decision-system S2b: pairs, detectors, grouper, reply shape #1243

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

Problem

The spike found three defects in draft extraction: percents that are not a confidence, quoted pastes, and one memo counted several times. Regex could not read replies (308 of 359 unclear). The pipeline needs tested objects that fix these, with ReplyShape backed by the model.

Approach

Required work:

  1. Add ExchangeFinder#pairs that returns Pair objects with AI text and timestamps — check: present class Pair in plugins/os-me/lib/**/*.rb
  2. Add MemoDetector — check: present class MemoDetector in plugins/os-me/lib/**/*.rb
  3. Add ConfidenceExtractor, anchored to "confidence/confident" and the recommendation line — check: present class ConfidenceExtractor in plugins/os-me/lib/**/*.rb
  4. Add RecommendationGrouper that counts one memo once and drops quoted pastes — check: present class RecommendationGrouper in plugins/os-me/lib/**/*.rb
  5. Add ReplyShape (model-backed through the DecisionModel port) and Latency — check: present class ReplyShape in plugins/os-me/lib/**/*.rb

Notes: Reuse TranscriptCatalog, TranscriptReader, Entry#typed_reply, Entry#main_thread?, and Split. Draft only objects of this stage. 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 fixture transcript with a memo that states a confidence and a reply that accepts, when the objects run, then one pair gives that confidence and the shape accept.
  2. Given a memo whose first percent is an alternative option, when ConfidenceExtractor runs, then it returns the confidence of the recommendation line.
  3. Given a reply that quotes a paste, when RecommendationGrouper runs, then it drops the quoted text.
  4. Given a memo with two follow-up turns, when RecommendationGrouper runs, then it counts the memo once.
  5. Given a fake DecisionModel adapter, when ReplyShape runs, then it returns the shape the adapter gave.

Owner sketch

class OsMe::ExchangeFinder
  def pairs(session); end
end
class OsMe::Pair; end
class OsMe::MemoDetector; end
class OsMe::ConfidenceExtractor; end
class OsMe::RecommendationGrouper; end
class OsMe::ReplyShape
  def initialize(client:); end
end
class OsMe::Latency; end

Scope and blocking

Blocked by: #1242
Object shapes are in docs/decision-system/extraction.md. Fixtures must not contain real transcript text. The spike points.json holds transcript text: never commit it.

Non-goals: the moment record, log, cursor, and CLI (S2c).

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 ConfidenceExtractor, extraction, detector, os-me
  • Where: docs/decision-system/build-plan.md S2 group (b); plugins/os-me/lib/os_me/exchange_finder.rb and new detector files
  • 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 The spike found three defects in draft extraction: percents that are not a confidence, quoted pastes, and one memo counted several times. Regex could not read replies (308 of 359 unclear). The pipeline needs tested objects that fix these, with `ReplyShape` backed by the model. ## Approach Required work: 1. Add `ExchangeFinder#pairs` that returns `Pair` objects with AI text and timestamps — check: present `class Pair` in `plugins/os-me/lib/**/*.rb` 2. Add `MemoDetector` — check: present `class MemoDetector` in `plugins/os-me/lib/**/*.rb` 3. Add `ConfidenceExtractor`, anchored to "confidence/confident" and the recommendation line — check: present `class ConfidenceExtractor` in `plugins/os-me/lib/**/*.rb` 4. Add `RecommendationGrouper` that counts one memo once and drops quoted pastes — check: present `class RecommendationGrouper` in `plugins/os-me/lib/**/*.rb` 5. Add `ReplyShape` (model-backed through the `DecisionModel` port) and `Latency` — check: present `class ReplyShape` in `plugins/os-me/lib/**/*.rb` Notes: Reuse `TranscriptCatalog`, `TranscriptReader`, `Entry#typed_reply`, `Entry#main_thread?`, and `Split`. Draft only objects of this stage. 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 fixture transcript with a memo that states a confidence and a reply that accepts, when the objects run, then one pair gives that confidence and the shape accept. 2. Given a memo whose first percent is an alternative option, when `ConfidenceExtractor` runs, then it returns the confidence of the recommendation line. 3. Given a reply that quotes a paste, when `RecommendationGrouper` runs, then it drops the quoted text. 4. Given a memo with two follow-up turns, when `RecommendationGrouper` runs, then it counts the memo once. 5. Given a fake `DecisionModel` adapter, when `ReplyShape` runs, then it returns the shape the adapter gave. ## Owner sketch ```ruby class OsMe::ExchangeFinder def pairs(session); end end class OsMe::Pair; end class OsMe::MemoDetector; end class OsMe::ConfidenceExtractor; end class OsMe::RecommendationGrouper; end class OsMe::ReplyShape def initialize(client:); end end class OsMe::Latency; end ``` ## Scope and blocking Blocked by: #1242 Object shapes are in `docs/decision-system/extraction.md`. Fixtures must not contain real transcript text. The spike `points.json` holds transcript text: never commit it. Non-goals: the moment record, log, cursor, and CLI (S2c). ## 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 ConfidenceExtractor, extraction, detector, os-me - Where: docs/decision-system/build-plan.md S2 group (b); plugins/os-me/lib/os_me/exchange_finder.rb and new detector files - 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-1243 (worktree, stacked on ticket-1242 because main checkout is dirty), AFK decision-system build, session 4f3f95ea.

Work started on branch ticket-1243 (worktree, stacked on ticket-1242 because main checkout is dirty), AFK decision-system build, session 4f3f95ea.
Author
Owner

Resolution

Done: Draft extraction objects: Pair, Entry, ExchangeFinder, Latency, MemoDetector, ConfidenceExtractor (+Stated), RecommendationGrouper, ReplyShape; implementation 117, all gates green after one extra red round and one refactor.

Evidence: Commit 84a99640 on branch ticket-1243 (stacked on ticket-1242): 10 files, plugins/os-me/test/draft_extraction_test.rb; suite + required-work + contract audit pass.

Follow-ups: none (LENS P5 line was JUSTIFIED: no and fixed in-run by moving Stated to confidence_extractor/stated.rb)

## Resolution **Done:** Draft extraction objects: Pair, Entry, ExchangeFinder, Latency, MemoDetector, ConfidenceExtractor (+Stated), RecommendationGrouper, ReplyShape; implementation 117, all gates green after one extra red round and one refactor. **Evidence:** Commit 84a99640 on branch ticket-1243 (stacked on ticket-1242): 10 files, plugins/os-me/test/draft_extraction_test.rb; suite + required-work + contract audit pass. **Follow-ups:** none (LENS P5 line was JUSTIFIED: no and fixed in-run by moving Stated to confidence_extractor/stated.rb)
jared closed this issue 2026-10-23 15:43:39 +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#1243
No description provided.