Skip to content

Test coverage gaps where a regression would go undetected (v0.11.0..main review) #284

Description

@thecodedrift

A pre-release review of v0.11.0..main turned up coverage gaps where a regression would not be caught. None is a defect today; each is a behaviour that could break silently. Filed as one issue because they share a shape, and are individually small.

Ordered by what would go undetected.

  • api/restore.ts:96-118 — five HTTP branches, zero coverage. 401 → unauthorized, fetch throws → unavailable, non-ok status → unavailable, response.json() throws → unavailable, and !Array.isArray(rules)unavailable. repair-integration.test.ts drives only the happy path. Flipping the 401 check or dropping the Array.isArray guard passes everything. Relatedly, plan.ts:129-135's unauthorized reconcile branch and plan.ts:139-148's materialize-failure catch are never forced to fire.

  • commands/verify.ts:127-176 — the tested/failed/refused split is never exercised on a mixed run. tested = results.length - refused.length, and both the human summary and --json ok derive from failed. Every existing test runs exactly one rule per invocation, so computing tested as results.length, or letting a refused rule leak into failed, passes today and misreports the moment a project has mixed rule kinds, which is the common case.

  • PlatformBinaryResolution.source — new, documented as load-bearing, no assertions. platform-binary.ts:157-230 states that only source === "platform-package" entitles a caller to treat the binary as pinned. No test in platform-binary.test.ts reads .source on any resolution. A regression always reporting "platform-package" passes.

  • PurgeIncompleteError's repair-path message is tested on the wrong side of the seam. plan.ts:170-181,280-289 formats plural/singular messages for a restore that wrote the rule but left a stale file. deliver.test.ts proves the throw in isolation; repair-integration.test.ts only covers the successful purge. Garbled wording, a dropped entry, or a miscount all pass.

  • The interactive wizard's reload notice is untested where init's is tested. wizard/index.ts:91 added the same getReloadNotice wiring as commands/init.ts:291, but only init got a test, whose own comment names the risk: "a dropped console.log or swapped field leaves every unit test green".

  • asMatchMode's strongest claim is untested. engine-dispatch.test.ts's REFUSALS table has no case for an unimplemented match: value, and "must not be coerced" is the file's central assertion.

  • REFERENCE_VERSION is a bare literal. rules/reference.ts:45, asserted only as toBe(2). Nothing ties a change in Reference/ReferenceRule/ReferenceTests/ReferenceLayout shape to bumping it, which is the mistake CLAUDE.md documents from the v1→v2 work. A structural fingerprint asserted beside the version would close it.

  • Migration 0006's test cannot fail on it. migrate-install.test.ts:184-206 seeds every start version with a bare taskless.json and no pre-existing README, so 0006's rewrite has nothing stale to act on and the test reads only the final version counter. Real coverage lives in installed-documentation.test.ts:57-87. Recording it so the migrate test is not later mistaken for 0006 coverage.

  • test/migrated-envelope.test.ts:39 parses stdout.trim().split("\n").at(-1). A helper that takes the last line cannot detect anything printed before it, which is how init --json writes prose to stdout, so the envelope cannot be parsed #279 stayed invisible. Worth fixing with that issue.

Well covered, verified by reading the tests

Runtime rule discovery refusals, the fixture-execution harness (including its "reports success having examined nothing" witness test), constraints.ts closed-list self-check, the demo command end to end with mutation-tested fixtures, reference corpus structural integrity and its drift check against the committed asset, schemas-export.test.ts asserting built output rather than a hand fixture, and no-implicit-migration.test.ts. prompts.test.ts was re-checked against the styleguide rule it once violated and now defers the built-graph question to the vite plugin, which is the correct shape.

Found in a pre-release review of v0.11.0..main.

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

    Labels

    AI friendlyWell defined bugs suitable for a PR from an AgentCLIRelated to the taskless CLIbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions