principles-disciple 1.223.0 → 1.225.0

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.
@@ -87,9 +87,20 @@ export declare class SignalCollectorHost {
87
87
  * 3. 按 strength 分流:STRONG → emitPainDetectedEvent;WEAK → trackFriction 累积 GFI;none → 仅记录
88
88
  */
89
89
  private detectAsyncAndRoute;
90
+ /**
91
+ * Stable occurrence identity for correction dedup (ADR-0020 §11.4): the real
92
+ * per-session turn index when the caller supplies one (parity with
93
+ * recordUserTurn), otherwise a content-derived legacy fallback. The fallback
94
+ * is a degradation — never silent (rc-9).
95
+ */
96
+ private resolveOccurrenceId;
90
97
  /**
91
98
  * STRONG 分流 → emitPainDetectedEvent (修断裂 ③)。
92
99
  * 带 STRONG rate limit 门控 (spec §7.2):单 session 每小时上限 strongRateLimitPerHour。
100
+ *
101
+ * Codex Governance Closure Slice B 收敛 (ADR-0020 §11.4):pain id 走
102
+ * production-pain-evidence 的内容派生 canonicalization(同一 pain identity
103
+ * 权威),不再铸造随机 `correction_<traceId>`;trace id 降级为 correlation 字段。
93
104
  */
94
105
  private routeStrong;
95
106
  /**
@@ -1,41 +1,18 @@
1
1
  /**
2
- * Live Signal Keyword Store — Learn→Detect 反馈闭环的检测侧接线
3
- * (MVP_CORE_LOOP_CONTRACT INV-01 §3 / P0-B)。
2
+ * Live Signal Keyword Store — OpenClaw delegation wrapper.
4
3
  *
5
- * 审计背景 (ISSUE-003): 修复前检测用 buildDefaultKeywordStore() 硬编码 6 词,
6
- * 与 CorrectionCueLearner/KeywordOptimizationService 写入的
7
- * <stateDir>/correction_keywords.json 完全脱钩——optimizer 学到的词永不回流检测。
8
- *
9
- * 本模块把 learner store (canonical mutable correction cue source) 投影成
10
- * UnifiedKeywordStore,并在每次检测时按 mtime 检查刷新:
11
- * - optimizer 写入 correction_keywords.json 后,无需重启 OpenClaw,
12
- * 下一次 detectSync 即消费新词 (cache invalidation via stat mtime)。
13
- * - empathy cue 不在 learner store 中(learner 是 correction-only),
14
- * 以 seed overlay 保留,行为不变。
15
- * - 3 个已证实的高精度纠正短语(不在 learner seed 集内)以 seed overlay
16
- * 保留,高精度 deterministic path 不回退。
17
- * - learned 词 weight ≥ HIGH_PRECISION_LEARNED_WEIGHT → precision 'high'
18
- * (可确定性触发 STRONG);FP 权重衰减(×0.8)是自然降级机制。
4
+ * The store projection itself (learner JSON → UnifiedKeywordStore, mtime
5
+ * refresh, seed overlays) is host-neutral and was extracted to
6
+ * `@principles/host-runtime` `createSharedCorrectionKeywordStore` by Codex
7
+ * Governance Closure Slice B (PRI-623, SPEC §12) so OpenClaw and Codex detect
8
+ * through the SAME keyword store, rule version, and STRONG semantics. This
9
+ * module keeps the OpenClaw-facing signature (WorkspaceContext + SystemLogger)
10
+ * and re-exports the shared constants.
19
11
  */
20
- import type { UnifiedKeywordStore } from '@principles/core/runtime-v2';
12
+ import { HIGH_PRECISION_LEARNED_WEIGHT, HIGH_PRECISION_CORRECTION_OVERLAY, EMPATHY_SEED_OVERLAY } from '@principles/host-runtime';
21
13
  import type { WorkspaceContext } from './workspace-context.js';
22
- /** learned 词进入高精度 deterministic path 的权重阈值(仅适用于 seed/owner_promoted;
23
- * llm_learned 恒 ambiguous — 见 projectLearnedStore 内注释) */
24
- export declare const HIGH_PRECISION_LEARNED_WEIGHT = 0.7;
25
- /** 高精度纠正短语 overlay(已验证的确定性 STRONG 路径,不属于 learner seed 集) */
26
- export declare const HIGH_PRECISION_CORRECTION_OVERLAY: ReadonlyArray<readonly [string, number]>;
27
- /** empathy seed overlay(检测行为不变) */
28
- export declare const EMPATHY_SEED_OVERLAY: ReadonlyArray<readonly [string, number]>;
29
- export interface LiveKeywordStore {
30
- /** 每次检测调用:mtime 未变返回缓存,变了重载并返回新快照 */
31
- resolve(): UnifiedKeywordStore;
32
- /** 当前快照的观测元数据(测试/诊断用) */
33
- stats(): {
34
- totalTerms: number;
35
- learnedTerms: number;
36
- lastReloadedAt: string | null;
37
- };
38
- }
14
+ export { HIGH_PRECISION_LEARNED_WEIGHT, HIGH_PRECISION_CORRECTION_OVERLAY, EMPATHY_SEED_OVERLAY, };
15
+ export type { SharedCorrectionKeywordStore as LiveKeywordStore } from '@principles/host-runtime';
39
16
  export declare function createLiveSignalKeywordStore(wctx: WorkspaceContext, logger?: {
40
17
  debug?: (msg: string) => void;
41
- }): LiveKeywordStore;
18
+ }): import("@principles/host-runtime").SharedCorrectionKeywordStore;