@skillsmith/core 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +2 -2
  3. package/dist/.tsbuildinfo +1 -1
  4. package/dist/src/index.d.ts +2 -1
  5. package/dist/src/index.d.ts.map +1 -1
  6. package/dist/src/index.js +3 -1
  7. package/dist/src/index.js.map +1 -1
  8. package/dist/src/scripts/__tests__/scan-imported-skills.test.js +9 -1
  9. package/dist/src/scripts/__tests__/scan-imported-skills.test.js.map +1 -1
  10. package/dist/src/scripts/scan-imported-skills.d.ts +7 -1
  11. package/dist/src/scripts/scan-imported-skills.d.ts.map +1 -1
  12. package/dist/src/scripts/scan-imported-skills.js +15 -2
  13. package/dist/src/scripts/scan-imported-skills.js.map +1 -1
  14. package/dist/src/scripts/skill-scanner/allowlist.d.ts +10 -0
  15. package/dist/src/scripts/skill-scanner/allowlist.d.ts.map +1 -1
  16. package/dist/src/scripts/skill-scanner/allowlist.js +10 -0
  17. package/dist/src/scripts/skill-scanner/allowlist.js.map +1 -1
  18. package/dist/src/scripts/skill-scanner/index.d.ts +8 -0
  19. package/dist/src/scripts/skill-scanner/index.d.ts.map +1 -1
  20. package/dist/src/scripts/skill-scanner/index.js +13 -5
  21. package/dist/src/scripts/skill-scanner/index.js.map +1 -1
  22. package/dist/src/scripts/skill-scanner/trust-scorer.d.ts.map +1 -1
  23. package/dist/src/scripts/skill-scanner/trust-scorer.js +6 -0
  24. package/dist/src/scripts/skill-scanner/trust-scorer.js.map +1 -1
  25. package/dist/src/security/scanner/SecurityScanner.action-context.d.ts +15 -0
  26. package/dist/src/security/scanner/SecurityScanner.action-context.d.ts.map +1 -0
  27. package/dist/src/security/scanner/SecurityScanner.action-context.js +209 -0
  28. package/dist/src/security/scanner/SecurityScanner.action-context.js.map +1 -0
  29. package/dist/src/security/scanner/SecurityScanner.d.ts +25 -0
  30. package/dist/src/security/scanner/SecurityScanner.d.ts.map +1 -1
  31. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts +40 -1
  32. package/dist/src/security/scanner/SecurityScanner.helpers.d.ts.map +1 -1
  33. package/dist/src/security/scanner/SecurityScanner.helpers.js +88 -51
  34. package/dist/src/security/scanner/SecurityScanner.helpers.js.map +1 -1
  35. package/dist/src/security/scanner/SecurityScanner.js +39 -6
  36. package/dist/src/security/scanner/SecurityScanner.js.map +1 -1
  37. package/dist/src/security/scanner/SecurityScanner.pii.d.ts +30 -0
  38. package/dist/src/security/scanner/SecurityScanner.pii.d.ts.map +1 -1
  39. package/dist/src/security/scanner/SecurityScanner.pii.js +8 -1
  40. package/dist/src/security/scanner/SecurityScanner.pii.js.map +1 -1
  41. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts +60 -0
  42. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.d.ts.map +1 -0
  43. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js +228 -0
  44. package/dist/src/security/scanner/SecurityScanner.prose-lexicon.js.map +1 -0
  45. package/dist/src/security/scanner/SecurityScanner.scanners.d.ts.map +1 -1
  46. package/dist/src/security/scanner/SecurityScanner.scanners.js +35 -5
  47. package/dist/src/security/scanner/SecurityScanner.scanners.js.map +1 -1
  48. package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts +49 -0
  49. package/dist/src/security/scanner/SecurityScanner.value-gate.d.ts.map +1 -0
  50. package/dist/src/security/scanner/SecurityScanner.value-gate.js +134 -0
  51. package/dist/src/security/scanner/SecurityScanner.value-gate.js.map +1 -0
  52. package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts +55 -0
  53. package/dist/src/security/scanner/SecurityScanner.weak-passwords.d.ts.map +1 -0
  54. package/dist/src/security/scanner/SecurityScanner.weak-passwords.js +313 -0
  55. package/dist/src/security/scanner/SecurityScanner.weak-passwords.js.map +1 -0
  56. package/dist/src/security/scanner/patterns.d.ts +16 -6
  57. package/dist/src/security/scanner/patterns.d.ts.map +1 -1
  58. package/dist/src/security/scanner/patterns.js +25 -61
  59. package/dist/src/security/scanner/patterns.js.map +1 -1
  60. package/dist/src/security/scanner/patterns.sensitive-path.d.ts +45 -0
  61. package/dist/src/security/scanner/patterns.sensitive-path.d.ts.map +1 -0
  62. package/dist/src/security/scanner/patterns.sensitive-path.js +137 -0
  63. package/dist/src/security/scanner/patterns.sensitive-path.js.map +1 -0
  64. package/dist/src/security/scanner/regex-utils.d.ts +31 -17
  65. package/dist/src/security/scanner/regex-utils.d.ts.map +1 -1
  66. package/dist/src/security/scanner/regex-utils.js +31 -17
  67. package/dist/src/security/scanner/regex-utils.js.map +1 -1
  68. package/dist/src/security/scanner/types.d.ts +9 -0
  69. package/dist/src/security/scanner/types.d.ts.map +1 -1
  70. package/dist/src/utils/index.d.ts +1 -0
  71. package/dist/src/utils/index.d.ts.map +1 -1
  72. package/dist/src/utils/index.js +2 -0
  73. package/dist/src/utils/index.js.map +1 -1
  74. package/dist/src/utils/skill-name.d.ts +19 -0
  75. package/dist/src/utils/skill-name.d.ts.map +1 -0
  76. package/dist/src/utils/skill-name.js +26 -0
  77. package/dist/src/utils/skill-name.js.map +1 -0
  78. package/dist/src/utils/skill-name.test.d.ts +2 -0
  79. package/dist/src/utils/skill-name.test.d.ts.map +1 -0
  80. package/dist/src/utils/skill-name.test.js +34 -0
  81. package/dist/src/utils/skill-name.test.js.map +1 -0
  82. package/dist/tests/security/ContinuousSecurity.performance.test.js +12 -7
  83. package/dist/tests/security/ContinuousSecurity.performance.test.js.map +1 -1
  84. package/dist/tests/security/ContinuousSecurity.test.js +14 -2
  85. package/dist/tests/security/ContinuousSecurity.test.js.map +1 -1
  86. package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts +10 -12
  87. package/dist/tests/security/ai-defence-multiline-promotion.test.d.ts.map +1 -1
  88. package/dist/tests/security/ai-defence-multiline-promotion.test.js +26 -33
  89. package/dist/tests/security/ai-defence-multiline-promotion.test.js.map +1 -1
  90. package/dist/tests/security/nested-instruction-long-attribute.test.js +20 -10
  91. package/dist/tests/security/nested-instruction-long-attribute.test.js.map +1 -1
  92. package/dist/tests/security/scanner-evidence-tiers.test.js +15 -0
  93. package/dist/tests/security/scanner-evidence-tiers.test.js.map +1 -1
  94. package/dist/tests/security/scanner-multiline-cap.test.d.ts +21 -0
  95. package/dist/tests/security/scanner-multiline-cap.test.d.ts.map +1 -0
  96. package/dist/tests/security/scanner-multiline-cap.test.js +152 -0
  97. package/dist/tests/security/scanner-multiline-cap.test.js.map +1 -0
  98. package/dist/tests/security/scanner-regression-guard.test.js +37 -0
  99. package/dist/tests/security/scanner-regression-guard.test.js.map +1 -1
  100. package/dist/tests/security/scanner-witness-sw1.test.d.ts +32 -0
  101. package/dist/tests/security/scanner-witness-sw1.test.d.ts.map +1 -0
  102. package/dist/tests/security/scanner-witness-sw1.test.js +255 -0
  103. package/dist/tests/security/scanner-witness-sw1.test.js.map +1 -0
  104. package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts +2 -0
  105. package/dist/tests/security/sensitive-path-adversarial-review.test.d.ts.map +1 -0
  106. package/dist/tests/security/sensitive-path-adversarial-review.test.js +193 -0
  107. package/dist/tests/security/sensitive-path-adversarial-review.test.js.map +1 -0
  108. package/dist/tests/security/sensitive-path-fp.test.js +248 -0
  109. package/dist/tests/security/sensitive-path-fp.test.js.map +1 -1
  110. package/dist/tests/security/smi5879-corroboration.core.test.js +44 -0
  111. package/dist/tests/security/smi5879-corroboration.core.test.js.map +1 -1
  112. package/dist/tests/security/weak-password-lexicon.test.d.ts +18 -0
  113. package/dist/tests/security/weak-password-lexicon.test.d.ts.map +1 -0
  114. package/dist/tests/security/weak-password-lexicon.test.js +122 -0
  115. package/dist/tests/security/weak-password-lexicon.test.js.map +1 -0
  116. package/dist/tests/skill-scanner/allowlist.test.js +58 -4
  117. package/dist/tests/skill-scanner/allowlist.test.js.map +1 -1
  118. package/dist/tests/skill-scanner/categorizer.test.d.ts +2 -0
  119. package/dist/tests/skill-scanner/categorizer.test.d.ts.map +1 -0
  120. package/dist/tests/skill-scanner/categorizer.test.js +71 -0
  121. package/dist/tests/skill-scanner/categorizer.test.js.map +1 -0
  122. package/dist/tests/skill-scanner/cli-guard.test.d.ts +23 -0
  123. package/dist/tests/skill-scanner/cli-guard.test.d.ts.map +1 -0
  124. package/dist/tests/skill-scanner/cli-guard.test.js +71 -0
  125. package/dist/tests/skill-scanner/cli-guard.test.js.map +1 -0
  126. package/dist/tests/unit/services/skill-installation.content.test.js +36 -0
  127. package/dist/tests/unit/services/skill-installation.content.test.js.map +1 -1
  128. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts +29 -0
  129. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.d.ts.map +1 -0
  130. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js +200 -0
  131. package/dist/tests/unit/services/skill-installation.service.sensitive-path-fp.test.js.map +1 -0
  132. package/package.json +6 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,14 @@ All notable changes to `@skillsmith/core` are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## v0.12.3
