pi-braid 0.43.5 → 0.43.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/CHANGELOG.md CHANGED
@@ -33,16 +33,60 @@ stay core history and no longer occupy a sibling's release name: past a bare
33
33
 
34
34
  ## Repository history
35
35
 
36
- `main` carries a single consolidated commit as of the 2026-10-12 consolidation.
37
- The per-iteration series it replaces (380 commits) is kept outside this
38
- repository, in a local-only ref (`refs/archive/main-pre-squash`) plus an
39
- all-refs bundle; a public clone has the consolidated commit only, so a checkout
40
- that needs line history needs access to that local archive. This file and
41
- [`packages/core/docs/HISTORY.md`](packages/core/docs/HISTORY.md) are the
42
- reader-facing record; the tag scheme above applies unchanged.
36
+ `main` is a linear history above the tag line described above; `git rev-list --count main` states how
37
+ many commits it holds.
38
+
39
+ Two rewrites are visible to anyone holding an older clone, and both preserved content byte for byte:
40
+
41
+ - the 2026-10-12 consolidation replaced the per-iteration series (380 commits) with one consolidated
42
+ commit; that series is kept outside this repository, in a local-only ref
43
+ (`refs/archive/main-pre-squash`) plus an all-refs bundle, so a public clone has the consolidated line
44
+ only;
45
+ - the 2026-10-29 subject rewrite changed 16 commit messages and nothing else: the generated
46
+ `Merge branch '<internal branch name>'` subjects became the subject of the commit that landed, and two
47
+ older hand-written subjects lost a prefix. Every tree hash is unchanged and the tags were re-pointed,
48
+ so fetching this history can report a forced update. Packed artifacts from releases before it name a
49
+ `build-info` commit from the old history, and that commit no longer resolves here.
50
+
51
+ This file and [`packages/core/docs/HISTORY.md`](packages/core/docs/HISTORY.md) are the reader-facing
52
+ record; the tag scheme above applies unchanged.
43
53
 
44
54
  ---
45
55
 
56
+ ## Core — 0.43.6 (2026-10-29: the rule says one thing, and a merge states what landed)
57
+
58
+ - **The identity block contradicted itself, and the contradiction is gone.** One sentence forbade
59
+ internal labels in commit messages while the next sanctioned the commit subject as a seat for them, so
60
+ the rule could be quoted in either direction and nothing could be gated against it. It now says one
61
+ thing: a branch name may carry an internal handle for the operator, a commit subject must not. The
62
+ file gate's own comment, the design research behind the rule, and the open-source readiness audit all
63
+ already said subjects stay clean; the block was the outlier.
64
+ - **A merge states what landed.** Git derives `Merge branch '<name>'` from the branch name, so every
65
+ merge out of a worker branch published a handle nobody chose to write: 14 of the 24 merge commits then
66
+ in this repository carried that shape, and no gate read commit messages. The merge path now passes the
67
+ landed commit's own subject, and refuses the merge when it cannot read one, because the fallback is
68
+ precisely the derived subject. A probe through the real tool on a two-parent merge shows the landed
69
+ subject before and after; against a build with the change reverted it prints the derived one.
70
+ - **History has a gate now.** `check:commit-subjects` reads every commit since the newest tag reachable
71
+ from HEAD, merges included, and refuses internal-label tokens and the branch namespace a merge subject
72
+ inherits. Its range re-anchors at each release, and the summary line carries the range, the baseline tag
73
+ and the head, so a recorded population names the revision it certifies. Both workflows now fetch full
74
+ history, because a shallow clone has no tag to anchor the range, and the gate fails closed rather than
75
+ certifying nothing.
76
+ - **One vocabulary, two surfaces.** The label patterns the source gate used moved into a module both
77
+ gates read, so a token added once is refused in files and in history. The source gate's behaviour is
78
+ unchanged, proven by the same planted token caught at the same line and column either side of the
79
+ extraction.
80
+ - **The spelling seats actually typed is refused.** The shared vocabulary is uppercase, and the lowercase
81
+ form slid through: it is refused in history now, where the population has no fixture strings to
82
+ confuse it, with three near-miss cases in the fixture proving a word character before the handle, two
83
+ digits, and a four-digit run are not hits. The source surface keeps the uppercase vocabulary until the
84
+ lowercase strings inside fixture names are swept, which is tracked rather than assumed.
85
+ - **The fixture builds its own repositories.** A tag and a clean range, a planted label reported with its
86
+ sha, token and subject while a clean commit beside it stays unreported, a tagless tree refused with a
87
+ reason, the subject git itself derives from a worker branch, and the lowercase spelling with its
88
+ near-misses. The label tokens are composed at runtime, so the fixture does not plant what it tests.
89
+
46
90
  ## Core — 0.43.5 (2026-10-28: the runtime suite runs eight files at once, and a planted hang still dies at its cap)
