File size: 8,465 Bytes
a8b4b87 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | // doctrine-scanner-exempt: legacy live-product surface; rename tracked as separate engineering debt — see scripts/check-doctrine-v6.mjs header.
import type { AmaruAgent } from './types';
/**
* The eight Amaru agents. Each is a node in the Codex Ouroboros loop with a
* scoped charter, an allowlist, a blocklist, governance limits, and a Lutar
* axis affinity (which axis of Σ they primarily improve).
*
* Modeled after A11oy's Fabric agent pattern but Amaru-native: data activation
* specialists, not generalist orchestrators. They cooperate via the
* `coalition` runtime and emit hash-chained run events.
*/
export const AMARU_AGENTS: readonly AmaruAgent[] = [
{
id: 'cartographer',
name: 'Cartographer',
mythosName: 'Pacha-Mapa',
role: 'Discovers sources, profiles tables, infers entities and PII surfaces.',
responsibilities: [
'Profile new sources and tables on connect',
'Detect PII columns and propose classification labels',
'Maintain the source freshness map',
'Surface candidate models to the Mapper',
],
allowedActions: ['profile_source', 'sample_rows_redacted', 'propose_model'],
blockedActions: ['write_destination', 'mutate_source', 'unredact_pii'],
governanceLimits: ['Sample rows are always redacted before persistence', 'Profiling never writes to a destination'],
inputs: ['source.connect', 'source.refresh_request'],
outputs: ['source.profile_v1', 'model.candidate_v1', 'pii.classification_v1'],
lutarAxisAffinity: 'P',
recentDecisionCount: 412,
recentBlockCount: 3,
approvalRate: 0.99,
avgConfidence: 0.92,
},
{
id: 'mapper',
name: 'Mapper',
mythosName: 'Quipu-Wari',
role: 'Proposes field-to-destination mappings with transforms and confidence.',
responsibilities: [
'Match model fields to destination fields',
'Choose transforms (identity, format, redact, hash, lookup)',
'Compute compatibility and confidence scores',
'Flag mappings that cross PII boundaries for approval',
],
allowedActions: ['propose_mapping', 'request_approval', 'attach_evidence'],
blockedActions: ['auto_apply_pii_mapping', 'bypass_approval', 'edit_destination_schema'],
governanceLimits: ['Cannot auto-apply if destination.piiAllowed = false and any source field is PII', 'Cannot raise confidence above 0.95 without two evidence rows'],
inputs: ['model.candidate_v1', 'destination.contract_v2'],
outputs: ['mapping.proposed_v1', 'approval.requested_v1'],
lutarAxisAffinity: 'Φ',
recentDecisionCount: 286,
recentBlockCount: 18,
approvalRate: 0.94,
avgConfidence: 0.87,
},
{
id: 'courier',
name: 'Courier',
mythosName: 'Chaski-Yacu',
role: 'Plans and executes batched, retry-aware deliveries to destinations.',
responsibilities: [
'Plan sync batches respecting rate limits',
'Execute extract-transform-deliver pipelines',
'Retry transient failures with backoff',
'Quarantine permanent failures with evidence',
],
allowedActions: ['plan_batch', 'extract_records', 'deliver_records', 'retry_with_backoff', 'quarantine_record'],
blockedActions: ['mutate_source', 'change_mapping', 'override_policy'],
governanceLimits: ['Hard cap 3 retries, exponential backoff', 'Single-batch ceiling 50 000 records', 'Halts on policy_blocked event'],
inputs: ['mapping.approved_v1', 'sync.scheduled_v1'],
outputs: ['delivery.batch_v1', 'delivery.failure_v1'],
lutarAxisAffinity: 'K',
recentDecisionCount: 1820,
recentBlockCount: 7,
approvalRate: 1.0,
avgConfidence: 0.95,
},
{
id: 'sentinel',
name: 'Sentinel',
mythosName: 'Apu-Wasi',
role: 'Enforces policies pre-flight and mid-flight; halts unsafe batches.',
responsibilities: [
'Evaluate every batch against the policy registry',
'Block PII leakage to non-PII destinations',
'Require approval where rules dictate',
'Emit policy_checked events for the proof ledger',
],
allowedActions: ['evaluate_policies', 'block_batch', 'require_approval', 'emit_evidence'],
blockedActions: ['silent_pass', 'modify_policy_at_runtime'],
governanceLimits: ['All decisions are written to the Codex Kernel proof ledger', 'Cannot self-modify the policy registry'],
inputs: ['delivery.batch_v1', 'policy.registry_v1'],
outputs: ['policy.checked_v1', 'policy.block_v1'],
lutarAxisAffinity: 'P',
recentDecisionCount: 2_140,
recentBlockCount: 142,
approvalRate: 0.93,
avgConfidence: 0.97,
},
{
id: 'verity',
name: 'Verity',
mythosName: 'Hampi-Tika',
role: 'Validates delivery acknowledgements against expected schema and counts.',
responsibilities: [
'Verify destination acknowledgement payloads',
'Reconcile delivered vs. expected counts',
'Compute per-batch witness hashes',
'Promote batches to "settled" or open dispute records',
],
allowedActions: ['verify_ack', 'reconcile_counts', 'compute_witness_hash', 'open_dispute'],
blockedActions: ['mutate_destination', 'forge_witness'],
governanceLimits: ['Requires N=2 witness sources for high-severity destinations', 'Disputes block downstream Outcome learning until resolved'],
inputs: ['delivery.batch_v1', 'destination.ack_v1'],
outputs: ['delivery.settled_v1', 'delivery.disputed_v1'],
lutarAxisAffinity: 'C',
recentDecisionCount: 1788,
recentBlockCount: 24,
approvalRate: 0.99,
avgConfidence: 0.96,
},
{
id: 'forecaster',
name: 'Forecaster',
mythosName: 'Quilla-Riq',
role: 'Predicts metric outcomes and quantifies activation lift.',
responsibilities: [
'Forecast destination KPI delta from a sync (lift estimate)',
'Track prediction error per sync over time',
'Recommend sync cadence changes based on observed lift',
'Surface low-lift syncs for retirement review',
],
allowedActions: ['forecast_lift', 'compare_actual', 'recommend_cadence_change'],
blockedActions: ['kill_sync', 'edit_destination'],
governanceLimits: ['Recommendations are suggestions only — never auto-applied', 'Forecasts older than 7 days are ignored'],
inputs: ['delivery.settled_v1', 'destination.kpi_observed_v1'],
outputs: ['outcome.forecast_v1', 'outcome.actual_v1'],
lutarAxisAffinity: 'Φ',
recentDecisionCount: 312,
recentBlockCount: 0,
approvalRate: 1.0,
avgConfidence: 0.78,
},
{
id: 'fixer',
name: 'Fixer',
mythosName: 'Inti-Khipu',
role: 'Triages sync failures and proposes deterministic remediations.',
responsibilities: [
'Classify failure (auth, rate, schema, data quality, destination)',
'Propose a remediation playbook with confidence',
'Open approval requests for non-trivial fixes',
'File suppression rules for known false positives',
],
allowedActions: ['classify_failure', 'propose_remediation', 'request_approval', 'file_suppression_proposal'],
blockedActions: ['rotate_credentials', 'edit_destination_schema_directly'],
governanceLimits: ['Cannot auto-rotate credentials — only request rotation', 'Suppression proposals expire after 30 days'],
inputs: ['delivery.failure_v1', 'policy.block_v1'],
outputs: ['remediation.proposed_v1', 'suppression.proposed_v1'],
lutarAxisAffinity: 'K',
recentDecisionCount: 188,
recentBlockCount: 6,
approvalRate: 0.91,
avgConfidence: 0.84,
},
{
id: 'scribe',
name: 'Scribe',
mythosName: 'Quipu-Mayu',
role: 'Writes the proof ledger entries and replay-grade decision receipts.',
responsibilities: [
'Hash-chain every decision into the Codex Kernel ledger',
'Mint decision receipts on every settled / failed / blocked event',
'Produce evidence packs for downstream auditors',
'Maintain the Lutar Σ envelope per sync run',
],
allowedActions: ['emit_proof_entry', 'mint_receipt', 'build_evidence_pack', 'compute_lutar_sigma'],
blockedActions: ['delete_proof_entry', 'rewrite_chain'],
governanceLimits: ['The chain is append-only; even Scribe cannot delete', 'Receipts include a Mocked flag if any input was synthetic'],
inputs: ['*'],
outputs: ['proof.entry_v1', 'receipt.decision_v1', 'sigil.composition_v1'],
lutarAxisAffinity: 'C',
recentDecisionCount: 4_280,
recentBlockCount: 0,
approvalRate: 1.0,
avgConfidence: 1.0,
},
];
|