Skip to content

Record Session-trace signals and Harness-version trends - #1158

Merged
JacobStephens2 merged 5 commits into
issue-981from
issue-1037
Oct 23, 2026
Merged

JacobStephens2 merged 5 commits into
issue-981from
issue-1037

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #1037.

Session trace (normalized facts + Harness resource)
  ├─ Run completion → retained Session signals → sums by session kind
  └─ historical metrics read → signals from converted traces, no writes
       └─ weekly Session trends → separate Harness-version groups

Keep tokens by observed Model (input, output, cache read/write), reported USD cost, tool errors, permission denials, killed work and repeated tool calls separate. Unknown measurements stay missing. Late amendments and companion task/agent events count the same work once. Update the guide and site pages.

Evidence

  • Before: cargo test --test metrics converted_session_traces_supply_signals_without_rewriting_past_metrics failed with missing Session signals; the completion regression also failed before wiring the recorder.
    After: focused metrics and completion tests passed; six real Harness fixture traces and permission/repetition regressions passed.
  • Before: both review commands failed: python3 /tmp/thirdshift-1037-spec-repro.py target/debug/thirdshift killed returned 0 instead of 2; python3 /tmp/thirdshift-1037-spec-repro.py target/debug/thirdshift session-model reported a null Model.
    After: both identical commands passed, with equivalent Rust regressions retained in tests/metrics.rs. The original standalone repro is retained with the local review artifacts.
  • Before: cargo test --bin thirdshift session::recording::tests::claude_stopped_background_agent_is_one_killed_work_item -- --exact returned 2 instead of 1.
    After: the identical command passed; the regression stays in src/session/recording/tests.rs.
  • cargo check and cargo clippy --all-targets -- -D warnings passed.
  • Initial affected-tests run: all 44 site tests passed, then three Console tests lost server connections. All 16 Console account tests passed on isolated rerun.
  • CI exposed the Console fixture expectation for the two additive nullable fields; the fixture was corrected and its exact test passed locally.
  • The first final run was cancelled after 745 passes when completion reopened a failed recorder’s FIFO. Before: the retained bounded metrics regression timed out at 3 seconds; a two-second standalone CLI repro also timed out. After: cargo test --test metrics non_regular_session_traces_are_missing_without_blocking -- --exact passed in 0.17s and the original cargo test --test progress_lines a_log_failure_still_recovers_and_reports_warnings_and_usage -- --exact passed in 1.58s. Non-regular trace paths now stay missing.
  • Final validation: Linux CI on 762460c passed the complete cargo test suite, formatting, Clippy and generator checks. cargo test took 12m25s, including 38.85s compilation; this excludes queue time. Site and Console browser CI also passed.
  • Local NEXTEST_TEST_THREADS=4 scripts/affected-tests 0d186a3a67077358703eaf95f716671d21f6b7d3 passed all 44 site tests. Its duplicate Rust run was stopped after exact-head CI passed, as docs/testing.md permits: 643 passed before cancellation, four running tests interrupted, no assertion failures. The local attempt took 994.98s total, including site checks and 22.61s Rust compilation. No repeat full-suite run was started after successful CI.

Test seams

  • Session-trace reader: normalized traces recorded from all six Harness fixtures, including amendments, cache conventions, observed Models and killed-work identities.
  • Run completion records and thirdshift metrics --json: sums by session kind, historical missing data, retention and Harness-version trends.

Review coverage

Independent Standards and Spec reviews used issue-981 fixed at 0d186a3a67077358703eaf95f716671d21f6b7d3, with one coverage follow-up each. Standards: 3 maintainability findings addressed. Spec: 3 P2 findings reproduced and fixed. Both axes read 20 of the final 21 changed files, including generated HTML; no generated-output exclusions. Unread by both independent reviewers: tests/console/metrics.rs, added after their single allowed follow-up to update the expected JSON for the two additive nullable Session-signal fields. The parent read it and ran cargo test --test console metrics::peek_shows_retained_run_metrics_and_marks_missing_signals -- --exact successfully. The stopped-agent and FIFO corrections touched already-read files and were tested by the parent after the follow-up.

Reports and each axis's final files-read list are saved locally in .thirdshift-review-uxq9pe/standards.md and .thirdshift-review-uxq9pe/spec.md.

Unaddressed findings

Standards

None.

Spec

None.

Security

None. Guidance-mode review of git diff 0d186a3a67077358703eaf95f716671d21f6b7d3...HEAD (Session-trace signals reader, Run/trend aggregation, cache-inclusive input refactor, tests and prose docs) found no introduced Security finding: inputs are the operator's own local trace files, outputs are the operator's own CLI JSON and retained metrics, parse errors degrade to missing signals, and no trust boundary is crossed. No pre-existing findings are recorded in this review.

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Additive metrics fields; historical reconstruction does not rewrite records. Revert the code to roll back.

Blast Radius: metrics

Run completion records and local metric views, including Session usage interpretation. No Harness pricing table or external metrics requests.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit 7b8de1f into issue-981 Oct 23, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1037 branch October 23, 2026 14:56
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.

1 participant