Skip to content

feat(webapp): dashboard parity for mollifier-buffered runs#3757

Draft
d-cs wants to merge 2 commits into
mollifier-phase-3-mutationsfrom
mollifier-phase-3-dashboard
Draft

feat(webapp): dashboard parity for mollifier-buffered runs#3757
d-cs wants to merge 2 commits into
mollifier-phase-3-mutationsfrom
mollifier-phase-3-dashboard

Conversation

@d-cs
Copy link
Copy Markdown
Collaborator

@d-cs d-cs commented May 26, 2026

Summary

Dashboard surfaces handle buffered runs by falling back to the mollifier snapshot:

  • Run detail, span detail, streams view (_app.../runs.\$runParam, resources.../spans.\$spanParam, resources.../streams.\$streamKey).
  • Redirect routes (@.runs.\$runParam, runs.\$runParam, projects.v3.\$projectRef.runs.\$runParam).
  • Action routes — cancel / replay / idempotency-reset / debug — under resources.taskruns/... and resources.../idempotencyKey.reset.
  • Logs download.
  • Realtime subscription route + per-run resource (realtime.v1.runs.\$runId, resources.../realtime.v1.*).
  • CancelRunDialog gains an onCancelSubmitted callback so submit isn't raced by the Radix DialogClose wrapper.

Stacked on the mutations PR.

Test plan

  • `pnpm run typecheck --filter webapp` passes
  • `pnpm run test --filter webapp test/mollifierRealtimeRunResource.test.ts` passes
  • `pnpm run test --filter webapp test/mollifierRealtimeRunResourceBuffer.test.ts` passes
  • `pnpm run test --filter webapp test/mollifierRealtimeSubscription.test.ts` passes
  • Manual smoke: trigger a buffered run, open it in the dashboard, replay/cancel from the UI

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 26, 2026

⚠️ No Changeset found

Latest commit: 33c8f9f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 28127392-c1a3-4ece-b53e-c618bc61fc43

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mollifier-phase-3-dashboard

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

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

Comment thread apps/webapp/app/routes/realtime.v1.runs.$runId.ts Outdated
Comment thread apps/webapp/app/routes/resources.runs.$runParam.logs.download.ts Outdated
Comment thread apps/webapp/app/routes/resources.taskruns.$runParam.debug.ts
@d-cs d-cs self-assigned this May 26, 2026
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from b8ead31 to 109fbd7 Compare May 26, 2026 11:12
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from dd31d60 to ba09531 Compare May 26, 2026 11:12
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 109fbd7 to c7a66bd Compare May 26, 2026 13:24
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from ba09531 to 1de95f4 Compare May 26, 2026 13:24
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 3157546 to 432f81a Compare May 26, 2026 14:28
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from c7a66bd to 094d006 Compare May 26, 2026 14:44
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 432f81a to 8c19830 Compare May 26, 2026 14:44
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 094d006 to 9914976 Compare May 26, 2026 15:00
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 8c19830 to fd7e01d Compare May 26, 2026 15:00
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 9914976 to 2ee45a8 Compare May 26, 2026 15:12
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from fd7e01d to 83880f8 Compare May 26, 2026 15:12
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 83880f8 to 1a8fbc6 Compare May 26, 2026 15:24
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from f4b6064 to 0547ba9 Compare May 26, 2026 16:00
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 1a8fbc6 to 558703b Compare May 26, 2026 16:00
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 0547ba9 to 0708ce5 Compare May 26, 2026 16:20
d-cs added a commit that referenced this pull request May 26, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 558703b to 372ca71 Compare May 26, 2026 16:20
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from ba084d8 to eb520ef Compare May 27, 2026 12:58
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 79a0885 to c2898d3 Compare May 27, 2026 12:58
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from c2898d3 to 0cdfe2c Compare May 27, 2026 13:47
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 2ea3d92 to 46c08fb Compare May 27, 2026 14:06
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 0cdfe2c to bdc87f5 Compare May 27, 2026 14:06
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from bdc87f5 to 04fab12 Compare May 27, 2026 15:07
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch 2 times, most recently from 0396ab9 to 65ca573 Compare May 27, 2026 15:27
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 04fab12 to 17e5432 Compare May 27, 2026 15:27
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 17e5432 to e50c7b9 Compare May 27, 2026 15:42
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 65ca573 to 15f5580 Compare May 27, 2026 15:42
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 15f5580 to f6d15b1 Compare May 27, 2026 16:50
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from e50c7b9 to cbc70ed Compare May 27, 2026 16:50
d-cs added a commit that referenced this pull request May 27, 2026
…ity envId from realtime counter

