feat(supervisor-run): read Runtime's settle record and add a report command - #740
Merged
Conversation
…ommand The supervisor-run reader takes a run's status from Runtime's own terminal record. result.json is the SupervisedResult that supervise() returned and its kind is the status; failure.json without a result reports status failed with the recorded error instead of unavailable. The loops state.json status and result.json sup_status stay readable as named legacy sources. readTerminalRecord is the one derivation the analyzer and the rollout minter share, which replaces the stale state.status ?? result.sup_status expression in analyze.ts. A directory holding observer.jsonl or failure.json is a Runtime run directory before its spawn journal exists, so a run that threw before its first spawn is read as a Runtime run and the report names the run id the record carries. agent-eval supervisor-run report <runDir> [--format headline|markdown|json] prints the headline, markdown, or JSON report; exit 1 on a read error. Fixtures copy the real discovery-lab recursive smoke r1 observer and spawn journals and add a synthetic result.json in Runtime's canonical byte form plus a synthetic failure.json for the first attempt's throw. Version 0.175.0 across the npm package and the Python client. Refs #711
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.
Change
The supervisor-run reader now takes a run's status from Runtime's own terminal record, and the CLI can print one run's report.
readTerminalRecord(newsrc/supervisor-run/terminal-record.ts) is the one derivation the analyzer and the rollout minter share.result.jsonis theSupervisedResultthatsupervise()returned; itskindis the status (supStatusSource: 'runtime-result') and itsreasonissupReason.failure.json({ runId, pursuitId, at, error: { name, message } }) without a result reports statusfailedwith the recorded error (runtime-failure), notunavailable.A
failure.jsonbeside a settled result is an earlier attempt's throw and is reported withearlierAttempt: true; the settled result stays the status.The control-plane-era
state.jsonstatusandresult.jsonsup_statusremain readable as the named legacy sourceslegacy-stateandlegacy-result.state.status ?? result.sup_statusexpression inanalyze.tsis replaced by the shared derivation;rollout-nodes.tsmintssup_status,is_completed, anderrorfrom the same record.trajectory.json, which Runtime never wrote.It passes
result.jsonandfailure.jsonthrough as bytes (SupervisorRunSources.failure), refuses a result whosetree.rootis not the journal root, and refuses a failure record with noerrorobject.isRuntimeSupervisorRunDirrecognizes any file only Runtime's durable layer writes (spawn-journal.jsonl,observer.jsonl,failure.json), so a run that threw before its first spawn is read as a Runtime run.The absent-journal report carries the run id the record names.
agent-eval supervisor-run report <runDir> [--format headline|markdown|json]printsrenderSupervisorRunHeadline, the markdown report, or the JSON report.Exit 1 when the directory cannot be read, 2 on a usage error.
package.jsonand the Python client;pnpm analyst:pinre-pinned the dependency-lock digest that coverspackage.json.Refs #711: the observer projection is not consumed here; this reads the terminal records the projection does not carry.
Runtime side:
tangle-network/agent-runtimebranchfeat/durable-settle-record(issue tangle-network/agent-runtime#1109), whosesettle-record.tswrites the two records this reader consumes.Evidence
Fixtures are copies of the real discovery-lab recursive smoke r1 directory (2026-09-06).
tests/fixtures/supervisor-run/runtime-run-r1-no-winner/holds byte-identicalobserver.jsonl(14 records) andspawn-journal.jsonl(28 lines), a syntheticresult.jsonin Runtime's canonical byte form for that journal (no-winner,all-children-down, 4 nodes), and a syntheticfailure.jsonfor the first attempt's throw (the observer's record 2, 05:58:29.604Z).runtime-run-r1-failed/is that directory as it stood after the first attempt: the first two observer records and the failure record, no journal.A test asserts every observer copy is digest-chained with sequences 1..n.
Limits
result.jsonin the fixture is synthetic: r1's real result was never persisted (the defect the Runtime branch fixes), so theSupervisedResultwas reconstructed from the journal's settled events and totals.journal-unavailableinstead of inventing one.docs/public-api.md(the consumer census) is generated on demand with a repository sweep and was not regenerated; the new exports (readTerminalRecord,runSupervisorRunCommand, and the constants) will show asnoneuntil the next sweep.🤖 Generated with Claude Code