feat(doc-syncer): PATCHED_FILES newline output for doc-commit handoff

doc-syncer now emits PATCHED_FILES — every public-doc file created/modified this run, ONE PATH PER LINE — in both STEP 9 OUTPUT (full audit) and AUTO MODE STEP A4 (the path orchestrators call). NONE stays silent (no line → doc-commit sees empty → no-ops). Additive: detection/patching logic and the `auto-mode scope:` input contract are unchanged → callers unaffected.

Separator contract, producer↔consumer aligned + proven: newline is doc-syncer's OUTPUT format (paths carry no newlines); the agent splits on newline and passes EACH path as a SEPARATE argv element to lib/doc-commit.sh. The helper takes argv (no in-band separator) → a path with spaces survives as one argument. lib/doc-commit.md spells this out (never flatten to a space-joined string + re-split, which would mis-split a spaced path the helper then silently drops). New test T7 PROVES it on real git: 'docs/My Guide.md' → committed as one file (28/28, shellcheck clean).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ho5EQCFTSvYamuRtVZpp2d
This commit is contained in:
Bastien Chanot
2026-06-27 01:07:03 +02:00
co-authored by Claude Opus 4.8
parent 4a54a65dd4
commit fb1f359da5
3 changed files with 49 additions and 6 deletions
+21 -2
View File
@@ -719,8 +719,16 @@ CREATED : <count> files
REMOVED : <count> files / sections
HUMAN PENDING: <count> items (see report above)
SKIPPED : <count> (user declined)
PATCHED_FILES: (one real path per LINE below; "(none)" if no write)
<path created or modified this run>
<path created or modified this run>
```
`PATCHED_FILES` is the machine-readable handle the doc-commit step (`lib/doc-commit.md`)
consumes — every public-doc file created or modified this run, ONE PATH PER LINE. Each line
is passed as a SEPARATE argument to `lib/doc-commit.sh` (newline split, space-safe). It NEVER
lists `.claude/**` or `CLAUDE.md` (never targets, BDR-022). Empty / `(none)` → doc-commit no-ops.
---
## AUTO MODE
@@ -782,8 +790,9 @@ Categorize:
### STEP A4 — ACT
- **NONE** → exit completely silent. No output.
- **MINOR** → patch silently. One-line confirmation:
- **NONE** → exit completely silent. No output (no `PATCHED_FILES` → the doc-commit step
sees an empty list and no-ops).
- **MINOR** → patch silently. One-line confirmation per file:
`doc-sync: patched <file> (<what changed>)`
- **SIGNIFICANT** → surface to user before patching:
```
@@ -793,6 +802,16 @@ Categorize:
```
Wait for approval.
After writing in MINOR or approved-SIGNIFICANT, emit the machine-readable handle the
doc-commit step (`lib/doc-commit.md`) consumes — ONE real path PER LINE:
```
PATCHED_FILES:
<path created or modified this run>
<path created or modified this run>
```
Emit ONLY when something was written; NONE stays silent. Never lists `.claude/**` or
`CLAUDE.md` (never targets, BDR-022).
---
## RULES