@intentius/chant 0.100.0 → 0.101.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 (276) hide show
  1. package/dist/build.d.ts +6 -0
  2. package/dist/build.d.ts.map +1 -1
  3. package/dist/cli/build-options.d.ts +2 -0
  4. package/dist/cli/build-options.d.ts.map +1 -1
  5. package/dist/cli/commands/build.d.ts.map +1 -1
  6. package/dist/cli/commands/import.d.ts.map +1 -1
  7. package/dist/cli/handlers/fan-out.d.ts.map +1 -1
  8. package/dist/cli/main.d.ts.map +1 -1
  9. package/dist/cli/mcp/workspace-tools.d.ts +8 -0
  10. package/dist/cli/mcp/workspace-tools.d.ts.map +1 -1
  11. package/dist/cli/registry.d.ts +22 -0
  12. package/dist/cli/registry.d.ts.map +1 -1
  13. package/dist/config.d.ts +11 -0
  14. package/dist/config.d.ts.map +1 -1
  15. package/dist/lexicon.d.ts +24 -1
  16. package/dist/lexicon.d.ts.map +1 -1
  17. package/dist/lifecycle/gate-ledger.d.ts.map +1 -1
  18. package/dist/lifecycle/plan-digest.d.ts +26 -5
  19. package/dist/lifecycle/plan-digest.d.ts.map +1 -1
  20. package/dist/lint/config.d.ts +4 -4
  21. package/dist/op/activities/activity-contracts.d.ts +1 -0
  22. package/dist/op/activities/activity-contracts.d.ts.map +1 -1
  23. package/dist/op/activities/propose-upgrade.d.ts +2 -0
  24. package/dist/op/activities/propose-upgrade.d.ts.map +1 -1
  25. package/dist/op/index.d.ts +1 -1
  26. package/dist/op/index.d.ts.map +1 -1
  27. package/dist/serializer.d.ts +8 -0
  28. package/dist/serializer.d.ts.map +1 -1
  29. package/dist/telemetry-attribution.d.ts +77 -0
  30. package/dist/telemetry-attribution.d.ts.map +1 -0
  31. package/dist/workspace/agent-cli.d.ts +83 -0
  32. package/dist/workspace/agent-cli.d.ts.map +1 -0
  33. package/dist/workspace/changes-cli.d.ts.map +1 -1
  34. package/dist/workspace/changes.d.ts +8 -1
  35. package/dist/workspace/changes.d.ts.map +1 -1
  36. package/dist/workspace/checks/links.d.ts +1 -0
  37. package/dist/workspace/checks/links.d.ts.map +1 -1
  38. package/dist/workspace/checks/live.d.ts +40 -0
  39. package/dist/workspace/checks/live.d.ts.map +1 -0
  40. package/dist/workspace/checks.d.ts +21 -2
  41. package/dist/workspace/checks.d.ts.map +1 -1
  42. package/dist/workspace/compose-graph.d.ts +63 -0
  43. package/dist/workspace/compose-graph.d.ts.map +1 -1
  44. package/dist/workspace/decide.d.ts +1 -1
  45. package/dist/workspace/decide.d.ts.map +1 -1
  46. package/dist/workspace/declaration.d.ts +32 -0
  47. package/dist/workspace/declaration.d.ts.map +1 -1
  48. package/dist/workspace/declaration.schema.json +138 -3
  49. package/dist/workspace/export-cli.d.ts +12 -0
  50. package/dist/workspace/export-cli.d.ts.map +1 -0
  51. package/dist/workspace/export.d.ts +145 -0
  52. package/dist/workspace/export.d.ts.map +1 -0
  53. package/dist/workspace/graph-cli.d.ts.map +1 -1
  54. package/dist/workspace/import.d.ts +73 -0
  55. package/dist/workspace/import.d.ts.map +1 -0
  56. package/dist/workspace/kinds.d.ts +6 -2
  57. package/dist/workspace/kinds.d.ts.map +1 -1
  58. package/dist/workspace/lineage-adopt-cli.d.ts +15 -0
  59. package/dist/workspace/lineage-adopt-cli.d.ts.map +1 -0
  60. package/dist/workspace/lineage-adopt.d.ts +106 -0
  61. package/dist/workspace/lineage-adopt.d.ts.map +1 -0
  62. package/dist/workspace/lineage-check.d.ts +9 -2
  63. package/dist/workspace/lineage-check.d.ts.map +1 -1
  64. package/dist/workspace/lineage-cli.d.ts +6 -1
  65. package/dist/workspace/lineage-cli.d.ts.map +1 -1
  66. package/dist/workspace/lineage-hash-index.d.ts +110 -0
  67. package/dist/workspace/lineage-hash-index.d.ts.map +1 -0
  68. package/dist/workspace/lineage-init.d.ts +10 -0
  69. package/dist/workspace/lineage-init.d.ts.map +1 -1
  70. package/dist/workspace/lineage-lock.d.ts +147 -0
  71. package/dist/workspace/lineage-lock.d.ts.map +1 -1
  72. package/dist/workspace/lineage-migrations.d.ts +15 -3
  73. package/dist/workspace/lineage-migrations.d.ts.map +1 -1
  74. package/dist/workspace/lineage-provenance.d.ts +18 -0
  75. package/dist/workspace/lineage-provenance.d.ts.map +1 -0
  76. package/dist/workspace/lineage-upgrade-cli.d.ts +2 -0
  77. package/dist/workspace/lineage-upgrade-cli.d.ts.map +1 -1
  78. package/dist/workspace/lineage-upgrade.d.ts +30 -1
  79. package/dist/workspace/lineage-upgrade.d.ts.map +1 -1
  80. package/dist/workspace/lineage-versions.d.ts +116 -0
  81. package/dist/workspace/lineage-versions.d.ts.map +1 -0
  82. package/dist/workspace/links.d.ts +31 -5
  83. package/dist/workspace/links.d.ts.map +1 -1
  84. package/dist/workspace/ls-generated.d.ts +37 -0
  85. package/dist/workspace/ls-generated.d.ts.map +1 -0
  86. package/dist/workspace/ls.d.ts +4 -0
  87. package/dist/workspace/ls.d.ts.map +1 -1
  88. package/dist/workspace/member-commands.d.ts.map +1 -1
  89. package/dist/workspace/nested-graph.d.ts +56 -0
  90. package/dist/workspace/nested-graph.d.ts.map +1 -0
  91. package/dist/workspace/nesting.d.ts +21 -0
  92. package/dist/workspace/nesting.d.ts.map +1 -0
  93. package/dist/workspace/pin-cli.d.ts +10 -0
  94. package/dist/workspace/pin-cli.d.ts.map +1 -0
  95. package/dist/workspace/pin-integrity.d.ts +51 -0
  96. package/dist/workspace/pin-integrity.d.ts.map +1 -0
  97. package/dist/workspace/reason-codes.d.ts +26 -2
  98. package/dist/workspace/reason-codes.d.ts.map +1 -1
  99. package/dist/workspace/record-sessions.d.ts +7 -11
  100. package/dist/workspace/record-sessions.d.ts.map +1 -1
  101. package/dist/workspace/records-cli.d.ts +30 -1
  102. package/dist/workspace/records-cli.d.ts.map +1 -1
  103. package/dist/workspace/records-close.d.ts +5 -2
  104. package/dist/workspace/records-close.d.ts.map +1 -1
  105. package/dist/workspace/records-write.d.ts +22 -4
  106. package/dist/workspace/records-write.d.ts.map +1 -1
  107. package/dist/workspace/records.d.ts +43 -5
  108. package/dist/workspace/records.d.ts.map +1 -1
  109. package/dist/workspace/returns.d.ts +129 -0
  110. package/dist/workspace/returns.d.ts.map +1 -0
  111. package/dist/workspace/status-gates.d.ts.map +1 -1
  112. package/dist/workspace/template-manifest.d.ts +11 -3
  113. package/dist/workspace/template-manifest.d.ts.map +1 -1
  114. package/dist/workspace/trust/attestor.d.ts +8 -0
  115. package/dist/workspace/trust/attestor.d.ts.map +1 -1
  116. package/dist/workspace/trust/dsse.d.ts +58 -0
  117. package/dist/workspace/trust/dsse.d.ts.map +1 -0
  118. package/dist/workspace/trust/evidence-cli.d.ts +66 -0
  119. package/dist/workspace/trust/evidence-cli.d.ts.map +1 -0
  120. package/dist/workspace/trust/evidence.d.ts +93 -0
  121. package/dist/workspace/trust/evidence.d.ts.map +1 -0
  122. package/dist/workspace/trust/policy.d.ts +54 -1
  123. package/dist/workspace/trust/policy.d.ts.map +1 -1
  124. package/dist/workspace/trust/provenance.d.ts +21 -1
  125. package/dist/workspace/trust/provenance.d.ts.map +1 -1
  126. package/dist/workspace/trust/rotation.d.ts +132 -0
  127. package/dist/workspace/trust/rotation.d.ts.map +1 -0
  128. package/dist/workspace/trust/seal.d.ts.map +1 -1
  129. package/dist/workspace/trust/signers-cli.d.ts +49 -0
  130. package/dist/workspace/trust/signers-cli.d.ts.map +1 -0
  131. package/dist/workspace/trust/ssh-commit.d.ts +12 -0
  132. package/dist/workspace/trust/ssh-commit.d.ts.map +1 -1
  133. package/dist/workspace/trust/test-repo.d.ts +13 -0
  134. package/dist/workspace/trust/test-repo.d.ts.map +1 -1
  135. package/dist/workspace/trust/verify.d.ts +15 -0
  136. package/dist/workspace/trust/verify.d.ts.map +1 -1
  137. package/dist/workspace/work-evidence.d.ts +1 -1
  138. package/dist/workspace/work-evidence.d.ts.map +1 -1
  139. package/dist/workspace/write-scope.d.ts +199 -0
  140. package/dist/workspace/write-scope.d.ts.map +1 -0
  141. package/package.json +1 -1
  142. package/src/build.ts +8 -0
  143. package/src/cli/build-options.ts +4 -1
  144. package/src/cli/commands/build.ts +2 -0
  145. package/src/cli/commands/import-live.test.ts +69 -1
  146. package/src/cli/commands/import.ts +48 -22
  147. package/src/cli/handlers/fan-out.test.ts +6 -6
  148. package/src/cli/handlers/fan-out.ts +2 -1
  149. package/src/cli/handlers/graph.test.ts +42 -0
  150. package/src/cli/handlers/graph.ts +22 -0
  151. package/src/cli/handlers/operator.ts +1 -1
  152. package/src/cli/main.test.ts +32 -0
  153. package/src/cli/main.ts +103 -6
  154. package/src/cli/mcp/workspace-tools.test.ts +1 -1
  155. package/src/cli/mcp/workspace-tools.ts +33 -2
  156. package/src/cli/registry.ts +22 -0
  157. package/src/cli/serve-mcp-workspace.test.ts +1 -1
  158. package/src/codegen/release-wiring.test.ts +5 -1
  159. package/src/components/fan-out-output.test.ts +1 -1
  160. package/src/components/fan-out.test.ts +1 -1
  161. package/src/components/promote.test.ts +1 -1
  162. package/src/config.ts +12 -0
  163. package/src/content-digest.test.ts +2 -2
  164. package/src/lexicon.ts +25 -1
  165. package/src/lifecycle/gate-ledger.test.ts +14 -0
  166. package/src/lifecycle/gate-ledger.ts +2 -1
  167. package/src/lifecycle/plan-digest.test.ts +54 -3
  168. package/src/lifecycle/plan-digest.ts +38 -8
  169. package/src/op/activities/activity-contracts.ts +1 -0
  170. package/src/op/activities/propose-upgrade.ts +8 -5
  171. package/src/op/gate-approval.test.ts +17 -0
  172. package/src/op/gate.ts +3 -3
  173. package/src/op/index.ts +1 -1
  174. package/src/serializer.ts +9 -0
  175. package/src/telemetry-attribution.test.ts +91 -0
  176. package/src/telemetry-attribution.ts +145 -0
  177. package/src/workspace/agent-cli.ts +134 -0
  178. package/src/workspace/agent.schema.json +356 -0
  179. package/src/workspace/behold-kinds.test.ts +1 -1
  180. package/src/workspace/changes-cli.ts +5 -0
  181. package/src/workspace/changes.schema.json +179 -1
  182. package/src/workspace/changes.ts +58 -4
  183. package/src/workspace/check-live.test.ts +192 -0
  184. package/src/workspace/check.schema.json +64 -0
  185. package/src/workspace/checks/links.ts +23 -2
  186. package/src/workspace/checks/live.ts +113 -0
  187. package/src/workspace/checks.test.ts +2 -2
  188. package/src/workspace/checks.ts +20 -3
  189. package/src/workspace/compose-graph.test.ts +47 -0
  190. package/src/workspace/compose-graph.ts +120 -3
  191. package/src/workspace/conformance/__fixture__/decisions/decision.kind.mjs +7 -1
  192. package/src/workspace/conformance/__fixture__/decisions/decision.schema.json +5 -0
  193. package/src/workspace/declaration.schema.json +138 -3
  194. package/src/workspace/declaration.ts +106 -1
  195. package/src/workspace/declared-kinds.test.ts +33 -0
  196. package/src/workspace/evidence.schema.json +279 -0
  197. package/src/workspace/export-cli.ts +180 -0
  198. package/src/workspace/export-import.test.ts +282 -0
  199. package/src/workspace/export.ts +486 -0
  200. package/src/workspace/graph-cli.ts +47 -1
  201. package/src/workspace/graph-contract.test.ts +89 -4
  202. package/src/workspace/graph.schema.json +206 -1
  203. package/src/workspace/import.ts +325 -0
  204. package/src/workspace/kinds.test.ts +5 -5
  205. package/src/workspace/kinds.ts +25 -3
  206. package/src/workspace/lineage-adopt-cli.ts +103 -0
  207. package/src/workspace/lineage-adopt.test.ts +552 -0
  208. package/src/workspace/lineage-adopt.ts +452 -0
  209. package/src/workspace/lineage-check.ts +26 -5
  210. package/src/workspace/lineage-cli.ts +12 -2
  211. package/src/workspace/lineage-hash-index.ts +305 -0
  212. package/src/workspace/lineage-init.test.ts +9 -0
  213. package/src/workspace/lineage-init.ts +29 -9
  214. package/src/workspace/lineage-lock.ts +54 -0
  215. package/src/workspace/lineage-migrations.test.ts +27 -0
  216. package/src/workspace/lineage-migrations.ts +44 -14
  217. package/src/workspace/lineage-provenance.ts +40 -0
  218. package/src/workspace/lineage-upgrade-cli.ts +9 -5
  219. package/src/workspace/lineage-upgrade.test.ts +92 -1
  220. package/src/workspace/lineage-upgrade.ts +111 -16
  221. package/src/workspace/lineage-versions.ts +348 -0
  222. package/src/workspace/links.test.ts +121 -2
  223. package/src/workspace/links.ts +97 -6
  224. package/src/workspace/ls-contract.test.ts +84 -1
  225. package/src/workspace/ls-generated.ts +111 -0
  226. package/src/workspace/ls.schema.json +19 -0
  227. package/src/workspace/ls.ts +8 -1
  228. package/src/workspace/member-commands.ts +3 -1
  229. package/src/workspace/nested-graph.test.ts +176 -0
  230. package/src/workspace/nested-graph.ts +169 -0
  231. package/src/workspace/nesting.ts +37 -0
  232. package/src/workspace/pin-cli.test.ts +71 -0
  233. package/src/workspace/pin-cli.ts +57 -0
  234. package/src/workspace/pin-integrity.test.ts +121 -0
  235. package/src/workspace/pin-integrity.ts +104 -0
  236. package/src/workspace/points-write.schema.json +1 -0
  237. package/src/workspace/read-contract.test.ts +24 -0
  238. package/src/workspace/reason-codes.test.ts +10 -0
  239. package/src/workspace/reason-codes.ts +29 -2
  240. package/src/workspace/record-sessions.ts +12 -14
  241. package/src/workspace/records-amend.schema.json +4 -0
  242. package/src/workspace/records-cli.ts +93 -12
  243. package/src/workspace/records-close.schema.json +6 -2
  244. package/src/workspace/records-close.ts +10 -2
  245. package/src/workspace/records-formats.test.ts +13 -5
  246. package/src/workspace/records-new.schema.json +4 -0
  247. package/src/workspace/records-review.schema.json +4 -0
  248. package/src/workspace/records-sessions.test.ts +23 -6
  249. package/src/workspace/records-write.test.ts +65 -8
  250. package/src/workspace/records-write.ts +70 -6
  251. package/src/workspace/records.schema.json +55 -3
  252. package/src/workspace/records.ts +96 -5
  253. package/src/workspace/returns.ts +328 -0
  254. package/src/workspace/signers.schema.json +206 -0
  255. package/src/workspace/status-gates.ts +2 -1
  256. package/src/workspace/template-manifest.ts +22 -4
  257. package/src/workspace/trust/attestor.ts +15 -0
  258. package/src/workspace/trust/dsse.ts +134 -0
  259. package/src/workspace/trust/evidence-cli.ts +195 -0
  260. package/src/workspace/trust/evidence.test.ts +241 -0
  261. package/src/workspace/trust/evidence.ts +207 -0
  262. package/src/workspace/trust/policy.ts +110 -3
  263. package/src/workspace/trust/provenance.ts +41 -4
  264. package/src/workspace/trust/record-seal.test.ts +1 -1
  265. package/src/workspace/trust/rotation.test.ts +258 -0
  266. package/src/workspace/trust/rotation.ts +336 -0
  267. package/src/workspace/trust/seal.ts +11 -0
  268. package/src/workspace/trust/signers-cli.ts +178 -0
  269. package/src/workspace/trust/ssh-commit.ts +53 -4
  270. package/src/workspace/trust/test-repo.ts +18 -0
  271. package/src/workspace/trust/trust.test.ts +8 -2
  272. package/src/workspace/trust/verify-cli.ts +1 -0
  273. package/src/workspace/trust/verify.ts +22 -0
  274. package/src/workspace/work-evidence.schema.json +4 -0
  275. package/src/workspace/write-scope.test.ts +340 -0
  276. package/src/workspace/write-scope.ts +448 -0
