amaru-source / web /src /data /fabric /agents.ts
betterwithage's picture
mirror github.com/szl-holdings/amaru@779a0d7e4e69
a8b4b87 verified
// 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,
},
];