← Back to Pull requests

claude: docs(adr): narrator reads as himself and skips interrupted narration in 0158 (#2027) #2029

Merged
Akagilnc merged 1 files (9 lines) on Nov 30, 2026 14:47 UTC
View on GitHub
Akagilnc Akagilnc commented on Nov 30, 2026 14:41 UTC
Author

Summary

 docs/adr/0158 「2026-11-30 补」
-- 叙事以皇帝身份读账,用现成的开月截断……
+- 叙事以递话人本人身份读账,截到开月那一笔为止,本月邸报、密报、奏疏、批红不放行
+- 只在记下开月那一笔时起一次;进程中断没写成,本月就没有递话,不补写

Folds the owner's answers to the #2027 notary escalation (owner a7e3cbac: 「不补写」「王承恩本人身份」) into the addendum merged in #2028.

Evidence

  • Before: addendum said the narrator reads with the emperor's month-open cutoff; 「重开补写」 pointed to the ticket.

  • After: narrator reads as himself with a cutoff that passes none of this month's controls; interrupted narration is not rewritten.

    Merge Danger

    Door: two-way

    Blast Radius: docs-only

    Refs #2027

    🤖 Generated with Claude Code

    <!-- CURSOR_SUMMARY -->
    ---

    [!NOTE]

    Low Risk

    Documentation-only ADR addendum; no runtime or auth changes.

    > Overview

    The 2026-11-30 addendum to ADR 0158 tightens how monthly 核账叙事 (wait-screen narration) is specified for #2027.

    > Narration POV and ledger scope: The messenger writes from their own identity (per 0164’s call identity), not as the emperor. Context stops at the month-open ledger entry—this month’s 邸报、密报、奏疏、批红 are explicitly excluded so the text does not leak the in-progress month.

    > Lifecycle: The LLM call runs only once when that month-open entry is recorded. If the run is interrupted and no text is produced, that month has no 递话条 and there is no backfill (same “stay silent” posture as retry exhaustion; rationale updated to avoid failure vs. interrupt semantics and timing around 邸报 already written).

    > Housekeeping: Drops “重开补写” from the “只陪等” bullet (details stay on #2027 ticket only) and extends 依据 with owner answers 「不补写」「王承恩本人身份」.

    > <sup>Reviewed by Cursor Bugbot for commit a76e9f698a75493148f6d02c717720feb007ab12. Bugbot is set up for automated code reviews on this repo. Configure here.</sup>

    <!-- /CURSOR_SUMMARY -->

    Summary by Sourcery

    Finalize ADR 0158’s rules for monthly narration identity, data cutoff, and interrupted runs.

    Enhancements:

  • Clarify ADR 0158’s monthly narration rules so the messenger writes from their own identity and can read only through the month-opening ledger entry, excluding all current-month reports and approvals.

  • Define narration lifecycle behavior to run once at month opening and remain absent when interrupted rather than being backfilled.
  • Documentation:

  • Update ADR 0158 with the finalized narration identity, cutoff, interruption, and no-backfill decisions.
  • Diff: 9 lines (+5 / -4) across 1 files Reviewer: cursor[bot] Review duration: 5m
    All Vouch review confidence checks passed
    Residual risk 0.09 = Change Risk (0.32) × (1 − Review Confidence (0.72)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.32 · 9 lines diff across 1 files
    0.32
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.58 · 5 substantive comment(s)
    0.58
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    71%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.138
    Rapid Merge rapid_merge
    0.100
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    11 items
    chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] commented on Nov 30, 2026 14:41 UTC
    Bot

    <!-- codex-pull-request-review-summary -->
    <!-- codex-review-state:v1 {"code_review":{"commit_sha":"a76e9f698a75493148f6d02c717720feb007ab12","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->

    <details>
    <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>

    This comment shows the latest Codex review activity on this pull request.

    | Review | Status | Commit | Review trigger |
    | --- | --- | --- | --- |
    | 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-30T14:43:19.393553Z">2026-11-30T14:43:19.393553Z</relative-time> | a76e9f6 | PR opened |

    <details> <summary>ℹ️ About Codex in GitHub</summary>
    <br/>

    Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review

  • Mark a draft as ready

  • Comment "@codex review" or "@codex security review".
  • Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

    </details>

    </details>

    cursor[bot] cursor[bot] commented on Nov 30, 2026 14:41 UTC
    Reviewer

    <!-- CURSOR_AUTOMATION_ID: c64f1558-9ab8-11f1-ba66-0e7d0216e441 | RUN_ID: bc-2f1f4387-dad6-43f4-b1c3-e6293385261c -->

    Critical bug scan — no issues found

    Scope: aa9e34d → a76e9f6 (1 commit): only docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md (narrator identity, no backfill after interrupt, rationale/依据 updates).

    Result: No runtime, persistence, auth, or concurrency code changed. Nothing in this diff can introduce data loss, crashes, security holes, or high-severity user-facing breakage on its own.

    (If a follow-up #2027 implementation PR lands, that code path should get a separate pass.)

    <div><a href="https://cursor.com/agents/bc-2f1f4387-dad6-43f4-b1c3-e6293385261c?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/automations/c64f1558-9ab8-11f1-ba66-0e7d0216e441"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/view-automation-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/view-automation-light.png"><img alt="View Automation" width="141" height="28" src="https://cursor.com/assets/images/view-automation-dark.png"></picture></a>&nbsp;</div>

    <sub>Sent by Cursor Automation: Find critical bugs</sub>

    coderabbitai[bot] coderabbitai[bot] commented on Nov 30, 2026 14:42 UTC
    Bot

    <!-- coderabbit-ai-generated:v1 -->

    <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
    <!-- review_stack_entry_start -->

    <a href="https://app.coderabbit.ai/change-stack/Akagilnc/ming-salvage-sim/pull/2029?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a>

    <!-- review_stack_entry_end -->
    <!-- recent_review_status_start -->

    No actionable comments were generated in the recent review.

    <!-- recent_review_status_end -->
    <!-- walkthrough_start -->

    <details>
    <summary><strong>Walkthrough</strong></summary>
    <dl>
    <dd>
    <br>

    The ADR amendment specifies that opening-month narration is generated once when the opening entry is recorded. It uses the messenger’s identity, reads records up to the opening-month cutoff while excluding that month’s events, and is not backfilled if generation is interrupted or unsuccessful.

    Changes: Opening-month narration rules

    |Layer / File(s)|Summary|
    |:---|:---|
    |Document narration timing and record scope <br> docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md|The ADR specifies one-time narration generation when the opening entry is recorded. The messenger reads records up to the opening-month cutoff, excluding that month’s events. Interrupted or unsuccessful generation does not produce later narration.|

    Estimated code review effort: 1 (Trivial) | ~4 minutes

    Possibly related issues

  • Issue 2027 — The ADR records decisions about the narration identity, opening-month cutoff, and no-backfill behavior described in the issue.
  • Possibly related PRs

  • Akagilnc/ming-salvage-sim#2028 — This PR revises the narration rules added by that PR, including narrator identity, cutoff timing, and interruption handling.
  • Suggested reviewers: sourcery-ai

    </dd>
    </dl>
    </details>

    <!-- walkthrough_end -->
    <details>
    <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>a76e9</code></summary>
    <dl>
    <dd>
    <br>

    <!-- final_review_risk_start -->
    <!-- final_review_risk_label
    Merge Risk: ⚪ Minimal · up to a76e9
    -->
    <!-- final_review_risk_coverage:{"sourceCommitId":"a76e9f698a75493148f6d02c717720feb007ab12","coveredCommitId":"a76e9f698a75493148f6d02c717720feb007ab12","kind":"reviewed"} -->

    This updates the ADR text describing how opening-month narration is generated. It changes no runtime behavior, so merge risk is minimal.
    <!-- final_review_risk_end -->

    </dd>
    </dl>
    </details>
    <!-- pre_merge_checks_walkthrough_start -->

    <details>
    <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4</strong></summary>
    <dl>
    <dd>
    <br>

    | Check name | Status | Explanation |
    | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | Description Check | !Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
    | Title check | !Passed | The title names a docs(adr) change to ADR 0158 about narration, but the changeset is a documentation-only addendum for ADR 0158. It states that the narrator reads as himself and that interrupted narra… |
    | Linked Issues check | !Passed | Check skipped because no linked issues were found for this pull request. |
    | Out of Scope Changes check | !Passed | Check skipped because no linked issues were found for this pull request. |

    <details>
    <summary><strong>Full details: Title check</strong></summary>
    <dl>
    <dd>
    <br>

    Explanation

    The title names a docs(adr) change to ADR 0158 about narration, but the changeset is a documentation-only addendum for ADR 0158. It states that the narrator reads as himself and that interrupted narration is skipped. The raw summary supports both points: the monthly narration uses the messenger's identity, excludes the opening month's events, and is not backfilled when interrupted. The title is specific to the main change and uses a 'claude:' prefix and a PR number, which are noise but do not make it unrelated. Its length (92 characters) is longer than ideal.

    </dd>
    </dl>
    </details>

    </dd>
    </dl>
    </details>

    <!-- pre_merge_checks_walkthrough_end -->
    <!-- autopilot:start -->

  • <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

  • <!-- autopilot:end -->
    <!-- recent_review_start -->

    <h6>
    <details>
    <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Recent review info</strong></summary>
    <dl>
    <dd>
    <br>

    <!-- review_info_content -->
    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
    <dl>
    <dd>
    <br>

  • Source mode: Auto

  • Repository: Unavailable

  • Branch: Unavailable

  • File: No configuration file from this repository applied

  • Commit: Unavailable

  • Layers: Repository UI

  • Review profile: CHILL

  • Plan: Essentials

  • Run ID: ede5f7fc-20f3-4264-9edf-4eba4693e006
  • </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary>
    <dl>
    <dd>
    <br>

    Reviewing files that changed from the base of the PR and between aa9e34d68b2825ec8754bbdccf7563331160da9a and a76e9f698a75493148f6d02c717720feb007ab12.

    </dd>
    </dl>
    </details>

    <details>
    <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 1</strong></summary>
    <dl>
    <dd>
    <br>

  • docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md
  • </dd>
    </dl>
    </details>

    Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

    </dd>
    </dl>
    </details>
    </h6>

    <!-- recent_review_end -->

    sourcery-ai[bot] sourcery-ai[bot] commented on Nov 30, 2026 14:42 UTC
    Bot

    <!-- Generated by sourcery-ai[bot]: start review_guide -->

    Reviewer's Guide

    Documentation

    Update ADR 0158’s narration rules together: use the messenger’s identity and month-open cutoff, skip interrupted narration without backfilling, and record the rationale and owner answers.

  • docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md L43-50
  • ---

    <details>
    <summary>Tips and commands</summary>

    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

  • [Contact our support team](mailto:support@sourcery.ai) 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.
  • </details>

    <!-- Generated by sourcery-ai[bot]: end review_guide -->

    sourcery-ai[bot] sourcery-ai[bot] commented on code on Nov 30, 2026 14:52 UTC
    Code Review
    docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:1
    @@ -40,10 +40,11 @@ Status: proposed(2026-09-09;决策票 [#1823](https://github.com/Akagilnc/mi
     决定 5 的「核账叙事」落定,「未定」一节「核账叙事(王承恩递话)由 LLM 长出」不再是未定:
     
     - 每月一次过月模型调用,由递话人按本人立场写核账叙事,显示在等待面的递话条上;批红前后两段等待沿用同一份。
    -- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账、重开补写的细节见 #2027 票面。
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
     - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。

    🟠 High · Wait narration reveals current-month facts

    When the narrator reads through the existing identity-based path as a non-emperor, Records._opening returns no cutoff for non-emperors, and fact_sources applies the cutoff only to the emperor, so the messenger's reads include current-month facts and the wait-screen narration can reveal them.

    Apply the month-open cutoff to messenger reads in both Records._opening and fact_sources.

    <details>
    <summary>Prompt for AI agents</summary>

    ~~~markdown
    In docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md at line 45:

    Wait narration reveals current-month facts

    When the narrator reads through the existing identity-based path as a non-emperor, Records._opening returns no cutoff for non-emperors, and fact_sources applies the cutoff only to the emperor, so the messenger's reads include current-month facts and the wait-screen narration can reveal them.

    Apply the month-open cutoff to messenger reads in both Records._opening and fact_sources.
    ~~~

    </details>

    sourcery-ai[bot] sourcery-ai[bot] commented on code on Nov 30, 2026 14:52 UTC
    Code Review
    docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:1
    @@ -40,10 +40,11 @@ Status: proposed(2026-09-09;决策票 [#1823](https://github.com/Akagilnc/mi
     决定 5 的「核账叙事」落定,「未定」一节「核账叙事(王承恩递话)由 LLM 长出」不再是未定:
     
     - 每月一次过月模型调用,由递话人按本人立场写核账叙事,显示在等待面的递话条上;批红前后两段等待沿用同一份。
    -- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账、重开补写的细节见 #2027 票面。
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
     - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    🟡 Medium · Restart regenerates omitted narration

    When the process restarts after the month-open entry is recorded but before narration is persisted, aDR 0164's restart rule resumes every unfinished month step, so it reruns narration that ADR 0158 says not to backfill, and the wait screen shows it.

    Explicitly exempt this narration from restart recovery in both ADRs.

    <details>
    <summary>Prompt for AI agents</summary>

    ~~~markdown
    In docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md at line 46:

    Restart regenerates omitted narration

    When the process restarts after the month-open entry is recorded but before narration is persisted, aDR 0164's restart rule resumes every unfinished month step, so it reruns narration that ADR 0158 says not to backfill, and the wait screen shows it.

    Explicitly exempt this narration from restart recovery in both ADRs.
    ~~~

    </details>

    From docs/adr/0164-four-layers.md L34:

      - **进程中断,重开后一律自动接着做未完成的部分,已落的不动**。说话、批红、过月、整夜转译都一样:被中断的那句召对回话,用受理时记下的原话自动重新生成。
    

    sourcery-ai[bot] sourcery-ai[bot] commented on code on Nov 30, 2026 14:52 UTC
    Code Review
    docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:1
    @@ -40,10 +40,11 @@ Status: proposed(2026-09-09;决策票 [#1823](https://github.com/Akagilnc/mi
     决定 5 的「核账叙事」落定,「未定」一节「核账叙事(王承恩递话)由 LLM 长出」不再是未定:
     
     - 每月一次过月模型调用,由递话人按本人立场写核账叙事,显示在等待面的递话条上;批红前后两段等待沿用同一份。
    -- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账、重开补写的细节见 #2027 票面。
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
     - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    🟡 Medium · Interrupted narration is generated again on reopen

    When a process is interrupted after the month-open entry is recorded but before narration is completed, Game resumes the pending month action through Month.advance, which calls Month.open again; because Month.open unconditionally records another month_open entry, the entry-triggered narration starts again after an interruption, contrary to the no-backfill rule.

    Persist an idempotent narration-attempt marker and check it during month recovery so reopening cannot start the narration again.

    <details>
    <summary>Prompt for AI agents</summary>

    ~~~markdown
    In docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md at line 46:

    Interrupted narration is generated again on reopen

    When a process is interrupted after the month-open entry is recorded but before narration is completed, Game resumes the pending month action through Month.advance, which calls Month.open again; because Month.open unconditionally records another month_open entry, the entry-triggered narration starts again after an interruption, contrary to the no-backfill rule.

    Persist an idempotent narration-attempt marker and check it during month recovery so reopening cannot start the narration again.
    ~~~

    </details>

    sourcery-ai[bot] sourcery-ai[bot] commented on code on Nov 30, 2026 14:52 UTC
    Code Review
    docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:1
    @@ -40,10 +40,11 @@ Status: proposed(2026-09-09;决策票 [#1823](https://github.com/Akagilnc/mi
     决定 5 的「核账叙事」落定,「未定」一节「核账叙事(王承恩递话)由 LLM 长出」不再是未定:
     
     - 每月一次过月模型调用,由递话人按本人立场写核账叙事,显示在等待面的递话条上;批红前后两段等待沿用同一份。
    -- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账、重开补写的细节见 #2027 票面。
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
     - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    🟡 Medium · Narration call is absent from the call inventory

    When the new narration call is implemented using the ADR set, implementers following this new once-per-month call rule still find only six named model steps in ADR 0164, whose per-step test guidance names no narration step. The narration call can therefore be omitted from the architecture’s step-specific identity and test setup.

    Add the narration step to ADR 0164’s named-call and per-step testing guidance.

    <details>
    <summary>Prompt for AI agents</summary>

    ~~~markdown
    In docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md at line 46:

    Narration call is absent from the call inventory

    When the new narration call is implemented using the ADR set, implementers following this new once-per-month call rule still find only six named model steps in ADR 0164, whose per-step test guidance names no narration step. The narration call can therefore be omitted from the architecture’s step-specific identity and test setup.

    Add the narration step to ADR 0164’s named-call and per-step testing guidance.
    ~~~

    </details>

    sourcery-ai[bot] sourcery-ai[bot] commented on code on Nov 30, 2026 14:52 UTC
    Code Review
    docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:1
    @@ -40,10 +40,11 @@ Status: proposed(2026-09-09;决策票 [#1823](https://github.com/Akagilnc/mi
     决定 5 的「核账叙事」落定,「未定」一节「核账叙事(王承恩递话)由 LLM 长出」不再是未定:
     
     - 每月一次过月模型调用,由递话人按本人立场写核账叙事,显示在等待面的递话条上;批红前后两段等待沿用同一份。
    -- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账、重开补写的细节见 #2027 票面。
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
     - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    ⚪ Low · ADR addendum becomes a mini spec

    The addendum lays out five separate normative bullets covering call timing, UI, identity, data access, and interruption behavior. This turns the ADR into a multi-decision specification rather than the required concise record of one decision.

    Consolidate the addendum into one decision expressed in 1-3 sentences, leaving reversible implementation details to the ticket or implementation documentation.

    <details>
    <summary>Prompt for AI agents</summary>

    ~~~markdown
    In docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md at lines 42-46:

    ADR addendum becomes a mini spec

    The addendum lays out five separate normative bullets covering call timing, UI, identity, data access, and interruption behavior. This turns the ADR into a multi-decision specification rather than the required concise record of one decision.

    Consolidate the addendum into one decision expressed in 1-3 sentences, leaving reversible implementation details to the ticket or implementation documentation.
    ~~~

    </details>

    From docs/agents/domain.md L40:

    **文档三层(采 Matt Pocock grill-with-docs DDD)**:① `CONTEXT.md`=领域词表(是什么、零实现);② `docs/adr/`=非显然决策的为什么(**ADR-FORMAT:1-3 句、单决策、稀有**,hard-to-reverse / surprising / real-tradeoff 才建,不是 spec;大模板会把可逆细节吸进来=过度设计,避开);③ 详设/代码任务 → issue;④ 实现 → 代码。给 AI 最薄一层。
    

    sourcery-ai[bot] sourcery-ai[bot] commented on Nov 30, 2026 14:52 UTC
    Reviewer

    Hey - I've found 5 issues

    <details>
    <summary>Prompt for AI Agents</summary>

    ~~~markdown
    Please address the comments from this code review:

    Individual Comments

    Comment 1


    <location path="docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md" line_range="45" />
    <code_context>
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
    - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    </code_context>
    <issue_to_address>
    Wait narration reveals current-month facts

    When the narrator reads through the existing identity-based path as a non-emperor, Records._opening returns no cutoff for non-emperors, and fact_sources applies the cutoff only to the emperor, so the messenger's reads include current-month facts and the wait-screen narration can reveal them.

    Apply the month-open cutoff to messenger reads in both Records._opening and fact_sources.
    </issue_to_address>

    Comment 2


    <location path="docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md" line_range="46" />
    <code_context>
    - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    -为什么:试玩里过月要空等 60–150 秒,只有一行「正在过月,请稍候。」(~/WorkSpace/vault/ak-cc-wiki/raw/ming-llm-runner/2026-11-30/playtest-player/REPORT.md)。陪等的话不该让等待变长(仓库 CLAUDE.md P5),也不值得为它卡住整月。递话人夜夜在殿,开月那一刻皇帝看得见的,他都看得见;用现成截断不新造读法。
    </code_context>
    <issue_to_address>
    Restart regenerates omitted narration

    When the process restarts after the month-open entry is recorded but before narration is persisted, aDR 0164's restart rule resumes every unfinished month step, so it reruns narration that ADR 0158 says not to backfill, and the wait screen shows it.

    Explicitly exempt this narration from restart recovery in both ADRs.
    </issue_to_address>

    Comment 3


    <location path="docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md" line_range="46" />
    <code_context>
    - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    -为什么:试玩里过月要空等 60–150 秒,只有一行「正在过月,请稍候。」(~/WorkSpace/vault/ak-cc-wiki/raw/ming-llm-runner/2026-11-30/playtest-player/REPORT.md)。陪等的话不该让等待变长(仓库 CLAUDE.md P5),也不值得为它卡住整月。递话人夜夜在殿,开月那一刻皇帝看得见的,他都看得见;用现成截断不新造读法。
    </code_context>
    <issue_to_address>
    Interrupted narration is generated again on reopen

    When a process is interrupted after the month-open entry is recorded but before narration is completed, Game resumes the pending month action through Month.advance, which calls Month.open again; because Month.open unconditionally records another month_open entry, the entry-triggered narration starts again after an interruption, contrary to the no-backfill rule.

    Persist an idempotent narration-attempt marker and check it during month recovery so reopening cannot start the narration again.
    </issue_to_address>

    Comment 4


    <location path="docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md" line_range="46" />
    <code_context>
    - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    -为什么:试玩里过月要空等 60–150 秒,只有一行「正在过月,请稍候。」(~/WorkSpace/vault/ak-cc-wiki/raw/ming-llm-runner/2026-11-30/playtest-player/REPORT.md)。陪等的话不该让等待变长(仓库 CLAUDE.md P5),也不值得为它卡住整月。递话人夜夜在殿,开月那一刻皇帝看得见的,他都看得见;用现成截断不新造读法。
    </code_context>
    <issue_to_address>
    Narration call is absent from the call inventory

    When the new narration call is implemented using the ADR set, implementers following this new once-per-month call rule still find only six named model steps in ADR 0164, whose per-step test guidance names no narration step. The narration call can therefore be omitted from the architecture’s step-specific identity and test setup.

    Add the narration step to ADR 0164’s named-call and per-step testing guidance.
    </issue_to_address>

    Comment 5


    <location path="docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md" line_range="42-46" />
    <code_context>
    决定 5 的「核账叙事」落定,「未定」一节「核账叙事(王承恩递话)由 LLM 长出」不再是未定:

    - 每月一次过月模型调用,由递话人按本人立场写核账叙事,显示在等待面的递话条上;批红前后两段等待沿用同一份。
    -- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账、重开补写的细节见 #2027 票面。
    +- 只陪等:与月草稿同时跑,不拉长过月;重试用尽不拦过月,不出提示、不给重试,这个月等待时就没有递话,与 0164「夜里预推失败照旧不拦过月」同理。起跑、落账的细节见 #2027 票面。
    - 月初快照不新增界面:名册、案头、起居录三个抽屉已按开月截断读出,就是月初快照;主面只加递话条。
    -- 叙事以皇帝身份读账,用现成的开月截断,不透露本月推演;递话人的操守、忠心、利害照 0162 作人物输入另给。
    +- 叙事以递话人本人身份读账(0164「按本次调用的身份供料」),截到开月那一笔为止,本月的邸报、密报、奏疏、批红都不放行,不透露本月推演。
    +- 只在记下开月那一笔时起一次;进程中断、叙事没写成,本月就没有递话,不补写。

    -为什么:试玩里过月要空等 60–150 秒,只有一行「正在过月,请稍候。」(~/WorkSpace/vault/ak-cc-wiki/raw/ming-llm-runner/2026-11-30/playtest-player/REPORT.md)。陪等的话不该让等待变长(仓库 CLAUDE.md P5),也不值得为它卡住整月。递话人夜夜在殿,开月那一刻皇帝看得见的,他都看得见;用现成截断不新造读法。
    </code_context>
    <issue_to_address>
    ADR addendum becomes a mini spec

    The addendum lays out five separate normative bullets covering call timing, UI, identity, data access, and interruption behavior. This turns the ADR into a multi-decision specification rather than the required concise record of one decision.

    Consolidate the addendum into one decision expressed in 1-3 sentences, leaving reversible implementation details to the ticket or implementation documentation.
    </issue_to_address>
    ~~~

    </details>

    Sourcery assessment

    Approval pending. 4 findings to address first.

    Blocking findings: docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:45, docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:46, docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:46, docs/adr/0158-v2-frontend-receives-audience-month-and-recovery.md:46

    ***

    <details>
    <summary>Sourcery is free for open source - if you like our reviews please consider sharing them ✨</summary>

  • X

  • Mastodon

  • LinkedIn

  • Facebook
  • </details>

    <!--
    <agent_instructions>
    Sourcery reviewed this pull request. Handle the review as follows:
    1. Triage every unresolved Sourcery review comment on this pull request: fix the issue, or reply to the comment with the reason you are not fixing it.
    2. Sourcery re-reviews the first 5 pushes to this pull request automatically; 5 automatic re-reviews remain. After each push, wait for the Sourcery review check again and read its summary. When a review raises nothing new to fix, you are done.
    </agent_instructions>
    -->

    Reviewers
    Assignees
    Akagilnc Akagilnc
    Labels
    risk: low confidence: 71.9% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 31.8% (LOW) · Higher = larger blast radius
    31.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 71.9% · Lower = rushed or shallow review
    71.9%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 8.9% · Safe to merge
    8.9%