@llblab/pi-state-flow 0.22.0 → 0.24.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.
@@ -1,4 +1,4 @@
1
- import { type InactiveMode } from "./snapshot.ts";
1
+ import { type InactiveMode, type StateFlowMode } from "./snapshot.ts";
2
2
  export declare const SNAPSHOT_ENTRY_TYPE = "state-flow-snapshot";
3
3
  interface BranchEntry {
4
4
  type?: unknown;
@@ -26,6 +26,8 @@ export interface PassiveStopBoundary {
26
26
  persistenceError?: string;
27
27
  /** The inactive mode selected by that failed change; legacy markers omit it. */
28
28
  mode?: InactiveMode;
29
+ /** Native-only Off choice; canonical runtime mode is deliberately not updated. */
30
+ memoryDeferred?: true;
29
31
  }
30
32
  export interface SnapshotDiscovery {
31
33
  candidates: unknown[];
@@ -33,6 +35,13 @@ export interface SnapshotDiscovery {
33
35
  }
34
36
  /** Enumerate active-branch snapshots newest-first while containing hostile entries. */
35
37
  export declare function discoverSnapshotData(branch: readonly BranchEntry[]): SnapshotDiscovery;
38
+ /** Read native mode policy only; semantic checkpoint validity remains the recovery owner's concern. */
39
+ export declare function findBranchPolicy(branch: readonly BranchEntry[], sessionId: string | undefined, stopEntryType: string | undefined, inactiveMode: InactiveMode): {
40
+ mode: StateFlowMode;
41
+ persistenceError?: string;
42
+ } | undefined;
43
+ /** Native policy bookkeeping retains an unacquired fork across extension reloads. */
44
+ export declare function hasPendingFork(branch: readonly BranchEntry[], sessionId: string, entryType: string): boolean;
36
45
  export declare function snapshotDataNewestFirst(branch: readonly BranchEntry[]): unknown[];
37
46
  export declare function latestSnapshotData(branch: readonly BranchEntry[]): unknown;
38
47
  export declare function hasPriorConversation(branch: readonly BranchEntry[]): boolean;
@@ -1,4 +1,4 @@
1
- import { parseRetainedPiCheckpoint } from "./snapshot.js";
1
+ import { parseRetainedPiCheckpoint, readCheckpointMode } from "./snapshot.js";
2
2
  export const SNAPSHOT_ENTRY_TYPE = "state-flow-snapshot";
3
3
  /** Enumerate active-branch snapshots newest-first while containing hostile entries. */
4
4
  export function discoverSnapshotData(branch) {
@@ -16,6 +16,65 @@ export function discoverSnapshotData(branch) {
16
16
  }
17
17
  return { candidates, errors };
18
18
  }
19
+ /** Read native mode policy only; semantic checkpoint validity remains the recovery owner's concern. */
20
+ export function findBranchPolicy(branch, sessionId, stopEntryType, inactiveMode) {
21
+ let stopReset = false;
22
+ for (let index = branch.length - 1; index >= 0; index--) {
23
+ try {
24
+ const entry = branch[index];
25
+ if (entry?.type !== "custom")
26
+ continue;
27
+ if (entry.customType === SNAPSHOT_ENTRY_TYPE) {
28
+ const mode = readCheckpointMode(entry.data, inactiveMode);
29
+ if (mode !== undefined)
30
+ return { mode };
31
+ const data = entry.data;
32
+ if (data?.disabled === true && !Object.hasOwn(data, "mode") && !Object.hasOwn(data, "enabled"))
33
+ return { mode: inactiveMode };
34
+ }
35
+ else if (stopEntryType !== undefined && entry.customType === stopEntryType) {
36
+ const data = entry.data;
37
+ if (!data || stopReset || (sessionId === undefined ? typeof data.owner !== "string" || !data.owner.trim() : data.owner !== sessionId))
38
+ continue;
39
+ if (data.reset === true) {
40
+ stopReset = true;
41
+ continue;
42
+ }
43
+ if (Number.isSafeInteger(data.at) && data.at >= 0 && data.memoryDeferred === true && data.mode === "off") {
44
+ return { mode: "off", ...(typeof data.persistenceError === "string" && data.persistenceError.trim() ? { persistenceError: data.persistenceError } : {}) };
45
+ }
46
+ if (Number.isSafeInteger(data.at) && data.at >= 0 && typeof data.persistenceError === "string" && data.persistenceError.trim()) {
47
+ return { mode: data.mode === "off" || data.mode === "passive" ? data.mode : inactiveMode, persistenceError: data.persistenceError };
48
+ }
49
+ }
50
+ }
51
+ catch {
52
+ // Malformed native policy cannot prevent another explicit retained choice from being read.
53
+ }
54
+ }
55
+ return undefined;
56
+ }
57
+ /** Native policy bookkeeping retains an unacquired fork across extension reloads. */
58
+ export function hasPendingFork(branch, sessionId, entryType) {
59
+ for (let index = branch.length - 1; index >= 0; index--) {
60
+ try {
61
+ const entry = branch[index];
62
+ if (entry?.type !== "custom" || entry.customType !== entryType)
63
+ continue;
64
+ const data = entry.data;
65
+ if (data?.owner !== sessionId)
66
+ continue;
67
+ if (data.reset === true)
68
+ return false;
69
+ if (data.forkPending === true)
70
+ return true;
71
+ }
72
+ catch {
73
+ // Unrelated native entries grant no fork authority.
74
+ }
75
+ }
76
+ return false;
77
+ }
19
78
  export function snapshotDataNewestFirst(branch) {
20
79
  return discoverSnapshotData(branch).candidates;
21
80
  }
@@ -14,6 +14,12 @@ export declare function isStateFlowMode(value: unknown): value is StateFlowMode;
14
14
  export interface SnapshotConfig {
15
15
  mode: StateFlowMode;
16
16
  }
17
+ /**
18
+ * Read only mode policy, without validating or accessing semantic checkpoint metadata.
19
+ * Missing/invalid policy stays undecided; callers must not treat this as restoration proof.
20
+ * Legacy `enabled:false` follows the caller's inactive policy.
21
+ */
22
+ export declare function readCheckpointMode(value: unknown, inactiveMode?: InactiveMode): StateFlowMode | undefined;
17
23
  interface LegacyValidationFeedback {
18
24
  attempt: number;
19
25
  error: string;
@@ -15,10 +15,13 @@ export function isStateFlowMode(value) {
15
15
  return value === "active" || value === "passive" || value === "off";
16
16
  }
17
17
  /**
18
- * Read-only compatibility for session config and native checkpoints written before `mode`:
19
- * `enabled:true` stays active; `enabled:false` stays the caller's inactive policy.
18
+ * Read only mode policy, without validating or accessing semantic checkpoint metadata.
19
+ * Missing/invalid policy stays undecided; callers must not treat this as restoration proof.
20
+ * Legacy `enabled:false` follows the caller's inactive policy.
20
21
  */
21
- function decodeLegacyMode(value, inactiveMode) {
22
+ export function readCheckpointMode(value, inactiveMode = "passive") {
23
+ if (!isObject(value))
24
+ return undefined;
22
25
  if (Object.hasOwn(value, "mode"))
23
26
  return Object.hasOwn(value, "enabled") || !isStateFlowMode(value.mode) ? undefined : value.mode;
24
27
  return typeof value.enabled === "boolean" ? value.enabled ? "active" : inactiveMode : undefined;
@@ -82,7 +85,7 @@ export function parseSessionRuntime(config, runtimeSource, cwd, sessionId) {
82
85
  let runtime;
83
86
  try {
84
87
  const settings = JSON.parse(config);
85
- const mode = isObject(settings) && Object.keys(settings).length === 1 ? decodeLegacyMode(settings, "passive") : undefined;
88
+ const mode = isObject(settings) && Object.keys(settings).length === 1 ? readCheckpointMode(settings, "passive") : undefined;
86
89
  if (mode === undefined)
87
90
  throw new Error("Invalid State Flow runtime configuration or counters");
88
91
  runtime = { config: { mode }, meta: JSON.parse(runtimeSource) };
@@ -166,7 +169,7 @@ export function parseRetainedPiCheckpoint(value, inactiveMode = "passive") {
166
169
  if (keys.length === 1 && (value.mode === "passive" || value.mode === "off"))
167
170
  return { mode: value.mode };
168
171
  const allowed = new Set(["boundary", "mode", "enabled", "step", "bootstrap", "specification"]);
169
- const mode = decodeLegacyMode(value, inactiveMode);
172
+ const mode = readCheckpointMode(value, inactiveMode);
170
173
  if (keys.some((key) => !allowed.has(key))
171
174
  || typeof value.boundary !== "string" || value.boundary.trim().length === 0
172
175
  || mode === undefined
@@ -112,7 +112,7 @@ export interface StateFlowTelegramAdapter {
112
112
  /** Main-menu section label shows only the current session mode. */
113
113
  export declare function formatStateFlowSectionLabel(snapshot: StateFlowTelegramSnapshot): string;
114
114
  export declare const STATE_FLOW_MODES: readonly ["off", "passive", "active"];
115
- /** Compact option values followed directly by read-only scope actions. */
115
+ /** One radio-style mode row followed directly by read-only scope actions. */
116
116
  export declare function buildStateFlowSectionView(snapshot: StateFlowTelegramSnapshot, callbackData: (action: string, payload?: string) => string): StateFlowTelegramView;
117
117
  export declare function renderStateFlowRichState(scope: StateFlowTelegramScope, revisions: ScopeRevisions, state: StateFlowTelegramState): StateFlowTelegramRichMessage;
118
118
  /** Default loader; injectable so tests and embedded hosts can control transport presence. */
@@ -24,13 +24,9 @@ export function stateFlowTelegramSectionSpecifiers(moduleUrl = import.meta.url)
24
24
  export function formatStateFlowSectionLabel(snapshot) {
25
25
  return `🌀 State Flow: ${snapshot.mode}`;
26
26
  }
27
- /** Match pi-telegram's settings-card value descriptions. */
28
- const STATE_FLOW_SECTION_HELP = [
29
- "<code>-</code> <code>off</code>: no memory tools or state bootstrap.",
30
- "<code>-</code> <code>passive</code> (default): memory tools and context with ordinary conversation.",
31
- "<code>-</code> <code>active</code>: state-driven episodes.",
32
- ].join("\n");
33
27
  export const STATE_FLOW_MODES = ["off", "passive", "active"];
28
+ const STATE_FLOW_MODE_LABELS = { off: "Off", passive: "Passive", active: "Active" };
29
+ const STATE_FLOW_SELECTED_MARKERS = { off: "🟡", passive: "🟣", active: "🟢" };
34
30
  function isStateFlowModeAction(value) {
35
31
  return STATE_FLOW_MODES.includes(value);
36
32
  }
@@ -39,19 +35,28 @@ function modeReceiptNotice(mode, result) {
39
35
  return undefined;
40
36
  return result.message;
41
37
  }
42
- /** Compact option values followed directly by read-only scope actions. */
38
+ /** One radio-style mode row followed directly by read-only scope actions. */
43
39
  export function buildStateFlowSectionView(snapshot, callbackData) {
44
40
  const modes = STATE_FLOW_MODES.map((mode) => ({
45
- text: `${mode === snapshot.mode ? "🟢 " : ""}${mode}`,
41
+ text: `${mode === snapshot.mode ? STATE_FLOW_SELECTED_MARKERS[mode] : "⚫️"} ${STATE_FLOW_MODE_LABELS[mode]}`,
46
42
  callback_data: callbackData(mode),
47
43
  }));
48
44
  return {
49
45
  text: [
50
46
  `<b>🌀 State Flow:</b> <code>${snapshot.mode}</code>`,
51
47
  "",
52
- "Choose how this session uses State Flow memory and context. Switching modes never erases stored memory.",
48
+ "<b>Mode</b> — choose a workflow (switching modes never erases stored memory):",
53
49
  "",
54
- STATE_FLOW_SECTION_HELP,
50
+ "<code>-</code> <code>off</code> (default): regular chat without State Flow memory tools or context.",
51
+ "<code>-</code> <code>passive</code>: regular chat with memory tools; available combined memory enters the agent's context.",
52
+ "<code>-</code> <code>active</code>: same memory access; each completed answer closes a cycle, and the next request starts from saved state, not the full chat.",
53
+ "",
54
+ "<b>Inspect memory</b> — view stored state even in Off:",
55
+ "",
56
+ "<code>-</code> <code>global</code>: memory shared across projects and sessions.",
57
+ "<code>-</code> <code>cwd</code>: memory shared by sessions in this directory.",
58
+ "<code>-</code> <code>session</code>: private memory for this session, kept on resume.",
59
+ "<code>-</code> <code>effective</code>: merged Global, CWD and Session state; the agent can use it when memory is enabled and available.",
55
60
  ].join("\n"),
56
61
  parseMode: "html",
57
62
  replyMarkup: { inline_keyboard: [
package/dist/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@llblab/pi-state-flow",
3
- "version": "0.22.0",
3
+ "version": "0.24.0",
4
+ "license": "MIT",
4
5
  "private": false,
5
6
  "description": "Incremental scoped state/context/memory compiler for Pi, inspired by SKILL.state",
6
7
  "keywords": [
@@ -66,17 +67,17 @@
66
67
  "node": ">=22.19.0"
67
68
  },
68
69
  "peerDependencies": {
69
- "@earendil-works/pi-agent-core": ">=0.87.0",
70
- "@earendil-works/pi-ai": ">=0.87.0",
71
- "@earendil-works/pi-coding-agent": ">=0.87.0",
72
- "@earendil-works/pi-tui": ">=0.87.0"
70
+ "@earendil-works/pi-agent-core": ">=1.0.0",
71
+ "@earendil-works/pi-ai": ">=1.0.0",
72
+ "@earendil-works/pi-coding-agent": ">=1.0.0",
73
+ "@earendil-works/pi-tui": ">=1.0.0"
73
74
  },
74
75
  "devDependencies": {
75
- "@earendil-works/pi-agent-core": "0.87.0",
76
- "@earendil-works/pi-ai": "0.87.0",
77
- "@earendil-works/pi-coding-agent": "0.87.0",
78
- "@earendil-works/pi-tui": "0.87.0",
79
- "@types/node": "latest",
80
- "typescript": "latest"
76
+ "@earendil-works/pi-agent-core": "1.0.0",
77
+ "@earendil-works/pi-ai": "1.0.0",
78
+ "@earendil-works/pi-coding-agent": "1.0.0",
79
+ "@earendil-works/pi-tui": "1.0.0",
80
+ "@types/node": "^26.4.0",
81
+ "typescript": "^7.0.2"
81
82
  }
82
83
  }
@@ -15,7 +15,7 @@ State Flow's on-demand operational reference. Resolve the usage question or iden
15
15
 
16
16
  Passive tools access memory without starting an episode. Missing tools or storage are blockers, not permission to enable an episode or bypass storage; explanation alone remains possible.
17
17
 
18
- Operator commands: `/state-flow-status` inspects; `/state-flow-active` selects state-driven episodes; `/state-flow-passive` selects ordinary conversation with both memory tools and existing-state projection; `/state-flow-off` removes both tools and all State Flow context, including frozen handoffs, without deleting memory. Commands and Telegram change only the current session's `mode`. Global `mode` defaults to Passive for new sessions and never overrides retained choices. Do not change mode without operator authorization.
18
+ Operator commands: `/state-flow-status` inspects; `/state-flow-active` selects state-driven episodes; `/state-flow-passive` selects ordinary conversation with both memory tools and existing-state projection; `/state-flow-off` removes both tools and all State Flow context, including frozen handoffs, without deleting memory. Commands and Telegram change only the current session's `mode`. Global `mode` defaults to Off for new sessions and never overrides retained choices. Do not change mode without operator authorization.
19
19
 
20
20
  ## Map
21
21
 
package/docs/README.md CHANGED
@@ -7,4 +7,5 @@
7
7
  - [Temporal acceptance](temporal-acceptance.md): Required temporal properties and their executable witnesses.
8
8
  - [SDK compatibility](compatibility.md): Tested dependency stacks, public lifecycle seams, isolated validation, and host limits.
9
9
  - [Physical fork contract](fork-contract.md): Session-stream copying, live shared memory, child ownership/origin, and tested support boundaries.
10
+ - [Agent contract relocation ledger](agent-contract-relocation.md): Source-bound paragraph-to-owner parity map for the compact `AGENTS.md`, with transferred clauses and validation evidence.
10
11
  - [Session performance](performance.md): Reproducible native-Pi/stateful workloads, long-session resume measurements, two-process publication probes, and evidence limits.
@@ -0,0 +1,72 @@
1
+ # Agent contract relocation ledger
2
+
3
+ This is the source-bound **paragraph-to-owner parity map** for the 8,141-word pre-compaction `AGENTS.md` (SHA-256 `0d328eacc96d6b67c5eb036a51adc27e1dcd24d20bb6695f2fff6d5a3c87737b`; source lines 3–58, based on commit `70baecde` plus the Passive-footprint and `barrier-block` edits). Each `L##` identifies exactly one original bullet/paragraph. Its destination is the current owner of that paragraph's reusable contract; where necessary, a compact root rule or executable witness is also named. The root remains approximately 1,300 words; its 0.23.0 default-mode rule supersedes the original Passive-default clause. This is a reviewed documentation trace, not a claim that prose links alone prove runtime correctness.
4
+
5
+ ## Composition, semantics, and model access
6
+
7
+ - L03 domain ownership, entrypoint and mirrored tests → [composition](architecture.md#composition), [invariant tests](../tests/invariants.test.ts).
8
+ - L04 Active opt-in, former Passive default/conditional projection, Off → [configuration](usage.md#configuration), [mode behavior](usage.md#active-passive-and-configured-off).
9
+ - L05 three session-owned mode workflows and global default → [mode behavior](usage.md#active-passive-and-configured-off), [configuration](usage.md#configuration).
10
+ - L06 native trace, frozen head, run anchors and foreign context → [Pi lifecycle](architecture.md#pi-lifecycle), [context limits](performance.md#context-projection-and-trajectory-selection), [lifecycle witnesses](temporal-acceptance.md#required-properties-and-witnesses).
11
+ - L07 sparse planes, projection, lazy filtering and intents → [semantic state](architecture.md#semantic-state), [model tools](architecture.md#model-tools), [lazy state](lazy-state.md).
12
+ - L08 artifact entries and hidden provenance → [artifact routing](architecture.md#artifact-routing).
13
+ - L09 exact registered-path observation → [artifact routing](architecture.md#artifact-routing), [source acquisition](usage.md#memory-and-source-acquisition).
14
+ - L10 compilation classifier, fingerprints and Skill masking → [artifact routing](architecture.md#artifact-routing).
15
+ - L11 stable exact-path acquisition and fork provenance → [artifact routing](architecture.md#artifact-routing), [Git/restore provenance](architecture.md#optional-git-backup), [fork contract](fork-contract.md).
16
+ - L12 global config, legacy modes and limits → [configuration](usage.md#configuration), [mode compatibility](compatibility.md#mode-configuration-compatibility).
17
+ - L13 session runtime/config/checkpoints and continuation authority → [storage and identity](architecture.md#storage-and-identity), [session continuation](architecture.md#session-continuation), [mode restoration](compatibility.md#mode-selection-and-memory-restoration).
18
+ - L14 overlay, scope ownership and Skill routing → [semantic state](architecture.md#semantic-state), [artifact routing](architecture.md#artifact-routing).
19
+ - L17 composed historical offsets → [temporal model](architecture.md#temporal-model).
20
+ - L18 lazy historical reads and tool availability → [model tools](architecture.md#model-tools), [lazy navigation](usage.md#lazy-navigation-and-historical-reading).
21
+ - L27 patch grammar, shared-head staging and private ownership → [model tools](architecture.md#model-tools), [asynchronous transaction](architecture.md#asynchronous-storage-transaction).
22
+ - L28 barrier and minimal acceptance receipts → [Pi lifecycle](architecture.md#pi-lifecycle), [tool preflight evidence](performance.md#tool-preflight-parent-traversal).
23
+ - L29 accepted-response reconciliation and cancellation → [Pi lifecycle](architecture.md#pi-lifecycle), [session behavior](usage.md#session-behavior).
24
+ - L35 omission, empty-scope rejection and response equivalence → [model tools](architecture.md#model-tools), [temporal model](architecture.md#temporal-model).
25
+ - L37 public-boundary draft detachment → [storage and identity](architecture.md#storage-and-identity), [COW evidence](performance.md#memory-only-owned-draft-cow).
26
+ - L38 recursive patch/null and replay → [model tools](architecture.md#model-tools), [semantic state](architecture.md#semantic-state).
27
+ - L39 no project schemas or size/action ledgers → [model tools](architecture.md#model-tools), [operational boundaries](../README.md#operational-boundaries).
28
+ - L49 no strict boundedness claim → [operational boundaries](../README.md#operational-boundaries), [performance limits](performance.md#scope).
29
+ - L51 tool toggle and Passive read/write boundary → [mode behavior](usage.md#active-passive-and-configured-off), [model tools](architecture.md#model-tools).
30
+
31
+ ## Canonical storage, lifecycle, and backup
32
+
33
+ - L15 anchored checkpoints/tails and retention folding → [temporal model](architecture.md#temporal-model), [storage and identity](architecture.md#storage-and-identity).
34
+ - L16 opaque causal identity, origins and shared drift → [temporal model](architecture.md#temporal-model), [Pi lifecycle](architecture.md#pi-lifecycle).
35
+ - L19 canonical layout and identity → [storage and identity](architecture.md#storage-and-identity).
36
+ - L20 optimistic durability, optional backup and contention → [power-loss boundary](filesystem-recovery.md#power-loss-durability), [asynchronous transaction](architecture.md#asynchronous-storage-transaction), [optional Git backup](architecture.md#optional-git-backup).
37
+ - L21 cohort classification and missing shared pairs → [recovery](usage.md#missing-partial-and-malformed-storage), [transaction rule](filesystem-recovery.md#transaction-rule).
38
+ - L22 predecessor formats and no in-place migration → [format boundary](usage.md#moving-a-store-and-the-017-format-boundary), [optional Git backup](architecture.md#optional-git-backup).
39
+ - L23 exact-file CAS, awaited transaction and rollback → [asynchronous transaction](architecture.md#asynchronous-storage-transaction), [storage and identity](architecture.md#storage-and-identity), [transaction rule](filesystem-recovery.md#transaction-rule).
40
+ - L24 initialization and exact-source fork → [Pi lifecycle](architecture.md#pi-lifecycle), [fork contract](fork-contract.md).
41
+ - L25 retained-boundary restore, failed-Stop read-only recovery and selection races → [Pi lifecycle](architecture.md#pi-lifecycle), [mode restoration](compatibility.md#mode-selection-and-memory-restoration).
42
+ - L26 independent revisions, backup capture/index/push/shutdown → [temporal model](architecture.md#temporal-model), [optional Git backup](architecture.md#optional-git-backup).
43
+ - L40 first active context preparation, abort and specification authority → [Pi lifecycle](architecture.md#pi-lifecycle), [pre-inference cancellation](compatibility.md#pre-inference-cancellation).
44
+ - L41 one existing-session bootstrap run → [session behavior](usage.md#session-behavior).
45
+ - L42 selected-branch retained-boundary restoration → [Pi lifecycle](architecture.md#pi-lifecycle), [fork contract](fork-contract.md).
46
+ - L44 Start/current-head acceptance and Active default → [asynchronous transaction](architecture.md#asynchronous-storage-transaction), [mode behavior](usage.md#active-passive-and-configured-off).
47
+ - L45 Passive/Off persistence and frozen Stop handoff → [Pi lifecycle](architecture.md#pi-lifecycle), [mode operations](usage.md#lifecycle-operations), [mode restoration](compatibility.md#mode-selection-and-memory-restoration).
48
+ - L46 failed-Stop marker and fence → [storage recovery](usage.md#storage-and-recovery), [Pi lifecycle](architecture.md#pi-lifecycle).
49
+ - L47 settled native compaction boundary → [session behavior](usage.md#session-behavior), [SDK settlement](compatibility.md#settlement-cancellation), [lifecycle witnesses](temporal-acceptance.md#required-properties-and-witnesses).
50
+
51
+ ## Operator, agent, and development policy
52
+
53
+ - L30 terminal handoff plane routing → [operational guidance](architecture.md#operational-guidance-and-memory-curation), [semantic state](architecture.md#semantic-state).
54
+ - L31 consequential evidence, semantic references and dangling hints → [model tools](architecture.md#model-tools), [lazy navigation](usage.md#lazy-navigation-and-historical-reading), [memory curation](architecture.md#operational-guidance-and-memory-curation).
55
+ - L32 volatile observation and external-effects revalidation → [operational boundaries](../README.md#operational-boundaries), [memory guidance](usage.md#memory-and-source-acquisition).
56
+ - L33 registered Skill acquisition → [artifact routing](architecture.md#artifact-routing).
57
+ - L34 bounded curation and verified transfers → [operational guidance](architecture.md#operational-guidance-and-memory-curation), [memory Skill](../skills/state-flow-memory/SKILL.md).
58
+ - L36 logging categories, privacy and error elision → [diagnostic privacy](usage.md#diagnostic-logging-and-privacy), [barrier contract](architecture.md#pi-lifecycle).
59
+ - L43 terminal status and read-only scope inspection → [status and controls](usage.md#status-and-controls), [observability](architecture.md#observability).
60
+ - L48 system section, context refresh and foreign prompt precedence → [Pi lifecycle](architecture.md#pi-lifecycle), [host context compatibility](compatibility.md#context-tools-and-provider-input).
61
+ - L50 extension-agnostic core and Telegram controls/receipts → [composition](architecture.md#composition), [observability](architecture.md#observability), [Telegram compatibility](compatibility.md#telegram-adapter).
62
+ - L52 tag release authority and version alignment → [release workflow](../.github/workflows/release.yml), [release boundary](../BACKLOG.md#release-boundary). Retain the durable no-token constraint in compact `AGENTS.md` until a permanent developer contract owns it.
63
+ - L53 opt-in benchmark location and source identity → [benchmark guide](../benchmarks/README.md), [performance validation](performance.md#validation-and-reporting).
64
+ - L54 provider callback completion witness → [temporal acceptance](temporal-acceptance.md#required-properties-and-witnesses), [integration tests](../tests/integration.test.ts).
65
+ - L55 awaited fixture handlers and withdrawal witness → [temporal acceptance](temporal-acceptance.md#required-properties-and-witnesses), [extension tests](../tests/extension.test.ts).
66
+ - L56 tracked `dist/` and build/package parity → [release workflow](../.github/workflows/release.yml), [release invariant tests](../tests/invariants.test.ts). Retain the developer rule in compact `AGENTS.md` unless a durable release guide takes ownership.
67
+ - L57 current docs vs delivery history → [documentation index](README.md), compact `AGENTS.md` (durable documentation policy).
68
+ - L58 validation order → compact `AGENTS.md` (durable development rule), [validation procedure](compatibility.md#validation-procedure).
69
+
70
+ ## Verification evidence
71
+
72
+ The map names all 56 source paragraphs exactly once. Each was compared with its destinations; the highest-risk clause groups were checked explicitly: L06/L45 native run anchors and Stop context, L23–L26 CAS/backup/rollback, L28 receipt-elision bounds, L31 reference/epistemic limits, L36 diagnostic privacy, L47 native compaction and L50 callback revocation. An additional exact-code-token audit exposed otherwise easy-to-lose clauses: legacy `{disabled:true}`, in-memory header key derivation, materialization equality, `contract.compiled_skills` rejection, Skill compiler revision, runtime-origin null exception and normalized artifact replay. Those are now stated in architecture; terse `patches[n]` and `{value:null, hint:[...]}` from the source are represented there by the more precise scoped patch path and expanded dangling-reference sentinel. The remaining uniquely durable developer rules, including no live-store fixture edits, stay in the compact root. `tests/invariants.test.ts` is unchanged; native and domain-specific witnesses remain in their named test files. Package, context and domain-DAG validation establish the final checked boundary; they cannot substitute for semantic judgment about future models.