@techgoblin/gobstack 0.7.5 → 0.7.6

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/CHANGELOG.md CHANGED
@@ -37,7 +37,6 @@ version recorded in a target's `.goblin/installed.json` and the source `VERSION`
37
37
  bare id with no check cell. `tests/t-extend.sh` proves the loop end to end through the real file:
38
38
  a library row off, then on and green, then red under its violation with its remedy, then refused
39
39
  when miswritten, then off again.
40
-
41
40
  ## Unreleased (feat/extras-catalogue)
42
41
 
43
42
  - **`gob extras`: the curated catalogue (the surface is seven verbs).** The catalogue
@@ -54,6 +53,26 @@ version recorded in a target's `.goblin/installed.json` and the source `VERSION`
54
53
  promotes them into catalogue.tsv by PR or edit. `--write` honours only the proposal's TICKED
55
54
  rows, through `gob extras install` itself — one allowlist, one code path.
56
55
 
56
+ ## 0.7.6 (curation: a dependency floor resolves, a performance baseline is re-measured)
57
+
58
+ - **`DP-02` (library row, off by default): an override resolves, it is not just declared.** The
59
+ `package.json` `overrides`/`resolutions` floor is certified against the tree that actually
60
+ installs: `npm ls <pkg> --all --workspaces=false --json` must show every hit satisfying the
61
+ floor (`sort -V`), each printed as `pkg@version (under ...)`, a resolver that cannot run is a
62
+ FAIL of the row (never a pass), and the RED names the package, the floor, every offending
63
+ version and the exact command that shows it. A repo opts in through
64
+ `.gob/manifest/enforcement.local.tsv`; `goblin-verify --only DP-02` SKIPs when there is no
65
+ `package.json` or no declared floor. What the resolver cannot see is docs/LIMITS.md #73
66
+ (`ecosystem:node`).
67
+ - **`PF-02` (library row, off by default): a performance baseline is re-measured, not trusted.**
68
+ `perf.cmd` is re-run in the repo root under `timeout 300`; the first integer it prints is the
69
+ measurement and it must stay inside `perf.baseline_value` plus `perf.tolerance` (default 10,
70
+ integer percent) — PASS prints metric, value, baseline and tolerance, RED names both numbers,
71
+ a command that prints no number FAILs (`unknown` is never treated as fine), and an empty
72
+ `perf.cmd` or `perf.baseline_value` SKIPs naming the missing half. A repo opts in through
73
+ `.gob/manifest/enforcement.local.tsv`. One measurement is one sample and the tolerance is the
74
+ row's whole honesty — docs/LIMITS.md #74.
75
+
57
76
  ## 0.7.5 (metadata: the repository URL, and the census that could hide)
58
77
 
59
78
  - **`package.json` names the repo it ships from.** `repository.url` now points at
package/README.md CHANGED
@@ -206,7 +206,7 @@ yet, not red). Every run prints what it cannot see.
206
206
  bash tests/run-tests.sh
207
207
 
208
208
  Runs the source-scope rules (PR-01..PR-04) and the test scripts, including `t-verify-red.sh` —
209
- one control per target-scope row (152 over 63 target rows), each required to go RED and then
209
+ one control per target-scope row (157 over 65 target rows), each required to go RED and then
210
210
  restored. **A verifier that only ever prints GREEN is a failure**, so that file is the one that
211
211
  matters most.
212
212
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.5
1
+ 0.7.6
package/bin/goblin-bans CHANGED
@@ -41,7 +41,7 @@
41
41
 
42
42
  set -uo pipefail
43
43
 
44
- GOBLIN_BANS_VERSION="0.7.5"
44
+ GOBLIN_BANS_VERSION="0.7.6"
45
45
  SELF_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
46
46
  # shellcheck source=goblin-lib.sh
47
47
  . "$SELF_DIR/goblin-lib.sh"
@@ -28,7 +28,7 @@
28
28
 
29
29
  set -uo pipefail
30
30
 
31
- GOBLIN_INSTALL_VERSION="0.7.5"
31
+ GOBLIN_INSTALL_VERSION="0.7.6"
32
32
  SELF_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
33
33
  SRC=$(cd "$SELF_DIR/.." && pwd)
34
34
  # shellcheck source=goblin-lib.sh
package/bin/goblin-lib.sh CHANGED
@@ -16,7 +16,7 @@
16
16
  # - name: typecheck four-space-indented second member of a list entry
17
17
  # cmd: npx tsc --noEmit
18
18
 
19
- GOBLIN_LIB_VERSION="0.7.5"
19
+ GOBLIN_LIB_VERSION="0.7.6"
20
20
 
21
21
  # ---------------------------------------------------------------- output -----
22
22
  # g_trunc <width> <text> — fold a long detail to one line at <width> columns, keeping the
package/bin/goblin-verify CHANGED
@@ -19,7 +19,7 @@
19
19
 
20
20
  set -uo pipefail
21
21
 
22
- GOBLIN_VERIFY_VERSION="0.7.5"
22
+ GOBLIN_VERIFY_VERSION="0.7.6"
23
23
  SELF_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
24
24
  # shellcheck source=goblin-lib.sh
25
25
  . "$SELF_DIR/goblin-lib.sh"
