Skip to content

fix(suite): fail closed on catalog lifecycle - #314

Draft
davida-ps wants to merge 1 commit into
davida-ps/release-simulation-version-fixture-v1from
davida-ps/suite-catalog-installability-v1
Draft

fix(suite): fail closed on catalog lifecycle#314
davida-ps wants to merge 1 commit into
davida-ps/release-simulation-version-fixture-v1from
davida-ps/suite-catalog-installability-v1

Conversation

@davida-ps

@davida-ps davida-ps commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

User description

Summary

  • make the Suite catalog reader a strict lifecycle denial overlay
  • exclude installable: false records from install candidates and expose only scrubbed historical context
  • add exact --skill resolution that fails closed for missing, non-installable, unavailable, or malformed catalog state
  • keep local generated catalog data descriptive only; it cannot authorize installation
  • bump clawsec-suite from 0.1.16 to 0.1.17

Security behavior

  • remote catalog eligibility is explicitly not stable authorization
  • no install command is emitted for denied or unresolved requests
  • untrusted catalog fields cannot smuggle commands into denial or warning output
  • signed stable-catalog authorization and advisory/operator gates remain separate required steps

Scope

This PR changes only five files under skills/clawsec-suite/: metadata, documentation, changelog, catalog discovery runtime, and its focused tests.

It is intentionally stacked on:

Remote validation

Validated only on davida@20.14.133.241 in a fresh /tmp quarantine after SCP of the reviewed five-file patch and SHA-256 verification:

  • 44 focused catalog-discovery cases
  • all Suite-local *.test.mjs tests
  • generated-index integration for denied NanoClaw and eligible Suite requests
  • skill schema validation and packaging/trust-packet checks
  • all root scripts/test-skill-*.mjs simulations with test(release): derive suite simulation version #313 layered in
  • ESLint, TypeScript, and production build

The validator reported only the existing optional warnings for release-generated advisory checksum artifacts.

No tag, release, publication, or merge is included.


Generated description

Below is a concise technical summary of the changes proposed in this PR:
Harden discover_skill_catalog.mjs to treat the remote catalog as a denial overlay, resolve exact --skill requests, and fail closed on malformed, unavailable, or non-installable lifecycle data. Update skill.json, SKILL.md, CHANGELOG.md, and the focused tests to describe the new non-authorizing fallback context, version 0.1.17, and guarded install flow.

TopicDetails
Lifecycle screen Harden catalog discovery to screen exact skill requests, deny installable: false and malformed records, and emit install commands only for lifecycle-screened remote candidates.
Modified files (2)
  • skills/clawsec-suite/scripts/discover_skill_catalog.mjs
  • skills/clawsec-suite/test/skill_catalog_discovery.test.mjs
Latest Contributors(2)
UserCommitDate
David.a@prompt.securityfix(suite): fail close...July 22, 2026
david.a@prompt.securityfix(clawsec-suite): re...April 16, 2026
Docs update Refresh suite metadata and docs for the 0.1.17 bump and document the new denial-overlay, non-authorizing catalog behavior.
Modified files (3)
  • skills/clawsec-suite/CHANGELOG.md
  • skills/clawsec-suite/SKILL.md
  • skills/clawsec-suite/skill.json
Latest Contributors(2)
UserCommitDate
David.a@prompt.securityfix(suite): fail close...July 22, 2026
david.a@prompt.securityfix(release): publish ...July 14, 2026
Review this PR on Baz | Customize your next review

Comment on lines +491 to +499
async function discoverCatalog(requestedSkill) {
const indexUrl = envVar("CLAWSEC_SKILLS_INDEX_URL") || DEFAULT_INDEX_URL;
const outputIndexUrl = indexUrlForOutput(indexUrl);
const timeoutMs = parseTimeoutMs();
const fallback = await loadFallbackCatalog();
const fallbackContext = await loadFallbackCatalog();

try {
const remote = await loadRemoteCatalog(indexUrl, timeoutMs);
const records = enrichWithFallbackMetadata(remote.records, fallbackContext);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discoverCatalog() awaits loadFallbackCatalog() before the remote try, so a malformed skills/clawsec-suite/skill.json throws before loadRemoteCatalog() runs and blocks all recommendations — should we wrap loadFallbackCatalog() in its own try/catch, defaulting fallbackContext to [], since the PR description says the suite-local catalog is non-authorizing context?

Severity

Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents
Before applying, verify this suggestion against the current code. In
skills/clawsec-suite/scripts/discover_skill_catalog.mjs around lines 491-499 inside the
`discoverCatalog(requestedSkill)` function, `fallbackContext` is loaded before the
remote `try` block, so any error thrown by `loadFallbackCatalog()` prevents the remote
catalog fetch from running. Refactor by wrapping the `await loadFallbackCatalog()` call
in its own try/catch, defaulting `fallbackContext` to an empty array (and optionally
storing a warning like "suite-local context unavailable/malformed"), so the subsequent
`loadRemoteCatalog()` attempt proceeds unaffected. Ensure the rest of the function uses
this safe default when fallback parsing fails, and that the remote "available" path
continues to compute recommendations using remoteRecords even when local parsing fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant