-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
332 lines (294 loc) · 11.1 KB
/
Taskfile.yaml
File metadata and controls
332 lines (294 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
version: '3'
vars:
BIN_NAME: haft
BIN_DIR: ~/.local/bin
TUI_DIR: tui
TUI_BUNDLE: tui/dist/tui.mjs
TUI_INSTALL_DIR: ~/.haft/tui
OPEN_SLEIGH_RELEASE_DIR: open-sleigh/_build/prod/rel/open_sleigh
OPEN_SLEIGH_INSTALL_DIR: ~/.haft/runtimes/open-sleigh/current
FPF_SPEC: data/FPF/FPF-Spec.md
FPF_DB: internal/cli/fpf.db
DESKTOP_APP_NAME: Haft
DESKTOP_DEV_CLI: desktop-tauri/target/debug/haft
DESKTOP_RELEASE_CLI: desktop-tauri/target/release/haft
tasks:
default:
desc: Show available tasks
cmds:
- task --list
test:
desc: Run all tests
cmds:
- go test $(go list ./... | grep -v /desktop)
lint:
desc: Run linter (go vet + typecheck)
cmds:
- go vet ./...
- cd {{.TUI_DIR}} && bun run typecheck
tui:
desc: Build TUI bundle
cmds:
- cd {{.TUI_DIR}} && bun run build
sources:
- tui/src/**/*.ts
- tui/src/**/*.tsx
generates:
- '{{.TUI_BUNDLE}}'
fpf-pull:
desc: Pull FPF submodule to latest upstream
cmds:
- git -C data/FPF fetch origin
- git -C data/FPF checkout origin/main
fpf-index:
desc: Rebuild embedded SQLite index from current FPF checkout
cmds:
- go run ./cmd/indexer {{.FPF_SPEC}} {{.FPF_DB}} "$(git -C data/FPF rev-parse HEAD 2>/dev/null || true)"
sources:
- '{{.FPF_SPEC}}'
- internal/fpf/fpf-routes.json
- cmd/indexer/**/*.go
- internal/fpf/**/*.go
generates:
- '{{.FPF_DB}}'
fpf-refresh:
desc: Pull FPF submodule to latest upstream and rebuild embedded SQLite index
deps: [fpf-pull]
cmds:
- task fpf-index
build:
desc: Build Go binary + TUI bundle
deps: [tui, fpf-refresh]
cmds:
- go build -o {{.BIN_NAME}} -trimpath ./cmd/haft/
generates:
- '{{.BIN_NAME}}'
install:
desc: Build and install haft (CLI + TUI + Open-Sleigh runtime) locally
deps: [tui, fpf-refresh, open-sleigh:install-runtime]
cmds:
# Remove any stale `haft` in GOBIN so PATH picks up BIN_DIR/haft,
# not a leftover `go install`'d binary from an older build.
- rm -f /Users/ivanzakutnii/go/bin/haft
- go build -o {{.BIN_DIR}}/{{.BIN_NAME}} -trimpath ./cmd/haft/
- mkdir -p {{.TUI_INSTALL_DIR}}
- cp {{.TUI_BUNDLE}} {{.TUI_INSTALL_DIR}}/bundle.mjs
- echo "Installed {{.BIN_DIR}}/{{.BIN_NAME}}"
- echo "Installed {{.TUI_INSTALL_DIR}}/bundle.mjs"
- echo "Installed {{.OPEN_SLEIGH_INSTALL_DIR}}"
- echo "Desktop — run task desktop:install separately (requires Rust toolchain)"
dev:
desc: Build Go binary only (TUI runs from source via bun)
deps: [fpf-index]
cmds:
- go build -o {{.BIN_NAME}} -trimpath ./cmd/haft/
doctor:
desc: Run haft doctor health check
cmds:
- go run ./cmd/haft doctor
desktop:
desc: Run Haft desktop app (Tauri dev with hot reload)
deps: [desktop:cli]
dir: desktop-tauri
cmds:
- cargo tauri dev
desktop:cli:
desc: Build the local Haft CLI used by Tauri desktop RPC in dev
cmds:
- mkdir -p desktop-tauri/target/debug
- go build -o {{.DESKTOP_DEV_CLI}} -trimpath ./cmd/haft/
sources:
- cmd/**/*.go
- db/**/*.go
- internal/**/*.go
- go.mod
- go.sum
generates:
- '{{.DESKTOP_DEV_CLI}}'
desktop:build:
desc: Build Haft desktop app (Tauri production bundle)
deps: [desktop:cli:release]
dir: desktop-tauri
cmds:
- cargo tauri build
desktop:cli:release:
desc: Build the Haft CLI next to the release desktop binary
cmds:
- mkdir -p desktop-tauri/target/release
- go build -o {{.DESKTOP_RELEASE_CLI}} -trimpath ./cmd/haft/
sources:
- cmd/**/*.go
- db/**/*.go
- internal/**/*.go
- go.mod
- go.sum
generates:
- '{{.DESKTOP_RELEASE_CLI}}'
desktop:install:
desc: Build and install Haft desktop app locally
deps: [desktop:build]
cmds:
- |
case "$(uname -s)" in
Darwin)
APP_SRC="desktop-tauri/target/release/bundle/macos/{{.DESKTOP_APP_NAME}}.app"
APP_DST="$HOME/Applications/{{.DESKTOP_APP_NAME}}.app"
if [ -d "$APP_SRC" ]; then
mkdir -p "$HOME/Applications"
rm -rf "$APP_DST"
cp -R "$APP_SRC" "$APP_DST"
echo "Installed $APP_DST (Spotlight-launchable)"
else
echo "Warning: .app bundle not found at $APP_SRC"
fi
;;
Linux)
BIN_SRC="desktop-tauri/target/release/haft-desktop"
BIN_DST="$HOME/.haft/bin/haft-desktop"
if [ -f "$BIN_SRC" ]; then
mkdir -p "$HOME/.haft/bin"
cp "$BIN_SRC" "$BIN_DST"
chmod +x "$BIN_DST"
echo "Installed $BIN_DST"
# Install .desktop file for app launchers
DESKTOP_DIR="$HOME/.local/share/applications"
mkdir -p "$DESKTOP_DIR"
cat > "$DESKTOP_DIR/haft.desktop" <<DESKTOP_EOF
[Desktop Entry]
Name=Haft
Comment=Engineering decision framework
Exec=$BIN_DST
Icon=$HOME/.haft/icon.png
Type=Application
Categories=Development;
DESKTOP_EOF
echo "Installed $DESKTOP_DIR/haft.desktop"
else
echo "Warning: desktop binary not found at $BIN_SRC"
fi
;;
*)
echo "Unsupported platform for desktop install"
;;
esac
desktop:open:
desc: Build and open Haft desktop app
deps: [desktop:install]
cmds:
- |
case "$(uname -s)" in
Darwin) open "$HOME/Applications/{{.DESKTOP_APP_NAME}}.app" ;;
Linux) "$HOME/.haft/bin/haft-desktop" & ;;
esac
repomix:
desc: Pack all code and specs into a timestamped XML review bundle
vars:
TIMESTAMP:
sh: date -u +%Y%m%dT%H%M%SZ
cmds:
- mkdir -p .context
- >-
repomix
--include "cmd/**,internal/**,logger/**,tui/**,desktop/**,desktop-tauri/**,open-sleigh/**,spec/**,skills/**,scripts/**,assurance/**,db/**,*.md,*.go,go.mod,go.sum,Taskfile.yaml,*.sql,*.yaml,*.yml,*.json,*.toml"
--ignore ".git,.context,.haft,.task,.cache,.claude,.codex,.crush,.cursor,.playwright-mcp,.zenflow,.zenflow-attachments,data/FPF,desktop-tauri/target,desktop/frontend/node_modules,tui/node_modules,open-sleigh/_build,open-sleigh/deps,node_modules,dist,build,tmp,coverage.out,internal/cli/fpf.db,*.db,*.sqlite,*.log,haft"
--output ".context/{{.TIMESTAMP}}_repomix.xml"
--parsable-style
--include-diffs
open-sleigh:doctor:
desc: Check the local Open-Sleigh commission harness prerequisites
dir: open-sleigh
cmds:
- REPO_URL="${REPO_URL:-/Users/ivanzakutnii/Repos/projects/haft}" mix open_sleigh.doctor --path sleigh.commission.md.example --mock-haft
open-sleigh:doctor-haft:
desc: Check the Haft commission-source harness prerequisites
dir: open-sleigh
cmds:
- REPO_URL="${REPO_URL:-/Users/ivanzakutnii/Repos/projects/haft}" mix open_sleigh.doctor --path sleigh.haft.md.example --mock-haft
open-sleigh:smoke:
desc: Run one deterministic local Open-Sleigh commission smoke
dir: open-sleigh
cmds:
- REPO_URL="${REPO_URL:-/Users/ivanzakutnii/Repos/projects/haft}" mix open_sleigh.start --path sleigh.commission.md.example --mock --once --once-timeout-ms=5000
open-sleigh:smoke-haft:
desc: Run one deterministic Haft commission-source smoke
dir: open-sleigh
cmds:
- REPO_URL="${REPO_URL:-/Users/ivanzakutnii/Repos/projects/haft}" mix open_sleigh.start --path sleigh.haft.md.example --mock --once --once-timeout-ms=5000
open-sleigh:smoke-real-haft:
desc: Run Open-Sleigh against a real temporary Haft MCP server and WorkCommission
cmds:
- bash scripts/open_sleigh_real_haft_smoke.sh
open-sleigh:smoke-real-haft-dynamic:
desc: Prove long-running Open-Sleigh picks up new Haft WorkCommissions without restart
cmds:
- bash scripts/open_sleigh_real_haft_dynamic_smoke.sh
open-sleigh:smoke-real-haft-from-decision:
desc: Prove Haft can create a WorkCommission from a DecisionRecord and Open-Sleigh consumes it
cmds:
- bash scripts/open_sleigh_real_haft_from_decision_smoke.sh
open-sleigh:smoke-real-haft-batch:
desc: Prove Haft can create a batch of WorkCommissions and Open-Sleigh consumes the queue
cmds:
- bash scripts/open_sleigh_real_haft_batch_smoke.sh
open-sleigh:smoke-real-haft-plan:
desc: Prove Haft can create WorkCommissions from an ImplementationPlan-lite file
cmds:
- bash scripts/open_sleigh_real_haft_plan_smoke.sh
open-sleigh:smoke-harness-command:
desc: Prove one haft harness command can create commissions and run Open-Sleigh
cmds:
- bash scripts/open_sleigh_harness_command_smoke.sh
open-sleigh:release:
desc: Build packaged Open-Sleigh runtime release
dir: open-sleigh
cmds:
- MIX_ENV=prod mix deps.get --only prod
- MIX_ENV=prod mix release --overwrite
open-sleigh:install-runtime:
desc: Install packaged Open-Sleigh runtime under ~/.haft
deps: [open-sleigh:release]
cmds:
- rm -rf {{.OPEN_SLEIGH_INSTALL_DIR}}
- mkdir -p "$(dirname {{.OPEN_SLEIGH_INSTALL_DIR}})"
- cp -R {{.OPEN_SLEIGH_RELEASE_DIR}} {{.OPEN_SLEIGH_INSTALL_DIR}}
open-sleigh:harness:
desc: Run local Open-Sleigh commission harness with real agent and mock Haft/Judge
dir: open-sleigh
cmds:
- REPO_URL="${REPO_URL:-/Users/ivanzakutnii/Repos/projects/haft}" mix open_sleigh.start --path sleigh.commission.md.example --mock-haft --mock-judge
open-sleigh:harness-haft:
desc: Run Haft commission-source harness with real agent and mock Haft/Judge
dir: open-sleigh
cmds:
- REPO_URL="${REPO_URL:-/Users/ivanzakutnii/Repos/projects/haft}" mix open_sleigh.start --path sleigh.haft.md.example --mock-haft --mock-judge
open-sleigh:harness-from-decision:
desc: Create a WorkCommission from DECISION and run the real Haft-backed Open-Sleigh harness
cmds:
- bash scripts/open_sleigh_harness_from_decision.sh "{{.DECISION}}"
open-sleigh:harness-from-decisions:
desc: Create WorkCommissions from DECISIONS and run the real Haft-backed Open-Sleigh harness
cmds:
- DECISIONS="{{.DECISIONS}}" bash scripts/open_sleigh_harness_from_decision.sh
open-sleigh:harness-plan:
desc: Create WorkCommissions from PLAN and run the real Haft-backed Open-Sleigh harness
cmds:
- PLAN="{{.PLAN}}" bash scripts/open_sleigh_harness_from_decision.sh
clean:
desc: Remove local build artifacts
cmds:
- rm -f {{.BIN_NAME}}
- rm -rf tui/dist
- rm -rf open-sleigh/_build
cleanup:
desc: Remove all built binaries and installed files
cmds:
- rm -f {{.BIN_NAME}}
- rm -rf tui/dist
- rm -rf open-sleigh/_build
- rm -f {{.BIN_DIR}}/{{.BIN_NAME}}
- rm -rf {{.TUI_INSTALL_DIR}}
- rm -rf ~/.haft/runtimes/open-sleigh
- rm -rf ~/Applications/{{.DESKTOP_APP_NAME}}.app
- rm -f ~/.haft/bin/haft-desktop
- rm -f ~/.local/share/applications/haft.desktop
- echo "Cleaned up"