feat: Phase 0 — canonical Origin model (collapse six provenance representations)#212
Merged
Conversation
Newer nightly (1.99.0) clippy flags the nested `if` inside the "version" match arm. Behavior-identical: fold the emptiness check into a match guard. Needed because the nightly bump (for libsqlite3-sys 0.38.1) tightened lints. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`install` already means manifest-reconcile-with-dependencies here (CONTEXT.md: "install = Manifest -> skills dir"). The per-Origin single-skill op is `add` semantics -> `add_from_origin(origin, mode)`; note the update preflight gate. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Post-grill refinements: Origin is install intent (resolved facts live in the Lock); `local` covers dir or .zip; repository variant always concrete. Lists all collapsed representations. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…act) Origin = install intent (git|local|zip-url|repository); GitRef sum type; Resolved = lock-only resolved facts (version/commit/checksum). Internally-tagged serde with minimal "latest" forms. VersionConstraint gains Display + serde (round-trips through parse, enforcing ADR-0004 at the boundary). 7 serde tests. Not yet wired into manifest/lock/SkillDefinition — that is the next commit. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…se 0, core)
Reshape fastskill-core onto the canonical Origin (intent) + lock-only Resolved:
- manifest: delete SkillSource/SourceSpecificFields/DependencySource;
SkillEntry {id, origin, groups}; DependencySpec = Version | Inline{origin,groups}.
- skill_manager: delete SourceType; SkillDefinition/SkillUpdate carry `origin`
(+ kept resolved facts commit_hash/fetched_at); SkillDefinition::new takes origin.
- lock: entries carry {origin, resolved}; version bumped to "3.0" with a
pre-parse guard rejecting pre-Origin locks (LockError::UnsupportedVersion);
build_skill_source deleted.
- consumers updated: reconciliation, service, update, http handlers, output.
BREAKING: on-disk manifest/lock serde formats change (greenfield, no shim).
Behavior-preserving for CLI outcomes; only new behavior is the lock old-data guard.
fastskill-cli intentionally does NOT compile yet — its pass is the next commit.
cargo build/test/clippy -p fastskill-core --all-targets all green (335+ tests).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
BREAKING CHANGE: on-disk lock/manifest formats change (greenfield, no shim).
Fix fastskill-cli against the reshaped core: build a concrete Origin at each
install site (add_from_git/folder/zip/registry), carry origin through the
lock<->manifest reconstructions (previously lossy — dropped source fields),
read resolved.version from lock entries, and delete the dead source-detection
trio (resolve_source_type/autodetect_source/ResolvedSource). SourceMeta and the
four per-path SkillUpdate builders collapse to one {origin} each.
Behavior-preserving (CLI outcomes unchanged; net -261 lines). lock_migration_test
rewritten: pre-3.0 locks are now rejected (UnsupportedVersion), not migrated.
Full workspace green: build + clippy -D warnings + 653 tests, 0 failures.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A pre-Origin `[dependencies]` entry (`source = "git"` + flat fields) no longer
parses; append a migration hint pointing at the `origin = { type = … }` shape
instead of surfacing a raw serde error. Completes the Phase-0 old-data guard
(the lock already rejects pre-3.0 formats).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 Phase 0 of spec 003 (browser skill management) — the canonical
Originmodel — per PRD #207.What this does
Collapses the six overlapping provenance representations (
SkillSource×2,SourceType,SourceSpecificFields, the flatsource_*fields on the lock entries, and the nine onSkillDefinition) into one canonicalOrigin(install intent) plus a lock-onlyResolved(the facts a fetch produced). See ADR-0005 and theOriginglossary entry in CONTEXT.md.Origin=Git{url, ref: GitRef, subdir?}|Local{path, editable}|ZipUrl{url}|Repository{repo, skill, version: Option<VersionConstraint>}. Internally-tagged; the common "install latest" case serializes minimally ({"type":"git","url":…}).GitRefis a sum type (Default|Branch|Tag|Commit) so illegal ref combos are unrepresentable.Originholds no commit SHA / resolved version / checksum — those live in the lock'sResolved.SkillEntry→{id, origin, groups}; lock entries →{…, origin, resolved}.VersionConstraintgainsDisplay+ serde that round-trips throughparse, so ADR-0004 (bare version = exact pin) is enforced at the serde boundary (a stored constraint is=1.2.3).metadata.versionis bumped to"3.0"and a pre-parse guard rejects older locks with an actionableLockError::UnsupportedVersion; loading a pre-Originmanifest appends a migration hint pointing atorigin = { type = … }.Breaking
On-disk manifest and lock serde formats change (greenfield break, no back-compat shim — per ADR-0005). CLI command behavior is otherwise unchanged.