mirror of
https://github.com/runkids/skillshare.git
synced 2026-11-18 18:04:17 +00:00
08ecb7afad0d3f90e2efeb0bc167a8ea7ffeca14
37
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
c040917bc7 |
fix(security): enforce credential and filesystem trust boundaries (#861)
Bind provider credentials to canonical or explicitly configured HTTPS origins and preserve that policy across remote consumers. Reject cross-site credentialed reads, linked fallback directories, and discovered-agent writes outside the source; audit staged content before rooted atomic publication. Add boundary regressions, private Git update coverage, stable cross-platform fixtures, and aligned documentation. Verified the integrated main baseline with all executed CI checks passing. |
||
|
|
51107fb1ac |
fix(projects): save new projects in config.yaml again (#793)
* fix(projects): save new projects in config.yaml again v0.29.0 wrote every project add, edit and remove to a machine-local registry, so a project added on one machine never reached config.yaml or the other machines that share it (#792). Most people share one config.yaml and expect a new project to follow it. config.yaml is the default again. Machine-local storage stays as an explicit choice: --machine-local on add, or projects_storage: machine-local for every new project, with --shared to override it. The new share command moves a local project into config.yaml, and localize still copies one to this machine. Edits and removals stay in the layer that owns the project; removing a local copy of a config.yaml project keeps config.yaml's version unless --shared asks to remove both, so one machine cannot silently drop a project for the others. Exclusions written by v0.29.0 are left as they are. The dashboard picks storage once, in the Add project dialog, and offers the two removal choices only where both copies exist. Moving a project between layers stays a CLI command, so the detail page keeps one job. Closes #792 * fix(projects): recheck both layers after a confirmation, sync the saved key remove and share ask before taking the config lock, then compared only the merged entry after locking. A share or localize from another terminal moves a project between layers without changing that entry, so a remove confirmed for this machine's copy could then delete config.yaml's declaration for every machine, and a confirmed share could overwrite config.yaml settings changed meanwhile. The recheck now compares the owning layer and config.yaml's declaration too (ProjectLayerState). Re-adding a project that v0.29.0 hid restores config.yaml's own key, which can be spelled differently from the folder given to add (~/app versus an absolute path). add --sync looked the project up by the given spelling and failed with "project not found" after saving it; it now syncs the key that was saved. * test(projects): make the layer tests hold on Windows The mutation-sequence test looked the shared project up by filepath.Join, but the fixture spells config.yaml's key $ROOT/app; on Windows the two spellings differ, so the lookup found nothing. It now asks the config for the key it uses. The remove save-failure test blocked the local registry, but removing a config.yaml project now writes config.yaml. On Linux the registry check still failed with ENOTDIR first, which hid the mismatch; on Windows that reads as a missing file and the save went through. The test now blocks config.yaml, as the edit save-failure test does, and its hook no longer shadows the config path with the target path. --------- Co-authored-by: sim <sim@example.invalid> |
||
|
|
78a8dc7c0d |
fix(trash): keep install metadata when restoring from the trash (#680)
* fix(trash): keep install metadata when restoring from the trash Uninstall pruned a skill's, tracked repo's or agent's entry from the central .metadata.json, and only the files went to the trash, so a restore brought back a remote install as a local one: update and check no longer knew its source (#679). Uninstall now saves the entries it prunes, with their audit acceptances and target overrides, beside the trash entry, re-keyed to the trash name so they match where restore puts the item. uninstall.Restore and RestoreAgent merge them back after the files return, and every restore path (CLI, trash TUI, dashboard) goes through them; the dashboard passes its cached store so it does not go stale. The saved copy is taken with the same rule RemoveByNames uses and copies each entry, so legacy repo-group entries are kept and re-keying never touches the live store. In project mode uninstall also drops the skill's .gitignore rule and lock pin, so a skill restore reconciles the project skills afterwards. trash.Delete removes an entry with its saved metadata, and replaces the direct RemoveAll calls in delete, empty and the 7-day cleanup. Items trashed before this change have no saved metadata and still restore as local. * fix(trash): keep live records of another path when restoring metadata A legacy store keys a grouped skill by its basename, so the saved copy of frontend/foo was keyed "foo". If a different skill was installed as root-level foo while frontend/foo sat in the trash, restoring it replaced the root skill's record and lost its source. Extract now writes full source-relative keys (legacy repo-group entries keep theirs, since their Group is not their path), and Merge keeps a live entry whose key names a different path instead of overwriting it. Merge is shared by skill and agent restore, so both are covered. |
||
|
|
da3383ed5f |
fix(plugins): separate shared intent from local installation state (#660)
* fix(plugins): separate shared intent from machine-local receipts Shared configs currently carry native paths, reviewed snapshots and pending failures, so one host can publish local progress over another host's target selection. Persist versioned declarations separately from local applied and pending receipts, and reconcile reviewed installs, imports and cleanup against this machine's native inventory without rewriting intent during sync/update. Keep snapshot names and adapter safeguards, move the operation lock locally, validate legacy adoption with local evidence, and invalidate approval on local state or native-context changes. Preserve source recipes after native adoption, require local import for absent native-only targets, and document the shared writer upgrade boundary in schemas and translated references. Cover two-host behavior, generated legacy fixtures, failure/recovery, stale intent, cleanup, npm recipes and the existing CLI/API/UI consumers with focused resource-capped tests. Fixes #651. * fix(plugins): preserve intent and ownership across host transitions Repeat-add must retain shared target selection, and update previews must resolve the requested ref before reviewing fresh or replacement installs. Keep disabled targets on the uninstall path and reject refs unsupported by native-only/npm intent before they can produce invalid shared declarations. Block changed-context add/import before Pi registration preparation so a new account cannot overwrite the old receipt. Preserve unresolved legacy bindings as passive private proof candidates before rewriting shared YAML, retaining original intent/store for later verified adoption and cleanup. Never compose these hints as executable state, and persist their explicit resolution. Cover the five review classes, native/private failure boundaries, requested-ref retry, and original-context hint proofs with isolated focused regressions. Keep local format v1 and baseline account validation unchanged. Refs #651. * fix(plugins): allow receipt-only orphan cleanup to complete An installation already removed on this host can retain a local receipt when another host removes or replaces shared intent. Sync correctly plans forget, but native command verification rejects that metadata-only action and blocks all targets before the receipt can be cleared. Exclude forget from native command verification while retaining host inventory checks and OMP scoped cleanup preparation. The existing completion path then persists receipt deletion, including pending work and passive legacy hints. Cover the cross-host disable/re-enable/remove walk, five native adapters, failed work with a legacy hint, and absent source replacement alongside a healthy target. Assert Apply completion, unchanged shared bytes/mtime, and a quiet second sync. Refs #651. * fix(plugin): reconcile ref intent across inventory consumers Validate explicit ref changes before disabled targets can save them and reuse one reviewed discovery throughout a preview. Surface shared ref changes as local reconciliation work while preserving the applied native identity and receipts. Reuse scoped legacy proofs for Pi extension ownership and make full inventory the dashboard's authoritative package/host pair. Cover invalid and replacement refs, read-only ownership, and shared-state properties without new persisted state or dependencies. * test(plugin): repair and consolidate host-state fixtures Create source intent and a pending imported Claude update through supported operations so direct and batch updates exercise the intended fixture. Keep the marketplace-loss case locally owned before testing its skipped reinstall. Consolidate cross-host repeat-add and requested-ref replacement/orphan retries at their existing owners, retaining failure recovery and shared-byte checks. Trim duplicate HTTP and translated-text assertions from consumer tests. * fix(plugin): reconcile legacy snapshot reads and native imports Resolve legacy snapshot ownership through existing scoped proofs before listing, reading or discovering cached source files. Keep adoption read-only and limit proof work to the requested package and targets; current receipts need no CLI. Only preserve reviewed source metadata on reimport when intent remains source managed. Native-only intent must not resurrect an older Git source after a same-ID local import. Retain identity mismatch and reviewed-source safeguards. Remove the unused source-folding helper left by the old shared runtime writer. * Preserve reviewed package versions locally * Fix reviewed package version lifecycle * fix(plugin): report missing local imports in doctor Show the local-import instruction instead of claiming a skipped imported plugin is healthy. Preserve the missing-CLI warning and shared config bytes. Keep fixture native settings inside scratch XDG directories and serialize the fake CLI calls used by concurrent inventories. Update assertions to separate shared declarations from local versions and native IDs, and align the raw-write audit with private plugin state and operation locks. * test(plugin): use declarations for doctor source fixture The missing-CLI case has no native ID, so encode it with the version 2 declaration schema. Keep the native-only import case in legacy syntax. * fix(plugin): install shared sources from reviewed snapshots When a source target is already declared, first sync must install its reviewed local snapshot even if the native client has a package from the same marketplace. Keep explicit add adoption and native-only import intact. Extend the existing two-host adoption check to cover an independent native installation on the second host and verify a quiet subsequent sync. * fix(plugin): preserve reviewed retries and native collision boundaries Retry a pending source update through the existing reviewed update path, so a rolled-back native failure cannot clear progress at the old snapshot. Record default-source versions for add, sync, and update while retaining the recipe fingerprint and generic-version checks for target overrides. Keep explicit native adoption, but block shared Claude sources when an independent same-name native plugin could shadow their hooks. Extract the existing adoption decision so the preview function becomes smaller. * test(plugin): respect OMP update safety in version control Check generic and target versions during review, then confirm the existing OMP upgrade guard preserves the installed and default-source versions. * fix(plugin): declare first local native imports explicitly A first local import into a shared source target now changes that target to native-only intent while preserving its sync selection. Verified source reimports retain their reviewed source and the preview discloses conversion. Cover the explicit import, local sync, and other-host cleanup flow, and remove the unconsumed internal observation assertion from the OMP test. * docs(plugin): explain first local import intent changes Describe the shared native-only target conversion and its effect on other machines, while distinguishing verified source reimports. * fix(plugin): verify checked sources before native reinstalls A checked update that becomes an install after native removal must still match the source digest the user approved. Reject moved or unchecked sources before native work, and allow a stable approved reinstall. Clear completed reinstalls from dashboard update availability while keeping failed targets available for retry. Cover both native presence states in the existing checked-update tests and the dashboard outcome rule. * fix(plugin): guard replacement before cleanup * fix(plugin): refresh discovery for each manager action A later Add action must review the current source even when the manager previously observed that source. Keep discovery sharing across one action while ending its cache before the next wizard invocation. Exercise a fresh source version after an earlier Add preview without TTY input or native writes, using an unavailable client to stop at review. * test(plugin): cover desired checks and final update outcomes Consolidate checked batch approval and dashboard completion tests while retaining removed-native, digest, version and approval controls. Reproduce stale shared recipes and failed or unfinished replacement installs. * test(plugin): make stale source discovery observable Remove the old repository before native-only and npm desired checks so those existing cases cannot pass by reading the applied source. * fix(plugin): check desired source and final outcome * test(plugin): bind checked updates to the observed recipe Reproduce a shared candidate change with equal version, commit and digest, and preserve a freshly checked replacement whose native ID differs. Use actual check observations in approval and native update controls, reject missing source identity, and verify the UI carries the observation through. * fix(plugin): bind checked update to source recipe * fix(ui): classify npm recipes as Pi packages * fix(plugin): retain legacy removal intent during migration Omit pending removals from shared declarations while retaining original local ownership proof so sync retries cleanup. Verification: focused regression passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4). * fix(plugin): keep imports local to an existing shared recipe Adopt a native installation into its local receipt without converting the shared source target or removing other machines installations. Verification: focused import regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4). * fix(plugin): capture legacy evidence on first read Persist passive hints before another machine writes v2 and save verified adoption on reads. Apply reuses preview receipts instead of querying every legacy binding again. Document the per-machine pre-migration read. Verification: migration regressions passed in isolated Linux Codex container runs, not the devcontainer (GOMAXPROCS=4, -p=4). * fix(plugin): target named declarations in interactive imports Offer unresolved package names in dashboard and TUI imports and pass the selected name in single and batch requests. Drop display-only rendered assertions. Verification: 47 UI tests passed with at most four workers in an isolated Linux Codex container, not the devcontainer. * fix(plugin): localize shared intent plan guidance Add message keys for local imports, account changes, cleanup and native collisions across all dashboard locales. Localized guidance contains no CLI flags. Verification: failing localization regression now passes in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4). * refactor(plugin): reuse preview inventory and guard apply boundaries Capture hints on first load without persisting in-memory adoption during preview, keeping approval revisions stable. Apply reuses preview inventory. Reuse accountEnv and guard applyChange plus native write boundaries without inspecting argv. Verification: migration, receipt, account and sync regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4). * test(plugin): organize host state coverage around lifecycle scenarios Group migration, ref drift, account context and cleanup tests behind shared host fixtures and public Preview/Apply assertions. Cover Codex, Cursor, Antigravity and project scopes; add second-machine doctor coverage and the two-machine runbook. Consolidate package-version tests and remove the unused private-record fixture. Verification: focused plugin regressions passed in an isolated Linux Codex container, not the devcontainer (GOMAXPROCS=4, -p=4). * docs(plugin): explain local imports and per-machine migration Document local receipts, per-machine review and commit pinning, config-path state identity and the required legacy read on every machine. Align sharing, doctor, troubleshooting, file-layout and four translated plugin references; restore schema editing guidance. Verification: context-router check passed. Runtime verification uses an isolated Linux Codex container, not the devcontainer. * refactor(plugin): separate unrelated review scope Move project OMP configuration, plugin list ordering, and npm Pi classification to independent local branches based on upstream/main. Keep the shared intent change focused and cover named import selection in the pure flow helper. The three local branches have passing builds in a Linux Codex container, not the devcontainer, with isolated test homes and capped parallelism. * perf(plugin): avoid recapturing v2 state on reads Only compare and persist passive migration hints when legacy bindings exist. Native v2 reads need no state serialization for migration. Verification: pending removal and first-read/import regressions passed in a Linux Codex container, not the devcontainer, with isolated HOME/XDG/TMPDIR and GOMAXPROCS=4 GOFLAGS=-p=4. * docs(plugin): clarify native marketplace repair after import A local import receipt is not a reviewed reinstall source. Correct the remaining troubleshooting instruction and its four translations to require native-client repair, and align the nearby code comment. Validation: checked against prepareChange, context-router check and git diff --check passed. Verification for this review ran in a Linux Codex container, not the devcontainer. * fix(plugins): preserve local ownership across shared intent changes Retain completed legacy migration markers so unchanged v1 YAML cannot uninstall a later manual reinstall. Serialize read-side hint persistence with native operations and keep local imports when shared recipes change. Require explicit dashboard import names and validate recipe identities. Correct schema descriptions, messages, CLI ref status, translated migration guidance and runbooks. Add failing-first Preview/Apply regressions and a real two-ssenv CLI lifecycle script. * fix(plugins): preserve migration history and show retained import guidance Mark existing legacy hints and receipts as captured before cleanup so state from the previous serializer cannot re-adopt a later manual installation. Keep recipe-change guidance in unchanged sync outcomes and visible dashboard rows, and resolve nested OpenCode entries through their package manifest. Cover public migration, ref, account, import and message contracts across adapters. Correct the real two-host Cursor assertions, explicit dashboard selection flow, and remaining localized guidance. * fix(plugins): retain explicit OpenCode entry during import matching Standalone OpenCode packages can rely on a reviewed explicit entry rather than an SDK dependency. Preserve that entry when reading native package identity so matching nested imports remain supported. * fix(plugins): preserve migrated imports and verify native entry identity Recognize older native-only receipts by their existing declaration fingerprint so remote source recipe edits cannot replace migrated imports. Keep managed npm receipts distinct through their source fingerprints. Only borrow an ancestor OpenCode package identity when its resolved entry is the actual registered file. Retain nested and explicit entry support. Add public two-host migration and mismatching-entry regressions. * fix(plugins): retain imported ownership through repeated adds Persist inferred imported ownership when a matching add refreshes the receipt intent, so later shared recipe changes still preserve local native installations. Keep the legacy replacement regression aligned with that ownership contract while retaining removed-intent cleanup. Reject missing or unstatable absolute OpenCode entries before identity matching rather than falling back to the file name. Cover both paths through public Preview and Apply regressions. * test(plugins): isolate OpenCode adapter fixtures from host config Keep native registration fixtures inside their fake agent home by setting XDG_CONFIG_HOME and clearing inherited OpenCode overrides. Ambient config writes can otherwise leak into config-discovery tests in other packages. Cover the XDG, file, directory and inline override cases with temporary config sentinels, while retaining the existing MCP listing expectation. * fix(plugin): let local imports return to the shared source Add a local unimport action that removes only this machine’s installation and receipt while preserving the shared source declaration. Keep retained-import guidance visible across matching adds, list, doctor and dashboard consumers. Avoid idle OMP guidance and unchanged legacy-read locks, preserve localized errors, keep import identity checks offline, and normalize OpenCode drive URLs. Cover the A/B transition and align translations, runbooks and environment cleanup. * fix(plugin): complete unimport validation and guidance Reject missing targets before planning local unimports and share per-target eligibility with the wizard. Make native uninstall effects explicit in help and translated docs, preserve structured update guidance, and cover error paths and shell completion. |
||
|
|
85bcf589a7 |
feat(sync): recognize and route agent-specific skill variants (#649)
* docs(proposals): propose agent-specific skill variants Tracked repositories can ship different files for the same skill across agents. Counting and syncing each copy independently sends incompatible instructions to every target unless users maintain routing filters. Propose repository-scoped logical identity and exact variant routing while preserving source files, explicit controls, and existing naming behavior. Leave activation and compatibility decisions for maintainer review. Refs #648 * docs(proposals): clarify variant routing compatibility Explain how recognition affects universal-only targets and how existing per-variant overrides preserve the desired routing. Fix the precedence between variant identity and generic host-style path inference. Include analyze, move, and catalog consumers while preserving physical identifiers and actual context-cost accounting. Refs #648 * docs(proposals): clarify activation assumptions and scope Make acceptance cases conditional on maintainer-approved recognition being enabled for the tracked source. Separate the provisional implementation estimate from this proposal-only PR so its size is clear. Refs #648 * docs(proposals): qualify naming and opt-in assumptions State that the reproduced routing behavior uses default flat target naming. Leave any opt-in surface with the maintainer's activation decision without ruling out future CLI or config fields. Refs #648 * feat: recognize and route tracked agent skill variants Count tracked variants as logical skills in source and repository summaries, while preserving physical paths, sync operations, and context costs. Select matching canonical agent variants, including account targets, through shared discovery and selection with existing explicit routing precedence. Refs #648 * fix: count logical skills in sync inventory summaries Use shared logical and physical inventory counts in global and project sync closing lines while preserving each target's operation totals. Refs #648 * fix: preserve variant routing diagnostics across previews Resolve target selections once so CLI and server previews keep ambiguity reasons and physical skip counts. Explain managed variants removed by automatic agent routing, and report logical inventory in doctor. Keep warning rows read-only, document upgrade recovery in translated filtering references, and remove the optional README-only addition. Refs #648 * fix: align sync matrix previews with shared variant selection Classify the full source selection once per target so matrix previews honor canonical aliases, account identity, exact-agent routing, and ambiguous variant skips. Preserve each rejected physical path's existing diagnostic and draft filter disambiguation; skipped preview rows remain read-only. Refs #648 * test: expect singular skill wording in doctor source checks Keep the undiscovered-link count assertion aligned with logical source inventory formatting for one skill in global and project mode. Refs #648 * fix: retain selection diagnostics in catalog and diff verdicts Report warning-only diff targets as requiring attention while preserving local-only folder semantics. Reuse shared per-path selection diagnostics in target-scoped catalogs without applying target naming to served paths. Compute source counts once in summary callers and require variant counts in the source status formatter. Refs #648 * test: tighten tracked variant preview fixtures Use a real committed tracked repository for status counts, verify sync preview banners retain server warnings, and use emitted ambiguity reason text in target preview fixtures. Refs #648 * fix(sync): keep agent variants in shared target folders Compatible targets sharing a skills folder need a combined selection so Codex and universal do not prune one another in merge or copy mode. Carry every shared reader through selection, pruning and previews, including project targets, account identities and path aliases. Require a matching skill suffix under two distinct agents before inferring variants, keeping ordinary agent-named categories unrestricted. Separate naming warnings from ambiguous selection in diff and explain ambiguous removals. Add global/project regression coverage for repeated sync, target-only sync, status JSON, diff and API consumers. * fix(variants): align consumer counts, hints and diagnostics Use logical source counts in list, tracked install and init summaries while matching audit caches against physical variants. Restore localized dashboard skip hints and explain symlink routing limits in status and doctor, including project and JSON output. Document paired-agent detection and compatible shared-folder selection in the proposal, built-in skill and English plus translated command pages. Add focused regressions for the affected consumers. * fix(sync): cover initial sync and ignored variant diagnostics Init syncs a fresh in-memory config, so resolve shared target identities before its first sync as well as when loading saved configuration. A whole-directory symlink exposes ignored skills too. Diagnose agent variants using physical inventory when active discovery has none, while keeping logical counts and merge/copy selection restricted to enabled skills. Cover global/project JSON status and doctor with regressions. Reuse sourcewalk directory and canonical-path helpers so traversal guards remain enforced and path resolution has a single existing owner. * fix(variants): address conversion, counts and selection diagnostics Ignore runtime agent identities when comparing convertible project targets and count logical skills during init. Keep selection warnings separate from naming warnings and preserve agent-named parent skills as ordinary skills. Cover account sync/prune, project ambiguity and overrides in merge/copy modes, and init/status agreement. Focused verification ran in an isolated Linux Codex container, not the devcontainer, as authorized. * refactor(variants): remove obsolete selection helpers Remove the unused FilterSkillsByTarget wrapper and prune agent parameter, cache canonical target aliases once, and restore catalog skip ordering to avoid an unrelated behavior change. Completes the optional cleanup from PR 649 review. * fix(ui): expose localized variant selection diagnostics Show target warnings with source paths, localize ambiguity across preview and detail consumers, and let skipped preview rows add a physical exclude pattern. Show tracked repository variant counts alongside logical skills. Drop display-only rendered cases while retaining mutation protection and plain TypeScript logic coverage. Inspect target states in Clean/Playful light/dark and Traditional Chinese. * docs(variants): explain diagnostics and add sync runbook Document doctor variant_routing and logical/physical counts, diff selection skips, and the nested parent-skill boundary. Keep all four command translations aligned and add isolated account/project E2E scenarios. Both runbook steps passed in the authorized Linux Codex container with separate HOME/XDG/TMPDIR fixtures. Website typecheck and all five locale builds passed. * test(config): use native paths in project conversion fixture The shared-agent regression fixture appended slash-separated suffixes to Windows temporary paths, so project path matching returned no candidates. Build each path with filepath.Join and preserve all conversion assertions. Focused project configuration tests passed in the authorized isolated Linux Codex container, not the devcontainer. Windows CI verifies the platform-specific fixture correction. * fix(ui): recompute shared skill routing for filter previews Evaluate edited include/exclude settings in the complete target map before classifying the draft, so a formerly shared folder no longer keeps its old union when the filters differ. Preserve the saved target configuration. * fix(mcp): keep parent skills when peer variants route elsewhere Do not treat an otherwise eligible variant for another agent as an unserved nested skill. Continue blocking parent publication for explicitly filtered, disabled, ambiguous, or invalid children so filters still hide their files. * fix(ui): distinguish agent selection from naming skips Expose separate naming and selection skip counts on target summaries. Show each applicable remedy in target details and sync previews so ambiguity keeps its filter/override guidance alongside naming and collision hints. * fix(list): include disabled rows in tracked repository counts Count the complete inventory that list displays, including ignored skills and physical variants, without changing the enabled counts used by status, install, or sync. Clone rows before counting to preserve disabled state. * docs: align variant counts and routing recovery guidance Show logical skill and physical variant counts in list/install documentation and keep the four translations aligned with the filtering examples. Explain that agent-named skill parents keep ordinary nested skills and retain the devcontainer-only runbook environment. Removal warnings now recommend a source-local override, since include filters cannot undo agent routing. * fix(mcp): preserve explicit target restrictions on nested variants Limit the differently routed child exemption to automatic layout inference. Frontmatter targets and dashboard source-local overrides must still prevent a parent from publishing files explicitly restricted to another target. * fix(ui): fill target name in naming warning guidance Pass the current target name when rendering localized warning hints so the same naming guidance shown beside the controls does not expose a placeholder in the warning banner. Verified in the populated target preview. --------- Co-authored-by: Willie <egg358358@gmail.com> |
||
|
|
efc492fd7a |
fix(update): audit tracked candidates before publication (#647)
* fix(update): audit tracked candidates before publication Prevent rejected tracked-update bytes from becoming readable through published target links by staging and auditing a private candidate before updating the active checkout. Publish the exact approved revision without a second upstream pull. Preserve sparse state, audit metadata, followed checkouts, and compatible edits. Recover staged and unstaged changes after failed forced publication, including deletions, renames, and sparse exclusions. Cover the boundary deterministically and align error messages and localized documentation. * fix(update): preserve local bytes across Git line-ending conversion Overlay dirty worktree bytes after staging candidate patches so core.autocrlf does not silently rewrite local edits. Cover staged, unstaged, and cancelled worktree changes while retaining their index state. Make permission-failure coverage explicitly POSIX-only and compare private checkout contents to their original bytes. Align red-team assertions with candidate rejection and register private temporary cleanup with the raw-write guard. * test(install): normalize checkout after configuring line endings Windows fixtures initially inherit core.autocrlf=true. Reset the isolated checkout after selecting the subtest setting so changing it to false does not turn untouched upstream files into local edits. |
||
|
|
2d196c286b |
feat(check): show what changed in a skill since install (#623)
* feat(check): show what changed in a skill since install #622 made a hand-edited skill visible as modified and kept update from overwriting it, but there was still no way to see the edits before deciding to keep or discard them (#621). LocalChanges compares the skill's files with the hashes recorded at install, fetches the source at the recorded commit only when a recorded file changed, and diffs each file against it, so the diff shows the user's edits even after upstream moves on. A skill without a recorded commit is refused rather than diffed against HEAD, which would show upstream changes as the user's. It backs `check <name> --diff`, GET /api/resources/{name}/local-changes, and the dashboard: the Modified locally dialog on the skill page lists the diffs, and the Updates tab links a modified skill to it. update's skip hints now point at --diff. The route looks up the exact record and refuses non-local names, so a nested or ../ path cannot borrow a top-level skill's record or read outside the source. The file diff helper moved to textdiff so the CLI and server share it. * fix(install): diff local changes against the full installed commit entry.Version holds the short SHA from `rev-parse --short`. A targeted fetch needs the full SHA, so checkoutCommit fell back to fetching every branch and tag with --unshallow: viewing one edited skill could download the repository's whole history, and fail when the commit is only reachable by its full SHA. Use entry.Commit, the full SHA install records, when it is the same commit as Version; a Commit left from an older install, or a legacy record without one, falls back to Version. * test(install): keep checkout line endings when editing in LocalChanges test On Windows git checks the installed copy out with CRLF, so overwriting SKILL.md with LF content made every line differ and the expected diff failed. Edit the installed file in place, as an editor would, and compare the diff without carriage returns. |
||
|
|
d23a44aec9 | refactor(projects): share safe dashboard and CLI operations (#602) | ||
|
|
4a5dacac6b |
feat(mcp): let mcp serve clients edit listed skills (#577)
* feat(mcp): let mcp serve clients edit listed skills A remote assistant that reaches skills only through `mcp serve` could read them but had to hand every change back to a person (#540). Skills listed in `mcp.serve.edit.skills` can now be changed one existing file at a time: `preview_skill_edit` writes nothing and returns the full diff, the audit result and a preview id, and `apply_skill_edit` saves exactly that preview, once. Every save is tied to the revision the client read, so a file changed in the meantime fails with a conflict instead of being overwritten. Skills that `update` would overwrite stay read-only: tracked repos, upstream installs, and skills nested inside an install. The skill is validated and audited in a temporary copy before anything is written; as with install, a finding at or above `audit.block_threshold` refuses the edit unless it was accepted with `--force`, and findings are marked new or existing so the client can see what its change adds. The write is atomic, keeps the file mode, goes through sourcefs link checks, and is recorded in the operation log. Native Skills extension clients still see the edit tools, since the extension cannot write. * fix(mcp): close gaps in mcp serve skill editing Codex review of #577 found five ways the edit tools could do more, or record less, than they promise: - A blank pattern in mcp.serve.edit.skills was dropped by the filter, and no patterns match every skill, so `skills: [' ']` made every skill editable. Blank patterns are now a config error. - preview_ttl was only checked when skills were listed, so the dashboard could save an invalid value that later stopped mcp serve. It is now checked whenever edit is present. - Apply compared only the edited file's digest, so two previews of different files, or an edit made elsewhere in between, could save a skill state that was never validated or audited. Apply now checks and audits the skill again as it will be saved. - Edit audits were not written to audit.log, so blocked attempts left no trace in `skillshare log --audit`. Each preview and apply audit is now logged like install's audit gate. - The writability check migrated legacy metadata, so a "writes nothing" preview (and --check) could rewrite .metadata.json and delete registry.yaml. It now reads the store without migrating; a legacy registry.yaml keeps every skill read-only, and a legacy sidecar marks its skill as installed. |
||
|
|
cf5783ee88 |
fix(backup): reclaim abandoned staging directories safely (#558)
* fix(backup): reclaim abandoned staging directories safely Interrupted backup copies leave hidden .snapshot-* directories that retention cleanup never discovers. Hold a shared process lock during copies and use an exclusive cleanup lock to reclaim orphaned staging without deleting active work. Share retention planning with non-mutating dry runs, report busy manual cleanup in the CLI and API, and align dashboard messages and translated docs. Cover process interruption and automatic cleanup with regression tests and an executable E2E runbook. Closes #556 * fix(backup): address staging cleanup review findings Keep cleanup reachable for staging-only dashboard backups and disclose abandoned incomplete directory deletion in every confirmation locale. Cover the empty-state confirmation with a regression test. Read staging entries before a read-only lock probe so first-use dry runs cannot count a newly active writer. Refresh entries only under the acquired lock and classify both backup-root reads in the filesystem guard. * fix(backup): align cleanup guides and doctor status Disclose abandoned incomplete directory removal in backup help, completion descriptions, and the daily backup guide with all four translations. Add help and completion regressions so these consumers stay aligned with cleanup. Keep the doctor Backups row visible when only the persistent lock remains after cleanup, preserving the existing JSON check and covering the lock-only state. * fix(backup): complete cleanup documentation disclosure Cleanup reclaims abandoned incomplete directories regardless of retention, so retention-only summaries understated the action. Align the backup synopsis, option table and previews, related workflow guides, built-in reference and all four website translations. Scope the retention defaults to completed snapshots. |
||
|
|
99c7911bf3 |
feat(plugins): update a batch of plugins over one stream (#534)
Updating several plugins from the dashboard was slow: each plugin took a preview and an apply round trip, apply previewed again, every plugin cloned its source on its own, and config reloaded after each one. The dashboard now sends the picks to POST /api/plugins/update/stream. The server holds the plugin lock once, previews each plugin once and applies that plan, lets plugins from one source share a single read of it, and reloads config once at the end. POST /api/plugins/update/stop lets the plugin under way finish and starts no other; a closed page does not cut an install short. The check-to-update safety moves to the server: an Agent whose source moved since the check, or that no check showed, installs nothing. npm packages in Pi are exempt, since Pi installs whatever npm names latest; the old client-side comparison flagged them as moved on every update. The update dialog follows the Skills update page, shows per-Agent old -> new versions, fails rows a broken stream never finished, and lists every plugin with its Agent and version when all are current. Release-As: 0.25.6 |
||
|
|
c638b46096 |
fix(sync): replace copy-mode copies with links when switching back to merge (#506)
* fix(sync): replace copy-mode copies with links when switching back to merge Switching a target from copy back to merge left every copy whose entry name did not change as a real folder. Merge sync treated it as the user's own folder, so status and doctor kept saying "run skillshare sync" while sync changed nothing, and only `sync --force` turned it into a link. Copy mode already replaces merge-mode links with copies on its own, so merge sync now replaces a folder the manifest records with a checksum (a copy-mode copy) with a link, without --force. Folders the manifest does not record, or records as a link, stay untouched. The pre-sync target backup is unchanged. The CLI and dashboard diffs name these entries as copies sync replaces instead of suggesting --force, and the sync-modes docs describe the switch. * fix(sync): keep copy-mode copies the user edited when switching to merge The first version replaced any folder the manifest recorded as a copy-mode copy. The manifest checksum is only a record, so a copy edited since copy mode made it was deleted too, and `sync --json` and project-mode dashboard sync take no pre-sync backup to restore it from. Replace the folder only while it still hashes to the recorded checksum (Manifest.OwnsCopy). An edited copy is kept and `sync --force` still replaces it; diff keeps suggesting --force for it. A copy whose name: was rewritten by prefixed naming, or that was made with custom ignore patterns, no longer hashes to the source checksum and is kept the same way. * fix(ui): say a copy-mode copy in a merge target is replaced by a link The Sync page picks a row's text from the diff item's action alone. The copy-mode copy that merge sync now replaces comes from the server as an update, which the page worded as "Link is broken or points elsewhere. Will be relinked" even though no link exists yet. Match the server's reason and show "Copy made by copy mode. Will be replaced by a link" instead, in all eleven dashboard languages. * docs(sync): say only unedited copy-mode copies are replaced on merge sync The sync-modes paragraph promised that copies copy mode made are replaced with links without --force. Merge sync keeps a copy that no longer hashes to the checksum copy mode recorded, so an edited copy, or one whose name: copy mode rewrote for prefixed naming, still needs --force. State the three cases in sync-modes and qualify the diff Modified and Local override labels, in English and the ja, ko, zh-Hans and zh-Hant copies. * fix(sync): keep the copy until its replacement link exists Replacing a copy-mode copy removed the folder first and then created the link. If creating the link failed (no symlink or junction rights on a Windows or network filesystem), sync returned an error with the skill gone from the target. This path now also runs on a plain sync, not only on --force. Park the folder beside the entry, create the link, then delete the parked folder; on failure the folder is moved back. A parked folder left by a run that died mid-way may be the only copy, so the next sync stops with a message instead of deleting it. The manifest also forgets the copy-mode mtime and naming records of an entry that is now a link. * test(sourcefs): register replaceWithLink's target writes in the raw-write ratchet The previous commit moved the merge-mode folder replacement into replaceWithLink, which the ratchet reports as new raw os calls and the old os.RemoveAll allowance as stale. All of them act on the sync target, not the skills source, like the neighbouring entries. * fix(sync): bound the parked copy's name and document the naming exception The folder parked while a link is created was named after the entry, so an entry near the 255-byte filename limit (a long flattened nested skill) could not be moved aside and its replacement failed. The parked name is now a fixed-length hash of the entry name. sync-modes also says what happens when `target_naming` changes in the same sync: the copy gets a new entry name and the prune pass removes it as an orphan whether or not it was edited, as it did before this change. |
||
|
|
c0d2d0409a |
fix(sync): rewrite the prefixed name of a read-only SKILL.md
A copy keeps the source file's mode, so a read-only SKILL.md (e.g. from a read-only checkout) could not be reopened for the name rewrite and a non-root sync failed, dropping the skill from the target mid-migration. Lift the write bit for the rewrite only and restore the mode afterwards. |
||
|
|
096de1ad9b |
fix(sync): drop a copy whose prefixed name could not be written
When the name: rewrite failed after the copy, the new folder stayed in the target with no manifest entry, so later syncs took it for a user's folder and never refreshed it. The copy helper now removes the folder it just made before returning the error; the next sync copies it again. |
||
|
|
16cfd048f1 |
test(sourcefs): allow the raw writes prefixed naming adds to targets
The raw-write ratchet flags SetFrontmatterValue and the rename-back after a failed manifest write. Both only touch target entries (the copied SKILL.md and a just-renamed managed folder), never the skills source, so they are listed with the target reason. |
||
|
|
11c2821350 |
fix(config): write the project migration through a fresh temp file
The legacy target migration wrote to the predictable path config.yaml.tmp next to the validated destination. A cloned project could ship that name as a symlink to a file outside the project, so merely loading the project overwrote the outside file and the rename then replaced the project config with the link. Create the temp file with os.CreateTemp in the destination directory, which never follows an existing name, and remove it if any step fails. |
||
|
|
080bb3e5e4 |
fix(server): guard the dashboard raw config save in project mode
PUT /api/config wrote the raw editor content with os.WriteFile, which follows a symlinked config.yaml. In project mode a link to a config outside the project was overwritten, bypassing the boundary the other config writers now enforce. Route this write through ConfigWritePath and answer 400 with the link named. |
||
|
|
49b43b228c |
fix(plugin): keep symlinked config.yaml and normalize plugin sources
Plugin saves wrote a temp file next to config.yaml and renamed it over the path. When config.yaml is a symlink into a dotfiles folder, the rename replaced the link with a regular file, so the shared config never received the change and the machine silently forked. The plugin writer also skipped preserve_tilde_on_save, saving sources as absolute home paths. The one-time legacy target migrations for global and project configs used the same temp+rename and replaced links as well. Plugin sources were compared as raw strings. The snapshot owner marker records the absolute path from add, so a config that spells the same folder as ~/... failed every update with "snapshot ownership conflict". For Agents whose snapshot location hashes the source, the new spelling silently created a second snapshot instead. Resolve the symlink before writing, normalize sources once where the plugin section is decoded so owner checks and snapshot paths agree, and fold sources back to ~ on save when preserve_tilde_on_save is set. Refs #460 Refs #461 |
||
|
|
0117161c8b | Merge remote-tracking branch 'origin/main' into runkids/436-managed-instruction-block | ||
|
|
a165bf7cf9 | Merge branch 'main' into runkids/arch-444-check-resolution | ||
|
|
05ff8c675a |
feat(extras): prepend and append modes for single-file extras
Tools without an @import directive (codex, gemini, cursor) could only take a shared instruction file as a symlink or copy, which replaces the target's own file. Teams that want one shared AGENTS.md plus the user's own notes in the same file had no way to express that. prepend and append write the source into the target file as a managed block fenced by skillshare:extra markers that carry the source path and a content hash. Sync inserts the block once and then rewrites it in place, status reports modified when the block body no longer matches its hash, Collect copies the edited body back to the source, Reapply rewrites the block from the source, and restore removes only the block. Lines outside the block, and markers inside code fences, are never touched. Several managed blocks (and an import line) may share one target file; the connection validator only rejects a file when a replacing mode (symlink, copy, merge) is involved. Refs #436 |
||
|
|
c23daf8ccc |
refactor(memory): move guidance plan and apply out of the dashboard handler
The guidance rules (status ranking, mixed_modes, multiple_blocks, the plan token, and check -> backup -> recheck -> write) were methods on *Server, so they could only be exercised over HTTP with a configured server, and the recheck after backup depended on callers using the right helper. internal/memory now owns status, plan, and apply behind GuidanceStatus, PlanGuidance, and ApplyGuidance. The server resolves targets, assignments, shared extras, and project reach into a GuidanceInput, syncs shared copies through a callback after each written file, and maps results to JSON. Only ApplyGuidance reaches the write steps, so the recheck cannot be skipped. Note creation and guidance creation shared a copied O_EXCL create with delete-on-failure; both now use createExclusive. Each keeps its own behaviour: notes still chmod to 0644, guidance still creates parents. HTTP routes, shapes, status codes, and error codes are unchanged. The raw write allowances follow the calls to their new functions. Refs #450 |
||
|
|
1f3e61b830 |
test(check): pin update-status resolution for the CLI and dashboard
The CLI, GET /api/check and the check stream each carry their own copy of the resolution sequence, and only its leaf helpers were tested. Pin what each caller reports for every outcome, against local bare remotes, so the copies can be merged without changing output. Refs #444 |
||
|
|
6b4c34dec4 |
test(sourcefs): move the download write allowances to writeDownloadedFile
The raw write ratchet listed the os calls of downloadFile, giteaDownloadFile and cnbWriteBlob. Those now go through writeDownloadedFile, so the list names that function instead, with the same clone reason. |
||
|
|
3375419c63 |
test(sourcefs): allow the raw writes in CreateJunction
The previous commit moved junction creation onto os.Mkdir and os.Remove inside CreateJunction. The raw-write ratchet lists every such call, so record them with the same reason as the neighbouring link helpers. Refs #420 |
||
|
|
d97f6d88b7 |
fix(trash): keep junctions as junctions when moving across volumes
When the skills source and the trash live on different volumes, the cross-device fallback in moveLink and copyDir recreated a Windows junction with os.Symlink. That needs Developer Mode or elevation, which the junction was chosen to avoid, so `unlink` and `trash restore` could fail after `link` had succeeded. Recreate a junction as a junction through a shared helper, and keep the original link in place when creation fails. CreateJunction moves from internal/sync to internal/utils so trash can reuse it. Refs #420 |
||
|
|
9db36b472a |
Merge remote-tracking branch 'origin/main' into runkids/419-link-unlink
# Conflicts: # internal/server/handler_skills.go # skills/skillshare/references/TROUBLESHOOTING.md # website/docs/reference/commands/ui.md # website/docs/reference/targets/configuration.md # website/i18n/ja/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/ja/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/i18n/ko/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/ko/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/commands/ui.md # website/i18n/zh-Hant/docusaurus-plugin-content-docs/current/reference/targets/configuration.md # website/src/data/featureMap.ts |
||
|
|
51f2beadd1 |
fix(install): retain existing skills until replacement succeeds
Copy staged directory links as concrete content through the source root, skip dangling links, and reject directory cycles. Preserve the existing skill under a sibling name and restore it if moving or copying the replacement fails so followed checkout updates cannot discard the old content. |
||
|
|
f20b7f7f1f |
fix(trash): record link copying in the write ratchet
Register link recreation alongside the existing trash and agent recovery copy operations. Keep translated trash guidance separate from the existing group paragraph. |
||
|
|
e7eecffeab | Merge remote-tracking branch 'origin/main' into runkids/274-follow-source-links | ||
|
|
97446744ff |
feat(omp): add native Oh My Pi support (#423)
* feat(omp): add native Oh My Pi support Support OMP skills, instructions, MCP, code hooks and guarded extension selection using its verified native contracts rather than Pi aliases. Add reviewed marketplace plugin installation, cache-preserving scoped removal and fresh-cache reinstall. Align Pi/OMP extension cards and localize inventory guidance while keeping native ownership and read-only constraints. Include regression coverage, isolated E2E runbooks, documentation and verification policies. Native plugin updates and unverified runtime platforms remain guarded. Refs #409 * fix(omp): guard runtime ownership and localize inventory guidance Native install recursively replaces its runtime destination, and a missing cache manifest could leave the real runtime link installed after removal. Bind and recheck an absent reviewed destination, and recover removal names only from verified scope-local links. Localize fixed backend reasons and warnings across dashboard locales while preserving paths and external diagnostics. Restore the reviewed source in the existing reinstall fixture and record real native verification. * fix(omp): allow forgetting natively removed plugins A different plugin can retain node_modules after native uninstall deletes this installation. When its cache, registration and known runtime state are absent, forget only the stale Skillshare binding instead of demanding runtime-name proof for unrelated files. Extend the existing removal recovery test with a failing-before-fix case that verifies the binding is dropped and unrelated native lock bytes and plugin files are preserved. make check passes. |
||
|
|
cd6e0165dd |
fix(uninstall): refuse skills at followed link roots
A root skill discovered through a followed source link occupies the link entry itself. Moving that entry to trash silently unlinks every nested skill instead of removing one skill. Share the root-skill guard across single and batch API handlers and CLI uninstall, report the unlink action clearly, and preserve explicit unlink and nested skill removal. |
||
|
|
2b76402240 |
test(source-links): align group test and raw-write ratchet with the review fixes
uninstall --group on a followed link is now refused, and restore no longer creates parents with a raw MkdirAll, so the ratchet allowance for it is stale. |
||
|
|
d4a9a28e04 |
fix(sourcefs): anchor MoveIn through a followed link in the opened root
MoveIn below a followed link ended in a pathname os.Rename against the link target's directory. That pathname can be renamed away and replaced by a link to another directory after through() cached the second root, so the move landed outside the checkout the root was opened on. The followed route now copies the staged tree through the root handle to a temporary name, renames it into place through the handle, and removes the staged source only after that. The primary root keeps its rename, so behavior without a follow policy is unchanged. |
||
|
|
c0e66720ce |
fix(source-links): preserve trashed links and resolve audit and hash roots
Trash moves and restores the link entry without copying or removing its target, including when rename fails. Relative link text is stored as an absolute target so relocation cannot change its meaning; list and TUI expose the link target without inventorying its contents. Pass the operation-scoped Follow policy into audit and hash operations, resolving their physical root while keeping logical result and metadata keys. Calls without a policy keep their existing behavior and ScanSkill retains its original function signature. Update six stale trash raw-write allowances for the injected rename test seam and classify moveLink creation/removal: it moves a checked source entry to trash or restores an entry into source, never writes through its target. Raw sourcewalk calls and allowances are unchanged. |
||
|
|
a502e9316b |
feat(sourcefs): write through followed first-level source links
With follow_source_links on, discovery reports <source>/_dev-skills/foo, but every write to it was refused: sourcefs rejects a link in the path, and its source-root os.Root refuses descendants outside the source. Dashboard edits, nested uninstall, regular skill replacement, and tracked installs under such a link all failed, although writing through a link the user placed is the agreed behavior (#410). sourcefs.Open, Create, MkdirAllIn, and CheckMoveOut take the operation's optional sourcewalk.Follow. A clean name <link>/<rest> whose first component the policy follows is handled by a second os.Root opened at the link's canonical target, with the same per-component link check on <rest>, so a nested link or ".." still cannot escape the target. Names with ".." keep the source root, which refuses them through the link. Without a policy nothing changes. The link entry itself stays a link: RemoveAll, Rename, and writes on it are refused, install --track --force still refuses to replace it, and CheckMoveOut still lets trash rename the link without following it. MkdirAll on a followed link is a no-op, since it already is that directory; install --into needs that. A rename across the link boundary is refused. The install, update, uninstall, and server callers pass the same policy their discovery uses, through InstallOptions.SourceFollow and the update context. No raw-write allowance was needed. Refs #274 |
||
|
|
8c60f51b9f |
feat(source): add the sourcewalk walker and sourcefs write boundary for proposal 274 (#385)
Implements rollout steps 1 and 2 of proposals/274-skillfollow.md. Nothing follows a link or parses .skillfollow yet. Step 1: doctor reports first-level symlinks and junctions in the skills source as info, in text and JSON, without following them. Step 2a: internal/sourcewalk owns traversal of the skills source. Thirteen raw walks move onto it with identical behavior, and a go/parser ratchet fails the tests on any new unclassified walk. Step 2b: internal/sourcefs wraps an os.Root opened at the skills source and refuses any write whose path has a link component. The six write sites the proposal found in review move onto it, including the cross-device copy fallback, and a second ratchet covers raw os write calls. The only behavior change is that an explicit path crossing a link inside the source is refused instead of written through. Refs #274 Release-As: 0.24.3 |