feat(setup-steward): multi-install + committed/local lock split + drift detection - #40
Merged
potiuk merged 1 commit intoMay 4, 2026
Conversation
…ft detection Rewrite setup-steward to support three install methods, split the lock file into committed (project pin) and local (per-machine fetch), and drive every framework-skill invocation through a drift check that compares the two locks. Three install methods (copy-pasteable recipes in docs/setup/install-recipes.md) - svn-zip: signed zip from ASF dist (`https://dist.apache.org/repos/dist/release/<project>/`), the canonical ASF release distribution path. Verified via SHA-512 + OpenPGP. Recommended for production once the framework ships official releases. - git-tag: pinned to a specific git tag — frozen by tag. - git-branch: tracks a branch tip (default: main) — the WIP path during pre-release. Each recipe is a single shell block: adds the right gitignore entries, downloads + verifies + extracts, copies the setup-steward skill into the adopter's skills dir (matching the flat or double-symlinked convention), and tells the user to follow /setup-steward from there. Lock-file split - .apache-steward.lock (committed) — the project's pin: method, url, ref, plus a verification anchor (commit SHA for tag, sha512 for zip). Edited only by /setup-steward; bumping it is a deliberate project-level commit. - .apache-steward.local.lock (gitignored) — what THIS machine actually fetched: source_method, source_url, source_ref, fetched_commit, fetched_at. Per-developer, per-checkout. Drift detection Every framework skill (and /setup-steward verify) compares the local lock to the committed lock at the top of its run. On mismatch: - Method or URL differ → ✗ full re-install - Ref differs (project bumped tag, or git-branch local is behind upstream) → ⚠ sync - svn-zip SHA-512 differs from the committed anchor → ✗ security-flagged; investigate before upgrading The proposal is always /setup-steward upgrade. On user OK, upgrade: 1. Deletes the gitignored snapshot outright. 2. Re-installs per the committed lock. 3. Refreshes gitignored framework-skill symlinks (adds new skills, removes renamed-away ones). 4. Reconciles agentic overrides against the new framework structure (surfaces conflicts; never auto-rewrites). 5. Updates the local lock. Changes - Rewrite setup-steward/SKILL.md, adopt.md, upgrade.md, verify.md to express the new model. - New: docs/setup/install-recipes.md with the three copy-pasteable recipes + explanatory framing. - README's Adopting the framework section split into Bootstrap (shell) + Skill takeover + Subsequent contributors + Drift detection. Out of scope (follow-up): wire the drift check into each framework skill's pre-flight section (alongside the override-consultation hook from apache#39). 15 skills to touch; mechanical, deferred to keep this PR focused on the mechanism. Generated-by: Claude Code (Claude Opus 4.7)
4 tasks
potiuk
added a commit
that referenced
this pull request
May 4, 2026
#41) Mirror of #39's override-consultation hook for the new drift-detection mechanism that landed in #40. Every framework skill (excluding setup-steward, which IS the drift mechanism) now declares a `## Snapshot drift` section right after its `## Adopter overrides` section. The standard block in every skill: ## Snapshot drift Also at the top of every run, this skill compares the gitignored `.apache-steward.local.lock` (per-machine fetch) against the committed `.apache-steward.lock` (the project pin). On mismatch the skill surfaces the gap and proposes [`/setup-steward upgrade`]. The proposal is non-blocking — the user may defer if they want to run with the local snapshot for now. Drift severity: - method or URL differ → ✗ full re-install - ref differs → ⚠ sync needed - svn-zip SHA-512 mismatches → ✗ security-flagged 15 skills updated: setup-isolated-setup-install security-issue-import setup-isolated-setup-update security-issue-import-from-md setup-isolated-setup-verify security-issue-import-from-pr setup-shared-config-sync security-issue-invalidate security-issue-sync pr-management-code-review security-cve-allocate pr-management-stats security-issue-deduplicate pr-management-triage security-issue-fix Skill not updated: setup-steward — IS the bootstrap + upgrade + verify + override-management skill; the drift check it would perform is the same one its `verify` sub-action exposes. The hook is documented behaviour, not runtime injection. A skill that has the `## Snapshot drift` section commits to performing the check when invoked. Future tooling can enforce mechanically; for now the convention is binding via the published contract. Generated-by: Claude Code (Claude Opus 4.7)
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
Rewrite
setup-stewardto support three install methods, split the lock file into committed (project pin) + local (per-machine fetch), and drive every framework-skill invocation through a drift check that compares the two locks.This is the design step that makes apache-steward behave like a proper distribution-aware framework: a project commits one pin, every contributor's machine fetches against it, drift is detected and remediated automatically.
Three install methods (copy-pasteable in
docs/setup/install-recipes.md)svn-ziphttps://dist.apache.org/repos/dist/release/<project>/) — the canonical ASF release distribution path per release-policy and infra release-distribution guidelines. Verified via SHA-512 + optional OpenPGP. Recommended for production once the framework ships official releases.git-taggit-branch(defaultmain)Each recipe is one shell block that adds gitignore entries, downloads + verifies + extracts the framework into
.apache-steward/, copies the bootstrap skill into the adopter's skills dir (matching flat or double-symlinked convention), and tells the user to follow/setup-stewardfrom there.Lock-file split
.apache-steward.lockmethod,url,ref, plus a verification anchor (commitfor tag,sha512for zip). Edited only by/setup-steward; bumping it is a deliberate project-level commit visible in PR diffs..apache-steward.local.locksource_method,source_url,source_ref,fetched_commit,fetched_at. Per-developer, per-checkout.Drift detection
Every framework skill (and
/setup-steward verify) compares the local lock to the committed lock at the top of its run./setup-steward upgrade(full re-install)git-branchlocal behind upstream tip)/setup-steward upgrade(sync)svn-zipSHA-512 differs from committed anchorupgradedeletes the gitignored snapshot outright, re-installs per the committed lock, refreshes the gitignored framework-skill symlinks (adds newly-added framework skills, removes renamed-away ones), and reconciles agentic overrides against the new framework structure (surfaces conflicts; never auto-rewrites).Changes
.claude/skills/setup-steward/{SKILL,adopt,upgrade,verify}.mdto express the new model.docs/setup/install-recipes.mdwith the three copy-pasteable recipes + explanatory framing (when to use each, what each step does, what the skill takes over post-recipe)./setup-stewarddoes) → Subsequent contributors (read the committed lock + reinstall) → Drift detection (the run-time mechanism).Test plan
prek run --all-fileshooks pass (markdownlint, typos, doctoc, check-placeholders)setup-stewardre-registers in Claude Code's available-skills list (live discovery picked up the rewrite in-session)docs/setup/install-recipes.mdrecipes are syntactically valid bash (each is a single fenced block, no obvious shell errors)Out of scope (follow-up PR)
Wire the drift check into each framework skill's pre-flight section, alongside the override-consultation hook from #39. 15 skills to touch; mechanical change, deferred to keep this PR focused on the mechanism design rather than the rollout.
🤖 Generated with Claude Code