{
  "slug": "state-and-observation",
  "category": "Decision foundations",
  "title": [
    "Agent 看到的，和环境里发生的",
    "What an Agent Sees—and What Actually Happened",
    "エージェントが見るもの、環境で起きたこと"
  ],
  "lead": [
    "工具超时了，刚才创建的表究竟存在吗？Agent 手里的消息和环境的真实状态，在这一刻分开了。理解这个差距，比记住一串模型缩写更有用。",
    "A tool times out. Does the table it was creating now exist? The agent’s messages and the environment’s actual state have diverged. That gap makes state and observation concrete.",
    "ツールがタイムアウトしたとき、作ろうとしていた表は存在するのでしょうか。エージェントのメッセージと環境の実態にずれが生まれます。この違いから状態と観測を考えます。"
  ],
  "sections": [
    {
      "title": [
        "状态要包含下一步所需的历史",
        "A state must carry the relevant history",
        "状態には必要な履歴が含まれる"
      ],
      "paragraphs": [
        [
          "马尔可夫性质说的是：给定当前状态与动作，更早的历史不再增加对下一状态的预测信息。这是对状态表示的要求，不是“Agent 不需要记忆”。如果遗漏正在进行的请求、剩余预算或已创建的资源，状态就可能不够用。",
          "The Markov property says that, given the current state and action, earlier history adds no predictive information about the next state. It is a requirement on the representation, not a claim that agents need no memory. Pending requests, remaining budgets, and created resources may all matter.",
          "Markov性とは、現在の状態と行動が分かれば、それ以前の履歴が次の状態の予測に情報を加えないことです。記憶が不要という意味ではありません。処理中の要求、残り予算、作成済みリソースも状態に必要な場合があります。"
        ],
        [
          "例如，下棋的“状态”不能总是只有棋子位置：轮到谁、特殊走法权限、和棋相关历史也可能影响合法动作。对于工具 Agent，也应先找出会改变行动后果的信息，再决定怎样保存。",
          "Even a chess state can require more than piece positions: the side to move, special-move rights, and draw-relevant history affect legal play. A tool agent likewise needs a representation of the information that changes action outcomes.",
          "チェスでも駒の位置だけで十分とは限りません。手番、特殊手の権利、引き分けに関わる履歴も影響します。ツールを使うAgentも、行動の結果を変える情報を先に特定し、それを保存します。"
        ]
      ],
      "figure": "models"
    },
    {
      "title": [
        "转移矩阵：把“可能发生什么”写清楚",
        "A transition matrix makes dynamics explicit",
        "遷移行列で変化を明示する"
      ],
      "paragraphs": [
        [
          "对齐次Markov链，Pᵢⱼ=P(Sₜ₊₁=j|Sₜ=i)。行是当前状态，列是下一状态，每行非负且和为1。若用行向量dₜ表示状态分布，则dₜ₊₁=dₜP。这个方向约定要固定，列和通常不为1；齐次表示P不随时间变，不等于链已处在平稳分布。",
          "For a homogeneous Markov chain, Pᵢⱼ=P(Sₜ₊₁=j|Sₜ=i). Rows denote current states and columns next states; entries are nonnegative and each row sums to one. With row-vector distribution dₜ, dₜ₊₁=dₜP. Keep this orientation consistent. Columns need not sum to one, and time-homogeneous transitions do not mean the chain already has its stationary distribution.",
          "斉次Markov連鎖ではPᵢⱼ=P(Sₜ₊₁=j|Sₜ=i)です。行が現在、列が次の状態で、各行は非負かつ合計1です。分布を行ベクトルdₜとすればdₜ₊₁=dₜP。列の合計は一般に1ではありません。斉次とはPが時刻で変わらないことで、既に定常分布にいる意味ではありません。"
        ],
        [
          "教学天气链：晴→晴0.8、晴→雨0.2，雨→晴0.4、雨→雨0.6。从晴开始，两步后晴的概率为0.8×0.8+0.2×0.4=0.72。一般地P⁽ᵐ⁺ⁿ⁾ᵢⱼ=ΣₖP⁽ᵐ⁾ᵢₖP⁽ⁿ⁾ₖⱼ：枚举中间状态并求和，得到矩阵乘法Pᵐ⁺ⁿ。Markov假设让路径历史可以在同一中间状态合并。",
          "In an illustrative weather chain, sunny→sunny is 0.8 and rainy→sunny is 0.4, with complementary rain probabilities. Starting sunny, the probability of sun after two steps is 0.8×0.8+0.2×0.4=0.72. In general, P⁽ᵐ⁺ⁿ⁾ᵢⱼ=ΣₖP⁽ᵐ⁾ᵢₖP⁽ⁿ⁾ₖⱼ. Summing over the intermediate state yields matrix multiplication; the Markov assumption lets histories meeting at that state be combined.",
          "晴→晴0.8、雨→晴0.4とする計算例では、晴から2ステップ後も晴である確率は0.8×0.8+0.2×0.4=0.72です。一般にP⁽ᵐ⁺ⁿ⁾ᵢⱼ=ΣₖP⁽ᵐ⁾ᵢₖP⁽ⁿ⁾ₖⱼ。中間状態で和を取ると行列積になり、Markov性によって同じ中間状態へ至る履歴をまとめられます。"
        ]
      ]
    },
    {
      "title": [
        "平稳分布存在，与实际收敛是两件事",
        "Stationarity and convergence are different",
        "定常分布と収束を区別する"
      ],
      "paragraphs": [
        [
          "平稳分布d*满足d*=d*P，表示一步之后分布不变。上面的两状态链解得d*=(2/3,1/3)。有限不可约链有唯一平稳分布；再有非周期性，任意初始分布才会向它收敛。若两个状态每步必定互换，(1/2,1/2)仍是平稳分布，但从某一个状态出发会一直振荡。",
          "A stationary distribution satisfies d*=d*P: one transition leaves the distribution unchanged. The two-state example gives d*=(2/3,1/3). A finite irreducible chain has a unique stationary distribution; aperiodicity additionally gives convergence from any starting distribution. Deterministically alternating states still have stationary distribution (1/2,1/2), but a point-mass start keeps oscillating.",
          "定常分布はd*=d*Pを満たし、1回の遷移で変わりません。上の例ではd*=(2/3,1/3)です。有限既約連鎖では一意に存在し、さらに非周期なら任意の初期分布から収束します。2状態を必ず交互に移る連鎖にも(1/2,1/2)はありますが、1状態から始めると振動し続けます。"
        ],
        [
          "细致平衡d*(i)Pᵢⱼ=d*(j)Pⱼᵢ要求每对状态双向流量相等；对i求和即可推出平稳性。它是充分条件，不是必要条件：存在环流的链也可以总体流入流出相等。把这个条件与收敛条件分开，后面才不会把“设计出正确平稳分布”误当成“已经采到了独立样本”。",
          "Detailed balance, d*(i)Pᵢⱼ=d*(j)Pⱼᵢ, equates flow in both directions for every pair. Summing proves stationarity. It is sufficient, not necessary: a chain can maintain balanced total flow while circulating around a cycle. Separating invariance from convergence prevents a correct stationary distribution from being mistaken for independent samples already obtained.",
          "詳細釣合いd*(i)Pᵢⱼ=d*(j)Pⱼᵢは各状態対の双方向流量を等しくします。和を取れば定常性が導けますが、必要条件ではありません。循環流があっても全流入と全流出は釣り合えます。定常性と収束を分ければ、正しい定常分布の設計を独立標本の取得と混同せずに済みます。"
        ]
      ]
    },
    {
      "title": [
        "观察是证据，不是状态本身",
        "Observations are evidence about state",
        "観測は状態についての証拠"
      ],
      "paragraphs": [
        [
          "环境状态可以包含服务器里全部的表、字段、权限和正在执行的任务。一次工具返回只暴露其中一部分。超时尤其含糊：请求可能没执行，也可能执行成功但返回丢失。",
          "The environment may contain every table, field, permission, and running operation. A tool response reveals only part of it. A timeout is especially ambiguous: execution may have failed, or succeeded while the response was lost.",
          "環境にはすべての表、フィールド、権限、実行中の処理があります。ツールの応答が見せるのはその一部です。タイムアウトは、未実行と、成功したが応答が失われた状態の両方を含み得ます。"
        ],
        [
          "POMDP 把隐藏状态、动作、观察和奖励分开。Agent 可以维护对可能状态的判断，再用新观察更新。严格的 belief state 是给定历史后的状态概率分布；实际工程里的摘要、TodoList、资源清单只是它的近似表示，需要靠读回验证纠正。",
          "A POMDP separates hidden state, action, observation, and reward. The agent maintains possible-state beliefs and updates them with observations. An exact belief state is a posterior distribution over states given history. Summaries, task lists, and resource inventories are practical approximations, checked against fresh reads.",
          "POMDPは隠れた状態、行動、観測、報酬を分けます。厳密なbelief stateは履歴を条件とする状態の事後分布です。要約、TodoList、リソース一覧は実用上の近似なので、新しい読み取りで確かめます。"
        ]
      ],
      "figure": "timeout"
    },
    {
      "title": [
        "HMM：隐藏过程和发射过程各有一个模型",
        "An HMM separates transitions and emissions",
        "HMMは遷移と出力を分ける"
      ],
      "paragraphs": [
        [
          "设隐藏状态zₜ按Aᵢⱼ转移，观察oₜ按Bⱼ(o)=P(o|zₜ=j)产生，初始分布为p₀。标准HMM假定隐藏链Markov，且给定zₜ后oₜ与其他时刻条件独立。观测序列本身一般不Markov：只知道今天的一条日志，可能还不足以判断服务器状态。",
          "Let hidden state zₜ transition with Aᵢⱼ and emit observation oₜ with Bⱼ(o)=P(o|zₜ=j), starting from p₀. A standard HMM assumes a Markov hidden chain and observations conditionally independent across time given their states. The observed process generally is not Markov: today’s log line alone may not determine the server’s state.",
          "隠れ状態zₜはAᵢⱼで遷移し、Bⱼ(o)=P(o|zₜ=j)で観測oₜを生成します。初期分布をp₀とします。標準HMMでは隠れ状態はMarkovで、状態を与えると各観測は条件付き独立です。観測列自体は一般にMarkovではなく、今日のログ1行だけではサーバー状態を判断できない場合があります。"
        ],
        [
          "因此联合概率可分解为P(z₁:ₜ,o₁:ₜ)=p₀(z₁)Bz₁(o₁)∏ₖ₌₂…ₜA(zₖ₋₁,zₖ)Bzₖ(oₖ)。这同时包含状态如何变化、每个状态怎样解释证据。若一条错误日志会直接影响下一条日志，且这种依赖未被z包含，标准发射独立假设就可能不合适；增加模型名字不能消除这个缺口。",
          "The joint probability factors as P(z₁:ₜ,o₁:ₜ)=p₀(z₁)Bz₁(o₁)∏ₖ₌₂…ₜA(zₖ₋₁,zₖ)Bzₖ(oₖ). It describes both hidden dynamics and how states explain evidence. If one error log directly affects the next in a way not represented by z, conditional emission independence may be inappropriate. Naming the model does not repair the missing dependency.",
          "同時確率はP(z₁:ₜ,o₁:ₜ)=p₀(z₁)Bz₁(o₁)∏ₖ₌₂…ₜA(zₖ₋₁,zₖ)Bzₖ(oₖ)と分解できます。隠れた変化と証拠の生成を同時に表します。ログ間の依存をzが表していなければ、発射の条件付き独立性は成立しないかもしれません。モデル名を付けるだけでは解決しません。"
        ]
      ]
    },
    {
      "title": [
        "前向算法：把所有可能路径加起来",
        "Forward inference sums over possible paths",
        "前向き算法は可能な経路を足し合わせる"
      ],
      "paragraphs": [
        [
          "前向量αₜ(j)=P(o₁:ₜ,zₜ=j)把“已见观察与当前状态”的联合概率压在每个状态上。初始化α₁(j)=p₀(j)Bⱼ(o₁)，递推αₜ₊₁(j)=Bⱼ(oₜ₊₁)Σᵢαₜ(i)Aᵢⱼ，最后Σⱼαₜ(j)就是观察序列的似然。稠密N状态模型的复杂度为O(TN²)，不用枚举Nᵀ条路径。",
          "The forward quantity αₜ(j)=P(o₁:ₜ,zₜ=j) collects the joint mass of observations and current state. Initialize α₁(j)=p₀(j)Bⱼ(o₁), then update αₜ₊₁(j)=Bⱼ(oₜ₊₁)Σᵢαₜ(i)Aᵢⱼ. Summing over final states gives the observation likelihood. A dense N-state model costs O(TN²), rather than enumerating Nᵀ paths.",
          "前向き量αₜ(j)=P(o₁:ₜ,zₜ=j)は観測列と現在状態の同時確率をまとめます。α₁(j)=p₀(j)Bⱼ(o₁)から、αₜ₊₁(j)=Bⱼ(oₜ₊₁)Σᵢαₜ(i)Aᵢⱼと更新し、最後の状態で足すと尤度になります。密なN状態モデルでO(TN²)となり、Nᵀ経路の列挙は不要です。"
        ],
        [
          "把αₜ按总和归一化，得到只用过去和当前观察的过滤分布P(zₜ|o₁:ₜ)。若再结合从未来向前计算的βₜ(j)=P(oₜ₊₁:ₜₑₙd|zₜ=j)，αₜβₜ归一化给出平滑分布。平滑可利用后来的证据修正过去判断；在线决策不能偷用尚未出现的未来观察。实际计算需缩放或log-sum-exp避免长序列下溢。",
          "Normalizing αₜ gives the filtering distribution P(zₜ|o₁:ₜ), using evidence available so far. Multiplying by the backward quantity βₜ(j)=P(future observations|zₜ=j) and normalizing gives smoothing. Smoothing revises past beliefs with later evidence; an online controller cannot use future observations that have not arrived. Scaling or log-sum-exp prevents numerical underflow on long sequences.",
          "αₜを正規化すると、現在までの観測だけを使うフィルタリング分布になります。未来の観測の尤度βₜを掛けて正規化すると平滑化です。後の証拠で過去の判断を修正できますが、オンライン判断で未到着の観測は使えません。長い列ではスケーリングやlog-sum-expでアンダーフローを避けます。"
        ]
      ]
    },
    {
      "title": [
        "Viterbi 找路径，Baum–Welch 学参数",
        "Viterbi finds a path; Baum–Welch fits parameters",
        "Viterbiは経路、Baum–Welchはパラメータを求める"
      ],
      "paragraphs": [
        [
          "Viterbi把前向递推里的求和换成最大值：δₜ₊₁(j)=Bⱼ(oₜ₊₁)maxᵢ[δₜ(i)Aᵢⱼ]，同时保存取到最大值的前驱，最后回溯整条最可能路径。它求argmax的联合路径，不等于每个时刻独立取边缘概率最大状态；后者拼接后可能形成低概率甚至不允许的转移。",
          "Viterbi replaces the forward sum with a maximum: δₜ₊₁(j)=Bⱼ(oₜ₊₁)maxᵢ[δₜ(i)Aᵢⱼ]. Store the maximizing predecessor and backtrack to obtain the most probable joint path. This differs from independently selecting the largest marginal at each time, which can assemble unlikely or impossible transitions.",
          "Viterbiは前向きの和を最大に替え、δₜ₊₁(j)=Bⱼ(oₜ₊₁)maxᵢ[δₜ(i)Aᵢⱼ]とします。最大の前駆を保存して遡ると、同時確率が最大の経路が得られます。各時刻の周辺分布の最大を別々に選ぶ方法とは違い、後者は不自然・不可能な遷移をつなぐことがあります。"
        ],
        [
          "Baum–Welch解决另一问题：A和B也未知。E步用前向后向得到状态占用与转移的期望计数；M步按这些计数重新归一化转移和发射概率。它是HMM的EM方法，常规精确更新使训练似然不下降，但可能收敛到局部最优。高似然也不自动证明隐藏状态具有想要的业务语义。",
          "Baum–Welch addresses unknown A and B. Its E-step uses forward–backward inference to compute expected state occupancies and transitions; its M-step renormalizes those counts into transition and emission probabilities. This HMM form of EM has nondecreasing training likelihood under exact updates, but may reach a local optimum. High likelihood does not itself identify the intended business meaning of hidden states.",
          "Baum–WelchはAとBも未知の場合に使います。Eステップで前向き・後向き計算から状態滞在と遷移の期待回数を求め、Mステップで正規化して確率を更新します。HMMのEM法で、正確な更新なら訓練尤度は下がりませんが、局所解に至り得ます。高尤度だけでは隠れ状態の業務上の意味は保証されません。"
        ]
      ]
    },
    {
      "title": [
        "POMDP 的信念更新：先预测，再用观察校正",
        "Belief updates predict, then condition on evidence",
        "信念更新は予測してから証拠で補正する"
      ],
      "paragraphs": [
        [
          "在隐藏状态之外加入动作a和奖励后，用bₜ(s)=P(sₜ=s|历史)保存信念。动作后先预测 b⁻(s′)=ΣₛP(s′|s,a)bₜ(s)；看到o后，再更新 bₜ₊₁(s′)=η O(o|s′,a)b⁻(s′)，η使总和为1。观察模型的时间约定在这里是“先执行动作、再观察新状态”，不能把新旧状态混入同一公式。",
          "With actions and rewards, maintain belief bₜ(s)=P(sₜ=s|history). Predict after the action: b⁻(s′)=ΣₛP(s′|s,a)bₜ(s). Then condition on observation o: bₜ₊₁(s′)=η O(o|s′,a)b⁻(s′), where η normalizes the distribution. This convention observes the new state after the action; mixing old-state and new-state observation conventions changes the formula.",
          "行動と報酬を加え、bₜ(s)=P(sₜ=s|履歴)を保持します。まずb⁻(s′)=ΣₛP(s′|s,a)bₜ(s)と予測し、観測oでbₜ₊₁(s′)=η O(o|s′,a)b⁻(s′)と補正します。ηは正規化係数です。ここでは行動後の新状態を観測する規約で、新旧の状態を混同してはいけません。"
        ],
        [
          "纯教学数值：超时后认为表已创建概率0.6；查询返回“未找到”，假设已创建时漏查概率0.1，未创建时正确报未找到概率0.9。更新后已创建概率为0.6×0.1/(0.6×0.1+0.4×0.9)=1/7。读回降低不确定性，却不自动变成绝对确定；实际要根据权限、分页、最终一致性和唯一标识判断查询是否可靠，不能把这些示例概率当线上校准值。",
          "A teaching example: after a timeout, assign 0.6 probability to creation. A query says “not found.” Suppose its miss probability after creation is 0.1 and its correct negative probability without creation is 0.9. The posterior is 0.6×0.1/(0.6×0.1+0.4×0.9)=1/7. Readback reduces uncertainty without guaranteeing certainty. Real reliability depends on permissions, pagination, eventual consistency, and identity; these numbers are not calibrated production probabilities.",
          "計算例として作成済み確率を0.6とし、「見つからない」という応答の確率を、作成済みなら0.1、未作成なら0.9と仮定します。事後の作成済み確率は0.6×0.1/(0.6×0.1+0.4×0.9)=1/7です。読戻しは不確実性を減らしても確実性を保証しません。実際には権限・ページング・結果整合性・識別子を確認し、この仮の確率を実測値として使わないことが必要です。"
        ]
      ]
    },
    {
      "title": [
        "同一条轨迹，两种续做方式",
        "Two continuations of the same trace",
        "同じ軌跡からの2つの続け方"
      ],
      "paragraphs": [
        [
          "示例：用户要求创建“订单”表。Create 返回超时。若直接重试，可能产生两张同名表；若先查询，并核对资源标识、创建时间或幂等请求标识，就能减少重复创建。确认表已存在后，保存实际 ID，再添加字段。",
          "Example: a user requests an Orders table and Create times out. Blindly retrying can create duplicates. Reading back and checking resource IDs, creation time, or an idempotency key helps resolve the ambiguity. Once existence is verified, retain the actual ID and add fields.",
          "例としてOrders表の作成がタイムアウトしたとします。すぐに再実行すると重複し得ます。リソースID、作成時刻、冪等キーなどを読み戻して確認し、存在が確認できたら実際のIDを保存してフィールドを追加します。"
        ],
        [
          "因此，“工具调用失败”与“业务动作没有发生”需要分开记录。错误消息说明通信或执行路径上的观察；资源读回说明环境里现在是什么。计划应随证据更新，而不是随一句模型自述更新。",
          "Record “the tool call failed” separately from “the business action did not happen.” An error is an observation about the communication or execution path; readback is evidence about current resources. Update the plan from evidence, not from an unsupported completion statement.",
          "「ツール呼び出しが失敗した」と「操作が行われなかった」は別に記録します。エラーは通信・実行経路の観測であり、読み戻しは現在のリソースについての証拠です。完了したという自己申告ではなく、証拠に基づいて計画を更新します。"
        ]
      ]
    },
    {
      "title": [
        "信息也有行动价值",
        "Information has action value",
        "情報を得ることにも価値がある"
      ],
      "paragraphs": [
        [
          "POMDP可以在信念空间中规划：即时期望奖励r(b,a)=Σₛb(s)r(s,a)，后续价值还要对可能观察求平均。读取状态即使没有直接业务产出，也可能避免重复创建或错误删除；是否值得读，要比较信息带来的后续收益与延迟、费用，而不是给每个read固定加分。",
          "A POMDP plans over beliefs: immediate expected reward is r(b,a)=Σₛb(s)r(s,a), and future value averages over possible observations. Reading state can prevent duplicate creation or incorrect deletion even without direct business output. Its value comes from improved later choices minus latency and cost, not from a fixed bonus for every read.",
          "POMDPは信念上で計画します。直近の期待報酬はr(b,a)=Σₛb(s)r(s,a)で、将来価値は可能な観測でも平均します。読取り自体に成果がなくても、重複作成や誤削除を防げます。価値は後の判断改善から遅延・費用を引いたもので、readごとの固定加点ではありません。"
        ],
        [
          "精确信念在已知模型下是历史的充分统计量，但N状态的信念仍在连续的N−1维空间中。把它改成最可能状态会丢掉多峰不确定性；把历史压成自然语言摘要或RNN向量也没有自动的充分性保证。工程上可保存“已确认／未知／待核对”的状态与证据，再用恢复测试检查压缩丢了什么。",
          "An exact belief is a sufficient history statistic under the model, yet for N states it lives in a continuous N−1 dimensional space. Replacing it with the most likely state loses multimodal uncertainty. A natural-language summary or recurrent vector is not automatically sufficient either. In practice, preserve confirmed, unknown, and pending facts with evidence, then test recovery to identify information lost by compression.",
          "既知モデルの厳密な信念は履歴の十分統計量ですが、N状態でもN−1次元の連続空間にあります。最尤状態だけでは多峰性を失います。自然言語要約やRNNベクトルも自動的に十分ではありません。実務では確認済み・不明・要確認を証拠付きで残し、再開テストで圧縮による欠落を調べます。"
        ]
      ]
    },
    {
      "title": [
        "MCMC 是用链采样，不是再一种控制策略",
        "MCMC uses a chain for sampling, not control",
        "MCMCは連鎖で標本を得る方法"
      ],
      "paragraphs": [
        [
          "MCMC反过来设计转移，使目标分布成为平稳分布。若目标只知未归一化密度f(x)，Metropolis–Hastings从q(y|x)提出y，以 min(1, f(y)q(x|y)/(f(x)q(y|x)))接受，否则留在x。归一化常数在比值中消掉；对称提议时q项才可约去，不能对任意提议都省略。",
          "MCMC constructs transitions whose stationary distribution is the desired target. Given unnormalized density f(x), Metropolis–Hastings proposes y from q(y|x) and accepts with min(1, f(y)q(x|y)/(f(x)q(y|x))); otherwise it stays at x. The normalizing constant cancels. Proposal terms cancel only for symmetric proposals, not in general.",
          "MCMCは目標分布を定常分布とする遷移を設計します。未正規化密度f(x)から、q(y|x)で候補yを作り、min(1, f(y)q(x|y)/(f(x)q(y|x)))で受理し、拒否ならxに留まります。正規化定数は消えますが、提案分布の項が消えるのは対称な場合だけです。"
        ],
        [
          "Gibbs采样逐坐标从条件分布取样，是另一种构造方式。目标平稳并不等于有限步已混合；常见的正自相关会让有效样本数小于保存条数（负自相关情形可能相反），需要看多链与有效样本诊断。这里没有为最大化奖励而选择业务动作，因此MCMC、HMM推断和MDP控制共享Markov结构，却在解不同的问题。",
          "Gibbs sampling instead samples coordinates from conditional distributions. Having the right invariant target does not establish finite-time mixing; positive autocorrelation commonly reduces effective sample size (negative correlation can have the opposite effect), so inspect multiple chains and effective-sample diagnostics. No business action is being optimized for reward here. MCMC, HMM inference, and MDP control share Markov structure while solving different problems.",
          "Gibbs法は各座標を条件付き分布から順にサンプルします。正しい不変分布があっても有限ステップで十分混ざったとは限らず、通常の正の自己相関では有効標本数が保存数より少なくなります（負の相関では逆の場合があります）。複数連鎖や有効標本の診断が必要です。報酬最大化の行動選択ではなく、HMM推論やMDP制御とは別の問題です。"
        ]
      ]
    },
    {
      "title": [
        "记忆应该保存什么",
        "What memory should preserve",
        "記憶に残すべきもの"
      ],
      "paragraphs": [
        [
          "优先保留会影响下一步的内容：已验证的资源 ID、依赖关系、未完成动作、失败是否可能产生副作用、用户尚未满足的约束。较早的长工具输出可以概括，但这些状态不能只剩一句“建表进行中”。",
          "Preserve what changes the next action: verified resource IDs, dependencies, pending work, possible side effects of failures, and unmet user constraints. Older tool output can be summarized, but these facts should not collapse into “database setup in progress.”",
          "次の行動を変える情報を残します。確認済みのID、依存関係、未完了操作、失敗時の副作用、未達の制約です。古い出力を要約しても、これらを「構築中」の一言にまとめてはいけません。"
        ],
        [
          "Markov Chain 描述状态如何变化；HMM 用观察推断隐藏状态；MDP 加入可控动作；POMDP 同时处理行动与观察不完整。它们是不同的建模问题，不是 Agent 必须依次经过的四个阶段。",
          "A Markov chain models state transitions; an HMM infers hidden states from observations; an MDP adds controlled actions; a POMDP combines control with partial observation. These are different modeling questions, not four execution stages of an agent.",
          "Markov Chainは状態遷移、HMMは観測からの隠れ状態推定、MDPは行動による制御、POMDPは制御と部分観測を扱います。Agentが順番に通過する4つの処理段階ではありません。"
        ]
      ]
    }
  ],
  "figures": [
    {
      "id": "models",
      "title": [
        "四种建模视角",
        "Four modeling perspectives",
        "4つのモデル化の視点"
      ],
      "caption": [
        "横向比较建模对象，框之间没有执行顺序。",
        "A comparison of modeling objects; boxes do not imply execution order.",
        "対象の比較であり、箱の間に実行順序はありません。"
      ],
      "rows": [
        {
          "connect": false,
          "nodes": [
            [
              "Markov Chain",
              "Markov chain",
              "Markov Chain"
            ],
            [
              "HMM",
              "HMM",
              "HMM"
            ]
          ],
          "sub": [
            [
              "状态转移",
              "State transitions",
              "状態遷移"
            ],
            [
              "隐藏状态 → 观察",
              "Hidden state → observation",
              "隠れ状態 → 観測"
            ]
          ]
        },
        {
          "connect": false,
          "nodes": [
            [
              "MDP",
              "MDP",
              "MDP"
            ],
            [
              "POMDP",
              "POMDP",
              "POMDP"
            ]
          ],
          "sub": [
            [
              "状态 + 可控动作",
              "State + controlled action",
              "状態＋制御可能な行動"
            ],
            [
              "隐藏状态 + 行动 + 观察",
              "Hidden state + action + observation",
              "隠れ状態＋行動＋観測"
            ]
          ]
        }
      ]
    },
    {
      "id": "timeout",
      "title": [
        "超时之后，先确认状态",
        "After a timeout, establish state",
        "タイムアウト後に状態を確認"
      ],
      "caption": [
        "示例：超时不能确定是否创建成功。核对身份后再续做，避免把通信错误当成环境回滚。",
        "Illustrative case: a timeout does not establish whether creation succeeded. Verify identity before continuing.",
        "説明用の例：タイムアウトだけでは作成の成否は分かりません。対象を確認してから続けます。"
      ],
      "rows": [
        {
          "nodes": [
            [
              "创建订单表",
              "Create Orders",
              "Ordersを作成"
            ],
            [
              "超时：结果未知",
              "Timeout: unknown outcome",
              "タイムアウト：結果不明"
            ],
            [
              "读取并核对",
              "Read back and verify",
              "読み戻して照合"
            ]
          ]
        },
        {
          "nodes": [
            [
              "确认已存在",
              "Existence verified",
              "存在を確認"
            ],
            [
              "保存真实 ID",
              "Retain actual ID",
              "実際のIDを保存"
            ],
            [
              "继续添加字段",
              "Continue with fields",
              "フィールド追加へ"
            ]
          ]
        }
      ],
      "bridges": [
        [
          0,
          2,
          1,
          0
        ]
      ]
    }
  ],
  "references": [
    [
      "Kaelbling, Littman & Cassandra · Planning and acting in partially observable stochastic domains",
      "https://doi.org/10.1016/S0004-3702(98)00023-X"
    ],
    [
      "Sutton & Barto · Reinforcement Learning",
      "https://www.andrew.cmu.edu/course/10-703/textbook/BartoSutton.pdf"
    ],
    [
      "Rabiner · A Tutorial on Hidden Markov Models",
      "https://www.cs.ubc.ca/~murphyk/Bayes/rabiner.pdf"
    ],
    [
      "Hastings · Monte Carlo Sampling Methods Using Markov Chains",
      "https://doi.org/10.1093/biomet/57.1.97"
    ]
  ],
  "related": [
    "bandits-to-planning",
    "agent-memory",
    "coding-agent-trajectories"
  ]
}
