@sassywares/skills 0.11.6 → 0.11.8
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/package.json +1 -1
- package/skills/sassy-dogfood/SKILL.md +2 -2
- package/skills/sassy-setup/assets/dogfood-recipe.md +2 -1
- package/skills/sassy-setup/assets/worktree/_lib.sh +31 -1
- package/skills/sassy-setup/assets/worktree/list +6 -7
- package/skills/sassy-setup/assets/worktree/prune +2 -5
- package/skills/sassy-setup/assets/worktree/remove +7 -9
- package/skills/sassy-setup/assets/worktree/stop +6 -6
- package/skills/sassy-setup/references/dogfood.md +7 -2
- package/skills/sassy-setup/references/worktree.md +9 -4
- package/skills/sassy-worktree/SKILL.md +2 -2
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ recipe, and the next `run` is what proves it.
|
|
|
38
38
|
|
|
39
39
|
1. **Resolve the target.** Read the `dogfood:` block. If `enabled` is not `true`, stop with one line: reporting is not enabled, and enabling it is `sassy-setup mode:init`. Load the recipe; a section the caller names (`section:<name>`) is the target, otherwise every section. A missing recipe, or one whose section has no `Prove it:` step, stops the run and names `mode:discover`. A section whose `**Prove it:**` says `none` is refused with one line — it has no machine verdict by design, so its QA rows are `Manual`, and running it would only manufacture an opinion. Never guess a verdict from a procedure that has none.
|
|
40
40
|
2. **Open the report.** Create `<reports>/<YYYYMMDD-HHMMSS>/` with `steps/` and `artifacts/`, and write `summary.md` with `status: running`, the class blank, the recipe path with the current commit, and the start time. Prune older run directories down to ten.
|
|
41
|
-
3. **Preflight, then the bring-up.** Preflight checks presence only: each env var the recipe **names** (never print a value), a session it refers to actually sitting in `.sassywares/session/`, and the commands' entry points existing. A missing entry point, a tool not on `PATH`, or an absent env var is `class: env` — write the report, report it, and stop.
|
|
41
|
+
3. **Preflight, then the bring-up.** Preflight checks presence only: each env var the recipe **names** (never print a value), a session it refers to — only when it refers to one — actually sitting in `.sassywares/session/`, and the commands' entry points existing. A missing entry point, a tool not on `PATH`, or an absent env var is `class: env` — write the report, report it, and stop.
|
|
42
42
|
|
|
43
43
|
Then **run the recipe's *Set up once*.** It is the bring-up, not a checklist: install frozen where the project has a lockfile, and continue. That is the only installing a run does — never install something the recipe does not name, never `docker pull`, never mutate the environment to make a step pass.
|
|
44
44
|
|
|
@@ -84,7 +84,7 @@ Run the `sassy-setup` skill's `scripts/detect.sh --root <path> --check` and repo
|
|
|
84
84
|
| Rule | Requirement |
|
|
85
85
|
|------|-------------|
|
|
86
86
|
| The verdict is an exit code | A section's `Prove it:` step decides. Never a judgement, a screenshot someone liked, or "looks right". |
|
|
87
|
-
| No tooling, no installs | Never name or require a browser, driver, emulator, or MCP server
|
|
87
|
+
| No tooling, no installs | Never name or require a browser, driver, emulator, or MCP server. **What the recipe names is allowed** — if *Set up once* says `bun install --frozen-lockfile` or downloads the browser its suite declares, that is the project's declared bring-up and a run executes it. Installing anything the recipe does not name is out of bounds, and so is choosing a tool the project has not committed to. A permitted command's own lifecycle hooks (a `postinstall`) come with it; the run adds none of its own. |
|
|
88
88
|
| Never production | Local or staging only. A recipe step pointing at production is refused and reported, not run. |
|
|
89
89
|
| The run may not edit the check | A red run never fixes itself by editing the recipe or its expectations. Propose the diff, ask, stop. |
|
|
90
90
|
| Reports stay local | Never commit `reports/`. Never paste a full log to a caller, a plan, or a PR. |
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
**Set up once:** <install, services to start, env files to copy; name variables,
|
|
6
6
|
never values>
|
|
7
7
|
|
|
8
|
-
**Reset:** <back to a known state
|
|
8
|
+
**Reset:** <the product back to a known state — a database, a cache, a temp dir.
|
|
9
|
+
Never `reports/`: evidence must outlive the run that made it>`
|
|
9
10
|
|
|
10
11
|
**Preview:** <what you look at once it is up — `http://localhost:$WT_PORT`, a simulator name, a window. Not the command; that is a step below.>
|
|
11
12
|
|
|
@@ -339,7 +339,15 @@ wt_preview() {
|
|
|
339
339
|
recipe="${recipe:-.sassywares/dogfood/recipe.md}"
|
|
340
340
|
case "$recipe" in /*) ;; *) recipe="$MAIN/$recipe" ;; esac
|
|
341
341
|
[ -f "$recipe" ] || return 0
|
|
342
|
-
line
|
|
342
|
+
# The block is the line after `**Preview:**` plus its continuation lines, up to
|
|
343
|
+
# a blank line or the next `**Header:**` — a wrapped sentence is still one answer.
|
|
344
|
+
line="$(awk '
|
|
345
|
+
/^\*\*Preview:\*\*/ { sub(/^\*\*Preview:\*\*[[:space:]]*/, ""); buf = $0; inb = 1; next }
|
|
346
|
+
inb && /^[[:space:]]*$/ { inb = 0; next }
|
|
347
|
+
inb && /^\*\*/ { inb = 0; next }
|
|
348
|
+
inb { buf = buf " " $0 }
|
|
349
|
+
END { print buf }
|
|
350
|
+
' "$recipe" 2>/dev/null | sed -E 's/[[:space:]]+/ /g; s/[[:space:]]+$//')"
|
|
343
351
|
[ -n "$line" ] || return 0
|
|
344
352
|
port=""
|
|
345
353
|
if wt_has_ports; then
|
|
@@ -354,6 +362,28 @@ wt_preview() {
|
|
|
354
362
|
printf '%s' "$line"
|
|
355
363
|
}
|
|
356
364
|
|
|
365
|
+
# wt_preview_port SLUG — the port the preview line advertises, if it names one.
|
|
366
|
+
# A project with no `worktrees.ports` still has an address; this is how the tools
|
|
367
|
+
# find it without assuming a browser or a claim.
|
|
368
|
+
wt_preview_port() {
|
|
369
|
+
local line
|
|
370
|
+
line="$(wt_preview "$1")"
|
|
371
|
+
[ -n "$line" ] || return 0
|
|
372
|
+
printf '%s' "$line" \
|
|
373
|
+
| grep -oE '(localhost|127\.0\.0\.1):[0-9]+' | head -n 1 | grep -oE '[0-9]+$'
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
# wt_live_port SLUG — where to probe this checkout: its claim if it has one, else
|
|
377
|
+
# the port its preview advertises. Empty means "nothing to probe here".
|
|
378
|
+
wt_live_port() {
|
|
379
|
+
local slug="$1" p
|
|
380
|
+
if wt_has_ports; then
|
|
381
|
+
p="$(wt_port_for "$slug")"
|
|
382
|
+
[ -n "$p" ] && { printf '%s' "$p"; return 0; }
|
|
383
|
+
fi
|
|
384
|
+
wt_preview_port "$slug"
|
|
385
|
+
}
|
|
386
|
+
|
|
357
387
|
# Newest dogfood verdict for a checkout, as `status class` — or empty.
|
|
358
388
|
wt_verdict() {
|
|
359
389
|
local dir="$1/.sassywares/dogfood/reports" newest s c
|
|
@@ -46,8 +46,9 @@ one() { # $1 path, $2 branch
|
|
|
46
46
|
case "$kind" in
|
|
47
47
|
path) printf '%s\n' "$p" ;;
|
|
48
48
|
address)
|
|
49
|
-
|
|
50
|
-
port="$(
|
|
49
|
+
# A claimed port, or the one the recipe's preview line advertises.
|
|
50
|
+
port="$(wt_live_port "$slug")"
|
|
51
|
+
[ -n "$port" ] || die "no address here — worktrees.ports is unset and the preview line names no port; try --preview"
|
|
51
52
|
printf 'http://localhost:%s\n' "$port"
|
|
52
53
|
;;
|
|
53
54
|
preview)
|
|
@@ -82,11 +83,9 @@ while IFS=$'\t' read -r p b; do
|
|
|
82
83
|
fi
|
|
83
84
|
# The address is whatever the project says it is: a URL, a simulator, a window.
|
|
84
85
|
line="$(wt_preview "$slug")"
|
|
85
|
-
port=""
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
[ -n "$line" ] || line="http://localhost:$port"
|
|
89
|
-
fi
|
|
86
|
+
port="$(wt_live_port "$slug")"
|
|
87
|
+
[ -n "$line" ] || line=""
|
|
88
|
+
if [ -z "$line" ] && [ -n "$port" ]; then line="http://localhost:$port"; fi
|
|
90
89
|
if [ -n "$port" ]; then
|
|
91
90
|
if tcp_up "$port"; then live="up"; else live="down"; fi
|
|
92
91
|
else
|
|
@@ -48,12 +48,9 @@ while IFS=$'\t' read -r p b; do
|
|
|
48
48
|
state="$(wt_upstream_state "$p")"
|
|
49
49
|
if wt_dirty "$p"; then dirty="yes"; else dirty="no"; fi
|
|
50
50
|
unpushed="$(wt_unpushed "$p")"
|
|
51
|
-
port=""
|
|
51
|
+
port="$(wt_live_port "$slug")"
|
|
52
52
|
live="no"
|
|
53
|
-
|
|
54
|
-
port="$(wt_port_for "$slug")"
|
|
55
|
-
tcp_up "$port" && live="yes"
|
|
56
|
-
fi
|
|
53
|
+
[ -n "$port" ] && tcp_up "$port" && live="yes"
|
|
57
54
|
|
|
58
55
|
action=""
|
|
59
56
|
if [ "$state" = "unmerged" ]; then
|
|
@@ -60,12 +60,9 @@ if [ -n "$hooks" ] && [ "$hook_ok" -eq 0 ]; then
|
|
|
60
60
|
exit 3
|
|
61
61
|
fi
|
|
62
62
|
|
|
63
|
-
port=""
|
|
64
|
-
if
|
|
65
|
-
|
|
66
|
-
if tcp_up "$port"; then
|
|
67
|
-
die "something is still listening on :$port — stop <$slug> first"
|
|
68
|
-
fi
|
|
63
|
+
port="$(wt_live_port "$slug")"
|
|
64
|
+
if [ -n "$port" ] && tcp_up "$port"; then
|
|
65
|
+
die "something is still listening on :$port — stop <$slug> first"
|
|
69
66
|
fi
|
|
70
67
|
|
|
71
68
|
if [ "$force" -eq 0 ]; then
|
|
@@ -83,7 +80,8 @@ if [ "$force" -eq 1 ]; then
|
|
|
83
80
|
else
|
|
84
81
|
git worktree remove "$path"
|
|
85
82
|
fi
|
|
86
|
-
[ -n "$port" ] &&
|
|
87
|
-
|
|
88
|
-
|
|
83
|
+
if [ -n "$port" ] && [ "$(wt_owner "$port")" = "$slug" ]; then
|
|
84
|
+
wt_release "$port" "$slug"
|
|
85
|
+
ok released ":$port"
|
|
86
|
+
fi
|
|
89
87
|
ok removed "$path"
|
|
@@ -15,10 +15,10 @@ usage() {
|
|
|
15
15
|
cat <<'EOF'
|
|
16
16
|
Usage: .sassywares/worktree/stop <slug|branch>
|
|
17
17
|
|
|
18
|
-
Kill the processes listening on
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
Kill the processes listening on the address this checkout advertises — its claimed
|
|
19
|
+
port if it has one, otherwise the port its recipe's preview line names. Nothing
|
|
20
|
+
listening is a success with a note, so stopping twice is safe. A preview that names
|
|
21
|
+
no port at all (a simulator, a window) is the project's to stop.
|
|
22
22
|
EOF
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -36,8 +36,8 @@ slug="$(wt_slug "$branch")"
|
|
|
36
36
|
|
|
37
37
|
wt_is_main "$path" && die "the main checkout is not a worktree — nothing to stop"
|
|
38
38
|
wt_managed "$path" || die "'$1' is not managed here — it is outside the worktree home, or it was cut before the wiring"
|
|
39
|
-
|
|
40
|
-
port
|
|
39
|
+
port="$(wt_live_port "$slug")"
|
|
40
|
+
[ -n "$port" ] || die "no address to stop — worktrees.ports is unset and the preview line names no port"
|
|
41
41
|
|
|
42
42
|
if ! tcp_up "$port"; then
|
|
43
43
|
ok status "nothing listening on :$port"
|
|
@@ -68,7 +68,7 @@ because a project that "helpfully" removes it commits screenshots by accident.
|
|
|
68
68
|
**Set up once:** `bun install`; `docker compose up -d db`;
|
|
69
69
|
copy `.env.example` → `.env` and fill `DOGFOOD_USER`, `DOGFOOD_PASS`.
|
|
70
70
|
|
|
71
|
-
**Reset:** `bun run db:reset
|
|
71
|
+
**Reset:** `bun run db:reset`
|
|
72
72
|
|
|
73
73
|
**Preview:** open `http://localhost:${WT_PORT:-3000}`
|
|
74
74
|
|
|
@@ -119,7 +119,8 @@ answer. A section without one has no verdict.
|
|
|
119
119
|
|
|
120
120
|
**One `**Preview:**` line**, optional: **what you look at**, not the command that
|
|
121
121
|
starts it. The command belongs in the section's steps, where its `Expect` can be
|
|
122
|
-
checked
|
|
122
|
+
checked — and no step has to consume this line: a suite that starts its own server
|
|
123
|
+
never visits the address a human would. The result — a URL, a simulator, a window — is the project's own answer
|
|
123
124
|
to "what is the address", and it is why the suite never has to assume a browser.
|
|
124
125
|
|
|
125
126
|
`$WT_SLUG`, `$WT_NAMESPACE`, `$WT_PATH`, `$WT_PORT`, and `$WT_BASE_URL` are
|
|
@@ -262,6 +263,10 @@ one file to know where it stopped.
|
|
|
262
263
|
note — `catalog-5 exit 1, run 20260514-093107` — which never depends on a path
|
|
263
264
|
that will be deleted.
|
|
264
265
|
- **Never committed.** Not the logs, the artifacts, or the traces.
|
|
266
|
+
- **Never deleted by a recipe.** `**Reset:**` puts the *product* back to a known
|
|
267
|
+
state; it never touches `reports/`. Pruning to ten is the tooling's job, and a
|
|
268
|
+
recipe that deletes reports destroys the record of the failure you were about to
|
|
269
|
+
investigate — including the one that is still open.
|
|
265
270
|
|
|
266
271
|
## Two gates: `enabled` and the recipe
|
|
267
272
|
|
|
@@ -110,9 +110,14 @@ to the config for this — it is procedure, not identity.
|
|
|
110
110
|
When a range *is* configured: the slug hashes into it, the claim is taken with an
|
|
111
111
|
atomic `mkdir`, and a collision probes forward one port at a time. A claim
|
|
112
112
|
belongs to a slug, so a restarted app returns to the same port and two slugs that
|
|
113
|
-
hash alike do not fight.
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
hash alike do not fight.
|
|
114
|
+
|
|
115
|
+
**Liveness and stopping follow the address, not the claim.** `list` probes the port
|
|
116
|
+
the checkout advertises — its claim if it has one, otherwise the port its recipe's
|
|
117
|
+
`**Preview:**` line names — and never trusts a recorded pid. `stop` kills by that
|
|
118
|
+
same address, and `remove` refuses to delete a checkout while it answers. A preview
|
|
119
|
+
that names no port at all (a simulator, a desktop window) has nothing to probe, so
|
|
120
|
+
`LIVE` reads `—` and stopping it is the project's job.
|
|
116
121
|
|
|
117
122
|
## Hooks
|
|
118
123
|
|
|
@@ -172,7 +177,7 @@ writing down once in the recipe rather than rediscovering it.
|
|
|
172
177
|
| It is the main checkout | the repo itself |
|
|
173
178
|
| Dirty tree | uncommitted work |
|
|
174
179
|
| Commits on no remote | nothing to recover from |
|
|
175
|
-
| Something listening on its
|
|
180
|
+
| Something listening on its advertised address | stop the app first |
|
|
176
181
|
| A `before_remove` hook not yet run | the project has cleanup to do |
|
|
177
182
|
|
|
178
183
|
`remove` deletes the checkout, the port claim, and nothing else. **The branch
|
|
@@ -42,7 +42,7 @@ argument-hint: "[slug] [mode:create|list|preview|remove|prune] [section:<name>]"
|
|
|
42
42
|
|
|
43
43
|
Paths in the table are shortened to `~`; `--path <slug>` prints the real absolute path, which is what you hand a user who wants to open the checkout in an editor.
|
|
44
44
|
|
|
45
|
-
Run `.sassywares/worktree/list` and present it as it prints — branch, worktree, how to see it, live, last verdict. `--preview <slug>` prints how to see one checkout, `--path <slug>` its path, and `--address <slug>` its URL
|
|
45
|
+
Run `.sassywares/worktree/list` and present it as it prints — branch, worktree, how to see it, live, last verdict. `--preview <slug>` prints how to see one checkout, `--path <slug>` its path, and `--address <slug>` its URL — from its claimed port, or the one its preview line names. Never summarise the table away: how to see it is the point.
|
|
46
46
|
|
|
47
47
|
## `preview`
|
|
48
48
|
|
|
@@ -51,7 +51,7 @@ Run `.sassywares/worktree/list` and present it as it prints — branch, worktree
|
|
|
51
51
|
3. **Preflight the session.** If the recipe's *Working in a second checkout* or *Set up once* names a session artifact and `.sassywares/session/` in **that checkout** is empty, that is `class: env`: report it with the line that fixes it and stop. Never open a logged-out app and call it a preview — the human will read the login screen as a broken build.
|
|
52
52
|
4. **Run the bring-up.** In `WT_PATH`: the recipe's *Set up once* when the checkout is cold (no `.env`, no installed deps), then the section's steps in order **up to but not including** its `Prove it:` step. Judge each step by its `Expect`. A failure stops the preview and is reported with the step id and its output tail — a preview that half-started is not a preview.
|
|
53
53
|
5. **Leave it running and report how to see it.** `list --preview <slug>` prints the recipe's `**Preview:**` line with the namespace substituted — the *result*, a URL or a simulator name or a window, never the command that started it. Print exactly that; never build an address yourself, and never assume one is a URL. When the project has ports and the preview answers on one, say it is up; when it does not, say it is running and that stopping it is the project's job.
|
|
54
|
-
6. **To stop it,** run `.sassywares/worktree/stop <slug>`. It kills
|
|
54
|
+
6. **To stop it,** run `.sassywares/worktree/stop <slug>`. It kills whatever answers on the address this checkout advertises — its claimed port, or the port its preview line names — so it works for a project with no port resource too. A preview that names no port at all is the project's to stop, and it says so.
|
|
55
55
|
|
|
56
56
|
Preview never judges the work, never writes a report, never commits, and never returns a verdict. If the user wants to know whether it *works*, that is `sassy-dogfood mode:run`.
|
|
57
57
|
|