feat(risk): promote control-plane paths to HIGH risk (Closes #179) - #185
Merged
Conversation
internal/risk/, internal/permissions/, internal/readiness/,
harness.toml, .claude/, and CLAUDE.md are the mechanisms that
constrain HERMIT itself. A PR that only touches one of them was
previously MEDIUM (via the internal/ prefix) or unclassified by path
at all, and so could auto-merge under its own judgment -- a
structurally invalid question. DefaultConfig().HighPaths now includes
these six control-plane paths alongside the existing cmd/, go.mod,
.github/ entries, and HighPaths is checked (and returns) before
MediumPaths, so a change confined to internal/risk/ is HIGH, not
MEDIUM, even at one file / one line.
The list intentionally names itself: internal/risk/ and harness.toml
(whose [risk] section can override HighPaths) are both included, so a
PR that tries to narrow this list to weaken the guard is itself HIGH.
cmd/hermit/templates/{CLAUDE.md,harness.toml}.tmpl remain covered by
the pre-existing ExcludePaths entry for cmd/hermit/templates/, since
they are scaffold content shipped to user projects, not HERMIT's own
control plane -- unaffected by this change.
Added REQUIREMENTS.md REQ-015 and TestREQ015_ControlPlanePathsAreHighRisk
covering all six new HIGH paths, the MEDIUM-vs-HIGH priority ordering,
a non-control-plane internal/ path staying MEDIUM, and the
templates/-only exclusion staying LOW. Also updated the pre-existing
TestDefaultConfig_MatchesLegacyHardcodedValues assertion, since it
directly encoded the old three-entry HighPaths list that this Issue
deliberately expands.
Updated README.md and cmd/hermit/templates/harness.toml.tmpl to
document that control-plane paths are HIGH by default.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Owner
Author
Superintendentによるレビュー(PR #185, Issue #179)
自己言及的なブートストラップ問題: このPRの目的そのものが「制御面( 差分の内容確認
懸念点
推奨コード自体の品質・テストカバレッジに問題はなく、実装内容はIssueの要求を満たしています。人間による承認後のマージを推奨します(上記のブートストラップ上の理由により、たとえMEDIUM判定であっても自動マージはスキップしました)。マージ順序を決める際はREQ-015番号衝突の解消も合わせてご検討ください。 |
This was referenced Jul 28, 2026
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.
Summary
DefaultConfig().HighPathsnow includes HERMIT's own control-plane surfaces, so PRs touching only these paths are always HIGH (never auto-merged), regardless of file/line count:internal/risk/internal/permissions/internal/readiness/harness.toml.claude/CLAUDE.mdHighPathsis checked beforeMediumPathsand returns as soon as it matches, so a change confined tointernal/risk/is now HIGH instead of the previous MEDIUM (via the broaderinternal/prefix).The list intentionally includes itself:
internal/risk/(the evaluator's own source) andharness.toml(whose[risk]section can overridehigh_paths) are both in the list, so a future PR that tries to remove a path fromhigh_pathsto weaken the guard is itself a change tointernal/risk/and/orharness.toml, and therefore always trips HIGH.cmd/hermit/templates/CLAUDE.md.tmplandcmd/hermit/templates/harness.toml.tmplare unaffected — they remain excluded via the pre-existingExcludePaths = ["cmd/hermit/templates/"]entry, since they are scaffold content shipped to user projects, not HERMIT's own control plane.Assumption (Issue was otherwise unambiguous)
None needed — the Issue's required path list, exclusion behavior, and acceptance criteria were fully specified. New requirement was filed as REQUIREMENTS.md REQ-015 (next available REQ-ID after REQ-014) with a REQ-015-named test in
internal/risk/req_test.go, following this repo's existing REQ-ID/test-naming convention.Changes
internal/risk/evaluator.go: extendedDefaultConfig().HighPathswith the six control-plane paths; documented the self-referential guard property in a comment.internal/risk/req_test.go: addedTestREQ015_ControlPlanePathsAreHighRiskcovering all six new HIGH paths at 1 file / 1 line, HIGH-over-MEDIUM priority, a non-control-planeinternal/path staying MEDIUM, and the templates/-only diff staying LOW.internal/risk/evaluator_test.go: updatedTestDefaultConfig_MatchesLegacyHardcodedValues's hardcodedwantHighPathslist, since it directly encoded the old three-entry list this Issue deliberately expands (this is the intended behavior change, not a regression).REQUIREMENTS.md: added REQ-015.README.md: documented control-plane paths as HIGH by default in the Risk Evaluation Criteria table and the example[risk]config.cmd/hermit/templates/harness.toml.tmpl: same documentation update for the template shipped to user projects.Note on this PR's own risk classification
This PR itself modifies
internal/risk/andREQUIREMENTS.md/README.md/harness.toml.tmpl, so under the new rule it will (correctly) evaluate as HIGH risk and requires a human merge decision — this is expected and is the exact self-referential property the Issue asked for.Test plan
go build ./...go test ./...— all packages pass, including new REQ-015 test casesgo vet ./...🤖 Generated with Claude Code