Make Handoff::Store the only owner of handoff file I/O #1401
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
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
rule-proposal
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#1401
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?
Problem
File I/O for handoff files sits in three classes.
Handoff::Documentreads its own file (plugins/os/lib/handoff/document.rb:13,File.binread) and writes its own file (document.rb:35,File.binwrite).Handoff::StatusCommanddeletes files (status_command.rb:15,File.delete).Handoff::Storealready exists, but it only reads (Dir.glob,File.realpath). Disk access has no single owner, and Document tests must touch the disk.Reproduce
n/a: structure change; behavior stays the same.
Approach
Make
Handoff::Storethe only owner of handoff file I/O: read, write, and delete (about 15 lines).Documentbecomes pure: it takes text and returns text.StatusCommandasks the store to delete.Required work:
Handoff::Document— check: absentFile.binreadinplugins/os/lib/handoff/document.rbHandoff::Document— check: absentFile.binwriteinplugins/os/lib/handoff/document.rbHandoff::StatusCommand— check: absentFile.deleteinplugins/os/lib/handoff/status_command.rbFile.binwriteinplugins/os/lib/handoff/store.rbAcceptance criteria
Handoff::Documentbuilt from a string, when its tests run, then they do not touch the disk.Owner sketch
Origin
8991003e; handoff sections). Three strict patterns flag the same lines: Repository R1, Hexagonal R1, Layers R2.VERDICT: CREATE
Resolution
Done: Handoff::Store is built on its handoffs directory and owns read, write, delete, complete; Document.new(path:, text:) parses text only; StatusCommand deletes through the store; Store.for_project keeps the .cc-os realpath rule and passes default_project. Ruling R1 predicted (74%), R2/R3 fix list.
Evidence: fast-batch-17 merged at main
80a39130(commitse5695b2c,86ca5729,532b8f05,428ee39a); os suite 47 runs 0 failures; grep finds no File.binread/binwrite/delete outside Store; blind judge: better, 75%.Follow-ups: Document unit tests from strings: captured separately in this session