carlos / platform Public

grouproll: the held-requests floor from signed release pointers

Engine.Floor ports held-floor-sha-map's floor(): edges liveness and
ha_take, the pinned template's release, roll's prepared release, with
floor and floor-error rows. release.ReleaseForArtifact maps a SHA-256
through the router pointers with the tool's strict read before
GetSystemPointer; the branch's 29 signed fixtures plus the four
escaped-timestamp cases pin the tool's verdict.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 06848c36eb03b2fb1308595dcd5fe0912694d5bc parent 0eaea76
38 files changed, +2,242 −0
  • internal/grouproll/fake_test.go +82 −0
  • internal/grouproll/floor.go +396 −0
  • internal/grouproll/floor_test.go +633 −0
  • internal/release/systemlookup.go +464 −0
  • internal/release/systemlookup_test.go +433 −0
  • internal/release/testdata/router-pointer-diff/accept-base.json +4 −0
  • internal/release/testdata/router-pointer-diff/accept-full.json +4 −0
  • internal/release/testdata/router-pointer-diff/cases.json +118 −0
  • internal/release/testdata/router-pointer-diff/conservative-audit-null.json +4 −0
  • internal/release/testdata/router-pointer-diff/conservative-duplicate-key.json +4 −0
  • internal/release/testdata/router-pointer-diff/conservative-history-capital-ambiguous.json +4 −0
  • internal/release/testdata/router-pointer-diff/conservative-unknown-field.json +4 −0
  • internal/release/testdata/router-pointer-diff/conservative-wrapper-duplicate-key.json +1 −0
  • internal/release/testdata/router-pointer-diff/reject-activation-id-capital-number.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-activation-id-number.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-21.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-actor-number.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-at-capital-bad.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-capital-21.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-fast-track-string.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-hotfix-string.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-retry-number.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-audit-version-number.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-console-artifacts-capital-invalid.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-history-11.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-history-capital-empty.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-history-released-at-bad.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-payload-bom.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-payload-nan.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-payload-not-object.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-payload-utf16.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-promoted-at-hour-24.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-promoted-at-offset-99.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-wrapper-bom.json +4 −0
  • internal/release/testdata/router-pointer-diff/reject-wrapper-utf16.json binary
  • internal/release/testdata/router-pointer-golden.json +4 −0
  • internal/release/testdata/router-pointer-golden.pub +1 −0
  • region_ha_boundary_test.go +2 −0

Intent

Human

