Set cause_challenged in the takedown run's final record #999

Closed
opened 2026-10-12 14:33:28 +00:00 by jared · 2 comments
Owner

Problem

We do not know how often the critic names a deeper cause than the researcher's. Child of #981 (AC 1-2); parent work #974. Constraint: do not change harness/cards/grader.md or its schema.

Design

/home/jared/dev/cc-os/.claude/worktrees/prism-architect/docs/takedown/999-20261012-103408/final-design.json

Approach

RunState#final_record computes the adr_causes list once and writes cause_challenged as whether that list is non-empty, in the class that owns the critique replies.

Required work:

  1. Write plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/run_state.rb
  2. Write test plugins/os-sdlc/eval/ticket-takedown/test/model/run_state_test.rb

Acceptance criteria

  • Any critique has non-empty adr_causes: true
  • All critiques have empty adr_causes: false
  • Critique reply lacks adr_causes: KeyError, as before

Owner sketch

Responsibility Owner
Hold critique replies and derive the adr_causes list RunState#adr_causes (unchanged)
Write the list and whether it is non-empty into the final record RunState#final_record (computes the list once)
Persist final-design.json Flow#settle (unchanged)

plugins/os-sdlc/eval/ticket-takedown/test/model/run_state_test.rb

# frozen_string_literal: true

require_relative "../run_support"

class RunStateTest < TakedownTest
  CAUSE = { "adr" => "docs/adr/0285-x.md", "why" => "FORCES THE WORKAROUND" }.freeze

  def state(*critique_causes)
    views = Takedown::TicketViews.new(full: "F", blind: "B", redactions: 0)
    run = Takedown::RunState.new(ticket: "999", dir: Takedown::RunDir.new(File.join(@root, "runs", "999-1")), views: views)
    run.replies["design-1"] = RunSupport.design("X")
    critique_causes.each_with_index { |causes, i| run.replies["critique-#{i + 1}"] = { "adr_causes" => causes } }
    run.prefer("design-1", nil)
    run
  end

  def test_a_critique_with_adr_causes_challenges_the_cause
    assert_equal true, state([], [CAUSE]).final_record["cause_challenged"]
  end

  def test_every_critique_with_empty_adr_causes_does_not_challenge_the_cause
    assert_equal false, state([], []).final_record["cause_challenged"]
  end

  def test_the_same_cause_named_in_two_rounds_is_listed_once_and_challenges
    record = state([CAUSE], [CAUSE]).final_record
    assert_equal [[CAUSE], true], record.values_at("adr_causes", "cause_challenged")
  end
end
## Problem We do not know how often the critic names a deeper cause than the researcher's. Child of #981 (AC 1-2); parent work #974. Constraint: do not change `harness/cards/grader.md` or its schema. ## Design /home/jared/dev/cc-os/.claude/worktrees/prism-architect/docs/takedown/999-20261012-103408/final-design.json ## Approach RunState#final_record computes the adr_causes list once and writes cause_challenged as whether that list is non-empty, in the class that owns the critique replies. Required work: 1. Write `plugins/os-sdlc/eval/ticket-takedown/lib/takedown/model/run_state.rb` 2. Write test `plugins/os-sdlc/eval/ticket-takedown/test/model/run_state_test.rb` ## Acceptance criteria - Any critique has non-empty adr_causes: true - All critiques have empty adr_causes: false - Critique reply lacks adr_causes: KeyError, as before ## Owner sketch | Responsibility | Owner | |---|---| | Hold critique replies and derive the adr_causes list | RunState#adr_causes (unchanged) | | Write the list and whether it is non-empty into the final record | RunState#final_record (computes the list once) | | Persist final-design.json | Flow#settle (unchanged) | `plugins/os-sdlc/eval/ticket-takedown/test/model/run_state_test.rb` ```ruby # frozen_string_literal: true require_relative "../run_support" class RunStateTest < TakedownTest CAUSE = { "adr" => "docs/adr/0285-x.md", "why" => "FORCES THE WORKAROUND" }.freeze def state(*critique_causes) views = Takedown::TicketViews.new(full: "F", blind: "B", redactions: 0) run = Takedown::RunState.new(ticket: "999", dir: Takedown::RunDir.new(File.join(@root, "runs", "999-1")), views: views) run.replies["design-1"] = RunSupport.design("X") critique_causes.each_with_index { |causes, i| run.replies["critique-#{i + 1}"] = { "adr_causes" => causes } } run.prefer("design-1", nil) run end def test_a_critique_with_adr_causes_challenges_the_cause assert_equal true, state([], [CAUSE]).final_record["cause_challenged"] end def test_every_critique_with_empty_adr_causes_does_not_challenge_the_cause assert_equal false, state([], []).final_record["cause_challenged"] end def test_the_same_cause_named_in_two_rounds_is_listed_once_and_challenges record = state([CAUSE], [CAUSE]).final_record assert_equal [[CAUSE], true], record.values_at("adr_causes", "cause_challenged") end end ```
Author
Owner

Implementation started on branch prism-architect (os-sdlc takedown-implement map), design docs/takedown/999-20261012-103408/final-design.json.

Implementation started on branch prism-architect (os-sdlc takedown-implement map), design docs/takedown/999-20261012-103408/final-design.json.
Author
Owner

Resolution

Done: RunState#final_record writes cause_challenged = adr_causes.any? into final-design.json (takedown run summary).

Evidence: Implementation 39 (takedown-implement, target takedown) complete; commits bcd3eaa0 + 78a36303 (hand-fix of two pinned key lists in pipeline_test.rb after escalation 17); harness suite 529 runs, 0 failures; design docs/takedown/999-20261012-103408.

Follow-ups: #1002 (design cards: every failing_tests method red at base; related designer gap: changed existing tests must be listed). Flag is defined by adr_causes only, as the ticket ACs state; comparison against the researcher cause is #1000.

## Resolution **Done:** RunState#final_record writes cause_challenged = adr_causes.any? into final-design.json (takedown run summary). **Evidence:** Implementation 39 (takedown-implement, target takedown) complete; commits bcd3eaa0 + 78a36303 (hand-fix of two pinned key lists in pipeline_test.rb after escalation 17); harness suite 529 runs, 0 failures; design docs/takedown/999-20261012-103408. **Follow-ups:** #1002 (design cards: every failing_tests method red at base; related designer gap: changed existing tests must be listed). Flag is defined by adr_causes only, as the ticket ACs state; comparison against the researcher cause is #1000.
jared closed this issue 2026-10-12 14:45:57 +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#999
No description provided.