name: charter_audit
description: "Valerius audits an existing Tenant charter for constitutional drift, boundary violations, and governance decay."
debug: true
system: agent_prompt

agent_prompt:
  - "= identity.md"

sections:
  - agent
  - project
  - rag
  - roster
  - deliverables
  - message
  - instructions

steps:
  - type: think
    hint: |
      You are {agent.name}, Chief Governance Officer. Your mandate is constitutional integrity.

      A charter is not a suggestion -- it is a binding contract between the Tenant and the portfolio.
      Drift is not evolution. It is failure.

      Audit the Tenant charter against these six governance tests:

      1. BOUNDARY INTEGRITY
         Are the service boundaries still narrow and black-box?
         Has scope crept beyond the founding charter language?

      2. RECURSION CHECK
         Does this Tenant now depend on outputs it is supposed to produce?
         Does any clause create a circular dependency with another Tenant?

      3. FORBIDDEN ACTIVITIES ENFORCEMENT
         Are the forbidden activities still explicit, current, and enforced?
         Has any forbidden activity become de-facto standard practice?

      4. NON-GOAL COMPLIANCE
         Are the non-goals still respected?
         Has the Tenant been tasked with anything outside its mandate?

      5. PORTFOLIO COHERENCE
         Does this Tenant still occupy a unique niche in the portfolio?
         Has another Tenant's scope expanded to overlap with this one?

      6. CONSTITUTIONAL ALIGNMENT
         Does the charter language align with Crimson Leaf's foundational principles?
         Is capital stewardship discipline still embedded in the mandate?

      For each test: PASS, FLAG, or FAIL. A single FAIL is sufficient to trigger remediation.
      Do not soften findings. Constitutional drift kills portfolios.

  - type: package
    packet_type: CharterAuditResult
    hint: |
      Serialize the audit findings. Do not introduce new reasoning -- only what was established above.
    schema:
      actions:
        - type: quick
          summary: "string -- one-sentence overall verdict"
          overall_verdict: "string -- PASS | FLAG | FAIL"
          boundary_integrity: "string -- PASS | FLAG | FAIL"
          recursion_check: "string -- PASS | FLAG | FAIL"
          forbidden_activities: "string -- PASS | FLAG | FAIL"
          non_goal_compliance: "string -- PASS | FLAG | FAIL"
          portfolio_coherence: "string -- PASS | FLAG | FAIL"
          constitutional_alignment: "string -- PASS | FLAG | FAIL"
          violations: ["string -- description of each finding that is FLAG or FAIL"]
          remediation_required: "boolean"
          remediation_actions: ["string -- specific corrective actions if remediation_required is true"]

  - type: close
    rag_update: true

adjudication:
  enabled: true
  pass_threshold: 85
  deliverable_type: coordination
  criteria:
    audit_rigor:
      weight: 40
      description: "All six governance tests are applied with constitutional precision, not narrative approximation"
    finding_specificity:
      weight: 30
      description: "Violations and remediation actions are concrete and actionable, not vague"
    constitutional_grounding:
      weight: 30
      description: "Findings are anchored to charter language and Crimson Leaf founding principles"
