Skip to content

Flag destructive commands in Run metrics - #1163

Merged
JacobStephens2 merged 4 commits into
issue-981from
issue-1038
Oct 23, 2026
Merged

JacobStephens2 merged 4 commits into
issue-981from
issue-1038

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Run completion
  read each unique Session trace
    match shell commands against one PATTERNS list
    retain {pattern, command} flags by session kind
  save metrics with the original Run outcome
Weekly Session trends count the flags

Flags cover force pushes, explicit shared-branch rewrites and recursive deletes outside the Worktree. Old evidence remains missing when the check cannot establish a result. The guide and site pages describe the advisory behavior.

Closes #1038

Evidence

  • Before: all five initial Spec regressions failed; all three additional regression tests failed on the reported cases.
    After: the retained regressions pass in cargo test --test metrics (24 passed, one fixture entry ignored). Fixtures cover matching commands and near misses across all six Harness command shapes; fixture commands are trace data.
  • cargo test --test run_metrics: 10 passed, one fixture entry ignored, including successful and failed Runs with flags, late amendments and trace removal.
  • cargo test --test console peek_shows_retained_run_metrics_and_marks_missing_signals: passed.
  • cargo check, cargo clippy --all-targets -- -D warnings, formatting and generated-doc checks passed.
  • scripts/affected-tests 7b8de1fc8cb5bdb27aaf037aecaa53b9c17c66e7: passed on 2786258; 44 site tests and 2,405 Rust tests passed (58 fixture/helper entries skipped). Timed selection: 1,945.16 s wall, including the 112 s Rust compilation; nextest execution: 1,756.743 s.
  • One initial site navigation check hit its 2 s timeout; its focused rerun and the complete final site run passed.

Test seams

  • Whole binary against fake Harnesses: Run outcome and retained metrics.
  • Normalized Session-trace fixtures read through thirdshift metrics: flags, near misses, historical evidence and weekly counts.
  • Console HTTP details and show --json: retained commands and missing signals.

Review

Reviewed against issue-981 pinned at 7b8de1fc8cb5bdb27aaf037aecaa53b9c17c66e7. Addressed both Standards judgment calls and all seven Spec findings, running each behavioral reproduction before fixing it and retaining its tests. Both axes read all 14 changed files, including the generated HTML hunk. Generated-output exclusions: none. Unread changed files: none.

Unaddressed findings

Standards

None.

Spec

None.

Security

None. Security review of the issue-1038 diff against merge base 7b8de1f found no introduced findings: the check only lexes session commands (never executes them), retained commands render escaped in peek via linkify, trends keep counts only, and flags are advisory (never block or fail a Run).

Security review outcome

No unaddressed introduced findings.

Merge Danger

Door: two-way

Blast Radius: metrics

Adds advisory metrics and trace-directory metadata. Saved flags do not change Delivery or Run outcomes.

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit c77938b into issue-981 Oct 23, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1038 branch October 23, 2026 16:32
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