Skip to content

tooling: deno fmt cannot verify packages/mcp — a deliberately malformed test fixture aborts config parsing #1618

Description

@rickylabs

Summary

deno fmt --check scoped to packages/mcp cannot produce a verdict. It aborts on a parse error
before evaluating any formatting, so the gate returns a failure that is indistinguishable from
"this package is unformatted" — and, worse, a passing run would be indistinguishable from
"the formatter never looked".

$ deno run --allow-read --allow-run .llm/tools/run-deno-fmt.ts --root packages/mcp --ext ts,tsx
{"command":"deno fmt --check","mode":"check","summary":{"filesSelected":115,"batches":1,"failedBatches":1,"findings":0,"ignoredFindings":0},"findings":[]}
1 deno fmt batch(es) failed without producing formatting findings.
This is a tooling/parse/permission failure, not a formatting difference.
error: Failed to parse "workspace" configuration.

Caused by:
    invalid type: string "packages/*", expected struct WorkspaceConfig
EXIT=1

Cause

packages/mcp/tests/fixtures/doctor/broken/deno.json sets "workspace" to a string:

{ "workspace": "packages/*" }

That is deliberate — it is the fixture for the doctor test that must see a malformed workspace
config. The defect is that deno fmt walks into the fixture tree and tries to parse it as real
configuration.

Confirmed pre-existing on origin/main (git cat-file -e origin/main:packages/mcp/tests/fixtures/doctor/broken/deno.json succeeds).
Not introduced by any in-flight PR.

Why this matters beyond the noise

The wrapper is honest about it — it prints "tooling/parse/permission failure, not a formatting
difference" and does not report false findings, which is good design. But the consequence is that
packages/mcp has no working scoped format gate, and any slice touching that package either
reports a red it did not cause or reports a green it did not earn. It was found because a slice's
formatting fix went uncommitted and the scoped wrapper could not reveal it; single-file
deno fmt --check caught it instead.

This is the same class as #1565 (a gate walking generated build output): a checker walking files
that are not its subject
. A fixture that is intentionally invalid is exactly the input a
configuration-parsing tool must not treat as configuration.

Options

  1. Exclude fixture trees from the formatter's config discovery — e.g. an exclude entry covering
    packages/*/tests/fixtures/** in the root deno.json fmt section, if that is enough to stop
    config parsing rather than only file selection.
  2. Have .llm/tools/run-deno-fmt.ts skip directories containing a fixture marker, mirroring the
    _site/git-ignore exclusion fix(docs): the snippet gate walks Lume's build output, so it fails on any checkout where the site has been built #1565 added to the snippet gate.
  3. Rename or relocate the broken fixture so it is not discoverable as an ancestor config, if the
    doctor test can construct it at runtime instead of checking it in.

Option 2 generalises best and lives in the same tool family as the #1565 fix; option 3 removes the
hazard entirely if the doctor test does not need the file on disk.

Acceptance

  • deno run --allow-read --allow-run .llm/tools/run-deno-fmt.ts --root packages/mcp --ext ts,tsx exits 0 on a clean tree, with failedBatches: 0.
  • The doctor test that depends on the malformed fixture still passes, and the fixture is still malformed in the way that test requires.
  • Negative control: introducing a real formatting error in a packages/mcp source file makes the scoped wrapper exit non-zero and report it as a formatting finding, not a parse failure. Raw exit shown.
  • Any other package carrying an intentionally-invalid config fixture is checked for the same blind spot, and the result recorded either way.

The last two rows matter most: today the gate cannot distinguish "clean" from "never ran", and that
is the property being fixed.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions