decision-system S2c: moment record, log, cursor, extract CLI #1244

Closed
opened 2026-10-23 15:17:25 +00:00 by jared · 2 comments
Owner

Problem

Detected moments must persist in the Store as a stored format that other code parses. Nothing writes DecisionMoment records today. A manual CLI is the tracer bullet that proves the whole chain on real train sessions.

Approach

Required work:

  1. Add DecisionMoment — check: present class DecisionMoment in plugins/os-me/lib/**/*.rb
  2. Add MomentLog, following the PredictionLog append pattern — check: present class MomentLog in plugins/os-me/lib/**/*.rb
  3. Add ExtractCursor — check: present class ExtractCursor in plugins/os-me/lib/**/*.rb
  4. Add the Thor CLI os-me-extract, with a manual run and no hook — check: present OsMe in plugins/os-me/bin/os-me-extract

O-2 done 2026-10-23: the challenge narrowed it to the moment id scheme; /os-adr:create rejected that (all readers inside os-me). No ADR. Use the format in docs/decision-system/extraction.md; MomentLog rows carry schema_version 1 and read missing fields as nil, like PredictionLog#records. Orchestrator work: run os-me-extract over all train sessions. An agent checks a frozen sample of 50 points (train split) before any tuning. Gate: ConfidenceExtractor precision at least 90%, ReplyShape agreement at least 80%. Below that, run a tuning pass on those two objects (S10 method) before S3. Follow the AFK rules in docs/decision-system/build-plan.md: never wait for Jared, use the AFK default of each open item, and list each default used in the report.

Acceptance criteria

  1. Given a held-out session, when os-me-extract runs, then the moment goes to the eval file and not to the train log.
  2. Given a train session with a memo and a reply, when os-me-extract runs, then MomentLog gains one DecisionMoment in the format of docs/decision-system/extraction.md, with schema_version 1.
  3. Given a cursor from an earlier run, when os-me-extract runs again, then it skips sessions already read.
  4. Given the Store is absent, when os-me-extract runs, then it exits with an error that names the Store path.
  5. Given a moment at AI message index 7 of session abc, when os-me-extract writes it, then its id is abc:7.

Owner sketch

class OsMe::DecisionMoment; end
class OsMe::MomentLog
  def append(moment); end
end
class OsMe::ExtractCursor
  def unread(sessions); end
end

Scope and blocking

Blocked by: #1243
Fixtures: a held-out session that the CLI must route to the eval file. Reuse Provenance and the PredictionLog append pattern.

Non-goals: the SessionStart hook (S6); other moment kinds (S7).

Origin

  • Trigger: User asked for the decision-system build tickets this session
  • Improvised this session: none
  • Chain: no ticket for this stage ← the build plan names the stage and the user asked for the tickets. Stop at DESIGN (docs/decision-system/build-plan.md).
  • Root candidate: none found; searched MomentLog, DecisionMoment, extraction, os-me
  • Where: docs/decision-system/build-plan.md S2 group (c); plugins/os-me/bin/os-me-extract; plugins/os-me/lib/os_me/moment_log.rb
  • Session: 4f3f95ea-3c6f-4d23-a0ea-e349d6ab02a5
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/4f3f95ea-3c6f-4d23-a0ea-e349d6ab02a5.jsonl

VERDICT: CREATE (user-approved; backlog search only)

## Problem Detected moments must persist in the Store as a stored format that other code parses. Nothing writes `DecisionMoment` records today. A manual CLI is the tracer bullet that proves the whole chain on real train sessions. ## Approach Required work: 1. Add `DecisionMoment` — check: present `class DecisionMoment` in `plugins/os-me/lib/**/*.rb` 2. Add `MomentLog`, following the `PredictionLog` append pattern — check: present `class MomentLog` in `plugins/os-me/lib/**/*.rb` 3. Add `ExtractCursor` — check: present `class ExtractCursor` in `plugins/os-me/lib/**/*.rb` 4. Add the Thor CLI `os-me-extract`, with a manual run and no hook — check: present `OsMe` in `plugins/os-me/bin/os-me-extract` O-2 done 2026-10-23: the challenge narrowed it to the moment id scheme; `/os-adr:create` rejected that (all readers inside os-me). No ADR. Use the format in `docs/decision-system/extraction.md`; `MomentLog` rows carry `schema_version` 1 and read missing fields as nil, like `PredictionLog#records`. Orchestrator work: run `os-me-extract` over all train sessions. An agent checks a frozen sample of 50 points (train split) before any tuning. Gate: `ConfidenceExtractor` precision at least 90%, `ReplyShape` agreement at least 80%. Below that, run a tuning pass on those two objects (S10 method) before S3. Follow the AFK rules in `docs/decision-system/build-plan.md`: never wait for Jared, use the AFK default of each open item, and list each default used in the report. ## Acceptance criteria 1. Given a held-out session, when `os-me-extract` runs, then the moment goes to the eval file and not to the train log. 2. Given a train session with a memo and a reply, when `os-me-extract` runs, then `MomentLog` gains one `DecisionMoment` in the format of `docs/decision-system/extraction.md`, with `schema_version` 1. 3. Given a cursor from an earlier run, when `os-me-extract` runs again, then it skips sessions already read. 4. Given the Store is absent, when `os-me-extract` runs, then it exits with an error that names the Store path. 5. Given a moment at AI message index 7 of session `abc`, when `os-me-extract` writes it, then its `id` is `abc:7`. ## Owner sketch ```ruby class OsMe::DecisionMoment; end class OsMe::MomentLog def append(moment); end end class OsMe::ExtractCursor def unread(sessions); end end ``` ## Scope and blocking Blocked by: #1243 Fixtures: a held-out session that the CLI must route to the eval file. Reuse `Provenance` and the `PredictionLog` append pattern. Non-goals: the SessionStart hook (S6); other moment kinds (S7). ## Origin - Trigger: User asked for the decision-system build tickets this session - Improvised this session: none - Chain: no ticket for this stage ← the build plan names the stage and the user asked for the tickets. Stop at `DESIGN` (`docs/decision-system/build-plan.md`). - Root candidate: none found; searched MomentLog, DecisionMoment, extraction, os-me - Where: docs/decision-system/build-plan.md S2 group (c); plugins/os-me/bin/os-me-extract; plugins/os-me/lib/os_me/moment_log.rb - Session: 4f3f95ea-3c6f-4d23-a0ea-e349d6ab02a5 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/4f3f95ea-3c6f-4d23-a0ea-e349d6ab02a5.jsonl VERDICT: CREATE (user-approved; backlog search only)
Author
Owner

Work started on branch ticket-1244 (worktree, stacked on ticket-1243). O-2: challenge narrowed to the id scheme; /os-adr:create rejected it; no ADR. Body updated: schema_version 1 and id-pin criterion 5. Log: docs/decision-system/afk-adr-log.md.

Work started on branch ticket-1244 (worktree, stacked on ticket-1243). O-2: challenge narrowed to the id scheme; /os-adr:create rejected it; no ADR. Body updated: schema_version 1 and id-pin criterion 5. Log: docs/decision-system/afk-adr-log.md.
Author
Owner

Resolution

Done: S2 extraction tracer complete: MomentExtractor, DecisionMoment, MomentLog, structured ReplyShape, mtime ExtractCursor; ReplyShape criteria tuned and the labeler moved from Haiku to Sonnet.

Evidence: Gate on the frozen 50: ConfidenceExtractor precision 35/37 = 94.6% (>= 90%); ReplyShape agreement 83.3% with Sonnet + tuned criteria (>= 80%; Haiku tuned 73.3%, first run 66%). Tune 86.7%, holdout 82.7%. Commits dfaece2d (port), 96fa1442 (records), 9a931fef; suite 211 runs 0 failures. Harness: plugins/os-me/eval/reply_shape/.

Follow-ups: Rerun os-me-extract over all train sessions with the Sonnet labeler so moments.jsonl outcomes use the tuned criteria (orchestrator step, no ticket: the cursor skips unchanged sessions, so the rerun needs a fresh outcome pass; tracked in the S10 tuning stage #1252).

## Resolution **Done:** S2 extraction tracer complete: MomentExtractor, DecisionMoment, MomentLog, structured ReplyShape, mtime ExtractCursor; ReplyShape criteria tuned and the labeler moved from Haiku to Sonnet. **Evidence:** Gate on the frozen 50: ConfidenceExtractor precision 35/37 = 94.6% (>= 90%); ReplyShape agreement 83.3% with Sonnet + tuned criteria (>= 80%; Haiku tuned 73.3%, first run 66%). Tune 86.7%, holdout 82.7%. Commits dfaece2d (port), 96fa1442 (records), 9a931fef; suite 211 runs 0 failures. Harness: plugins/os-me/eval/reply_shape/. **Follow-ups:** Rerun os-me-extract over all train sessions with the Sonnet labeler so moments.jsonl outcomes use the tuned criteria (orchestrator step, no ticket: the cursor skips unchanged sessions, so the rerun needs a fresh outcome pass; tracked in the S10 tuning stage #1252).
jared closed this issue 2026-10-23 17:31:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#1244
No description provided.