Skip to content

feat: generate sources#19

Open
rickliujh wants to merge 8 commits into
mainfrom
feat/generate-sources
Open

feat: generate sources#19
rickliujh wants to merge 8 commits into
mainfrom
feat/generate-sources

Conversation

@rickliujh

Copy link
Copy Markdown
Owner

No description provided.

rickliujh and others added 8 commits July 16, 2026 13:53
Rename PRInfo to ChangeSet, DiffProvider to ChangeSource, and ParsePRRef to
ParseSourceRef. Pure rename with no behavior change, preparing for commit and
snapshot sources alongside PR/MR generation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Accept multiple source references on the CLI and squash their changesets in
the order given (spec rules CS1-CS5): per-file old content from the first
source, new content from the last, with rename-chain tracking, continuity
warnings, repo consistency checks, and metadata from the last source.

Modules generated from sources without PR metadata degrade gracefully:
missing head branch synthesizes loom/<name>, missing provider omits the pr
operation, missing repo URL omits spec.target.

Adds specs/generate-sources.md describing the multi-source design (PRs,
commit ranges, local snapshots).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Generate modules from a single commit or commit range using git only — no
provider API. Works against any git host (GitHub, GitLab, Bitbucket, Gitea,
bare SSH remotes) and authenticates with the user's git credentials.

Reference grammar: <repo>@<sha> or <repo>@<base>...<head>, where <repo> is a
short-form repo (github:o/r), any git URL, or a local checkout path. Commit
and compare URLs are accepted as sugar. Remote repos are cloned bare with
--filter=blob:none so cost scales with changed files, with a full-clone
fallback for servers without partial clone support.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Generate modules from the current state of files in a local checkout. A local
path ref with --include globs captures matched files: without --base every
file becomes a template (stamp-out module); with --base the working tree —
including uncommitted and untracked files — is diffed against that git ref so
modified YAML still produces SMP patches (transform module).

Repo URL, base branch, and provider are read from the checkout's git remote
when available; modules without a remote degrade per the generate-sources
spec. --name is required when generating from local files only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Single-commit parent resolution relies on full history in the bare partial
clone rather than a depth-2 fetch, and the error table gains the no-changes
and repo-root-with-base conditions.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
--include/--exclude/--base are invocation-wide, so multiple snapshot refs
would silently share them; same-repo composition (CS3) makes multiple
snapshots redundant anyway. Error out instead of guessing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Capture the committed tree of a repository without a local checkout via the
canonical snapshot:<repo-or-path>[@<ref>] form — git-native like the commit
source (bare partial clone, user's git credentials, any host). A bare local
path stays sugar for the working-tree snapshot; @<ref> pins the committed
tree at a tag/branch/SHA for both local and remote forms, listed via git
ls-tree with symlinks and submodules skipped. Ranges are rejected: snapshots
capture one state.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rewrite the generate guide and CLI reference for the new source kinds:
git-native commit/range refs, local and remote snapshots with
--include/--exclude/--base, source composition, and the degraded git-ops
behavior for sources without PR metadata. Drop the documented but
never-implemented --exclude-git-ops flag.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rickliujh rickliujh changed the title Feat/generate sources feat: generate sources Jul 21, 2026
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.

1 participant