Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ U1 (script) first; U2 (script tests + parity) with it. U3 (ce-plan rewire) and U
- **Goal:** One script turns the two config files into a validated, resolved pack-root list with per-entry warnings and errors.
- **Requirements:** R1-R7, R11, R12
- **Dependencies:** none
- **Files:** `skills/ce-plan/scripts/packs-resolve.py` (canonical copy), `skills/ce-brainstorm/scripts/packs-resolve.py`, `skills/ce-setup/scripts/packs-resolve.py` (byte-identical duplicates)
- **Files:** `skills/ce-brainstorm/scripts/packs-resolve.py` (canonical copy), `skills/ce-plan/scripts/packs-resolve.py`, `skills/ce-setup/scripts/packs-resolve.py` (byte-identical duplicates)
- **Approach:** Stdlib-only Python. Read `packs:` from `config.yaml` then `config.local.yaml` (missing files fine; both lists concatenate in that order, each entry tagged with its origin file for error messages). Per entry: classify source kind, normalizing a GitHub tree URL to url + ref + `path:` (conflict with explicit fields errors); enforce R3 ref rules; validate paths per KTD-4; resolve git sources through the KTD-3 cache (atomic temp-clone-then-rename on miss, reuse on hit; fetch/auth failure under the non-interactive git environment -> warning, entry skipped); scope the source root by `path:` when present; enumerate published packs per R6 (immediate children only); apply `pack:` selection and `id:` override; detect duplicate resolved ids across all entries (R7, both entries named, neither installs). Emit JSON to stdout: `{roots: [{id, dir}], warnings: [...], errors: [...]}` — exit 0 whenever a parse was possible (per-entry failures are data), nonzero only on catastrophic failure. No third-party YAML dependency: parse the `packs:` block with a minimal reader whose accepted subset is pinned — block-list entries, flow (`[a, b]`) and block lists for `pack:`, quoted and bare scalars, full-line and trailing comments — and any line under `packs:` the reader cannot classify is a loud error naming the file and line, never a silent skip.
- **Patterns to follow:** `skills/ce-plan/scripts/peer-job-runner.py` (scratch-root preamble, non-interactive subprocess discipline, per-skill duplication, stdlib-only); the deleted `repo-profile-cache.py` remains in git history (`git show c184234b^:skills/ce-plan/scripts/repo-profile-cache.py`) for its cache-keying and JSON-out shape.
- **Test scenarios:** covered in U2 (the script is exercised only through its tests and callers).
Expand Down
6 changes: 4 additions & 2 deletions tests/skills/ce-packs-resolver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import { afterAll, describe, expect, setDefaultTimeout, test } from "bun:test"

// Deterministic proof for the CE Packs resolver (plan AE1-AE7): fixture repos
// and file:// git sources built per test, cache isolated via CE_PACKS_CACHE_ROOT.
// Exercise the canonical ce-brainstorm copy; the other skill copies stay
// byte-identical via the parity test below.
setDefaultTimeout(30000)

const RESOLVER = path.join(process.cwd(), "skills/ce-plan/scripts/packs-resolve.py")
const RESOLVER = path.join(process.cwd(), "skills/ce-brainstorm/scripts/packs-resolve.py")
const COPIES = [
"skills/ce-plan/scripts/packs-resolve.py",
"skills/ce-brainstorm/scripts/packs-resolve.py",
"skills/ce-plan/scripts/packs-resolve.py",
"skills/ce-setup/scripts/packs-resolve.py",
"skills/ce-code-review/scripts/packs-resolve.py",
"skills/ce-doc-review/scripts/packs-resolve.py",
Expand Down