Skip to content

fix(proof): reconcile successful mediated HEAD abort - #450

Merged
bizzybee90 merged 5 commits into
mainfrom
codex/fix-product-proof-mediated-head-reconciliation-20260809
Aug 9, 2026
Merged

fix(proof): reconcile successful mediated HEAD abort#450
bizzybee90 merged 5 commits into
mainfrom
codex/fix-product-proof-mediated-head-reconciliation-20260809

Conversation

@bizzybee90

@bizzybee90 bizzybee90 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Purpose

Reconcile the one proven successful bodyless HEAD lifecycle from governed staging run 31310002086: both observers recorded matching successful responses, the existing bounded CDP-abort rule completed the CDP side, and Playwright mediation then emitted its corresponding aborted terminal.

Included scope

  • Add an explicit per-request marker set only by the existing successful bodyless HEAD CDP-abort exception.
  • Complete the mediated side only when the later failure is the exact matching aborted terminal for that marked request.
  • Add proof-first and adversarial regressions for the accepted order and every material wider/incomplete shape.
  • Amend ADR 0033 and its lifecycle diagram to document the ordered, fail-closed boundary.

Explicit exclusions

  • No general ERR_ABORTED or cancelled-fetch allowance.
  • No acceptance of reverse terminal order, ordinary cdp-finished, GET/XHR/body-bearing requests, missing or unequal responses, non-2xx responses, duplicate terminals, or incomplete HTTP teardown.
  • No app runtime, schema, migration, dependency, workflow, provider, billing, credential, customer-data, staging-schema, public-signup, or production change.

Architecture placement

Current owner / directory:

The governed product-proof live network recorder in scripts/product-proof-live-evidence.mjs; the boundary is documented in ADR 0033.

Dependencies and duplicate-system check:

The change extends the existing dual-observer bodyless-HEAD exception and does not add another recorder, retry layer, or request policy.

Security and tenancy impact

  • Authentication / authorization: none; request admission and credential posture are unchanged.
  • Tenant isolation: unchanged; the governed two-tenant proof and cleanup contracts remain mandatory.
  • Service-role impact: none.
  • Provider / webhook impact: none.
  • Secrets impact: accepted evidence contains only fixed event codes and an opaque correlation token; adversarial tests prove raw request IDs, URLs and credentials are not exposed.

Data impact

  • Schema / migration / RLS / grant impact: none.
  • Backfill, retention, or rollback: none; rollback is the protected squash commit.

Verification

  • Behavioural tests: proof-first regression failed on the unchanged base; final recorder suite 45/45 passed; adjacent browser/network/evidence suites 262/262 passed; reverse order, ordinary CDP completion, pre-response abort, GET/XHR/body/non-2xx/missing/mismatched/duplicate/incomplete cases remain stopped.
  • CI / security review: scoped ESLint, Node syntax, diff and redaction checks passed; independent security audit found zero findings; final local CodeRabbit exact-diff review reported no new findings. Hosted clean-install CI is authoritative for the full repository suite.

Release safety

  • Deployment scope: source PR only. After protected merge, only an exact-SHA private Cloudflare preview and governed synthetic staging proof are authorized. Production is not authorized.
  • Monitoring / stop conditions: stop on any failed protected gate, wider accepted abort shape, cleanup/postflight/recovery failure, unresolved review, secret exposure, production/provider/schema mutation, or exact-head drift.
  • Rollback or containment: do not merge unless every exact-head gate is green; failed staging proof remains diagnostic only, writes no accepted evidence, and must complete cleanup/recovery.

Documentation and generated files

  • Docs / diagrams / ADR updates: ADR 0033 text and Mermaid HTTP teardown lifecycle updated.
  • Generated-file or lockfile justification: none.

Completion check

  • Starts from current origin/main (cbbc2c2ce95d57c900796e4a5bf5c9a4c01d307a).
  • No valuable work remains only in a dirty worktree, stash, or local-only branch after publication.
  • Source branch will be retired under the branch policy after merge.
  • Any PR-size or branch-retention exception is documented below, or neither applies.

