Skip to content

Phase 13 plan — journal and lifecycle commands - #56

Merged
mmacy merged 2 commits into
mainfrom
phase-13-plan
Aug 7, 2026
Merged

Phase 13 plan — journal and lifecycle commands#56
mmacy merged 2 commits into
mainfrom
phase-13-plan

Conversation

@mmacy

@mmacy mmacy commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Implementation plan for phase 13 of the spec: the engine substrate for authored triggers and quests, with no interpreter — the optional source field on the base command model, session-state blocks for trigger fired-marks and the journal, the MarkTriggerFired/AddJournalEntry/RecordNote referee commands with their events, the journal in the player view, and additive persistence of the new blocks. Phase 13 is order-independent of phase 12 (landed) and must precede phase 14, whose interpreter issues these commands and reads this state.

Notable decisions

  • source is one field on the base Command (str | None, min_length=1), inherited everywhere, read by nothing in execution — pinned by a twin-session state-equality test, not prose. Serialization consequence planned: the four goldens that store serialized commands (phase4_delve, phase5_milestone, phase11_gates including its refusals block, phase12_wipe) regenerate with "source": null keys as the entire diff.
  • Re-marking a fired trigger is idempotent-accept: state records the first firing, the event records each one. Load-bearing because replay_game raises on any rejected replayed command — a rejecting re-mark would poison every replay of a repeatable trigger's log under phase 14's semantics.
  • Fired-marks are a list[str] in first-fired order — ordered and deterministic where sets are banned; nothing consumes a count.
  • JournalEntry carries text plus a rounds clock stamp, pinned because append-time is capturable only at append: the view API promises front ends never replay the event log, and a compacted save sheds the log entirely. The plan argues the naming divergence from DeathRecord.round explicitly. The player view ships the entries verbatim (the spec's word) — no mirror view model.
  • Visibility follows the flag precedent: journal-entry events player-visible (authored text as content data, the spec's carve-out); trigger-fired and note events referee-visibility. Fired-marks never reach the player view.
  • Everything is additive at schema_version 3: two new payload keys with empty defaults, no migration, no new rejection codes, no Ruleset flag, no spec edit, and no adaptations entry — the phase touches no SRD text (B/X has no journal or trigger machinery; verified by search).

Review provenance

Rubber-ducked by a fresh skeptical reviewer with the ordered reading list (spec, phase 11/12 plans, AGENTS.md, the touched code, the goldens). First-pass verdict: SOLID, with four non-blocking wording/citation findings — the journal load expression shown as a raw-dict get instead of the per-entry model_validate pattern, the golden-regeneration fact citing session_state instead of the generators' own dumps (and omitting phase11_gates's refusals block), a docstring-framing justification attributed to a module docstring that never carried it, and the unremarked rounds/round naming divergence. All four were folded in and re-verified by the same reviewer, context intact: each fix CONFIRMED, final verdict SOLID. The reviewer's verified-good list covered, among ~23 checks: the four-golden census, the absence of any SRD surface, spec fidelity of the three commands' semantics and visibilities, the census/docs-gate mechanics, the cycle-free views.py import of JournalEntry, and the fuzzer impact of the new required string fields.

https://claude.ai/code/session_013aS1Fbhon3y9aipXJ8s24a

mmacy added 2 commits August 6, 2026 08:46
Four non-blocking sign-off notes from the review, each folded in: the
journal load expression now shows the per-entry model_validate pattern
(death_records precedent) instead of a raw-dict get; the golden-regeneration
fact cites the generators' own command dumps as the serialization site and
names phase11_gates's refusals block as part of the diff; the interpreter
framing for the command docstrings cites the spec rather than a module
docstring that never carried it; and the JournalEntry.rounds naming
divergence from DeathRecord.round is acknowledged with its rationale.

Claude-Session: https://claude.ai/code/session_013aS1Fbhon3y9aipXJ8s24a
@mmacy
mmacy merged commit 2b4dbc2 into main Aug 7, 2026
9 of 15 checks passed
@mmacy
mmacy deleted the phase-13-plan branch August 7, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant