Skip to content

Implementation Log: ANU-18 - Bento Host Save, Stable Focus, and Template Catalog

Approval and boundary

  • Girish approved the exact ImplementationPlan on 2026-07-27.
  • Implementation is limited to the Bento-owned protocol, contract, editor session/Store adapter, catalog generation, packaging, tests, browser harness, and durable repository documentation described by that plan.
  • Presentation contract, player protocol/artifact, renderer, and template-family object schema remain compatibility invariants.

Baseline

Item Evidence
Branch base bef9c3f49fe1d7018b495f3987ba4657d358ff10
Branch codex/anu-18-add-bento-host-save-stable-focus-and-packaged-te
Node v24.18.0
npm 10.9.2
TypeScript 5.8.3
Vite 7.3.6
Pre-implementation docs timestamp 2026-07-27T15:27:23.4455605Z
Docs preview CLI-owned http://127.0.0.1:4005, review URL https://bento1.girishd.com

Baseline verification

Command Result
npm ci Passed; 79 packages installed
npm run build Passed; TypeScript and Vite production build
node ..\scripts\test-sync.ts Passed all 45,362 convergence checks
npm run test:anuva Passed 103 contract, 37 adapter, and 162 editor checks

The baseline install did not require an escalated network retry. The Vite build retained the existing third-party Rollup comment-position warning and completed successfully.

Decisions

Area Decision Source
Save path Host manual/autosave requests, visible Save, and Ctrl+S converge on one validated AnuvaEditorSession.saveRequest path. Approved plan
Focus Expose only stable slide identity and navigation through Store.goTo; do not mutate currentIndex directly. Approved plan
Catalog Generate JSON by importing createAnuvaTemplateFamilies(); do not maintain a copied family fixture. Approved plan
Versions Advance editor protocol, editor artifact, and package distribution to 1.1.0; preserve presentation/player/family object versions. Approved plan
Security Keep exact origin/source validation, hard-offline mode, host persistence authority, license, and notices. Linear and approved plan

Implementation evidence

Source map

  • packages/anuva-bento-contract/
  • package/editor protocol 1.1.0 constants and declarations;
  • closed request union and runtime/JSON-Schema parity;
  • stable save/focus/duplicate errors; and
  • closed anuva/bento-template-catalog 1.0.0 validation.
  • slides/src/anuva/editor-session.ts, editor-bridge.ts, and main.ts
  • one manual/autosave save path, duplicate-ID ledger, stable Store navigation, and real per-surface active-slide reporting.
  • slides/src/anuva/template-families.ts, slides/vite.anuva-template-catalog.ts, and scripts/build-anuva-template-catalog.ts
  • one shared deterministic catalog serializer used by dev and production builds.
  • scripts/package-anuva-editor.ts
  • ANU-18 artifact path plus catalog descriptor, capability, hash, license, and notice enforcement.
  • scripts/test-anuva-editor.ts, scripts/test-anuva-editor-session.ts, and slides/src/anuva/editor-host-entry.ts
  • closed-shape, session invariant, browser, correlation, focus, catalog, and hard-offline coverage.

Focused verification

Command or check Result
npx tsc -b --pretty false Passed
npm run test:editor Passed 231 protocol/editor/schema/catalog checks and 31 session checks after completion-review fix
npm run build:anuva Passed; generated Signal/Paper catalog
npm run package:editor Passed; 14 pre-manifest files
two clean editor package rebuilds Byte-stable manifest and catalog identities
contract npm run build Passed
contract npm pack --dry-run Passed after completion-review fix with 43 files; 39.9 kB packed, 223.0 kB unpacked, shasum 2fd30ab5a50a18c44d5ad2ba46894eb62b00f715

The first dry-run pack attempt could not write the sandbox-external npm user cache. The approved escalated retry used the existing npm tooling and passed; no package publication occurred.

Artifact identities

Item Identity
Editor artifact working/anu-18/anuva-bento-editor-1.1.0/
Manifest SHA-256 27db22300a9e471d24c474879ace7fbdbe1e3b6f3e7e9aad197e4e463d86088b
Catalog path template-catalog.json
Catalog SHA-256 63f487f7f65d3d62ce0b6cf395aca2b4db4daeac04a6fa6f4a14f159f56cb440
Ordered family IDs signal-family, paper-family
Versions artifact/protocol/package 1.1.0; presentation/player/family schema 1.0.0; renderer 1.0.8-anuva-renderer.1

The catalog descriptor digest equals the packaged bytes, its file-list entry, and the clean-rebuild digest. The artifact retains LICENSE and THIRD_PARTY_NOTICES.md.

