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,242 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.workflows.chat-refresh-from-main
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: main-refresh
8
+ disciplines:
9
+ - agentic
10
+ kind: workflow
11
+ purpose: Govern refreshing a chat branch from local main without losing work or bypassing
12
+ recovery paths.
13
+ portability:
14
+ class: required
15
+ targets:
16
+ - llm-workbench
17
+ used_by:
18
+ - id: shared.workflows.change-shared-process
19
+ path: .agentic/shared/workflows/change-shared-process.md
20
+ - id: harness.architecture.adr.0011-use-chat-owned-worktrees-for-local-convergence
21
+ -->
22
+ # Chat Refresh From Main Workflow
23
+
24
+ ## Use When
25
+
26
+ Use this after `main` changes, or when a chat branch may need to absorb newer
27
+ accepted work from `main`.
28
+
29
+ ## Purpose
30
+
31
+ Keep `main` as the canonical accepted baseline while preserving chat branch
32
+ history, user work, and session evidence.
33
+
34
+ ## Required Gates
35
+
36
+ Before changing branches, merging, rebasing, staging, or committing, run:
37
+
38
+ ```bash
39
+ bash scripts/00.chat/main-refresh/classify-refresh-readiness/script.sh
40
+ ```
41
+
42
+ <!-- deterministic-check: allow reason="refresh-readiness classifier determines dirty state; workflow defines the human-facing blocked response" -->
43
+ If the classifier reports `unsupported-dirty`, respond exactly:
44
+
45
+ ```txt
46
+ Blocked: required action is not governed.
47
+ Action needed: refresh chat branch from main
48
+ Blocking condition: unsupported dirty state before main refresh
49
+ Missing governance: .agentic/00.chat/workflows/chat-refresh-from-main.md does not define a deterministic recovery path for this dirty state
50
+ Confirm update the harness or approve a one-off exception?
51
+ ```
52
+
53
+ Do not edit files, change branches, stash, restore, merge, rebase, stage, or
54
+ commit while blocked.
55
+
56
+ ## Main Update Intake
57
+
58
+ 1. Confirm `main` exists locally:
59
+
60
+ ```bash
61
+ git show-ref --verify --quiet refs/heads/main
62
+ ```
63
+
64
+ <!-- deterministic-check: allow reason="show-main-update-status reports remote presence; workflow keeps the human fetch policy visible" -->
65
+ 2. If a remote exists, fetch before comparing:
66
+
67
+ ```bash
68
+ git fetch --prune
69
+ git branch -vv --all
70
+ ```
71
+
72
+ <!-- deterministic-check: allow reason="show-main-update-status emits the local-only freshness warning deterministically" -->
73
+ 3. If no remote exists, state that freshness is only local.
74
+
75
+ 4. Inspect branch relationship:
76
+
77
+ ```bash
78
+ bash scripts/00.chat/main-refresh/show-main-update-status/script.sh
79
+ ```
80
+
81
+ 5. Inspect active branch metadata and changed-path overlap:
82
+
83
+ ```bash
84
+ bash scripts/00.chat/local-merge/list-active-chat-branches/script.sh
85
+ bash scripts/00.chat/local-merge/report-chat-branch-overlaps/script.sh
86
+ ```
87
+
88
+ ## Refresh Policy
89
+
90
+ - New chat branches should start from `main`.
91
+ - Existing active chat branches should be compared with `main` before more
92
+ work is added.
93
+ - Main refresh is branch maintenance. Keep it separate from task commits.
94
+ - Prefer merging `main` into an active chat branch because it preserves history
95
+ and does not rewrite published or session evidence.
96
+ - For normal repository work, prefer a governed chat checkpoint commit before
97
+ refreshing from `main`; do not hide task work in stash by default.
98
+ - Preflight the refresh in a temporary worktree before mutating the active chat
99
+ worktree when the branch has task commits or a checkpoint.
100
+ - Rebase, cherry-pick repair, force update, branch deletion, and push require
101
+ explicit user approval in the current chat.
102
+ - Never discard dirty work to refresh a branch.
103
+ - Do not use `git stash` in this workflow unless a later governed stash
104
+ capability defines exact path scope, stash identity recording, apply/drop
105
+ behavior, and conflict handling.
106
+ - If conflicts appear outside a governed recovery path, stop after Git reports
107
+ the conflict set. Summarize the conflicting files and ask for approval before
108
+ resolving them.
109
+
110
+ ## Dirty State Classes
111
+
112
+ Classify before refresh:
113
+
114
+ ```bash
115
+ bash scripts/00.chat/main-refresh/classify-refresh-readiness/script.sh
116
+ ```
117
+
118
+ The classifier reports state; the workflow decides what is allowed.
119
+
120
+ - `clean`: the active chat worktree can use the normal refresh or preflight
121
+ flow.
122
+ - `current-session-bookkeeping`: dirty paths are limited to the current chat
123
+ session log. Preserve the session log. If the incoming `main` overlap
124
+ includes the current session log, stop.
125
+ - `repo-work`: dirty paths include normal repository work. Create a governed
126
+ checkpoint commit before refresh if the user approves. Do not stash by
127
+ default.
128
+ - `unsupported-dirty`: stop. The workflow does not own this recovery.
129
+
130
+ ## Checkpoint And Rehearsed Refresh
131
+
132
+ Use this when normal repository work exists on the chat branch or when a main
133
+ refresh should be rehearsed before mutating the active chat worktree.
134
+
135
+ <!-- deterministic-check: allow reason="checkpoint commits require human approval and existing commit gates" -->
136
+ 1. If normal repository work is dirty, create an explicit chat checkpoint commit
137
+ only after user approval and the relevant gates.
138
+ 2. Once the active chat worktree is clean, create a temporary refresh branch and
139
+ worktree:
140
+
141
+ ```bash
142
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/main-refresh/rehearse-refresh-from-main/script.sh
143
+ ```
144
+
145
+ 3. If preflight reports conflicts, stop before resolving. Classify each
146
+ conflicted path with:
147
+
148
+ ```bash
149
+ bash scripts/00.chat/main-refresh/classify-conflict/script.sh <conflicted-path>
150
+ ```
151
+
152
+ Use `.agentic/00.chat/standards/main-refresh-conflict-types.md` as the
153
+ authority for the classification. Resolve only conflicts with deterministic
154
+ actions in that standard. If no existing type fits, use the
155
+ missing-governance stop response and propose a new type or expansion before
156
+ resolving.
157
+
158
+ Record every conflict classification and resolution under `## Main Refresh
159
+ Conflicts` in the current chat session log with:
160
+
161
+ ```bash
162
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/session-log/record-main-refresh-conflict/script.sh ...
163
+ ```
164
+
165
+ Do not apply the rehearsed refresh until the session log records the audit
166
+ trail for every conflicted path.
167
+ 4. If the user already approved the main-refresh preflight, and the preflight
168
+ branch is clean, fully resolved, tested, and contains the intended merge
169
+ result, verify the session-log audit trail, then apply it back to the chat
170
+ branch automatically:
171
+
172
+ ```bash
173
+ bash scripts/00.chat/main-refresh/verify-conflict-audit/script.sh \
174
+ --path <conflicted-path> ...
175
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/main-refresh/apply-rehearsed-refresh/script.sh <preflight-branch>
176
+ ```
177
+
178
+ 5. Applying the rehearsed refresh fast-forwards the active chat branch, verifies it points at the
179
+ tested preflight commit, removes the clean temporary preflight worktree,
180
+ deletes the matching `agentic/preflight/*/<timestamp>` branch, and cleans up
181
+ stale sibling preflight branches/worktrees for the same chat branch when they
182
+ are already ancestors of the promoted chat branch and have clean or absent
183
+ worktrees.
184
+ <!-- deterministic-check: allow reason="apply-rehearsed-refresh enforces dirty preflight worktree refusal before applying or cleanup" -->
185
+ 6. Stop before applying if unresolved conflicts remain, required checks failed
186
+ or were skipped, the preflight worktree is dirty, the preflight branch no
187
+ longer descends from the chat branch, the apply script refuses cleanup,
188
+ or the user explicitly asked to inspect before applying. Stale sibling
189
+ preflight branches with unique commits or dirty worktrees must be reported
190
+ and skipped, not deleted. Do not force-remove the preflight worktree, delete
191
+ the preflight branch, or apply the refresh while stopped.
192
+ 7. After applying the refresh, run the relevant layer checks before any task commit or
193
+ promotion to `main`.
194
+
195
+ ## Recommended Active-Branch Flow
196
+
197
+ 1. Record the starting branch:
198
+
199
+ ```bash
200
+ git branch --show-current
201
+ ```
202
+
203
+ 2. Inspect status:
204
+
205
+ ```bash
206
+ git status --short --branch
207
+ bash scripts/00.chat/main-refresh/classify-refresh-readiness/script.sh
208
+ bash scripts/00.chat/main-refresh/show-main-update-status/script.sh
209
+ bash scripts/00.chat/local-merge/list-active-chat-branches/script.sh
210
+ bash scripts/00.chat/local-merge/report-chat-branch-overlaps/script.sh
211
+ ```
212
+
213
+ 3. If the active chat branch is behind `main`, ask before integrating `main`
214
+ unless the user already explicitly requested that operation.
215
+
216
+ 4. If the active chat worktree is clean and the refresh does not require
217
+ rehearsal, an approved non-rewriting refresh may merge directly:
218
+
219
+ ```bash
220
+ git merge --no-ff main
221
+ ```
222
+
223
+ 5. If the branch contains task commits, checkpoint commits, or uncertain merge
224
+ risk, use the preflight flow instead of merging directly in the active chat
225
+ worktree.
226
+
227
+ 6. Run the relevant checks for the changed layer before committing.
228
+
229
+ 7. Record decisions, issues, and ADR disposition in the current session log
230
+ before any task commit.
231
+
232
+ ## After Refresh
233
+
234
+ - Report whether the branch is now even with, ahead of, behind, or diverged
235
+ from `main`.
236
+ - Note whether the comparison used local refs only or included a remote fetch.
237
+ - Record the classifier result, dirty paths, incoming overlap paths, recovery
238
+ action, preflight branch, preflight worktree, promoted commit, cleanup result,
239
+ conflict type for each conflicted path, deterministic action used, and whether
240
+ stash was used. Expected value for stash is `no` unless a later governed stash
241
+ path is approved.
242
+ - Do not commit the refresh unless the user explicitly approves the commit.
@@ -0,0 +1,69 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.workflows.chat-reporting
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: chat
8
+ disciplines:
9
+ - agentic
10
+ kind: workflow
11
+ purpose: Document Chat Reporting Workflow.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ - entity-builder
17
+ - design-system-builder
18
+ used_by:
19
+ - id: repo.agents
20
+ path: AGENTS.md
21
+ -->
22
+ # Chat Reporting Workflow
23
+
24
+ ## Use When
25
+
26
+ Use this when the user asks for summaries, metrics, or reports derived from chat
27
+ session logs.
28
+
29
+ ## Purpose
30
+
31
+ Own on-demand reports from chat session logs.
32
+
33
+ ## Source Evidence
34
+
35
+ - Individual session logs under `commitLogs/` are durable source evidence.
36
+ - The retired aggregate path `commitLogs/README.md` is not maintained.
37
+ - Report artifacts are temporary or explicitly requested outputs, not automatic
38
+ branch bookkeeping.
39
+
40
+ ## On-Demand Summary
41
+
42
+ Use the chat-layer reporting skill for human-oriented summary work:
43
+
44
+ ```txt
45
+ .agentic/00.chat/skills/session-summary.md
46
+ ```
47
+
48
+ Use the script for deterministic aggregate metrics:
49
+
50
+ ```bash
51
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/reporting/generate-commit-log-summary/script.sh
52
+ ```
53
+
54
+ To write a file, require an explicit output path:
55
+
56
+ ```bash
57
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/reporting/generate-commit-log-summary/script.sh --output <path>
58
+ ```
59
+
60
+ ## Rules
61
+
62
+ - Do not recreate tracked `commitLogs/README.md`.
63
+ - Treat individual session logs as source evidence.
64
+ - Write file artifacts only to explicit user-requested paths.
65
+ - Prefer stdout for quick inspection.
66
+ - If the requested report needs interpretation beyond deterministic metrics,
67
+ cite the source session logs used.
68
+ - If a requested report would need new persistent generated files, stop and ask
69
+ whether the harness should define that artifact first.
@@ -0,0 +1,173 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.workflows.chat-start
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: startup
8
+ disciplines:
9
+ - agentic
10
+ kind: workflow
11
+ purpose: Govern chat startup routing, session metadata discovery, and first-chat setup
12
+ steps.
13
+ portability:
14
+ class: required
15
+ targets:
16
+ - llm-workbench
17
+ used_by:
18
+ - id: repo.agents
19
+ path: AGENTS.md
20
+ - id: chat.script.startup.start-chat-session
21
+ path: scripts/00.chat/startup/start-chat-session/script.sh
22
+ -->
23
+ # Chat Start Workflow
24
+
25
+ ## Purpose
26
+
27
+ Use this at the start of a new chat to identify the active session, chat
28
+ lifecycle workflow, latest context-packet references, and chat-owned worktree
29
+ with minimal token use.
30
+
31
+ ## Fast Path
32
+
33
+ First run:
34
+
35
+ ```bash
36
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/startup/resolve-current-chat-session/script.sh "<opening user message>"
37
+ ```
38
+
39
+ This startup bootstrap is governed by the opening prompt. It may create or
40
+ verify the chat branch, chat-owned worktree, and session log before task write
41
+ permission is granted. Task edits remain read-only until the user grants write
42
+ permission for the chat.
43
+
44
+ If it returns valid chat lifecycle metadata, use it for session/worktree
45
+ handling.
46
+
47
+ Do not assign the whole chat a durable layer, mode, or workflow.
48
+ Do not read `.agentic/routing-policy.yaml`.
49
+ Do not load unrelated workflows, skills, standards, or documentation.
50
+
51
+ If the metadata includes a `worktree` value, use that chat-owned worktree for
52
+ task writes. The root worktree is the local integration console.
53
+
54
+ If it reports `recorded-session-approval-required`, do not use the existing
55
+ session metadata and do not edit files. Respond exactly:
56
+
57
+ ```txt
58
+ Blocked: existing chat session has recorded commits. Confirm continue this existing chat/worktree, or start a new chat?
59
+ ```
60
+
61
+ If the opening user request explicitly approves continuing the existing
62
+ chat/worktree, rerun:
63
+
64
+ ```bash
65
+ bash scripts/00.chat/session-log/read-current-chat-log/script.sh --allow-recorded-session
66
+ ```
67
+
68
+ Only then may the existing session metadata be used.
69
+
70
+ After the user first grants write permission for the chat, rename the current
71
+ session log folder to a concise summary:
72
+
73
+ ```bash
74
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/session-log/rename-current-chat-log-folder/script.sh "<short-summary>"
75
+ ```
76
+
77
+ If the current assistant can provide transcript metadata, record it through the
78
+ neutral `transcript_provider`, `transcript_path`, `transcript_bytes`, and
79
+ `transcript_source` session metadata fields before the first task commit.
80
+
81
+ For Codex sessions, this optional adapter can discover and register the local
82
+ JSONL transcript path:
83
+
84
+ ```bash
85
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/transcript/register-codex-session-log/script.sh
86
+ ```
87
+
88
+ Missing transcript metadata is not a chat-start blocker in portable mode. Commit
89
+ recording will mark token metrics unavailable unless strict transcript metrics
90
+ mode is explicitly requested.
91
+
92
+ ## Missing Session
93
+
94
+ <!-- deterministic-check: allow reason="resolve-current-chat-session.sh owns missing-session detection and auto-start execution" -->
95
+ If no matching chat log exists for the current branch, or if
96
+ `read-current-chat-log` reports `ERROR: current branch is not a chat branch:
97
+ main`, treat the opening user message as a request for a new chat session
98
+ unless it starts with `ignore chat start`. This is the Missing Session path, not
99
+ a read-only orientation stop condition.
100
+
101
+ If the opening message is exactly `new`, ask exactly:
102
+
103
+ ```txt
104
+ What should the new chat be about?
105
+ ```
106
+
107
+ Do not create a session until the user provides a task summary.
108
+
109
+ Otherwise run:
110
+
111
+ ```bash
112
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/startup/resolve-current-chat-session/script.sh "<opening user message>"
113
+ ```
114
+
115
+ After the command succeeds, use the generated session log, chat lifecycle
116
+ workflow, latest context-packet references, and chat-owned worktree as the
117
+ current chat context. Do not require the user to paste the generated first
118
+ prompt back into the same chat.
119
+
120
+ ## Context Packet Continuity
121
+
122
+ <!-- deterministic-check: allow reason="prompt routing may be manual or repo-specific; no universal script can decide whether a context router exists" -->
123
+ Do not assign the whole chat a durable layer, mode, or workflow during startup.
124
+ When later prompts need layer, mode, workflow, corpus, or rule context, use the
125
+ current user request, this repo's assistant instructions, and any repo-provided
126
+ context router if one exists.
127
+
128
+ <!-- deterministic-check: allow reason="context packets are optional continuity evidence and may come from repo-specific routers" -->
129
+ If latest context-packet metadata is missing, leave it blank until a governed
130
+ context-router query returns a packet. Record only the latest context packet ID,
131
+ routing summary, and timestamp as continuity references. Do not copy the
132
+ packet's prompt route into chat session `layer`, `mode`, or `workflow` fields.
133
+
134
+ ## Dirty Worktree
135
+
136
+ Before editing files, run:
137
+
138
+ ```bash
139
+ bash scripts/00.chat/worktree/dirty-worktree-check/script.sh
140
+ ```
141
+
142
+ <!-- deterministic-check: allow reason="dirty-worktree-check.sh detects dirty state; workflow defines the exact blocked response" -->
143
+ If dirty, respond exactly:
144
+
145
+ ```txt
146
+ Blocked: dirty worktree. Confirm proceed?
147
+ ```
148
+
149
+ Do not explain unless asked.
150
+ Do not edit files while blocked.
151
+
152
+ ## Write Requests Without A Chat Worktree
153
+
154
+ If the user grants write permission but the current session has no chat-owned
155
+ worktree, create or verify it before editing:
156
+
157
+ ```bash
158
+ bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/worktree/ensure-chat-worktree/script.sh <session-log>
159
+ ```
160
+
161
+ <!-- deterministic-check: allow reason="check-write-location.sh enforces the write-location invariant; workflow states when agents should invoke it" -->
162
+ Then run task commands from that worktree and verify:
163
+
164
+ ```bash
165
+ bash scripts/00.chat/worktree/check-write-location/script.sh
166
+ ```
167
+
168
+ ## Migration Notes
169
+
170
+ The executable chat startup scripts now live under canonical
171
+ `scripts/00.chat/...` capability folders. Old `scripts/shared/chat/` command
172
+ wrappers have been retired; use public `package.json` `chat:*` commands or
173
+ the canonical governed script paths.
@@ -0,0 +1,123 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: chat.workflows.chat-upstream-reusable-lesson
4
+ version: 1
5
+ status: active
6
+ layer: 00.chat
7
+ domain: chat
8
+ disciplines:
9
+ - agentic
10
+ kind: workflow
11
+ purpose: Document Chat Upstream Reusable Lesson Workflow.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ - entity-builder
17
+ - design-system-builder
18
+ used_by:
19
+ - id: repo.agents
20
+ path: AGENTS.md
21
+ -->
22
+ # Chat Upstream Reusable Lesson Workflow
23
+
24
+ ## Use When
25
+
26
+ Use this when work in a product or downstream repo reveals a reusable chat
27
+ harness lesson that should be promoted to an upstream workbench repo such as
28
+ `llm-workbench`.
29
+
30
+ ## Purpose
31
+
32
+ Create a governed handoff from the source repo where the lesson was discovered
33
+ to the upstream workbench repo that owns reusable chat harness behavior.
34
+
35
+ The workflow documents and opens the upstream task. It does not silently copy
36
+ files, edit the source repo, push to remotes, or mutate both repos in one step.
37
+
38
+ Architecture decision: `docs/harness/architecture/adrs/0014-promote-reusable-lessons-upstream.md`.
39
+
40
+ When the reusable lesson affects public `llm-workbench` startup, install,
41
+ assistant adapters, metrics, portability, or export behavior, it must preserve
42
+ `.agentic/00.chat/standards/llm-workbench-public-beta-contract.md`.
43
+
44
+ ## Ownership Model
45
+
46
+ - The source repo provides evidence from real work.
47
+ - The upstream workbench repo owns reusable chat harness workflows, scripts,
48
+ checklists, standards, and installer behavior.
49
+ - Product, deployment, domain, and customer-specific rules stay in the source
50
+ repo.
51
+ - If ownership is ambiguous, stop and ask whether the lesson is reusable or
52
+ source-repo-specific.
53
+
54
+ ## Required Source Packet
55
+
56
+ Before opening the upstream chat, collect:
57
+
58
+ - source repo absolute path
59
+ - source branch
60
+ - source chat worktree absolute path
61
+ - source session log absolute or repo-relative path
62
+ - source transcript provider and path when recorded in session metadata
63
+ - target upstream repo absolute path
64
+ - reusable lesson summary
65
+ - source evidence paths or commands
66
+ - source-repo-specific details that must not be promoted
67
+
68
+ ## Required Boundaries
69
+
70
+ The upstream handoff prompt must include:
71
+
72
+ ```txt
73
+ Inspect the source paths read-only.
74
+ Do not edit the source repo.
75
+ Do not copy source-repo-specific product, deployment, customer, or domain rules
76
+ into the upstream workbench.
77
+ Extract only the reusable chat harness lesson.
78
+ If reusable ownership is ambiguous, stop and ask.
79
+ Do not push unless explicitly approved separately.
80
+ ```
81
+
82
+ ## Opening The Upstream Chat
83
+
84
+ From the upstream workbench repo, start a normal chat session using the existing
85
+ chat startup path. The source repo may prepare the prompt, but the upstream repo
86
+ must own the implementation chat.
87
+
88
+ The prompt should include:
89
+
90
+ ```txt
91
+ Task: Promote reusable chat harness lesson into llm-workbench
92
+
93
+ Source repo: <absolute-path>
94
+ Source branch: <branch>
95
+ Source chat worktree: <absolute-path>
96
+ Source session log: <path>
97
+ Source transcript: <path-or-blank>
98
+ Target repo: <absolute-path>
99
+
100
+ Reusable lesson:
101
+ <summary>
102
+
103
+ Evidence:
104
+ <paths, commands, failure mode, decisions>
105
+
106
+ Keep out of upstream:
107
+ <source-repo-specific details>
108
+
109
+ Boundaries:
110
+ Inspect the source paths read-only.
111
+ Do not edit the source repo.
112
+ Do not copy source-repo-specific product, deployment, customer, or domain rules
113
+ into the upstream workbench.
114
+ Extract only the reusable chat harness lesson.
115
+ If reusable ownership is ambiguous, stop and ask.
116
+ Do not push unless explicitly approved separately.
117
+ ```
118
+
119
+ ## Later Script
120
+
121
+ A later command may prepare this source packet and open the upstream chat, but
122
+ the command must preserve the boundaries above. Do not script cross-repo copying
123
+ until this workflow has been exercised manually.
@@ -0,0 +1,32 @@
1
+ <!-- agentic-artifact:
2
+ schema: agentic-artifact/v2
3
+ id: shared.standards.readme
4
+ version: 1
5
+ status: active
6
+ layer: 06.shared
7
+ domain: governance
8
+ disciplines:
9
+ - agentic
10
+ kind: readme
11
+ purpose: Index the Shared Standards artifact family.
12
+ portability:
13
+ class: required
14
+ targets:
15
+ - llm-workbench
16
+ - entity-builder
17
+ - design-system-builder
18
+ used_by:
19
+ - id: repo.agents
20
+ path: AGENTS.md
21
+ -->
22
+
23
+ # Shared Standards
24
+
25
+ Shared standards govern cross-layer expectations that more than one layer can
26
+ reuse.
27
+
28
+ ## Standards
29
+
30
+ - `upstream-repo-bootstrap.md` - bootstrap reusable upstream repos from a
31
+ source repo without leaking source-specific behavior.
32
+