Skip to content

fix(#375): make the Parity Gate check all four targets, and correct what it finds - #391

Merged
dcccrypto merged 1 commit into
mainfrom
fix/375-parity-gate-all-targets
Sep 3, 2026
Merged

fix(#375): make the Parity Gate check all four targets, and correct what it finds#391
dcccrypto merged 1 commit into
mainfrom
fix/375-parity-gate-all-targets

Conversation

@dcccrypto

Copy link
Copy Markdown
Owner

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 main every day since at least 2026-08-23, with three of 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. ABI drift in prog and stake had no detection at all.

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 — that was the second of prog's two failure causes.

Deliberately unpinned, for the reason percolator-prog's own ci.yml gives for leaving the engine unpinned while pinning the sibling programs: the engine is compiled into the wrapper, so its main is 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 in removed_tags, asserting they were gone; 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 return byte-identical, 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 now use the COLLIDES with v17 … wording the file already applies 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

check result
pnpm test 33 files, 1034 passed, 0 failed
npx tsc --noEmit clean
negative control spec WithdrawProtocolFee 84 → 85 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 what check-parity-fixtures.mjs asserts

Ordering

Land dcccrypto/percolator-stake#285 and dcccrypto/percolator-prog#460 first. In between, the gate reports DRIFT DETECTED rather than cargo run failed — already a better failure.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NgoNgagkvw7i5SSRC3FJ8D

…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
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: d5da3b2b-29b8-40b8-97cd-650f19d04697


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dcccrypto
dcccrypto merged commit cd61e1a into main Sep 3, 2026
5 of 6 checks passed
@dcccrypto
dcccrypto deleted the fix/375-parity-gate-all-targets branch September 3, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant