@openclawbrain/openclaw 0.1.2 → 0.1.3

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.
package/README.md CHANGED
@@ -2,31 +2,32 @@
2
2
 
3
3
  OpenClaw integration helpers for promoted-pack compile consumption and normalized event emission.
4
4
 
5
- Use this package when OpenClaw needs a narrow, typed bridge over promoted packs:
5
+ Use this package when OpenClaw needs the narrow supported operator bridge captured by `OPERATOR_API_CONTRACT_V1`:
6
6
 
7
- - bootstrap an initial attach pack from a normalized export and activate it
8
- - resolve the active promoted pack from activation pointers
9
- - consume `runtime_compile.v1` through an activation-aware serve-path helper
10
- - surface compact attach status over activation health, active pack freshness, and compile/handoff evidence
11
- - surface learned-route diagnostics alongside compiled context
12
- - emit normalized interaction and feedback events for learner handoff
13
- - optionally write learner-facing event-export bundles on disk
14
- - run a bounded async teacher loop that converts normalized exports into canonical supervision artifacts and future learner inputs
15
- - feed learner-side PG route refreshes only with explicit collected labels rather than heuristic learned-label propagation
16
- - keep the post-attach loop real with canonical supervision, bounded learner refresh, candidate promotion, and later compile freshness
7
+ - bootstrap an initial attach pack from a normalized export, or truthfully self-boot from zero events, and activate it
8
+ - inspect attach status and canonical current-profile operator truth
9
+ - emit deterministic normalized event-export bundles for learner handoff
10
+ - refresh learner state into candidate packs through the learner boundary
11
+ - stage/promote/rollback activation pointers explicitly
12
+ - prove local activation, freshness, learned-route, and kernel-vs-brain boundaries through observability surfaces
17
13
 
18
- The post-attach loop stays off the hot path: it exports turns, builds candidate packs, and promotes them later rather than mutating the current active pack in place.
14
+ The supported operator contract is intentionally decomposed into bootstrap/attach, status, export, refresh, promote, rollback, and proof/observability. The post-attach loop stays off the hot path: it exports turns, builds candidate packs, and promotes them later rather than mutating the current active pack in place.
15
+
16
+ Read `docs/operator-api-contract.md` for the family-by-family contract map and the explicitly quarantined surfaces.
17
+
18
+ For first install, the boring path is intentionally simple: pass `interactionEvents: []` / `feedbackEvents: []` when you have no live turns yet, or hand `bootstrapRuntimeAttach()` a zero-event `normalizedEventExport` payload and let it canonicalize the derived range/provenance fields from the embedded event arrays. The resulting attach stays truthful with `awaiting_first_export` until the first live export lands; truly invalid non-empty exports fail with attach-specific remediation instead of a raw provenance validator surprise.
19
19
 
20
20
  ```ts
21
21
  import {
22
+ OPERATOR_API_CONTRACT_V1,
22
23
  bootstrapRuntimeAttach,
23
- compileRuntimeContext,
24
24
  describeAttachStatus,
25
- rollbackRuntimeAttach,
26
- runContinuousProductLoopTurn,
27
- runRuntimeTurn
25
+ describeCurrentProfileBrainStatus,
26
+ rollbackRuntimeAttach
28
27
  } from "@openclawbrain/openclaw";
29
28
 
29
+ console.log(OPERATOR_API_CONTRACT_V1.families);
30
+
30
31
  const attach = bootstrapRuntimeAttach({
31
32
  activationRoot: "/var/openclawbrain/activation",
32
33
  packRoot: "/var/openclawbrain/packs/bootstrap",
@@ -53,6 +54,15 @@ console.log(attachStatus.compile?.handoffState);
53
54
  console.log(attachStatus.landingBoundaries.compileBoundary.activationSlot);
54
55
  console.log(attachStatus.landingBoundaries.failOpenSemantics.eventExportWriteFailurePreservesCompile);
55
56
 
57
+ const currentProfile = describeCurrentProfileBrainStatus({
58
+ activationRoot: "/var/openclawbrain/activation",
59
+ brainAttachmentPolicy: "dedicated"
60
+ });
61
+
62
+ console.log(currentProfile.profile.selector);
63
+ console.log(currentProfile.attachment.policyMode);
64
+ console.log(currentProfile.brainStatus.serveState);
65
+
56
66
  const rollbackPreview = rollbackRuntimeAttach({
57
67
  activationRoot: "/var/openclawbrain/activation",
58
68
  dryRun: true
@@ -62,63 +72,36 @@ console.log(rollbackPreview.allowed);
62
72
  console.log(rollbackPreview.before.activePackId);
63
73
  console.log(rollbackPreview.after?.activePackId);
64
74
 
65
- const compileResult = compileRuntimeContext({
66
- activationRoot: "/var/openclawbrain/activation",
67
- message: "feedback scanner route gating",
68
- runtimeHints: ["feedback scanner"]
69
- });
75
+ ```
70
76
 
