@vedprakash-m/tenet 0.0.0-stage → 0.1.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 (924) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +104 -2
  3. package/dist/cli.d.ts +53 -0
  4. package/dist/cli.js +389 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/bless.d.ts +2 -0
  7. package/dist/commands/bless.js +27 -0
  8. package/dist/commands/bless.js.map +1 -0
  9. package/dist/commands/board.d.ts +32 -0
  10. package/dist/commands/board.js +31 -0
  11. package/dist/commands/board.js.map +1 -0
  12. package/dist/commands/check.d.ts +2 -0
  13. package/dist/commands/check.js +35 -0
  14. package/dist/commands/check.js.map +1 -0
  15. package/dist/commands/context.d.ts +45 -0
  16. package/dist/commands/context.js +49 -0
  17. package/dist/commands/context.js.map +1 -0
  18. package/dist/commands/doctor.d.ts +8 -0
  19. package/dist/commands/doctor.js +47 -0
  20. package/dist/commands/doctor.js.map +1 -0
  21. package/dist/commands/fix.d.ts +2 -0
  22. package/dist/commands/fix.js +25 -0
  23. package/dist/commands/fix.js.map +1 -0
  24. package/dist/commands/index.d.ts +12 -0
  25. package/dist/commands/index.js +13 -0
  26. package/dist/commands/index.js.map +1 -0
  27. package/dist/commands/init.d.ts +11 -0
  28. package/dist/commands/init.js +215 -0
  29. package/dist/commands/init.js.map +1 -0
  30. package/dist/commands/onboard.d.ts +45 -0
  31. package/dist/commands/onboard.js +66 -0
  32. package/dist/commands/onboard.js.map +1 -0
  33. package/dist/commands/remove.d.ts +8 -0
  34. package/dist/commands/remove.js +56 -0
  35. package/dist/commands/remove.js.map +1 -0
  36. package/dist/commands/split.d.ts +2 -0
  37. package/dist/commands/split.js +20 -0
  38. package/dist/commands/split.js.map +1 -0
  39. package/dist/commands/upgrade.d.ts +8 -0
  40. package/dist/commands/upgrade.js +69 -0
  41. package/dist/commands/upgrade.js.map +1 -0
  42. package/dist/commands/verify.d.ts +33 -0
  43. package/dist/commands/verify.js +147 -0
  44. package/dist/commands/verify.js.map +1 -0
  45. package/dist/context/index.d.ts +61 -0
  46. package/dist/context/index.js +401 -0
  47. package/dist/context/index.js.map +1 -0
  48. package/dist/core/clock.d.ts +3 -0
  49. package/dist/core/clock.js +16 -0
  50. package/dist/core/clock.js.map +1 -0
  51. package/dist/core/commands.d.ts +38 -0
  52. package/dist/core/commands.js +2 -0
  53. package/dist/core/commands.js.map +1 -0
  54. package/dist/core/fs.d.ts +7 -0
  55. package/dist/core/fs.js +97 -0
  56. package/dist/core/fs.js.map +1 -0
  57. package/dist/core/git.d.ts +11 -0
  58. package/dist/core/git.js +223 -0
  59. package/dist/core/git.js.map +1 -0
  60. package/dist/core/hash.d.ts +6 -0
  61. package/dist/core/hash.js +123 -0
  62. package/dist/core/hash.js.map +1 -0
  63. package/dist/core/messages.d.ts +276 -0
  64. package/dist/core/messages.js +289 -0
  65. package/dist/core/messages.js.map +1 -0
  66. package/dist/core/output.d.ts +22 -0
  67. package/dist/core/output.js +78 -0
  68. package/dist/core/output.js.map +1 -0
  69. package/dist/core/schema.d.ts +14 -0
  70. package/dist/core/schema.js +138 -0
  71. package/dist/core/schema.js.map +1 -0
  72. package/dist/core/yaml.d.ts +1 -0
  73. package/dist/core/yaml.js +16 -0
  74. package/dist/core/yaml.js.map +1 -0
  75. package/dist/install/doctor.d.ts +3 -0
  76. package/dist/install/doctor.js +365 -0
  77. package/dist/install/doctor.js.map +1 -0
  78. package/dist/install/environment.d.ts +4 -0
  79. package/dist/install/environment.js +47 -0
  80. package/dist/install/environment.js.map +1 -0
  81. package/dist/install/hosts.d.ts +5 -0
  82. package/dist/install/hosts.js +105 -0
  83. package/dist/install/hosts.js.map +1 -0
  84. package/dist/install/init.d.ts +2 -0
  85. package/dist/install/init.js +80 -0
  86. package/dist/install/init.js.map +1 -0
  87. package/dist/install/integrity.d.ts +24 -0
  88. package/dist/install/integrity.js +200 -0
  89. package/dist/install/integrity.js.map +1 -0
  90. package/dist/install/manifest.d.ts +27 -0
  91. package/dist/install/manifest.js +276 -0
  92. package/dist/install/manifest.js.map +1 -0
  93. package/dist/install/preflight.d.ts +3 -0
  94. package/dist/install/preflight.js +558 -0
  95. package/dist/install/preflight.js.map +1 -0
  96. package/dist/install/remove.d.ts +2 -0
  97. package/dist/install/remove.js +668 -0
  98. package/dist/install/remove.js.map +1 -0
  99. package/dist/install/types.d.ts +303 -0
  100. package/dist/install/types.js +2 -0
  101. package/dist/install/types.js.map +1 -0
  102. package/dist/install/upgrade.d.ts +2 -0
  103. package/dist/install/upgrade.js +307 -0
  104. package/dist/install/upgrade.js.map +1 -0
  105. package/dist/install/writes.d.ts +15 -0
  106. package/dist/install/writes.js +1200 -0
  107. package/dist/install/writes.js.map +1 -0
  108. package/dist/mcp/index.d.ts +13 -0
  109. package/dist/mcp/index.js +437 -0
  110. package/dist/mcp/index.js.map +1 -0
  111. package/dist/onboard/assignment.d.ts +22 -0
  112. package/dist/onboard/assignment.js +102 -0
  113. package/dist/onboard/assignment.js.map +1 -0
  114. package/dist/onboard/bless.d.ts +104 -0
  115. package/dist/onboard/bless.js +729 -0
  116. package/dist/onboard/bless.js.map +1 -0
  117. package/dist/onboard/card.d.ts +31 -0
  118. package/dist/onboard/card.js +175 -0
  119. package/dist/onboard/card.js.map +1 -0
  120. package/dist/onboard/findings.d.ts +3 -0
  121. package/dist/onboard/findings.js +185 -0
  122. package/dist/onboard/findings.js.map +1 -0
  123. package/dist/onboard/inventory.d.ts +21 -0
  124. package/dist/onboard/inventory.js +302 -0
  125. package/dist/onboard/inventory.js.map +1 -0
  126. package/dist/onboard/preflight.d.ts +32 -0
  127. package/dist/onboard/preflight.js +156 -0
  128. package/dist/onboard/preflight.js.map +1 -0
  129. package/dist/onboard/refresh.d.ts +28 -0
  130. package/dist/onboard/refresh.js +65 -0
  131. package/dist/onboard/refresh.js.map +1 -0
  132. package/dist/policy/errors.d.ts +12 -0
  133. package/dist/policy/errors.js +25 -0
  134. package/dist/policy/errors.js.map +1 -0
  135. package/dist/policy/index.d.ts +4 -0
  136. package/dist/policy/index.js +4 -0
  137. package/dist/policy/index.js.map +1 -0
  138. package/dist/policy/kit.d.ts +12 -0
  139. package/dist/policy/kit.js +162 -0
  140. package/dist/policy/kit.js.map +1 -0
  141. package/dist/policy/load.d.ts +15 -0
  142. package/dist/policy/load.js +415 -0
  143. package/dist/policy/load.js.map +1 -0
  144. package/dist/policy/selectors.d.ts +2 -0
  145. package/dist/policy/selectors.js +43 -0
  146. package/dist/policy/selectors.js.map +1 -0
  147. package/dist/policy/types.d.ts +40 -0
  148. package/dist/policy/types.js +2 -0
  149. package/dist/policy/types.js.map +1 -0
  150. package/dist/reports/acceptance.d.ts +2 -0
  151. package/dist/reports/acceptance.js +79 -0
  152. package/dist/reports/acceptance.js.map +1 -0
  153. package/dist/reports/declared.d.ts +6 -0
  154. package/dist/reports/declared.js +114 -0
  155. package/dist/reports/declared.js.map +1 -0
  156. package/dist/reports/errors.d.ts +8 -0
  157. package/dist/reports/errors.js +12 -0
  158. package/dist/reports/errors.js.map +1 -0
  159. package/dist/reports/index.d.ts +8 -0
  160. package/dist/reports/index.js +8 -0
  161. package/dist/reports/index.js.map +1 -0
  162. package/dist/reports/items.d.ts +6 -0
  163. package/dist/reports/items.js +85 -0
  164. package/dist/reports/items.js.map +1 -0
  165. package/dist/reports/read-types.d.ts +7 -0
  166. package/dist/reports/read-types.js +2 -0
  167. package/dist/reports/read-types.js.map +1 -0
  168. package/dist/reports/read.d.ts +3 -0
  169. package/dist/reports/read.js +96 -0
  170. package/dist/reports/read.js.map +1 -0
  171. package/dist/reports/registry.d.ts +32 -0
  172. package/dist/reports/registry.js +372 -0
  173. package/dist/reports/registry.js.map +1 -0
  174. package/dist/reports/scan.d.ts +23 -0
  175. package/dist/reports/scan.js +406 -0
  176. package/dist/reports/scan.js.map +1 -0
  177. package/dist/reports/tags.d.ts +4 -0
  178. package/dist/reports/tags.js +53 -0
  179. package/dist/reports/tags.js.map +1 -0
  180. package/dist/reports/types.d.ts +90 -0
  181. package/dist/reports/types.js +2 -0
  182. package/dist/reports/types.js.map +1 -0
  183. package/dist/reports/weakening.d.ts +5 -0
  184. package/dist/reports/weakening.js +260 -0
  185. package/dist/reports/weakening.js.map +1 -0
  186. package/dist/sdk.d.ts +8 -0
  187. package/dist/sdk.js +8 -0
  188. package/dist/sdk.js.map +1 -0
  189. package/dist/specs/anchors.d.ts +44 -0
  190. package/dist/specs/anchors.js +171 -0
  191. package/dist/specs/anchors.js.map +1 -0
  192. package/dist/specs/check.d.ts +19 -0
  193. package/dist/specs/check.js +656 -0
  194. package/dist/specs/check.js.map +1 -0
  195. package/dist/specs/citations.d.ts +5 -0
  196. package/dist/specs/citations.js +65 -0
  197. package/dist/specs/citations.js.map +1 -0
  198. package/dist/specs/deltas.d.ts +10 -0
  199. package/dist/specs/deltas.js +110 -0
  200. package/dist/specs/deltas.js.map +1 -0
  201. package/dist/specs/fix.d.ts +11 -0
  202. package/dist/specs/fix.js +583 -0
  203. package/dist/specs/fix.js.map +1 -0
  204. package/dist/specs/flags.d.ts +25 -0
  205. package/dist/specs/flags.js +100 -0
  206. package/dist/specs/flags.js.map +1 -0
  207. package/dist/specs/ladder.d.ts +13 -0
  208. package/dist/specs/ladder.js +105 -0
  209. package/dist/specs/ladder.js.map +1 -0
  210. package/dist/specs/parse.d.ts +58 -0
  211. package/dist/specs/parse.js +565 -0
  212. package/dist/specs/parse.js.map +1 -0
  213. package/dist/specs/sections.d.ts +2 -0
  214. package/dist/specs/sections.js +36 -0
  215. package/dist/specs/sections.js.map +1 -0
  216. package/dist/specs/split.d.ts +8 -0
  217. package/dist/specs/split.js +264 -0
  218. package/dist/specs/split.js.map +1 -0
  219. package/dist/specs/touched.d.ts +11 -0
  220. package/dist/specs/touched.js +376 -0
  221. package/dist/specs/touched.js.map +1 -0
  222. package/dist/types/generated.d.ts +547 -0
  223. package/dist/types/generated.js +4 -0
  224. package/dist/types/generated.js.map +1 -0
  225. package/dist/verify/bundle.d.ts +104 -0
  226. package/dist/verify/bundle.js +212 -0
  227. package/dist/verify/bundle.js.map +1 -0
  228. package/dist/verify/card.d.ts +7 -0
  229. package/dist/verify/card.js +105 -0
  230. package/dist/verify/card.js.map +1 -0
  231. package/dist/verify/forge.d.ts +56 -0
  232. package/dist/verify/forge.js +173 -0
  233. package/dist/verify/forge.js.map +1 -0
  234. package/dist/verify/record.d.ts +63 -0
  235. package/dist/verify/record.js +539 -0
  236. package/dist/verify/record.js.map +1 -0
  237. package/dist/verify/records.d.ts +33 -0
  238. package/dist/verify/records.js +107 -0
  239. package/dist/verify/records.js.map +1 -0
  240. package/dist/verify/run-checks.d.ts +22 -0
  241. package/dist/verify/run-checks.js +149 -0
  242. package/dist/verify/run-checks.js.map +1 -0
  243. package/dist/views/specs-board.d.ts +43 -0
  244. package/dist/views/specs-board.js +427 -0
  245. package/dist/views/specs-board.js.map +1 -0
  246. package/kit/CHANGELOG.md +42 -0
  247. package/kit/README.md +18 -0
  248. package/kit/TENET.md +83 -0
  249. package/kit/agents/drafter.md +78 -0
  250. package/kit/agents/spec-reviewer.md +75 -0
  251. package/kit/defaults/tenet.yaml +25 -0
  252. package/kit/hooks/pre-commit +7 -0
  253. package/kit/packs/minimal/pack.yaml +54 -0
  254. package/kit/practices/default.md +6 -0
  255. package/kit/schemas/agent-card.json +280 -0
  256. package/kit/schemas/assignment.json +128 -0
  257. package/kit/schemas/board.json +563 -0
  258. package/kit/schemas/bundle.json +148 -0
  259. package/kit/schemas/finding.json +59 -0
  260. package/kit/schemas/interview.json +48 -0
  261. package/kit/schemas/inventory.json +409 -0
  262. package/kit/schemas/lock.json +37 -0
  263. package/kit/schemas/manifest-local.json +31 -0
  264. package/kit/schemas/manifest.json +109 -0
  265. package/kit/schemas/pack.json +190 -0
  266. package/kit/schemas/packet.json +94 -0
  267. package/kit/schemas/proof-card.json +526 -0
  268. package/kit/schemas/results/bless.json +14 -0
  269. package/kit/schemas/results/board.json +169 -0
  270. package/kit/schemas/results/check.json +42 -0
  271. package/kit/schemas/results/context.json +169 -0
  272. package/kit/schemas/results/doctor.json +22 -0
  273. package/kit/schemas/results/fix.json +33 -0
  274. package/kit/schemas/results/init.json +102 -0
  275. package/kit/schemas/results/mcp.json +173 -0
  276. package/kit/schemas/results/onboard.json +72 -0
  277. package/kit/schemas/results/remove.json +34 -0
  278. package/kit/schemas/results/split.json +21 -0
  279. package/kit/schemas/results/upgrade.json +23 -0
  280. package/kit/schemas/results/verify.json +34 -0
  281. package/kit/schemas/spec-front-matter.json +218 -0
  282. package/kit/schemas/tenet-yaml.json +356 -0
  283. package/kit/schemas/test-report.json +77 -0
  284. package/kit/skills/draft-specs/SKILL.md +38 -0
  285. package/kit/skills/review-with-findings/SKILL.md +21 -0
  286. package/kit/skills/work-a-change/SKILL.md +30 -0
  287. package/kit/templates/agents-block.md +47 -0
  288. package/kit/templates/design.md +43 -0
  289. package/kit/templates/escalation.md +34 -0
  290. package/kit/templates/experience.md +33 -0
  291. package/kit/templates/intent.md +56 -0
  292. package/kit/templates/plan.md +35 -0
  293. package/kit/templates/pull-request.md +25 -0
  294. package/kit/templates/requirements.md +43 -0
  295. package/kit/templates/vision.md +69 -0
  296. package/kit/workflows/existing-ci-step.yml +83 -0
  297. package/kit/workflows/tenet-tests.yml +88 -0
  298. package/kit/workflows/tenet.yml +87 -0
  299. package/package.json +67 -4
  300. package/pkg/conformance/alg-02/README.md +18 -0
  301. package/pkg/conformance/alg-02/n01-duplicate-slug/expected.json +5 -0
  302. package/pkg/conformance/alg-02/n01-duplicate-slug/input.json +5 -0
  303. package/pkg/conformance/alg-02/n02-ambiguous-rename/expected.json +12 -0
  304. package/pkg/conformance/alg-02/n02-ambiguous-rename/input.json +20 -0
  305. package/pkg/conformance/alg-02/n03-missing-front/expected.json +12 -0
  306. package/pkg/conformance/alg-02/n03-missing-front/input.json +5 -0
  307. package/pkg/conformance/alg-02/n04-invalid-origin/expected.json +4 -0
  308. package/pkg/conformance/alg-02/n04-invalid-origin/input.json +9 -0
  309. package/pkg/conformance/alg-02/p01-leading-preamble/expected.json +15 -0
  310. package/pkg/conformance/alg-02/p01-leading-preamble/input.json +5 -0
  311. package/pkg/conformance/alg-02/p02-four-backtick-fence/expected.json +11 -0
  312. package/pkg/conformance/alg-02/p02-four-backtick-fence/input.json +5 -0
  313. package/pkg/conformance/alg-02/p03-unicode-and-empty-slug/expected.json +14 -0
  314. package/pkg/conformance/alg-02/p03-unicode-and-empty-slug/input.json +5 -0
  315. package/pkg/conformance/alg-02/p04-normalized-bodies/expected.json +6 -0
  316. package/pkg/conformance/alg-02/p04-normalized-bodies/input.json +7 -0
  317. package/pkg/conformance/alg-02/p05-rename-digest/expected.json +10 -0
  318. package/pkg/conformance/alg-02/p05-rename-digest/input.json +16 -0
  319. package/pkg/conformance/alg-02/p06-requirement-prefix/expected.json +14 -0
  320. package/pkg/conformance/alg-02/p06-requirement-prefix/input.json +7 -0
  321. package/pkg/conformance/alg-03/README.md +20 -0
  322. package/pkg/conformance/alg-03/n01-ambiguous-relocation/expected.json +3 -0
  323. package/pkg/conformance/alg-03/n01-ambiguous-relocation/input.json +8 -0
  324. package/pkg/conformance/alg-03/n02-missing-source/expected.json +5 -0
  325. package/pkg/conformance/alg-03/n02-missing-source/input.json +12 -0
  326. package/pkg/conformance/alg-03/n03-edited-intent/expected.json +5 -0
  327. package/pkg/conformance/alg-03/n03-edited-intent/input.json +14 -0
  328. package/pkg/conformance/alg-03/n04-unblessed-stale-metadata/expected.json +3 -0
  329. package/pkg/conformance/alg-03/n04-unblessed-stale-metadata/input.json +12 -0
  330. package/pkg/conformance/alg-03/n05-ambiguous-moved-anchor/expected.json +5 -0
  331. package/pkg/conformance/alg-03/n05-ambiguous-moved-anchor/input.json +14 -0
  332. package/pkg/conformance/alg-03/p01-path-anchor/expected.json +8 -0
  333. package/pkg/conformance/alg-03/p01-path-anchor/input.json +15 -0
  334. package/pkg/conformance/alg-03/p02-peer-test-anchor/expected.json +8 -0
  335. package/pkg/conformance/alg-03/p02-peer-test-anchor/input.json +15 -0
  336. package/pkg/conformance/alg-03/p03-doc-anchor/expected.json +8 -0
  337. package/pkg/conformance/alg-03/p03-doc-anchor/input.json +15 -0
  338. package/pkg/conformance/alg-03/p04-unique-relocation/expected.json +4 -0
  339. package/pkg/conformance/alg-03/p04-unique-relocation/input.json +8 -0
  340. package/pkg/conformance/alg-03/p05-clean-moved-anchor/expected.json +3 -0
  341. package/pkg/conformance/alg-03/p05-clean-moved-anchor/input.json +14 -0
  342. package/pkg/conformance/alg-03/p06-owner-precedence/expected.json +5 -0
  343. package/pkg/conformance/alg-03/p06-owner-precedence/input.json +7 -0
  344. package/pkg/conformance/alg-03/p07-owner-last-match/expected.json +6 -0
  345. package/pkg/conformance/alg-03/p07-owner-last-match/input.json +6 -0
  346. package/pkg/conformance/alg-04/README.md +19 -0
  347. package/pkg/conformance/alg-04/n01-missing-file/expected.json +10 -0
  348. package/pkg/conformance/alg-04/n01-missing-file/input.json +6 -0
  349. package/pkg/conformance/alg-04/n02-backward-range/expected.json +10 -0
  350. package/pkg/conformance/alg-04/n02-backward-range/input.json +8 -0
  351. package/pkg/conformance/alg-04/n03-missing-heading/expected.json +10 -0
  352. package/pkg/conformance/alg-04/n03-missing-heading/input.json +8 -0
  353. package/pkg/conformance/alg-04/n04-reversed-test-segments/expected.json +10 -0
  354. package/pkg/conformance/alg-04/n04-reversed-test-segments/input.json +8 -0
  355. package/pkg/conformance/alg-04/n05-out-of-range/expected.json +10 -0
  356. package/pkg/conformance/alg-04/n05-out-of-range/input.json +8 -0
  357. package/pkg/conformance/alg-04/p01-single-line/expected.json +3 -0
  358. package/pkg/conformance/alg-04/p01-single-line/input.json +8 -0
  359. package/pkg/conformance/alg-04/p02-full-range/expected.json +3 -0
  360. package/pkg/conformance/alg-04/p02-full-range/input.json +8 -0
  361. package/pkg/conformance/alg-04/p03-doc-heading/expected.json +3 -0
  362. package/pkg/conformance/alg-04/p03-doc-heading/input.json +8 -0
  363. package/pkg/conformance/alg-04/p04-nested-test/expected.json +3 -0
  364. package/pkg/conformance/alg-04/p04-nested-test/input.json +8 -0
  365. package/pkg/conformance/alg-04/p05-python-test/expected.json +3 -0
  366. package/pkg/conformance/alg-04/p05-python-test/input.json +8 -0
  367. package/pkg/conformance/alg-04/p06-go-test/expected.json +3 -0
  368. package/pkg/conformance/alg-04/p06-go-test/input.json +8 -0
  369. package/pkg/conformance/alg-08/cases.json +263 -0
  370. package/pkg/conformance/alg-09/cases.json +95 -0
  371. package/pkg/conformance/alg-10/README.md +24 -0
  372. package/pkg/conformance/alg-10/n01-no-blessed-material/expected.json +7 -0
  373. package/pkg/conformance/alg-10/n01-no-blessed-material/input.json +23 -0
  374. package/pkg/conformance/alg-10/n02-rejected-section/expected.json +7 -0
  375. package/pkg/conformance/alg-10/n02-rejected-section/input.json +24 -0
  376. package/pkg/conformance/alg-10/n03-broken-blessed-copy/expected.json +7 -0
  377. package/pkg/conformance/alg-10/n03-broken-blessed-copy/input.json +27 -0
  378. package/pkg/conformance/alg-10/n04-local-omitted/expected.json +12 -0
  379. package/pkg/conformance/alg-10/n04-local-omitted/input.json +27 -0
  380. package/pkg/conformance/alg-10/n05-over-budget-explicit-id/expected.json +10 -0
  381. package/pkg/conformance/alg-10/n05-over-budget-explicit-id/input.json +26 -0
  382. package/pkg/conformance/alg-10/n06-unknown-method/expected.json +11 -0
  383. package/pkg/conformance/alg-10/n06-unknown-method/input.json +32 -0
  384. package/pkg/conformance/alg-10/p01-path-admitted/expected.json +14 -0
  385. package/pkg/conformance/alg-10/p01-path-admitted/input.json +26 -0
  386. package/pkg/conformance/alg-10/p02-retry-once-source-changed/expected.json +15 -0
  387. package/pkg/conformance/alg-10/p02-retry-once-source-changed/input.json +26 -0
  388. package/pkg/conformance/alg-10/p03-id-and-path-deduplicate/expected.json +13 -0
  389. package/pkg/conformance/alg-10/p03-id-and-path-deduplicate/input.json +30 -0
  390. package/pkg/conformance/alg-10/p04-include-draft-with-blessing/expected.json +17 -0
  391. package/pkg/conformance/alg-10/p04-include-draft-with-blessing/input.json +27 -0
  392. package/pkg/conformance/alg-10/p05-no-inputs-global-and-index/expected.json +16 -0
  393. package/pkg/conformance/alg-10/p05-no-inputs-global-and-index/input.json +21 -0
  394. package/pkg/conformance/alg-10/p06-checked-policy-rule/expected.json +20 -0
  395. package/pkg/conformance/alg-10/p06-checked-policy-rule/input.json +26 -0
  396. package/pkg/conformance/alg-10/p07-mcp-session/expected.json +60 -0
  397. package/pkg/conformance/alg-10/p07-mcp-session/input.json +65 -0
  398. package/pkg/conformance/alg-10/p08-applies-to-prose/expected.json +12 -0
  399. package/pkg/conformance/alg-10/p08-applies-to-prose/input.json +25 -0
  400. package/pkg/conformance/alg-10/p09-global-beyond-reserve/expected.json +14 -0
  401. package/pkg/conformance/alg-10/p09-global-beyond-reserve/input.json +27 -0
  402. package/pkg/conformance/alg-10/p10-query-case-insensitive/expected.json +11 -0
  403. package/pkg/conformance/alg-10/p10-query-case-insensitive/input.json +23 -0
  404. package/pkg/conformance/alg-11/README.md +29 -0
  405. package/pkg/conformance/alg-11/n01-no-commits-refused/expected.json +11 -0
  406. package/pkg/conformance/alg-11/n01-no-commits-refused/input.json +13 -0
  407. package/pkg/conformance/alg-11/n02-secrets-and-env-skipped/expected.json +153 -0
  408. package/pkg/conformance/alg-11/n02-secrets-and-env-skipped/input.json +20 -0
  409. package/pkg/conformance/alg-11/n03-generated-vendored-and-tests-excluded-from-size/expected.json +171 -0
  410. package/pkg/conformance/alg-11/n03-generated-vendored-and-tests-excluded-from-size/input.json +22 -0
  411. package/pkg/conformance/alg-11/n04-binary-oversize-and-onboard-exclude-skipped/expected.json +137 -0
  412. package/pkg/conformance/alg-11/n04-binary-oversize-and-onboard-exclude-skipped/input.json +20 -0
  413. package/pkg/conformance/alg-11/n05-uncommitted-worktree-source-ignored/expected.json +124 -0
  414. package/pkg/conformance/alg-11/n05-uncommitted-worktree-source-ignored/input.json +17 -0
  415. package/pkg/conformance/alg-11/p01-small-one-file-service/expected.json +145 -0
  416. package/pkg/conformance/alg-11/p01-small-one-file-service/input.json +18 -0
  417. package/pkg/conformance/alg-11/p02-four-codeowners-areas-separate/expected.json +255 -0
  418. package/pkg/conformance/alg-11/p02-four-codeowners-areas-separate/input.json +17 -0
  419. package/pkg/conformance/alg-11/p03-twenty-thousand-lines-separate/expected.json +169 -0
  420. package/pkg/conformance/alg-11/p03-twenty-thousand-lines-separate/input.json +14 -0
  421. package/pkg/conformance/alg-11/p04-merge-small-unit-into-neighbor/expected.json +186 -0
  422. package/pkg/conformance/alg-11/p04-merge-small-unit-into-neighbor/input.json +15 -0
  423. package/pkg/conformance/alg-11/p05-layout-override/expected.json +128 -0
  424. package/pkg/conformance/alg-11/p05-layout-override/input.json +14 -0
  425. package/pkg/conformance/alg-11/p06-cli-kind-and-instruction-files/expected.json +154 -0
  426. package/pkg/conformance/alg-11/p06-cli-kind-and-instruction-files/input.json +18 -0
  427. package/pkg/conformance/alg-11/p07-local-test-report-in-observations/expected.json +131 -0
  428. package/pkg/conformance/alg-11/p07-local-test-report-in-observations/input.json +17 -0
  429. package/pkg/conformance/alg-11/p08-first-findings-all-four-kinds/expected.json +207 -0
  430. package/pkg/conformance/alg-11/p08-first-findings-all-four-kinds/input.json +20 -0
  431. package/pkg/conformance/alg-14/README.md +21 -0
  432. package/pkg/conformance/alg-14/n01-draft-implements/expected.json +3 -0
  433. package/pkg/conformance/alg-14/n01-draft-implements/input.json +12 -0
  434. package/pkg/conformance/alg-14/n02-outside-replacement/expected.json +8 -0
  435. package/pkg/conformance/alg-14/n02-outside-replacement/input.json +12 -0
  436. package/pkg/conformance/alg-14/n03-insertion-at-end/expected.json +8 -0
  437. package/pkg/conformance/alg-14/n03-insertion-at-end/input.json +12 -0
  438. package/pkg/conformance/alg-14/n04-same-owner-different-rule/expected.json +3 -0
  439. package/pkg/conformance/alg-14/n04-same-owner-different-rule/input.json +16 -0
  440. package/pkg/conformance/alg-14/n05-missing-implements/expected.json +3 -0
  441. package/pkg/conformance/alg-14/n05-missing-implements/input.json +12 -0
  442. package/pkg/conformance/alg-14/p01-implements-first/expected.json +8 -0
  443. package/pkg/conformance/alg-14/p01-implements-first/input.json +14 -0
  444. package/pkg/conformance/alg-14/p02-overlapping-replacement/expected.json +8 -0
  445. package/pkg/conformance/alg-14/p02-overlapping-replacement/input.json +12 -0
  446. package/pkg/conformance/alg-14/p03-interior-insertion/expected.json +8 -0
  447. package/pkg/conformance/alg-14/p03-interior-insertion/input.json +12 -0
  448. package/pkg/conformance/alg-14/p04-text-changed/expected.json +8 -0
  449. package/pkg/conformance/alg-14/p04-text-changed/input.json +10 -0
  450. package/pkg/conformance/alg-14/p05-same-folder/expected.json +8 -0
  451. package/pkg/conformance/alg-14/p05-same-folder/input.json +14 -0
  452. package/pkg/conformance/alg-14/p06-codeowners-priority/expected.json +8 -0
  453. package/pkg/conformance/alg-14/p06-codeowners-priority/input.json +18 -0
  454. package/pkg/conformance/alg-14/p07-same-area-cap/expected.json +44 -0
  455. package/pkg/conformance/alg-14/p07-same-area-cap/input.json +14 -0
  456. package/pkg/conformance/alg-14/p08-deleted-document/expected.json +8 -0
  457. package/pkg/conformance/alg-14/p08-deleted-document/input.json +13 -0
  458. package/pkg/conformance/board/README.md +19 -0
  459. package/pkg/conformance/board/n01-no-specifications/expected.json +8 -0
  460. package/pkg/conformance/board/n01-no-specifications/expected.md +1 -0
  461. package/pkg/conformance/board/n01-no-specifications/input.json +19 -0
  462. package/pkg/conformance/board/n02-broken-citation/expected.json +14 -0
  463. package/pkg/conformance/board/n02-broken-citation/expected.md +1 -0
  464. package/pkg/conformance/board/n02-broken-citation/input.json +24 -0
  465. package/pkg/conformance/board/n03-untested-requirement/expected.json +12 -0
  466. package/pkg/conformance/board/n03-untested-requirement/expected.md +1 -0
  467. package/pkg/conformance/board/n03-untested-requirement/input.json +23 -0
  468. package/pkg/conformance/board/n04-over-budget/expected.json +14 -0
  469. package/pkg/conformance/board/n04-over-budget/expected.md +1 -0
  470. package/pkg/conformance/board/n04-over-budget/input.json +20 -0
  471. package/pkg/conformance/board/p01-fresh-draft/expected.json +22 -0
  472. package/pkg/conformance/board/p01-fresh-draft/expected.md +2 -0
  473. package/pkg/conformance/board/p01-fresh-draft/input.json +20 -0
  474. package/pkg/conformance/board/p02-half-blessed/expected.json +34 -0
  475. package/pkg/conformance/board/p02-half-blessed/expected.md +3 -0
  476. package/pkg/conformance/board/p02-half-blessed/input.json +25 -0
  477. package/pkg/conformance/board/p03-sources-changed/expected.json +18 -0
  478. package/pkg/conformance/board/p03-sources-changed/expected.md +2 -0
  479. package/pkg/conformance/board/p03-sources-changed/input.json +24 -0
  480. package/pkg/conformance/board/p04-clean-all/expected.json +17 -0
  481. package/pkg/conformance/board/p04-clean-all/expected.md +1 -0
  482. package/pkg/conformance/board/p04-clean-all/input.json +25 -0
  483. package/pkg/conformance/board/p05-clean-default/expected.json +7 -0
  484. package/pkg/conformance/board/p05-clean-default/expected.md +1 -0
  485. package/pkg/conformance/board/p05-clean-default/input.json +25 -0
  486. package/pkg/conformance/board/p06-edited-only/expected.json +18 -0
  487. package/pkg/conformance/board/p06-edited-only/expected.md +2 -0
  488. package/pkg/conformance/board/p06-edited-only/input.json +23 -0
  489. package/pkg/conformance/board/p07-ux-part-2/expected.json +47 -0
  490. package/pkg/conformance/board/p07-ux-part-2/expected.md +7 -0
  491. package/pkg/conformance/board/p07-ux-part-2/input.json +26 -0
  492. package/pkg/conformance/card/README.md +34 -0
  493. package/pkg/conformance/card/n01-no-acceptance-block/expected.json +62 -0
  494. package/pkg/conformance/card/n01-no-acceptance-block/expected.md +7 -0
  495. package/pkg/conformance/card/n01-no-acceptance-block/input.json +94 -0
  496. package/pkg/conformance/card/n02-malformed-acceptance-block/expected.json +64 -0
  497. package/pkg/conformance/card/n02-malformed-acceptance-block/expected.md +8 -0
  498. package/pkg/conformance/card/n02-malformed-acceptance-block/input.json +99 -0
  499. package/pkg/conformance/card/n03-report-missing-not-checked/expected.json +85 -0
  500. package/pkg/conformance/card/n03-report-missing-not-checked/expected.md +9 -0
  501. package/pkg/conformance/card/n03-report-missing-not-checked/input.json +97 -0
  502. package/pkg/conformance/card/n04-nonzero-exit-after-passing-report/expected.json +84 -0
  503. package/pkg/conformance/card/n04-nonzero-exit-after-passing-report/expected.md +8 -0
  504. package/pkg/conformance/card/n04-nonzero-exit-after-passing-report/input.json +99 -0
  505. package/pkg/conformance/card/n05-bundle-refused-and-records-not-kept/expected.json +83 -0
  506. package/pkg/conformance/card/n05-bundle-refused-and-records-not-kept/expected.md +8 -0
  507. package/pkg/conformance/card/n05-bundle-refused-and-records-not-kept/input.json +98 -0
  508. package/pkg/conformance/card/n06-policy-load-failure-fallback/expected.json +93 -0
  509. package/pkg/conformance/card/n06-policy-load-failure-fallback/expected.md +9 -0
  510. package/pkg/conformance/card/n06-policy-load-failure-fallback/input.json +105 -0
  511. package/pkg/conformance/card/p01-clean-pass-success/expected.json +93 -0
  512. package/pkg/conformance/card/p01-clean-pass-success/expected.md +8 -0
  513. package/pkg/conformance/card/p01-clean-pass-success/input.json +101 -0
  514. package/pkg/conformance/card/p02-no-blessed-intent-badge/expected.json +62 -0
  515. package/pkg/conformance/card/p02-no-blessed-intent-badge/expected.md +5 -0
  516. package/pkg/conformance/card/p02-no-blessed-intent-badge/input.json +92 -0
  517. package/pkg/conformance/card/p03-matrix-shards-and-retry-merge/expected.json +93 -0
  518. package/pkg/conformance/card/p03-matrix-shards-and-retry-merge/expected.md +8 -0
  519. package/pkg/conformance/card/p03-matrix-shards-and-retry-merge/input.json +137 -0
  520. package/pkg/conformance/card/p04-blessings-changed-and-requirement-deltas/expected.json +122 -0
  521. package/pkg/conformance/card/p04-blessings-changed-and-requirement-deltas/expected.md +11 -0
  522. package/pkg/conformance/card/p04-blessings-changed-and-requirement-deltas/input.json +102 -0
  523. package/pkg/conformance/card/p05-workflow-and-protected-surfaces-would-block/expected.json +88 -0
  524. package/pkg/conformance/card/p05-workflow-and-protected-surfaces-would-block/expected.md +8 -0
  525. package/pkg/conformance/card/p05-workflow-and-protected-surfaces-would-block/input.json +101 -0
  526. package/pkg/conformance/card/p06-test-weakening-would-block/expected.json +99 -0
  527. package/pkg/conformance/card/p06-test-weakening-would-block/expected.md +8 -0
  528. package/pkg/conformance/card/p06-test-weakening-would-block/input.json +101 -0
  529. package/pkg/conformance/card/p07-only-skipped-cases/expected.json +80 -0
  530. package/pkg/conformance/card/p07-only-skipped-cases/expected.md +7 -0
  531. package/pkg/conformance/card/p07-only-skipped-cases/input.json +99 -0
  532. package/pkg/conformance/card/p08-coverage-not-confirmed/expected.json +80 -0
  533. package/pkg/conformance/card/p08-coverage-not-confirmed/expected.md +7 -0
  534. package/pkg/conformance/card/p08-coverage-not-confirmed/input.json +99 -0
  535. package/pkg/conformance/check/README.md +26 -0
  536. package/pkg/conformance/check/n01-missing-citation-file/expected.json +15 -0
  537. package/pkg/conformance/check/n01-missing-citation-file/input.json +25 -0
  538. package/pkg/conformance/check/n02-citation-out-of-range/expected.json +15 -0
  539. package/pkg/conformance/check/n02-citation-out-of-range/input.json +26 -0
  540. package/pkg/conformance/check/n03-missing-citation-heading/expected.json +15 -0
  541. package/pkg/conformance/check/n03-missing-citation-heading/input.json +26 -0
  542. package/pkg/conformance/check/n04-missing-citation-test/expected.json +15 -0
  543. package/pkg/conformance/check/n04-missing-citation-test/input.json +26 -0
  544. package/pkg/conformance/check/n05-changed-blessed-copy/expected.json +12 -0
  545. package/pkg/conformance/check/n05-changed-blessed-copy/input.json +29 -0
  546. package/pkg/conformance/check/n06-missing-blessed-copy/expected.json +12 -0
  547. package/pkg/conformance/check/n06-missing-blessed-copy/input.json +27 -0
  548. package/pkg/conformance/check/n07-two-blessed-ids/expected.json +12 -0
  549. package/pkg/conformance/check/n07-two-blessed-ids/input.json +32 -0
  550. package/pkg/conformance/check/n08-uncovered-vision/expected.json +8 -0
  551. package/pkg/conformance/check/n08-uncovered-vision/input.json +27 -0
  552. package/pkg/conformance/check/n09-ci-budget-crossing/expected.json +13 -0
  553. package/pkg/conformance/check/n09-ci-budget-crossing/input.json +47 -0
  554. package/pkg/conformance/check/n10-kit-edited/expected.json +12 -0
  555. package/pkg/conformance/check/n10-kit-edited/input.json +31 -0
  556. package/pkg/conformance/check/n11-lock-version-mismatch/expected.json +13 -0
  557. package/pkg/conformance/check/n11-lock-version-mismatch/input.json +31 -0
  558. package/pkg/conformance/check/n12-local-budget-warning/expected.json +10 -0
  559. package/pkg/conformance/check/n12-local-budget-warning/input.json +29 -0
  560. package/pkg/conformance/check/p01-covered-vision/expected.json +6 -0
  561. package/pkg/conformance/check/p01-covered-vision/input.json +29 -0
  562. package/pkg/conformance/check/p02-path-citation/expected.json +6 -0
  563. package/pkg/conformance/check/p02-path-citation/input.json +26 -0
  564. package/pkg/conformance/check/p03-doc-and-test-citations/expected.json +6 -0
  565. package/pkg/conformance/check/p03-doc-and-test-citations/input.json +27 -0
  566. package/pkg/conformance/check/p04-valid-blessed-copy/expected.json +6 -0
  567. package/pkg/conformance/check/p04-valid-blessed-copy/input.json +30 -0
  568. package/pkg/conformance/check/p05-unique-across-documents/expected.json +6 -0
  569. package/pkg/conformance/check/p05-unique-across-documents/input.json +32 -0
  570. package/pkg/conformance/check/p06-matching-lock-and-kit/expected.json +6 -0
  571. package/pkg/conformance/check/p06-matching-lock-and-kit/input.json +31 -0
  572. package/pkg/conformance/install/.gitattributes +1 -0
  573. package/pkg/conformance/install/README.md +40 -0
  574. package/pkg/conformance/install/environment.json +29 -0
  575. package/pkg/conformance/install/n01-git-executable-missing/args.json +17 -0
  576. package/pkg/conformance/install/n01-git-executable-missing/before/README.md +1 -0
  577. package/pkg/conformance/install/n02-not-a-git-repository/args.json +15 -0
  578. package/pkg/conformance/install/n02-not-a-git-repository/before/README.md +1 -0
  579. package/pkg/conformance/install/n02-not-a-git-repository/expected/01-init/result.json +4 -0
  580. package/pkg/conformance/install/n03-remove-recorded-parent-path/args.json +14 -0
  581. package/pkg/conformance/install/n03-remove-recorded-parent-path/before/.tenet/manifest.json +12 -0
  582. package/pkg/conformance/install/n03-remove-recorded-parent-path/before/README.md +1 -0
  583. package/pkg/conformance/install/n03-remove-recorded-parent-path/before/tenet.yaml +1 -0
  584. package/pkg/conformance/install/n03-remove-recorded-parent-path/expected/01-remove/result.json +4 -0
  585. package/pkg/conformance/install/n04-init-symlink-outside/args.json +22 -0
  586. package/pkg/conformance/install/n04-init-symlink-outside/before/package-lock.json +15 -0
  587. package/pkg/conformance/install/n04-init-symlink-outside/before/package.json +11 -0
  588. package/pkg/conformance/install/n04-init-symlink-outside/before/src/retry.ts +1 -0
  589. package/pkg/conformance/install/n04-init-symlink-outside/before/test/retry.test.ts +3 -0
  590. package/pkg/conformance/install/n04-init-symlink-outside/expected/01-init/result.json +4 -0
  591. package/pkg/conformance/install/n05-conflicting-created-workflow/args.json +12 -0
  592. package/pkg/conformance/install/n05-conflicting-created-workflow/before/.github/workflows/tenet.yml +3 -0
  593. package/pkg/conformance/install/n05-conflicting-created-workflow/before/package-lock.json +15 -0
  594. package/pkg/conformance/install/n05-conflicting-created-workflow/before/package.json +11 -0
  595. package/pkg/conformance/install/n05-conflicting-created-workflow/before/src/retry.ts +1 -0
  596. package/pkg/conformance/install/n05-conflicting-created-workflow/before/test/retry.test.ts +3 -0
  597. package/pkg/conformance/install/n05-conflicting-created-workflow/expected/01-init/result.json +4 -0
  598. package/pkg/conformance/install/n06-interrupted-plan-drift/args.json +27 -0
  599. package/pkg/conformance/install/n06-interrupted-plan-drift/before/AGENTS.md +1 -0
  600. package/pkg/conformance/install/n06-interrupted-plan-drift/before/package-lock.json +15 -0
  601. package/pkg/conformance/install/n06-interrupted-plan-drift/before/package.json +11 -0
  602. package/pkg/conformance/install/n06-interrupted-plan-drift/before/src/retry.ts +1 -0
  603. package/pkg/conformance/install/n06-interrupted-plan-drift/before/test/retry.test.ts +3 -0
  604. package/pkg/conformance/install/n07-doctor-missing-lock/args.json +11 -0
  605. package/pkg/conformance/install/n07-doctor-missing-lock/before/README.md +1 -0
  606. package/pkg/conformance/install/n07-doctor-missing-lock/before/tenet.yaml +2 -0
  607. package/pkg/conformance/install/n07-doctor-missing-lock/expected/01-doctor/tree/README.md +1 -0
  608. package/pkg/conformance/install/n07-doctor-missing-lock/expected/01-doctor/tree/tenet.yaml +2 -0
  609. package/pkg/conformance/install/n08-preflight-declined/args.json +14 -0
  610. package/pkg/conformance/install/n08-preflight-declined/before/AGENTS.md +1 -0
  611. package/pkg/conformance/install/n08-preflight-declined/before/package-lock.json +15 -0
  612. package/pkg/conformance/install/n08-preflight-declined/before/package.json +11 -0
  613. package/pkg/conformance/install/n08-preflight-declined/before/src/retry.ts +1 -0
  614. package/pkg/conformance/install/n08-preflight-declined/before/test/retry.test.ts +3 -0
  615. package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/AGENTS.md +1 -0
  616. package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/package-lock.json +15 -0
  617. package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/package.json +11 -0
  618. package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/src/retry.ts +1 -0
  619. package/pkg/conformance/install/n08-preflight-declined/expected/01-init/tree/test/retry.test.ts +3 -0
  620. package/pkg/conformance/install/p01-empty/args.json +15 -0
  621. package/pkg/conformance/install/p01-empty/before/.gitkeep +0 -0
  622. package/pkg/conformance/install/p02-node-vitest/args.json +12 -0
  623. package/pkg/conformance/install/p02-node-vitest/before/.nvmrc +1 -0
  624. package/pkg/conformance/install/p02-node-vitest/before/package-lock.json +15 -0
  625. package/pkg/conformance/install/p02-node-vitest/before/package.json +11 -0
  626. package/pkg/conformance/install/p02-node-vitest/before/src/retry.ts +1 -0
  627. package/pkg/conformance/install/p02-node-vitest/before/test/retry.test.ts +3 -0
  628. package/pkg/conformance/install/p03-node-existing-ci/args.json +12 -0
  629. package/pkg/conformance/install/p03-node-existing-ci/before/.github/workflows/ci.yml +10 -0
  630. package/pkg/conformance/install/p03-node-existing-ci/before/package-lock.json +15 -0
  631. package/pkg/conformance/install/p03-node-existing-ci/before/package.json +11 -0
  632. package/pkg/conformance/install/p03-node-existing-ci/before/src/retry.ts +1 -0
  633. package/pkg/conformance/install/p03-node-existing-ci/before/test/retry.test.ts +3 -0
  634. package/pkg/conformance/install/p04-node-matrix/args.json +12 -0
  635. package/pkg/conformance/install/p04-node-matrix/before/.github/workflows/ci.yml +13 -0
  636. package/pkg/conformance/install/p04-node-matrix/before/package-lock.json +15 -0
  637. package/pkg/conformance/install/p04-node-matrix/before/package.json +11 -0
  638. package/pkg/conformance/install/p04-node-matrix/before/src/retry.ts +1 -0
  639. package/pkg/conformance/install/p04-node-matrix/before/test/retry.test.ts +3 -0
  640. package/pkg/conformance/install/p05-python-pytest/args.json +12 -0
  641. package/pkg/conformance/install/p05-python-pytest/before/.python-version +1 -0
  642. package/pkg/conformance/install/p05-python-pytest/before/requirements.txt +1 -0
  643. package/pkg/conformance/install/p05-python-pytest/before/tests/test_retry.py +2 -0
  644. package/pkg/conformance/install/p06-go/args.json +12 -0
  645. package/pkg/conformance/install/p06-go/before/go.mod +3 -0
  646. package/pkg/conformance/install/p06-go/before/retry_test.go +5 -0
  647. package/pkg/conformance/install/p07-existing-agents-md/args.json +12 -0
  648. package/pkg/conformance/install/p07-existing-agents-md/before/AGENTS.md +7 -0
  649. package/pkg/conformance/install/p07-existing-agents-md/before/package-lock.json +15 -0
  650. package/pkg/conformance/install/p07-existing-agents-md/before/package.json +11 -0
  651. package/pkg/conformance/install/p07-existing-agents-md/before/src/retry.ts +1 -0
  652. package/pkg/conformance/install/p07-existing-agents-md/before/test/retry.test.ts +3 -0
  653. package/pkg/conformance/install/p08-existing-mcp/args.json +12 -0
  654. package/pkg/conformance/install/p08-existing-mcp/before/.mcp.json +18 -0
  655. package/pkg/conformance/install/p08-existing-mcp/before/CLAUDE.md +1 -0
  656. package/pkg/conformance/install/p08-existing-mcp/before/package-lock.json +15 -0
  657. package/pkg/conformance/install/p08-existing-mcp/before/package.json +11 -0
  658. package/pkg/conformance/install/p08-existing-mcp/before/src/retry.ts +1 -0
  659. package/pkg/conformance/install/p08-existing-mcp/before/test/retry.test.ts +3 -0
  660. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/args.json +33 -0
  661. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/.gitattributes +1 -0
  662. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/.github/pull_request_template.md +1 -0
  663. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/.mcp.json +18 -0
  664. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/AGENTS.md +3 -0
  665. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/CLAUDE.md +3 -0
  666. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/package-lock.json +15 -0
  667. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/package.json +11 -0
  668. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/src/retry.ts +1 -0
  669. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/tenet/intent.md +3 -0
  670. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/before/test/retry.test.ts +3 -0
  671. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/.gitattributes +1 -0
  672. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/.github/pull_request_template.md +1 -0
  673. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/.mcp.json +18 -0
  674. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/AGENTS.md +3 -0
  675. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/CLAUDE.md +3 -0
  676. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/package-lock.json +15 -0
  677. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/package.json +11 -0
  678. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/src/retry.ts +1 -0
  679. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/tenet/intent.md +3 -0
  680. package/pkg/conformance/install/p09-init-repeat-upgrade-remove/expected/04-remove/tree/test/retry.test.ts +3 -0
  681. package/pkg/conformance/install/p10-remove-keeps-user-edits/args.json +24 -0
  682. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/.mcp.json +18 -0
  683. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/CLAUDE.md +1 -0
  684. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/package-lock.json +15 -0
  685. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/package.json +11 -0
  686. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/src/retry.ts +1 -0
  687. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/tenet/intent.md +1 -0
  688. package/pkg/conformance/install/p10-remove-keeps-user-edits/before/test/retry.test.ts +3 -0
  689. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/.mcp.json +16 -0
  690. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/CLAUDE.md +1 -0
  691. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/package-lock.json +15 -0
  692. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/package.json +11 -0
  693. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/src/retry.ts +1 -0
  694. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/tenet/intent.md +1 -0
  695. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/tenet.yaml +2 -0
  696. package/pkg/conformance/install/p10-remove-keeps-user-edits/expected/02-remove/tree/test/retry.test.ts +3 -0
  697. package/pkg/conformance/install/p11-interrupted-install-resumes/args.json +24 -0
  698. package/pkg/conformance/install/p11-interrupted-install-resumes/before/.mcp.json +18 -0
  699. package/pkg/conformance/install/p11-interrupted-install-resumes/before/CLAUDE.md +1 -0
  700. package/pkg/conformance/install/p11-interrupted-install-resumes/before/package-lock.json +15 -0
  701. package/pkg/conformance/install/p11-interrupted-install-resumes/before/package.json +11 -0
  702. package/pkg/conformance/install/p11-interrupted-install-resumes/before/src/retry.ts +1 -0
  703. package/pkg/conformance/install/p11-interrupted-install-resumes/before/test/retry.test.ts +3 -0
  704. package/pkg/conformance/install/p12-windows-local-host/args.json +26 -0
  705. package/pkg/conformance/install/p12-windows-local-host/before/.vscode/mcp.json +10 -0
  706. package/pkg/conformance/install/p12-windows-local-host/before/CLAUDE.md +1 -0
  707. package/pkg/conformance/install/p12-windows-local-host/before/package-lock.json +15 -0
  708. package/pkg/conformance/install/p12-windows-local-host/before/package.json +11 -0
  709. package/pkg/conformance/install/p12-windows-local-host/before/src/retry.ts +1 -0
  710. package/pkg/conformance/install/p12-windows-local-host/before/test/retry.test.ts +3 -0
  711. package/pkg/conformance/install/p13-existing-ci-with-services/args.json +12 -0
  712. package/pkg/conformance/install/p13-existing-ci-with-services/before/.github/workflows/ci.yml +16 -0
  713. package/pkg/conformance/install/p13-existing-ci-with-services/before/package-lock.json +15 -0
  714. package/pkg/conformance/install/p13-existing-ci-with-services/before/package.json +11 -0
  715. package/pkg/conformance/install/p13-existing-ci-with-services/before/src/retry.ts +1 -0
  716. package/pkg/conformance/install/p13-existing-ci-with-services/before/test/retry.test.ts +3 -0
  717. package/pkg/conformance/install/p14-reusable-workflow/args.json +12 -0
  718. package/pkg/conformance/install/p14-reusable-workflow/before/.github/workflows/ci.yml +5 -0
  719. package/pkg/conformance/install/p14-reusable-workflow/before/.github/workflows/reusable.yml +10 -0
  720. package/pkg/conformance/install/p14-reusable-workflow/before/package-lock.json +15 -0
  721. package/pkg/conformance/install/p14-reusable-workflow/before/package.json +11 -0
  722. package/pkg/conformance/install/p14-reusable-workflow/before/src/retry.ts +1 -0
  723. package/pkg/conformance/install/p14-reusable-workflow/before/test/retry.test.ts +3 -0
  724. package/pkg/conformance/install/p15-non-github-forge/args.json +15 -0
  725. package/pkg/conformance/install/p15-non-github-forge/before/package-lock.json +15 -0
  726. package/pkg/conformance/install/p15-non-github-forge/before/package.json +11 -0
  727. package/pkg/conformance/install/p15-non-github-forge/before/src/retry.ts +1 -0
  728. package/pkg/conformance/install/p15-non-github-forge/before/test/retry.test.ts +3 -0
  729. package/pkg/conformance/install/p16-vendor-fresh-clone/args.json +20 -0
  730. package/pkg/conformance/install/p16-vendor-fresh-clone/before/package-lock.json +15 -0
  731. package/pkg/conformance/install/p16-vendor-fresh-clone/before/package.json +11 -0
  732. package/pkg/conformance/install/p16-vendor-fresh-clone/before/src/retry.ts +1 -0
  733. package/pkg/conformance/install/p16-vendor-fresh-clone/before/test/retry.test.ts +3 -0
  734. package/pkg/conformance/install/p17-upgrade-pins-and-policy/args.json +24 -0
  735. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/.cursor/mcp.json +10 -0
  736. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/.mcp.json +18 -0
  737. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/CLAUDE.md +1 -0
  738. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/package-lock.json +15 -0
  739. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/package.json +11 -0
  740. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/src/retry.ts +1 -0
  741. package/pkg/conformance/install/p17-upgrade-pins-and-policy/before/test/retry.test.ts +3 -0
  742. package/pkg/conformance/install/p18-accepted-reporter-edit/args.json +15 -0
  743. package/pkg/conformance/install/p18-accepted-reporter-edit/before/.github/workflows/ci.yml +9 -0
  744. package/pkg/conformance/install/p18-accepted-reporter-edit/before/package-lock.json +15 -0
  745. package/pkg/conformance/install/p18-accepted-reporter-edit/before/package.json +11 -0
  746. package/pkg/conformance/install/p18-accepted-reporter-edit/before/src/retry.ts +1 -0
  747. package/pkg/conformance/install/p18-accepted-reporter-edit/before/test/retry.test.ts +3 -0
  748. package/pkg/conformance/scenarios/README.md +34 -0
  749. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/kit/TENET.md +3 -0
  750. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/src/retry.ts +3 -0
  751. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet/blessed/tenet__intent.md/requirements.md +1 -0
  752. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +10 -0
  753. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet/intent.md +7 -0
  754. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet.lock +7 -0
  755. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/tenet.yaml +20 -0
  756. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/before/test/retry.test.ts +2 -0
  757. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/expected/04-card.md +9 -0
  758. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/expected/04-verify.json +92 -0
  759. package/pkg/conformance/scenarios/s01-tagged-test-never-ran/steps.json +88 -0
  760. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/kit/TENET.md +3 -0
  761. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/src/retry.ts +6 -0
  762. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet/blessed/tenet__intent.md/requirements.md +2 -0
  763. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +15 -0
  764. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet/intent.md +8 -0
  765. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet.lock +7 -0
  766. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/tenet.yaml +20 -0
  767. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/before/test/retry.test.ts +2 -0
  768. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/04-card.md +9 -0
  769. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/04-verify.json +92 -0
  770. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/05-card.md +10 -0
  771. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/expected/05-verify.json +107 -0
  772. package/pkg/conformance/scenarios/s02-implements-changed-same-commit/steps.json +101 -0
  773. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/kit/TENET.md +3 -0
  774. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/tenet/intent.md +7 -0
  775. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/tenet.lock +7 -0
  776. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/before/tenet.yaml +24 -0
  777. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/expected/01-gate-fixture.json +48 -0
  778. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/expected/02-check.json +106 -0
  779. package/pkg/conformance/scenarios/s03-advisory-and-enforced-failure/steps.json +79 -0
  780. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/kit/TENET.md +3 -0
  781. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/src/retry.ts +3 -0
  782. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__specs__prd.md/requirements.md +1 -0
  783. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__specs__prd.md/requirements.md.anchors.json +7 -0
  784. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
  785. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
  786. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/plan.md +7 -0
  787. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/prd.md +7 -0
  788. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/tech-spec.md +7 -0
  789. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/specs/ux-spec.md +7 -0
  790. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet/vision.md +7 -0
  791. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet.lock +7 -0
  792. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/before/tenet.yaml +20 -0
  793. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/02-board.json +72 -0
  794. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/03-context.json +46 -0
  795. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/04-mcp.json +71 -0
  796. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/05-bless.json +13 -0
  797. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/expected/06-context-sdk.json +38 -0
  798. package/pkg/conformance/scenarios/s04-reject-edit-to-blessed-section/steps.json +98 -0
  799. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/kit/TENET.md +3 -0
  800. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/src/checkout/pay.ts +1 -0
  801. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__specs__prd.md/requirements.md +3 -0
  802. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__specs__prd.md/requirements.md.anchors.json +5 -0
  803. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
  804. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
  805. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/plan.md +7 -0
  806. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/prd.md +9 -0
  807. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/tech-spec.md +7 -0
  808. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/specs/ux-spec.md +7 -0
  809. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet/vision.md +7 -0
  810. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet.lock +7 -0
  811. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/before/tenet.yaml +20 -0
  812. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/01-context-tight.json +54 -0
  813. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/02-mcp.json +79 -0
  814. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/03-context-explicit.json +52 -0
  815. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/expected/04-context-zero.json +17 -0
  816. package/pkg/conformance/scenarios/s05-global-rule-budget-pressure/steps.json +79 -0
  817. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/CODEOWNERS +2 -0
  818. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/kit/TENET.md +3 -0
  819. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/src/api/handler.ts +2007 -0
  820. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/src/billing/charge.ts +2007 -0
  821. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/src/shared/http.ts +3 -0
  822. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet/blessed/tenet__intent.md/requirements.md +2 -0
  823. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +11 -0
  824. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet/intent.md +8 -0
  825. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet.lock +7 -0
  826. package/pkg/conformance/scenarios/s06-change-to-shared-helper/before/tenet.yaml +20 -0
  827. package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/01-onboard-initial.json +240 -0
  828. package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/05-onboard-refresh.json +252 -0
  829. package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/06-card.md +8 -0
  830. package/pkg/conformance/scenarios/s06-change-to-shared-helper/expected/06-verify.json +77 -0
  831. package/pkg/conformance/scenarios/s06-change-to-shared-helper/steps.json +122 -0
  832. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/.mcp.json +10 -0
  833. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/AGENTS.md +3 -0
  834. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/package.json +11 -0
  835. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/src/index.ts +1 -0
  836. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/before/test/index.test.ts +2 -0
  837. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/01-interrupted-init.json +4 -0
  838. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/02-init-resume.json +75 -0
  839. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/03-doctor.json +40 -0
  840. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/expected/04-remove.json +44 -0
  841. package/pkg/conformance/scenarios/s07-install-interrupted-part-way/steps.json +56 -0
  842. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/kit/TENET.md +3 -0
  843. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/src/retry.ts +3 -0
  844. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__specs__prd.md/requirements.md +1 -0
  845. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__specs__prd.md/requirements.md.anchors.json +7 -0
  846. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
  847. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
  848. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/plan.md +7 -0
  849. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/prd.md +7 -0
  850. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/tech-spec.md +7 -0
  851. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/specs/ux-spec.md +7 -0
  852. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet/vision.md +7 -0
  853. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet.lock +7 -0
  854. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/before/tenet.yaml +20 -0
  855. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/02-context-clean.json +38 -0
  856. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/04-context-drift.json +40 -0
  857. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/05-bless.json +13 -0
  858. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/expected/05-log-entry.json +15 -0
  859. package/pkg/conformance/scenarios/s08-blessing-fresh-clone-squash-merge/steps.json +80 -0
  860. package/pkg/conformance/scenarios/s09-renamed-heading/before/kit/TENET.md +3 -0
  861. package/pkg/conformance/scenarios/s09-renamed-heading/before/src/retry.ts +3 -0
  862. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__specs__prd.md/checkout-retries.md +1 -0
  863. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__specs__prd.md/checkout-retries.md.anchors.json +5 -0
  864. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__vision.md/vision.md +1 -0
  865. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/blessed/tenet__vision.md/vision.md.anchors.json +1 -0
  866. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/plan.md +7 -0
  867. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/prd.md +7 -0
  868. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/tech-spec.md +7 -0
  869. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/specs/ux-spec.md +7 -0
  870. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet/vision.md +7 -0
  871. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet.lock +7 -0
  872. package/pkg/conformance/scenarios/s09-renamed-heading/before/tenet.yaml +20 -0
  873. package/pkg/conformance/scenarios/s09-renamed-heading/before/test/retry.test.ts +2 -0
  874. package/pkg/conformance/scenarios/s09-renamed-heading/expected/02-fix.json +34 -0
  875. package/pkg/conformance/scenarios/s09-renamed-heading/expected/03-check.json +14 -0
  876. package/pkg/conformance/scenarios/s09-renamed-heading/expected/04-board.json +56 -0
  877. package/pkg/conformance/scenarios/s09-renamed-heading/expected/05-context.json +38 -0
  878. package/pkg/conformance/scenarios/s09-renamed-heading/steps.json +58 -0
  879. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/kit/TENET.md +3 -0
  880. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/src/retry.ts +3 -0
  881. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet/blessed/tenet__intent.md/requirements.md +1 -0
  882. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet/blessed/tenet__intent.md/requirements.md.anchors.json +7 -0
  883. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet/intent.md +7 -0
  884. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet.lock +7 -0
  885. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/before/tenet.yaml +20 -0
  886. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/expected/04-card.md +8 -0
  887. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/expected/04-verify.json +77 -0
  888. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/expected/05-verify-closed.json +6 -0
  889. package/pkg/conformance/scenarios/s10-pr-closed-without-merging/steps.json +108 -0
  890. package/pkg/conformance/scenarios/s11-readme-walkthrough/before/README.md +3 -0
  891. package/pkg/conformance/scenarios/s11-readme-walkthrough/before/package.json +8 -0
  892. package/pkg/conformance/scenarios/s11-readme-walkthrough/before/src/retry.ts +3 -0
  893. package/pkg/conformance/scenarios/s11-readme-walkthrough/before/test/retry.test.ts +2 -0
  894. package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/01-init.json +75 -0
  895. package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/02-onboard-inventory.json +141 -0
  896. package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/06-card.md +7 -0
  897. package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/06-onboard-card.json +10 -0
  898. package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/07-bless.json +13 -0
  899. package/pkg/conformance/scenarios/s11-readme-walkthrough/expected/08-remove.json +57 -0
  900. package/pkg/conformance/scenarios/s11-readme-walkthrough/steps.json +93 -0
  901. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/.claude/settings.json +1 -0
  902. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/.github/workflows/ci.yml +8 -0
  903. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/CODEOWNERS +1 -0
  904. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/README.md +3 -0
  905. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/docs/adr/0001-retries.md +1 -0
  906. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/docs/adr/0002-timeouts.md +1 -0
  907. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/docs/architecture.md +3 -0
  908. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/package.json +11 -0
  909. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/src/retry.ts +6 -0
  910. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/before/test/checkout.retry.test.ts +4 -0
  911. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/01-init.json +103 -0
  912. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/02-onboard-inventory.json +233 -0
  913. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/06-card.md +9 -0
  914. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/06-onboard-card.json +10 -0
  915. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/07-bless.json +13 -0
  916. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/expected/08-board.json +34 -0
  917. package/pkg/conformance/scenarios/s12-ux-walkthrough-existing/steps.json +98 -0
  918. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/before/.gitkeep +0 -0
  919. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/01-init.json +82 -0
  920. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/04-onboard-inventory.json +188 -0
  921. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/05-card.md +12 -0
  922. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/05-onboard-card.json +10 -0
  923. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/expected/06-bless.json +13 -0
  924. package/pkg/conformance/scenarios/s13-ux-walkthrough-new/steps.json +76 -0
