name: amend_charter
description: "OPERATOR-ONLY -- Valerius drafts a formal constitutional amendment to the Crimson Leaf master charter. Adjudicated at 98. Operator must manually apply the approved amendment to charter.md."
debug: true
system: agent_prompt

agent_prompt:
  - "= identity.md"

skills:
  - guides/CorporateCharterGuide.md

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

steps:
  - type: think
    hint: |
      You are {agent.name}, Chief Governance Officer of Crimson Leaf LLC.

      This is a constitutional act. You are drafting an amendment to the master charter --
      the foundational law of the entire Organization. This document governs every agent,
      every Tenant, and every Genesis action. It cannot be changed casually.

      IMPORTANT: You are producing a PROPOSAL only. No amendment takes effect until the
      Operator reviews, approves, and manually commits it to charter.md. Your role is to
      draft the amendment in strict constitutional form and subject it to the ?12 test.

      The operator has requested this amendment. Their exact request is in the MESSAGE section.

      Apply the ?12 Amendment Standard -- ALL FOUR criteria must be satisfied:

      1. IDENTITY PRESERVATION
         Does this amendment preserve Crimson Leaf's identity as the Genesis Node and holding company?
         Would any aspect of this amendment cause Crimson Leaf to drift toward becoming an
         operating company, service provider, or execution entity?
         PASS or FAIL -- explain specifically.

      2. ANTI-SPRAWL TEST
         Does this amendment avoid reintroducing operational sprawl?
         Does it add vague or expansive powers that could be abused?
         Does it weaken any existing constraint without replacing it with an equal or stronger one?
         PASS or FAIL -- explain specifically.

      3. CONSTITUTIONAL CLARITY TEST
         Does this amendment strengthen constitutional clarity?
         Is the new or revised language more precise, enforceable, and unambiguous than what it replaces?
         Would the adjudicator be able to evaluate compliance against the amended text?
         PASS or FAIL -- explain specifically.

      4. ELEVATED GOVERNANCE REVIEW
         Is this amendment being proposed through the proper constitutional path?
         Is it being triggered by the Operator (the only authorized party to amend the master charter)?
         PASS or FAIL -- explain specifically.

      If ANY of the four criteria FAIL, the amendment must be rejected or redesigned.
      A failing amendment that still gets packaged will be rejected at 98% adjudication threshold.

      If all four criteria PASS, draft the complete amended charter section(s):
      - State exactly which section(s) are being amended (by number and title)
      - Show the CURRENT text being replaced (quote it exactly)
      - Show the PROPOSED replacement text
      - State the constitutional rationale in one precise paragraph
      - State what risk or gap this amendment corrects

  - type: document
    filename: charter_amendment

  - type: package
    packet_type: CharterAmendmentProposal
    hint: |
      Serialize the amendment proposal. This is the formal constitutional record.
      Do not summarize or abbreviate -- every field must be complete.
      The operator will use this output to manually apply the change to charter.md.
    schema:
      actions:
        - type: quick
          amendment_title: "string -- short title for this amendment (e.g. 'Add ?13 Emergency Governance Path')"
          sections_affected: ["string -- section numbers and titles being amended or added"]
          identity_preservation: "string -- PASS or FAIL with explanation"
          anti_sprawl_test: "string -- PASS or FAIL with explanation"
          constitutional_clarity: "string -- PASS or FAIL with explanation"
          elevated_governance: "string -- PASS or FAIL with explanation"
          overall_verdict: "string -- APPROVED_FOR_OPERATOR_REVIEW | REJECTED"
          current_text: "string -- exact text being replaced (quote from charter.md)"
          proposed_text: "string -- complete replacement or addition text in markdown"
          constitutional_rationale: "string -- one paragraph explaining why this amendment is justified"
          risk_corrected: "string -- what specific risk or gap this addresses"
          operator_action_required: "string -- exact steps the operator must take to apply this amendment"

  - type: close
    rag_update: true

adjudication:
  enabled: true
  pass_threshold: 98
  deliverable_type: coordination
  criteria:
    identity_preservation:
      weight: 30
      description: "Amendment preserves CL identity as Genesis Node and holding company -- does NOT expand it toward execution or service provision"
    anti_sprawl:
      weight: 25
      description: "Amendment tightens constraints or maintains them -- does not weaken existing governance boundaries"
    constitutional_clarity:
      weight: 25
      description: "New language is more precise and adjudicable than what it replaces -- no vague expansions"
    proper_authority:
      weight: 20
      description: "Amendment is being proposed through the operator-controlled path only -- agents cannot self-authorize charter changes"
