project.rb: pass target: in BriefFacts#project; keep false values in Project.upsert #564

Closed
opened 2026-09-13 23:18:03 +00:00 by jared · 2 comments
Owner

Map: #568

Context

Responsibility audit of project.rb on 2026-09-13 found two guard defects that move no ownership. Batch position 1 of 4. Runs first. The map ticket names the order.

Observed

BriefFacts#project calls Project::Source.for(implementation) without target:. GateCommands#project passes it. The fallback becomes Project.load(root, target: nil), which raises TargetSelectionError on any targets-shaped project.
Project.upsert drops a false value, so commit_on_complete: false can never be written or cleared.

plugins/os-sdlc/lib/os_sdlc/runner/brief_facts.rb:32   Project::Source.for(implementation)
plugins/os-sdlc/lib/os_sdlc/project.rb:110             h[key.to_s] = value if value

Reproduce

cd plugins/os-sdlc && ruby -Ilib -e 'require "os_sdlc"; p OsSdlc::Project.upsert(Dir.pwd, commit_on_complete: false)'

Then inspect .sdlc/project.yaml: no commit_on_complete key is written.

Expected

def test_upsert_writes_false_values
  Project.upsert(dir, commit_on_complete: false)
  assert_equal false, YAML.safe_load_file(Project.yaml_path(dir))["commit_on_complete"]
end

def test_brief_facts_project_passes_target
  # BriefFacts#project on a targets-shaped project with a bound target does not raise TargetSelectionError
end

Tasks

  • Failing test: upsert keeps a false value
  • Fix project.rb:110 to unless value.nil?
  • Failing test: BriefFacts#project on a targets-shaped project with a bound target
  • Pass target: in brief_facts.rb:32 the same way GateCommands does

Acceptance criteria

  • Both tests green; full suite green
  • ADR case: completes ADR-0169 (target: required on every load). No ADR work.

Origin

  • Trigger: /os-sdlc:responsibility-audit plugins/os-sdlc/lib/os_sdlc/project.rb on 2026-09-13; analysis at .sdlc/tmp/responsibility-audit/2026-09-13-project/analysis.yaml
  • Improvised this session: none
  • Chain: mixed responsibilities in OsSdlc::Project ← DESIGN (plugins/os-sdlc/lib/os_sdlc/project.rb, ADR-0055/0074/0088/0169/0174)
  • Root candidate: this ticket
  • Where: OsSdlc::Project, plugins/os-sdlc/lib/os_sdlc/project.rb
  • Session: c72ac6a8-cb89-4b97-904d-155babd2a7a2
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/c72ac6a8-cb89-4b97-904d-155babd2a7a2.jsonl
Map: #568 ## Context Responsibility audit of `project.rb` on 2026-09-13 found two guard defects that move no ownership. Batch position 1 of 4. Runs first. The map ticket names the order. ## Observed `BriefFacts#project` calls `Project::Source.for(implementation)` without `target:`. `GateCommands#project` passes it. The fallback becomes `Project.load(root, target: nil)`, which raises `TargetSelectionError` on any targets-shaped project. `Project.upsert` drops a false value, so `commit_on_complete: false` can never be written or cleared. ``` plugins/os-sdlc/lib/os_sdlc/runner/brief_facts.rb:32 Project::Source.for(implementation) plugins/os-sdlc/lib/os_sdlc/project.rb:110 h[key.to_s] = value if value ``` ## Reproduce ``` cd plugins/os-sdlc && ruby -Ilib -e 'require "os_sdlc"; p OsSdlc::Project.upsert(Dir.pwd, commit_on_complete: false)' ``` Then inspect `.sdlc/project.yaml`: no `commit_on_complete` key is written. ## Expected ```ruby def test_upsert_writes_false_values Project.upsert(dir, commit_on_complete: false) assert_equal false, YAML.safe_load_file(Project.yaml_path(dir))["commit_on_complete"] end def test_brief_facts_project_passes_target # BriefFacts#project on a targets-shaped project with a bound target does not raise TargetSelectionError end ``` ## Tasks - [ ] Failing test: upsert keeps a false value - [ ] Fix `project.rb:110` to `unless value.nil?` - [ ] Failing test: `BriefFacts#project` on a targets-shaped project with a bound target - [ ] Pass `target:` in `brief_facts.rb:32` the same way `GateCommands` does ## Acceptance criteria - Both tests green; full suite green - ADR case: completes ADR-0169 (`target:` required on every load). No ADR work. ## Origin - Trigger: `/os-sdlc:responsibility-audit plugins/os-sdlc/lib/os_sdlc/project.rb` on 2026-09-13; analysis at `.sdlc/tmp/responsibility-audit/2026-09-13-project/analysis.yaml` - Improvised this session: none - Chain: mixed responsibilities in `OsSdlc::Project` ← DESIGN (`plugins/os-sdlc/lib/os_sdlc/project.rb`, ADR-0055/0074/0088/0169/0174) - Root candidate: this ticket - Where: `OsSdlc::Project`, `plugins/os-sdlc/lib/os_sdlc/project.rb` - Session: c72ac6a8-cb89-4b97-904d-155babd2a7a2 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/c72ac6a8-cb89-4b97-904d-155babd2a7a2.jsonl
Author
Owner

Work started via /os-sdlc:implement on branch ticket-564 (worktree). Map: #568.

Work started via /os-sdlc:implement on branch ticket-564 (worktree). Map: #568.
Author
Owner

Resolution

Done: Project.upsert keeps false values (present_attrs uses unless value.nil?). BriefFacts accepts target: through an Options Data and passes it to Project::Source.for; StartSubagent passes implementation.target.

Evidence: Pipeline implementation 1 complete: 14 dispatches, 2 contract-auditor retries, suite 1207 runs 0 failures. Commit on branch ticket-564, merged to main via worktree finish. Tests: project_test#test_upsert_writes_a_false_attribute_value_instead_of_dropping_it, brief_facts_project_source_test#test_code_changes_does_not_raise_target_selection_error_for_a_bound_target.

Follow-ups: none. Deviation: the pipeline left StartSubagent, the only production builder of BriefFacts, without a target; wired by hand after implementation_complete, suite and lint green.

## Resolution **Done:** Project.upsert keeps false values (present_attrs uses unless value.nil?). BriefFacts accepts target: through an Options Data and passes it to Project::Source.for; StartSubagent passes implementation.target. **Evidence:** Pipeline implementation 1 complete: 14 dispatches, 2 contract-auditor retries, suite 1207 runs 0 failures. Commit on branch ticket-564, merged to main via worktree finish. Tests: project_test#test_upsert_writes_a_false_attribute_value_instead_of_dropping_it, brief_facts_project_source_test#test_code_changes_does_not_raise_target_selection_error_for_a_bound_target. **Follow-ups:** none. Deviation: the pipeline left StartSubagent, the only production builder of BriefFacts, without a target; wired by hand after implementation_complete, suite and lint green.
jared closed this issue 2026-09-13 23:47:43 +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#564
No description provided.