Repository navigation
Backlog
Labels
bugSomething isn't workingepic:preflightPreflight answer: make every AI agent want Charter's governancepriority:p2Nice to have this cycle
Description
Problem
charter classify matches the commit subject against regexes (classify/src/index.ts). Changes that are major-version breaks under core.adf's contract rules come out as the lowest-risk classes:
| Subject | Result |
|---|---|
fix(cli): rename verdict to status in adf evidence JSON |
SURFACE ("rename" matches a surface pattern) |
fix(cli): exit 2 instead of 1 when evidence ceiling exceeded |
LOCAL |
change API contract for evidence |
CROSS_CUTTING (only because the word "contract" appears) |
Reproduced at pinned 5412100.
Expected
- Short term: a subject naming a JSON field, exit code or output-format change is never SURFACE. "rename" plus a contract noun outranks the rename-is-cosmetic pattern.
- Better: a
--diff/ staged mode that classifies from the changed files using contract-pin detection (Detect when a file's behaviour is pinned by a contract test, and say what a change means for semver #445), so the class doesn't depend on how a subject is worded.
Acceptance
Both example subjects above classify as CROSS_CUTTING. A diff touching a contract-pinned file classifies as CROSS_CUTTING whatever its subject says.
Works on its own. Part of #437.
Coordination with existing issues
- Make governance trailers meaningful: resolve references and allow per-repo risk patterns #292 (per-repo risk patterns): Charter already has two risk systems:
classify(SURFACE/LOCAL/CROSS_CUTTING) andHIGH_RISK_PATTERNSinpackages/git/src/risk.ts. The diff mode here must reuse the configurable risk patterns Make governance trailers meaningful: resolve references and allow per-repo risk patterns #292 proposes (git.riskPatternsin.charter/config.json) plus contract-pin detection (Detect when a file's behaviour is pinned by a contract test, and say what a change means for semver #445). It must not introduce a third path list. If Make governance trailers meaningful: resolve references and allow per-repo risk patterns #292 lands first, build on it; if this lands first, put the path config where Make governance trailers meaningful: resolve references and allow per-repo risk patterns #292 proposes. - hook: commit-msg gate does not apply CI's HIGH-risk unlinked-commit check #342 (hook vs CI HIGH-risk check): a staged-diff mode is the capability hook: commit-msg gate does not apply CI's HIGH-risk unlinked-commit check #342 needs to apply CI's HIGH-risk check in the commit hook. Design it so the hook and
validate --cicall the same classifier and can't disagree.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingepic:preflightPreflight answer: make every AI agent want Charter's governancepriority:p2Nice to have this cycle
Activity