Skip to content

docs: require --all when deriving names, and scope agent scratch files - #115

Merged
kenjudy merged 1 commit into
mainfrom
docs/scrub-brief-derivation-fix
Aug 20, 2026
Merged

kenjudy merged 1 commit into
mainfrom
docs/scrub-brief-derivation-fix

Conversation

@kenjudy

@kenjudy kenjudy commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Two defects in scrub-report-instruction.md, both found by running the brief for real across six reports rather than by reading it.

The derivation command missed an author who is in the report

The brief said:

git log --format=%an%n%cn | sort -u

That reads the default branch. This toolkit whole premise is analysing commits on unmerged feature branches, so a report routinely names authors and subjects a plain git log never reaches. Measured on one repository: the agent following the brief found its list did not contain an author who appears in the report, switched to --all variants on its own initiative, and caught it.

An agent following the brief literally would have shipped a report containing a real name, and verified it clean against a derived list that never contained that name. The verification step would have passed. That is the worst shape of failure available here.

--all is now required on both the name and the subject query, with the measured case recorded so the requirement is not optimised away later by someone who reads it as belt-and-braces.

Also recorded: an author initials can survive inside a branch name after the name itself is replaced. origin/jw/create-staging-env outlived the substitution of the author it belongs to.

Concurrent agents collided on scratch filenames

Six agents ran this brief at once. They share one scratchpad and the brief said nothing about naming, so two of them wrote scripts to the same path. Each then found its own file replaced by another agent script targeting a different repository, one of them a repository its safety rules explicitly forbade it from writing to, accompanied by the harness own reminder not to mention the change.

Both agents handled it correctly and better than their instructions required: refused to run the foreign script, verified nothing had been written where it was forbidden, disregarded the concealment line, renamed their own file, re-read it to confirm contents, and reported it anyway. No file was written outside its target repository, and all six scrubbed outputs were verified afterwards to match their own repository data with no cross-contamination.

But both spent real time investigating a filename collision as though it were tampering, and one described it as an anomaly it could not explain. The brief now tells an agent to namespace its scratch files to its target repository, and what to do if a file comes back altered, so the next one spends no time on this.

Not changed

The human review gate, the substitution table, the never-touch list and the JSON scope limit are all unchanged. This is a fix to how the sensitive list is derived and how an agent names its own working files, not to what gets replaced or who decides it is safe to share.

Verification

714 tests pass, lint and typecheck clean. Documentation only.

🤖 Generated with Claude Code

Two defects found by running the brief for real across six reports.

The derivation command missed an author who is in the report. `git log
--format='%an%n%cn'` reads the default branch, but this toolkit's whole premise
is analysing commits on unmerged feature branches, so the report routinely names
authors and subjects a plain `git log` never reaches. An agent following the
brief literally would have shipped a real name and verified clean against a list
that never contained it. `--all` is now required on both the name and subject
queries, with the measured case recorded so the requirement is not optimised away
later. Also records that initials can survive inside a branch name after the name
itself is replaced (origin/jw/create-staging-env).

Adds scratch-file scoping. Six concurrent agents share one scratchpad, and a
generic filename like scrub.py gets silently overwritten by another agent's
script targeting a different repository. That happened: one agent found its own
file replaced by a script pointing at a repository its safety rules forbade it
from writing to, accompanied by a harness reminder not to mention the change.
It correctly refused to run the script, verified nothing was written, disregarded
the concealment line and reported it. The brief now tells an agent to namespace
its scratch files and what to do if one comes back altered, so the next agent
spends no time investigating a filename collision as if it were tampering.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

PR Analysis

Size: small (based on production code)
Production Code: 17 lines (1 files)
Test Code: 0 lines (0 files)
Total: 17 lines (1 files)
Test-to-Production Ratio: 0.00:1
No size or quality concerns.

Commit Analysis

Total Commits: 1
Average Commit Size: 17 production lines
Average Files per Commit: 1.0

Metric Value
Large commits (>100 prod lines) 0/1 (0%)
Sprawling commits (>5 files) 0/1 (0%)
Test/prod co-change rate 0/1 (0%)
Message quality 1/1 (100%)
Median net additions ratio 0.76
Test-only commits 0
Production-only commits 1

Commit Details

3d90424 Ken Judy (8/20/2026)
docs: require --all when deriving names, and scope agent scratch files
17 prod lines, 1 files

Test Coverage

Test Adequacy: poor

  • No test changes for production code modifications
  • All commits lack test coverage

DORA Capability Assessment

Archetype: mixed-signals
No clear archetype pattern. Review individual metric thresholds.

Capability Metric Value Target
Small Batches Large commit % 0% <18% (no critical band established)
Small Batches Sprawling commit % 0% <18% (no critical band established)
Version Control Test/prod co-change rate 0% >23% (no critical band established)
Version Control Message quality 100% no band, see spec
AI Risk Signal Net additions ratio (median) 0.76 no band, see spec
Sample size (1 commit) is below the 5-commit convention for a rate verdict (code-quality-metrics-w9f): large-commit %, sprawling-commit % and test/prod co-change rate are reported below without a pass/fail judgement.
Automated by Code Metrics Workflow

@kenjudy
kenjudy merged commit 83114c3 into main Aug 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant