fix(#375): make the Parity Gate check all four targets, and correct what it finds - #391
Merged
Merged
Conversation
…hat it finds
The gate has been red on main every day since at least 2026-08-23 with three of its
four targets never running:
[percolator-prog] cargo run failed: error: failed to get `percolator` as a
dependency of package `percolator-prog`
[percolator-stake] cargo run failed
[percolator-nft] cargo run failed <- fixed earlier
[percolator-match] parity OK
A permanently red gate is an ignored gate, so ABI drift in prog and stake had no
detection at all. This is the SDK half; the two fixture binaries are in
percolator-prog and percolator-stake.
WORKFLOW
Checks out the `percolator` engine, which percolator-prog compiles through
`path = "../percolator"`. Without it the prog fixture cannot build regardless of
whether it exists. Deliberately unpinned, for the same reason percolator-prog's own
ci.yml leaves it unpinned: the engine is compiled INTO the wrapper, so its main is
what the wrapper ships.
WHAT THE GATE FOUND, ONCE IT COULD RUN
specs/wrapper-tags.json was missing twelve live instructions (tags 81-92), seven of
which move money — WithdrawProtocolFee(84), WithdrawInsuranceReserveToStake(87),
WithdrawCreatorFee(90), RebalanceLpVaultBacking(91), plus the fee-split and
protocol-fee-authority setters. Gaps, names and every other tag already agreed.
specs/stake-parity.json understated percolator-stake by fifteen: tags 5-9 were
listed in `removed_tags` — asserting they were GONE — and tags 19-28 were simply
absent. All fifteen are live at 474079f, d0c6ecb and main alike. The layout half
was already correct; all ten offsets and reserved_start come back byte-identical,
which is independent evidence the new fixtures are faithful.
SDK CHANGES BEYOND THE SPECS
* IX_TAG gains CancelRedemption(81) and UnwrapEscrowedPortfolio(82), the only two
v17 wrapper instructions with no entry. Both tags were represented solely by
deprecated v12 names annotated "Not in v17", which was false; those two
annotations are corrected to the COLLIDES wording the file already uses for the
same situation at 73/74/75/78/79/80/85/90.
* test/parity-fixtures.test.ts had hand-curated maps that agreed with the stale
specs and disagreed with both programs — including a literal
`expect(fixture.removed_tags).toEqual([5, 6, 7, 8, 9, 11, 17])`. STAKE_IX
already carried all fifteen stake tags; only the spec and this subset were
wrong, and they corroborated each other. Now [11, 17].
This is the third instance today of an assurance nobody could verify: a check, a
spec and a test agreeing with one another while the program disagreed with all
three.
VERIFIED
pnpm test 33 files, 1034 passed, 0 failed
npx tsc --noEmit clean
negative control WithdrawProtocolFee 84 -> 85 in the spec fails with
"WithdrawProtocolFee tag mismatch: expected 84 to be 85";
restoring goes green. The gate is not vacuous.
byte-equality both new fixtures reproduce their committed spec exactly,
which is precisely what check-parity-fixtures.mjs asserts.
Land the two fixture PRs first. In between, the gate reports DRIFT instead of
`cargo run failed` — already a better failure.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Part 3 of 3 for #375. The SDK half: the workflow fix, the corrected specs, and the two SDK gaps the gate exposed once it could actually run.
The state this fixes
The gate has been red on
mainevery day since at least 2026-08-23, with three of four targets never running:A permanently red gate is an ignored gate. ABI drift in prog and stake had no detection at all.
Workflow
Checks out the
percolatorengine, whichpercolator-progcompiles throughpath = "../percolator". Without it the prog fixture cannot build regardless of whether it exists — that was the second of prog's two failure causes.Deliberately unpinned, for the reason percolator-prog's own
ci.ymlgives for leaving the engine unpinned while pinning the sibling programs: the engine is compiled into the wrapper, so itsmainis what the wrapper ships.What the gate found
specs/wrapper-tags.json— missing twelve live instructions (tags 81–92), seven of which move money:WithdrawProtocolFee(84),WithdrawInsuranceReserveToStake(87),WithdrawCreatorFee(90),RebalanceLpVaultBacking(91), plus the fee-split and protocol-fee-authority setters. Gaps, names and every other tag already agreed.specs/stake-parity.json— understated percolator-stake by fifteen. Tags 5–9 were inremoved_tags, asserting they were gone; tags 19–28 were simply absent. All fifteen are live at474079f,d0c6ecbandmainalike. The layout half was already correct — all ten offsets andreserved_startreturn byte-identical, independent evidence the new fixtures are faithful.SDK changes beyond the specs
IX_TAGgainsCancelRedemption(81) andUnwrapEscrowedPortfolio(82) — the only two v17 wrapper instructions with no entry. Both tags were represented solely by deprecated v12 names annotated "Not in v17", which was false; those two annotations now use theCOLLIDES with v17 …wording the file already applies at 73/74/75/78/79/80/85/90.test/parity-fixtures.test.tshad hand-curated maps that agreed with the stale specs and disagreed with both programs — including a literalexpect(fixture.removed_tags).toEqual([5, 6, 7, 8, 9, 11, 17]).STAKE_IXalready carried all fifteen stake tags; only the spec and this subset were wrong, and they corroborated each other. Now[11, 17].This is the third instance today of an assurance nobody could verify: a check, a spec and a test agreeing with one another while the program disagreed with all three.
Verified
pnpm testnpx tsc --noEmitWithdrawProtocolFee84 → 85 fails withWithdrawProtocolFee tag mismatch: expected 84 to be 85; restoring goes green — the gate is not vacuouscheck-parity-fixtures.mjsassertsOrdering
Land dcccrypto/percolator-stake#285 and dcccrypto/percolator-prog#460 first. In between, the gate reports
DRIFT DETECTEDrather thancargo run failed— already a better failure.🤖 Generated with Claude Code
https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D