[PR #1390] [MERGED] fix(relationship-tracker): 0.7.1 review and fix a rejected History answer #1437

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1390
Author: @NoblezDomain
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/relationship-tracker-0.7.1


📝 Commits (3)

  • 1d1a7c8 fix(relationship-tracker): 0.7.1 review and fix a rejected History answer
  • f6da65b fix(relationship-tracker): 0.7.1 release History review chat text promptly
  • 862cf0f Merge branch 'staging' into fix/relationship-tracker-0.7.1

📊 Changes

15 files changed (+840 additions, -87 deletions)

View changed files

➕ artifacts/relationship-tracker-0.7.1.zip (+0 -0)
📝 catalog/catalog.json (+14 -14)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+14 -14)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+14 -14)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/relationship-tracker/CHANGELOG.md (+7 -0)
📝 packages/relationship-tracker/README.md (+1 -0)
📝 packages/relationship-tracker/client.js (+276 -6)
📝 packages/relationship-tracker/history.mjs (+459 -19)
📝 packages/relationship-tracker/manifest.json (+11 -11)
📝 packages/relationship-tracker/persona-tracking.mjs (+10 -2)
📝 packages/relationship-tracker/server.mjs (+7 -1)
📝 packages/relationship-tracker/tracking.mjs (+9 -6)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1336

Why this change

  • Update from History failed with "The history update model returned an invalid relationship delta: Each history update references an unknown character alias". There was no way to see the model's answer or recover from it, and most users of the tracker aren't technical.
  • The likely cause is the model putting the persona alias (p0) or an NPC's name into a character pair in u. History rejects the whole answer, as its contract requires, and the error didn't say which alias was wrong.

What changed

  • A rejected History answer now comes back to the Tracker Panel as editable changes:
    • character names instead of aliases;
    • a plain-words problem on each change, e.g. "“Mira” isn't a character card in this chat" or "Mention Bob by name in “How Alice sees Bob”";
    • the raw answer under Details for bug reports.
  • New package route POST /api/relationship-tracker/v1/chats/:chatId/history-update/review saves the fixed changes:
    • through the same strict History checks, against the rejected run's message window and aliases;
    • one package document per save, so relationship changes and persona perceptions get separate buttons;
    • refused if that document's revision, the active persona, or the assigned cards changed since the run.
  • Reviews live only in server memory, at most 20 at a time. A review is released once everything in it is saved, after 30 minutes, on the chat's next History run, or when the package stops, and an answer with nothing to save is not kept. The review is kept off the error's enumerable properties, so the model's answer (chat-derived text) stays out of server error logs.
  • The prompt keeps the persona alias and names out of u. A character paired with the persona in u is offered as that character's perception.
  • Other fixes:
    • errors name the unknown alias;
    • an omitted empty u or p list means no change;
    • a persona-only save reports its perceptions instead of "saved 0 relationship changes".
  • Generated outputs: artifacts/relationship-tracker-0.7.1.zip (248,153 bytes, sha256 c401f92789a6c541ad220cf86e45e538075e86b6324b5ac60bd59da42ea83d52), the three catalog lanes, and the notes sidecars, all rebuilt with node scripts/build-relationship-tracker-package.mjs.

Package and security impact

  • Affected package IDs: relationship-tracker (0.7.0 → 0.7.1)
  • Engine compatibility impact: none. The Engine range (2.4.4 to below 4.0.0) and Capability API 1.14 are unchanged, and there are no Engine changes.
  • New or changed permissions/entrypoints: no new permissions or entrypoints. One new package-owned privileged route, history-update/review, under the existing routes permission. The public read API is unchanged.
  • Restart, storage, update, or uninstall impact: restart required, as before. No storage schema change and no migration; reviews are in memory only.

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