71
- if (compileResult.ok) {
72
- console.log(compileResult.compileResponse.diagnostics.usedLearnedRouteFn);
73
- console.log(compileResult.compileResponse.diagnostics.routerIdentity);
74
- }
75
-
76
- const turnResult = runRuntimeTurn(
77
- {
78
- sessionId: "session-123",
79
- channel: "whatsapp",
80
- userMessage: "feedback scanner route gating",
81
- compile: {
82
- createdAt: "2026-03-07T17:01:00.000Z"
83
- },
84
- delivery: {
85
- createdAt: "2026-03-07T17:02:00.000Z",
86
- messageId: "msg-123"
87
- },
88
- export: {
89
- rootDir: "/var/openclawbrain/exports/session-123"
90
- }
91
- },
92
- {
93
- activationRoot: "/var/openclawbrain/activation"
94
- }
95
- );
77
+ This package stays fail-open for non-learned-required compile misses, and event-export write failures do not erase successful compile output.
96
78
 
97
- const productLoopTurn = runContinuousProductLoopTurn({
98
- activationRoot: "/var/openclawbrain/activation",
99
- loopRoot: "/var/openclawbrain/runtime-loop",
100
- packLabel: "post-attach-loop",
101
- workspace: {
102
- workspaceId: "workspace-1",
103
- snapshotId: "workspace-1@snapshot-2",
104
- capturedAt: "2026-03-07T18:00:30.000Z",
105
- rootDir: "/workspace/openclawbrain",
106
- revision: "runtime-loop-rev-2"
107
- },
108
- turn: {
109
- sessionId: "session-123",
110
- channel: "whatsapp",
111
- userMessage: "Compile the fresher learned route artifact after promotion.",
112
- feedback: [{ content: "Prefer the fresher learned route artifact after promotion." }]
113
- }
114
- });
79
+ ## Narrow operator contract
115
80
 
116
- console.log(productLoopTurn.compileActiveVersion);
117
- console.log(productLoopTurn.learning.promoted);
118
- console.log(productLoopTurn.state.currentActivePack?.routerIdentity);
119
- ```
81
+ Treat these as the supported operator families for Wave 1:
120
82
 
121
- This package stays fail-open for non-learned-required compile misses, and event-export write failures do not erase successful compile output.
83
+ - bootstrap / attach `bootstrapRuntimeAttach()`, `describeAttachStatus()`
84
+ - status / rollback — `openclawbrain-ops ...`, `describeCurrentProfileBrainStatus()`, `formatOperatorRollbackReport()`
85
+ - export — `buildNormalizedRuntimeEventExport()`, `writeRuntimeEventExportBundle()`, `loadRuntimeEventExportBundle()`
86
+ - proof / observability — `describeAttachStatus()`, `describeKernelBrainBoundary()`, `describeActivationObservability()`
87
+
88
+ The refresh and promote families stay explicit in their owning packages instead of being hidden behind a catch-all convenience wrapper:
89
+
90
+ - refresh — `@openclawbrain/learner.createAlwaysOnLearningRuntimeState()`, `advanceAlwaysOnLearningRuntime()`, `materializeAlwaysOnLearningCandidatePack()`
91
+ - promote — `@openclawbrain/pack-format.stageCandidatePack()`, `promoteCandidatePack()`
92
+
93
+ Wrong-shaped surfaces are intentionally quarantined from this contract even if they remain exported elsewhere for proof or integration work:
94
+
95
+ - `openclawbrain-ops doctor`
96
+ - `buildOperatorSurfaceReport()`
97
+ - `formatOperatorStatusReport()`
98
+ - `formatOperatorDoctorReport()`
99
+ - `runContinuousProductLoopTurn()`
100
+ - `runRecordedSessionReplay()`
101
+ - `runRuntimeTurn()`
102
+ - `createAsyncTeacherLiveLoop()`
103
+
104
+ For one repo-local end-to-end proof of the full attach -> status -> run turn -> export -> refresh -> promote -> status story, run `pnpm current-profile-lifecycle:smoke` from the workspace root. That harness prints the before/after canonical current-profile answer, the matching compact `status` summary plus `status --json` proof built from those same snapshots, and the active graph/router/objective/weights/freshness checksum changes that became true only after promotion.
122
105
 
123
106
  ## Boundary truth
124
107
 
@@ -135,12 +118,11 @@ Operator-facing CLI:
135
118
 
136
119
  ```bash
137
120
  pnpm exec openclawbrain-ops status --activation-root /var/openclawbrain/activation --event-export /var/openclawbrain/exports/latest --teacher-snapshot /var/openclawbrain/runtime/teacher-snapshot.json
