# Goal Maker v2 state.yaml
# Board truth lives here. goal.md is the editable charter; notes/ holds long receipts only.

version: 2

goal:
  title: "<Goal title>"
  slug: "<goal-slug>"
  kind: open_ended # specific | open_ended | existing_plan | recovery | audit
  tranche: "<continuous execution: complete successive safe verified slices until the full original outcome is complete>"
  status: active # active | blocked | done
  intake:
    original_request: "<shortest faithful user request>"
    interpreted_outcome: "<one sentence>"
    input_shape: vague # vague | specific | existing_plan | recovery | audit
    audience: unknown
    authority: requested # requested | approved | inferred | needs_approval | blocked
    proof_type: artifact # test | demo | artifact | metric | review | source_backed_answer | decision
    completion_proof: "<observable signal that proves the full original outcome is complete>"
    likely_misfire: "<how Goal Maker could succeed at the wrong thing>"
    blind_spots_considered: []
    existing_plan_facts: []

rules:
  pm_owns_state: true
  one_active_task: true
  max_write_workers: 1
  no_implementation_without_worker_or_pm_task: true
  no_completion_without_judge_or_pm_audit: true
  planning_is_not_completion: true
  queued_required_worker_blocks_completion: true
  continuous_until_full_outcome: true
  missing_input_or_credentials_do_not_stop_goal: true
  preserve_and_validate_existing_plan: true
  intake_misfire_must_be_audited: true

agents:
  scout: installed
  worker: installed
  judge: installed

active_task: T001

tasks:
  - id: T001
    type: scout
    assignee: Scout
    status: active
    reasoning_hint: default # default | low | medium | high | xhigh
    objective: "Map repo purpose, architecture, verification commands, health signals, and improvement candidates."
    inputs:
      - README.md
      - package.json
      - docs
      - tests
    constraints:
      - "Read-only."
      - "Do not edit implementation files."
      - "Prefer concrete file-path evidence over generic advice."
    expected_output:
      - "Repo map"
      - "Verification commands"
      - "Ranked improvement candidates"
      - "Candidate next tasks"
    receipt: null
  - id: T002
    type: judge
    assignee: Judge
    status: queued
    reasoning_hint: default
    objective: "Review Scout findings and choose the first safe implementation task."
    inputs:
      - "T001 receipt"
    constraints:
      - "Do not implement."
      - "Pick small reviewable work."
    expected_output:
      - "Decision"
      - "Exact Worker objective"
      - "allowed_files"
      - "verify"
      - "stop_if"
      - "Blocked or deferred tasks"
    receipt: null
  - id: T003
    type: worker
    assignee: Worker
    status: queued
    reasoning_hint: default
    objective: "Execute the first safe implementation task selected by Judge."
    allowed_files: []
    verify: []
    stop_if:
      - "Need files outside allowed_files."
      - "Behavior is ambiguous."
      - "Verification fails twice."
    receipt: null
  - id: T999
    type: judge
    assignee: Judge
    status: queued
    reasoning_hint: default
    objective: "Audit whether the implemented slice satisfies the original user outcome for this tranche."
    inputs:
      - "All done task receipts"
      - "Last verification"
      - "Current dirty diff"
    constraints:
      - "Do not implement."
      - "Reject completion if required Worker work is still queued or active."
      - "Reject completion if the broader original outcome still has safe local follow-up slices."
      - "Reject stopping only because a slice needs owner input, credentials, production access, destructive operations, or policy decisions."
    expected_output:
      - "complete | not_complete"
      - "full_outcome_complete: true | false"
      - "missing evidence"
      - "next task if not complete"
    receipt: null

checks:
  dirty_fingerprint: unknown
  last_verification:
    result: unknown
    task: null
    commands: []