Browser and security evidence

The real production host/editor harness passed:

PASS — catalog signal-family,paper-family; manual/autosave correlation;
three-surface focus; revision production-1 → production-2; renderer
1.0.8-anuva-renderer.1; no external requests or page errors

The first browser run found that the dev catalog URL fell through to HTML. The fix introduced the shared Vite catalog plugin, so dev and production now serve bytes from the same serializer. A clean browser rerun passed catalog validation, non-first-slide focus on all three surfaces, repeated-focus idempotency, missing/wrong-surface failures, duplicate request rejection, manual/autosave correlation, revision acknowledgement, and the network deny rule.

The browser inspection layer separately logged a URL-less MutationObserver error in its isolated controller context. The host and iframe page-owned error and unhandledrejection arrays remained empty, and the final harness passed. No Anuva runtime source introduced a MutationObserver.

Final regression

Command Result
documented Windows single-file build Passed; compressed shell 1170 KB to 580 KB
npm run build Passed; existing third-party Rollup PURE-comment warning only
node ..\scripts\test-sync.ts Passed all 45,362 convergence checks
npm run test:anuva Passed after completion-review fix: 103 contract, 37 adapter, 231 editor/schema/catalog, and 31 session checks
npm run build:anuva Passed
npm run package:editor Passed; manifest and catalog identities above
npm run package:player Passed; 10 files; manifest SHA-256 df806b6541cf5bffa1803917a0628d9079bef75109cac979e4275f7630c50042

No test was skipped. Generated build and handoff directories remain ignored local evidence and were not published or deployed.

Documentation evidence

Check Result
anuva docs validate-indexes --repository current Passed; no missing or empty indexes
anuva docs ensure --repository current --confirm Passed strict build and ensured the CLI-owned preview
final completion-report wait HTTP 200, strict-build verified, rendered SHA-256 5e369efa9dbdae7e1c6079ccc96919b5f1e981e0550d693c1f9978986e88055e against the recorded pre-edit timestamp
anuva docs links Returned exact HTTPS links for all 15 changed documentation pages

Primary review pages:

Recovery and local services

The user stopped the local Tobii Service because it held the repository docs preview port. The CLI-owned MkDocs preview then used port 4005. The service remains a local recovery item and is not changed by repository source.

Delivery evidence

  • Guarded implementation commit: 8e7a7cabb5eede85cfba75a77fb5b15bff9742f5.
  • gh auth status passed immediately before the first GitHub-backed operation.
  • anuva pr create ANU-18 --draft --confirm pushed the branch, created draft PR #6, linked it to ANU-18, and moved Linear from In Progress to In Review.
  • No merge, ready transition, release, deployment, or Done transition was performed.

Completion-review evidence

  • Review input head: fe6990a29c8ac27f4875ef797253f76908fcab66.
  • Reviewed implementation and schema-parity fix commit: 229989e9664e821c2ed730b7aab7ad78e9085c72.
  • PR #6 was open, draft, cleanly mergeable, and had no configured checks, reviews, requested changes, or unresolved review comments.
  • Review found that editor.schema.json omitted the public editor response and event variants required by the approved plan even though runtime requests were correctly closed.
  • The in-scope fix adds closed response, validation-issue, operation-result, ready, save-request, dirty/revision, operation-result, and error event schema definitions plus focused parity assertions.
  • npm run test:editor passed 231 editor/schema/catalog and 31 session checks.
  • npm run test:anuva passed all 402 checks across the contract, adapter, editor/schema/catalog, and session suites.
  • Two clean npm run package:editor rebuilds reproduced manifest SHA-256 27db22300a9e471d24c474879ace7fbdbe1e3b6f3e7e9aad197e4e463d86088b; catalog SHA-256 remained 63f487f7f65d3d62ce0b6cf395aca2b4db4daeac04a6fa6f4a14f159f56cb440.
  • Contract npm pack --dry-run passed with 43 files, 39.9 kB packed, 223.0 kB unpacked, and shasum 2fd30ab5a50a18c44d5ad2ba46894eb62b00f715.
  • Completion-review docs timestamp: 2026-07-27T16:11:59.9359288Z.
  • Recursive index validation and the strict MkDocs build passed. Fresh HTTP 200 preview comparison verified the CompletionReport at rendered SHA-256 bd96c42e9c7b248224a79ac7d40c29b1e9eba8d4bc29f8f6177e608bf379e6a1 and the normative editor-host protocol at rendered SHA-256 2512e58cc6ecd33454d9ddba987e22870d52a0b6b372b5065407bdffa2f16d60.