ctxr-cli 0.1.0 → 0.2.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.
Files changed (175) hide show
  1. package/dist/adapters/forge/github.d.ts +4 -1
  2. package/dist/adapters/forge/github.d.ts.map +1 -1
  3. package/dist/adapters/forge/github.js +41 -1
  4. package/dist/adapters/forge/github.js.map +1 -1
  5. package/dist/adapters/forge/types.d.ts +23 -0
  6. package/dist/adapters/forge/types.d.ts.map +1 -1
  7. package/dist/adapters/types.d.ts.map +1 -1
  8. package/dist/adapters/types.js +2 -1
  9. package/dist/adapters/types.js.map +1 -1
  10. package/dist/commands/check.d.ts +12 -4
  11. package/dist/commands/check.d.ts.map +1 -1
  12. package/dist/commands/check.js +28 -1
  13. package/dist/commands/check.js.map +1 -1
  14. package/dist/commands/entry-append.d.ts +25 -0
  15. package/dist/commands/entry-append.d.ts.map +1 -0
  16. package/dist/commands/entry-append.js +39 -0
  17. package/dist/commands/entry-append.js.map +1 -0
  18. package/dist/commands/graph-build.d.ts +5 -0
  19. package/dist/commands/graph-build.d.ts.map +1 -1
  20. package/dist/commands/graph-build.js +8 -5
  21. package/dist/commands/graph-build.js.map +1 -1
  22. package/dist/commands/graph-query.d.ts +15 -0
  23. package/dist/commands/graph-query.d.ts.map +1 -1
  24. package/dist/commands/graph-query.js +12 -2
  25. package/dist/commands/graph-query.js.map +1 -1
  26. package/dist/commands/identity.d.ts +24 -0
  27. package/dist/commands/identity.d.ts.map +1 -0
  28. package/dist/commands/identity.js +35 -0
  29. package/dist/commands/identity.js.map +1 -0
  30. package/dist/commands/init.d.ts.map +1 -1
  31. package/dist/commands/init.js +7 -7
  32. package/dist/commands/init.js.map +1 -1
  33. package/dist/commands/rollup-stale.d.ts +18 -0
  34. package/dist/commands/rollup-stale.d.ts.map +1 -0
  35. package/dist/commands/rollup-stale.js +35 -0
  36. package/dist/commands/rollup-stale.js.map +1 -0
  37. package/dist/commands/rollup-write.d.ts +9 -1
  38. package/dist/commands/rollup-write.d.ts.map +1 -1
  39. package/dist/commands/rollup-write.js +17 -2
  40. package/dist/commands/rollup-write.js.map +1 -1
  41. package/dist/commands/session-capture.d.ts +25 -0
  42. package/dist/commands/session-capture.d.ts.map +1 -0
  43. package/dist/commands/session-capture.js +119 -0
  44. package/dist/commands/session-capture.js.map +1 -0
  45. package/dist/commands/session-land.d.ts +45 -0
  46. package/dist/commands/session-land.d.ts.map +1 -0
  47. package/dist/commands/session-land.js +140 -0
  48. package/dist/commands/session-land.js.map +1 -0
  49. package/dist/commands/session-list.d.ts.map +1 -1
  50. package/dist/commands/session-list.js +3 -2
  51. package/dist/commands/session-list.js.map +1 -1
  52. package/dist/commands/session-reap.d.ts.map +1 -1
  53. package/dist/commands/session-reap.js +3 -2
  54. package/dist/commands/session-reap.js.map +1 -1
  55. package/dist/commands/session-submit.d.ts +2 -0
  56. package/dist/commands/session-submit.d.ts.map +1 -1
  57. package/dist/commands/session-submit.js +6 -2
  58. package/dist/commands/session-submit.js.map +1 -1
  59. package/dist/commands/source-add-alt.d.ts +20 -0
  60. package/dist/commands/source-add-alt.d.ts.map +1 -0
  61. package/dist/commands/source-add-alt.js +48 -0
  62. package/dist/commands/source-add-alt.js.map +1 -0
  63. package/dist/commands/source-check.js +1 -1
  64. package/dist/commands/source-check.js.map +1 -1
  65. package/dist/commands/source-stamp.d.ts +24 -0
  66. package/dist/commands/source-stamp.d.ts.map +1 -0
  67. package/dist/commands/source-stamp.js +46 -0
  68. package/dist/commands/source-stamp.js.map +1 -0
  69. package/dist/commands/verify.js +2 -2
  70. package/dist/commands/verify.js.map +1 -1
  71. package/dist/config/defaults.d.ts +13 -0
  72. package/dist/config/defaults.d.ts.map +1 -1
  73. package/dist/config/defaults.js +13 -0
  74. package/dist/config/defaults.js.map +1 -1
  75. package/dist/config/schema.d.ts +31 -0
  76. package/dist/config/schema.d.ts.map +1 -1
  77. package/dist/config/schema.js +42 -0
  78. package/dist/config/schema.js.map +1 -1
  79. package/dist/core/agents-doc.d.ts.map +1 -1
  80. package/dist/core/agents-doc.js +3 -1
  81. package/dist/core/agents-doc.js.map +1 -1
  82. package/dist/core/checks/disclosure-checks.d.ts +4 -0
  83. package/dist/core/checks/disclosure-checks.d.ts.map +1 -0
  84. package/dist/core/checks/disclosure-checks.js +24 -0
  85. package/dist/core/checks/disclosure-checks.js.map +1 -0
  86. package/dist/core/checks/identity-checks.d.ts +6 -1
  87. package/dist/core/checks/identity-checks.d.ts.map +1 -1
  88. package/dist/core/checks/identity-checks.js +23 -19
  89. package/dist/core/checks/identity-checks.js.map +1 -1
  90. package/dist/core/checks/integrity-checks.js +2 -2
  91. package/dist/core/checks/integrity-checks.js.map +1 -1
  92. package/dist/core/checks/manifest.d.ts.map +1 -1
  93. package/dist/core/checks/manifest.js +2 -0
  94. package/dist/core/checks/manifest.js.map +1 -1
  95. package/dist/core/checks/organize-checks.d.ts +2 -0
  96. package/dist/core/checks/organize-checks.d.ts.map +1 -1
  97. package/dist/core/checks/organize-checks.js +24 -1
  98. package/dist/core/checks/organize-checks.js.map +1 -1
  99. package/dist/core/checks/write-lifecycle-checks.d.ts +4 -1
  100. package/dist/core/checks/write-lifecycle-checks.d.ts.map +1 -1
  101. package/dist/core/checks/write-lifecycle-checks.js +18 -2
  102. package/dist/core/checks/write-lifecycle-checks.js.map +1 -1
  103. package/dist/core/disclosure/leak-scan.d.ts +19 -0
  104. package/dist/core/disclosure/leak-scan.d.ts.map +1 -0
  105. package/dist/core/disclosure/leak-scan.js +31 -0
  106. package/dist/core/disclosure/leak-scan.js.map +1 -0
  107. package/dist/core/errors.d.ts +40 -0
  108. package/dist/core/errors.d.ts.map +1 -1
  109. package/dist/core/errors.js +128 -0
  110. package/dist/core/errors.js.map +1 -1
  111. package/dist/core/fs/fenced-region.d.ts +9 -0
  112. package/dist/core/fs/fenced-region.d.ts.map +1 -1
  113. package/dist/core/fs/fenced-region.js +40 -0
  114. package/dist/core/fs/fenced-region.js.map +1 -1
  115. package/dist/core/git/repo.d.ts +2 -0
  116. package/dist/core/git/repo.d.ts.map +1 -1
  117. package/dist/core/git/repo.js +4 -0
  118. package/dist/core/git/repo.js.map +1 -1
  119. package/dist/core/graph/document.d.ts +26 -0
  120. package/dist/core/graph/document.d.ts.map +1 -0
  121. package/dist/core/graph/document.js +67 -0
  122. package/dist/core/graph/document.js.map +1 -0
  123. package/dist/core/graph/model.d.ts +44 -2
  124. package/dist/core/graph/model.d.ts.map +1 -1
  125. package/dist/core/graph/model.js +65 -6
  126. package/dist/core/graph/model.js.map +1 -1
  127. package/dist/core/graph/persist.d.ts +4 -0
  128. package/dist/core/graph/persist.d.ts.map +1 -1
  129. package/dist/core/graph/persist.js +10 -0
  130. package/dist/core/graph/persist.js.map +1 -1
  131. package/dist/core/graph/query.d.ts +24 -0
  132. package/dist/core/graph/query.d.ts.map +1 -1
  133. package/dist/core/graph/query.js +45 -2
  134. package/dist/core/graph/query.js.map +1 -1
  135. package/dist/core/identity.d.ts +36 -4
  136. package/dist/core/identity.d.ts.map +1 -1
  137. package/dist/core/identity.js +119 -12
  138. package/dist/core/identity.js.map +1 -1
  139. package/dist/core/ingest/canonical-url.d.ts +11 -0
  140. package/dist/core/ingest/canonical-url.d.ts.map +1 -0
  141. package/dist/core/ingest/canonical-url.js +27 -0
  142. package/dist/core/ingest/canonical-url.js.map +1 -0
  143. package/dist/core/ingest/identity.d.ts +2 -0
  144. package/dist/core/ingest/identity.d.ts.map +1 -1
  145. package/dist/core/ingest/identity.js +2 -0
  146. package/dist/core/ingest/identity.js.map +1 -1
  147. package/dist/core/ingest/model.d.ts +9 -2
  148. package/dist/core/ingest/model.d.ts.map +1 -1
  149. package/dist/core/ingest/model.js +32 -3
  150. package/dist/core/ingest/model.js.map +1 -1
  151. package/dist/core/procedures.d.ts +32 -12
  152. package/dist/core/procedures.d.ts.map +1 -1
  153. package/dist/core/procedures.js +613 -75
  154. package/dist/core/procedures.js.map +1 -1
  155. package/dist/core/rollup.d.ts +29 -0
  156. package/dist/core/rollup.d.ts.map +1 -0
  157. package/dist/core/rollup.js +60 -0
  158. package/dist/core/rollup.js.map +1 -0
  159. package/dist/core/session.d.ts +14 -0
  160. package/dist/core/session.d.ts.map +1 -1
  161. package/dist/core/session.js +19 -0
  162. package/dist/core/session.js.map +1 -1
  163. package/dist/core/write-lifecycle/path-gate.d.ts +20 -0
  164. package/dist/core/write-lifecycle/path-gate.d.ts.map +1 -0
  165. package/dist/core/write-lifecycle/path-gate.js +90 -0
  166. package/dist/core/write-lifecycle/path-gate.js.map +1 -0
  167. package/dist/prompt/inquirer-prompter.d.ts.map +1 -1
  168. package/dist/prompt/inquirer-prompter.js +4 -1
  169. package/dist/prompt/inquirer-prompter.js.map +1 -1
  170. package/dist/prompt/prompter.d.ts +9 -0
  171. package/dist/prompt/prompter.d.ts.map +1 -1
  172. package/dist/run.d.ts.map +1 -1
  173. package/dist/run.js +149 -4
  174. package/dist/run.js.map +1 -1
  175. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"procedures.js","sourceRoot":"","sources":["../../src/core/procedures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,WAAW,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAwBjD,MAAM,CAAC,MAAM,oBAAoB,GAC/B,gIAAgI,CAAC;AAEnI,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C;QACE,IAAI,EAAE,2BAA2B;QACjC,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uHAAuH;QACpI,OAAO,EAAE;;;;;EAKX,oBAAoB;;;;;;;;;CASrB;KACE;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,WAAW;QACjB,WAA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AAC;QACD,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YAAE,SAAS,CAAC,mCAAmC;QAC1F,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7E,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,EAAE,KAAK,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IACjH,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { GitRunner } from './git/exec.js';
2
+ import type { Note } from './notes/list.js';
3
+ /** The single fenced region `rollup write` writes into, and the frontmatter timestamp it stamps alongside it. */
4
+ export declare const ROLLUP_FENCE: import("./markers.js").Fence;
5
+ export declare const ROLLED_UP_FIELD = "rolled_up";
6
+ export declare function hasRollupSection(note: Note): boolean;
7
+ export interface StaleRollupEntry {
8
+ entity: string;
9
+ rolledUp: string | null;
10
+ newestBacklink: {
11
+ path: string;
12
+ modified: string;
13
+ } | null;
14
+ }
15
+ /**
16
+ * context-organize spec (D4): staleness is computed, never stored — no
17
+ * cache, no ledger. An entity with no recorded timestamp (but at least one
18
+ * backlink) is always stale; otherwise it is stale once the gap between the
19
+ * newest backlink's last commit and the recorded timestamp exceeds
20
+ * `staleDays`, bounding noise from a backlink edited moments ago. A
21
+ * backlink with no commit history at all (freshly created, uncommitted)
22
+ * counts as newer than any timestamp, since it clearly postdates it.
23
+ */
24
+ export declare function checkRollupStaleness(git: GitRunner, root: string, entity: Note, allNotes: readonly Note[], staleDays: number): Promise<StaleRollupEntry | null>;
25
+ /** Every entity with a rollup section (optionally narrowed to one), reported stale per `checkRollupStaleness`. */
26
+ export declare function findStaleRollups(git: GitRunner, root: string, notes: readonly Note[], options?: {
27
+ entity?: string;
28
+ }, staleDays?: number): Promise<StaleRollupEntry[]>;
29
+ //# sourceMappingURL=rollup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/core/rollup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE5C,iHAAiH;AACjH,eAAO,MAAM,YAAY,8BAA6B,CAAC;AACvD,eAAO,MAAM,eAAe,cAAc,CAAC;AAE3C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAEpD;AAaD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3D;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,SAAS,IAAI,EAAE,EACzB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAsBlC;AAED,kHAAkH;AAClH,wBAAsB,gBAAgB,CACpC,GAAG,EAAE,SAAS,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,IAAI,EAAE,EACtB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,EACjC,SAAS,SAAI,GACZ,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAQ7B"}
@@ -0,0 +1,60 @@
1
+ import path from 'node:path';
2
+ import { extractLinkTargets } from './graph/model.js';
3
+ import { htmlCommentFence } from './markers.js';
4
+ /** The single fenced region `rollup write` writes into, and the frontmatter timestamp it stamps alongside it. */
5
+ export const ROLLUP_FENCE = htmlCommentFence('rollup');
6
+ export const ROLLED_UP_FIELD = 'rolled_up';
7
+ export function hasRollupSection(note) {
8
+ return note.body.includes(ROLLUP_FENCE.start);
9
+ }
10
+ function backlinksFor(notes, entityPath) {
11
+ const stem = path.basename(entityPath, '.md');
12
+ return notes.filter((n) => n.path !== entityPath && extractLinkTargets(n.body).includes(stem));
13
+ }
14
+ async function lastModified(git, root, relativePath) {
15
+ const result = await git.run(['log', '-1', '--format=%cI', '--', relativePath], { cwd: root, allowFailure: true });
16
+ const date = result.stdout.trim();
17
+ return date.length > 0 ? date : null;
18
+ }
19
+ /**
20
+ * context-organize spec (D4): staleness is computed, never stored — no
21
+ * cache, no ledger. An entity with no recorded timestamp (but at least one
22
+ * backlink) is always stale; otherwise it is stale once the gap between the
23
+ * newest backlink's last commit and the recorded timestamp exceeds
24
+ * `staleDays`, bounding noise from a backlink edited moments ago. A
25
+ * backlink with no commit history at all (freshly created, uncommitted)
26
+ * counts as newer than any timestamp, since it clearly postdates it.
27
+ */
28
+ export async function checkRollupStaleness(git, root, entity, allNotes, staleDays) {
29
+ const recorded = entity.frontmatter?.[ROLLED_UP_FIELD];
30
+ const rolledUp = typeof recorded === 'string' ? recorded : null;
31
+ const backlinks = backlinksFor(allNotes, entity.path);
32
+ let newest = null;
33
+ for (const backlink of backlinks) {
34
+ const modified = (await lastModified(git, root, backlink.path)) ?? new Date(8640000000000000).toISOString();
35
+ if (!newest || new Date(modified).getTime() > new Date(newest.modified).getTime()) {
36
+ newest = { path: backlink.path, modified };
37
+ }
38
+ }
39
+ if (rolledUp === null) {
40
+ return newest ? { entity: entity.path, rolledUp: null, newestBacklink: newest } : null;
41
+ }
42
+ if (!newest)
43
+ return null;
44
+ const gapMs = new Date(newest.modified).getTime() - new Date(rolledUp).getTime();
45
+ if (gapMs < staleDays * 24 * 60 * 60 * 1000)
46
+ return null;
47
+ return { entity: entity.path, rolledUp, newestBacklink: newest };
48
+ }
49
+ /** Every entity with a rollup section (optionally narrowed to one), reported stale per `checkRollupStaleness`. */
50
+ export async function findStaleRollups(git, root, notes, options = {}, staleDays = 0) {
51
+ const candidates = notes.filter((n) => hasRollupSection(n) && (!options.entity || n.path === options.entity));
52
+ const results = [];
53
+ for (const candidate of candidates) {
54
+ const entry = await checkRollupStaleness(git, root, candidate, notes, staleDays);
55
+ if (entry)
56
+ results.push(entry);
57
+ }
58
+ return results.sort((a, b) => a.entity.localeCompare(b.entity));
59
+ }
60
+ //# sourceMappingURL=rollup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../src/core/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,iHAAiH;AACjH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,YAAY,CAAC,KAAsB,EAAE,UAAkB;IAC9D,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;IAC9C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAA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AAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACjF,IAAI,KAAK;YAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAClE,CAAC"}
@@ -6,6 +6,20 @@ import type { StoreConfig } from '../config/schema.js';
6
6
  */
7
7
  export declare function generateSessionBranchName(config: StoreConfig, now?: Date): string;
8
8
  export declare function isSessionBranch(config: StoreConfig, branch: string): boolean;
9
+ /**
10
+ * session-submit-and-land spec: a worktree is ALSO recognized as a session
11
+ * by where it lives, not only by its branch's name — `session submit
12
+ * --branch <name>` renames the branch out from under the prefix, and a
13
+ * renamed session must stay a session for `session list`/`session reap`.
14
+ *
15
+ * Deliberately independent of any particular `store.root`: the worktree's
16
+ * OWN path shape is the durable identity — its immediate parent directory
17
+ * is named after the configured worktrees path — because the caller
18
+ * checking this (e.g. `session land --reap`, run FROM the very worktree it
19
+ * would remove) may itself resolve `store.root` to that same path, which
20
+ * would make a storeRoot-relative comparison meaningless.
21
+ */
22
+ export declare function isSessionWorktreePath(config: StoreConfig, worktreePath: string): boolean;
9
23
  /** A branch name may contain "/"; a directory name may not treat that as a separator. */
10
24
  export declare function worktreeDirNameFor(branch: string): string;
11
25
  export declare function worktreePathFor(store: {
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,GAAE,IAAiB,GAAG,MAAM,CAQ7F;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpG"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,GAAE,IAAiB,GAAG,MAAM,CAQ7F;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAKxF;AAED,yFAAyF;AACzF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpG"}
@@ -17,6 +17,25 @@ export function generateSessionBranchName(config, now = new Date()) {
17
17
  export function isSessionBranch(config, branch) {
18
18
  return branch.startsWith(config.session.branch_prefix);
19
19
  }
20
+ /**
21
+ * session-submit-and-land spec: a worktree is ALSO recognized as a session
22
+ * by where it lives, not only by its branch's name — `session submit
23
+ * --branch <name>` renames the branch out from under the prefix, and a
24
+ * renamed session must stay a session for `session list`/`session reap`.
25
+ *
26
+ * Deliberately independent of any particular `store.root`: the worktree's
27
+ * OWN path shape is the durable identity — its immediate parent directory
28
+ * is named after the configured worktrees path — because the caller
29
+ * checking this (e.g. `session land --reap`, run FROM the very worktree it
30
+ * would remove) may itself resolve `store.root` to that same path, which
31
+ * would make a storeRoot-relative comparison meaningless.
32
+ */
33
+ export function isSessionWorktreePath(config, worktreePath) {
34
+ const worktreesDirName = path.basename(config.session.worktrees_path);
35
+ const parts = path.resolve(worktreePath).split(path.sep);
36
+ const index = parts.lastIndexOf(worktreesDirName);
37
+ return index !== -1 && index === parts.length - 2;
38
+ }
20
39
  /** A branch name may contain "/"; a directory name may not treat that as a separator. */
21
40
  export function worktreeDirNameFor(branch) {
22
41
  return branch.replace(/\//g, '-');
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/core/session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAmB,EAAE,GAAG,GAAS,IAAI,IAAI,EAAE;IACnF,MAAM,KAAK,GAAG,GAAG;SACd,WAAW,EAAE;SACb,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;SACpB,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;SACtB,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACrB,MAAM,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;AAC7D,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAmB,EAAE,MAAc;IACjE,OAAO,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;AACzD,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,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CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAClD,OAAO,KAAK,KAAK,CAAC,CAAC,IAAI,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;AACpD,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAA4C,EAAE,MAAc;IAC1F,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC;AAChG,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { StoreConfig } from '../../config/schema.js';
2
+ export interface PathGateResult {
3
+ ok: boolean;
4
+ reason?: string;
5
+ }
6
+ /**
7
+ * session-capture-command spec (D5): one path gate, used at commit time
8
+ * (`staged.path_allowlist`, via the pre-commit hook) and at capture time
9
+ * (`session capture`), so the two can never disagree.
10
+ *
11
+ * The symlink-escape rule is absolute and always enforced: `relativePath`
12
+ * must resolve inside the store even after every existing ancestor
13
+ * directory's symlinks are followed. The sanctioned-location rule is
14
+ * opt-in — with `write_lifecycle.writable_paths` empty (the default),
15
+ * every in-store path is accepted; once any path is declared, only a
16
+ * configured taxonomy layer, the inbox, a declared writable path, or a
17
+ * contexture-owned location passes.
18
+ */
19
+ export declare function sanctionedPath(config: StoreConfig, root: string, relativePath: string): Promise<PathGateResult>;
20
+ //# sourceMappingURL=path-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-gate.d.ts","sourceRoot":"","sources":["../../../src/core/write-lifecycle/path-gate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAuCD;;;;;;;;;;;;GAYG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAqCrH"}
@@ -0,0 +1,90 @@
1
+ import { existsSync } from 'node:fs';
2
+ import { realpath } from 'node:fs/promises';
3
+ import path from 'node:path';
4
+ import { configuredAdapters } from '../../adapters/registry.js';
5
+ import { identityFilePaths } from '../identity.js';
6
+ function normalizePrefix(prefix) {
7
+ return prefix.replace(/\/+$/, '');
8
+ }
9
+ function isUnderAnyPrefix(relativePath, prefixes) {
10
+ return prefixes.some((prefix) => {
11
+ const trimmed = normalizePrefix(prefix);
12
+ return relativePath === trimmed || relativePath.startsWith(`${trimmed}/`);
13
+ });
14
+ }
15
+ /** session-capture-command spec (D5): locations contexture itself owns are always sanctioned, regardless of writable_paths. */
16
+ function contextureOwnedPrefixes(config) {
17
+ const prefixes = [
18
+ config.identity.path,
19
+ config.catalog.path,
20
+ config.harness.procedures_path,
21
+ config.harness.conventions_path,
22
+ ...identityFilePaths(config),
23
+ ];
24
+ try {
25
+ for (const adapter of configuredAdapters(config, 'harness-generation'))
26
+ prefixes.push(adapter.entryFileName);
27
+ }
28
+ catch {
29
+ // an adapter that fails to resolve is doctor's problem (adapters.compatibility) — never this gate's.
30
+ }
31
+ return prefixes;
32
+ }
33
+ function sanctionedPrefixesFor(config) {
34
+ return [
35
+ ...config.taxonomy.layers.map((layer) => layer.path),
36
+ config.ingest.inbox_path,
37
+ ...config.write_lifecycle.writable_paths,
38
+ ...contextureOwnedPrefixes(config),
39
+ ];
40
+ }
41
+ /**
42
+ * session-capture-command spec (D5): one path gate, used at commit time
43
+ * (`staged.path_allowlist`, via the pre-commit hook) and at capture time
44
+ * (`session capture`), so the two can never disagree.
45
+ *
46
+ * The symlink-escape rule is absolute and always enforced: `relativePath`
47
+ * must resolve inside the store even after every existing ancestor
48
+ * directory's symlinks are followed. The sanctioned-location rule is
49
+ * opt-in — with `write_lifecycle.writable_paths` empty (the default),
50
+ * every in-store path is accepted; once any path is declared, only a
51
+ * configured taxonomy layer, the inbox, a declared writable path, or a
52
+ * contexture-owned location passes.
53
+ */
54
+ export async function sanctionedPath(config, root, relativePath) {
55
+ const normalizedRoot = path.resolve(root);
56
+ const target = path.resolve(root, relativePath);
57
+ const rel = path.relative(normalizedRoot, target).split(path.sep).join('/');
58
+ if (rel === '' || rel.startsWith('..') || path.isAbsolute(rel)) {
59
+ return { ok: false, reason: 'resolves outside the store' };
60
+ }
61
+ // Walk up to the deepest EXISTING ancestor, but never past the store root itself: a root (or a
62
+ // whole store) that doesn't exist yet on disk has no symlink to escape through, and the lexical
63
+ // check above already confirmed the path is nominally inside it.
64
+ let ancestor = target;
65
+ while (ancestor !== normalizedRoot && !existsSync(ancestor)) {
66
+ const parent = path.dirname(ancestor);
67
+ if (parent === ancestor)
68
+ break;
69
+ ancestor = parent;
70
+ }
71
+ if (existsSync(ancestor)) {
72
+ const realRoot = await realpath(normalizedRoot).catch(() => normalizedRoot);
73
+ const realAncestor = await realpath(ancestor).catch(() => ancestor);
74
+ const insideRoot = realAncestor === realRoot || realAncestor.startsWith(`${realRoot}${path.sep}`);
75
+ if (!insideRoot) {
76
+ return { ok: false, reason: 'escapes the store through a symbolic link' };
77
+ }
78
+ }
79
+ if (config.write_lifecycle.writable_paths.length === 0) {
80
+ return { ok: true };
81
+ }
82
+ if (!isUnderAnyPrefix(rel, sanctionedPrefixesFor(config))) {
83
+ return {
84
+ ok: false,
85
+ reason: 'is not under a configured taxonomy layer, the inbox, a declared writable path, or a contexture-owned location',
86
+ };
87
+ }
88
+ return { ok: true };
89
+ }
90
+ //# sourceMappingURL=path-gate.js.map
@@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AM,CAAC;IACpB,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,CAAC;QAC5E,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;QACpE,MAAM,UAAU,GAAG,YAAY,KAAK,QAAQ,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAClG,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,2CAA2C,EAAE,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,IAAI,MAAM,CAAC,eAAe,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAC1D,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,+GAA+G;SACxH,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"inquirer-prompter.d.ts","sourceRoot":"","sources":["../../src/prompt/inquirer-prompter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,QAAQ,CAgBjD"}
1
+ {"version":3,"file":"inquirer-prompter.d.ts","sourceRoot":"","sources":["../../src/prompt/inquirer-prompter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,IAAI,QAAQ,CAoBjD"}
@@ -1,4 +1,4 @@
1
- import { select } from '@inquirer/prompts';
1
+ import { confirm, select } from '@inquirer/prompts';
2
2
  /**
3
3
  * The real prompter. Renders entirely to stderr via @inquirer/prompts'
4
4
  * `output` context option — never stdout, so no invocation mode can let
@@ -22,6 +22,9 @@ export function createInquirerPrompter() {
22
22
  })),
23
23
  }, { output: process.stderr });
24
24
  },
25
+ async confirm(input) {
26
+ return confirm({ message: input.message, default: false }, { output: process.stderr });
27
+ },
25
28
  };
26
29
  }
27
30
  //# sourceMappingURL=inquirer-prompter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inquirer-prompter.js","sourceRoot":"","sources":["../../src/prompt/inquirer-prompter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,KAAK,CAAC,aAAa,CAAC,KAAK;YACvB,OAAO,MAAM,CACX;gBACE,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,KAAK,CAAC,SAAS;gBACxB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACjC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,EAAE;oBACpC,KAAK,EAAE,CAAC,CAAC,EAAE;iBACZ,CAAC,CAAC;aACJ,EACD,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAC3B,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"inquirer-prompter.js","sourceRoot":"","sources":["../../src/prompt/inquirer-prompter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,KAAK,CAAC,aAAa,CAAC,KAAK;YACvB,OAAO,MAAM,CACX;gBACE,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,KAAK,CAAC,SAAS;gBACxB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBACjC,IAAI,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,WAAW,EAAE;oBACpC,KAAK,EAAE,CAAC,CAAC,EAAE;iBACZ,CAAC,CAAC;aACJ,EACD,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAC3B,CAAC;QACJ,CAAC;QAED,KAAK,CAAC,OAAO,CAAC,KAAK;YACjB,OAAO,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACzF,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -20,5 +20,14 @@ export interface Prompter {
20
20
  choices: readonly ProfileChoice[];
21
21
  defaultId: string;
22
22
  }): Promise<string>;
23
+ /**
24
+ * session-submit-and-land spec: the fire gate before an external side
25
+ * effect (a merge, a worktree removal) — `false` means the operator
26
+ * declined and nothing happens. Implementations MUST render entirely to
27
+ * stderr, for the same --json-corruption reason as `selectProfile`.
28
+ */
29
+ confirm(input: {
30
+ message: string;
31
+ }): Promise<boolean>;
23
32
  }
24
33
  //# sourceMappingURL=prompter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompter.d.ts","sourceRoot":"","sources":["../../src/prompt/prompter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;QAClC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrB"}
1
+ {"version":3,"file":"prompter.d.ts","sourceRoot":"","sources":["../../src/prompt/prompter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,QAAQ;IACvB;;;;OAIG;IACH,aAAa,CAAC,KAAK,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,SAAS,aAAa,EAAE,CAAC;QAClC,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpB;;;;;OAKG;IACH,OAAO,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD"}
package/dist/run.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAOhD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAI,MAAM,EAAE,QAAQ,CAAU,CAAC;AAiFzD;;;;GAIG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkZjF"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAOhD;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAI,MAAM,EAAE,QAAQ,CAAU,CAAC;AAiFzD;;;;GAIG;AACH,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CA8iBjF"}
package/dist/run.js CHANGED
@@ -10,18 +10,25 @@ import * as ingestCommand from './commands/ingest.js';
10
10
  import * as lintCommand from './commands/lint.js';
11
11
  import * as migrateCommand from './commands/migrate.js';
12
12
  import * as graphBuildCommand from './commands/graph-build.js';
13
+ import * as entryAppendCommand from './commands/entry-append.js';
13
14
  import * as graphQueryCommand from './commands/graph-query.js';
15
+ import * as identityCommand from './commands/identity.js';
14
16
  import * as initCommand from './commands/init.js';
15
17
  import * as noteResolveCommand from './commands/note-resolve.js';
16
18
  import * as sessionAbandonCommand from './commands/session-abandon.js';
19
+ import * as sessionCaptureCommand from './commands/session-capture.js';
20
+ import * as sessionLandCommand from './commands/session-land.js';
17
21
  import * as sessionListCommand from './commands/session-list.js';
18
22
  import * as sessionReapCommand from './commands/session-reap.js';
19
23
  import * as sessionStartCommand from './commands/session-start.js';
20
24
  import * as rollupGatherCommand from './commands/rollup-gather.js';
25
+ import * as rollupStaleCommand from './commands/rollup-stale.js';
21
26
  import * as rollupWriteCommand from './commands/rollup-write.js';
22
27
  import * as sessionSubmitCommand from './commands/session-submit.js';
28
+ import * as sourceAddAltCommand from './commands/source-add-alt.js';
23
29
  import * as sourceCheckCommand from './commands/source-check.js';
24
30
  import * as sourceHashCommand from './commands/source-hash.js';
31
+ import * as sourceStampCommand from './commands/source-stamp.js';
25
32
  import { buildEnvelope } from './core/envelope.js';
26
33
  import { ContextureError } from './core/errors.js';
27
34
  import { ExitCode } from './core/exit-codes.js';
@@ -139,13 +146,27 @@ export async function run(argv, env) {
139
146
  });
140
147
  program
141
148
  .command('check <path>')
142
- .description('the disclosure-policy tri-state verdict (ALLOW/DENY/ASK) for a note and an audience')
143
- .requiredOption('--audience <audience>', 'the audience the content would be disclosed to')
149
+ .description('the disclosure-policy tri-state verdict (ALLOW/DENY/ASK) for a note and an audience, or --scan for a leak scan')
150
+ .option('--audience <audience>', 'the audience the content would be disclosed to (required unless --scan is given)')
151
+ .option('--scan', 'scan this note for content matching another context\'s markers that this note is not visible to')
144
152
  .action(async (notePath, cmdOpts, cmd) => {
145
153
  const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
146
154
  result = await runCommand('check', runEnv, jsonMode, async () => {
147
155
  const store = await openStore(runEnv, { root });
148
- return checkCommand.execute(runEnv, store, { path: notePath, audience: cmdOpts.audience });
156
+ return checkCommand.execute(runEnv, store, { path: notePath, audience: cmdOpts.audience, scan: cmdOpts.scan });
157
+ });
158
+ });
159
+ const entryCommand = program.command('entry').description('structured writes into a fenced region');
160
+ entryCommand
161
+ .command('append <path>')
162
+ .description('append a line into a contexture:<region> fenced region, creating it if absent')
163
+ .requiredOption('--region <name>', 'the region name')
164
+ .requiredOption('--text <text>', 'the line to append')
165
+ .action(async (notePath, cmdOpts, cmd) => {
166
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
167
+ result = await runCommand('entry.append', runEnv, jsonMode, async () => {
168
+ const store = await openStore(runEnv, { root });
169
+ return entryAppendCommand.execute(runEnv, store, { path: notePath, region: cmdOpts.region, text: cmdOpts.text });
149
170
  });
150
171
  });
151
172
  const noteCommand = program.command('note').description('inspect a single note');
@@ -211,6 +232,7 @@ export async function run(argv, env) {
211
232
  .description('list nodes reachable from <node> within --depth hops')
212
233
  .option('--depth <n>', 'hop count', (v) => Number.parseInt(v, 10), 1)
213
234
  .option('--direction <dir>', 'in, out, or both', 'both')
235
+ .option('--type <name>', 'follow only edges of this type (a configured relation name, or link)')
214
236
  .option('--as <context>', 'filter to notes visible to this context before traversal')
215
237
  .action(async (node, cmdOpts, cmd) => {
216
238
  const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
@@ -220,6 +242,7 @@ export async function run(argv, env) {
220
242
  node,
221
243
  depth: cmdOpts.depth,
222
244
  direction: cmdOpts.direction,
245
+ type: cmdOpts.type,
223
246
  as: cmdOpts.as,
224
247
  });
225
248
  });
@@ -258,6 +281,29 @@ export async function run(argv, env) {
258
281
  return graphQueryCommand.executeHubs(store, { top: cmdOpts.top, as: cmdOpts.as });
259
282
  });
260
283
  });
284
+ graphQueryCommandGroup
285
+ .command('clusters')
286
+ .description('every positional cluster with its note count')
287
+ .option('--as <context>', 'filter to notes visible to this context first')
288
+ .action(async (cmdOpts, cmd) => {
289
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
290
+ result = await runCommand('graph.query.clusters', runEnv, jsonMode, async () => {
291
+ const store = await openStore(runEnv, { root });
292
+ return graphQueryCommand.executeClusters(store, { as: cmdOpts.as });
293
+ });
294
+ });
295
+ graphQueryCommandGroup
296
+ .command('bridges')
297
+ .description('notes that link into the most other clusters')
298
+ .option('--top <n>', 'how many to list (default: the configured bridge limit)', (v) => Number.parseInt(v, 10))
299
+ .option('--as <context>', 'filter to notes visible to this context before ranking')
300
+ .action(async (cmdOpts, cmd) => {
301
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
302
+ result = await runCommand('graph.query.bridges', runEnv, jsonMode, async () => {
303
+ const store = await openStore(runEnv, { root });
304
+ return graphQueryCommand.executeBridges(store, { top: cmdOpts.top, as: cmdOpts.as });
305
+ });
306
+ });
261
307
  graphQueryCommandGroup
262
308
  .command('orphans')
263
309
  .description('nodes with no links in or out')
@@ -298,7 +344,7 @@ export async function run(argv, env) {
298
344
  });
299
345
  sourceCommand
300
346
  .command('check <path>')
301
- .description('two-stage dedupe verdict: already-ingested, alternate-source-match, multiple-matches, or new')
347
+ .description('two-stage dedupe verdict: new, already-ingested, drift, alternate-source-match, or multiple-matches')
302
348
  .requiredOption('--source-id <id>', "the candidate material's source identifier")
303
349
  .action(async (notePath, cmdOpts, cmd) => {
304
350
  const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
@@ -307,6 +353,29 @@ export async function run(argv, env) {
307
353
  return sourceCheckCommand.execute(runEnv, store, { path: notePath, sourceId: cmdOpts.sourceId });
308
354
  });
309
355
  });
356
+ sourceCommand
357
+ .command('stamp <path>')
358
+ .description('record source identity (and, by default, the current content hash) on a note directly')
359
+ .requiredOption('--id <id>', 'the source identifier to record')
360
+ .option('--hash <hash>', 'the content hash to record (default: computed from the note\'s current body)')
361
+ .action(async (notePath, cmdOpts, cmd) => {
362
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
363
+ result = await runCommand('source.stamp', runEnv, jsonMode, async () => {
364
+ const store = await openStore(runEnv, { root });
365
+ return sourceStampCommand.execute(runEnv, store, { path: notePath, id: cmdOpts.id, hash: cmdOpts.hash });
366
+ });
367
+ });
368
+ sourceCommand
369
+ .command('add-alt <path>')
370
+ .description('append an alternative source identity to an already-ingested note')
371
+ .requiredOption('--id <id>', 'the alternative source identifier')
372
+ .action(async (notePath, cmdOpts, cmd) => {
373
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
374
+ result = await runCommand('source.add-alt', runEnv, jsonMode, async () => {
375
+ const store = await openStore(runEnv, { root });
376
+ return sourceAddAltCommand.execute(runEnv, store, { path: notePath, id: cmdOpts.id });
377
+ });
378
+ });
310
379
  program