Three CodeRabbit findings from #3709, re-raised on #3757:

- resources.taskruns.$runParam.debug.ts: buffered fallback returned the
  run's queue / concurrencyKey / queueTimestamp from the snapshot
  without verifying org membership. Any authenticated user who knew a
  friendlyId could read those fields across orgs. Now joins through
  orgMember the same way the PG path does and 404s on miss.
- resources.runs.$runParam.logs.download.ts: same shape — the buffered
  placeholder leaked runId existence to non-members on direct URL
  access. Same orgMember check now gates the buffered branch.
- mollifierTelemetry.server.ts: recordRealtimeBufferedSubscription was
  attaching envId (a UUID) as an OTEL counter dimension, violating the
  project's "no high-cardinality IDs in metric attributes" guideline.
  Dropped the parameter; the call site's logger.info still emits envId.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from f6d15b1 to fcd196d Compare May 27, 2026 16:58
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from cbc70ed to da1a1dd Compare May 27, 2026 16:58
d-cs added a commit that referenced this pull request May 28, 2026
Address review findings on PR #3757:

- replay: guard `synthetic.traceId` / `spanId` before adapting a
  buffered snapshot into the TaskRun shape ReplayTaskRunService expects.
  Without the guard, an older snapshot missing those fields produces
  `00-undefined-undefined-01` as the W3C traceparent, which OTel
  silently drops — severing the replayed run's trace linkage. Extract
  the adapter into `buildSyntheticReplayTaskRun` so the guard is unit
  tested.
- run-detail: reflect the buffered snapshot's CANCELED state into the
  NavBar status + Cancel-button gate. Previously `tryMollifiedRunFallback`
  hardcoded `status: PENDING` / `isFinished: false` regardless of
  `buffered.status` / `cancelledAt`, so cancelling a buffered run left
  the NavBar showing Pending with a Cancel button until the drainer
  materialised the row. Extract the mapping into `buildSyntheticRunHeader`
  and unit test PENDING vs CANCELED.
- admin runs redirect (@.runs.$runParam): preselect the root span on
  the buffered redirect via `v3RunSpanPath`, matching the sibling
  redirect routes. Without this the trace tree opened with nothing
  selected for buffered runs reached via the admin impersonate path.
- RunStreamPresenter: switch from `deserialiseSnapshot` (redis-worker)
  to the webapp wrapper `deserialiseMollifierSnapshot` so both read-side
  modules share one deserialisation path, per the contract comment in
  `syntheticRedirectInfo.server.ts`.
- cancel route: collapse the `mutateSnapshot` "not_found" branch into
  the same retry message as "busy". Both indicate the drainer raced the
  mutation between `getEntry` and `mutateSnapshot`; the run is in PG by
  then and a retry hits the regular cancel path.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
d-cs added a commit that referenced this pull request May 28, 2026
Address review findings on PR #3757:

- replay: guard `synthetic.traceId` / `spanId` before adapting a
  buffered snapshot into the TaskRun shape ReplayTaskRunService expects.
  Without the guard, an older snapshot missing those fields produces
  `00-undefined-undefined-01` as the W3C traceparent, which OTel
  silently drops — severing the replayed run's trace linkage. Extract
  the adapter into `buildSyntheticReplayTaskRun` so the guard is unit
  tested.
- run-detail: reflect the buffered snapshot's CANCELED state into the
  NavBar status + Cancel-button gate. Previously `tryMollifiedRunFallback`
  hardcoded `status: PENDING` / `isFinished: false` regardless of
  `buffered.status` / `cancelledAt`, so cancelling a buffered run left
  the NavBar showing Pending with a Cancel button until the drainer
  materialised the row. Extract the mapping into `buildSyntheticRunHeader`
  and unit test PENDING vs CANCELED.
- admin runs redirect (@.runs.$runParam): preselect the root span on
  the buffered redirect via `v3RunSpanPath`, matching the sibling
  redirect routes. Without this the trace tree opened with nothing
  selected for buffered runs reached via the admin impersonate path.
