Skip to content

feat(dev): semantic lifecycle replay (#105 stage 3) - #279

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
wave/105-s3
Sep 2, 2026
Merged

feat(dev): semantic lifecycle replay (#105 stage 3)#279
ScriptedAlchemy merged 3 commits into
mainfrom
wave/105-s3

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

#105 stage 3: semantic lifecycle replay. A replay crosses real native decode → generated event-route execution → RSC rendering through the runtime dispatcher → real native encode, correlated with the Agent Document stage, with fixture-vs-observed receipt provenance surfaced honestly.

Dev server (agent-bundle)

  • New authenticated foreground routes: GET /api/lifecycles (compiled event routes × concrete hosts with native event names, contract revisions, checked-in starter fixtures, and honest exclusion diagnostics) and POST /api/lifecycles/replays (fail-closed manifest binding → validateNativeEventEnvelopecreateCanonicalEventProps → real dispatcher render → projectEventDocument).
  • The per-target native envelope validation previously inlined as generated wrapper strings is single-sourced into validateNativeEventEnvelope in the events runtime; generated wrappers now import it (behavior-preserving, proven by the artifact suites).
  • Replays render in a sibling react-server child (fork + IPC, stdout rerouted, abort kills the child), mirroring the flight-worker precedent; works from TS source and packaged dist.
  • New codes: AB8210 (invalid path), AB8211 (malformed body/envelope, 400), AB8212 (unavailable), AB8213 (stale manifest binding, 409), AB8214 (16 MiB response budget, 413); semantic diagnostics lifecycle.target.unsupported/excluded, lifecycle.route.unavailable, lifecycle.projection.unsupported.

Workbench

  • New desktop #lifecycles page: lifecycle/target selector, starter fixture or pasted observed receipt, provenance banner with an explicit "deterministic replay, not evidence the host dispatched this event" disclaimer, canonical identity + request context, ordered feat(runtime): add Agent Document contracts #140 render-event timeline through the shared Agent Document stage, native response/projection diagnostics, and the stale (AB8213) → refresh → explicit re-run repair flow.
  • Strict zod decode of both endpoints; per-conventions atoms/state (no stream-backed derived atoms).

Local gates (all green)

  • pnpm typecheck, pnpm lint (0/0 across 957 files)
  • Unit 39 ✓; route-unit replay ✓; integration 61 ✓ (incl. new real-dev-server replay proof, generated-route-server wrapper parity, target hook contracts, public API) + 64 ✓ (hooks/dev-workbench regressions)
  • Browser-mounted lifecycle page 3 ✓
  • Workbench e2e at 1440×900: lifecycles.e2e ✓ (claude + codex fixture legs, observed leg, stale→repair, zero page errors), overview.e2e + runtime-playground.e2e regressions 16 ✓

Closes nothing; lands stage 3 of #105.

Replay compiled event routes through native validation, canonical decoding, the real render dispatcher, and host projection while preserving fixture provenance and stale-manifest safety.
Expose fixture and observed native replay evidence in one correlated lifecycle view with fail-closed stale-manifest repair.
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13d72be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
agent-bundle Patch

Not sure what this means? Click here to learn what changesets are.

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

@ScriptedAlchemy
ScriptedAlchemy merged commit 9a43616 into main Sep 2, 2026
4 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T04:59:38.707008Z 13d72be PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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