create-principles-disciple 1.145.32 → 1.145.34

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.
Files changed (86) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/ingestion/ingestion.js +3 -1
  3. package/codex-adapter/package.json +1 -1
  4. package/console/dist/server/models/ActivationsConsoleModel.d.ts +19 -2
  5. package/console/dist/server/models/ActivationsConsoleModel.js +124 -10
  6. package/console/dist/server/models/OwnerDecisionConsoleModel.d.ts +3 -1
  7. package/console/dist/server/models/OwnerDecisionConsoleModel.js +6 -2
  8. package/console/dist/server/routes/activations.js +7 -2
  9. package/console/dist/server/routes/owner-decisions.js +1 -1
  10. package/core/dist/runtime-v2/activation/index.d.ts +6 -0
  11. package/core/dist/runtime-v2/activation/index.d.ts.map +1 -1
  12. package/core/dist/runtime-v2/activation/index.js +3 -0
  13. package/core/dist/runtime-v2/activation/index.js.map +1 -1
  14. package/core/dist/runtime-v2/activation/openclaw-promotion-checks.d.ts +75 -0
  15. package/core/dist/runtime-v2/activation/openclaw-promotion-checks.d.ts.map +1 -1
  16. package/core/dist/runtime-v2/activation/openclaw-promotion-checks.js +131 -37
  17. package/core/dist/runtime-v2/activation/openclaw-promotion-checks.js.map +1 -1
  18. package/core/dist/runtime-v2/activation/production-gate-deps.d.ts.map +1 -1
  19. package/core/dist/runtime-v2/activation/production-gate-deps.js +7 -3
  20. package/core/dist/runtime-v2/activation/production-gate-deps.js.map +1 -1
  21. package/core/dist/runtime-v2/activation/recovery-composition.d.ts +54 -0
  22. package/core/dist/runtime-v2/activation/recovery-composition.d.ts.map +1 -0
  23. package/core/dist/runtime-v2/activation/recovery-composition.js +129 -0
  24. package/core/dist/runtime-v2/activation/recovery-composition.js.map +1 -0
  25. package/core/dist/runtime-v2/activation/recovery-control-surfaces.d.ts +62 -0
  26. package/core/dist/runtime-v2/activation/recovery-control-surfaces.d.ts.map +1 -0
  27. package/core/dist/runtime-v2/activation/recovery-control-surfaces.js +84 -0
  28. package/core/dist/runtime-v2/activation/recovery-control-surfaces.js.map +1 -0
  29. package/core/dist/runtime-v2/activation/rulecode-shadow-summary.d.ts +13 -1
  30. package/core/dist/runtime-v2/activation/rulecode-shadow-summary.d.ts.map +1 -1
  31. package/core/dist/runtime-v2/activation/rulecode-shadow-summary.js +24 -1
  32. package/core/dist/runtime-v2/activation/rulecode-shadow-summary.js.map +1 -1
  33. package/core/dist/runtime-v2/index.d.ts +2 -2
  34. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  35. package/core/dist/runtime-v2/index.js +1 -1
  36. package/core/dist/runtime-v2/index.js.map +1 -1
  37. package/core/dist/runtime-v2/trajectory-schema.d.ts.map +1 -1
  38. package/core/dist/runtime-v2/trajectory-schema.js +12 -1
  39. package/core/dist/runtime-v2/trajectory-schema.js.map +1 -1
  40. package/core/dist/runtime-v2/types/event-types.d.ts +10 -0
  41. package/core/dist/runtime-v2/types/event-types.d.ts.map +1 -1
  42. package/core/dist/runtime-v2/types/event-types.js +1 -0
  43. package/core/dist/runtime-v2/types/event-types.js.map +1 -1
  44. package/core/package.json +1 -1
  45. package/dist/installer.d.ts.map +1 -1
  46. package/dist/installer.js +111 -46
  47. package/dist/installer.js.map +1 -1
  48. package/host-runtime/dist/cli-recovery-probe.d.ts +30 -0
  49. package/host-runtime/dist/cli-recovery-probe.js +169 -0
  50. package/host-runtime/dist/governance-signal-admission.js +22 -5
  51. package/host-runtime/dist/host-liveness-contract.d.ts +51 -28
  52. package/host-runtime/dist/host-liveness-contract.js +143 -46
  53. package/host-runtime/dist/index.d.ts +2 -0
  54. package/host-runtime/dist/index.js +2 -0
  55. package/host-runtime/dist/production-pain-evidence.d.ts +2 -0
  56. package/host-runtime/dist/production-pain-evidence.js +46 -8
  57. package/host-runtime/dist/production-rulehost-gate.js +24 -6
  58. package/host-runtime/dist/workbuddy-rule-context-provider.d.ts +33 -0
  59. package/host-runtime/dist/workbuddy-rule-context-provider.js +126 -0
  60. package/host-runtime/dist/workspace-behavior-evidence.d.ts +22 -5
  61. package/host-runtime/dist/workspace-behavior-evidence.js +41 -11
  62. package/host-runtime/package.json +1 -1
  63. package/package.json +2 -2
  64. package/pd-cli/dist/commands/recovery-reachability-probe.d.ts +25 -0
  65. package/pd-cli/dist/commands/recovery-reachability-probe.d.ts.map +1 -0
  66. package/pd-cli/dist/commands/recovery-reachability-probe.js +50 -0
  67. package/pd-cli/dist/commands/recovery-reachability-probe.js.map +1 -0
  68. package/pd-cli/dist/commands/runtime-activation.d.ts +10 -1
  69. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
  70. package/pd-cli/dist/commands/runtime-activation.js +81 -3
  71. package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
  72. package/pd-cli/package.json +1 -1
  73. package/plugin/dist/bundle.js +385 -385
  74. package/plugin/dist/governance-audit.js +1 -1
  75. package/plugin/dist/openclaw.plugin.json +1 -1
  76. package/plugin/dist/rulehost-evidence.js +1 -1
  77. package/plugin/openclaw.plugin.json +1 -1
  78. package/plugin/package.json +1 -1
  79. package/release-manager/dist/installer.d.ts.map +1 -1
  80. package/release-manager/dist/installer.js +111 -46
  81. package/release-manager/dist/installer.js.map +1 -1
  82. package/release-manager/package.json +2 -2
  83. package/workbuddy-adapter/dist/codec/input-decoder.d.ts +14 -11
  84. package/workbuddy-adapter/dist/codec/input-decoder.js +28 -14
  85. package/workbuddy-adapter/dist/pd-hook.js +31 -12
  86. package/workbuddy-adapter/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "productVersion": "2.4.0",
