{
  "schema_version": "0.1",
  "brainstorm_id": "BR-2026-07-14-deterministic-workflow-engine",
  "title": "Deterministic execution with validated LLM judgment overlays",
  "created_at": "2026-07-14",
  "author_agent": "AGENT-001",
  "source_session": "SES-001",
  "status": "approved",
  "context": "PRD Plugin already has deterministic state, configuration, validation, reporting-bundle, verification-plan, and hook components, but the host LLM still performs orchestration, bookkeeping, sequencing, and completion mechanics repeatedly. The owner requires a complete configurable workflow engine that deterministically executes everything with a bounded contract and invokes an LLM only at explicit judgment boundaries.",
  "goals": [
    {"id": "BR-REQ-009", "summary": "Move every bounded mechanical, policy, validation, state, evidence, execution, and lifecycle operation into a deterministic runtime."},
    {"id": "BR-REQ-010", "summary": "Represent remaining LLM work as explicit source-backed judgment requests whose results are schema-validated before use."},
    {"id": "BR-REQ-011", "summary": "Make workflows declarative, configurable, inspectable, dry-runnable, resumable, idempotent, and auditable."},
    {"id": "BR-REQ-012", "summary": "Integrate the engine across session hooks, requests, planning, debugging, review, verification, closeout, installation, maintenance, and releases."},
    {"id": "BR-REQ-013", "summary": "Guarantee sound outcomes: completed means all declared postconditions passed; every other outcome is explicit and never a false success."},
    {"id": "BR-REQ-014", "summary": "Ship the complete authority through config, CLI, MCP, UTCP, AI-Collab contracts, host skills, templates, installer migration, documentation, and release."}
  ],
  "non_goals": [
    "Claim that filesystems, Git, networks, model providers, or registries can never fail.",
    "Replace product, architecture, debugging, review, or user-intent judgment with brittle rules.",
    "Permit arbitrary untrusted shell execution or let an LLM mutate canonical project state directly.",
    "Create a second configuration authority or a second state/ID system."
  ],
  "decisions": [
    {"id": "BR-DEC-007", "summary": "Use versioned declarative workflow definitions interpreted by one deterministic state machine."},
    {"id": "BR-DEC-008", "summary": "Use an allowlisted action registry; workflow JSON may select registered capabilities but cannot inject code."},
    {"id": "BR-DEC-009", "summary": "Judgment steps pause runs and emit immutable source bundles; an external executor returns a validated result before deterministic continuation."},
    {"id": "BR-DEC-010", "summary": "Define the guarantee as correct completion or explicit failure for validated inputs, never universal availability or silent fallback success."}
  ],
  "open_questions": [],
  "risks": [
    {"id": "BR-RISK-007", "summary": "A workflow claims determinism while hiding LLM judgment in an action.", "mitigation": "Action metadata declares determinism class and audit rejects undeclared or mismatched steps."},
    {"id": "BR-RISK-008", "summary": "Retrying a write duplicates state or side effects.", "mitigation": "Idempotency keys, action receipts, locks, and resume-from-checkpoint semantics."},
    {"id": "BR-RISK-009", "summary": "A custom workflow gains arbitrary execution authority.", "mitigation": "Custom definitions are disabled by default and all actions remain allowlisted with mutation policy."},
    {"id": "BR-RISK-010", "summary": "A judgment result fabricates sources or writes project truth.", "mitigation": "Exact source allowlists, strict schemas, no-write contracts, and deterministic follow-up mutations through MCP."},
    {"id": "BR-RISK-011", "summary": "Existing skills/hooks and the new engine become competing authorities.", "mitigation": "Route shipped workflows through the engine and define skills as judgment guidance over its contracts."},
    {"id": "BR-RISK-012", "summary": "External execution failure is mistaken for workflow success.", "mitigation": "Explicit external status, bounded retries, receipts, required postconditions, and fail-closed completion."}
  ],
  "candidate_tracking_updates": ["TRK-101", "TRK-102", "TRK-103", "TRK-104", "TRK-105"],
  "source_request_id": "REQ-096",
  "next_recommended_artifact": "PRD-008"
}
