Repository navigation
fix(evals): enforce canonical promise ledger format - #199
Conversation
|
Verdict: FAIL Round 1 swarm at this head: gates + live + merge simulation (sonnet@high), consumer-parity review and data-safety review (opus@xhigh each; work model sonnet@high). Gates: PASS (lint 6/6 incl. the new canonical-form step; audit 0 problems; only the known host NativeGit errors). Live: Fix-forward (in scope, the new
Notes (no change needed): |
|
Verdict: PASS+NOTES Round 2 swarm at this head: gates + live on temp ledger copies + merge simulation (sonnet@high), fix review and integration review against main af9e849 (opus@xhigh each; work model sonnet@high). Gates: lint 6/6, audit with Notes (follow-ups, not blocking):
|
Adds ledger.py format and format --check, rewrites ledger.json with sorted keys, and runs the check in the lint tier. Two branches that add different entries now merge without a conflict, because entries land at their sorted place instead of the end of a section.
The promise said 23 principle links and omitted principle-explain-the-number as an owner. A new static test asserts the owners equal the keys of PRINCIPLE_RULES.
92523a4 to
b037a0e
Compare
What Changed
--checkmode, and duplicate-key rejection.ledger.json, enforce canonical form in CI and local lint gates, and document the formatting workflow with regression coverage.principle-explain-the-number, and check its owners and count against the pinned rules.Validation
Risk Assessment
✅ Low: The ledger.json change is a pure key reorder. A semantic diff against the base shows the only value changes are the intended principle-leaf-summaries-match fix: the claim goes from 23 to 24, and principle-explain-the-number is added to owners, matching the 24 PRINCIPLE_RULES keys. The format command meets each round-1 requirement: it encodes before opening a file, writes a mkstemp file in the same directory, applies copymode, then os.replace. Duplicate keys are rejected in the shared load/parse path. Red tests cover the surrogate, duplicate-key and CRLF cases. The check is wired into gate-check.sh lint and lint.yml.
Testing
Targeted tests and real CLI scenarios passed, including malformed-input preservation and interrupted-write recovery. Drift diagnostics produced the expected failures on altered disposable data, but were not validated live. Evidence was retained and temporary files removed; lint and CI phases were left to the outer executor.
Evidence: Ledger CLI transcript and drift diagnostics
Evidence: Disposable validation driver
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
TMPDIR="$PWD/.ledger-validation/tmp" PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=evals/promises python3 -m unittest -v test_ledger.CanonicalFormTest test_static.TestStaticPromises.test_principle_promise_owners_are_the_pinned_leavesPYTHONDONTWRITEBYTECODE=1 python3 .ledger-validation/drive.py: real CLI formatting, checks, audit, owners, duplicate-key rejection, surrogate preservation, SIGKILL interruption, and retryExecuted the targeted principle-owner test against disposable ledger copies with a missing owner and an incorrect principle count.Saved the CLI transcript and reproducer, removed disposable files, and confirmedgit status --shortwas empty.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.