Skip to content

feat: add exact review lifecycle telemetry - #991

Merged
brokemac79 merged 1 commit into
mainfrom
codex/csw-087-lifecycle-telemetry
Aug 1, 2026
Merged

brokemac79 merged 1 commit into
mainfrom
codex/csw-087-lifecycle-telemetry

Conversation

@brokemac79

@brokemac79 brokemac79 commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements #898 Workstream 3 as a producer-only Durable Object telemetry contract: ExactReviewLifecycleTelemetryV1.

  • Derives terminal coverage from the existing lifecycle projection, with explicit durable-terminal, acknowledgement-pending, unknown-terminal, and non-current counts.
  • Records server-observed direct outcomes and per-item publication terminal outcomes. Canonical accepted/deduped results remain receipts; a workflow success is never counted as a canonical acceptance.
  • Retains event counters for seven days, reports only aggregate counts, and keeps identity only inside Durable Object event keys for idempotency.

Problem

Actions/public item status can show a visible acknowledgement without proving the durable lifecycle is Completed. Operators need producer facts that distinguish a terminal lifecycle projection, an acknowledgement still pending observation, and unresolved/unknown work without treating workflow success as per-item lifecycle truth.

Implementation

  • Add dashboard/exact-review-lifecycle-telemetry.ts, the ExactReviewLifecycleTelemetryV1 aggregate contract and bounded telemetry tables.
  • Hook only existing queue publication paths in dashboard/exact-review-queue.ts: direct fallback/accepted/deduped/superseded outcomes; batch and non-batch retryable/permanent/superseded terminal outcomes; lifecycle receipt-derived accepted/deduped counts.
  • Add controlled Worker coverage for acknowledgement-pending versus Completed, retention, direct outcomes, batch stale supersession (before fetch and before completion), and non-batch terminal completions.

Real Behavior Proof

Claim: telemetry reports durable lifecycle facts, not Actions success or visible command status.

Exercised surface: an in-memory Durable Object Worker with signed direct publication results and fenced publication batch/complete routes.

Scenarios and observed results:

  • A command-originated revision with a durable routed terminal remains acknowledgementPending until its acknowledgement is observed; it is not represented as Completed.
  • Direct publication records fallback, accepted, deduped, and superseded facts. Batch receipt counters record accepted/deduped; terminal batch and normal completion paths record retryable/permanent/superseded facts exactly once.
  • A batch made stale before fetch reports a durable superseded outcome. A successful non-batch published completion does not create a synthetic accepted result.
  • Seven-day expiry is applied when reading outcome events and canonical batch receipts; aggregate output contains no target identities.

Commands and results:

pnpm run build:dashboard
node --test --test-name-pattern "lifecycle telemetry counts durable terminal coverage|direct publication endpoint authenticates|fetching a stale publication batch|non-batch publication completions" test/dashboard-worker.test.ts
pnpm run lint:dashboard
pnpm run lint:scripts
node --test test/dashboard-worker.test.ts

All passed; the full Worker suite completed 290/290. git diff --check and targeted oxfmt --check passed.

Controlled Linux/Docker current-head trace

Provider: Crabbox local-container on Linux Docker image mcr.microsoft.com/playwright:v1.60.0-noble; one-shot lease cbx_8f5e8735cc4d (automatically stopped). The script asserted the reviewed head before building the repair dependency and exercising the actual Worker/queue producer entrypoints. The redacted terminal trace was:

CSW-087_HEAD=8920e416368a1c36db3aaf712b97f4dbcdd99c50
CSW-087_PROOF=direct-and-batch-producer-paths
v24.15.0
11.10.0
CRABBOX_PHASE:repair-build
$ tsc -p tsconfig.repair.json
CRABBOX_PHASE:producer-runtime
✔ lifecycle telemetry counts durable terminal coverage without treating acknowledgement pending as completed
✔ direct publication endpoint authenticates, dedupes, and returns a structured 413
✔ fetching a stale publication batch records a durable superseded telemetry outcome
✔ non-batch publication completions record durable terminal outcomes without inferring acceptance
ℹ tests 4
ℹ pass 4
ℹ fail 0
CSW-087_RESULT=producer-runtime-proof-passed

Limits: this is a controlled, isolated Docker proof of the current-head Worker/queue routes and durable-object storage behavior. It makes no production call, changes no queue/workflow authority, and adds no reader or public status surface.

Review

  • codex review --uncommitted: final closeout reported no correctness issues.
  • codex review --base origin/main: no actionable correctness issues.
  • Review findings led to retention-at-read filtering plus coverage of stale-before-fetch, stale-before-complete, and ordinary non-batch terminal completion paths.