@@ -0,0 +1,106 @@
1
+ /**
2
+ * `chant workspace adopt-lineage`: give a scope a git lineage it can be
3
+ * upgraded from (#2551, D5, D9, requirement P7).
4
+ *
5
+ * Two cases, told apart by what the lock already holds for the scope.
6
+ *
7
+ * A scope with no lineage, such as a project made before the lock existed or
8
+ * copied by hand from a template or a fork of one, has no record of where its
9
+ * files came from. Adoption recovers it from the template's own versions:
10
+ *
11
+ * 1. Compute the template's hash index from its tags (./lineage-hash-index.ts),
12
+ * or reuse a cached copy for the tags whose commit it still names.
13
+ * 2. Score each version against the scope: how many of the template's files
14
+ * the scope holds byte for byte. The best version wins; ties go to the
15
+ * version whose files the scope accounts for best, then to the oldest.
16
+ * 3. Re-check a winner that came from the cache against the template itself,
17
+ * so a stale or forged cache never reaches the lock.
18
+ * 4. Record a lineage pinned to that version. Each file the template has
19
+ * there is recorded with the template's hash, after the template's
20
+ * parameters are substituted (#2627), as its merge base, so a file the
21
+ * scope edited shows as edited and merges on upgrade like any other.
22
+ * 5. Record the adoption under P7: the exact commit range it vouches for,
23
+ * everything up to HEAD, goes into the lineage and into
24
+ * `.chant/trust.json`'s `adopted` list. That file is policy, read at the
25
+ * base revision, and editing it is a protected write, so the range counts
26
+ * only once an admin has merged it. The scope then reads as `adopted`
27
+ * (./lineage-provenance.ts).
28
+ *
29
+ * A scope with a directory lineage (#2647) already has a lineage, but no
30
+ * history to rebuild a merge base from once the directory changes. The
31
+ * studio's boxes are made this way, with `chant init --from ~/box/template`,
32
+ * and a kit release replaces that directory. Adoption moves such a scope onto
33
+ * the git repository the directory was copied from: every candidate version
34
+ * is rendered with the parameters the lock recorded, and only a version that
35
+ * reproduces every hash the lock recorded qualifies. The merge base is then
36
+ * the same files, so the lineage keeps its files, parameters and migrations,
37
+ * and only its source, ref and address change. Nothing about the scope's
38
+ * history is claimed, so no commit range is admitted.
39
+ */
40
+ import { type HashIndex } from "./lineage-hash-index.js";
41
+ import { type Adoption, type Lineage } from "./lineage-lock.js";
42
+ export interface AdoptOptions {
43
+ /** The directory that holds (or will hold) `.chant/workspace.lock.json`. */
44
+ root: string;
45
+ /** The scope to adopt, relative to `root`. Defaults to `"."`. */
46
+ scope?: string;
47
+ /** `<repo>[@<ref>][#<member>]`: the template. With a ref, adopt at exactly that version. */
48
+ from: string;
49
+ /** Only tags matching this glob are candidates, such as `kit-v*`. */
50
+ tags?: string;
51
+ /** A cached hash index, such as a copy the template's CI published. */
52
+ cache?: HashIndex;
53
+ /** `--param name=value` values for a template with a `chant.template.json`; only for a scope with no lineage. */
54
+ params?: Record<string, string>;
55
+ dryRun?: boolean;
56
+ }
57
+ export interface VersionScore {
58
+ tag: string;
59
+ commit: string;
60
+ /** Files the template has at the version. */
61
+ files: number;
62
+ identical: number;
63
+ edited: number;
64
+ missing: number;
65
+ }
66
+ export interface AdoptionResult {
67
+ scope: string;
68
+ /** `files` for a scope with no lineage, `lineage` for a directory lineage moved onto git. */
69
+ by: Adoption["by"];
70
+ template: string;
71
+ chosen: VersionScore;
72
+ /** The next best versions that do not tie with the chosen one, best first, at most three. */
73
+ alternatives: VersionScore[];
74
+ /** Other versions that score exactly as the chosen one does. `@<ref>` in `--from` picks one of them. */
75
+ ties: string[];
76
+ /** How many versions were compared. */
77
+ compared: number;
78
+ /** The files, by how the scope holds them (for `lineage`, by how the lock recorded them). */
79
+ identical: string[];
80
+ edited: string[];
81
+ missing: string[];
82
+ index: Adoption["index"];
83
+ /** The lineage the lock records. */
84
+ lineage: Lineage;
85
+ /** The `.chant/trust.json` entry the adoption adds, for `files`. Null when it is already there or for `lineage`. */
86
+ trust: {
87
+ path: string;
88
+ entry: {
89
+ to: string;
90
+ note: string;
91
+ };
92
+ } | null;
93
+ /** Whether the lock (and the trust entry) were written: false for a dry run. */
94
+ written: boolean;
95
+ /** Whether a `.gitignore` covers the lock, so it would not be committed without `git add -f`. */
96
+ lockIgnored: boolean;
97
+ }
98
+ /**
99
+ * Adopt a lineage for the scope, and record it unless `dryRun`. Throws a
100
+ * {@link LockError} when the scope has a lineage that is not a directory
101
+ * lineage, when no version fits, or when the template cannot be read.
102
+ */
103
+ export declare function adoptLineage(options: AdoptOptions): AdoptionResult;
104
+ /** One line per fact, for the terminal. */
105
+ export declare function describeAdoption(p: AdoptionResult): string[];
106
+ //# sourceMappingURL=lineage-adopt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineage-adopt.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-adopt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,OAAO,EAAiD,KAAK,SAAS,EAAuB,MAAM,sBAAsB,CAAC;AAE1H,OAAO,EAWL,KAAK,QAAQ,EACb,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AAQxB,MAAM,WAAW,YAAY;IAC3B,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4FAA4F;IAC5F,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iHAAiH;IACjH,MAAM,CAAC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C,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,GAAG,MAAM,EAAE,CA0B5D"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * `chant workspace check [--at <rev>] [--json] [--format stylish|json|sarif] [--generated] [--kind <kind file>]`:
2
+ * `chant workspace check [--at <rev>] [--json] [--format stylish|json|sarif] [--generated] [--kind <kind file>] [--live --env <env>]`:
3
3
  * the lineage checks (#2550, D9), and the declaration checks (#2535, D16)
4
4
  * when a declaration sits between the current directory and the git root.
5
5
  *
@@ -12,7 +12,10 @@
12
12
  * pipelines (#2542) and generated files (#2541) as well as the declaration
13
13
  * itself (#2641). `--generated` runs each declared generator too. `--kind`
14
14
  * reads a record kind's records and reports the files they pin by hash that
15
- * have changed since (#2549).
15
+ * have changed since (#2549). `--live --env <env>` resolves each declared
16
+ * member link against the live graph of `<env>` (`./checks/live.ts`, #2549):
17
+ * it is the one option that reaches a network, through each member's own
18
+ * `chant graph --live`, and is catalogued as egress.
16
19
  *
17
20
  * `chant workspace upgrade` runs the same checks in its staging worktree
18
21
  * before it reaches its gate.
@@ -85,6 +88,10 @@ export type CheckDocument = (CheckReport & {
85
88
  export declare function runChecks(cwd: string, at?: string, options?: {
86
89
  runGenerators?: boolean;
87
90
  kind?: string;
91
+ live?: {
92
+ env: string;
93
+ onStderr?: (text: string) => void;
94
+ };
88
95
  }): Promise<CheckDocument>;
89
96
  export declare function runWorkspaceCheck(ctx: CommandContext): Promise<number>;
90
97
  //# sourceMappingURL=lineage-check.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lineage-check.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMvD,yCAAyC;AACzC,eAAO,MAAM,WAAW,+CAAgF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C,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;CAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CA2DrM;AAcD,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyF5E"}
@@ -9,7 +9,8 @@
9
9
  * project (#2525 rule 4).
10
10
  */
11
11
  import type { CommandContext } from "../cli/registry.js";
12
- import { type LineageSource, type ManualStep } from "./lineage-lock.js";
12
+ import { type Adoption, type LineageSource, type ManualStep } from "./lineage-lock.js";
13
+ import { type LineageProvenance } from "./lineage-provenance.js";
13
14
  export interface LineageScopeView {
14
15
  scope: string;
15
16
  kind: "template" | "vendor";
@@ -23,6 +24,10 @@ export interface LineageScopeView {
23
24
  edited: string[];
24
25
  missing: string[];
25
26
  manualSteps: ManualStep[];
27
+ /** How adopt-lineage recorded the lineage (#2551), when it did. */
28
+ adoption?: Adoption;
29
+ /** For a lineage adopted by its files: whether the policy at base admits the adopted range (D5, P7). */
30
+ provenance?: LineageProvenance;
26
31
  }
27
32
  /** One line naming a scope's source kind and where it points (#2647). */
28
33
  export declare function describeSource(source: LineageSource): string;
@@ -1 +1 @@
1
- {"version":3,"file":"lineage-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAA6E,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIhJ,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IAC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M,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,wGAAwG;IACxG,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAED,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAa5D;AAED,sFAAsF;AACtF,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,gBAAgB,EAAE,CAAA;CAAE,GAAG,IAAI,CAuB7F;AAED,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsC9E"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * The hash index that `chant workspace adopt-lineage` matches a scope against
3
+ * (#2551, D9, ws-006).
4
+ *
5
+ * For each tagged version of a template, the index lists every file the
6
+ * template has at that version with the SHA-256 of its content. It is computed
7
+ * on demand from the template's tags: no registry holds it, and a template
8
+ * needs no extra publishing to be adoptable. A template's CI may publish a copy
9
+ * (`chant workspace hash-index`) and an adopter may pass it with `--index`.
10
+ * That copy is a cache only. chant reuses an entry only while the tag still
11
+ * names the commit the entry records, and it recomputes the entry it adopts
12
+ * from the template itself before anything reaches the lock.
13
+ *
14
+ * ws-006 also names parameter masking: rendering each version with and without
15
+ * its parameters, so a file that differs only by a parameter value still
16
+ * matches. The index hashes the files as the tag holds them, with the
17
+ * template's `chant.template.json` left out, since a project never receives
18
+ * it (#2627). A file a parameter changed reads as edited when matched against
19
+ * a scope's files; adopt-lineage records it with its substituted hash once
20
+ * the version is chosen. Moving a directory lineage onto git renders every
21
+ * candidate with the recorded parameters instead (./lineage-adopt.ts).
22
+ *
23
+ * The network steps are `git ls-remote --tags` and one `git fetch` of the tags
24
+ * to compute, both catalogued in `test/egress-catalogue.ts`. A local
25
+ * repository reaches nothing.
26
+ */
27
+ import { z } from "zod";
28
+ /** The index format this chant reads and writes. */
29
+ export declare const HASH_INDEX_VERSION = 1;
30
+ declare const EntrySchema: z.ZodObject<{
31
+ tag: z.ZodString;
32
+ commit: z.ZodString;
33
+ tree: z.ZodString;
34
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
35
+ }, z.core.$strict>;
36
+ export type HashIndexEntry = z.infer<typeof EntrySchema>;
37
+ declare const IndexSchema: z.ZodObject<{
38
+ indexVersion: z.ZodLiteral<1>;
39
+ template: z.ZodString;
40
+ tags: z.ZodArray<z.ZodObject<{
41
+ tag: z.ZodString;
42
+ commit: z.ZodString;
43
+ tree: z.ZodString;
44
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
45
+ }, z.core.$strict>>;
46
+ }, z.core.$strict>;
47
+ export type HashIndex = z.infer<typeof IndexSchema>;
48
+ /** Read and validate an index file, such as a copy a template's CI published. */
49
+ export declare function readHashIndex(path: string): HashIndex;
50
+ export declare function renderHashIndex(index: HashIndex): string;
51
+ /** Whether a template path is left out of the index: files a project never receives from the template. */
52
+ export declare function indexExcludes(path: string): boolean;
53
+ export interface RemoteTag {
54
+ tag: string;
55
+ /** The commit the tag names, peeled through an annotated tag. */
56
+ commit: string;
57
+ }
58
+ /**
59
+ * A scratch repository to read a template's tags in. Every method works on it;
60
+ * `dispose()` deletes it.
61
+ */
62
+ export declare class TemplateTags {
63
+ readonly url: string;
64
+ readonly member: string | undefined;
65
+ readonly label: string;
66
+ readonly scratch: string;
67
+ private readonly blobHashes;
68
+ private readonly fetched;
69
+ constructor(url: string, member: string | undefined, label: string);
70
+ dispose(): void;
71
+ /**
72
+ * The template's version tags, oldest first: every tag whose name reads as
73
+ * a version, narrowed by `pattern` when given (`chant-v*`).
74
+ */
75
+ listTags(pattern?: string): RemoteTag[];
76
+ /** Fetch the given tags, one commit deep each, in as few `git fetch` calls as the argument limit allows. */
77
+ fetchTags(tags: string[]): void;
78
+ /**
79
+ * Fetch one ref that is not a version tag, such as a branch or a commit, one
80
+ * commit deep, and return the commit it names.
81
+ */
82
+ fetchRef(ref: string): RemoteTag;
83
+ /**
84
+ * The index entry of one fetched tag: its tree and the SHA-256 of every file
85
+ * under the template's directory. Null when the directory does not exist at
86
+ * that tag: a template kept in one directory of a larger repository is
87
+ * absent from the tags cut before it was added.
88
+ */
89
+ entry(tag: RemoteTag): HashIndexEntry | null;
90
+ /** SHA-256 each blob not seen yet, read in one `git cat-file --batch`. Blobs shared between tags are hashed once. */
91
+ private hashBlobs;
92
+ }
93
+ export interface ComputedIndex {
94
+ index: HashIndex;
95
+ /** Tags whose entry came from the cache, unverified until one is adopted. */
96
+ cached: Set<string>;
97
+ }
98
+ /**
99
+ * The index of a template, from its tags. With `cache`, an entry is reused when
100
+ * its tag still names the recorded commit; the others are fetched and
101
+ * computed. `only` restricts the index to one ref the user named: a version
102
+ * tag, or any other ref git can fetch, such as a branch or a commit.
103
+ */
104
+ export declare function computeHashIndex(tags: TemplateTags, template: string, options?: {
105
+ pattern?: string;
106
+ cache?: HashIndex;
107
+ only?: string;
108
+ }): ComputedIndex;
109
+ export {};
110
+ //# sourceMappingURL=lineage-hash-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineage-hash-index.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-hash-index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAOH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAKpC,QAAA,MAAM,WAAW;;;;;kBASN,CAAC;AACZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD,Q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ACjB,6EAA6E;IAC7E,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,YAAY,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACnE,aAAa,CA+Cf"}
@@ -33,6 +33,14 @@ export interface TemplateSpec {
33
33
  * `git@host:path`, a local path, or `owner/name` for a GitHub repository.
34
34
  */
35
35
  export declare function parseTemplateSpec(spec: string, cwd?: string): TemplateSpec;
36
+ /**
37
+ * Parse `<repo>[@<ref>][#<member>]`, where the ref may be left out: the form
38
+ * `chant workspace adopt-lineage --from`, `hash-index --from` and
39
+ * `upgrade --source` take (#2551). `flag` names the option in messages.
40
+ */
41
+ export declare function parseTemplateSource(spec: string, cwd?: string, flag?: string): Omit<TemplateSpec, "ref"> & {
42
+ ref?: string;
43
+ };
36
44
  export interface FetchedTemplate {
37
45
  commit: string;
38
46
  tree: string;
@@ -122,6 +130,8 @@ export interface InitFromResult {
122
130
  }
123
131
  /** `chant init --from <repo>@<ref>[#<member>] [path]`, or `--from <dir>[#<member>]`. */
124
132
  export declare function initFromCommand(options: InitFromOptions): Promise<InitFromResult>;
133
+ /** A local repository is recorded relative to the project, so the lock does not name this machine's paths. */
134
+ export declare function portableUrl(url: string, targetDir: string): string;
125
135
  export interface TemplateLockInput {
126
136
  targetDir: string;
127
137
  lexicon: string;
@@ -1 +1 @@
1
- {"version":3,"file":"lineage-init.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAwBH,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,GAAG,EAAE,MAAM,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AY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,mHAAmH;IACnH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,GAAG,IAAI,CA0BzE"}
@@ -83,6 +83,65 @@ declare const ManualStepSchema: z.ZodObject<{
83
83
  upstream: z.ZodNullable<z.ZodString>;
84
84
  }, z.core.$strict>;
85
85
  export type ManualStep = z.infer<typeof ManualStepSchema>;
86
+ /**
87
+ * How a scope got its lineage from `chant workspace adopt-lineage` (#2551, D5,
88
+ * D9, requirement P7), rather than from `chant init`.
89
+ *
90
+ * - `by: "files"`: the scope had no lineage. Its files were matched against
91
+ * the template's versions, and the history before the lock is vouched for
92
+ * by an exact commit range, `commits.to` and every commit before it. The
93
+ * range is the one `.chant/trust.json` lists under `adopted`; once that
94
+ * entry is at the base revision, an admin has admitted it, and the scope
95
+ * reads as provenance `adopted` (D5). Until then it reads as `unattested`.
96
+ * - `by: "lineage"`: the scope had a directory lineage (#2647), and it was
97
+ * moved onto a git source whose files at the chosen ref reproduce every hash
98
+ * the lock recorded. The merge base is unchanged, so no history needs
99
+ * vouching for, and `previous` keeps the source it replaced.
100
+ */
101
+ declare const AdoptionSchema: z.ZodObject<{
102
+ by: z.ZodEnum<{
103
+ files: "files";
104
+ lineage: "lineage";
105
+ }>;
106
+ commits: z.ZodObject<{
107
+ to: z.ZodString;
108
+ }, z.core.$strict>;
109
+ match: z.ZodObject<{
110
+ files: z.ZodNumber;
111
+ identical: z.ZodNumber;
112
+ edited: z.ZodNumber;
113
+ missing: z.ZodNumber;
114
+ }, z.core.$strict>;
115
+ index: z.ZodEnum<{
116
+ cache: "cache";
117
+ computed: "computed";
118
+ }>;
119
+ previous: z.ZodOptional<z.ZodObject<{
120
+ template: z.ZodString;
121
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
122
+ type: z.ZodLiteral<"git">;
123
+ repo: z.ZodString;
124
+ url: z.ZodString;
125
+ path: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strict>, z.ZodObject<{
127
+ type: z.ZodLiteral<"dir">;
128
+ path: z.ZodString;
129
+ member: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strict>, z.ZodObject<{
131
+ type: z.ZodLiteral<"lexicon">;
132
+ lexicon: z.ZodString;
133
+ template: z.ZodString;
134
+ }, z.core.$strict>, z.ZodObject<{
135
+ type: z.ZodLiteral<"local">;
136
+ path: z.ZodString;
137
+ }, z.core.$strict>, z.ZodObject<{
138
+ type: z.ZodLiteral<"archive">;
139
+ url: z.ZodString;
140
+ subpath: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strict>], "type">;
142
+ }, z.core.$strict>>;
143
+ }, z.core.$strict>;
144
+ export type Adoption = z.infer<typeof AdoptionSchema>;
86
145
  declare const LineageSchema: z.ZodObject<{
87
146
  kind: z.ZodEnum<{
88
147
  template: "template";
@@ -121,6 +180,7 @@ declare const LineageSchema: z.ZodObject<{
121
180
  chant: z.ZodOptional<z.ZodString>;
122
181
  }, z.core.$strict>>;
123
182
  parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
183
+ hostBound: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
124
184
  repinned: z.ZodOptional<z.ZodArray<z.ZodObject<{
125
185
  record: z.ZodString;
126
186
  paths: z.ZodArray<z.ZodString>;
@@ -145,6 +205,49 @@ declare const LineageSchema: z.ZodObject<{
145
205
  }>;
146
206
  upstream: z.ZodNullable<z.ZodString>;
147
207
  }, z.core.$strict>>;
208
+ adoption: z.ZodOptional<z.ZodObject<{
209
+ by: z.ZodEnum<{
210
+ files: "files";
211
+ lineage: "lineage";
212
+ }>;
213
+ commits: z.ZodObject<{
214
+ to: z.ZodString;
215
+ }, z.core.$strict>;
216
+ match: z.ZodObject<{
217
+ files: z.ZodNumber;
218
+ identical: z.ZodNumber;
219
+ edited: z.ZodNumber;
220
+ missing: z.ZodNumber;
221
+ }, z.core.$strict>;
222
+ index: z.ZodEnum<{
223
+ cache: "cache";
224
+ computed: "computed";
225
+ }>;
226
+ previous: z.ZodOptional<z.ZodObject<{
227
+ template: z.ZodString;
228
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
229
+ type: z.ZodLiteral<"git">;
230
+ repo: z.ZodString;
231
+ url: z.ZodString;
232
+ path: z.ZodOptional<z.ZodString>;
233
+ }, z.core.$strict>, z.ZodObject<{
234
+ type: z.ZodLiteral<"dir">;
235
+ path: z.ZodString;
236
+ member: z.ZodOptional<z.ZodString>;
237
+ }, z.core.$strict>, z.ZodObject<{
238
+ type: z.ZodLiteral<"lexicon">;
239
+ lexicon: z.ZodString;
240
+ template: z.ZodString;
241
+ }, z.core.$strict>, z.ZodObject<{
242
+ type: z.ZodLiteral<"local">;
243
+ path: z.ZodString;
244
+ }, z.core.$strict>, z.ZodObject<{
245
+ type: z.ZodLiteral<"archive">;
246
+ url: z.ZodString;
247
+ subpath: z.ZodOptional<z.ZodString>;
248
+ }, z.core.$strict>], "type">;
249
+ }, z.core.$strict>>;
250
+ }, z.core.$strict>>;
148
251
  }, z.core.$strict>;
149
252
  export type Lineage = z.infer<typeof LineageSchema>;
150
253
  declare const LockSchema: z.ZodObject<{
@@ -187,6 +290,7 @@ declare const LockSchema: z.ZodObject<{
187
290
  chant: z.ZodOptional<z.ZodString>;
188
291
  }, z.core.$strict>>;
189
292
  parameters: z.ZodRecord<z.ZodString, z.ZodUnknown>;
293
+ hostBound: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
190
294
  repinned: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
295
  record: z.ZodString;
192
296
  paths: z.ZodArray<z.ZodString>;
@@ -211,6 +315,49 @@ declare const LockSchema: z.ZodObject<{
211
315
  }>;
212
316
  upstream: z.ZodNullable<z.ZodString>;
213
317
  }, z.core.$strict>>;
318
+ adoption: z.ZodOptional<z.ZodObject<{
319
+ by: z.ZodEnum<{
320
+ files: "files";
321
+ lineage: "lineage";
322
+ }>;
323
+ commits: z.ZodObject<{
324
+ to: z.ZodString;
325
+ }, z.core.$strict>;
326
+ match: z.ZodObject<{
327
+ files: z.ZodNumber;
328
+ identical: z.ZodNumber;
329
+ edited: z.ZodNumber;
330
+ missing: z.ZodNumber;
331
+ }, z.core.$strict>;
332
+ index: z.ZodEnum<{
333
+ cache: "cache";
334
+ computed: "computed";
335
+ }>;
336
+ previous: z.ZodOptional<z.ZodObject<{
337
+ template: z.ZodString;
338
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
339
+ type: z.ZodLiteral<"git">;
340
+ repo: z.ZodString;
341
+ url: z.ZodString;
342
+ path: z.ZodOptional<z.ZodString>;
343
+ }, z.core.$strict>, z.ZodObject<{
344
+ type: z.ZodLiteral<"dir">;
345
+ path: z.ZodString;
346
+ member: z.ZodOptional<z.ZodString>;
347
+ }, z.core.$strict>, z.ZodObject<{
348
+ type: z.ZodLiteral<"lexicon">;
349
+ lexicon: z.ZodString;
350
+ template: z.ZodString;
351
+ }, z.core.$strict>, z.ZodObject<{
352
+ type: z.ZodLiteral<"local">;
353
+ path: z.ZodString;
354
+ }, z.core.$strict>, z.ZodObject<{
355
+ type: z.ZodLiteral<"archive">;
356
+ url: z.ZodString;
357
+ subpath: z.ZodOptional<z.ZodString>;
358
+ }, z.core.$strict>], "type">;
359
+ }, z.core.$strict>>;
360
+ }, z.core.$strict>>;
214
361
  }, z.core.$strict>>;
215
362
  }, z.core.$strict>;
216
363
  export type LineageLock = z.infer<typeof LockSchema>;
@@ -1 +1 @@
1
- {"version":3,"file":"lineage-lock.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAkC,KAAK,aAAa,EAAE,MA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14 +149,26 @@ export interface MigrationPlan {
149
149
  /**
150
150
  * The migrations that take `lineage` from its version to `targetRef`, in order.
151
151
  *
152
+ * With `switchTo`, the upgrade also moves the scope to another template, the
153
+ * one with that id (#2551). The chain then starts with a bridge migration: one
154
+ * the new template ships whose `from.template` names the scope's current
155
+ * template and whose `from.versions` accepts the scope's version. Its `to` is a
156
+ * version of the new template, and the new template's own migrations carry on
157
+ * from there. This is how a fork-born scope, adopted against the fork, comes
158
+ * forward onto the template the fork came from.
159
+ *
152
160
  * Refused, with a {@link MigrationError}:
153
- * - a target below the scope's version;
161
+ * - a target below the scope's version (without a switch: versions of two
162
+ * templates do not compare);
154
163
  * - a pending migration when either end of the upgrade is not a version, so
155
164
  * no chain can be computed;
156
165
  * - a gap: a migration in range whose `from` does not accept the version the
157
- * scope has reached by then.
166
+ * scope has reached by then;
167
+ * - a switch with no bridge from the scope's version, when the new template
168
+ * has migrations of its own, since the scope's place in its history is
169
+ * then unknown.
158
170
  */
159
- export declare function planMigrations(lineage: Lineage, targetRef: string | undefined, available: LoadedMigration[]): MigrationPlan;
171
+ export declare function planMigrations(lineage: Lineage, targetRef: string | undefined, available: LoadedMigration[], switchTo?: string): MigrationPlan;
160
172
  export interface RunMigrationOptions {
161
173
  /** The scope directory in the staging worktree. */
162
174
  dir: string;
@@ -1 +1 @@
1
- {"version":3,"file":"lineage-migrations.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAA6F,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5I,mFAAmF;AACnF,eAAO,MAAM,cAAc,sBAAsB,CAAC;AAUlD,4EAA4E;AAC5E,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;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C7B,+EAA+E;IAC/E,SAAS,EAAE,OAAO,CAAC;IACnB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,yGAAyG;IACzG,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC7C;AAED,kFAAkF;AAClF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAOpF;AAED,qFAAqF;AACrF,wBAAsB,YAAY,CAAC,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B/F"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The provenance of an adopted lineage (#2551, D5, requirement P7).
3
+ *
4
+ * `chant workspace adopt-lineage` records the commit it adopted at, and adds
5
+ * the range ending there to `.chant/trust.json`. That file is policy, always
6
+ * read at the base revision (./trust/policy.ts), so an adoption counts only
7
+ * once its range is in the policy at base, which takes a protected write by
8
+ * an admin. Until then the scope reads as `unattested`, like any lineage
9
+ * chant wrote itself.
10
+ */
11
+ import type { Lineage } from "./lineage-lock.js";
12
+ export interface LineageProvenance {
13
+ level: "adopted" | "unattested";
14
+ reason: string;
15
+ }
16
+ /** Null for a lineage that makes no adoption claim: one chant wrote at init, vendor or upgrade, or a directory lineage moved onto git. */
17
+ export declare function lineageProvenance(root: string, lineage: Lineage): LineageProvenance | null;
18
+ //# sourceMappingURL=lineage-provenance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineage-provenance.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-provenance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAG9C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,SAAS,GAAG,YAAY,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,0IAA0I;AAC1I,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CAkB1F"}
@@ -19,6 +19,8 @@ export interface UpgradeCommandOptions {
19
19
  root: string;
20
20
  scope?: string;
21
21
  to?: string;
22
+ /** Move the scope to another template (#2551). */
23
+ source?: string;
22
24
  allowCode?: boolean;
23
25
  dryRun?: boolean;
24
26
  output?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"lineage-upgrade-cli.d.ts","sourceRoot":"","sources":["../../src/workspace/lineage-upgrade-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAyE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAGxH,OAAO,EAAoD,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAI3H,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iBAAiB;IACjB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9F,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,cAAc,CAAC;IACxB,QAAQ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