Repository navigation
Name every session by a typed session kind that owns its log token, stage and --session rule - #875
Merged
Merged
Conversation
…tage and --session rule One module, src/session/kind.rs, now defines every kind of session thirdshift runs, writes and reads its Session-log token, gives the Command record stage it enters through an exhaustive match, and says which --session words select it. Callers pass the typed kind to the session runner; below it the token stays a plain label, so log names and Model evidence are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en in one place Review follow-up: a token no kind reads is still selected without its -resume, and the repair word selects the numbers it always read. The unnumbered kinds' tokens are written once, and labels below the seam are named as labels. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
One module now owns every session kind. It writes and reads the Session-log token, gives the Command record stage and applies the
--sessionrule. Callers pass a typed kind. Below the session runner the token stays a plain label.src/session/ +├── kind.rs # Kind, Logged { kind, resume }: token, read, stage, selects ├── recording.rs src/session.rs # Sessions::run(kind: Kind, …) — was kind: &str src/logs.rs # session(): if/else ladder ending `else { return; }` → session.stage() src/logs/reading/selection.rs # --session matching → kind::selectsThe stage comes from one exhaustive match. A Resume of the implement session, Spec review, a Repair or Security review enters
Resume. Any other Resume keeps its own kind's stage, as on main.Seams under test:
session::kindinterface: round-trip, stage table,--sessionrules, malformed tokenssession.rs/execution_tests.rstestsEvidence
Before: a token with no matching rung fell through
else { return; }and recorded no stage, and nothing at compile time caught it.After:
cargo test --bin thirdshift session::kindpasses 6 tests:every_kind_reads_back_from_its_token_and_its_resumeseach_session_enters_its_command_record_stagea_session_word_selects_its_token_its_kind_or_any_repairrepair_selects_the_numbers_it_has_always_read_and_no_othersan_unreadable_token_is_selected_by_itself_or_without_its_resumemalformed_tokens_read_back_as_no_kindNo integration test under
tests/changed: Session log names,show/logs --sessionand Command record stages. Fullcargo test: 52 binaries, 2052 passed, 0 failed.cargo clippy --all-targetsis clean.Review follow-up: the Spec reviewer's probes failed on the first commit, as the finding said:
selects("legacy", "legacy-resume")selects("repair", "repair-+1")!selects("repair-1", "repair-01")The fix restores main's
--sessionrules for every token, and the probes are now kept as tests.Merge Danger
Door: two-way
A refactor with no on-disk change: log file names, Model evidence and Command record stage names are unchanged.
Blast Radius: internal
Only in-crate callers of
Sessions::run/run_to_final_messagechange.Unaddressed findings
Standards
src/session/kind.rsusescrate::logs::Stage;src/logs.rsandsrc/logs/reading/selection.rsusecrate::session). Declined because the plan decided it. Issue Name every session by a typed session kind that owns its log token, stage and --session rule #873 Decision: "The module lives with sessions, and the logs module reads it … the logs module gains a dependency on it for the stage and--sessionrules."logs::session(src/logs.rs,pub fn session(session: Logged, path: &Path) { record().stage(session.stage(), Some(path)); }). Declined. It still hides the process-widerecord(), sosessionnever touches the Command record directly. Issue Name every session by a typed session kind that owns its log token, stage and --session rule #873 keeps the stage recorded through the logs module.Logged::of/Logged::resume_of(src/session/kind.rs). Declined because both are used:Logged::resume_of(kind)insrc/session.rs).selectsdestructures the fields (Logged { kind: Kind::Repair(_), .. }).crate::session::Kindinsrc/spec_run.rstests. Declined.Kindthere is alreadycrate::child_run::Kind(src/spec_run.rs:19,use crate::child_run::{Ended, Kind, Runs};). The same finding is fixed insrc/logs.rs, which now importsLogged.Spec
None. Both findings were fixed (see Evidence).
Security review outcome
No unaddressed introduced findings.
Review coverage
Both reviewers read every changed file. No generated-output exclusions.
Closes #873
🤖 Generated with Claude Code
Built with claude · claude-opus-5-5 · medium