pi-braid 0.43.33 → 0.43.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.
package/CHANGELOG.md CHANGED
@@ -96,6 +96,17 @@ record; the tag scheme above applies unchanged.
96
96
  note that a clean disable releases it, because a refusal an operator cannot act on
97
97
  is a support ticket.
98
98
 
99
+ ## Core — 0.43.34 (2026-11-07: a receipt that names a session file must name one that exists)
100
+
101
+ - **A close receipt is meant to be re-runnable, and a hand-typed path is not.** Three closes in one
102
+ day recorded a session path that had never existed; the string looked exactly like the real thing and
103
+ nothing but a reader noticed. The close-gate reader gains predicate (e): a row that names a `.jsonl`
104
+ file which is not on disk is refused with the path, in shadow mode as a logged line and in enforce
105
+ mode before any write. Outputs a step produces are not references and are not judged, so a command
106
+ that creates a file is untouched.
107
+ - **The recorded instance joins the pinned table**, with its repaired form naming the path through the
108
+ variable the operator actually has.
109
+
99
110
  ## Core — 0.43.33 (2026-11-07: a refusal that names the cell moves the model, not the key)
100
111
 
101
112
  - **The serving cell's capacity is a fact about the model, not about a credential.** Two refusals —
package/build-info.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.33",
4
- "sha": "a0a4432ed5510a3b89184583838a314103855a5f",
5
- "shaShort": "a0a4432e",
3
+ "version": "0.43.34",
4
+ "sha": "df1a367634966b692b53c47eab975ee5d88038f0",
5
+ "shaShort": "df1a3676",
6
6
  "branch": "detached",
7
7
  "dirty": false,
8
- "packedAt": "2026-11-07T09:26:18.671Z"
8
+ "packedAt": "2026-11-07T15:12:01.126Z"
9
9
  }
@@ -409,7 +409,7 @@ export declare function recordWorkerMerge(workerId: string, info: {
409
409
  cwd?: string;
410
410
  }): WorkerEntry | null;
411
411
  /** Predicate letters, in the order the four are evaluated. */
412
- export type GateRowPredicate = "a" | "b" | "c" | "d";
412
+ export type GateRowPredicate = "a" | "b" | "c" | "d" | "e";
413
413
  export interface GateRowViolation {
414
414
  predicate: GateRowPredicate;
415
415
  detail: string;
@@ -864,6 +864,33 @@ export function findGateRowViolation(cmd, exit, outcome) {
864
864
  if (outcome === "completed" && exit !== 0) {
865
865
  return { predicate: "d", detail: `exit ${exit} recorded under a completed outcome` };
866
866
  }
867
+ // (e) A row that names a session file is a receipt for a command someone can
868
+ // re-run. A path that does not exist cannot be re-run at all, and a hand-typed
869
+ // near-copy of a real name reads exactly like the real thing: three closes in
870
+ // one day recorded a session path that had never existed, and nothing but the
871
+ // reader noticed. Only `.jsonl` references are read, because that is what a
872
+ // recorded check names; outputs a step writes are not references and are not
873
+ // judged.
874
+ const missing = missingSessionPathIn(cmd);
875
+ if (missing !== null) {
876
+ return {
877
+ predicate: "e",
878
+ detail: `refers to a session file that does not exist: ${missing}`,
879
+ };
880
+ }
881
+ return null;
882
+ }
883
+ /** Absolute-ish `.jsonl` references in a row that are not on disk. */
884
+ function missingSessionPathIn(cmd) {
885
+ for (const raw of cmd.split(/\s+/u)) {
886
+ const token = raw.replace(/^["']|["',;)]+$/gu, "");
887
+ if (!token.endsWith(".jsonl"))
888
+ continue;
889
+ if (!token.includes("/"))
890
+ continue;
891
+ if (!existsSync(token))
892
+ return token;
893
+ }
867
894
  return null;
868
895
  }
869
896
  /** Where close-gate refusals land: one JSONL line per failing row. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.33",
3
+ "version": "0.43.34",
4
4
  "description": "🥨 Braid - Metacognitive extension suite for pi coding agent: Adds memory, plan tracking, structured cognitive signals and completion checks on top of pi core loop, so long sessions keep their context and stop claiming unfinished work.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1076,7 +1076,7 @@ function assertGateEvidence(
1076
1076
  // cmd, `sh -n` parses only and `command -v` only looks a token up.
1077
1077
 
1078
1078
  /** Predicate letters, in the order the four are evaluated. */
1079
- export type GateRowPredicate = "a" | "b" | "c" | "d";
1079
+ export type GateRowPredicate = "a" | "b" | "c" | "d" | "e";
1080
1080
 
1081
1081
  export interface GateRowViolation {
1082
1082
  predicate: GateRowPredicate;
@@ -1261,6 +1261,31 @@ export function findGateRowViolation(
1261
1261
  if (outcome === "completed" && exit !== 0) {
1262
1262
  return { predicate: "d", detail: `exit ${exit} recorded under a completed outcome` };
1263
1263
  }
1264
+ // (e) A row that names a session file is a receipt for a command someone can
1265
+ // re-run. A path that does not exist cannot be re-run at all, and a hand-typed
1266
+ // near-copy of a real name reads exactly like the real thing: three closes in
1267
+ // one day recorded a session path that had never existed, and nothing but the
1268
+ // reader noticed. Only `.jsonl` references are read, because that is what a
1269
+ // recorded check names; outputs a step writes are not references and are not
1270
+ // judged.
1271
+ const missing = missingSessionPathIn(cmd);
1272
+ if (missing !== null) {
1273
+ return {
1274
+ predicate: "e",
1275
+ detail: `refers to a session file that does not exist: ${missing}`,
1276
+ };
1277
+ }
1278
+ return null;
1279
+ }
1280
+
1281
+ /** Absolute-ish `.jsonl` references in a row that are not on disk. */
1282
+ function missingSessionPathIn(cmd: string): string | null {
1283
+ for (const raw of cmd.split(/\s+/u)) {
1284
+ const token = raw.replace(/^["']|["',;)]+$/gu, "");
1285
+ if (!token.endsWith(".jsonl")) continue;
1286
+ if (!token.includes("/")) continue;
1287
+ if (!existsSync(token)) return token;
1288
+ }
1264
1289
  return null;
1265
1290
  }
1266
1291