Parse uppercase CHANGE tags in handoff items so the auto-commit includes refactorer files #906
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#906
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?
Parse uppercase CHANGE tags in handoff items so the auto-commit includes refactorer files [capture]
Problem
The Runner auto-commit takes its file list from handoff
items.Commit::Itemstrips only lowercase tags. The refactorer writesCHANGE: <path> :: ...items with an uppercase tag. The parser readsCHANGE:as the path. A file that only a refactorer item names is never staged. A new untracked file in that state breaks the committed tree.Observed
Implementation 6 (#897) reached
implementation_complete. The Runner committedd93e4600.commit.pathslisted 10 files.commit.dirty_pathslistedplugins/os-sdlc/lib/os_sdlc/model/map/source.rb. That file was new and untracked. The code ind93e4600referencesMap::Source. The commit alone fails the suite. The user committed the file by hand ase43b1864.The handoff rows of implementation 6 show the cause.
source.rbonly inCHANGE: plugins/os-sdlc/lib/os_sdlc/model/map/source.rb :: new Map::Source = ....plugins/os-sdlc/lib/os_sdlc/model/map/changed_error.rb. Those paths were committed.plugins/os-sdlc/tests/model/dispatch/work_order_test.rbas a plain path. It was incommit.paths."CHANGE: plugins/.../source.rb :: ...".sub(/\A[a-z_]+:\s*/, "")does not match, becauseCHANGEis uppercase. The first token isCHANGE:, which becomesCHANGE:after DECORATION removal. It is not inchanged_paths.ListedPaths#call & changed_paths(query/implementation/commit/listed_paths.rb:12, command/implementation/commit.rb:34) drops it.commit.rb:27then puts the real file indirty_paths: changed_paths - paths.The refactorer agent definition prescribes this format (
plugins/os-sdlc/agents/refactorer.md:44):CHANGE: <path> :: <refactoring or NO-REFACTOR-NEEDED>.Reproduce
Output:
CHANGE:Approach
Give the refactorer the same
itemsgrammar as the programmer and the test-writer: each item is one changed file path, with no tag. The parser stays as it is. Then the commit path list has one grammar for every writer role, and no parser heuristic gets wider.plugins/os-sdlc/agents/refactorer.md,itemslists every file the refactorer changed, as a plain path.items: []means no refactoring.RATIONALE:andLENS:lines move todisclosures, as inagents/programmer.md.NO-REFACTOR-NEEDEDresult goes insummary.agents/refactorer.mdand sends each item toImplementation::Commit::Item#path. Each item must give its path. This test is red now: the example itemCHANGE: lib/widget.rb :: ...givesCHANGE:.Required work:
CHANGE:item tag from the refactorer handoff — check: absentCHANGE:inplugins/os-sdlc/agents/refactorer.mddisclosures:inplugins/os-sdlc/agents/refactorer.mdRejected:
Item::TAGto/\A[A-Za-z_]+:\s*/. The parser then accepts a second grammar that a prompt owns. Judge items such asTEST: <path> :: <name>(test-reviewer) also start to resolve to paths, so a judge item can stage a file. This adds a heuristic for one emitter (feedback-remove-habits-dont-backfill-heuristics).overlapping_pathsanddirty_pathsexist to protect that work, ADR-0171).Acceptance criteria
agents/refactorer.md, when each item goes toImplementation::Commit::Item#path, then each item gives a repository-relative path.itemsname only a new untracked file, when the implementation completes, thencommit.pathscontains that file andcommit.dirty_pathsdoes not.agents/refactorer.md, when searched, then noCHANGE:item prefix remains, and theRATIONALE:andLENS:lines are underdisclosures.Owner sketch
Origin
e43b1864("fix(os-sdlc): #897 add Map::Source, omitted from the Runner commitd93e4600")source.rbindirty_pathsnotpaths←ListedPathskeeps only tokens that Item parses as a path ←Item::TAGmatches lowercase tags only (plugins/os-sdlc/lib/os_sdlc/parser/implementation/commit/item.rb:7) ← refactorer items use the uppercaseCHANGE:tag (plugins/os-sdlc/agents/refactorer.md:44; handoff 34 in.sdlc/pipeline.db) ← DESIGN: ADR-0171 auto-commit takes paths from handoff items, and the item grammar has two disagreeing owners (agent prompt and parser).VERDICT: CREATE — observed in a complete in-policy run (#897 implementation 6); Item::TAG at item.rb:7 matches only lowercase tags while refactorer.md:44 prescribes uppercase CHANGE:, so the auto-commit silently omits refactorer files.
PREDICTED RULING: REVISE
a. No. The user would not accept "widen Item::TAG to [A-Za-z_]".
b. Reasons:
modified: lib/widget.rb) pins a format that no agent emits.TEST: <path> :: <name>(test-reviewer) also resolve to paths. A judge item can then stage a file.c. They would call the regex a patch on the symptom. Research done: the item formats in agents/*.md. programmer.md and test-writer.md use plain paths in
itemsand put LENS indisclosures. Only refactorer.md tags a writer item. No lib code readsCHANGE:. No test reads agent prompts.d. Give the refactorer the programmer's grammar: plain changed paths in
items, RATIONALE/LENS indisclosures, NO-REFACTOR-NEEDED insummary. Add a red test: the refactorer.md example items must parse through Commit::Item#path. The parser and ADR-0171 do not change. The body is edited to match.e. Not read: pipeline.db handoff 34, the contract-auditor brief assembly (it may quote refactorer items), the map node instructions for the refactorer, and ADR-0050/0135 on handoff item kinds.
Work started on branch ticket-906 through /os-sdlc:implement (poodr-ticket-implementation map).
Resolution
Done: refactorer.md handoff now writes plain changed paths in items (programmer grammar); RATIONALE/LENS lines go to disclosures; NO-REFACTOR-NEEDED goes in summary. Commit::Item parser and ADR-0171 unchanged, so judge-agent tags still never become commit paths.
Evidence: Implementation 21 complete, 8 dispatches all pass, suite gate exit 0. New test tests/parser/implementation/commit/item_test.rb reads the refactorer.md example through Commit::Item#path. Commits
04fbc824,7bef0c4eon main.Follow-ups: none