Skip to content

feat(build): package capsule-declared Skill assets#1282

Merged
joshuajbouw merged 4 commits into
mainfrom
feat/capsule-declared-skill-assets
Jul 19, 2026
Merged

feat(build): package capsule-declared Skill assets#1282
joshuajbouw merged 4 commits into
mainfrom
feat/capsule-declared-skill-assets

Conversation

@joshuajbouw

Copy link
Copy Markdown
Member

Linked Issue

Closes #1281

Summary

Makes [[skill]] a real distributable capsule asset for Rust-built capsules and preserves typed filesystem absence at the guest boundary. This lets an agent runtime discover workflows from its installed capsule introspection view without per-principal lifecycle-hook copies.

Changes

  • parse synthesized Rust capsule manifests for [[skill]].file declarations
  • package each declared Skill at its exact relative archive path
  • reject absolute paths, traversal, missing/non-file assets, and symlinks escaping the capsule source tree
  • deduplicate declared paths deterministically
  • document and test declarative assets flowing through the existing principal introspection mirror
  • map native VFS not-found and permission-denied I/O kinds to the existing typed guest error codes
  • add packaging, traversal, out-of-tree symlink, mirror, and error-mapping regressions

Verification

  • cargo test -p astrid-build — 20 passed
  • cargo test -p astrid-capsule-install principal_introspection — 5 passed
  • cargo test -p astrid-capsule error_mapping_tests — 2 passed
  • cargo clippy -p astrid-build -p astrid-capsule-install -p astrid-capsule --all-features -- -D warnings
  • cargo fmt --all -- --check
  • built AOS Forge, System, and Skills capsules with this builder; the resulting archives contained all three declared SKILL.md assets and passed AOS's archive-level validator

No public API or wire shape changes. No release, version bump, channel promotion, or crates.io publication was triggered.

Checklist

  • Linked to an issue
  • CHANGELOG.md updated under [Unreleased]

Copilot AI review requested due to automatic review settings July 19, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Packages capsule-declared skill assets into Rust-built .capsule archives and ensures guest-visible filesystem errors preserve typed semantics (not-found / permission-denied) so runtimes can safely distinguish optional-absent inputs from real I/O failures. This aligns Rust capsule builds with the existing principal-scoped introspection mirror so skills can be discovered from installed capsule metadata without per-principal copy hooks.

Changes:

  • Parse synthesized/merged Capsule.toml for [[skill]].file entries and include those files in the capsule archive at their declared relative paths (with traversal/absolute/out-of-tree validation and deterministic deduping).
  • Preserve typed guest error codes for native std::io::ErrorKind::{NotFound, PermissionDenied} when wrapped by astrid_vfs::VfsError::Io.
  • Add/extend regression tests for archive packaging, introspection mirroring of declarative assets, and error-code mapping; document the behavior in CHANGELOG.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/astrid-capsule/src/engine/wasm/host/fs/mod.rs Map VfsError::Io not-found/permission-denied into typed guest ErrorCodes and add regression tests.
crates/astrid-capsule-install/src/principal_introspection.rs Clarify security/docs to include declarative public assets in the mirror and extend mirroring tests to cover a skill asset.
crates/astrid-build/src/rust.rs Resolve and validate [[skill]].file assets and pass them into archive packing; add packaging/traversal/symlink-escape tests.
CHANGELOG.md Document the new skill-asset packaging behavior and typed error mapping under [Unreleased].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/astrid-build/src/rust.rs Outdated
@joshuajbouw
joshuajbouw force-pushed the feat/capsule-declared-skill-assets branch from 6526edd to 39b34aa Compare July 19, 2026 20:04
@joshuajbouw
joshuajbouw merged commit 6c3b2d0 into main Jul 19, 2026
21 checks passed
@joshuajbouw
joshuajbouw deleted the feat/capsule-declared-skill-assets branch July 19, 2026 21:08
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.

Package capsule-declared skills for principal-scoped discovery

2 participants