Stabilize report identity and root output #21

Closed
codex wants to merge 9 commits from codex/prewave-deterministic-contract into codex/prewave-hostile-input-safety
Collaborator

Canary Context Pack

Product story

Wave 1 golden output should lock a portable contract, not machine-specific paths or a schema name already identified as drift. This PR makes the report stable before goldens land.

What changed

  • Split report identity into schema: "fallow-ts.report" and schema_version: "0.1".
  • Changed root output from an absolute host path to ".".
  • Exported SCHEMA_VERSION.
  • Added a determinism canary asserting byte-identical JSON across repeated analysis.
  • Added test coverage that report output does not leak the fixture root path.
  • Updated README JSON example.

Why it changed

Issue #17 flagged absolute root paths as unreproducible and schema naming drift as harmful before Wave 1 golden tests. ADR 0003 records the schema direction; this PR implements it.

Files touched

  • src/types.ts
  • src/analyze.ts
  • src/index.ts
  • tests/analyze.test.mjs
  • tests/cli.test.mjs
  • README.md

Relevant context

  • Refs #17
  • ADR 0003 from PR #18
  • Stacked on PR #20 (codex/prewave-hostile-input-safety)

Runtime evidence

  • npm run build
  • npm test
  • node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json
  • git diff --check

Known constraints

This intentionally changes the bootstrap JSON shape before public golden files exist.

Explicit out-of-scope

  • Full schema documentation for Wave 1 #6.
  • Golden snapshot files for Wave 1 #5.
  • Any finding categories.

Requested decision

Approve and merge after PR #20.

Merge blockers

Machine-specific output, schema/version drift from ADR 0003, or nondeterministic JSON output.

## Canary Context Pack ### Product story Wave 1 golden output should lock a portable contract, not machine-specific paths or a schema name already identified as drift. This PR makes the report stable before goldens land. ### What changed - Split report identity into `schema: "fallow-ts.report"` and `schema_version: "0.1"`. - Changed `root` output from an absolute host path to `"."`. - Exported `SCHEMA_VERSION`. - Added a determinism canary asserting byte-identical JSON across repeated analysis. - Added test coverage that report output does not leak the fixture root path. - Updated README JSON example. ### Why it changed Issue #17 flagged absolute root paths as unreproducible and schema naming drift as harmful before Wave 1 golden tests. ADR 0003 records the schema direction; this PR implements it. ### Files touched - `src/types.ts` - `src/analyze.ts` - `src/index.ts` - `tests/analyze.test.mjs` - `tests/cli.test.mjs` - `README.md` ### Relevant context - Refs #17 - ADR 0003 from PR #18 - Stacked on PR #20 (`codex/prewave-hostile-input-safety`) ### Runtime evidence - `npm run build` - `npm test` - `node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json` - `git diff --check` ### Known constraints This intentionally changes the bootstrap JSON shape before public golden files exist. ### Explicit out-of-scope - Full schema documentation for Wave 1 #6. - Golden snapshot files for Wave 1 #5. - Any finding categories. ### Requested decision Approve and merge after PR #20. ### Merge blockers Machine-specific output, schema/version drift from ADR 0003, or nondeterministic JSON output.
Stabilize report identity and root output
Some checks failed
CI / test (push) Failing after 14s
CI / test (pull_request) Failing after 14s
17322458a2
Adopt the schema/schema_version split from ADR 0003, stop emitting machine-specific absolute root paths, and add a determinism canary before Wave 1 golden files land.

Refs #17.

Verified:

- npm run build

- npm test

- node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json

- git diff --check
Cover ESM, CommonJS, dynamic imports, side-effect imports, type imports, multiline imports, and re-exports with fixture-backed analyzer assertions.

Closes #2.

Verified:

- npm run build

- npm test

- git diff --check
Read root package.json fields needed for later graph work while keeping current analysis semantics unchanged and malformed metadata non-fatal.

Closes #3.

Verified:

- npm run build

- npm test

- git diff --check
Closes #4.

Verified:

- npm run build

- npm test

- node dist/cli.js analyze --root tests/fixtures/module-syntax --format json --output /tmp/fallow-ts-module-syntax.json

- git diff --check
Closes #5.

Verified:

- npm run build

- npm test

- node dist/cli.js analyze --root tests/fixtures/golden-basic --format json --output /tmp/fallow-ts-golden-basic.json

- cmp -s tests/golden/basic-report.json /tmp/fallow-ts-golden-basic.json

- git diff --check
Document v0 report contract
Some checks failed
CI / test (push) Failing after 13s
CI / test (pull_request) Failing after 13s
ff975d73cd
Closes #6.

Verified:

- npm run build

- npm test

- git diff --check
Reviewed-on: #22
Resolve relative internal imports
Some checks failed
CI / test (push) Failing after 14s
CI / test (pull_request) Failing after 13s
cfc49b356d
Closes #7.

Verified:

- npm run build

- npm test

- node dist/cli.js analyze --root . --format json --output /tmp/fallow-ts-report.json

- git diff --check
Reviewed-on: #23
codex closed this pull request 2026-05-17 01:17:25 +02:00
Some checks failed
CI / test (push) Failing after 15s
CI / test (pull_request) Failing after 13s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/fallow-ts!21
No description provided.