[PR #664] [MERGED] beholder: bring the panel up to the reference extension #1078

Closed
opened 2026-10-21 05:02:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/664
Author: @GetBeholder
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @GetBeholder

Base: staging ← Head: feat/beholder-ui-parity


📝 Commits (10+)

  • 9e67ebe beholder: build state from the chat, reach every slot, and drop the new-tab control
  • b78ed41 beholder: say which model answers, and split Doctor from Inspector
  • b93f624 beholder: a roster, and make every view reachable on a phone
  • 7ed53a3 beholder: stop the icon shim from defeating the responsive rules
  • 196fef7 beholder: stop shadowing the reference chrome, and open views in the panel
  • 40af75c beholder: say when the prose is outside what the small model reads
  • 05fabe3 beholder: gate the prose warning on vocabulary, not word count
  • 799306e beholder: a Doctor report people can paste
  • a9ed385 beholder: state the boundary to everyone instead of detecting it
  • 72d6179 beholder: correct a false claim about multi-character scenes

📊 Changes

37 files changed (+8418 additions, -596 deletions)

View changed files

📝 .github/workflows/pull-request-checks.yml (+6 -0)
📝 .gitignore (+3 -0)
📝 artifacts/beholder-1.3.7.zip (+0 -0)
📝 catalog/catalog.json (+4 -4)
📝 catalog/v2/catalog.json (+4 -4)
📝 catalog/v3/catalog.json (+4 -4)
📝 eslint.config.mjs (+5 -0)
📝 packages/beholder/client.js (+3131 -312)
📝 packages/beholder/manifest.json (+2 -2)
➕ packages/beholder/src/11-garment-vocab.js (+171 -0)
📝 packages/beholder/src/30-paperdoll.js (+19 -1)
📝 packages/beholder/src/40-ui.js (+7 -2)
📝 packages/beholder/src/50-editor.js (+164 -22)
➕ packages/beholder/src/52-sheet.js (+237 -0)
➕ packages/beholder/src/54-roster.js (+121 -0)
📝 packages/beholder/src/55-sidecar.js (+4 -0)
➕ packages/beholder/src/56-banner.js (+238 -0)
➕ packages/beholder/src/58-inspector.js (+115 -0)
➕ packages/beholder/src/59-report.js (+194 -0)
📝 packages/beholder/src/60-views.js (+637 -49)

...and 17 more files

📄 Description

Pull request

Linked issue

Closes #665

Why this change

  • Parity with the reference extension had been claimed three times and was wrong three times. Each time the question "do we have X?" was answered by grepping the package and finding a hit in style.css, which carries the reference's entire stylesheet and matches whether or not anything renders it. The backfill bar, the slot sheet and the note box were all "present" by that test and absent from the product. There was no honest way to answer the question, because every test here asserts that something written is present and so can only fail if that work is deleted.
  • The gap itself: no way to tell Beholder something directly; Doctor showed checks but not the facts behind them, and nothing showed what Beholder had actually been doing, so "never ran", "ran and failed" and "ran and found nothing" were indistinguishable; no sign that a newer model exists although the engine can already tell; no first-run explanation; locking was a checkbox that named the control rather than its state, with an unstyled mark on the card; nothing marked the values you set yourself; merging only offered names already on screen; no way to start over; and no way to see which message changed what, which is the question you have when something is wrong.

What changed

  • Measurement first. tests/beholder-parity.regression.ts inverts the test: it starts from the reference's surface, reads only the package's JavaScript, and so fails on a feature that was never written. It runs in CI and prints 232/232 of portable surface rendered (100%), 0 missing, 33 deliberately not ported. Each exclusion carries a written reason and the test fails if one is missing or too short, so "not ported" cannot become a place to park work. The final exclusion is bh-field, which wraps the reference's endpoint / model / API-key form — extraction here runs server-side, so there is no endpoint to type and no form for it to wrap.
  • Note box (74-notebox.js) — type "Maggie takes off her boots" and it is read as a line of the story with the current state as context; the slots it touches are locked afterwards.
  • Doctor — a vitals grid and a table of the last five reads, rendered from the same function as the copyable report so the two cannot disagree.
  • Model updates (56-banner.js) — shown only when the engine can actually tell, dismissible per published version.
  • First-run note (76-onboard.js), the colour legend, a real lock switch and its card mark, pencil marks on hand-set slots, merging by typing a name that is not on screen yet, a two-press "start over", and per-message badges (78-badges.js).
  • Affected package outputs rebuilt: packages/beholder/client.js, manifest.json, artifacts/beholder-1.3.7.zip, and all three catalog lanes.
  • eslint.config.mjs — the beholder globals block lists names that are defined in sibling modules and concatenated into one scope at build time. It had fallen behind by five (BH_SLOT_LABELS, BH_GARMENT_WORDS, BH_PACKAGE_VERSION, OFF_BODY_SLOTS, familyOf); declared rather than worked around.

Package and security impact

  • Affected package IDs: beholder
  • Engine compatibility impact: the note box and the badges need Pasta-Devs/Marinara-Engine#5695. Please merge that first. The manifest range is unchanged (>=2.4.4 <4.0.0) because the package degrades rather than breaking: the badges and Doctor's recent-reads section simply do not render on an older engine. The one case that could not degrade quietly is the note box — an engine without directive support accepts the request and ignores the field, re-running the turn against the story, so it would look like it worked and do something else. It now probes a route that shipped alongside the directive and disables itself with an explanation when the engine predates both. If you would rather gate on the version instead, say so and I will raise engine.min once staging carries the Engine change.
  • New or changed permissions/entrypoints: none. Same conversation-toolbar slot, same entrypoint, no new permissions.
  • Restart, storage, update, or uninstall impact: no restart requirement change. New localStorage keys, all namespaced marinara.beholder.* — edited.<chatId> (hand-set slots) and onboarded / updateDismissed (both global, both single values). "Start over" clears this chat's locks, pinned values, edit marks and roster together, and deliberately leaves the global keys alone.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Also ran node scripts/test-catalog-lanes.mjs and node scripts/validate-package-locales.mjs — both pass. Formatting is clean under the repository's pinned Prettier.

The modes-and-uninstall box is left unticked deliberately. Chat modes and restart behaviour were exercised — desktop and narrow layouts, and the package reinstalled and driven through repeated engine restarts — but uninstall cleanup was not tested, so the box stays as it is.

Manual verification notes

Driven against a local Marinara Engine build with the package installed, using a Playwright suite that clicks through the real interface rather than inspecting source: tests/beholder-ui-parity.e2e.mjs, 102 checks, passing twice in a row. It seeds its own starting state, because it asserts that a directive changes something and a second run against the state the first left behind reported a false failure purely from run order.

Checks worth naming: a directive updates the state it mentions and leaves every other character intact; the slots it changed end up locked; every value in Doctor's vitals grid appears in the pasted report; the recent-reads table reports when, how long and what was found; the lock switch changes its label and aria-checked, and its card mark picks up the ported stylesheet's computed style rather than merely existing; an applied edit reaches the server; the first-run note appears once and stays gone after dismissal; the update strip appears for an available update, names both versions, spins a real spinner, remembers dismissal per version, and stays hidden for an update that could not be confirmed; the badges describe the change rather than the whole body, are coloured by the kind of change, and are removed when Beholder is closed. Behaviour on an engine without the new routes was checked by stubbing them to 404.

Two of the suite's own checks could not fail and were fixed. One read window.BH, which lives inside the bundle's IIFE, so every assertion built on it passed while seeing nothing. The other stubbed a response the service worker re-issued — requests made there do not pass through Playwright's interception — so on any reload the real response silently replaced the stub.

Bugs the verification caught, rather than the features: badges painted additions as removals, because the colour was computed before the state loaded; sidecar responses were cacheable, though every one answers "right now"; the download spinner never span, because the reference relies on FontAwesome's fa-spin and this package ships an icon shim; and the lock mark on cards used a class of our own invention that the ported stylesheet has no rule for, so it rendered unstyled.

Documentation impact

  • No documentation changes needed

Catalog membership, compatibility and setup are unchanged. The user-visible behaviour that changed is explained inside the package itself — the first-run note and the Help view.

UI evidence (if applicable)

The browser suite is the evidence: it drives the real interface and reports each check by name, including the computed styles where "the element exists" was not enough.

Notes on writing into the host's message list

The per-message badges deserve calling out. This package does not own that DOM and the host's contract has no per-message slot, so the row is appended from outside. That is only acceptable under rules the code keeps: append only, so the host's reconciliation is never handed a node that moved; idempotent, so re-running is always safe; and self-healing through a MutationObserver, so a re-render that drops the row puts it back. This was measured before it was written — an appended node survives a chat switch, a scroll and composer input with no errors from the host. The badges belong to Beholder, so closing it takes them away.

If that trade is not wanted, removing 78-badges.js and its dock wiring takes the package back to 97% and changes nothing else.

🤖 Generated with Claude Code

https://claude.ai/code/session_01992DGH2exasKGaJiqRnteC

Summary by CodeRabbit

  • New Features

    • Added character roster management with hiding, aliases, merging, and drag-to-reorder support.
    • Added slot picker, editing, locking, directive input, and message change badges.
    • Added backfill options for reprocessing recent or complete chat history.
    • Added Inspector and Doctor views with diagnostics, health checks, reports, and state reset tools.
    • Added model status/update banners, onboarding guidance, and clearer scope messaging.
  • Bug Fixes

    • Toast notifications now display correctly.
    • Improved editor dismissal, keyboard accessibility, narrow-panel navigation, and state persistence.
  • Tests

    • Expanded automated coverage for UI behavior and reference-interface parity.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/664 **Author:** [@GetBeholder](https://github.com/GetBeholder) **Created:** 8/31/2026 **Status:** ✅ Merged **Merged:** 8/31/2026 **Merged by:** [@GetBeholder](https://github.com/GetBeholder) **Base:** `staging` ← **Head:** `feat/beholder-ui-parity` --- ### 📝 Commits (10+) - [`9e67ebe`](https://github.com/Pasta-Devs/Marinara-Agents/commit/9e67ebe85ecf644d10df37f072ecb41cd8691ab6) beholder: build state from the chat, reach every slot, and drop the new-tab control - [`b78ed41`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b78ed41cd017dd4f930d5d7ee08fbd94dcb64641) beholder: say which model answers, and split Doctor from Inspector - [`b93f624`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b93f62423246499b71a87bfae39a96a66eed2743) beholder: a roster, and make every view reachable on a phone - [`7ed53a3`](https://github.com/Pasta-Devs/Marinara-Agents/commit/7ed53a31fa1005df385f104b5973afdcab620ad2) beholder: stop the icon shim from defeating the responsive rules - [`196fef7`](https://github.com/Pasta-Devs/Marinara-Agents/commit/196fef774d6904bbb295fba78691768e89cf8de1) beholder: stop shadowing the reference chrome, and open views in the panel - [`40af75c`](https://github.com/Pasta-Devs/Marinara-Agents/commit/40af75cf22fef4399038b3c1fbfd77013cf61f7c) beholder: say when the prose is outside what the small model reads - [`05fabe3`](https://github.com/Pasta-Devs/Marinara-Agents/commit/05fabe378c42c41ad0158d5d8b3df0734a2f3db0) beholder: gate the prose warning on vocabulary, not word count - [`799306e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/799306eaad15ae4763715ae550571573584dff10) beholder: a Doctor report people can paste - [`a9ed385`](https://github.com/Pasta-Devs/Marinara-Agents/commit/a9ed38518cf1cbaed8534f5ecb5974501f4a6f64) beholder: state the boundary to everyone instead of detecting it - [`72d6179`](https://github.com/Pasta-Devs/Marinara-Agents/commit/72d6179a7c3c2609fd2ac325e8a21ed7b4ef270f) beholder: correct a false claim about multi-character scenes ### 📊 Changes **37 files changed** (+8418 additions, -596 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/pull-request-checks.yml` (+6 -0) 📝 `.gitignore` (+3 -0) 📝 `artifacts/beholder-1.3.7.zip` (+0 -0) 📝 `catalog/catalog.json` (+4 -4) 📝 `catalog/v2/catalog.json` (+4 -4) 📝 `catalog/v3/catalog.json` (+4 -4) 📝 `eslint.config.mjs` (+5 -0) 📝 `packages/beholder/client.js` (+3131 -312) 📝 `packages/beholder/manifest.json` (+2 -2) ➕ `packages/beholder/src/11-garment-vocab.js` (+171 -0) 📝 `packages/beholder/src/30-paperdoll.js` (+19 -1) 📝 `packages/beholder/src/40-ui.js` (+7 -2) 📝 `packages/beholder/src/50-editor.js` (+164 -22) ➕ `packages/beholder/src/52-sheet.js` (+237 -0) ➕ `packages/beholder/src/54-roster.js` (+121 -0) 📝 `packages/beholder/src/55-sidecar.js` (+4 -0) ➕ `packages/beholder/src/56-banner.js` (+238 -0) ➕ `packages/beholder/src/58-inspector.js` (+115 -0) ➕ `packages/beholder/src/59-report.js` (+194 -0) 📝 `packages/beholder/src/60-views.js` (+637 -49) _...and 17 more files_ </details> ### 📄 Description # Pull request ## Linked issue Closes #665 ## Why this change - Parity with the reference extension had been claimed three times and was wrong three times. Each time the question "do we have X?" was answered by grepping the package and finding a hit in `style.css`, which carries the reference's entire stylesheet and matches whether or not anything renders it. The backfill bar, the slot sheet and the note box were all "present" by that test and absent from the product. There was no honest way to answer the question, because every test here asserts that something written is present and so can only fail if that work is deleted. - The gap itself: no way to tell Beholder something directly; Doctor showed checks but not the facts behind them, and nothing showed what Beholder had actually been doing, so "never ran", "ran and failed" and "ran and found nothing" were indistinguishable; no sign that a newer model exists although the engine can already tell; no first-run explanation; locking was a checkbox that named the control rather than its state, with an unstyled mark on the card; nothing marked the values you set yourself; merging only offered names already on screen; no way to start over; and no way to see which message changed what, which is the question you have when something is wrong. ## What changed - **Measurement first.** `tests/beholder-parity.regression.ts` inverts the test: it starts from the reference's surface, reads only the package's JavaScript, and so fails on a feature that was never written. It runs in CI and prints `232/232 of portable surface rendered (100%), 0 missing, 33 deliberately not ported`. Each exclusion carries a written reason and the test fails if one is missing or too short, so "not ported" cannot become a place to park work. The final exclusion is `bh-field`, which wraps the reference's endpoint / model / API-key form — extraction here runs server-side, so there is no endpoint to type and no form for it to wrap. - **Note box** (`74-notebox.js`) — type "Maggie takes off her boots" and it is read as a line of the story with the current state as context; the slots it touches are locked afterwards. - **Doctor** — a vitals grid and a table of the last five reads, rendered from the same function as the copyable report so the two cannot disagree. - **Model updates** (`56-banner.js`) — shown only when the engine can actually tell, dismissible per published version. - **First-run note** (`76-onboard.js`), the colour legend, a real lock switch and its card mark, pencil marks on hand-set slots, merging by typing a name that is not on screen yet, a two-press "start over", and per-message badges (`78-badges.js`). - **Affected package outputs rebuilt**: `packages/beholder/client.js`, `manifest.json`, `artifacts/beholder-1.3.7.zip`, and all three catalog lanes. - **`eslint.config.mjs`** — the beholder globals block lists names that are defined in sibling modules and concatenated into one scope at build time. It had fallen behind by five (`BH_SLOT_LABELS`, `BH_GARMENT_WORDS`, `BH_PACKAGE_VERSION`, `OFF_BODY_SLOTS`, `familyOf`); declared rather than worked around. ## Package and security impact - Affected package IDs: `beholder` - Engine compatibility impact: the note box and the badges need Pasta-Devs/Marinara-Engine#5695. **Please merge that first.** The manifest range is unchanged (`>=2.4.4 <4.0.0`) because the package degrades rather than breaking: the badges and Doctor's recent-reads section simply do not render on an older engine. The one case that could not degrade quietly is the note box — an engine without directive support accepts the request and ignores the field, re-running the turn against the story, so it would look like it worked and do something else. It now probes a route that shipped alongside the directive and disables itself with an explanation when the engine predates both. If you would rather gate on the version instead, say so and I will raise `engine.min` once staging carries the Engine change. - New or changed permissions/entrypoints: none. Same `conversation-toolbar` slot, same entrypoint, no new permissions. - Restart, storage, update, or uninstall impact: no restart requirement change. New `localStorage` keys, all namespaced `marinara.beholder.*` — `edited.<chatId>` (hand-set slots) and `onboarded` / `updateDismissed` (both global, both single values). "Start over" clears this chat's locks, pinned values, edit marks and roster together, and deliberately leaves the global keys alone. ## Validation - [x] `node scripts/validate-catalog.mjs` passes locally - [x] `git diff --check` passes locally - [x] Rebuilt every affected manifest, payload, artifact, and catalog entry - [x] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [x] Read and followed `CONTRIBUTING.md` Also ran `node scripts/test-catalog-lanes.mjs` and `node scripts/validate-package-locales.mjs` — both pass. Formatting is clean under the repository's pinned Prettier. The modes-and-uninstall box is left unticked deliberately. Chat modes and restart behaviour were exercised — desktop and narrow layouts, and the package reinstalled and driven through repeated engine restarts — but **uninstall cleanup was not tested**, so the box stays as it is. ### Manual verification notes Driven against a local Marinara Engine build with the package installed, using a Playwright suite that clicks through the real interface rather than inspecting source: `tests/beholder-ui-parity.e2e.mjs`, **102 checks, passing twice in a row**. It seeds its own starting state, because it asserts that a directive *changes* something and a second run against the state the first left behind reported a false failure purely from run order. Checks worth naming: a directive updates the state it mentions and leaves every other character intact; the slots it changed end up locked; every value in Doctor's vitals grid appears in the pasted report; the recent-reads table reports when, how long and what was found; the lock switch changes its label and `aria-checked`, and its card mark picks up the ported stylesheet's computed style rather than merely existing; an applied edit reaches the server; the first-run note appears once and stays gone after dismissal; the update strip appears for an available update, names both versions, spins a real spinner, remembers dismissal per version, and stays hidden for an update that could not be confirmed; the badges describe the change rather than the whole body, are coloured by the kind of change, and are removed when Beholder is closed. Behaviour on an engine without the new routes was checked by stubbing them to 404. Two of the suite's own checks could not fail and were fixed. One read `window.BH`, which lives inside the bundle's IIFE, so every assertion built on it passed while seeing nothing. The other stubbed a response the service worker re-issued — requests made there do not pass through Playwright's interception — so on any reload the real response silently replaced the stub. Bugs the verification caught, rather than the features: badges painted additions as removals, because the colour was computed before the state loaded; sidecar responses were cacheable, though every one answers "right now"; the download spinner never span, because the reference relies on FontAwesome's `fa-spin` and this package ships an icon shim; and the lock mark on cards used a class of our own invention that the ported stylesheet has no rule for, so it rendered unstyled. ## Documentation impact - [x] No documentation changes needed Catalog membership, compatibility and setup are unchanged. The user-visible behaviour that changed is explained inside the package itself — the first-run note and the Help view. ## UI evidence (if applicable) The browser suite is the evidence: it drives the real interface and reports each check by name, including the computed styles where "the element exists" was not enough. ## Notes on writing into the host's message list The per-message badges deserve calling out. This package does not own that DOM and the host's contract has no per-message slot, so the row is appended from outside. That is only acceptable under rules the code keeps: **append only**, so the host's reconciliation is never handed a node that moved; **idempotent**, so re-running is always safe; and **self-healing** through a MutationObserver, so a re-render that drops the row puts it back. This was measured before it was written — an appended node survives a chat switch, a scroll and composer input with no errors from the host. The badges belong to Beholder, so closing it takes them away. If that trade is not wanted, removing `78-badges.js` and its dock wiring takes the package back to 97% and changes nothing else. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01992DGH2exasKGaJiqRnteC <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added character roster management with hiding, aliases, merging, and drag-to-reorder support. - Added slot picker, editing, locking, directive input, and message change badges. - Added backfill options for reprocessing recent or complete chat history. - Added Inspector and Doctor views with diagnostics, health checks, reports, and state reset tools. - Added model status/update banners, onboarding guidance, and clearer scope messaging. - **Bug Fixes** - Toast notifications now display correctly. - Improved editor dismissal, keyboard accessibility, narrow-panel navigation, and state persistence. - **Tests** - Expanded automated coverage for UI behavior and reference-interface parity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:02:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Agents#1078
No description provided.