Scope check overrides per protocol, and stop warning about correct ones (#33) - #95
Merged
Conversation
…es (#33) porch.checks is one flat map applied to every protocol, and protocols do not declare the same check names. Measured against this skeleton: air build, e2e_tests, pr_exists, tests bugfix build, regression_test, tests maintain build, tests pir build, plan_exists, pr_exists, review_has_*, tests spir/aspir build, e2e_tests, tests, + the artifact checks regression_test is BUGFIX's alone; e2e_tests is absent from BUGFIX, PIR and MAINTAIN. In a repo with no package.json the npm defaults cannot run, so those overrides are required -- and then every porch status on a protocol that does not declare the name printed "Unknown check override". Dropping the override broke the protocol that needed it; keeping it warned on every one that did not. Two halves. The issue offers them as alternatives; they fix different things. The warning now fires only for a name NO protocol anywhere declares. A name another protocol uses is applicable config that this one happens not to use, which is a different statement from "unknown", and the text says so. Without a workspace to check against, the old behaviour stands rather than falling silent -- silence there would turn a real typo into a no-op. And porch.byProtocol.<name>.checks states per-protocol overrides directly, merged field-by-field over the flat map with the per-protocol value winning. Wholesale replacement would mean a per-protocol skip silently discarded the global command for the same check. Keyed by canonical protocol name, so spir and spider are one entry rather than two spellings that can disagree. Reading the check names turned out to need both shapes: loadProtocol hoists per-phase check OBJECTS into a top-level map, so a protocol.json read raw from disk carries them under each phase instead. Reading only the top-level `checks` key found nothing at all in any protocol. Note the issue's own example uses `test`, singular. No protocol in this skeleton declares that name -- they all use `tests` -- so a literal `test` override still warns, correctly. Documented in all four porch skill copies. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Fixes #33.
porch.checksis one flat map applied to every protocol, and protocols do not declare the same check names. Measured against the skeleton in this repo:build,e2e_tests,pr_exists,testsbuild,regression_test,testsbuild,testsbuild,plan_exists,pr_exists,review_has_*,testsbuild,e2e_tests,tests, + the artifact checksregression_testis BUGFIX's alone;e2e_testsis absent from BUGFIX, PIR and MAINTAIN. In a repo with nopackage.jsonthe npm defaults cannot run, so those overrides are required — and then everyporch statuson a protocol that does not declare the name printed⚠ Unknown check override. Dropping the override broke the protocol that needed it; keeping it warned on every one that did not.Both halves, because they fix different things
The warning now fires only for a name no protocol anywhere declares. A name another protocol uses is applicable config that this one happens not to use — a different statement from "unknown", and the text now says
not declared by any protocol. Without a workspace to check against, the old behaviour stands rather than falling silent: silence there would turn a real typo into a no-op.porch.byProtocol.<name>.checksstates per-protocol overrides directly:{ "porch": { "checks": { "build": { "command": "./infra/render.sh" } }, "byProtocol": { "bugfix": { "checks": { "regression_test": { "skip": true } } } } } }Merged field-by-field over the flat map, per-protocol winning. Wholesale replacement would mean a per-protocol
skipsilently discarded the globalcommandfor the same check — the opposite of what one line of protocol-specific config implies. Keyed by canonical protocol name, sospirandspiderare one entry rather than two spellings that can disagree.A correction to the issue
The issue's example uses
test, singular. No protocol in this skeleton declares that name — they all usetests. A literaltestoverride still warns, correctly. The mechanism the issue describes is real; the example name is not one of the cases.Found while implementing
Reading the check names needs both JSON shapes.
loadProtocolhoists per-phase check objects into a top-level map and rewritesphase.checksto a name list, so aprotocol.jsonread raw from disk carries them under each phase instead. Reading only the top-levelcheckskey found nothing at all, in any protocol.Verification
tsc --noEmitcleanlistAllCheckNamesrun from the built module against this repo, returning all 15 declared names🤖 Generated with Claude Code