mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8301] [MERGED] feat(macros): expose the tracked world clock in prompts #8266
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#8266
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/8301
Author: @SpicyMarinara
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/world-state-time-macros-1669📝 Commits (6)
e89a113feat(macros): expose tracked world date and time9d95594test(macros): verify tracked clocks across agent prompts and selected swipes6bce9edfix(macros): keep tracked clock values literal and previews on the selected snapshotf269258test(macros): capture tracked clocks at the generation boundary4d96103fix(macros): localize world-clock reference descriptions79a2c41fix(macros): load stored clocks for assembly-only previews📊 Changes
15 files changed (+436 additions, -11 deletions)
View changed files
📝
docs/prompts/macros.md(+8 -1)📝
e2e/core-flows.e2e.ts(+4 -0)📝
packages/client/src/components/ui/MacroTextarea.tsx(+5 -1)📝
packages/client/src/lib/slash-commands.ts(+7 -4)📝
packages/client/src/localization/locales/en.json(+3 -0)📝
packages/server/src/routes/chats.routes.ts(+7 -5)📝
packages/server/src/routes/generate.routes.ts(+2 -0)📝
packages/server/src/routes/generate/dry-run-route.ts(+2 -0)📝
packages/server/src/routes/generate/retry-agents-route.ts(+13 -0)📝
packages/server/src/services/agents/agent-executor.ts(+10 -0)📝
packages/server/src/services/prompt/assembler.ts(+3 -0)📝
packages/server/src/services/prompt/macro-context.ts(+9 -0)📝
packages/shared/src/utils/macro-engine.ts(+59 -0)📝
scripts/regressions/prompt.regression.ts(+1 -0)➕
scripts/regressions/world-state-time-macros.regression.ts(+303 -0)📄 Description
Linked issue
Closes Pasta-Devs/Marinara-Agents#1669
Why this change
Prompt authors can read the real clock but cannot use World State's scene clock to control other agents. A fictional date must also stay fictional when the user changes swipes or regenerates a reply.
What changed
Add
{{date.world_state}},{{time.world_state}}, and{{weekday.world_state}}to prompts, conditionals and agent templates. Date/time retain their tracked text; weekday accepts a custom Weekday/Day of Week field, an explicit weekday, or a valid ISO date. Missing values are empty. Existing real-world macros retain their behavior.Generation, dry-run, retry agents and live prompt preview use the selected story state. Assembly-only callers also load the stored clock when neither state input is supplied; explicit null preserves an intentionally empty clock. One cached snapshot promise keeps preview clock and lorebook processing consistent. Tracked strings are inserted literally after executable macro passes.
The reference modal and current-language slash help use semantic localization keys for the new descriptions.
Validation
Full
pnpm checkand completepnpm regression:promptpassed on repair head79a2c4179, including localization, formatting, lint/types and production builds.The new real-database assembly-only regression fails on the prior head and passes with the fallback repair. Explicit
worldState: nullandgameState: nullstay empty. Existing prompt, assembler-macro-budget and past-reasoning-history regressions pass unchanged apart from declaring a card-only fixture's intentionally absent snapshot store.The maintained world-clock regression also covers literal/conditional macros, agent-template escaping, selected-swipe dry-run/preview, and prompts captured by a local SSE provider in Conversation, Roleplay, Game, merged group and both individual speakers. No external provider calls.
Existing reasoning-macro regressions passed. The macro-reference UI case passed on desktop Chromium, mobile Chromium and mobile WebKit.
Substantive local CodeRabbit findings were addressed. One earlier missing-generation-wiring finding was rejected after a current-code trace and an unchanged provider regression replay; that disposition is recorded in the conversation. The final three-file assembler repair review completed with zero findings.
Dottore's assembler fallback defect was reproduced and repaired. Its lorebook-context/null-return questions were traced separately: content resolvers retain the selected macro context and the storage methods return null when no snapshot exists.
Local container validation is unavailable because the installed Docker daemon is not running. Hosted container checks remain a merge gate.
Manually verify tracked scene clocks in prompt and agent templates.
Manually verify swipe/regeneration clocks and existing real-world timezone behavior.
Docs and release impact
Updated
docs/prompts/macros.md; translated documentation follow-up #8303. No release or storage-format change.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.