Audit takedown eval for duplicates of os-sdlc lib, move onto owners #1011

Open
opened 2026-10-15 17:00:50 +00:00 by jared · 4 comments
Owner

Problem

The takedown eval (plugins/os-sdlc/eval/ticket-takedown) re-implements behavior that plugins/os-sdlc/lib/os_sdlc already owns. The eval will merge into the os-sdlc lib later. Each duplicate adds code and tests that the merge must remove.

Jared's ruling, 2026-10-15: "The eval project should reuse as much of the os-sdlc code as possible. It will be integrated into os-sdlc's lib once we have the kinks ironed-out anyway. So if the code it needs already exists, use it! The eval code should really only be the difference between the existing os-sdlc code and the customizations needed for the eval portion. So, it should be using the entire Project class - not necessarily just Project::Target and Project::Config. That should reduce the number of tests needed and new code required when we merge in the future."

An ADR records this rule. It is created in the same session as this ticket. See the ADR on takedown eval reuse of os-sdlc lib.

Observed

Verified on HEAD:

  1. eval/ticket-takedown/lib/takedown/adapter/project_suites.rb defines PATH = File.join(".sdlc", "project.yaml"), reads it with YAML.safe_load_file, and reads raw section hashes. It wraps a single OsSdlc::Project::Target through from_section. Owners: OsSdlc::Project.from_data (lib/os_sdlc/model/project.rb) and OsSdlc::Project::Config (lib/os_sdlc/adapter/project/config.rb, which owns path, read, document).
  2. The literal File.join(@repo, ".sdlc", "project.yaml") repeats in eval tests: test/command/green_suite_test.rb:20, test/command/polish_test.rb:91, test/command/final_suite_test.rb:101 and :208, test/controller/run_cli_test.rb:26. See docs/research/lint-lessons/sdlc-dry-repeated-literal-argument.md.
  3. Eval tests may re-test os-sdlc behavior (path ownership, target selection). Not yet enumerated.

Reproduce

n/a: audit and refactor ticket; nothing to reproduce.

Approach

Audit the whole eval, not only the instances above. For each duplicate, name the os-sdlc owner and move the eval onto it. Where the eval must differ, record the reason. The eval keeps only the difference from os-sdlc. This work needs at least one dedicated session.

Required work:

  1. Load the project through OsSdlc::Project in the eval adapter — check: absent YAML.safe_load_file in plugins/os-sdlc/eval/ticket-takedown/lib/**/*.rb
  2. Remove the repeated project.yaml path literal from eval tests — check: absent ".sdlc", "project.yaml" in plugins/os-sdlc/eval/ticket-takedown/test/**/*.rb

Acceptance criteria

  1. Given the audit is done, when the ticket closes, then every duplicate found is listed with its os-sdlc owner.
  2. Given a listed duplicate, when the ticket closes, then the eval uses the owner, or the ticket records why the eval must differ.
  3. Given an eval test that re-tests os-sdlc behavior, when the ticket closes, then the test is deleted.
  4. Given the change, when the eval suite and the os-sdlc suite run, then both pass.

Owner sketch

class Takedown::ProjectSuites
  def targets
    # OsSdlc::Project built from the owner's loader; eval adds only its command/suite customization
  end
end

Origin

  • Trigger: Jared's ruling in session 270dfee2, 2026-10-15
  • Improvised this session: none
  • Chain: eval duplicates os-sdlc project loading ← eval built standalone before the merge plan ← DESIGN (ADR on takedown eval reuse of os-sdlc lib)
  • Root candidate: none
  • Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/adapter/project_suites.rb
  • Session: 270dfee2-6a92-4e87-828c-9ac8c32c1cd7
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-prism-architect/270dfee2-6a92-4e87-828c-9ac8c32c1cd7.jsonl

VERDICT: CREATE (ticket-skeptic: explicit user request floor applies)

