Repository navigation
Description
From #722, where you asked for this to have its own issue, with the design agreed before any code. There's no code here, only what I measured and the questions I'd want settled first.
What happens
When part of a config isn't in force, the CLI says so: each case below prints a notice to stderr and the run carries on. That's by design, and fail-open on inherit_from is documented; I'm not arguing against either. What I measured is where the notice ends up on the other integrations. These are local fixtures, measured on 20 November: this repository at 029bf06 (the only commit since, #724, doesn't touch these paths), commit-check-action at adc0ec2 and commit-check-mcp at f8feca9, both still their heads. "Step log only" and "no notice" mean the run's every stream was captured and the notice was in that one or in none.
| The config says | CLI | pre-commit hook | Action summary, PR comment, result |
MCP result |
|---|---|---|---|---|
inherit_from that can't load (missing file, 404, DNS, refused connection) |
⊘ … could not be loaded: …; continuing with the local config |
Passed; notice hidden |
passed; notice only in the step log | pass; notice only on server stderr |
a parent that has its own inherit_from |
⊘ … is ignored: only one level of inherit_from is followed |
Passed |
passed; step log only | pass; server stderr only |
a misspelt key (subject_max_lenght) |
⚠ unknown setting … is ignored |
Passed |
passed; step log only | pass; no notice |
CCHK_SUBJECT_MAX_LENGTH=abc |
Warning: Invalid value for CCHK_… |
Passed |
passed; step log only | n/a: the server doesn't read CCHK_* |
files = "x" |
⊘ [files] must be a table, …; the file rules are disabled |
Passed |
"Files: skipped", with "no rule is set in the [files] section of the config" | n/a |
[files] max_size = "5M" |
⊘ [files] max_size = '5M' is not usable; CC302 file-size is disabled |
Passed |
"Files: passed" | n/a |
--branch with no branch rule configured |
⊘ --branch requested but no branch rules are configured … |
Passed |
"Branch: passed" | pass, with an empty checks list |
[pull_request] ai_declaration_checkbox (singular) |
nothing; CC501 is off | no hook runs it | "skipped: ai_attribution is "ignore"", though with the key spelt right the same config fails CC501 | n/a |
The hook column shows pre-commit hiding a passing hook's output, as it does by design; with verbose: true every notice showed (14 of 14). The network cases gave the same outcome as the local missing file on every integration, 3 out of 3 runs each. commit-check-ci prints each notice in its log, beside passed.
What already reaches them
ignore_authors and warn do reach the Action and the MCP result. The Action's summary shows "skipped: author … is in [commit].ignore_authors" and "passed with warnings"; the MCP returns skip and a warn check. Those two travel in the result itself, as status: skip with its reason and as the warnings count, and each integration renders them. The cases in the table are printed beside the result, before the engine runs, so nothing downstream has them to render.
A possible shape
This is a sketch to react to, not a proposal to merge. One additive field next to status, warnings and checks, in --format json and the API:
{
"status": "pass",
"warnings": 0,
"checks": ["…"],
"config": {
"inherit_from": {"source": "github:org/.github:commit-check.toml", "loaded": false, "error": "HTTP Error 404: Not Found"},
"notices": [
{"setting": "commit.subject_max_lenght", "notice": "unknown setting, ignored"},
{"setting": "files.max_size", "notice": "'5M' is not usable; CC302 file-size is disabled"}
]
}
}status and the exit code stay as they are, and so do the CLI's stderr lines. unknown_setting_warnings() already returns its list; today it's only printed. The Action could then show a line under the summary the way it shows a skip reason, and put the same in result. The MCP could return it in the structured result. pre-commit can't be changed from here, so for that one I think a line in the pre-commit guide about verbose: true is the most that can be done.
Questions for you
- Shape. A separate field as above, or entries in
checks? A separate field leaves every current consumer unchanged; a check entry would change what a check is. - A parent that didn't load. Should it stay
pass? The documented fail-open says yes. An opt-in that fails the run, for an org that depends on its parent policy, would be a separate decision, and I'm only raising it. - Which parent ran. With
loaded: true, should the result also carry what was loaded, such as the ref or a hash of the bytes?github:org/repo:pathfollows the default branch, so the same commit and config can be judged under a different policy from one day to the next. A hash would at least let two runs show they used the same parent. [pull_request]. The unknown-setting check skips this section because the GitHub App reads the rest of it (config_merger.py:115-118). That's how the singularai_declaration_checkboxturns CC501 off with no line anywhere. Would a list of the keys the App reads let the CLI report the others? Separately, the Action givesai_attribution is "ignore"as the reason for the skip, and in that case it isn't the cause.- A run that checked nothing.
--branchwith no branch rule returnspasswith an emptycheckslist, becauseoverall_status()reads no checks as a pass. Should an empty run beskip, the way a fully skipped run already is? - Order. I'd suggest the core result first, then the Action and the MCP, each in its own repository. The MCP not reading
CCHK_*is a separate issue, and I'd raise it in commit-check-mcp.
I have the captures behind every row and can share any of them.
Activity
shenxianpeng commentedon Nov 21, 2026
Thanks, I reproduced these on 2.23.1 and they match: the notices go to stderr only, so
--format json, the Action's summary andresult, and the MCP result never see them, and every case returnspass. One small difference: with[files] max_size = "5M"as the only file rule, the Action shows "Files: skipped, no rule is set in the [files] section", not "passed". The notice is still lost either way.My answers:
checks. I'd keep it flat: a top-levelnoticeslist, each entry with the setting and the message, and leaveinherit_fromdetails out for now. Fewer new names to commit to.pass, as documented. An opt-in that fails the run can wait until an org asks for it.[pull_request]. Yes. The App reads onlycheck,ai_labelandbody_ai_attribution, and the CLI readsai_declaration_checkboxes, so the CLI can report any other key in that section as unknown. That catches the singularai_declaration_checkbox. You're also right that the Action's "ai_attribution is ignore" reason is wrong in that case; it should only be given when the policy really isignore.checkslist should beskip, the same as a fully skipped run. The exit code stays 0.notices+ unknown[pull_request]keys + empty run asskip), then the Action, then the MCP. Please open theCCHK_*one in commit-check-mcp separately. A line in the pre-commit guide aboutverbose: trueis a good idea too.If you'd like to build the core part, go ahead and I'll review it. Please keep the names as above, and ask here before adding any other new field or key.
invictustitan2 commentedon Nov 21, 2026
Thanks, and you're right about
max_size. My fixture also setprohibited_patterns = ["*.pem"], which the row left out, so "passed" held only for that config. Withmax_sizeas the only rule, the Action's reason "no rule is set" is wrong as well: a rule is set, it just can't be used. I'll take that with theai_attributionreason in the Action part.I'll build the core part. Before I start, here's what I'd do, so you can stop me early:
notices: each entry is{"setting": …, "message": …}.settinguses the form the CLI already prints, such as[files] max_sizeor[commit] subject_max_lenght, and otherwiseinherit_from, theCCHK_*variable's name, or--branch/--files.messageis the stderr line without its leading mark. The stderr lines stay.inherit_fromnot loaded, a nestedinherit_from, an unknown setting, an invalidCCHK_*value,[files]not a table, a[files]value that can't be used, and--branch/--fileswith nothing configured. The--filesone wasn't in my table, but it's the same code. Skip and warning summaries aren't included, sincechecksalready carries them.[pull_request]:check,ai_label,body_ai_attributionandai_declaration_checkboxesare known; any other key is reported, with the closest match.[jira]stays exempt.overall_status()reads no checks asskip. The exit code stays 0, and text output is unchanged.Three things to confirm:
ai_attribution = "ignore",--ai-attribution-onlyreturns no checks, so it becomesskip.ai_toolsis unchanged. Your testtest_ignore_runs_nothing_but_still_names_the_toolsand the policies guide both say it passes. I read your answer as covering this, so I'd change both. Is that right?noticesbe on every result, as an empty list when there are none, likewarnings? Or only when there's at least one?[files]notices itself, so they'd be carried. It doesn't check a passed config dict for unknown keys today. Should it stay that way?I'll open the
CCHK_*issue in commit-check-mcp, and send theverbose: trueline and the guide wording to commit-check.com once the core change is clear.shenxianpeng commentedon Nov 21, 2026
Thanks, this is clean and matches what we agreed in #727. I checked it locally: the JSON result carries all five kinds of notice in the same order as stderr,
[pull_request] ai_declaration_checkboxnow gets the "did you mean" hint, and--fileswith nothing configured givesskipwith exit 0.Answers to your three questions, for the record:
--ai-attribution-onlyunderignorewith noai_declaration_checkboxesset isskip.noticesis always there, as an empty list when there are none.Merging. The Action and MCP parts, and the site pages, can follow as you planned.