Skip to content

feat: stage publisher signal indexes - #3501

Draft
jesse-merhi wants to merge 2 commits into
mainfrom
jesse/stage-signal-indexes
Draft

feat: stage publisher signal indexes#3501
jesse-merhi wants to merge 2 commits into
mainfrom
jesse/stage-signal-indexes

Conversation

@jesse-merhi

@jesse-merhi jesse-merhi commented Aug 21, 2026

Copy link
Copy Markdown
Member

"## What Problem This Solves\n\nThe Signals workflow needs four new Convex indexes, but querying an index in the same production deployment that first creates it can race index backfill.\n\n## Why This Change Was Made\n\nThis prerequisite adds the indexes in staged mode without switching any production query to them. The dependent Signals PR can be deployed only after Convex reports all four staged indexes backfilled.\n\n## User Impact\n\nThere is no user-visible behavior change in this PR. It is an operational safety step for the Signals rollout.\n\n## Validation\n\n- bunx tsc --noEmit: passed.\n- The full stacked head passed bun run ci:static, bun run ci:unit, bun run ci:types-build, and bun run ci:packages.\n- bunx convex dev --once: passed against development deployment admired-dodo-615; no production deployment or backfill was started.\n\nDeployment gate: deploy this PR first, wait for both staged indexes to finish backfilling, then deploy #3493. Do not merge or deploy the dependent query switch first.\n\nReview status: draft. Sign-off has not been requested."

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
clawhub Ready Ready Preview Aug 21, 2026 9:14pm

Request Review

@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge. Reviewed August 22, 2026, 3:43 PM ET / 19:43 UTC.

ClawSweeper review

What this changes

This PR adds three optional publisher-signal fields and four staged Convex indexes as a prerequisite for later traffic-signal queries.

Merge readiness

Blocked by patch quality or review findings - 5 items remain

Keep open: the staged-index approach is appropriate, but the branch still adds an unsupported persisted attention lifecycle that the moderation contract explicitly forbids.

Priority: P2
Reviewed head: b0cdd14de2e7fc882a9479f5172251e94475e4b8

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The index staging is focused, but the unresolved P1 contract violation prevents merge readiness.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored internal schema prerequisite has no directly user-visible behavior; staged-index backfill confirmation is the relevant operational evidence.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored internal schema prerequisite has no directly user-visible behavior; staged-index backfill confirmation is the relevant operational evidence.
Evidence reviewed 4 items Explicit moderation contract: The repository specification limits Signals to open, snoozed, and dismissed and expressly prohibits a separate escalation state.
Current main lifecycle implementation: Current main validates only the three review states and its query, mutation, dashboard, and UI paths use reviewStatus rather than a separate attention lifecycle.
Patch and review continuity: The unchanged reviewed head adds attentionState, needsAttention, and their staged indexes; this is the same unresolved P1 concern from the prior completed review cycle.
Findings 1 actionable finding [P1] Remove the unsupported Signals escalation state
Security None None.

Live Verification

Command: bunx tsc -p packages/schema/tsconfig.json --noEmit --listFiles

Result: FAIL (partial) — step 2 expect_output convex/schema.ts: expected terminal output was not visible within 30 seconds: "convex/schema.ts"

/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.scripthost.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.core.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.collection.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.generator.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.iterable.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.promise.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.proxy.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.reflect.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.wellknown.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.array.include.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.intl.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.arraybuffer.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.date.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.object.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.sharedmemory.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.string.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.intl.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.typedarrays.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asyncgenerator.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asynciterable.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.intl.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.promise.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.regexp.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.array.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.object.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.string.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.symbol.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.intl.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.bigint.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.date.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.promise.d.ts
/tmp/clawsweeper-live-proof-3501-eICSuH/target/node_modules/@typescript/typescript-linux-x64/l
… output truncated …

Assertions:

  • FAIL expect_output: convex/schema.ts

How this fits together

Publisher-abuse scans store durable signals in Convex for staff moderation. The staged indexes prepare those records for a later Signals query rollout and ultimately feed the staff review queue.

flowchart LR
  A[Publisher traffic data] --> B[Abuse scan]
  B --> C[Publisher signal records]
  C --> D[Staged Convex indexes]
  D --> E[Later Signals queries]
  E --> F[Staff review queue]
Loading

Before merge

  • Remove the unsupported Signals escalation state (P1) - The explicit Signals contract permits only open, snoozed, and dismissed, with no separate escalation state. These persisted fields and their indexes establish a parallel lifecycle that no current write, audit, queue, or UI path owns; remove them from this index-only prerequisite. This remains unresolved at the unchanged previously reviewed head.
  • Resolve merge risk (P1) - Persisting and indexing attentionState/needsAttention creates a second moderation lifecycle without matching write paths, audit events, queue semantics, or an approved contract.
  • Complete next step (P2) - The blocker is a small, source-proven schema-only repair; the established moderation specification already determines the required direction.
  • Improve patch quality - Remove the two unsupported lifecycle fields and their coupled indexes.
  • Improve patch quality - Before the dependent query switch, deploy the remaining staged indexes and record that Convex completed their backfill.

Findings

  • [P1] Remove the unsupported Signals escalation state — convex/schema.ts:4095-4123
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Schema scope 27 added, 0 removed; 3 optional fields and 4 staged indexes The one-file prerequisite is narrow, making removal of the unsupported lifecycle portion a focused repair.

Merge-risk options

Maintainer options:

  1. Remove the unsupported lifecycle fields (recommended)
    Drop attentionState, needsAttention, and their two coupled staged indexes so this remains a narrow index-backfill prerequisite.
  2. Propose a complete lifecycle change
    If a separate attention workflow is intended, first update the moderation contract and add corresponding write, audit, queue, and review proof before merging it.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Remove attentionState, needsAttention, and their coupled staged indexes; preserve only indexes required by the approved Signals query rollout.

Technical review

Best possible solution:

Retain only the staged indexes needed by the dependent Signals query, and model any future communication workflow separately from the established signal review lifecycle.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this is an internal staged-schema prerequisite, not a reported user-facing failure.

Is this the best way to solve the issue?

No: staged indexes are the right rollout mechanism, but the additional persisted attention lifecycle conflicts with the documented three-state Signals contract.

Full review comments:

  • [P1] Remove the unsupported Signals escalation state — convex/schema.ts:4095-4123
    The explicit Signals contract permits only open, snoozed, and dismissed, with no separate escalation state. These persisted fields and their indexes establish a parallel lifecycle that no current write, audit, queue, or UI path owns; remove them from this index-only prerequisite. This remains unresolved at the unchanged previously reviewed head.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against fb0ef1d21eab.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • remove merge-risk: 🚨 availability: Current PR review merge-risk labels are merge-risk: 🚨 other.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded moderation-rollout defect with no current user-visible outage.
  • merge-risk: 🚨 other: The patch introduces an unapproved persisted moderation state that can diverge from the established review lifecycle.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This member-authored internal schema prerequisite has no directly user-visible behavior; staged-index backfill confirmation is the relevant operational evidence.

Evidence

Acceptance criteria:

  • [P1] bunx tsc -p packages/schema/tsconfig.json --noEmit.
  • [P1] bunx tsc -p packages/clawhub/tsconfig.json --noEmit.
  • [P1] bun run ci:types-build.
  • [P1] bunx convex dev --once.

What I checked:

  • Explicit moderation contract: The repository specification limits Signals to open, snoozed, and dismissed and expressly prohibits a separate escalation state. (specs/security-moderation.md:113, fb0ef1d21eab)
  • Current main lifecycle implementation: Current main validates only the three review states and its query, mutation, dashboard, and UI paths use reviewStatus rather than a separate attention lifecycle. (convex/schema.ts:4047, fb0ef1d21eab)
  • Patch and review continuity: The unchanged reviewed head adds attentionState, needsAttention, and their staged indexes; this is the same unresolved P1 concern from the prior completed review cycle. (convex/schema.ts:4095, b0cdd14de2e7)
  • Convex staged-index contract: The checked-in Convex guidance confirms staged indexes backfill asynchronously and cannot be queried until a later deployment removes staged mode, supporting the PR's sequencing rationale. (convex/_generated/ai/guidelines.md:183, b0cdd14de2e7)

Likely related people:

  • jesse-merhi: Current schema head and the recent publisher-abuse signal lifecycle history are authored by Jesse Merhi. (role: feature owner and recent area contributor; confidence: high; commits: b0cdd14de2e7, 7ef2b15cfb03, 723f1551e97b; files: convex/schema.ts, convex/publisherAbuse.ts, specs/security-moderation.md)
  • Patrick Erichsen: History shows Patrick Erichsen introduced the original temporal publisher-abuse scan that this Signals work extends. (role: adjacent feature contributor; confidence: medium; commits: 8ebae3914012, 87ca030c30f3; files: convex/publisherAbuse.ts, convex/schema.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (21 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-22T07:37:28.214Z sha b0cdd14 :: found issues before merge. :: [P1] Keep Signals within the documented review lifecycle
  • reviewed 2026-08-22T09:36:37.815Z sha b0cdd14 :: found issues before merge. :: [P1] Keep Signals within the documented review lifecycle
  • reviewed 2026-08-22T10:57:16.499Z sha b0cdd14 :: found issues before merge. :: [P1] Keep Signals within the documented review lifecycle
  • reviewed 2026-08-22T12:38:16.942Z sha b0cdd14 :: found issues before merge. :: [P1] Keep Signals within the documented review lifecycle
  • reviewed 2026-08-22T14:09:27.429Z sha b0cdd14 :: needs changes before merge. :: [P1] Remove the unsupported Signals escalation state
  • reviewed 2026-08-22T15:34:14.342Z sha b0cdd14 :: found issues before merge. :: [P1] Remove the unsupported Signals escalation state
  • reviewed 2026-08-22T17:34:02.158Z sha b0cdd14 :: found issues before merge. :: [P1] Remove the unsupported Signals escalation state
  • reviewed 2026-08-22T19:34:20.574Z sha b0cdd14 :: needs changes before merge. :: [P1] Remove the unsupported Signals escalation state

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 21, 2026
@jesse-merhi

Copy link
Copy Markdown
Member Author

/clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat: stage publisher signal indexes This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant