Skip to content

sminos guide: right member on /branch and in-session /resume; a fork told it is one (#99) - #269

Merged
SSFSKIM merged 5 commits into
mainfrom
smns-guide-fork
Oct 19, 2026
Merged

SSFSKIM merged 5 commits into
mainfrom
smns-guide-fork

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Board #99 (spike): a live check of the sminos session-start guide on the real engine's /clear, fork and compaction SessionStart paths, and the fix for what it found. The measurements are in the findings comment (board:693) and in the org-directory spec's Surprises & Discoveries (#99).

What the live check found (Claude Code 2.1.303, plugin 7.188.8)

  • /clear, /compact, claude --resume <id> --fork-session and claude --bg --resume <id> (a running session's fork): when the hook starts, the engine's record already names the session. The guide names the right member within 0.2–0.3 s.
  • /branch and an in-session /resume <id>: the engine's record still names the session being replaced, and it is rewritten only once the SessionStart hooks return. This was measured at +5.13 s behind a capture hook that blocked for 5 s, and at +1.63 s and +2.43 s behind the guide's own 1.5 s wait. The guide printed nothing. The branch's context then holds only its parent's copied guide, so the branch believes it is the parent.
  • A fork that does get its guide still holds its parent's guide above it. Asked who it was, the live --fork-session session quoted both lines and would not choose.

The fix

  • The engine running the hook stands in for the record. When no record names the session, sminos guide reads the record of the engine running its hook (CLAUDE_PID). The record is believed only when CLAUDE_CODE_SESSION_ID beside it is the payload's session; a pair inherited from an outer engine names another session. The session id is substituted in. The payload's session_title becomes the name when there is one (/branch passes one); otherwise the process's own name stands. The facts the gate checks (kind, entrypoint, pid, the host's mark) belong to the process, so they are already the new session's. There is no wait on this path.
  • A fork is told it is one. Its first line ends "You are a fork of another session: any sminos line above this one was written for it, not you." In headless haiku runs of the live --fork-session context, the fork was named 0/4 times without the clause and 4/4 with it.
  • board-api integration drills: five fail on the dp#63 live-binding fence; edge-verbs spool probe is quadratic on TMPDIR #99's open question. The question was whether a fork gets a fresh line or none. §9 already answers it: a fork gets the whole guide, and its first line names the fork.
  • The spec records the observation (with the measurement table) and the decision. It also notes that M7's claim, that a hook's environment carries no CLAUDE_CODE_SESSION_ID, no longer holds on 2.1.302+.

Tests

tests/sminos/test-guide.sh gains a fork case and a same-engine case: /branch with a title, /resume without one, an inherited environment, a claude -p engine, and an ended engine. Five of these cases fail on main and pass here.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)

…ork is told the line above it was its parent's (#99, 7.188.10)

The live check of board #99 (Claude Code 2.1.303) found two ways the
session-start guide misses the session it starts:

- `/branch` and an in-session `/resume` fire SessionStart while the
  engine's record still names the session they replace. The engine
  rewrites the record only once the SessionStart hooks return, so the
  guide's 1.5 s wait never saw the new session and printed nothing. The
  guide now reads the record of the engine running its hook (CLAUDE_PID,
  believed only when CLAUDE_CODE_SESSION_ID beside it is the payload's
  session), with the payload's session_title as the name when it gives one.
- A fork's context holds its parent's guide, copied with the conversation.
  Asked who it was, a fork quoted both lines and would not choose (0/4
  headless haiku runs). Its first line now says it is a fork and that any
  sminos line above it was written for the parent (4/4).

Findings on the board (#99, board:693); the org-directory spec's Surprises
& Discoveries and Decision Log record both.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T14:58:48.199842Z aaca3ce PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

…p to 7.188.11

Main took 7.188.10 with #270, so this branch moves to the next patch above
it. No conflicts.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…narrow the Decision line to /branch (review of #269)

The review's one P3: after an in-session /resume the engine renames the
process from the resumed transcript's agent name, so a guide that took the
payload's title or the process's name can name another alias than the one
the log joins the session under. Logged in TECH-DEBT.md (T3) with its
trigger; the Decision line now claims the title only for /branch and points
at the entry.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
…; bump to 7.189.1

Conflicts only in the version manifests: main's side taken (devcloud 0.4.2
with it), then bump-version.sh to 7.189.1, the next patch above main.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 2018dab into main Oct 19, 2026
9 checks passed
SSFSKIM added a commit that referenced this pull request Oct 19, 2026
…e-roster; bump to 7.189.2

Conflicts resolved:
- cmd_guide: #269's guide_text(session, launch, source, session_title) call,
  with the roster's launch variable and its append around it.
- test-guide.sh: #269's fork and engine-record cases and this branch's
  roster cases both kept, the roster's first.
- The spec's Decisions: #269's, then the roster's, its follow-on.
- CLAUDE.md's hooks/ row: main's line with the roster clause.
- The version manifests: main's side, then bump-version.sh to 7.189.2.

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
SSFSKIM added a commit that referenced this pull request Oct 19, 2026
…ise-handle-form; bump to 7.189.2

Sminos-Session: smns-erb-71#b4948247 (doperpowers on macbook)
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