Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt

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

Signal validation (VAL)

Thrown when signals don’t match the policy’s signalsSchema.
CodeMeaningFix
VAL-003Signal not declared in signalsSchemaRemove the unknown signal or add it to the policy’s schema
VAL-004Required signal missing from inputAdd the missing signal to your request
VAL-005number signal has non-numeric valuePass a number
VAL-006boolean signal has non-boolean valuePass true or false, not 1 or "true"
VAL-007integer signal has non-integer valuePass a whole number, not a float or string
VAL-008string signal has non-string valuePass a string
VAL-009enum value not in declared values arrayCheck the values array in signalsSchema
VAL-011enum signal missing values array in schemaAdd "values": [...] to the signal definition
VAL-012Unsupported signal type in schemaUse: integer, number, boolean, string, enum

Policy compilation (POL)

Thrown by compilePolicy or generateBundle. Errors block signing; the policy must be fixed before a bundle can be produced.
CodeMeaningFix
POL-001policy.json not found at the given pathCheck the path passed to compile
POL-002Invalid JSON in policy.jsonFix the syntax error
POL-003Missing policyId fieldAdd "policyId": "your-policy-id"
POL-004Missing policyVersion fieldAdd "policyVersion": "1.0.0"
POL-005Missing schemaVersion fieldAdd "schemaVersion": "1.0.0"
POL-006Missing signalsSchema fieldAdd a signalsSchema object
POL-007Missing rules fieldAdd a rules array
POL-008policyId doesn’t match directory nameName the directory {policyId}
POL-009Unsupported schemaVersionOnly "1.0.0" is currently supported
POL-010Signal missing type fieldAdd "type": "..." to the signal definition
POL-011Signal has invalid typeUse: integer, number, boolean, string, enum
POL-012enum signal missing values arrayAdd "values": [...] to the enum signal
POL-013Rule missing id fieldAdd a unique id string to the rule
POL-014Rule missing condition fieldAdd a condition object to the rule
POL-015Rule missing outcome fieldAdd an outcome object to the rule
POL-016Rule outcome.action is not a valid actionUse a supported action string
POL-017Rule outcome.requires_override must be booleanPass true or false
POL-018Rule outcome.reason must be a stringPass a string value
POL-019Rule condition references unknown signalAdd the signal to signalsSchema
POL-020Duplicate rule idEach rule id must be unique within the policy
POL-021No catch-all rule foundAdd a rule with "condition": { "all": [] } as the last rule
POL-022policyVersion not semverUse 1.0.0 format - the v1 prefix is not supported

System (SYS)

CodeMeaningFix
SYS-006No rule matched - default reject appliedAdd a catch-all rule ("condition": { "all": [] }) as the last rule

Invariants (INV)

CodeMeaningFix
INV-013Replay detected - execution_fingerprint already consumedThis signal set has already been executed. Use different signals or a fresh replay store for testing.

Using error codes in code

All codes are available as constants in @parmanasystems/execution:
import { ErrorCodes } from "@parmanasystems/execution";

try {
  await executeFromSignals(...);
} catch (error: any) {
  if (error.message.includes(ErrorCodes.INV_013)) {
    // Replay violation - signal set already executed
    metrics.increment("governance.replay_violation");
  }
  if (error.message.includes(ErrorCodes.VAL_004)) {
    // Missing required signal
    res.status(400).json({ error: "Missing required signal", code: "VAL-004" });
  }
}

See also