mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-28 16:36:45 +00:00
Prevent helper-era ROADMAP id collisions before review (#3115)
Add a lightweight ROADMAP duplicate-id guard and wire it into the low-risk docs/pre-push paths so optimistic append collisions introduced after the next-id helper are caught before merge. Constraint: Current ROADMAP contains legacy numbered lists and pre-helper duplicate low ids, so the default guard checks helper-era ids >=723 while preserving --min-id 1 for a future strict audit. Rejected: Fail CI on every numeric duplicate in the whole historical ROADMAP | current main would fail before this PR because old prose/list numbering is already duplicated. Confidence: high Scope-risk: narrow Directive: Keep roadmap-next-id.sh paired with roadmap-check-ids.sh when changing ROADMAP append workflows. Tested: bash -n scripts/roadmap-check-ids.sh scripts/roadmap-next-id.sh .github/hooks/pre-push; scripts/roadmap-check-ids.sh; temp ROADMAP copy with duplicate 723 failed nonzero and listed id 723; SKIP_CLAW_PRE_PUSH_BUILD=1 .github/hooks/pre-push; git diff --check; python3 .github/scripts/check_doc_source_of_truth.py; python3 .github/scripts/check_release_readiness.py Not-tested: full cargo workspace build/test because this is docs/scripts-only and the local pre-push cargo build was smoke-tested with its documented skip path.
This commit is contained in:
@@ -43,9 +43,30 @@ git config core.hooksPath .github/hooks
|
||||
|
||||
This sets the repo's Git hook directory to `.github/hooks`; if you already use a
|
||||
custom `core.hooksPath`, copy or chain `.github/hooks/pre-push` instead. The hook
|
||||
runs `cargo build --manifest-path rust/Cargo.toml --workspace --locked` from the
|
||||
repository root. If you must bypass it for a non-code/docs-only push, set
|
||||
`SKIP_CLAW_PRE_PUSH_BUILD=1`; the hook prints when that escape hatch is used.
|
||||
runs the ROADMAP id guard, then runs
|
||||
`cargo build --manifest-path rust/Cargo.toml --workspace --locked` from the
|
||||
repository root. If you must bypass the cargo build for a docs-only push, set
|
||||
`SKIP_CLAW_PRE_PUSH_BUILD=1`; the hook still runs the ROADMAP guard and prints
|
||||
when the cargo-build escape hatch is used.
|
||||
|
||||
## ROADMAP id allocation
|
||||
|
||||
Before appending a new numeric ROADMAP entry, pull/rebase onto the latest
|
||||
`main`, allocate the id from the file you are about to edit, and run the duplicate
|
||||
id guard before pushing:
|
||||
|
||||
```bash
|
||||
git pull --rebase
|
||||
NEXT=$(scripts/roadmap-next-id.sh)
|
||||
# append "${NEXT}. **...**" to ROADMAP.md
|
||||
scripts/roadmap-check-ids.sh
|
||||
```
|
||||
|
||||
The duplicate guard currently checks helper-era ids (`>=723`) by default so it
|
||||
catches new optimistic-append collisions without failing on legacy numbered lists
|
||||
already present in the historical roadmap. Use `scripts/roadmap-check-ids.sh
|
||||
--min-id 1` for a strict whole-file audit after those legacy collisions are
|
||||
cleaned up.
|
||||
|
||||
## Checks before opening a pull request
|
||||
|
||||
|
||||
Reference in New Issue
Block a user