Repository navigation
runner: display-only events.jsonl stream for GUI v1 (#175) - #176
Merged
Merged
Conversation
Append one redacted JSON line per runner-dispatched role invocation start/end to events.jsonl beside the ledger. Emitted at the three runner invocation wrappers (role, zen, specialist) with the exact status and duration the ledger usage entry records for the same invocation, including throw/transport/timeout ends, so an actor never stays working because an invocation failed. recover appends one observed end (role null, duration null, INVOCATION_FAILURE) to close a killed supervisor's dangling start. Native workers inside AGY are invisible to the runner and never produce events; declared delegations are claims, not invocations. Appends are best-effort: a failure warns events.jsonl append failed: <code> and never changes the milestone outcome. The ledger remains the only source of truth.
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.
Implements #175 (runner-side GUI v1 event stream).
What
The vNext runner appends one JSON line per runner-dispatched role invocation to
events.jsonlin the ledger's directory (created lazily on first append). Display-only: the ledger remains the only source of truth for completion, blockers and promotion.Line shapes (exactly these fields):
{"ts","role","milestone","event":"start"}— immediately before each dispatched invocation.{"ts","role","milestone","event":"end","status","duration_ms"}— after the invocation settles, on success, transport failure, throw and timeout alike, so an actor never stays working because an invocation failed.Exact lifecycle statuses
run)bulldozerone)DONE/BLOCKED/NEEDS_DEEPrun)zenGO/NO-GOplan)piledrivernullSUCCESS(advisory envelope carries no status; a packet-levelstatusstring, if present, is used verbatim)alt)instinctnull(the--milestonevalue is nested in the contract and is not a binding)SUCCESSnavi)navinullOBSERVED/DONE/BLOCKED/NEEDS_CONFIRMATIONjaguar/puma/bobcat/strix-haloREADY,ACCEPT)Transport/timeout failures: when the runner resolves
{ok:false}, the end status is the runner error code verbatim (TIMEOUT,SPAWN_ERROR,MODEL_ERROR,INVALID_OUTPUT,EMPTY_RESPONSE,INVALID_RESPONSE_FORMAT,TOOL_PERMISSION_DENIED,EXECUTION_FAILED,PROMPT_TOO_LARGE,RECURSION_DETECTED, ...). When the invocation throws, it iserror.code || error.name || 'ERROR'(e.g.ETIMEDOUT,ENOENT). Zen envelope rejections throw plainError->Error. Every status string is exactly what the ledger usage entry records for the same invocation (asserted in tests).recoverappends one end line:role: null,duration_ms: null, statusINVOCATION_FAILURE(mirroring the ledger record) — it closes the dangling start a killed supervisor left; the ledger records no active role.Limitations (by design)
delegationsare claims, not observed invocations (no events, matching their unverified ledger accounting).Safety
scripts/telemetry.mjsredaction (<redacted>secrets,(local path)user paths) before the line is written.events.jsonl append failed: <code>to stderr and never changes the invocation or milestone outcome (covered by tests with an injected throwing log and a real read-only file).Verification
SKIP_LIVE_TESTS=1 node --test tests/*.mjs-> 353 tests, 332 passed, 0 failed, 21 skipped.python3 tests/test_zen_shell_guard.py-> 8 tests OK;python3 tests/test_excavator_shell_guard.py-> 7 tests OK.tests/test_events.mjs(emitter schema/redaction/ordering/nonfatal append) andtests/test_runner_events.mjs(integration at the real runner invocation seam: paired start/end, ledger status/duration equality, specialist adapter vs declared delegation, transport + thrown failures, redaction at the seam, null-milestone planning/alt, nonfatal append failure, killed-supervisor recover pairing).