carlos / platform Public

region-ha p1b-3a: retain slow placement outcomes

Track placement and recovery reachability by reference epoch beyond the
host observation window, and accept true-holder replies during revalidation.

Reserve peer choices atomically, report final fallback decisions, and cover
late results and lazy suspect handling with regression tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 4cf3b5dcab59a733d4dc00c62d69113fbf8978d7 parent ffc659c
10 files changed, +218 −36
  • docs/superpowers/notes/census-proposal-region-ha-p1b3a.md +2 −2
  • docs/superpowers/notes/census-region-ha-p1b3a-claims.md +1 −1
  • internal/activator/hacache.go +20 −8
  • internal/activator/haforward.go +20 −12
  • internal/activator/haplacement_peers.go +21 −0
  • internal/activator/haplacement_test.go +135 −3
  • internal/activator/hasuspect_test.go +12 −4
  • internal/host/haplacement.go +2 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-p1b3a.tsv +4 −4

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-region-ha-p1b3a.md b/docs/superpowers/notes/census-proposal-region-ha-p1b3a.md
index f3702304f..173231c6f 100644
--- a/docs/superpowers/notes/census-proposal-region-ha-p1b3a.md
+++ b/docs/superpowers/notes/census-proposal-region-ha-p1b3a.md
@@ -6,7 +6,7 @@ Ruling `census-ruling-region-ha-p1b3a`. The independent reviewer approves or rej
|---|---|---|---|
| `internal/activator/activator.go` `type Service` | body | unchanged (0) | Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority. |
| `internal/host/agent.go` `runAgent` | body | unchanged (6) | Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority. |
-| `internal/activator/haforward.go` `Service.ForwardTarget` | sites | +registry:Host ×2, +whole:Route ×3 | Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Read in-memory route Host and whole Route for snapshot/decision only; same bounded lock read, no new store or filesystem operation and no acquire authority. |
+| `internal/activator/haforward.go` `Service.ForwardTarget` | sites | +registry:Host ×5, +whole:Route ×2 | Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Fix round 1: decide and reserve under one peer mutex using only current serving candidates, and log the final Base/Refuse decision if attempt tagging loses a race. Reads in-memory route Host and the Route passed to the pure rule; same bounded lock read, no new store or filesystem operation and no acquire authority. |
| `internal/edge/forwardha.go` `Edge.frontForwardHA` | sites | +whole:Route | Pass the existing route to a lazy cached wakeSnapshot closure, handle explicit local denial before all accounting, and refuse a disappeared Placement choice rather than falling through locally; whole Route read only, no new store or filesystem operation and no root authority. |
Envelopes re-pinned: `internal/activator`, `internal/boxchoice`, `internal/edge`, `internal/host`.
@@ -26,6 +26,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/activator/haplacement.go:DecidePlacement`: reads +registry:App, +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
- new `internal/edge/wakeplacement.go:homeMap.wakeSnapshot`: reads +registry:App, +registry:Host, +whole:Route; written legacy, accepted-legacy, frozen
-Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `ff762f68961a754609f209d3a2e6f6ddef46f67eb860e511bd538c5a2ded2580`.
+Seal: `5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc` → `5d20b3777026e43906bfba301186bce0ae58daa9d8ad5019879b7833f14dc6ff`.
Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-p1b3a.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/census-region-ha-p1b3a-claims.md b/docs/superpowers/notes/census-region-ha-p1b3a-claims.md
index 102f9fd54..cf199476b 100644
--- a/docs/superpowers/notes/census-region-ha-p1b3a-claims.md
+++ b/docs/superpowers/notes/census-region-ha-p1b3a-claims.md
@@ -2,6 +2,6 @@ internal/activator/awakeapps.go:Service.AwakeApps Count owned awake entries unde
internal/edge/wakeplacement.go:homeMap.wakeSnapshot Project cold-wake candidates from one immutable cached edges fold using the local route's canonical host, release.RouteAccount and app. Reads only in-memory route fields, cached publication additions and mirrored signing keys; no filesystem, registry, store or root authority added. Reject malformed placement evidence independently of the unchanged holder decoder; preserve explicit local safety denials even when stale.
internal/activator/activator.go:type Service Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.
internal/host/agent.go:runAgent Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.
-internal/activator/haforward.go:Service.ForwardTarget Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Read in-memory route Host and whole Route for snapshot/decision only; same bounded lock read, no new store or filesystem operation and no acquire authority.
+internal/activator/haforward.go:Service.ForwardTarget Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Fix round 1: decide and reserve under one peer mutex using only current serving candidates, and log the final Base/Refuse decision if attempt tagging loses a race. Reads in-memory route Host and the Route passed to the pure rule; same bounded lock read, no new store or filesystem operation and no acquire authority.
internal/edge/forwardha.go:Edge.frontForwardHA Pass the existing route to a lazy cached wakeSnapshot closure, handle explicit local denial before all accounting, and refuse a disappeared Placement choice rather than falling through locally; whole Route read only, no new store or filesystem operation and no root authority.
internal/activator/haplacement.go:DecidePlacement Pure applicability rule reads in-memory route Host/App and RouteAccount for capacity preference, self/expired-owner recovery and explicit LocalDenied refusal; no proof, acquire, store, filesystem or root authority, and no guessed free observation.
diff --git a/internal/activator/hacache.go b/internal/activator/hacache.go
index ccf618495..d950bda4d 100644
--- a/internal/activator/hacache.go
+++ b/internal/activator/hacache.go
@@ -332,11 +332,17 @@ func (c *holderCache) placement(host, ref string, kind edge.ForwardKind, gen uin
return e.gen
}
-// hintResult ignores outcomes superseded by another choice or local acquire.
+// hintResult records reachability under the peer epoch, independently of the
+// negative observation's lifetime. Holder-cache changes still require the
+// original host generation; a newer positive holder supersedes the hint.
func (c *holderCache) hintResult(host, self string, res edge.ForwardResult, accepted func()) bool {
c.mu.Lock()
defer c.mu.Unlock()
el := c.holders[host]
+ if el != nil && el.Value.(*holderEntry).ref != "" {
+ return false
+ }
+ accepted()
if el == nil {
return false
}
@@ -354,7 +360,6 @@ func (c *holderCache) hintResult(host, self string, res edge.ForwardResult, acce
c.seq++
e.gen = c.seq
}
- accepted()
return true
}
@@ -367,11 +372,18 @@ func (c *holderCache) holderResult(host, self string, res edge.ForwardResult, ac
// P1b-2 lets a still-outstanding answer clear this same true holder's
// suspicion. A newer holder, negative observation or acquire stands.
if el == nil {
- return
- }
- e := el.Value.(*holderEntry)
- if !e.suspect || e.ref != res.Ref || res.Outcome != edge.ForwardDone || (res.Holder == "" && res.Status == 0) {
- return
+ // An answer from the true holder also wins while its expired
+ // suspect entry is absent during revalidation. A local acquire
+ // marks that flight stale and must still win over this answer.
+ f := c.flights[host]
+ if f == nil || f.suspect != res.Ref || f.stale || res.Outcome != edge.ForwardDone || (res.Holder == "" && res.Status == 0) {
+ return
+ }
+ } else {
+ e := el.Value.(*holderEntry)
+ if !e.suspect || e.ref != res.Ref || res.Outcome != edge.ForwardDone || (res.Holder == "" && res.Status == 0) {
+ return
+ }
}
}
accepted()
@@ -412,7 +424,7 @@ func (c *holderCache) holderResult(host, self string, res edge.ForwardResult, ac
c.seq++
e.gen = c.seq
}
- } else if f := c.flights[host]; f != nil && f.suspect != "" && !f.stale {
+ } else if f := c.flights[host]; f != nil && f.suspect == res.Ref && !f.stale {
c.putLocked(host, res.Ref, false, holderPositiveTTL)
}
}
diff --git a/internal/activator/haforward.go b/internal/activator/haforward.go
index b435fbfa6..d79c0a0f8 100644
--- a/internal/activator/haforward.go
+++ b/internal/activator/haforward.go
@@ -148,25 +148,22 @@ func (a *Service) ForwardTarget(ctx context.Context, rt registry.Route, snapshot
s = snapshot()
}
now := a.holders.clock()
- pv := a.peers.snapshot(now)
+ // Decide and reserve against the same peer state. A concurrent failure
+ // cannot turn a selected peer suspect between the rule and admission.
+ a.peers.mu.Lock()
+ pv := a.peers.snapshotForLocked(now, s.Serving)
d := DecidePlacement(rt, r.self(), resolved.View, s, pv, now)
var token uint64
if (d.Kind == Recovery || d.Kind == Place) && d.Ref != s.Self {
- var admitted bool
- token, admitted = a.peers.begin(d.Ref, now)
- if !admitted {
- // Re-evaluate under the same applicability rule after a concurrent
- // reservation or failure changes the bounded peer state.
- pv = a.peers.snapshot(now)
- pv.Saturated = true
- d = DecidePlacement(rt, r.self(), resolved.View, s, pv, now)
- }
+ token, _ = a.peers.beginLocked(d.Ref, now)
}
- a.observePlacement(rt.Host, d, s, resolved.View, now)
+ a.peers.mu.Unlock()
if d.Kind == Refuse {
+ a.observePlacement(rt.Host, d, s, resolved.View, now)
return edge.ForwardDecision{Unavailable: true}
}
if d.Kind == Base || d.Ref == s.Self {
+ a.observePlacement(rt.Host, d, s, resolved.View, now)
return edge.ForwardDecision{}
}
kind := edge.Placement
@@ -175,9 +172,13 @@ func (a *Service) ForwardTarget(ctx context.Context, rt registry.Route, snapshot
}
gen := a.holders.placement(rt.Host, d.Ref, kind, resolved.Gen)
if gen == 0 {
+ // A concurrent observation or acquire won. This loser may return
+ // 503 when local service is denied; log that final rule decision.
fallback := DecidePlacement(rt, r.self(), nil, s, pv, now)
+ a.observePlacement(rt.Host, fallback, s, nil, now)
return edge.ForwardDecision{Unavailable: fallback.Kind == Refuse}
}
+ a.observePlacement(rt.Host, d, s, resolved.View, now)
return edge.ForwardDecision{Ref: d.Ref, Kind: kind, Gen: gen, PeerGen: token}
}
@@ -207,7 +208,14 @@ func (a *Service) NoteForward(host string, res edge.ForwardResult) {
self, _ := boxSelfRef(a.backend)
note := func() { a.peers.note(res, a.holders.clock()) }
if res.Kind != edge.Holder {
- a.holders.hintResult(host, self, res, note)
+ // Local ownership supersedes routing advice, even after its cache
+ // entry was dropped. Keep this check and the note under the service
+ // mutex so a new wake cannot enter between them.
+ a.mu.Lock()
+ defer a.mu.Unlock()
+ if a.entries[host] == nil {
+ a.holders.hintResult(host, self, res, note)
+ }
return
}
a.holders.holderResult(host, self, res, note)
diff --git a/internal/activator/haplacement_peers.go b/internal/activator/haplacement_peers.go
index 28aa22ef1..7b39b83e7 100644
--- a/internal/activator/haplacement_peers.go
+++ b/internal/activator/haplacement_peers.go
@@ -4,6 +4,7 @@ import (
"sync"
"time"
+ "github.com/carlosframework/platform/internal/boxchoice"
"github.com/carlosframework/platform/internal/edge"
)
@@ -40,9 +41,29 @@ func (p *placementPeers) snapshot(now time.Time) PlacementPeerView {
}
return v
}
+
+// snapshotForLocked copies only candidates this decision can use. Cold requests
+// do not scan the entire tracked-reference set unless reclamation is needed.
+func (p *placementPeers) snapshotForLocked(now time.Time, candidates []boxchoice.Candidate) PlacementPeerView {
+ if len(p.refs) >= holderCacheMax {
+ p.reclaim(now)
+ }
+ v := PlacementPeerView{Suspect: map[string]bool{}, Saturated: len(p.refs) >= holderCacheMax}
+ for _, c := range candidates {
+ if e := p.refs[c.BoxID]; e != nil && now.Before(e.until) {
+ v.Suspect[c.BoxID] = true
+ }
+ }
+ return v
+}
+
func (p *placementPeers) begin(ref string, now time.Time) (uint64, bool) {
p.mu.Lock()
defer p.mu.Unlock()
+ return p.beginLocked(ref, now)
+}
+
+func (p *placementPeers) beginLocked(ref string, now time.Time) (uint64, bool) {
if e := p.refs[ref]; e != nil {
if now.Before(e.until) {
return 0, false
diff --git a/internal/activator/haplacement_test.go b/internal/activator/haplacement_test.go
index 354cee17b..8e04efba1 100644
--- a/internal/activator/haplacement_test.go
+++ b/internal/activator/haplacement_test.go
@@ -177,19 +177,29 @@ func TestPlacementCachesObservationNotChoice(t *testing.T) {
}
}
func TestPlacementSnapshotIsLazy(t *testing.T) {
- for _, mode := range []string{"cold", "positive", "suspect", "awake", "waking", "legacy"} {
+ for _, mode := range []string{"cold", "positive", "suspect", "failed revalidation", "awake", "waking", "legacy"} {
t.Run(mode, func(t *testing.T) {
s := haService(t, "shop.example.com")
s.rt.HA = true
+ clk := &fakeClock{t: time.Now()}
+ s.a.holders.now = clk.now
switch mode {
case "positive":
s.a.holders.set(s.rt.Host, "b")
- case "suspect":
+ case "suspect", "failed revalidation":
s.a.holders.set(s.rt.Host, "b")
s.a.holders.mu.Lock()
gen := s.a.holders.holders[s.rt.Host].Value.(*holderEntry).gen
s.a.holders.mu.Unlock()
s.a.holders.unreachable(s.rt.Host, gen)
+ if mode == "failed revalidation" {
+ clk.advance(holderSuspectTTL)
+ old := readHolderLock
+ readHolderLock = func(context.Context, string, string, string) (hafresh.View, error) {
+ return hafresh.View{}, context.DeadlineExceeded
+ }
+ t.Cleanup(func() { readHolderLock = old })
+ }
case "awake":
s.a.entries[s.rt.Host] = &actEntry{state: actAwake}
case "waking":
@@ -198,7 +208,10 @@ func TestPlacementSnapshotIsLazy(t *testing.T) {
s.rt.HA = false
}
calls := 0
- s.a.ForwardTarget(context.Background(), s.rt, func() boxchoice.WakeSnapshot { calls++; return boxchoice.WakeSnapshot{} })
+ d := s.a.ForwardTarget(context.Background(), s.rt, func() boxchoice.WakeSnapshot { calls++; return boxchoice.WakeSnapshot{} })
+ if mode == "failed revalidation" && !d.Refuse {
+ t.Fatalf("failed suspect revalidation must refuse: %+v", d)
+ }
want := 0
if mode == "cold" {
want = 1
@@ -593,3 +606,122 @@ func TestPlacementHeldOwnerWins(t *testing.T) {
t.Fatal(d)
}
}
+
+// N-HA12 uses the reference epoch even after a negative observation expires
+// or another request re-reads it. The forward can take up to thirty seconds.
+func TestPlacementSlowOutcome(t *testing.T) {
+ for _, kind := range []edge.ForwardKind{edge.Placement, edge.Recovery} {
+ for _, reread := range []bool{false, true} {
+ for _, status := range []int{503, 200} {
+ t.Run(fmt.Sprintf("kind=%d/reread=%v/status=%d", kind, reread, status), func(t *testing.T) {
+ s := haService(t, "shop.example.com")
+ s.rt.HA = true
+ clk := &fakeClock{t: time.Now()}
+ s.a.holders.now = clk.now
+ if kind == edge.Recovery {
+ putLockFor(t, s.b, s.rt, leaseBody(t, heldByB, clk.now().Add(-time.Second)))
+ }
+ snap := placementSnapshot(clk.now())
+ project := func() boxchoice.WakeSnapshot { return snap }
+ first := s.a.ForwardTarget(context.Background(), s.rt, project)
+ if first.Ref != "b" || first.Kind != kind {
+ t.Fatalf("initial %+v", first)
+ }
+ clk.advance(12 * time.Second)
+ latest := first
+ if reread {
+ latest = s.a.ForwardTarget(context.Background(), s.rt, project)
+ if latest.Ref != "b" || latest.Gen == first.Gen {
+ t.Fatalf("re-read %+v, first %+v", latest, first)
+ }
+ }
+ s.a.NoteForward(s.rt.Host, placementResult(first, status, ""))
+ if status == 200 {
+ // An older failure cannot overwrite the newer reference success.
+ s.a.NoteForward(s.rt.Host, placementResult(latest, 503, "none"))
+ if s.a.peers.snapshot(clk.now()).Suspect["b"] {
+ t.Fatal("late failure poisoned slow success")
+ }
+ return
+ }
+ if !s.a.peers.snapshot(clk.now()).Suspect["b"] {
+ t.Fatal("slow failure was not recorded")
+ }
+ if next := s.a.ForwardTarget(context.Background(), s.rt, project); next.Ref != "" || next.Refuse || next.Unavailable {
+ t.Fatalf("next request must avoid b and preserve local recovery: %+v", next)
+ }
+ clk.advance(9 * time.Second)
+ if !s.a.peers.snapshot(clk.now()).Suspect["b"] {
+ t.Fatal("suspicion did not last ten seconds from the outcome")
+ }
+ clk.advance(time.Second)
+ if next := s.a.ForwardTarget(context.Background(), s.rt, project); next.Ref != "b" || next.Kind != kind {
+ t.Fatalf("reference not readmitted after ten seconds: %+v", next)
+ }
+ })
+ }
+ }
+ }
+}
+
+func TestPlacementDecisionLogAfterLostRace(t *testing.T) {
+ for _, denied := range []bool{false, true} {
+ t.Run(fmt.Sprintf("denied=%v", denied), func(t *testing.T) {
+ logs := captureLog(t)
+ s := haService(t, "shop.example.com")
+ s.rt.HA = true
+ d := s.a.ForwardTarget(context.Background(), s.rt, func() boxchoice.WakeSnapshot {
+ // Invalidate the observation after resolution, before attempt tagging.
+ s.a.holders.drop(s.rt.Host)
+ snap := placementSnapshot(time.Now())
+ snap.LocalDenied = denied
+ return snap
+ })
+ kind := "Base"
+ if denied {
+ kind = "Refuse"
+ }
+ if d.Ref != "" || d.Unavailable != denied {
+ t.Fatalf("lost race %+v", d)
+ }
+ if !strings.Contains(logs.String(), "kind="+kind+" ref= reason=base-no-observation") {
+ t.Fatalf("log does not match returned decision: %s", logs.String())
+ }
+ })
+ }
+}
+
+func TestPlacementBusyPeerUsesSurvivor(t *testing.T) {
+ logs := captureLog(t)
+ s := haService(t, "shop.example.com")
+ s.rt.HA = true
+ now := time.Now()
+ token, _ := s.a.peers.begin("b", now)
+ s.a.peers.note(edge.ForwardResult{Kind: edge.Placement, Ref: "b", PeerGen: token, Outcome: edge.ForwardUnreachable}, now)
+ snap := placementSnapshot(now)
+ snap.LocalDenied = true
+ survivor := snap.Serving[1]
+ survivor.BoxID = "c"
+ snap.Serving = append(snap.Serving, survivor)
+ d := s.a.ForwardTarget(context.Background(), s.rt, func() boxchoice.WakeSnapshot { return snap })
+ if d.Ref != "c" || d.Kind != edge.Placement || d.PeerGen == 0 || d.Unavailable {
+ t.Fatalf("busy peer hid survivor: %+v", d)
+ }
+ if !strings.Contains(logs.String(), "kind=Place ref=c reason=roomiest") {
+ t.Fatalf("busy-peer log: %s", logs.String())
+ }
+}
+
+func TestPlacementStaleResultCannotPoisonHolder(t *testing.T) {
+ s := haService(t, "shop.example.com")
+ s.rt.HA = true
+ d := s.a.ForwardTarget(context.Background(), s.rt, func() boxchoice.WakeSnapshot { return placementSnapshot(time.Now()) })
+ s.a.holders.set(s.rt.Host, "c")
+ s.a.NoteForward(s.rt.Host, placementResult(d, 503, "none"))
+ if s.a.peers.snapshot(time.Now()).Suspect["b"] {
+ t.Fatal("superseded hint poisoned reference after a newer holder")
+ }
+ if ref, positive, _ := s.a.holders.get(s.rt.Host); ref != "c" || !positive {
+ t.Fatalf("superseded hint replaced holder: %q positive=%v", ref, positive)
+ }
+}
diff --git a/internal/activator/hasuspect_test.go b/internal/activator/hasuspect_test.go
index 65cc9d306..eee37a0f5 100644
--- a/internal/activator/hasuspect_test.go
+++ b/internal/activator/hasuspect_test.go
@@ -275,12 +275,19 @@ func TestSuccessDuringRevalidationWins(t *testing.T) {
return func() bool { return reads.Load() == 1 }, func() { close(gate) }
}
t.Run("success", func(t *testing.T) {
- s, clk := suspectB(t)
+ s := haHeldByB(t)
+ clk := &fakeClock{t: time.Now()}
+ s.a.holders.now = clk.now
+ d := s.decide()
+ if d.Gen == 0 {
+ t.Fatal("production forward must have a generation")
+ }
+ s.note(d, edge.ForwardResult{Outcome: edge.ForwardUnreachable})
clk.advance(holderSuspectTTL + time.Millisecond)
started, release := holdRead(t)
got := s.concurrently(1)
waitFor(t, "the revalidation read", started)
- s.a.NoteForward(s.rt.Host, edge.ForwardResult{Outcome: edge.ForwardDone, Ref: "b", Status: http.StatusOK})
+ s.note(d, edge.ForwardResult{Outcome: edge.ForwardDone, Status: http.StatusOK})
release()
if d := recv(t, got); d.Refuse || d.Ref != "b" {
t.Fatalf("the revalidating request after b answered and the read failed: %+v, want a forward to b", d)
@@ -295,7 +302,8 @@ func TestSuccessDuringRevalidationWins(t *testing.T) {
clk := &fakeClock{t: time.Now()}
s.a.holders.now = clk.now
s.a.holders.set(s.rt.Host, "b")
- s.note(s.decide(), edge.ForwardResult{Outcome: edge.ForwardUnreachable})
+ d := s.decide()
+ s.note(d, edge.ForwardResult{Outcome: edge.ForwardUnreachable})
clk.advance(holderSuspectTTL + time.Millisecond)
started, release := holdRead(t)
got := s.concurrently(1)
@@ -303,7 +311,7 @@ func TestSuccessDuringRevalidationWins(t *testing.T) {
if _, err := s.wakeForTest(context.Background()); err != nil {
t.Fatalf("wake: %v", err)
}
- s.a.NoteForward(s.rt.Host, edge.ForwardResult{Outcome: edge.ForwardDone, Ref: "b", Status: http.StatusOK})
+ s.note(d, edge.ForwardResult{Outcome: edge.ForwardDone, Status: http.StatusOK})
release()
recv(t, got)
if _, _, found := s.a.holders.get(s.rt.Host); found {
diff --git a/internal/host/haplacement.go b/internal/host/haplacement.go
index ce89f267c..6c6b74425 100644
--- a/internal/host/haplacement.go
+++ b/internal/host/haplacement.go
@@ -6,6 +6,7 @@ import (
"time"
"github.com/carlosframework/platform/internal/activator"
+ "github.com/carlosframework/platform/internal/alerting"
)
func armHAPlacement(svc *activator.Service, page func(context.Context, string, string, string) error) {
@@ -13,6 +14,6 @@ func armHAPlacement(svc *activator.Service, page func(context.Context, string, s
svc.OnHAOverCapacity = func(region, host, ref string) {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
- _ = page(ctx, "warning", fmt.Sprintf("Region %s needs more capacity", region), fmt.Sprintf("Region %s is short on spare capacity. Instance %s is waking on %s. Add capacity to the region.", region, host, ref))
+ _ = page(ctx, alerting.LevelWarning, fmt.Sprintf("Region %s needs more capacity", region), fmt.Sprintf("Region %s is short on spare capacity. Instance %s is waking on %s. Add capacity to the region.", region, host, ref))
}
}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index b7d19fffb..714229043 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -56,4 +56,4 @@ plan14-root-reads-fix-set-aside-exdev.tsv f9d3016cc6803338f9db19311f3f598e20c37c
plan14-root-reads-durability-3a-escrow.tsv 03a92257beb9b8aac421559e247d191bd69f28a0b26243397a1344a90d59fc2a
plan14-root-reads-rootfs-default-home.tsv 7a0a3da3d6fe7e3c77abb22676db000af2a276c3d13ccae0f038190f51287ed5
plan14-root-reads-probe-burst-limit.tsv 5f805400717bad7726bd9d62744b8103a40eb5f5823b0ab7c960a5c0965cb3bc
-plan14-root-reads-region-ha-p1b3a.tsv ff762f68961a754609f209d3a2e6f6ddef46f67eb860e511bd538c5a2ded2580
+plan14-root-reads-region-ha-p1b3a.tsv 5d20b3777026e43906bfba301186bce0ae58daa9d8ad5019879b7833f14dc6ff
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-p1b3a.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3a.tsv
index d5a3a24b9..87b6edcef 100644
--- a/internal/provision/testdata/plan14-root-reads-region-ha-p1b3a.tsv
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-p1b3a.tsv
@@ -4,16 +4,16 @@
@legacy 2ffbb58e2568a1ea38d893670ab9498c6581af1aeba74e5a4d78cc5327e531cd internal/activator/awakeapps.go Service.AwakeApps legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Count owned awake entries under the service mutex by release.RouteAccount(route)/route.App, validating the resolved account and app. Reads in-memory route values only; no store, registry or filesystem call and no new root authority. registry:App@242,whole:Route@234,whole:Route@244 1eb4a8a36fdcb246f031482676c6af586cb1ecbeabc07271c9d3021ecf355a60
@legacy 653dd27f83091a121207d90a965a155e4319b70f1a6874994bdec69d35d8ab2f internal/activator/haplacement.go DecidePlacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Pure applicability rule reads in-memory route Host/App and RouteAccount for capacity preference, self/expired-owner recovery and explicit LocalDenied refusal; no proof, acquire, store, filesystem or root authority, and no guessed free observation. registry:App@1863,registry:Host@1825,whole:Route@1855 136b66955b351e71ec06326a564f25c7c4338ee8639fb7b6bef88adb062d7c1b
@legacy 6e6ab5cce7e2052c11c68f2f2716f5916f4eb59d3a1603f6f9ceaa347e58998e internal/edge/wakeplacement.go homeMap.wakeSnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Project cold-wake candidates from one immutable cached edges fold using the local route's canonical host, release.RouteAccount and app. Reads only in-memory route fields, cached publication additions and mirrored signing keys; no filesystem, registry, store or root authority added. Reject malformed placement evidence independently of the unchanged holder decoder; preserve explicit local safety denials even when stale. registry:App@2068,registry:Host@1173,whole:Route@1204 738a92d33ed1ff738f503f33aa33e29550f0ffb4ce66eeda9551ea83ae1b3bdc
-@legacy cf74a525f98bef3b391132d4ab21d8bf2c1c368965f9332f641469bdf0be1388 internal/activator/haforward.go Service.ForwardTarget legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b2;basis=new (region HA P1b-2): the agent's activator answers the edge with a holder box ref for an HA route not awake here, from its in-memory holder cache or one bounded (2 s) lock.json read through readHolderView; reads the route's HA flag and host from its own registry row; root never calls it;rev3=census-ruling-region-ha-dead-holder-backoff;basis=Returns edge.ForwardDecision (Ref, Refuse, Gen) from holderCache.resolve, in memory only: a suspect holder refuses; a positive entry forwards under its generation; a failed read that revalidates an expired suspect keeps it suspect and refuses. The round-1 cache connection gate is removed. The same single bounded (2 s) lock.json read through readHolderView on a miss; no new read and no new S3 request; root never calls it.;rev3=census-ruling-region-ha-p1b3a;basis=Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Read in-memory route Host and whole Route for snapshot/decision only; same bounded lock read, no new store or filesystem operation and no acquire authority. registry:HA@140,registry:Host@1028,registry:Host@2046,registry:Host@2334,registry:Host@302,registry:Host@415,whole:Route@1563,whole:Route@1978,whole:Route@216,whole:Route@2415,whole:Route@769 2e50631e05a29ac96897ed7142e2100d585ccb7ab6d845956d571547dddd779c
+@legacy 092b090847085fb530f3a4cc35f721a02d758c6ba0212ac34074493fbcae2158 internal/activator/haforward.go Service.ForwardTarget legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b2;basis=new (region HA P1b-2): the agent's activator answers the edge with a holder box ref for an HA route not awake here, from its in-memory holder cache or one bounded (2 s) lock.json read through readHolderView; reads the route's HA flag and host from its own registry row; root never calls it;rev3=census-ruling-region-ha-dead-holder-backoff;basis=Returns edge.ForwardDecision (Ref, Refuse, Gen) from holderCache.resolve, in memory only: a suspect holder refuses; a positive entry forwards under its generation; a failed read that revalidates an expired suspect keeps it suspect and refuses. The round-1 cache connection gate is removed. The same single bounded (2 s) lock.json read through readHolderView on a miss; no new read and no new S3 request; root never calls it.;rev3=census-ruling-region-ha-p1b3a;basis=Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Fix round 1: decide and reserve under one peer mutex using only current serving candidates, and log the final Base/Refuse decision if attempt tagging loses a race. Reads in-memory route Host and the Route passed to the pure rule; same bounded lock read, no new store or filesystem operation and no acquire authority. registry:HA@140,registry:Host@1028,registry:Host@1984,registry:Host@2132,registry:Host@2305,registry:Host@2575,registry:Host@2698,registry:Host@302,registry:Host@415,whole:Route@1747,whole:Route@216,whole:Route@2523,whole:Route@769 3aec5f42ee7a1f943537f884bc3ee4773ede60c4bb475ea4b9806f0a3bbcdd92
@legacy b10df392ce2033c88a0fb712b47a773f006403af65f681b5f42262cb1332a710 internal/edge/forwardha.go Edge.frontForwardHA legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b2;basis=new (region HA P1b-2): the agent's edge decides at the front door whether to forward a visitor request: reads the route's HA flag and host from the box's own registry row and asks the activator; forwards only to a box in view over the existing signed hop; root never calls it;rev3=census-ruling-region-ha-dead-holder-backoff;basis=ForwardTarget returns a ForwardDecision (Ref, Refuse, Gen); a Refuse is answered at the front door with the existing unreachable answer (503, Retry-After: 10, same body, via answerHolderUnreachable), with no forward, dial, note or per-request step. A forward passes the decision to forwardHA and NoteForward carries Ref and Gen back. The round-1 connection callback (NoteConnected) is gone: the dial bound now lives in forwardTransport's forwardDialGate, which coalesces TCP dials per holder address in memory. The same 5 read sites; no new read; root never calls it.;rev3=census-ruling-region-ha-p1b3a;basis=Pass the existing route to a lazy cached wakeSnapshot closure, handle explicit local denial before all accounting, and refuse a disappeared Placement choice rather than falling through locally; whole Route read only, no new store or filesystem operation and no root authority. registry:HA@225,registry:Host@928,whole:Route@228,whole:Route@405,whole:Route@548,whole:Route@931 ae7b0d8715c18d05fdebfb3a65861b8b83cd051b6e0d25a60ea16cc4867a8fbc
internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority. e3f1f4dd7c3e94d923878e6bdb39e93416887d775f972a7f6a6674ba300292c4
internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority. file:Exec@17617,file:Open@1150,file:Statfs@44473,registry:App@11372,whole:Route@11364,whole:Route@28441 025250d688e25a05823b2e168207acfd1c23dbec4a5f5c87e96d11b73c7456ae
internal/activator/awakeapps.go Service.AwakeApps legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Count owned awake entries under the service mutex by release.RouteAccount(route)/route.App, validating the resolved account and app. Reads in-memory route values only; no store, registry or filesystem call and no new root authority. registry:App@242,whole:Route@234,whole:Route@244 1eb4a8a36fdcb246f031482676c6af586cb1ecbeabc07271c9d3021ecf355a60
internal/activator/haplacement.go DecidePlacement legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Pure applicability rule reads in-memory route Host/App and RouteAccount for capacity preference, self/expired-owner recovery and explicit LocalDenied refusal; no proof, acquire, store, filesystem or root authority, and no guessed free observation. registry:App@1863,registry:Host@1825,whole:Route@1855 136b66955b351e71ec06326a564f25c7c4338ee8639fb7b6bef88adb062d7c1b
internal/edge/wakeplacement.go homeMap.wakeSnapshot legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b3a;basis=Project cold-wake candidates from one immutable cached edges fold using the local route's canonical host, release.RouteAccount and app. Reads only in-memory route fields, cached publication additions and mirrored signing keys; no filesystem, registry, store or root authority added. Reject malformed placement evidence independently of the unchanged holder decoder; preserve explicit local safety denials even when stale. registry:App@2068,registry:Host@1173,whole:Route@1204 738a92d33ed1ff738f503f33aa33e29550f0ffb4ce66eeda9551ea83ae1b3bdc
-internal/activator/haforward.go Service.ForwardTarget legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b2;basis=new (region HA P1b-2): the agent's activator answers the edge with a holder box ref for an HA route not awake here, from its in-memory holder cache or one bounded (2 s) lock.json read through readHolderView; reads the route's HA flag and host from its own registry row; root never calls it;rev3=census-ruling-region-ha-dead-holder-backoff;basis=Returns edge.ForwardDecision (Ref, Refuse, Gen) from holderCache.resolve, in memory only: a suspect holder refuses; a positive entry forwards under its generation; a failed read that revalidates an expired suspect keeps it suspect and refuses. The round-1 cache connection gate is removed. The same single bounded (2 s) lock.json read through readHolderView on a miss; no new read and no new S3 request; root never calls it.;rev3=census-ruling-region-ha-p1b3a;basis=Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Read in-memory route Host and whole Route for snapshot/decision only; same bounded lock read, no new store or filesystem operation and no acquire authority. registry:HA@140,registry:Host@1028,registry:Host@2046,registry:Host@2334,registry:Host@302,registry:Host@415,whole:Route@1563,whole:Route@1978,whole:Route@216,whole:Route@2415,whole:Route@769 2e50631e05a29ac96897ed7142e2100d585ccb7ab6d845956d571547dddd779c
+internal/activator/haforward.go Service.ForwardTarget legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b2;basis=new (region HA P1b-2): the agent's activator answers the edge with a holder box ref for an HA route not awake here, from its in-memory holder cache or one bounded (2 s) lock.json read through readHolderView; reads the route's HA flag and host from its own registry row; root never calls it;rev3=census-ruling-region-ha-dead-holder-backoff;basis=Returns edge.ForwardDecision (Ref, Refuse, Gen) from holderCache.resolve, in memory only: a suspect holder refuses; a positive entry forwards under its generation; a failed read that revalidates an expired suspect keeps it suspect and refuses. The round-1 cache connection gate is removed. The same single bounded (2 s) lock.json read through readHolderView on a miss; no new read and no new S3 request; root never calls it.;rev3=census-ruling-region-ha-p1b3a;basis=Retain immutable lock observations and evaluate the pure placement rule after all existing bypass and positive-holder/suspect checks. Fix round 1: decide and reserve under one peer mutex using only current serving candidates, and log the final Base/Refuse decision if attempt tagging loses a race. Reads in-memory route Host and the Route passed to the pure rule; same bounded lock read, no new store or filesystem operation and no acquire authority. registry:HA@140,registry:Host@1028,registry:Host@1984,registry:Host@2132,registry:Host@2305,registry:Host@2575,registry:Host@2698,registry:Host@302,registry:Host@415,whole:Route@1747,whole:Route@216,whole:Route@2523,whole:Route@769 3aec5f42ee7a1f943537f884bc3ee4773ede60c4bb475ea4b9806f0a3bbcdd92
internal/edge/forwardha.go Edge.frontForwardHA legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1b2;basis=new (region HA P1b-2): the agent's edge decides at the front door whether to forward a visitor request: reads the route's HA flag and host from the box's own registry row and asks the activator; forwards only to a box in view over the existing signed hop; root never calls it;rev3=census-ruling-region-ha-dead-holder-backoff;basis=ForwardTarget returns a ForwardDecision (Ref, Refuse, Gen); a Refuse is answered at the front door with the existing unreachable answer (503, Retry-After: 10, same body, via answerHolderUnreachable), with no forward, dial, note or per-request step. A forward passes the decision to forwardHA and NoteForward carries Ref and Gen back. The round-1 connection callback (NoteConnected) is gone: the dial bound now lives in forwardTransport's forwardDialGate, which coalesces TCP dials per holder address in memory. The same 5 read sites; no new read; root never calls it.;rev3=census-ruling-region-ha-p1b3a;basis=Pass the existing route to a lazy cached wakeSnapshot closure, handle explicit local denial before all accounting, and refuse a disappeared Placement choice rather than falling through locally; whole Route read only, no new store or filesystem operation and no root authority. registry:HA@225,registry:Host@928,whole:Route@228,whole:Route@405,whole:Route@548,whole:Route@931 ae7b0d8715c18d05fdebfb3a65861b8b83cd051b6e0d25a60ea16cc4867a8fbc
-@coverage internal/activator 824f9d800d661913d15a0b09e65511d8d9c7d6b693c7c6a062c1327a32282872
+@coverage internal/activator c5b7e26a3821e9f1482f35667c63d5a15de613c4be6d157d697332814885cfc3
@coverage internal/boxchoice 2461971eb41338ab53f0c7c77c0e01b1e0b854f657a1cecddfbaf6c142f0feed
@coverage internal/edge be7b24797e5b0f87f01aafc728c77a8939571a77d8e17394b74b3b6cec29d89d
-@coverage internal/host 8e80c946443f5ec139b840d17a5e7e7e51a9b9a1645c08c1d50dfb275559cb47
+@coverage internal/host 99415a544b5dbbe53ee873c118ff7998ccdea57aad30f5e78eaa914146fb9f0c