Skip to content

docs(proposals): dos-me extension observation quarantine (m2) - #1608

Merged
JOY (JOY) merged 4 commits into
devfrom
docs/1606-dos-me-extension-observations
Nov 4, 2026
Merged

JOY (JOY) merged 4 commits into
devfrom
docs/1606-dos-me-extension-observations

Conversation

@JOY

@JOY JOY (JOY) commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1606

Draft DOS-Me migration for milestone M2 of Docs/Proposals/2026-10-28-extension-data-source.md: the quarantine for ExtensionObservation v1, with the contract's Revision 2. Nothing is applied anywhere. The apply goes through DOS-Me after JOY approves it.

What it adds

  • Docs/Proposals/2026-11-04-dos-me-extension-observations.sql: one idempotent transaction.
    • rate.extension_ingest_secret (one private row, the sha256 of the web's ingest key; the migration inserts no row), rate.extension_submitters (with network_hash) and rate.extension_observations (one checked column per payload key, received_at, network_hash, status).
    • RLS on all three, not forced; anon and authenticated get no table privilege; service_role everything; rate_worker reads submitters and observations and updates status only.
    • register_extension_submitter(key, network_hash) and submit_extension_observation(key, submitter, observation, network_hash) check the ingest key (42501, DETAIL ingest_key) and require the network hash. delete_extension_submitter takes no key. purge_extension_observations(28, 180, 7) is for service_role only. All four are SECURITY DEFINER with search_path = ''.
    • Limits: 20 registers an hour per network and 600 a minute in all; 120 observations an hour per submitter and 600 per network. Every count runs under a lock.
    • The purge locks empty submitters first and deletes them under a fresh check, so a concurrent submit is never cascaded away.
  • -verify.sql (V1 to V12 return 0; V13 is retention information), -rollback.sql, and a .md covering the ingest key, privacy, order, rating impact (none), limits and the apply runbook.
  • scripts/test-extension-observations-proposal.mjs: Docker replay. It checks that the RPC and parseExtensionObservationV1 reach the same verdict and field on 160 payloads. It also covers the ingest key, the exact limit thresholds, delete, the purge and its race, grants, rollback and re-apply.
  • .gitignore exceptions for the three .sql files, and a CI step after the @repo/shared-data build.

Test

pnpm --filter @repo/shared-data build && node scripts/test-extension-observations-proposal.mjs passes locally on Docker PostgreSQL 17 when built with the validator from the code branch. This CI step fails until the code PR adding packages/shared-data/src/rules/extension-observation.ts is in dev and this branch is rebased on it.

🤖 Generated with Claude Code

Draft DOS-Me migration for ExtensionObservation v1 (#1606). Nothing is applied.

- rate.extension_submitters and rate.extension_observations, RLS on, no anon or
  authenticated table access, rate_worker reads and updates status only.
- register, submit, delete and purge RPCs, security definer with an empty search_path,
  with the contract's SQLSTATEs and DETAILs, limits and 28/180 day retention.
- Verify and rollback files, and a Docker replay that exercises every RPC, the grants,
  the rollback and a re-apply.

Refs #1606

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude 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.

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
rate Ready Ready Preview Nov 4, 2026 7:18am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3bdb5a0c-abd4-4e3a-8c66-d5c3bf535da2
Commits

Reviewing files that changed from the base of the PR and between d627634 and 04dd3e3.

Files selected for processing: 7
  • .github/workflows/ci.yml
  • .gitignore
  • Docs/Proposals/2026-11-04-dos-me-extension-observations-rollback.sql
  • Docs/Proposals/2026-11-04-dos-me-extension-observations-verify.sql
  • Docs/Proposals/2026-11-04-dos-me-extension-observations.md
  • Docs/Proposals/2026-11-04-dos-me-extension-observations.sql
  • scripts/test-extension-observations-proposal.mjs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the docs Documentation changes label Nov 4, 2026
dos[bot]
dos Bot approved these changes Nov 4, 2026

@dos dos 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.

⏱️ Code Review completed (6 eligible files · 73,883 chars · 1 model call(s) · 3 PR unit(s))

Whole diff with bounded context at base 8919776 / head f375dd6.

✅ CLEAN_PASS: Complete diff reviewed

…mits

Applies Revision 2 of the M2 contract (#1606). Nothing is applied.

- rate.extension_ingest_secret: register and submit check the sha256 of an ingest key
  (42501, DETAIL ingest_key); the network hash is required in both.
- Register: 20 an hour per network hash, then the global brake under an advisory lock;
  submitters keep their network hash.
- Purge: empty submitters after 7 days, locked first and deleted under a fresh check.
- DETAIL observation for an unknown key; presence checked per field in the validator order;
  semicolons and JavaScript spaces refused in listing_url.
- Verify: owner, no forced RLS, column list, limits in the bodies, no grants on the key.
- Replay: parity with parseExtensionObservationV1, exact thresholds, ingest key, the purge
  race; wired into CI after the shared-data build.

Refs #1606

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the ci CI/CD workflows and pipelines label Nov 4, 2026
dos[bot]
dos Bot approved these changes Nov 4, 2026

@dos dos 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.

⏱️ Code Review completed (7 eligible files · 102,031 chars · 3 model call(s) · 4 PR unit(s))

Whole diff with bounded context at base 8919776 / head 72b1329.

✅ CLEAN_PASS: Complete diff reviewed

Context investigation was bounded to the explicitly requested snapshot paths.

Re-review fixes for the M2 quarantine proposal (#1606). Nothing is applied.

- Purge clears submitter hashes before observation hashes, the lock order of delete, so a
  delete during a purge waits instead of deadlocking. The replay stalls a purge, runs a delete
  in the middle, and fails with the old order.
- The key row cannot hold the sha256 of the empty string, and register and submit refuse a
  missing key or one under 32 characters (42501, DETAIL ingest_key).
- observed_at: seconds 00 to 59 and offsets up to 15:59, as Postgres parses them.
- The .md runbook is written for the applying session: CSPRNG key, printf hash, Vercel
  secrets, apply, row, verify, then the flag; rotation is a hard cut.

Refs #1606

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dos[bot]
dos Bot approved these changes Nov 4, 2026

@dos dos 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.

⏱️ Code Review completed (7 eligible files · 109,130 chars · 3 model call(s) · 4 PR unit(s))

Whole diff with bounded context at base 8919776 / head 17e4dc6.

✅ CLEAN_PASS: Complete diff reviewed

Context investigation was bounded to the explicitly requested snapshot paths.

@dos

dos Bot commented Nov 4, 2026

Copy link
Copy Markdown

⏸️ DOS Review: Automatic Review Limit Reached

DOS Code Review already reviewed 3 commits of this pull request automatically, the limit for one pull request, so this commit was not reviewed automatically and nothing was charged. Please step back before pushing another fix: a pull request that needs this many review rounds usually needs a rethink of its approach or a smaller scope, not one more patch. When you are ready, a maintainer can comment /review to review the current commit.

@JOY
JOY (JOY) merged commit 59676e6 into dev Nov 4, 2026
14 of 15 checks passed
@JOY
JOY (JOY) deleted the docs/1606-dos-me-extension-observations branch November 4, 2026 07:26

This branch was successfully deployed

1 active deployment
Preview — 04dd3e31 Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci CI/CD workflows and pipelines docs Documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant