fix(cli): enforce fingerprint-safe install and sync - #804
Merged
Conversation
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
Signed-off-by: XiaoSeS <87064762+XiaoSeS@users.noreply.github.com>
XiaoSeS
marked this pull request as ready for review
September 2, 2026 10:25
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
--force, and--checkBehavior
up-to-dateupdate-available, even when content is identicalblocked; verify and use explicit installblocked; no automatic downgradeblocked; no automatic update--forceonly permits overwriting local edits during an otherwise valid update. It does not bypass any remote integrity/version guard. Blocked pull/check results use validation exit code 6.Validation
cd cli && bun test: 432 passed, 0 failedcd cli && bun run typecheck: passedcd cli && bun run lint: passedcd cli && bun run build: passedcd cli && node dist/index.js version: passed362ca1e06a76512d61aa9b8aa5b8d98cccb00796, with MinIO pinned toRELEASE.2025-09-07T16-13-09Zand its digestManual retest
cd cli && bun test test/unit/services/install-service.test.ts --test-name-pattern "rejects a downloaded fingerprint mismatch"Expected: exit code 6; existing skill directory and inventory remain byte-for-byte unchanged; temporary install directory is removed.
cd cli && bun test test/integration/sync-command.test.tsExpected: the five rows above are observed; blocked
--checkand--forceexit 6; no install action runs; local files remain unchanged.In the sync integration output, verify the parameterized local-edit cases cover downgrade, same-version drift, and unknown version order. Each must report
blocked, retainchangedFiles: ["SKILL.md"], and return no actions.The running Compose preview validates the exact-SHA server/runtime and MinIO upload/download path. The CLI branch decisions are intentionally reproduced against the controlled fake registry so version and fingerprint combinations can be set deterministically.