feat(loop-readiness): add fail-closed LC-01 loop readiness gate - #38
Open
creayma-del wants to merge 2 commits into
Open
feat(loop-readiness): add fail-closed LC-01 loop readiness gate#38creayma-del wants to merge 2 commits into
creayma-del wants to merge 2 commits into
Conversation
Implement roadmap LC-01: a versioned readiness contract (v1, 14 capabilities x 5 levels) plus a pure evaluator and CLI that decide whether a caller-declared capability assessment allows a loop run level. The gate never probes hosts, network, or workspace; absent required capabilities report `unavailable` and prevent the level, and any input the assessment contract rejects (unknown id/state/field, duplicate observation, empty evidence, unsupported version, malformed JSON) exits 1 without ever producing a decision. Exit codes: 0 allowed, 2 prevented, 1 invalid input. Wire a `loop` command group (audience advanced) with a `readiness` subcommand into the better-harness CLI registry and root help, add `references/loop-engineering/readiness-gate.md` to the doc routing graph, and regenerate the frozen CLI baselines that pin root help and inventory/schema hashes. Spec: docs/specs/2026-07-31-lc01-loop-readiness-gate.md (reviewed in three acceptance rounds; all P1/P2/P3 findings resolved). Validated with test/loop-readiness.test.mjs (25 tests: contract shape, allowed/ prevented envelopes, invalid-input matrix, import allowlist with obfuscation defenses, empty-tmpdir spawn, facade byte parity) and the full suite `npm test` at 1048/1048, plus mutation checks proving the no-arg and allowlist guards fail when their implementation is removed. Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
Record the new `better-harness loop readiness` fail-closed gate in the Unreleased Added section so the user-facing CLI addition from the LC-01 spec is covered by the changelog checklist on PR QoderAI#38. Validated with the full suite `npm test`. Co-authored-by: QoderAI (Qwen 3.8 Max) <qoder_ai@qoder.com>
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
Adds the LC-01 fail-closed loop runtime readiness gate: a versioned readiness contract (v1, 14 capabilities x 5 levels), a pure evaluator, and a
better-harness loop readinessCLI that decides whether a caller-declared capability assessment allows a proposed loop run level. The gate never probes hosts, network, or the workspace; absent required capabilities reportunavailableand prevent the level, and any input the assessment contract rejects exits 1 without ever producing a decision (exit codes: 0 allowed, 2 prevented, 1 invalid input).Why
Traceability and Scope
docs/specs/2026-07-31-lc01-loop-readiness-gate.md(Status: Implemented; reviewed through an expert spec review plus three acceptance rounds — all P1/P2/P3 findings resolved in-spec and in-code).scripts/loop-readiness/(contract, evaluator, CLI); new referencereferences/loop-engineering/readiness-gate.md.Change Type
Test and Review Evidence
node --test test/loop-readiness.test.mjsnpm testnode --test test/scripts-refactor-contract.test.mjsloopgroup only)node --test test/doc-link-graph.test.mjsimport "node:os";each turn exactly one guard test red; both restored cleanManual or visual evidence: smoke runs —
loop readiness --level scheduled-bounded-apply --assessment mixed-partial-failed.jsonexits 2 listing 9 blocking capabilities;--level bogus --jsonexits 1 with theloop-readiness-errorenvelope; facade output verified byte-identical to direct invocation.Risk and Recovery
readFileSync.commands --json/ OpenCLIschemaoutput gains theloopgroup; frozen baselines (root-help.txt, two sha256 hashes) regenerated to match, diff limited to the new group.AI Involvement
Checklist
AGENTS.md,CONTRIBUTING.md, and the relevant canonical-owner guidance.CHANGELOG.md.