feat(daemon): launch ladders → step() O8 observations (coupling-core B1)#475
Merged
Conversation
…coupling-core B1)
The four launch ladders (handleStartRun / processStartRunCore /
processContinueRunCore / handleContinueRun) and their failure arm
(failOpenCodeRunBootstrap) no longer write run status events. Every
milestone and bootstrap failure is reported as an O8 launch observation
(launchSignal) and decided by the pure policy stepLaunchProgress:
stageRunCreated -> queued, stageLaunchReady -> booting,
stageWorkspaceOnly/stageAgentStarted -> running,
failure -> failed (reason launch_<step>, error artifact first)
- commitRunStatus (new status_commit.go) extracts the guard/append core
of updateStatus and is now the single constructor site for status
events. updateStatus keeps the monitor-plane consequences (publish,
auto-resolve, listeners); reportLaunchProgress is the launch-plane
executor and also serves the worker process, which has no Daemon.
- Launch failures gain machine-readable reasons launch_<step> (new law
L9), keeping the error-artifact-then-verdict order of the old ladders.
- Terminal absorption replaces store-guard reliance: a launch
observation on a terminal view is absorbed by the stepRun L4 guard
instead of dying as a silently discarded append error (same fold
outcome as before).
- The implicit initial queued (the fold default) is no longer
materialized as a redundant event.
- nosemgrep whitelist: 47 -> 10 annotations (socket.go 40 -> 3; every
survivor has a recorded disposition in run-state-machine.md section 6).
- Law tests: O8 joined the law-sweep observation set, so terminality,
determinism, idempotent convergence and stream fixed-point now cover
it; dedicated stage-mapping and failure-reason tests added.
- Docs in the same change set: run-state-machine.md sections 1/2/3/5/6/7
(D-B1), AGENTS.md status-write-surface, roadmap B1 + watchlist.
Verified: go build ./..., go test ./internal/daemon, make lint, full
go test ./... (only the two pre-existing tmux-environment integration
failures, identical on main at f39a19b).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Phase B1 of the coupling-core roadmap: the four launch ladders (W2
handleStartRun, W3processStartRunCore, W4processContinueRunCore, W5handleContinueRun) and the failure arm (W7failOpenCodeRunBootstrap) no longer write run status events. All 37 ladder append sites are replaced by O8 launch observations decided in the pure transition core.Key decisions (run-state-machine.md §7 D-B1)
commitRunStatusextraction:updateStatus's guard/append core is now a process-neutral function, so the worker plane (which runsSocketServerwithout aDaemon) commits through identical guards. Status events are constructed in exactly one place.stepLaunchProgress's.launch_<step>reasons (new law L9), rendered byorch psasfailed(launch_session)etc.queued(fold default) is no longer materialized as a redundant event.Whitelist meter
nosemgrep: run-status-write-surface: 47 → 10 (socket.go 40 → 3). Every survivor has a §6 disposition: W6/W8 (integrate v2), W9 ×4 / W10 (quarantined law boundaries),appendRunResolvedByUser(B3 verb), plus the sanctioned constructor itself.Tests
TestStepLaunchProgressStageMapping(stage→status + re-affirmation silence),TestStepLaunchFailureCarriesReason(artifact order,launch_<step>,launch_bootstrapfallback).go build ./...,go test ./internal/daemon(19.4s ok),make lint(all semgrep fixtures pass, 0 findings), fullgo test ./...— only the two pre-existing tmux-environment integration failures (TestAgentClaudeCreatesMultiplexerSession,TestAgentStatePersistence), reproduced identically on main @ f39a19b.Docs in the same change set
run-state-machine.md §1 (writer table + single-constructor note), §2 (O8), §3 (O8 matrix rows), §5 (L9 +
launch_<step>reason family), §6 (W2–W5/W7 → integrated), §7 (D-B1); AGENTS.md status-write-surface; roadmap B1 + watchlist rows 1/6.Per the routing rule this is a core change: frontier + human review — please review before merging.
🤖 Generated with Claude Code