Skip to content

guard postguard-js's 20 required contexts against its ruleset (the other half of #318) #331

Description

@rubenhensen

Question

#318 closed the registry half for postguard: the ruleset-drift job in build.yml reads the live effective rules on main and compares them against the REQUIRED_CHECK constant in pg-core/tests/ci_wiring.rs. postguard-js has the same gap and 20 times the surface — and it is the repo where the wiring guard (postguard-js#222) found both of its own premises stale, so the registry side there is the least-verified part of the fleet.

The credential question is already answered and is not the blocker. #318 measured it: postguard-js is public, so rules/branches/main answers 200 to the built-in GITHUB_TOKEN at any permission level and across repositories — a job in postguard can read postguard-js's ruleset with no secret at all. scripts/ruleset-drift.sh already takes RULESET_REPO and RULESET_EXPECTED and was exercised against postguard-js's live 20 contexts while #318 was open.

What to settle

The real question is where the expected list of 20 lives, because there must be exactly one copy and today it is a REQUIRED_CONTEXTS constant inside packages/pg-js/tests/ci-wiring.test.ts in the other repo:

  1. A job in postguard-js reading its own constant. No cross-repo coupling, one source of truth, but it needs a workflow edit in a repo with eight workflow files — and the dobby-coder App cannot push those, so it lands as a hand-applied patch, which is the exact failure class Gates should assert their own workflow wiring, so an unapplied patch fails loudly #272 exists for.
  2. A job in postguard fetching ci-wiring.test.ts from raw.githubusercontent.com and parsing REQUIRED_CONTEXTS out of it. Free (public, no credential), one source of truth, one place to read results — but it parses another repo's TypeScript by regex, so a reformat there reds a gate here. Note that lands on exit 2 (undetermined), not exit 1 (drift), which is the honest outcome but still noise.
  3. postguard-js commits the list as data (e.g. .github/required-contexts.json) that both its own test and a drift job read. Robust to reformatting and readable by anyone, at the cost of a new file and a change in that repo anyway.

Also decide whether one job should cover both repos or each repo guards itself, now that the cost that motivated "one per repo" (a cross-repo credential) turned out to be zero.

Done when

postguard-js's main ruleset requiring its 20 contexts is asserted somewhere that runs on every merge, with the expected list stored exactly once, and mutation-verified red — the standard #272/#222/#318 all held themselves to.

Part of #247 (workstream C).

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:taskWayfinder ticket: manual work unblocking a decision, or execution under this map

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions