mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[PR #1604] [MERGED] fix(maps): use the chat's agent reference lorebook #1599
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#1599
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1604
Author: @SpicyMarinara
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/maps-agent-reference-lorebook-1603📝 Commits (10+)
3bb2c92fix(maps): start per-chat agent reference integration0e3bcb9feat(maps): deliver scoped reference lorebook support4a84bd0fix(maps): preserve reference host error responses25bc85efix(maps): preserve complete reference prompts within model context0e5912efix(maps): honor configured output caps in reference fit checksd7ae712fix(maps): accept omitted host context budget echoes726f5b1fix(maps): use checked output reserve for reference calls8853eabfix(maps): retain checked reserve for JSON repair2aa9e03Merge branch 'staging' into fix/maps-agent-reference-lorebook-16031160410fix(maps): ignore unusable output cap metadata📊 Changes
18 files changed (+975 additions, -169 deletions)
View changed files
📝
README.md(+3 -1)➕
artifacts/hierarchical-maps-1.7.0.zip(+0 -0)📝
catalog/catalog.json(+12 -12)📝
catalog/notes.json(+6 -0)📝
catalog/v2/catalog.json(+12 -12)📝
catalog/v2/notes.json(+6 -0)📝
catalog/v3/catalog.json(+12 -12)📝
catalog/v3/notes.json(+6 -0)📝
packages/hierarchical-maps/CHANGELOG.md(+3 -0)📝
packages/hierarchical-maps/client.js(+89 -81)📝
packages/hierarchical-maps/engine-boundary.json(+3 -3)📝
packages/hierarchical-maps/manifest.json(+9 -9)📝
packages/hierarchical-maps/server.mjs(+31 -28)📝
packages/hierarchical-maps/src/engine/packages/server/src/routes/spatial-context.routes.ts(+50 -2)📝
packages/hierarchical-maps/src/engine/packages/server/src/services/spatial-context/package-runtime.ts(+40 -1)📝
scripts/build-feature-packages.mjs(+4 -5)📝
scripts/hierarchical-maps-boundary.mjs(+3 -3)➕
tests/hierarchical-maps-agent-reference.regression.ts(+686 -0)📄 Description
Runtime teardown is classified across the complete request
The exact 1.7.0 ZIP now covers36 held-await controls. In 18 teardown cases, preview, generation, configuration/model resolution, provider completion and formatting repair return503
spatial_runtime_unavailable, including successful and rejected awaits in chat and global-template requests. None starts another model call after teardown. The 18 live-runtime controls preserve their normal200/400/502 behavior. The negative control returned200 from a preview after its real activation cleanup ran.A single scoped Fastify error boundary plus registration checks before requests and before responses cover the whole route plugin, including errors relabeled by nested catches. The guard retains only the runtime registration identity. Configured older hosts still return501
host_feature_unavailable. This fixes LOW4359687221 without changing the Engine API, English docs or reference/canon contracts.Final scoped CodeRabbit completed with zero findings across 8 text files; the ZIP was excluded from source upload and validated separately. Full local checks, Maps TypeScript, all catalog/locale/lane/notes gates and the complete exact-ZIP lifecycle pass. Two rebuilds reproduce all 10 output hashes. Fresh strict base191e72 is merged, and every non-Maps entry remains unchanged across all 3 catalogs, including Slurp 0.4.0 and Gacha Forge 1.10.1.
Negative control,36-case result, validation logs, artifact reproduction hashes and final scoped review: all 11 raw proof files match local bytes. Earlier full feature and repair reviews remain in the PR history. Fresh hosted checks and an actual Viable Dottore verdict for this final head remain merge gates.
Linked issue
Closes #1603. Package-side completion of Pasta-Devs/Marinara-Engine#8145; requires the Engine host contract in Pasta-Devs/Marinara-Engine#8153. Owned by @SpicyMarinara (Codex).
Why this change
World Maps owns model requests outside the normal agent pipeline. The chat's selected reference lorebook therefore did not reach map generation, even when its setting appeared in the Engine. World Maps 1.7.0 supplies normally triggered entries to its chat-specific requests.
Review contract decisions
The per-agent lorebook is an extra reference, not a replacement for the builder’s authoritative, cited lore catalog. Lore-grounded requests still require explicit source IDs (
generateSpatialMapDraftRequestSchema), and strict canon still requires catalogsourceKeys(groundingPromptLinesand plan normalization). The review suggestion to bypass an unavailable catalog when reference entries exist would weaken that existing contract; it is intentionally declined. Actual preview/generation regressions provelore_expandandlore_strictrefuse missing or unavailable catalog selections even with an attached reference, while setup previews use the reference normally.World Maps 1.7.0 is an unshipped version introduced only by this PR; live staging still has 1.6.0. Repairs to this unpublished archive stay in 1.7.0 rather than manufacturing a patch release.
Only a positive, finite whole-token output cap reduces the valid requested reserve. Hosts reporting zero as an uncapped sentinel, negative/non-finite values or fractional metadata retain the normal reserve; actual public-host route tests prove those calls remain valid.
The output-budget review finding is repaired at the public host boundary: the same capped reserve is passed to both
fitContextandchatComplete, including the malformed-JSON repair call. The current Engine provider also clamps the connection cap, but a valid public host need not duplicate that behavior. A real-route fixture reproduced 12,000 requested after fitting 2,048 before the repair and now observes matching 2,048 values.What changed
46faa1ad32a945054a94b88971349908151b773b.Validation
Required local
npm run check, catalog lanes, package locales, catalog/artifact integrity and release-note checks pass. Maps typecheck and the existing UI contract regression pass. A second build reproduced all ten generated output hashes byte-for-byte.The new regression activates the actual ZIP against the real Engine runtime and storage. It verifies Roleplay/Game chat isolation, default-off, disabled/missing books and unmatched entries, additive explicit sources, preview without model calls, create/replace/expand requests, global-template exclusion, normal host-budget enforcement, finite-model context rejection without model calls, the connection's saved output cap, omitted/reduced public budget echoes, actual fit/call reserve parity, authoritative-catalog refusal controls, and the actual missing-host preview/generation HTTP error envelopes (501, stable code and readable message). Running it on shipped World Maps 1.6.0 fails at the missing reference assertion. The missing-host route assertion also reproduced the previous generic “Not Implemented” message before its fix. Model completions use a local fixture; no paid provider was called.
The existing exact-artifact lifecycle regression passes, including update, offline restart, removal/reinstall, backup/restore, shared worlds, and chat history preservation. Hosted checks and Dottore Review remain separate merge gates. Local CodeRabbit review results are recorded in the PR conversation.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.