os-me: backfill the 131 review-log rows into predictions.jsonl once #1079

Closed
opened 2026-10-17 11:54:38 +00:00 by jared · 2 comments
Owner

Problem

History before the record log would vanish from bin/os-me-report. The Store holds 131 review-log rows that carry the only record of earlier predictions.

Reproduce

n/a: feature work. Jared chose to keep this step on 2026-10-17.

Approach

Rules decided 2026-10-17 by the orchestrator after escalation 29, from the real ~/dev/os-me-store/learning/review-log.md. Only the table under ## Log is read. Its columns are Date | Run | Finding | Change.

  • Session: the first 8-character lowercase hex token in the Run column (for example live predict e8bce22a @12:59 gives e8bce22a). A row with no such token produces no record.
  • Verdict: the Finding column starts with a verdict word, case-insensitive, followed by :, ,, ., space, or end. Hit gives hit, Partial gives partial, Miss gives miss, and Unscored or Not scored gives unscored (stored as verdict null).
  • Multi-verdict: a Finding that starts with count phrases such as 2 hits, 1 miss or 3 match (...), 1 partial (...), 3 miss splits into one record per counted prediction. match/matches/hit/hits give hit; partial/partials give partial; miss/misses give miss.
  • Any other Finding start (Held, Dropped, Not processed, No score, Verdicts, Decision, Transcript, a hex id) produces no record.
  • Id: synthetic letters A, B, C ... per session, in file order across all rows of that session.
  • Triggers: every T<n>, A<n>, R<n>, C<n> token in the Finding and Change columns, unique, in order of first appearance.
  • Text: the Finding column text. Confidence, depth, origin, autopilot: null. backfilled: true. scored_at: the row Date.
  • PredictionLog#append skips a record whose id and session_id already exist in the log. This makes the backfill idempotent and also stops a second append TRANSCRIPT from writing duplicates (takedown grade X1, run 1079-20261017-094730).
  • A review log with no table under ## Log makes the backfill raise with a message that names the file; the CLI exits non-zero.
  • bin/os-me-backfill [--review-log PATH] [--log PATH] prints one line: records appended, records already present, and rows without a record.

Required work:

  1. Add class OsMe::ReviewLogBackfill with the rules above — check: present class ReviewLogBackfill in plugins/os-me/lib/os_me/review_log_backfill.rb
  2. Add backfilled to PredictionLog::FIELDS — check: present backfilled in plugins/os-me/lib/os_me/prediction_log.rb
  3. Add the CLI bin/os-me-backfill — check: present backfill in plugins/os-me/bin/os-me-backfill
  4. Make PredictionLog#append skip a record whose id and session_id already exist in the log (proved by acceptance criteria 2 and 7)

Orchestrator work: run bin/os-me-backfill once against the Store, commit learning/predictions.jsonl in ~/dev/os-me-store, and record the commit hash in this ticket.

Acceptance criteria

  1. Given a review log with five rows, one of them 2 hits, 1 miss, when the backfill runs, then the log holds seven records.
  2. Given a log that the backfill already filled, when the backfill runs again, then it appends nothing.
  3. Given a row whose Run column is live predict e8bce22a @12:59 and whose Finding starts with Hit:, when the backfill runs, then the record has session e8bce22a, verdict hit, backfilled true, and confidence, depth and origin null.
  4. Given a row whose Finding starts with Held or Dropped, or a row with no hex session in its Run column, when the backfill runs, then it writes no record for that row.
  5. Given two rows of the same session, when the backfill runs, then their records have ids A and B.
  6. Given a Finding or Change that names T16 and C29, when the backfill runs, then the record's triggers are T16 and C29.
  7. Given a log that already holds a record with id A for session s1, when append receives a record with id A for session s1, then the log does not change.
  8. Given a Store review log, when bin/os-me-backfill runs, then stdout reports the appended count, the already-present count, and the count of rows without a record.
  9. Given a review log with no table under ## Log, when bin/os-me-backfill runs, then it exits non-zero and names the file.

Owner sketch

