@agfpd/iapeer-memory 0.2.5 → 0.2.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agfpd/iapeer-memory",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "iapeer-memory — peer memory for the iapeer ecosystem: vault, memoryd (index/search/MCP-http), layer-5 context fragments, role doctrines. The package IS the system; the claude/codex plugins are thin session sockets (docs/10-distribution.md, ADR-009).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "access": "public"
28
28
  },
29
29
  "dependencies": {
30
- "@agfpd/iapeer-memory-core": "0.2.5"
30
+ "@agfpd/iapeer-memory-core": "0.2.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/bun": "^1.2.0",
package/src/cli.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * verify found problems, 2 usage error or not-yet-implemented stage.
14
14
  */
15
15
 
16
- import { isUnderProdAnchor, sandboxEnvArmed } from "@agfpd/iapeer-memory-core";
16
+ import { sandboxBlocksProdRead } from "@agfpd/iapeer-memory-core";
17
17
  import { loadConfigFile } from "./config-env.js";
18
18
  import { liveEgress } from "./egress.js";
19
19
  import { memoryPaths } from "./paths.js";
@@ -92,7 +92,7 @@ export async function main(argv: string[]): Promise<number> {
92
92
  // process. A test must pass ITS OWN IAPEER_MEMORY_CONFIG_FILE.
93
93
  if (cmd && !["help", "--help", "-h", "version", "--version", "-V"].includes(cmd)) {
94
94
  const configFile = memoryPaths().configFile;
95
- if (sandboxEnvArmed() && isUnderProdAnchor(configFile)) {
95
+ if (sandboxBlocksProdRead(configFile)) {
96
96
  console.error(
97
97
  `iapeer-memory: live config.env skipped under the test sandbox (${configFile}) — pass IAPEER_MEMORY_CONFIG_FILE`,
98
98
  );
package/src/fleet.ts CHANGED
@@ -21,7 +21,7 @@
21
21
  import fs from "node:fs";
22
22
  import path from "node:path";
23
23
  import { IAPEER_BIN, type Egress } from "./egress.js";
24
- import { guardedWriteFileSync } from "@agfpd/iapeer-memory-core";
24
+ import { guardedWriteFileSync, sandboxBlocksProdRead } from "@agfpd/iapeer-memory-core";
25
25
 
26
26
  export type FleetMapResult = {
27
27
  action: "written" | "failed";
@@ -48,6 +48,15 @@ export type FleetPeer = { personality: string; cwd: string; runtimes: string[] }
48
48
  * (pre-v1.2 maps) read as `runtimes: []` — the sweep skips them until the
49
49
  * next map re-write (init/update/verify --repair). */
50
50
  export function readFleetMap(fleetMapPath: string): FleetPeer[] | null {
51
+ // Read-as-egress (И4 parity): the prod fleet map NAMES live cwds — a
52
+ // sandboxed process must not learn them. Null = «map unreadable», every
53
+ // caller already reports that honestly instead of sweeping.
54
+ if (sandboxBlocksProdRead(fleetMapPath)) {
55
+ console.error(
56
+ `iapeer-memory: live fleet map skipped under the test sandbox (${fleetMapPath}) — set IAPEER_MEMORY_STATE_DIR/IAPEER_ROOT`,
57
+ );
58
+ return null;
59
+ }
51
60
  try {
52
61
  const raw = JSON.parse(fs.readFileSync(fleetMapPath, "utf-8")) as {
53
62
  peers?: Array<{ personality?: unknown; cwd?: unknown; runtimes?: unknown }>;
package/src/slot.ts CHANGED
@@ -32,7 +32,11 @@
32
32
  import fs from "node:fs";
33
33
  import path from "node:path";
34
34
  import { IAPEER_BIN, type Egress } from "./egress.js";
35
- import { guardedWriteFileSync, guardedUnlinkSync } from "@agfpd/iapeer-memory-core";
35
+ import {
36
+ guardedWriteFileSync,
37
+ guardedUnlinkSync,
38
+ sandboxBlocksProdRead,
39
+ } from "@agfpd/iapeer-memory-core";
36
40
 
37
41
  export const SLOT_PROVIDER = "iapeer-memory";
38
42
  export const SLOT_PACKAGE = "@agfpd/iapeer-memory";
@@ -100,6 +104,10 @@ export type MemoryProviderSlot = {
100
104
 
101
105
  /** Never throws: missing / unreadable / malformed → null (empty slot). */
102
106
  export function readSlot(slotPath: string): MemoryProviderSlot | null {
107
+ // Read-as-egress (И4 parity): the PROD slot gates fleet-wide sweeps
108
+ // («slot is ours» is TRUE on the live host) — a sandboxed process must
109
+ // read it as absent and refuse/skip honestly.
110
+ if (sandboxBlocksProdRead(slotPath)) return null;
103
111
  try {
104
112
  const parsed = JSON.parse(fs.readFileSync(slotPath, "utf-8")) as MemoryProviderSlot;
105
113
  if (!parsed || typeof parsed.provider !== "string") return null;