4
- "sourceCommit": "e521227eda1422f6f53934b204d0fd384bf76cdd"
4
+ "sourceCommit": "ad6954c8d1ef4140ea7c9a03f3419ab742cb7c92"
5
5
  }
@@ -168,7 +168,9 @@ function ingestTranscriptDelta({ fallbackRootSessionId, canonicalPath, identity,
168
168
  // and the next Stop retries instead of silently losing the verified facts.
169
169
  const verifiedOutcomes = collectVerifiedToolOutcomes(decoded.observations);
170
170
  if (verifiedOutcomes.length > 0) {
171
- const verified = recordVerifiedToolOutcomes({ workspaceDir, sessionId: rootSessionId, outcomes: verifiedOutcomes });
171
+ // SPEC-RULECODE-HOST-PROMOTION-001 R2: stamp the producing host on the
172
+ // inserted rows so attribution-aware readers can prove provenance.
173
+ const verified = recordVerifiedToolOutcomes({ workspaceDir, sessionId: rootSessionId, outcomes: verifiedOutcomes, hostKind: 'codex' });
172
174
  const failed = verified.find((result) => result.status === 'unavailable');
173
175
  if (failed !== undefined) {
174
176
  const reason = failed.reason === 'trajectory_db_not_found' ? 'verified_outcome_db_unavailable' : `verified_outcome_write_failed:${failed.reason.split(':', 2)[1] ?? ''}`;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/codex-adapter",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Codex CLI host adapter for Principles Disciple — implements HostAdapter interface for OpenAI Codex CLI's stdin/stdout JSON hook model (ADR-0020).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -152,7 +152,12 @@ export declare class ActivationsConsoleModel {
152
152
  private readonly governanceAuditWriter;
153
153
  constructor(workspaceDir: string, governanceAuditWriter?: GovernanceAuditWriter);
154
154
  getActivations(targetHost?: PromptInjectionTargetHost): Promise<ActivationsResponse>;
155
- getOwnerReview(activationId: string, ownerIdentityConfigured?: boolean, ownerActor?: OwnerPromotionActor): Promise<RuleCodeOwnerReview>;
155
+ getOwnerReview(activationId: string, ownerIdentityConfigured?: boolean, options?: {
156
+ ownerActor?: OwnerPromotionActor;
157
+ routeContext?: {
158
+ servedThroughAuthenticatedConsoleRoute: boolean;
159
+ };
160
+ }): Promise<RuleCodeOwnerReview>;
156
161
  continueObserving(activationId: string, input: OwnerMutationInput): Promise<{
157
162
  decisionId: string;
158
163
  }>;
@@ -173,7 +178,19 @@ export declare class ActivationsConsoleModel {
173
178
  artifactDigest: string;
174
179
  controlVersion: number;
175
180
  confirmed: boolean;
176
- }, input: OwnerMutationInput): Promise<OwnerPromotionResult>;
181
+ }, input: OwnerMutationInput & {
182
+ routeContext?: {
183
+ servedThroughAuthenticatedConsoleRoute: boolean;
184
+ };
185
+ }): Promise<OwnerPromotionResult>;
186
+ /**
187
+ * SPEC R4/P1: non-destructive write-capability probe for the global-pause
188
+ * substrate. Inserts a probe pause row inside an explicit transaction,
189
+ * verifies it, ROLLS BACK, then asserts the table is unchanged (no probe
190
+ * row, same row count). Pure substrate evidence for THIS workspace — the
191
+ * browser-to-HTTP entry path is deliberately not claimed.
192
+ */
193
+ private probePauseSubstrate;
177
194
  private withMutableRuleCode;
178
195
  private requireOwnerDecisionFeature;
179
196
  deactivateActivation(activationId: string): Promise<{
@@ -112,7 +112,8 @@ export function collectRuleCodeEventEntries(workspaceDir) {
112
112
  }
113
113
  return { entries, sourceDirsFound };
114
114
  }
115
- function readRuleCodeTelemetry(workspaceDir, activationId, decisions) {
115
+ function readRuleCodeTelemetry(workspaceDir, activationId, options) {
116
+ const { decisions } = options;
116
117
  const countCircuitTrips = (minimumTime) => decisions.filter(decision => decision.decision === 'safety_isolate' && Date.parse(decision.decidedAt) >= minimumTime).length;
117
118
  const now = Date.now();
118
119
  const unavailableWindow = (minimumTime) => ({ eligible: null, matched: null, blocked: null, unhealthy: null, circuitTrips: countCircuitTrips(minimumTime), toolDistribution: null });
@@ -154,7 +155,11 @@ function readRuleCodeTelemetry(workspaceDir, activationId, decisions) {
154
155
  const filePath = typeof entry.data.filePath === 'string' ? entry.data.filePath : '';
155
156
  representativeSamples.push({ toolName: entry.data.toolName, decision: entry.data.decision, pathCategory: path.extname(filePath) || (filePath ? 'workspace_path' : 'no_path') });
156
157
  }
157
- return { shadowSummary: summarizeRuleCodeShadowEvents(entries, activationId), metrics: { last24Hours: summarizeWindow(now - 24 * 60 * 60 * 1000), last7Days: summarizeWindow(now - 7 * 24 * 60 * 60 * 1000), representativeSamples } };
158
+ // SPEC-RULECODE-HOST-PROMOTION-001 B3: the promotion shadow summary counts
159
+ // only samples attributed to the workspace's resolved promotion host —
160
+ // another host's samples (and pre-attribution legacy rows) can never
161
+ // satisfy this host's readiness threshold.
162
+ return { shadowSummary: summarizeRuleCodeShadowEvents(entries, activationId, options.promotionHostKind), metrics: { last24Hours: summarizeWindow(now - 24 * 60 * 60 * 1000), last7Days: summarizeWindow(now - 7 * 24 * 60 * 60 * 1000), representativeSamples } };
158
163
  }
159
164
  export class ActivationsConsoleModel {
160
165
  workspaceDir;
@@ -439,7 +444,7 @@ export class ActivationsConsoleModel {
439
444
  catch { /* best-effort */ }
440
445
  }
441
446
  }
442
- async getOwnerReview(activationId, ownerIdentityConfigured = false, ownerActor) {
447
+ async getOwnerReview(activationId, ownerIdentityConfigured = false, options) {
443
448
  const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: true });
444
449
  try {
445
450
  const activationStore = new SqliteActivationStateStore(conn);
@@ -457,7 +462,63 @@ export class ActivationsConsoleModel {
457
462
  throw new Error(`Artifact not found for activation: ${activation.artifactId}`);
458
463
  const digest = `sha256:${createHash('sha256').update(JSON.stringify(artifact), 'utf8').digest('hex')}`;
459
464
  const decisions = await safetyStore.listDecisions(activationId);
460
- const telemetry = readRuleCodeTelemetry(this.workspaceDir, activationId, decisions);
465
+ // PRI-813: the promotion host contract follows the workspace's REAL
466
+ // host declarations — a Codex (or multi-host) workspace no longer
467
+ // inherits the OpenClaw capability claim (fail closed, null contract).
468
+ // Resolved BEFORE telemetry so the shadow summary can attribute samples
469
+ // to the SAME host the readiness checks will run against
470
+ // (SPEC-RULECODE-HOST-PROMOTION-001 B3).
471
+ const promotionHost = resolvePromotionHostLiveness(this.workspaceDir);
472
+ // Review R4/P1: PER-CAPABILITY target-environment evidence, produced
473
+ // fresh for THIS evaluation (never cached). Each entry states exactly
474
+ // what it proved — no evidence is reused across capabilities:
475
+ // - pd_status / rulecode_deactivate: the REAL pd CLI subprocess probes
476
+ // (shared host-runtime implementation; the status listing must
477
+ // contain this activation; deactivate runs its real --dry-run
478
+ // validation path — no audit write, no mutation);
479
+ // - rulecode_global_pause: the durable pause substrate of THIS
480
+ // workspace is writable — a transaction-rollback probe inserts a
481
+ // probe pause row, verifies it, rolls back, and asserts the table is
482
+ // unchanged afterwards. Substrate evidence only; the browser-to-HTTP
483
+ // entry path remains e2e/isolated-route-test evidence and is NOT
484
+ // claimed here;
485
+ // - owner_review_access: THIS readiness evaluation is being served
486
+ // through a real authenticated Console HTTP route (the owner-review
487
+ // GET or the promote POST passed the signal down) — the entry exists,
488
+ // dispatches, authenticates, and binds to this workspace, observed
489
+ // right now.
490
+ const recoveryCapabilities = [];
491
+ try {
492
+ const { resolveCliRecoveryEntry, probeCliActivationStatus, probeCliDeactivateDryRun } = await import('@principles/host-runtime');
493
+ const cliEntry = resolveCliRecoveryEntry();
494
+ if (cliEntry === null) {
495
+ recoveryCapabilities.push({ capabilityId: 'pd_status', channel: 'cli', ok: false, workspaceMatched: false, detail: 'pd CLI entry not found in this environment' }, { capabilityId: 'rulecode_deactivate', channel: 'cli', ok: false, workspaceMatched: false, detail: 'pd CLI entry not found in this environment' });
496
+ }
497
+ else {
498
+ recoveryCapabilities.push(await probeCliActivationStatus({ cliEntry, workspaceDir: this.workspaceDir, expectedActivationId: activationId }), await probeCliDeactivateDryRun({ cliEntry, workspaceDir: this.workspaceDir }));
499
+ }
500
+ }
501
+ catch (error) {
502
+ const detail = error instanceof Error ? error.message : String(error);
503
+ recoveryCapabilities.push({ capabilityId: 'pd_status', channel: 'cli', ok: false, workspaceMatched: false, detail: `cli probe failed: ${detail}` }, { capabilityId: 'rulecode_deactivate', channel: 'cli', ok: false, workspaceMatched: false, detail: `cli probe failed: ${detail}` });
504
+ }
505
+ recoveryCapabilities.push(this.probePauseSubstrate());
506
+ recoveryCapabilities.push({
507
+ capabilityId: 'owner_review_access',
508
+ channel: 'console',
509
+ ok: options?.routeContext?.servedThroughAuthenticatedConsoleRoute === true,
510
+ workspaceMatched: options?.routeContext?.servedThroughAuthenticatedConsoleRoute === true,
511
+ detail: options?.routeContext?.servedThroughAuthenticatedConsoleRoute === true
512
+ ? undefined
513
+ : 'this readiness evaluation was not served through an authenticated Console HTTP route (direct model call); the owner-review entry is therefore not evidenced',
514
+ });
515
+ const recoveryStoreProbe = {
516
+ source: 'console-route-served',
517
+ ok: recoveryCapabilities.every(capability => capability.ok),
518
+ workspaceMatched: recoveryCapabilities.every(capability => capability.workspaceMatched),
519
+ capabilities: recoveryCapabilities,
520
+ };
521
+ const telemetry = readRuleCodeTelemetry(this.workspaceDir, activationId, { decisions, promotionHostKind: promotionHost.ok ? promotionHost.hostKind : undefined });
461
522
  const flags = computeFlagsFromLoadResult(loadPdConfig(this.workspaceDir));
462
523
  // PRI-634-F R3 (SPEC P1-1): promotion readiness evaluates through the
463
524
  // SAME workspace host-declaration resolver as CLI/Approvals — the bare
@@ -465,10 +526,6 @@ export class ActivationsConsoleModel {
465
526
  // provenance degrades to the legacy readiness behavior (read-model
466
527
  // probe, not a mutation), consistent with the CLI readiness writer.
467
528
  const toolSemantics = resolveWorkspaceHostToolSemantics(this.workspaceDir);
468
- // PRI-813: the promotion host contract follows the workspace's REAL
469
- // host declarations — a Codex (or multi-host) workspace no longer
470
- // inherits the OpenClaw capability claim (fail closed, null contract).
471
- const promotionHost = resolvePromotionHostLiveness(this.workspaceDir);
472
529
  const writer = new RuleHostWriter({
473
530
  gateDeps: createProductionGateDeps({
474
531
  projectDir: this.workspaceDir,
@@ -496,7 +553,23 @@ export class ActivationsConsoleModel {
496
553
  ownerIdentityConfigured,
497
554
  safetyControlsEnabled: isFeatureEnabled(flags, 'rulecode_safety_controls'),
498
555
  hostContract: promotionHost.ok ? promotionHost.hostContract : null,
556
+ // SPEC-RULECODE-HOST-PROMOTION-001 B: the contract version the
557
+ // resolver handed out — a shape-valid contract of the WRONG host
558
+ // version must fail runtime_compatibility, not pass as-is.
559
+ ...(promotionHost.ok ? { expectedHostContractVersion: promotionHost.hostRuntimeVersion } : {}),
499
560
  existingLiveArtifacts: liveArtifacts,
561
+ // Review R3/P1: composition executes through the production
562
+ // boundary and needs the same root the replay normalizes against.
563
+ projectDir: this.workspaceDir,
564
+ ...(toolSemantics.ok ? { toolSemantics: toolSemantics.registry } : {}),
565
+ // Review R3/P1: console-side target-environment reachability —
566
+ // prove the recovery controls' DURABLE SUBSTRATE is reachable
567
+ // from this process by reading the same safety store the pause
568
+ // handler writes (non-destructive). The authenticated owner
569
+ // review route serving this very request is the entry evidence
570
+ // for this surface; the Owner-browser → HTTP entry path is
571
+ // e2e/isolated-test evidence, deliberately NOT claimed here.
572
+ recoveryReachability: recoveryStoreProbe,
500
573
  validateProductionArtifact: candidate => writer.canActivate(candidate),
501
574
  });
502
575
  },
@@ -509,7 +582,7 @@ export class ActivationsConsoleModel {
509
582
  expectedArtifactDigest: digest,
510
583
  // Bind the real authenticated actor; null (not a placeholder) when
511
584
  // the review is read without an Owner session.
512
- ownerIdentity: ownerActor ?? null,
585
+ ownerIdentity: options?.ownerActor ?? null,
513
586
  hostRuntimeVersion: promotionHost.ok ? promotionHost.hostRuntimeVersion : promotionHost.reason,
514
587
  shadowSummary: telemetry.shadowSummary,
515
588
  });
@@ -640,7 +713,7 @@ export class ActivationsConsoleModel {
640
713
  }
641
714
  }
642
715
  async promoteRuleCode(activationId, expected, input) {
643
- const review = await this.getOwnerReview(activationId, input.actor.principal.kind === 'configured_owner' && input.actor.authentication.method === 'console_token', input.actor);
716
+ const review = await this.getOwnerReview(activationId, input.actor.principal.kind === 'configured_owner' && input.actor.authentication.method === 'console_token', { ownerActor: input.actor, routeContext: input.routeContext });
644
717
  const flags = computeFlagsFromLoadResult(loadPdConfig(this.workspaceDir));
645
718
  const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: false });
646
719
  try {
@@ -673,6 +746,47 @@ export class ActivationsConsoleModel {
673
746
  catch { /* best effort */ }
674
747
  }
675
748
  }
749
+ /**
750
+ * SPEC R4/P1: non-destructive write-capability probe for the global-pause
751
+ * substrate. Inserts a probe pause row inside an explicit transaction,
752
+ * verifies it, ROLLS BACK, then asserts the table is unchanged (no probe
753
+ * row, same row count). Pure substrate evidence for THIS workspace — the
754
+ * browser-to-HTTP entry path is deliberately not claimed.
755
+ */
756
+ probePauseSubstrate() {
757
+ const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: false });
758
+ try {
759
+ const db = conn.getDb();
760
+ const probeId = `recovery-probe-${randomUUID()}`;
761
+ const before = db.prepare('SELECT COUNT(*) AS n FROM global_rulecode_pauses').get();
762
+ db.exec('BEGIN IMMEDIATE');
763
+ try {
764
+ db.prepare("INSERT INTO global_rulecode_pauses (pause_id, status, incident_decision_id, release_decision_id, affected_activation_ids, paused_at, released_at, version) VALUES (?, 'paused', ?, NULL, '[]', ?, NULL, 1)")
765
+ .run(probeId, `probe-${probeId}`, new Date().toISOString());
766
+ const inserted = db.prepare('SELECT pause_id FROM global_rulecode_pauses WHERE pause_id = ?').get(probeId);
767
+ if (inserted === undefined)
768
+ throw new Error('probe pause row not visible inside the transaction');
769
+ }
770
+ finally {
771
+ db.exec('ROLLBACK');
772
+ }
773
+ const after = db.prepare('SELECT COUNT(*) AS n FROM global_rulecode_pauses').get();
774
+ const probeLeftover = db.prepare('SELECT pause_id FROM global_rulecode_pauses WHERE pause_id = ?').get(probeId);
775
+ if (probeLeftover !== undefined || before.n !== after.n) {
776
+ return { capabilityId: 'rulecode_global_pause', channel: 'console', ok: false, workspaceMatched: true, detail: 'rollback probe left state behind — substrate evidence rejected' };
777
+ }
778
+ return { capabilityId: 'rulecode_global_pause', channel: 'console', ok: true, workspaceMatched: true };
779
+ }
780
+ catch (error) {
781
+ return { capabilityId: 'rulecode_global_pause', channel: 'console', ok: false, workspaceMatched: true, detail: `pause substrate probe failed: ${error instanceof Error ? error.message : String(error)}` };
782
+ }
783
+ finally {
784
+ try {
785
+ conn.close();
786
+ }
787
+ catch { /* best effort */ }
788
+ }
789
+ }
676
790
  async withMutableRuleCode(activationId, action) {
677
791
  const conn = new SqliteConnection({ workspaceDir: this.workspaceDir, readonly: false });
678
792
  try {
@@ -35,7 +35,9 @@ export declare class OwnerDecisionConsoleModel {
35
35
  * 派生当前真实可执行的 Owner 决策列表(INV-01 / SPEC §27 badge 的唯一来源)。
36
36
  * N = items.length — 不是 candidate 数、不是 NHR 总数、不是 failed 数。
37
37
  */
38
- listOwnerDecisionItems(): Promise<OwnerDecisionListResult>;
38
+ listOwnerDecisionItems(routeContext?: {
39
+ servedThroughAuthenticatedConsoleRoute: boolean;
40
+ }): Promise<OwnerDecisionListResult>;
39
41
  /**
40
42
  * failed-tasks 列表分流字段: 该 NHR 任务是否 decision-capable
41
43
  * (decision-capable → 前往治理焦点;technical → Recover)。
@@ -188,7 +188,7 @@ export class OwnerDecisionConsoleModel {
188
188
  * 派生当前真实可执行的 Owner 决策列表(INV-01 / SPEC §27 badge 的唯一来源)。
189
189
  * N = items.length — 不是 candidate 数、不是 NHR 总数、不是 failed 数。
190
190
  */
191
- async listOwnerDecisionItems() {
191
+ async listOwnerDecisionItems(routeContext) {
192
192
  const stateDbPath = path.join(this.workspaceDir, '.pd', 'state.db');
193
193
  if (!fs.existsSync(stateDbPath)) {
194
194
  return { items: [], total: 0, generatedAt: new Date().toISOString() };
@@ -267,7 +267,11 @@ export class OwnerDecisionConsoleModel {
267
267
  const artifactId = typeof row.artifact_id === 'string' ? row.artifact_id : '';
268
268
  const activationId = typeof row.activation_id === 'string' ? row.activation_id : '';
269
269
  try {
270
- const review = await activationModel.getOwnerReview(activationId, true);
270
+ // SPEC R4/P1: this projection runs inside the real authenticated
271
+ // owner-decisions GET route — the route signal evidences the
272
+ // Console HTTP surface for the visibility evaluation; promotion
273
+ // still re-evaluates at the real owner-review/promote entry.
274
+ const review = await activationModel.getOwnerReview(activationId, true, { routeContext });
271
275
  if (review.readiness.status !== 'ready' && review.readiness.status !== 'evidence_insufficient')
272
276
  continue;
273
277
  }
@@ -167,7 +167,10 @@ export async function handleActivationsRoute(req, res, workspaceDir, subPath, au
167
167
  else {
168
168
  if (!body.artifactId || !body.artifactDigest || body.controlVersion === undefined || body.confirmed !== true)
169
169
  throw new Error('Promotion requires artifactId, artifactDigest, controlVersion, and confirmed=true');
170
- const result = await model.promoteRuleCode(activationId, { artifactId: body.artifactId, artifactDigest: body.artifactDigest, controlVersion: body.controlVersion, confirmed: body.confirmed }, input);
170
+ // SPEC R4/P1: the authenticated promote POST is likewise a real
171
+ // Console HTTP entry — the readiness evaluation it triggers carries
172
+ // the route-served signal for owner_review_access.
173
+ const result = await model.promoteRuleCode(activationId, { artifactId: body.artifactId, artifactDigest: body.artifactDigest, controlVersion: body.controlVersion, confirmed: body.confirmed }, { ...input, routeContext: { servedThroughAuthenticatedConsoleRoute: true } });
171
174
  if (!result.ok) {
172
175
  sendError(res, 409, result.reasonCode, result.summary, { failedChecks: result.failedChecks, nextAction: result.nextAction });
173
176
  return;
@@ -197,7 +200,9 @@ export async function handleActivationsRoute(req, res, workspaceDir, subPath, au
197
200
  return;
198
201
  }
199
202
  try {
200
- sendSuccess(res, await getModel(workspaceDir).getOwnerReview(activationId, authority?.ownerActor !== null && authority?.ownerActor !== undefined, authority?.ownerActor ?? undefined));
203
+ // SPEC R4/P1: this real authenticated GET is the owner_review_access
204
+ // entry evidence — pass the route signal into the readiness assembly.
205
+ sendSuccess(res, await getModel(workspaceDir).getOwnerReview(activationId, authority?.ownerActor !== null && authority?.ownerActor !== undefined, { ownerActor: authority?.ownerActor ?? undefined, routeContext: { servedThroughAuthenticatedConsoleRoute: true } }));
201
206
  }
202
207
  catch (err) {
203
208
  const message = err instanceof Error ? err.message : String(err);
@@ -163,7 +163,7 @@ export async function handleOwnerDecisionsRoute(req, res, ctx) {
163
163
  return;
164
164
  }
165
165
  try {
166
- const result = await getModel(workspaceDir).listOwnerDecisionItems();
166
+ const result = await getModel(workspaceDir).listOwnerDecisionItems({ servedThroughAuthenticatedConsoleRoute: true });
167
167
  sendSuccess(res, result);
168
168
  }
169
169
  catch (err) {
@@ -19,6 +19,12 @@ export { evaluateRuleCodeSafetyCircuit, initialRuleCodeSafetyCircuitState } from
19
19
  export type { RuleCodeSafetySample, RuleCodeSafetyCircuitState, RuleCodeSafetyTripReason } from './rulecode-safety-circuit-breaker.js';
20
20
  export { collectOpenClawPromotionChecks } from './openclaw-promotion-checks.js';
21
21
  export type { HostLivenessContract } from './openclaw-promotion-checks.js';
22
+ export type { RecoveryReachabilityEvidence, RecoveryCapabilityEvidence, RecoveryCapabilityCoverage } from './openclaw-promotion-checks.js';
23
+ export { validateRecoveryCapabilityCoverage } from './openclaw-promotion-checks.js';
24
+ export { RECOVERY_CONTROL_SURFACES, validateRecoveryControlSurfaces } from './recovery-control-surfaces.js';
25
+ export type { RecoveryControlCapability, RecoveryControlSurface, RecoveryControlValidation } from './recovery-control-surfaces.js';
26
+ export { verifyRecoveryProbeComposition } from './recovery-composition.js';
27
+ export type { RecoveryCompositionArtifact, RecoveryCompositionInput, RecoveryCompositionProbe, RecoveryCompositionResult } from './recovery-composition.js';
22
28
  export { summarizeRuleCodeShadowEvents } from './rulecode-shadow-summary.js';
23
29
  export type { RuleCodeShadowSummary } from './rulecode-shadow-summary.js';
24
30
  export { buildPromotionEvidenceSnapshot, computeArtifactDigest, normalizeOwnerIdentity, verifyPiArtifactRowDigest } from './promotion-evidence-snapshot.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,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EAC1B,cAAc,GACf,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,2BAA2B,EAC3B,QAAQ,IAAI,gBAAgB,EAC5B,uBAAuB,EACvB,4BAA4B,EAC5B,YAAY,EACZ,aAAa,EACb,4BAA4B,GAC7B,MAAM,wCAAwC,CAAC;AAEhD,YAAY,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,6CAA6C,EAC7C,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,mCAAmC,EACnC,mCAAmC,EACnC,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,cAAc,EACd,0BAA0B,EAC1B,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,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evaluateRuleCodePromotionReadiness } from
11
11
  export { PromotionReadinessReader } from './promotion-readiness-reader.js';
12
12
  export { evaluateRuleCodeSafetyCircuit, initialRuleCodeSafetyCircuitState } from './rulecode-safety-circuit-breaker.js';
13
13
  export { collectOpenClawPromotionChecks } from './openclaw-promotion-checks.js';
14
+ export { validateRecoveryCapabilityCoverage } from './openclaw-promotion-checks.js';
15
+ export { RECOVERY_CONTROL_SURFACES, validateRecoveryControlSurfaces } from './recovery-control-surfaces.js';
16
+ export { verifyRecoveryProbeComposition } from './recovery-composition.js';
14
17
  export { summarizeRuleCodeShadowEvents } from './rulecode-shadow-summary.js';
15
18
  export { buildPromotionEvidenceSnapshot, computeArtifactDigest, normalizeOwnerIdentity, verifyPiArtifactRowDigest } from './promotion-evidence-snapshot.js';
16
19
  export { ApprovalQueue, decideAutoPromotion } from './approval-queue.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime-v2/activation/index.ts"],"names":[],"mappings":"AAiCA,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,mCAAmC,EACnC,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,2EAA2E;AAC3E,OAAO,EAAE,yBAAyB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAG3H,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAElF,OAAO,EAAE,4BAA4B,EAAE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8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAE7E,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG5J,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAEzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAGpF,4EAA4E;AAC5E,0EAA0E;AAC1E,2DAA2D;AAC3D,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAEnG,oEAAoE;AACpE,4EAA4E;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,8EAA8E;AAC9E,iEAAiE;AACjE,OAAO,EACL,6BAA6B,EAC7B,0BAA0B,EAC1B,cAAc,GACf,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EACL,2BAA2B,EAC3B,QAAQ,IAAI,gBAAgB,EAC5B,uBAAuB,EACvB,4BAA4B,EAC5B,YAAY,EACZ,aAAa,EACb,4BAA4B,GAC7B,MAAM,wCAAwC,CAAC;AAShD,4EAA4E;AAC5E,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,6CAA6C,EAC7C,uBAAuB,EACvB,uBAAuB,EACvB,4BAA4B,EAC5B,mCAAmC,EACnC,mCAAmC,EACnC,mCAAmC,EACnC,0BAA0B,EAC1B,iCAAiC,EACjC,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { PIArtifactSnapshot } from './activation-types.js';
2
+ import type { ToolSemanticRegistry } from '../internalization/tool-semantic-registry.js';
2
3
  import type { PromotionReadinessCheck } from './promotion-readiness-evaluator.js';
3
4
  export interface HostLivenessContract {
4
5
  version: string;
@@ -20,11 +21,85 @@ interface OpenClawPromotionCheckInput {
20
21
  ownerIdentityConfigured: boolean;
21
22
  safetyControlsEnabled: boolean;
22
23
  hostContract: unknown;
24
+ /**
25
+ * SPEC-RULECODE-HOST-PROMOTION-001 B: the contract version the workspace
26
+ * host resolver handed out for THIS promotion target. The shape validator
27
+ * only accepts a contract whose version matches — a Codex (or WorkBuddy)
28
+ * workspace can no longer present the OpenClaw legacy contract (or vice
29
+ * versa) as its capability authority. Defaults to the OpenClaw legacy
30
+ * version so pre-existing callers keep their exact behavior.
31
+ */
32
+ expectedHostContractVersion?: string;
23
33
  existingLiveArtifacts: readonly PIArtifactSnapshot[];
34
+ /**
35
+ * Review R3/P1: composition verification executes through the production
36
+ * boundary (same hardened evaluator + mergeDecisions as the shared gate)
37
+ * and needs the project root for path normalization, exactly like the
38
+ * golden-trace replay does.
39
+ */
40
+ projectDir?: string;
41
+ toolSemantics?: ToolSemanticRegistry;
42
+ /**
43
+ * Review R3/P1: target-environment reachability evidence for the recovery
44
+ * controls, produced per readiness evaluation by the CALLER through a
45
+ * bounded, non-destructive probe (never cached, never destructive):
46
+ * - CLI channel: the caller spawns the real read-only status command and
47
+ * verifies it executes, parses, and reflects the TARGET workspace;
48
+ * - console channel: the caller proves the control's durable substrate is
49
+ * reachable from this process (and the authenticated review route served
50
+ * this request) — the full HTTP entry path from the Owner's browser is
51
+ * e2e/isolated-test evidence, not something a server can self-assert.
52
+ * Absent or failed evidence keeps emergency_controls FAILED — a registry
53
+ * proof in code is not an environment health fact.
54
+ */
55
+ recoveryReachability?: RecoveryReachabilityEvidence;
24
56
  validateProductionArtifact(artifact: PIArtifactSnapshot): Promise<{
25
57
  ok: boolean;
26
58
  }>;
27
59
  }
60
+ export interface RecoveryReachabilityEvidence {
61
+ source: 'cli-status-probe' | 'console-store-probe' | 'console-route-served';
62
+ ok: boolean;
63
+ /** The probe was observed to target the workspace this readiness run governs. */
64
+ workspaceMatched: boolean;
65
+ /** Bounded, structured detail for the failed case (rc-9). */
66
+ detail?: string;
67
+ /**
68
+ * Review R4/P1: PER-CAPABILITY evidence. One aggregate probe can never
69
+ * certify the whole recovery surface — a successful status query says
70
+ * nothing about the deactivate entry, and a readable pause store says
71
+ * nothing about the pause ROUTE. emergency_controls requires one valid,
72
+ * current, workspace-matched entry for EVERY capability in the
73
+ * recovery-control registry: missing, duplicate, unknown, channel-mismatched,
74
+ * or failed entries fail the check (fail closed).
75
+ */
76
+ capabilities?: readonly RecoveryCapabilityEvidence[];
77
+ }
78
+ export interface RecoveryCapabilityEvidence {
79
+ capabilityId: string;
80
+ channel: 'cli' | 'console';
81
+ ok: boolean;
82
+ workspaceMatched: boolean;
83
+ /** Bounded reason when ok/workspaceMatched is false (rc-9). */
84
+ detail?: string;
85
+ }
86
+ export type RecoveryCapabilityCoverage = {
87
+ ok: true;
88
+ } | {
89
+ ok: false;
90
+ reason: 'recovery_capability_evidence_incomplete' | 'recovery_reachability_unverified';
91
+ detail: string;
92
+ };
93
+ /**
94
+ * Review R4/P1: validate the per-capability evidence matrix against the
95
+ * recovery-control registry. Required: every registry capability present
96
+ * EXACTLY once, channel matching the registry, ok AND workspace-matched.
97
+ * Duplicates, unknown ids, missing entries, or channel mismatches are
98
+ * coverage failures; entries that ran but failed (or targeted another
99
+ * workspace) are reachability failures. Never cached — the caller produces
100
+ * this evidence fresh for every readiness evaluation.
101
+ */
102
+ export declare function validateRecoveryCapabilityCoverage(capabilities: readonly RecoveryCapabilityEvidence[] | undefined): RecoveryCapabilityCoverage;
28
103
  export declare function collectOpenClawPromotionChecks(artifact: PIArtifactSnapshot, input: OpenClawPromotionCheckInput): Promise<PromotionReadinessCheck[]>;
29
104
  export {};
30
105
  //# sourceMappingURL=openclaw-promotion-checks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"openclaw-promotion-checks.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/openclaw-promotion-checks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAElF,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,OAAO,CAAC;IAChC,iBAAiB,EAAE,SAAS,CAAC,uBAAuB,GAAG,uBAAuB,GAAG,sBAAsB,CAAC,EAAE,CAAC;IAC3G,qBAAqB,EAAE,SAAS;QAC9B,YAAY,EAAE,MAAM,CAAC;QACrB,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;KACpC,EAAE,CAAC;IACJ,aAAa,EAAE,SAAS;QACtB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC1C,gBAAgB,EAAE,OAAO,CAAC;KAC3B,EAAE,CAAC;CACL;AAED,UAAU,2BAA2B;IACnC,uBAAuB,EAAE,OAAO,CAAC;IACjC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;IACtB,qBAAqB,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACrD,0BAA0B,CAAC,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CACpF;AA4FD,wBAAsB,8BAA8B,CAClD,QAAQ,EAAE,kBAAkB,EAC5B,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAmCpC"}
1
+ {"version":3,"file":"openclaw-promotion-checks.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/activation/openclaw-promotion-checks.ts"],"names":[],"mappings":"AA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