311
380
  .command('lint')
312
381
  .description('health observations that never fail the run: orphans, broken links, uningested inbox material, catalog gaps')
@@ -349,6 +418,55 @@ export async function run(argv, env) {
349
418
  return rollupWriteCommand.execute(runEnv, store, { entity, contentFile: cmdOpts.contentFile });
350
419
  });
351
420
  });
421
+ rollupCommand
422
+ .command('stale')
423
+ .description('list entity notes whose backlinks moved past their last rollup timestamp')
424
+ .option('--for <entity>', 'check only this entity')
425
+ .action(async (cmdOpts, cmd) => {
426
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
427
+ result = await runCommand('rollup.stale', runEnv, jsonMode, async () => {
428
+ const store = await openStore(runEnv, { root });
429
+ return rollupStaleCommand.execute(runEnv, store, { for: cmdOpts.for });
430
+ });
431
+ });
432
+ const identityCommandGroup = program.command('identity').description('edit an identity role\'s file by entry — add, replace, or remove');
433
+ identityCommandGroup
434
+ .command('add')
435
+ .description('append a new entry')
436
+ .requiredOption('--file <role>', 'posture, world-facts, or user-facts')
437
+ .requiredOption('--text <text>', 'the entry text')
438
+ .action(async (cmdOpts, cmd) => {
439
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
440
+ result = await runCommand('identity.add', runEnv, jsonMode, async () => {
441
+ const store = await openStore(runEnv, { root });
442
+ return identityCommand.executeAdd(store, cmdOpts);
443
+ });
444
+ });
445
+ identityCommandGroup
446
+ .command('replace')
447
+ .description('replace the single entry containing --match')
448
+ .requiredOption('--file <role>', 'posture, world-facts, or user-facts')
449
+ .requiredOption('--match <text>', 'a unique substring of the entry to replace')
450
+ .requiredOption('--text <text>', 'the replacement text')
451
+ .action(async (cmdOpts, cmd) => {
452
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
453
+ result = await runCommand('identity.replace', runEnv, jsonMode, async () => {
454
+ const store = await openStore(runEnv, { root });
455
+ return identityCommand.executeReplace(store, cmdOpts);
456
+ });
457
+ });
458
+ identityCommandGroup
459
+ .command('remove')
460
+ .description('remove the single entry containing --match')
461
+ .requiredOption('--file <role>', 'posture, world-facts, or user-facts')
462
+ .requiredOption('--match <text>', 'a unique substring of the entry to remove')
463
+ .action(async (cmdOpts, cmd) => {
464
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
465
+ result = await runCommand('identity.remove', runEnv, jsonMode, async () => {
466
+ const store = await openStore(runEnv, { root });
467
+ return identityCommand.executeRemove(store, cmdOpts);
468
+ });
469
+ });
352
470
  const adaptersCommand = program.command('adapters').description('harness-generation, identity-injection, and forge adapters');
