Skip to content

[codex] Save V.0.5.3.2.5 project snapshot - #28

Draft
4Um4 wants to merge 2 commits into
V.0.5.3.2.4_Всё_вижу_и_создаюfrom
V.0.5.3.2.5_Всё_вижу_и_создаю

Hidden character warning

The head ref may contain hidden characters: "V.0.5.3.2.5_\u0412\u0441\u0451_\u0432\u0438\u0436\u0443_\u0438_\u0441\u043e\u0437\u0434\u0430\u044e"
Draft

4Um4 wants to merge 2 commits into
V.0.5.3.2.4_Всё_вижу_и_создаюfrom
V.0.5.3.2.5_Всё_вижу_и_создаю

Conversation

@4Um4

@4Um4 4Um4 commented Jun 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Saved the current local project state into branch V.0.5.3.2.5_Всё_вижу_и_создаю.
  • Included the full staged snapshot from the working tree: backend services, sandbox validation, reports, and Open_road save/session data.

Validation

  • Commit hook compile check completed successfully.
  • Push hook sandbox tests passed: 7 passed.

Notes

  • Commit hook reported ADR IMPACT AUDIT REQUIRED as a warning for architecture-impacting files, but the hook completed with [OK] and accepted the commit.
  • PR targets the previous project branch because GitHub reported no common history between this branch line and main.

Summary by Sourcery

Усиление детерминизма симуляции NPC и распространения причинно-следственных состояний при сохранении последнего проверенного снимка проекта.

New Features:

  • Добавить детерминированную обработку решений NPC и постоянное выполнение подготовленных действий (action windup) между тиками.
  • Поддержать социальные взаимодействия, обновление отношений, резервную обработку торговли, голосовые профили NPC и улучшения начального состояния аватаров.
  • Расширить покрытие причинно-следственной валидации для персистентности, убеждений, травм, скрытой правды, голосового поведения и сопротивляемости аватаров.

Bug Fixes:

  • Восстановить контекст решений NPC и повествовательный вывод, чтобы результаты симуляции были видимы для DM-пайплайна.
  • Улучшить персистентность хроники уровня L1 и запись причинно-следственных событий для директив, давления, затухания, боя, урона и страха.
  • Устранить отсутствующие привязки кампаний, входные данные world effective-drive и пространственные данные NPC в пайплайне.

Enhancements:

  • Улучшить логирование критически важных сервисов и обеспечить детерминированность случайности при повторном проигрывании решений для каждого NPC в ходе симуляции.
  • Добавить дедупликацию подготовленных действий (windup) и изоляцию кампаний для отложенных боевых событий.

Documentation:

  • Добавить лицензию проекта и обновить отчёты сессий с учётом текущего состояния симуляции и рендеринга.

Tests:

  • Расширить песочницу причинно-следственной валидации, включив сценарии социальных взаимодействий, боя, персистентности, убеждений и поведенческой целостности.

Chores:

  • Сохранить обновлённые снимки сессии Open_road, тиков мира, кампаний и профилей персонажей.
Original summary in English

Summary by Sourcery

Strengthen NPC simulation determinism and causal state propagation while saving the latest validated project snapshot.

New Features:

  • Add deterministic NPC decision processing and persistent action windup execution across ticks.
  • Support social interactions, relationship updates, trade fallback handling, NPC voice profiles, and avatar starting state enhancements.
  • Extend causal validation coverage for persistence, beliefs, trauma, hidden truths, voice behavior, and avatar resistance.

Bug Fixes:

  • Restore NPC decision context and narrative output so simulation results are visible to the DM pipeline.
  • Improve L1 chronicle persistence and causal event recording for directives, pressure, decay, combat, damage, and fear.
  • Resolve missing campaign bindings, world effective-drive inputs, and NPC spatial pipeline data.

Enhancements:

  • Improve critical service logging and enforce per-NPC replay-deterministic randomness throughout simulation decisions.
  • Add windup deduplication and campaign isolation for delayed combat events.

Documentation:

  • Add the project license and update session reports with current simulation and rendering health.

Tests:

  • Expand sandbox causal validation to cover social, combat, persistence, belief, and behavioral integrity scenarios.

