Repository navigation
Conversation
Руководство для ревьюераРеализует жизненный цикл выполнения «action windup» согласно ADR-O-310, усиливает причинное/L1‑логирование, вводит детерминированный генератор случайных чисел (RNG) для решений NPC и случайных событий, расширяет песочницу причинной валидации и улучшает социальное/торговое поведение, убеждения, голос и поведение аватаров для снимка кампании Open_road. Диаграмма последовательности для жизненного цикла выполнения ADR-O-310
|
| Change | Details | Files |
|---|---|---|
| Introduce orchestrator-level action windup registry and delayed combat event execution gate. |
|
backend/app/services/tick_orchestrator.pybackend/app/domain/action_windup.py |
| Strengthen L1Chronicle logging for directives, decay, combat, and fear to support causal validation. |
|
backend/app/services/tick_orchestrator.pybackend/app/services/npc/l1_chronicle.py |
| Ensure NPC communication and decision context reach DM/R3_DIRECT pipeline with proper intent resolution and npc_contexts. |
|
backend/app/services/tick_orchestrator.pybackend/app/services/game_loop/npc_orchestration.pybackend/app/services/game_loop/__init__.pybackend/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. |
|
backend/app/services/npc/life_engine.pybackend/app/services/world/world_tick_engine.pybackend/app/services/game_loop/phase_2_world_tick.pybackend/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. |
|
backend/tests/sandbox/SUPERBOX/causal_validation.pybackend/app/services/events/rules_subscriber.pybackend/app/services/npc/pattern_detector.py |
| Improve DM-agent voice rendering and avatar economic/volitional baseline for simulation tests. |
|
backend/app/agents/dm_agent.pybackend/app/services/player_avatar_service.pybackend/tests/sandbox/SUPERBOX/causal_validation.py |
| Update reports and session history snapshots for the new Open_road run. |
|
reports/LAST_SESSION.mdreports/history/2026-06-26_06-07.mdbackend/data/sessions/Open_road/world_tick.jsonsaves/Open_road/campaign_state.jsonsaves/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, руководство для ревьюера и другие. - Изменять язык ревью.
- Добавлять, удалять или редактировать пользовательские инструкции для ревью.
- Настраивать другие параметры ревью.
Получение помощи
- Свяжитесь с нашей командой поддержки по вопросам или для обратной связи.
- Посетите нашу документацию для подробных руководств и информации.
- Оставайтесь на связи с командой Sourcery, подписавшись на нас в X/Twitter, LinkedIn или GitHub.
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
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=[...])
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
File-Level Changes
| Change | Details | Files |
|---|---|---|
| Introduce orchestrator-level action windup registry and delayed combat event execution gate. |
|
backend/app/services/tick_orchestrator.pybackend/app/domain/action_windup.py |
| Strengthen L1Chronicle logging for directives, decay, combat, and fear to support causal validation. |
|
backend/app/services/tick_orchestrator.pybackend/app/services/npc/l1_chronicle.py |
| Ensure NPC communication and decision context reach DM/R3_DIRECT pipeline with proper intent resolution and npc_contexts. |
|
backend/app/services/tick_orchestrator.pybackend/app/services/game_loop/npc_orchestration.pybackend/app/services/game_loop/__init__.pybackend/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. |
|
backend/app/services/npc/life_engine.pybackend/app/services/world/world_tick_engine.pybackend/app/services/game_loop/phase_2_world_tick.pybackend/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. |
|
backend/tests/sandbox/SUPERBOX/causal_validation.pybackend/app/services/events/rules_subscriber.pybackend/app/services/npc/pattern_detector.py |
| Improve DM-agent voice rendering and avatar economic/volitional baseline for simulation tests. |
|
backend/app/agents/dm_agent.pybackend/app/services/player_avatar_service.pybackend/tests/sandbox/SUPERBOX/causal_validation.py |
| Update reports and session history snapshots for the new Open_road run. |
|
reports/LAST_SESSION.mdreports/history/2026-06-26_06-07.mdbackend/data/sessions/Open_road/world_tick.jsonsaves/Open_road/campaign_state.jsonsaves/Open_road/character_profiles.json |
Tips and commands
Interacting with Sourcery
- Trigger a new review: Comment
@sourcery-ai reviewon 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 issueto create an issue from it. - Generate a pull request title: Write
@sourcery-aianywhere in the pull
request title to generate a title at any time. You can also comment
@sourcery-ai titleon the pull request to (re-)generate the title at any time. - Generate a pull request summary: Write
@sourcery-ai summaryanywhere in
the pull request body to generate a PR summary at any time exactly where you
want it. You can also comment@sourcery-ai summaryon the pull request to
(re-)generate the summary at any time. - Generate reviewer's guide: Comment
@sourcery-ai guideon the pull
request to (re-)generate the reviewer's guide at any time. - Resolve all Sourcery comments: Comment
@sourcery-ai resolveon 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 dismisson 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 reviewto 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
- Contact our support team for questions or feedback.
- Visit our documentation for detailed guides and information.
- Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
V.0.5.3.2.5_Всё_вижу_и_создаю.Validation
7 passed.Notes
ADR IMPACT AUDIT REQUIREDas a warning for architecture-impacting files, but the hook completed with[OK]and accepted the commit.main.Summary by Sourcery
Усиление детерминизма симуляции NPC и распространения причинно-следственных состояний при сохранении последнего проверенного снимка проекта.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores:
Original summary in English
Summary by Sourcery
Strengthen NPC simulation determinism and causal state propagation while saving the latest validated project snapshot.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores:
Original summary in English
Summary by Sourcery
Усиление детерминизма симуляции NPC и распространения причинно-следственных состояний при сохранении последнего проверенного снимка проекта.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores:
Original summary in English
Summary by Sourcery
Strengthen NPC simulation determinism and causal state propagation while saving the latest validated project snapshot.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests:
Chores: