Skip to content

feat(workbench): compiler-manifest-driven navigation and route catalog (#105 stage 1) - #211

Merged
ScriptedAlchemy merged 3 commits into
mainfrom
wave5/105-manifest-navigation
Sep 1, 2026
Merged

feat(workbench): compiler-manifest-driven navigation and route catalog (#105 stage 1)#211
ScriptedAlchemy merged 3 commits into
mainfrom
wave5/105-manifest-navigation

Conversation

@ScriptedAlchemy

Copy link
Copy Markdown
Owner

Closes the stage 1 slice of #105: Workbench navigation and its catalog now derive from the compiled route graph instead of artifact counts alone. This is additive — all nine existing pages, the single shell, the single navigation rail, and the single hash router are unchanged.

How the manifest flows dev-server → UI

  1. ProjectService.prepare() already compiles the route graph once per revision. workbench-server.ts composes a RouteManifestRouteService that projects latestValidPreparedProject.routeGraph through routeManifestFor(graph, sourceRevision) — no second discovery pass.
  2. RouteManifestRoutes serves it from one new read-only route, GET /api/routes/manifest, behind the existing same-session guard. No existing status or artifact DTO was widened, so sourceStatusSchema / artifactEpochSchema are untouched.
  3. RouteManifestClient fetches and strictly decodes the response with its own Zod schema (z.strictObject throughout), so an unknown field fails loudly in tests rather than silently in the browser.
  4. routeCatalogFor() projects the decoded manifest into a RouteCatalog grouped by MCP server then by project surface, and compares the manifest's sourceRevision against the published epoch's projectRevision to label the catalog current or stale.
  5. loadWorkbenchCapabilities() carries the catalog on WorkbenchCapabilities.routes. Page availability is the union of artifact counts and the compiled graph: hooks, mcp, and playground open from either source, and routes is always present. A refused or absent manifest yields an unavailable catalog that degrades only the Routes page.

The Routes page shows per-route id, kind, project-relative source, provenance, a flattened static config summary, the compiled CLI argv projection, the graph digest and source revision, MCP server packaging mode, context providers, and the graph's own diagnostics.

Pages preserved — browser proof

packages/workbench/tests/examples-real.e2e.test.ts and overview.e2e.test.ts at 1440×900 in real Chrome: 18/18 passing.

  • audiobook-curator (new): the flagship catalog — one generated curator server with 15 tools, 1 resource, 1 prompt, plus 15 conventional CLI routes with their argv projections (library-audit [<sources>…] [--concurrency] --report [--strict]), 32 routes total, no invented event routes, scripts, or providers; then navigates back to Overview and asserts it still renders.
  • hooks-and-scripts: shows the one compiler-discovered script route (script:verify-release) and not the configured script:detect-risk, plus a computed-style assertion that the catalog stylesheet reached the document.
  • mcp-app: empty compiled graph renders "This project declares no conventional route modules." while all nine other navigation links stay visible.
  • skills-starter and the capability reveal/repair/remove flow pass unchanged.

Plan-doc amendments

Both superpowers docs carry explicit supersession notes stating that the compiled graph is now a navigation input, that the page set is ten pages, and that the "must not create another shell/navigation/router" invariant still holds because the catalog is a page inside the existing shell:

  • docs/superpowers/specs/2026-08-25-capability-aware-workbench-design.md
  • docs/superpowers/plans/2026-08-25-capability-aware-workbench.md

Verification

  • tsc --noEmit (root and packages/workbench): clean.
  • rslint .: 0 errors, 0 warnings across 840 files.
  • Workbench unit slice + route-manifest-routes.test.ts: 683 tests, 0 failures.
  • rstest.route-unit.config.ts: 0 failures.
  • Browser e2e above: 18/18.

Known-flaky on main as well: the full 20-file workbench integration run reports ~3 failures whose set changes every run (overview.e2e, runtime-playground.e2e, mcp-app-real.e2e) and none reproduce in isolation. Confirmed by running the same suite on origin/main (also 3 failures, different set), which is the same reload-budget flake #200/#203 tracks.

What stage 2 needs

  • Schema-driven input editors: the manifest deliberately summarizes config (annotations: 2 keys) rather than shipping nested JSON. Stage 2 needs the route inputSchema on the wire — add it as a new field on RouteManifestRoute and extend routeSchema in route-manifest-client.ts in the same PR.
  • The Agent Document stage will want per-route capability states; RouteManifestProvenance is already a discriminated union so a non-conventional provenance is additive rather than a wire break.
  • Read-only discovery is stage 4 and nothing here anticipates it.

…piled route graph (#105 stage 1)

The dev server projects the prepared project's existing CompiledRouteGraph
into one browser-safe DTO behind a new read-only route
(GET /api/routes/manifest), so the Workbench reads the same compiler pass the
build, inspect, and test harness use rather than discovering routes again.

A Routes page under Build renders that catalog grouped by MCP server and by
project surface, with per-route id, source, provenance, config summary, the
compiled CLI argv projection, and the graph's own diagnostics. Page
availability is now the union of the artifact catalog and the compiled graph:
Hooks, MCP playground, and Playground open from either source, and an absent
or refused manifest degrades only the Routes page. All nine existing pages,
the single shell, navigation rail, and hash router are unchanged.
…stop repeating descriptions

Three catalog rules carried a literal line-number prefix, so the CSS parser
dropped them and provenance ran into its source path unstyled. The Routes page
also printed each route's description twice — once as the route label and again
inside the config summary.

Adds the flagship audiobook-curator example to the browser example suite as the
seven-kind catalog proof (one generated server, 15 tools, a resource, and a
prompt), and asserts computed provenance layout so a dropped stylesheet fails
the suite rather than only the screenshot.
… with positionals

The routed CLI landed for audiobook-curator, so the compiled catalog now shows
15 CLI routes beside the curator server's 17. The usage line puts positionals
first in argv order instead of following the compiler's key ordering, which put
a positional between two flags.
@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d5eedc1

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 1, 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-01T21:15:55.537625Z d5eedc1 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.

@ScriptedAlchemy
ScriptedAlchemy merged commit c158be5 into main Sep 1, 2026
1 check passed
@ScriptedAlchemy
ScriptedAlchemy deleted the wave5/105-manifest-navigation branch September 1, 2026 21:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d5eedc1a02

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/workbench/tests/examples-real.e2e.test.ts
Comment thread packages/workbench/src/routes/routes-page.tsx
Comment thread packages/workbench/src/routes/routes-model.ts
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