@@ -0,0 +1,365 @@
1
+ import { spawn } from "node:child_process";
2
+ import { readFile, stat } from "node:fs/promises";
3
+ import path from "node:path";
4
+ import { parseDocument } from "yaml";
5
+ import { message } from "../core/messages.js";
6
+ import { errorFinding, exitCodeFor, fail } from "../core/output.js";
7
+ import { verifyLock as verifyPackageLock } from "../policy/index.js";
8
+ import { installedLocalIntegrity, installedPackageVersion, localIntegrityWarning } from "./integrity.js";
9
+ const minimumVersions = {
10
+ node: "22.0.0",
11
+ git: "2.40.0",
12
+ ssh: "8.9.0",
13
+ };
14
+ function versionParts(value) {
15
+ const match = /(?:^|\s)(?:v|version\s+)?(\d+)\.(\d+)(?:\.(\d+))?/i.exec(value);
16
+ if (!match)
17
+ return null;
18
+ return [Number(match[1]), Number(match[2]), Number(match[3] ?? "0")];
19
+ }
20
+ function versionAtLeast(actual, required) {
21
+ const left = versionParts(actual);
22
+ const right = versionParts(required);
23
+ if (!left || !right)
24
+ return false;
25
+ for (let index = 0; index < 3; index += 1) {
26
+ const a = left[index] ?? 0;
27
+ const b = right[index] ?? 0;
28
+ if (a !== b)
29
+ return a > b;
30
+ }
31
+ return true;
32
+ }
33
+ function cleanVersion(tool, output) {
34
+ const patterns = {
35
+ node: /v?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)/i,
36
+ git: /git version\s+(\d+\.\d+(?:\.\d+)?(?:[^\s]*)?)/i,
37
+ ssh: /OpenSSH(?:_for_Windows)?[ _-](\d+\.\d+(?:\.\d+)?(?:p\d+)?)/i,
38
+ gh: /gh version\s+(\S+)/i,
39
+ };
40
+ const match = (patterns[tool] ?? /(\d+\.\d+(?:\.\d+)?)/).exec(output);
41
+ return match?.[1] ?? null;
42
+ }
43
+ function displayVersion(tool, output) {
44
+ return cleanVersion(tool, output) ?? output.trim();
45
+ }
46
+ function defaultRunner(tool, args, options) {
47
+ return new Promise((resolve, reject) => {
48
+ const child = spawn(tool, args, {
49
+ cwd: options.cwd,
50
+ shell: false,
51
+ windowsHide: true,
52
+ });
53
+ const stdout = [];
54
+ const stderr = [];
55
+ child.stdout.on("data", (chunk) => stdout.push(chunk));
56
+ child.stderr.on("data", (chunk) => stderr.push(chunk));
57
+ child.on("error", reject);
58
+ child.on("close", (code) => {
59
+ const text = `${Buffer.concat(stdout).toString("utf8")}${Buffer.concat(stderr).toString("utf8")}`.trim();
60
+ if (code === 0)
61
+ resolve(text);
62
+ else
63
+ reject(Object.assign(new Error(text || `${tool} exited with code ${String(code)}`), { code }));
64
+ });
65
+ });
66
+ }
67
+ function canonical(code, variables) {
68
+ const text = message(code, variables);
69
+ return fail(code, text.message, text.fix);
70
+ }
71
+ function injectedTool(environment, tool) {
72
+ return environment?.tools?.[tool];
73
+ }
74
+ async function toolOutput(tool, args, cwd, environment, dependencies) {
75
+ const injected = injectedTool(environment, tool);
76
+ if (injected === null)
77
+ return null;
78
+ if (injected !== undefined)
79
+ return injected;
80
+ const runner = dependencies.runners?.[tool] ?? dependencies.runTool ?? defaultRunner;
81
+ try {
82
+ return await runner(tool, args, { cwd });
83
+ }
84
+ catch {
85
+ return null;
86
+ }
87
+ }
88
+ async function insideRepository(cwd, environment, dependencies) {
89
+ const state = environment?.git?.state;
90
+ if (state === "not-a-repository" || state === "tool-unavailable")
91
+ return false;
92
+ if (state === "committed" || state === "unborn")
93
+ return true;
94
+ const runner = dependencies.runners?.git ?? dependencies.runTool ?? defaultRunner;
95
+ try {
96
+ return (await runner("git", ["rev-parse", "--is-inside-work-tree"], { cwd })).trim() === "true";
97
+ }
98
+ catch {
99
+ return false;
100
+ }
101
+ }
102
+ function gitOutput(environment, discovered) {
103
+ if (environment?.tools?.git === null || environment?.git?.state === "tool-unavailable")
104
+ return null;
105
+ const version = environment?.git?.version;
106
+ return version !== undefined ? version : discovered;
107
+ }
108
+ function lockFinding(error) {
109
+ const found = errorFinding(error);
110
+ if (found?.code === "TN-LOCK-MISSING") {
111
+ return canonicalLock("TN-LOCK-MISSING");
112
+ }
113
+ if (found?.code === "TN-LOCK-INVALID") {
114
+ const text = message("TN-LOCK-INVALID", { detail: found.message });
115
+ return { ...found, ...text };
116
+ }
117
+ if (found?.code === "TN-LOCK-MISMATCH" &&
118
+ found.message.startsWith("Vendored kit digest differs from tenet.lock")) {
119
+ return { ...found, code: "TN-KIT-EDITED" };
120
+ }
121
+ if (found?.code === "TN-KIT-MISSING") {
122
+ const kitPath = found.file ?? ".tenet/kit";
123
+ const text = message("TN-KIT-MISSING", { path: kitPath });
124
+ return { ...found, file: kitPath, ...text };
125
+ }
126
+ if (found?.code === "TN-KIT-INVALID") {
127
+ const text = message("TN-KIT-INVALID", {
128
+ path: found.file ?? ".tenet/kit",
129
+ detail: found.message,
130
+ });
131
+ return { ...found, ...text };
132
+ }
133
+ if (found)
134
+ return found;
135
+ const detail = error instanceof Error ? error.message : String(error);
136
+ const text = message("TN-LOCK-INVALID", { detail });
137
+ return fail("TN-LOCK-INVALID", text.message, text.fix);
138
+ }
139
+ function canonicalLock(code) {
140
+ const text = message(code, {});
141
+ return fail(code, text.message, text.fix);
142
+ }
143
+ async function localLockIntegrity(cwd, compute) {
144
+ try {
145
+ const filename = path.join(cwd, "tenet.lock");
146
+ const document = parseDocument(await readFile(filename, "utf8"), {
147
+ merge: false,
148
+ prettyErrors: true,
149
+ uniqueKeys: true,
150
+ });
151
+ if (document.errors.length > 0)
152
+ return null;
153
+ const lock = document.toJS({ maxAliasCount: 100 });
154
+ if (!lock || typeof lock !== "object")
155
+ return null;
156
+ if (lock["x-integrity-source"] !== "local")
157
+ return null;
158
+ const installedVersion = await installedPackageVersion();
159
+ if (lock.version !== installedVersion)
160
+ return null;
161
+ const actual = await compute();
162
+ if (actual === lock.integrity) {
163
+ return {
164
+ matches: true,
165
+ mismatchFinding: null,
166
+ warning: typeof lock.package === "string"
167
+ ? localIntegrityWarning(lock.package, installedVersion)
168
+ : null,
169
+ };
170
+ }
171
+ const text = message("TN-LOCK-INVALID", {
172
+ detail: "installed package integrity does not match the local integrity recorded in tenet.lock",
173
+ });
174
+ return {
175
+ matches: false,
176
+ mismatchFinding: {
177
+ ...fail("TN-LOCK-INVALID", text.message, text.fix),
178
+ file: "tenet.lock",
179
+ },
180
+ warning: null,
181
+ };
182
+ }
183
+ catch (error) {
184
+ if (error.code === "ENOENT")
185
+ return null;
186
+ if (error instanceof SyntaxError)
187
+ return null;
188
+ throw error;
189
+ }
190
+ }
191
+ async function workflowConfiguration(cwd) {
192
+ let source;
193
+ try {
194
+ source = await readFile(path.join(cwd, "tenet.yaml"), "utf8");
195
+ }
196
+ catch (error) {
197
+ if (error.code === "ENOENT")
198
+ return { ci: false, testWorkflow: null };
199
+ throw error;
200
+ }
201
+ const document = parseDocument(source, { merge: false, prettyErrors: true, uniqueKeys: true });
202
+ if (document.errors.length > 0)
203
+ return { ci: false, testWorkflow: null };
204
+ const data = document.toJS({ maxAliasCount: 100 });
205
+ if (!data || typeof data !== "object" || !data.ci || typeof data.ci !== "object") {
206
+ return { ci: false, testWorkflow: null };
207
+ }
208
+ const ci = data.ci;
209
+ return {
210
+ ci: ci.mode !== "none",
211
+ testWorkflow: typeof ci.test_workflow === "string"
212
+ ? ci.test_workflow
213
+ : ".github/workflows/tenet-tests.yml",
214
+ };
215
+ }
216
+ async function workflowCheck(cwd) {
217
+ const configuration = await workflowConfiguration(cwd);
218
+ if (!configuration.ci) {
219
+ return {
220
+ check: { name: "workflows", ok: true, detail: "No workflows configured (ci_mode none)" },
221
+ finding: null,
222
+ ci: false,
223
+ };
224
+ }
225
+ const required = [".github/workflows/tenet.yml", configuration.testWorkflow]
226
+ .filter((value, index, values) => Boolean(value) && values.indexOf(value) === index);
227
+ for (const relative of required) {
228
+ try {
229
+ const info = await stat(path.resolve(cwd, ...relative.replaceAll("\\", "/").split("/")));
230
+ if (!info.isFile())
231
+ throw Object.assign(new Error("not a file"), { code: "ENOENT" });
232
+ }
233
+ catch {
234
+ const text = message("TN-KIT-MISSING", { path: relative });
235
+ return {
236
+ check: { name: "workflows", ok: false, detail: `missing workflow ${relative}` },
237
+ finding: { ...fail("TN-KIT-MISSING", text.message, text.fix), file: relative },
238
+ ci: true,
239
+ };
240
+ }
241
+ }
242
+ return {
243
+ check: { name: "workflows", ok: true, detail: "configured workflows found" },
244
+ finding: null,
245
+ ci: true,
246
+ };
247
+ }
248
+ function doctorDependencies(options, supplied) {
249
+ const platform = supplied.platform ?? options.platform ?? options.environment?.platform;
250
+ return {
251
+ ...(platform !== undefined ? { platform } : {}),
252
+ ...(supplied.runTool || options.runTool ? { runTool: supplied.runTool ?? options.runTool } : {}),
253
+ ...(supplied.runners || options.runners
254
+ ? { runners: { ...(options.runners ?? {}), ...(supplied.runners ?? {}) } }
255
+ : {}),
256
+ ...(supplied.verifyLock || options.verifyLock
257
+ ? { verifyLock: supplied.verifyLock ?? options.verifyLock }
258
+ : {}),
259
+ };
260
+ }
261
+ export async function doctorEvaluation(options = {}, supplied = {}) {
262
+ const cwd = path.resolve(options.cwd ?? process.cwd());
263
+ const environment = options.environment;
264
+ const dependencies = doctorDependencies(options, supplied);
265
+ const findings = [];
266
+ const nodeRaw = await toolOutput("node", ["--version"], cwd, environment, dependencies);
267
+ const nodeVersion = nodeRaw === null ? null : displayVersion("node", nodeRaw);
268
+ const nodeOk = nodeVersion !== null && versionAtLeast(nodeVersion, minimumVersions.node);
269
+ if (!nodeOk) {
270
+ findings.push(canonical("TN-ENV-NODE", { found: nodeVersion ?? "not installed" }));
271
+ }
272
+ const discoveredGit = environment?.git?.state === "tool-unavailable"
273
+ ? null
274
+ : await toolOutput("git", ["--version"], cwd, environment, dependencies);
275
+ const rawGit = gitOutput(environment, discoveredGit);
276
+ const gitVersion = rawGit === null ? null : displayVersion("git", rawGit);
277
+ let gitOk = gitVersion !== null && versionAtLeast(gitVersion, minimumVersions.git);
278
+ if (!gitOk)
279
+ findings.push(canonical("TN-ENV-GIT", { found: gitVersion ?? "not installed" }));
280
+ if (gitOk && !(await insideRepository(cwd, environment, dependencies))) {
281
+ gitOk = false;
282
+ findings.push(canonical("TN-ENV-NOT-GIT", { path: cwd }));
283
+ }
284
+ const sshRaw = await toolOutput("ssh", ["-V"], cwd, environment, dependencies);
285
+ const sshVersion = sshRaw === null ? null : displayVersion("ssh", sshRaw);
286
+ const sshOk = sshVersion === null || versionAtLeast(sshVersion, minimumVersions.ssh);
287
+ const ghRaw = await toolOutput("gh", ["--version"], cwd, environment, dependencies);
288
+ const ghAvailable = ghRaw !== null;
289
+ let lockOk = false;
290
+ let lockDetail = "";
291
+ let localWarning = null;
292
+ const packageVerify = dependencies.verifyLock ?? verifyPackageLock;
293
+ try {
294
+ const verified = await packageVerify({ cwd });
295
+ lockOk = true;
296
+ const relativeKit = path.relative(cwd, verified.path).replaceAll("\\", "/");
297
+ lockDetail = relativeKit === ".tenet/kit"
298
+ ? "vendored kit matches tenet.lock"
299
+ : "tenet.lock and kit match";
300
+ const localIntegrity = await localLockIntegrity(cwd, installedLocalIntegrity);
301
+ if (localIntegrity?.matches === false && localIntegrity.mismatchFinding) {
302
+ findings.push(localIntegrity.mismatchFinding);
303
+ lockOk = false;
304
+ lockDetail = localIntegrity.mismatchFinding.message;
305
+ }
306
+ else if (localIntegrity?.matches) {
307
+ localWarning = localIntegrity.warning;
308
+ lockDetail +=
309
+ " (local integrity; CI treats it as advisory until the package is published and re-pinned with `tenet upgrade`)";
310
+ }
311
+ }
312
+ catch (error) {
313
+ const finding = lockFinding(error);
314
+ findings.push(finding);
315
+ lockDetail = finding.message;
316
+ }
317
+ const workflow = await workflowCheck(cwd);
318
+ if (workflow.finding)
319
+ findings.push(workflow.finding);
320
+ const checks = [
321
+ {
322
+ name: "node",
323
+ ok: nodeOk,
324
+ detail: `Node.js ${nodeVersion ?? "not installed"}`,
325
+ },
326
+ {
327
+ name: "git",
328
+ ok: gitOk,
329
+ detail: gitVersion === null
330
+ ? "Git not installed"
331
+ : gitOk
332
+ ? `Git ${gitVersion}`
333
+ : environment?.git?.state === "not-a-repository"
334
+ ? "not a Git repository"
335
+ : `Git ${gitVersion}`,
336
+ },
337
+ {
338
+ name: "ssh",
339
+ ok: sshOk,
340
+ detail: sshVersion === null
341
+ ? "OpenSSH not found (optional until assure)"
342
+ : `OpenSSH ${sshVersion}`,
343
+ },
344
+ {
345
+ name: "gh",
346
+ ok: true,
347
+ detail: ghAvailable ? `gh CLI ${displayVersion("gh", ghRaw)}` : "gh CLI not found (optional)",
348
+ },
349
+ { name: "lock", ok: lockOk, detail: lockDetail },
350
+ workflow.check,
351
+ ];
352
+ const diagnosticExit = exitCodeFor(findings);
353
+ return {
354
+ checks,
355
+ findings,
356
+ notices: localWarning !== null && workflow.ci ? [localWarning] : [],
357
+ exitCode: diagnosticExit === 3 ? 3 : checks.some((check) => !check.ok && (check.name === "lock" || check.name === "workflows")) ? 1 :
358
+ diagnosticExit === 1 ? 1 : 0,
359
+ };
360
+ }
361
+ export async function doctor(options = {}, supplied = {}) {
362
+ const { checks } = await doctorEvaluation(options, supplied);
363
+ return { checks };
364
+ }
365
+ //# sourceMappingURL=doctor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/install/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,IAAI,EAAgB,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAYzG,MAAM,eAAe,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,OAAO;CACJ,CAAC;AAEX,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,KAAK,GAAG,oDAAoD,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC/E,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC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AAE,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE;QACnE,QAAQ,EAAE,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CACzD,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzE,cAAc,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC/B,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,UAAyB,EAAE,EAAE,WAA+B,EAAE;IACzF,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAC7D,OAAO,EAAE,MAAM,EAAE,CAAC;AACpB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { PreflightEnvironment } from "./types.js";
2
+ export declare function localProfileRoot(environment?: PreflightEnvironment): string | undefined;
3
+ export declare function localProfileRoots(environment?: PreflightEnvironment): Partial<Record<string, string>> | undefined;
4
+ export declare function windowsCommandShimRequired(environment: PreflightEnvironment, detectedMcpHosts: string[]): string[] | undefined;
@@ -0,0 +1,47 @@
1
+ import path from "node:path";
2
+ export function localProfileRoot(environment = {}) {
3
+ if (environment.localProfileRoot !== undefined) {
4
+ return environment.localProfileRoot;
5
+ }
6
+ const platform = environment.platform ?? process.platform;
7
+ if (platform !== "win32")
8
+ return undefined;
9
+ const profile = process.env.USERPROFILE;
10
+ if (profile)
11
+ return path.resolve(profile);
12
+ const appData = process.env.APPDATA;
13
+ if (appData)
14
+ return path.resolve(appData);
15
+ const home = process.env.HOME;
16
+ return home ? path.resolve(home) : undefined;
17
+ }
18
+ export function localProfileRoots(environment = {}) {
19
+ if (environment.localProfileRoot !== undefined) {
20
+ return {
21
+ claude: environment.localProfileRoot,
22
+ cursor: environment.localProfileRoot,
23
+ vscode: environment.localProfileRoot,
24
+ };
25
+ }
26
+ if ((environment.platform ?? process.platform) !== "win32")
27
+ return undefined;
28
+ const home = process.env.USERPROFILE ?? process.env.HOME;
29
+ const roaming = process.env.APPDATA ??
30
+ (process.env.USERPROFILE ? path.resolve(process.env.USERPROFILE, "AppData", "Roaming") : undefined) ??
31
+ (process.env.HOME ? path.resolve(process.env.HOME, "AppData", "Roaming") : undefined);
32
+ if (!home && !roaming)
33
+ return undefined;
34
+ return {
35
+ ...(home ? { claude: path.resolve(home) } : {}),
36
+ ...(roaming ? { cursor: path.resolve(roaming), vscode: path.resolve(roaming) } : {}),
37
+ };
38
+ }
39
+ export function windowsCommandShimRequired(environment, detectedMcpHosts) {
40
+ if (environment.windowsCommandShimRequired !== undefined) {
41
+ return environment.windowsCommandShimRequired;
42
+ }
43
+ return (environment.platform ?? process.platform) === "win32"
44
+ ? detectedMcpHosts
45
+ : undefined;
46
+ }
47
+ //# sourceMappingURL=environment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../../src/install/environment.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,MAAM,UAAU,gBAAgB,CAC9B,cAAoC,EAAE;IAEtC,IAAI,WAAW,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAC/C,OAAO,WAAW,CAAC,gBAAgB,CAAC;IACtC,CAAC;IACD,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC;IAC1D,IAAI,QAAQ,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;IACxC,IAAI,OAAO;QAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,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AAE,OAAO,SAAS,CAAC;IACxC,OAAO;QACL,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/C,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACrF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,WAAiC,EACjC,gBAA0B;IAE1B,IAAI,WAAW,CAAC,0BAA0B,KAAK,SAAS,EAAE,CAAC;QACzD,OAAO,WAAW,CAAC,0BAA0B,CAAC;IAChD,CAAC;IACD,OAAO,CAAC,WAAW,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,OAAO;QAC3D,CAAC,CAAC,gBAAgB;QAClB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { HostContext, HostDescriptor } from "./types.js";
2
+ export declare const hostDescriptors: HostDescriptor[];
3
+ export declare const HOST_DESCRIPTORS: HostDescriptor[];
4
+ export declare function detectHosts(context: HostContext): Promise<HostDescriptor[]>;
5
+ export declare function compareUtf16(left: string, right: string): number;
@@ -0,0 +1,105 @@
1
+ import { access, constants } from "node:fs/promises";
2
+ import path from "node:path";
3
+ const skillNames = ["draft-specs", "review-with-findings", "work-a-change"];
4
+ function emptyPlan() {
5
+ return { created: [], blocks: [], keys: [], local_keys: [] };
6
+ }
7
+ function skillWrites(prefix) {
8
+ return skillNames.map((name) => `${prefix}/tenet-${name}/SKILL.md`);
9
+ }
10
+ function localKey(context, host, relativePath, pointer) {
11
+ const root = context.localProfileRoots?.[host] ?? context.localProfileRoot;
12
+ if (!root && context.platform !== "win32")
13
+ return [];
14
+ if (!root)
15
+ return [];
16
+ if (!context.windowsCommandShimRequired?.includes(host))
17
+ return [];
18
+ const filename = path.join(root, ...relativePath.split("/")).replaceAll("\\", "/");
19
+ return [{ host, path: filename, pointer }];
20
+ }
21
+ async function exists(context, relative) {
22
+ try {
23
+ await access(path.join(context.cwd, ...relative.replaceAll("\\", "/").split("/")), constants.F_OK);
24
+ return true;
25
+ }
26
+ catch {
27
+ return false;
28
+ }
29
+ }
30
+ export const hostDescriptors = [
31
+ {
32
+ id: "claude",
33
+ capabilityLevel: "skills+mcp",
34
+ async detect(context) {
35
+ return (await exists(context, ".claude")) || exists(context, "CLAUDE.md");
36
+ },
37
+ planWrites(context) {
38
+ return {
39
+ created: skillWrites(".claude/skills"),
40
+ blocks: [{ path: "CLAUDE.md", kind: "markdown" }],
41
+ keys: [{ path: ".mcp.json", pointer: "/mcpServers/tenet" }],
42
+ local_keys: localKey(context, "claude", ".claude.json", "/mcpServers/tenet"),
43
+ };
44
+ },
45
+ },
46
+ {
47
+ id: "cursor",
48
+ capabilityLevel: "mcp",
49
+ detect: (context) => exists(context, ".cursor"),
50
+ planWrites(context) {
51
+ const plan = emptyPlan();
52
+ plan.keys.push({ path: ".cursor/mcp.json", pointer: "/mcpServers/tenet" });
53
+ plan.local_keys.push(...localKey(context, "cursor", "Cursor/User/mcp.json", "/mcpServers/tenet"));
54
+ return plan;
55
+ },
56
+ },
57
+ {
58
+ id: "copilot",
59
+ capabilityLevel: "instructions",
60
+ detect: (context) => exists(context, ".github/copilot-instructions.md"),
61
+ planWrites() {
62
+ return {
63
+ ...emptyPlan(),
64
+ blocks: [{ path: ".github/copilot-instructions.md", kind: "markdown" }],
65
+ };
66
+ },
67
+ },
68
+ {
69
+ id: "vscode",
70
+ capabilityLevel: "mcp",
71
+ detect: (context) => exists(context, ".vscode"),
72
+ planWrites(context) {
73
+ const plan = emptyPlan();
74
+ plan.keys.push({ path: ".vscode/mcp.json", pointer: "/servers/tenet" });
75
+ plan.local_keys.push(...localKey(context, "vscode", "Code/User/mcp.json", "/servers/tenet"));
76
+ return plan;
77
+ },
78
+ },
79
+ {
80
+ id: "agents",
81
+ capabilityLevel: "skills+mcp",
82
+ detect: () => true,
83
+ planWrites() {
84
+ return {
85
+ created: skillWrites(".agents/skills"),
86
+ blocks: [{ path: "AGENTS.md", kind: "markdown" }],
87
+ keys: [],
88
+ local_keys: [],
89
+ };
90
+ },
91
+ },
92
+ ];
93
+ export const HOST_DESCRIPTORS = hostDescriptors;
94
+ export async function detectHosts(context) {
95
+ const detected = [];
96
+ for (const descriptor of hostDescriptors) {
97
+ if (await descriptor.detect(context))
98
+ detected.push(descriptor);
99
+ }
100
+ return detected.sort((left, right) => compareUtf16(left.id, right.id));
101
+ }
102
+ export function compareUtf16(left, right) {
103
+ return left < right ? -1 : left > right ? 1 : 0;
104
+ }
105
+ //# sourceMappingURL=hosts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hosts.js","sourceRoot":"","sources":["../../src/install/hosts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,MAAM,UAAU,GAAG,CAAC,aAAa,EAAE,sBAAsB,EAAE,eAAe,CAAU,CAAC;AAErF,SAAS,SAAS;IAChB,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;AAC/D,CAAC;AAED,SAAS,WAAW,CAAC,MAAc;IACjC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,UAAU,IAAI,WAAW,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,QAAQ,CACf,OAAoB,EACpB,IAAY,EACZ,YAAoB,EACpB,OAAe;IAEf,MAAM,IAAI,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC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CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { InitOptions, InitResult } from "./types.js";
2
+ export declare function init(options?: InitOptions): Promise<InitResult>;
@@ -0,0 +1,80 @@
1
+ import { readFile } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { preflight } from "./preflight.js";
4
+ import { manifestJson, sha256Bytes } from "./manifest.js";
5
+ import { applyPlan, planWriteSet, resumePendingPlan } from "./writes.js";
6
+ import { localProfileRoot } from "./environment.js";
7
+ async function isComplete(cwd, plan) {
8
+ for (const write of plan.writes) {
9
+ try {
10
+ const filename = write.kind === "local_key"
11
+ ? path.resolve(write.path)
12
+ : path.resolve(cwd, ...write.path.replaceAll("\\", "/").split("/"));
13
+ const bytes = await readFile(filename);
14
+ if (sha256Bytes(bytes) !== write.after_sha256)
15
+ return false;
16
+ }
17
+ catch (error) {
18
+ if (error.code === "ENOENT")
19
+ return false;
20
+ throw error;
21
+ }
22
+ }
23
+ try {
24
+ return (await readFile(path.join(cwd, ".tenet", "manifest.json"), "utf8")) === manifestJson(plan.manifest);
25
+ }
26
+ catch (error) {
27
+ if (error.code === "ENOENT")
28
+ return false;
29
+ throw error;
30
+ }
31
+ }
32
+ export async function init(options = {}) {
33
+ const preflightOptions = { ...options };
34
+ const result = await preflight(preflightOptions);
35
+ const cwd = path.resolve(options.cwd ?? process.cwd());
36
+ const profileRoot = localProfileRoot(options.environment);
37
+ if (options.answers?.continue === false) {
38
+ if (!result.plan) {
39
+ throw Object.assign(new Error(result.diagnostics[0]?.message ?? "Install preflight failed."), {
40
+ finding: result.diagnostics[0],
41
+ });
42
+ }
43
+ return {
44
+ plan: result.plan,
45
+ wrote: { created: [], blocks: [], keys: [], local_keys: [] },
46
+ findings: [],
47
+ cancelled: true,
48
+ };
49
+ }
50
+ const resumed = await resumePendingPlan(cwd, result, {
51
+ ...(options.fault ? { fault: options.fault } : {}),
52
+ ...(profileRoot
53
+ ? { localProfileRoot: profileRoot }
54
+ : {}),
55
+ });
56
+ if (resumed)
57
+ return { ...resumed, findings: [...result.findings, ...resumed.findings] };
58
+ const plan = await planWriteSet(result, { ...options, command: "init" });
59
+ const findings = [
60
+ ...result.findings,
61
+ ...(plan.integrity_warning
62
+ ? [{ kind: "local-integrity", path: "tenet.lock", message: plan.integrity_warning }]
63
+ : []),
64
+ ];
65
+ if (await isComplete(cwd, plan)) {
66
+ return {
67
+ plan: plan.plan,
68
+ wrote: { created: [], blocks: [], keys: [], local_keys: [] },
69
+ findings,
70
+ };
71
+ }
72
+ const applied = await applyPlan(plan, {
73
+ ...(options.fault ? { fault: options.fault } : {}),
74
+ ...(profileRoot
75
+ ? { localProfileRoot: profileRoot }
76
+ : {}),
77
+ });
78
+ return { ...applied, findings };
79
+ }
80
+ //# sourceMappingURL=init.js.map