Chores:

  • Save updated Open_road session, world-tick, campaign, and character-profile snapshots.
Original summary in English

Summary by Sourcery

Усиление детерминизма симуляции NPC и распространения причинно-следственных состояний при сохранении последнего проверенного снимка проекта.

New Features:

  • Добавить детерминированную обработку решений NPC и постоянное выполнение подготовленных действий (action windup) между тиками.
  • Поддержать социальные взаимодействия, обновление отношений, резервную обработку торговли, голосовые профили NPC и улучшения начального состояния аватаров.
  • Расширить покрытие причинно-следственной валидации для персистентности, убеждений, травм, скрытой правды, голосового поведения и сопротивляемости аватаров.

Bug Fixes:

  • Восстановить контекст решений NPC и повествовательный вывод, чтобы результаты симуляции были видимы для DM-пайплайна.
  • Улучшить персистентность хроники уровня L1 и запись причинно-следственных событий для директив, давления, затухания, боя, урона и страха.
  • Устранить отсутствующие привязки кампаний, входные данные world effective-drive и пространственные данные NPC в пайплайне.

Enhancements:

  • Улучшить логирование критически важных сервисов и обеспечить детерминированность случайности при повторном проигрывании решений для каждого NPC в ходе симуляции.
  • Добавить дедупликацию подготовленных действий (windup) и изоляцию кампаний для отложенных боевых событий.

Documentation:

  • Добавить лицензию проекта и обновить отчёты сессий с учётом текущего состояния симуляции и рендеринга.

Tests:

  • Расширить песочницу причинно-следственной валидации, включив сценарии социальных взаимодействий, боя, персистентности, убеждений и поведенческой целостности.

Chores:

  • Сохранить обновлённые снимки сессии Open_road, тиков мира, кампаний и профилей персонажей.
Original summary in English

Summary by Sourcery

Strengthen NPC simulation determinism and causal state propagation while saving the latest validated project snapshot.

New Features:

  • Add deterministic NPC decision processing and persistent action windup execution across ticks.
  • Support social interactions, relationship updates, trade fallback handling, NPC voice profiles, and avatar starting state enhancements.
  • Extend causal validation coverage for persistence, beliefs, trauma, hidden truths, voice behavior, and avatar resistance.

Bug Fixes:

  • Restore NPC decision context and narrative output so simulation results are visible to the DM pipeline.
  • Improve L1 chronicle persistence and causal event recording for directives, pressure, decay, combat, damage, and fear.
  • Resolve missing campaign bindings, world effective-drive inputs, and NPC spatial pipeline data.

Enhancements:

  • Improve critical service logging and enforce per-NPC replay-deterministic randomness throughout simulation decisions.
  • Add windup deduplication and campaign isolation for delayed combat events.

Documentation:

  • Add the project license and update session reports with current simulation and rendering health.

Tests:

  • Expand sandbox causal validation to cover social, combat, persistence, belief, and behavioral integrity scenarios.

Chores:

  • Save updated Open_road session, world-tick, campaign, and character-profile snapshots.

@sourcery-ai

sourcery-ai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Руководство для ревьюера

Реализует жизненный цикл выполнения «action windup» согласно ADR-O-310, усиливает причинное/L1‑логирование, вводит детерминированный генератор случайных чисел (RNG) для решений NPC и случайных событий, расширяет песочницу причинной валидации и улучшает социальное/торговое поведение, убеждения, голос и поведение аватаров для снимка кампании Open_road.

Диаграмма последовательности для жизненного цикла выполнения ADR-O-310 action_windup

sequenceDiagram
    participant TickOrchestrator
    participant EventBus

    TickOrchestrator->>TickOrchestrator: _phase_6_post_decision(ctx)
    TickOrchestrator->>TickOrchestrator: create ActionWindup(actor_id, target_id, "attack", ctx.tick_number, 2)
    TickOrchestrator->>TickOrchestrator: store in self._windup_registry[(ctx.campaign_id, actor_id)]
    Note over TickOrchestrator: EventDTO marked is_windup and frozen in pending_event

    TickOrchestrator->>TickOrchestrator: _phase_7_windup_resolution(ctx)
    TickOrchestrator->>TickOrchestrator: iterate self._windup_registry
    TickOrchestrator->>TickOrchestrator: [campaign_id matches and windup completed]
    TickOrchestrator->>EventBus: bus.publish(windup.pending_event)
    TickOrchestrator->>TickOrchestrator: mark windup status=COMPLETED
    TickOrchestrator->>TickOrchestrator: cleanup non-PENDING windups
Loading

Диаграмма последовательности для маршрутизации социальных взаимодействий через RulesSubscriber

sequenceDiagram
    participant GameLoop as GameLoop_run_pipeline
    participant RulesSubscriber
    participant RelationshipStore
    participant TargetNPC as target_npc

    GameLoop->>GameLoop: build _rules_snapshot(all_npcs_raw, tick_number, campaign_id, relationship_store, raw_input)
    GameLoop->>RulesSubscriber: handle(event, _rules_snapshot)

    RulesSubscriber->>RulesSubscriber: _extract_target(event)
    RulesSubscriber->>RulesSubscriber: [if no target and raw_input matches _TRADE_ACTIONS]
    RulesSubscriber->>RulesSubscriber: resolve tavern_keeper/merchant as target_id

    RulesSubscriber->>RulesSubscriber: [event_type is player_interacts / PLAYER_INTERACTS]
    RulesSubscriber->>RulesSubscriber: _handle_social(event, target_id, snapshot)

    RulesSubscriber->>RulesSubscriber: infer _semantic_action from payload.raw_input
    RulesSubscriber->>RulesSubscriber: compute trust_delta, attraction_delta

    RulesSubscriber->>RelationshipStore: update(campaign_id, "player", target_id, {trust, attraction})
    RulesSubscriber->>RelationshipStore: update(campaign_id, target_id, "player", {trust, attraction})

    RulesSubscriber->>TargetNPC: inject trust/attraction into relationship_cache["player"]
    RulesSubscriber-->>GameLoop: RulesDelta(action_type="SANDBOX_SOCIAL", success=True, checks=[...])
Loading

Диаграмма последовательности для детерминированного RNG в принятии решений NPC и случайных событиях

sequenceDiagram
    participant LifeEngine
    participant DecisionHub
    participant KernelRNG

    LifeEngine->>LifeEngine: tick_decisions(campaign_id)
    LifeEngine->>LifeEngine: get_current_tick(campaign_id)

    loop for npc in npcs
        LifeEngine->>KernelRNG: KernelRNG(tick, npc_id)
        LifeEngine->>DecisionHub: DecisionHub(rng=_rng)
        LifeEngine->>DecisionHub: compute(state_l2, profile_l0, effective_drives, event, scene_state, social_modifiers, decision_ctx)
        DecisionHub-->>LifeEngine: decision(intent, score)
        LifeEngine->>LifeEngine: print "[DECISION_HUB] npc=... tick=... intent=..." (deterministic)
    end

    LifeEngine->>LifeEngine: check_random_events(npc, tick, rng=_rng)
    LifeEngine->>KernelRNG: rng.random(), rng.choice(events)
    KernelRNG-->>LifeEngine: deterministic values
Loading

Изменения на уровне файлов

Change Details Files
Introduce orchestrator-level action windup registry and delayed combat event execution gate.
  • Перенести владение объектами action windup из tick‑контекста в TickOrchestrator с постоянным _windup_registry, индексируемым по (campaign_id, actor_id).
  • Расширить фазу 6 post-decision для дедупликации атакующих windup, «заморозки» EventDTO во windup и отложенной публикации до момента резолюции.
  • Добавить фазу 7 windup resolution для выполнения завершённых windup, публикации замороженных событий и очистки реестра для предотвращения разрастания.
  • Обновить датакласс ActionWindup для поддержки хранения замороженного EventDTO и согласовать docstring с новым жизненным циклом.
backend/app/services/tick_orchestrator.py
backend/app/domain/action_windup.py
Strengthen L1Chronicle logging for directives, decay, combat, and fear to support causal validation.
  • Эмитировать записи TraitDriftEvent для изменений директив, включая события «identity-pressure» во время финализации игрока.
  • Логировать события распада (decay) в обработчике простоя физиологии при изменении боли или потери крови у NPC.
  • Эмитировать L1‑события атаки и урона во время combat drain, а также события страха, когда аффективный payload указывает на страх при интеграции.
  • Улучшить ленивую загрузку L1Chronicle, автоматически привязывая campaign_id из SQLite, когда он явно не задан, с безопасным фейлом на пустых сторох.
backend/app/services/tick_orchestrator.py
backend/app/services/npc/l1_chronicle.py
Ensure NPC communication and decision context reach DM/R3_DIRECT pipeline with proper intent resolution and npc_contexts.
  • Добавить intent_resolution в DMContextDTO и протянуть его из shared_context в NPC‑оркестрацию.
  • Собирать ctx.npc_contexts из communication_intents с помощью адаптера, который отображает коммуникационные интенты в структуры, похожие на DecisionResult, для R3_DIRECT.
  • Пропагировать npc_contexts из результата игрока в tick_orchestrator в shared_context перед построением R3 DM‑фрейма, чтобы DM видел принятые решения.
  • Добавить SHI‑логирующие print‑ы из результатов DecisionHub как в NPC‑tick‑пайплайне, так и в конструкторе контекста вербализации.
backend/app/services/tick_orchestrator.py
backend/app/services/game_loop/npc_orchestration.py
backend/app/services/game_loop/__init__.py
backend/app/services/npc/npc_tick_pipeline.py
Introduce deterministic RNG (KernelRNG) across NPC life engine, world tick, and pipeline for replayable behavior and fix effective drives usage.
  • Заменить глобальное использование random в macro_simulate и генерации случайных событий на KernelRNG, привязанный к (tick, npc_id), передавая rng в check_random_events и используя rng.choice/uniform/random.
  • Создавать DecisionHub для каждого NPC в idle‑решениях и world_tick с отдельным KernelRNG на NPC вместо одного общего хаба.
  • Требовать effective_drives для проактивных решений в world_tick, вычисляя effective_drives_map в phase_2_world_tick с помощью хелпера tick_orchestrator и пропуская NPC без drives с логированием ошибки.
  • Разрешить вербализационному пайплайну использовать внедряемый rng_factory для RNG DecisionHub, по умолчанию используя KernelRNG, если фабрика не задана.
backend/app/services/npc/life_engine.py
backend/app/services/world/world_tick_engine.py
backend/app/services/game_loop/phase_2_world_tick.py
backend/app/services/npc/npc_tick_pipeline.py
Expand sandbox causal validation suite and rules subscriber to cover social, trade, belief, trauma, secrets, voice, and avatar resistance behaviors.
  • Упростить путь к лог‑файлу причинной валидации и подправить команды тестов, длительность простоя и проверки денег так, чтобы использовать снимок NPC вместо состояния аватара.
  • Заменить грубые L1‑проверки присутствия на проверки конкретных цепочек событий (attack/damage/fear, decay, persistence памяти/ран) и событий распада.
  • Рефакторить доступ к хранилищу отношений, чтобы использовать get_all_for_source, расширить тесты, включив детектор паттернов, кристаллизацию убеждений, асимметричную травму, «ворота» скрытой истины, соблюдение голосового профиля и сопротивление аватара.
  • Расширить RulesSubscriber для обработки событий player_interacts, добавить эвристическую классификацию семантического действия на основе raw_input, реализовать социальные/торговые обновления доверия/притяжения и трату денег игроком, а также обеспечить торговый fallback к трактирщику при отсутствии цели.
  • Добавить заглушку PatternDetector.query_evidence для поддержки запросов причинной валидации без полной реализации.
backend/tests/sandbox/SUPERBOX/causal_validation.py
backend/app/services/events/rules_subscriber.py
backend/app/services/npc/pattern_detector.py
Improve DM-agent voice rendering and avatar economic/volitional baseline for simulation tests.
  • Усилить блок контекста DM‑агента для NPC, добавив voice_profile и author_notes, управляемые флагом hardcore_mode, и скорректировать заголовок блока, чтобы подчеркнуть стиль речи.
  • Гарантировать, что состояние NPC аватара игрока (NPCState) всегда имеет поле money (по умолчанию 50 золота, 48 для загруженных состояний), и устанавливать willpower при загрузке состояния для тестов сопротивления аватара.
  • Подвязать ожидания тестов сопротивления аватара к изменениям will_state после богохульных действий.
backend/app/agents/dm_agent.py
backend/app/services/player_avatar_service.py
backend/tests/sandbox/SUPERBOX/causal_validation.py
Update reports and session history snapshots for the new Open_road run.
  • Обновить метрики LAST_SESSION.md, таблицы пайплайна передвижения и списки багов, чтобы отразить последние данные по тикам/сессиям.
  • Добавить новый файл отчёта истории сессии, фиксирующий метрики DNA, роли архитектора, рендеринговую информацию, состояние симуляции, пайплайн передвижения и причинные разрывы для сессии 2026-06-26.
  • Обновить JSON‑файлы Open_road world_tick и сохранений так, чтобы они соответствовали последнему снимку состояния симуляции.
reports/LAST_SESSION.md
reports/history/2026-06-26_06-07.md
backend/data/sessions/Open_road/world_tick.json
saves/Open_road/campaign_state.json
saves/Open_road/character_profiles.json

Советы и команды

Взаимодействие с Sourcery

  • Запустить новое ревью: Оставьте комментарий @sourcery-ai review в pull request.
  • Продолжать обсуждения: Отвечайте напрямую на комментарии ревью от Sourcery.
  • Сгенерировать задачу GitHub из комментария ревью: Попросите Sourcery создать
    issue из комментария ревью, ответив на него. Можно также ответить на
    комментарий ревью с @sourcery-ai issue, чтобы создать из него issue.
  • Сгенерировать заголовок pull request: Напишите @sourcery-ai где угодно в
    заголовке pull request, чтобы сгенерировать заголовок в любой момент. Можно также
    оставить комментарий @sourcery-ai title в pull request, чтобы (пере)сгенерировать заголовок в любой момент.
  • Сгенерировать summary pull request: Напишите @sourcery-ai summary где угодно в
    теле pull request, чтобы сгенерировать summary PR в любой момент прямо там, где
    вы хотите. Можно также оставить комментарий @sourcery-ai summary в pull request, чтобы
    (пере)сгенерировать summary в любой момент.
  • Сгенерировать руководство для ревьюера: Оставьте комментарий @sourcery-ai guide в pull
    request, чтобы (пере)сгенерировать руководство для ревьюера в любой момент.
  • Разрешить все комментарии Sourcery: Оставьте комментарий @sourcery-ai resolve в pull
    request, чтобы пометить все комментарии Sourcery как разрешённые. Полезно, если вы уже
    учли все комментарии и больше не хотите их видеть.
  • Отклонить все ревью Sourcery: Оставьте комментарий @sourcery-ai dismiss в pull
    request, чтобы отклонить все существующие ревью Sourcery. Особенно полезно, если вы
    хотите начать заново с новым ревью — не забудьте оставить комментарий
    @sourcery-ai review, чтобы запустить новое ревью!

Настройка работы

Зайдите в вашу панель управления, чтобы:

  • Включать или отключать функции ревью, такие как автоматически генерируемое Sourcery
    summary pull request, руководство для ревьюера и другие.
  • Изменять язык ревью.
  • Добавлять, удалять или редактировать пользовательские инструкции для ревью.
  • Настраивать другие параметры ревью.

Получение помощи

Original review guide in English

Reviewer's Guide

Implements ADR-O-310 action windup execution lifecycle, strengthens causal/L1 logging, introduces deterministic RNG for NPC decisions and random events, expands causal validation sandbox, and improves social/trade, belief, voice, and avatar behavior for the Open_road campaign snapshot.

Sequence diagram for ADR-O-310 action_windup execution lifecycle

sequenceDiagram
    participant TickOrchestrator
    participant EventBus

    TickOrchestrator->>TickOrchestrator: _phase_6_post_decision(ctx)
    TickOrchestrator->>TickOrchestrator: create ActionWindup(actor_id, target_id, "attack", ctx.tick_number, 2)
    TickOrchestrator->>TickOrchestrator: store in self._windup_registry[(ctx.campaign_id, actor_id)]
    Note over TickOrchestrator: EventDTO marked is_windup and frozen in pending_event

    TickOrchestrator->>TickOrchestrator: _phase_7_windup_resolution(ctx)
    TickOrchestrator->>TickOrchestrator: iterate self._windup_registry
    TickOrchestrator->>TickOrchestrator: [campaign_id matches and windup completed]
    TickOrchestrator->>EventBus: bus.publish(windup.pending_event)
    TickOrchestrator->>TickOrchestrator: mark windup status=COMPLETED
    TickOrchestrator->>TickOrchestrator: cleanup non-PENDING windups