8
+
9
+ - **Add**: `SecurityScanner.weak-passwords.ts` — a generated, versioned list of common weak passwords (vendored from SecLists, hash-pinned, capped to the top 5,000 by frequency rank), built by the new `scripts/gen-weak-password-lexicon.mjs` generator and mirrored byte-identically into the Node and Deno/Supabase edge scanner twins. This wave ships the data pipeline only — no scanner behavior changes; the `sensitive_path` detection change that consumes this data is a separate, follow-on change (SMI-6441 Wave 1)
10
+ - **Added**: SMI-6472 -- new `./utils/skill-name` subpath export (`VALID_SKILL_NAME_RE`, `validateSkillName`), matching the existing narrow-subpath convention (`./services/skill-installation-io`, etc.) rather than requiring consumers to import the full package barrel for a small, dependency-free utility.
11
+ - **Fix**: `scripts/skill-scanner/index.ts` no longer runs its CLI `main()` unconditionally at module-load time — the invocation is guarded by the standard `import.meta.url === \`file://${process.argv[1]}\`` check, so importing the barrel for its exports (types, categorizer, trust-scorer, file-scanner, logger, reporter, scanner) no longer hijacks `process.argv`, runs a scan, or exits the importing process. `main` is now exported, and the `scripts/scan-imported-skills.ts` backwards-compat shim (the `weekly-security-scan.yml` entry point) invokes it explicitly under its own identical guard — direct `npx tsx` execution of either file is unchanged (SMI-6464)
12
+ - **Fix**: `sensitive_path` scanner findings now require nearby action evidence (a verb, shell operator, or imperative framing) before scoring HIGH — a bare mention of a sensitive path in prose or a defensive/documentation context downgrades to MEDIUM instead of triggering the weekly security scan's allowlist-triage cycle (SMI-5207). Adds `SecurityScanner.action-context.ts` (the action-context gate) and `SecurityScanner.value-gate.ts`/`SecurityScanner.prose-lexicon.ts` (per-assignment-segmented value classification), with `patterns.sensitive-path.ts` split out of `patterns.ts` for the pattern family itself. `scanSensitivePaths()`'s severity-message construction now embeds up to 60 chars of the matched content — see `skill-scanner/allowlist.ts`'s updated design-invariant note if authoring a new allowlist entry against a `sensitive_path` message.
13
+ - **Fix**: `multilineTruncated` (set when a scan hits its per-pattern iteration ceiling, so `riskScore` is a known under-count) was computed but never consumed at the quarantine decision — `trust-scorer.ts`'s `shouldQuarantine()` could clear or never apply a quarantine hold based on an incomplete scan. A truncated scan now forces `quarantine: true` before allowlist filtering runs, so an allowlist can no longer clear a scan-integrity hold (SMI-5879, SMI-6020)
14
+
7
15
  ## v0.12.2
