Project::Setup owns project.yaml creation policy #580
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#580
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 3 of 4. Capability: project.yaml creation policy. Audit run 15:
.sdlc/tmp/responsibility-audit/run-15/analysis.yaml, finding 1.Project.upsertholds the create-time preconditions as private class methods on aData.definevalue type. One of its two refusals is dead:ensure_creatable!(project.rb:43) runs only underunless yaml.exist?(project.rb:64), soraise_yaml_already_exists!(project.rb:45) never fires. Decision: delete the overwrite refusal; upsert means create-or-update.Proposed owner (from the report; class renamed Project::Setup by user decision)
Keep the not-a-git-repo message text identical to project.rb today.
project.rbmust stay free of gem requires (ADR-0181 pre-boot chain); the new file needs a manualrequire_relativewhereproject.rbrequires its siblings.Callers that delegate
Project.upsert(project.rb:61): buildsProject::Setup.new(root).upsert(name:, **attrs)then loads and returns the Project as today.ProjectConfigCommand#create(project_config_command.rb:38): throughProject.upsert, unchanged call.Tasks
Project::Setup#upsertrefuses a root outside a git repo withHarnessError.Project::Setup#upsertcreates.sdlc/project.yamlwith the given name and attrs when none exists.Project::Setup#upsertmerges only the given keys into an existing file and leavestrackeruntouched.Project.upsertdelegates and still returns aProject(existingtests/project_test.rb:107-129hold).Acceptance criteria
.git,Project::Setup.new(dir).upsert(name: "widgets")raisesHarnessErrorcontainingnot inside a git repo.name: widgets.tracker: forgejo:a/b,upsert(name: "widgets", code_path: "src")leavestrackerunchanged and writescode_path.Project.upsert(dir, name: "widgets")returns aProjectwhose name iswidgets.Structural follow-through
project.rb:ensure_creatable!,raise_not_a_git_repo!,raise_yaml_already_exists!,git_repo?. Grep after:rg "ensure_creatable|raise_yaml_already_exists|raise_not_a_git_repo|git_repo\?" plugins/os-sdlc/libreturns nothing.Git::Repoleaves project.rb's collaborator list. Grep after:rg "Git::Repo" plugins/os-sdlc/lib/os_sdlc/project.rbreturns nothing.TimingBootSafetyTestafter the split.ADR case
Amends ADR-0178 (upsert stays the entry point;
Project::Setupholds the preconditions; the overwrite refusal is withdrawn as unreachable). Create the amending ADR when the ticket lands.Order
Position 3 of 4. Follows ticket 2 (RootSearch message). Next: ticket 4 (Project.load_shared).
Origin
.sdlc/tmp/responsibility-audit/run-15/analysis.yamlMap: #582
Work started via /os-sdlc:responsibility-refactor batch 3 (map #582). Branch: ticket-580, map poodr-ticket-implementation.yaml, target os-sdlc.
Resolution
Done: Project::Setup (lib/os_sdlc/project/setup.rb) owns the git-repo precondition and merge-then-write; Project.upsert delegates; ensure_creatable!, raise_not_a_git_repo!, raise_yaml_already_exists!, git_repo? deleted from Project; Git::Repo leaves project.rb; overwrite refusal withdrawn (unreachable). Class named Project::Setup per user decision.
Evidence: main
51c40d1, ADR-0185 (amends 0178), suite 1169 runs 0 failures, rubocop clean. Pipeline: 11 dispatches, escalated unexpected_pass:test-writer/diff-test after Setup was built (the remaining task, upsert delegation, is structural and has no red test). Deviations: (1) hand-finished the delegation and deletions after the escalation; (2) programmer applied the git check on every upsert; restored the sketch's create-time-only check (tests/project_test.rb:378 caught it); (3) programmer relayed the prior dispatch id again, hand-settled row 153; (4) removed the descriptive comment the programmer added to setup.rb.Follow-ups: none