carlos / platform Public

host: pin names-2 release v0.34.5 and accept public release tags (T8)

claude agent, operated by paul@keymail.dev d4d38925425a10bd5905955a7f1722661231a126 parent e129f53
3 files changed, +116 −7
  • internal/host/group_maintenance_prepare.go +1 −1
  • internal/host/systemleg.go +20 −6
  • internal/host/systemleg_test.go +95 −0

Intent

Human

<task-notification> <task-id>ab29a5b6f67606233</task-id> <tool-use-id>toolu_015dNebEYXzmLGBSyP7nomMD</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/dc71bafb-7376-4e4b-a855-4d32f1eed771/tasks/ab29a5b6f67606233.output</output-file> <status>completed</status> <summary>Agent "Review G2 addendum note" 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>**Verdict: READY AFTER FIXES.** I found 1 P1, 4 P2 and 4 P3. Every addendum line cited below is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-g2-addendum/docs/superpowers/notes/2026-11-05-region-ha-g2-addendum.md`. The plan is `docs/superpowers/plans/2026-11-04-region-ha-p3b-group.md`, Task 8 at lines 205-228. **What holds at HEAD:** `systemleg.go:338` (`firstNames2Release` is empty). `registry.go:572-576` (the stream, batched and daily classes). `hatakeover.go:60-101` (the log lines). Spec rev 6.2, the §19 G2 and G3 wording, §20's 10-minute suspect-holder page, and `floor=absent-expected` in the census basis. `group_launch_template_version` exists in `infra/modules/region-host`. The two-member, 4-target shape matches Task 8. Voice is clean: no em or en dashes, and no tenant or customer names. **P1** 1. **Lines 50-57: the "Pass" column is incomplete.** The note says only that Task 8's *numeric* limits are unchanged. Plan line 223 also requires these, and an operator reading the column could record a pass without them: - zero successful requests served by the failed instance after exclusion; - one writer per lease generation, with generations only increasing; - no takeover before proof **and** expiry in drills 2 and 3, not only drill 1; - any missing sample or exceeded bound is FAIL: stop injecting and never weaken the limit afterwards; - a class with no recorded interval is not a pass, and the interval must be recorded before injecting. It also drops the per-drill cleanup column. Fix: after the table, state these conditions or say "the card copies Task 8's table and the paragraph after it verbatim". **P2** 1. **Lines 102 and 107: two rows still read as if no ruling had been made.** T3's owner still says "or Paul accepts operator log watch". T8's still says "Paul: pin it in the next release (recommended), or freeze". Fix: change both owners to "ruled 2026-11-05 (§4): build on `region-ha-g2-prep`", and give T3's fallback of operator log watch with termination at 10 minutes. 2. **Lines 64-76: Task 8 rows are dropped without saying so.** Plan lines 225-226 and spec §21.2 include rows the note neither runs nor lists as not run: - the Task 7 witness for T1 and I4; - the accepted CONTINUE with a lost response (only ruling 3 mentions it); - a failed initial boot reaching ABANDON with no Pending buildup; - an all-unhealthy NLB still unable to bypass local admission; - "concurrent cold wakes (one writer)"; - default rollback; - the hairpin from a **sidecar** (§21.2 names agent, tenant and sidecar). The disposable-only EIP mapping rehearsal (plan line 226) is dropped with a reason but no ruling, yet §2 says only rulings replace plan text. Fix: add each to "Riding along" or "Not run, and why". For the EIP rehearsal, cite a ruling or mark it as awaiting one. 3. **Line 91: the T8 widening weakens a code invariant and is credited to the agent manager, not Paul.** `systemleg.go:329-332` says "a caller-supplied version, even above FirstRelease, never grants reader capability". Lines 353-361 accept only a pinned digest. Accepting `release:&lt;tag&gt;` pointers changes that rule. Fix: say so, and record who approved it (Paul or the census reviewer), or mark it pending. 4. **Line 56: drill 4 adds SSM blocking beyond spec §21.2 and plan line 213, which say "black-hole S3" only.** Fix: cite `2026-11-05-region-ha-p3b2-standby-witness.md` step 3 (lines 173-195). Also state the consequences: the operator loses Session Manager and must terminate through the EC2 API, and the harness's root timer removes the block. **P3** 1. **Line 42:** the refusal is at `installchannel.go:323` (`errGroupLaunch`), not 322. It also accepts a matching release tag, not only the sha256. 2. **Line 102:** "only ha_takeover log lines exist" is too broad. `hatakeover.go:53-63` already pages on the departure-finalize path; only the visitor path is log-only. Also, line 101's text says "EC2 did not answer" even when the holder is running. The fallback log watch should match `ha_takeover ... confirmed=false`. 3. **Line 37:** §2 says it lists every ruling that replaces plan text, but omits the §4 acceptance ruling, which overrides plan line 42 ("no G2 claim while any prerequisite is missing"). Add a pointer. 4. **Lines 39 and 113:** say that the $5 card cap is per drill window, on top of the group's lifted running cap.</result> <usage><subagent_tokens>74198</subagent_tokens><tool_uses>11</tool_uses><duration_ms>135642</duration_ms></usage> </task-notification>

Attributed to this commit: 14.9 g CO₂e (1,777,761 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-g2-prep, 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/host/group_maintenance_prepare.go b/internal/host/group_maintenance_prepare.go
index a98a5b5d7..5a2f70bb2 100644
--- a/internal/host/group_maintenance_prepare.go
+++ b/internal/host/group_maintenance_prepare.go
@@ -180,7 +180,7 @@ func (cmd *groupMaintenanceCommand) prepare(ctx context.Context, c *hostenv.Grou
// groupReaderTargetAllowed is the fixed-reader automatic-update gate. This
// group-only entry is the serialized operator's path; it has no cached fold
// and cannot manufacture the operator's deployment-wide retirement evidence.
- pending := &systemPending{version: p.Current.Version, promotedAt: p.PromotedAt, artifact: art}
+ pending := &systemPending{version: p.Current.Version, source: p.Current.Source, promotedAt: p.PromotedAt, artifact: art}
prior, err := readSystemResult(a.optDir)
if err != nil {
return err
diff --git a/internal/host/systemleg.go b/internal/host/systemleg.go
index 98253b4b0..c3e08c435 100644
--- a/internal/host/systemleg.go
+++ b/internal/host/systemleg.go
@@ -15,6 +15,7 @@ import (
"time"
"github.com/carlosframework/platform/internal/edgesfile"
+ "github.com/carlosframework/platform/internal/publicrelease"
"github.com/carlosframework/platform/internal/release"
"github.com/carlosframework/platform/internal/version"
)
@@ -66,6 +67,7 @@ type systemLeg struct {
// decided, and when tick may act on it.
type systemPending struct {
version string
+ source string
promotedAt time.Time
noop bool
artifact release.SystemArtifact
@@ -158,7 +160,7 @@ func (l *systemLeg) observe(ctx context.Context) {
// its retry ladder starts at the base (same rule as noteRestartFailed's
// "a DIFFERENT version starts the hold fresh").
l.backoff, l.backoffUntil = 0, time.Time{}
- l.pending = &systemPending{version: p.Current.Version, promotedAt: p.PromotedAt, noop: noop, artifact: art,
+ l.pending = &systemPending{version: p.Current.Version, source: p.Current.Source, promotedAt: p.PromotedAt, noop: noop, artifact: art,
deadline: now.Add(l.jitter(p.SpreadDuration()))}
if noop {
// Nothing to install and nothing to spread: root only needs to
@@ -326,16 +328,22 @@ func (l *systemLeg) forget(version string) {
}
}
-// firstNames2Release is deliberately unprepared. Release preparation pins the
-// first tag and independently verified artifact SHA-256s by platform here.
-// Add verified later/local/upload artifacts explicitly; a caller-supplied
-// version, even above FirstRelease, never grants reader capability.
type namesReleasePin struct {
FirstRelease string
Digests map[string][]string
}
-var firstNames2Release = namesReleasePin{}
+// firstNames2Release pins v0.34.5 from the public release SHA256SUMS.txt,
+// checked against the release build's local dist and the arm64 stable pointer.
+// Add a later local/upload build's independently verified SHA-256 to its
+// platform list; its version alone does not grant reader capability.
+var firstNames2Release = namesReleasePin{
+ FirstRelease: "v0.34.5",
+ Digests: map[string][]string{
+ "linux-arm64": {"310ab5b97a52fa0d4c033393c3d2649adeda2c53e842fff81cd0c7ef57e16cd4"},
+ "linux-amd64": {"400d62739efe8994f93d0ca96dc3a6d0d499e6f4ea53db64069177dea8360176"},
+ },
+}
func (l *systemLeg) groupReaderTargetAllowed(p *systemPending, now time.Time) bool {
s := l.readers()
@@ -354,6 +362,12 @@ func (l *systemLeg) groupReaderTargetAllowed(p *systemPending, now time.Time) bo
if !pinned || release.BelowFloor(p.version, floor) {
return false
}
+ // The signed source names the console's checksum-verified public ingest.
+ if p.source == "release:"+p.version && publicrelease.TagRe.MatchString(p.version) {
+ if v, ok := release.ParseReleaseVersion(p.version); ok && v.Compare(floor) >= 0 {
+ return true
+ }
+ }
for _, digest := range l.namesRelease.Digests[l.platform] {
if len(digest) == 64 && digest == p.artifact.SHA256 {
return true
diff --git a/internal/host/systemleg_test.go b/internal/host/systemleg_test.go
index 5b287ed27..01a91716f 100644
--- a/internal/host/systemleg_test.go
+++ b/internal/host/systemleg_test.go
@@ -611,3 +611,98 @@ func testSystemLegGroupReaderRollbackPaths(t *testing.T) {
})
}
}
+
+func TestSystemLegNames2ReleasePin(t *testing.T) {
+ const arm64Digest = "310ab5b97a52fa0d4c033393c3d2649adeda2c53e842fff81cd0c7ef57e16cd4"
+ const amd64Digest = "400d62739efe8994f93d0ca96dc3a6d0d499e6f4ea53db64069177dea8360176"
+ for _, tc := range []struct {
+ name, version, source, platform, digest string
+ emptyFloor, allow bool
+ }{
+ {name: "production-arm64", version: "v0.34.5", digest: arm64Digest, allow: true},
+ {name: "production-amd64", version: "v0.34.5", platform: "linux-amd64", digest: amd64Digest, allow: true},
+ {name: "release-at-floor", version: "v0.34.5", source: "release:v0.34.5", allow: true},
+ {name: "later-release", version: "v0.34.6", source: "release:v0.34.6", allow: true},
+ {name: "release-below-floor", version: "v0.34.4", source: "release:v0.34.4"},
+ {name: "file-unknown", version: "v0.34.9", source: "file"},
+ {name: "file-pinned", version: "v0.34.9", source: "file", digest: arm64Digest, allow: true},
+ {name: "empty-source", version: "v0.34.9"},
+ {name: "mismatched-source", version: "v0.36.0", source: "release:v0.35.0"},
+ {name: "mismatched-source-pinned", version: "v0.36.0", source: "release:v0.35.0", digest: arm64Digest, allow: true},
+ {name: "prerelease", version: "v0.35.0-rc1", source: "release:v0.35.0-rc1"},
+ {name: "missing-v", version: "0.35.0", source: "release:0.35.0"},
+ {name: "missing-patch", version: "v0.35", source: "release:v0.35"},
+ {name: "overflow", version: "v999999999999999999999999999999.0.0", source: "release:v999999999999999999999999999999.0.0"},
+ {name: "empty-floor-release", version: "v0.34.6", source: "release:v0.34.6", emptyFloor: true},
+ {name: "empty-floor-pinned", version: "v0.34.5", digest: arm64Digest, emptyFloor: true},
+ {name: "pinned-below-floor", version: "v0.34.4", digest: arm64Digest},
+ {name: "wrong-platform-pin", version: "v0.34.5", digest: amd64Digest},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ f := newLegFixture(t, "stable", "v0.34.0")
+ if tc.platform != "" {
+ f.leg.platform = tc.platform
+ }
+ if tc.emptyFloor {
+ f.leg.namesRelease.FirstRelease = ""
+ }
+ body := []byte("names-2 test artifact")
+ sum := sha256.Sum256(body)
+ digest := hex.EncodeToString(sum[:])
+ if tc.digest != "" {
+ digest = tc.digest
+ }
+ art := release.SystemArtifact{Key: release.SystemArtifactKey(tc.version, f.leg.platform), SHA256: digest}
+ rel := release.SystemRelease{Version: tc.version, Source: tc.source, Artifacts: map[string]release.SystemArtifact{f.leg.platform: art}}
+ if _, err := f.store.Put(t.Context(), art.Key, body, ""); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := release.PromoteSystem(t.Context(), f.store, release.RootSigner(f.priv), release.SystemComponentRouter, f.leg.channel, rel, release.SystemPromoteOptions{}); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := f.store.Put(t.Context(), edgesfile.Key("g-01234567890123456789"), []byte(`{"v":1,"box":"g-01234567890123456789","box_role":"serve","admitted":true,"capabilities":["names-2"],"hosts":{}}`), ""); err != nil {
+ t.Fatal(err)
+ }
+ s := &readerStore{Store: f.store}
+ e := readerFold(t, s)
+ if !e.GroupReaderSnapshot().HasGroupNamespace() {
+ t.Fatal("fixture has no live group namespace")
+ }
+ f.leg.readers = e.GroupReaderSnapshot
+ if tc.digest != "" {
+ // Published release bytes are not a fixture. Stub only their fetch;
+ // observe still verifies the signed pointer carrying the real pin.
+ f.leg.fetchTo = func(_ context.Context, key, dst, sha string) error {
+ if key != art.Key || sha != digest {
+ t.Fatalf("fetch key=%q sha=%q", key, sha)
+ }
+ return os.WriteFile(dst, body, 0644)
+ }
+ }
+ fetches := f.countFetches()
+ f.now = time.Now()
+ f.leg.observe(t.Context())
+ if f.leg.pending == nil {
+ t.Fatal("signed target did not arm")
+ }
+ beforeGet, beforeList := s.gets, s.lists
+ f.leg.tick(t.Context(), f.now)
+ f.leg.tick(t.Context(), f.now.Add(10*time.Second))
+ request := f.request()
+ _, markerErr := f.marker()
+ if tc.allow {
+ if *fetches != 1 || request == nil || request.Version != tc.version || markerErr != nil {
+ t.Fatalf("permitted target: fetches=%d request=%+v marker=%v", *fetches, request, markerErr)
+ }
+ } else {
+ _, requestErr := os.Stat(systemRequestPath(f.dd))
+ if *fetches != 0 || !os.IsNotExist(requestErr) || !os.IsNotExist(markerErr) {
+ t.Fatalf("refused target: fetches=%d request=%+v requestErr=%v marker=%v", *fetches, request, requestErr, markerErr)
+ }
+ }
+ if s.gets != beforeGet || s.lists != beforeList {
+ t.Fatal("gate added store reads")
+ }
+ })
+ }
+}