Skip to content

feat(get): borrow full skill directories with explicit cleanup (#654) - #655

Merged
luongnv89 merged 2 commits into
mainfrom
feat/654-feature-asm-get-clone-full-skill
Sep 9, 2026
Merged

feat(get): borrow full skill directories with explicit cleanup (#654)#655
luongnv89 merged 2 commits into
mainfrom
feat/654-feature-asm-get-clone-full-skill

Conversation

@luongnv89

Copy link
Copy Markdown
Owner

Closes #654

Summary

Adds persistent full-directory borrowing to asm get --path so ephemeral callers receive supporting scripts, templates, references, and binary assets, plus an explicit asm cleanup <borrowed-path> command that only removes ASM-owned borrows.

Approach

Thin borrowed-copy facade over the existing dependency-lease lifecycle (separate get-borrows namespace); copy every source tier and require exact registered-path cleanup.

Decision Record

  • Root cause: asm get resolved complete skill directories but only emitted SKILL.md, then deleted the remote staging clone, leaving callers without referenced supporting files.
  • Options considered: Option 1 — Minimal fix: dependency-session borrowing; Option 2 — Balanced approach: dedicated get-borrows facade; Option 3 — Comprehensive refactor: shared owned-copy lifecycle
  • Options rejected: Option 1 — Session-token cleanup exposes dependency internals and is awkward for an API whose primary result is a filesystem path; Option 3 — A shared lifecycle redesign is unnecessary for [FEATURE] asm get: clone full skill directory to temp location instead of only reading SKILL.md #654 because the existing lease engine already supplies the required capabilities
  • Selected option: Option 2 — Balanced approach: dedicated get-borrows facade
  • Residual risk: Windows runtime was not exercised; hard interruptions may leave quarantined artifacts for explicit inspection rather than silent removal.
  • Effort profile: omitted
  • Design-confirm: auto-selected Option 2 (complexity: XL)

Analyzed at: feat/654-feature-asm-get-clone-full-skill @ 1fc84c0 (2026-09-09)

Changes

File Change
README.md Documents persistent borrowing, exact-path cleanup, and permanent install workflow
src/cli.ts Command-aware get --path parsing and cleanup routing/help
src/cli.test.ts CLI lifecycle regression coverage, including dry-run rejection
src/commands/cleanup.ts Exact-path cleanup handler; rejects unsupported --dry-run
src/commands/get.ts Persistent full-directory borrow branch; preserves default output
src/commands/get.test.ts Source staging lifecycle coverage
src/config.ts Dedicated ASM-owned borrow root helper
src/dependency-leases.ts Exact registered-path lease release
src/dependency-leases.test.ts Path-release safety coverage
src/formatter-core.ts Borrow/cleanup formatting
src/formatter.ts Borrow/cleanup formatter surface
src/get-borrows.ts Thin lease facade for borrow/copy/lookup/release
src/get-borrows.test.ts Ownership, preservation, symlink, and concurrency coverage
src/utils/types.ts Borrow/cleanup result contracts

Test Results

  • Unit tests: 2793 passed
  • Integration tests: included in unit suite where applicable
  • E2e tests: push hooks passed
  • Build: passed
  • QA cycles: 2

Acceptance Criteria Verification

Criterion Status Evidence
Borrow full skill directory with supporting files pass src/get-borrows.test.ts binary/executable preservation; CLI test reads all files after process exit
Provide explicit cleanup afterward pass asm cleanup <borrowed-path>; second-process removal test
Keep default asm get behavior unchanged pass default-output regression coverage
Use asm install for permanent retention pass README documents install workflow; no borrow retention operation

@luongnv89
luongnv89 merged commit cb65bfc into main Sep 9, 2026
12 checks passed
@luongnv89
luongnv89 deleted the feat/654-feature-asm-get-clone-full-skill branch September 9, 2026 20:53
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.

[FEATURE] asm get: clone full skill directory to temp location instead of only reading SKILL.md

1 participant