# Logic as Data

## The Philosophy of Prompt-as-Code

In ADAM, we subscribe to the "Logic as Data" and "Prompt-as-Code" methodologies. This approach fundamentally separates business rules, risk thresholds, and compliance constraints from the underlying execution code.

### Decoupling Rules from Code
Traditionally, credit risk thresholds (e.g., maximum leverage ratios, minimum interest coverage) are hard-coded into Python or Rust backend services. Updating these requires code changes, pull requests, test suite runs, and deployments.

In ADAM, these rules are abstracted into `jsonLogic` and YAML definitions.

### Benefits for Underwriting Workflows
1. **Auditability:** Every rule evaluation is a data artifact. When a credit memo is generated, the specific JSON rule that flagged a covenant breach is recorded in the `ProofOfThoughtLogger` alongside the `ProvenanceHeader`.
2. **Provenance:** "Prompt-as-Code" treats system prompts and logical constraints as version-controlled assets. We can mathematically prove which version of the underwriting logic approved or rejected an asset.
3. **Agility:** Risk managers can adjust thresholds dynamically without requiring engineering intervention, simply by updating a JSON file.

### Handling Drift
This framework is self-healing. If the deterministic JSONLogic evaluation contradicts the narrative generated by a probabilistic System 1 agent, the system logs an 'observed_drift' flag. This triggers a reconciliation workflow, ensuring that the deterministic engine always serves as the final source of truth.