## Problem The takedown eval (`plugins/os-sdlc/eval/ticket-takedown`) re-implements behavior that `plugins/os-sdlc/lib/os_sdlc` already owns. The eval will merge into the os-sdlc lib later. Each duplicate adds code and tests that the merge must remove. Jared's ruling, 2026-10-15: "The eval project should reuse as much of the os-sdlc code as possible. It will be integrated into os-sdlc's lib once we have the kinks ironed-out anyway. So if the code it needs already exists, use it! The eval code should really only be the difference between the existing os-sdlc code and the customizations needed for the eval portion. So, it should be using the entire Project class - not necessarily just Project::Target and Project::Config. That should reduce the number of tests needed and new code required when we merge in the future." An ADR records this rule. It is created in the same session as this ticket. See the ADR on takedown eval reuse of os-sdlc lib. ## Observed Verified on HEAD: 1. `eval/ticket-takedown/lib/takedown/adapter/project_suites.rb` defines `PATH = File.join(".sdlc", "project.yaml")`, reads it with `YAML.safe_load_file`, and reads raw section hashes. It wraps a single `OsSdlc::Project::Target` through `from_section`. Owners: `OsSdlc::Project.from_data` (`lib/os_sdlc/model/project.rb`) and `OsSdlc::Project::Config` (`lib/os_sdlc/adapter/project/config.rb`, which owns `path`, `read`, `document`). 2. The literal `File.join(@repo, ".sdlc", "project.yaml")` repeats in eval tests: `test/command/green_suite_test.rb:20`, `test/command/polish_test.rb:91`, `test/command/final_suite_test.rb:101` and `:208`, `test/controller/run_cli_test.rb:26`. See `docs/research/lint-lessons/sdlc-dry-repeated-literal-argument.md`. 3. Eval tests may re-test os-sdlc behavior (path ownership, target selection). Not yet enumerated. ## Reproduce n/a: audit and refactor ticket; nothing to reproduce. ## Approach Audit the whole eval, not only the instances above. For each duplicate, name the os-sdlc owner and move the eval onto it. Where the eval must differ, record the reason. The eval keeps only the difference from os-sdlc. This work needs at least one dedicated session. Required work: 1. Load the project through `OsSdlc::Project` in the eval adapter — check: absent `YAML.safe_load_file` in `plugins/os-sdlc/eval/ticket-takedown/lib/**/*.rb` 2. Remove the repeated project.yaml path literal from eval tests — check: absent `".sdlc", "project.yaml"` in `plugins/os-sdlc/eval/ticket-takedown/test/**/*.rb` ## Acceptance criteria 1. Given the audit is done, when the ticket closes, then every duplicate found is listed with its os-sdlc owner. 2. Given a listed duplicate, when the ticket closes, then the eval uses the owner, or the ticket records why the eval must differ. 3. Given an eval test that re-tests os-sdlc behavior, when the ticket closes, then the test is deleted. 4. Given the change, when the eval suite and the os-sdlc suite run, then both pass. ## Owner sketch ```ruby class Takedown::ProjectSuites def targets # OsSdlc::Project built from the owner's loader; eval adds only its command/suite customization end end ``` ## Origin - Trigger: Jared's ruling in session 270dfee2, 2026-10-15 - Improvised this session: none - Chain: eval duplicates os-sdlc project loading ← eval built standalone before the merge plan ← DESIGN (ADR on takedown eval reuse of os-sdlc lib) - Root candidate: none - Where: plugins/os-sdlc/eval/ticket-takedown/lib/takedown/adapter/project_suites.rb - Session: 270dfee2-6a92-4e87-828c-9ac8c32c1cd7 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-prism-architect/270dfee2-6a92-4e87-828c-9ac8c32c1cd7.jsonl VERDICT: CREATE (ticket-skeptic: explicit user request floor applies)
Author
Owner

The rule this ticket applies is recorded in ADR-0296 (docs/adr/0296-the-takedown-eval-holds-only-its-difference-from-os-sdlc-lib-and-reuses-os-sdlc-owners-amends-adr-0293.md).

The rule this ticket applies is recorded in ADR-0296 (docs/adr/0296-the-takedown-eval-holds-only-its-difference-from-os-sdlc-lib-and-reuses-os-sdlc-owners-amends-adr-0293.md).
Author
Owner

