Repository navigation
Report a failure with the Session log of the session its cause came from - #933
Merged
Merged
Conversation
A Security hold is raised only after the Repair loop, whose sessions may run after the review, so the failure report, the Command log's closing line and the Run notification named a later Repair's log. The review's Outcome now carries its Session log and the Failed run path reports it for a hold. A cause from no session keeps the most recent Session log, as the guide now says. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…private A Spec run whose Tickets are not done reported no Session log, though one Ticket's session can be the whole cause. It now names that Ticket's log when just one Ticket's Run failed, and none when several did, as the guide says. A failing Repair after a Security review is tested end to end, the Security hold's log is read through an accessor, and the review's actionable checks move to a named helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
As a Run does, an interrupted Spec run keeps the Session log it would report. The log is read from the board once the landing ran to its end, not set inside the failure's closure, and a Ticket blocked by the failed one leaves the failed Ticket's log named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 21, 2026
Merged
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.
Summary
A failure report now gives the Session log of the session its cause came from, not just the last session that ran. The terminal report, the Command log's closing
session log:line and the Run notification all readFailedRun.log, so they agree.Delivery implement session Security review → Outcome { ended, log: security-review.jsonl } Repair loop → repair-1.jsonl … Security hold raised (Merge run) fail(log = most recent) - report log = most recent (repair-2.jsonl, as in #776) + report log = hold.log() or most recent (security-review.jsonl) Spec run, Tickets not done - report log = none + report log = the one failed Ticket's log; none if several failedHere is the rule for each cause. The guide documents it under Logs.
Sessions::last_log_of(kind)returns the last session's log only if that session was ofkind. A Security review that started no session therefore carries no log, and its hold falls back to the most recent one.Evidence
Before: the new tests fail with the hold's log choice disabled:
security_review::a_refused_security_review_followed_by_a_repair_reports_the_reviews_session_logpanics because the reported log is…-repair-1.jsonl.delivery::tests::a_security_hold_after_a_repair_reports_the_reviews_session_logfails.main,spec_run::tests::a_spec_run_failed_by_one_tickets_session_names_that_sessions_logfails withleft: None, right: Some("/logs/session.jsonl").After: all of these pass. The full
cargo testrun passes (2204 tests), and so docargo clippy --all-targets -- -D warningsandcargo fmt --check.The acceptance criteria are covered by these tests:
Merge Danger
Door: two-way. This changes which path is reported. Nothing is stored or published differently, and the notification format is unchanged.
Blast Radius: reporting. It touches the Failed run's Session log line on stderr, in the Command log and in the Run notification. A Spec run failed by Tickets now prints a
session log:line it did not print before.Unaddressed findings
Standards
All of these are judgement-call smells. None says behaviour is wrong.
Outside::security_review. It follows the existing(Result<T>, Option<PathBuf>)shape ofSessions::within/checked_within(src/session.rs:141,:156). TheErrmust stay inspectable forUntrustedEditbefore it becomes an Outcome (src/delivery.rs:231).SecurityHoldinfail/stopped_at. They answer different questions: whether to keep the PR ready (src/delivery.rs:372), which log to report (:374) and where the Run stopped (:414). Merging them would hide that.faildirectly. This follows the precedentfailed_run_finishing_errors_warn_and_preserve_the_primary_error_and_log(src/delivery.rs:1144). The routed cases are tested throughdeliverand end to end.last_log_ofrepeating theexists()filter. It is read in the middle of the steps, beforechecked_within's filter runs at the end (src/session.rs:178), so it has to filter for itself (:329).last_log_ofhas no direct unit test.tests/security_review.rs:621exercises it end to end, and that test goes red without the fix.Outcome.logexists only to feedHold. The issue's Key interfaces ask for exactly this: "Where a Security review's outcome becomes a hold (the Security reviewOutcome): it needs to carry its Session log with it."Landingcarrying several board facts. That struct shape predates this change (src/spec_run.rs:368). This PR adds one field to it and does not restructure it.PathBuf. The cause isEnded::Failed { log: Option<String> }(src/child_run.rs:382), which predates this change and is parsed from a child Run's output. Changing it is outside A failure report links the most recent session's log, not the one that caused the failure #911.TicketBoard::failed_logduplicating the query inlines(). The predicates differ.lines()matches only failures with a log (src/spec_run/ticket_board.rs:178).failed_log(:140) must also count failures without a log, so that two failures never name one.Spec
None. Findings (a)1, (a)2 and the follow-up's interrupt filter were all addressed.
Security review outcome
No unaddressed introduced findings.
Review coverage
Both axes read every changed file. There were no generated-output exclusions. Commit 0632e12 came after both review passes. It edits only
src/spec_run.rs, which both axes read in their follow-up, to resolve the follow-up findings.Closes #911
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium