Project.load_shared: target-agnostic read for tracker and lint_config #581
Labels
No labels
P0
P1
P2
P3
bug
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#581
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Batch 3 on project.rb, ticket 4 of 4. Capability: target-agnostic project read. Audit run 15:
.sdlc/tmp/responsibility-audit/run-15/analysis.yaml, finding 2.TargetSelectionErrorexists so a misselected target fails loudly (harness_error.rb:17). Two readers need only shared keys (tracker,lint_config), passtarget: nil, and rescueHarnessError, which swallows it. On a multi-target project.yaml the tracker slug and the root lint config silently become nil.Proposed owner (from the report, verbatim)
After ticket 2, the missing-root raise goes through
Project::RootSearch#root!, notraise_missing_root!.Callers that delegate
Runner::TeaTracker#resolve_slug(runner/tea_tracker.rb:148):Project.load_shared(@root).tracker, no rescue ofHarnessError. The yaml read at tea_tracker.rb:125 goes the same way.AutocorrectPrepass#root_lint_config(autocorrect_prepass.rb:95):Project.load_shared(@root).resolved_lint_config, no rescue ofHarnessError.Tasks
Project.load_shared(dir)returns aProjectwith the top-level shared keys and defaults from a targets-shaped project.yaml without raisingTargetSelectionError.Project.load_shared(dir)on a flat project.yaml returns the same attrs asProject.load(dir, target: nil).TeaTrackerresolves the forgejo slug from a targets-shaped project.yaml with a top-leveltracker.AutocorrectPrepassresolves the root lint config from a targets-shaped project.yaml with a top-levellint_config.Acceptance criteria
targets: {a: {code_path: lib}}plus top-leveltracker: forgejo:j/r,Project.load_shared(dir).tracker == "forgejo:j/r"and no error is raised.Project.load(dir, target: nil)still raisesTargetSelectionError(unchanged).TeaTrackerbuilt on that root resolves slugj/r.lint_config: .rubocop.yml, the autocorrect pre-pass's generated config inherits<root>/.rubocop.yml.Structural follow-through
rescue HarnessErrorat autocorrect_prepass.rb:96 and tea_tracker.rb:153 and the ADR-0169 exemption comment at tea_tracker.rb:145-146. Grep after:rg "target: nil" plugins/os-sdlc/libreturns nothing.tests/runner_project_load_guard_test.rb:10; the guard now allowsload_sharedand forbidsProject.loadoutside implementation-open as before.ADR case
Amends ADR-0088 (a shared-key read is a named constructor, not a
niltarget) and ADR-0169 item 3 (the two pre-open readers useProject.load_shared, so the exemption is withdrawn). Create the amending ADR when the ticket lands.Order
Position 4 of 4. Follows ticket 3 (Project::Setup). Last in batch; re-audit follows.
Origin
.sdlc/tmp/responsibility-audit/run-15/analysis.yamlMap: #582
Work started via /os-sdlc:responsibility-refactor batch 3 (map #582). Branch: ticket-581, map poodr-ticket-implementation.yaml, target os-sdlc. Note: after #579 the missing-root raise goes through Project::RootSearch#root!.
Resolution
Done: Project.load_shared (target-agnostic read) built from ProjectTargets#shared_attrs, now public; TeaTracker#resolve_slug and AutocorrectPrepass#root_lint_config use it and no longer rescue HarnessError; ADR-0169 item 3 exemption withdrawn; guard test exempt list reduced to open_implementation.rb.
Evidence: main
31e6759, ADR-0186 (amends 0088/0169), suite 1176 runs 0 failures, rubocop clean. Pipeline: 12 dispatches, 2 retries. Deviations: (1) the new autocorrect test asserted a single inherit path where the chain is always plugin config then custom (ADR-0091); hand-corrected to assert_includes. (2) implementation-report crashes with record_usage! for nil when run from plugins/os-sdlc instead of the worktree root; rerun from root. (3) One order-dependent failure in tests/autocorrect_prepass_test.rb (trailing whitespace assertion) appeared once in a full run and not in isolation or later runs; not investigated.Follow-ups: none