module OsMe
  class ReviewLogBackfill
    def initialize(review_log:, log:); end
    def run; end
  end
end

Non-goals

  • Inventing confidence, depth, or origin for old rows.

Blocked by #1074

Origin

  • Trigger: Jared asked for this ticket on 2026-10-17 while designing os-me prediction records.
  • Improvised this session: none
  • Chain: old history missing from the report ← old rows live only in review-log.md prose. DESIGN (plugins/os-me/lib/os_me/review_log_backfill.rb)
  • Root candidate: this ticket
  • Where: plugins/os-me/lib/os_me/review_log_backfill.rb
  • Session: 2fc707d3-1acb-4f67-98d1-3685e5283f89
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/2fc707d3-1acb-4f67-98d1-3685e5283f89.jsonl
## Problem History before the record log would vanish from bin/os-me-report. The Store holds 131 review-log rows that carry the only record of earlier predictions. ## Reproduce n/a: feature work. Jared chose to keep this step on 2026-10-17. ## Approach Rules decided 2026-10-17 by the orchestrator after escalation 29, from the real `~/dev/os-me-store/learning/review-log.md`. Only the table under `## Log` is read. Its columns are Date | Run | Finding | Change. - Session: the first 8-character lowercase hex token in the Run column (for example `live predict e8bce22a @12:59` gives `e8bce22a`). A row with no such token produces no record. - Verdict: the Finding column starts with a verdict word, case-insensitive, followed by `:`, `,`, `.`, space, or end. `Hit` gives `hit`, `Partial` gives `partial`, `Miss` gives `miss`, and `Unscored` or `Not scored` gives `unscored` (stored as verdict null). - Multi-verdict: a Finding that starts with count phrases such as `2 hits, 1 miss` or `3 match (...), 1 partial (...), 3 miss` splits into one record per counted prediction. `match`/`matches`/`hit`/`hits` give `hit`; `partial`/`partials` give `partial`; `miss`/`misses` give `miss`. - Any other Finding start (`Held`, `Dropped`, `Not processed`, `No score`, `Verdicts`, `Decision`, `Transcript`, a hex id) produces no record. - Id: synthetic letters `A`, `B`, `C` ... per session, in file order across all rows of that session. - Triggers: every `T<n>`, `A<n>`, `R<n>`, `C<n>` token in the Finding and Change columns, unique, in order of first appearance. - Text: the Finding column text. Confidence, depth, origin, autopilot: null. `backfilled`: true. `scored_at`: the row Date. - `PredictionLog#append` skips a record whose `id` and `session_id` already exist in the log. This makes the backfill idempotent and also stops a second `append TRANSCRIPT` from writing duplicates (takedown grade X1, run 1079-20261017-094730). - A review log with no table under `## Log` makes the backfill raise with a message that names the file; the CLI exits non-zero. - `bin/os-me-backfill [--review-log PATH] [--log PATH]` prints one line: records appended, records already present, and rows without a record. Required work: 1. Add class `OsMe::ReviewLogBackfill` with the rules above — check: present `class ReviewLogBackfill` in `plugins/os-me/lib/os_me/review_log_backfill.rb` 2. Add `backfilled` to `PredictionLog::FIELDS` — check: present `backfilled` in `plugins/os-me/lib/os_me/prediction_log.rb` 3. Add the CLI `bin/os-me-backfill` — check: present `backfill` in `plugins/os-me/bin/os-me-backfill` 4. Make `PredictionLog#append` skip a record whose `id` and `session_id` already exist in the log (proved by acceptance criteria 2 and 7) Orchestrator work: run `bin/os-me-backfill` once against the Store, commit `learning/predictions.jsonl` in `~/dev/os-me-store`, and record the commit hash in this ticket. ## Acceptance criteria 1. Given a review log with five rows, one of them `2 hits, 1 miss`, when the backfill runs, then the log holds seven records. 2. Given a log that the backfill already filled, when the backfill runs again, then it appends nothing. 3. Given a row whose Run column is `live predict e8bce22a @12:59` and whose Finding starts with `Hit:`, when the backfill runs, then the record has session `e8bce22a`, verdict `hit`, backfilled true, and confidence, depth and origin null. 4. Given a row whose Finding starts with `Held` or `Dropped`, or a row with no hex session in its Run column, when the backfill runs, then it writes no record for that row. 5. Given two rows of the same session, when the backfill runs, then their records have ids `A` and `B`. 6. Given a Finding or Change that names `T16` and `C29`, when the backfill runs, then the record's triggers are `T16` and `C29`. 7. Given a log that already holds a record with id `A` for session `s1`, when `append` receives a record with id `A` for session `s1`, then the log does not change. 8. Given a Store review log, when `bin/os-me-backfill` runs, then stdout reports the appended count, the already-present count, and the count of rows without a record. 9. Given a review log with no table under `## Log`, when `bin/os-me-backfill` runs, then it exits non-zero and names the file. ## Owner sketch ```ruby module OsMe class ReviewLogBackfill def initialize(review_log:, log:); end def run; end end end ``` ## Non-goals - Inventing confidence, depth, or origin for old rows. Blocked by #1074 ## Origin - Trigger: Jared asked for this ticket on 2026-10-17 while designing os-me prediction records. - Improvised this session: none - Chain: old history missing from the report ← old rows live only in review-log.md prose. DESIGN (plugins/os-me/lib/os_me/review_log_backfill.rb) - Root candidate: this ticket - Where: plugins/os-me/lib/os_me/review_log_backfill.rb - Session: 2fc707d3-1acb-4f67-98d1-3685e5283f89 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/2fc707d3-1acb-4f67-98d1-3685e5283f89.jsonl
Author
Owner

