Takedown: add the polish step to green-suite (ADR-0293, #1005 slice 2) #1009

Closed
opened 2026-10-15 16:05:20 +00:00 by jared · 3 comments
Owner

Problem

After #1005 (slice 1), a live takedown run that has green suites and new lint offenses fails at green-suite. ADR-0293 requires a polish step that repairs the form of the design before it becomes final. Without this step, no live design with offenses can become final, and the D2 tracer stays blocked.

This ticket is slice 2 of #1005. The split happened on 2026-10-15, because the blast-radius report showed that one run (about 12 lib files and 5 test files) is too large.

Reproduce

n/a: feature ticket; the step does not exist yet.

Approach

Required work: none beyond the acceptance criteria.

Behavior is fixed by ADR-0293. The design is open. Known parts from the blast-radius report: a new StepProfile entry for polish, harness/cards/polisher.md, harness/schemas/polish.json, a polish branch in StepList#build, and a loop in Flow around green-suite. OsSdlc::Lesson::Relay (lib/os_sdlc/presenter/lesson/relay.rb:4, takes library: and seen_keys:) supplies lessons; adapter/gate_red.rb:12 is the existing example of an eval-to-OsSdlc reference.

Pinning tests that change (under plugins/os-sdlc/eval/ticket-takedown/): test/model/harness_files_test.rb (line 16, the card set; line 156, the schema set), test/command/pipeline_test.rb (line 442 and line 258, the final-design.json key set). Write polish_rounds in live mode only, so that the eval-mode key set stays the same.

Also inject LintRun from the entry point (lens P2 challenge, implementation 45: code defect). Today model/suite_check.rb:5 has lint: LintRun.new as a default, and adapter/lint_run.rb:7 defaults runner: ProcessRunner.new, so production lint does not use env.runner. Follow SuiteRunner: build LintRun.new(runner: runner) in controller/run_cli.rb next to suites: (line 49), carry it through Collaborators, StepList and GreenSuiteStep to SuiteCheck.run, and remove both defaults. Update the green-suite StepList.new calls in test/command/green_suite_test.rb, test/command/final_suite_test.rb (line 197) and test/command/pipeline_test.rb.

Implementation route: /os-sdlc:implement <this ticket> poodr-ticket-implementation, not takedown-implement. The pipeline cannot polish its own fix (bootstrap).

Acceptance criteria

  1. Given a live run with passing suites and at least one offense under the target's lint_config that is not present at base, when green-suite runs, then the next step is polish, and green-suite runs again after it.
  2. Given polish runs, then its input is the offenses and the lint lesson from plugins/os-sdlc/lint-lessons/ (read through Lesson::Relay) when one exists for the cop. It never receives the ruling or the grade. It changes form only.
  3. Given polish returns files, when the guard runs, then the target suites pass and the design's failing tests are still red at base. If either check fails, the polish round does not count as a success.
  4. Given polish has run 5 rounds, or a round does not lower the offense count, when the limit is reached, then the run escalates and the design is not final.
  5. Given a polished final design, then the grade stays on the unpolished design (its own step record), final-design.json holds the polished files, source_step names the graded design, and a new polish_rounds field holds the polish count. place-design, the implement body and the takedown-implement map keep reading final-design.json.
  6. Given eval case mode, then polish does not run and the final-design.json key set is unchanged.

Owner sketch

class Takedown::PolishStep
  def call(run)
end

class Takedown::SuiteCheck
  def self.run(suites, repo, design, lint:)
end

class Takedown::RunState
  def final_record
end

Non-goals

  • The green-suite rename, the lint baseline, and the test-red return to revise: #1005.
  • Lint lessons for the 6 cops: the lint-lesson side-session (docs/handoffs/2026-10-15-lint-lesson-analysis.md).

Blocked by #1005. Blocks the D2 tracer.

Origin

  • Trigger: blast-radius report on #1005, 2026-10-15
  • Improvised this session: none
  • Chain: D2 tracer blocked ← a live design with lint offenses cannot become final ← no polish step ← DESIGN: ADR-0293 decisions 3 and 4
  • Root candidate: this ticket
  • Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/command/flow.rb; plugins/os-sdlc/eval/ticket-takedown/lib/takedown/command/step_list.rb; plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/step_profile.rb; plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/run_state.rb
  • Session: fb136c57-06cc-462d-a1bd-d42dc243e0d5
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-prism-architect/fb136c57-06cc-462d-a1bd-d42dc243e0d5.jsonl
## Problem After #1005 (slice 1), a live takedown run that has green suites and new lint offenses fails at `green-suite`. ADR-0293 requires a `polish` step that repairs the form of the design before it becomes final. Without this step, no live design with offenses can become final, and the D2 tracer stays blocked. This ticket is slice 2 of #1005. The split happened on 2026-10-15, because the blast-radius report showed that one run (about 12 lib files and 5 test files) is too large. ## Reproduce n/a: feature ticket; the step does not exist yet. ## Approach Required work: none beyond the acceptance criteria. Behavior is fixed by ADR-0293. The design is open. Known parts from the blast-radius report: a new `StepProfile` entry for `polish`, `harness/cards/polisher.md`, `harness/schemas/polish.json`, a `polish` branch in `StepList#build`, and a loop in `Flow` around `green-suite`. `OsSdlc::Lesson::Relay` (`lib/os_sdlc/presenter/lesson/relay.rb:4`, takes `library:` and `seen_keys:`) supplies lessons; `adapter/gate_red.rb:12` is the existing example of an eval-to-OsSdlc reference. Pinning tests that change (under `plugins/os-sdlc/eval/ticket-takedown/`): `test/model/harness_files_test.rb` (line 16, the card set; line 156, the schema set), `test/command/pipeline_test.rb` (line 442 and line 258, the `final-design.json` key set). Write `polish_rounds` in live mode only, so that the eval-mode key set stays the same. Also inject `LintRun` from the entry point (lens P2 challenge, implementation 45: code defect). Today `model/suite_check.rb:5` has `lint: LintRun.new` as a default, and `adapter/lint_run.rb:7` defaults `runner: ProcessRunner.new`, so production lint does not use `env.runner`. Follow `SuiteRunner`: build `LintRun.new(runner: runner)` in `controller/run_cli.rb` next to `suites:` (line 49), carry it through `Collaborators`, `StepList` and `GreenSuiteStep` to `SuiteCheck.run`, and remove both defaults. Update the green-suite `StepList.new` calls in `test/command/green_suite_test.rb`, `test/command/final_suite_test.rb` (line 197) and `test/command/pipeline_test.rb`. Implementation route: `/os-sdlc:implement <this ticket> poodr-ticket-implementation`, not `takedown-implement`. The pipeline cannot polish its own fix (bootstrap). ## Acceptance criteria 1. Given a live run with passing suites and at least one offense under the target's `lint_config` that is not present at base, when `green-suite` runs, then the next step is `polish`, and `green-suite` runs again after it. 2. Given `polish` runs, then its input is the offenses and the lint lesson from `plugins/os-sdlc/lint-lessons/` (read through `Lesson::Relay`) when one exists for the cop. It never receives the ruling or the grade. It changes form only. 3. Given `polish` returns files, when the guard runs, then the target suites pass and the design's failing tests are still red at base. If either check fails, the polish round does not count as a success. 4. Given polish has run 5 rounds, or a round does not lower the offense count, when the limit is reached, then the run escalates and the design is not final. 5. Given a polished final design, then the grade stays on the unpolished design (its own step record), `final-design.json` holds the polished files, `source_step` names the graded design, and a new `polish_rounds` field holds the polish count. `place-design`, the implement body and the `takedown-implement` map keep reading `final-design.json`. 6. Given eval case mode, then `polish` does not run and the `final-design.json` key set is unchanged. ## Owner sketch ```ruby class Takedown::PolishStep def call(run) end class Takedown::SuiteCheck def self.run(suites, repo, design, lint:) end class Takedown::RunState def final_record end ``` ## Non-goals - The `green-suite` rename, the lint baseline, and the test-red return to `revise`: #1005. - Lint lessons for the 6 cops: the lint-lesson side-session (`docs/handoffs/2026-10-15-lint-lesson-analysis.md`). Blocked by #1005. Blocks the D2 tracer. ## Origin - Trigger: blast-radius report on #1005, 2026-10-15 - Improvised this session: none - Chain: D2 tracer blocked ← a live design with lint offenses cannot become final ← no `polish` step ← `DESIGN`: ADR-0293 decisions 3 and 4 - Root candidate: this ticket - Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/command/flow.rb; plugins/os-sdlc/eval/ticket-takedown/lib/takedown/command/step_list.rb; plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/step_profile.rb; plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/run_state.rb - Session: fb136c57-06cc-462d-a1bd-d42dc243e0d5 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-prism-architect/fb136c57-06cc-462d-a1bd-d42dc243e0d5.jsonl
Author
Owner

Work started 2026-10-15 (session fb136c57) on branch prism-architect. Route: /os-sdlc:implement 1009 poodr-ticket-implementation. #1005 (slice 1) closed and merged.

Work started 2026-10-15 (session fb136c57) on branch prism-architect. Route: /os-sdlc:implement 1009 poodr-ticket-implementation. #1005 (slice 1) closed and merged.
Author
Owner

Skeptic DROP (lens follow-up): depth-1 rule; no observed failure yet. Lens challenge found two code defects (signals b89d0233 A12, edda0d5d P2): (1) presenter/prompts.rb:5 builds LintLessons.for as a default; test/command/polish_test.rb:154 asserts real lesson text, so a lesson edit breaks the test. (2) command/flow.rb:29 suite_tests_green? copies SuiteCheck#tests_green?; fix is a tests_green key in SuiteCheck#to_h. File a ticket if the polish test breaks on a lesson edit.

Skeptic DROP (lens follow-up): depth-1 rule; no observed failure yet. Lens challenge found two code defects (signals b89d0233 A12, edda0d5d P2): (1) presenter/prompts.rb:5 builds LintLessons.for as a default; test/command/polish_test.rb:154 asserts real lesson text, so a lesson edit breaks the test. (2) command/flow.rb:29 suite_tests_green? copies SuiteCheck#tests_green?; fix is a tests_green key in SuiteCheck#to_h. File a ticket if the polish test breaks on a lesson edit.
Author
Owner

Resolution

Done: ADR-0293 polish loop built via poodr-ticket-implementation (implementation 46, 20 dispatches, 26 min): lint-red green-suite goes to a polish model step (offenses + lessons via OsSdlc Lesson::Relay, no ruling or grade); guard after polish (suites pass, failing tests red at base); limit 5 rounds or stall, then escalate; grade stays on the unpolished design; final-design.json holds polished files and polish_rounds (live only); LintRun injected from run_cli.rb (P2 fix from #1005).

Evidence: Commit eb77efcf on prism-architect (runner commit; suite-check green; behavior-verifier pass on round 3; contract-auditor pass). Records d439af13 (README polish row, os-sdlc leaf History row). Lens signals b89d0233 (A12), edda0d5d (P2) on main.

Follow-ups: Lens A12 and P2 code defects: skeptic DROP, recorded in the comment above. No other follow-ups.

## Resolution **Done:** ADR-0293 polish loop built via poodr-ticket-implementation (implementation 46, 20 dispatches, 26 min): lint-red green-suite goes to a polish model step (offenses + lessons via OsSdlc Lesson::Relay, no ruling or grade); guard after polish (suites pass, failing tests red at base); limit 5 rounds or stall, then escalate; grade stays on the unpolished design; final-design.json holds polished files and polish_rounds (live only); LintRun injected from run_cli.rb (P2 fix from #1005). **Evidence:** Commit eb77efcf on prism-architect (runner commit; suite-check green; behavior-verifier pass on round 3; contract-auditor pass). Records d439af13 (README polish row, os-sdlc leaf History row). Lens signals b89d0233 (A12), edda0d5d (P2) on main. **Follow-ups:** Lens A12 and P2 code defects: skeptic DROP, recorded in the comment above. No other follow-ups.
jared closed this issue 2026-10-15 16:49:37 +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#1009
No description provided.