138
- pnpm exec openclawbrain-ops doctor --activation-root /var/openclawbrain/activation --event-export /var/openclawbrain/exports/latest --teacher-snapshot /var/openclawbrain/runtime/teacher-snapshot.json
139
121
  pnpm exec openclawbrain-ops rollback --activation-root /var/openclawbrain/activation --dry-run
140
122
  ```
141
123
 
142
- - `status` prints a compressed one-screen summary of active/candidate pack truth, brain handoff state, serve-path fail-open status, route freshness, supervision flow, live-vs-backfill learning mode, the last async no-op reason, and rollback readiness
143
- - `doctor` prints explicit `PASS` / `WARN` / `FAIL` findings and exits `1` only when a hard serve-path failure exists
124
+ - `status --json` emits the canonical `current_profile_brain_status.v1` answer; plain `status` prints a compact summary derived from that same object
125
+ - `describeCurrentProfileBrainStatus()` freezes the current-profile `Host / Profile / Brain / Attachment` answer shape instead of widening to a second report payload
144
126
  - `rollback --dry-run` previews the exact `active <- previous` and `active -> candidate` move before you apply rollback for real
145
127
  - `--event-export` accepts either a runtime event-export bundle root or a normalized-export JSON payload
146
128
  - `--teacher-snapshot` accepts JSON from `teacherLoop.snapshot()` or `await teacherLoop.flush()` when you want the last duplicate/no-op reason plus learner bootstrapped/mode/next-lane backlog truth kept visible
@@ -150,6 +132,14 @@ Programmatic rollback is available too:
150
132
  - `rollbackRuntimeAttach({ activationRoot, dryRun: true })` previews the move without changing activation pointers
151
133
  - `rollbackRuntimeAttach({ activationRoot })` applies the rollback and reports which pack was restored to `active`
152
134
 
135
+ Wave 1 also freezes shared-vs-dedicated brain policy semantics:
136
+
137
+ - `brainAttachmentPolicy: "dedicated"` means one current profile is intentionally attached to one Brain activation root until operators reattach it elsewhere
138
+ - `brainAttachmentPolicy: "shared"` means multiple profiles may intentionally attach to the same Brain activation root, so attribution must stay current-profile explicit and operators must not read served context as profile-exclusive
139
+ - `brainAttachmentPolicy: "undeclared"` is the truthful fallback when the host has not declared which policy it is using
140
+
141
+ Per-turn normalized interaction and feedback events can carry the same current-profile attribution fields so later learner/export analysis can see `brainStatus`, `brainAttachmentPolicy`, pack/router identity, and selection evidence turn by turn.
142
+
153
143
  The learned-required serve path is stricter:
154
144
 
155
145
  - `compileRuntimeContext()` now forwards the active-slot diagnostics from `@openclawbrain/compiler.compileRuntimeFromActivation()`
package/dist/src/cli.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { type OperatorSurfaceInput } from "./index.js";
2
+ import { type CurrentProfileBrainStatusInput } from "./index.js";
3
3
  interface ParsedOperatorCliArgs {
4
- command: "status" | "doctor" | "rollback";
5
- input: OperatorSurfaceInput;
4
+ command: "status" | "rollback";
5
+ input: CurrentProfileBrainStatusInput;
6
6
  json: boolean;
7
7
  help: boolean;
8
8
  dryRun: boolean;
package/dist/src/cli.js CHANGED
@@ -1,44 +1,71 @@
1
1
  #!/usr/bin/env node
2
2
  import path from "node:path";
3
3
  import { pathToFileURL } from "node:url";
4
- import { buildOperatorSurfaceReport, formatOperatorDoctorReport, formatOperatorRollbackReport, formatOperatorStatusReport, rollbackRuntimeAttach } from "./index.js";
4
+ import { describeCurrentProfileBrainStatus, formatOperatorRollbackReport, rollbackRuntimeAttach } from "./index.js";
5
5
  function operatorCliHelp() {
6
6
  return [
7
7
  "Usage:",
8
- " openclawbrain-ops <status|doctor|rollback> --activation-root <path> [options]",
8
+ " openclawbrain-ops <status|rollback> --activation-root <path> [options]",
9
9
  "",
10
10
  "Options:",
11
11
  " --activation-root <path> Activation root to inspect.",
12
12
  " --event-export <path> Event-export bundle root or normalized export JSON payload.",
13
13
  " --teacher-snapshot <path> Async teacher snapshot JSON from teacherLoop.snapshot()/flush().",
14
14
  " --updated-at <iso> Observation time to use for freshness checks.",
15
+ " --brain-attachment-policy <undeclared|dedicated|shared> Override attachment policy semantics for status inspection.",
15
16
  " --dry-run Preview rollback pointer movement without writing activation state.",
16
17
  " --json Emit machine-readable JSON instead of text.",
17
18
  " --help Show this help.",
18
19
  "",
19
20
  "Common flow:",
20
- " 1. status quick attach / first-value / rollback summary",
21
- " 2. doctor explicit PASS / WARN / FAIL findings",
22
- " 3. rollback --dry-run preview active <- previous, active -> candidate",
23
- " 4. rollback apply the rollback when the preview says ready",
21
+ " 0. bootstrap call bootstrapRuntimeAttach() to activate an initial pack on first install",
22
+ " 1. status --json read the canonical current_profile_brain_status.v1 object",
23
+ " 2. rollback --dry-run preview active <- previous, active -> candidate",
24
+ " 3. rollback apply the rollback when the preview says ready",
24
25
  "",
25
26
  "Exit codes:",
26
27
  " status: 0 on successful inspection, 1 on input/read failure.",
27
- " doctor: 0 when no FAIL findings are present, 1 otherwise.",
28
28
  " rollback: 0 when ready/applied, 1 when blocked or on input/read failure."
29
29
  ].join("\n");
30
30
  }
31
+ function yesNo(value) {
32
+ if (value === null) {
33
+ return "unknown";
34
+ }
35
+ return value ? "yes" : "no";
36
+ }
37
+ function formatCurrentProfileStatusSummary(status) {
38
+ return [
39
+ `STATUS ${status.brainStatus.status}`,
40
+ `summary ${status.brain.summary}`,
41
+ `host runtime=${status.host.runtimeOwner} activation=${status.host.activationRoot}`,
42
+ `profile selector=${status.profile.selector} attachment=${status.attachment.state} policy=${status.attachment.policyMode}`,
43
+ `brain pack=${status.brain.activePackId ?? "none"} state=${status.brain.state} init=${status.brain.initMode ?? "unknown"} routeFreshness=${status.brain.routeFreshness} router=${status.brain.routerIdentity ?? "none"}`,
44
+ `serve state=${status.brainStatus.serveState} usedRouteFn=${yesNo(status.brainStatus.usedLearnedRouteFn)} awaitingFirstExport=${yesNo(status.brainStatus.awaitingFirstExport)} detail=${status.brainStatus.detail}`,
45
+ `turn attribution=${status.currentTurnAttribution === null ? "none" : status.currentTurnAttribution.contract}`
46
+ ].join("\n");
47
+ }
48
+ function requireActivationRoot(input, command) {
49
+ if (input.activationRoot.trim().length === 0) {
50
+ throw new Error(`--activation-root is required for ${command}`);
51
+ }
52
+ return path.resolve(input.activationRoot);
53
+ }
31
54
  export function parseOperatorCliArgs(argv) {
32
55
  let command = "status";
33
56
  let activationRoot = null;
34
57
  let eventExportPath = null;
35
58
  let teacherSnapshotPath = null;
36
59
  let updatedAt = null;
60
+ let brainAttachmentPolicy = null;
37
61
  let json = false;
38
62
  let help = false;
39
63
  let dryRun = false;
40
64
  const args = [...argv];
41
- if (args[0] === "status" || args[0] === "doctor" || args[0] === "rollback") {
65
+ if (args[0] === "doctor") {
66
+ throw new Error("`doctor` was deleted. Use `status --json` for the canonical current-profile status object and proof helpers for deeper activation diagnostics.");
67
+ }
68
+ if (args[0] === "status" || args[0] === "rollback") {
42
69
  command = args.shift();
43
70
  }
44
71
  for (let index = 0; index < args.length; index += 1) {
@@ -88,6 +115,17 @@ export function parseOperatorCliArgs(argv) {
88
115
  index += 1;
89
116
  continue;
90
117
  }
118
+ if (arg === "--brain-attachment-policy") {
119
+ if (next === undefined) {
120
+ throw new Error("--brain-attachment-policy requires a value");
121
+ }
122
+ if (next !== "undeclared" && next !== "dedicated" && next !== "shared") {
123
+ throw new Error(`invalid --brain-attachment-policy value: ${next}`);
124
+ }
125
+ brainAttachmentPolicy = next;
126
+ index += 1;
127
+ continue;
128
+ }
91
129
  throw new Error(`unknown argument: ${arg}`);
92
130
  }
93
131
  return {
@@ -96,7 +134,8 @@ export function parseOperatorCliArgs(argv) {
96
134
  activationRoot: activationRoot ?? "",
97
135
  eventExportPath,
98
136
  teacherSnapshotPath,
99
- updatedAt
137
+ updatedAt,
138
+ brainAttachmentPolicy
100
139
  },
101
140
  json,
102
141
  help,
@@ -109,7 +148,7 @@ export function runOperatorCli(argv = process.argv.slice(2)) {
109
148
  console.log(operatorCliHelp());
110
149
  return 0;
111
150
  }
112
- const activationRoot = path.resolve(parsed.input.activationRoot);
151
+ const activationRoot = requireActivationRoot(parsed.input, parsed.command);
113
152
  if (parsed.command === "rollback") {
114
153
  const result = rollbackRuntimeAttach({
115
154
  activationRoot,
@@ -124,20 +163,17 @@ export function runOperatorCli(argv = process.argv.slice(2)) {
124
163
  }
125
164
  return result.allowed ? 0 : 1;
126
165
  }
127
- const report = buildOperatorSurfaceReport({
166
+ const status = describeCurrentProfileBrainStatus({
128
167
  ...parsed.input,
129
168
  activationRoot
130
169
  });
131
170
  if (parsed.json) {
132
- console.log(JSON.stringify(report, null, 2));
133
- }
134
- else if (parsed.command === "doctor") {
135
- console.log(formatOperatorDoctorReport(report));
171
+ console.log(JSON.stringify(status, null, 2));
136
172
  }
137
173
  else {
138
- console.log(formatOperatorStatusReport(report));
174
+ console.log(formatCurrentProfileStatusSummary(status));
139
175
  }
140
- return parsed.command === "doctor" && report.status === "fail" ? 1 : 0;
176
+ return 0;
141
177
  }
142
178
  if (process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href) {
143
179
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,0BAA0B,EAC1B,qBAAqB,EAEtB,MAAM,YAAY,CAAC;AAUpB,SAAS,eAAe;IACtB,OAAO;QACL,QAAQ;QACR,iFAAiF;QACjF,EAAE;QACF,UAAU;QACV,2DAA2D;QAC3D,2FAA2F;QAC3F,gGAAgG;QAChG,6EAA6E;QAC7E,mGAAmG;QACnG,2EAA2E;QAC3E,+CAA+C;QAC/C,EAAE;QACF,cAAc;QACd,6DAA6D;QAC7D,oDAAoD;QACpD,2EAA2E;QAC3E,0EAA0E;QAC1E,EAAE;QACF,aAAa;QACb,gEAAgE;QAChE,6DAA6D;QAC7D,4EAA4E;KAC7E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,IAAuB;IAC1D,IAAI,OAAO,GAAqC,QAAQ,CAAC;IACzD,IAAI,cAAc,GAAkB,IAAI,CAAC;IACzC,IAAI,eAAe,GAAkB,IAAI,CAAC;IAC1C,IAAI,mBAAmB,GAAkB,IAAI,CAAC;IAC9C,IAAI,SAAS,GAAkB,IAAI,CAAC;IACpC,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,IAAI,GAAG,KAAK,CAAC;IACjB,IAAI,MAAM,GAAG,KAAK,CAAC;IAEnB,MAAM,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,IAAI,IAAI,CAAC,CAAC,CAAC,K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lot, type ContextCompactionMode, type FeedbackEventKind, type FeedbackEventV1, type KernelSurfaceValidationResultV1, type LearningBootProfile, type InteractionEventV1, type NormalizedEventExportV1, type RouteMode, type RuntimeCompileResponseV1, type RuntimeCompileTargetV1, type RuntimeGraphPlasticityStateV1, type RuntimePlasticitySourceV1, type SparseFeedbackPolicyV1, type TeacherSupervisionArtifactV1, type WorkspaceInjectionSurfaceV1 } from "@openclawbrain/contracts";
1
+ import { CONTRACT_IDS, type ArtifactManifestV1, type ActivationPointerRecordV1, type ActivationPointerSlot, type RuntimeTurnBrainAttachmentPolicyV1, type ContextCompactionMode, type ContextContributionEvidenceStateV1, type CurrentProfileBrainStatusAnswerV1, type FeedbackEventKind, type FeedbackEventV1, type KernelSurfaceValidationResultV1, type LearningBootProfile, type InteractionEventV1, type NormalizedEventExportV1, type RouteMode, type RuntimeCompileResponseV1, type RuntimeCompileTargetV1, type RuntimeGraphPlasticityStateV1, type RuntimePlasticitySourceV1, type SparseFeedbackPolicyV1, type TeacherSupervisionArtifactV1, type WorkspaceInjectionSurfaceV1 } from "@openclawbrain/contracts";
2
2
  import { type AdvanceAlwaysOnLearningRuntimeInput, type AlwaysOnLearningCadenceV1, type AlwaysOnLearningMaterializationJobV1, type AlwaysOnLearningRuntimePlanV1, type AlwaysOnLearningRuntimeStateV1 } from "@openclawbrain/learner";
3
3
  import { type ActivationInspection, type ActivationObservabilityReport, type ActivationSlotInspection, type InitHandoffState } from "@openclawbrain/pack-format";
4
4
  export declare const DEFAULT_ASYNC_TEACHER_QUEUE_CAPACITY = 8;
@@ -82,7 +82,7 @@ export interface AttachStatusInput {
82
82
  activationRoot: string;
83
83
  compile?: false | Omit<CompileRuntimeContextInput, "activationRoot">;
84
84
  }
85
- export type ContextContributionEvidenceState = "route_fn_and_brain_context" | "brain_context_only" | "route_fn_only" | "stable_kernel_only" | "fail_open_static_context" | "hard_fail" | "unprobed";
85
+ export type ContextContributionEvidenceState = ContextContributionEvidenceStateV1;
86
86
  export interface ContextAttributionSummaryV1 {
87
87
  selectedContextCount: number;
88
88
  stableKernelBlockCount: number;
@@ -245,6 +245,7 @@ export interface OpenClawRuntimeTurnInput {
245
245
  maxContextBlocks?: number;
246
246
  mode?: RouteMode;
247
247
  runtimeHints?: readonly string[];
248
+ brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
248
249
  compile?: RuntimeTurnCompileInput | null;
249
250
  delivery?: boolean | RuntimeTurnDeliveryInput | null;
250
251
  feedback?: readonly (RuntimeTurnFeedbackInput | null)[] | null;
@@ -622,6 +623,111 @@ export declare function verifyRecordedSessionReplayBundleHashes(bundle: Recorded
622
623
  export type OperatorSurfaceStatus = "ok" | "warn" | "fail";
623
624
  export type OperatorFindingSeverity = "pass" | "warn" | "fail";
624
625
  export type OperatorLastPromotionConfidence = "proven_from_previous_pointer" | "unknown_from_local_pointers" | "no_active_pack";
626
+ export declare const OPERATOR_API_CONTRACT_ID: "openclaw_operator_api.v1";
627
+ export declare const SUPPORTED_OPERATOR_API_FAMILIES: readonly ["bootstrap_attach", "status", "export", "refresh", "promote", "rollback", "proof_observability"];
628
+ export type SupportedOperatorApiFamily = (typeof SUPPORTED_OPERATOR_API_FAMILIES)[number];
629
+ export type OperatorApiRouteScope = "cli" | "programmatic" | "proof_lane";
630
+ export interface OperatorApiRouteDescriptor {
631
+ family: SupportedOperatorApiFamily;
632
+ scope: OperatorApiRouteScope;
633
+ packageName: string;
634
+ entrypoints: readonly string[];
635
+ summary: string;
636
+ notes: readonly string[];
637
+ }
638
+ export interface OperatorApiContractV1 {
639
+ contract: typeof OPERATOR_API_CONTRACT_ID;
640
+ runtimeOwner: "openclaw";
641
+ scope: "narrow_supported_operator_surface";
642
+ families: readonly SupportedOperatorApiFamily[];
643
+ routes: readonly OperatorApiRouteDescriptor[];
644
+ quarantinedSurface: readonly string[];
645
+ }
646
+ export declare const OPERATOR_API_CONTRACT_V1: {
647
+ readonly contract: "openclaw_operator_api.v1";
648
+ readonly runtimeOwner: "openclaw";
649
+ readonly scope: "narrow_supported_operator_surface";
650
+ readonly families: readonly ["bootstrap_attach", "status", "export", "refresh", "promote", "rollback", "proof_observability"];
651
+ readonly routes: readonly [{
652
+ readonly family: "bootstrap_attach";
653
+ readonly scope: "programmatic";
654
+ readonly packageName: "@openclawbrain/openclaw";
655
+ readonly entrypoints: readonly ["bootstrapRuntimeAttach", "describeAttachStatus"];
656
+ readonly summary: "Bootstrap the first attach pack and prove the initial handoff state without pretending live learning has already run.";
657
+ readonly notes: readonly ["Zero-event bootstrap is supported and stays explicit through awaiting_first_export.", "Attach serves only from activation's active slot after bootstrap completes."];
658
+ }, {
659
+ readonly family: "status";
660
+ readonly scope: "cli";
661
+ readonly packageName: "@openclawbrain/openclaw";
662
+ readonly entrypoints: readonly ["openclawbrain-ops status", "describeCurrentProfileBrainStatus"];
663
+ readonly summary: "Read the canonical current-profile brain-status object for the active Host/Profile/Brain/Attachment boundary.";
664
+ readonly notes: readonly ["Status is the first operator read path.", "describeCurrentProfileBrainStatus() freezes the supported Host/Profile/Brain/Attachment answer shape for the current profile.", "Use activation and export observability proof helpers when you need candidate/previous or export-freshness detail."];
665
+ }, {
666
+ readonly family: "export";
667
+ readonly scope: "programmatic";
668
+ readonly packageName: "@openclawbrain/openclaw";
669
+ readonly entrypoints: readonly ["buildNormalizedRuntimeEventExport", "writeRuntimeEventExportBundle", "loadRuntimeEventExportBundle"];
670
+ readonly summary: "Emit the deterministic learner handoff artifact explicitly instead of folding export into a larger implicit runtime loop.";
671
+ readonly notes: readonly ["Export is an off-hot-path operator handoff artifact, not proof of immediate active-pack mutation.", "Bundle roots and normalized payloads are both accepted downstream by observability surfaces."];
672
+ }, {
673
+ readonly family: "refresh";
674
+ readonly scope: "programmatic";
675
+ readonly packageName: "@openclawbrain/learner";
676
+ readonly entrypoints: readonly ["createAlwaysOnLearningRuntimeState", "advanceAlwaysOnLearningRuntime", "materializeAlwaysOnLearningCandidatePack"];
677
+ readonly summary: "Refresh candidate learning state explicitly through the learner boundary before any activation-pointer move happens.";
678
+ readonly notes: readonly ["Refresh is PG-only candidate-pack materialization in this repo.", "Refresh does not mutate the currently served active pack in place."];
679
+ }, {
680
+ readonly family: "promote";
681
+ readonly scope: "programmatic";
682
+ readonly packageName: "@openclawbrain/pack-format";
683
+ readonly entrypoints: readonly ["stageCandidatePack", "promoteCandidatePack"];
684
+ readonly summary: "Stage and promote activation-ready candidate packs through explicit pointer changes.";
685
+ readonly notes: readonly ["Promotion is the only path that changes which pack is served.", "Candidate and previous remain inspectable around the pointer move."];
686
+ }, {
687
+ readonly family: "rollback";
688
+ readonly scope: "cli";
689
+ readonly packageName: "@openclawbrain/openclaw";
690
+ readonly entrypoints: readonly ["openclawbrain-ops rollback", "rollbackRuntimeAttach", "formatOperatorRollbackReport"];
691
+ readonly summary: "Preview and apply the explicit active<-previous / active->candidate rollback move.";
692
+ readonly notes: readonly ["Rollback is blocked when the previous pointer is unavailable.", "Dry-run is the required first read path for safe operator rollback."];
693
+ }, {
694
+ readonly family: "proof_observability";
695
+ readonly scope: "programmatic";
696
+ readonly packageName: "@openclawbrain/openclaw";
697
+ readonly entrypoints: readonly ["describeAttachStatus", "describeKernelBrainBoundary"];
698
+ readonly summary: "Prove the local attach and kernel-vs-brain boundary from the shipped bridge surface.";
699
+ readonly notes: readonly ["Use these for repo-local or installed-package operator proof reads.", "These surfaces report the promoted artifact boundary, not full live runtime plasticity."];
700
+ }, {
701
+ readonly family: "proof_observability";
702
+ readonly scope: "programmatic";
703
+ readonly packageName: "@openclawbrain/pack-format";
704
+ readonly entrypoints: readonly ["describeActivationObservability"];
705
+ readonly summary: "Inspect activation health, freshness, route artifacts, rollback lineage, and slot readiness.";
706
+ readonly notes: readonly ["Activation observability is the ground truth for active/candidate/previous slot inspection."];
707
+ }, {
708
+ readonly family: "proof_observability";
709
+ readonly scope: "programmatic";
710
+ readonly packageName: "@openclawbrain/event-export";
711
+ readonly entrypoints: readonly ["describeNormalizedEventExportObservability"];
712
+ readonly summary: "Inspect supervision freshness and teacher freshness from the exported learner handoff artifact.";
713
+ readonly notes: readonly ["Export observability is local-to-export proof only."];
714
+ }, {
715
+ readonly family: "proof_observability";
716
+ readonly scope: "proof_lane";
717
+ readonly packageName: "workspace";
718
+ readonly entrypoints: readonly ["pnpm current-profile-lifecycle:smoke", "pnpm observability:smoke"];
719
+ readonly summary: "Run the repo-local proof lanes that derive operator truth from the canonical current-profile status object plus activation observability.";
720
+ readonly notes: readonly ["These lanes are proof machinery, not a second semver-stable API."];
721
+ }];
722
+ readonly quarantinedSurface: readonly ["openclawbrain-ops doctor was deleted; use the canonical current-profile status object plus proof helpers instead of a parallel troubleshooting surface.", "buildOperatorSurfaceReport / formatOperatorStatusReport / formatOperatorDoctorReport were historical parallel status surfaces and are not the supported operator API.", "runContinuousProductLoopTurn collapses export/refresh/promote into one proof helper and is not the supported operator API.", "runRecordedSessionReplay and recorded-session fixtures are proof helpers, not operator API.", "release scripts, root smoke plumbing, and workspace layout are proof-and-build machinery, not operator API.", "runRuntimeTurn is a runtime convenience wrapper and not the narrow operator export contract.", "createAsyncTeacherLiveLoop is supporting internals for refresh/teacher snapshots, not the narrow operator contract."];
723
+ };
724
+ export declare const OPENCLAW_OPERATOR_NOUNS_V1: readonly ["Host", "Profile", "Brain", "Attachment"];
725
+ export declare const CURRENT_PROFILE_BRAIN_STATUS_CONTRACT: "current_profile_brain_status.v1";
726
+ export declare const BRAIN_ATTACHMENT_POLICY_SEMANTICS_V1: {
727
+ readonly undeclared: "The Host has not declared whether the current Profile's Brain attachment policy is shared or dedicated; do not infer profile exclusivity from activation state alone.";
728
+ readonly dedicated: "The Host declares a dedicated Brain attachment policy: one Profile is intentionally attached to one Brain activation root, and operators may treat the served Brain state as profile-specific until the attachment changes.";
729
+ readonly shared: "The Host declares a shared Brain attachment policy: multiple Profiles may intentionally attach to the same Brain activation root, attribution must stay current-profile explicit, and operators must not treat later served context as profile-exclusive.";
730
+ };
625
731
  export type OperatorBrainState = InitHandoffState | "no_active_pack";
626
732
  export type OperatorServePathState = "serving_active_pack" | "fail_open_static_context" | "hard_fail" | "unprobed";
627
733
  export interface OperatorSurfaceInput {
@@ -685,6 +791,7 @@ export interface OperatorSupervisionSummary {
685
791
  sourcePath: string | null;
686
792
  sourceKind: "bundle_root" | "payload" | "missing";
687
793
  exportDigest: string | null;
794
+ exportedAt: string | null;
688
795
  flowing: boolean | null;
689
796
  sourceCount: number;
690
797
  freshestSourceStream: string | null;
@@ -726,62 +833,12 @@ export interface OperatorLearningSummary {
726
833
  lastMaterializedPackId: string | null;
727
834
  detail: string;
728
835
  }
729
- export interface OperatorSurfaceReport {
730
- generatedAt: string;
731
- activationRoot: string;
732
- status: OperatorSurfaceStatus;
733
- active: OperatorSurfaceSlotSummary | null;
734
- candidate: OperatorSurfaceSlotSummary | null;
735
- previous: OperatorSurfaceSlotSummary | null;
736
- freshness: {
737
- activeBehindPromotionReadyCandidate: boolean;
738
- candidateAheadBy: string[];
739
- };
740
- brain: OperatorBrainStateSummary;
741
- learnedRouting: {
742
- required: boolean;
743
- available: boolean;
744
- routerIdentity: string | null;
745
- routeFnVersion: string | null;
746
- trainingMethod: string | null;
747
- routerTrainedAt: string | null;
748
- objective: string | null;
749
- pgProfile: ActivationObservabilityReport["learnedRouteFn"]["pgProfile"];
750
- objectiveChecksum: string | null;
751
- updateMechanism: string | null;
752
- updateVersion: string | null;
753
- updateCount: number | null;
754
- supervisionCount: number | null;
755
- collectedLabelsTotal: number | null;
756
- freshnessChecksum: string | null;
757
- handoffState: InitHandoffState;
758
- initMode: LearningBootProfile | null;
759
- seedStateVisible: boolean;
760
- };
761
- servePath: OperatorServePathSummary;
762
- promotion: {
763
- allowed: boolean;
764
- findings: string[];
765
- lastPromotion: OperatorLastPromotionSummary;
766
- activeUpdatedAt: string | null;
767
- candidateUpdatedAt: string | null;
768
- previousUpdatedAt: string | null;
769
- };
770
- rollback: {
771
- allowed: boolean;
772
- findings: string[];
773
- previousPackId: string | null;
774
- state: "ready" | "blocked" | "unknown";
775
- };
776
- supervision: OperatorSupervisionSummary;
777
- learning: OperatorLearningSummary;
778
- teacherLoop: OperatorTeacherLoopSummary;
779
- findings: OperatorDoctorFinding[];
836
+ export interface CurrentProfileBrainStatusInput extends OperatorSurfaceInput {
837
+ brainAttachmentPolicy?: RuntimeTurnBrainAttachmentPolicyV1 | null;
780
838
  }
781
- export declare function buildOperatorSurfaceReport(input: OperatorSurfaceInput): OperatorSurfaceReport;
839
+ export type CurrentProfileBrainStatusV1 = CurrentProfileBrainStatusAnswerV1;
840
+ export declare function describeCurrentProfileBrainStatus(input: CurrentProfileBrainStatusInput): CurrentProfileBrainStatusV1;
782
841
  export declare function formatOperatorRollbackReport(result: RollbackRuntimeAttachResult): string;
783
- export declare function formatOperatorStatusReport(report: OperatorSurfaceReport): string;
784
- export declare function formatOperatorDoctorReport(report: OperatorSurfaceReport): string;
785
842
  /**
786
843
  * A per-turn summary of what was kernel-injected vs brain-compiled in a given
787
844
  * compile response. Useful for operator observability and debugging.