Skip to content

Preflight parts follow-ups: Windows drive-letter test ranking, semicolon-free import parse, and 9 minors #467

Backlog

Description

@stackbilt-admin

Minor findings from the approving adversarial reviews of #462 (#440), #463 (#441), #465 (#444), #466 (#445) and #464 (#459). None blocked a merge. The first two give a confident wrong answer rather than unknown, so they were fixed in the integration that wired these parts into the preflight answer (PR #468). Items 3-13 are still open.

Done in PR #468

  1. Rank first-test candidates by direct symbol evidence, not import distance #444 test-rank.ts:199: a lowercase Windows drive letter finds no tests. rankFirstTests with c:/.../packages/adf/src/manifest.ts returns 0 candidates and unknown: "evidence ran out". path.resolve keeps c:, but the graph keys use C:. Normalise seeds through the same canonical-path routine as relativizeFilePath (feat(cli): route adf context --files modules from path tokens #452).
  2. Detect when a file's behaviour is pinned by a contract test, and say what a change means for semver #445 contract-pins.ts:134: in semicolon-free code an export type can swallow a later value import. extractImports("export type Foo = {\n a: number\n}\nimport { x } from './x'\n") reports ./x as type-only, so a pinned file comes back pinned: false. Anchor the import regex per statement, or tokenise.

Others

  1. Rank first-test candidates by direct symbol evidence, not import distance #444 test-rank.ts:318: a wrong reason when symbols is restricted. With symbols: ['resolveModules'] (or an unknown name, which is dropped without a message), manifest.test.ts reads "imports manifest.ts directly but none of its exported symbols", yet it calls parseManifest. Report unknown requested symbols, and word the reason relative to the requested set.
  2. Rank first-test candidates by direct symbol evidence, not import distance #444 test-rank.ts:78: same-named symbols reached through the barrel. packages/cli/src/index.ts (86 importers) connects almost everything within SYMBOL_REACH=8, so a seed exporting a common name (run, format, parse) can pick up false symbol-tier hits.
  3. Detect when a file's behaviour is pinned by a contract test, and say what a change means for semver #445 contract-pins.ts:292: surfaces are per test file, not per pinned file. index.ts is pinned only through EXIT_CODE, yet it inherits --format json.
  4. Detect when a file's behaviour is pinned by a contract test, and say what a change means for semver #445 contract-pins.ts:264: input casing kept on Windows. PACKAGES/cli/... returns file: "PACKAGES/cli/..." rather than the canonical casing.
  5. getProjectState reports 'All constraints pass' while live evidence fails #441 project-state.ts:60: an unreadable METRICS source fails the whole call. A source that is a directory throws EISDIR, and getProjectState returns isError, where before it returned the static validation. It should be labelled measured: false with the reason.
  6. getProjectState reports 'All constraints pass' while live evidence fails #441 project-state.ts:56 vs adf-evidence.ts:74: a non-default --ai-dir measures different files. getProjectState resolves METRICS paths from the .ai/ parent, while adf evidence --auto-measure resolves them against the cwd. With sub/.ai run from the root, the two can disagree. Use one resolver (as Preflight follow-ups: task-only Binds, nested .ai/, MSYS paths, new files from subdirectories #460 item 2 also needs).
  7. context-refresh --once and charter_context serve a stale snapshot as fresh after a branch, HEAD or working-tree change #440 context-refresh.ts:463: a refresh from a subdirectory invalidates the root snapshot. --ai-dir defaults to cwd-relative .ai, so <sub>/.ai/context.snapshot.json counts as dirty for the root. The effect is extra refreshes, never a stale answer.
  8. context-refresh --once and charter_context serve a stale snapshot as fresh after a branch, HEAD or working-tree change #440 git-fingerprint.ts:268: serve's own runtime paths aren't ignored. With a different --config or cwd from the refresh, serve's telemetry writes make charter_context report stale: true. This is a false positive only.
  9. smart-commit.sh can't set a message or trailers, so core.adf's commit rule is unfollowable #459 smart-commit.sh:96: the message-file exclusion isn't fully path-proof. It misses a file name typed in a different case, and a path through a directory junction (Windows). The case is caught for directories, not for the file name. With --merge, a tracked and modified message file is still committed (documented).
  10. PR feat(cli): fill Contract, Run first and Fresh in the preflight answer (#447) #468 adf-preflight.ts:243: the "nothing binds" answer is slower. Contract pins are needed to decide binds, but git status isn't, and it now runs first. ci.yml went from a median of about 290 ms to 430 ms. Read freshness only once something binds.
  11. PR feat(cli): fill Contract, Run first and Fresh in the preflight answer (#447) #468 tests and reasons. The two-answer ci.yml test in adf-preflight.test.ts still has the 5 s default timeout. Its "under 1 s" test asserts elapsed < 3000, so the title and the check disagree. In test-rank.ts, type-only imports count as symbol evidence, and the import itself is counted (import { foo } plus foo() gave "calls foo (3)").

Part of #437 · Refs #447, #460

Activity

  1. added
    bug
    priority:p1
    epic:preflight
    on Nov 28, 2026
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

    bugepic:preflightpriority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions