Forge-cli v1 Sprint 7: parity harness, exit-code matrix, fixture lint#398
Merged
Conversation
…re lint - Add cross-provider parity harness driving dry-run for every atom + pr.deliver and asserting schema literal, ok flag, data.provider, and warnings field shape match between github and gitlab backends. - Add full exit-code matrix exercising every documented sysexits exit constant and every Lock-down policy error.kind; constants come from nils_common::cli_contract::exit so a future re-number is caught. - Add forge-cli-fixture-lint.sh (wired into the docs-only entrypoint) that greps the fixture tree for token-shaped strings; planted-token regression test pins the lint's behaviour on both pass and fail paths.
…complete - Update Task 7.1 / 7.2 / 7.3 to completed with branch-level evidence and refresh the session log; Sprint 8 (wrapper + brew + nils-cli minor bump) is the final v1 milestone.
CoverageTotal line coverage: 85.42% (75409/88276 lines hit). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sprint 7 of the forge-cli v1 plan locks the contract behind tests: a cross-provider parity harness, the full exit-code matrix, and a fixture redaction lint wired into the docs-only entrypoint. After this PR merges, only Sprint 8 (wrapper + Homebrew tap + nils-cli minor bump) remains.
Changes
crates/forge-cli/tests/integration/parity.rs(new) — driver iterates an 11-row parity matrix and asserts four cross-provider envelope invariants per row: schema literal matches,ok=trueon both,data.providerdiffers only at the documented field, andwarningsstays empty/omitted. Coversrepo view,pr checks,pr wait-checks,pr merge, every issue atom, andpr deliver. Plus one negative-control test that pins the harness's own schema-mismatch detection.crates/forge-cli/tests/integration/exit_codes_full.rs(new) — 12 tests covering every row in spec §"Exit code map" plus everyerror.kindrow in spec §"Lock-down policy". Each test references the constant name fromnils_common::cli_contract::exit, never the numeric value, so a sysexits re-number is caught instead of drifting silently. Abinary_only_emits_documented_exit_constantsinvariant pins the six-constant set.scripts/ci/forge-cli-fixture-lint.sh(new) — grep-based lint refusing any ofgh{ps,r,o}_<base62>,glpat-<base62>, orBearer <opaque>matches undercrates/forge-cli/tests/fixtures/. Wired into.agents/skills/nils-cli-verify-required-checks/scripts/nils-cli-verify-required-checks.shso the docs-only lane catches un-redacted fixtures before merge.crates/forge-cli/tests/integration/fixture_lint.rs(new) — planted-token regression test that writes a syntheticghp_<20-byte>string into a tempdir, runs the lint against that root, and asserts non-zero exit + filename + offending match in stderr. Companionfixture_lint_passes_on_clean_tempdirtest pins the success path.crates/forge-cli/tests/fixtures/README.md(new) — documents the redaction policy and pattern table, plus the negative regression test's behaviour.docs/plans/forge-cli/forge-cli-execution-state.mdrecords Tasks 7.1 + 7.2 + 7.3 with branch-level evidence.Test-First Evidence
cargo test -p nils-forge-cli— 219 lib + 89 integration green (was 219 + 70 at end of Sprint 6).cargo clippy -p nils-forge-cli --all-targets -- -D warnings— clean.bash scripts/ci/forge-cli-fixture-lint.sh --strict— pass (18 files scanned, 0 matches).bash scripts/ci/cli-output-contract-lint.sh— pass.Testing
cargo test -p nils-forge-cli(308 total).cargo clippy -p nils-forge-cli --all-targets -- -D warnings.bash scripts/ci/forge-cli-fixture-lint.sh --strict.Risk / Notes