Skip to content

v2.1.1 - Fail-Closed Governance Hardening & Catalog Distribution

Choose a tag to compare

@kok-o kok-o released this 27 Sep 17:07
· 63 commits to main since this release

ContextOS v2.1.1 - Fail-Closed Governance Hardening & Catalog Distribution

ContextOS 2.1.1 delivers critical governance hardening, supply chain integrity, full catalog distribution in the npm package, and clean checkout execution.

What's Changed in v2.1.1

Supply Chain & NPM Distribution

  • Full Catalog Distribution: Included catalog directory in npm package distribution (package.json files field), allowing consumer projects to install all 36 catalog skills directly from the unpacked package without requiring a repository clone.
  • Catalog Source Precedence: Built-in package catalog skills take strict precedence over consumer project files, preventing local workspace files from hijacking catalog installations. Local skills require an explicit local: or path reference.
  • Package Size Verification: Total unpacked package size is strictly bounded at 1.30 MB (well below the 2.00 MB budget target), with a compressed tarball size of 396 KB across 303 files.

Security & Fail-Closed Governance

  • Strict Exit Code Contract: Standardized exit codes across scan and gate: all reading, git, or configuration failures return code 2 with explicit diagnostics in both enforce and advisory modes; code 0 is returned strictly when verification completes cleanly with no blocking violations; code 1 is returned on blocking violations.
  • Literal Git Pathspecs & Diff Isolation: Added --literal-pathspecs, -c core.quotepath=false, --no-ext-diff, and --no-textconv to staged git diff and blob inspections, eliminating filename regex fragility and supporting paths with spaces, Unicode, and glob characters.
  • Pre-Commit Hook Safety & Trusted Local Runner:
    • Automatically migrates existing trailing hook blocks from v2.1.0 to execute immediately after the shebang before any user exit 0.
    • Added strict shell shebang validation, rejecting non-shell interpreters (python, node) with exit code 1.
    • Resolves local executable via ./node_modules/.bin/contextos or source repository runner, eliminating unpinned PATH binary fallbacks.
    • Preserves exact scanner exit codes (including code 2 for infrastructure/unverified errors) rather than coercing to code 1.
  • Cross-Repository Scan Targeting (--project): Added --project <path> support to contextos scan, enabling inspection of external target Git repositories from a central runner.

Core Adapters & Clean Checkout Parity

  • Self-Contained MCP Selector Resolution: Resolver parity tests now dynamically compile the TypeScript selector in-memory when gitignored dist is absent, guaranteeing clean checkout compatibility without pre-build requirements.
  • CLAUDE.md Demarcation & Idempotency: Claude Code adapter now generates CLAUDE.md with explicit <!-- CONTEXTOS:START --> and <!-- CONTEXTOS:END --> demarcation, preserving user preamble, custom guidelines, and ensuring idempotent re-exports.
  • Dual-Root Profile Discovery: Extended dual-root contract to profiles.js (listProfiles and getProfile), enabling consumer projects to define custom profiles that are seamlessly discovered across all CLI and compiler entrypoints.
  • Skill Examples Verification Engine: Replaced vm.Script with esbuild.transformSync (for TypeScript/TSX/ESM JavaScript) and Python AST parsing in scripts/verify-skill-examples.js, with syntax validation explicitly separated from behavioral runtime checks.
  • CLI Robustness & Documentation Alignment: Restored audit proxy command (as an alias for validate), added rejection with exit code 1 for unknown commands, supported comma-separated --target cursor,claude, updated action examples to v2.1.1, and protected .aider.conf.yml against malformed YAML overwrites.