carlos / platform Public

host, provision: drop the reconcile trace hook; provision is untouched

Ruling: this branch is log-only and must not change provision.
internal/provision/reconcile.go is back to its 7c811738 content
(ReconcileConfig.Trace and its call sites gone), and the host side no
longer sets or calls it. The first pass still logs the reconcile stage
as a whole with its store op counts.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 2656d74c4bfa85fdf53e4bce96301f9b04546988 parent ebfa325
4 files changed, +6 −44
  • internal/host/agent.go +0 −10
  • internal/host/changeindex.go +2 −5
  • internal/host/startuptiming_test.go +4 −9
  • internal/provision/reconcile.go +0 −20

Intent

Human

<task-notification> <task-id>afd7eeb021ac44e3f</task-id> <tool-use-id>toolu_01RZETJDWzrpdc6R8w5A9LvZ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/68be7e6f-7841-4936-9fa0-2041da778685/tasks/afd7eeb021ac44e3f.output</output-file> <status>completed</status> <summary>Agent "Implement Task 1: startup timing" 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 The review's Minor is fixed: the counting test now fails if store latency stops adding up. Commits: - 4d6a2b2b host: time each startup step up to the end of the first full pass - ebfa325b host: pin that store op latency accumulates per op and diffs Tests: all 6 targeted tests pass, including the new `TestStoreCounterAccumulatesLatency`. With the latency add removed it failed, and it passed again once restored. `go vet` and `gofmt` are clean. Concerns: none new. Those from the first report still stand: the S3 and prefix stores are timed but not counted, and the `opCountingStore` rename. Report (fix appended): /home/paulca/amadan.net/carlos/platform/.claude/worktrees/fleet-first-reconcile-speed/.superpowers/sdd/2026-11-15-fleet-first-reconcile/task-1-report.md</result> <usage><subagent_tokens>217287</subagent_tokens><tool_uses>5</tool_uses><duration_ms>94139</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bc6hz33hl</task-id> <tool-use-id>toolu_01E2aQPRb2iPT3DvfYuNTg2G</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/68be7e6f-7841-4936-9fa0-2041da778685/tasks/bc6hz33hl.output</output-file> <status>completed</status> <summary>Background command "until s=$(amadan ci status carlos/platform -branch fleet-first-reconcile-speed 2&gt;&amp;1 | head -1); ! echo "$s" | grep -q "queued\|running"; do sleep 30; done; echo "$s"" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 15.4 g CO₂e (1,743,701 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on fleet-first-reconcile-speed, 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/agent.go b/internal/host/agent.go
index dd83106ec..c1e2d5ae6 100644
--- a/internal/host/agent.go
+++ b/internal/host/agent.go
@@ -2275,15 +2275,8 @@ func reconcileSerializedWith(ctx context.Context, s release.Store, reg *registry
// been seen. The report is fresh per pass (ReconcileReport is overwritten).
// Sidecar records decide no host's catch: sidecars are never published.
func reconcileSerializedAuth(ctx context.Context, s release.Store, reg *registry.Registry, cfg provision.ReconcileConfig, w *movesWorker, auth *assetAuthority) error {
- // The first pass's stage timing (passLegs.startup); nil otherwise.
- trace := func(stage string) {
- if cfg.Trace != nil {
- cfg.Trace(stage)
- }
- }
reconcileMu.Lock()
defer reconcileMu.Unlock()
- trace("lock wait")
if cfg.WithdrawPool == nil {
cfg.WithdrawPool = preparePoolWithdrawal
cfg.PoolWithdrawn = finishPoolWithdrawal
@@ -2308,7 +2301,6 @@ func reconcileSerializedAuth(ctx context.Context, s release.Store, reg *registry
// read from s afterwards. Disarmed, or when the view cannot vouch, rs is
// s and the pass walks the bucket as before.
rs, epoch, cached := viewStore(ctx, s)
- trace("record view")
source, complete := provision.DepartureSource(rs)
walkStarted := time.Now()
if !cached {
@@ -2360,7 +2352,6 @@ func reconcileSerializedAuth(ctx context.Context, s release.Store, reg *registry
// Sessions ride them too (rootfs apps Plan 6 Task 12): the worker notes
// every in-scope record with a session marker.
cfg = withInteractiveHook(cfg)
- trace("pass setup")
var rep provision.ReconcileReport
instances := cfg
instances.Report = &rep
@@ -2370,7 +2361,6 @@ func reconcileSerializedAuth(ctx context.Context, s release.Store, reg *registry
err := provision.Reconcile(ctx, rs, reg, instances)
auth.recordsPass(start, rep)
err = errors.Join(err, provision.ReconcileSidecars(ctx, rs, reg, cfg))
- trace("sidecars")
if err == nil && cfg.PolicyScope == nil && boxDepartureInventory.Snapshot().Complete {
armedFixedAdmission.Load().observe(groupadmission.Facts{Reconciled: true})
}
diff --git a/internal/host/changeindex.go b/internal/host/changeindex.go
index 558fbea6c..43883d9e3 100644
--- a/internal/host/changeindex.go
+++ b/internal/host/changeindex.go
@@ -377,8 +377,8 @@ type passLegs struct {
bs *buildStates
cfg func() provision.ReconcileConfig // read per pass, as provisionTickConfig always was
- // startup, when set, times the first run's stages and reconcile's own
- // stages, one line each with the store ops each made
+ // startup, when set, times the first run's stages, one line each with
+ // the store ops each made
// (startuptiming.go). Later runs log only when slow, as before.
startup *startupLog
firstRan atomic.Bool
@@ -436,9 +436,6 @@ func (l *passLegs) run(ctx context.Context, what string, keep func(registry.Rout
cfg := l.cfg()
cfg.PolicyScope = policyScope
- if stages != nil {
- cfg.Trace = stages.nested("reconcile: ").done
- }
if err := reconcileSerialized(ctx, store, l.reg, cfg); err != nil {
log.Printf("agent: fast converge reconcile: %v", err)
}
diff --git a/internal/host/startuptiming_test.go b/internal/host/startuptiming_test.go
index d33c852de..7d1c9ed03 100644
--- a/internal/host/startuptiming_test.go
+++ b/internal/host/startuptiming_test.go
@@ -284,8 +284,8 @@ func TestStartupStepsLines(t *testing.T) {
}
}
-// The first run of the pass set logs every stage, reconcile's own stages
-// among them, with its store ops; a later fast run logs nothing.
+// The first run of the pass set logs every stage with its store ops; a
+// later fast run logs nothing.
func TestFirstPassOnlyLogsStages(t *testing.T) {
w := newCIWorld(t)
disarmView(t)
@@ -301,11 +301,6 @@ func TestFirstPassOnlyLogsStages(t *testing.T) {
first := cl.got()
joined := strings.Join(first, "\n")
for _, want := range []string{
- "agent: startup: first pass: reconcile: lock wait took ",
- "agent: startup: first pass: reconcile: record scan took ",
- "agent: startup: first pass: reconcile: mint took ",
- "agent: startup: first pass: reconcile: removal took ",
- "agent: startup: first pass: reconcile: sidecars took ",
"agent: startup: first pass: reconcile took ",
"agent: startup: first pass: moves took ",
"agent: startup: first pass: adopt took ",
@@ -315,8 +310,8 @@ func TestFirstPassOnlyLogsStages(t *testing.T) {
t.Errorf("first run: no line starting %q in:\n%s", want, joined)
}
}
- if !regexp.MustCompile(`first pass: reconcile: record scan took \S+ at \+\S+ \(store: [^)]*list \d+/`).MatchString(joined) {
- t.Errorf("first run: the record scan carries no store listing:\n%s", joined)
+ if !regexp.MustCompile(`first pass: reconcile took \S+ at \+\S+ \(store: [^)]*list \d+/`).MatchString(joined) {
+ t.Errorf("first run: the reconcile stage carries no store listing:\n%s", joined)
}
if routes, err := reg.List(); err != nil || len(routes) == 0 {
t.Fatalf("fixture: the first pass minted nothing (%v)", err)
diff --git a/internal/provision/reconcile.go b/internal/provision/reconcile.go
index c0da6d3c6..780da7732 100644
--- a/internal/provision/reconcile.go
+++ b/internal/provision/reconcile.go
@@ -43,11 +43,6 @@ type ReconcileConfig struct {
// HAIngress receives the complete pre-pool record scan; errors revoke its evidence.
HAIngress func([]Record, error)
- // Trace, when set, is called as each of Reconcile's coarse stages ends,
- // with the stage's name. The agent sets it on its first pass after start
- // to time the stages; nil everywhere else.
- Trace func(stage string)
-
Departures *DeparturePass
ClaimEnabled bool
ClaimInstall func(context.Context, ClaimRecord, func(registry.ClaimOwnership) error) error
@@ -1464,7 +1459,6 @@ func scanInstanceRecords(ctx context.Context, st release.Store, cfg ReconcileCon
// proceeds regardless.
func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg ReconcileConfig) error {
cfg.withdrawPools(ctx, s, reg, false)
- cfg.trace("pool withdrawal")
cfg = withDemoClaimHolds(cfg)
if cfg.Now == nil {
cfg.Now = time.Now
@@ -1486,7 +1480,6 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
}
cfg.Departures.family("instance", sc.departureRecords, err == nil && !sc.departureInvalid && !sc.readFailed && !sc.partial && len(sc.unread) == 0 && len(sc.protect) == 0)
- cfg.trace("record scan")
if err != nil {
return err
}
@@ -1592,7 +1585,6 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
tombs[k] = tombRead{tomb, terr}
prefetchMu.Unlock()
})
- cfg.trace("manifests and trash markers")
// The apps' signed operator policies (#328, #329), for the apps this
// pass mints or keeps rows for: those with an in-scope record and a
// trash marker read and absent. Read through the cache, so a pass reads
@@ -1617,7 +1609,6 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
}
policyNow := cfg.Now()
policies := newPolicyPass(policyCache.read(ctx, freshStore(s), cfg.ReleasePub, policyApps, policyNow, policyScope), policyNow)
- cfg.trace("policies")
seedCache := map[acctApp]string{}
seedKnown := map[acctApp]bool{}
@@ -1838,7 +1829,6 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
}
}
fp.run()
- cfg.trace("forward phase")
// --- mint / converge / conflict -------------------------------------------
routes, err := reg.List()
@@ -1858,7 +1848,6 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
// A colliding host's journal waits too (given neither): its row is the
// instance pass's to leave exactly as it is, the import's included.
journalHandled, journaled, journalOK := journalPass(ctx, s, reg, cfg, recs, readFailed, protect, collide)
- cfg.trace("import journal")
if !journalOK {
readFailed = true
pr.whole = true // an unread journal could be holding any host's import gate
@@ -2398,8 +2387,6 @@ func Reconcile(ctx context.Context, s release.Store, reg *registry.Registry, cfg
}
}
policies.publish()
- cfg.trace("mint")
- defer cfg.trace("removal")
// --- removal, only when nothing failed to read this pass ------------------
// Three conditions, each load-bearing: Provisioned (the flag — not the
@@ -3623,10 +3610,3 @@ func seedJSON(m *Manifest) string {
}
return string(b)
}
-
-// trace reports that a Reconcile stage ended (ReconcileConfig.Trace).
-func (c ReconcileConfig) trace(stage string) {
- if c.Trace != nil {
- c.Trace(stage)
- }
-}