Skip to content

fix(#102): pin_template --command names the source set_claim_template now takes - #110

Merged
Lexirieru merged 1 commit into
mainfrom
fix/pin-template-source
Oct 31, 2026
Merged

Lexirieru merged 1 commit into
mainfrom
fix/pin-template-source

Conversation

@Lin1er

@Lin1er Lin1er commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Refs #102, #94, #96.

Problem

v0.5.0 changed set_claim_template to set_claim_template(source: Source, parts: Vec<Bytes>, provider_hash: Bytes) (#94). tools/pin_template.py --command still printed the v0.4.0 shape, with no --source, so step 6 of the upgrade runbook in #102 would be refused by the CLI on 2026-10-31.

Change

tools/pin_template.py only:

  • Each entry in SOURCES now carries its contract Source variant (AdSense, AdMob).
  • The printed command adds --source <Variant> after -- set_claim_template.
  • The follow-up text says to simulate with --send=no first. It also reads the template back with claim_template_for --source <Variant> rather than the singleton claim_template().

The derivation, the checks and the parts are unchanged.

Verified

Not verified

The CLI's parsing of a unit enum as --source AdMob cannot be exercised until v0.5.0 is live; v0.4.0 has no such argument. Simulating step 6 with --send=no is the check, as the runbook already says.

… now takes

v0.5.0's set_claim_template takes the Source variant first (#94). The printed
invoke line still had the v0.4.0 shape, so the CLI would refuse it on the day.
It now prints --source AdSense or --source AdMob from --source, says to simulate
with --send=no first, and reads the template back with claim_template_for.
@Lin1er
Lin1er requested a review from Lexirieru October 31, 2026 05:09
@vercel

vercel Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
forepay Ready Ready Preview Oct 31, 2026 5:10am UTC
forepay-vue5 Ready Ready Preview Oct 31, 2026 5:10am UTC

@Lexirieru Lexirieru left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, and thank you for catching this one against your own tool rather than against my runbook.

Verified locally on 10e9e41, not taken from CI:

Check Result
pin_template.py --self-test --source adsense passed — round trip, structure, signature 0x4f3b53c4…8aba6, arity, wrong window refused, cross-source order refused
pin_template.py --self-test --source admob passed, same six checks
Diff scope tools/pin_template.py only, +9 −2. No contract, no backend, no front end.
CI 3/3 green

The fix is right and the reasoning behind it is the useful part: --command prints a line a human runs once, on the day it matters, so a line that the CLI would have refused is as bad as a wrong value. The variant field in SOURCES is also the right shape — the CLI spelling now comes from the same table as the separators, so the two cannot drift apart.

The --source AdMob spelling you could not test is confirmed. You wrote that you could not check the CLI parsing a unit enum before v0.5.0 was live. It is live now, and the CLI takes --source AdMob and --source AdSense exactly as printed — set_claim_template --source AdMob landed on production in 01cc1878…3d00a7, and claim_template_for --source AdMob reads it back. So the printed line is runnable as-is.

One small thing I noticed while running this, not worth changing here: --self-test runs both derivations regardless of --source, so --self-test --source adsense prints self-test (admob) first and the flag has no effect. That is harmless — it tests more, not less — but the flag reads as if it narrows the test. A line in the help, or dropping --source from the self-test path, would save the next person a double-take.

@Lexirieru
Lexirieru merged commit f18bbe5 into main Oct 31, 2026
9 checks passed
@Lexirieru
Lexirieru deleted the fix/pin-template-source branch October 31, 2026 14:25
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.

2 participants