Loading

Sequence diagram for social interaction routing via RulesSubscriber

sequenceDiagram
    participant GameLoop as GameLoop_run_pipeline
    participant RulesSubscriber
    participant RelationshipStore
    participant TargetNPC as target_npc

    GameLoop->>GameLoop: build _rules_snapshot(all_npcs_raw, tick_number, campaign_id, relationship_store, raw_input)
    GameLoop->>RulesSubscriber: handle(event, _rules_snapshot)

    RulesSubscriber->>RulesSubscriber: _extract_target(event)
    RulesSubscriber->>RulesSubscriber: [if no target and raw_input matches _TRADE_ACTIONS]
    RulesSubscriber->>RulesSubscriber: resolve tavern_keeper/merchant as target_id

    RulesSubscriber->>RulesSubscriber: [event_type is player_interacts / PLAYER_INTERACTS]
    RulesSubscriber->>RulesSubscriber: _handle_social(event, target_id, snapshot)

    RulesSubscriber->>RulesSubscriber: infer _semantic_action from payload.raw_input
    RulesSubscriber->>RulesSubscriber: compute trust_delta, attraction_delta

    RulesSubscriber->>RelationshipStore: update(campaign_id, "player", target_id, {trust, attraction})
    RulesSubscriber->>RelationshipStore: update(campaign_id, target_id, "player", {trust, attraction})

    RulesSubscriber->>TargetNPC: inject trust/attraction into relationship_cache["player"]
    RulesSubscriber-->>GameLoop: RulesDelta(action_type="SANDBOX_SOCIAL", success=True, checks=[...])
Loading

Sequence diagram for deterministic RNG in NPC decision and random events

sequenceDiagram
    participant LifeEngine
    participant DecisionHub
    participant KernelRNG

    LifeEngine->>LifeEngine: tick_decisions(campaign_id)
    LifeEngine->>LifeEngine: get_current_tick(campaign_id)

    loop for npc in npcs
        LifeEngine->>KernelRNG: KernelRNG(tick, npc_id)
        LifeEngine->>DecisionHub: DecisionHub(rng=_rng)
        LifeEngine->>DecisionHub: compute(state_l2, profile_l0, effective_drives, event, scene_state, social_modifiers, decision_ctx)
        DecisionHub-->>LifeEngine: decision(intent, score)
        LifeEngine->>LifeEngine: print "[DECISION_HUB] npc=... tick=... intent=..." (deterministic)
    end

    LifeEngine->>LifeEngine: check_random_events(npc, tick, rng=_rng)
    LifeEngine->>KernelRNG: rng.random(), rng.choice(events)
    KernelRNG-->>LifeEngine: deterministic values
Loading

File-Level Changes

Change Details Files
Introduce orchestrator-level action windup registry and delayed combat event execution gate.
  • Move ownership of action windups from tick context to TickOrchestrator with a persistent _windup_registry keyed by (campaign_id, actor_id).
  • Extend Phase 6 post-decision to deduplicate attack windups, freeze EventDTO into windup, and defer publishing until resolution.
  • Add Phase 7 windup resolution to execute completed windups, publish frozen events, and clean registry to prevent bloat.
  • Update ActionWindup dataclass to support storage of the frozen EventDTO and align docstring with new lifecycle.
backend/app/services/tick_orchestrator.py
backend/app/domain/action_windup.py
Strengthen L1Chronicle logging for directives, decay, combat, and fear to support causal validation.
  • Emit TraitDriftEvent entries for directive deltas, including identity-pressure events during player finalize.
  • Log decay events on physiology idle handler deltas when pain or blood loss change for NPCs.
  • Emit L1 events for attack and damage during combat drain, and fear events when affective payload indicates fear during integration.
  • Improve L1Chronicle lazy loading by auto-binding campaign_id from SQLite when not explicitly set, with safe failure on empty stores.
