Repository navigation
ci(spec): spec-quote drift checking in CI + vacuous-pass fix + drift repair - #357
Amperstrand wants to merge 1 commit into
Conversation
|
Findings from review + verification:
E2E cloud-lab run for this head is in flight; results will follow. (CI-only change, so the run is a regression formality — the value here is the drift gate itself.) |
|
Thanks — drift checking in CI is the right call, and the
No E2E run for this PR — CI workflow + source comments only, no web/portal/UI surface touched. |
|
E2E results: deployed head
Regression formality as noted — this PR is CI-only. One incidental: while wiring artifacts for these runs we confirmed the drift gate this PR adds would have caught the current go.mod drift on main (being fixed by #361's cleanup). |
…markers - contract-lint job now installs greatspectations, clones cashubtc/nuts HEAD, and runs the check over all non-test sources — DRIFT FAILS THE BUILD (exit-code semantics verified: drifted quote exit 1, clean 0) - critical invocation fix: --comment-start must be "// " (trailing space) — with "//" the marker never matches and the check passes vacuously. make/speccheck.sh (new on this branch; supersedes the version in open OpenTollGate#354 which carries the vacuous-pass bug) documents this in a comment - fixed the one genuinely drifted quote: NUT-03 swap (spec now writes `Proofs` with backticks); 9/9 quotes verified against current spec - added NUT-05 melt-quote at GonutsWallet.Melt (OpenTollGate#299 site) - repaired two comment lines that parsed as malformed markers and aborted whole-repo runs (merchant.go dedup pointer, port.go doc comment)
88eb163 to
5b8efc9
Compare
felixfelix-bot
left a comment
There was a problem hiding this comment.
Re-review of current head 5b8efc9b (force-pushed 2026-08-30). The prior review's findings are still live on this head, and the branch is now conflicting with main.
Blocking
make/speccheck.sh:22-23still re-introduces the vacuous pass this PR exists to fix.greatspectate check ... || truefollowed by unconditionalexit 0means the local entry point can never fail — spec drift, a brokenspecquotes.toml, a CLI/flag change, or a regression of the--comment-startmarker all report identical success. The CI step fails the build but the local script is a rubber stamp; the two will silently diverge the first time the tool errors instead of drifting. Distinguish outcomes: let tool/config/usage errors exit non-zero (drop|| true, or branch on the exit code); if local drift must stay non-fatal, keepexit 0only for the drift-found path with a loudSPEC DRIFT DETECTEDbanner.
Conflict (must resolve before merge)
make/speccheck.shconflicts with main. main merged #354 which added its ownmake/speccheck.sh(usesspectate,--comment-start '//', plus aspectate coveragestep). This PR's version supersedes that copy (correct--comment-start "// "), but the branch needs a rebase/merge to resolve. Note main's version carries the exact vacuous-pass bug this PR fixes — after resolving, keep this PR's corrected invocation and consider folding in thecoveragestep.
Non-blocking (still live)
- [RISK] Unpinned upstream deps —
test.yml:62pip-installs greatspectations at HEAD and:64clones cashubtc/nuts at HEAD. Any upstream change flips CI red on an untouched commit. Consider pinning to commit SHAs with a scheduled bump job. - [NIT] NUT-05 quote anchored to wrong function —
gonuts_wallet.go:160places the melt-quote-request quote aboveMelt()(:161, which executes a quote) instead ofRequestMeltQuote(:156). Move it to the request site. - [NIT] Silenced install output — both install attempts discard stderr; when both fail the only symptom is
greatspectate: command not found. Let the fallback's stderr through.
CI
No CI runs exist for the current head 5b8efc9b (last branch run was on 88eb1638, 2026-08-23). After resolving the conflict, a fresh push is needed to get CI on the final head.
Cannot merge in this state (conflicting + blocking finding unaddressed).
… fixes) (#376) * fix(spec): fix drifted NUT-03 quote, malformed markers, NUT-05 comment placement - NUT-03 swap quote: 'generate new Proofs' -> 'generate new `Proofs`' (spec added backticks; the one genuinely drifted quote found by review) - NUT-05 melt quote added at GonutsWallet.RequestMeltQuote (per reviewer feedback: above the request-method, not above Melt()) - merchant.go: reword 'NUT-00' marker prefix to 'Spec (NUT 00)' so it doesn't parse as a malformed quote marker - port.go: reword 'NUT-04 spec' to 'spec (NUT 04)' for the same reason - CHANGELOG: note spec-quote drift checking entry superseding #357 - .gitignore: add *.cov to exclude greatspectate coverage artifacts * ci(spec): wire spec-quote drift check with vacuous-pass fix + coverage step - Contract-lint job: new 'Spec-quote drift check' step that installs greatspectations, clones cashubtc/nuts, and verifies all NUT spec quotes in source comments against spec — drift fails the build. - make/speccheck.sh: supports both local drift-report mode and CI fail mode. Vacuous-pass fix: tool/config/usage errors (exit 2+) propagate non-zero; exit 0 only for clean runs or drift-only (exit 1, loud banner). Coverage step folded in from main's #354 but corrected for the real greatspectate CLI (--coverage=FILE). - Correct command name: greatspectations installs 'greatspectate' as its only console script (no 'spectate'). Both CI and local scripts use the correct name. - Correct --comment-start '// ' (trailing space) — without the trailing space the checker passes vacuously (matches nothing). - Pinned deps: greatspectations at SHA 0f226495 with scheduled-bump comment; cashubtc/nuts at SHA 49a909c in CI for reproducibility. - No silenced pip output (install logs visible). --------- Co-authored-by: Felix <301398501+felixfelix-bot@users.noreply.github.com>
|
Status: superseded by #376 — no merge needed, conflicts are now a no-op. I investigated the conflicts on this PR ( What #376 carried forward (all reviewer-corrected):
After resolving all three conflicts against current Recommendation: close this PR as superseded by #376. Nothing is lost — the branch is preserved and all unique content landed (in corrected form) via #376. cc @Amperstrand — thanks for the original; your contribution is in, just via the reviewed copy. |
|
Marking this superseded by #376 (clean copy with reviewer fixes, merged as |
|
Closing as superseded by #376 (already merged to main as 3fa8336). Every change in this PR already landed, in corrected form, via #376:
The two remaining conflicts vs current main (test.yml, CHANGELOG.md, make/speccheck.sh) are all cases where main's #376 version is the reviewed+improved one. Merging this PR would regress those to the unpinned originals and re-add a misplaced duplicate NUT-05 quote. Nothing is lost — branch preserved at 5b8efc9. Thanks @Amperstrand — the contribution is in via the reviewed copy #376. |
…ith reviewer fixes) (OpenTollGate#376) * fix(spec): fix drifted NUT-03 quote, malformed markers, NUT-05 comment placement - NUT-03 swap quote: 'generate new Proofs' -> 'generate new `Proofs`' (spec added backticks; the one genuinely drifted quote found by review) - NUT-05 melt quote added at GonutsWallet.RequestMeltQuote (per reviewer feedback: above the request-method, not above Melt()) - merchant.go: reword 'NUT-00' marker prefix to 'Spec (NUT 00)' so it doesn't parse as a malformed quote marker - port.go: reword 'NUT-04 spec' to 'spec (NUT 04)' for the same reason - CHANGELOG: note spec-quote drift checking entry superseding OpenTollGate#357 - .gitignore: add *.cov to exclude greatspectate coverage artifacts * ci(spec): wire spec-quote drift check with vacuous-pass fix + coverage step - Contract-lint job: new 'Spec-quote drift check' step that installs greatspectations, clones cashubtc/nuts, and verifies all NUT spec quotes in source comments against spec — drift fails the build. - make/speccheck.sh: supports both local drift-report mode and CI fail mode. Vacuous-pass fix: tool/config/usage errors (exit 2+) propagate non-zero; exit 0 only for clean runs or drift-only (exit 1, loud banner). Coverage step folded in from main's OpenTollGate#354 but corrected for the real greatspectate CLI (--coverage=FILE). - Correct command name: greatspectations installs 'greatspectate' as its only console script (no 'spectate'). Both CI and local scripts use the correct name. - Correct --comment-start '// ' (trailing space) — without the trailing space the checker passes vacuously (matches nothing). - Pinned deps: greatspectations at SHA 0f226495 with scheduled-bump comment; cashubtc/nuts at SHA 49a909c in CI for reproducibility. - No silenced pip output (install logs visible). --------- Co-authored-by: Felix <301398501+felixfelix-bot@users.noreply.github.com>
Wires the greatspectations quote set into CI as a drift-blocking check — and fixes two real problems found while doing it.
Found while wiring
--comment-start "//"(no trailing space) matches zero quotes — the markerNUTnever follows the comment start, so the check exits 0 having verified nothing."/ "is required. Themake/speccheck.shcarried by open feat: token recovery tool + AI audit prompts + speccheck (rebased onto main) #354 has exactly this bug: it passes vacuously. This PR ships a corrected script (with the trap documented in a comment) and supersedes that copy — worth folding into feat: token recovery tool + AI audit prompts + speccheck (rebased onto main) #354 or dropping theirs.`Proofs`with backticks ("generate new Proofs" → "generate new`Proofs`"). Updated; 9/9 quotes now verify verbatim against current spec.// NUT-00 .../// NUT-04 spec...(a dedup pointer from chore: add NUT spec quotes (greatspectations Layer 1) #327 and a doc note from feat(tollwallet): WalletPort interface + GonutsWallet adapter + token flow tests #299) parse as broken quote markers — one syntax error makes the tool return empty results. Rephrased both.What this adds
GonutsWallet.Melt(the feat(tollwallet): WalletPort interface + GonutsWallet adapter + token flow tests #299 site) — the quote set now covers NUT-00/03/04/05 at their construction sites.make/speccheck.sh(correct version) for local runs: exit 0 always, prints the drift report.Verification
greatspectate checkover 56 source files: 9/9 quotes pass, 0 syntax errors against nuts @734f60e(current HEAD)