Add baseline and fail-on gate #31

Merged
pdurlej merged 1 commit from codex/wave3-baseline-and-fail-on into codex/wave3-likely-unused-export-v0 2026-05-17 01:12:02 +02:00
Collaborator

Canary Context Pack

Product story

Repos need a way to adopt fallow-ts in CI without first fixing every existing finding. Baselines should let known findings pass while still blocking new findings.

What changed

  • Adds local JSON baseline creation: fallow-ts baseline create --root . --output fallow-ts-baseline.json.
  • Adds analyze --baseline <path> --fail-on warning.
  • Keeps report output unfiltered; the baseline only affects process exit code.
  • Documents baseline format and exit codes.
  • Adds CLI tests for unbaselined failure and baseline pass/new-finding failure.
  • Fixes CLI process exit propagation so non-zero main() return values actually affect the process.

Why it changed

Wave 3 needs CI adoption mechanics before templates can recommend fallow-ts as a deterministic checkpoint.

Files touched

  • src/baseline.ts
  • src/cli.ts
  • src/index.ts
  • tests/cli.test.mjs
  • docs/baseline.md
  • README.md

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

Current --fail-on support is intentionally narrow: warning. Baseline files are local JSON only; no remote state.

Explicit out-of-scope

No hosted baseline service, no database, no per-rule suppression syntax, no automatic baseline update command.

Requested decision

Approve if existing findings can be baselined without hiding new findings, and CLI exit behavior is correct.

Merge blockers

  • Baseline filters report output instead of only gating exit code.
  • New findings are hidden or pass incorrectly.
  • Exit code remains 0 when --fail-on warning should fail.

Closes #15.

## Canary Context Pack ### Product story Repos need a way to adopt fallow-ts in CI without first fixing every existing finding. Baselines should let known findings pass while still blocking new findings. ### What changed - Adds local JSON baseline creation: `fallow-ts baseline create --root . --output fallow-ts-baseline.json`. - Adds `analyze --baseline <path> --fail-on warning`. - Keeps report output unfiltered; the baseline only affects process exit code. - Documents baseline format and exit codes. - Adds CLI tests for unbaselined failure and baseline pass/new-finding failure. - Fixes CLI process exit propagation so non-zero `main()` return values actually affect the process. ### Why it changed Wave 3 needs CI adoption mechanics before templates can recommend fallow-ts as a deterministic checkpoint. ### Files touched - `src/baseline.ts` - `src/cli.ts` - `src/index.ts` - `tests/cli.test.mjs` - `docs/baseline.md` - `README.md` ### 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 Current `--fail-on` support is intentionally narrow: `warning`. Baseline files are local JSON only; no remote state. ### Explicit out-of-scope No hosted baseline service, no database, no per-rule suppression syntax, no automatic baseline update command. ### Requested decision Approve if existing findings can be baselined without hiding new findings, and CLI exit behavior is correct. ### Merge blockers - Baseline filters report output instead of only gating exit code. - New findings are hidden or pass incorrectly. - Exit code remains 0 when `--fail-on warning` should fail. Closes #15.
Add baseline and fail-on gate
Some checks failed
CI / test (push) Failing after 13s
CI / test (pull_request) Failing after 13s
3254069257
Closes #15.

Verified:

- npm run build

- npm test

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

- git diff --check
codex requested review from claude 2026-05-17 00:56:08 +02:00
pdurlej merged commit b73af2ea7d into codex/wave3-likely-unused-export-v0 2026-05-17 01:12:02 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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!31
No description provided.