Skip to content

feat: add /adopt discovery and native Agent Skills - #411

Draft
naraen-ram wants to merge 20 commits into
Observal:mainfrom
naraen-ram:feat/adopt
Draft

naraen-ram wants to merge 20 commits into
Observal:mainfrom
naraen-ram:feat/adopt

Conversation

@naraen-ram

@naraen-ram naraen-ram commented Sep 16, 2026

Copy link
Copy Markdown

Purpose

Add the first complete /adopt workflow for discovering resources from existing OpenCode, DSH, Claude Code, and Pi installations without executing discovered code. This also adds immutable source acquisition and native installation for standards-compliant Agent Skills.

Fixes

N/A

Approach

  • Add strict, dependency-free adoption RPC, capability, manifest, pagination, and error contracts.
  • Discover supported resources through bounded, data-only ecosystem adapters.
  • Expose discovery and inspection through the daemon, SDK, CLI, TUI, and web client.
  • Acquire local, npm, and Git sources into immutable, content-addressed revisions without lifecycle execution.
  • Validate archives, dependency locks, paths, source hashes, licenses, notices, and executable surfaces before publication.
  • Render a hash-bound trust review containing the source identity, destination scope, resources, capabilities, executable helpers, conflicts, and precedence changes.
  • Bind activation approval to the exact review, policy generation, immutable revision, and registry generation.
  • Install valid Agent Skills through immutable registry pointers rather than mutable source directories.
  • Preserve skill references and assets, reject unsafe executable helpers, and reject Pi disable-model-invocation skills until manual-only activation is supported.
  • Persist native adoption operations across daemon restarts and reload affected sessions only at safe boundaries.
  • Bump the wire protocol from version 17 to 18 for the expanded adoption contract.

Security impact:

  • Discovered source remains untrusted data and is never imported or executed.
  • Credentials and sensitive paths are rejected before immutable publication.
  • Source mutations, stale approvals, registry races, collisions, unsupported primary surfaces, and unavailable isolation fail closed.
  • Adopted skills are loaded only from verified immutable revisions selected by the daemon-owned registry.

How was this tested?

Passed:

  • pnpm build
  • pnpm --filter @axl/compiler test — 48 tests passed
  • pnpm --filter @axl/protocol test — 57 tests passed
  • pnpm --filter @axl/extension-skills test — 5 tests passed
  • pnpm --filter @axl/runtime test — 15 tests passed
  • pnpm --filter @axl/sdk test — 64 tests passed
  • pnpm --filter @axl/web test — 45 tests passed
  • pnpm --filter @axl/tui test — 209 tests passed in the focused package run
  • node --test packages/daemon/test/adoption-store.test.ts — 19 tests passed
  • node --test --test-name-pattern='reload rebuilds|dispatches cancellable adoption' packages/daemon/test/daemon.test.ts — 2 focused tests passed
  • pnpm typecheck
  • pnpm lint
  • pnpm check:boundaries
  • pnpm check:generated
  • pnpm audit --audit-level high — no known vulnerabilities
  • Changed-file Biome formatting checks

Additional review:

  • Independent adversarial review completed with no remaining critical, high, medium, or low findings.

Aggregate-suite note:

  • pnpm test reached 1,029 tests but failed on two existing timing-sensitive checks: the TUI stale-shutdown test and the release-package test's fixed 30-second timeout.
  • The TUI stale-shutdown test passed independently.
  • node --test --test-timeout=120000 scripts/build-release-package.test.ts passed independently in about 37 seconds.
  • reuse lint was not run because reuse is not installed in this environment.
  • Repository-wide pnpm format:check remains blocked by pre-existing unrelated formatting changes in packages/ai/tsconfig.json and .vscode/settings.json; all files changed by this branch pass Biome.

Learning

  • A discovery fingerprint is not a substitute for an immutable source hash. Native activation revalidates against the published immutable revision.
  • Human review can outlive short discovery-cache windows, so review snapshots need a user-scale lifetime while still revalidating source content.
  • Registry activation is authoritative. Session reload requests must be coalesced by registry generation and retried at safe boundaries.

Checklist

  • I reviewed the complete diff.
  • I added or updated the smallest relevant test for behavior changes.
  • I ran the relevant build, type check, lint, test, boundary, and license checks, except reuse lint, which is unavailable as noted above.
  • Every new file has SPDX metadata, directly or through REUSE.toml.
  • Every commit has a matching DCO Signed-off-by trailer.
  • UI changes include screenshots attached to the pull request, not committed to the repository.

AI assistance

  • Generative AI materially assisted this change. Tool and model/version: Pi coding agent with azure-openai-responses/gpt-5.6-sol.
  • I manually reviewed, understood, and tested the generated work.

Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
Comment thread packages/compiler/src/npm-acquisition.ts Fixed
Comment thread packages/compiler/src/npm-acquisition.ts Fixed
Comment thread packages/compiler/src/npm-acquisition.ts Fixed
Signed-off-by: Naraen Rammoorthi <naraen13@gmail.com>
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.

2 participants