os-me-extract marks a live session read, so its later moments are never extracted #1257
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1257
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
os-me-extractmarks a session read as soon as it extracts it, even when the session is still live. A live transcript grows after the run. The cursor never lets a later run read that session again, so the moments added after the run are lost. A live transcript also moves to another project folder when the session enters or leaves a worktree, and the run then fails on the old path.Observed
On 2026-10-23 the extraction ran from session 4f3f95ea while that session was live. The session entered the worktree
ticket-1245during the run. The transcript moved from-home-jared-dev-cc-os--claude-worktrees-ticket-1256/to-home-jared-dev-cc-os--claude-worktrees-ticket-1245/.The rerun read the session at its new path and marked it read in
queue/extract-cursor.json. The session continued after that, and its later memos will not be extracted.Reproduce
n/a: needs a live session that changes worktree during an extraction run; the steps are in Observed.
Approach
Follow the cursor design in
docs/decision-system/extraction.md("A session that is still open changes mtime, so it is processed again next time").ExtractCursorstores{session_id => transcript mtime}. A session is unread when its transcript mtime is later than the stored value.MomentExtractor#runadvances the cursor for one session after that session is appended. A moment id thatMomentLogalready holds is not sent toReplyShapeagain, so a changed session costs model calls only for its new memos. A cursor file in the old format (a JSON array of session ids) counts each listed session as seen at its transcript mtime at load time. A transcript path that no longer exists is skipped and not marked.Required work:
File.mtimeinplugins/os-me/lib/os_me/extract_cursor.rbAcceptance criteria
Owner sketch
Origin
os-me-extractrerun for #1244 (S2c) on 2026-10-23plugins/os-me/lib/os_me/moment_extractor.rb,runcallsmark_readper session) ← no rule skips a session whose transcript is still being written. Stop atDESIGN(docs/decision-system/extraction.md, cursor).VERDICT: CREATE
Work started on branch ticket-1257 (os-sdlc implement pipeline).
Resolution
Done: ExtractCursor stores {session_id => transcript mtime}, returns unread paths, advances one session after its moments are appended, migrates the old array cursor at load, and skips a vanished path without marking it. MomentExtractor sends only memos whose moment id the log does not hold to ReplyShape. DecisionMoment owns the id rule and TranscriptCatalog owns session_id(path).
Evidence: Implementation 126 complete (18 dispatches, 15 min 12 s, one reroute after escalation 66 for two test defects fixed by hand). Commits on ticket-1257; os-me suite 177 runs, 0 failures.
Follow-ups: none