Manual verification notes

  • Run locally, all passing:
    • npm run check (no warnings in relationship-tracker files);
    • node scripts/test-catalog-lanes.mjs;
    • node scripts/validate-package-locales.mjs;
    • node scripts/validate-catalog.mjs;
    • node scripts/tests/catalog-release-notes.regression.mjs;
    • git diff --check.
  • Rerunning the builder left no diff.
  • In the Relationship Tracker source tree, node validate-phase5.mjs passes 193/193 regression tests. 19 of them are new: review building, plain-words issues, strict save, stale/expired/replaced reviews, releasing reviews on expiry, once saved and over the cap, the persona pair filed under u, separate saves for a mixed answer, the omitted list, and the client review UI.
  • The review panel was exercised in a browser with the real client.js and mocked package routes, at Tracker Panel width and 375 px: editing, choosing a character, removing, saving one kind, and dismissing.
  • Not yet done: installing or updating through Marinara Engine, a real History failure against a live model, and a physical touch device.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

Package README and CHANGELOG updated; no catalog README or Engine documentation changes.

UI evidence (if applicable)

Screenshots from the browser check (mocked routes, real client):

What a failed run shows Persona card, save buttons, bug-report details After saving the relationship changes
Review cards with plain-words problems Persona card, separate save buttons, Details for bug reports Success message with the remaining persona change

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Update from History now presents suggested changes for review when the model’s answer can’t be used. Edit or remove suggestions before saving; relationship changes and persona perceptions can be saved separately.
    • View the original answer under Details for bug reports.
  • Bug Fixes
    • Improved handling of persona aliases in character pairs and clearer alias error messages.
    • Update from History accepts an omitted empty list and reports how many persona perceptions were saved.

