Skip to content

Harden emergent memory and plot continuity - #16

Merged
dajiaohuang merged 1 commit into
mainfrom
audit/memory-plot-backtest-20260830
Aug 30, 2026
Merged

Harden emergent memory and plot continuity#16
dajiaohuang merged 1 commit into
mainfrom
audit/memory-plot-backtest-20260830

Conversation

@dajiaohuang

Copy link
Copy Markdown
Contributor

Summary

This hardens long-running CoC campaigns across four confirmed defect classes.

  1. Memory retrieval and lifecycle
    • Page objective-memory and ActorKnowledge search through Core authority offsets instead of truncating after 100 results.
    • Resolve up to 128 exact event:<id> actor-memory references through Core branch, participant, knowledge-disclosure, and audience policy, even when the event is older than the 200-event recent window and the lexical query is blank.
    • Keep exact references ahead of ordinary candidates under the deterministic memory budget and retain the existing inactive/superseded/forgotten lifecycle semantics.
  2. Monotonic plot continuity
    • Reject deletion or regression of established front, story-thread, character-arc, visited-scene, opportunity, and evidence history.
    • Keep branch, snapshot, and undo/redo recovery as the explicit rewind paths.
  3. Evidence-backed emergent progression
    • Require front/thread/arc evidence references to resolve on the checked-out branch before accepting playthrough progress.
    • Accept real branch events, snapshots, memory facts, Atlas scenes, design clues, and committed NPC conversations while rejecting forged or sibling-branch references.
  4. Runtime/contract consistency
    • Align the public catalog and documentation with 52 tools, NPC proposal v5, Snapshot v9, inactive-memory behavior, monotonic progress, and active-branch evidence.
    • Pin the locked lane to Core 59173c2fe3b80637a0890062dff381b38aa325fe. This includes the search-offset contract first merged at c53cb8a419929c1c6ef18306bbd275efe636c270 and the bounded exact actor-event read used here.

Root cause and approach

The CoC search facades previously materialized only the first 100 Core-ranked results and paged that truncated list locally. Actor memory similarly combined only 200 recent events with non-blank lexical matches, so a durable exact reference could disappear. Plot replacement validated shape but not historical monotonicity, and progress evidence was syntactically valid without being attested against branch authority.

The adapters now forward bounded pagination and exact-event reads to Core, deduplicate authority records by stable id, and leave ranking/visibility decisions at the appropriate Core or CoC selector boundary. Plot validation and evidence attestation are enforced before state replacement.

Verification

Final verification against canonical Core 59173c2fe3b80637a0890062dff381b38aa325fe:

  • uv sync --frozen --all-packages --all-extras
  • Domain: 92 passed
  • MCP: 79 passed, including public-tool tests for 105-result pagination, full memory CRUD/retirement, forged evidence rejection, and exact old-event recall without Keeper-only or other-actor disclosure
  • Ruff: all checks passed
  • CoC Full Skills validator: 52 tools
  • CoC Module Generator Skill validator: passed
  • git diff --check, JSON/YAML parsing, Python compilation, tracked Markdown link validation, and credential-pattern scan: passed

The repository-wide audit also ran the unchanged UI lane: 4 tests passed, Astro check reported no errors/warnings/hints, and the production build generated four pages.

Limitations

  • Some non-search Core list paths still materialize a complete branch head; this is a performance risk rather than a reproduced correctness failure.
  • Exact actor-event recall is intentionally bounded to 128 references per context request.
  • Plot evidence event attestation is bounded by the current Core offset ceiling (approximately 100,100 active-branch events).
  • The campaign backtests use hermetic public MCP calls, real stdio/HTTP protocol tests, and authored/emergent Pack fixtures; they do not include a paid live-model nondeterministic long run.
  • The public site is deployed from a separate repository, so this repository cannot prove detailed page-by-page deployment parity.

@dajiaohuang
dajiaohuang merged commit 9a4d61b into main Aug 30, 2026
4 checks passed
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