Skip to content

Commit 33ee527

Browse files
feat(skills/update-stack): drop ledger condition + auto-derive scan list (#3777)
Two coupled changes to step 3ter drift gate: 1. Drop `DOWNSTREAM_PATCHES.md` ledger exception — block on ANY shared non-test file divergence vs `devkit-node/master`. User decision 2026-06-02 (memory `feedback_no_dev_in_shared_modules`): drift in shared files must never happen, not be documented. Resolution path becomes revert / promote-up / relocate. 2. Replace hardcoded module list (`modules/home auth users tasks uploads billing lib config/defaults`) with `modules lib config`. Old enum silently missed `modules/audit`, `modules/core`, `modules/organizations`. Re-audit on trawl_node with corrected scan surfaced 1 undeclared drift (`modules/core/doc/index.yml`). Mirrors infra#37 (PRF Phase 0.5 gate) for `/update-stack`-time enforcement.
1 parent 3086820 commit 33ee527

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

.claude/skills/update-stack/SKILL.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ BODY
8888

8989
Proceed to Phase 2 and track the upstream fix separately — do not block downstream alignment on it.
9090

91-
### 3ter. Block on undeclared drift
91+
### 3ter. Block on drift
9292

93-
After `/verify` passes, run a final diff sweep before starting Phase 2. Any stack file that diverges from upstream **and** is not declared in `DOWNSTREAM_PATCHES.md` blocks the flow.
93+
After `/verify` passes, run a final diff sweep before starting Phase 2. Any shared non-test stack file that diverges from upstream blocks the flow. No ledger exception (user decision 2026-06-02 — drift must never happen, not be documented).
9494

9595
```bash
9696
git fetch devkit-node master --quiet
@@ -101,24 +101,23 @@ while IFS= read -r f; do
101101
[ -z "$upstream_blob" ] && continue # downstream-only file — skip
102102
local_blob=$(git rev-parse "HEAD:$f" 2>/dev/null)
103103
if [ "$upstream_blob" != "$local_blob" ]; then
104-
if ! grep -qF "'$f'" DOWNSTREAM_PATCHES.md 2>/dev/null; then
105-
echo "BLOCK: undeclared drift on stack file: $f"
106-
echo " Fix A — revert to upstream: git checkout devkit-node/master -- $f"
107-
echo " Fix B — declare it: add '$f' + rationale to DOWNSTREAM_PATCHES.md"
108-
drift_found=1
109-
fi
104+
echo "BLOCK: drift on shared stack file: $f"
105+
echo " Fix A — revert to upstream: git checkout devkit-node/master -- $f"
106+
echo " Fix B — promote upstream: open a devkit PR with the change, merge, /update-stack here"
107+
echo " Fix C — relocate: move logic to a downstream-only module or config/defaults/<project>.config.js"
108+
drift_found=1
110109
fi
111-
done < <(git ls-files modules/home modules/auth modules/users modules/tasks modules/uploads modules/billing lib config/defaults 2>/dev/null \
110+
done < <(git ls-files modules lib config 2>/dev/null \
112111
| grep -vE "/(tests|__tests__)/" | grep -vE "\.(test|spec)\.(js|jsx|ts|tsx)$")
113112

114113
[ "$drift_found" -eq 1 ] && exit 1
115-
echo "3ter: no undeclared drift — OK"
114+
echo "3ter: no drift — OK"
116115
```
117116

118117
**Rules:**
119-
- Missing `DOWNSTREAM_PATCHES.md` = no declared divergences allowed (treat as empty).
120-
- Declare diverging paths in `DOWNSTREAM_PATCHES.md` as `'path/to/file'` (single-quoted) — the gate matches on the quoted token to avoid substring collisions.
121-
- Downstream-only files (new modules, helpers, lib additions) are not scanned — the sweep only covers the stack directories listed above.
118+
- Block on ANY shared-file divergence. No "declare and skip" path — the `DOWNSTREAM_PATCHES.md` ledger model was abandoned 2026-06-02 (memory `feedback_no_dev_in_shared_modules`).
119+
- Scan covers the full stack tree (`modules`, `lib`, `config`) — auto-discovers every shared module. Per-file `git ls-tree` on upstream filters downstream-only files.
120+
- Test files (`/tests*/`, `/__tests__/`, `*.test.*`, `*.spec.*`) are excluded — downstream test adaptations are acceptable.
122121
- This gate runs **after** `/verify` (never blocks on transient verify failures) and **before** Phase 2 (failure is recoverable — no merge commit yet).
123122
- Ref: plan `2026-05-30-trawl-devkit-perfect-alignment.md` Tasks E.1 + E.2.
124123

0 commit comments

Comments
 (0)