Correction: the ADR is ADR-0297 (docs/adr/0297-the-takedown-eval-holds-only-its-difference-from-os-sdlc-lib-and-reuses-os-sdlc-owners-amends-adr-0293.md). 0296 is taken on branch adr-gate.

Correction: the ADR is ADR-0297 (docs/adr/0297-the-takedown-eval-holds-only-its-difference-from-os-sdlc-lib-and-reuses-os-sdlc-owners-amends-adr-0293.md). 0296 is taken on branch adr-gate.
Author
Owner

Occurrence: Use ProjectScenario in the takedown eval tests
Seen: eval/ticket-takedown/test/command/green_suite_test.rb:20, command/polish_test.rb:91, command/final_suite_test.rb:38+228 (same two-target Hash twice), controller/run_cli_test.rb:26
Run: session 2dd497e0-555e-4518-9cdd-c68461c32463 (#1019 plan, 2026-10-28)
Adds: Required work step 2 is satisfied by reusing os-sdlc's test support rather than a new eval helper. Add two lines to eval/ticket-takedown/test/test_helper.rb: require_relative ../../../tests/support/home_and_start and ../../../tests/support/project_scenario (after #1460 splits HomeAndStart out). Do not push the whole os-sdlc tests/support dir: it eager-loads ~85 files that assume the os-sdlc test helper's DB connection and Open3 stubs. Replace each Hash+write with ProjectScenario.new(@repo, name:).write_multi_target_project_yaml(targets:). ADR-0297 is retired, so the boundary no longer forbids this. Measurement from plugins/os-sdlc should give yaml=0 afterwards (command on #1019 memo comment). Depends on #1460.

Occurrence: Use ProjectScenario in the takedown eval tests Seen: eval/ticket-takedown/test/command/green_suite_test.rb:20, command/polish_test.rb:91, command/final_suite_test.rb:38+228 (same two-target Hash twice), controller/run_cli_test.rb:26 Run: session 2dd497e0-555e-4518-9cdd-c68461c32463 (#1019 plan, 2026-10-28) Adds: Required work step 2 is satisfied by reusing os-sdlc's test support rather than a new eval helper. Add two lines to eval/ticket-takedown/test/test_helper.rb: require_relative ../../../tests/support/home_and_start and ../../../tests/support/project_scenario (after #1460 splits HomeAndStart out). Do not push the whole os-sdlc tests/support dir: it eager-loads ~85 files that assume the os-sdlc test helper's DB connection and Open3 stubs. Replace each Hash+write with ProjectScenario.new(@repo, name:).write_multi_target_project_yaml(targets:). ADR-0297 is retired, so the boundary no longer forbids this. Measurement from plugins/os-sdlc should give yaml=0 afterwards (command on #1019 memo comment). Depends on #1460.
Author
Owner

Occurrence done (fast-batch-22, main 5f32ca8f, commits 97581502 and 4ae19f04): the takedown eval tests write project.yaml through ProjectScenario#write_multi_target_project_yaml (7 sites; final_suite_test had 4). The eval test_helper require_relatives home_and_start, project_scenario, and git_repo_scenario only. The #1019 measurement prints yaml=0. Eval suite 608 runs, 0 failures. The scenario also writes name: widgets; Takedown::ProjectSuites reads only targets (memo docs/crc/os-sdlc/fast-batch-22/finding-l-eval-project-scenario.md).

Occurrence done (fast-batch-22, main 5f32ca8f, commits 97581502 and 4ae19f04): the takedown eval tests write project.yaml through ProjectScenario#write_multi_target_project_yaml (7 sites; final_suite_test had 4). The eval test_helper require_relatives home_and_start, project_scenario, and git_repo_scenario only. The #1019 measurement prints yaml=0. Eval suite 608 runs, 0 failures. The scenario also writes name: widgets; Takedown::ProjectSuites reads only targets (memo docs/crc/os-sdlc/fast-batch-22/finding-l-eval-project-scenario.md).
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#1011
No description provided.