[PR #5674] [MERGED] fix(agents): make Beholder's bare and missing flags manual-only #6876

Closed
opened 2026-10-23 04:14:31 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5674
Author: @GetBeholder
Created: 8/30/2026
Status: ✅ Merged
Merged: 8/30/2026
Merged by: @GetBeholder

Base: staging ← Head: fix/beholder-manual-only-flags


📝 Commits (10+)

  • 8d12f94 fix(agents): make Beholder's bare and missing flags manual-only
  • ef952e5 Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags
  • f79e7d9 test(agents): update the Beholder slot expectation to the manual-only contract
  • a8f05ec fix(agents): only excuse a refused Beholder delta on a real slot
  • 6708c05 Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags
  • c14bdde Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags
  • 68926db Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags
  • 86fadfa fix(agents): keep manual flags across a full snapshot
  • c6a903e Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags
  • 6f2c36d fix(agents): match names case-insensitively and keep the carried state normalized

📊 Changes

3 files changed (+310 additions, -3 deletions)

View changed files

📝 packages/server/src/services/agents/beholder-state.ts (+90 -2)
➕ scripts/regressions/beholder-manual-only-flags.regression.ts (+209 -0)
📝 scripts/regressions/prompt.regression.ts (+11 -1)

📄 Description

Pull request

Linked issue

Closes #

Why this change

  • The extractor may propose missing and bare; Beholder should not apply either on its own. Both are destructive when wrong — missing takes over a slot outright and cascades distally, bare contradicts whatever is worn there.
  • The model is not reliable at them. Measured against the held-out eval set (85 per-character rows, frozen scorer):
flag tp fp fn
bare 3 5 12
missing 0 0 1

bare is more wrong than right, and missing was never emitted at all — so this costs three true positives and saves five false ones.

  • The reference extractor has refused model-set missing for the same reason since its first release, and now refuses bare alongside it. This brings the agent in line.

What changed

  • beholder-state.ts: both flags are stripped in resolveBeholderStateResponse, the single point where a model reply becomes state, so the delta path and the full-snapshot path are covered together. Nothing else in the reply is touched — worn_remove in particular still works, and there is a test for it.
  • A delta whose entire content was those flags now resolves as a valid no-op instead of "empty or unusable state delta". The agent refused it on purpose; surfacing that as an extraction failure would hand the operator an error they can neither act on nor reproduce.
  • Nothing outside the Beholder agent's own files is touched.

Package and security impact

  • Affected package IDs: beholder (agent behaviour only; no manifest or catalog change)
  • Engine compatibility impact: none — no schema, route or contract change
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none. Existing stored state is untouched; only newly proposed flags are refused.

Validation

  • node ./scripts/run-regressions.mjs --filter scripts/regressions/beholder-manual-only-flags.regression.ts passes
  • All four pre-existing beholder-* regressions still pass
  • tsc --noEmit -p packages/server/tsconfig.json clean for the changed file
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup

Manual verification notes

The two unticked boxes are honest: this is a server-side behaviour change with no package payload, so there is nothing to install, and I verified it through the regression harness rather than a live chat.

New regression covers: a delta proposing missing does not take the slot; a delta proposing bare does not take the slot and does not disturb what is worn there; the flags are dropped while wounds and held items in the same slot survive; a full-snapshot reply is stripped the same way; and worn_remove still removes the named garment.

Documentation impact

  • No documentation changes needed

UI evidence (if applicable)

None — no UI change.

Summary by CodeRabbit

  • Bug Fixes

    • Improved Beholder state processing by ignoring unsupported missing and bare flags in generated responses.
    • Responses containing only these flags are now handled as valid no-ops, while other invalid responses remain errors.
    • Existing manually authored state and garment-removal behavior remain unaffected.
    • Reported worn items and wounds continue to be preserved and merged correctly.
  • Tests

    • Added regression coverage for full snapshots, deltas, wound merging, and garment removal.

🔄 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-Engine/pull/5674 **Author:** [@GetBeholder](https://github.com/GetBeholder) **Created:** 8/30/2026 **Status:** ✅ Merged **Merged:** 8/30/2026 **Merged by:** [@GetBeholder](https://github.com/GetBeholder) **Base:** `staging` ← **Head:** `fix/beholder-manual-only-flags` --- ### 📝 Commits (10+) - [`8d12f94`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d12f94b477ed1b6b41f5797b1ed8a8c7b08603a) fix(agents): make Beholder's bare and missing flags manual-only - [`ef952e5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ef952e56420bbc538bf4201e988dc832ce282130) Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags - [`f79e7d9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f79e7d907b38fcf00edf0df639a1354d0b81e8c2) test(agents): update the Beholder slot expectation to the manual-only contract - [`a8f05ec`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a8f05ec0b5db78d9186dd5a594d3bbb9534b676d) fix(agents): only excuse a refused Beholder delta on a real slot - [`6708c05`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6708c0508f33e24581b37434038f6b8ee1afeb28) Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags - [`c14bdde`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c14bdded98d73af3fe01fc0c4cb9df136ef4578d) Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags - [`68926db`](https://github.com/Pasta-Devs/Marinara-Engine/commit/68926db7f38cc7f76be1115759f2e1a6df9d130b) Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags - [`86fadfa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/86fadfacbc25e89c9d32dac290b169f4e67c6700) fix(agents): keep manual flags across a full snapshot - [`c6a903e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c6a903e48e4902189563787d633faa975db16749) Merge remote-tracking branch 'origin/staging' into fix/beholder-manual-only-flags - [`6f2c36d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6f2c36d16f19ceaab66a03ffaccc4816f33d0737) fix(agents): match names case-insensitively and keep the carried state normalized ### 📊 Changes **3 files changed** (+310 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/agents/beholder-state.ts` (+90 -2) ➕ `scripts/regressions/beholder-manual-only-flags.regression.ts` (+209 -0) 📝 `scripts/regressions/prompt.regression.ts` (+11 -1) </details> ### 📄 Description # Pull request ## Linked issue Closes # ## Why this change - The extractor may propose `missing` and `bare`; Beholder should not apply either on its own. Both are destructive when wrong — `missing` takes over a slot outright and cascades distally, `bare` contradicts whatever is worn there. - The model is not reliable at them. Measured against the held-out eval set (85 per-character rows, frozen scorer): | flag | tp | fp | fn | |---|---|---|---| | `bare` | 3 | **5** | 12 | | `missing` | 0 | 0 | 1 | `bare` is more wrong than right, and `missing` was never emitted at all — so this costs three true positives and saves five false ones. - The reference extractor has refused model-set `missing` for the same reason since its first release, and now refuses `bare` alongside it. This brings the agent in line. ## What changed - `beholder-state.ts`: both flags are stripped in `resolveBeholderStateResponse`, the single point where a model reply becomes state, so the delta path and the full-snapshot path are covered together. Nothing else in the reply is touched — `worn_remove` in particular still works, and there is a test for it. - A delta whose entire content was those flags now resolves as a **valid no-op** instead of `"empty or unusable state delta"`. The agent refused it on purpose; surfacing that as an extraction failure would hand the operator an error they can neither act on nor reproduce. - Nothing outside the Beholder agent's own files is touched. ## Package and security impact - Affected package IDs: `beholder` (agent behaviour only; no manifest or catalog change) - Engine compatibility impact: none — no schema, route or contract change - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none. Existing stored state is untouched; only newly proposed flags are refused. ## Validation - [x] `node ./scripts/run-regressions.mjs --filter scripts/regressions/beholder-manual-only-flags.regression.ts` passes - [x] All four pre-existing `beholder-*` regressions still pass - [x] `tsc --noEmit -p packages/server/tsconfig.json` clean for the changed file - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup ### Manual verification notes The two unticked boxes are honest: this is a server-side behaviour change with no package payload, so there is nothing to install, and I verified it through the regression harness rather than a live chat. New regression covers: a delta proposing `missing` does not take the slot; a delta proposing `bare` does not take the slot and does not disturb what is worn there; the flags are dropped while wounds and held items in the same slot survive; a full-snapshot reply is stripped the same way; and `worn_remove` still removes the named garment. ## Documentation impact - [x] No documentation changes needed ## UI evidence (if applicable) None — no UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved Beholder state processing by ignoring unsupported `missing` and `bare` flags in generated responses. * Responses containing only these flags are now handled as valid no-ops, while other invalid responses remain errors. * Existing manually authored state and garment-removal behavior remain unaffected. * Reported worn items and wounds continue to be preserved and merged correctly. * **Tests** * Added regression coverage for full snapshots, deltas, wound merging, and garment removal. <!-- 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-23 04:14:31 +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-Engine#6876
No description provided.