# Custom application policy — NOT an Amazon Bedrock AgentCore schema
# and NOT a Strands harness configuration file.
#
# A path, a dollar figure, or an approval name in this file does nothing
# until some other control enforces it. See enforcement-map.md.
#
# Checked against public docs on 11 October 2026. Limits below that match
# AgentCore Harness (maxIterations 75, timeoutSeconds 3600, and so on)
# are service defaults you set on InvokeHarness or the CLI. They are
# listed here so a reviewer can see the intended ceiling. This YAML does
# not push them.

schema: factualminds.application-harness-policy/v1
enforcement: application-code

task:
  id: codemod-retry-copy
  objective: Update the retry message in src/utils/retry.ts and keep the existing tests green.
  success:
    - unit tests for retry.ts pass
    - typecheck passes
    - the diff touches only the allowed paths
  prohibited:
    - git push
    - opening a pull request
    - adding or upgrading a dependency
    - editing CI workflows
  preconditions:
    - clean git status recorded before the first edit
  evidence_before_complete:
    - command transcripts for the required checks
    - final diff
    - run record with model id, iterations, token counts, and outcome

scope:
  allowed_paths:
    - src/utils/retry.ts
    - src/utils/retry.test.ts
  allowed_commands:
    - git status
    - git diff
    - pnpm exec vitest run src/utils/retry.test.ts
    - pnpm exec tsc --noEmit --pretty false

iterations:
  # Application counter. Stop the loop in code when this is reached.
  max_iterations: 8
  deadline_seconds: 900

cost:
  # Telemetry only inside this file. Pair it with a hard stop you actually have:
  # AgentCore maxTokens / maxIterations / timeoutSeconds, or an application
  # counter that refuses the next model call. AWS Budgets and a CloudWatch
  # alarm are not an instantaneous cap.
  record_input_tokens: true
  record_output_tokens: true
  record_tool_latency: true
  stop_after_model_calls: 12

retries:
  max_attempts: 2
  # If mutated_remote_state is unknown, reconcile. Do not send the write again.
  require_reconcile_when_outcome_unknown: true

data:
  redact_secrets_in_traces: true
  persist_raw_prompts: false
  customer_payloads: minimize

approvals:
  required_operations:
    - git_push
    - deploy
    - add_dependency
    - refund
    - cancel_order
    - adjust_inventory
    - disclose_pii
  # The model must not mint this id. A human workflow writes it.
  approval_id_source: human-workflow

verification:
  independent_of_model: true
  required_checks:
    - unit
    - typecheck
  agent_self_approval_counts: false
