docs(vendor): add opensrc submodule and reference analysis - #61
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
No issues found across 4 files
Auto-approved: Documentation and reference-only submodule addition with no impact on core business logic or runtime execution.
Architecture diagram
sequenceDiagram
participant Agent as AI Agent / User
participant CLI as NEW: opensrc CLI (Rust)
participant Local as Project Workspace (CWD)
participant Cache as ~/.opensrc (Global Cache)
participant Registry as External Registry (npm/PyPI)
participant Git as Git Host (GitHub/GitLab)
Note over Agent,Git: NEW: opensrc "path" Fetch Pipeline Analysis
Agent->>CLI: opensrc path <spec>
CLI->>Cache: NEW: Check sources.json for cached <spec>
alt Cache Hit
Cache-->>CLI: Return existing path
else Cache Miss
opt No version in <spec>
CLI->>Local: NEW: detect_installed_version()
Local->>Local: Parse lockfiles (pnpm/yarn/npm) via regex
Local-->>CLI: Resolved version (e.g. 1.2.0)
end
CLI->>Registry: NEW: resolve_package(name, version)
Registry-->>CLI: Git Repo URL + Subdirectory (monorepo support)
alt Git Clone Flow
CLI->>Git: NEW: clone_at_tag() (depth=1)
alt v<version> tag exists
Git-->>CLI: Shallow clone success
else v<version> missing
CLI->>Git: Fallback: Clone default branch
Git-->>CLI: Clone success (with warning)
end
end
CLI->>CLI: Strip .git directory (snapshot only)
CLI->>Cache: NEW: write_sources() (Atomic write)
Note right of Cache: Temp file + Rename for concurrency
end
CLI-->>Agent: Print absolute path to stdout (e.g. /home/user/.opensrc/repos/...)
Note over Agent,CLI: Agent then uses path in shell: cat $(opensrc path zod)/README.md
Add vercel-labs/opensrc as a reference submodule under vendor/opensrc/ alongside vendor/intent/, and document its architecture, fetch pipeline, cache layout, and design contrasts with ASK in .please/docs/references/opensrc.md.
amondnet
force-pushed
the
docs/add-opensrc-vendor
branch
from
April 11, 2026 08:35
82afb4a to
bc27625
Compare
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.
Summary
Add vercel-labs/opensrc as a reference-only git submodule under `vendor/opensrc/` (alongside the existing `vendor/intent/`), and document its architecture, fetch pipeline, cache layout, and design contrasts with ASK.
opensrc and ASK solve the same underlying problem ("give coding agents accurate, version-specific source for installed libraries") from opposite ends — opensrc lazily clones upstream repos into a global `~/.opensrc/` cache and asks the agent to compose `opensrc path` inside shell commands, whereas ASK pre-renders per-project markdown + Claude Code skill files. Having opensrc vendored gives us a concrete reference implementation to cross-check our resolver/source split and AGENTS.md generation against.
Changes
Test Plan
Notes
Summary by cubic
Vendor
vercel-labs/opensrcas a reference-only git submodule undervendor/opensrc/(pinned to 0.7.1) and add a deep-dive at.please/docs/references/opensrc.mdon its architecture, fetch pipeline, and cache to compare with ASK. UpdateCLAUDE.mdto list the new vendor; no runtime or build changes.Written for commit bc27625. Summary will update on new commits.