47
91
 
48
92
  - **The core suite stopped waiting on one file at a time.** Its 320 files ran serially in 640s; eight in flight measured
package/build-info.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.5",
4
- "sha": "e4d4f633f2707551090ffe407362b0266788dee9",
5
- "shaShort": "e4d4f633",
3
+ "version": "0.43.6",
4
+ "sha": "e7ebbc542f5983f2270e96628def7a9b6d654610",
5
+ "shaShort": "e7ebbc54",
6
6
  "branch": "detached",
7
7
  "dirty": false,
8
- "packedAt": "2026-10-29T11:33:28.249Z"
8
+ "packedAt": "2026-10-29T14:29:10.456Z"
9
9
  }
@@ -8,7 +8,7 @@ import { type PromptSection } from "./section.js";
8
8
  * instead of a prohibition list. The text is pinned verbatim by the lockstep
9
9
  * test — no paraphrasing here either.
10
10
  */
11
- export declare const SURFACE_DISCIPLINE = "Signal discipline binds every surface you produce: code comments, commit messages, tests, docs, reports, logs. A comment earns its place only by explaining why \u2014 code that needs a what-narration is rewritten, not annotated. Never commit internal task IDs, wave or phase labels, or session-ephemeral figures: a future reader has no context for them. Internal labels present in task text or briefs are never copied into code, tests, comments, docs, or commit messages \u2014 the only sanctioned seats for wave context are a report's filename and title and the commit subject. Write any spec or brief so a teammate with zero context can act on it.";
11
+ export declare const SURFACE_DISCIPLINE = "Signal discipline binds every surface you produce: code comments, commit messages, tests, docs, reports, logs. A comment earns its place only by explaining why \u2014 code that needs a what-narration is rewritten, not annotated. Never commit internal task IDs, wave or phase labels, or session-ephemeral figures: a future reader has no context for them. Internal labels present in task text or briefs are never copied into code, tests, comments, docs, or commit messages. A report's filename and title are the only sanctioned seats for wave context: a branch name may carry an internal handle for the operator, but the commit subject must not, because git derives it from the branch name and a reader keeps the subject. Write any spec or brief so a teammate with zero context can act on it.";
12
12
  /**
13
13
  * Its own section: the handler places it between the identity block and the
14
14
  * identity-core block — render order: COMMUNICATION ��� SURFACE_DISCIPLINE
@@ -8,7 +8,7 @@ import { simpleSection } from "./section.js";
8
8
  * instead of a prohibition list. The text is pinned verbatim by the lockstep
9
9
  * test — no paraphrasing here either.
10
10
  */
11
- export const SURFACE_DISCIPLINE = `Signal discipline binds every surface you produce: code comments, commit messages, tests, docs, reports, logs. A comment earns its place only by explaining why — code that needs a what-narration is rewritten, not annotated. Never commit internal task IDs, wave or phase labels, or session-ephemeral figures: a future reader has no context for them. Internal labels present in task text or briefs are never copied into code, tests, comments, docs, or commit messages — the only sanctioned seats for wave context are a report's filename and title and the commit subject. Write any spec or brief so a teammate with zero context can act on it.`;
11
+ export const SURFACE_DISCIPLINE = `Signal discipline binds every surface you produce: code comments, commit messages, tests, docs, reports, logs. A comment earns its place only by explaining why — code that needs a what-narration is rewritten, not annotated. Never commit internal task IDs, wave or phase labels, or session-ephemeral figures: a future reader has no context for them. Internal labels present in task text or briefs are never copied into code, tests, comments, docs, or commit messages. A report's filename and title are the only sanctioned seats for wave context: a branch name may carry an internal handle for the operator, but the commit subject must not, because git derives it from the branch name and a reader keeps the subject. Write any spec or brief so a teammate with zero context can act on it.`;
12
12
  /**
13
13
  * Its own section: the handler places it between the identity block and the
14
14
  * identity-core block — render order: COMMUNICATION ��� SURFACE_DISCIPLINE
@@ -211,7 +211,17 @@ function verifyAndMergeBase(workerId, workerBranch, base, repoRoot, population)
211
211
  if (dirty === undefined || dirty.length > 0) {
212
212
  return nothingMerged(`NOT merged: worktree on ${base} has uncommitted changes; refusing to merge over them. Base unchanged at ${short(baseBefore)}. Locks and branch kept.`);
213
213
  }
214
- if (git(repoRoot, ["merge", "--no-edit", workerBranch]) === undefined) {
214
+ // Git derives a merge subject from the branch name, so a merge out of a
215
+ // worker branch would publish that branch's namespace in the one part of a
216
+ // commit a reader keeps. The subject states what landed instead. A tip
217
+ // whose subject cannot be read (missing, or empty) refuses the merge: the
218
+ // fallback is precisely the derived subject this avoids, so a silent
219
+ // fallback would put the leak back.
220
+ const landed = git(repoRoot, ["log", "-1", "--format=%s", workerBranch]);
221
+ if (!landed) {
222
+ return nothingMerged(`NOT merged: cannot read the subject of ${workerBranch} at ${short(tip)}; refusing to merge without an explicit subject, since git would derive the merge subject from that branch name. Base unchanged at ${short(baseBefore)}. Locks and branch kept.`);
223
+ }
224
+ if (git(repoRoot, ["merge", "--no-edit", "-m", landed, workerBranch]) === undefined) {
215
225
  return nothingMerged(`NOT merged: git merge ${workerBranch} into ${base} failed (conflict or refusal). Base unchanged at ${short(baseBefore)}. Locks and branch kept.`);
216
226
  }
217
227
  }
package/docs/LOCAL_DEV.md CHANGED
@@ -138,7 +138,7 @@ before and after a full run. A non-zero delta is the leak this rule prevents.
138
138
  ### New fixtures: use `node:test`
139
139
 
140
140
  A new fixture is written on `node:test`. The runner does not care which style a
141
- file uses - 87 of the core suite's 321 fixtures already use `node:test` - so the
141
+ file uses - 88 of the core suite's 322 fixtures already use `node:test` - so the
142
142
  reason is the failure the other style produces. A hand-rolled helper that calls
143
143
  `fn()` without awaiting it discards the case's promise, so an `async` case runs
144
144
  detached and the file can print its green tally before that case settles, with
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-braid",
3
- "version": "0.43.5",
3
+ "version": "0.43.6",
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",
@@ -9,7 +9,7 @@ import { simpleSection, type PromptSection } from "./section.js";
9
9
  * instead of a prohibition list. The text is pinned verbatim by the lockstep
10
10
  * test — no paraphrasing here either.
11
11
  */
12
- export const SURFACE_DISCIPLINE = `Signal discipline binds every surface you produce: code comments, commit messages, tests, docs, reports, logs. A comment earns its place only by explaining why — code that needs a what-narration is rewritten, not annotated. Never commit internal task IDs, wave or phase labels, or session-ephemeral figures: a future reader has no context for them. Internal labels present in task text or briefs are never copied into code, tests, comments, docs, or commit messages — the only sanctioned seats for wave context are a report's filename and title and the commit subject. Write any spec or brief so a teammate with zero context can act on it.`;
12
+ export const SURFACE_DISCIPLINE = `Signal discipline binds every surface you produce: code comments, commit messages, tests, docs, reports, logs. A comment earns its place only by explaining why — code that needs a what-narration is rewritten, not annotated. Never commit internal task IDs, wave or phase labels, or session-ephemeral figures: a future reader has no context for them. Internal labels present in task text or briefs are never copied into code, tests, comments, docs, or commit messages. A report's filename and title are the only sanctioned seats for wave context: a branch name may carry an internal handle for the operator, but the commit subject must not, because git derives it from the branch name and a reader keeps the subject. Write any spec or brief so a teammate with zero context can act on it.`;
13
13
 
14
14
  /**
15
15
  * Its own section: the handler places it between the identity block and the
@@ -324,7 +324,19 @@ function verifyAndMergeBase(
324
324
  `NOT merged: worktree on ${base} has uncommitted changes; refusing to merge over them. Base unchanged at ${short(baseBefore)}. Locks and branch kept.`,
325
325
  );
326
326
  }
327
- if (git(repoRoot, ["merge", "--no-edit", workerBranch]) === undefined) {
327
+ // Git derives a merge subject from the branch name, so a merge out of a
328
+ // worker branch would publish that branch's namespace in the one part of a
329
+ // commit a reader keeps. The subject states what landed instead. A tip
330
+ // whose subject cannot be read (missing, or empty) refuses the merge: the
331
+ // fallback is precisely the derived subject this avoids, so a silent
332
+ // fallback would put the leak back.
333
+ const landed = git(repoRoot, ["log", "-1", "--format=%s", workerBranch]);
334
+ if (!landed) {
335
+ return nothingMerged(
336
+ `NOT merged: cannot read the subject of ${workerBranch} at ${short(tip)}; refusing to merge without an explicit subject, since git would derive the merge subject from that branch name. Base unchanged at ${short(baseBefore)}. Locks and branch kept.`,
337
+ );
338
+ }
339
+ if (git(repoRoot, ["merge", "--no-edit", "-m", landed, workerBranch]) === undefined) {
328
340
  return nothingMerged(
329
341
  `NOT merged: git merge ${workerBranch} into ${base} failed (conflict or refusal). Base unchanged at ${short(baseBefore)}. Locks and branch kept.`,
330
342
  );