Skip to content

Spec: Session traces, OTLP JSON Lines in place of Session logs - #1111

Merged
JacobStephens2 merged 13 commits into
mainfrom
issue-700-branch-2
Oct 23, 2026
Merged

JacobStephens2 merged 13 commits into
mainfrom
issue-700-branch-2

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #700
Closes #854

All Spec #700 Tickets are integrated. Sessions from Claude, Codex, agy, Grok, Muse and OpenCode now record correlated OTLP log records and spans in place of raw Session logs.

Harness events → normalized events → Session trace
                                  ├── .logs.jsonl → conversation / show / heartbeat
                                  └── .spans.jsonl → Waterfall tree / Peek / export
Command record → Command / Run / stage ancestry ────────────────────────┘
  • The shared normalized events retain raw Harness output, setup/prompt, Harness version, Models, usage/cost and tool outcomes. Records arrive live; ended spans retain timing and interruption errors. Model evidence and review reports keep their existing stems.
  • All six Harnesses render in conversation; byte-offset streaming, latest-event show, Silent, heartbeat and inventory use the log-records file. The Waterfall grows a foldable span tree, slowest-call ranking, zoom and summary Peek, paired with show --spans / --span --json and a 390 px phone layout.
  • Codex apply_patch diffs come from Codex's own retained session files and are marked as such. Missing diffs and shell edits retain the existing fallback.
  • Export includes the complete Command Trace and record-derived ancestors. Optional OTLP/HTTP sending is best effort; Security Sessions stay local and behind Console sign-in. The standalone codec uses existing runtime dependencies and is checked against official protocol types.
  • Convert both hosts' Session logs and check the reports #994 completed both hosts' conversion before The switch: stop writing Session logs #997 retired the converter, raw writer and old readers. Retained original-path references resolve to converted traces. Glossary, guide, README and generated Session prompts now use Session trace; Command logs and Activity logs retain their names.

Review fixes in bb63be8 make export and Console ancestry agree, keep dispatched Sessions with their actual Run, migrate the retained timing checks, and correct the remaining terminology/ADR drift.

Evidence

Seams under test:

  • The built CLI against fake Harnesses: Session-trace files, Model evidence, ancestry and export.

  • Console HTTP routes and their paired CLI views: exact span times, stage ancestry and retained records.

  • Console browser interactions: live refresh, tree folding, summary Peek, keyboard navigation and phone layout.

  • Generated public documentation and Session prompts.

  • Before: both independent Spec reproductions failed: exported child Runs bypassed their dispatch stage, and Pickup inventory attached a dispatched Spec's Session to the Pickup. The end-to-end export comparison failed on each defect before its fix.
    After: both exact reproductions pass. cargo test --test export_trace passes (3 tests, 1 fixture entry ignored), comparing every span's parent across CLI/Console and exported OTLP.

  • Before: python3 console/reproductions/waterfall-fractional.py and python3 console/reproductions/waterfall-stage.py failed with empty tool lists.
    After: both pass with actual Session traces; fractional timing is 150.25 ms and the tool nests under its implement stage. waterfall-trace-axis.py also passes.

  • npm test --prefix console: 59 passed after the fixes, including live tree/Peek/zoom, keyboard and phone checks.

  • cargo fmt --check and git diff --check: passed.

  • /usr/bin/time -p scripts/affected-tests main: passed; all 37 site tests and the full Rust suite passed. Wall time 1199.92 s (19m 59.92s), including Rust compilation. Nextest was unavailable, so the selector used cargo test.

Unaddressed findings

Standards

  • S4, remaining generic traversal extraction declined: the reviewer withdrew this heuristic after shared rules were extracted. src/logs/trace.rs:101 owns dispatch-stage selection, both callers use it (src/logs/spans.rs:300, src/logs/export.rs:180), and src/logs/export.rs:174 uses shared Session-stem normalization. The remaining traversals produce distinct presentation and OTLP projections; a generic visitor adds an interface without removing another domain decision. All three concrete Standards findings were fixed. No Spec or Day shift decision is deferred.

Spec

None. Both findings were reproduced and fixed.

Security

None. Guidance-mode review of the f2eb1fa...HEAD diff found no introduced finding: the new /spans route inherits the Console sign-in guard middleware, span rendering uses textContent with server-side </>/& escaping of the embedded JSON, the OTLP endpoint keeps its pre-existing Security-run exclusion, export writes fixed filenames with no-clobber tempfiles, and the Codex session-file lookup matches existing filenames only. No proof-of-concept failed, so no fix and no new regression test.

Security review outcome

No unaddressed introduced findings.

Review coverage

Standards and Spec each read all 127 original changed paths, the additional ADR amendment, and relevant supporting files. Each reviewer inspected generated changed hunks and removed contents directly. Unread changed files: none under either axis. Generated-output exclusions: none. Final reports and each axis's combined files-read manifest are saved locally in .thirdshift-review-D4gS6S/standards.md and spec.md.

Merge Danger

Door: one-way

The final cutover assumes #994's conversion completed on both hosts. An older binary that reads only raw Session logs cannot read newly recorded Sessions. This PR does not delete the hosts' originals; that human conversion step is already complete.

Blast Radius: observability

All six Harnesses' Session recording, the Console, CLI log inspection and trace export.

Built with codex · gpt-6.1-sol · xhigh

Tickets

Replace raw Session logs with Session traces
Share dispatch-stage ancestry between the Console and OTLP export, and let dispatched Runs claim their Sessions before ancestor inventory. Retain end-to-end coverage for every span parent, migrate timing reproductions to Session traces, and correct Command-log terminology and the cutover ADR.
@JacobStephens2
JacobStephens2 marked this pull request as ready for review October 23, 2026 07:19
Keep the Session-trace cutover and converter retirement while preserving main's decoded tail budget, Codex diff recovery and Security review fallback. Adapt incoming regressions and regenerate the manual for the merged behavior.
@JacobStephens2
JacobStephens2 merged commit 380e63a into main Oct 23, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-700-branch-2 branch October 23, 2026 07:57
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decide Codex patch evidence retention for Console edit diffs Spec: Session traces, OTLP JSON Lines in place of Session logs

1 participant