Skip to content

feat(workbench): state-lifetime catalog in the compiled route manifest (#269) - #323

Merged
ScriptedAlchemy merged 2 commits into
mainfrom
wave/269-visibility
Sep 2, 2026
Merged

feat(workbench): state-lifetime catalog in the compiled route manifest (#269)#323
ScriptedAlchemy merged 2 commits into
mainfrom
wave/269-visibility

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Summary

Deliverable 1 of 2 for #269 (the #98 visibility remainder split from #233 when #268 shipped the existing-surface half): the compiled route manifest now carries the normalized state declaration, and the Workbench Routes page displays it as a read-only catalog panel (G6: zero mutation affordances).

  • Manifest projection: routeManifestFor gains an optional normalized state input; RouteManifest.state?: RouteManifestState carries declared id, effective lifetime, driver kind (memory/sqlite, mirroring entry codegen), budgets as { source: 'declared' | 'defaults', resolved } or { source: 'dynamic' } (statically unreadable), the described (never fabricated) workspace-durable location, the notice-ledger co-mount note, and the conventional src/state.ts source. Absence stays honest: a stateless project's manifest simply omits the field.
  • One derivation: the projection logic shared by inspect --state (feat(state): kernel budgets and lifetime visibility (#233 items 3-4) #268) and the manifest lives in src/core/state-inspection.ts. Static inspection stays independent of the optional @agent-bundle/runtime peer — local frozen policy defaults with a cross-package drift-guard test comparing them against the runtime's AGENT_STATE_DEFAULT_BUDGETS export, so consumers loading compiler APIs without the peer cannot crash and the two package boundaries cannot drift silently.
  • Wire: RouteManifestState exported through src/contracts/routes.ts; the Workbench RouteManifestClient decodes it with z.strictObject throughout (an unknown field inside state fails loudly under AB8123).
  • Workbench: the Routes page shows a State panel (id, lifetime, driver, budgets with source, durable location, notices) with zero interactive controls; the stateless case renders "This project declares no state module." with no role="alert". Coordinates with the compiled-graph catalog from feat(workbench): compiler-manifest-driven navigation and route catalog (#105 stage 1) #211 unchanged — no new page, shell, or router.

Per the #218 stage-2/3 deferral notes: the static half of the state-lifetime assertions is now wireable from the manifest; the runtime-identity half rides the companion #269 PR.

Test plan

  • pnpm build, pnpm lint (0/0), pnpm typecheck
  • pnpm test:unit, pnpm test:route-unit, pnpm test:projection
  • Real-Chrome e2e at 1440×900 (examples-real.e2e.test.ts): flagship audiobook-curator shows the populated workspace-durable/sqlite panel with zero mutation affordances; mcp-app shows honest absence
  • Cross-package drift guard: local policy defaults === runtime AGENT_STATE_DEFAULT_BUDGETS
  • Changeset: agent-bundle minor

Restore local policy defaults and a cross-package drift guard so static compiler consumers do not require the optional runtime peer.
@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d979031

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 Minor

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

@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-02T22:54:59.566342Z d979031 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.

@pkg-pr-new

pkg-pr-new Bot commented Sep 2, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle@323
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/create-agent-bundle@323
npm i https://pkg.pr.new/ScriptedAlchemy/agent-bundle/@agent-bundle/runtime@323

commit: d979031

@ScriptedAlchemy
ScriptedAlchemy merged commit ce1725e into main Sep 2, 2026
8 of 9 checks passed
@ScriptedAlchemy
ScriptedAlchemy deleted the wave/269-visibility branch September 3, 2026 05:28
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