Work started on branch ticket-1079 (os-sdlc poodr-ticket-implementation). Takedown run 1079-20261017-094730 failed at green-suite (a lint offense in a failing test that polish cannot fix), so the ticket's own Approach drives the build.

Work started on branch ticket-1079 (os-sdlc poodr-ticket-implementation). Takedown run 1079-20261017-094730 failed at green-suite (a lint offense in a failing test that polish cannot fix), so the ticket's own Approach drives the build.
Author
Owner

Resolution

Done: OsMe::ReviewLogBackfill and bin/os-me-backfill parse the review-log Log table into prediction records (session from the Run hex id, verdict from the Finding start, multi-verdict splits, synthetic letters per session, T/A/R/C triggers, backfilled true). PredictionLog#append skips an existing id+session, which also removes takedown grade X1 (duplicate records on a second append). Backfill run once: 111 records appended, 20 rows without a record; Store commit f9ee1d8 (os-me-store, prediction-log.jsonl).

Evidence: Implementation 57 (poodr-ticket-implementation, 20 dispatches, 2 orchestrator reroutes after ticket-defect escalations 29 and 30, 4 retries): 9/9 criteria verified, suite and contract audit pass. Dry run on a copy: second run appends 0; no-table log exits 1 naming the file; os-me-report renders all four tables. LENS A10 and A12 challenged: heuristic holds; signals committed.

Follow-ups: none

## Resolution **Done:** OsMe::ReviewLogBackfill and bin/os-me-backfill parse the review-log Log table into prediction records (session from the Run hex id, verdict from the Finding start, multi-verdict splits, synthetic letters per session, T/A/R/C triggers, backfilled true). PredictionLog#append skips an existing id+session, which also removes takedown grade X1 (duplicate records on a second append). Backfill run once: 111 records appended, 20 rows without a record; Store commit f9ee1d8 (os-me-store, prediction-log.jsonl). **Evidence:** Implementation 57 (poodr-ticket-implementation, 20 dispatches, 2 orchestrator reroutes after ticket-defect escalations 29 and 30, 4 retries): 9/9 criteria verified, suite and contract audit pass. Dry run on a copy: second run appends 0; no-table log exits 1 naming the file; os-me-report renders all four tables. LENS A10 and A12 challenged: heuristic holds; signals committed. **Follow-ups:** none
jared closed this issue 2026-10-17 14:12:31 +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#1079
No description provided.