fix(proof): bound workspace binding preflight repeats - #462
Merged
bizzybee90 merged 2 commits intoAug 10, 2026
Merged
Conversation
bizzybee90
temporarily deployed
to
release-status-ledger-writer
August 10, 2026 08:38 — with
GitHub Actions
Inactive
📝 WalkthroughWalkthroughThe product-proof scripts now recognize authenticated ChangesWorkspace user-binding evidence
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant LiveEvidence
participant NetworkPolicy
participant Realtime
Browser->>LiveEvidence: Send workspace-user-binding GET and managed OPTIONS requests
LiveEvidence->>NetworkPolicy: Classify requests with expected user identity
NetworkPolicy-->>LiveEvidence: Return canonical request and preflight occurrence matches
LiveEvidence->>LiveEvidence: Track preflight and base-request completion
LiveEvidence->>Realtime: Finalize validated evidence
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
coderabbitai
Bot
temporarily deployed
to
release-status-ledger-writer
August 10, 2026 08:39
Inactive
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/product-proof-live-evidence.test.mjs`:
- Around line 2608-2623: Remove the duplicate preflightFor definition near the
later test and hoist one module-scope preflightFor helper shared by both tests.
Preserve its existing label default and preflight request shape, and update both
test sections to call the shared helper.
In `@scripts/product-proof-network-policy.mjs`:
- Around line 515-529: The canonical workspace-user-binding contract is
duplicated across three sites; export one shared descriptor and derive each site
from it. In scripts/product-proof-network-policy.mjs lines 515-529, replace the
inline comparison and provide the descriptor’s maxOccurrences to
addCommonAuthenticatedRequests. In scripts/product-proof-live-evidence.mjs lines
702-725, derive the URL, headers, and occurrence bounds from that descriptor. In
scripts/product-proof-network-policy.test.mjs lines 675-677, assert against the
exported descriptor instead of restating the occurrence rule.
In `@scripts/product-proof-network-policy.test.mjs`:
- Around line 650-656: Update the repeatable-preflight assertion in the test to
sort the mapped actual labels before comparing them with the expected labels.
Keep the existing filter and expected label set unchanged so the assertion
remains independent of request insertion order.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: a2d8678e-9891-412e-aed5-d6eb4b4d0571
📒 Files selected for processing (4)
scripts/product-proof-live-evidence.mjsscripts/product-proof-live-evidence.test.mjsscripts/product-proof-network-policy.mjsscripts/product-proof-network-policy.test.mjs
bizzybee90
temporarily deployed
to
release-status-ledger-writer
August 10, 2026 08:52 — with
GitHub Actions
Inactive
bizzybee90
temporarily deployed
to
release-status-ledger-writer
August 10, 2026 08:54 — with
GitHub Actions
Inactive
bizzybee90
temporarily deployed
to
release-status-ledger-writer
August 10, 2026 08:54 — with
GitHub Actions
Inactive
coderabbitai
Bot
temporarily deployed
to
release-status-ledger-writer
August 10, 2026 08:55
Inactive
6 tasks
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.
Purpose
Repair the exact fail-closed blocker from governed proof run 31369456189: a second valid
workspace-user-binding-optionslifecycle exhausted a one-shot OPTIONS policy while its exact base GET is source-owned with max 2.Included scope
workspace-user-bindingGET: exact user-bound Supabase REST URL/query ordering, GET/fetch/null body, min 1/max 2, and exactaccept-profileplus app-origin identity.workspace-user-binding-optionspolicy to use min 0/max 2.authenticated-user-optionsat 4 and every other OPTIONS policy at 1.Exact evidence
Run 31369456189, source
476c2116d6725a7e69edf3622484825fbaad2985, stopped at tenant-a / home / desktop withworkspace-user-binding-options → policy_occurrence_exhausted. Cleanup, explicit postflight, and independent recovery passed. Tenant B was absent, tenant A unchanged, protected surfaces zero, provider/production flags false, and no proof artifact was published.Explicit exclusions
No generic
options.max = base.max, label-suffix matching, wildcard/subset identity, extra occurrences for workspace-record or any other policy, timeout/global-limit changes, app behavior, workflow/gate, dependency, schema, credential, provider, billing, customer, staging, or production mutation.Architecture placement
Current owner / directory: existing product-proof network policy and live evidence under
scripts/; no new subsystem.Dependencies and duplicate-system check: extends the existing collector/recorder and replaces three duplicated canonical workspace-binding constants with one primitive-only frozen descriptor. Producer and recorder still independently construct and validate dynamic user, URL, origin, and header identity.
Security and tenancy impact
Data impact
Verification
46b5b8ccgates and CodeRabbit rereview are mandatory.Release safety
476c2116d6725a7e69edf3622484825fbaad2985/ manifest4afe27ea36469c6c97023f064c03e008090a1ecebf47d4d8fecc06d060b22add; no production action.Documentation and generated files
Completion check
origin/main.Policy exceptions (leave blank when none apply)
PR-size exception rationale: four files and one coherent safety fix; total PR is 635 insertions/31 deletions, slightly above the normal 400–600 guideline because 467 inserted lines are adversarial lifecycle and privacy tests required to prove the narrow exception cannot widen.
Retained branch reason / owner / review date / maximum retention date:
Summary by CodeRabbit
Bug Fixes
Tests