Skip to content

feat(config): parse, validate and freeze agent skill attachments (PR 1a-i) - #193

Open
shoedog wants to merge 2 commits into
mainfrom
feat/pr1a-i-skills-parse
Open

shoedog wants to merge 2 commits into
mainfrom
feat/pr1a-i-skills-parse

Conversation

@shoedog

@shoedog shoedog commented Oct 21, 2026

Copy link
Copy Markdown
Owner

PR 1a-i of the reviewer prism-skill design (docs/superpowers/specs/2026-10-18-reviewer-prism-skill-design.md §§1, 2, 6). This is the parse/validate/freeze foundation; workflow delivery (1a-ii) follows after G-A2.2 slice b.

What it adds

  • [[agents.skills]] with id, path and delivery = "prompt". If skills are absent the selection is empty. Unknown delivery values, empty IDs or paths, and duplicate IDs within an agent are rejected.
  • RegistryConfig::admit_skills(declaring_config, checkout):
    • Paths resolve against the declaring config's directory, never the process cwd.
    • On Unix, files open without following symlinks on any path component, the opened handle must be a regular file, and reads are bounded and non-blocking against FIFOs. Other platforms get an explicit refusal.
  • Frontmatter validation uses a strict hand-written parser, with no YAML dependency (controller ruling; Cargo.* is untouched):
    • accepted: plain, single- and double-quoted scalars, and |/> block scalars for name and description;
    • refused, with the construct named: flow collections, anchors, aliases, tags, nested maps, duplicate required keys and tab indentation.
  • Limits: 32 KiB per skill and 64 KiB per selection, counted in bytes. Frozen values keep the exact source bytes (CRLF included) plus SHA-256, size and delivery mode.
  • Previews and errors omit source bytes and host paths. A metadata-only not_delivered(route) value exists for later reporting.
  • Until 1a-ii, registry conversion explicitly refuses nonempty skills instead of dropping them. Empty configs behave exactly as before.

Not touched: session_fingerprint.rs, execution_policy.rs, main.rs, core lib.rs, the G-A2.2 files, and the [custody], routing-chain and review-history sections of config.rs. The bridge session confirmed the scope.

Verification

  • Tests were written first, with RED witnessed against a stubbed API; 14 skills tests are green.
  • Workspace on the host: 5,658 passed, 2 failed. Both are custody_push tests that fail only under full-workspace load (EAGAIN in a subprocess). Run alone, all 29 custody tests pass on both base c487d6c and this branch, so they're unrelated (Lane R is tracking them).
  • cargo build --all-targets, cargo fmt --check, cargo clippy --workspace --all-targets -D warnings and validate --repo-hygiene pass.
  • cargo deny fails identically on base (RUSTSEC-2026-0381/0382); chore(deps): bump rustls-webpki and webpki-roots (RUSTSEC-2026-0381/0382) #191 fixes that.
  • The skills module was split move-only into skills.rs (540 weighted lines) plus two test files, to stay under the 1,000-line split rule.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JhYB2xRuHRHxDFM7eDt8Fh

shoedog and others added 2 commits October 20, 2026 22:20
…1a-i)

Adds [[agents.skills]] (id, path, delivery="prompt") with an explicit
admission API that resolves paths against the declaring config, opens
without following symlinks, bounds reads (32 KiB per skill, 64 KiB per
selection), validates frontmatter name/description with a strict parser
(no YAML dependency) and freezes exact bytes plus SHA-256. Registry
conversion refuses nonempty skills until PR 1a-ii wires delivery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JhYB2xRuHRHxDFM7eDt8Fh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant