feat(source): linked (editable) sources — SPEC-007 (closes #69) - #71
Merged
Conversation
Add an npm-link / go-replace mode to the SPEC-003 source system: a linked source symlinks a managed .agents/ artifact at a live local git checkout instead of a SHA-pinned tarball snapshot, so edits flow both ways and `git pull` in the checkout reaps updates with no re-fetch. - schema: Override.Link + LockEntry.Link/ManagedClone; link⊕pin_sha and absolute-path rejection validated at manifest load - file: scheme parser (relative ok, absolute rejected) resolved against .agents/ - `source add --link=<path> <entry>` (link a checkout), `--link <entry>` (managed clone under .agents/.sources/, scanned once via SPEC-005), and `--link=<path>` (derive owner/repo from the checkout's git remote) - pull skips the fetcher and verifies/self-heals the symlink; dangling target warns instead of silently re-fetching; update git-pulls managed clones - index follows symlinks so linked skills enumerate in AGENTS.md - `source list` marks linked entries; `detach` freezes a link into a vendored snapshot (keeps upstream identity, drops the link override) - all persisted paths + on-disk symlinks are relative (portability invariant) - scan/copyTree skip nested .git; docs + SPEC-007 status → Implemented - tests: Go (parse, three add forms, dangling, detach, index) + 7 bats e2e Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🤖 AI Code Review CompleteReview performed on changed files. Check inline comments for specific findings. Severity Levels:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements SPEC-007 (spec) — the
npm link/go mod replaceanalogue for.agents/artifacts. A linked source symlinks a managed artifact at a live local git checkout instead of a SHA-pinned tarball snapshot, so edits flow both ways andgit pullin the checkout reaps updates with no re-fetch. Replaces the undocumented, non-portable manualln -s.What's new
Acceptance criteria (issue #69)
Override.Link+LockEntry.Link/ManagedCloneschema; link⊕pin_sha validated at loadfile:parse (relative ok, absolute rejected)add --link=<path> <entry>writes relative manifest/lock + relative symlink; re-pullno-op, no clobberadd --link <entry>managed clone + SPEC-005 scan gate--link=<path>derives owner/repo from git remoteupdate: managed clonegit pull --ff-only; user checkout no-opindexenumerates linked skill in AGENTS.md (follows symlinks)detachlink → vendored copy (freeze; keeps upstream identity)Design notes
file:scheme relative to.agents/; the on-disk symlink is created relative too — absolutefile:paths are rejected at parse time (git-trackedsources.lockmust stay portable).Overridemechanism (addslink, mutually exclusive withpin_sha).pullnever re-fetches a snapshot over a link; a moved/deleted checkout surfaces as a warning, not a silent revert.scan/copyTreenow skip nested.git(VCS metadata is never artifact content).Tests
file:parse table, link⊕pin_sha + absolute rejection, all threeadd --linkforms (managed clone uses a hermetic local repo via injectableCloneURL), dangling-target warn,detachfreeze, index-follows-symlink.go test ./...,go vet,gofmtclean.🤖 Generated with Claude Code