- RunStreamPresenter: switch from `deserialiseSnapshot` (redis-worker)
  to the webapp wrapper `deserialiseMollifierSnapshot` so both read-side
  modules share one deserialisation path, per the contract comment in
  `syntheticRedirectInfo.server.ts`.
- cancel route: collapse the `mutateSnapshot` "not_found" branch into
  the same retry message as "busy". Both indicate the drainer raced the
  mutation between `getEntry` and `mutateSnapshot`; the run is in PG by
  then and a retry hits the regular cancel path.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from 214bd92 to c2e1c6e Compare May 28, 2026 08:49
@d-cs d-cs force-pushed the mollifier-phase-3-dashboard branch from 50dcb33 to 7494c3d Compare May 28, 2026 08:49
@d-cs d-cs force-pushed the mollifier-phase-3-mutations branch from c2e1c6e to 0f7365d Compare May 28, 2026 09:41
d-cs and others added 2 commits May 28, 2026 12:58
Address review findings on PR #3757:

- replay: guard `synthetic.traceId` / `spanId` before adapting a
  buffered snapshot into the TaskRun shape ReplayTaskRunService expects.
  Without the guard, an older snapshot missing those fields produces
  `00-undefined-undefined-01` as the W3C traceparent, which OTel
  silently drops — severing the replayed run's trace linkage. Extract
  the adapter into `buildSyntheticReplayTaskRun` so the guard is unit
  tested.
- run-detail: reflect the buffered snapshot's CANCELED state into the
  NavBar status + Cancel-button gate. Previously `tryMollifiedRunFallback`
  hardcoded `status: PENDING` / `isFinished: false` regardless of
  `buffered.status` / `cancelledAt`, so cancelling a buffered run left
  the NavBar showing Pending with a Cancel button until the drainer
  materialised the row. Extract the mapping into `buildSyntheticRunHeader`
  and unit test PENDING vs CANCELED.
- admin runs redirect (@.runs.$runParam): preselect the root span on
  the buffered redirect via `v3RunSpanPath`, matching the sibling
  redirect routes. Without this the trace tree opened with nothing
  selected for buffered runs reached via the admin impersonate path.
- RunStreamPresenter: switch from `deserialiseSnapshot` (redis-worker)
  to the webapp wrapper `deserialiseMollifierSnapshot` so both read-side
  modules share one deserialisation path, per the contract comment in
  `syntheticRedirectInfo.server.ts`.
- cancel route: collapse the `mutateSnapshot` "not_found" branch into
  the same retry message as "busy". Both indicate the drainer raced the
  mutation between `getEntry` and `mutateSnapshot`; the run is in PG by
  then and a retry hits the regular cancel path.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- CancelRunDialog: restore the `onCancelSubmitted` callback the PR
  description promised but never actually shipped. The run-detail route
  was passing this prop to a component that didn't accept it, breaking
  the webapp typecheck. Wire the callback to the form's onSubmit so the
  parent can close the Radix Dialog without wrapping the submit button
  in `DialogClose` — that wrapper races submit (close fires first,
  unmounts the form, the cancel POST never lands).
- NoLogsView: restore the original "We delete old logs" retention copy
  on the no-completedAt branch. The earlier change overwrote it with a
  "Waiting to start" panel intended for buffered runs, but buffered
  runs always carry a synthetic trace (buildSyntheticTraceForBufferedRun)
  and never reach NoLogsView — so the new copy was unreachable for the
  case it was added for, while clobbering the actual case the branch
  fires for (in-flight PG runs with no logs).
- syntheticReplayTaskRun: document why `as unknown as TaskRun` is
  load-bearing. SyntheticRun and Prisma TaskRun are not structurally
  assignable (optional vs required fields, narrower status enum, absent
  PG columns), so a direct cast won't compile; routing through
  `unknown` is the explicit "we know this is a subset, the audited
  fields ReplayTaskRunService reads are enumerated on SyntheticRun"
  signal.
- replay loader: scope the buffered `orgProject` lookup by
  `organizationId: entry.orgId` as well as the env id. The prior
  `orgMember.findFirst` check confirms the user belongs to
  `entry.orgId`; pinning organizationId on the project query mirrors
  the PG path's `project.organization.members.some.userId` scoping
  and means a malformed entry whose envId resolves to a different org
  can't leak that project through this loader.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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