Scope and risks

This PR is deliberately not a consumer or presentation change. It adds no Bay/Overview UI, public status/API expansion, authenticated operator route, R2 scan/backfill/replay, workflow/queue authority change, Workstream 1/2 semantic change, deployment, gate change, merge, or automerge.

The aggregate contract is producer-only by design. A future exact per-revision operator reader needs separate maintainer approval and must stay authenticated, redacted, and outside Bay/public status semantics. Telemetry write failures are non-blocking and cannot change publication/lifecycle behavior.

Rebased on current origin/main at 8e620fc4fb3fe04761a8b0245b9e89cb553ebb5a (#990); its batch post-effect workflow/test ordering is preserved.

Relates to #898, #947, #952, and #990.

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 1, 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 repository_dispatch).
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: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 11:51 PM ET / August 1, 2026, 03:51 UTC.

ClawSweeper review

What this changes

Adds a producer-only Durable Object aggregate that records exact-review lifecycle coverage and direct, batch, and non-batch publication outcomes with seven-day retention.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

The focused source review and current-head controlled runtime trace support the producer-only behavior, and no discrete patch defect was identified. Keep this PR open for the coordinated roadmap decision in #898: the additive Durable Object telemetry contract and its persistent-storage boundary need explicit maintainer approval before the draft can move forward.

Likely related people: brokemac79 is the strongest routing candidate from the linked merged lifecycle/publication slices and the roadmap sequencing record; Peter Steinberger is a lower-confidence adjacent queue-history contact.

Priority: P2
Reviewed head: 8920e416368a1c36db3aaf712b97f4dbcdd99c50
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, covered by targeted Worker tests, and supported by a current-head controlled runtime trace; merge readiness is gated by product-scope approval rather than a demonstrated code defect.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body now includes an inspectable redacted current-head Crabbox Linux/Docker terminal trace that runs the changed Worker/queue producer scenarios and shows all four targeted tests passing; it is controlled-runtime proof, not a production call.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body now includes an inspectable redacted current-head Crabbox Linux/Docker terminal trace that runs the changed Worker/queue producer scenarios and shows all four targeted tests passing; it is controlled-runtime proof, not a production call.
Evidence reviewed 6 items Telemetry contract: The added store defines two additive Durable Object SQL tables, validates identity fields, retains outcome events for seven days, and derives aggregate lifecycle/publication counts without defining a fetch route.
Queue integration: The queue initializes the telemetry schema and records direct, batch, stale-batch, and non-batch completion outcomes through non-blocking error handling, leaving publication decisions unchanged on telemetry failure.
Focused regression coverage: The added Worker tests cover acknowledgement-pending versus completed, direct outcomes, retention, stale batch completion, and non-batch terminal outcomes.
Findings None None.
Security None None.

How this fits together

Exact review events enter the queue and lifecycle projection inside a Durable Object, which then drives canonical publication and terminal handling. This PR records aggregate operational facts alongside those producer paths while deliberately exposing no public or operator reader.

flowchart LR
  Events[Exact-review events] --> Queue[Durable Object queue]
  Queue --> Lifecycle[Lifecycle projection]
  Queue --> Publication[Direct and batch publication]
  Lifecycle --> Telemetry[Producer-only telemetry]
  Publication --> Telemetry
  Telemetry --> Storage[Durable Object SQL tables]
Loading

Decision needed

Question Recommendation
Should ClawSweeper adopt this producer-only Durable Object lifecycle telemetry contract now, with its additive persistent tables and no reader or public-status exposure? Approve the bounded producer contract: Accept the seven-day aggregate telemetry writer with no reader or public/Bay integration, and let normal current-head preflight govern landing.

Why: The patch is technically bounded, but #898 reserves coordinated workstream scope and the new retained telemetry contract creates an operational product boundary that source review cannot approve on behalf of maintainers.

Before merge

  • Resolve merge risk (P1) - Merging creates two persistent Durable Object telemetry tables and adds synchronous producer-path writes; the in-memory controlled proof establishes behavior but does not establish the intended production storage budget or owner for this new contract.
  • Resolve merge risk (P1) - The producer-only/no-reader boundary is deliberate, but its future operator-reader and privacy semantics remain a maintainer product decision rather than a mechanical implementation detail.
  • Complete next step (P2) - The remaining blocker is explicit maintainer approval of the new persistent producer telemetry contract, not a narrow mechanical repair suitable for automation.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch size 921 added, 2 removed across 3 files Most of the change is a new persistent telemetry contract plus focused queue integration and Worker coverage.
Persistent schema 2 Durable Object tables added The telemetry contract introduces retained storage on a shared exact-review queue path.

