@peer-agent/protocol 0.1.0-rc.37 → 0.1.0-rc.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,9 +6,9 @@ const statuses = new Set(WORK_SESSION_STATUSES);
6
6
  const ownerships = new Set(['live', 'ended', 'unknown']);
7
7
  const owners = new Set(['bot', 'user', 'none']);
8
8
  const reasons = new Set(['settled', 'superseded', 'stop_confirmed', 'user_withdrawn',
9
- 'stop_unconfirmed', 'human_request', 'awaiting_human_gate', 'technical_block', 'awaiting_acceptance_technical',
9
+ 'stop_unconfirmed', 'human_request', 'awaiting_human_gate', 'technical_block', 'local_persistence_failed', 'awaiting_acceptance_technical',
10
10
  'verification_failed', 'live_execution', 'paused', 'unknown_facts']);
11
- const hostReasons = new Set(['live_execution', 'stop_unconfirmed', 'unknown_facts']);
11
+ const hostReasons = new Set(['live_execution', 'stop_unconfirmed', 'unknown_facts', 'local_persistence_failed']);
12
12
  export function runtimeSessionFacts(value) {
13
13
  const row = record(value), origin = record(row.origin), cancellation = record(origin.cancellation);
14
14
  const sessionId = text(row.sessionId), rawStatus = text(row.status);
@@ -426,7 +426,7 @@ export interface LifecycleCoreDecision extends ProjectionDecision {
426
426
  * `inCurrentList` 是派生事实,不允许消费端各自按 status 再判一次。
427
427
  */
428
428
  export type FollowUpOwner = 'bot' | 'user' | 'none';
429
- export type FollowUpReason = 'settled' | 'superseded' | 'stop_confirmed' | 'user_withdrawn' | 'stop_unconfirmed' | 'human_request' | 'awaiting_human_gate' | 'technical_block' | 'awaiting_acceptance_technical' | 'verification_failed' | 'live_execution' | 'paused' | 'unknown_facts';
429
+ export type FollowUpReason = 'settled' | 'superseded' | 'stop_confirmed' | 'user_withdrawn' | 'stop_unconfirmed' | 'human_request' | 'awaiting_human_gate' | 'technical_block' | 'local_persistence_failed' | 'awaiting_acceptance_technical' | 'verification_failed' | 'live_execution' | 'paused' | 'unknown_facts';
430
430
  export interface FollowUpProjection {
431
431
  readonly owner: FollowUpOwner;
432
432
  readonly inCurrentList: boolean;
@@ -34,6 +34,8 @@ export function decideFollowUp(decision, facts = {}, ownership = 'unknown') {
34
34
  if (facts.superseded === true || status === 'superseded')
35
35
  return followUpOf('none', 'superseded');
36
36
  // 3) 核验失败/缺证据:即使存在历史 accepted 事实也不能静默(那次验收是旧结论)。
37
+ if (['failed', 'waiting_agent'].includes(status) && facts.blockedReason === 'conversation_persistence_failed')
38
+ return followUpOf('bot', 'local_persistence_failed');
37
39
  if (status === 'failed')
38
40
  return followUpOf('bot', 'verification_failed');
39
41
  if (facts.accepted === true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peer-agent/protocol",
3
- "version": "0.1.0-rc.37",
3
+ "version": "0.1.0-rc.38",
4
4
  "description": "Shared host-neutral protocol contracts for Peer Agent runtimes and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",