feat(activation): policy-hash generator for Gate 13 and Gate 16 - #323
Open
theonlygeranium wants to merge 1 commit into
Open
theonlygeranium wants to merge 1 commit into
theonlygeranium wants to merge 1 commit into
Conversation
Deploying vinifera with
|
| Latest commit: |
28e2651
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8ef2c216.vinifera.pages.dev |
| Branch Preview URL: | https://cursor-gate-activation-polic.vinifera.pages.dev |
theonlygeranium
marked this pull request as ready for review
August 7, 2026 10:08
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
The Gate 13 (ShipCompliant) and Gate 16 (custom hostname) acceptance
controllers fail closed unless each *Sha256 policy array holds the SHA-256 of
the exact, normalized target. Hand-computing those with the controllers' precise
origin/path/hostname normalization is the most error-prone step in the
activation runbooks.
Add scripts/gate-policy-hash.mjs (npm run ops:gate-policy-hash) with subcommands:
- gate13: reads the workflow's SHIPCOMPLIANT_*/SUPABASE_URL/STAGING_WORKER_ORIGIN
env values and prints a paste-ready policy object.
- gate16: derives the policy object from an acceptance manifest JSON.
- manifest-sha256: computes the manifest byte hash for the
STAGING_GATE1{3,6}_ACCEPTANCE_MANIFEST_SHA256 secrets.
It reuses each controller's own sha256 + normalization (the two pure Gate 13
normalizers exactHttpsOrigin/exactApiPath are now exported) so generated hashes
cannot drift from the controllers' fail-closed checks. Read-only: prints only
hashes, no network, no mutation. Runbooks updated to reference it at their
hashing steps.
Autonomous, non-Gate-8 work per the remaining-gates manifest; does not create
provider resources, dispatch workflows, or change gate status (13 and 16 remain
pending).
Verification: npm run ... gate-policy-hash tests 5/5; gate13+gate16 controller
suites 24/24 (exports intact); node --test .github/scripts/*.policy.mjs 77/77;
full vitest 774 pass with 3 known cold-start octopus-runbook timeouts that pass
warm (--testTimeout=60000 -> 38/38).
Co-authored-by: theonlygeranium <theonlygeranium@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/gate-activation-policy-hash-fefb
branch
from
August 7, 2026 10:10
4a8c664 to
28e2651
Compare
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.
Summary
Adds a small, safe, tested helper that removes the most error-prone manual step in the Gate 13 (ShipCompliant) and Gate 16 (custom hostname) activation runbooks: computing the exact SHA-256
*Sha256policy entries the acceptance controllers fail-closed check. Chosen as autonomous, non-Gate-8 work perdocs/activation/remaining-gates-manifest.md; it does not create provider resources, dispatch workflows, or change any gate status (13 and 16 remainpending).New:
scripts/gate-policy-hash.mjs(npm run ops:gate-policy-hash)gate13SHIPCOMPLIANT_*,SUPABASE_URL,STAGING_WORKER_ORIGINenv valuesconfig/shipcompliant-staging-acceptance-policy.jsonobjectgate16 --manifest <file>config/gate16-custom-hostname-acceptance-policy.jsonobjectmanifest-sha256 --manifest <file>STAGING_GATE1{3,6}_ACCEPTANCE_MANIFEST_SHA256Why it's correct and safe
sha256+ normalization, so generated hashes cannot drift from what the controller checks. The two pure Gate 13 normalizers (exactHttpsOrigin,exactApiPath) are nowexported for reuse — a behavior-preserving change (controller suites still green).authorize()and asserts it is accepted — a strong anti-drift cross-check.Deployment impact: operator tooling + docs only. No application route, provider, database, credential, billing, DNS, Worker activation, or gate status change.
Type of change
Evidence level
npx vitest run tests/scripts/gate-policy-hash.test.mjs→ 5 passed (incl. theauthorize()cross-check)node --test .github/scripts/*.policy.mjs→ 77 passednpm test→ 774 passed; 3 failures are the known cold-start 5s timeouts intests/scripts/octopus-runbook.test.mjs(unrelated; pass warm —--testTimeout=60000→ 38/38)ops:gate-policy-hash gate13emits a valid policy object--staged→ lanehigh-risk, riskmediumClassifier and test selection
package.json)Logical delivery contract
[Unreleased]changelog entrydevwill squash to one logical Conventional CommitEnvironment and activation
Activation gates affected: None (Gates 13 and 16 remain pending; this only eases populating their policies)
human-review-requirednordo-not-mergeis presentRisks, rollback, and assumptions
Low risk; adds one helper + one npm script + tests, exports two pure functions, and updates two runbooks. Rollback = revert. Assumes the two acceptance controllers remain the source of truth for normalization (reused directly, so they stay authoritative).