🔄 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/1390 **Author:** [@NoblezDomain](https://github.com/NoblezDomain) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/relationship-tracker-0.7.1` --- ### 📝 Commits (3) - [`1d1a7c8`](https://github.com/Pasta-Devs/Marinara-Agents/commit/1d1a7c868ab29364c1c776e43159608090bf7b4a) fix(relationship-tracker): 0.7.1 review and fix a rejected History answer - [`f6da65b`](https://github.com/Pasta-Devs/Marinara-Agents/commit/f6da65bd806baa18b9ae1c360cb136f68e2272d1) fix(relationship-tracker): 0.7.1 release History review chat text promptly - [`862cf0f`](https://github.com/Pasta-Devs/Marinara-Agents/commit/862cf0f2f4fa6e4e43b194dca38be00c057e222b) Merge branch 'staging' into fix/relationship-tracker-0.7.1 ### 📊 Changes **15 files changed** (+840 additions, -87 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/relationship-tracker-0.7.1.zip` (+0 -0) 📝 `catalog/catalog.json` (+14 -14) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+14 -14) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+14 -14) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/relationship-tracker/CHANGELOG.md` (+7 -0) 📝 `packages/relationship-tracker/README.md` (+1 -0) 📝 `packages/relationship-tracker/client.js` (+276 -6) 📝 `packages/relationship-tracker/history.mjs` (+459 -19) 📝 `packages/relationship-tracker/manifest.json` (+11 -11) 📝 `packages/relationship-tracker/persona-tracking.mjs` (+10 -2) 📝 `packages/relationship-tracker/server.mjs` (+7 -1) 📝 `packages/relationship-tracker/tracking.mjs` (+9 -6) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1336 ## Why this change - Update from History failed with "The history update model returned an invalid relationship delta: Each history update references an unknown character alias". There was no way to see the model's answer or recover from it, and most users of the tracker aren't technical. - The likely cause is the model putting the persona alias (`p0`) or an NPC's name into a character pair in `u`. History rejects the whole answer, as its contract requires, and the error didn't say which alias was wrong. ## What changed - A rejected History answer now comes back to the Tracker Panel as editable changes: - character names instead of aliases; - a plain-words problem on each change, e.g. "“Mira” isn't a character card in this chat" or "Mention Bob by name in “How Alice sees Bob”"; - the raw answer under **Details for bug reports**. - New package route `POST /api/relationship-tracker/v1/chats/:chatId/history-update/review` saves the fixed changes: - through the same strict History checks, against the rejected run's message window and aliases; - one package document per save, so relationship changes and persona perceptions get separate buttons; - refused if that document's revision, the active persona, or the assigned cards changed since the run. - Reviews live only in server memory, at most 20 at a time. A review is released once everything in it is saved, after 30 minutes, on the chat's next History run, or when the package stops, and an answer with nothing to save is not kept. The review is kept off the error's enumerable properties, so the model's answer (chat-derived text) stays out of server error logs. - The prompt keeps the persona alias and names out of `u`. A character paired with the persona in `u` is offered as that character's perception. - Other fixes: - errors name the unknown alias; - an omitted empty `u` or `p` list means no change; - a persona-only save reports its perceptions instead of "saved 0 relationship changes". - Generated outputs: `artifacts/relationship-tracker-0.7.1.zip` (248,153 bytes, sha256 `c401f92789a6c541ad220cf86e45e538075e86b6324b5ac60bd59da42ea83d52`), the three catalog lanes, and the notes sidecars, all rebuilt with `node scripts/build-relationship-tracker-package.mjs`. ## Package and security impact - Affected package IDs: `relationship-tracker` (0.7.0 → 0.7.1) - Engine compatibility impact: none. The Engine range (2.4.4 to below 4.0.0) and Capability API 1.14 are unchanged, and there are no Engine changes. - New or changed permissions/entrypoints: no new permissions or entrypoints. One new package-owned privileged route, `history-update/review`, under the existing `routes` permission. The public read API is unchanged. - Restart, storage, update, or uninstall impact: restart required, as before. No storage schema change and no migration; reviews are in memory only. ## 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` ### Manual verification notes - Run locally, all passing: - `npm run check` (no warnings in relationship-tracker files); - `node scripts/test-catalog-lanes.mjs`; - `node scripts/validate-package-locales.mjs`; - `node scripts/validate-catalog.mjs`; - `node scripts/tests/catalog-release-notes.regression.mjs`; - `git diff --check`. - Rerunning the builder left no diff. - In the Relationship Tracker source tree, `node validate-phase5.mjs` passes 193/193 regression tests. 19 of them are new: review building, plain-words issues, strict save, stale/expired/replaced reviews, releasing reviews on expiry, once saved and over the cap, the persona pair filed under `u`, separate saves for a mixed answer, the omitted list, and the client review UI. - The review panel was exercised in a browser with the real `client.js` and mocked package routes, at Tracker Panel width and 375 px: editing, choosing a character, removing, saving one kind, and dismissing. - **Not yet done:** installing or updating through Marinara Engine, a real History failure against a live model, and a physical touch device. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation Package README and CHANGELOG updated; no catalog README or Engine documentation changes. ## UI evidence (if applicable) Screenshots from the browser check (mocked routes, real client): | What a failed run shows | Persona card, save buttons, bug-report details | After saving the relationship changes | | --- | --- | --- | | <img width="260" alt="Review cards with plain-words problems" src="https://github.com/user-attachments/assets/4c8906d8-93d4-49ed-a8ff-a492dda5f3fb" /> | <img width="260" alt="Persona card, separate save buttons, Details for bug reports" src="https://github.com/user-attachments/assets/165151cd-f981-4068-b64f-5d3cb7dadce9" /> | <img width="260" alt="Success message with the remaining persona change" src="https://github.com/user-attachments/assets/823c8952-99c2-4972-8b13-9cb31e139d4b" /> | 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit * **New Features** * Update from History now presents suggested changes for review when the model’s answer can’t be used. Edit or remove suggestions before saving; relationship changes and persona perceptions can be saved separately. * View the original answer under **Details for bug reports**. * **Bug Fixes** * Improved handling of persona aliases in character pairs and clearer alias error messages. * Update from History accepts an omitted empty list and reports how many persona perceptions were saved. <!-- 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:11:26 +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#1437
No description provided.