mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5149] [MERGED] Capability API 1.12: spatial transition events for the game-owning Experience #6650
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#6650
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-Engine/pull/5149
Author: @kolacheee
Created: 8/16/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @kolacheee
Base:
staging← Head:feat/5143-experience-spatial-events📝 Commits (3)
919c320feat(capability): address spatial transition events to the game-owning Experience (capability API 1.12)89b9ff9fix(client): streamEvents carries the parsed error body on its ApiError22f9e86fix(capability): synthesize spatial rejects only on definitive evidence (review round)📊 Changes
9 files changed (+209 additions, -29 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
docs/development/optional-agent-packages.md(+24 -0)📝
packages/client/src/hooks/use-generate.ts(+41 -9)📝
packages/client/src/hooks/use-spatial-context.ts(+62 -6)📝
packages/client/src/lib/api-client.ts(+13 -4)📝
packages/client/src/lib/capability-client-events.ts(+21 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+4 -1)📝
scripts/regressions/capability-package-lifecycle.regression.ts(+5 -5)📝
scripts/regressions/roleplay-streaming.regression.ts(+37 -4)📄 Description
Linked issue
Closes #5143
Why this change
sendMessage'spendingSpatialTransitionargument) never learns whether the move committed or was rejected — the spatial capability events are addressed tohierarchical-mapsonly. The reference Experience (Pixelforge) ships a two-turn stale-count heuristic as a stand-in, and every future Experience would need the same hack. During implementation a second, pre-existing gap surfaced that affects World Maps itself: on the game/roleplay owner-turn path the commit runs before the SSE stream opens, so a rejected transition surfaces only as an HTTP error and no reject event exists at all.What changed
dispatchSpatialCapabilityEvent(new, incapability-client-events.ts) dual-dispatches every spatial event: once tohierarchical-maps, once to the chat'sgameExperienceIdpackage when present. Addressing stays filter-by-own-id — an addressed second dispatch, never a broadcast.use-generate.ts, the finally-blockspatial_context_refresh, and the REST commit success + onError-recovery paths inuse-spatial-context.ts), with the owning package id resolved lazily from the cached chat row.spatial_transition_rejected(with the errorcodein the payload) when a transition lands inneeds_review.streamEventsnow carries the parsed error body on itsApiErrorso that code is actually reachable.supportedCapabilityApi→ 1.12 (soft seam per the 1.11 precedent: delivered regardless of declaredcapabilityApi; a package declares 1.12 only to require the events). No manifest vocabulary changes.docs/development/optional-agent-packages.md(includes thestep_by_step/complete: falsekeep-pending rule). CHANGELOG entry added.roleplay-streamingdispatch-shape pins updated, plus two new pins on the dual-dispatch contract and the reject synthesis.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Performed by the submitting agent (boxes above intentionally left for the human reviewer):
pnpm checkgreen;node scripts/run-regressions.mjs --filter roleplay-streamingpasses with the updated and added pins.spatial_transition_committedaddressed topixelforgewith the matching commandId (pending journey resolved the moment the turn settled); a deliberately stale map revision delivered the synthesizedspatial_transition_rejectedwithcode: "spatial_transition_stale_definition"and the journey cleared immediately. World Maps behavior unchanged throughout (its own events still arrive as before).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)For the reviewer: this PR updates
CHANGELOG.mdanddocs/development/optional-agent-packages.md, and[docs-i18n]follow-up issue #5150 is already open for the language-pack mirror. No version bump.Summary by CodeRabbit
Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.