Repository navigation
ci(threat-model): stop threat-model PRs conflicting on prose_version - #525
Merged
Merged
Conversation
…prose_version threat-model.yaml kept a sha256 of the whole prose, so any two pull requests that changed threat-model.md both rewrote that one line and the second to merge conflicted (#400, #508). The YAML's prose_version now names the prose in the same commit, and the validator's new --base check (run by CI against the merge commit's parent) fails a change to the prose that changes neither companion, which is what the hash enforced, without a line every change edits. Adds tests, including two branches that change the prose in different places merging cleanly and still validating. Fixes #507 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bwc5go44W4hjHKu329MepB
adeelahmad
pushed a commit
that referenced
this pull request
Oct 18, 2026
Brings in #525: prose_version no longer hashes the prose. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YHrWfYDCaCbKKDX4w9at9C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adeel · project thread
Description
Before:
threat-model.yamlkeptprose_version: "threat-model.md@sha256:<hash of the whole prose>", so any two pull requests that changedthreat-model.mdboth rewrote that one line, and whichever merged second conflicted. A conflicted PR gets no CI, so it had to merge main, recompute the hash and wait out CI again (#400 three times, #508 six).After:
prose_versionis"threat-model.md@same-commit", a value no change edits. What the hash enforced, that a change to the prose is regenerated into the companions, is now checked per change:ci/validate_threat_model.py --base REFfails whenthreat-model.mdchanged sinceREFbut neitherthreat-model.yamlnorthreat-model.jsondid. CI passes--base HEAD^1(the merge commit's base on a PR, the previous main on a push) withfetch-depth: 2. The id, Q-number and snapshot checks are unchanged.How: the validator drops the hash comparison, requires the fixed
prose_version, and addschanged_since()(git merge-base, then a diff against the working tree so uncommitted edits count locally). The workflow also runs the newci/test_validate_threat_model.py.Motivation and Context
Fixes #507.
Evidence:
test_two_changes_to_the_prose_merge_cleanlybuilds two branches that each add a property to the prose and companions in their own place, merges them, and validates the result. Re-run with the old whole-prose hash, the same test fails withCONFLICT (content): Merge conflict in threat-model.yaml. With this change it merges and passes.--depth 2clone of this branch merged into main:--base HEAD^1passes. After adding a commit that changes onlythreat-model.md, it fails withthreat-model.md changed since HEAD^1 but neither threat-model.yaml nor threat-model.json did.ci/validate_threat_model.py --base origin/mainpasses on this branch, and so do the 8 validator tests, pre-commit (ruff, actionlint, check-yaml) andmake requirements.ci/local-ci.sh --pr 525 --jobs pre-commit,titlealso passes (no backend or frontend code changed).Open PRs that still carry a hash, such as #508, will conflict on this line one last time. Take main's
"threat-model.md@same-commit".Types of changes
!in the title)Checklist:
make hookschecks it on commit).docs/accordingly. (docs/requirements.mdrow, threat-model.md §1.19, DEVLOG note)## UnreleasedinCHANGELOG.md. (n/a: CI-only)Done questions (AGENTS.md)
dependencieslacks, and §1.8 outputs and §1.7 entry points also have rows the YAML lacks. ci: threat-model.yaml and .json lag the prose's tables; check row coverage #526 tracks backfilling them and adding a row-coverage check.🤖 Generated with Claude Code
https://claude.ai/code/session_01Bwc5go44W4hjHKu329MepB