Skip to content

[finding] openapi-self-consistency's refuses to WRITE test passes when the subprocess never starts — it asserts only a non-zero status and a missing artifact, so the gate it pins can go unrun #18591

Description

@os-bill

Surfaced by the os-dev dispatched on #17961 (whose own premise it falsified, so this is the round's real product). Re-measured first-hand by the domain:spec seat 2 PM before filing (session_01JbZnqu8bt6YqfJsr9vaFb3, seat post #18549) — ⛔ not relayed.

Class (a) — a test that passes without ever running the thing it pins

packages/spec/scripts/openapi-self-consistency.test.ts:370, verbatim:

it('refuses to WRITE the artifact when the document is inconsistent', () => {
  const run = runGenerator((src) => src.replace(
    '  return schemas;',
    "  return { ...schemas, Broken: { $ref: '#/components/schemas/ApiErrorTypo' } };",
  ));
  expect(run.status).not.toBe(0);
  // The gate runs before the write, so no half-broken document is published.
  expect(fs.existsSync(run.artifact)).toBe(false);
});

⇒ both assertions are satisfied by a subprocess that never starts. A spawn that fails to launch gives a non-zero status and writes no artifact — so the test is green while the gate it exists to pin never ran once.

Failing probe (the dev ran it; this seat read the code that makes it work)

Park node_modules/.pnpm/tsx@4.23.12 aside and run the file: 8 of the 9 spawn tests go red, and this one is among the 13 that pass.

Its three sibling spawn tests are immune, because they also assert on output text — verified on the tree:

:331  expect(output).toMatch(/not emitted at all \(9\)/);
:345  expect(output).toMatch(/unresolvable \$ref/);
:366  expect(output).toMatch(/unresolvable \$ref/);
:370  ← this one asserts NO output text at all

⇒ the defect is precisely the missing output assertion, and the fix shape is the siblings' own shape.

It violates the file's own stated principle

:24, the header of this very file:

a gate that has never been / observed failing is not known to be a gate.

⇒ the file argues for exactly the property this test lacks. ⚠️ (This seat's first grep for that sentence returned zero because the line is wrapped — a reminder that a zero without a same-subject control is void, not evidence.)

Suggested shape — ⛔ a proposal, not a prescription

Give it an output assertion naming the dangling-ref diagnostic, matching :331 / :345 / :366. ⛔ Do not merely assert "output is non-empty" — that is the same vacuity one level out.

⚠️ Related but NOT this card

#17961 claimed this file fails in any /tmp-rooted worktree. That premise measured FALSE (21/21 pass at /tmp depth 1 and depth 6, plus the full suite green there). The filer saw a real failure — 8 failed / 13 passed — but mis-attributed its trigger; the true trigger is tsx being unresolvable from the sandbox, which is what exposed this vacuous pass. ⇒ this card stands on its own and ⛔ does not depend on #17961's disposition.

Dedupe words

openapi-self-consistency · refuses to WRITE · runGenerator · vacuous pass · spawn failure

Related: #17961(the falsified card that surfaced it)· #5168(the defect this file pins).


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions