{
  "schema_version": "0.1",
  "paths": {
    "state_dir": ".prd_plugin/state",
    "local_dir": ".prd_plugin/local",
    "docs_dir": "docs",
    "registry_file": ".prd_plugin/ids/registry.json",
    "requests_file": ".prd_plugin/state/requests.json",
    "health_file": ".prd_plugin/state/health.json",
    "releases_file": ".prd_plugin/state/releases.json",
    "outbox_dir": ".prd_plugin/outbox",
    "inbox_dir": ".prd_plugin/inbox",
    "mailboxes_dir": ".prd_plugin/mailboxes",
    "automation_dir": ".prd_plugin/local/automation"
  },
  "plugin": {
    "installed_version": "0.16.62"
  },
  "configuration": {
    "active_profile": "custom",
    "custom_profiles": {}
  },
  "hooks": {
    "enabled": true,
    "nudge": {
      "enabled": true,
      "on_session_start": true,
      "on_user_prompt": true
    },
    "stop_guard": {
      "enabled": true
    },
    "session_report": {
      "enabled": true,
      "skill_usage_report": true
    },
    "drift_check": {
      "enabled": true
    },
    "reflection": {
      "enabled": true
    },
    "precommit_gate": {
      "enabled": true
    },
    "test_scope_guard": {
      "enabled": true
    },
    "skill_log": {
      "enabled": true
    },
    "archive_automation": {
      "enabled": true
    },
    "workflow": {
      "enabled": true,
      "on_session_start": true,
      "on_stop": true,
      "fail_closed": false
    }
  },
  "tracking": {
    "branching": {
      "enabled": true,
      "require_for_parallel_agents": true
    }
  },
  "workflows": {
    "enabled": true,
    "catalog_path": ".prd_plugin/workflows.json",
    "run_state_path": ".prd_plugin/state/workflow-runs.json",
    "enabled_ids": [
      "session.start",
      "session.stop",
      "request.intake",
      "request.import",
      "planning.requirements",
      "engineering.debug",
      "engineering.code-review",
      "engineering.verify",
      "evidence.record",
      "project.closeout",
      "project.maintenance",
      "install.update-check",
      "hub.release"
    ],
    "allow_custom_definitions": false,
    "allow_state_mutations": true,
    "max_attempts": 5,
    "max_output_chars": 50000,
    "judgment": {
      "executor": "ai-collab",
      "profile": "fast-capable",
      "require_source_refs": true,
      "fallback": "fail"
    }
  },
  "skills": {
    "repo_local_path": ".agents/skills",
    "opencode_target": ".opencode/skill",
    "claude_target": ".claude/skills",
    "install_scope_manifest": ".prd_plugin/templates/skill-install-scope.json",
    "install_repo_local_by_default": true,
    "install_opencode_by_default": true,
    "install_claude_by_default": true,
    "required_skills": [
      "project-architecture",
      "project-brainstorm",
      "project-change-request",
      "project-decision-ledger",
      "project-decision-policy",
      "project-deterministic-workflows",
      "project-document-branch",
      "project-evidence",
      "project-evidence-ledger",
      "project-health",
      "project-implementation-plan",
      "project-local-integration",
      "project-memory",
      "project-planning-lifecycle",
      "project-prd",
      "project-request-intake",
      "project-session-close",
      "project-systematic-debugging",
      "project-test-driven-implementation",
      "project-traceability-review",
      "project-traceability-sync",
      "project-verification-before-completion",
      "project-blocker-resolution",
      "project-git-workflow",
      "project-code-review",
      "project-llm-wiki"
    ]
  },
  "artifacts": {
    "planning": {
      "canonical_format": "json",
      "canonical_path_pattern": ".prd_plugin/state/artifacts/{artifact_type}/{artifact_id}.json",
      "markdown_as_source_of_truth": false,
      "dual_write_markdown": false,
      "markdown_exports": {
        "on_human_request_only": true,
        "export_path_pattern": "docs/exports/{artifact_type}/{artifact_id}.md",
        "template_dir": ".prd_plugin/templates/human-exports"
      }
    }
  },
  "script_installation": {
    "manifest": ".prd_plugin/templates/script-install-scope.json",
    "copy_scripts_by_default": false,
    "allow_explicit_install_scopes": [
      "downstream_runtime",
      "downstream_optional"
    ],
    "forbid_downstream_install_scopes": [
      "hub_runtime",
      "plugin_development"
    ]
  },
  "requests": {
    "upstream_hub_path": "D:\\Projects\\prd-plugin",
    "peers": {
      "ai-collab-v3": "D:\\Projects\\AI-Collab-v3"
    },
    "outside_agents_must_use_requests": true,
    "allow_direct_project_truth_edits": false,
    "implemented_requires_graduated_to": true,
    "prefer_thread_updates_for_existing_issues": true,
    "stale_after_days": 14,
    "allowed_types": [
      "feature",
      "bug",
      "compatibility",
      "docs",
      "method",
      "skill",
      "template",
      "health",
      "refactor",
      "question",
      "version_change"
    ],
    "allowed_severities": [
      "critical",
      "high",
      "medium",
      "low"
    ],
    "allowed_statuses": [
      "proposed",
      "in_review",
      "needs_info",
      "accepted",
      "rejected",
      "superseded",
      "implemented"
    ]
  },
  "memory": {
    "canonical_format": "json",
    "raw_session_gitignored": true,
    "promotion_requires_sources": true,
    "promotion_requires_agent_session": true,
    "allow_human_exports": true,
    "promotion_policy": "all",
    "selective_min_confidence": "high",
    "selective_min_evidence_count": 2,
    "weekly_gc_stale_after_days": 90
  },
  "health": {
    "stale_tracking_after_days": 14,
    "accepted_request_stale_after_days": 7,
    "fail_on_critical_findings": false
  },
  "ids": {
    "zero_pad": 3,
    "required_prefixes": [
      "BR-REQ",
      "BR-DEC",
      "BR-Q",
      "BR-RISK",
      "PRD-REQ",
      "PRD-NFR",
      "PRD-ACC",
      "ARCH-COMP",
      "ARCH-DEC",
      "ARCH-IF",
      "ARCH-RISK",
      "IMP-PHASE",
      "IMP-TASK",
      "IMP-VAL",
      "DEC",
      "EV",
      "AGENT",
      "SES",
      "MEM",
      "OBS",
      "TRK",
      "CHG",
      "REQ",
      "MSG",
      "HLT",
      "BLK",
      "DBR",
      "DBR-DELTA",
      "DBR-MERGE",
      "DBR-REG",
      "RFQ",
      "WFR"
    ]
  },
  "agents": {
    "require_agent_id": true,
    "require_session_id": true,
    "default_agent_label": "codex-main"
  },
  "reports": {
    "request_report_format": "markdown",
    "request_report_output": "request-report/request-report.md"
  },
  "privacy": {
    "repo_scope": "upstream",
    "upstream_hub": "prd-plugin",
    "cross_repo_request_visibility": false,
    "cross_repo_message_visibility": false,
    "allow_explicit_upstream_submission": true,
    "upstream_submissions_must_be_sanitized": true,
    "use_scoped_mailboxes": true,
    "exclude_local_state_from_indexing": true
  },
  "automation": {
    "request_check_name": "request-check",
    "lock_required": true,
    "queue_pending_ticks": true,
    "stale_after_seconds": 900,
    "default_mode": "risk_based_triage",
    "archive_completed_sessions": true,
    "archive_requires_known_automation": true,
    "autonomy_level": "autonomous",
    "autonomy_levels": {
      "autonomous": "Decide everything in the discretionary middle; stop only for real blockers (the floor in project-blocker-resolution).",
      "key_decision": "Decide routine, reversible, low-impact work; stop for key decisions (architecture/design, scope changes, anything irreversible or outward-facing, high severity/risk) plus the floor.",
      "guided": "Confirm most non-trivial decisions; auto-decide only the unambiguous, trivial, or read-only, plus the floor."
    },
    "graph_auto_refresh": false,
    "autonomous_run_until_done": true,
    "key_decision_continue_guard": true,
    "autonomous_continue_cap": 25,
    "stop_guard_goal_max_age_days": 2,
    "precommit_gate": true,
    "version_check": {
      "enabled": true,
      "ttl_hours": 1,
      "package": "prd-plugin"
    }
  },
  "release": {
    "require_version_bump_for_plugin_changes": true,
    "require_companion_artifacts_for_skill_changes": true,
    "gap_audit_required_before_version_bump": true,
    "upgrade_review_required_for_medium_risk": true,
    "version_file": ".codex-plugin/plugin.json",
    "version_file_candidates": [
      ".codex-plugin/plugin.json",
      ".opencode/plugin.json",
      ".claude-plugin/plugin.json"
    ],
    "companion_artifact_paths": [
      "README.md",
      "docs/",
      "templates/"
    ]
  },
  "drift": {
    "monitoring": {
      "enabled": true,
      "validators": [
        "state_consistency_check",
        "prd_doctor",
        "release_check",
        "gap_audit",
        "request_report",
        "prd_gate",
        "prd_self_audit",
        "prd_graph",
        "staleness_audit",
        "wiki_drift",
        "ingest_manual_drift",
        "fork_drift"
      ],
      "weights": {
        "state_consistency_check": 1,
        "prd_doctor": 1,
        "release_check": 1,
        "gap_audit": 1,
        "request_report": 1
      },
      "on_stop": true,
      "on_stop_validators": [
        "state_consistency_check",
        "staleness_audit",
        "prd_self_audit",
        "prd_graph",
        "wiki_drift",
        "ingest_manual_drift",
        "fork_drift"
      ],
      "export": {
        "enabled": true,
        "path": ".prd_plugin/drift/events.jsonl"
      }
    }
  },
  "integrations": {
    "substrate": {
      "enabled": false,
      "mode": "off",
      "capabilities": [
        "records",
        "graph",
        "events"
      ],
      "contract_version": 2,
      "require_source_refs": true,
      "endpoint": "http://127.0.0.1:47124",
      "manual_url": "http://127.0.0.1:47124/utcp.json",
      "knowledge_browse_url": "http://127.0.0.1:5276",
      "auth_env": "AI_COLLAB_API_KEY",
      "timeout_seconds": 5,
      "max_result_bytes": 1048576,
      "cache_ttl_seconds": 60,
      "fallback": "local",
      "automation": {
        "discovery_on_session_start": true,
        "knowledge_recall": true,
        "memory_recall": true,
        "context_enrichment": true,
        "notices_on_session_start": false,
        "goals_sync": false,
        "telemetry_on_maintenance": false,
        "reporting_dispatch": true,
        "judgment_dispatch": true,
        "verification_execution": true
      }
    }
  },
  "verification": {
    "test_scope": {
      "enabled": true,
      "executor": "ai-collab",
      "neighbor_limit": 12,
      "max_changed_files": 25,
      "fallback": "full",
      "full_suite_triggers": [
        "release",
        "core_change",
        "impact_unavailable",
        "impact_degraded",
        "unmapped_change"
      ],
      "core_paths": [
        "package.json",
        "package-lock.json",
        "pyproject.toml",
        "Cargo.toml",
        "go.mod",
        ".github/workflows/**"
      ],
      "test_patterns": [
        "tests/**",
        "test/**",
        "spec/**",
        "**/*.test.*",
        "**/*.spec.*",
        "test_*.py",
        "*_test.py",
        "*_test.go",
        "**/test_*.py",
        "**/*_test.py",
        "**/*_test.go"
      ],
      "max_selected_tests": 200,
      "execution_timeout_seconds": 600,
      "focused_commands": [],
      "full_commands": [],
      "allowed_executables": [
        "python",
        "python3",
        "py",
        "pytest",
        "npm",
        "npx",
        "node",
        "go",
        "cargo",
        "dotnet",
        "mvn",
        "gradle",
        "gradlew",
        "make"
      ]
    }
  },
  "reporting": {
    "delegation": {
      "enabled": false,
      "executor": "ai-collab",
      "contract_version": 1,
      "profile": "fast-capable",
      "tasks": [
        "report_summary",
        "session_summary",
        "wiki_synthesis",
        "triage_draft"
      ],
      "fallback": "main",
      "require_source_refs": true,
      "max_input_tokens": 12000,
      "max_output_tokens": 1500,
      "timeout_seconds": 30
    }
  },
  "reflection": {
    "enabled": true,
    "on_stop": true,
    "max_questions_per_stop": 5,
    "categories": [
      {
        "id": "behaviour_quality",
        "name": "Behaviour quality",
        "enabled": true,
        "questions": [
          {
            "id": "RFQ-001",
            "text": "Based on the work you just carried out, would you classify your behaviour as good? Answer yes or no and cite observable evidence.",
            "enabled": true
          },
          {
            "id": "RFQ-002",
            "text": "If you answered no, what could you do differently to correct your behaviour?",
            "enabled": true
          },
          {
            "id": "RFQ-003",
            "text": "Would another attempt using the identified good behaviours materially improve the outcome? Answer yes or no and state the next corrective action if yes.",
            "enabled": true
          }
        ]
      },
      {
        "id": "harness_friction",
        "name": "Harness friction",
        "enabled": true,
        "questions": [
          {
            "id": "RFQ-004",
            "text": "What harness friction points made this work more difficult?",
            "enabled": true
          },
          {
            "id": "RFQ-005",
            "text": "What up to three changes would most improve friction in the harness?",
            "enabled": true
          }
        ]
      }
    ]
  },
  "knowledge": {
    "llm_wiki": {
      "enabled": true,
      "wiki_dir": "wiki",
      "raw_dir": "raw",
      "require_inline_md_links": true
    }
  },
  "reasoning_guard": {
    "mode": "report",
    "backfill": {
      "mode": "recent",
      "limit": 20
    },
    "categories": {
      "evidence_follow_through": "inherit",
      "causal_claims": "inherit",
      "permanent_mutations": "inherit",
      "completion_claims": "inherit"
    }
  },
  "journal": {
    "schema_version": 1,
    "enabled": true,
    "capture": {
      "automatic": true
    },
    "reflections": {
      "enabled": false
    },
    "prompt_recall": {
      "enabled": true
    },
    "retention": {
      "mode": "archive-only"
    },
    "security": {
      "protected_read_audit": true
    }
  },
  "fork": {
    "version_check": {
      "enabled": false,
      "source_url": "",
      "version_field": "fork_version",
      "local_marker": "FORK-VERSION",
      "ttl_hours": 6
    }
  },
  "fabric": {
    "model_profiles": {},
    "default_when_unmapped": "raw",
    "binding_requires_evidence": true
  }
}