353
471
  adaptersCommand
354
472
  .command('generate')
@@ -409,6 +527,7 @@ export async function run(argv, env) {
409
527
  .option('--message <text>', 'commit message for any remaining staged changes')
410
528
  .option('--title <text>', 'pull request title')
411
529
  .option('--body <text>', 'pull request body')
530
+ .option('--branch <name>', 'rename the session branch before pushing, so a generated name never reaches the forge')
412
531
  .action(async (cmdOpts, cmd) => {
413
532
  const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
414
533
  result = await runCommand('session.submit', runEnv, jsonMode, async () => {
@@ -416,6 +535,32 @@ export async function run(argv, env) {
416
535
  return sessionSubmitCommand.execute(runEnv, store, cmdOpts);
417
536
  });
418
537
  });
538
+ sessionCommand
539
+ .command('capture')
540
+ .description('apply an approved end-of-session capture proposal: create or append notes, apply identity deltas')
541
+ .requiredOption('--proposal <path>', 'a YAML file of approved notes / world_facts / user_facts items')
542
+ .action(async (cmdOpts, cmd) => {
543
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
544
+ result = await runCommand('session.capture', runEnv, jsonMode, async () => {
545
+ const store = await openStore(runEnv, { root });
546
+ return sessionCaptureCommand.execute(store, cmdOpts);
547
+ });
548
+ });
549
+ sessionCommand
550
+ .command('land')
551
+ .description('complete a reviewed session: merge its pull request, sync the default branch, optionally reap the worktree')
552
+ .option('--pr <number>', 'the pull request number to land (default: the one for the current or --branch session)', (v) => Number.parseInt(v, 10))
553
+ .option('--branch <name>', 'the session branch to land (default: the current branch)')
554
+ .option('--yes', 'consent to the merge without an interactive prompt')
555
+ .option('--merge-method <method>', 'squash, merge, or rebase', 'squash')
556
+ .option('--reap', 'remove the session worktree afterward, if it is clean and the pull request merged')
557
+ .action(async (cmdOpts, cmd) => {
558
+ const { runEnv, jsonMode, root } = deriveRunEnv(env, cmd);
559
+ result = await runCommand('session.land', runEnv, jsonMode, async () => {
560
+ const store = await openStore(runEnv, { root });
561
+ return sessionLandCommand.execute(runEnv, store, cmdOpts);
562
+ });
563
+ });
419
564
  sessionCommand
420
565
  .command('abandon <branch>')
421
566
  .description('discard a session: remove its worktree and delete its branch')