Skip to content

Scope check overrides per protocol, and stop warning about correct ones (#33) - #95

Merged
pseudoseed merged 1 commit into
mainfrom
fix/33-checks-by-protocol
Aug 24, 2026
Merged

Scope check overrides per protocol, and stop warning about correct ones (#33)#95
pseudoseed merged 1 commit into
mainfrom
fix/33-checks-by-protocol

Conversation

@pseudoseed

Copy link
Copy Markdown
Owner

Fixes #33.

porch.checks is one flat map applied to every protocol, and protocols do not declare the same check names. Measured against the skeleton in this repo:

protocol check names
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.

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>.checks states 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 skip silently discarded the global command for the same check — the opposite of what one line of protocol-specific config implies. Keyed by canonical protocol name, so spir and spider are 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 use tests. A literal test override 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. loadProtocol hoists per-phase check objects into a top-level map and rewrites phase.checks to a name list, 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.

Verification

  • 5941 passed, 0 failed (full suite, local)
  • tsc --noEmit clean
  • 14 new tests, including that a BUGFIX-only override does not leak into SPIR and that an alias resolves to the same entry
  • listAllCheckNames run from the built module against this repo, returning all 15 declared names
  • Documented in all four porch skill copies (instance + skeleton, both ecosystems)

🤖 Generated with Claude Code

…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>
@pseudoseed
pseudoseed merged commit b174b68 into main Aug 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

porch.checks has no per-protocol scoping, so valid overrides warn on protocols that lack the check

1 participant