90e60b414595f510d6f519e5087ce7b7943ae38c
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
5292bc5477 |
refactor(3597): extract captureConsole + toPosixPath to helpers; dedup makeTmp wrappers; CLAUDE.md MemPalace
## Helper deduplication (16 files)
Two genuinely-duplicated test helpers extracted to tests/helpers.cjs:
- captureConsole(fn) → {stdout, stderr} with ANSI strip + exception
re-throw after console restore (preserves the #2775 CR contract).
Removed from 6 bug-N test files (bug-2775, bug-2829, bug-3033,
bug-3211, bug-3231, bug-3359) where the implementation was either
byte-identical or trivially-different. installer-migration-install-
integration's captureConsole has a different signature ({value,
output}) and stays as-is.
- toPosixPath(p) → p with path.sep → '/'. Returns input unchanged if
null/undefined for safe optional-chain composition. Replaces the
local normalizePath in bug-3491-nested-git-worktree (the
prune-orphaned-worktrees inline normalizeSlashes was already swapped
for canonicalPath in the cluster-J batch).
## makeTmp/mkScratch wrappers (8 files)
Reduced each local wrapper from a 3-line fs.mkdtempSync(path.join(
os.tmpdir(), ...)) block to a 1-line arrow delegating to
createTempDir (already in helpers.cjs). Bug-number prefix conventions
stay local for readability:
- bug-2256, bug-2794, feat-3023, feat-3024 → `gsd-<bug>-${prefix}-`
- bug-3288 → makeTmpDir = createTempDir (identity)
- bug-3571 → 'gsd-3571-' (no parameter)
- feat-3595 → mkScratch = `fs-fault-${name}-`
- project-root-generator → 'gsd-parity-'
bug-3288 also collapsed local rmTmpDir into `cleanup` from helpers
(removes a separate inline rmSync site).
## CLAUDE.md — MemPalace protocol
Adds explicit instruction to call mempalace_status at session start
and mempalace_search / mempalace_kg_query before answering questions
about people, past work, or prior decisions in this project.
## Why this is a real consolidation
Initial survey suggested the bug-N test files could be parameterized
into one install-end-to-end.test.cjs — that turned out to oversell the
savings (~200 LOC on 2238) and to bury per-bug fixture context in a
table. The genuinely duplicated surface was the helpers themselves:
captureConsole copy-pasted ~6×, makeTmp variant copy-pasted ~8×.
Extracting them retires ~170 LOC of pure copy-paste without changing
any test semantics.
Validated: holodeck (ubuntu docker) 11232/0 pass; ratchet guard
still 7/7 at baseline.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
||
|
|
3a98ce83e5 |
fix(3597): windows parity batch — sdk/install/hook/worktree clusters (21 files)
Three parallel diagnostic agents (G: sdk/install path-sep, H: hook scripts, I: worktree/workspace) characterised the remaining windows-22 failures on |
||
|
|
b08e57c92d |
fix(install): copy sdk/shared/model-catalog.json + resolve chain in CJS (#3288) (#3293)
* test: reproduce model-catalog MODULE_NOT_FOUND in install layout (#3288) Tests A/B/C exercise the install-layout regression introduced by #3230: - A: confirms the old 3-level __dirname path fails when sdk/shared/ is absent - B: confirms the new co-located bin/shared/ path resolves correctly (RED) - C: confirms install() copies model-catalog.json to co-located path (RED) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(install): copy sdk/shared/model-catalog.json + resolve chain in CJS (#3288) Two-part fix for the CRITICAL regression introduced by #3230: Install-side: bin/install.js now copies sdk/shared/model-catalog.json into get-shit-done/bin/shared/model-catalog.json immediately after the main get-shit-done/ copy step. Every runtime install (Claude Code, Codex, OpenCode, Gemini, etc.) now includes this file in the payload. CJS-side: model-catalog.cjs replaces the brittle single-path require with a resolve-chain that checks candidates in order: 1. get-shit-done/bin/shared/model-catalog.json (co-located, preferred post-install) 2. sdk/shared/model-catalog.json (source-repo dev path, legacy fallback) 3. GSD_MODEL_CATALOG env override (custom deployments / test harnesses) When no candidate resolves, throws with a diagnostic listing all tried paths (PRED.k301 — throw must include candidate paths for debuggability). REFACTOR audit: three other __dirname traversals in bin/lib/ were inspected: - core.cjs:1242 (3 levels up → agents/) — safe; agents/ IS copied to targetDir - profile-output.cjs:547,740 (2 levels up → templates/) — safe; templates/ is inside get-shit-done/ and IS copied Only model-catalog.cjs traversed outside the installed payload. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * changeset: pr=3293 for #3288 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(model-catalog): narrow catch to missing-file errors; clear env in test (#3288) Two CR findings from PR #3293 review: 1. model-catalog.cjs catch block swallowed ALL errors — malformed JSON, permission errors, and other real failures were silently absorbed into the fallback chain. Now only MODULE_NOT_FOUND (with matching path in message) and ENOENT are treated as recoverable; any other error is rethrown immediately. 2. test beforeEach saved GSD_EXPLICIT_CONFIG_DIR but didn't clear it — a CI-set value could leak into install() and redirect the install to an unexpected directory, making test C non-deterministic. Added `delete process.env.GSD_EXPLICIT_CONFIG_DIR` to beforeEach. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> |