Repository navigation
Description
Strength: Worth exploring · Dependencies: local-substitutable
Files: src/logs/run_metrics.rs, src/logs/metrics/trends.rs, src/logs/command_record.rs, src/session/recording.rs, tests/run_metrics.rs, tests/metrics.rs
Before
flowchart LR
C[Completion metrics] -.-> R[Command records]
W[Weekly trends] -.-> R
C -.-> E[Session evidence]
W -.-> E
classDef leak stroke:#dc2626,stroke-width:2px;
class C,W leak
After — opportunity to investigate
flowchart LR
C[Completion metrics] --> A[Run metrics Session attribution]
W[Weekly trends] --> A
A --> R[Command records]
A --> E[Session evidence]
classDef deep stroke-width:3px;
class A deep
Problem: Completion metrics and weekly trends independently associate Sessions with stages and evidence, spreading identity, first-stage ownership and setup knowledge across their implementations.
Evidence:
- Completion metrics zip recorded stages with metric stages and deduplicate Session signals by normalized Session identity; review findings instead deduplicate literal paths.
- Weekly trends independently reconnect metric stages to recorded stages by index, deduplicate normalized Session identities, read exact-Command Model evidence, and track Security review/Resume setup fallback.
Solution: Investigate a deep Run metrics module whose interface owns Session-to-stage attribution and evidence selection at one seam, retaining completion and weekly trends as distinct projections.
Wins
- Locality: one attribution policy
- Leverage: completion and weekly trends
- Tests cross one shared interface
Why not Strong: Some rules serve different projections; the deletion test has not established that consolidation would concentrate meaningful complexity rather than move it into another shallow module.
Investigation: Prototype the attribution seam against shared Session references, former/current filename aliases, repeated Repairs, missing evidence and Security review Resumes; reject a helper that merely returns a normalized path or relocates the existing loops.
Testing: The interface is the test surface; existing completion and CLI trend regressions should survive, with temporary-file test adapters exercising attribution and evidence together and replacing duplicated private-helper tests where applicable.
Constraints: Preserve retained metric formats, read-only historical reconstruction, missing-evidence coverage, exact owning-Command Model evidence and ADR 0019/0021; the Trace ancestry module owns display ancestry and should retain that responsibility.
Priority and overlap: Recent Run metrics work expanded completion recording to Review, Triage and Fix runs (#2047); this seam now affects more callers. All 186 open issue titles and bodies were checked. No open issue proposes this deepening; #2036/#2066 change aggregation and presentation rather than concentrating Session attribution policy.
Activity
JacobStephens2 commentedon Nov 12, 2026
Investigation summary
Investigated #2082 against selected Base commit 287d9a9. Code inspection confirms duplicated attribution policy, but does not establish that the proposed consolidation earns its interface cost. Recommend separating the interface proof from production migration.
Confirmed evidence
Proposed split
A. Prove a Run metrics attribution interface using temporary-file evidence adapters and a behavior matrix. Explore ordered stage observations that hide positional matching, normalized identity, first-stage ownership, evidence selection and setup fallback without exposing those algorithms to both callers. Exercise shared references, former/current filename aliases, repeated Repairs, absent/corrupt evidence, no-path stages, mismatched retained stage arrays, wrong-owner Model evidence, Security review Resumes and orphan Resumes. Demonstrate which caller responsibilities disappear; reject a normalization helper or pass-through extraction.
B. Only after A establishes depth and settles the alias policy, migrate completion and weekly trends through that interface. Keep timing, aggregation, grouping and serialization in their existing projections. Preserve retained formats, saved metrics, historical read-only behavior, missing coverage, requested-versus-observed Model distinctions and ADR 0019/0021. Trace ancestry remains responsible for display attachment and descendant ownership.
Existing regression anchors include tests/run_metrics.rs:226,271 and tests/metrics.rs:397,465,641,660,715,1151,1267,1358. Future implementation validation should run the focused Run metrics/metrics suites and scripts/affected-tests against its Base branch.
No matching open issue was found among 186 open issues searched by title/body. #2036 and its related Tickets address aggregation/presentation rather than this interface. Tests were inspected, not executed: this investigation confirms an architectural observation, not a reported runtime failure. No source, Git-history or GitHub changes were made.
Questionnaire
For the Day shift deciding how to advance #2082:
Code inspection confirms repeated Session attribution logic, but the issue's deletion test remains unproven. The proposed scope also contains a potential behavior change: completion review counts deduplicate literal paths while Session signals normalize former/current filenames.
JacobStephens2 commentedon Nov 25, 2026
Investigation summary
Re-investigated #2082 against current Base HEAD 0d205f0; the issue cites 287d9a9. The duplicated Session attribution is still present and has grown since the cited base, but the deletion test remains unproven and consolidation must now settle observable divergences between projections. Recommend approving the split below rather than treating this as one agent-ready Ticket.
Confirmed on current Base
New since the cited base and prior triage
Proposed split
A. Prototype the attribution seam first, with temporary-file evidence adapters and a behavior matrix: shared Session references, former/current filename aliases, repeated Repairs, absent/corrupt evidence, no-path stages, mismatched retained stage arrays (including the trends-vs-groups name-mismatch divergence), wrong-owner Model evidence, Security review Resumes and orphan Resumes. The interface must hide positional matching, normalized identity, first-stage ownership, evidence selection and setup fallback, and demonstrate which responsibilities disappear from run_metrics, trends and groups; reject a normalization helper or pass-through extraction.
B. Only if A demonstrates depth, migrate completion metrics, weekly trends and signal groups through the seam as distinct projections, keeping timing, aggregation, grouping and serialization in place. Preserve retained metric formats, read-only historical reconstruction, missing-evidence coverage, requested-versus-observed Model distinctions and ADR 0019/0021. Regression anchors: tests/run_metrics.rs:226-271 (first-stage review counts, missing summaries) and tests/metrics.rs:397,465,641,660,715,1151,1267,1358-1362; validate with the focused run_metrics/metrics suites and scripts/affected-tests against the implementing Base.
Decisions for the Day shift
No duplicate found: all 203 open issue titles were listed and searched for attribution/session-evidence/metrics terms; #2087 (Fleet signal groups across machines), #1655 and #1639 touch neighbouring metrics behaviour but do not propose this attribution seam. Tests were inspected, not executed - this confirms an architectural observation and code-level divergences, not a reproduced runtime failure.