backend/app/services/tick_orchestrator.py
backend/app/services/npc/l1_chronicle.py
Ensure NPC communication and decision context reach DM/R3_DIRECT pipeline with proper intent resolution and npc_contexts.
  • Add intent_resolution to DMContextDTO and wire it from shared_context into npc orchestration.
  • Build ctx.npc_contexts from communication_intents with an adapter that maps communication intents into DecisionResult-like structures for R3_DIRECT.
  • Propagate npc_contexts from tick_orchestrator player result into shared_context before building R3 DM frame so DM sees decisions.
  • Add SHI logging prints from DecisionHub results in both NPC tick pipeline and verbalization context builder.
backend/app/services/tick_orchestrator.py
backend/app/services/game_loop/npc_orchestration.py
backend/app/services/game_loop/__init__.py
backend/app/services/npc/npc_tick_pipeline.py
Introduce deterministic RNG (KernelRNG) across NPC life engine, world tick, and pipeline for replayable behavior and fix effective drives usage.
  • Replace global random usage in macro_simulate and random event generation with KernelRNG bound to (tick, npc_id), passing rng through check_random_events and using rng.choice/uniform/random.
  • Construct DecisionHub per NPC in idle decisions and world_tick with per-NPC KernelRNG instead of a single shared hub.
  • Require effective_drives for proactive world tick decisions, computing effective_drives_map in phase_2_world_tick using tick_orchestrator helper, and skipping NPCs without drives with error logging.
  • Allow verbalization pipeline to use an injectable rng_factory for DecisionHub RNG while defaulting to KernelRNG when absent.
backend/app/services/npc/life_engine.py
backend/app/services/world/world_tick_engine.py
backend/app/services/game_loop/phase_2_world_tick.py
backend/app/services/npc/npc_tick_pipeline.py
Expand sandbox causal validation suite and rules subscriber to cover social, trade, belief, trauma, secrets, voice, and avatar resistance behaviors.
  • Simplify causal validation log file path and tweak test commands, idle durations, and money checks to use NPC snapshot rather than avatar state.
  • Replace coarse L1 presence assertions with checks for specific event chains (attack/damage/fear, decay, memory/wound persistence) and decay events.
  • Refactor relationship store access to use get_all_for_source, broaden tests to include pattern detector, belief crystallization, asymmetric trauma, hidden truth gate, voice profile adherence, and avatar resistance.
  • Extend RulesSubscriber to handle player_interacts events, add heuristic semantic action classification based on raw input, implement social/trade trust/attraction updates and player money spending, and provide trade fallback to tavern keeper when target is missing.
  • Add PatternDetector.query_evidence stub to support causal validation queries without full implementation.
backend/tests/sandbox/SUPERBOX/causal_validation.py
backend/app/services/events/rules_subscriber.py
backend/app/services/npc/pattern_detector.py
Improve DM-agent voice rendering and avatar economic/volitional baseline for simulation tests.
  • Enhance DM agent NPC context block with voice_profile and author_notes, gated by hardcore_mode, and adjust block title to emphasize speech style.
  • Ensure player avatar NPCState always has a money field (default 50 gold, 48 for loaded states), and set willpower on state load for avatar resistance tests.
  • Wire avatar resistance test expectations around will_state changes after blasphemous actions.
backend/app/agents/dm_agent.py
backend/app/services/player_avatar_service.py
backend/tests/sandbox/SUPERBOX/causal_validation.py
Update reports and session history snapshots for the new Open_road run.
  • Refresh LAST_SESSION.md metrics, movement pipeline tables, and bug lists to reflect latest tick/session data.
  • Add a new session history report file capturing DNA metrics, architect roles, rendering info, simulation state, movement pipeline, and causal breaks for the 2026-06-26 session.
  • Update Open_road world_tick and save JSON files to match the latest simulation state snapshot.
reports/LAST_SESSION.md
reports/history/2026-06-26_06-07.md
backend/data/sessions/Open_road/world_tick.json
saves/Open_road/campaign_state.json
saves/Open_road/character_profiles.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

This branch has not been deployed

No deployments
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