crc-shares rows-merge: apply the wave 5 row-fill file to the ledger #1159

Closed
opened 2026-10-19 18:18:28 +00:00 by jared · 3 comments
Owner

Problem

In crc-refactor phase 5, one opus agent writes wave5-rows-<ticket>.tsv after each wave 5 ticket. No script applies that file to the ledger. SKILL.md phase 5 step 3 tells the orchestrator to write a short script for each run. In run 2 the orchestrator wrote scratch fill_rows.py and kept it in its context. The token-cost choice in docs/crc/PLAN.md Phase 8 (lever a, item 1) replaces that step with a committed script.

Reproduce

n/a: new merge subcommand; nothing to reproduce.

Approach

Add the subcommand rows-merge to bin/crc-shares: crc-shares --target NAME --ticket N rows-merge RUN_DIR. It reads RUN_DIR/wave5-rows-N.tsv, checks every line, and applies the lines to RUN_DIR/ledger.tsv by path. Reuse Crc::Shares::Table, VerdictRules, IdList, Jobs::CellMerge, Crc::Ledger, Crc::Emitter, and Crc::Result.

File header (exact): path job concept job_category role verdict new_path new_constant new_test_path wave ruling evidence_add question (tab-separated).

Apply, per line: job, concept, job_category, role, verdict, new_path, new_constant, new_test_path, wave, and question replace the row's cells. Each ruling ID is added to the row's ruling list once (IdList#with). evidence_add is appended to evidence once (CellMerge#with). A second run with the same file changes no byte.

Refuse (exit 1, ledger unchanged, each problem in the JSON problems list): no such file; header differs; a line with the wrong field count; a path that is not a ledger row; a duplicate path; a job that does not start with This object owns; an empty concept, job_category, or role; an empty ruling; a ruling ID that no ledger row cites yet; any VerdictRules.wave_2 problem of the merged row. --ticket is required for rows-merge and refused for the other subcommands. Exit 2 with usage when it is missing.

Required work:

  1. Add the rows-merge subcommand — check: present rows-merge in plugins/os-sdlc/lib/os_sdlc/crc/shares.rb
  2. Add the merge class — check: present class RowMerge in plugins/os-sdlc/lib/os_sdlc/crc/shares/row_merge.rb
  3. Name the subcommand and --ticket in the crc-shares usage text — check: present --ticket N in plugins/os-sdlc/lib/os_sdlc/boot/inputs/usage_text.rb

Orchestrator work: SKILL.md phase 5 step 3 calls crc-shares rows-merge in place of the scratch script.

Rejected: a separate bin/crc-rows — crc-shares already owns the agent-TSV-to-ledger merges and their checks.

Acceptance criteria

  1. Given a ledger with a created-file row and a valid wave5-rows-7.tsv line for it, when crc-shares --target T --ticket 7 rows-merge RUN_DIR runs, then it exits 0, the row has the line's job, concept, job_category, role, verdict, and new cells, the ruling ID is in ruling, and evidence ends with the evidence_add text.
  2. Given the same file, when the command runs a second time, then the ledger bytes do not change.
  3. Given a line whose path is not in the ledger, when the command runs, then it exits 1, problems names the path, and the ledger bytes do not change.
  4. Given a line whose job does not start with This object owns, or whose ruling ID no ledger row cites, when the command runs, then it exits 1 with that problem and the ledger is unchanged.
  5. Given a line with verdict rename and an empty new_constant, when the command runs, then it exits 1 with rename without new_constant and the ledger is unchanged.
  6. Given rows-merge without --ticket, when the command runs, then it exits 2 and prints the usage.

Owner sketch

module OsSdlc::Crc::Shares
  class RowMerge
    def initialize(run_path, ticket)
    def call # => Crc::Result
  end
end

Origin

  • Trigger: docs/crc/PLAN.md Phase 8 token-cost choice, lever a item 1; round C2 crc-token-levers (docs/crc/os-sdlc/run-3-prep-rounds.md).
  • Improvised this session: none
  • Chain: run 2 main loop wrote and read scratch fill_rows.py ← no committed row-fill merge ← DESIGN (plugins/os-sdlc/skills/crc-refactor/SKILL.md phase 5 step 3)
  • Root candidate: none found; searched crc-shares, rows-merge, row-fill, wave5-rows, fill_rows, wave 5, crc-ledger
  • Where: plugins/os-sdlc/lib/os_sdlc/crc/shares/
  • Session: 73498add-5935-49ad-85e0-fcfcc55f2dad
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/73498add-5935-49ad-85e0-fcfcc55f2dad.jsonl

VERDICT: CREATE

## Problem In crc-refactor phase 5, one opus agent writes `wave5-rows-<ticket>.tsv` after each wave 5 ticket. No script applies that file to the ledger. SKILL.md phase 5 step 3 tells the orchestrator to write a short script for each run. In run 2 the orchestrator wrote scratch `fill_rows.py` and kept it in its context. The token-cost choice in `docs/crc/PLAN.md` Phase 8 (lever a, item 1) replaces that step with a committed script. ## Reproduce n/a: new merge subcommand; nothing to reproduce. ## Approach Add the subcommand `rows-merge` to `bin/crc-shares`: `crc-shares --target NAME --ticket N rows-merge RUN_DIR`. It reads `RUN_DIR/wave5-rows-N.tsv`, checks every line, and applies the lines to `RUN_DIR/ledger.tsv` by `path`. Reuse `Crc::Shares::Table`, `VerdictRules`, `IdList`, `Jobs::CellMerge`, `Crc::Ledger`, `Crc::Emitter`, and `Crc::Result`. File header (exact): `path job concept job_category role verdict new_path new_constant new_test_path wave ruling evidence_add question` (tab-separated). Apply, per line: `job`, `concept`, `job_category`, `role`, `verdict`, `new_path`, `new_constant`, `new_test_path`, `wave`, and `question` replace the row's cells. Each `ruling` ID is added to the row's `ruling` list once (`IdList#with`). `evidence_add` is appended to `evidence` once (`CellMerge#with`). A second run with the same file changes no byte. Refuse (exit 1, ledger unchanged, each problem in the JSON `problems` list): no such file; header differs; a line with the wrong field count; a path that is not a ledger row; a duplicate path; a `job` that does not start with `This object owns`; an empty `concept`, `job_category`, or `role`; an empty `ruling`; a ruling ID that no ledger row cites yet; any `VerdictRules.wave_2` problem of the merged row. `--ticket` is required for `rows-merge` and refused for the other subcommands. Exit 2 with usage when it is missing. Required work: 1. Add the `rows-merge` subcommand — check: present `rows-merge` in `plugins/os-sdlc/lib/os_sdlc/crc/shares.rb` 2. Add the merge class — check: present `class RowMerge` in `plugins/os-sdlc/lib/os_sdlc/crc/shares/row_merge.rb` 3. Name the subcommand and `--ticket` in the crc-shares usage text — check: present `--ticket N` in `plugins/os-sdlc/lib/os_sdlc/boot/inputs/usage_text.rb` Orchestrator work: SKILL.md phase 5 step 3 calls `crc-shares rows-merge` in place of the scratch script. Rejected: a separate `bin/crc-rows` — crc-shares already owns the agent-TSV-to-ledger merges and their checks. ## Acceptance criteria 1. Given a ledger with a created-file row and a valid `wave5-rows-7.tsv` line for it, when `crc-shares --target T --ticket 7 rows-merge RUN_DIR` runs, then it exits 0, the row has the line's job, concept, job_category, role, verdict, and new cells, the ruling ID is in `ruling`, and `evidence` ends with the `evidence_add` text. 2. Given the same file, when the command runs a second time, then the ledger bytes do not change. 3. Given a line whose path is not in the ledger, when the command runs, then it exits 1, `problems` names the path, and the ledger bytes do not change. 4. Given a line whose job does not start with `This object owns`, or whose ruling ID no ledger row cites, when the command runs, then it exits 1 with that problem and the ledger is unchanged. 5. Given a line with verdict `rename` and an empty `new_constant`, when the command runs, then it exits 1 with `rename without new_constant` and the ledger is unchanged. 6. Given `rows-merge` without `--ticket`, when the command runs, then it exits 2 and prints the usage. ## Owner sketch ```ruby module OsSdlc::Crc::Shares class RowMerge def initialize(run_path, ticket) def call # => Crc::Result end end ``` ## Origin - Trigger: `docs/crc/PLAN.md` Phase 8 token-cost choice, lever a item 1; round C2 `crc-token-levers` (`docs/crc/os-sdlc/run-3-prep-rounds.md`). - Improvised this session: none - Chain: run 2 main loop wrote and read scratch `fill_rows.py` ← no committed row-fill merge ← DESIGN (`plugins/os-sdlc/skills/crc-refactor/SKILL.md` phase 5 step 3) - Root candidate: none found; searched crc-shares, rows-merge, row-fill, wave5-rows, fill_rows, wave 5, crc-ledger - Where: plugins/os-sdlc/lib/os_sdlc/crc/shares/ - Session: 73498add-5935-49ad-85e0-fcfcc55f2dad - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/73498add-5935-49ad-85e0-fcfcc55f2dad.jsonl VERDICT: CREATE
Author
Owner

Work started on branch crc-token-levers (round C2 crc-token-levers).

Work started on branch crc-token-levers (round C2 crc-token-levers).
Author
Owner

Pipeline run 78 failed at test-reviewer (dispatch 734, verdict:error): the brief fact test_changes was null. Cause: the orchestrator is a subagent that cannot enter the worktree, so every pipeline agent starts in the main checkout, and the Runner computed the brief against the main checkout. The test-writer tests (red) are kept; one test defect fixed (default line cited R1, which no ledger row cited). The ticket continues by TDD by hand in worktree crc-token-levers.

Pipeline run 78 failed at test-reviewer (dispatch 734, verdict:error): the brief fact test_changes was null. Cause: the orchestrator is a subagent that cannot enter the worktree, so every pipeline agent starts in the main checkout, and the Runner computed the brief against the main checkout. The test-writer tests (red) are kept; one test defect fixed (default line cited R1, which no ledger row cited). The ticket continues by TDD by hand in worktree crc-token-levers.
Author
Owner

Resolution

Done: crc-shares --target NAME --ticket N rows-merge RUN_DIR applies wave5-rows-.tsv to the ledger; SKILL.md phase 5 step 3 calls it.

Evidence: 7d314216, 090ffc4e (audit fixes), b451e367 (skill). Suite 2248 runs, 5053 assertions, 0 failures, 43.3 s; rubocop no offenses on changed files; branch crc-token-levers (merged to main by worktree finish).

Follow-ups: none

## Resolution **Done:** crc-shares --target NAME --ticket N rows-merge RUN_DIR applies wave5-rows-<ticket>.tsv to the ledger; SKILL.md phase 5 step 3 calls it. **Evidence:** 7d314216, 090ffc4e (audit fixes), b451e367 (skill). Suite 2248 runs, 5053 assertions, 0 failures, 43.3 s; rubocop no offenses on changed files; branch crc-token-levers (merged to main by worktree finish). **Follow-ups:** none
jared closed this issue 2026-10-19 18:53:56 +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#1159
No description provided.