Skip to content

feat: add a React starter on Hono - #325

Merged
timeleft-- merged 2 commits into
mainfrom
automation/tracked-d772ec2a4fe8
Oct 29, 2026
Merged

timeleft-- merged 2 commits into
mainfrom
automation/tracked-d772ec2a4fe8

Conversation

@yia-mw-agent

Copy link
Copy Markdown
Contributor

What this changes

saga init --a2ui-stack react-mcp --server hono DIR now creates a clean React starter on Hono from a maintained templates/react-hono. It is qualified from generated output the same way the five Lit pairs are.

Design: getting-started tracks, "React/Hono starter" (approved in #324).

  • Template. server/ is the lit-hono text. src/ is the same application (public status, protected account operation with a verifier that refuses everything, and the "Clear the note" local action) written in .tsx against @saga-a2ui/react-mcp-stack, with react/react-dom 19.3.1 and jsx: react-jsx. template.json names react-mcp, hono and the five React-side SDK packages.
  • Shared server text. The <starter-app check in server/operations.ts became a VIEW_MARKER that each template declares in src/contract.ts (<starter-app for the five Lit templates, <div id="root" for React). scripts/starter-hono.test.ts now also fails if the React copy's server files, server build files, contract (apart from the marker) or Hono pins differ from lit-hono's. The Hono-only cases moved to scripts/starter-hono-cases.ts and run for both Hono templates.
  • Stack-aware checks. Stack-import and page-marker checks (starter-qualification.ts), the browser teardown selector (starter.spec.ts), snippet extraction (now reads .tsx and records each snippet's language; guide-recipes.ts fences each recipe accordingly), the packed set in saga-init-offered.test.ts, REQUIRED_TEMPLATES and the stack-import units. New scripts/starter-react-hono.test.ts.
  • CLI. One SUPPORTED_PAIRS row, added after the qualification passed. saga demo is unchanged (Lit and Node only).
  • Docs. The "no React starter" statements are removed from the setup, action, host-compatibility and React guides and from the tour (with their tests); the guide's refused-pair example is now react-mcp on express. docs/attach-to-existing-backend.md is regenerated and gains a React/Hono recipe. templates/README.md and the development reference are updated.
  • Housekeeping. The template is in the root typecheck script, and templates/react-*/** is in release_paths of .version-policy.json.

Version

The change adds a template and one CLI pair and changes no SDK runtime behavior, so it follows the earlier Hapi starter and selects a patch bump (0.7.7-rc.1 to 0.7.8-rc.1 on every unit) with the footer below. Drop the footer for the automatic minor bump instead.

Version-Bump: patch

Evidence

Linux x64, Node 26.7.0, Playwright Chromium. The local host fixture is not an assistant host, and no host run is claimed.

  • npx vitest run scripts/starter-react-hono.test.ts: 35 headless cases. The generated output installs packed candidate tarballs with exact peers and no source alias, typechecks, builds and starts; over HTTP MCP the public, protected, missing-credential and concurrent-identity cases pass, plus the Hono Host/Origin cases.
  • scripts/saga-init-offered.test.ts runs the real saga init for every offered pair (including react-mcp on hono), installs the packed candidates and builds the project; scripts/saga.test.ts covers the refusals (destination exists, interruption, no implicit install, and the React stack on any other server).
  • Chromium (apps/lit-host/e2e/starter.spec.ts, all six starters, plus tour.spec.ts): 68 passed. For react-hono, the operation's result reaches the React view, "Clear the note" works with no server call, and teardown and pagehide leave #root empty and the retained button inert.
  • npm run guide:recipes -- --check, npm run typecheck (every step up to the retained Lynx fixture, whose own dependencies are not installed here), python3 scripts/mw-version.py check.
  • Full npx vitest run: 2698 passed. The remaining failures are environmental here and are not touched by this change: the Lynx fixture's packages are not installed, one test needs the full host build (it passes after npm run build -w @saga-a2ui/lit-host-app: scripts/candidate-identity.test.ts, 12 passed), and two verify-safeguards cases exceed their 5 s limit because tsx takes about 7 s to start on this machine (npx tsx scripts/check-test-discovery.ts runs clean).

`saga init --a2ui-stack react-mcp --server hono DIR` now creates a clean React
starter from a maintained `templates/react-hono`: the same public status,
protected account operation (a verifier that refuses every credential) and
local "Clear the note" action as the Lit starters, with a view written in
`.tsx` against `@saga-a2ui/react-mcp-stack` and React 19.3.1.

- `server/` is the `lit-hono` text. The view-artifact check in
  `server/operations.ts` reads a `VIEW_MARKER` that each template declares in
  `src/contract.ts`, so the same server text serves a Lit or a React page. The
  Hono qualification checks that the React copy stays byte-identical.
- The pair is qualified from generated output like the Lit pairs: packed
  packages with exact peers, typecheck, build, start, HTTP MCP cases and
  Chromium cases on the local host fixture. The checks that assumed Lit now
  read the template's stack: the stack-import and page-marker checks, the
  teardown selector, snippet extraction (`.tsx`, with a per-snippet language
  for the recipe fences), the packed set, the boundary scan and the stack
  import units. The Hono-only cases move to a shared helper.
- `saga init` offers the pair; `saga demo` stays Lit and Node only.
- Removes the "no React starter" statements from the guides and the tour, and
  regenerates the existing-backend recipes.
- Counts `templates/react-*/**` as product in the version policy and bumps the
  version.

@timeleft-- timeleft-- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed exact head aefffe2 against the React/Hono starter slice of the approved getting-started design at 6c3638b (public approval record #324). The delivery coordinator will record the actual landed SHA in the owning Blueprint Status after merge. No publication or real-host acceptance is claimed.

Independent validation on macOS arm64, Node v26.12.1/npm 11.20.0: 325 tests pass across starter-react-hono, starter-hono, starter-template, saga, saga-init-offered, consumer-boundary, consumer-stack-imports, guide and guide-actions-document. All six starters were built from packed candidates with sourceDirty=false. All 36 Chromium starter cases passed, including React result rendering, overlapping per-account requests, Clear with no request, wrong-build/failure clearing, teardown and pagehide with an inert retained control. Recipe freshness, version policy (using the submitted body/footer), diff hygiene and clean tracked state pass. The exact base 9863201 refuses the actual react-mcp/hono init command; the candidate's offered-pair tests generate, typecheck and build it. These are later regression checks, not proof of historical TDD chronology. The running root's events summarize qualification but do not expose that chronology.

[P2] Finish reconciling the current generated-tooling claims. Required scope explicitly removes the no-React-starter claims, but docs/getting-started.md:5 still says the CLI offers Lit templates, its current setup illustration (diagrams/saga-setup-paths.mmd and rendered outputs, caption at line 7) only offers a Lit starter, and docs/react-consumers.md:18 still refers to the absence of a generated React starter. Those first-use claims contradict the new supported command later in the same guides and can send a React reader away from the shipped path. Also docs/actions.md:479 puts the newly qualified React starter and generated recipe under Not shown instead of Shown. Update these current claims/illustration together to say React/Hono is offered, preserve the Lit-only demo and other unqualified-pair/host boundaries, regenerate and visually inspect affected diagram outputs under the existing LFS rules, and run the owning documentation checks. No broader guide rewrite or extra host qualification is requested.

The implementation and exercised behavior otherwise satisfy the selected starter scope. This is one consolidated documentation finding; unrelated prose preferences remain nonblocking.

Reconcile the first-use claims that still described a Lit-only CLI:
the getting-started introduction and setup illustration, the React
consumer guide, the public installation summary and the actions guide
Shown and Not shown table. The Lit-only demonstration and the other
unqualified React server pairs stay stated as boundaries.

@timeleft-- timeleft-- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Independent re-review of exact head 7085eeb. The consolidated current-documentation finding is resolved: the setup opening/caption and rendered setup illustration offer both Lit and React starters while preserving the Lit-only demo; the React guide states the qualified Hono route; the actions matrix now places qualified tooling under Shown, with other React pairs and real-host starter runs still unqualified. The same correction in public-install is in scope. I visually inspected the changed PNG and checked its editable Mermaid/Excalidraw and SVG changes; the labels are readable and agree. LFS pointers validate (22 artifacts).

The repair changes only documentation, diagram artifacts and the owning document assertion. Reused the exact initial head's still-valid starter evidence: 325 independent generated-starter/CLI/boundary/document checks and 36 Chromium cases across all six starters, including the React result, Clear, concurrent-account isolation and teardown/pagehide cases. On this repaired head, 141 affected documentation/boundary checks, generated-recipe freshness, submitted-body version policy and diff hygiene pass; tracked state is clean. Runtime: macOS arm64, Node v26.12.1/npm 11.20.0.

This implements the React/Hono starter slice of the approved getting-started design at 6c3638b (public approval #324), including the template/CLI integration, qualified server identity behavior, lifecycle and recipes. No remaining material finding. The delivery coordinator owns the post-merge landed-SHA mapping in getting-started tracks and the affected application-setup amendment, leaving game/guide/brand and remaining acceptance explicit. Required application CI is still in progress at the last read and must pass on the merge head; this is no claim of all-CI success, package publication, deployment, actual assistant-host acceptance or historical TDD chronology.

@timeleft--
timeleft-- merged commit 0ad4acb into main Oct 29, 2026
5 checks passed
@timeleft--
timeleft-- deleted the automation/tracked-d772ec2a4fe8 branch October 29, 2026 10:29
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.

2 participants