8
16
 
9
17
  - **Feature**: SMI-6343 Wave 4 -- apply_manifest_reconcile tool (#2715)
@@ -380,6 +388,7 @@ All notable changes to `@skillsmith/core` are documented here.
380
388
  ## v0.11.6
381
389
 
382
390
  - **Fix**: Harden manifest concurrency (uninstall lock, temp-file races) (#2331)
391
+ - **Fix**: `scanPatternsWithMultilineSupport` (`security/scanner/SecurityScanner.helpers.ts`) tested each `content`/`both`-scope pattern with a non-global regex `.match()`, returning only the *first* match in the whole document — a real jailbreak/prompt-injection attack repeated later in a long skill could undercount and slip past the quarantine threshold. Rewritten as a per-pattern global-exec loop bounded by `MAX_MULTILINE_LINES_PER_PATTERN` (64, score-neutral) and `MAX_MULTILINE_ITERATIONS_PER_PATTERN` (10,000, wall-clock liveness only, sets `ScanReport.multilineTruncated`); also fixes an off-by-one where a match capturing a leading `(?:^|\n)` anchor reported `.index` at the *previous* line's newline instead of the matched line's own start. `MAX_CONTENT_LENGTH_FOR_REGEX` (pass-1 full-content cap) raised from 10,000 to 1,000,000 chars, closing a truncation blind spot on real-sized SKILL.md files (re-benchmarked: ~56ms worst case at 1MB, linear to 4MB). `multilineTruncated` is now enforced at every quarantine write path (Node + Deno indexer runtimes, and this package's own `trust-scorer.ts`) — a truncated scan can only raise a verdict, never lower one (SMI-5879, SMI-6020)
383
392
  - **Fix**: code-review follow-up on the Antigravity `directory-package` companion-agent path (two BLOCKING findings). (1) `resolveCompanionAgentPath()` gains an explicit 3rd `baseDir` param (default `process.cwd()`) instead of letting Antigravity's relative `dir` resolve implicitly against whatever `process.cwd()` happens to be at the exact `fs` call that consumes the path — wrong for the long-running MCP server, whose cwd is fixed at launch and does not track the calling editor/agent's real project. `writeInstallFiles()` gains a matching optional `companionBaseDir` param, threaded through both its callers (`SkillInstallationService.install()` via a new `companionBaseDir` constructor param, and `installFromContent()`); the MCP `install_skill` tool gains an optional `cwd` input field passed through as `companionBaseDir` so a caller can supply its real project root. (2) `resolveCompanionAgentPath()`'s `directory-package` branch now rejects an unsafe `skillName` (`''`, `'.'`, `'..'`, or containing `/`/`\`) before building the path — `skillName` becomes its own path segment in this mode, so `'..'` would otherwise `path.join`-normalize outside the intended companion-agent directory. Not exploitable through either current caller (both already sanitize `skillName` upstream), but the function is exported/reusable with no validation of its own, so it now enforces the same "last line of defense" standard already applied to `skillNameFromSkillId()` (SMI-5982)
384
393
  - **Feature**: `antigravity` is now a real `ClientId` (`install/paths.ts`) — `CLIENT_NATIVE_PATHS['antigravity'] = ~/.gemini/config/skills`, un-deferred from `compatibility/slugs.ts`'s `BROWSE_ONLY_SLUGS` (which now only contains `gemini`), and given its own `CLIENT_TO_COMPATIBILITY_SLUG` entry. `CompanionAgentTarget.fileMode` gains a second value, `'directory-package'` (Antigravity only today) — a per-skill subdirectory `<dir>/<skillName>/agent.md`, instead of every other client's flat `<dir>/<name>-suffix.md`; `resolveCompanionAgentPath()` is now mode-aware. Antigravity's companion-agent output is project-scoped (`.agents/agents/<name>/agent.md`, relative to the invocation directory) — this CLI has no existing global-vs-project install-mode distinction to hook into, confirmed by grep, so global scope (`~/.gemini/config/agents/`) is a fast-follow, not implemented here (SMI-5982)
385
394
  - **Fix**: `writeInstallFiles()`'s rollback path could leave behind an orphaned, empty per-skill companion-agent directory when a new `directory-package`-mode install (Antigravity) failed partway through — every other client's agents dir is shared and pre-existing, so this hazard never applied to them. Cleanup uses a non-recursive `rmdir`, a safe no-op when the directory was never created or holds unexpected surviving content (SMI-5982)
package/README.md CHANGED
@@ -6,13 +6,13 @@ Part of Skillsmith: a registry for sharing, scanning, and tracking agent skills
6
6
 
7
7
  ## Contents
8
8
 
9
- - [What's New](#whats-new-in-v0122)
9
+ - [What's New](#whats-new-in-v0123)
10
10
  - [Installation](#installation)
11
11
  - [Quick Start](#quick-start)
12
12
  - [Features](#features)
13
13
  - [Exports](#exports)
14
14
 
15
- ## What's New in v0.12.2
15
+ ## What's New in v0.12.3
16
16
 
17
17
  - **New `resolveSessionTier` client** (`sync/license-status-client.ts`): authenticates a stored `skillsmith login` session against `/license-status` so the MCP server can resolve a real subscription tier without a separately-configured `SKILLSMITH_API_KEY`, instead of silently falling back to `community`.
18
18
  - **Scanner: bundled-file scan expanded to operational code** (Gap 8 of the ClawHavoc remediation): the indexer now reads `scripts/`, `src/`, and `bin/` alongside `SKILL.md`, closing a blind spot where a backdoor buried mid-function in working operational code was structurally invisible.