@joshuafolkken/kit 1.1010.0 → 1.1035.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 (272) hide show
  1. package/.claude/settings.json +1 -5
  2. package/.claude/skills/dependency-update/SKILL.md +6 -3
  3. package/.claude/skills/epic-commands/SKILL.md +46 -17
  4. package/.claude/skills/workflow-commands/SKILL.md +8 -23
  5. package/.claude/skills/workflow-commands/backlogrun-child.md +4 -2
  6. package/.claude/skills/workflow-commands/backlogrun.md +3 -12
  7. package/.claude/skills/workflow-commands/fullrun-steps.md +4 -3
  8. package/.claude/skills/workflow-commands/fullrun.md +1 -1
  9. package/.claude/skills/workflow-commands/halfrun.md +2 -1
  10. package/.claude/skills/workflow-commands/into-target.md +1 -1
  11. package/.claude/skills/workflow-commands/observation-filing.md +42 -43
  12. package/.claude/skills/workflow-commands/prerequisite.md +1 -1
  13. package/.codex/hooks.json +1 -5
  14. package/.github/workflows/sonar-qube.yml +1 -1
  15. package/AGENTS.md +4 -25
  16. package/CLAUDE.md +24 -38
  17. package/GEMINI.md +4 -24
  18. package/README.md +22 -56
  19. package/dist/CLAUDE.md +24 -38
  20. package/dist/hooks/batch-guard.js +4 -4
  21. package/dist/hooks/{chunk-WMIR5SNX.js → chunk-D67KVGGY.js} +3 -3
  22. package/dist/hooks/{chunk-EZLHXKJ6.js → chunk-EIFCAJRB.js} +70 -27
  23. package/dist/hooks/{chunk-KPZN42RT.js → chunk-GJT4BNVE.js} +3 -3
  24. package/dist/hooks/{chunk-PAXMLGSS.js → chunk-GLBDBJOK.js} +44 -24
  25. package/dist/hooks/{chunk-GBJUERYK.js → chunk-HOYJU5RM.js} +1 -1
  26. package/dist/hooks/{chunk-6PSTVOLH.js → chunk-HU66PWWL.js} +33 -57
  27. package/dist/hooks/{chunk-A2H5I2VD.js → chunk-KG6PZD72.js} +2 -2
  28. package/dist/hooks/{chunk-AWTFKKFW.js → chunk-XPLP27WA.js} +3 -8
  29. package/dist/hooks/{chunk-4GDR2YTV.js → chunk-Y27M6A7X.js} +4 -4
  30. package/dist/hooks/{chunk-56LGMJJV.js → chunk-ZXNE6NY3.js} +2 -2
  31. package/dist/hooks/codex-hook-adapter.js +10 -10
  32. package/dist/hooks/duplicate-read-guard.js +5 -5
  33. package/dist/hooks/format-edited.js +2 -2
  34. package/dist/hooks/investigation-guard.js +5 -5
  35. package/dist/hooks/pretool-guard.js +9 -9
  36. package/dist/hooks/stop-guard.js +11 -15
  37. package/dist/josh.js +38 -19
  38. package/dist/version/index.js +93 -41
  39. package/eslint/base.js +2 -11
  40. package/package.json +31 -5
  41. package/prompts/coding-standards.md +15 -290
  42. package/prompts/collaboration-workflow/cross-repo-epic.md +2 -51
  43. package/prompts/collaboration-workflow/epic-audit.md +2 -53
  44. package/prompts/collaboration-workflow/epic-bundle.md +2 -106
  45. package/prompts/collaboration-workflow/issue-template.md +4 -4
  46. package/prompts/collaboration-workflow/operating-rules.md +18 -75
  47. package/prompts/collaboration-workflow/principles.md +74 -0
  48. package/prompts/collaboration-workflow/residency.md +54 -14
  49. package/prompts/collaboration-workflow/rule-delivery.md +1 -11
  50. package/prompts/collaboration-workflow/upstream-interrupt.md +1 -1
  51. package/prompts/collaboration-workflow.md +22 -28
  52. package/scripts/adopt/adopt-logic.ts +2 -2
  53. package/scripts/adopt/adopt-toolkits.ts +1 -1
  54. package/scripts/adopt/adopt.ts +2 -2
  55. package/scripts/agent/agent-event.ts +2 -9
  56. package/scripts/agent/agent-exit-record.ts +2 -9
  57. package/scripts/backlog/backlog-budget-cli.ts +2 -6
  58. package/scripts/backlog/backlog-drive-cli.ts +20 -10
  59. package/scripts/backlog/backlog-drive.ts +50 -16
  60. package/scripts/backlog/backlog-offer-cli.ts +6 -5
  61. package/scripts/backlog/backlog-plan.ts +1 -1
  62. package/scripts/build/build-bin.ts +2 -1
  63. package/scripts/build/build-config-merge.ts +2 -1
  64. package/scripts/build/build-hooks.ts +24 -4
  65. package/scripts/build/build-managed-marker.ts +2 -1
  66. package/scripts/build/build-self-sync-guard.ts +2 -1
  67. package/scripts/build/build-version.ts +2 -1
  68. package/scripts/cases/cases-logic.ts +2 -6
  69. package/scripts/ci/pr-classification.ts +13 -11
  70. package/scripts/cost-runtime/cost-transcript.ts +4 -11
  71. package/scripts/doctor/doctor-consumer.ts +5 -12
  72. package/scripts/doctor/doctor-ports.ts +2 -2
  73. package/scripts/document/document-byte-budget.ts +8 -16
  74. package/scripts/document/document-section.ts +2 -6
  75. package/scripts/document/entry-read-budget.ts +1 -1
  76. package/scripts/{git/git-epic-add-body.ts → epic/epic-add-body.ts} +23 -23
  77. package/scripts/{git/git-epic-add-plan.ts → epic/epic-add-plan.ts} +23 -26
  78. package/scripts/{git/git-epic-add.ts → epic/epic-add.ts} +17 -17
  79. package/scripts/epic/epic-audit-cli.ts +4 -4
  80. package/scripts/epic/epic-audit-orphans.ts +2 -2
  81. package/scripts/epic/epic-audit-rationale.ts +1 -1
  82. package/scripts/epic/epic-audit.ts +1 -1
  83. package/scripts/{git/git-epic-body.ts → epic/epic-body.ts} +6 -6
  84. package/scripts/epic/epic-bundle-cli.ts +1 -1
  85. package/scripts/epic/epic-bundle.ts +2 -2
  86. package/scripts/epic/epic-candidate-confirm.ts +2 -1
  87. package/scripts/{git/git-epic-chains.ts → epic/epic-chains.ts} +4 -4
  88. package/{scripts-ai → scripts/epic}/epic-check.ts +5 -4
  89. package/{scripts-ai → scripts/epic}/epic-cli.ts +4 -4
  90. package/scripts/{git/git-epic-close-comment.ts → epic/epic-close-comment.ts} +9 -9
  91. package/scripts/{git/git-epic-close.ts → epic/epic-close.ts} +23 -19
  92. package/scripts/epic/epic-cross-repo.ts +21 -38
  93. package/scripts/{git/git-epic-decision.ts → epic/epic-decision.ts} +12 -14
  94. package/scripts/epic/epic-fetch.ts +3 -3
  95. package/scripts/epic/epic-graph.ts +3 -3
  96. package/scripts/epic/epic-index.ts +2 -2
  97. package/scripts/epic/epic-issue.ts +1 -1
  98. package/scripts/epic/epic-next.ts +3 -3
  99. package/scripts/{git/git-epic-parse.ts → epic/epic-parse.ts} +3 -3
  100. package/scripts/{git/git-epic-promote.ts → epic/epic-promote.ts} +10 -10
  101. package/scripts/{git/git-epic-read.ts → epic/epic-read.ts} +9 -9
  102. package/scripts/{git/git-epic-reconcile.ts → epic/epic-reconcile.ts} +18 -20
  103. package/scripts/{git/git-epic-reference.ts → epic/epic-reference.ts} +4 -23
  104. package/scripts/epic/epic-relation-recheck.ts +4 -3
  105. package/scripts/{git/git-epic-relations.ts → epic/epic-relations.ts} +5 -5
  106. package/scripts/{git/git-epic-remove-plan.ts → epic/epic-remove-plan.ts} +17 -19
  107. package/scripts/{git/git-epic-remove.ts → epic/epic-remove.ts} +13 -13
  108. package/scripts/{git/git-epic-run.ts → epic/epic-run.ts} +27 -27
  109. package/scripts/{git/git-epic-sections.ts → epic/epic-sections.ts} +6 -6
  110. package/scripts/{git/git-epic-shape.ts → epic/epic-shape.ts} +7 -7
  111. package/scripts/{git/git-epic-validate.ts → epic/epic-validate.ts} +13 -13
  112. package/{scripts-ai → scripts/epic}/epic.ts +17 -16
  113. package/scripts/gh/fix-gh-packages.ts +2 -1
  114. package/scripts/gh/gh-spawn.ts +12 -10
  115. package/scripts/git/constants.ts +1 -1
  116. package/scripts/git/git-branch.ts +10 -1
  117. package/scripts/git/git-command.ts +1 -1
  118. package/scripts/git/git-error.ts +2 -5
  119. package/{scripts-ai → scripts/git}/git-followup-finish.ts +7 -7
  120. package/scripts/git/git-followup-flush.ts +74 -48
  121. package/scripts/git/git-followup-issue-close.ts +2 -2
  122. package/scripts/git/git-followup-label.ts +1 -1
  123. package/scripts/git/git-followup-pending.ts +1 -1
  124. package/{scripts-ai → scripts/git}/git-followup-workflow.ts +23 -11
  125. package/scripts/git/git-gh-exec.ts +85 -26
  126. package/scripts/git/git-gh-issue-read.ts +2 -2
  127. package/scripts/git/git-gh-issue-rest.ts +2 -2
  128. package/scripts/git/git-gh-issue-write.ts +6 -6
  129. package/scripts/git/git-gh-pr-read.ts +0 -21
  130. package/scripts/git/git-gh-pr.ts +2 -23
  131. package/scripts/git/git-pr-followup-wrapup.ts +2 -6
  132. package/scripts/git/git-preflight.ts +3 -6
  133. package/scripts/git/git-staging.ts +21 -9
  134. package/{scripts-ai → scripts/git}/git-workflow.ts +11 -11
  135. package/scripts/git/github-issue-url.ts +1 -1
  136. package/scripts/git/issue-labels.ts +1 -1
  137. package/scripts/git/issue-reference.ts +19 -0
  138. package/scripts/git/main-merge.ts +2 -1
  139. package/scripts/git/main-sync.ts +3 -2
  140. package/scripts/git/schemas.ts +1 -1
  141. package/scripts/git/stash-pop-args.ts +7 -13
  142. package/scripts/git/stash-pop-cli.ts +2 -1
  143. package/{scripts-ai → scripts/git}/telegram-test-logic.ts +2 -2
  144. package/{scripts-ai → scripts/git}/telegram-test.ts +7 -7
  145. package/scripts/hooks/format-rewrite-notice.ts +2 -8
  146. package/scripts/init/init-ai-copy.ts +2 -5
  147. package/scripts/init/init.ts +8 -4
  148. package/scripts/init/start-steps.ts +2 -1
  149. package/scripts/init/start.ts +2 -1
  150. package/scripts/issue/issue-comment-cli.ts +2 -1
  151. package/scripts/issue/issue-file-cli.ts +2 -1
  152. package/scripts/issue/issue-fold-cli.ts +9 -16
  153. package/scripts/issue/issue-scout-cli.ts +8 -13
  154. package/scripts/issue/measure-rerun-cli.ts +7 -6
  155. package/scripts/josh/josh-commands-ai.ts +2 -2
  156. package/scripts/josh/josh-commands-backlog.ts +1 -1
  157. package/scripts/josh/josh-commands-development.ts +1 -1
  158. package/scripts/josh/josh-commands-workflow.ts +4 -4
  159. package/scripts/lane/lane-cli.ts +2 -1
  160. package/scripts/lane/lane-open.ts +3 -2
  161. package/scripts/lane/lane-registry.ts +3 -6
  162. package/scripts/lib/cli-flags.ts +20 -2
  163. package/scripts/lib/error-message.ts +9 -0
  164. package/scripts/lib/read-file.ts +26 -2
  165. package/scripts/observations/observation-ledger-home.ts +98 -26
  166. package/scripts/observations/observation-ledger-migrate.ts +26 -21
  167. package/scripts/observations/observation-ledger-prepare.ts +10 -20
  168. package/scripts/observations/observation-ledger.ts +58 -25
  169. package/scripts/observations/observations-flush-cli.ts +6 -23
  170. package/scripts/observations/observations-flush-landing.ts +2 -1
  171. package/scripts/observations/observations-flush.ts +29 -20
  172. package/scripts/package/package-scout-cli.ts +8 -16
  173. package/scripts/ports/port-command.ts +2 -1
  174. package/scripts/propagate/propagate-publish.ts +6 -7
  175. package/scripts/propagate/propagate-steps.ts +2 -1
  176. package/scripts/propagate/propagate.ts +3 -2
  177. package/scripts/refactor/import-graph.ts +2 -6
  178. package/scripts/registry-migration/migrate.ts +3 -2
  179. package/scripts/registry-migration/user-npmrc.ts +2 -2
  180. package/scripts/release/release-cli.ts +2 -1
  181. package/scripts/repo/repo-setting.ts +10 -8
  182. package/scripts/review/review-finding-ledger.ts +3 -3
  183. package/scripts/review/review-findings-cli.ts +4 -11
  184. package/scripts/review/review-record-cli.ts +14 -11
  185. package/scripts/review/review-record.ts +6 -16
  186. package/scripts/rules/decision-oracle.ts +2 -2
  187. package/scripts/rules/rule-body-guard.ts +2 -2
  188. package/scripts/rules/rule-value-cache.ts +99 -0
  189. package/scripts/rules/rule-value-cli.ts +10 -9
  190. package/scripts/rules/rule-value.ts +1 -1
  191. package/scripts/run/run-carry-args.ts +2 -6
  192. package/scripts/run/run-carry-cli.ts +5 -7
  193. package/scripts/run/run-cut-args.ts +7 -13
  194. package/scripts/run/run-ending-cli.ts +4 -7
  195. package/scripts/run/run-event-stream.ts +2 -5
  196. package/scripts/run/run-liveness-cli.ts +4 -7
  197. package/scripts/run/run-progress-args.ts +2 -6
  198. package/scripts/run/run-progress-cli.ts +2 -1
  199. package/scripts/run/run-tail-cli.ts +3 -3
  200. package/scripts/run/run-tidy-stashes.ts +7 -14
  201. package/scripts/run/run-wake-cli.ts +2 -6
  202. package/scripts/run/run-wake-driver.ts +15 -2
  203. package/scripts/run/run-wake-session.ts +14 -4
  204. package/scripts/safe-chain/project-config.ts +3 -6
  205. package/scripts/security/security-audit-provision.ts +6 -7
  206. package/scripts/sonar/sonar-hotspots-cli.ts +2 -1
  207. package/scripts/sync/directory-copy-guard.ts +2 -1
  208. package/scripts/sync/sync-ai-files.ts +3 -3
  209. package/scripts/sync/template-source-logic.ts +3 -4
  210. package/scripts/test/e2e-retry-check.ts +3 -6
  211. package/scripts/ui/ui-routes-cli.ts +3 -6
  212. package/scripts/version/bump-version.ts +2 -1
  213. package/scripts/version/version-remote.ts +18 -27
  214. package/scripts/version/version-targets.ts +3 -3
  215. package/.claude/skills/workflow-commands/rule-residency.md +0 -267
  216. package/evals/scenarios/consult-not-execute.json +0 -20
  217. package/evals/scenarios/no-implicit-workflow.json +0 -26
  218. package/evals/scenarios/overrides-both-locations.json +0 -29
  219. package/evals/scenarios/upstream-interrupt.json +0 -23
  220. package/evals/scenarios/workflow-skill-loaded.json +0 -16
  221. package/prompts/agent-lint-protocol.json +0 -79
  222. package/prompts/agent-rules.md +0 -63
  223. package/prompts/collaboration-workflow/consultation-vs-execution.md +0 -8
  224. package/prompts/collaboration-workflow/distributed-docs.md +0 -7
  225. package/prompts/collaboration-workflow/durable-rules.md +0 -24
  226. package/prompts/collaboration-workflow/latest-first.md +0 -14
  227. package/prompts/collaboration-workflow/no-clones.md +0 -11
  228. package/prompts/collaboration-workflow/simplicity-first.md +0 -9
  229. package/prompts/collaboration-workflow/single-source-rules.md +0 -13
  230. package/scripts/build/shim-shell.ts +0 -25
  231. package/scripts/claude/skill-meta.ts +0 -37
  232. package/scripts/document/document-scan.ts +0 -108
  233. package/scripts/document/generate-catalog.ts +0 -69
  234. package/scripts/document/retired-phrases.ts +0 -143
  235. package/scripts/document/review-agent-type.ts +0 -46
  236. package/scripts/document/single-source.ts +0 -73
  237. package/scripts/git/git-fixture-workspace.ts +0 -88
  238. package/scripts/hooks/format-edited-file-fixtures.ts +0 -109
  239. package/scripts/hooks/prompt-hooks.ts +0 -38
  240. package/scripts/init/hook-command-bootstrap.ts +0 -83
  241. package/scripts/issue/issue-logic.ts +0 -50
  242. package/scripts/josh/__snapshots__/josh-command-map.test.ts.snap +0 -1227
  243. package/scripts/josh/josh-script-reader.ts +0 -11
  244. package/scripts/package/production-dependency-graph.ts +0 -68
  245. package/scripts/retrospective/retrospective-cli.ts +0 -97
  246. package/scripts/retrospective/retrospective.ts +0 -127
  247. package/scripts/rules/delivered-rules-harness.ts +0 -72
  248. package/scripts/rules/top-level-scripts-guard.ts +0 -47
  249. package/scripts/run/run-carry-flush.ts +0 -58
  250. package/scripts/run/run-transcript.golden.txt +0 -57
  251. package/scripts/run/run-wake-work.ts +0 -108
  252. package/scripts/sync/dependabot-pin-logic.ts +0 -135
  253. package/scripts/test/classify-isolation.ts +0 -149
  254. package/scripts/test/http-fault-injection.ts +0 -79
  255. package/scripts/test/josh-harness-environment.ts +0 -260
  256. package/scripts/test/josh-harness.ts +0 -96
  257. package/scripts/test/pilot-files.ts +0 -452
  258. package/scripts/test/pilot-measure.ts +0 -78
  259. package/scripts/test/test-network-guard.ts +0 -453
  260. package/scripts/test/test-repository-guard.ts +0 -317
  261. package/scripts/test/test-state-guard.ts +0 -85
  262. package/scripts/test/test-stdout-guard.ts +0 -54
  263. package/scripts/test/test-telegram-guard.ts +0 -90
  264. package/scripts/test/unit-guard-environment.ts +0 -12
  265. package/scripts/test/unit-projects.ts +0 -139
  266. package/scripts/test/vitest-include-globs.ts +0 -12
  267. package/scripts/time-runtime/time-batch-guard-fixtures.ts +0 -66
  268. package/scripts-ai/completion-gate.ts +0 -13
  269. package/scripts-ai/environment-loader.ts +0 -9
  270. /package/{scripts-ai → scripts/epic}/epic-cli-argv.ts +0 -0
  271. /package/{scripts-ai → scripts/epic}/epic-cli-remove.ts +0 -0
  272. /package/{scripts-ai → scripts/git}/followup-issue-number.ts +0 -0
@@ -1,139 +0,0 @@
1
- import { agent_session_environment } from '#scripts/josh/agent-session-environment'
2
- import { PILOT_FILES } from './pilot-files'
3
- import { VITEST_INCLUDE_GLOBS } from './vitest-include-globs'
4
-
5
- // The unit suite runs as two Vitest projects so the isolation-safe files can skip per-file worker
6
- // isolation, which re-evaluates every shared module once per file (joshuafolkken/kit#2170). Measured
7
- // back to back on the pilot set, isolate:false ran it in 27.5s against 64.7s isolated — a 57% cut,
8
- // because module evaluation is about half of a run's wall clock.
9
- //
10
- // **The two projects partition the suite exactly.** `pure` runs the classifier's isolation-free set;
11
- // `isolated` runs everything else the main globs match, excluding the pilot files so no file lands in
12
- // both. Their union is every included file bar the packed-consumer smoke test, and nothing runs
13
- // twice — which is what keeps the gate's green condition identical to the single-project suite it
14
- // replaces. `classify-isolation.ts` lists a file as pure only when it mutates no state a sibling in
15
- // the same worker could observe, so isolate:false changes how the pure files run, never whether they
16
- // pass.
17
-
18
- const TEST_TIMEOUT_MS = 10_000
19
-
20
- // Smoke test packs and installs the real tarball — too slow (~60 s setup) for the unit gate. Run
21
- // before release with: pnpm vitest run --config vitest.harness.config.ts
22
- const MAIN_EXCLUDE: ReadonlyArray<string> = ['scripts/build/packed-consumer.test.ts']
23
-
24
- // **`JOSH_LANE_CHILD` is blanked so the unit suite never inherits the lane it happens to run in**
25
- // (joshuafolkken/kit#2310). The gate runs inside a dispatched lane child, whose mark and lane cwd would
26
- // otherwise make every world-consulting rule guard (`pre-gate-cut`, `implementation-cut`, `lane-park`)
27
- // read a delivery fixture as a real lane-child call and fire on it. A suite that wants to test
28
- // lane-child behavior sets the mark itself in its own `beforeEach`, exactly as it always has; blank is
29
- // the "no dispatch mark" a person's session carries, which `marked_issue` reads as absent.
30
- //
31
- // **The proxy spellings are blanked for the same reason** (joshuafolkken/kit#2436): a package-manager
32
- // wrapper writes its loopback proxy and CA into everything `pnpm` spawns, so a suite asserting what a
33
- // `gh` spawn receives would pass in CI and fail on a machine with the wrapper. A suite about proxies
34
- // declares the one it is testing in its own `beforeEach`.
35
- //
36
- // **The detached ship supervisor's marks are blanked too** (joshuafolkken/kit#2456): the pre-push unit
37
- // run inherits `JOSH_SHIP_SUPERVISED` and `JOSH_AGENT_PROVIDER` from the supervisor that pushes, so a
38
- // ship fixture would take the supervised stop path — and try to relaunch a real lane child — only there.
39
- const PROXY_ENV: Record<string, string> = Object.fromEntries(
40
- [...agent_session_environment.PROXY_KEYS, agent_session_environment.PROXY_CERTIFICATE_KEY].map(
41
- (key) => [key, ''],
42
- ),
43
- )
44
-
45
- const ENV: Record<string, string> = {
46
- ...PROXY_ENV,
47
- CLAUDE_CODE_SESSION_ID: 'vitest-session',
48
- CODEX_THREAD_ID: '',
49
- JOSH_AGENT_PROVIDER: '',
50
- JOSH_LANE_CHILD: '',
51
- JOSH_SHIP_SUPERVISED: '',
52
- }
53
-
54
- const PURE_PROJECT = 'pure'
55
- const ISOLATED_PROJECT = 'isolated'
56
-
57
- // The state guard runs on the pure project alone. isolate:false is what lets one file see the git
58
- // branch, working tree or GIT_* variables a sibling left changed, so that is the only run where a leak
59
- // is a correctness problem rather than a latent one — and the isolated project keeps exactly the guards
60
- // the single-project suite had. The network guard is armed once at the root instead, since it arms
61
- // `PATH` before any worker of either project forks.
62
- const STATE_GUARD: ReadonlyArray<string> = ['./scripts/test/test-state-guard.ts']
63
-
64
- // Runs in every worker of both projects, before each test, and silences the real streams for the test
65
- // body so a fixture's direct `process.stdout` write cannot leak into `pnpm josh test:unit`'s output
66
- // (joshuafolkken/kit#2296). `setupFiles` rather than `globalSetup` because it must run inside the
67
- // worker where the test's writes happen, not once in the main process.
68
- const STDOUT_GUARD: ReadonlyArray<string> = ['./scripts/test/test-stdout-guard.ts']
69
-
70
- // Runs in every worker for the same reason: it wraps that worker's own `fetch`, refusing a real
71
- // Telegram send and recording which test tried (joshuafolkken/kit#2494).
72
- const TELEGRAM_GUARD: ReadonlyArray<string> = ['./scripts/test/test-telegram-guard.ts']
73
-
74
- interface UnitProjectTest {
75
- name: string
76
- env: Record<string, string>
77
- include: ReadonlyArray<string>
78
- exclude: ReadonlyArray<string>
79
- isolate: boolean
80
- testTimeout: number
81
- globalSetup: ReadonlyArray<string>
82
- setupFiles: ReadonlyArray<string>
83
- }
84
-
85
- interface UnitProject {
86
- test: UnitProjectTest
87
- }
88
-
89
- interface UnitProjectSpec {
90
- name: string
91
- include: ReadonlyArray<string>
92
- isolate: boolean
93
- exclude?: ReadonlyArray<string>
94
- globalSetup?: ReadonlyArray<string>
95
- }
96
-
97
- function unit_project(spec: UnitProjectSpec): UnitProject {
98
- return {
99
- test: {
100
- name: spec.name,
101
- env: ENV,
102
- include: [...spec.include],
103
- exclude: [...(spec.exclude ?? [])],
104
- isolate: spec.isolate,
105
- testTimeout: TEST_TIMEOUT_MS,
106
- globalSetup: [...(spec.globalSetup ?? [])],
107
- setupFiles: [...STDOUT_GUARD, ...TELEGRAM_GUARD],
108
- },
109
- }
110
- }
111
-
112
- const UNIT_PROJECTS: ReadonlyArray<UnitProject> = [
113
- unit_project({
114
- name: PURE_PROJECT,
115
- include: PILOT_FILES,
116
- isolate: false,
117
- globalSetup: STATE_GUARD,
118
- }),
119
- unit_project({
120
- name: ISOLATED_PROJECT,
121
- include: VITEST_INCLUDE_GLOBS,
122
- isolate: true,
123
- exclude: [...MAIN_EXCLUDE, ...PILOT_FILES],
124
- }),
125
- ]
126
-
127
- const unit_projects = {
128
- ENV,
129
- ISOLATED_PROJECT,
130
- MAIN_EXCLUDE,
131
- PURE_PROJECT,
132
- STATE_GUARD,
133
- STDOUT_GUARD,
134
- TELEGRAM_GUARD,
135
- UNIT_PROJECTS,
136
- }
137
-
138
- export type { UnitProject, UnitProjectTest }
139
- export { unit_projects }
@@ -1,12 +0,0 @@
1
- const VITEST_INCLUDE_GLOBS: ReadonlyArray<string> = [
2
- '*.test.ts',
3
- 'scripts/**/*.test.ts',
4
- 'scripts-ai/**/*.test.ts',
5
- 'env/**/*.test.ts',
6
- 'eslint/**/*.test.ts',
7
- 'ports/**/*.test.ts',
8
- 'prettier/**/*.test.ts',
9
- 'templates/**/*.test.ts',
10
- ]
11
-
12
- export { VITEST_INCLUDE_GLOBS }
@@ -1,66 +0,0 @@
1
- import type { GuardedCall } from './time-batch-guard'
2
-
3
- // The calls, labels and transcript builder the batch-guard suite is written from, lifted out of
4
- // `time-batch-guard.test.ts` so the suite stays under its line limit as kit#2311 adds the read-fold
5
- // cases (joshuafolkken/kit#2311). Fixtures rather than tests, so they carry no `describe`; the one
6
- // test file that reads them imports the names it already used.
7
-
8
- const NEVER_REFUSED = 0
9
- const FRESH_PATH = 'scripts/fresh.ts'
10
- // A path-shaped word that appears only inside quotes (joshuafolkken/kit#1611).
11
- const QUOTED_PATTERN = 'scripts/time'
12
- const FRESH_CALL: GuardedCall = { name: 'Read', input: { file_path: FRESH_PATH } }
13
- // The two calls both predicate tables name, and their labels, so neither the fixture nor the wording is
14
- // written twice.
15
- const EDIT_LABEL = 'an edit'
16
- const SED_LABEL = 'an in-place sed'
17
- const FILE_READ_LABEL = 'a file read'
18
- const EDIT_TOOL = 'Edit'
19
- // Named the way this harness names it. Neither spelling of the delegation tool is in the bundleable
20
- // set, so the case reads the same under `Task`.
21
- const DELEGATION_TOOL = 'Agent'
22
- const WRITE_TOOL = 'Write'
23
- const WRITE_LABEL = 'a whole-file write'
24
- const EDIT_CALL: GuardedCall = { name: EDIT_TOOL, input: { file_path: FRESH_PATH } }
25
- const IN_PLACE_SED_CALL: GuardedCall = {
26
- name: 'Bash',
27
- input: { command: `sed -i '' s/a/b/ ${FRESH_PATH}` },
28
- }
29
- const SHELL_READ_CALL: GuardedCall = { name: 'Bash', input: { command: `cat ${FRESH_PATH}` } }
30
- const JOSH_CALL: GuardedCall = { name: 'Bash', input: { command: 'pnpm josh gate' } }
31
- const CHAINED_SED_CALL: GuardedCall = {
32
- name: 'Bash',
33
- input: { command: `cat notes.md && sed -i '' s/a/b/ ${FRESH_PATH}` },
34
- }
35
- const REDIRECTION_CALL: GuardedCall = {
36
- name: 'Bash',
37
- input: { command: "jq '.x' a.json > b.json" },
38
- }
39
- const WRITE_CALL: GuardedCall = { name: WRITE_TOOL, input: { file_path: FRESH_PATH } }
40
-
41
- // The turns of one run, joined the way Claude Code writes them: one line per content block.
42
- function transcript(...groups: Array<Array<string>>): string {
43
- return groups.flat().join('\n')
44
- }
45
-
46
- export {
47
- CHAINED_SED_CALL,
48
- DELEGATION_TOOL,
49
- EDIT_CALL,
50
- EDIT_LABEL,
51
- EDIT_TOOL,
52
- FILE_READ_LABEL,
53
- FRESH_CALL,
54
- FRESH_PATH,
55
- IN_PLACE_SED_CALL,
56
- JOSH_CALL,
57
- NEVER_REFUSED,
58
- QUOTED_PATTERN,
59
- REDIRECTION_CALL,
60
- SED_LABEL,
61
- SHELL_READ_CALL,
62
- WRITE_CALL,
63
- WRITE_LABEL,
64
- WRITE_TOOL,
65
- transcript,
66
- }
@@ -1,13 +0,0 @@
1
- const GATE_LINT = 'pnpm run lint'
2
- const GATE_CHECK_CI = 'pnpm josh check:svelte:ci'
3
- const GATE_CSPELL = 'pnpm josh cspell:dot'
4
- const GATE_TEST_UNIT = 'pnpm josh test:unit'
5
-
6
- const COMPLETION_GATE_STEPS: ReadonlyArray<string> = [
7
- GATE_LINT,
8
- GATE_CHECK_CI,
9
- GATE_CSPELL,
10
- GATE_TEST_UNIT,
11
- ]
12
-
13
- export { COMPLETION_GATE_STEPS, GATE_LINT, GATE_CHECK_CI, GATE_CSPELL, GATE_TEST_UNIT }
@@ -1,9 +0,0 @@
1
- function load_optional_environment(): void {
2
- try {
3
- process.loadEnvFile('.env')
4
- } catch {
5
- // .env is optional
6
- }
7
- }
8
-
9
- export { load_optional_environment }
File without changes
File without changes