Policy exceptions (leave blank when none apply)

PR-size exception rationale:

Retained branch reason / owner / review date / maximum retention date:

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of qualifying bodyless HEAD requests when browser and mediated abort signals arrive in sequence.
    • Invalid, duplicate, incomplete, or mismatched completion events continue to fail safely.
    • Preserved secure, secret-free evidence when request processing stops.
  • Tests

    • Added coverage for valid and invalid abort ordering, response requirements, duplicate events, and exact HEAD request matching.
  • Documentation

    • Documented the updated request completion sequence and security implications.

@bizzybee90
bizzybee90 temporarily deployed to release-status-ledger-writer August 9, 2026 11:43 — with GitHub Actions Inactive
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 23729d2e-50f0-416f-b82e-2d7c0582694b

📥 Commits

Reviewing files that changed from the base of the PR and between a5be223 and 47aedc5.

📒 Files selected for processing (1)
  • scripts/product-proof-live-evidence.test.mjs

📝 Walkthrough

Walkthrough

The change updates bodyless HEAD abort reconciliation. Qualifying CDP aborts set a per-request marker. A later mediated terminal completes the lifecycle only when the sequence and responses match. Tests cover valid and fail-closed paths.

Changes

Bodyless HEAD abort reconciliation

Layer / File(s) Summary
Request eligibility and completion state
scripts/product-proof-live-evidence.mjs
The flow identifies bounded HEAD requests, requires matching successful responses, and tracks CDP abort completion.
Ordered terminal reconciliation
scripts/product-proof-live-evidence.mjs, docs/adr/0033-authenticated-staging-browser-process-secret-boundary.md
A qualifying CDP abort sets a marker. A later mediated normal finish or matching abort completes the lifecycle. Invalid and incomplete sequences remain fail-closed.
Sequence and terminal validation
scripts/product-proof-live-evidence.test.mjs
Tests cover successful reconciliation, invalid ordering, request and response bounds, duplicate terminals, diagnostics, and stopped finalization.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CDP
  participant HTTPCorrelation
  participant MediatedObserver
  participant Evidence
  CDP->>HTTPCorrelation: qualifying HEAD aborted terminal
  HTTPCorrelation->>HTTPCorrelation: set per-request completion marker
  HTTPCorrelation->>Evidence: emit CDP completion event
  MediatedObserver->>HTTPCorrelation: later mediated terminal
  HTTPCorrelation->>Evidence: finalize reconciled lifecycle
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: reconciling successful mediated HEAD aborts.
Description check ✅ Passed The description follows the repository template and covers scope, security, verification, release safety, documentation, and completion status.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-product-proof-mediated-head-reconciliation-20260809

Comment @coderabbitai help to get the list of available commands.

@coderabbitai
coderabbitai Bot temporarily deployed to release-status-ledger-writer August 9, 2026 11:44 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 1656-1674: Extend the loop covering the widened GET and xhr
request shapes with a second attempt that records both 2xx responses, then emits
a cdp-failed terminal with aborted status. Assert that this path is refused with
the fixed stop code, while preserving the existing cdp-finished assertions and
teardown checks.
🪄 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: a7ec0ce2-94be-4e2b-99f7-413ad2bbc6b7

📥 Commits

Reviewing files that changed from the base of the PR and between cbbc2c2 and a5be223.

📒 Files selected for processing (3)
  • docs/adr/0033-authenticated-staging-browser-process-secret-boundary.md
  • scripts/product-proof-live-evidence.mjs
  • scripts/product-proof-live-evidence.test.mjs

Comment thread scripts/product-proof-live-evidence.test.mjs
@bizzybee90
bizzybee90 temporarily deployed to release-status-ledger-writer August 9, 2026 11:51 — with GitHub Actions Inactive
@coderabbitai
coderabbitai Bot temporarily deployed to release-status-ledger-writer August 9, 2026 11:51 Inactive
@bizzybee90
bizzybee90 merged commit f6ef025 into main Aug 9, 2026
11 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.

1 participant