Skip to content

ci: ratify backend/security invariant registry in make check and CI#183

Closed
devitway wants to merge 1 commit into
mainfrom
ci/contract-gate
Closed

ci: ratify backend/security invariant registry in make check and CI#183
devitway wants to merge 1 commit into
mainfrom
ci/contract-gate

Conversation

@devitway

Copy link
Copy Markdown
Contributor

Adds scripts/contracts/: a hand-authored registry (contracts.json, 89 invariants) of authz / multi-tenant isolation / SSRF / fail-closed / write-atomicity / SQL-injection properties, plus a deterministic gate (pusk_contract_gate.py) that ratifies it against the working tree.

Teeth (each → exit 1): DRIFT (a contract's code anchor vanished), REGRESSION (a guard was removed or a guarded function renamed away), NEW BLIND SPOT (a new unenforced gap not in gap-baseline). Complements the existing frontend/coherence linters, which do not cover backend security invariants. Two known gaps are baselined and visible (addressed by separate fix PRs).

Wired into make check (new contracts target) and the CI build job.

Add scripts/contracts/: a hand-authored registry (contracts.json, 89
invariants) of authz / multi-tenant isolation / SSRF / fail-closed /
write-atomicity / SQL-injection properties, plus a deterministic gate
(pusk_contract_gate.py) that ratifies it against the working tree.

Teeth: DRIFT (a contract's code anchor vanished), REGRESSION (a guard
was removed or a guarded function renamed away), and NEW BLIND SPOT (a
new unenforced gap not in gap-baseline). Complements the existing
frontend/coherence linters, which do not cover backend security
invariants. One known gap is baselined and visible (addressed by a
separate fix PR).

One contract documents that markChannelRead is intentionally open to
non-subscribers (feature #101, unread badges for unsubscribed channels)
and fails if a membership guard is ever added there.

Wire it into 'make check' (new contracts target) and the CI build job.
@devitway

Copy link
Copy Markdown
Contributor Author

Closing — keeping this check in the local maintainer workflow rather than vendoring it into the repo.

@devitway devitway closed this Jun 16, 2026
@devitway devitway deleted the ci/contract-gate branch June 16, 2026 10:19
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.

1 participant