Merge-risk options

Maintainer options:

  1. Authorize the producer-only v1 boundary (recommended)
    Accept the additive Durable Object schema and queue-path writer only with the stated no-reader/no-public-status boundary preserved.
  2. Pause for storage and reader policy
    Keep the PR draft until maintainers document the intended retention/storage budget and any future authenticated-reader contract.

Technical review

Best possible solution:

Record explicit maintainer approval for this narrow producer-only Workstream 3 contract, including its storage budget and the rule that any future reader is authenticated and outside Bay/public-status semantics, then land the additive implementation without broadening it into a presentation surface.

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

Not applicable as a defect reproduction: this is a new producer contract. The PR does provide a high-confidence controlled current-head trace of the changed Durable Object and queue entrypoints, with four targeted passing scenarios.

Is this the best way to solve the issue?

Unclear: the implementation is a coherent narrow way to add aggregate producer facts, but whether this persistent telemetry contract should exist now is reserved for the coordinated roadmap decision in #898.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded operational telemetry feature on the shared exact-review queue path, with no demonstrated user-facing outage or data-loss incident.
  • merge-risk: 🚨 compatibility: The PR adds persistent Durable Object tables and producer-path writes, so maintainers need to approve upgrade and operational-storage expectations before merge.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body now includes an inspectable redacted current-head Crabbox Linux/Docker terminal trace that runs the changed Worker/queue producer scenarios and shows all four targeted tests passing; it is controlled-runtime proof, not a production call.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes an inspectable redacted current-head Crabbox Linux/Docker terminal trace that runs the changed Worker/queue producer scenarios and shows all four targeted tests passing; it is controlled-runtime proof, not a production call.

Evidence

What I checked:

  • Telemetry contract: The added store defines two additive Durable Object SQL tables, validates identity fields, retains outcome events for seven days, and derives aggregate lifecycle/publication counts without defining a fetch route. (dashboard/exact-review-lifecycle-telemetry.ts:104, 8920e416368a)
  • Queue integration: The queue initializes the telemetry schema and records direct, batch, stale-batch, and non-batch completion outcomes through non-blocking error handling, leaving publication decisions unchanged on telemetry failure. (dashboard/exact-review-queue.ts:1954, 8920e416368a)
  • Focused regression coverage: The added Worker tests cover acknowledgement-pending versus completed, direct outcomes, retention, stale batch completion, and non-batch terminal outcomes. (test/dashboard-worker.test.ts:561, 8920e416368a)
  • Current-head behavior proof: The PR body supplies a redacted Crabbox Linux/Docker terminal trace for head 8920e41 showing four targeted Worker/queue producer-path tests passing after build. (8920e416368a)
  • Lifecycle feature provenance: Current main contains the lifecycle projection introduced by the merged lifecycle slice; this PR is an additive telemetry layer over that established projection rather than a replacement of it. (dashboard/exact-review-lifecycle.ts:306, b07ab751813c)
  • Roadmap boundary: The supplied roadmap context identifies Workstream 3 as backend telemetry producers and says coordinated implementation needs an explicitly approved narrow workstream boundary; this PR body does not link a maintainer approval comparable to the linked Workstream 2 approval record.

Likely related people:

  • brokemac79: The supplied roadmap names this person as sequencing the coordinated work, and the related merged publication, lifecycle, and workflow slices were authored by this account. (role: roadmap sequencer and prior merged lifecycle/publication contributor; confidence: high; commits: 05d864b0103e, b07ab751813c, 8e620fc4fb3f; files: dashboard/exact-review-queue.ts, dashboard/exact-review-lifecycle.ts)
  • Peter Steinberger: Local file-history sampling shows sustained contribution to the queue and Worker-test surface surrounding the lifecycle work, although the unavailable deeper promisor history prevents a more specific ownership assignment. (role: adjacent queue-history contributor; confidence: low; commits: b4d1edea, 3d2a878f; files: dashboard/exact-review-queue.ts, test/dashboard-worker.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Obtain explicit maintainer approval for the Workstream 3 producer-only storage and no-reader boundary before taking this PR out of draft.

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 (1 earlier review cycle)
  • reviewed 2026-08-01T03:32:22.747Z sha 8920e41 :: needs real behavior proof before merge. :: none

@brokemac79

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 1, 2026
@brokemac79
brokemac79 marked this pull request as ready for review August 1, 2026 04:04
@brokemac79
brokemac79 merged commit a80c24e into main Aug 1, 2026
31 checks passed
@brokemac79
brokemac79 deleted the codex/csw-087-lifecycle-telemetry branch August 1, 2026 04:04
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant