jbaruch / jbaruch/coding-policy
fix(herdr): Partition-loader docstring drift, brief TOCTOU, and validator-output provenance
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1
- Forks
- 2
- Avg merge
- 9h 22m
- Merged PRs (30d)
- 81
Description
Summary
Three items raised on #456 and deferred there (advisory; the PR's gates were green and the blocking findings were fixed in-round).
-
Stale docstring.
partition.load_validated's docstring says the result "carries the slices with their RESOLVED paths". The slices carry globs at every stage —planemits them asslice_paths,compose-briefs.shrenders them, the worker resolves them. Onlyvalidate()'s return is resolved paths, and the loader discards it. One sentence, but it is what made two reviewers read the loader as accepting a broader boundary than intended. -
Brief time-of-check/time-of-use gap.
_require_bound_slicesreads each brief at preflight;assign.applyre-reads the path at send. A brief edited in between dispatches unchecked. Shared with every otherapplypreflight (readiness, tier, qualification), so the fix is to pass checked CONTENT to the send rather than a path — anassign.applyinterface change touching every caller. -
No provenance on the validator's output.
load_validatedaccepts any file carrying achangedlist and re-proves the partition over that set. A caller who supplies a smaller self-consistent set gets a partition genuinely valid over it.planhas no repo, base or head and cannot check the round diff. Closing this means signingvalidate-partition's output and verifying it here — including deciding what happens when no key is configured.
Test plan
- Docstring describes what the loader returns
- (2) A brief edited between preflight and send is refused
- (3) An unsigned or mis-signed validator output is refused, with the no-key behavior documented
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing partition.load_validated, validate(), _require_bound_slices, and assign.apply, including every caller of the apply interface; inspect compose-briefs.sh and the validate-partition output path. Done means the loader docstring matches its return, checked brief content is used through send, and unsigned or mis-signed validator output follows documented no-key behavior and is refused when required.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, shell
- Domain
- security, tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100