Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/CarlosEduJs/SCAL-P/llms.txt

Use this file to discover all available pages before exploring further.

The policy file at .scalp/policy.json is the single source of truth for how SCAL-P evaluates your dependencies. It follows JSON Schema Draft 2020-12 and is validated against the bundled schema at .scalp/policy.schema.json. Only version is required; all other fields have safe defaults that produce an audit-only, non-blocking posture.
Add "$schema": "https://raw.githubusercontent.com/CarlosEduJs/SCAL-P/main/.scalp/policy.schema.json" to your policy.json for inline autocomplete and validation in VS Code, JetBrains IDEs, and any editor that supports JSON Schema.

Top-level fields

$schema
string
Optional. A URI pointing to the JSON Schema for this file. Set it to the canonical URL below to enable editor autocomplete and validation.
https://raw.githubusercontent.com/CarlosEduJs/SCAL-P/main/.scalp/policy.schema.json
version
integer
required
Schema version. The only accepted value is 1. SCAL-P uses this field to detect incompatible future policy formats.
trust
object
Controls which packages are evaluated, how trust scoring works, and whether missing hashes are a hard failure.
packages
object
Allow and deny rules for specific packages or name patterns. Rules are evaluated according to the active trust.mode.
transitive
object
Limits on transitive (indirect) dependencies.
enforcement
object
Controls what SCAL-P does when a violation is detected.

PackageRule

A PackageRule matches one or more packages by exact name, glob pattern, version constraint, or expected checksum. Every rule must include either name or pattern — both cannot be absent.
name
string
Exact package name to match. Supports scoped packages.Examples: "lodash", "@scope/package"
pattern
string
Glob pattern for matching multiple packages. Supports * (any), *suffix, prefix*, *substr*, and @scope/*.Examples: "*-free", "@scope/*", "*substr*"
versions
string
Optional npm semver range. When present, the rule applies only to packages whose resolved version matches the constraint.Examples: "^4.0.0", ">=1.0.0"
checksum
string
Optional expected SHA-512 integrity hash in sha512-<base64> format. When present, the rule matches only packages whose lockfile integrity entry equals this value.Example: "sha512-a1b2c3d4..."

Complete example

{
  "$schema": "https://raw.githubusercontent.com/CarlosEduJs/SCAL-P/main/.scalp/policy.schema.json",
  "version": 1,
  "trust": {
    "mode": "allowlist",
    "min_score": 60,
    "require_hash": true
  },
  "packages": {
    "allow": [
      { "name": "lodash", "versions": "^4.0.0" },
      { "pattern": "@your-org/*" }
    ],
    "deny": [
      { "pattern": "*-free" },
      { "pattern": "@evil-scope/*" }
    ]
  },
  "transitive": {
    "max_depth": 5
  },
  "enforcement": {
    "on_violation": "block",
    "default_mode": "guarded"
  }
}
packages.deny is evaluated even when trust.mode is allowlist. A package in packages.allow that also matches a packages.deny rule is still blocked. Deny rules take precedence.

Build docs developers (and LLMs) love