llm-wb 0.1.0-beta.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 (170) hide show
  1. package/.agentic/00.chat/README.md +78 -0
  2. package/.agentic/00.chat/checklists/before-commit.md +195 -0
  3. package/.agentic/00.chat/checklists/llm-workbench-public-beta.md +94 -0
  4. package/.agentic/00.chat/commands/README.md +108 -0
  5. package/.agentic/00.chat/migration-plan.md +132 -0
  6. package/.agentic/00.chat/skills/session-summary.md +48 -0
  7. package/.agentic/00.chat/standards/llm-workbench-public-beta-contract.md +216 -0
  8. package/.agentic/00.chat/standards/main-refresh-conflict-types.md +358 -0
  9. package/.agentic/00.chat/workflows/README.md +40 -0
  10. package/.agentic/00.chat/workflows/bootstrap-chat-workbench-repo.md +212 -0
  11. package/.agentic/00.chat/workflows/chat-cleanup.md +102 -0
  12. package/.agentic/00.chat/workflows/chat-commit.md +56 -0
  13. package/.agentic/00.chat/workflows/chat-promote-to-main.md +169 -0
  14. package/.agentic/00.chat/workflows/chat-refresh-from-main.md +242 -0
  15. package/.agentic/00.chat/workflows/chat-reporting.md +69 -0
  16. package/.agentic/00.chat/workflows/chat-start.md +173 -0
  17. package/.agentic/00.chat/workflows/chat-upstream-reusable-lesson.md +123 -0
  18. package/.agentic/shared/standards/README.md +32 -0
  19. package/.agentic/shared/standards/upstream-repo-bootstrap.md +131 -0
  20. package/.agentic/shared/workflows/README.md +35 -0
  21. package/.agentic/shared/workflows/capability-resolution-workflow.md +189 -0
  22. package/.agentic/shared/workflows/change-shared-process.md +92 -0
  23. package/.cursor/rules/llm-workbench.mdc +17 -0
  24. package/.github/copilot-instructions.md +16 -0
  25. package/AGENTS.md +63 -0
  26. package/CLAUDE.md +16 -0
  27. package/CONTRIBUTING.md +57 -0
  28. package/LICENSE +21 -0
  29. package/LLM_WORKBENCH.md +17 -0
  30. package/README.md +98 -0
  31. package/SECURITY.md +44 -0
  32. package/bin/llm-workbench.js +672 -0
  33. package/docs/00.chat/README.md +47 -0
  34. package/docs/00.chat/llm-workbench-acceptance-matrix.md +55 -0
  35. package/docs/00.chat/script-layout.md +107 -0
  36. package/docs/adapting-to-your-repo.md +29 -0
  37. package/docs/concepts.md +38 -0
  38. package/docs/install.md +114 -0
  39. package/docs/public-beta-contract.md +45 -0
  40. package/docs/workflows.md +103 -0
  41. package/examples/minimal-repo/README.md +13 -0
  42. package/package.json +93 -0
  43. package/scripts/00.chat/README.md +46 -0
  44. package/scripts/00.chat/bootstrap/README.md +35 -0
  45. package/scripts/00.chat/bootstrap/audit-chat-bootstrap-file-set/README.md +39 -0
  46. package/scripts/00.chat/bootstrap/audit-chat-bootstrap-file-set/script.sh +213 -0
  47. package/scripts/00.chat/closeout/README.md +30 -0
  48. package/scripts/00.chat/closeout/build-closeout-prompt/README.md +35 -0
  49. package/scripts/00.chat/closeout/build-closeout-prompt/script.sh +124 -0
  50. package/scripts/00.chat/command/README.md +31 -0
  51. package/scripts/00.chat/command/close/README.md +30 -0
  52. package/scripts/00.chat/command/close/script.sh +25 -0
  53. package/scripts/00.chat/command/dispatcher/README.md +46 -0
  54. package/scripts/00.chat/command/dispatcher/script.sh +91 -0
  55. package/scripts/00.chat/command/dispatcher/smoke-test.sh +168 -0
  56. package/scripts/00.chat/command/new/README.md +32 -0
  57. package/scripts/00.chat/command/new/script.sh +28 -0
  58. package/scripts/00.chat/command/open-window/README.md +38 -0
  59. package/scripts/00.chat/command/open-window/script.sh +25 -0
  60. package/scripts/00.chat/command/package-scripts/README.md +34 -0
  61. package/scripts/00.chat/command/package-scripts/smoke-test.sh +113 -0
  62. package/scripts/00.chat/git/README.md +30 -0
  63. package/scripts/00.chat/git/cleanup-empty-chat-branches/README.md +36 -0
  64. package/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh +243 -0
  65. package/scripts/00.chat/git/cleanup-empty-chat-branches/smoke-test.sh +136 -0
  66. package/scripts/00.chat/local-merge/README.md +30 -0
  67. package/scripts/00.chat/local-merge/list-active-chat-branches/README.md +29 -0
  68. package/scripts/00.chat/local-merge/list-active-chat-branches/script.sh +109 -0
  69. package/scripts/00.chat/local-merge/report-chat-branch-overlaps/README.md +29 -0
  70. package/scripts/00.chat/local-merge/report-chat-branch-overlaps/script.sh +142 -0
  71. package/scripts/00.chat/local-merge/verify-chat-ready-to-merge-local-main/README.md +33 -0
  72. package/scripts/00.chat/local-merge/verify-chat-ready-to-merge-local-main/script.sh +345 -0
  73. package/scripts/00.chat/local-merge/verify-chat-ready-to-merge-local-main/smoke-test.sh +244 -0
  74. package/scripts/00.chat/main-refresh/README.md +39 -0
  75. package/scripts/00.chat/main-refresh/apply-rehearsed-refresh/README.md +32 -0
  76. package/scripts/00.chat/main-refresh/apply-rehearsed-refresh/script.sh +198 -0
  77. package/scripts/00.chat/main-refresh/check-chat-is-current-with-main/README.md +30 -0
  78. package/scripts/00.chat/main-refresh/check-chat-is-current-with-main/script.sh +121 -0
  79. package/scripts/00.chat/main-refresh/classify-conflict/README.md +39 -0
  80. package/scripts/00.chat/main-refresh/classify-conflict/script.sh +169 -0
  81. package/scripts/00.chat/main-refresh/classify-conflict/smoke-test.sh +137 -0
  82. package/scripts/00.chat/main-refresh/classify-refresh-readiness/README.md +35 -0
  83. package/scripts/00.chat/main-refresh/classify-refresh-readiness/script.sh +171 -0
  84. package/scripts/00.chat/main-refresh/classify-refresh-readiness/smoke-test.sh +132 -0
  85. package/scripts/00.chat/main-refresh/rehearse-refresh-from-main/README.md +34 -0
  86. package/scripts/00.chat/main-refresh/rehearse-refresh-from-main/script.sh +124 -0
  87. package/scripts/00.chat/main-refresh/rehearse-refresh-from-main/smoke-test.sh +257 -0
  88. package/scripts/00.chat/main-refresh/show-main-update-status/README.md +31 -0
  89. package/scripts/00.chat/main-refresh/show-main-update-status/script.sh +73 -0
  90. package/scripts/00.chat/main-refresh/verify-conflict-audit/README.md +37 -0
  91. package/scripts/00.chat/main-refresh/verify-conflict-audit/script.sh +154 -0
  92. package/scripts/00.chat/main-refresh/verify-conflict-audit/smoke-test.sh +99 -0
  93. package/scripts/00.chat/metrics/README.md +35 -0
  94. package/scripts/00.chat/metrics/data/chat-pricing.json +107 -0
  95. package/scripts/00.chat/metrics/data/chat-pricing.schema.json +63 -0
  96. package/scripts/00.chat/metrics/estimate-chat-cost/README.md +40 -0
  97. package/scripts/00.chat/metrics/estimate-chat-cost/script.js +130 -0
  98. package/scripts/00.chat/migration/README.md +30 -0
  99. package/scripts/00.chat/migration/audit-chat-layer-migration/README.md +33 -0
  100. package/scripts/00.chat/migration/audit-chat-layer-migration/script.sh +127 -0
  101. package/scripts/00.chat/recovery/README.md +30 -0
  102. package/scripts/00.chat/recovery/import-active-paths-to-chat-worktree/README.md +76 -0
  103. package/scripts/00.chat/recovery/import-active-paths-to-chat-worktree/script.sh +212 -0
  104. package/scripts/00.chat/recovery/import-active-paths-to-chat-worktree/smoke-test.sh +162 -0
  105. package/scripts/00.chat/reporting/README.md +30 -0
  106. package/scripts/00.chat/reporting/generate-commit-log-summary/README.md +35 -0
  107. package/scripts/00.chat/reporting/generate-commit-log-summary/script.sh +299 -0
  108. package/scripts/00.chat/reporting/generate-commit-log-summary/smoke-test.sh +93 -0
  109. package/scripts/00.chat/reporting/report-chat-workspaces/README.md +32 -0
  110. package/scripts/00.chat/reporting/report-chat-workspaces/script.sh +82 -0
  111. package/scripts/00.chat/session-log/README.md +33 -0
  112. package/scripts/00.chat/session-log/check-commit-prerequisites/README.md +89 -0
  113. package/scripts/00.chat/session-log/check-commit-prerequisites/script.sh +121 -0
  114. package/scripts/00.chat/session-log/check-commit-prerequisites/smoke-test.sh +119 -0
  115. package/scripts/00.chat/session-log/check-commitlog-deletions/README.md +90 -0
  116. package/scripts/00.chat/session-log/check-commitlog-deletions/script.sh +131 -0
  117. package/scripts/00.chat/session-log/check-commitlog-deletions/smoke-test.sh +123 -0
  118. package/scripts/00.chat/session-log/checkpoint-chat-session-log/README.md +98 -0
  119. package/scripts/00.chat/session-log/checkpoint-chat-session-log/script.sh +126 -0
  120. package/scripts/00.chat/session-log/paths/README.md +38 -0
  121. package/scripts/00.chat/session-log/paths/lib.sh +133 -0
  122. package/scripts/00.chat/session-log/prepare-chat-session-before-commit/README.md +90 -0
  123. package/scripts/00.chat/session-log/prepare-chat-session-before-commit/script.sh +145 -0
  124. package/scripts/00.chat/session-log/read-current-chat-log/README.md +44 -0
  125. package/scripts/00.chat/session-log/read-current-chat-log/script.sh +92 -0
  126. package/scripts/00.chat/session-log/read-current-chat-log/smoke-test.sh +127 -0
  127. package/scripts/00.chat/session-log/record-chat-commit/README.md +133 -0
  128. package/scripts/00.chat/session-log/record-chat-commit/script.sh +394 -0
  129. package/scripts/00.chat/session-log/record-chat-commit/smoke-test.sh +227 -0
  130. package/scripts/00.chat/session-log/record-main-refresh-conflict/README.md +34 -0
  131. package/scripts/00.chat/session-log/record-main-refresh-conflict/script.sh +239 -0
  132. package/scripts/00.chat/session-log/rename-current-chat-log-folder/README.md +32 -0
  133. package/scripts/00.chat/session-log/rename-current-chat-log-folder/script.sh +112 -0
  134. package/scripts/00.chat/session-log/update-chat-log/README.md +32 -0
  135. package/scripts/00.chat/session-log/update-chat-log/script.sh +294 -0
  136. package/scripts/00.chat/startup/README.md +37 -0
  137. package/scripts/00.chat/startup/auto-start-missing-session/README.md +113 -0
  138. package/scripts/00.chat/startup/auto-start-missing-session/script.sh +54 -0
  139. package/scripts/00.chat/startup/resolve-current-chat-session/README.md +57 -0
  140. package/scripts/00.chat/startup/resolve-current-chat-session/script.sh +47 -0
  141. package/scripts/00.chat/startup/resolve-current-chat-session/smoke-test.sh +130 -0
  142. package/scripts/00.chat/startup/start-chat-session/README.md +197 -0
  143. package/scripts/00.chat/startup/start-chat-session/script.sh +330 -0
  144. package/scripts/00.chat/startup/start-chat-session/smoke-test.sh +182 -0
  145. package/scripts/00.chat/startup/start-new-chat/README.md +31 -0
  146. package/scripts/00.chat/startup/start-new-chat/script.sh +29 -0
  147. package/scripts/00.chat/transcript/README.md +36 -0
  148. package/scripts/00.chat/transcript/discover-codex-session-log/README.md +32 -0
  149. package/scripts/00.chat/transcript/discover-codex-session-log/script.sh +106 -0
  150. package/scripts/00.chat/transcript/register-codex-session-log/README.md +32 -0
  151. package/scripts/00.chat/transcript/register-codex-session-log/script.sh +115 -0
  152. package/scripts/00.chat/worktree/README.md +32 -0
  153. package/scripts/00.chat/worktree/check-write-location/README.md +87 -0
  154. package/scripts/00.chat/worktree/check-write-location/script.sh +95 -0
  155. package/scripts/00.chat/worktree/dirty-worktree-check/README.md +77 -0
  156. package/scripts/00.chat/worktree/dirty-worktree-check/script.sh +93 -0
  157. package/scripts/00.chat/worktree/ensure-chat-worktree/README.md +33 -0
  158. package/scripts/00.chat/worktree/ensure-chat-worktree/script.sh +132 -0
  159. package/scripts/00.chat/worktree/open-window/README.md +34 -0
  160. package/scripts/00.chat/worktree/open-window/script.sh +131 -0
  161. package/scripts/00.chat/worktree/paths/README.md +32 -0
  162. package/scripts/00.chat/worktree/paths/lib.sh +71 -0
  163. package/scripts/01.harness/artifact-metadata/check-headers/script.sh +522 -0
  164. package/scripts/01.harness/artifact-metadata/check-headers/smoke-test.sh +48 -0
  165. package/scripts/01.harness/check-deterministic-process-drift.sh +416 -0
  166. package/scripts/01.harness/check-governed-script-command-drift.sh +184 -0
  167. package/scripts/01.harness/run-governed-script.sh +178 -0
  168. package/scripts/install.sh +503 -0
  169. package/scripts/uninstall.sh +199 -0
  170. package/tests/smoke-test-install.sh +70 -0
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # agentic-artifact:
5
+ # schema: agentic-artifact/v2
6
+ # id: chat.script.command.dispatcher.smoke-test
7
+ # version: 1
8
+ # status: active
9
+ # layer: 00.chat
10
+ # domain: validation
11
+ # disciplines:
12
+ # - agentic
13
+ # kind: script
14
+ # purpose: Smoke test the chat command dispatcher and chat subcommands.
15
+ # portability:
16
+ # class: reusable
17
+ # targets:
18
+ # - llm-workbench
19
+ # used_by:
20
+ # - id: chat.commands.readme
21
+ # path: .agentic/00.chat/commands/README.md
22
+ # - id: chat.workflows.bootstrap-chat-workbench-repo
23
+ # path: .agentic/00.chat/workflows/bootstrap-chat-workbench-repo.md
24
+ # - id: chat.script.command.dispatcher.readme
25
+ # path: scripts/00.chat/command/dispatcher/README.md
26
+ # effects:
27
+ # - branches
28
+ # - worktrees
29
+ # - writes-files
30
+
31
+ fail() {
32
+ echo "FAIL: $*" >&2
33
+ exit 1
34
+ }
35
+
36
+ SOURCE_ROOT="$(git rev-parse --show-toplevel)"
37
+ TMP_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/chat-command-smoke.XXXXXX")"
38
+
39
+ cleanup() {
40
+ rm -rf "$TMP_ROOT"
41
+ }
42
+
43
+ trap cleanup EXIT
44
+
45
+ REPO="$TMP_ROOT/repo"
46
+ mkdir -p "$REPO"
47
+ git -C "$REPO" init --quiet --initial-branch=main
48
+
49
+ mkdir -p \
50
+ "$REPO/scripts/00.chat/closeout/build-closeout-prompt" \
51
+ "$REPO/scripts/00.chat/command/close" \
52
+ "$REPO/scripts/00.chat/command/dispatcher" \
53
+ "$REPO/scripts/00.chat/command/new" \
54
+ "$REPO/scripts/00.chat/command/open-window" \
55
+ "$REPO/scripts/00.chat/git/cleanup-empty-chat-branches" \
56
+ "$REPO/scripts/00.chat/session-log/paths" \
57
+ "$REPO/scripts/00.chat/startup/auto-start-missing-session" \
58
+ "$REPO/scripts/00.chat/startup/start-chat-session" \
59
+ "$REPO/scripts/00.chat/startup/start-new-chat" \
60
+ "$REPO/scripts/00.chat/worktree/ensure-chat-worktree" \
61
+ "$REPO/scripts/00.chat/worktree/open-window" \
62
+ "$REPO/scripts/00.chat/worktree/paths"
63
+
64
+ cp "$SOURCE_ROOT/scripts/00.chat/command/dispatcher/script.sh" "$REPO/scripts/00.chat/command/dispatcher/script.sh"
65
+ cp "$SOURCE_ROOT/scripts/00.chat/command/new/script.sh" "$REPO/scripts/00.chat/command/new/script.sh"
66
+ cp "$SOURCE_ROOT/scripts/00.chat/command/close/script.sh" "$REPO/scripts/00.chat/command/close/script.sh"
67
+ cp "$SOURCE_ROOT/scripts/00.chat/command/open-window/script.sh" "$REPO/scripts/00.chat/command/open-window/script.sh"
68
+ cp "$SOURCE_ROOT/scripts/00.chat/session-log/paths/lib.sh" "$REPO/scripts/00.chat/session-log/paths/lib.sh"
69
+ cp "$SOURCE_ROOT/scripts/00.chat/worktree/paths/lib.sh" "$REPO/scripts/00.chat/worktree/paths/lib.sh"
70
+ cp "$SOURCE_ROOT/scripts/00.chat/worktree/ensure-chat-worktree/script.sh" "$REPO/scripts/00.chat/worktree/ensure-chat-worktree/script.sh"
71
+ cp "$SOURCE_ROOT/scripts/00.chat/worktree/open-window/script.sh" "$REPO/scripts/00.chat/worktree/open-window/script.sh"
72
+ cp "$SOURCE_ROOT/scripts/00.chat/startup/start-chat-session/script.sh" "$REPO/scripts/00.chat/startup/start-chat-session/script.sh"
73
+ cp "$SOURCE_ROOT/scripts/00.chat/startup/start-new-chat/script.sh" "$REPO/scripts/00.chat/startup/start-new-chat/script.sh"
74
+ cp "$SOURCE_ROOT/scripts/00.chat/closeout/build-closeout-prompt/script.sh" "$REPO/scripts/00.chat/closeout/build-closeout-prompt/script.sh"
75
+ cp "$SOURCE_ROOT/scripts/00.chat/startup/auto-start-missing-session/script.sh" "$REPO/scripts/00.chat/startup/auto-start-missing-session/script.sh"
76
+ cp "$SOURCE_ROOT/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh" "$REPO/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh"
77
+ chmod +x "$REPO/scripts/00.chat/closeout/build-closeout-prompt/script.sh" "$REPO/scripts/00.chat/command/dispatcher/script.sh" "$REPO/scripts/00.chat/command/new/script.sh" "$REPO/scripts/00.chat/command/close/script.sh" "$REPO/scripts/00.chat/command/open-window/script.sh" "$REPO/scripts/00.chat/startup/auto-start-missing-session/script.sh" "$REPO/scripts/00.chat/startup/start-chat-session/script.sh" "$REPO/scripts/00.chat/startup/start-new-chat/script.sh" "$REPO/scripts/00.chat/worktree/ensure-chat-worktree/script.sh" "$REPO/scripts/00.chat/worktree/open-window/script.sh" "$REPO/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh"
78
+ chmod 0644 "$REPO/scripts/00.chat/command/new/script.sh"
79
+
80
+ printf 'base\n' > "$REPO/README.md"
81
+ git -C "$REPO" add README.md scripts
82
+ git -C "$REPO" -c user.name='Smoke Test' -c user.email='smoke@example.invalid' commit --quiet -m 'base'
83
+
84
+ CHAT_COPY_PROMPT=skip \
85
+ bash -c 'cd "$1" && shift && "$@"' sh "$REPO" \
86
+ bash scripts/00.chat/command/dispatcher/script.sh list \
87
+ >"$TMP_ROOT/list.out"
88
+
89
+ grep -q '^ new$' "$TMP_ROOT/list.out" || fail "new command was not listed"
90
+ grep -q '^ close$' "$TMP_ROOT/list.out" || fail "close command was not listed"
91
+ grep -q '^ open-window$' "$TMP_ROOT/list.out" || fail "open-window command was not listed"
92
+
93
+ AGENTIC_CHAT_WORKTREE_ROOT="$TMP_ROOT/worktrees" \
94
+ CHAT_CLEANUP_EMPTY_BRANCHES=skip \
95
+ CHAT_COPY_PROMPT=skip \
96
+ CHAT_OPEN_WORKTREE_WINDOW=skip \
97
+ bash -c 'cd "$1" && shift && "$@"' sh "$REPO" \
98
+ bash scripts/00.chat/command/dispatcher/script.sh new "test command-created session" \
99
+ >"$TMP_ROOT/new.out"
100
+
101
+ grep -q 'Created branch: chat/' "$TMP_ROOT/new.out" || fail "new command did not create a chat branch"
102
+ grep -q 'Paste this into Codex / Claude / Mistral:' "$TMP_ROOT/new.out" || fail "new command did not print first prompt"
103
+
104
+ AGENTIC_CHAT_WORKTREE_ROOT="$TMP_ROOT/worktrees" \
105
+ CHAT_CLEANUP_EMPTY_BRANCHES=skip \
106
+ CHAT_COPY_PROMPT=skip \
107
+ CHAT_OPEN_WORKTREE_WINDOW=skip \
108
+ bash -c 'cd "$1" && shift && "$@"' sh "$REPO" \
109
+ bash scripts/00.chat/startup/auto-start-missing-session/script.sh "test opening prompt session" \
110
+ >"$TMP_ROOT/auto-start.out"
111
+
112
+ grep -q 'Created branch: chat/' "$TMP_ROOT/auto-start.out" || fail "auto-start did not create a chat branch"
113
+ grep -q 'Task: test opening prompt session' "$TMP_ROOT/auto-start.out" || fail "auto-start did not use opening prompt as task"
114
+
115
+ if CHAT_COPY_PROMPT=skip \
116
+ bash -c 'cd "$1" && shift && "$@"' sh "$REPO" \
117
+ bash scripts/00.chat/startup/auto-start-missing-session/script.sh new \
118
+ >"$TMP_ROOT/bare-new.out"; then
119
+ fail "bare new auto-start unexpectedly succeeded"
120
+ fi
121
+
122
+ grep -Fxq 'What should the new chat be about?' "$TMP_ROOT/bare-new.out" || fail "bare new did not ask for a task summary"
123
+
124
+ chat_branch="$(git -C "$REPO" branch --format='%(refname:short)' | grep '^chat/' | head -n 1)"
125
+ worktree_path="$(
126
+ git -C "$REPO" worktree list --porcelain \
127
+ | awk -v branch="refs/heads/${chat_branch}" '
128
+ /^worktree / { path = substr($0, 10) }
129
+ /^branch / && substr($0, 8) == branch { print path }
130
+ '
131
+ )"
132
+
133
+ if [ -z "$worktree_path" ]; then
134
+ fail "new command did not create a chat worktree"
135
+ fi
136
+
137
+ FAKE_BIN="$TMP_ROOT/fake-bin"
138
+ mkdir -p "$FAKE_BIN"
139
+ cat > "$FAKE_BIN/code" <<'EOF'
140
+ #!/usr/bin/env bash
141
+ printf '%s\n' "$*" > "$CODE_ARGS_FILE"
142
+ EOF
143
+ chmod +x "$FAKE_BIN/code"
144
+
145
+ CODE_ARGS_FILE="$TMP_ROOT/code-args.out" \
146
+ PATH="$FAKE_BIN:$PATH" \
147
+ bash -c 'cd "$1" && shift && "$@"' sh "$worktree_path" \
148
+ bash scripts/00.chat/command/dispatcher/script.sh open window \
149
+ >"$TMP_ROOT/open-window.out"
150
+
151
+ grep -q '^Opened VS Code window: ' "$TMP_ROOT/open-window.out" \
152
+ || fail "open window command did not report opened worktree"
153
+ grep -q -- '^--new-window ' "$TMP_ROOT/code-args.out" \
154
+ || fail "open window command did not call code with the chat worktree"
155
+
156
+ CHAT_COPY_PROMPT=skip \
157
+ bash -c 'cd "$1" && shift && "$@"' sh "$worktree_path" \
158
+ bash scripts/00.chat/command/dispatcher/script.sh close \
159
+ >"$TMP_ROOT/close.out"
160
+
161
+ grep -q 'Workflow: .agentic/00.chat/workflows/chat-promote-to-main.md' "$TMP_ROOT/close.out" \
162
+ || fail "close command did not route to promote workflow"
163
+ grep -q 'Ask for explicit approval before creating any task commit.' "$TMP_ROOT/close.out" \
164
+ || fail "close command did not preserve commit approval boundary"
165
+ grep -q 'Do not push to origin unless I explicitly approve a separate push.' "$TMP_ROOT/close.out" \
166
+ || fail "close command did not preserve push approval boundary"
167
+
168
+ echo "chat command smoke test passed."
@@ -0,0 +1,32 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.script.command.new.readme
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: command
8
+ disciplines:
9
+ - agentic
10
+ kind: capability-readme
11
+ purpose: Explain the public chat new-session command entrypoint.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ used_by:
17
+ - id: chat.script.command.new
18
+ path: scripts/00.chat/command/new/script.sh
19
+ -->
20
+ # New Command
21
+
22
+ `script.sh` is the canonical entrypoint for the public `chat:new` command. It
23
+ delegates to `scripts/00.chat/startup/start-new-chat/script.sh`.
24
+
25
+ The command keeps the public interface small: humans ask for a new chat, and
26
+ startup owns branch creation, worktree creation, session-log initialization,
27
+ chat lifecycle metadata, and terminal handoff. Prompt-level routing and context
28
+ selection are resolved later from the current request, repo assistant
29
+ instructions, and any repo-provided context router if one exists.
30
+
31
+ This command can create branches, worktrees, and session-log files through the
32
+ startup engine.
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # agentic-artifact:
5
+ # schema: agentic-artifact/v2
6
+ # id: chat.script.command.new
7
+ # version: 1
8
+ # status: active
9
+ # layer: 00.chat
10
+ # domain: command
11
+ # disciplines:
12
+ # - agentic
13
+ # kind: script
14
+ # purpose: Dispatch the public chat new-session command to the startup capability.
15
+ # portability:
16
+ # class: required
17
+ # targets:
18
+ # - llm-workbench
19
+ # used_by:
20
+ # - id: chat.script.command.dispatcher
21
+ # path: scripts/00.chat/command/dispatcher/script.sh
22
+ # effects:
23
+ # - branches
24
+ # - stages-files
25
+ # - worktrees
26
+ # - writes-files
27
+
28
+ exec bash scripts/00.chat/startup/start-new-chat/script.sh "$@"
@@ -0,0 +1,38 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.script.command.open-window.readme
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: command
8
+ disciplines:
9
+ - agentic
10
+ kind: capability-readme
11
+ purpose: Explain the public chat open-window command entrypoint.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ used_by:
17
+ - id: chat.script.command.open-window
18
+ path: scripts/00.chat/command/open-window/script.sh
19
+ -->
20
+ # Open Window Command
21
+
22
+ `script.sh` is the canonical entrypoint for opening the current chat-owned
23
+ worktree in a new VS Code window.
24
+
25
+ Run it as:
26
+
27
+ ```bash
28
+ npm run chat -- open window
29
+ ```
30
+
31
+ The hyphenated form also works:
32
+
33
+ ```bash
34
+ npm run chat -- open-window
35
+ ```
36
+
37
+ When run outside a chat branch, pass either a chat worktree path or a session-log
38
+ `README.md` path.
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # agentic-artifact:
5
+ # schema: agentic-artifact/v2
6
+ # id: chat.script.command.open-window
7
+ # version: 1
8
+ # status: active
9
+ # layer: 00.chat
10
+ # domain: command
11
+ # disciplines:
12
+ # - agentic
13
+ # kind: script
14
+ # purpose: Dispatch the public chat open-window command to the worktree window capability.
15
+ # portability:
16
+ # class: required
17
+ # targets:
18
+ # - llm-workbench
19
+ # used_by:
20
+ # - id: chat.script.command.dispatcher
21
+ # path: scripts/00.chat/command/dispatcher/script.sh
22
+ # effects:
23
+ # - read-only
24
+
25
+ exec bash scripts/00.chat/worktree/open-window/script.sh "$@"
@@ -0,0 +1,34 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.script.command.package-scripts.readme
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: command
8
+ disciplines:
9
+ - agentic
10
+ kind: capability-readme
11
+ purpose: Explain validation for package.json chat command scripts.
12
+ portability:
13
+ class: reusable
14
+ targets:
15
+ - llm-workbench
16
+ used_by:
17
+ - id: chat.script.command.package-scripts.smoke-test
18
+ path: scripts/00.chat/command/package-scripts/smoke-test.sh
19
+ - id: chat.workflows.bootstrap-chat-workbench-repo
20
+ path: .agentic/00.chat/workflows/bootstrap-chat-workbench-repo.md
21
+ -->
22
+ # Package Scripts
23
+
24
+ This capability validates the public `package.json` `chat:*` command surface in
25
+ a throwaway repository.
26
+
27
+ The smoke test proves that package scripts can find their canonical
28
+ `scripts/00.chat/...` implementations after bootstrap. That matters for a
29
+ standalone workbench repo because outside engineers should not need to know the
30
+ internal folder layout before trying the harness.
31
+
32
+ This is validation tooling only; it is not a runtime command used during normal
33
+ chat work.
34
+
@@ -0,0 +1,113 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # agentic-artifact:
5
+ # schema: agentic-artifact/v2
6
+ # id: chat.script.command.package-scripts.smoke-test
7
+ # version: 1
8
+ # status: active
9
+ # layer: 00.chat
10
+ # domain: validation
11
+ # disciplines:
12
+ # - agentic
13
+ # kind: script
14
+ # purpose: Smoke test package.json chat command scripts against a throwaway repo.
15
+ # portability:
16
+ # class: reusable
17
+ # targets:
18
+ # - llm-workbench
19
+ # used_by:
20
+ # - id: chat.workflows.bootstrap-chat-workbench-repo
21
+ # path: .agentic/00.chat/workflows/bootstrap-chat-workbench-repo.md
22
+ # - id: chat.script.bootstrap.audit-chat-bootstrap-file-set
23
+ # path: scripts/00.chat/bootstrap/audit-chat-bootstrap-file-set/script.sh
24
+ # effects:
25
+ # - writes-files
26
+
27
+ fail() {
28
+ echo "FAIL: $*" >&2
29
+ exit 1
30
+ }
31
+
32
+ SOURCE_ROOT="$(git rev-parse --show-toplevel)"
33
+ TMP_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/chat-package-scripts-smoke.XXXXXX")"
34
+
35
+ cleanup() {
36
+ rm -rf "$TMP_ROOT"
37
+ }
38
+
39
+ trap cleanup EXIT
40
+
41
+ REPO="$TMP_ROOT/repo"
42
+ mkdir -p \
43
+ "$REPO/scripts/00.chat/closeout/build-closeout-prompt" \
44
+ "$REPO/scripts/00.chat/command/close" \
45
+ "$REPO/scripts/00.chat/command/dispatcher" \
46
+ "$REPO/scripts/00.chat/command/new" \
47
+ "$REPO/scripts/00.chat/command/open-window" \
48
+ "$REPO/scripts/00.chat/git/cleanup-empty-chat-branches" \
49
+ "$REPO/scripts/00.chat/reporting/generate-commit-log-summary" \
50
+ "$REPO/scripts/00.chat/reporting/report-chat-workspaces" \
51
+ "$REPO/scripts/00.chat/session-log/paths" \
52
+ "$REPO/scripts/00.chat/startup/start-new-chat" \
53
+ "$REPO/scripts/00.chat/worktree/open-window" \
54
+ "$REPO/scripts/00.chat/worktree/paths" \
55
+ "$REPO/commitLogs/2026/jun/19/test-chat"
56
+
57
+ git -C "$REPO" init --quiet --initial-branch=main
58
+
59
+ cp "$SOURCE_ROOT/package.json" "$REPO/package.json"
60
+ cp "$SOURCE_ROOT/scripts/00.chat/command/dispatcher/script.sh" "$REPO/scripts/00.chat/command/dispatcher/script.sh"
61
+ cp "$SOURCE_ROOT/scripts/00.chat/command/new/script.sh" "$REPO/scripts/00.chat/command/new/script.sh"
62
+ cp "$SOURCE_ROOT/scripts/00.chat/command/close/script.sh" "$REPO/scripts/00.chat/command/close/script.sh"
63
+ cp "$SOURCE_ROOT/scripts/00.chat/command/open-window/script.sh" "$REPO/scripts/00.chat/command/open-window/script.sh"
64
+ cp "$SOURCE_ROOT/scripts/00.chat/reporting/generate-commit-log-summary/script.sh" "$REPO/scripts/00.chat/reporting/generate-commit-log-summary/script.sh"
65
+ cp "$SOURCE_ROOT/scripts/00.chat/reporting/report-chat-workspaces/script.sh" "$REPO/scripts/00.chat/reporting/report-chat-workspaces/script.sh"
66
+ cp "$SOURCE_ROOT/scripts/00.chat/session-log/paths/lib.sh" "$REPO/scripts/00.chat/session-log/paths/lib.sh"
67
+ cp "$SOURCE_ROOT/scripts/00.chat/worktree/paths/lib.sh" "$REPO/scripts/00.chat/worktree/paths/lib.sh"
68
+ cp "$SOURCE_ROOT/scripts/00.chat/worktree/open-window/script.sh" "$REPO/scripts/00.chat/worktree/open-window/script.sh"
69
+ cp "$SOURCE_ROOT/scripts/00.chat/startup/start-new-chat/script.sh" "$REPO/scripts/00.chat/startup/start-new-chat/script.sh"
70
+ cp "$SOURCE_ROOT/scripts/00.chat/closeout/build-closeout-prompt/script.sh" "$REPO/scripts/00.chat/closeout/build-closeout-prompt/script.sh"
71
+ cp "$SOURCE_ROOT/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh" "$REPO/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh"
72
+ chmod +x \
73
+ "$REPO/scripts/00.chat/closeout/build-closeout-prompt/script.sh" \
74
+ "$REPO/scripts/00.chat/command/dispatcher/script.sh" \
75
+ "$REPO/scripts/00.chat/command/new/script.sh" \
76
+ "$REPO/scripts/00.chat/command/close/script.sh" \
77
+ "$REPO/scripts/00.chat/command/open-window/script.sh" \
78
+ "$REPO/scripts/00.chat/reporting/generate-commit-log-summary/script.sh" \
79
+ "$REPO/scripts/00.chat/reporting/report-chat-workspaces/script.sh" \
80
+ "$REPO/scripts/00.chat/worktree/open-window/script.sh" \
81
+ "$REPO/scripts/00.chat/startup/start-new-chat/script.sh" \
82
+ "$REPO/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh"
83
+
84
+ cat > "$REPO/commitLogs/2026/jun/19/test-chat/README.md" <<'EOF'
85
+ # Chat Session: test-chat
86
+
87
+ <!-- agentic-session
88
+ id: test-chat
89
+ chat_duration: 10s
90
+ estimated_chat_tokens: 20 tokens
91
+ estimated_chat_cost: USD 0.0006 estimated from estimated_chat_tokens
92
+ -->
93
+ EOF
94
+
95
+ git -C "$REPO" add package.json scripts commitLogs
96
+ git -C "$REPO" -c user.name='Smoke Test' -c user.email='smoke@example.invalid' commit --quiet -m 'fixture'
97
+
98
+ (
99
+ cd "$REPO"
100
+ npm run --silent chat:list > "$TMP_ROOT/list.out"
101
+ npm run --silent chat:commit-log-summary > "$TMP_ROOT/summary.out"
102
+ npm run --silent chat:cleanup-empty-branches -- --dry-run > "$TMP_ROOT/cleanup.out"
103
+ CHAT_OPEN_WORKTREE_WINDOW=skip npm run --silent chat:open-window -- "$REPO" > "$TMP_ROOT/open-window.out"
104
+ )
105
+
106
+ grep -q '^ close$' "$TMP_ROOT/list.out" || fail "chat:list did not list close"
107
+ grep -q '^ new$' "$TMP_ROOT/list.out" || fail "chat:list did not list new"
108
+ grep -q '^ open-window$' "$TMP_ROOT/list.out" || fail "chat:list did not list open-window"
109
+ grep -q '| Total | USD 0.0006 |' "$TMP_ROOT/summary.out" || fail "chat:commit-log-summary did not delegate"
110
+ grep -q 'Mode: dry-run' "$TMP_ROOT/cleanup.out" || fail "chat:cleanup-empty-branches did not delegate"
111
+ grep -q '^Skipping VS Code window open: ' "$TMP_ROOT/open-window.out" || fail "chat:open-window did not delegate"
112
+
113
+ echo "chat package scripts smoke test passed."
@@ -0,0 +1,30 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.script.git.readme
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: git
8
+ disciplines:
9
+ - agentic
10
+ kind: script-domain-readme
11
+ purpose: Explain chat-owned Git maintenance scripts.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ used_by:
17
+ - id: chat.workflows.chat-cleanup
18
+ path: .agentic/00.chat/workflows/chat-cleanup.md
19
+ - id: chat.script.git.cleanup-empty-chat-branches.readme
20
+ path: scripts/00.chat/git/cleanup-empty-chat-branches/README.md
21
+ -->
22
+ # Git Scripts
23
+
24
+ Git scripts in this domain handle chat-owned Git maintenance. They are not
25
+ general-purpose Git wrappers. They exist only where chat lifecycle behavior
26
+ needs deterministic branch or log handling.
27
+
28
+ Destructive behavior must be explicit and governed. Scripts should default to
29
+ inspection or dry-run when deletion is possible.
30
+
@@ -0,0 +1,36 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.script.git.cleanup-empty-chat-branches.readme
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: git
8
+ disciplines:
9
+ - agentic
10
+ kind: capability-readme
11
+ purpose: Explain empty chat branch and session-log cleanup.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ used_by:
17
+ - id: chat.workflows.chat-cleanup
18
+ path: .agentic/00.chat/workflows/chat-cleanup.md
19
+ - id: chat.script.git.cleanup-empty-chat-branches
20
+ path: scripts/00.chat/git/cleanup-empty-chat-branches/script.sh
21
+ -->
22
+ # Cleanup Empty Chat Branches
23
+
24
+ `script.sh` finds `chat/*` branches with no commits beyond the base branch and
25
+ optionally removes them with their matching empty session logs.
26
+
27
+ Dry-run is the default. Use `--apply` only when deletion is explicitly approved.
28
+ The script never deletes the current branch and skips branches that are checked
29
+ out in any worktree.
30
+
31
+ A session log is deleted only when it belongs to the empty branch and contains
32
+ no recorded commits or retention marker. That protects real chat evidence while
33
+ allowing abandoned zero-work sessions to be cleaned up.
34
+
35
+ `smoke-test.sh` exercises the branch and log safety rules in a throwaway repo.
36
+