<task-notification> <task-id>a4bcc52657dfed16b</task-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/669506ff-23ec-45f1-9035-1d29593f2c37/tasks/a4bcc52657dfed16b.output</output-file> <status>completed</status> <summary>Agent "Implement Task 6: deciders + golden" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Status: DONE. Both Go deciders give the same answer as the script on every recorded case. - **Commit:** `0eaea76d` "grouproll: classify and terminate deciders, golden from the script", on group-roll-verb, not pushed. - **Script check:** `classify` and `terminate_decision` are byte-identical between this branch's script and `script-floor.py`. - **Recorder:** ran at the full 3000 seeds. 277 tests passed in 739 s, 237 s of it the simulation. It found 321 distinct classify cases and 439 terminate cases. Every fixture time is a whole number of milliseconds. - **Tests:** `TestClassifyGolden` (321 cases), `TestTerminateGolden` (439), `TestTerminateEveryCombination` (92,169 rows, oracle ported), `TestClassifyZeroDefaults` and the adapter's `TestMapPhaseMatchesCoreCopy` all pass. Vet, gofmt, both cross-builds, the boundary test and the census tests also pass. - **TDD and mapping checks:** against stub deciders, 745 of 760 golden cases and all grid rows failed. Mapping PreInService, Pending:Wait or EnteringStandby to the wrong phase fails the golden test. - **Concerns:** 1. I left the held suite's exhaustive terminate grid (92,169 calls) out of the recording. Recording it made `terminate.jsonl` 28 MB, and the Go grid test checks those same rows against the ported oracle. This goes against "record every call"; say if you want it recorded anyway, compressed. 2. In Go, `DivergenceRecorded` and `FloorChecked` are plain bools that default to false, but the script defaults them to true. Task 7's fact builder must always set them, as `decision_facts` does. 3. Most of the terminate golden is "done" (420 of 439 cases). The grid test covers the other branches. 4. Go commands only run outside the sandbox here: new `~/.cache/go-build` entries fail with "read-only file system". GOCACHE is still at its default. 5. The census change is only the `internal/grouproll` envelope digest, one line in the overlay. The seal and proposal card are unchanged. Report: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-group-roll-verb/.superpowers/sdd/2026-11-09-group-roll-verb/task-6-report.md`</result> <usage><subagent_tokens>153073</subagent_tokens><tool_uses>74</tool_uses><duration_ms>1906869</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>aa1b9e01ce7e1fc22</task-id> <tool-use-id>toolu_015VucnK19EcwCkQf7KkZfFx</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/669506ff-23ec-45f1-9035-1d29593f2c37/tasks/aa1b9e01ce7e1fc22.output</output-file> <status>completed</status> <summary>Agent "Review Task 6 (spec + quality)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>### Spec Compliance - ✅ Spec compliant for the Go deciders and the recorder. I compared both against `scripts/region-group-roll.py:246-420` branch by branch and found no behavioural difference. The recorder runs the roll, held and probe suites and the 3000-seed simulation, and records distinct deduped cases. Only the original decider is recorded, because the mutation runs are suspended or never pass through the wrapper. Raw states are kept. `Facts` and `TerminateFacts` hold the required keys. - ⚠️ Cannot verify from the diff: that `classify.jsonl` and `terminate.jsonl` were recorded on `main` after `held-floor-sha-map` merged (Step 1). The report says the script's decider text is byte-identical to `script-floor.py`, but I did not diff them. ### Strengths - **Absent facts.** Every default of an absent fact matches the script. `eq(nil, n)` mirrors Python `None != n-1`. `N` 0 means `shape` is false, as `n &gt;= 2` is in the script. The test helper `classifyFacts` supplies the script's `.get` defaults, including `divergence_recorded` and `floor_checked` as true. - **Terminate.** Selection by `ActivityID` against the previous-ID and skew path matches the script. The stable sort means the last listed activity decides among equal times. Millisecond constants are 5000, 120000 and 600000. The test converter fails on any time that is not a whole number of milliseconds. - **Phase mapping, classify.** The collapsed phases are equivalent in every branch. `Pending`, `PreInService` and `Pending:Proceed` form the only many-to-one group, and the script treats them identically in the sent-set, the wait branch and the fall-through. `Terminat*` and `None` are only ever tested together as "gone". Unmapped states such as `Detaching` and `""` behave like `Unknown` in every branch. - **Mapping tests.** `TestMapPhaseMatchesCoreCopy` (`internal/grouprollaws/phase_test.go`) covers the adapter's `MapPhase` against the table, including all documented lifecycle states, near misses and every raw state in the golden files. - **Terminate grid.** The ported grid maps raw phases through the table but computes its expectation from the raw string (`terminateExpected`). A lossy mapping therefore fails it, which compensates for the golden's thin phase coverage. The grid has 92,169 rows against the required 30,000. ### Issues #### Critical (Must Fix) None. #### Important (Should Fix) None. #### Minor (Nice to Have) - **`classify_test.go` `TestClassifyGolden`: weak phase coverage in the classify golden.** `EnteringStandby` appears in only 2 cases, `Terminated` in 2, and no real unlisted state such as `Detaching` appears at all (the 4 "Unknown" rows use a literal string). A lossy mapping of `Parking` in the hook branch, or in the resume `Parked, Parking` case, could pass the golden. The adapter table test does not close this gap, because it checks the mapping function and not how the decider uses a phase. Add a second table test that runs `Classify` with the `Parking` phase against the script's `Standby` outcome. Alternatively, run the same facts through Python and Go in a differential test. - **`classify.go:~30`, `Facts` zero value.** The zero value of `DivergenceRecorded` and `FloorChecked` is false, but the script's default is true. Go callers that forget to set them get `diverged` or `floor` where the script would not. The comment documents this and `TestClassifyZeroDefaults` sets them. Inverting the names (`DivergenceMissing`, `FloorUnchecked`) would remove the trap. Check that Task 7 callers set both. - **`classify.go`, `ExitState`.** An empty `ExitState` counts as `"none"`, whereas the script would treat `""` as sent. The facts builder always supplies a value, so this is harmless. The helper in the test pins the default. - **`terminate.go`, `PreviousIDs`.** A script activity with no `id` (`None`) is never in `previous_ids`, so the script includes it. The Go code excludes an activity with an empty ID only if `""` appears in `PreviousIDs`. This is unreachable with real AWS rows. - **`terminate.go`, `IntentSeq`.** It is carried but never read by the decider. - **`record.py` deviation.** The held suite's 92,169-row grid is not recorded. The controller has ruled on this, and the Go grid test covers it. The ruling holds up, since `terminateExpected` is independent of the golden. ### Assessment **Task quality:** Approved **Reasoning:** `Classify` and `TerminateDecision` match the script in every branch I compared, including nil and zero defaults and the millisecond arithmetic. The terminate grid also verifies the phase mapping against an oracle that works from raw states. The classify golden's `Parking` and unlisted-state coverage is thin, which is Minor and cheap to close.</result> <usage><subagent_tokens>72647</subagent_tokens><tool_uses>6</tool_uses><duration_ms>80991</duration_ms></usage> </task-notification>

Attributed to this commit: 10.6 g CO₂e (1,349,165 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on group-roll-verb, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/internal/grouproll/fake_test.go b/internal/grouproll/fake_test.go
index ee3b4c02c..95f1a77dd 100644
--- a/internal/grouproll/fake_test.go
+++ b/internal/grouproll/fake_test.go
@@ -107,6 +107,23 @@ type fake struct {
cancelSession func(id string) error
// sessions, when set, names the session each box call reports.
sessions func(iid, verb string) []string
+
+ // The floor's objects (held-floor-sha-map's HeldFake). haTake is
+ // each member box's ha_take by box ref when set (an absent ref
+ // publishes 1, a nil value publishes none); a nil map publishes no
+ // ha_take at all. fixed are boxes outside the group with an edges
+ // file; pointers are the router pointers' bytes by channel (an absent
+ // channel fails the GET).
+ haTake map[string]any
+ fixed map[string]fixedEdges
+ pointers map[string][]byte
+}
+
+// fixedEdges is a box outside the group: its ha_take (nil: none) and how
+// old its edges file's generation is.
+type fixedEdges struct {
+ haTake any
+ age time.Duration
}
// newFake is a group of n members (the script's Fake has two): the
@@ -661,9 +678,65 @@ type fakeStore struct {
bucket string
}
+// List is the config bucket's edges listing (the floor's edges_list):
+// every box's edges file, members first, then fixed boxes, and one key the
+// floor must skip.
+func (s fakeStore) List(ctx context.Context, prefix string) ([]string, error) {
+ f := s.f
+ r, err := f.request("edges_list", map[string]any{"prefix": prefix}, func() (any, error) {
+ if s.bucket != f.c.Bucket || prefix != "control/edges/" {
+ return nil, Uncertain{Key: "api"}
+ }
+ var keys []string
+ for _, iid := range sortedKeys(f.boxes) {
+ keys = append(keys, "control/edges/"+f.boxes[iid]["box_ref"].(string)+".json")
+ }
+ for _, ref := range sortedKeys(f.fixed) {
+ keys = append(keys, "control/edges/"+ref+".json")
+ }
+ return append(keys, "control/edges/index/v1"), nil
+ })
+ if err != nil {
+ return nil, err
+ }
+ return r.([]string), nil
+}
+
func (s fakeStore) Get(ctx context.Context, key string) ([]byte, string, error) {
f := s.f
+ if channel, ok := strings.CutPrefix(key, "control/system/router/"); ok {
+ channel = strings.TrimSuffix(channel, ".json")
+ r, err := f.request("release_pointer", map[string]any{"channel": channel}, func() (any, error) {
+ body, ok := f.pointers[channel]
+ if s.bucket != f.c.Bucket || !ok {
+ return nil, Uncertain{Key: "api"}
+ }
+ return body, nil
+ })
+ if err != nil {
+ return nil, "", err
+ }
+ return r.([]byte), "etag", nil
+ }
ref := strings.TrimSuffix(strings.TrimPrefix(key, "control/edges/"), ".json")
+ if fx, ok := f.fixed[ref]; ok && s.bucket == f.c.Bucket {
+ r, err := f.request("edges", map[string]any{"box_ref": ref}, func() (any, error) {
+ e := liveEdges(f.t, fakePBox)
+ e["box"], e["box_id"], e["generation"] = ref, ref, stamp(f.now.Add(-fx.age))
+ if fx.haTake != nil {
+ e["ha_take"] = fx.haTake
+ }
+ return e, nil
+ })
+ if err != nil {
+ return nil, "", err
+ }
+ if b, ok := r.([]byte); ok {
+ return b, "etag", nil
+ }
+ b, err := json.Marshal(r)
+ return b, "etag", err
+ }
r, err := f.request("edges", map[string]any{"box_ref": ref}, func() (any, error) {
if s.bucket != f.c.Bucket || !strings.HasPrefix(key, "control/edges/") {
return nil, os.ErrNotExist
@@ -697,6 +770,15 @@ func (s fakeStore) Get(ctx context.Context, key string) ([]byte, string, error)
}
e := liveEdges(f.t, fixture)
e["box"], e["box_id"], e["generation"], e["admitted"] = ref, ref, stamp(f.published[iid]), f.admitted
+ if f.haTake != nil {
+ take, set := f.haTake[ref]
+ if !set {
+ take = int64(1)
+ }
+ if take != nil {
+ e["ha_take"] = take
+ }
+ }
return e, nil
})
if err != nil {
diff --git a/internal/grouproll/floor.go b/internal/grouproll/floor.go
new file mode 100644
index 000000000..eacf572bd
--- /dev/null
+++ b/internal/grouproll/floor.go
@@ -0,0 +1,396 @@
+package grouproll
+
+import (
+ "context"
+ "encoding/base64"
+ "errors"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// DrainAckPeers' liveness for an edges file (script :258): a generation
+// at most 15 minutes old and at most 60 s ahead.
+const (
+ edgesMaxAge = 15 * time.Minute
+ edgesSkew = 60 * time.Second
+)
+
+// The release mapping's defaults (script release_for_sha).
+var (
+ defaultReleaseChannels = []string{"stable"}
+ defaultReleasePlatform = "linux-arm64"
+)
+
+// Floor is the script's Operator.floor (held-floor-sha-map; region HA
+// spec §25.9, group roll verb spec §9): which rule a departure or a roll
+// takes. "drain" when every live box publishes ha_take: 1 and the release
+// the transaction leaves running is at or above ha_floor; "dr4" when a
+// definite finding says otherwise. kind is "replace", "remove" or "roll";
+// version is the release the member prepared (roll only).
+//
+// A floor that cannot be read (an unreadable edges file or listing, a
+// template release that cannot be compared, a SHA-256 that cannot be
+// mapped through the signed router pointers, a prepared release the
+// pointers contradict) journals floor-error, says each error and refuses
+// with floor_error. It never falls back to DR-4. A chosen rule journals
+// floor and says the rule and each reason.
+func (e *Engine) Floor(ctx context.Context, kind, version string) (rule string, err error) {
+ // reasons are definite findings below the floor, so DR-4 applies.
+ // errs mean the floor could not be read: refuse, never fall back.
+ reasons, errs, live := []any{}, []any{}, []any{}
+ releases := map[string]any{}
+ var haFloor any
+ if e.c.HAFloor != nil {
+ haFloor = *e.c.HAFloor
+ }
+ if e.c.HAFloor == nil || e.c.DataPrefix == nil || e.c.DataBucket == nil {
+ reasons = append(reasons, Text("floor_config"))
+ } else {
+ floor := *e.c.HAFloor
+ err := func() error {
+ keys, err := e.edgesList(ctx)
+ if err != nil {
+ return err
+ }
+ for _, key := range keys {
+ m := EdgesKey.FindStringSubmatch(key)
+ if m == nil {
+ continue
+ }
+ v, err := e.edgesKey(ctx, key)
+ if err != nil {
+ if !refusalOrUncertain(err) {
+ return err
+ }
+ errs = append(errs, Text("floor_unreadable", "key", key))
+ continue
+ }
+ edges, _ := v.(map[string]any)
+ generation, err := instant(edges["generation"])
+ if err != nil {
+ continue
+ }
+ // DrainAckPeers' liveness: a file outside it is not a live box.
+ if age := e.clock().Sub(generation); age < -edgesSkew || age > edgesMaxAge {
+ continue
+ }
+ live = append(live, m[1])
+ if take, ok := edges["ha_take"].(int64); !ok || take != 1 {
+ reasons = append(reasons, Text("floor_box", "box", m[1]))
+ }
+ }
+ if kind == "replace" {
+ rel, err := e.templateRelease(ctx)
+ if err != nil {
+ return err
+ }
+ switch {
+ case SHA.MatchString(rel):
+ // group_config.release pins the artifact SHA-256.
+ mapped, err := e.releaseForSHA(ctx, rel)
+ if err != nil {
+ if !isRefusal(err) {
+ return err
+ }
+ errs = append(errs, Text("floor_sha", "sha", rel, "why", err.Error()))
+ } else {
+ releases[rel] = mapped
+ if belowFloor(mapped, floor) {
+ reasons = append(reasons, Text("floor_template_sha", "sha", rel, "release", mapped))
+ }
+ }
+ case !releaseVersion.MatchString(rel):
+ // A suffixed release cannot be compared.
+ errs = append(errs, Text("floor_template", "release", rel))
+ case belowFloor(rel, floor):
+ reasons = append(reasons, Text("floor_template", "release", rel))
+ }
+ }
+ compare := kind == "roll"
+ if kind == "roll" && e.c.ReleasePublicKey != nil {
+ // The member prepared --to-sha256 from its own verified
+ // pointer; the signed records must name the same release.
+ sha, _ := e.header["new"].(string)
+ mapped, err := e.rollRelease(ctx, sha, version)
+ if err != nil {
+ if !isRefusal(err) {
+ return err
+ }
+ errs = append(errs, Text("floor_sha", "sha", sha, "why", err.Error()))
+ compare = false // already an error; not compared
+ } else {
+ releases[sha] = mapped
+ version = mapped
+ }
+ }
+ if compare {
+ if !releaseVersion.MatchString(version) {
+ errs = append(errs, Text("floor_version", "release", version))
+ } else if belowFloor(version, floor) {
+ reasons = append(reasons, Text("floor_version", "release", version))
+ }
+ }
+ return nil
+ }()
+ if err != nil {
+ if !refusalOrUncertain(err) {
+ return "", err
+ }
+ errs = append(errs, reasonOf(err))
+ }
+ }
+ if len(errs) > 0 {
+ if _, err := e.event("floor-error", map[string]any{"errors": errs, "reasons": reasons}); err != nil {
+ return "", err
+ }
+ for _, reason := range errs {
+ e.say("floor", reason.(string))
+ }
+ return "", refuse("floor_error")
+ }
+ rule = "drain"
+ if len(reasons) > 0 {
+ rule = "dr4"
+ }
+ if _, err := e.event("floor", map[string]any{"rule": rule, "reasons": reasons, "live": live,
+ "ha_floor": haFloor, "releases": releases}); err != nil {
+ return "", err
+ }
+ if rule == "drain" {
+ e.say("rule", Text("rule_drain"))
+ } else {
+ e.say("rule", Text("rule_dr4"))
+ }
+ for _, reason := range reasons {
+ e.say("floor", reason.(string))
+ }
+ return rule, nil
+}
+
+// rollRelease is the roll --to-sha256 mapping (§9): the release the
+// signed router pointers name for sha, which must be the release the
+// member's prepare reported. A different one is the release_mismatch
+// refusal; any other doubt is releaseForSHA's refusal.
+func (e *Engine) rollRelease(ctx context.Context, sha, prepared string) (string, error) {
+ mapped, err := e.releaseForSHA(ctx, sha)
+ if err != nil {
+ return "", err
+ }
+ if prepared != mapped {
+ return "", refuse("release_mismatch", "prepared", prepared, "release", mapped)
+ }
+ return mapped, nil
+}
+
+// releaseForSHA is the script's release_for_sha: the vX.Y.Z version of
+// the one release whose release_platform artifact is sha, read from the
+// signed router pointers of release_channels (release.ReleaseForArtifact)
+// under release_public_key. Every doubt is a Refusal naming why (a
+// release_* text); only a journal failure or a cancelled context is
+// returned as itself.
+func (e *Engine) releaseForSHA(ctx context.Context, sha string) (string, error) {
+ if e.c.ReleasePublicKey == nil {
+ return "", refuse("release_key")
+ }
+ pub, ok := ParseReleasePublicKey(*e.c.ReleasePublicKey)
+ if !ok {
+ return "", refuse("release_key")
+ }
+ channels := e.c.ReleaseChannels
+ if channels == nil {
+ channels = defaultReleaseChannels
+ }
+ platform := defaultReleasePlatform
+ if e.c.ReleasePlatform != nil {
+ platform = *e.c.ReleasePlatform
+ }
+ version, err := release.ReleaseForArtifact(ctx, pointerStore{e}, pub, channels, platform, sha)
+ var pe *release.PointerError
+ var amb *release.AmbiguousArtifactError
+ switch {
+ case err == nil:
+ case errors.As(err, &pe):
+ switch pe.Fault {
+ case release.PointerUnreadable:
+ if !refusalOrUncertain(pe.Err) {
+ return "", pe.Err
+ }
+ return "", refuse("release_unreadable", "key", pe.Key)
+ case release.PointerScoped:
+ return "", refuse("release_scoped", "key", pe.Key)
+ case release.PointerSignature:
+ return "", refuse("release_signature", "key", pe.Key)
+ case release.PointerCancelled:
+ return "", refuse("release_cancelled", "key", pe.Key)
+ }
+ return "", refuse("release_invalid", "key", pe.Key, "channel", pe.Channel)
+ case errors.Is(err, release.ErrUnknownArtifact):
+ return "", refuse("release_unknown", "channels", strings.Join(channels, ", "), "platform", platform)
+ case errors.As(err, &amb):
+ return "", refuse("release_ambiguous", "versions", strings.Join(amb.Versions, ", "))
+ default:
+ return "", err
+ }
+ if !releaseVersion.MatchString(version) {
+ return "", refuse("release_uncomparable", "release", version)
+ }
+ return version, nil
+}
+
+// pointerStore is the script's call("release_pointer", channel=...) as a
+// release.Store: each router pointer GET in the config bucket is one
+// journaled call, its bytes kept (base64) in the response row.
+type pointerStore struct{ e *Engine }
+
+func (p pointerStore) Get(ctx context.Context, key string) ([]byte, string, error) {
+ e := p.e
+ channel := strings.TrimSuffix(strings.TrimPrefix(key, "control/system/router/"), ".json")
+ var body []byte
+ _, err := e.call(ctx, "release_pointer", map[string]any{"channel": channel}, time.Time{},
+ func(ctx context.Context, _ func(string)) (any, error) {
+ if e.Objects == nil {
+ return nil, refuse("unsupported")
+ }
+ b, err := readObject(ctx, e.Objects.Bucket(e.c.Bucket), key)
+ if err != nil {
+ return nil, err
+ }
+ body = b
+ return map[string]any{"body": base64.StdEncoding.EncodeToString(b)}, nil
+ })
+ if err != nil {
+ return nil, "", err
+ }
+ return body, "", nil
+}
+
+func (pointerStore) Put(context.Context, string, []byte, string) (string, error) {
+ return "", refuse("unsupported")
+}
+func (pointerStore) List(context.Context, string) ([]string, error) {
+ return nil, refuse("unsupported")
+}
+func (pointerStore) ListDirs(context.Context, string) ([]string, error) {
+ return nil, refuse("unsupported")
+}
+func (pointerStore) Delete(context.Context, string) error { return refuse("unsupported") }
+
+// edgesList is the script's call("edges_list"): every key under
+// control/edges/ in the config bucket, sorted.
+func (e *Engine) edgesList(ctx context.Context) ([]string, error) {
+ var keys []string
+ _, err := e.call(ctx, "edges_list", map[string]any{}, time.Time{}, func(ctx context.Context, _ func(string)) (any, error) {
+ if e.Objects == nil {
+ return nil, refuse("unsupported")
+ }
+ k, err := e.Objects.Bucket(e.c.Bucket).List(ctx, "control/edges/")
+ if err != nil {
+ if ctx.Err() != nil {
+ return nil, ctx.Err()
+ }
+ var u Uncertain
+ if errors.As(err, &u) {
+ return nil, u
+ }
+ return nil, Uncertain{Key: "api"}
+ }
+ sort.Strings(k)
+ keys = k
+ out := make([]any, len(k))
+ for i, s := range k {
+ out[i] = s
+ }
+ return out, nil
+ })
+ return keys, err
+}
+
+// edgesKey is the script's call("edges_key", key=...): one edges file,
+// decoded (an empty body is {}).
+func (e *Engine) edgesKey(ctx context.Context, key string) (any, error) {
+ var out any
+ _, err := e.call(ctx, "edges_key", map[string]any{"key": key}, time.Time{}, func(ctx context.Context, _ func(string)) (any, error) {
+ if !EdgesKey.MatchString(key) {
+ return nil, refuse("api")
+ }
+ if e.Objects == nil {
+ return nil, refuse("unsupported")
+ }
+ body, err := readObject(ctx, e.Objects.Bucket(e.c.Bucket), key)
+ if err != nil {
+ return nil, err
+ }
+ v, err := decodeObject(body)
+ if err != nil {
+ return nil, err
+ }
+ out = v
+ return v, nil
+ })
+ return out, err
+}
+
+// templateRelease is the script's call("template_release",
+// template=header["template"]): the pinned template's CARLOS_RELEASE.
+func (e *Engine) templateRelease(ctx context.Context) (string, error) {
+ var rel string
+ _, err := e.call(ctx, "template_release", map[string]any{"template": e.header["template"]}, time.Time{},
+ func(ctx context.Context, _ func(string)) (any, error) {
+ tpl, _ := e.header["template"].(map[string]any)
+ r, err := e.g.TemplateRelease(ctx, tpl)
+ if err != nil {
+ return nil, err
+ }
+ rel = r
+ return r, nil
+ })
+ return rel, err
+}
+
+// belowFloor is the script's below_floor: a version that parses and is
+// below floor. An unparseable version is not below.
+func belowFloor(version, floor string) bool {
+ v, ok := versionTuple(version)
+ f, fok := versionTuple(floor)
+ if !ok || !fok {
+ return false
+ }
+ for i := range v {
+ if v[i] != f[i] {
+ return v[i] < f[i]
+ }
+ }
+ return false
+}
+
+// versionTuple is the script's release_version: vX.Y.Z (optional v, no
+// leading zeros, at most nine digits each) as three integers.
+func versionTuple(s string) ([3]int, bool) {
+ m := releaseVersion.FindStringSubmatch(s)
+ if m == nil {
+ return [3]int{}, false
+ }
+ var out [3]int
+ for i, part := range strings.Split(m[1], ".") {
+ n, err := strconv.Atoi(part)
+ if err != nil {
+ return [3]int{}, false
+ }
+ out[i] = n
+ }
+ return out, true
+}
+
+func isRefusal(err error) bool {
+ var r Refusal
+ return errors.As(err, &r)
+}
+
+func refusalOrUncertain(err error) bool {
+ var u Uncertain
+ return isRefusal(err) || errors.As(err, &u)
+}
diff --git a/internal/grouproll/floor_test.go b/internal/grouproll/floor_test.go
new file mode 100644
index 000000000..c6b345fa4
--- /dev/null
+++ b/internal/grouproll/floor_test.go
@@ -0,0 +1,633 @@
+//go:build linux || darwin
+
+package grouproll
+
+import (
+ "context"
+ "crypto/ed25519"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "os"
+ "path/filepath"
+ "reflect"
+ "strings"
+ "testing"
+ "time"
+)
+
+// The floor's witnesses: held-floor-sha-map's region_group_held_test.py
+// FloorTests, ReleaseMapTests and the drained roll's floor cases, run on
+// Engine.Floor directly (the verbs that call it come later). The router
+// pointer fixtures are the branch's, copied into internal/release/testdata.
+
+var (
+ floorCurrent = strings.Repeat("11", 32) // v0.35.1 linux-arm64
+ floorAMD64 = strings.Repeat("22", 32) // v0.35.1 linux-amd64
+ floorHistory = strings.Repeat("55", 32) // v0.35.0
+ floorOldHistory = strings.Repeat("33", 32) // v0.34.9
+ floorRouterKey = "control/system/router/stable.json"
+)
+
+func floorFixture(t *testing.T, name string) []byte {
+ t.Helper()
+ b, err := os.ReadFile(filepath.Join("..", "release", "testdata", name))
+ if err != nil {
+ t.Fatal(err)
+ }
+ return b
+}
+
+// floorSign is the wrapper the seed 1..32 root key writes for payload.
+func floorSign(t *testing.T, payload any) []byte {
+ t.Helper()
+ body, ok := payload.([]byte)
+ if !ok {
+ var err error
+ if body, err = json.MarshalIndent(payload, "", " "); err != nil {
+ t.Fatal(err)
+ }
+ }
+ seed := make([]byte, ed25519.SeedSize)
+ for i := range seed {
+ seed[i] = byte(i + 1)
+ }
+ encoded := base64.StdEncoding.EncodeToString(body)
+ sig := ed25519.Sign(ed25519.NewKeyFromSeed(seed), []byte(encoded))
+ w, err := json.MarshalIndent(map[string]string{"payload": encoded, "sig": base64.StdEncoding.EncodeToString(sig)}, "", " ")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return w
+}
+
+// floorRelease and floorPointer are the Python test's system_release and
+// router_payload.
+func floorRelease(version, arm64 string) map[string]any {
+ return map[string]any{"release_tag": version, "version": version, "source": "release:" + version,
+ "released_at": "2026-11-09T12:00:00Z",
+ "artifacts": map[string]any{"linux-arm64": map[string]any{
+ "key": "bootstrap/router/" + version + "/carlos-linux-arm64", "sha256": arm64}}}
+}
+
+func floorPointer(current map[string]any, channel string, extra map[string]any) map[string]any {
+ p := map[string]any{"schema": 1, "component": "router", "channel": channel, "current": current,
+ "spread": "5m0s", "promoted_at": "2026-11-09T12:00:00Z"}
+ for k, v := range extra {
+ p[k] = v
+ }
+ return p
+}
+
+// newFloorHarness is HeldBase.setUp: ha_floor v0.35.0 with a data bucket
+// and prefix, every live box publishing ha_take 1 (the members and the
+// fixed box adi), the template pinned at v0.35.0, and the golden pointer
+// in the stable channel. withKey adds the golden release_public_key
+// (ReleaseMapTests).
+func newFloorHarness(t *testing.T, withKey bool) *harness {
+ t.Helper()
+ h := newHarness(t, 2)
+ floor, prefix, bucket := "v0.35.0", "instances", "example-bucket"
+ h.c.HAFloor, h.c.DataPrefix, h.c.DataBucket = &floor, &prefix, &bucket
+ if withKey {
+ pub := strings.TrimSpace(string(floorFixture(t, "router-pointer-golden.pub")))
+ h.c.ReleasePublicKey = &pub
+ }
+ h.f.c = h.c
+ h.f.haTake = map[string]any{}
+ h.f.fixed = map[string]fixedEdges{"adi": {haTake: int64(1), age: 5 * time.Second}}
+ h.f.templateRelease = "v0.35.0"
+ h.f.pointers = map[string][]byte{"stable": floorFixture(t, "router-pointer-golden.json")}
+ return h
+}
+
+func ref(iid string) string { return "g-" + iid[2:] }
+
+type floorRun struct {
+ e *Engine
+ rule string
+ err error
+}
+
+// floor runs Engine.Floor in a journal whose header names the pinned
+// template and the roll's artifact (newSHA).
+func (h *harness) floor(kind, version string) floorRun {
+ h.t.Helper()
+ e := h.journaled()
+ e.header = Row{"iid": fakeIID, "template": copyArgs(fakeTemplate), "new": newSHA}
+ rule, err := e.Floor(context.Background(), kind, version)
+ return floorRun{e, rule, err}
+}
+
+func (r floorRun) row(t *testing.T, kind string) Row {
+ t.Helper()
+ row, _ := r.e.j.Last(kind, nil)
+ return row
+}
+
+func (h *harness) routerGets() int {
+ n := 0
+ for _, op := range h.f.ops() {
+ if op == "release_pointer" {
+ n++
+ }
+ }
+ return n
+}
+
+// refused is assert_floor_refused at the floor: the rule is dr4, said with
+// the reason, and journaled.
+func (h *harness) refused(t *testing.T, r floorRun, reason string) {
+ t.Helper()
+ if r.err != nil || r.rule != "dr4" {
+ t.Fatalf("Floor = %q, %v; want dr4", r.rule, r.err)
+ }
+ out := h.out.String()
+ if !strings.Contains(out, Text("line", "phase", "rule", "detail", Text("rule_dr4"))) ||
+ !strings.Contains(out, Text("line", "phase", "floor", "detail", reason)) {
+ t.Fatalf("output %q lacks the DR-4 rule or %q", out, reason)
+ }
+ row := r.row(t, "floor")
+ if row == nil || row["rule"] != "dr4" || !containsValue(row["reasons"], reason) {
+ t.Fatalf("floor row = %v", row)
+ }
+ if r.row(t, "floor-error") != nil {
+ t.Fatal("a floor-error row beside the rule")
+ }
+}
+
+// floorError is assert_floor_error: the floor could not be read, so the
+// transaction is refused with no rule and never falls back to DR-4.
+func (h *harness) floorError(t *testing.T, r floorRun, reason string) {
+ t.Helper()
+ var ref Refusal
+ if !errors.As(r.err, &ref) || ref.Key != "floor_error" || r.rule != "" {
+ t.Fatalf("Floor = %q, %v; want the floor_error refusal", r.rule, r.err)
+ }
+ out := h.out.String()
+ if strings.Contains(out, Text("rule_dr4")) || strings.Contains(out, Text("rule_drain")) {
+ t.Fatalf("a rule was said: %q", out)
+ }
+ if !strings.Contains(out, Text("line", "phase", "floor", "detail", reason)) {
+ t.Fatalf("output %q lacks %q", out, reason)
+ }
+ if r.row(t, "floor") != nil {
+ t.Fatal("a floor row was journaled")
+ }
+ row := r.row(t, "floor-error")
+ if row == nil || !containsValue(row["errors"], reason) {
+ t.Fatalf("floor-error row = %v, want %q among its errors", row, reason)
+ }
+ if _, ok := row["reasons"].([]any); !ok {
+ t.Fatalf("floor-error row has no reasons list: %v", row)
+ }
+}
+
+func (h *harness) drained(t *testing.T, r floorRun) Row {
+ t.Helper()
+ if r.err != nil || r.rule != "drain" {
+ t.Fatalf("Floor = %q, %v; want drain (output %q)", r.rule, r.err, h.out.String())
+ }
+ if !strings.Contains(h.out.String(), Text("line", "phase", "rule", "detail", Text("rule_drain"))) {
+ t.Fatalf("output %q lacks the drain rule", h.out.String())
+ }
+ return r.row(t, "floor")
+}
+
+func containsValue(list any, want string) bool {
+ l, _ := list.([]any)
+ for _, v := range l {
+ if v == want {
+ return true
+ }
+ }
+ return false
+}
+
+func TestFloorMetDrains(t *testing.T) {
+ h := newFloorHarness(t, false)
+ r := h.floor("replace", "")
+ row := h.drained(t, r)
+ want := Row{"rule": "drain", "reasons": []any{}, "live": []any{"adi", ref(fakeIID), ref(fakePeer)},
+ "ha_floor": "v0.35.0", "releases": map[string]any{}}
+ for k, v := range want {
+ if !sameValue(row[k], v) {
+ t.Fatalf("floor row %s = %v, want %v", k, row[k], v)
+ }
+ }
+ if _, ok := row["at_ms"].(int64); !ok {
+ t.Fatalf("floor row time %v is not integer ms", row["at_ms"])
+ }
+ // The script's calls, journaled: one listing, each edges file, the
+ // template; no router pointer for a version pin.
+ var ops []string
+ for _, row := range r.e.j.Rows() {
+ if row["kind"] == "intent" {
+ ops = append(ops, row["op"].(string))
+ }
+ }
+ if !reflect.DeepEqual(ops, []string{"edges_list", "edges_key", "edges_key", "edges_key", "template_release"}) {
+ t.Fatalf("journaled ops = %v", ops)
+ }
+ var keys []any
+ for _, row := range r.e.j.Rows() {
+ if row["kind"] == "intent" && row["op"] == "edges_key" {
+ keys = append(keys, row["args"].(map[string]any)["key"])
+ }
+ }
+ if want := []any{"control/edges/adi.json", "control/edges/" + ref(fakeIID) + ".json",
+ "control/edges/" + ref(fakePeer) + ".json"}; !reflect.DeepEqual(keys, want) {
+ t.Fatalf("edges_key keys = %v, want %v (the index key skipped)", keys, want)
+ }
+ if in, _ := r.e.j.Last("intent", map[string]any{"op": "template_release"}); !sameValue(in["args"], map[string]any{"template": fakeTemplate}) {
+ t.Fatalf("template_release args = %v", in["args"])
+ }
+ if h.routerGets() != 0 {
+ t.Fatal("a version pin read a router pointer")
+ }
+}
+
+func TestFloorMemberWithoutHATake(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.f.haTake[ref(fakePeer)] = nil
+ h.refused(t, h.floor("replace", ""), Text("floor_box", "box", ref(fakePeer)))
+}
+
+func TestFloorMemberWithOtherHATake(t *testing.T) {
+ for _, take := range []any{int64(0), int64(2), true, "1", nil} {
+ h := newFloorHarness(t, false)
+ h.f.haTake[ref(fakeIID)] = take
+ r := h.floor("replace", "")
+ if r.err != nil {
+ t.Fatalf("take %#v: %v; output %q", take, r.err, h.out.String())
+ }
+ h.refused(t, r, Text("floor_box", "box", ref(fakeIID)))
+ }
+ // 1.0 is not the integer 1 to the script either, but a format 2
+ // journal holds integers only (spec V3): the edges_key response row
+ // cannot be written, so the file is unreadable and the floor refuses
+ // instead of choosing DR-4. Never a drain.
+ h := newFloorHarness(t, false)
+ h.f.haTake[ref(fakeIID)] = json.Number("1.0")
+ h.floorError(t, h.floor("replace", ""), Text("floor_unreadable", "key", "control/edges/"+ref(fakeIID)+".json"))
+}
+
+func TestFloorFixedForwarderWithoutHATake(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.f.fixed["adi"] = fixedEdges{age: 5 * time.Second}
+ h.refused(t, h.floor("replace", ""), Text("floor_box", "box", "adi"))
+}
+
+// test_stale_box_is_not_live: an edges file outside DrainAckPeers'
+// liveness (older than 15 minutes, more than 60 s ahead, or with no
+// readable generation) is not a live box, so its ha_take does not count.
+func TestFloorStaleEdgesFileIgnored(t *testing.T) {
+ for name, age := range map[string]time.Duration{"old": 16 * time.Minute, "ahead": -61 * time.Second} {
+ h := newFloorHarness(t, false)
+ h.f.fixed[name] = fixedEdges{age: age}
+ row := h.drained(t, h.floor("replace", ""))
+ if containsValue(row["live"], name) {
+ t.Fatalf("%s is live: %v", name, row["live"])
+ }
+ }
+ // The bounds themselves are live.
+ h := newFloorHarness(t, false)
+ h.f.fixed["edge-old"] = fixedEdges{haTake: int64(1), age: 15 * time.Minute}
+ h.f.fixed["edge-ahead"] = fixedEdges{haTake: int64(1), age: -60 * time.Second}
+ row := h.drained(t, h.floor("replace", ""))
+ if !containsValue(row["live"], "edge-old") || !containsValue(row["live"], "edge-ahead") {
+ t.Fatalf("live = %v", row["live"])
+ }
+ // No readable generation: skipped, not an error.
+ h = newFloorHarness(t, false)
+ h.f.fixed["nogen"] = fixedEdges{}
+ h.f.wrap = func(op string, args map[string]any, r any, err error) (any, error) {
+ if op == "edges" && args["box_ref"] == "nogen" {
+ r.(map[string]any)["generation"] = "yesterday"
+ }
+ return r, err
+ }
+ row = h.drained(t, h.floor("replace", ""))
+ if containsValue(row["live"], "nogen") {
+ t.Fatalf("live = %v", row["live"])
+ }
+}
+
+func TestFloorOldPinnedTemplate(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.f.templateRelease = "v0.34.9"
+ h.refused(t, h.floor("replace", ""), Text("floor_template", "release", "v0.34.9"))
+ // remove reads no template.
+ h = newFloorHarness(t, false)
+ h.f.templateRelease = "v0.34.9"
+ h.drained(t, h.floor("remove", ""))
+ for _, op := range h.f.ops() {
+ if op == "template_release" {
+ t.Fatal("remove read the template")
+ }
+ }
+}
+
+func TestFloorUncomparablePinnedTemplateIsAnError(t *testing.T) {
+ for _, rel := range []string{"v0.35.0-rc1", ""} {
+ h := newFloorHarness(t, false)
+ h.f.templateRelease = rel
+ h.floorError(t, h.floor("replace", ""), Text("floor_template", "release", rel))
+ }
+ // A SHA pin with no release_public_key cannot be mapped.
+ h := newFloorHarness(t, false)
+ h.f.templateRelease = strings.Repeat("a", 64)
+ h.floorError(t, h.floor("replace", ""), Text("floor_sha", "sha", strings.Repeat("a", 64), "why", Text("release_key")))
+ if h.routerGets() != 0 {
+ t.Fatal("a router pointer was read without a key")
+ }
+}
+
+func TestFloorNoFloorConfig(t *testing.T) {
+ for _, key := range []string{"ha_floor", "data_prefix", "data_bucket"} {
+ h := newFloorHarness(t, false)
+ switch key {
+ case "ha_floor":
+ h.c.HAFloor = nil
+ case "data_prefix":
+ h.c.DataPrefix = nil
+ case "data_bucket":
+ h.c.DataBucket = nil
+ }
+ r := h.floor("replace", "")
+ h.refused(t, r, Text("floor_config"))
+ if len(h.f.ops()) != 0 {
+ t.Fatalf("%s: calls %v without a floor config", key, h.f.ops())
+ }
+ if key == "ha_floor" && r.row(t, "floor")["ha_floor"] != nil {
+ t.Fatalf("ha_floor = %v, want null", r.row(t, "floor")["ha_floor"])
+ }
+ }
+}
+
+// test_unreadable_edges_file: refuse (floor_error), never DR-4.
+func TestFloorUnreadableEdgesFile(t *testing.T) {
+ for name, fail := range map[string]func(r any) (any, error){
+ "get fails": func(any) (any, error) { return nil, Uncertain{Key: "api"} },
+ "not JSON": func(any) (any, error) { return []byte("{not json"), nil },
+ } {
+ t.Run(name, func(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.f.wrap = func(op string, args map[string]any, r any, err error) (any, error) {
+ if op == "edges" && args["box_ref"] == "adi" {
+ return fail(r)
+ }
+ return r, err
+ }
+ h.floorError(t, h.floor("replace", ""), Text("floor_unreadable", "key", "control/edges/adi.json"))
+ })
+ }
+}
+
+func TestFloorListingErrorRefusesWithoutDR4(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.f.before = func(op string, args map[string]any) error {
+ if op == "edges_list" {
+ return Uncertain{Key: "api"}
+ }
+ return nil
+ }
+ h.floorError(t, h.floor("roll", "v0.35.0"), Text("api"))
+}
+
+func TestFloorRollToReleaseBelowFloorUsesDR4(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.refused(t, h.floor("roll", "v0.34.0"), Text("floor_version", "release", "v0.34.0"))
+ h = newFloorHarness(t, false)
+ h.floorError(t, h.floor("roll", "v0.35.0-rc1"), Text("floor_version", "release", "v0.35.0-rc1"))
+ // Without release_public_key the prepared release is kept: no pointer.
+ h = newFloorHarness(t, false)
+ h.drained(t, h.floor("roll", "v0.35.0"))
+ if h.routerGets() != 0 {
+ t.Fatal("a router pointer was read without a key")
+ }
+}
+
+// ReleaseMapTests: a SHA pin is mapped through the signed router pointers.
+
+func (h *harness) shaError(t *testing.T, r floorRun, sha, why string) {
+ t.Helper()
+ h.floorError(t, r, Text("floor_sha", "sha", sha, "why", why))
+}
+
+func TestFloorCurrentReleaseMeetsFloor(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.f.templateRelease = floorCurrent
+ r := h.floor("replace", "")
+ row := h.drained(t, r)
+ if !sameValue(row["releases"], map[string]any{floorCurrent: "v0.35.1"}) {
+ t.Fatalf("releases = %v", row["releases"])
+ }
+ in, _ := r.e.j.Last("intent", map[string]any{"op": "release_pointer"})
+ if !sameValue(in["args"], map[string]any{"channel": "stable"}) {
+ t.Fatalf("release_pointer args = %v", in["args"])
+ }
+ resp, _ := r.e.j.Last("response", map[string]any{"op": "release_pointer"})
+ if !sameValue(resp["result"], map[string]any{"body": base64.StdEncoding.EncodeToString(h.f.pointers["stable"])}) {
+ t.Fatalf("release_pointer result = %v", resp["result"])
+ }
+ if h.routerGets() != 1 {
+ t.Fatalf("%d router GETs, want one per channel", h.routerGets())
+ }
+}
+
+func TestFloorHistoryRelease(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.f.templateRelease = floorHistory
+ row := h.drained(t, h.floor("replace", ""))
+ if !sameValue(row["releases"], map[string]any{floorHistory: "v0.35.0"}) {
+ t.Fatalf("releases = %v", row["releases"])
+ }
+ h = newFloorHarness(t, true)
+ h.f.templateRelease = floorOldHistory
+ h.refused(t, h.floor("replace", ""), Text("floor_template_sha", "sha", floorOldHistory, "release", "v0.34.9"))
+}
+
+func TestFloorConfiguredPlatform(t *testing.T) {
+ h := newFloorHarness(t, true)
+ amd := "linux-amd64"
+ h.c.ReleasePlatform = &amd
+ h.f.templateRelease = floorAMD64
+ row := h.drained(t, h.floor("replace", ""))
+ if !sameValue(row["releases"], map[string]any{floorAMD64: "v0.35.1"}) {
+ t.Fatalf("releases = %v", row["releases"])
+ }
+ h = newFloorHarness(t, true)
+ h.c.ReleasePlatform = &amd
+ h.f.templateRelease = floorCurrent
+ h.shaError(t, h.floor("replace", ""), floorCurrent,
+ Text("release_unknown", "channels", "stable", "platform", "linux-amd64"))
+}
+
+func TestFloorUnknownSHA(t *testing.T) {
+ h := newFloorHarness(t, true)
+ sha := strings.Repeat("77", 32)
+ h.f.templateRelease = sha
+ h.shaError(t, h.floor("replace", ""), sha, Text("release_unknown", "channels", "stable", "platform", "linux-arm64"))
+}
+
+func TestFloorPointerRefusals(t *testing.T) {
+ golden := floorFixture(t, "router-pointer-golden.json")
+ var gw map[string]any
+ if err := json.Unmarshal(golden, &gw); err != nil {
+ t.Fatal(err)
+ }
+ sig, _ := base64.StdEncoding.DecodeString(gw["sig"].(string))
+ sig[len(sig)-1] ^= 1
+ flipped, _ := json.Marshal(map[string]any{"payload": gw["payload"], "sig": base64.StdEncoding.EncodeToString(sig)})
+ scoped, _ := json.Marshal(map[string]any{"payload": gw["payload"], "sig": gw["sig"],
+ "grant": map[string]any{"payload": "e30=", "sig": "AA=="}})
+ extra, _ := json.Marshal(map[string]any{"payload": gw["payload"], "sig": gw["sig"], "note": "x"})
+ good := floorRelease("v0.35.1", floorCurrent)
+ invalid := Text("release_invalid", "key", floorRouterKey, "channel", "stable")
+ cases := map[string]struct {
+ body []byte
+ why string
+ }{
+ "bad signature": {flipped, Text("release_signature", "key", floorRouterKey)},
+ "scoped key": {scoped, Text("release_scoped", "key", floorRouterKey)},
+ "wrapper field": {extra, invalid},
+ "wrong channel": {floorSign(t, floorPointer(good, "canary", nil)), invalid},
+ "wrong component": {floorSign(t, map[string]any{"schema": 1, "component": "edge", "channel": "stable", "current": good, "spread": "5m0s", "promoted_at": "2026-11-09T12:00:00Z"}), invalid},
+ "spread 25h": {floorSign(t, floorPointer(good, "stable", map[string]any{"spread": "25h"})), invalid},
+ "zero promoted": {floorSign(t, floorPointer(good, "stable", map[string]any{"promoted_at": "0001-01-01T00:00:00Z"})), invalid},
+ "not json": {floorSign(t, []byte("not json")), invalid},
+ "cancelled": {floorSign(t, floorPointer(map[string]any{"version": "", "artifacts": map[string]any{}, "released_at": "2026-11-09T12:00:00Z"},
+ "stable", map[string]any{"cancellation_id": "c1"})), Text("release_cancelled", "key", floorRouterKey)},
+ "suffixed version": {floorSign(t, floorPointer(floorRelease("v0.35.1-rc1", floorCurrent), "stable", nil)),
+ Text("release_uncomparable", "release", "v0.35.1-rc1")},
+ }
+ // The branch's Go-invalid and Go-ambiguous fixtures refuse as invalid.
+ for _, name := range []string{"conservative-history-capital-ambiguous", "reject-audit-version-number", "reject-history-capital-empty"} {
+ cases[name] = struct {
+ body []byte
+ why string
+ }{floorFixture(t, filepath.Join("router-pointer-diff", name+".json")), invalid}
+ }
+ for name, c := range cases {
+ t.Run(name, func(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.f.templateRelease = floorCurrent
+ h.f.pointers["stable"] = c.body
+ h.shaError(t, h.floor("replace", ""), floorCurrent, c.why)
+ })
+ }
+ t.Run("unreadable", func(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.f.templateRelease = floorCurrent
+ delete(h.f.pointers, "stable")
+ h.shaError(t, h.floor("replace", ""), floorCurrent, Text("release_unreadable", "key", floorRouterKey))
+ })
+ t.Run("no key", func(t *testing.T) {
+ h := newFloorHarness(t, false)
+ h.f.templateRelease = floorCurrent
+ h.shaError(t, h.floor("replace", ""), floorCurrent, Text("release_key"))
+ if h.routerGets() != 0 {
+ t.Fatal("a router pointer was read without a key")
+ }
+ })
+}
+
+func TestFloorValidSignedPayloadForms(t *testing.T) {
+ good := floorRelease("v0.35.1", floorCurrent)
+ for _, extra := range []map[string]any{
+ {"spread": "1h30m0.5s"}, {"spread": "0"}, {"promoted_at": "2026-11-09T13:00:00.25+01:00"},
+ {"history": []any{floorRelease("v0.36.0-rc1", strings.Repeat("99", 32))}},
+ } {
+ h := newFloorHarness(t, true)
+ h.f.templateRelease = floorCurrent
+ h.f.pointers["stable"] = floorSign(t, floorPointer(good, "stable", extra))
+ row := h.drained(t, h.floor("replace", ""))
+ if !sameValue(row["releases"], map[string]any{floorCurrent: "v0.35.1"}) {
+ t.Fatalf("%v: releases = %v", extra, row["releases"])
+ }
+ }
+}
+
+func TestFloorTwoChannels(t *testing.T) {
+ both := func(h *harness) {
+ h.c.ReleaseChannels = []string{"stable", "canary"}
+ h.f.templateRelease = floorCurrent
+ }
+ h := newFloorHarness(t, true)
+ both(h)
+ h.f.pointers["canary"] = floorSign(t, floorPointer(floorRelease("v0.35.1", floorCurrent), "canary", nil))
+ row := h.drained(t, h.floor("replace", ""))
+ if !sameValue(row["releases"], map[string]any{floorCurrent: "v0.35.1"}) || h.routerGets() != 2 {
+ t.Fatalf("releases = %v, %d GETs", row["releases"], h.routerGets())
+ }
+ // One artifact named by two versions is a doubt: refuse.
+ h = newFloorHarness(t, true)
+ both(h)
+ h.f.pointers["canary"] = floorSign(t, floorPointer(floorRelease("v0.36.0", floorCurrent), "canary", nil))
+ h.shaError(t, h.floor("replace", ""), floorCurrent, Text("release_ambiguous", "versions", "v0.35.1, v0.36.0"))
+ // A configured channel that cannot be read refuses, even with a match elsewhere.
+ h = newFloorHarness(t, true)
+ both(h)
+ h.shaError(t, h.floor("replace", ""), floorCurrent,
+ Text("release_unreadable", "key", "control/system/router/canary.json"))
+}
+
+func TestFloorVersionPinNeedsNoReleaseRecords(t *testing.T) {
+ h := newFloorHarness(t, false)
+ row := h.drained(t, h.floor("replace", ""))
+ if !sameValue(row["releases"], map[string]any{}) || h.routerGets() != 0 {
+ t.Fatalf("releases = %v, %d GETs", row["releases"], h.routerGets())
+ }
+}
+
+// roll --to-sha256: the same mapping, cross-checked with what the member
+// prepared.
+
+func (h *harness) rollPointer(t *testing.T, version string) {
+ h.f.pointers["stable"] = floorSign(t, floorPointer(floorRelease(version, newSHA), "stable", nil))
+}
+
+func TestFloorRollMapsItsSHA(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.rollPointer(t, "v0.35.0")
+ row := h.drained(t, h.floor("roll", "v0.35.0"))
+ if !sameValue(row["releases"], map[string]any{newSHA: "v0.35.0"}) || h.routerGets() != 1 {
+ t.Fatalf("releases = %v, %d GETs", row["releases"], h.routerGets())
+ }
+}
+
+func TestFloorRollBelowFloorBySHAUsesDR4(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.rollPointer(t, "v0.34.0")
+ h.refused(t, h.floor("roll", "v0.34.0"), Text("floor_version", "release", "v0.34.0"))
+}
+
+func TestFloorRollPreparedReleaseMustMatchTheMapping(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.rollPointer(t, "v0.35.1")
+ h.shaError(t, h.floor("roll", "v0.35.0"), newSHA,
+ Text("release_mismatch", "prepared", "v0.35.0", "release", "v0.35.1"))
+}
+
+func TestFloorRollUnmappedSHARefuses(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.shaError(t, h.floor("roll", "v0.35.0"), newSHA,
+ Text("release_unknown", "channels", "stable", "platform", "linux-arm64"))
+}
+
+// rollRelease is the mapping Task 7's roll calls: the release the signed
+// pointers name for sha, which must be the release prepare reported.
+func TestRollRelease(t *testing.T) {
+ h := newFloorHarness(t, true)
+ h.rollPointer(t, "v0.35.1")
+ e := h.journaled()
+ if v, err := e.rollRelease(context.Background(), newSHA, "v0.35.1"); err != nil || v != "v0.35.1" {
+ t.Fatalf("rollRelease = %q, %v", v, err)
+ }
+ _, err := e.rollRelease(context.Background(), newSHA, "v0.35.0")
+ var r Refusal
+ if !errors.As(err, &r) || r.Key != "release_mismatch" || r.Error() != Text("release_mismatch", "prepared", "v0.35.0", "release", "v0.35.1") {
+ t.Fatalf("err = %v, want release_mismatch", err)
+ }
+}
diff --git a/internal/release/systemlookup.go b/internal/release/systemlookup.go
new file mode 100644
index 000000000..36ebe7cb2
--- /dev/null
+++ b/internal/release/systemlookup.go
@@ -0,0 +1,464 @@
+package release
+
+import (
+ "bytes"
+ "context"
+ "crypto/ed25519"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "os"
+ "regexp"
+ "sort"
+ "strconv"
+ "strings"
+ "time"
+ "unicode/utf8"
+)
+
+// ReleaseForArtifact is the reverse lookup the region group verb's floor
+// needs (group roll verb spec §9, region HA §25.9): the version of the one
+// release whose platform artifact is sha, read from the signed router
+// pointer of every channel in channels, Current and History. Every channel
+// is read, in order, even after a match: a channel that cannot be read or
+// verified refuses the lookup.
+//
+// Each pointer is read as the roll tool reads it (held-floor-sha-map's
+// verify_router_pointer), which is stricter than GetSystemPointer: the
+// tool refuses a few records Go's decoder accepts or might read
+// differently (a duplicate or case-variant key, an unknown field, a null,
+// a lone surrogate escape, a time outside RFC 3339 as the tool writes it).
+// So the raw wrapper and payload bytes pass that strict read first, and
+// GetSystemPointer's verification second; a record is accepted only when
+// both accept it.
+//
+// Errors: *PointerError naming the channel and why its pointer was
+// refused; ErrUnknownArtifact when no release names sha; an
+// *AmbiguousArtifactError (errors.Is ErrAmbiguousArtifact) when releases
+// with different versions do. The version is returned as signed: whether
+// it is a comparable vX.Y.Z is the caller's question.
+func ReleaseForArtifact(ctx context.Context, store Store, pub ed25519.PublicKey, channels []string, platform, sha string) (string, error) {
+ versions := map[string]bool{}
+ for _, channel := range channels {
+ key := SystemPointerKey(SystemComponentRouter, channel)
+ body, _, err := store.Get(ctx, key)
+ if err != nil {
+ return "", &PointerError{Channel: channel, Key: key, Fault: PointerUnreadable, Err: err}
+ }
+ releases, err := readRouterPointer(ctx, pub, body, channel, key)
+ if err != nil {
+ return "", err
+ }
+ for _, r := range releases {
+ if a, ok := r.Artifacts[platform]; ok && a.SHA256 == sha {
+ versions[r.Version] = true
+ }
+ }
+ }
+ switch len(versions) {
+ case 0:
+ return "", ErrUnknownArtifact
+ case 1:
+ for v := range versions {
+ return v, nil
+ }
+ }
+ list := make([]string, 0, len(versions))
+ for v := range versions {
+ list = append(list, v)
+ }
+ sort.Strings(list)
+ return "", &AmbiguousArtifactError{Versions: list}
+}
+
+var (
+ // ErrUnknownArtifact: no release in the channels read names the
+ // artifact for the platform.
+ ErrUnknownArtifact = errors.New("system pointer: no release names this artifact")
+ // ErrAmbiguousArtifact: the artifact is named by releases with
+ // different versions.
+ ErrAmbiguousArtifact = errors.New("system pointer: the artifact names more than one release")
+)
+
+// AmbiguousArtifactError lists the versions naming one artifact, sorted.
+type AmbiguousArtifactError struct{ Versions []string }
+
+func (e *AmbiguousArtifactError) Error() string {
+ return ErrAmbiguousArtifact.Error() + ": " + strings.Join(e.Versions, ", ")
+}
+
+func (e *AmbiguousArtifactError) Is(target error) bool { return target == ErrAmbiguousArtifact }
+
+// PointerFault is why a router pointer was refused, in the roll tool's
+// terms (its release_* refusals).
+type PointerFault string
+
+const (
+ PointerUnreadable PointerFault = "unreadable" // the GET failed
+ PointerScoped PointerFault = "scoped" // the wrapper carries a grant
+ PointerSignature PointerFault = "signature" // the root key's signature does not verify
+ PointerInvalid PointerFault = "invalid" // not a valid router pointer for the channel
+ PointerCancelled PointerFault = "cancelled" // the channel names no current release
+)
+
+// PointerError is one channel's pointer refused. Err is the cause: the
+// store's error, os.ErrNotExist for a cancelled channel, or an error
+// wrapping ErrBadSystemPointer.
+type PointerError struct {
+ Channel, Key string
+ Fault PointerFault
+ Err error
+}
+
+func (e *PointerError) Error() string {
+ return fmt.Sprintf("system pointer %s: %s: %v", e.Key, e.Fault, e.Err)
+}
+
+func (e *PointerError) Unwrap() error { return e.Err }
+
+// readRouterPointer is the roll tool's verify_router_pointer followed by
+// GetSystemPointer's verification over the same bytes. It returns Current
+// followed by History.
+func readRouterPointer(ctx context.Context, pub ed25519.PublicKey, raw []byte, channel, key string) ([]SystemRelease, error) {
+ fault := func(f PointerFault, why string) error {
+ err := error(os.ErrNotExist)
+ if f != PointerCancelled {
+ err = fmt.Errorf("%w: %s", ErrBadSystemPointer, why)
+ }
+ return &PointerError{Channel: channel, Key: key, Fault: f, Err: err}
+ }
+ wrapper, err := strictJSON(raw)
+ if err != nil {
+ return nil, fault(PointerInvalid, "wrapper: "+err.Error())
+ }
+ if w, ok := wrapper.(map[string]any); ok {
+ if _, grant := w["grant"]; grant {
+ return nil, fault(PointerScoped, "signed by a scoped key")
+ }
+ }
+ if err := strictObject(wrapper, wrapperFields); err != nil {
+ return nil, fault(PointerInvalid, "wrapper: "+err.Error())
+ }
+ w := wrapper.(map[string]any)
+ if len(w) != len(wrapperFields) {
+ return nil, fault(PointerInvalid, "wrapper: payload and sig are required")
+ }
+ sigText, payloadText := w["sig"].(string), w["payload"].(string)
+ // Python's b64decode(validate=True) refuses a line break Go's decoder
+ // would skip; the signed bytes are the payload string's ASCII.
+ sig, err := base64.StdEncoding.DecodeString(sigText)
+ if err != nil || strings.ContainsAny(sigText, "\r\n") || !isASCII(payloadText) {
+ return nil, fault(PointerSignature, "bad signature encoding")
+ }
+ if len(pub) != ed25519.PublicKeySize || !ed25519.Verify(pub, []byte(payloadText), sig) {
+ return nil, fault(PointerSignature, "signature does not verify")
+ }
+ payloadBytes, err := base64.StdEncoding.DecodeString(payloadText)
+ if err != nil || strings.ContainsAny(payloadText, "\r\n") {
+ return nil, fault(PointerInvalid, "bad payload encoding")
+ }
+ payload, err := strictJSON(payloadBytes)
+ if err != nil {
+ return nil, fault(PointerInvalid, "payload: "+err.Error())
+ }
+ if err := strictObject(payload, pointerFields); err != nil {
+ return nil, fault(PointerInvalid, "payload: "+err.Error())
+ }
+ p := payload.(map[string]any)
+ current, _ := p["current"].(map[string]any)
+ if id, _ := p["cancellation_id"].(string); id != "" {
+ if v, _ := current["version"].(string); v == "" {
+ return nil, fault(PointerCancelled, "cancelled")
+ }
+ }
+ // validateSystemPointer reads a zero promoted_at as unset; the tool
+ // also reads any instant it cannot hold (before year 1 or after 9999
+ // in UTC, at microsecond precision) as unset.
+ if at, ok := p["promoted_at"].(string); !ok || !toolInstant(at) {
+ return nil, fault(PointerInvalid, "promoted_at unset")
+ }
+ sp, _, err := GetSystemPointer(ctx, oneObject(raw), pub, SystemComponentRouter, channel)
+ if errors.Is(err, os.ErrNotExist) {
+ return nil, fault(PointerCancelled, "cancelled")
+ }
+ if err != nil {
+ return nil, fault(PointerInvalid, err.Error())
+ }
+ return append([]SystemRelease{sp.Current}, sp.History...), nil
+}
+
+// oneObject is a Store holding one pointer's bytes, for GetSystemPointer
+// over bytes already read.
+type oneObject []byte
+
+func (o oneObject) Get(context.Context, string) ([]byte, string, error) { return o, "", nil }
+func (oneObject) Put(context.Context, string, []byte, string) (string, error) {
+ return "", errors.New("read only")
+}
+func (oneObject) List(context.Context, string) ([]string, error) { return nil, errors.New("read only") }
+func (oneObject) ListDirs(context.Context, string) ([]string, error) {
+ return nil, errors.New("read only")
+}
+func (oneObject) Delete(context.Context, string) error { return errors.New("read only") }
+
+func isASCII(s string) bool {
+ for i := 0; i < len(s); i++ {
+ if s[i] >= 0x80 {
+ return false
+ }
+ }
+ return true
+}
+
+// The roll tool's field tables (script-floor.py WRAPPER_FIELDS ...
+// POINTER_FIELDS): the exact, case-sensitive JSON names of the Go structs,
+// each with its declared kind.
+type fieldKind int
+
+const (
+ kindString fieldKind = iota
+ kindBool
+ kindInt
+ kindTime
+ kindRelease
+ kindReleases
+ kindAudit
+ kindArtifacts
+)
+
+var (
+ wrapperFields = map[string]fieldKind{"payload": kindString, "sig": kindString}
+ artifactFields = map[string]fieldKind{"key": kindString, "sha256": kindString}
+ promotionFields = map[string]fieldKind{"version": kindString, "from": kindString, "to": kindString,
+ "actor": kindString, "hotfix": kindBool, "fast_track": kindBool, "retry": kindBool, "at": kindTime}
+ releaseFields = map[string]fieldKind{"console_artifacts": kindArtifacts, "release_tag": kindString,
+ "seeds_protocol": kindInt, "moves_protocol": kindInt, "version": kindString, "artifacts": kindArtifacts,
+ "source": kindString, "released_at": kindTime}
+ pointerFields = map[string]fieldKind{"activation_id": kindString, "cancellation_id": kindString,
+ "schema": kindInt, "component": kindString, "channel": kindString, "current": kindRelease,
+ "history": kindReleases, "spread": kindString, "promoted_at": kindTime, "audit": kindAudit,
+ "allow_below_rootfs_floor": kindBool, "allow_below_regional_floor": kindBool,
+ "allow_below_fleet_forward_floor": kindBool}
+)
+
+// toolRFC3339 is the tool's RFC3339 pattern: what Go's encoder writes,
+// checked before any time is parsed.
+var toolRFC3339 = regexp.MustCompile(`^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]` +
+ `(?:\.[0-9]{1,9})?(?:Z|[+-](?:[01][0-9]|2[0-3]):[0-5][0-9])$`)
+
+// toolTime is the tool's go_time without its zero reading: the pattern,
+// a year Python's datetime holds, and a real date.
+func toolTime(s string) (time.Time, error) {
+ if !toolRFC3339.MatchString(s) || strings.HasPrefix(s, "0000") {
+ return time.Time{}, errors.New("not an RFC 3339 time")
+ }
+ return time.Parse(time.RFC3339Nano, s)
+}
+
+// toolInstant is the tool's go_time(...) is not None: a valid time whose
+// UTC instant, truncated to microseconds, is after Go's zero time and
+// within year 9999.
+func toolInstant(s string) bool {
+ t, err := toolTime(s)
+ if err != nil {
+ return false
+ }
+ u := t.UTC()
+ return u.Year() <= 9999 && u.Truncate(time.Microsecond).After(time.Time{})
+}
+
+// strictObject is the tool's strict_object: a JSON object of exactly the
+// named fields (a subset), each of its declared kind. null refuses.
+func strictObject(v any, fields map[string]fieldKind) error {
+ m, ok := v.(map[string]any)
+ if !ok {
+ return errors.New("not an object")
+ }
+ for name := range m {
+ if _, known := fields[name]; !known {
+ return fmt.Errorf("unknown field %q", name)
+ }
+ }
+ for name, item := range m {
+ if err := strictValue(item, fields[name]); err != nil {
+ return fmt.Errorf("%s: %w", name, err)
+ }
+ }
+ return nil
+}
+
+func strictValue(v any, kind fieldKind) error {
+ switch kind {
+ case kindString:
+ if _, ok := v.(string); !ok {
+ return errors.New("not a string")
+ }
+ case kindBool:
+ if _, ok := v.(bool); !ok {
+ return errors.New("not a boolean")
+ }
+ case kindInt:
+ n, ok := v.(json.Number)
+ if !ok || strings.ContainsAny(string(n), ".eE") {
+ return errors.New("not an integer")
+ }
+ if _, err := strconv.ParseInt(string(n), 10, 64); err != nil {
+ return errors.New("not a 64-bit integer")
+ }
+ case kindTime:
+ s, ok := v.(string)
+ if !ok {
+ return errors.New("not a time")
+ }
+ if _, err := toolTime(s); err != nil {
+ return err
+ }
+ case kindRelease:
+ return strictObject(v, releaseFields)
+ case kindReleases, kindAudit:
+ list, ok := v.([]any)
+ limit, fields := historyMax, releaseFields
+ if kind == kindAudit {
+ limit, fields = auditMax, promotionFields
+ }
+ if !ok || len(list) > limit {
+ return errors.New("not a list within its bound")
+ }
+ for _, item := range list {
+ if err := strictObject(item, fields); err != nil {
+ return err
+ }
+ }
+ case kindArtifacts:
+ m, ok := v.(map[string]any)
+ if !ok {
+ return errors.New("not an object")
+ }
+ for _, item := range m {
+ if err := strictObject(item, artifactFields); err != nil {
+ return err
+ }
+ }
+ default:
+ return errors.New("unknown kind")
+ }
+ return nil
+}
+
+// strictJSON is the tool's strict_json: one JSON value from strict UTF-8
+// bytes with no BOM, no lone surrogate escape (Go would replace it), and
+// no two keys of one object equal when case is folded (Go's decoder folds
+// case and keeps the last). Numbers stay json.Number.
+func strictJSON(raw []byte) (any, error) {
+ if bytes.HasPrefix(raw, []byte("\xef\xbb\xbf")) || !utf8.Valid(raw) {
+ return nil, errors.New("not UTF-8 JSON")
+ }
+ if loneSurrogate(raw) {
+ return nil, errors.New("a lone surrogate escape")
+ }
+ dec := json.NewDecoder(bytes.NewReader(raw))
+ dec.UseNumber()
+ v, err := strictTree(dec)
+ if err != nil {
+ return nil, err
+ }
+ if _, err := dec.Token(); err != io.EOF {
+ return nil, errors.New("trailing data")
+ }
+ return v, nil
+}
+
+func strictTree(dec *json.Decoder) (any, error) {
+ tok, err := dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ switch t := tok.(type) {
+ case json.Delim:
+ switch t {
+ case '{':
+ obj, folded := map[string]any{}, map[string]bool{}
+ for dec.More() {
+ kt, err := dec.Token()
+ if err != nil {
+ return nil, err
+ }
+ key, ok := kt.(string)
+ if !ok {
+ return nil, errors.New("object key is not a string")
+ }
+ f := strings.ToLower(strings.ToUpper(key))
+ if folded[f] {
+ return nil, fmt.Errorf("duplicate key %q", key)
+ }
+ folded[f] = true
+ v, err := strictTree(dec)
+ if err != nil {
+ return nil, err
+ }
+ obj[key] = v
+ }
+ if _, err := dec.Token(); err != nil {
+ return nil, err
+ }
+ return obj, nil
+ case '[':
+ arr := []any{}
+ for dec.More() {
+ v, err := strictTree(dec)
+ if err != nil {
+ return nil, err
+ }
+ arr = append(arr, v)
+ }
+ if _, err := dec.Token(); err != nil {
+ return nil, err
+ }
+ return arr, nil
+ }
+ return nil, fmt.Errorf("unexpected %v", t)
+ }
+ return tok, nil
+}
+
+// loneSurrogate reports a \u escape of a UTF-16 surrogate that is not one
+// half of a high-low pair. Backslashes occur only inside strings in valid
+// JSON; anything malformed is left to the decoder.
+func loneSurrogate(raw []byte) bool {
+ hex4 := func(at int) (rune, bool) {
+ if at+4 > len(raw) {
+ return 0, false
+ }
+ n, err := strconv.ParseUint(string(raw[at:at+4]), 16, 32)
+ return rune(n), err == nil
+ }
+ for i := 0; i < len(raw); i++ {
+ if raw[i] != '\\' || i+1 >= len(raw) {
+ continue
+ }
+ if raw[i+1] != 'u' {
+ i++ // a two-character escape, \\ included
+ continue
+ }
+ r, ok := hex4(i + 2)
+ if !ok {
+ continue
+ }
+ i += 5 // the last hex digit
+ switch {
+ case r >= 0xd800 && r < 0xdc00:
+ if i+2 < len(raw) && raw[i+1] == '\\' && raw[i+2] == 'u' {
+ if low, ok := hex4(i + 3); ok && low >= 0xdc00 && low < 0xe000 {
+ i += 6
+ continue
+ }
+ }
+ return true
+ case r >= 0xdc00 && r < 0xe000:
+ return true
+ }
+ }
+ return false
+}
diff --git a/internal/release/systemlookup_test.go b/internal/release/systemlookup_test.go
new file mode 100644
index 000000000..46feb66ed
--- /dev/null
+++ b/internal/release/systemlookup_test.go
@@ -0,0 +1,433 @@
+package release
+
+import (
+ "bytes"
+ "context"
+ "crypto/ed25519"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "os"
+ "path/filepath"
+ "reflect"
+ "strings"
+ "testing"
+)
+
+// The router pointer fixtures come from the parked branch
+// held-floor-sha-map (scripts/testdata), byte for byte: the golden pointer
+// release.PromoteSystem wrote with the seed bytes 1..32, and the signed
+// differential cases its Python test writes (diff_cases). cases.json gives
+// Go's GetSystemPointer verdict ("go") and the roll tool's ("tool") for
+// each. ReleaseForArtifact must give the tool's.
+const (
+ lookupGolden = "testdata/router-pointer-golden.json"
+ lookupPub = "testdata/router-pointer-golden.pub"
+ lookupDiffDir = "testdata/router-pointer-diff"
+)
+
+var (
+ lookupCurrent = strings.Repeat("11", 32) // v0.35.1 linux-arm64
+ lookupAMD64 = strings.Repeat("22", 32) // v0.35.1 linux-amd64
+ lookupHistory = strings.Repeat("55", 32) // v0.35.0 linux-arm64
+ lookupOldHistory = strings.Repeat("33", 32) // v0.34.9 linux-arm64
+)
+
+func lookupSeedKey() ed25519.PrivateKey {
+ seed := make([]byte, ed25519.SeedSize)
+ for i := range seed {
+ seed[i] = byte(i + 1)
+ }
+ return ed25519.NewKeyFromSeed(seed)
+}
+
+func lookupRead(t *testing.T, path string) []byte {
+ t.Helper()
+ b, err := os.ReadFile(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return b
+}
+
+func lookupPubKey(t *testing.T) ed25519.PublicKey {
+ t.Helper()
+ raw, err := base64.StdEncoding.DecodeString(strings.TrimSpace(string(lookupRead(t, lookupPub))))
+ if err != nil || len(raw) != ed25519.PublicKeySize {
+ t.Fatalf("golden pub: %v", err)
+ }
+ if !bytes.Equal(raw, lookupSeedKey().Public().(ed25519.PublicKey)) {
+ t.Fatal("golden pub is not the seed 1..32 key")
+ }
+ return raw
+}
+
+// lookupStore is a bucket of router pointers by channel; a channel without
+// one fails the GET as a missing object.
+type lookupStore struct {
+ Store
+ pointers map[string][]byte
+ gets []string
+}
+
+func (s *lookupStore) Get(_ context.Context, key string) ([]byte, string, error) {
+ s.gets = append(s.gets, key)
+ for ch, body := range s.pointers {
+ if key == SystemPointerKey("router", ch) {
+ return body, "etag", nil
+ }
+ }
+ return nil, "", os.ErrNotExist
+}
+
+// lookupSign is the wrapper a root key writes for these payload bytes
+// (signSystemPointer: the signature covers the base64 payload string).
+func lookupSign(t *testing.T, payload []byte) []byte {
+ t.Helper()
+ encoded := base64.StdEncoding.EncodeToString(payload)
+ sig := ed25519.Sign(lookupSeedKey(), []byte(encoded))
+ w, err := json.MarshalIndent(map[string]string{"payload": encoded, "sig": base64.StdEncoding.EncodeToString(sig)}, "", " ")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return w
+}
+
+// lookupPayload is the payload bytes of a signed wrapper on disk.
+func lookupPayload(t *testing.T, path string) []byte {
+ t.Helper()
+ var w struct{ Payload string }
+ if err := json.Unmarshal(lookupRead(t, path), &w); err != nil {
+ t.Fatal(err)
+ }
+ p, err := base64.StdEncoding.DecodeString(w.Payload)
+ if err != nil {
+ t.Fatal(err)
+ }
+ return p
+}
+
+// routerPayload is the Python test's router_payload over one release.
+func routerPayload(t *testing.T, version, arm64, channel string, extra map[string]any) []byte {
+ t.Helper()
+ p := map[string]any{
+ "schema": 1, "component": "router", "channel": channel, "spread": "5m0s",
+ "promoted_at": "2026-11-09T12:00:00Z",
+ "current": map[string]any{
+ "release_tag": version, "version": version, "source": "release:" + version,
+ "released_at": "2026-11-09T12:00:00Z",
+ "artifacts": map[string]any{"linux-arm64": map[string]any{
+ "key": "bootstrap/router/" + version + "/carlos-linux-arm64", "sha256": arm64}},
+ },
+ }
+ for k, v := range extra {
+ p[k] = v
+ }
+ b, err := json.MarshalIndent(p, "", " ")
+ if err != nil {
+ t.Fatal(err)
+ }
+ return b
+}
+
+func pointerFault(err error) PointerFault {
+ var pe *PointerError
+ if errors.As(err, &pe) {
+ return pe.Fault
+ }
+ return ""
+}
+
+func TestReleaseForArtifactGolden(t *testing.T) {
+ ctx := context.Background()
+ pub := lookupPubKey(t)
+ golden := lookupRead(t, lookupGolden)
+ stable := []string{"stable"}
+
+ for _, c := range []struct {
+ name, platform, sha, want string
+ }{
+ {"current", "linux-arm64", lookupCurrent, "v0.35.1"},
+ {"current other platform", "linux-amd64", lookupAMD64, "v0.35.1"},
+ {"history", "linux-arm64", lookupHistory, "v0.35.0"},
+ {"older history", "linux-arm64", lookupOldHistory, "v0.34.9"},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ s := &lookupStore{pointers: map[string][]byte{"stable": golden}}
+ got, err := ReleaseForArtifact(ctx, s, pub, stable, c.platform, c.sha)
+ if err != nil || got != c.want {
+ t.Fatalf("ReleaseForArtifact = %q, %v; want %q", got, err, c.want)
+ }
+ if !reflect.DeepEqual(s.gets, []string{"control/system/router/stable.json"}) {
+ t.Fatalf("gets = %v", s.gets)
+ }
+ })
+ }
+
+ t.Run("unknown", func(t *testing.T) {
+ for _, c := range []struct{ platform, sha string }{
+ {"linux-arm64", strings.Repeat("77", 32)},
+ {"linux-amd64", lookupCurrent}, // the arm64 artifact, asked for amd64
+ } {
+ s := &lookupStore{pointers: map[string][]byte{"stable": golden}}
+ if _, err := ReleaseForArtifact(ctx, s, pub, stable, c.platform, c.sha); !errors.Is(err, ErrUnknownArtifact) {
+ t.Fatalf("%s %s: err = %v, want ErrUnknownArtifact", c.platform, c.sha[:4], err)
+ }
+ }
+ })
+
+ t.Run("two channels, one version", func(t *testing.T) {
+ s := &lookupStore{pointers: map[string][]byte{"stable": golden,
+ "canary": lookupSign(t, routerPayload(t, "v0.35.1", lookupCurrent, "canary", nil))}}
+ got, err := ReleaseForArtifact(ctx, s, pub, []string{"stable", "canary"}, "linux-arm64", lookupCurrent)
+ if err != nil || got != "v0.35.1" {
+ t.Fatalf("got %q, %v", got, err)
+ }
+ if len(s.gets) != 2 {
+ t.Fatalf("gets = %v, want one per channel", s.gets)
+ }
+ })
+
+ t.Run("two versions", func(t *testing.T) {
+ s := &lookupStore{pointers: map[string][]byte{"stable": golden,
+ "canary": lookupSign(t, routerPayload(t, "v0.36.0", lookupCurrent, "canary", nil))}}
+ _, err := ReleaseForArtifact(ctx, s, pub, []string{"stable", "canary"}, "linux-arm64", lookupCurrent)
+ var amb *AmbiguousArtifactError
+ if !errors.Is(err, ErrAmbiguousArtifact) || !errors.As(err, &amb) ||
+ !reflect.DeepEqual(amb.Versions, []string{"v0.35.1", "v0.36.0"}) {
+ t.Fatalf("err = %v, want ambiguous v0.35.1, v0.36.0", err)
+ }
+ })
+
+ t.Run("a channel that cannot be read refuses, even with a match elsewhere", func(t *testing.T) {
+ s := &lookupStore{pointers: map[string][]byte{"stable": golden}}
+ _, err := ReleaseForArtifact(ctx, s, pub, []string{"stable", "canary"}, "linux-arm64", lookupCurrent)
+ var pe *PointerError
+ if !errors.As(err, &pe) || pe.Fault != PointerUnreadable || pe.Key != "control/system/router/canary.json" ||
+ pe.Channel != "canary" || !errors.Is(err, os.ErrNotExist) {
+ t.Fatalf("err = %#v", err)
+ }
+ })
+
+ t.Run("scoped key", func(t *testing.T) {
+ var w map[string]any
+ if err := json.Unmarshal(golden, &w); err != nil {
+ t.Fatal(err)
+ }
+ w["grant"] = map[string]any{"payload": "e30=", "sig": "AA=="}
+ body, _ := json.Marshal(w)
+ s := &lookupStore{pointers: map[string][]byte{"stable": body}}
+ _, err := ReleaseForArtifact(ctx, s, pub, stable, "linux-arm64", lookupCurrent)
+ if pointerFault(err) != PointerScoped || !errors.Is(err, ErrBadSystemPointer) {
+ t.Fatalf("err = %v, want scoped", err)
+ }
+ })
+
+ t.Run("wrong channel", func(t *testing.T) {
+ // The stable pointer's bytes, read as the canary channel's.
+ s := &lookupStore{pointers: map[string][]byte{"canary": golden}}
+ _, err := ReleaseForArtifact(ctx, s, pub, []string{"canary"}, "linux-arm64", lookupCurrent)
+ var pe *PointerError
+ if !errors.As(err, &pe) || pe.Fault != PointerInvalid || pe.Channel != "canary" {
+ t.Fatalf("err = %v, want invalid for canary", err)
+ }
+ })
+
+ t.Run("bad signature", func(t *testing.T) {
+ var w map[string]string
+ if err := json.Unmarshal(golden, &w); err != nil {
+ t.Fatal(err)
+ }
+ sig, _ := base64.StdEncoding.DecodeString(w["sig"])
+ sig[len(sig)-1] ^= 1
+ flipped, _ := json.Marshal(map[string]string{"payload": w["payload"], "sig": base64.StdEncoding.EncodeToString(sig)})
+ other := ed25519.NewKeyFromSeed(make([]byte, 32))
+ otherSig := ed25519.Sign(other, []byte(w["payload"]))
+ otherKey, _ := json.Marshal(map[string]string{"payload": w["payload"], "sig": base64.StdEncoding.EncodeToString(otherSig)})
+ newline, _ := json.Marshal(map[string]string{"payload": w["payload"], "sig": w["sig"][:10] + "\n" + w["sig"][10:]})
+ for name, body := range map[string][]byte{"flipped": flipped, "other key": otherKey, "line break in sig": newline} {
+ s := &lookupStore{pointers: map[string][]byte{"stable": body}}
+ if _, err := ReleaseForArtifact(ctx, s, pub, stable, "linux-arm64", lookupCurrent); pointerFault(err) != PointerSignature {
+ t.Fatalf("%s: err = %v, want signature", name, err)
+ }
+ }
+ })
+
+ t.Run("cancelled channel", func(t *testing.T) {
+ p, _ := json.MarshalIndent(map[string]any{"schema": 1, "component": "router", "channel": "stable",
+ "cancellation_id": "c1", "spread": "5m0s", "promoted_at": "2026-11-09T12:00:00Z",
+ "current": map[string]any{"version": "", "artifacts": map[string]any{}, "released_at": "0001-01-01T00:00:00Z"}}, "", " ")
+ s := &lookupStore{pointers: map[string][]byte{"stable": lookupSign(t, p)}}
+ if _, err := ReleaseForArtifact(ctx, s, pub, stable, "linux-arm64", lookupCurrent); pointerFault(err) != PointerCancelled {
+ t.Fatalf("err = %v, want cancelled", err)
+ }
+ })
+
+ t.Run("a mapped version is returned as signed, suffix and all", func(t *testing.T) {
+ s := &lookupStore{pointers: map[string][]byte{"stable": lookupSign(t, routerPayload(t, "v0.35.1-rc1", lookupCurrent, "stable", nil))}}
+ got, err := ReleaseForArtifact(ctx, s, pub, stable, "linux-arm64", lookupCurrent)
+ if err != nil || got != "v0.35.1-rc1" {
+ t.Fatalf("got %q, %v", got, err)
+ }
+ })
+}
+
+// TestReleaseForArtifactDifferential is held-floor-sha-map's
+// scripts/witness-pointer/diff_test.go for the Go verb: every signed case
+// gets the tool's verdict from ReleaseForArtifact, and GetSystemPointer's
+// own verdict still matches the "go" column (so the five conservative
+// cases are exactly where the strict read adds a refusal).
+func TestReleaseForArtifactDifferential(t *testing.T) {
+ ctx := context.Background()
+ pub := lookupPubKey(t)
+ var cases map[string]struct{ Go, Tool string }
+ if err := json.Unmarshal(lookupRead(t, filepath.Join(lookupDiffDir, "cases.json")), &cases); err != nil {
+ t.Fatal(err)
+ }
+ if len(cases) != 29 {
+ t.Fatalf("%d differential cases, want the branch's 29", len(cases))
+ }
+ conservative := 0
+ for name, c := range cases {
+ t.Run(name, func(t *testing.T) {
+ body := lookupRead(t, filepath.Join(lookupDiffDir, name+".json"))
+ s := &lookupStore{pointers: map[string][]byte{"stable": body}}
+ _, _, goErr := GetSystemPointer(ctx, s, pub, "router", "stable")
+ if got := map[bool]string{true: "accept", false: "reject"}[goErr == nil]; got != c.Go {
+ t.Fatalf("GetSystemPointer %s (%v), manifest says %s", got, goErr, c.Go)
+ }
+ version, err := ReleaseForArtifact(ctx, s, pub, []string{"stable"}, "linux-arm64", lookupCurrent)
+ switch c.Tool {
+ case "accept":
+ if err != nil || version != "v0.35.1" {
+ t.Fatalf("tool accepts; got %q, %v", version, err)
+ }
+ case "refuse":
+ var pe *PointerError
+ if !errors.As(err, &pe) {
+ t.Fatalf("tool refuses the pointer; got %q, %v", version, err)
+ }
+ default:
+ t.Fatalf("tool verdict %q", c.Tool)
+ }
+ })
+ if c.Go == "accept" && c.Tool == "refuse" {
+ conservative++
+ }
+ }
+ if conservative != 5 {
+ t.Fatalf("%d conservative cases, want 5", conservative)
+ }
+}
+
+// replaceNth replaces the nth (1-based) occurrence of old in s.
+func replaceNth(t *testing.T, s []byte, old, new string, n int) []byte {
+ t.Helper()
+ at := 0
+ for i := 0; i < n; i++ {
+ j := bytes.Index(s[at:], []byte(old))
+ if j < 0 {
+ t.Fatalf("occurrence %d of %q not found", n, old)
+ }
+ at += j
+ if i < n-1 {
+ at += len(old)
+ }
+ }
+ out := append([]byte{}, s[:at]...)
+ out = append(out, new...)
+ return append(out, s[at+len(old):]...)
+}
+
+// TestReleaseForArtifactEscapedTimestamps: round 2's four cases on the
+// floor branch (review F2.1). A JSON escape inside a timestamp reads as a
+// valid time once unescaped, but Go's time.Time.UnmarshalJSON parses the
+// raw token and refuses it. The tool must refuse all four positions.
+func TestReleaseForArtifactEscapedTimestamps(t *testing.T) {
+ ctx := context.Background()
+ pub := lookupPubKey(t)
+ full := lookupPayload(t, filepath.Join(lookupDiffDir, "accept-full.json"))
+ esc := "\\" + "u002d" // an escaped "-"
+ for name, payload := range map[string][]byte{
+ "promoted_at": replaceNth(t, full, `"promoted_at": "2026-11-09T13`, `"promoted_at": "2026`+esc+`11-09T13`, 1),
+ "current released_at": replaceNth(t, full, `"released_at": "2026-11`, `"released_at": "2026`+esc+`11`, 1),
+ "history released_at": replaceNth(t, full, `"released_at": "2026-11`, `"released_at": "2026`+esc+`11`, 2),
+ "audit at": replaceNth(t, full, `"at": "2026-11`, `"at": "2026`+esc+`11`, 1),
+ } {
+ t.Run(name, func(t *testing.T) {
+ var p map[string]any
+ if err := json.Unmarshal(payload, &p); err != nil {
+ t.Fatalf("the case is not JSON: %v", err)
+ }
+ s := &lookupStore{pointers: map[string][]byte{"stable": lookupSign(t, payload)}}
+ if _, _, err := GetSystemPointer(ctx, s, pub, "router", "stable"); err == nil {
+ t.Fatal("GetSystemPointer accepts an escaped timestamp")
+ }
+ if _, err := ReleaseForArtifact(ctx, s, pub, []string{"stable"}, "linux-arm64", lookupCurrent); pointerFault(err) != PointerInvalid {
+ t.Fatalf("err = %v, want invalid", err)
+ }
+ })
+ }
+ // The unescaped original is accepted: the refusal is the escape's.
+ s := &lookupStore{pointers: map[string][]byte{"stable": lookupSign(t, full)}}
+ if v, err := ReleaseForArtifact(ctx, s, pub, []string{"stable"}, "linux-arm64", lookupCurrent); err != nil || v != "v0.35.1" {
+ t.Fatalf("re-signed accept-full: %q, %v", v, err)
+ }
+}
+
+// TestReleaseForArtifactConservative: the rest of the floor branch's
+// conservative decoder, where Go's decoder is more lenient than the tool
+// or reads a value differently. Each refuses as invalid.
+func TestReleaseForArtifactConservative(t *testing.T) {
+ ctx := context.Background()
+ pub := lookupPubKey(t)
+ base := string(routerPayload(t, "v0.35.1", lookupCurrent, "stable", nil))
+ sub := func(old, new string) []byte {
+ if !strings.Contains(base, old) {
+ t.Fatalf("%q not in the base payload", old)
+ }
+ return []byte(strings.Replace(base, old, new, 1))
+ }
+ for name, payload := range map[string][]byte{
+ "lone surrogate": sub(`"source": "release:v0.35.1"`, `"source": "release:`+"\\ud800"+`"`),
+ "invalid UTF-8 in a string": sub(`"source": "release:v0.35.1"`, "\"source\": \"release:\xff\""),
+ "comma fraction": sub(`"promoted_at": "2026-11-09T12:00:00Z"`, `"promoted_at": "2026-11-09T12:00:00,5Z"`),
+ "ten fraction digits": sub(`"promoted_at": "2026-11-09T12:00:00Z"`, `"promoted_at": "2026-11-09T12:00:00.1234567890Z"`),
+ "year zero": sub(`"released_at": "2026-11-09T12:00:00Z"`, `"released_at": "0000-11-09T12:00:00Z"`),
+ "promoted before year one": sub(`"promoted_at": "2026-11-09T12:00:00Z"`, `"promoted_at": "0001-01-01T00:30:00+01:00"`),
+ "schema 1.0": sub(`"schema": 1`, `"schema": 1.0`),
+ "null release_tag": sub(`"release_tag": "v0.35.1"`, `"release_tag": null`),
+ "null artifact": sub(`"artifacts": {`, `"artifacts": {"linux-amd64": null,`),
+ "artifact unknown field": sub(`"sha256": "`+lookupCurrent+`"`, `"sha256": "`+lookupCurrent+`", "size": 1`),
+ "artifact platform case pair": sub(`"artifacts": {`, `"artifacts": {"LINUX-ARM64": {"key": "x", "sha256": "y"},`),
+ "payload cased field": sub(`"schema": 1`, `"Schema": 1`),
+ "payload with a BOM": append([]byte("\xef\xbb\xbf"), base...),
+ } {
+ t.Run(name, func(t *testing.T) {
+ s := &lookupStore{pointers: map[string][]byte{"stable": lookupSign(t, payload)}}
+ if _, err := ReleaseForArtifact(ctx, s, pub, []string{"stable"}, "linux-arm64", lookupCurrent); pointerFault(err) != PointerInvalid {
+ t.Fatalf("err = %v, want invalid", err)
+ }
+ })
+ }
+ // A valid surrogate pair is one character, as in Python: accepted.
+ s := &lookupStore{pointers: map[string][]byte{"stable": lookupSign(t, sub(`"source": "release:v0.35.1"`, `"source": "release:`+"\\ud83d\\ude00"+`"`))}}
+ if v, err := ReleaseForArtifact(ctx, s, pub, []string{"stable"}, "linux-arm64", lookupCurrent); err != nil || v != "v0.35.1" {
+ t.Fatalf("surrogate pair: %q, %v", v, err)
+ }
+
+ // The wrapper: an extra field or a cased one is invalid, never scoped.
+ golden := lookupRead(t, lookupGolden)
+ var w map[string]any
+ if err := json.Unmarshal(golden, &w); err != nil {
+ t.Fatal(err)
+ }
+ for name, extra := range map[string]string{"note": "note", "cased grant": "Grant"} {
+ m := map[string]any{"payload": w["payload"], "sig": w["sig"], extra: map[string]any{"payload": "e30=", "sig": "AA=="}}
+ body, _ := json.Marshal(m)
+ s := &lookupStore{pointers: map[string][]byte{"stable": body}}
+ if _, err := ReleaseForArtifact(ctx, s, pub, []string{"stable"}, "linux-arm64", lookupCurrent); pointerFault(err) != PointerInvalid {
+ t.Fatalf("wrapper %s: err = %v, want invalid", name, err)
+ }
+ }
+}
diff --git a/internal/release/testdata/router-pointer-diff/accept-base.json b/internal/release/testdata/router-pointer-diff/accept-base.json
new file mode 100644
index 000000000..0ede2ff03
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/accept-base.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKfQ==",
+ "sig": "fe+gStv9ZU9DP/0gIBjv2sTH/F3B2NwEj7iWzesxmjlKpWMyMRQ5+fAC5pLQx6bacCDXFPBw1AUrW55wEANQAQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/accept-full.json b/internal/release/testdata/router-pointer-diff/accept-full.json
new file mode 100644
index 000000000..391002976
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/accept-full.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0sCiAgICAgICJsaW51eC1hbWQ2NCI6IHsKICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzUuMS9jYXJsb3MtbGludXgtYW1kNjQiLAogICAgICAgICJzaGEyNTYiOiAiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMiIKICAgICAgfQogICAgfSwKICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zNS4xIiwKICAgICJyZWxlYXNlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICB9LAogICJzcHJlYWQiOiAiMWgzMG0wLjVzIiwKICAicHJvbW90ZWRfYXQiOiAiMjAyNi0xMS0wOVQxMzowMDowMC4yNSswMTowMCIsCiAgImhpc3RvcnkiOiBbCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zNS4wIiwKICAgICAgInZlcnNpb24iOiAidjAuMzUuMCIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjAvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiNTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NSIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zNS4wIiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInJlbGVhc2VfdGFnIjogInYwLjM0LjkiLAogICAgICAidmVyc2lvbiI6ICJ2MC4zNC45IiwKICAgICAgImFydGlmYWN0cyI6IHsKICAgICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzQuOS9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICIzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzIgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjM0LjkiLAogICAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9CiAgXSwKICAiYWN0aXZhdGlvbl9pZCI6ICJhY3QtMSIsCiAgImFsbG93X2JlbG93X3Jvb3Rmc19mbG9vciI6IGZhbHNlLAogICJhdWRpdCI6IFsKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgICAgICJmcm9tIjogImJldGEiLAogICAgICAidG8iOiAic3RhYmxlIiwKICAgICAgImFjdG9yIjogIm9wZXJhdG9yQGV4YW1wbGUudGVzdCIsCiAgICAgICJob3RmaXgiOiB0cnVlLAogICAgICAiZmFzdF90cmFjayI6IGZhbHNlLAogICAgICAicmV0cnkiOiB0cnVlCiAgICB9CiAgXQp9",
+ "sig": "SzpkChSZkXksk5KbU0nrt0Su1QfKhiauMomAPTaHC37ezXw6o7veHX4sXmZw/cq02lJ4y55hV3UOZvCR4ydmBA=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/cases.json b/internal/release/testdata/router-pointer-diff/cases.json
new file mode 100644
index 000000000..24d29cab2
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/cases.json
@@ -0,0 +1,118 @@
+{
+ "accept-base": {
+ "go": "accept",
+ "tool": "accept"
+ },
+ "accept-full": {
+ "go": "accept",
+ "tool": "accept"
+ },
+ "conservative-audit-null": {
+ "go": "accept",
+ "tool": "refuse"
+ },
+ "conservative-duplicate-key": {
+ "go": "accept",
+ "tool": "refuse"
+ },
+ "conservative-history-capital-ambiguous": {
+ "go": "accept",
+ "tool": "refuse"
+ },
+ "conservative-unknown-field": {
+ "go": "accept",
+ "tool": "refuse"
+ },
+ "conservative-wrapper-duplicate-key": {
+ "go": "accept",
+ "tool": "refuse"
+ },
+ "reject-activation-id-capital-number": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-activation-id-number": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-21": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-actor-number": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-at-capital-bad": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-capital-21": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-fast-track-string": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-hotfix-string": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-retry-number": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-audit-version-number": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-console-artifacts-capital-invalid": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-history-11": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-history-capital-empty": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-history-released-at-bad": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-payload-bom": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-payload-nan": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-payload-not-object": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-payload-utf16": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-promoted-at-hour-24": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-promoted-at-offset-99": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-wrapper-bom": {
+ "go": "reject",
+ "tool": "refuse"
+ },
+ "reject-wrapper-utf16": {
+ "go": "reject",
+ "tool": "refuse"
+ }
+}
diff --git a/internal/release/testdata/router-pointer-diff/conservative-audit-null.json b/internal/release/testdata/router-pointer-diff/conservative-audit-null.json
new file mode 100644
index 000000000..e78083cc8
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/conservative-audit-null.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogbnVsbAp9",
+ "sig": "vEgya9IApzT79P9OXlvKE+wKY1IhwzO/dVxR82q/2CYEsZkvFkOoxwCxlWp/7ZKF04i9Ij8ycvUw4K0hG3J3Ag=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/conservative-duplicate-key.json b/internal/release/testdata/router-pointer-diff/conservative-duplicate-key.json
new file mode 100644
index 000000000..fa64aff84
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/conservative-duplicate-key.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJzcHJlYWQiOiAiNW0wcyIsCiAgInByb21vdGVkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgp9",
+ "sig": "zyt78FbTHuAY+kSXmk7HocFJTZNs3CrFCEbq+heIJBhp2f20ju/P/ixqH0GJF7t6NT4BuV5n45NzP/zLMJksCA=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/conservative-history-capital-ambiguous.json b/internal/release/testdata/router-pointer-diff/conservative-history-capital-ambiguous.json
new file mode 100644
index 000000000..8674e6269
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/conservative-history-capital-ambiguous.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgIkhpc3RvcnkiOiBbCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zNC4wIiwKICAgICAgInZlcnNpb24iOiAidjAuMzQuMCIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM0LjAvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zNC4wIiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfQogIF0KfQ==",
+ "sig": "vCoVNzlNyxsqHyLlQrfeg+ctIWIkeppc9e0/QfXos+1TCkMvpnmkA0qn0dBq3YNrapgGklf2RNd8VAIv5xETBQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/conservative-unknown-field.json b/internal/release/testdata/router-pointer-diff/conservative-unknown-field.json
new file mode 100644
index 000000000..a70dbf972
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/conservative-unknown-field.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgIm5vdGUiOiAieCIKfQ==",
+ "sig": "30vioogUGlLcPfxT+cOQIvTZ4GeIq99MlZvwAknt2UP8pGsC/hNsy7+7BhZ45vZSjQCWn4bVsxEWCaZjwNCeBw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/conservative-wrapper-duplicate-key.json b/internal/release/testdata/router-pointer-diff/conservative-wrapper-duplicate-key.json
new file mode 100644
index 000000000..372dc360a
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/conservative-wrapper-duplicate-key.json
@@ -0,0 +1 @@
+{"payload": "e30=", "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKfQ==", "sig": "fe+gStv9ZU9DP/0gIBjv2sTH/F3B2NwEj7iWzesxmjlKpWMyMRQ5+fAC5pLQx6bacCDXFPBw1AUrW55wEANQAQ=="}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-activation-id-capital-number.json b/internal/release/testdata/router-pointer-diff/reject-activation-id-capital-number.json
new file mode 100644
index 000000000..8393f0f33
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-activation-id-capital-number.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgIkFjdGl2YXRpb25fSUQiOiA3Cn0=",
+ "sig": "mEmkq1DNz7UdQLLQ0QFxIYXVPhk1/MeOKaXg3mdyj7h3sCqmk3RNZd7N8DUBFzUkW9shItJDvBBY4jVtPxesDw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-activation-id-number.json b/internal/release/testdata/router-pointer-diff/reject-activation-id-number.json
new file mode 100644
index 000000000..2f6df67a3
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-activation-id-number.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImFjdGl2YXRpb25faWQiOiA3Cn0=",
+ "sig": "r0jKaiGqp2Y5hQFXDjux/jJjYG0yiHwq1kjHIzLiCreeMcG/eWZcUiS62IKKbSaDs9s8cvQTnltaTohktBANBA=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-21.json b/internal/release/testdata/router-pointer-diff/reject-audit-21.json
new file mode 100644
index 000000000..e7da0fc7a
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-21.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAgICJhdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjEiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9CiAgXQp9",
+ "sig": "4BouCfoezShHOp+wLoGBnEwpBIU74TVQXhyB0dAL0B47qBZytv2YLy2OR++pw40RGqsY85ddYfw5GmyJGt1cDQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-actor-number.json b/internal/release/testdata/router-pointer-diff/reject-audit-actor-number.json
new file mode 100644
index 000000000..7875bd36d
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-actor-number.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIiwKICAgICAgImFjdG9yIjogNQogICAgfQogIF0KfQ==",
+ "sig": "IZkkkBHPYtr1BrIKkcI4rZTtXDwc1AlNuVanQC26rk90PydmEV9BRw5kpnQOOE9tdTZv/6sb1NJOiJfOsVXvAw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-at-capital-bad.json b/internal/release/testdata/router-pointer-diff/reject-audit-at-capital-bad.json
new file mode 100644
index 000000000..b117669fd
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-at-capital-bad.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgIkF0IjogImJhZCIKICAgIH0KICBdCn0=",
+ "sig": "jSodlJvAmBZRCuSHjN7QtFK6QGuJokas3x70iPvL0sbp9VytMvbsiqHJIDpfNWNxWp9pvLpt3/kbuAE1GeS9Aw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-capital-21.json b/internal/release/testdata/router-pointer-diff/reject-audit-capital-21.json
new file mode 100644
index 000000000..7cb8ce97b
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-capital-21.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgIkF1ZGl0IjogWwogICAge30sCiAgICB7fSwKICAgIHt9LAogICAge30sCiAgICB7fSwKICAgIHt9LAogICAge30sCiAgICB7fSwKICAgIHt9LAogICAge30sCiAgICB7fSwKICAgIHt9LAogICAge30sCiAgICB7fSwKICAgIHt9LAogICAge30sCiAgICB7fSwKICAgIHt9LAogICAge30sCiAgICB7fSwKICAgIHt9CiAgXQp9",
+ "sig": "ETbo9Pcqqc4dDPS8s7lGAcAgHmT1cf6GegHN4P5d49kV59elT+yGpx5vh5xs+acwocXj7KcA1xo/Uw1RkAjMBg=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-fast-track-string.json b/internal/release/testdata/router-pointer-diff/reject-audit-fast-track-string.json
new file mode 100644
index 000000000..e09177ba5
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-fast-track-string.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIiwKICAgICAgImZhc3RfdHJhY2siOiAidHJ1ZSIKICAgIH0KICBdCn0=",
+ "sig": "MEEXFVSwe7zReYJxh+gn1Mn6r1j0Ow/Q5MbpYGhl2Uq8iIVOsS3MA7ZnE8Ika65sxQt8PKTjXhtysIfBwbXXDQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-hotfix-string.json b/internal/release/testdata/router-pointer-diff/reject-audit-hotfix-string.json
new file mode 100644
index 000000000..eed60b645
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-hotfix-string.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIiwKICAgICAgImhvdGZpeCI6ICJmYWxzZSIKICAgIH0KICBdCn0=",
+ "sig": "u/yh87r1yRVibkXB5fYCSHi8FeDjQUiBVYVqyJNUDwBWd7STpMc6sVFj0Kf7GeYccqa+6Tl5nAKR+O5NS3zMDA=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-retry-number.json b/internal/release/testdata/router-pointer-diff/reject-audit-retry-number.json
new file mode 100644
index 000000000..e0e0ff684
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-retry-number.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIiwKICAgICAgInJldHJ5IjogMQogICAgfQogIF0KfQ==",
+ "sig": "B0HD5PfYbNQ9K0jtXh3pm+rv0xIG8ffWa07t7PJS09fu6YvnXPXv2m1P6Xw9Pb/UtwYlwzd79IWJgqTfKu5KAw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-audit-version-number.json b/internal/release/testdata/router-pointer-diff/reject-audit-version-number.json
new file mode 100644
index 000000000..058f2cdb6
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-audit-version-number.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6IDEyMywKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfQogIF0KfQ==",
+ "sig": "V31p054D04YUgdq/QshJaf6CX/4+t6x3wjsYx5gwmudJULaezuOfJbnZrri/gRb+b2l4xV0mmGw1dXARhhYdBg=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-console-artifacts-capital-invalid.json b/internal/release/testdata/router-pointer-diff/reject-console-artifacts-capital-invalid.json
new file mode 100644
index 000000000..9f33939a3
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-console-artifacts-capital-invalid.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiLAogICAgIkNvbnNvbGVfQXJ0aWZhY3RzIjogewogICAgICAieCI6IHt9CiAgICB9CiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKfQ==",
+ "sig": "dSFKTLNinO4kQYTHQ3OpWdaSlEkQAxdrdsavz0fIySc7Jxn3+NqHkl9JblcDmO6+MuRh5P4KB+OuLDGWEAx5AQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-history-11.json b/internal/release/testdata/router-pointer-diff/reject-history-11.json
new file mode 100644
index 000000000..a1170af7d
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-history-11.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImhpc3RvcnkiOiBbCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zMC4wIiwKICAgICAgInZlcnNpb24iOiAidjAuMzAuMCIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjMwLjAvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MDYwNjA2MCIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zMC4wIiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInJlbGVhc2VfdGFnIjogInYwLjMwLjEiLAogICAgICAidmVyc2lvbiI6ICJ2MC4zMC4xIiwKICAgICAgImFydGlmYWN0cyI6IHsKICAgICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzAuMS9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICI2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxNjE2MTYxIgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjMwLjEiLAogICAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAicmVsZWFzZV90YWciOiAidjAuMzAuMiIsCiAgICAgICJ2ZXJzaW9uIjogInYwLjMwLjIiLAogICAgICAiYXJ0aWZhY3RzIjogewogICAgICAgICJsaW51eC1hcm02NCI6IHsKICAgICAgICAgICJrZXkiOiAiYm9vdHN0cmFwL3JvdXRlci92MC4zMC4yL2Nhcmxvcy1saW51eC1hcm02NCIsCiAgICAgICAgICAic2hhMjU2IjogIjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjI2MjYyNjIiCiAgICAgICAgfQogICAgICB9LAogICAgICAic291cmNlIjogInJlbGVhc2U6djAuMzAuMiIsCiAgICAgICJyZWxlYXNlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zMC4zIiwKICAgICAgInZlcnNpb24iOiAidjAuMzAuMyIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjMwLjMvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MzYzNjM2MyIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zMC4zIiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInJlbGVhc2VfdGFnIjogInYwLjMwLjQiLAogICAgICAidmVyc2lvbiI6ICJ2MC4zMC40IiwKICAgICAgImFydGlmYWN0cyI6IHsKICAgICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzAuNC9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICI2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0NjQ2NDY0IgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjMwLjQiLAogICAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAicmVsZWFzZV90YWciOiAidjAuMzAuNSIsCiAgICAgICJ2ZXJzaW9uIjogInYwLjMwLjUiLAogICAgICAiYXJ0aWZhY3RzIjogewogICAgICAgICJsaW51eC1hcm02NCI6IHsKICAgICAgICAgICJrZXkiOiAiYm9vdHN0cmFwL3JvdXRlci92MC4zMC41L2Nhcmxvcy1saW51eC1hcm02NCIsCiAgICAgICAgICAic2hhMjU2IjogIjY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjU2NTY1NjUiCiAgICAgICAgfQogICAgICB9LAogICAgICAic291cmNlIjogInJlbGVhc2U6djAuMzAuNSIsCiAgICAgICJyZWxlYXNlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zMC42IiwKICAgICAgInZlcnNpb24iOiAidjAuMzAuNiIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjMwLjYvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiNjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NiIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zMC42IiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInJlbGVhc2VfdGFnIjogInYwLjMwLjciLAogICAgICAidmVyc2lvbiI6ICJ2MC4zMC43IiwKICAgICAgImFydGlmYWN0cyI6IHsKICAgICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzAuNy9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICI2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3Njc2NzY3IgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjMwLjciLAogICAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAicmVsZWFzZV90YWciOiAidjAuMzAuOCIsCiAgICAgICJ2ZXJzaW9uIjogInYwLjMwLjgiLAogICAgICAiYXJ0aWZhY3RzIjogewogICAgICAgICJsaW51eC1hcm02NCI6IHsKICAgICAgICAgICJrZXkiOiAiYm9vdHN0cmFwL3JvdXRlci92MC4zMC44L2Nhcmxvcy1saW51eC1hcm02NCIsCiAgICAgICAgICAic2hhMjU2IjogIjY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4Njg2ODY4NjgiCiAgICAgICAgfQogICAgICB9LAogICAgICAic291cmNlIjogInJlbGVhc2U6djAuMzAuOCIsCiAgICAgICJyZWxlYXNlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICAgIH0sCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zMC45IiwKICAgICAgInZlcnNpb24iOiAidjAuMzAuOSIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjMwLjkvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiNjk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OTY5Njk2OSIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zMC45IiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfSwKICAgIHsKICAgICAgInJlbGVhc2VfdGFnIjogInYwLjMwLjEwIiwKICAgICAgInZlcnNpb24iOiAidjAuMzAuMTAiLAogICAgICAiYXJ0aWZhY3RzIjogewogICAgICAgICJsaW51eC1hcm02NCI6IHsKICAgICAgICAgICJrZXkiOiAiYm9vdHN0cmFwL3JvdXRlci92MC4zMC4xMC9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICI3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwNzA3MDcwIgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjMwLjEwIiwKICAgICAgInJlbGVhc2VkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgogICAgfQogIF0KfQ==",
+ "sig": "O00JElpbGKBp+x8jypcXooak1cJ51JCXckSSywFNvcPg60Loe+XkE7U7JmOGTLKHuu4gkCvOc2A42pQF/wJQDQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-history-capital-empty.json b/internal/release/testdata/router-pointer-diff/reject-history-capital-empty.json
new file mode 100644
index 000000000..efc8980d9
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-history-capital-empty.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgIkhpc3RvcnkiOiBbCiAgICB7fQogIF0KfQ==",
+ "sig": "R6F3aI6LiQGSZGFSXp2OAckdmCW9F2IO4D7oKeI82Hxhz0NJCfyxOuGDUZrJJeeV3mnXksGEXgGLvrs08N2OCg=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-history-released-at-bad.json b/internal/release/testdata/router-pointer-diff/reject-history-released-at-bad.json
new file mode 100644
index 000000000..40b2ad311
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-history-released-at-bad.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIsCiAgImhpc3RvcnkiOiBbCiAgICB7CiAgICAgICJyZWxlYXNlX3RhZyI6ICJ2MC4zNS4wIiwKICAgICAgInZlcnNpb24iOiAidjAuMzUuMCIsCiAgICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICAgImxpbnV4LWFybTY0IjogewogICAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjAvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAgICJzaGEyNTYiOiAiNTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NSIKICAgICAgICB9CiAgICAgIH0sCiAgICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zNS4wIiwKICAgICAgInJlbGVhc2VkX2F0IjogInNvb24iCiAgICB9CiAgXQp9",
+ "sig": "+2Y24HPzwGG2dLKvbfcRuRnVw1zzTEVnzCYp3Y1QGOBICEMR0an8gDQb/gC7H/bmXYj33NaB0p3LRod9cKu3Bw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-payload-bom.json b/internal/release/testdata/router-pointer-diff/reject-payload-bom.json
new file mode 100644
index 000000000..87928599c
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-payload-bom.json
@@ -0,0 +1,4 @@
+{
+ "payload": "77u/ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKfQ==",
+ "sig": "v5dIV5xuoXDu7PzCqRVqxJR4V0pqRrHPpm5oeTMlvKkrlZIZJ1Sg/ytVftHh83iM9y7+eBr4jKsJkLZJEbeADw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-payload-nan.json b/internal/release/testdata/router-pointer-diff/reject-payload-nan.json
new file mode 100644
index 000000000..66624af90
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-payload-nan.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiBOYU4sCiAgImNvbXBvbmVudCI6ICJyb3V0ZXIiLAogICJjaGFubmVsIjogInN0YWJsZSIsCiAgImN1cnJlbnQiOiB7CiAgICAicmVsZWFzZV90YWciOiAidjAuMzUuMSIsCiAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICJhcnRpZmFjdHMiOiB7CiAgICAgICJsaW51eC1hcm02NCI6IHsKICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzUuMS9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICJzaGEyNTYiOiAiMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIKICAgICAgfQogICAgfSwKICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zNS4xIiwKICAgICJyZWxlYXNlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICB9LAogICJzcHJlYWQiOiAiNW0wcyIsCiAgInByb21vdGVkX2F0IjogIjIwMjYtMTEtMDlUMTI6MDA6MDBaIgp9",
+ "sig": "0h4mbTLZc8bJbMkFmEDnfXpfKFzWCZgAYS3lzT9/ONIytOvvd/ag+fwEedulSYgDYoVR2f22SGItjuEc0D+vDA=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-payload-not-object.json b/internal/release/testdata/router-pointer-diff/reject-payload-not-object.json
new file mode 100644
index 000000000..7fc34bec9
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-payload-not-object.json
@@ -0,0 +1,4 @@
+{
+ "payload": "W10=",
+ "sig": "CwjDRh/HWIQBgv85z9mvqwNcWULRKLnuiRdchz+sYgM3QAajN8Xpqit4Y0SaWOI1Vw3+6t+HexLezJIcNrwtDQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-payload-utf16.json b/internal/release/testdata/router-pointer-diff/reject-payload-utf16.json
new file mode 100644
index 000000000..fa189c4fd
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-payload-utf16.json
@@ -0,0 +1,4 @@
+{
+ "payload": "//57AAoAIAAgACIAcwBjAGgAZQBtAGEAIgA6ACAAMQAsAAoAIAAgACIAYwBvAG0AcABvAG4AZQBuAHQAIgA6ACAAIgByAG8AdQB0AGUAcgAiACwACgAgACAAIgBjAGgAYQBuAG4AZQBsACIAOgAgACIAcwB0AGEAYgBsAGUAIgAsAAoAIAAgACIAYwB1AHIAcgBlAG4AdAAiADoAIAB7AAoAIAAgACAAIAAiAHIAZQBsAGUAYQBzAGUAXwB0AGEAZwAiADoAIAAiAHYAMAAuADMANQAuADEAIgAsAAoAIAAgACAAIAAiAHYAZQByAHMAaQBvAG4AIgA6ACAAIgB2ADAALgAzADUALgAxACIALAAKACAAIAAgACAAIgBhAHIAdABpAGYAYQBjAHQAcwAiADoAIAB7AAoAIAAgACAAIAAgACAAIgBsAGkAbgB1AHgALQBhAHIAbQA2ADQAIgA6ACAAewAKACAAIAAgACAAIAAgACAAIAAiAGsAZQB5ACIAOgAgACIAYgBvAG8AdABzAHQAcgBhAHAALwByAG8AdQB0AGUAcgAvAHYAMAAuADMANQAuADEALwBjAGEAcgBsAG8AcwAtAGwAaQBuAHUAeAAtAGEAcgBtADYANAAiACwACgAgACAAIAAgACAAIAAgACAAIgBzAGgAYQAyADUANgAiADoAIAAiADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAMQAxADEAIgAKACAAIAAgACAAIAAgAH0ACgAgACAAIAAgAH0ALAAKACAAIAAgACAAIgBzAG8AdQByAGMAZQAiADoAIAAiAHIAZQBsAGUAYQBzAGUAOgB2ADAALgAzADUALgAxACIALAAKACAAIAAgACAAIgByAGUAbABlAGEAcwBlAGQAXwBhAHQAIgA6ACAAIgAyADAAMgA2AC0AMQAxAC0AMAA5AFQAMQAyADoAMAAwADoAMAAwAFoAIgAKACAAIAB9ACwACgAgACAAIgBzAHAAcgBlAGEAZAAiADoAIAAiADUAbQAwAHMAIgAsAAoAIAAgACIAcAByAG8AbQBvAHQAZQBkAF8AYQB0ACIAOgAgACIAMgAwADIANgAtADEAMQAtADAAOQBUADEAMgA6ADAAMAA6ADAAMABaACIACgB9AA==",
+ "sig": "bajUk2pPC0iNwhZi0RzT3GXiMGxwmpb51Swos/okGlIvFmPrSLlp2FBp/EnJ5vghYISebWMnwKbExqmArkpKAg=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-promoted-at-hour-24.json b/internal/release/testdata/router-pointer-diff/reject-promoted-at-hour-24.json
new file mode 100644
index 000000000..d757d51d7
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-promoted-at-hour-24.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDI0OjAwOjAwWiIKfQ==",
+ "sig": "u9PG4+FvhtktcWO1y4ZmATgAKwjSTc/k9HLrLwdZAWlEwwbAjQo+qqDACd9UZYlEIMIgGFBkFKhNLSinsGl+Dw=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-promoted-at-offset-99.json b/internal/release/testdata/router-pointer-diff/reject-promoted-at-offset-99.json
new file mode 100644
index 000000000..bd2e8ddd9
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-promoted-at-offset-99.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwKzAwOjk5Igp9",
+ "sig": "2CPLYNhTIkIpBbTlehN5vI21pgpYGxSBIoUdSdaesS84VyB0TylU6WziJ07d9D6D77AlYkIePbXahqoalc2ZAQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-wrapper-bom.json b/internal/release/testdata/router-pointer-diff/reject-wrapper-bom.json
new file mode 100644
index 000000000..64dc56604
--- /dev/null
+++ b/internal/release/testdata/router-pointer-diff/reject-wrapper-bom.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFybTY0IiwKICAgICAgICAic2hhMjU2IjogIjExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTEiCiAgICAgIH0KICAgIH0sCiAgICAic291cmNlIjogInJlbGVhc2U6djAuMzUuMSIsCiAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgfSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKfQ==",
+ "sig": "fe+gStv9ZU9DP/0gIBjv2sTH/F3B2NwEj7iWzesxmjlKpWMyMRQ5+fAC5pLQx6bacCDXFPBw1AUrW55wEANQAQ=="
+}
\ No newline at end of file
diff --git a/internal/release/testdata/router-pointer-diff/reject-wrapper-utf16.json b/internal/release/testdata/router-pointer-diff/reject-wrapper-utf16.json
new file mode 100644
index 000000000..6a84d8bee
Binary files /dev/null and b/internal/release/testdata/router-pointer-diff/reject-wrapper-utf16.json differ
diff --git a/internal/release/testdata/router-pointer-golden.json b/internal/release/testdata/router-pointer-golden.json
new file mode 100644
index 000000000..82560926a
--- /dev/null
+++ b/internal/release/testdata/router-pointer-golden.json
@@ -0,0 +1,4 @@
+{
+ "payload": "ewogICJzY2hlbWEiOiAxLAogICJjb21wb25lbnQiOiAicm91dGVyIiwKICAiY2hhbm5lbCI6ICJzdGFibGUiLAogICJjdXJyZW50IjogewogICAgInJlbGVhc2VfdGFnIjogInYwLjM1LjEiLAogICAgInZlcnNpb24iOiAidjAuMzUuMSIsCiAgICAiYXJ0aWZhY3RzIjogewogICAgICAibGludXgtYW1kNjQiOiB7CiAgICAgICAgImtleSI6ICJib290c3RyYXAvcm91dGVyL3YwLjM1LjEvY2FybG9zLWxpbnV4LWFtZDY0IiwKICAgICAgICAic2hhMjU2IjogIjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIiCiAgICAgIH0sCiAgICAgICJsaW51eC1hcm02NCI6IHsKICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzUuMS9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICJzaGEyNTYiOiAiMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMTExMSIKICAgICAgfQogICAgfSwKICAgICJzb3VyY2UiOiAicmVsZWFzZTp2MC4zNS4xIiwKICAgICJyZWxlYXNlZF9hdCI6ICIyMDI2LTExLTA5VDEyOjAwOjAwWiIKICB9LAogICJoaXN0b3J5IjogWwogICAgewogICAgICAicmVsZWFzZV90YWciOiAidjAuMzUuMCIsCiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjAiLAogICAgICAiYXJ0aWZhY3RzIjogewogICAgICAgICJsaW51eC1hbWQ2NCI6IHsKICAgICAgICAgICJrZXkiOiAiYm9vdHN0cmFwL3JvdXRlci92MC4zNS4wL2Nhcmxvcy1saW51eC1hbWQ2NCIsCiAgICAgICAgICAic2hhMjU2IjogIjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjYiCiAgICAgICAgfSwKICAgICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzUuMC9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICI1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1IgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjM1LjAiLAogICAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9LAogICAgewogICAgICAicmVsZWFzZV90YWciOiAidjAuMzQuOSIsCiAgICAgICJ2ZXJzaW9uIjogInYwLjM0LjkiLAogICAgICAiYXJ0aWZhY3RzIjogewogICAgICAgICJsaW51eC1hbWQ2NCI6IHsKICAgICAgICAgICJrZXkiOiAiYm9vdHN0cmFwL3JvdXRlci92MC4zNC45L2Nhcmxvcy1saW51eC1hbWQ2NCIsCiAgICAgICAgICAic2hhMjU2IjogIjQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQiCiAgICAgICAgfSwKICAgICAgICAibGludXgtYXJtNjQiOiB7CiAgICAgICAgICAia2V5IjogImJvb3RzdHJhcC9yb3V0ZXIvdjAuMzQuOS9jYXJsb3MtbGludXgtYXJtNjQiLAogICAgICAgICAgInNoYTI1NiI6ICIzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzIgogICAgICAgIH0KICAgICAgfSwKICAgICAgInNvdXJjZSI6ICJyZWxlYXNlOnYwLjM0LjkiLAogICAgICAicmVsZWFzZWRfYXQiOiAiMjAyNi0xMS0wOVQxMjowMDowMFoiCiAgICB9CiAgXSwKICAic3ByZWFkIjogIjVtMHMiLAogICJwcm9tb3RlZF9hdCI6ICIyMDI2LTExLTA5VDIxOjA3OjM5WiIsCiAgImF1ZGl0IjogWwogICAgewogICAgICAidmVyc2lvbiI6ICJ2MC4zNS4xIiwKICAgICAgImZyb20iOiAidjAuMzUuMCIsCiAgICAgICJ0byI6ICJzdGFibGUiLAogICAgICAiYWN0b3IiOiAib3BlcmF0b3JAZXhhbXBsZS50ZXN0IiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMjE6MDc6MzkuNTU1ODkzMTg3WiIKICAgIH0sCiAgICB7CiAgICAgICJ2ZXJzaW9uIjogInYwLjM1LjAiLAogICAgICAiZnJvbSI6ICJ2MC4zNC45IiwKICAgICAgInRvIjogInN0YWJsZSIsCiAgICAgICJhY3RvciI6ICJvcGVyYXRvckBleGFtcGxlLnRlc3QiLAogICAgICAiYXQiOiAiMjAyNi0xMS0wOVQyMTowNzozOS41NDI5NjUwNzlaIgogICAgfSwKICAgIHsKICAgICAgInZlcnNpb24iOiAidjAuMzQuOSIsCiAgICAgICJ0byI6ICJzdGFibGUiLAogICAgICAiYWN0b3IiOiAib3BlcmF0b3JAZXhhbXBsZS50ZXN0IiwKICAgICAgImF0IjogIjIwMjYtMTEtMDlUMjE6MDc6MzkuNTI3MzYxOTZaIgogICAgfQogIF0KfQ==",
+ "sig": "Bj7HulX5Rkee9kya0CHv/O/PF2vHuFZEMJgMveT8kRgEviOusDGIeq1h2ClWHAE/+0U3vcg0Lj0T9iy8sKBZBA=="
+}
diff --git a/internal/release/testdata/router-pointer-golden.pub b/internal/release/testdata/router-pointer-golden.pub
new file mode 100644
index 000000000..047b1976c
--- /dev/null
+++ b/internal/release/testdata/router-pointer-golden.pub
@@ -0,0 +1 @@
+ebVWLo/mVPlAeLES6KmLp5AfhTrmlb7X4OORC60ElmQ=
diff --git a/region_ha_boundary_test.go b/region_ha_boundary_test.go
index c46dbf72f..249877e13 100644
--- a/region_ha_boundary_test.go
+++ b/region_ha_boundary_test.go
@@ -54,6 +54,8 @@ var regionHACoreFiles = []string{
"internal/grouproll/status.go",
"internal/grouproll/classify.go",
"internal/grouproll/terminate.go",
+ "internal/grouproll/floor.go",
+ "internal/release/systemlookup.go",
}
// regionHAAdapterFiles are spec 2's AWS adapters. Each is named for AWS so