jbaruch / jbaruch/coding-policy

fix(herdr): Partition-loader docstring drift, brief TOCTOU, and validator-output provenance

Open
#460 0 comments 0 reactions 0 assignees View on GitHub

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).

  1. Stale docstring. partition.load_validated's docstring says the result "carries the slices with their RESOLVED paths". The slices carry globs at every stage — plan emits them as slice_paths, compose-briefs.sh renders them, the worker resolves them. Only validate()'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.

  2. Brief time-of-check/time-of-use gap. _require_bound_slices reads each brief at preflight; assign.apply re-reads the path at send. A brief edited in between dispatches unchecked. Shared with every other apply preflight (readiness, tier, qualification), so the fix is to pass checked CONTENT to the send rather than a path — an assign.apply interface change touching every caller.

  3. No provenance on the validator's output. load_validated accepts any file carrying a changed list and re-proves the partition over that set. A caller who supplies a smaller self-consistent set gets a partition genuinely valid over it. plan has no repo, base or head and cannot check the round diff. Closing this means signing validate-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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.