Repository navigation
feat(skills): add controlled local and pinned publication - #524
Closed
SanAntonio021 wants to merge 2 commits into
Closed
SanAntonio021 wants to merge 2 commits into
SanAntonio021 wants to merge 2 commits into
Conversation
SanAntonio021
marked this pull request as draft
October 20, 2026 04:39
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.
Behavior
Add controlled skill publication from local directories and exact public Git commits. Local install/info commands provide JSON output; public install/update accept an exact source commit and retain their existing human-readable output.
Updates validate the SSOT and deployed copies before changing them, stage file changes with database updates, and provide rollback and recovery journals. Declared
--runtime-filepaths stay local to each copy: baseline comparisons do not open them, updates preserve them, and a conflicting source path is rejected before publication. Generated__pycache__/*.pycfiles are excluded on both first pinned installation and updates; source directories containing only excluded caches are not deployed.New installations record file and directory baselines, protecting user-added empty directories even when all application copies match the SSOT. First installs preserve existing empty trees and reject unregistered directory-to-file conversion. Subsequent updates keep retained directory projections consistent when application copies must be rebuilt. Native filename hashing preserves literal Unix backslashes and non-UTF8 names. Public pinned installs read the name and description from the captured source metadata. Baseline-owned empty directories can still become files. Old records retain a file-only baseline after updates and reject directory-to-file replacements because ownership of their existing directories cannot be established. Legacy marketplace hashes require a match against their original baseline and unchanged pre-existing hidden content before migration. Rollback restores directories created by an update to an existing installation so the update can be retried; external additions survive, and incomplete rollback retains recovery journals.
An OS file lock serializes skill mutations across CLI processes, including configuration import and snapshot restore, through baseline checks, publication, database commit, rollback, and cleanup. Publication captures the source once so metadata and every deployed copy use the same captured bytes even if the source changes during preparation.
Ordinary archive downloads and exact-commit downloads resolve the newly created, still-empty temporary root before writing downloaded content. This permits trusted system temp aliases such as macOS
/var, while links inside skill trees remain rejected.Skill commands bypass unrelated startup imports and proxy recovery while retaining the saved outbound proxy for downloads. This PR includes the publication and transaction APIs required by the runtime-file behavior. The comparison baseline is upstream v5.11.2 (
b03e7258).Local validation
Windows, Rust 1.91.1, MSVC 14.44 and Windows SDK 10.0.26100:
cargo fmt --check,git diff --check,cargo check --lib --no-default-features -j2, andcargo build --bin cc-switch -j2passed.5ae10886b27d8f2d0d7eced8998bee94e74f7fdbalso built successfully as a static-CRT Windows release, and that exact executable passed the same eight CLI black-box checks. Its eight fix files are identical to PR commite38c24dd05b08c48aae02db2b0e132b5669726f5; the maintenance branch additionally retains the fork's existing proxy extensions. The release build and checks left all 13 monitored live files unchanged. Executable SHA256:4f4bb13dce4c8f9cce5903fcc55b146f7d4322d963339a18f4c1b5a28831a007.cargo clippy --all-targets -j2 -- -A clippy::reversed_empty_rangespassed with warnings. Unmodified Clippy is blocked by the existingreversed_empty_rangesdiagnostic insrc/cli/tui/ui/home_chart.rs:806.Outstanding validation limits
This remains a draft. The full Windows suite is not green, and GitHub checks have not reported a passing result. CI is additional validation, not a substitute for local testing.
Runtime exclusions apply to the controlled publication invocation that explicitly supplies them. They are not persisted as a policy for later ordinary
skills syncor provider-switch sync, whose full-tree behavior is unchanged. The publication lock also does not refresh another process's cached storage-location settings: changing skill storage while another process downloads a skill retains the pre-existing stale-location race. The concurrent CLI checks cover simultaneous controlled publication at a fixed storage location, not concurrent storage migration.An earlier full-suite comparison recorded 4,383 passing / 139 failing library tests on this branch and 4,278 passing / 138 failing upstream. All 138 upstream library failures and all 46 other/integration failures also occurred on this branch. One additional library failure,
store::tests::startup_seeds_gemini_common_config_snippet_from_live, has not been conclusively ruled out as a regression. The upstream comparison checkout needed two test-only Unix symlink calls gated withcfg(unix)to compile on Windows; production sources were unchanged.The earlier full-suite attempt also exposed inadequate Windows home isolation: environment overrides alone did not redirect
dirs::home_dir(), and tests touched live Gemini/OpenCode files. No further full-suite or store/configuration tests were run. Known Gemini provider, prompt, and authentication state was restored from available pre-test database records, and the generated OpenCode file was moved into private recovery storage. There was no complete pre-test Gemini file snapshot, so restoration of any additional manual Gemini settings cannot be verified. Recovery data and local validation artifacts are not included in this PR.