docs: make commit-SHA pinning discoverable + test SHA-predicate agreement - #285
Draft
Brian Krabach (bkrabach) wants to merge 1 commit into
Draft
docs: make commit-SHA pinning discoverable + test SHA-predicate agreement#285Brian Krabach (bkrabach) wants to merge 1 commit into
Brian Krabach (bkrabach) wants to merge 1 commit into
Conversation
Follow-up to #282 (merged as 1a40883), which added full-commit-SHA refs to the git source handler but shipped the feature undiscoverable: every git-source example in docs/ used @main and SHA pinning appeared nowhere. - docs/URI_FORMATS.md, docs/BUNDLE_GUIDE.md: add a pinned-commit row to the source-format tables plus a short note covering what pinning is for (reproducible installs, eval/CI), that pinned sources are skipped by `amplifier update` (get_status -> is_pinned -> has_update=False -> excluded from updateable_sources), that short SHAs are rejected by design, and the cost of a typo'd-but-valid-looking SHA (full-clone fallback before a clear checkout error; a failed pinned resolve can leave a cache entry behind that a later resolve may serve, so clear the cache entry if a pin fails). - tests/test_sources.py: the full-SHA rule is encoded twice -- _is_full_commit_sha (regex, sources/git.py) and SourceStatus.is_pinned (length+charset, sources/protocol.py) -- guarded only by a comment. Add TestShaPredicatesAgree asserting the two agree across 40-hex lower/upper/mixed, 39/41-char, non-hex, and branch-name refs, plus one test documenting the intentional v-tag divergence. Converts the load-bearing comment into a checked invariant without abstracting (two instances is below the bar). 🤖 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.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.
Summary
Follow-up to merged PR #282 (commit-SHA pinning: fetch-by-sha + fallback). The feature is powerful but undocumented — users discovering it by accident in git.py would need to trace the code. This PR adds discovery documentation and validates the SHA-predicate agreement at test time.
What Changed
** — URI-FORMATS section updated:**
git+https://…/repo@<commit-sha>.amplifier_cache_meta.jsontracks resolved commit** — new PINNING subsection:**
New test:
test_sha_predicate_agreementGaps Honestly Stated
Test Evidence
Verbatim (Linux aarch64, Python 3.13):
Pre-Filing Review
Pre-filing: passed an independent context-isolated adversarial review (issue verified against implementation, fix reviewed composed-state, tests re-run by reviewer). Human review requested before merge.