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.
- package/.agentic/00.chat/README.md +78 -0
- package/.agentic/00.chat/checklists/before-commit.md +195 -0
- package/.agentic/00.chat/checklists/llm-workbench-public-beta.md +94 -0
- package/.agentic/00.chat/commands/README.md +108 -0
- package/.agentic/00.chat/migration-plan.md +132 -0
- package/.agentic/00.chat/skills/session-summary.md +48 -0
- package/.agentic/00.chat/standards/llm-workbench-public-beta-contract.md +216 -0
- package/.agentic/00.chat/standards/main-refresh-conflict-types.md +358 -0
- package/.agentic/00.chat/workflows/README.md +40 -0
- package/.agentic/00.chat/workflows/bootstrap-chat-workbench-repo.md +212 -0
- package/.agentic/00.chat/workflows/chat-cleanup.md +102 -0
- package/.agentic/00.chat/workflows/chat-commit.md +56 -0
- package/.agentic/00.chat/workflows/chat-promote-to-main.md +169 -0
- package/.agentic/00.chat/workflows/chat-refresh-from-main.md +242 -0
- package/.agentic/00.chat/workflows/chat-reporting.md +69 -0
- package/.agentic/00.chat/workflows/chat-start.md +173 -0
- package/.agentic/00.chat/workflows/chat-upstream-reusable-lesson.md +123 -0
- package/.agentic/shared/standards/README.md +32 -0
- package/.agentic/shared/standards/upstream-repo-bootstrap.md +131 -0
- package/.agentic/shared/workflows/README.md +35 -0
- package/.agentic/shared/workflows/capability-resolution-workflow.md +189 -0
- package/.agentic/shared/workflows/change-shared-process.md +92 -0
- package/.cursor/rules/llm-workbench.mdc +17 -0
- package/.github/copilot-instructions.md +16 -0
- package/AGENTS.md +63 -0
- package/CLAUDE.md +16 -0
- package/CONTRIBUTING.md +57 -0
- package/LICENSE +21 -0
- package/LLM_WORKBENCH.md +17 -0
- package/README.md +98 -0
- package/SECURITY.md +44 -0
- package/bin/llm-workbench.js +672 -0
- package/docs/00.chat/README.md +47 -0
- package/docs/00.chat/llm-workbench-acceptance-matrix.md +55 -0
- package/docs/00.chat/script-layout.md +107 -0
- package/docs/adapting-to-your-repo.md +29 -0
- package/docs/concepts.md +38 -0
- package/docs/install.md +114 -0
- package/docs/public-beta-contract.md +45 -0
- package/docs/workflows.md +103 -0
- package/examples/minimal-repo/README.md +13 -0
- package/package.json +93 -0
- package/scripts/00.chat/README.md +46 -0
- package/scripts/00.chat/bootstrap/README.md +35 -0
- package/scripts/00.chat/bootstrap/audit-chat-bootstrap-file-set/README.md +39 -0
- package/scripts/00.chat/bootstrap/audit-chat-bootstrap-file-set/script.sh +213 -0
- package/scripts/00.chat/closeout/README.md +30 -0
- package/scripts/00.chat/closeout/build-closeout-prompt/README.md +35 -0
- package/scripts/00.chat/closeout/build-closeout-prompt/script.sh +124 -0
- package/scripts/00.chat/command/README.md +31 -0
- package/scripts/00.chat/command/close/README.md +30 -0
- package/scripts/00.chat/command/close/script.sh +25 -0
- package/scripts/00.chat/command/dispatcher/README.md +46 -0
- package/scripts/00.chat/command/dispatcher/script.sh +91 -0
- package/scripts/00.chat/command/dispatcher/smoke-test.sh +168 -0
- package/scripts/00.chat/command/new/README.md +32 -0
- package/scripts/00.chat/command/new/script.sh +28 -0
- package/scripts/00.chat/command/open-window/README.md +38 -0
- package/scripts/00.chat/command/open-window/script.sh +25 -0
- package/scripts/00.chat/command/package-scripts/README.md +34 -0
- package/scripts/00.chat/command/package-scripts/smoke-test.sh +113 -0
- package/scripts/00.chat/git/README.md +30 -0
- package/scripts/00.chat/git/cleanup-empty-chat-branches/README.md +36 -0
- package/scripts/00.chat/git/cleanup-empty-chat-branches/script.sh +243 -0
- package/scripts/00.chat/git/cleanup-empty-chat-branches/smoke-test.sh +136 -0
- package/scripts/00.chat/local-merge/README.md +30 -0
- package/scripts/00.chat/local-merge/list-active-chat-branches/README.md +29 -0
- package/scripts/00.chat/local-merge/list-active-chat-branches/script.sh +109 -0
- package/scripts/00.chat/local-merge/report-chat-branch-overlaps/README.md +29 -0
- package/scripts/00.chat/local-merge/report-chat-branch-overlaps/script.sh +142 -0
- package/scripts/00.chat/local-merge/verify-chat-ready-to-merge-local-main/README.md +33 -0
- package/scripts/00.chat/local-merge/verify-chat-ready-to-merge-local-main/script.sh +345 -0
- package/scripts/00.chat/local-merge/verify-chat-ready-to-merge-local-main/smoke-test.sh +244 -0
- package/scripts/00.chat/main-refresh/README.md +39 -0
- package/scripts/00.chat/main-refresh/apply-rehearsed-refresh/README.md +32 -0
- package/scripts/00.chat/main-refresh/apply-rehearsed-refresh/script.sh +198 -0
- package/scripts/00.chat/main-refresh/check-chat-is-current-with-main/README.md +30 -0
- package/scripts/00.chat/main-refresh/check-chat-is-current-with-main/script.sh +121 -0
- package/scripts/00.chat/main-refresh/classify-conflict/README.md +39 -0
- package/scripts/00.chat/main-refresh/classify-conflict/script.sh +169 -0
- package/scripts/00.chat/main-refresh/classify-conflict/smoke-test.sh +137 -0
- package/scripts/00.chat/main-refresh/classify-refresh-readiness/README.md +35 -0
- package/scripts/00.chat/main-refresh/classify-refresh-readiness/script.sh +171 -0
- package/scripts/00.chat/main-refresh/classify-refresh-readiness/smoke-test.sh +132 -0
- package/scripts/00.chat/main-refresh/rehearse-refresh-from-main/README.md +34 -0
- package/scripts/00.chat/main-refresh/rehearse-refresh-from-main/script.sh +124 -0
- package/scripts/00.chat/main-refresh/rehearse-refresh-from-main/smoke-test.sh +257 -0
- package/scripts/00.chat/main-refresh/show-main-update-status/README.md +31 -0
- package/scripts/00.chat/main-refresh/show-main-update-status/script.sh +73 -0
- package/scripts/00.chat/main-refresh/verify-conflict-audit/README.md +37 -0
- package/scripts/00.chat/main-refresh/verify-conflict-audit/script.sh +154 -0
- package/scripts/00.chat/main-refresh/verify-conflict-audit/smoke-test.sh +99 -0
- package/scripts/00.chat/metrics/README.md +35 -0
- package/scripts/00.chat/metrics/data/chat-pricing.json +107 -0
- package/scripts/00.chat/metrics/data/chat-pricing.schema.json +63 -0
- package/scripts/00.chat/metrics/estimate-chat-cost/README.md +40 -0
- package/scripts/00.chat/metrics/estimate-chat-cost/script.js +130 -0
- package/scripts/00.chat/migration/README.md +30 -0
- package/scripts/00.chat/migration/audit-chat-layer-migration/README.md +33 -0
- package/scripts/00.chat/migration/audit-chat-layer-migration/script.sh +127 -0
- package/scripts/00.chat/recovery/README.md +30 -0
- package/scripts/00.chat/recovery/import-active-paths-to-chat-worktree/README.md +76 -0
- package/scripts/00.chat/recovery/import-active-paths-to-chat-worktree/script.sh +212 -0
- package/scripts/00.chat/recovery/import-active-paths-to-chat-worktree/smoke-test.sh +162 -0
- package/scripts/00.chat/reporting/README.md +30 -0
- package/scripts/00.chat/reporting/generate-commit-log-summary/README.md +35 -0
- package/scripts/00.chat/reporting/generate-commit-log-summary/script.sh +299 -0
- package/scripts/00.chat/reporting/generate-commit-log-summary/smoke-test.sh +93 -0
- package/scripts/00.chat/reporting/report-chat-workspaces/README.md +32 -0
- package/scripts/00.chat/reporting/report-chat-workspaces/script.sh +82 -0
- package/scripts/00.chat/session-log/README.md +33 -0
- package/scripts/00.chat/session-log/check-commit-prerequisites/README.md +89 -0
- package/scripts/00.chat/session-log/check-commit-prerequisites/script.sh +121 -0
- package/scripts/00.chat/session-log/check-commit-prerequisites/smoke-test.sh +119 -0
- package/scripts/00.chat/session-log/check-commitlog-deletions/README.md +90 -0
- package/scripts/00.chat/session-log/check-commitlog-deletions/script.sh +131 -0
- package/scripts/00.chat/session-log/check-commitlog-deletions/smoke-test.sh +123 -0
- package/scripts/00.chat/session-log/checkpoint-chat-session-log/README.md +98 -0
- package/scripts/00.chat/session-log/checkpoint-chat-session-log/script.sh +126 -0
- package/scripts/00.chat/session-log/paths/README.md +38 -0
- package/scripts/00.chat/session-log/paths/lib.sh +133 -0
- package/scripts/00.chat/session-log/prepare-chat-session-before-commit/README.md +90 -0
- package/scripts/00.chat/session-log/prepare-chat-session-before-commit/script.sh +145 -0
- package/scripts/00.chat/session-log/read-current-chat-log/README.md +44 -0
- package/scripts/00.chat/session-log/read-current-chat-log/script.sh +92 -0
- package/scripts/00.chat/session-log/read-current-chat-log/smoke-test.sh +127 -0
- package/scripts/00.chat/session-log/record-chat-commit/README.md +133 -0
- package/scripts/00.chat/session-log/record-chat-commit/script.sh +394 -0
- package/scripts/00.chat/session-log/record-chat-commit/smoke-test.sh +227 -0
- package/scripts/00.chat/session-log/record-main-refresh-conflict/README.md +34 -0
- package/scripts/00.chat/session-log/record-main-refresh-conflict/script.sh +239 -0
- package/scripts/00.chat/session-log/rename-current-chat-log-folder/README.md +32 -0
- package/scripts/00.chat/session-log/rename-current-chat-log-folder/script.sh +112 -0
- package/scripts/00.chat/session-log/update-chat-log/README.md +32 -0
- package/scripts/00.chat/session-log/update-chat-log/script.sh +294 -0
- package/scripts/00.chat/startup/README.md +37 -0
- package/scripts/00.chat/startup/auto-start-missing-session/README.md +113 -0
- package/scripts/00.chat/startup/auto-start-missing-session/script.sh +54 -0
- package/scripts/00.chat/startup/resolve-current-chat-session/README.md +57 -0
- package/scripts/00.chat/startup/resolve-current-chat-session/script.sh +47 -0
- package/scripts/00.chat/startup/resolve-current-chat-session/smoke-test.sh +130 -0
- package/scripts/00.chat/startup/start-chat-session/README.md +197 -0
- package/scripts/00.chat/startup/start-chat-session/script.sh +330 -0
- package/scripts/00.chat/startup/start-chat-session/smoke-test.sh +182 -0
- package/scripts/00.chat/startup/start-new-chat/README.md +31 -0
- package/scripts/00.chat/startup/start-new-chat/script.sh +29 -0
- package/scripts/00.chat/transcript/README.md +36 -0
- package/scripts/00.chat/transcript/discover-codex-session-log/README.md +32 -0
- package/scripts/00.chat/transcript/discover-codex-session-log/script.sh +106 -0
- package/scripts/00.chat/transcript/register-codex-session-log/README.md +32 -0
- package/scripts/00.chat/transcript/register-codex-session-log/script.sh +115 -0
- package/scripts/00.chat/worktree/README.md +32 -0
- package/scripts/00.chat/worktree/check-write-location/README.md +87 -0
- package/scripts/00.chat/worktree/check-write-location/script.sh +95 -0
- package/scripts/00.chat/worktree/dirty-worktree-check/README.md +77 -0
- package/scripts/00.chat/worktree/dirty-worktree-check/script.sh +93 -0
- package/scripts/00.chat/worktree/ensure-chat-worktree/README.md +33 -0
- package/scripts/00.chat/worktree/ensure-chat-worktree/script.sh +132 -0
- package/scripts/00.chat/worktree/open-window/README.md +34 -0
- package/scripts/00.chat/worktree/open-window/script.sh +131 -0
- package/scripts/00.chat/worktree/paths/README.md +32 -0
- package/scripts/00.chat/worktree/paths/lib.sh +71 -0
- package/scripts/01.harness/artifact-metadata/check-headers/script.sh +522 -0
- package/scripts/01.harness/artifact-metadata/check-headers/smoke-test.sh +48 -0
- package/scripts/01.harness/check-deterministic-process-drift.sh +416 -0
- package/scripts/01.harness/check-governed-script-command-drift.sh +184 -0
- package/scripts/01.harness/run-governed-script.sh +178 -0
- package/scripts/install.sh +503 -0
- package/scripts/uninstall.sh +199 -0
- package/tests/smoke-test-install.sh +70 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# agentic-artifact:
|
|
5
|
+
# schema: agentic-artifact/v2
|
|
6
|
+
# id: chat.script.session-log.update-chat-log
|
|
7
|
+
# version: 1
|
|
8
|
+
# status: active
|
|
9
|
+
# layer: 00.chat
|
|
10
|
+
# domain: session-log
|
|
11
|
+
# disciplines:
|
|
12
|
+
# - agentic
|
|
13
|
+
# kind: script
|
|
14
|
+
# purpose: Internal helper for appending structured entries to the current chat log.
|
|
15
|
+
# portability:
|
|
16
|
+
# class: internal
|
|
17
|
+
# targets: []
|
|
18
|
+
# used_by:
|
|
19
|
+
# - id: chat.checklists.before-commit
|
|
20
|
+
# path: .agentic/00.chat/checklists/before-commit.md
|
|
21
|
+
# effects:
|
|
22
|
+
# - writes-files
|
|
23
|
+
|
|
24
|
+
# shellcheck source=../paths/lib.sh
|
|
25
|
+
source "scripts/00.chat/session-log/paths/lib.sh"
|
|
26
|
+
|
|
27
|
+
usage() {
|
|
28
|
+
cat <<'EOF'
|
|
29
|
+
Usage:
|
|
30
|
+
update-chat-log.sh question <asked-summary> <response-summary>
|
|
31
|
+
update-chat-log.sh issue <issue-summary> <resolution-summary>
|
|
32
|
+
update-chat-log.sh decision <decision-summary> <rationale-summary>
|
|
33
|
+
update-chat-log.sh commit-summary <commit-or-message> <summary> [adr-impact]
|
|
34
|
+
update-chat-log.sh adr-disposition needed <adr-path> <reason>
|
|
35
|
+
update-chat-log.sh adr-disposition not-needed <reason>
|
|
36
|
+
|
|
37
|
+
Updates the current chat branch session log under commitLogs/<yyyy>/<mmm>/<dd>/<session>/README.md.
|
|
38
|
+
EOF
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if [ $# -lt 1 ]; then
|
|
42
|
+
usage >&2
|
|
43
|
+
exit 2
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
BRANCH="$(git branch --show-current)"
|
|
47
|
+
|
|
48
|
+
if ! SESSION_ID="$(chat_session_id_from_branch "$BRANCH")"; then
|
|
49
|
+
echo "ERROR: current branch is not a chat branch: $BRANCH" >&2
|
|
50
|
+
exit 1
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
LOG_FILE="$(chat_log_file_for_session "$SESSION_ID")"
|
|
54
|
+
|
|
55
|
+
if [ ! -f "$LOG_FILE" ]; then
|
|
56
|
+
echo "ERROR: missing chat log: $LOG_FILE" >&2
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
TIMESTAMP="$(date -u +"%Y-%m-%dT%H:%M:%SZ")"
|
|
61
|
+
|
|
62
|
+
insert_section_entry() {
|
|
63
|
+
local section="$1"
|
|
64
|
+
local entry="$2"
|
|
65
|
+
local tmp
|
|
66
|
+
local entry_tmp
|
|
67
|
+
|
|
68
|
+
tmp="$(mktemp)"
|
|
69
|
+
entry_tmp="$(mktemp)"
|
|
70
|
+
printf '%s\n' "$entry" > "$entry_tmp"
|
|
71
|
+
|
|
72
|
+
if awk -v section="$section" -v entry_path="$entry_tmp" '
|
|
73
|
+
BEGIN {
|
|
74
|
+
in_section = 0
|
|
75
|
+
inserted = 0
|
|
76
|
+
found = 0
|
|
77
|
+
entry = ""
|
|
78
|
+
while ((getline line < entry_path) > 0) {
|
|
79
|
+
entry = entry (entry == "" ? "" : "\n") line
|
|
80
|
+
}
|
|
81
|
+
close(entry_path)
|
|
82
|
+
}
|
|
83
|
+
$0 == section {
|
|
84
|
+
found = 1
|
|
85
|
+
in_section = 1
|
|
86
|
+
print
|
|
87
|
+
next
|
|
88
|
+
}
|
|
89
|
+
in_section && /^## / && inserted == 0 {
|
|
90
|
+
print ""
|
|
91
|
+
print entry
|
|
92
|
+
print ""
|
|
93
|
+
inserted = 1
|
|
94
|
+
in_section = 0
|
|
95
|
+
}
|
|
96
|
+
in_section && $0 == "- None recorded yet." {
|
|
97
|
+
next
|
|
98
|
+
}
|
|
99
|
+
{
|
|
100
|
+
print
|
|
101
|
+
}
|
|
102
|
+
END {
|
|
103
|
+
if (found == 0) {
|
|
104
|
+
print ""
|
|
105
|
+
print section
|
|
106
|
+
print ""
|
|
107
|
+
print entry
|
|
108
|
+
} else if (in_section == 1 && inserted == 0) {
|
|
109
|
+
print ""
|
|
110
|
+
print entry
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
' "$LOG_FILE" > "$tmp"; then
|
|
114
|
+
mv "$tmp" "$LOG_FILE"
|
|
115
|
+
else
|
|
116
|
+
rm -f "$tmp"
|
|
117
|
+
rm -f "$entry_tmp"
|
|
118
|
+
return 1
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
rm -f "$entry_tmp"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
set_adr_disposition() {
|
|
125
|
+
local needed="$1"
|
|
126
|
+
local path="$2"
|
|
127
|
+
local reason="$3"
|
|
128
|
+
local tmp
|
|
129
|
+
|
|
130
|
+
tmp="$(mktemp)"
|
|
131
|
+
|
|
132
|
+
awk -v needed="$needed" -v path="$path" -v reason="$reason" '
|
|
133
|
+
BEGIN {
|
|
134
|
+
in_adr = 0
|
|
135
|
+
saw_needed = 0
|
|
136
|
+
saw_path = 0
|
|
137
|
+
saw_reason = 0
|
|
138
|
+
}
|
|
139
|
+
$0 == "## ADR Disposition" {
|
|
140
|
+
in_adr = 1
|
|
141
|
+
print
|
|
142
|
+
next
|
|
143
|
+
}
|
|
144
|
+
in_adr && /^## / {
|
|
145
|
+
if (saw_needed == 0) {
|
|
146
|
+
print "ADR needed: " needed
|
|
147
|
+
}
|
|
148
|
+
if (saw_path == 0) {
|
|
149
|
+
print "ADR path: " path
|
|
150
|
+
}
|
|
151
|
+
if (saw_reason == 0) {
|
|
152
|
+
print "Reason: " reason
|
|
153
|
+
}
|
|
154
|
+
in_adr = 0
|
|
155
|
+
}
|
|
156
|
+
in_adr && /^ADR needed:/ {
|
|
157
|
+
print "ADR needed: " needed
|
|
158
|
+
saw_needed = 1
|
|
159
|
+
next
|
|
160
|
+
}
|
|
161
|
+
in_adr && /^ADR path:/ {
|
|
162
|
+
print "ADR path: " path
|
|
163
|
+
saw_path = 1
|
|
164
|
+
next
|
|
165
|
+
}
|
|
166
|
+
in_adr && /^Reason:/ {
|
|
167
|
+
print "Reason: " reason
|
|
168
|
+
saw_reason = 1
|
|
169
|
+
next
|
|
170
|
+
}
|
|
171
|
+
{
|
|
172
|
+
print
|
|
173
|
+
}
|
|
174
|
+
END {
|
|
175
|
+
if (in_adr == 1) {
|
|
176
|
+
if (saw_needed == 0) {
|
|
177
|
+
print "ADR needed: " needed
|
|
178
|
+
}
|
|
179
|
+
if (saw_path == 0) {
|
|
180
|
+
print "ADR path: " path
|
|
181
|
+
}
|
|
182
|
+
if (saw_reason == 0) {
|
|
183
|
+
print "Reason: " reason
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
' "$LOG_FILE" > "$tmp"
|
|
188
|
+
|
|
189
|
+
mv "$tmp" "$LOG_FILE"
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
COMMAND="$1"
|
|
193
|
+
shift
|
|
194
|
+
|
|
195
|
+
case "$COMMAND" in
|
|
196
|
+
question)
|
|
197
|
+
if [ $# -ne 2 ]; then
|
|
198
|
+
usage >&2
|
|
199
|
+
exit 2
|
|
200
|
+
fi
|
|
201
|
+
insert_section_entry "## Questions Asked" "- Asked: $1
|
|
202
|
+
Response: $2"
|
|
203
|
+
insert_section_entry "## Activity Log" "### ${TIMESTAMP} - Question
|
|
204
|
+
|
|
205
|
+
Asked: $1
|
|
206
|
+
|
|
207
|
+
Response: $2"
|
|
208
|
+
;;
|
|
209
|
+
issue)
|
|
210
|
+
if [ $# -ne 2 ]; then
|
|
211
|
+
usage >&2
|
|
212
|
+
exit 2
|
|
213
|
+
fi
|
|
214
|
+
insert_section_entry "## Issues Raised" "- Raised: $1
|
|
215
|
+
Resolution: $2"
|
|
216
|
+
insert_section_entry "## Activity Log" "### ${TIMESTAMP} - Issue
|
|
217
|
+
|
|
218
|
+
Raised: $1
|
|
219
|
+
|
|
220
|
+
Resolution: $2"
|
|
221
|
+
;;
|
|
222
|
+
decision)
|
|
223
|
+
if [ $# -ne 2 ]; then
|
|
224
|
+
usage >&2
|
|
225
|
+
exit 2
|
|
226
|
+
fi
|
|
227
|
+
insert_section_entry "## Decisions Made" "- Decision: $1
|
|
228
|
+
Rationale: $2"
|
|
229
|
+
insert_section_entry "## Activity Log" "### ${TIMESTAMP} - Decision
|
|
230
|
+
|
|
231
|
+
Decision: $1
|
|
232
|
+
|
|
233
|
+
Rationale: $2"
|
|
234
|
+
;;
|
|
235
|
+
commit-summary)
|
|
236
|
+
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
|
237
|
+
usage >&2
|
|
238
|
+
exit 2
|
|
239
|
+
fi
|
|
240
|
+
ADR_IMPACT="${3:-covered by session ADR disposition}"
|
|
241
|
+
insert_section_entry "## Commits" "- Commit: $1
|
|
242
|
+
Summary: $2
|
|
243
|
+
ADR impact: ${ADR_IMPACT}"
|
|
244
|
+
insert_section_entry "## Activity Log" "### ${TIMESTAMP} - Commit summary
|
|
245
|
+
|
|
246
|
+
Commit: $1
|
|
247
|
+
|
|
248
|
+
Summary: $2
|
|
249
|
+
|
|
250
|
+
ADR impact: ${ADR_IMPACT}"
|
|
251
|
+
;;
|
|
252
|
+
adr-disposition)
|
|
253
|
+
if [ $# -lt 1 ]; then
|
|
254
|
+
usage >&2
|
|
255
|
+
exit 2
|
|
256
|
+
fi
|
|
257
|
+
case "$1" in
|
|
258
|
+
needed)
|
|
259
|
+
if [ $# -ne 3 ]; then
|
|
260
|
+
usage >&2
|
|
261
|
+
exit 2
|
|
262
|
+
fi
|
|
263
|
+
set_adr_disposition "yes" "$2" "$3"
|
|
264
|
+
insert_section_entry "## Activity Log" "### ${TIMESTAMP} - ADR disposition
|
|
265
|
+
|
|
266
|
+
ADR needed: yes
|
|
267
|
+
|
|
268
|
+
ADR path: $2
|
|
269
|
+
|
|
270
|
+
Reason: $3"
|
|
271
|
+
;;
|
|
272
|
+
not-needed)
|
|
273
|
+
if [ $# -ne 2 ]; then
|
|
274
|
+
usage >&2
|
|
275
|
+
exit 2
|
|
276
|
+
fi
|
|
277
|
+
set_adr_disposition "no" "" "$2"
|
|
278
|
+
insert_section_entry "## Activity Log" "### ${TIMESTAMP} - ADR disposition
|
|
279
|
+
|
|
280
|
+
ADR needed: no
|
|
281
|
+
|
|
282
|
+
Reason: $2"
|
|
283
|
+
;;
|
|
284
|
+
*)
|
|
285
|
+
usage >&2
|
|
286
|
+
exit 2
|
|
287
|
+
;;
|
|
288
|
+
esac
|
|
289
|
+
;;
|
|
290
|
+
*)
|
|
291
|
+
usage >&2
|
|
292
|
+
exit 2
|
|
293
|
+
;;
|
|
294
|
+
esac
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!-- agentic-artifact:
|
|
2
|
+
schema: agentic-artifact/v2
|
|
3
|
+
id: chat.script.startup.readme
|
|
4
|
+
version: 1
|
|
5
|
+
status: active
|
|
6
|
+
layer: 00.chat
|
|
7
|
+
domain: startup
|
|
8
|
+
disciplines:
|
|
9
|
+
- agentic
|
|
10
|
+
kind: script-domain-readme
|
|
11
|
+
purpose: Explain scripts that create or resume governed chat sessions.
|
|
12
|
+
portability:
|
|
13
|
+
class: required
|
|
14
|
+
targets:
|
|
15
|
+
- llm-workbench
|
|
16
|
+
used_by:
|
|
17
|
+
- id: chat.workflows.chat-start
|
|
18
|
+
path: .agentic/00.chat/workflows/chat-start.md
|
|
19
|
+
- id: chat.script.startup.start-chat-session.readme
|
|
20
|
+
path: scripts/00.chat/startup/start-chat-session/README.md
|
|
21
|
+
-->
|
|
22
|
+
# Startup Scripts
|
|
23
|
+
|
|
24
|
+
Startup scripts create the governed working context for a chat. They handle
|
|
25
|
+
task summaries, branch creation, chat-owned worktrees, session logs, latest
|
|
26
|
+
context-packet continuity fields, and terminal handoff prompts.
|
|
27
|
+
|
|
28
|
+
Startup is where the harness prevents the first turn from being ambiguous. A
|
|
29
|
+
chat should begin with a known branch, known worktree, known chat lifecycle
|
|
30
|
+
workflow, and known session log. Prompt-level layer, mode, workflow, corpus, and
|
|
31
|
+
rule context is resolved later from the current request, repo assistant
|
|
32
|
+
instructions, and any repo-provided context router if one exists.
|
|
33
|
+
|
|
34
|
+
Agents following chat-start should use `resolve-current-chat-session` as the
|
|
35
|
+
startup entrypoint. It reads existing chat metadata when available and
|
|
36
|
+
auto-starts a missing session from the opening prompt when the repo is still on
|
|
37
|
+
root `main` or otherwise lacks a matching chat log.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!-- agentic-artifact:
|
|
2
|
+
schema: agentic-artifact/v2
|
|
3
|
+
id: chat.script.startup.auto-start-missing-session.readme
|
|
4
|
+
version: 1
|
|
5
|
+
status: active
|
|
6
|
+
layer: 00.chat
|
|
7
|
+
domain: startup
|
|
8
|
+
disciplines:
|
|
9
|
+
- agentic
|
|
10
|
+
kind: capability-readme
|
|
11
|
+
purpose: Explain how opening-prompt auto-start decides whether to create a governed
|
|
12
|
+
chat session.
|
|
13
|
+
portability:
|
|
14
|
+
class: required
|
|
15
|
+
targets:
|
|
16
|
+
- llm-workbench
|
|
17
|
+
used_by:
|
|
18
|
+
- id: chat.script.startup.auto-start-missing-session
|
|
19
|
+
path: scripts/00.chat/startup/auto-start-missing-session/script.sh
|
|
20
|
+
- id: chat.script.command.dispatcher.smoke-test
|
|
21
|
+
path: scripts/00.chat/command/dispatcher/smoke-test.sh
|
|
22
|
+
- id: harness.architecture.adr.0017-organize-scripts-by-owner-domain-and-capability
|
|
23
|
+
-->
|
|
24
|
+
# Auto-Start Missing Session
|
|
25
|
+
|
|
26
|
+
`script.sh` is the bridge between an opening user message and the normal chat
|
|
27
|
+
startup engine.
|
|
28
|
+
|
|
29
|
+
It exists for the moment when a chat starts without usable session metadata. In
|
|
30
|
+
that case, the harness needs to decide whether the opening message should become
|
|
31
|
+
a new governed chat session, or whether startup should stop and ask the human
|
|
32
|
+
for clearer intent.
|
|
33
|
+
|
|
34
|
+
## Mental Model
|
|
35
|
+
|
|
36
|
+
Normal startup is explicit: a human or command asks to start a chat with a task
|
|
37
|
+
summary.
|
|
38
|
+
|
|
39
|
+
Auto-start is recovery startup: the harness has an opening prompt but no
|
|
40
|
+
session log metadata yet. Rather than guessing silently, this script applies a
|
|
41
|
+
small set of routing rules and then delegates to the normal `chat-command new`
|
|
42
|
+
path.
|
|
43
|
+
|
|
44
|
+
Agents should normally reach this through `resolve-current-chat-session`, which
|
|
45
|
+
first checks whether current session metadata already exists and only delegates
|
|
46
|
+
here for the missing-session path.
|
|
47
|
+
|
|
48
|
+
That means auto-start does not create a separate startup model. It only turns a
|
|
49
|
+
valid opening prompt into the same branch, worktree, session log, and first
|
|
50
|
+
prompt that `start-chat-session` would create.
|
|
51
|
+
|
|
52
|
+
## Decisions
|
|
53
|
+
|
|
54
|
+
1. Empty prompt
|
|
55
|
+
|
|
56
|
+
An empty opening prompt is rejected. There is no task summary to name the
|
|
57
|
+
session, create a useful branch/worktree identity, or write useful session
|
|
58
|
+
metadata.
|
|
59
|
+
|
|
60
|
+
2. Bare `new`
|
|
61
|
+
|
|
62
|
+
A message that is exactly `new` is treated as incomplete intent. The script
|
|
63
|
+
asks:
|
|
64
|
+
|
|
65
|
+
```txt
|
|
66
|
+
What should the new chat be about?
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This prevents the harness from creating a low-information branch and log.
|
|
70
|
+
|
|
71
|
+
3. `ignore chat start`
|
|
72
|
+
|
|
73
|
+
If the opening prompt begins with `ignore chat start`, auto-start exits
|
|
74
|
+
cleanly without creating a session. This is the explicit escape hatch for
|
|
75
|
+
chats that should bypass the chat-start workflow.
|
|
76
|
+
|
|
77
|
+
4. Any other opening prompt
|
|
78
|
+
|
|
79
|
+
The prompt is passed to:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bash scripts/00.chat/command/dispatcher/script.sh new "$PROMPT"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The dispatcher then routes to the normal startup command.
|
|
86
|
+
|
|
87
|
+
## What This Does Not Do
|
|
88
|
+
|
|
89
|
+
- It does not classify tasks itself.
|
|
90
|
+
- It does not create branches or worktrees directly.
|
|
91
|
+
- It does not write the session log directly.
|
|
92
|
+
- It does not bypass the normal startup engine.
|
|
93
|
+
- It does not replace the governed runner allowlist for the old compatibility
|
|
94
|
+
path.
|
|
95
|
+
|
|
96
|
+
## Validation
|
|
97
|
+
|
|
98
|
+
The dispatcher smoke test covers this capability. It verifies that an opening
|
|
99
|
+
prompt creates a chat session, that the task text is preserved, and that a bare
|
|
100
|
+
`new` prompt asks for a task summary instead of creating a vague session.
|
|
101
|
+
|
|
102
|
+
Run it with:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
bash scripts/00.chat/command/dispatcher/smoke-test.sh
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Compatibility
|
|
109
|
+
|
|
110
|
+
The old request-initialization entrypoint
|
|
111
|
+
`scripts/shared/chat/request-initialization/auto-start-missing-session.sh` has
|
|
112
|
+
been retired. New callers should use this canonical script through the governed
|
|
113
|
+
runner.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# agentic-artifact:
|
|
5
|
+
# schema: agentic-artifact/v2
|
|
6
|
+
# id: chat.script.startup.auto-start-missing-session
|
|
7
|
+
# version: 1
|
|
8
|
+
# status: active
|
|
9
|
+
# layer: 00.chat
|
|
10
|
+
# domain: startup
|
|
11
|
+
# disciplines:
|
|
12
|
+
# - agentic
|
|
13
|
+
# kind: script
|
|
14
|
+
# purpose: Convert an opening prompt into a governed chat session when metadata is missing.
|
|
15
|
+
# portability:
|
|
16
|
+
# class: required
|
|
17
|
+
# targets:
|
|
18
|
+
# - llm-workbench
|
|
19
|
+
# used_by:
|
|
20
|
+
# - id: chat.commands.readme
|
|
21
|
+
# path: .agentic/00.chat/commands/README.md
|
|
22
|
+
# - id: chat.script.startup.auto-start-missing-session.readme
|
|
23
|
+
# path: scripts/00.chat/startup/auto-start-missing-session/README.md
|
|
24
|
+
# effects:
|
|
25
|
+
# - branches
|
|
26
|
+
# - worktrees
|
|
27
|
+
# - writes-files
|
|
28
|
+
# - stages-files
|
|
29
|
+
OPENING_PROMPT="${*:-}"
|
|
30
|
+
|
|
31
|
+
trimmed_prompt() {
|
|
32
|
+
printf '%s' "$OPENING_PROMPT" | sed -E 's/^[[:space:]]+//; s/[[:space:]]+$//'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
PROMPT="$(trimmed_prompt)"
|
|
36
|
+
PROMPT_LOWER="$(printf '%s' "$PROMPT" | tr '[:upper:]' '[:lower:]')"
|
|
37
|
+
|
|
38
|
+
if [ -z "${PROMPT// }" ]; then
|
|
39
|
+
echo "ERROR: opening prompt is required." >&2
|
|
40
|
+
exit 2
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
case "$PROMPT_LOWER" in
|
|
44
|
+
"new")
|
|
45
|
+
echo "What should the new chat be about?"
|
|
46
|
+
exit 2
|
|
47
|
+
;;
|
|
48
|
+
ignore\ chat\ start*)
|
|
49
|
+
echo "Skipping chat auto-start because the opening prompt begins with 'ignore chat start'."
|
|
50
|
+
exit 0
|
|
51
|
+
;;
|
|
52
|
+
esac
|
|
53
|
+
|
|
54
|
+
exec bash scripts/00.chat/command/dispatcher/script.sh new "$PROMPT"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!-- agentic-artifact:
|
|
2
|
+
schema: agentic-artifact/v2
|
|
3
|
+
id: chat.script.startup.resolve-current-chat-session.readme
|
|
4
|
+
version: 1
|
|
5
|
+
status: active
|
|
6
|
+
layer: 00.chat
|
|
7
|
+
domain: startup
|
|
8
|
+
disciplines:
|
|
9
|
+
- agentic
|
|
10
|
+
kind: capability-readme
|
|
11
|
+
purpose: Explain the startup resolver that reads current metadata or auto-starts
|
|
12
|
+
missing chat sessions.
|
|
13
|
+
portability:
|
|
14
|
+
class: required
|
|
15
|
+
targets:
|
|
16
|
+
- llm-workbench
|
|
17
|
+
used_by:
|
|
18
|
+
- id: chat.script.startup.resolve-current-chat-session
|
|
19
|
+
path: scripts/00.chat/startup/resolve-current-chat-session/script.sh
|
|
20
|
+
- id: chat.workflows.chat-start
|
|
21
|
+
path: .agentic/00.chat/workflows/chat-start.md
|
|
22
|
+
-->
|
|
23
|
+
# Resolve Current Chat Session
|
|
24
|
+
|
|
25
|
+
`script.sh` is the single startup entrypoint for agents following the chat-start
|
|
26
|
+
workflow.
|
|
27
|
+
|
|
28
|
+
It first asks `read-current-chat-log` for existing session metadata. If the
|
|
29
|
+
current branch is already a usable chat branch, the metadata is printed and no
|
|
30
|
+
startup mutation happens.
|
|
31
|
+
|
|
32
|
+
If the current branch has no matching chat session, including the common root
|
|
33
|
+
`main` case, the script delegates to `auto-start-missing-session` with the
|
|
34
|
+
opening user message. That creates the normal chat branch, chat-owned worktree,
|
|
35
|
+
session log, and first prompt.
|
|
36
|
+
|
|
37
|
+
Other failures are passed through unchanged. In particular,
|
|
38
|
+
`recorded-session-approval-required` remains a stop condition until the user
|
|
39
|
+
explicitly approves continuing the recorded chat/worktree.
|
|
40
|
+
|
|
41
|
+
Run it through the governed runner:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
bash scripts/01.harness/run-governed-script.sh --approved-action scripts/00.chat/startup/resolve-current-chat-session/script.sh "<opening user message>"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Validation
|
|
48
|
+
|
|
49
|
+
Run the smoke test with:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
bash scripts/00.chat/startup/resolve-current-chat-session/smoke-test.sh
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
It verifies that root `main` with no chat session auto-starts from the opening
|
|
56
|
+
prompt, and that an existing chat worktree returns metadata without creating a
|
|
57
|
+
second chat branch.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# agentic-artifact:
|
|
5
|
+
# schema: agentic-artifact/v2
|
|
6
|
+
# id: chat.script.startup.resolve-current-chat-session
|
|
7
|
+
# version: 1
|
|
8
|
+
# status: active
|
|
9
|
+
# layer: 00.chat
|
|
10
|
+
# domain: startup
|
|
11
|
+
# disciplines:
|
|
12
|
+
# - agentic
|
|
13
|
+
# kind: script
|
|
14
|
+
# purpose: Resolve startup to current chat metadata or auto-start a missing session.
|
|
15
|
+
# portability:
|
|
16
|
+
# class: required
|
|
17
|
+
# targets:
|
|
18
|
+
# - llm-workbench
|
|
19
|
+
# used_by:
|
|
20
|
+
# - id: chat.workflows.chat-start
|
|
21
|
+
# path: .agentic/00.chat/workflows/chat-start.md
|
|
22
|
+
# effects:
|
|
23
|
+
# - branches
|
|
24
|
+
# - worktrees
|
|
25
|
+
# - writes-files
|
|
26
|
+
# - stages-files
|
|
27
|
+
|
|
28
|
+
OPENING_PROMPT="${*:-}"
|
|
29
|
+
|
|
30
|
+
set +e
|
|
31
|
+
CURRENT_METADATA="$(bash scripts/00.chat/session-log/read-current-chat-log/script.sh 2>&1)"
|
|
32
|
+
READ_STATUS=$?
|
|
33
|
+
set -e
|
|
34
|
+
|
|
35
|
+
if [ "$READ_STATUS" -eq 0 ]; then
|
|
36
|
+
printf '%s\n' "$CURRENT_METADATA"
|
|
37
|
+
exit 0
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
case "$CURRENT_METADATA" in
|
|
41
|
+
*"ERROR: current branch is not a chat branch:"*|*"ERROR: missing chat log:"*)
|
|
42
|
+
exec bash scripts/00.chat/startup/auto-start-missing-session/script.sh "$OPENING_PROMPT"
|
|
43
|
+
;;
|
|
44
|
+
esac
|
|
45
|
+
|
|
46
|
+
printf '%s\n' "$CURRENT_METADATA"
|
|
47
|
+
exit "$READ_STATUS"
|