@@ -2072,6 +2072,168 @@ EOF
2072
2072
  [ "$bad" -eq 0 ]
2073
2073
  }
2074
2074
 
2075
+ # ---- DP-02 (CURATION-2026-11-29, library row, OFF by default) -------------------------------
2076
+ # DP-02 — a declared floor is proven by what resolves, not by what was written. The only
2077
+ # witness that can see the tree a floor applies to is the resolver, so the row asks it
2078
+ # (`npm ls <pkg> --all --workspaces=false --json`) and compares every hit against the floor
2079
+ # with `sort -V`, printing each hit as `pkg@version (under ...)`. A resolver that cannot run
2080
+ # is a FAIL of the row, never a pass: an uncertified floor is exactly the failure the row
2081
+ # exists to catch. Limit: it certifies the hits the listing carries — a duplicate hidden
2082
+ # behind a peer resolution or outside this workspace root sits outside the listing.
2083
+
2084
+ # _dp_floor_min <raw value> — the lowest concrete version a floor range demands: the first
2085
+ # version-shaped token with the range decoration (^ ~ > >= =) stripped and a trailing .x/.*
2086
+ # cut. Empty when the value names no version at all (`$ref`, `workspace:*`, `true`).
2087
+ _dp_floor_min() {
2088
+ printf '%s' "$1" | tr ' ' '\n' \
2089
+ | grep -E '^[~^>=]*[0-9]+(\.[0-9]+)*(|-|\.)?(x|X|\*)?$' | head -n 1 \
2090
+ | sed -e 's/^[~^>=]*//' -e 's/\.\(x\|X\|\*\)$//'
2091
+ }
2092
+
2093
+ # _dp_floors <package.json> — pkg<TAB>parent<TAB>rawvalue lines for every entry in the
2094
+ # `overrides`/`resolutions` objects whose value is a string (parent is `-` when the floor is
2095
+ # unscoped; a real field must never be empty or `read` would collapse the delimiter). A nested
2096
+ # object entry (npm's scoped-override form) contributes its "." value as the parent's own floor
2097
+ # and every other key as a floor scoped under that parent; a resolutions key `parent/dep` is
2098
+ # scoped the same way (the shell splits it). Scalar values are skipped here; the floor check
2099
+ # drops the rest.
2100
+ _dp_floors() {
2101
+ tr -d '\n\r\t' < "$1" | awk '
2102
+ function obj_at(s, start, i, d, c) {
2103
+ d = 0
2104
+ for (i = start; i <= length(s); i++) {
2105
+ c = substr(s, i, 1)
2106
+ if (c == "{") d++
2107
+ else if (c == "}") { d--; if (d == 0) return substr(s, start, i - start + 1) }
2108
+ }
2109
+ return ""
2110
+ }
2111
+ function scan(o, parent, pos, m, key, after, vstart, vend, ab, subo, nc) {
2112
+ pos = 1
2113
+ while (match(substr(o, pos), /"[^"]+"[[:space:]]*:/)) {
2114
+ m = substr(o, pos + RSTART, RLENGTH)
2115
+ key = m; sub(/^[[:space:]]*"/, "", key); sub(/"[[:space:]]*:.*$/, "", key)
2116
+ after = pos + RSTART + RLENGTH - 1
2117
+ rest = substr(o, after)
2118
+ sub(/^[[:space:]]*/, "", rest)
2119
+ if (substr(rest, 1, 1) == "{") {
2120
+ ab = after
2121
+ while (ab <= length(o) && substr(o, ab, 1) != "{") ab++
2122
+ subo = obj_at(o, ab)
2123
+ scan(substr(subo, 2, length(subo) - 2), key)
2124
+ pos = ab + length(subo)
2125
+ } else if (substr(rest, 1, 1) == "\"") {
2126
+ vstart = after
2127
+ while (vstart <= length(o) && substr(o, vstart, 1) != "\"") vstart++
2128
+ vend = vstart + 1
2129
+ while (vend <= length(o) && substr(o, vend, 1) != "\"") vend++
2130
+ printf "%s\t%s\t%s\n", key, (parent == "" ? "-" : parent), substr(o, vstart + 1, vend - vstart - 1)
2131
+ pos = vend
2132
+ } else {
2133
+ nc = index(substr(o, after), ",")
2134
+ if (nc == 0) { pos = length(o) + 1 } else { pos = after + nc }
2135
+ }
2136
+ }
2137
+ }
2138
+ BEGIN { nb = split("overrides resolutions", blocks, " ") }
2139
+ {
2140
+ s = $0
2141
+ for (bi = 1; bi <= nb; bi++) {
2142
+ key = blocks[bi]
2143
+ kp = index(s, "\"" key "\"")
2144
+ if (kp == 0) continue
2145
+ op = index(substr(s, kp), "{")
2146
+ if (op == 0) continue
2147
+ obj = obj_at(s, kp + op - 1)
2148
+ if (obj == "") continue
2149
+ scan(substr(obj, 2, length(obj) - 2), "")
2150
+ }
2151
+ }'
2152
+ }
2153
+
2154
+ # _dp_hits <pkg> — pkg<TAB>version<TAB>chain lines for every hit of pkg in `npm ls --json`
2155
+ # output on stdin. Structural `dependencies` layers are dropped from the chain, so a hit
2156
+ # prints as `under tailwindcss` and a workspace-root hit prints `under <root>`.
2157
+ _dp_hits() {
2158
+ awk -v want="$1" '
2159
+ {
2160
+ line = $0
2161
+ opens = gsub(/\{/, "{", line)
2162
+ closes = gsub(/\}/, "}", line)
2163
+ depth += opens
2164
+ if (opens > 0 && match(line, /^ *"[^"]+"[[:space:]]*:[[:space:]]*\{/)) {
2165
+ key = line; sub(/^ *"/, "", key); sub(/".*$/, "", key)
2166
+ stack[depth] = key
2167
+ } else if (opens > 0) {
2168
+ stack[depth] = ""
2169
+ }
2170
+ if (depth >= 2 && stack[depth] == want && match(line, /"version"[[:space:]]*:[[:space:]]*"[^"]+"/)) {
2171
+ v = substr(line, RSTART, RLENGTH)
2172
+ sub(/.*:[[:space:]]*"/, "", v); sub(/"$/, "", v)
2173
+ chain = ""
2174
+ for (i = 1; i < depth; i++) if (stack[i] != "" && stack[i] != "dependencies") chain = (chain == "" ? stack[i] : chain " > " stack[i])
2175
+ printf "%s\t%s\t%s\n", want, v, (chain == "" ? "<root>" : chain)
2176
+ }
2177
+ depth -= closes
2178
+ }'
2179
+ }
2180
+
2181
+ check_dp_02() {
2182
+ # The overrides row: what was WRITTEN in package.json must be what RESOLVES at every hit.
2183
+ [ -f "$ROOT/package.json" ] || { printf 'no package.json - there is no override to certify\n'; return 3; }
2184
+ local floors="" pkg parent raw fmin rc out hits lowest nfloor=0 bad=0
2185
+ floors=$(_dp_floors "$ROOT/package.json")
2186
+ [ -n "$floors" ] || { printf 'no declared floor: package.json carries no overrides/resolutions entry with a version floor\n'; return 3; }
2187
+ while IFS="$(printf '\t')" read -r pkg parent raw; do
2188
+ [ -n "$pkg" ] || continue
2189
+ [ "$parent" = "-" ] && parent=""
2190
+ case "$pkg" in
2191
+ .) # npm's scoped-override form {"parent": {"." : "^x"}} — the parent's own floor;
2192
+ # unscoped so every resolved hit of the parent itself is certified
2193
+ [ -n "$parent" ] || continue
2194
+ pkg="$parent"; parent="" ;;
2195
+ */*) parent="${pkg%%/*}"; pkg="${pkg#*/}" ;;
2196
+ esac
2197
+ fmin=$(_dp_floor_min "$raw")
2198
+ [ -n "$fmin" ] || continue
2199
+ nfloor=$((nfloor + 1))
2200
+ out=$( cd "$ROOT" && npm ls "$pkg" --all --workspaces=false --json 2>/dev/null )
2201
+ rc=$?
2202
+ if ! printf '%s' "$out" | grep -q '^{'; then
2203
+ printf 'the resolver could not certify %s: `npm ls %s --all --workspaces=false --json` produced no JSON tree (rc %s)\n' "$pkg" "$pkg" "$rc"
2204
+ bad=1; continue
2205
+ fi
2206
+ hits=$(_dp_hits "$pkg" <<<"$out" | awk ' !seen[$0]++ ')
2207
+ if [ -z "$hits" ]; then
2208
+ if [ "$rc" -ne 0 ]; then
2209
+ printf 'the resolver could not certify %s: the tree it reports is not intact (rc %s, no %s hit) - see `npm ls %s --all --workspaces=false --json`\n' "$pkg" "$rc" "$pkg" "$pkg"
2210
+ bad=1; continue
2211
+ fi
2212
+ printf '%s has no hit in the resolved tree (floor %s) - nothing violates it\n' "$pkg" "$raw"
2213
+ continue
2214
+ fi
2215
+ while IFS="$(printf '\t')" read -r _hpkg hver chain; do
2216
+ # a scoped floor certifies only the hits under its parent; an unscoped floor every hit
2217
+ if [ -n "$parent" ] && [ "$chain" != "<root>" ] \
2218
+ && ! printf '%s' "$chain" | grep -q -- "$parent" \
2219
+ && [ "$_hpkg" != "$parent" ]; then
2220
+ continue
2221
+ fi
2222
+ lowest=$(printf '%s\n' "$fmin" "$hver" | sort -V | head -n 1)
2223
+ if [ "$lowest" = "$fmin" ]; then
2224
+ printf '%s@%s (under %s) satisfies the floor %s\n' "$pkg" "$hver" "$chain" "$raw"
2225
+ else
2226
+ printf '%s@%s (under %s) is below the declared floor %s (lowest demanded: %s) - shown by `npm ls %s --all --workspaces=false --json`\n' "$pkg" "$hver" "$chain" "$raw" "$fmin" "$pkg"
2227
+ bad=1
2228
+ fi
2229
+ done <<<"$hits"
2230
+ done <<<"$floors"
2231
+ [ "$nfloor" -gt 0 ] || { printf 'no declared floor: package.json carries no overrides/resolutions entry with a version floor\n'; return 3; }
2232
+ [ "$bad" -eq 0 ] || return 1
2233
+ printf '%d declared floor(s) certified against the resolved tree\n' "$nfloor"
2234
+ return 0
2235
+ }
2236
+
2075
2237
  check_sc_06() {
2076
2238
  [ -f "$ROOT/package.json" ] || { printf 'no package.json - there is no dependency manifest to lock\n'; return 3; }
2077
2239
  local f found=""
@@ -2243,6 +2405,38 @@ sk01_cell() {
2243
2405
  n=0; for f in .gob/skills/*/SKILL.md .hermes/skills/*/SKILL.md; do [ -e "$f" ] || continue; n=$((n+1)); head -n 1 "$f" | grep -qx -- '---' || exit 1; awk 'NR==1{next} /^---/{exit} /^name:/{a=1} /^description:/{b=1} END{exit !(a&&b)}' "$f" || exit 1; done; [ "$n" -gt 0 ] || { echo "no installed skill found"; exit 1; }; exit 0
2244
2406
  }
2245
2407
 
2408
+ # ---- PF-02 (CURATION-2026-11-29, library row, OFF by default) -------------------------------
2409
+ # PF-02 — the baseline is a NUMBER somebody measured, so the row re-measures: it runs the
2410
+ # declared `perf.cmd` inside the repo under `timeout 300`, reads the first integer of its
2411
+ # output as the sample, and passes only while the sample stays inside baseline + tolerance
2412
+ # (`perf.tolerance`, default 10, integer percent). One measurement is one sample and the
2413
+ # tolerance is the row's whole honesty — a command that prints no number FAILs the row,
2414
+ # never passes as unknown.
2415
+ check_pf_02() {
2416
+ local tol val ceiling
2417
+ [ -n "$PERF_CMD" ] || { printf 'no perf.cmd declared - there is no command to re-measure (that half is missing)\n'; return 3; }
2418
+ [ -n "$PERF_BASELINE_VALUE" ] || {
2419
+ printf 'no perf.baseline_value recorded (that half is missing): run `%s`, take the number it prints, write it as the baseline\n' "$PERF_CMD"
2420
+ return 3
2421
+ }
2422
+ case "$PERF_BASELINE_VALUE" in ''|*[!0-9]*) printf 'perf.baseline_value is not a number: %s\n' "${PERF_BASELINE_VALUE:-<empty>}"; return 1 ;; esac
2423
+ tol=$(g_agents_read "$CONFIG" perf.tolerance)
2424
+ [ -n "$tol" ] || tol=10
2425
+ case "$tol" in ''|*[!0-9]*) printf 'perf.tolerance is not an integer percent: %s\n' "$tol"; return 1 ;; esac
2426
+ val=$( cd "$ROOT" && timeout 300 bash -c "$PERF_CMD" 2>/dev/null | grep -Eo '[0-9]+' | head -n 1 )
2427
+ if [ -z "$val" ]; then
2428
+ printf 'the declared command printed no number (%s under timeout 300) - unknown is not a pass\n' "$PERF_CMD"
2429
+ return 1
2430
+ fi
2431
+ ceiling=$(( PERF_BASELINE_VALUE * (100 + tol) / 100 ))
2432
+ if [ "$val" -gt "$ceiling" ]; then
2433
+ printf 'measured %s is above baseline %s + tolerance %s%% (ceiling %s) - shown by `%s`\n' "$val" "$PERF_BASELINE_VALUE" "$tol" "$ceiling" "$PERF_CMD"
2434
+ return 1
2435
+ fi
2436
+ printf '%s measured %s, inside baseline %s + tolerance %s%% (ceiling %s)\n' "${PERF_METRIC:-metric}" "$val" "$PERF_BASELINE_VALUE" "$tol" "$ceiling"
2437
+ return 0
2438
+ }
2439
+
2246
2440
  check_sk_01() {
2247
2441
  sk_proc_skip && return 3
2248
2442
  ( cd "$ROOT" && sk01_cell )
@@ -0,0 +1,171 @@
1
+ # Curation — what the tech-goblin dependency and perf rounds taught gobstack (2026-11-29)
2
+
3
+ One project, mined for rules that are true beyond it. This file is the analysis, not the adoption: every
4
+ proposal is stated so it can be argued with, priced, or refused on the record. It follows
5
+ `CURATION-2026-11-25-preview-surfaces.md` and is held to the same standing rule.
6
+
7
+ **Evidence base.** `tech-goblin.com` frontend, 2026-11-29: one dependency round (a security advisory in a
8
+ transitive build-time package, resolved through an `overrides` pin — commit `e6710f1`, Vercel deployment
9
+ `8143879900`) and one measurement round (a zero-dependency CDP performance harness, run against production
10
+ three times). A delegation round ran alongside both and produced the process evidence in §3. Numbers quoted
11
+ here were measured on that machine on that day; every failure named below has an artifact that shows it.
12
+
13
+ **What makes this round worth mining.** Both technical failures were *audit* failures, not code failures: the
14
+ scanner reported eight vulnerabilities where the shipped graph had none, and the first harness reported a
15
+ byte table that was mostly cache fiction waiting to happen. A tool that measures the wrong tree produces
16
+ confident, well-formatted, wrong numbers — and it is believed precisely because it looks like a measurement.
17
+
18
+ ---
19
+
20
+ ## 0. The standing rule this file is held to
21
+
22
+ Unchanged from the 2026-11-25 curation §0: a lesson may enter gobstack only if it is true regardless of
23
+ framework. A mechanism may read per-ecosystem conventions (a lockfile, a `package.json`, a `perf.cmd`) ONLY
24
+ as heuristics — a repo without those conventions gets `SKIP` with the reason, never a RED.
25
+
26
+ Everything adopted below is therefore a **library** row (off by default), so an existing install cannot turn
27
+ red by upgrading, and a repo opts in by pasting one line into `.gob/manifest/enforcement.local.tsv`.
28
+
29
+ ---
30
+
31
+ ## 1. The six candidates, ranked by leverage
32
+
33
+ | # | Lesson | Class | Mechanisable today | Verdict |
34
+ |---|---|---|---|---|
35
+ | D1 | The tree you audit must be the tree you ship | dependency / verification | shape only (needs a `deploy_root` declaration) | **advisory** — candidate `DP-01` |
36
+ | D2 | A security pin is proven resolved, never declared | dependency / security | yes, builtin + `npm ls` | **adopt as `DP-02`** (library, `ecosystem:node`) |
37
+ | D3 | The installed tree must still match the lockfile | dependency / integrity | partly, slow and shallow | **advisory** — candidate `DP-03` |
38
+ | P1 | A perf ratchet must be measured, not declared | performance / verification | yes, `perf.cmd` + tolerance | **adopt as `PF-02`** (library, gate) |
39
+ | J1 | A cause is a cause only when the event stream names it | judgement / review | no (a reading discipline) | **doc only** — LIMITS + skill sentence |
40
+ | K1 | A deferral written in prose is not a lock | delegation / process | no | **advisory** — belongs to the delegation standard |
41
+
42
+ ---
43
+
44
+ ## 2. The adoptions, with the failure that justifies each
45
+
46
+ ### D2 — `DP-02`: a security pin is proven resolved, never declared
47
+
48
+ **Failure.** The shipped graph carried `postcss-selector-parser@6.0.10` (`< 6.1.5`, GHSA-rj75-hqrm-r3gf,
49
+ build-time only, reached through `@tailwindcss/typography`). The fix is one line —
50
+ `"overrides": { "postcss-selector-parser": "^6.1.5" }` — and the interesting part is what "fixed" means. An
51
+ override is a *request*: it is honoured when npm re-resolves, ignored when the tree it is declared in is not
52
+ the tree npm resolves, and silently inert when the declaration sits in the wrong workspace. The only proof
53
+ that existed was a measurement: three resolution hits all at `6.1.6`, `cssesc` gone from the lockfile, and
54
+ the audit count for the shipped tree falling from 2 moderate to 0.
55
+
56
+ **Rule (project-independent).** *A declared version floor for a transitive dependency is proven by the
57
+ version that resolves at every hit, not by the line that was written.*
58
+
59
+ **Mechanism (`DP-02`, library, `script`, `ecosystem:node`).** For each entry in `overrides` (and
60
+ `resolutions` when a repo uses that convention) whose value carries a floor, resolve the package with the
61
+ ecosystem's own resolver in the package root the lockfile governs, and require **every** resolution to satisfy
62
+ the floor. Failures name the package, the floor, the resolved version, and the resolver command that shows
63
+ it. A repo with no `package.json`, or no declared floor, is `SKIP` with that reason — never a pass, because
64
+ "nothing to check" and "checked, fine" are different sentences (the lesson `SC-03` learned in 0.7.0).
65
+
66
+ **Honest limit.** The resolver shows what is installed under the package root it is asked about; a duplicate
67
+ behind a peer resolution, or a pin consumed by a different workspace root, can sit outside the listing. The
68
+ row proves the tree it can see, and says which tree that was.
69
+
70
+ ### P1 — `PF-02`: a perf ratchet must be measured, not declared
71
+
72
+ **Failure.** `PF-01` already requires a perf baseline to name the commit it was measured on. Nothing
73
+ *produces* that number, and nothing re-measures it — so the ratchet can only ratchet a value a human typed.
74
+ The measurement round produced the numbers a gate needs, and three of them are traps: a cold TTFB of
75
+ 1103 ms against a warm 593 ms on the same URL (edge cache, not an optimisation); a CLS of `0` on desktop
76
+ against a visible `<UL>` shift on a throttled phone; and a TBT of 250 ms that exists only under 4× CPU —
77
+ i.e. the desktop-only run says "fine" about a page whose real mobile budget is already breached.
78
+
79
+ **Rule (project-independent).** *A performance gate is a measured baseline plus a tolerance, re-measured by
80
+ the command the repo declares — never a ceiling someone typed, because a ceiling is edited to green and a
81
+ baseline has to be overwritten by a measurement.*
82
+
83
+ **Mechanism (`PF-02`, library, `gate`).** When `perf.cmd` is declared, run it and require the printed number
84
+ to stay within the declared baseline plus tolerance (`perf.tolerance`, default 10 %). No `perf.cmd`, or no
85
+ baseline: `SKIP` naming which half is missing, because a fresh install must not be red for not having
86
+ measured yet. A number that cannot be parsed is a FAIL of the row, not a pass of the page — a gate that reads
87
+ "unknown" as "fine" is the decorative guard `HV-02` already refuses to be.
88
+
89
+ **Honest limit.** A single measurement is a sample: the honest form records the date, the profile and the
90
+ variance of repeat runs, and `PF-02` can only re-run the command the repo declared. It cannot tell a real
91
+ regression from a noisy machine, so the tolerance is the row's whole honesty.
92
+
93
+ ---
94
+
95
+ ## 3. The advisory set (no mechanism yet, and why)
96
+
97
+ - **D1 — the tree you audit must be the tree you ship.** `npm audit` at the monorepo root reported **8
98
+ findings (6 high, 2 moderate)**; the deployed graph reported **0**. Seven of the eight came from **914
99
+ extraneous packages** left in the root `node_modules` by an earlier workspace layout — `js-yaml@3.x`,
100
+ `postcss@8.4.x`, `nanoid@<3.3.18`, `source-map-js@<1.2.2`, `sharp@0.32.6` — none of them in the artifact
101
+ that ships, because the deploy builds `frontend/` with `frontend/package-lock.json`. The general rule is
102
+ strong (*audit the tree the build ships*), but the mechanism needs a declaration gobstack does not have:
103
+ a `deploy_root:` the row can resolve, plus a proof that the deploy config actually uses it. That is a
104
+ design decision, not a probe, and it should be designed against a second project. Candidate `DP-01`,
105
+ held advisory.
106
+ - **D3 — the installed tree must still match the lockfile.** A delegated agent ran
107
+ `npm install --workspace=frontend` **from the monorepo root**: npm walked up, pruned **574 packages** out of
108
+ `frontend/node_modules`, left `frontend/package-lock.json` untouched, and printed no error. The tree and
109
+ the lockfile silently disagreed until every gate was re-run against it. The obvious check —
110
+ `npm ls --depth=0` — is shallow, and a package-count comparison is a heuristic dressed as an equality.
111
+ Held advisory as `DP-03` until someone states a cheap, honest form.
112
+ - **J1 — a cause is a cause only when the event stream names it.** A worker's two failed runs were recorded
113
+ `crashed [worker lost: EOFError, exit_code 15]`. The event stream said something else entirely: run 3 was
114
+ `reclaimed [manual: "card deferred by Harvey, dispatcher started it without go"]`, and the cause was a
115
+ second orchestrator session enforcing a deferral that the scheduler does not read. `SIGTERM` followed by
116
+ `EOF` on a managed pipe is what **every** external `kill` looks like — it is not a crash signature. No row
117
+ can read intent out of a log; what gobstack can carry is the sentence and the blind spot: *an exit code
118
+ names how a process ended, never why, and the why lives in the event log next to it.* Goes to `docs/LIMITS.md`
119
+ and one line in the judge-facing skill, not to the matrix.
120
+ - **K1 — a deferral written in prose is not a lock.** The same card carried "explicitly deferred … do NOT
121
+ start this until Harvey says go" in its body. The dispatcher does not read bodies; it promoted the card to
122
+ `running` on the next tick. Two different actors then disagreed about what "deferred" meant, and the
123
+ disagreement cost two runs. The rule (*a machine that can start work must read the same field the human
124
+ wrote the veto in*) is real but belongs to the delegation standard, not to a repo gate. Advisory.
125
+
126
+ ---
127
+
128
+ ## 4. Where these should live, concretely
129
+
130
+ | Proposal | Matrix row | Skill touch | Doc touch |
131
+ |---|---|---|---|
132
+ | D2 | `DP-02` (library, script, `ecosystem:node`) | `goblin-verify-author`: a pin is a request; the resolver is the proof | LIMITS: what the resolver cannot see |
133
+ | P1 | `PF-02` (library, gate) | `goblin-verify-author`: baseline + tolerance, two profiles, cache off | LIMITS: a sample is a sample |
134
+ | D1, D3 | — (advisory, named candidates) | — | LIMITS: audit on the shipped root; the prune that prints nothing |
135
+ | J1 | none | `goblin-judge`: exit code is not a cause | LIMITS: the event log is the evidence |
136
+ | K1 | none | delegation standard | — |
137
+
138
+ Cost estimate from the shape of the existing checks: `DP-02` is the `SC-06` class (a builtin that returns
139
+ 3 on a non-node repo, then reads one lockfile) — half a day including a negative control that proves it RED
140
+ under a real unresolved floor; `PF-02` is cheaper (it runs a declared command and compares one number) but
141
+ carries the most risk of being written as a decorative guard, so its control must plant both a rise *and* an
142
+ unparseable output.
143
+
144
+ ---
145
+
146
+ ## 5. What this project must NOT push into gobstack
147
+
148
+ Next.js / Vercel / Strapi / Cloudflare facts, the specific advisories and their GHSA ids, the flag names
149
+ (`--workspaces=false`), the measured numbers (1103/593 ms, 2349 ms, 250 ms, 363.7 KB), the workspace layout
150
+ (`frontend/` + `backend/`), the kanban tooling and its scheduler all stay in the project skill. What travels
151
+ is only what survived being separated from them: *resolve, don't declare* (D2) and *measure, then ratchet the
152
+ measurement* (P1). The npm-specific invocation appears in `DP-02` only as a mechanism detail behind an
153
+ `ecosystem:` token, and a repo without that ecosystem records a named SKIP.
154
+
155
+ ---
156
+
157
+ ## 6. What this file leaves open for the next curation
158
+
159
+ 1. **Is "the shipped tree" a declaration or a derivation?** `DP-01` needs `deploy_root:`; the alternative is
160
+ deriving it from the CI config, which is one vendor's YAML. A second project with a different build shape
161
+ decides.
162
+ 2. **How many samples make a perf ratchet honest?** Three runs gave TTFB 1103, 593 and 406 ms on the same
163
+ URL — the spread is larger than any tolerance worth setting. Until a project records variance, `PF-02`
164
+ only catches gross regressions, and it should say so out loud.
165
+ 3. **Does a process lesson ever earn a row?** J1 and K1 are both real, both measured, both unmechanisable —
166
+ the same shape as `HP-04` (advisory, semantic judgement). The next curation should decide whether the
167
+ advisory lane is an acceptable permanent home or whether these belong in the skills only.
168
+
169
+ The general rule this file is built on, unchanged from the first curation: a lesson earns a row only when its
170
+ failure has been *measured* somewhere, and a rule earns a mechanism only when the mechanism can be proven red
171
+ on demand.
package/docs/GUIDE.md CHANGED
@@ -3,7 +3,7 @@
3
3
  A step-by-step guide for your first week. **Read this before the README.** The README tells you
4
4
  what the pieces are; this tells you what to *do*, in order, and what you should see when it works.
5
5
 
6
- Version: `0.7.5` · Last measured: 2026-11-29 · Every command and every output below was run on a
6
+ Version: `0.7.6` · Last measured: 2026-11-29 · Every command and every output below was run on a
7
7
  real repository while writing this guide.
8
8
 
9
9
  ---
package/docs/LIMITS.md CHANGED
@@ -701,6 +701,31 @@ the Node the gates ran under.
701
701
  row catches removal, not a poor replacement, and Tailwind/inline utility classes are
702
702
  invisible to it. The generated trees (`node_modules`, `dist`, `build`, `out`, `.next`,
703
703
  `coverage`) are excluded, so a stylesheet that lives only there is never seen.
704
+ 73. **`DP-02` — the override resolves (added 2026-11-29).** A `package.json` `overrides`/
705
+ `resolutions` entry carrying a version floor is certified against the tree that actually
706
+ resolves: `npm ls <pkg> --all --workspaces=false --json` must show every hit satisfying the
707
+ floor (`sort -V`), each printed as `pkg@version (under ...)`, and a resolver that cannot run
708
+ is a FAIL of the row, never a pass. The row cannot see the tree outside the listing: a
709
+ duplicate hidden behind a peer resolution or living in another workspace root sits outside
710
+ the listing and is never asked about — the resolver sees exactly the tree it is given, no
711
+ more. A floor pinned to a tag/alias ref (and `workspace:*`) contributes no concrete minimum
712
+ and is skipped as unmeasurable rather than guessed.
713
+ 74. **`PF-02` — the baseline is re-measured (added 2026-11-29).** A performance baseline is
714
+ certified by re-running the command the repo declares (`perf.cmd`, under `timeout 300` in
715
+ the repo root): the first integer it prints is the measurement, and it must stay inside
716
+ `perf.baseline_value` plus `perf.tolerance` (default 10, integer percent). The row cannot
717
+ see more than one sample: one measurement is one sample — a lucky run, a warm cache or an
718
+ idle machine passes where a median over ten runs would not. The tolerance is the row's whole
719
+ honesty: there is no dispersion check, no outlier rejection and no host normalisation behind
720
+ it, so a baseline recorded on a faster machine can only be caught if the tolerance is small.
721
+ 75. **An exit code names how a process ended, never why (added 2026-11-29).** Two failed runs of one
722
+ delegated card were recorded `crashed [worker lost: EOFError]`; the event stream beside them said
723
+ `reclaimed [manual]` and named the reason — a second supervisor enforcing a deferral the scheduler
724
+ did not read. `SIGTERM` followed by `EOF` on a managed pipe is what *every* external `kill` looks
725
+ like, so it is a shape shared by intention and by accident, and a report that reads it as "the
726
+ worker crashed" is naming a cause it never measured. No row can read intent out of a log. The
727
+ discipline, for any agent writing up a failure: quote the event that names the cause, and if the
728
+ only evidence is an exit code, say the cause is unknown rather than inventing a plausible one.
704
729
 
705
730
  ---
706
731
 
@@ -24,7 +24,9 @@ SC-03 target No client-visible name is secret-shaped, and no build output carrie
24
24
  SC-04 target Every cookie write carries its flags. lint repo goblin-verify --only SC-04 Builtin, same-statement only: a write spread over three lines is not seen, and the row says so. It REPORTS that a JS-written cookie is readable by any script rather than failing on it - that is a design fact, not a bug - so the pass is about the flags, never about the choice. SC-04
25
25
  SC-05 target Every write route validates its input, or is waived. gate security's write_routes goblin-verify --only SC-05 Builtin: it proves a validator is CALLED (`safeParse|zod|valibot|yup|ajv|superstruct|validate(`), never that the schema is right - a schema that accepts everything passes. `.gob/boundary-waivers` is the escape hatch, and the waived count is printed, so a silent pile-up is visible. SC-05
26
26
  SC-06 target A lockfile exists, and the repo tracks it. gate package.json + lockfile ecosystem:node goblin-verify --only SC-06 Builtin: presence, then `git ls-files --error-unmatch`. It cannot see that the lockfile is STALE relative to `package.json` - resolving that needs the package manager, which is a deliberate network-shaped step, not a check. SKIPs with a reason when there is no `package.json`. SC-06
27
+ DP-02 target A declared version floor for a transitive dependency is proven by the version that resolves at every hit, not by the line that was written. script package.json overrides goblin-verify --only DP-02 Builtin: parses the `overrides`/`resolutions` floors out of `package.json` and asks the resolver to certify them (`npm ls <pkg> --all --workspaces=false --json`): every hit must satisfy the floor (`sort -V`), each printed as `pkg@version (under ...)`, and a resolver that cannot run is a FAIL of the row, never a pass. It cannot see the tree outside the listing - a duplicate hidden behind a peer resolution or another workspace root sits outside the listing (ecosystem:node). SKIPs with a reason when there is no `package.json` or no declared floor. DP-02
27
28
  PF-01 target The perf baseline names the commit it measured. lint AGENTS.md perf: + ratchet: goblin-verify --only PF-01 Builtin: the metric must equal `ratchet.name` so the budget and the measurement cannot silently disagree, the value must be numeric, the date must exist, the baseline commit must exist AND be an ancestor of HEAD (`HP-05`'s mechanic, reused rather than re-derived), and `ratchet.ceiling` must equal `perf.baseline_value` - otherwise a one-line ceiling raise passes while the row prints the contradiction, which is `I raised the budget and never measured again` (G8-6b). It cannot see whether the metric is the right one for the product, and it never re-measures: re-anchoring is a deliberate operator action. SKIPs with a reason when no perf metric is declared, or none has been recorded yet. PF-01
29
+ PF-02 target A performance baseline is re-measured by the command the repo declares, and the measurement stays inside the baseline plus tolerance. gate AGENTS.md perf.* goblin-verify --only PF-02 Builtin: runs `perf.cmd` in the repo root under `timeout 300` and takes the first integer of its output as the sample; the row passes only while `value <= perf.baseline_value * (100 + perf.tolerance) / 100` (default tolerance 10, integer percent). One measurement is one sample - the tolerance is the row's whole honesty, so a command that prints no number FAILs the row rather than passing as unknown. SKIPs with a reason when `perf.cmd` or `perf.baseline_value` is empty. PF-02
28
30
  VA-01 target The generated verification skill's doctor command runs and exits 0. gate AGENTS.md verify_doctor: goblin-verify --only VA-01 SKIPs (exit 3) when verify_doctor: is empty (the replay.commit: "" shape). Runs the DECLARED command exactly as GT-02 runs a declared gate, and never a string read out of file content (the v0.2 blocker). Closes P6's stated-but-unenforced clause 'a generated skill that was never executed is a draft': the doctor is the smallest executable proof that the skill's own instructions still run - and it proves only that, never that the doctor tests the right path. VA-01
29
31
  RC-01 target No file in the shipping tree matches a reference-corpus hash. gate reference-manifest.json + security: build_output: goblin-verify --only RC-01 Four clauses: (1) `reference_manifest:` empty -> SKIP with that reason (the `FM-01`/`VA-01` shape - not born RED); (2) declared but missing or unparseable -> FAIL, never a SKIP; (3) any file under the declared `security: build_output:` whose sha256 appears in an entry's sha256 -> FAIL, naming path + entry; (4) the manifest itself must not sit inside the build output, at the declared path or as a byte-identical copy - it is a listing of every corpus hash, so shipping it ships the corpus's shape. Cannot see: a re-encoded/resized/recoloured asset (level 2), copied text in a shipped string (level 3), or a manifest authored weak - that is `RC-02`. RC-01
30
32
  RC-02 target The reference manifest is shaped so `RC-01` cannot pass vacuously. lint reference-manifest.json ecosystem:goblin-reference goblin-verify --only RC-02 Schema `reference-manifest/1`; `generated_from` non-empty; `reference_app.package`/`.version`/`apk_sha256` (64 hex); `entries` non-empty; every entry carries `path`, 64-hex `sha256`, numeric `bytes`; `entry_count` equals `len(entries)`. SKIPs with `RC-01`'s reason when the key is empty. Exists because `RC-01` alone carries the `bans.tsv` weakness: a weakened input passes the check it feeds (`LIMITS.md` #28). It cannot see whether the entries are the *right* hashes - that is as strong as tamper hashing, and `installed.json` is unsigned (`LIMITS.md` #18). RC-02
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techgoblin/gobstack",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Agent-discipline toolkit: one verify command, an enforcement matrix, and LIMITS. bash engine, npm shim.",
5
5
  "bin": {
6
6
  "goblin": "bin/goblin.js",