{
  "openapi": "3.1.0",
  "info": {
    "title": "FCOS ChatGPT Actions API",
    "version": "2.0.0",
    "description": "FCOS Builder action intake surface. The canonical GPT action schema URL is https://api.fcosthinktank.uk/fcos/builder/action-openapi. Use /fcos/menu to discover the live FCOS menu surface and /fcos/menu/system to inspect operation parameters before calling /fcos/execute. For the FCOS Master GPT Actions privacy notice use https://www.fcosthinktank.site/products/legal/fcos-gpt-actions-privacy.html. Use /fcos/direct-apply for exact code changes where explicitly supported."
  },
  "servers": [
    {
      "url": "https://api.fcosthinktank.uk"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "API health check",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/fcos/menu": {
      "get": {
        "operationId": "listFcosMenus",
        "summary": "List all 8 FCOS system menus (synapse, sprint, builder-main, builder-v2, codex, system, founder, notion). Each menu has operations you execute via /fcos/execute.",
        "responses": {
          "200": {
            "description": "Menu index with system keys, display names, descriptions, and operation counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "totalSystems": {
                      "type": "integer"
                    },
                    "totalOperations": {
                      "type": "integer"
                    },
                    "systems": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "systemKey": {
                            "type": "string"
                          },
                          "displayName": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "operationCount": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/fcos/menu/system": {
      "get": {
        "operationId": "getFcosMenu",
        "summary": "Get a specific system menu with all its operations, parameters, and descriptions. Use systemKey from /fcos/menu (e.g. synapse, builder-main, codex, founder, system, builder-v2, notion).",
        "parameters": [
          {
            "name": "systemKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "System key: builder-main, builder-v2, codex, system, founder, synapse, notion"
          }
        ],
        "responses": {
          "200": {
            "description": "Menu with operations array. Each operation has operationKey, method, path, summary, and parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "systemKey": {
                      "type": "string"
                    },
                    "displayName": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "operations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "operationKey": {
                            "type": "string"
                          },
                          "method": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "parameters": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string"
                                },
                                "in": {
                                  "type": "string"
                                },
                                "required": {
                                  "type": "boolean"
                                },
                                "description": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/fcos/menu/frontend-schema-intelligence": {
      "get": {
        "operationId": "getFcosMenuFrontendSchemaIntelligence",
        "summary": "Get the live FCOS frontend menu schema intelligence: how menus should be grouped, when they should split, what should be bunched together, and where schema metadata is missing.",
        "responses": {
          "200": {
            "description": "Frontend schema intelligence for FCOS menus"
          }
        }
      }
    },
    "/fcos/menu/frontend-action-plan": {
      "get": {
        "operationId": "getFcosMenuFrontendActionPlan",
        "summary": "Get the FCOS frontend action plan that turns menu schema intelligence into scale buckets, split and merge priorities, and next actions for ChatGPT-facing planning.",
        "responses": {
          "200": {
            "description": "Frontend action plan for FCOS menus"
          }
        }
      }
    },
    "/fcos/build/playwright-readiness": {
      "get": {
        "operationId": "getFcosBuildPlaywrightReadiness",
        "summary": "Check whether Playwright-backed frontend proof is actually available. Returns runtime readiness, sandbox-vs-host verification state, blocked proof surfaces, and repair commands.",
        "parameters": [
          {
            "name": "refresh",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Playwright readiness and host verification status"
          }
        }
      }
    },
    "/fcos/build/proofing-plan": {
      "post": {
        "operationId": "getFcosBuildProofingPlan",
        "summary": "Generate the exact proof and verification sequence ChatGPT should follow for a coding job, including Builder Main checks, frontend proof packs, final proof gate choice, and completion sync.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "objective"
                ],
                "properties": {
                  "objective": {
                    "type": "string"
                  },
                  "changedFiles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "projectKey": {
                    "type": "string"
                  },
                  "requestedByRole": {
                    "type": "string"
                  },
                  "targetUrl": {
                    "type": "string"
                  },
                  "previewBaseUrl": {
                    "type": "string"
                  },
                  "surfaceType": {
                    "type": "string",
                    "enum": [
                      "website",
                      "landing_page",
                      "html_app",
                      "template",
                      "pwa_app"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task-specific proofing plan for a coding job"
          }
        }
      }
    },
    "/fcos/build/proofing-plan/launch": {
      "post": {
        "operationId": "launchFcosBuildProofingPlan",
        "summary": "Bridge proof planning directly into governed execution. Creates the operator session and launches it from the same proof contract so ChatGPT does not have to rebuild the payloads itself.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "objective"
                ],
                "properties": {
                  "objective": {
                    "type": "string"
                  },
                  "changedFiles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "projectKey": {
                    "type": "string"
                  },
                  "requestedByRole": {
                    "type": "string"
                  },
                  "targetUrl": {
                    "type": "string"
                  },
                  "previewBaseUrl": {
                    "type": "string"
                  },
                  "dryRun": {
                    "type": "boolean"
                  },
                  "surfaceType": {
                    "type": "string",
                    "enum": [
                      "website",
                      "landing_page",
                      "html_app",
                      "template",
                      "pwa_app"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Proofing-plan launch result with planning contract, operator session, and launch outcome"
          }
        }
      }
    },
    "/fcos/engine/upgrade-queue": {
      "get": {
        "operationId": "getEngineUpgradeQueue",
        "summary": "Get the prioritized engine upgrade queue that merges template upgrade plans, frontend action-plan splits, and audit scale buckets into the most actionable next steps.",
        "responses": {
          "200": {
            "description": "Engine upgrade queue with plan metadata and recommended actions"
          }
        }
      }
    },
    "/fcos/templates/upgrade-plan": {
      "get": {
        "operationId": "getTemplateUpgradePlan",
        "summary": "Return the ranked template upgrade actions including placeholder fixes, scores, and recommended seed packs.",
        "responses": {
          "200": {
            "description": "Template upgrade plan payload"
          }
        }
      }
    },
    "/fcos/templates/seed-inject": {
      "post": {
        "operationId": "postTemplateSeedInject",
        "summary": "Inject the recommended seed pack values into a template file by replacing {{placeholders}}.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "templateKey",
                  "filePath"
                ],
                "properties": {
                  "templateKey": {
                    "type": "string"
                  },
                  "filePath": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Injection result with replaced placeholders"
          }
        }
      }
    },
    "/fcos/templates/gallery-watchdog": {
      "get": {
        "operationId": "getTemplateGalleryWatchdog",
        "summary": "Check whether a template meets gallery standards (placeholders, score, screenshot history) and return recommended fixes.",
        "parameters": [
          {
            "name": "templateKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Template key to verify"
          }
        ],
        "responses": {
          "200": {
            "description": "Gallery readiness report"
          }
        }
      }
    },
    "/fcos/templates/health-telemetry": {
      "get": {
        "operationId": "getTemplateHealthTelemetry",
        "summary": "Summarize template health across the registry: gallery-ready ratio, failure counts, and recent screenshot failures.",
        "responses": {
          "200": {
            "description": "Template health telemetry payload"
          }
        }
      }
    },
    "/fcos/templates/failure-insights": {
      "get": {
        "operationId": "getTemplateFailureInsights",
        "summary": "Return the recorded template failure insights, including historical screenshot/placeholder issues and counts.",
        "responses": {
          "200": {
            "description": "Template failure insights payload"
          }
        }
      }
    },
    "/fcos/templates/failure-dashboard": {
      "get": {
        "operationId": "getTemplateFailureDashboard",
        "summary": "Dashboard-ready summary of failure counts, high-severity totals, and worst templates.",
        "responses": {
          "200": {
            "description": "Template failure dashboard"
          }
        }
      }
    },
    "/fcos/templates/failure-summary": {
      "get": {
        "operationId": "getTemplateFailureSummary",
        "summary": "Human-friendly summary sentence describing total failures, high severity counts, and recent incidents.",
        "responses": {
          "200": {
            "description": "Template failure summary"
          }
        }
      }
    },
    "/fcos/templates/screenshot-verify": {
      "post": {
        "operationId": "postTemplateScreenshotVerify",
        "summary": "Run the Playwright-driven screenshot verification for a template and record any failures.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "templateKey"
                ],
                "properties": {
                  "templateKey": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Screenshot verification success report"
          },
          "422": {
            "description": "Screenshot verification failed; failure logged"
          }
        }
      }
    },
    "/fcos/build/operator-session": {
      "post": {
        "operationId": "createFcosBuildOperatorSession",
        "summary": "Create a persisted FCOS coding operator session that binds routing, context, coding lane, proof gates, and completion sync into one founder-facing contract.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "objective"
                ],
                "properties": {
                  "objective": {
                    "type": "string"
                  },
                  "projectKey": {
                    "type": "string"
                  },
                  "requestedByRole": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persisted operator session with execution, proof, and sync plans"
          }
        }
      }
    },
    "/fcos/build/operator-session/launch": {
      "post": {
        "operationId": "launchFcosBuildOperatorSession",
        "summary": "Launch or preview a persisted FCOS coding operator session through the governed Build lane.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sessionId"
                ],
                "properties": {
                  "sessionId": {
                    "type": "string"
                  },
                  "dryRun": {
                    "type": "boolean"
                  },
                  "requestedByRole": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operator session launch result"
          }
        }
      }
    },
    "/fcos/build/operator-session/by-id": {
      "get": {
        "operationId": "getFcosBuildOperatorSessionById",
        "summary": "Read a persisted FCOS coding operator session by sessionId.",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Persisted operator session"
          }
        }
      }
    },
    "/fcos/build/frontend-ship-pack": {
      "post": {
        "operationId": "getFcosBuildFrontendShipPack",
        "summary": "Run the FCOS frontend ship pack for an HTML app, website, landing page, template, or PWA. Captures desktop/mobile screenshots, console health, failed requests, PWA signals, and template polish scoring.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targetUrl"
                ],
                "properties": {
                  "targetUrl": {
                    "type": "string"
                  },
                  "surfaceType": {
                    "type": "string",
                    "enum": [
                      "website",
                      "landing_page",
                      "html_app",
                      "template",
                      "pwa_app"
                    ]
                  },
                  "auditLabel": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Frontend ship pack browser proof and polish verdict"
          }
        }
      }
    },
    "/fcos/build/frontend-regression-pack": {
      "post": {
        "operationId": "getFcosBuildFrontendRegressionPack",
        "summary": "Resolve the best preview URL from changed frontend files, run the ship pack, compare screenshots against a stored baseline, and report regressions before shipping.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "changedFiles"
                ],
                "properties": {
                  "changedFiles": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "targetUrl": {
                    "type": "string"
                  },
                  "previewBaseUrl": {
                    "type": "string"
                  },
                  "surfaceType": {
                    "type": "string",
                    "enum": [
                      "website",
                      "landing_page",
                      "html_app",
                      "template",
                      "pwa_app"
                    ]
                  },
                  "auditLabel": {
                    "type": "string"
                  },
                  "selector": {
                    "type": "string"
                  },
                  "baselineKey": {
                    "type": "string"
                  },
                  "promoteBaseline": {
                    "type": "boolean"
                  },
                  "regressionThresholdRatio": {
                    "type": "number"
                  },
                  "maxResolvedTargets": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Frontend regression proof, baseline diff, and final ship verdict"
          }
        }
      }
    },
    "/fcos/execute": {
      "post": {
        "operationId": "executeFcosOperation",
        "summary": "Execute any operation from any menu. Pass systemKey + operationKey + parameters. Parameters can be flat top-level keys (preferred) or nested under 'parameters'. The router handles query vs body routing automatically.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "systemKey",
                  "operationKey"
                ],
                "properties": {
                  "systemKey": {
                    "type": "string",
                    "description": "System menu key from /fcos/menu."
                  },
                  "operationKey": {
                    "type": "string",
                    "description": "Operation key within the selected system menu."
                  },
                  "repo_key": {
                    "type": "string",
                    "description": "Canonical runtime repo key. Prefer the live repo mapping from /fcos/menu over stale aliases."
                  },
                  "prefix": {
                    "type": "string",
                    "description": "Directory prefix to filter (e.g. app/services/) [Live menu source: builder-main/inspect-tree]"
                  },
                  "path": {
                    "type": "string",
                    "description": "File path within repo [Live menu source: builder-main/inspect-file]"
                  },
                  "summary": {
                    "type": "boolean",
                    "description": "When supported, return structural summary instead of full file content."
                  },
                  "instruction": {
                    "type": "string",
                    "description": "Precise code change instruction [Live menu source: builder-main/submit-job]"
                  },
                  "editable_files": {
                    "type": "string",
                    "description": "Files to edit [Live menu source: builder-main/submit-job]"
                  },
                  "job_name": {
                    "type": "string",
                    "description": "Human-readable name [Live menu source: builder-main/submit-job]"
                  },
                  "lane_type": {
                    "type": "string",
                    "description": "governed (default) or one_shot [Live menu source: builder-main/submit-job]"
                  },
                  "changes": {
                    "type": "string",
                    "description": "Array of changes. Each: {file, action, search?, replace?, replace_all?, content?, line_start?, line_end?, new_file?} [Live menu source: builder-main/direct-apply]"
                  },
                  "files": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "File list used by commit, rollback, deploy-backend, build-progress, and similar builder-main operations."
                  },
                  "command": {
                    "type": "string",
                    "description": "Verification command (defaults to repo's standard check) [Live menu source: builder-main/verify-build]"
                  },
                  "description": {
                    "type": "string",
                    "description": "What this build does [Live menu source: builder-main/validate-build-plan]"
                  },
                  "file": {
                    "type": "string",
                    "description": "File path within the target repo for file-scoped builder operations."
                  },
                  "start_line": {
                    "type": "string",
                    "description": "Start line (1-indexed, default 1) [Live menu source: builder-main/read-lines]"
                  },
                  "end_line": {
                    "type": "string",
                    "description": "End line (default: end of file, max 200 lines per request) [Live menu source: builder-main/read-lines]"
                  },
                  "pattern": {
                    "type": "string",
                    "description": "Regex or search pattern for grep-driven code search operations."
                  },
                  "path_filter": {
                    "type": "string",
                    "description": "Optional glob/path filter for grep and similar scoped code search operations."
                  },
                  "max_results": {
                    "type": "number",
                    "description": "Maximum result count for grep/search style operations."
                  },
                  "multiline": {
                    "type": "string",
                    "description": "true for patterns spanning lines [Live menu source: builder-main/grep]"
                  },
                  "files_only": {
                    "type": "string",
                    "description": "true to return just file paths (saves tokens) [Live menu source: builder-main/grep]"
                  },
                  "search": {
                    "type": "string",
                    "description": "String to find [Live menu source: builder-main/multi-file-replace]"
                  },
                  "replace": {
                    "type": "string",
                    "description": "Replacement string [Live menu source: builder-main/multi-file-replace]"
                  },
                  "replace_all": {
                    "type": "string",
                    "description": "Replace all occurrences per file (default true) [Live menu source: builder-main/multi-file-replace]"
                  },
                  "dry_run": {
                    "type": "string",
                    "description": "Preview without changing files [Live menu source: builder-main/multi-file-replace]"
                  },
                  "compare_to": {
                    "type": "string",
                    "description": "HEAD (default) or another file path [Live menu source: builder-main/file-diff]"
                  },
                  "count": {
                    "type": "string",
                    "description": "Number of commits (default 10, max 30) [Live menu source: builder-main/git-log]"
                  },
                  "template_type": {
                    "type": "string",
                    "description": "route, service, or component [Live menu source: builder-main/scaffold]"
                  },
                  "name": {
                    "type": "string",
                    "description": "Name for the new entity [Live menu source: builder-main/scaffold]"
                  },
                  "session_id": {
                    "type": "string",
                    "description": "Session ID [Live menu source: builder-main/session-preview]"
                  },
                  "files_hint": {
                    "type": "string",
                    "description": "Optional file hints [Live menu source: builder-main/scope-map]"
                  },
                  "files_changed": {
                    "type": "string",
                    "description": "Array of changed file paths [Live menu source: builder-main/verify-guard]"
                  },
                  "original_change": {
                    "type": "string",
                    "description": "The change that failed {file, action, search, replace} [Live menu source: builder-main/retry-refine]"
                  },
                  "error_message": {
                    "type": "string",
                    "description": "The error message from the failed attempt [Live menu source: builder-main/retry-refine]"
                  },
                  "action": {
                    "type": "string",
                    "description": "Action that failed [Live menu source: builder-main/failure-record]"
                  },
                  "error": {
                    "type": "string",
                    "description": "Error message [Live menu source: builder-main/failure-record]"
                  },
                  "context": {
                    "type": "string",
                    "description": "What was being attempted [Live menu source: builder-main/failure-record]"
                  },
                  "upgrades": {
                    "type": "string",
                    "description": "Array of {name, description} [Live menu source: builder-main/classify-upgrades]"
                  },
                  "last_n": {
                    "type": "string",
                    "description": "Number of runs to return (default 10) [Live menu source: builder-main/pipeline-trace]"
                  },
                  "ops": {
                    "type": "string",
                    "description": "Array of {endpoint, payload} objects e.g. [{endpoint: '/inspect-file', payload: {repo_key: 'x', file_path: 'y'}}] [Live menu source: builder-main/parallel-op-batch]"
                  },
                  "since_hours": {
                    "type": "string",
                    "description": "Look-back window in hours (default 24) [Live menu source: builder-main/session-resume-diff]"
                  },
                  "endpoint": {
                    "type": "string",
                    "description": "Endpoint path e.g. '/pipeline-trace' [Live menu source: builder-main/op-test]"
                  },
                  "method": {
                    "type": "string",
                    "description": "GET or POST (default POST) [Live menu source: builder-main/op-test]"
                  },
                  "payload": {
                    "type": "string",
                    "description": "Test payload [Live menu source: builder-main/op-test]"
                  },
                  "expect_fields": {
                    "type": "string",
                    "description": "Array of field names that must exist in response [Live menu source: builder-main/op-test]"
                  },
                  "service_name": {
                    "type": "string",
                    "description": "Target service for service-restart-confirm or deploy-backend, e.g. fcos-api, builder-control-plane-api, builder-bridge-pro, fcos-think-tank."
                  },
                  "reason": {
                    "type": "string",
                    "description": "Human-readable reason for service confirmation or restart-adjacent checks."
                  },
                  "product": {
                    "type": "string",
                    "description": "Product name: build, store, sprint, brainz, synapse, landing [Live menu source: builder-main/html-product-lint]"
                  },
                  "file_path": {
                    "type": "string",
                    "description": "Override path (default: /root/fcos-products/{product}/index.html) [Live menu source: builder-main/html-product-lint]"
                  },
                  "refresh": {
                    "type": "string",
                    "description": "true to force a fresh runtime probe instead of using the short-lived cache [Live menu source: builder-main/playwright-readiness]"
                  },
                  "task_description": {
                    "type": "string",
                    "description": "The original task/instruction [Live menu source: builder-main/verify-intent]"
                  },
                  "content": {
                    "type": "string",
                    "description": "Content (for create/full_rewrite/append) [Live menu source: builder-main/quick-edit]"
                  },
                  "auto_commit": {
                    "type": "string",
                    "description": "Auto-commit if all checks pass (default true) [Live menu source: builder-main/smart-apply]"
                  },
                  "change_summary": {
                    "type": "string",
                    "description": "What changed [Live menu source: builder-main/post-change-sync]"
                  },
                  "operations_added": {
                    "type": "string",
                    "description": "Number of new operations added [Live menu source: builder-main/post-change-sync]"
                  },
                  "templates_added": {
                    "type": "string",
                    "description": "Number of new templates added [Live menu source: builder-main/post-change-sync]"
                  },
                  "knowledge_files_changed": {
                    "type": "string",
                    "description": "Array of changed KB filenames e.g. ['04-builder-execution.md'] [Live menu source: builder-main/post-change-sync]"
                  },
                  "commit_message": {
                    "type": "string",
                    "description": "Commit message for deploy-backend or execute-build-plan style rollouts."
                  },
                  "message": {
                    "type": "string",
                    "description": "Commit message [Live menu source: builder-main/auto-commit]"
                  },
                  "verify_after": {
                    "type": "boolean",
                    "description": "Whether to capture a post-action health snapshot after deploy-backend."
                  },
                  "mode": {
                    "type": "string",
                    "description": "soft (default) or revert [Live menu source: builder-main/undo-commit]"
                  },
                  "synapse_project_id": {
                    "type": "string",
                    "description": "Synapse project ID — reads pages as code files (PREFERRED) [Live menu source: builder-main/execute-build-plan]"
                  },
                  "notion_project_page_id": {
                    "type": "string",
                    "description": "Notion project page ID (legacy) [Live menu source: builder-main/execute-build-plan]"
                  },
                  "projectId": {
                    "type": "string",
                    "description": "Synapse project ID containing code pages [Live menu source: builder-main/build-manifest]"
                  },
                  "apiJobId": {
                    "type": "string",
                    "description": "Job ID from submit response [Live menu source: builder-main/job-summary]"
                  },
                  "include_one_shot": {
                    "type": "string",
                    "description": "true to include non-canonical jobs [Live menu source: builder-main/list-jobs]"
                  },
                  "api_job_id": {
                    "type": "string",
                    "description": "Job ID to promote [Live menu source: builder-main/promote]"
                  },
                  "symbol": {
                    "type": "string",
                    "description": "Symbol name to find (function, class, const) [Live menu source: builder-main/symbol-search]"
                  },
                  "scope": {
                    "type": "string",
                    "description": "all (default), definition, or usages [Live menu source: builder-main/symbol-search]"
                  },
                  "file_extensions": {
                    "type": "string",
                    "description": "Comma-sep extensions to search e.g. '.ts,.tsx' (default: all source files) [Live menu source: builder-main/symbol-search]"
                  },
                  "test_paths": {
                    "type": "string",
                    "description": "Array of test file paths (empty = auto-detect all tests) [Live menu source: builder-main/run-tests]"
                  },
                  "timeout": {
                    "type": "string",
                    "description": "Max seconds (default 60) [Live menu source: builder-main/run-tests]"
                  },
                  "source_file": {
                    "type": "string",
                    "description": "Source file to generate tests for [Live menu source: builder-main/generate-test]"
                  },
                  "output_file": {
                    "type": "string",
                    "description": "Output test file path (auto-derived if empty) [Live menu source: builder-main/generate-test]"
                  },
                  "run_after": {
                    "type": "string",
                    "description": "Run tests immediately after generating (default true) [Live menu source: builder-main/generate-test]"
                  },
                  "target_files": {
                    "type": "string",
                    "description": "Array of files the task touches (supplemented by analysis) [Live menu source: builder-main/decompose-task]"
                  },
                  "error_output": {
                    "type": "string",
                    "description": "Raw error text from compiler, test runner, or runtime [Live menu source: builder-main/root-cause-analysis]"
                  },
                  "context_lines": {
                    "type": "string",
                    "description": "Lines of code context around each error (default 3) [Live menu source: builder-main/root-cause-analysis]"
                  },
                  "old_name": {
                    "type": "string",
                    "description": "Old symbol or file stem name [Live menu source: builder-main/auto-import-sync]"
                  },
                  "new_name": {
                    "type": "string",
                    "description": "New name to replace with [Live menu source: builder-main/auto-import-sync]"
                  },
                  "rename_type": {
                    "type": "string",
                    "description": "symbol (default) or file [Live menu source: builder-main/auto-import-sync]"
                  },
                  "old_file_path": {
                    "type": "string",
                    "description": "For file renames: original relative path [Live menu source: builder-main/auto-import-sync]"
                  },
                  "new_file_path": {
                    "type": "string",
                    "description": "For file renames: new relative path [Live menu source: builder-main/auto-import-sync]"
                  },
                  "run_tests_flag": {
                    "type": "string",
                    "description": "Run test suite (default true) [Live menu source: builder-main/test-and-verify]"
                  },
                  "days": {
                    "type": "string",
                    "description": "Look-back window in days (default 7) [Live menu source: builder-main/telemetry-trends]"
                  },
                  "operation": {
                    "type": "string",
                    "description": "Filter to specific operation name (empty = all) [Live menu source: builder-main/telemetry-trends]"
                  },
                  "top_n": {
                    "type": "string",
                    "description": "How many top/worst operations to return (default 10) [Live menu source: builder-main/telemetry-trends]"
                  },
                  "max_depth": {
                    "type": "string",
                    "description": "Directory depth limit (default 4) [Live menu source: builder-main/repo-map]"
                  },
                  "include_extensions": {
                    "type": "string",
                    "description": "Comma-sep extensions e.g. '.ts,.tsx' (default: all source files) [Live menu source: builder-main/repo-map]"
                  },
                  "max_files": {
                    "type": "string",
                    "description": "Max files to map (default 200) [Live menu source: builder-main/repo-map]"
                  },
                  "limit": {
                    "type": "string",
                    "description": "Max events to return (default 50) [Live menu source: builder-main/execution-trace]"
                  },
                  "include_payloads": {
                    "type": "string",
                    "description": "Include full event payloads (verbose, default false) [Live menu source: builder-main/execution-trace]"
                  },
                  "max_attempts": {
                    "type": "string",
                    "description": "Max recovery attempts (default 3, max 3) [Live menu source: builder-main/fix-and-retry]"
                  },
                  "batch_number": {
                    "type": "string",
                    "description": "Which batch number this is (for commit message) [Live menu source: builder-main/session-commit-batch]"
                  },
                  "model_context_k": {
                    "type": "string",
                    "description": "Context window in K tokens (default 128) [Live menu source: builder-main/context-budget]"
                  },
                  "error_class": {
                    "type": "string",
                    "description": "Filter by error class (e.g. type_mismatch, missing_import, undefined_symbol) [Live menu source: builder-main/failure-index]"
                  },
                  "slugs": {
                    "type": "string",
                    "description": "Array of template slugs to scan. Omit to scan all 226 templates. [Live menu source: builder-main/template-scan]"
                  },
                  "sector": {
                    "type": "string",
                    "description": "Sector name: restaurant | trades | saas | health-fitness | real-estate | creative-agency | finance | general [Live menu source: builder-main/template-seed]"
                  },
                  "founderRequest": {
                    "type": "string",
                    "description": "Founder request text describing what the Brainz pack should cover. [Live menu source: brainz/strict-build-session]"
                  },
                  "desiredOutcome": {
                    "type": "string",
                    "description": "Optional description of expected outcome for the Brainz pack. [Live menu source: brainz/strict-build-session]"
                  },
                  "buildMode": {
                    "type": "string",
                    "description": "Build mode: build_my_brainz | build_their_brainz. [Live menu source: brainz/strict-build-session]"
                  },
                  "targetAgentLabel": {
                    "type": "string",
                    "description": "Agent label that should own the resulting Brainz pack. [Live menu source: brainz/strict-build-session]"
                  },
                  "packTitle": {
                    "type": "string",
                    "description": "Optional title for the Brainz pack. [Live menu source: brainz/strict-build-session]"
                  },
                  "noteMode": {
                    "type": "string",
                    "description": "FCOS Think Tank note mode key to link the pack (if applicable). [Live menu source: brainz/strict-build-execute]"
                  },
                  "now": {
                    "type": "string",
                    "description": "Optional timestamp override for when the pack is recorded. [Live menu source: brainz/strict-build-execute]"
                  },
                  "packKey": {
                    "type": "string",
                    "description": "Pack key returned from the strict-build execution result. [Live menu source: brainz/strict-build-by-pack]"
                  },
                  "applyAllSafe": {
                    "type": "string",
                    "description": "Apply every safe generated action [Live menu source: template-quality/registry-sync]"
                  },
                  "actionIds": {
                    "type": "string",
                    "description": "Optional explicit sync action ids to apply [Live menu source: template-quality/registry-sync]"
                  },
                  "templateKey": {
                    "type": "string",
                    "description": "Template key [Live menu source: template-quality/placeholder-scan]"
                  },
                  "filePath": {
                    "type": "string",
                    "description": "Live FCOS menu parameter for template-quality/seed-inject."
                  },
                  "backlogKey": {
                    "type": "string",
                    "description": "Backlog item being acted on [Live menu source: engine-upgrades/action-receipt]"
                  },
                  "actionKey": {
                    "type": "string",
                    "description": "Planner action key [Live menu source: engine-upgrades/action-receipt]"
                  },
                  "executedRoute": {
                    "type": "string",
                    "description": "Route that was executed [Live menu source: engine-upgrades/action-receipt]"
                  },
                  "executionStatus": {
                    "type": "string",
                    "description": "succeeded, failed, or blocked [Live menu source: engine-upgrades/action-receipt]"
                  },
                  "approvalUsed": {
                    "type": "string",
                    "description": "true when founder approval has been explicitly granted for a founder-review action [Live menu source: engine-upgrades/action-launch]"
                  },
                  "overridePayload": {
                    "type": "string",
                    "description": "Optional bounded override payload. Only allowlisted fields for the chosen action are accepted. [Live menu source: engine-upgrades/action-launch]"
                  },
                  "backlogKeys": {
                    "type": "string",
                    "description": "Optional scoped backlog keys. When supplied, the sweep only considers those survivor items instead of the full safe_auto_retry lane set. [Live menu source: engine-upgrades/auto-repair-safe-batch]"
                  },
                  "decisionKey": {
                    "type": "string",
                    "description": "Decision key [Live menu source: founder/get-decision]"
                  },
                  "objective": {
                    "type": "string",
                    "description": "Founder coding objective [Live menu source: founder/proofing-plan]"
                  },
                  "changedFiles": {
                    "type": "string",
                    "description": "Optional changed file paths if the coding scope is already known [Live menu source: founder/proofing-plan]"
                  },
                  "targetUrl": {
                    "type": "string",
                    "description": "Explicit preview URL for frontend proof [Live menu source: founder/proofing-plan]"
                  },
                  "surfaceType": {
                    "type": "string",
                    "description": "website, landing_page, html_app, template, or pwa_app [Live menu source: founder/proofing-plan]"
                  },
                  "previewBaseUrl": {
                    "type": "string",
                    "description": "Preview base URL used when targetUrl is not supplied [Live menu source: founder/proof-bundle]"
                  },
                  "baselineKey": {
                    "type": "string",
                    "description": "Optional regression baseline key [Live menu source: founder/proof-bundle]"
                  },
                  "promoteBaseline": {
                    "type": "string",
                    "description": "true to write/update the regression baseline during the run [Live menu source: founder/proof-bundle]"
                  },
                  "dryRun": {
                    "type": "string",
                    "description": "Preview-only launch when true [Live menu source: founder/proofing-plan-launch]"
                  },
                  "projectKey": {
                    "type": "string",
                    "description": "Optional project key [Live menu source: founder/operator-session]"
                  },
                  "requestedByRole": {
                    "type": "string",
                    "description": "Founder/operator role label [Live menu source: founder/operator-session]"
                  },
                  "sessionId": {
                    "type": "string",
                    "description": "Operator session id [Live menu source: founder/operator-session-by-id]"
                  },
                  "query": {
                    "type": "string",
                    "description": "Audit query [Live menu source: founder/audit-guide]"
                  },
                  "email": {
                    "type": "string",
                    "description": "Email address [Live menu source: platform/signup]"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password (min 8 chars) [Live menu source: platform/signup]"
                  },
                  "room": {
                    "type": "string",
                    "description": "Room: home/validate/plan/build/run [Live menu source: platform/chat-create]"
                  },
                  "project_id": {
                    "type": "string",
                    "description": "Project ID [Live menu source: platform/chat-create]"
                  },
                  "title": {
                    "type": "string",
                    "description": "Session title [Live menu source: platform/chat-create]"
                  },
                  "id": {
                    "type": "string",
                    "description": "Session ID [Live menu source: platform/chat-get]"
                  },
                  "role": {
                    "type": "string",
                    "description": "user or assistant [Live menu source: platform/chat-message]"
                  },
                  "feature": {
                    "type": "string",
                    "description": "Feature to check: can_build, max_pages, etc. [Live menu source: platform/tier-limits]"
                  },
                  "page_id": {
                    "type": "string",
                    "description": "Page ID [Live menu source: platform/page-version-save]"
                  },
                  "pageId": {
                    "type": "string",
                    "description": "Page ID [Live menu source: platform/page-versions]"
                  },
                  "version_id": {
                    "type": "string",
                    "description": "Version ID to restore [Live menu source: platform/page-rollback]"
                  },
                  "tier": {
                    "type": "string",
                    "description": "pro | business | enterprise [Live menu source: platform/billing-checkout]"
                  },
                  "success_url": {
                    "type": "string",
                    "description": "Redirect after payment success [Live menu source: platform/billing-checkout]"
                  },
                  "cancel_url": {
                    "type": "string",
                    "description": "Redirect after cancellation [Live menu source: platform/billing-checkout]"
                  },
                  "required_tier": {
                    "type": "string",
                    "description": "pro | business | enterprise — if set, returns meets_required_tier boolean [Live menu source: platform/tier-check]"
                  },
                  "code": {
                    "type": "string",
                    "description": "Referral code [Live menu source: platform/referral-track]"
                  },
                  "event": {
                    "type": "string",
                    "description": "click (default) or signup [Live menu source: platform/referral-track]"
                  },
                  "token": {
                    "type": "string",
                    "description": "Invite token from the invite link [Live menu source: platform/accept-invite]"
                  },
                  "memberId": {
                    "type": "string",
                    "description": "Team member ID [Live menu source: platform/remove-member]"
                  },
                  "createdBy": {
                    "type": "string",
                    "description": "Founder name [Live menu source: platform/session-create]"
                  },
                  "participantName": {
                    "type": "string",
                    "description": "Your name [Live menu source: platform/session-join]"
                  },
                  "senderName": {
                    "type": "string",
                    "description": "Sender name [Live menu source: platform/session-message]"
                  },
                  "since": {
                    "type": "string",
                    "description": "ISO timestamp — returns only messages after this point [Live menu source: platform/session-poll]"
                  },
                  "team_decisions": {
                    "type": "string",
                    "description": "Array of team decision strings [Live menu source: platform/save-shared-context]"
                  },
                  "shared_milestones": {
                    "type": "string",
                    "description": "Array of shared milestone strings [Live menu source: platform/save-shared-context]"
                  },
                  "shared_documents": {
                    "type": "string",
                    "description": "Array of shared document references [Live menu source: platform/save-shared-context]"
                  },
                  "updated_by": {
                    "type": "string",
                    "description": "Name of the team member making the update [Live menu source: platform/save-shared-context]"
                  },
                  "file_pattern": {
                    "type": "string",
                    "description": "Glob pattern to filter source files e.g. src/**/*.ts [Live menu source: precision/coverage-check]"
                  },
                  "tsconfig_path": {
                    "type": "string",
                    "description": "Path to tsconfig.json (default: tsconfig.json) [Live menu source: precision/tsc-check]"
                  },
                  "body": {
                    "type": "string",
                    "description": "PR description (markdown) [Live menu source: precision/pr-create]"
                  },
                  "base": {
                    "type": "string",
                    "description": "Base branch (default: main) [Live menu source: precision/pr-create]"
                  },
                  "draft": {
                    "type": "string",
                    "description": "Create as draft PR (default: false) [Live menu source: precision/pr-create]"
                  },
                  "labels": {
                    "type": "string",
                    "description": "Array of label names [Live menu source: precision/pr-create]"
                  },
                  "test_file": {
                    "type": "string",
                    "description": "Relative path to test file [Live menu source: precision/test-improve]"
                  },
                  "write": {
                    "type": "string",
                    "description": "Write improved file to disk (default: true) [Live menu source: precision/test-improve]"
                  },
                  "error_category": {
                    "type": "string",
                    "description": "Error category (e.g. missing_import, type_mismatch) [Live menu source: precision/shared-failure-index]"
                  },
                  "error_signature": {
                    "type": "string",
                    "description": "Key phrase from the error message [Live menu source: precision/shared-failure-index]"
                  },
                  "fix": {
                    "type": "string",
                    "description": "The fix that worked (required for record) [Live menu source: precision/shared-failure-index]"
                  },
                  "language": {
                    "type": "string",
                    "description": "typescript, python, or any [Live menu source: precision/shared-failure-index]"
                  },
                  "function_name": {
                    "type": "string",
                    "description": "Name of the function to fix [Live menu source: precision/logic-fix]"
                  },
                  "expected_behavior": {
                    "type": "string",
                    "description": "What the function should do [Live menu source: precision/logic-fix]"
                  },
                  "actual_behavior": {
                    "type": "string",
                    "description": "What it currently does (wrong) [Live menu source: precision/logic-fix]"
                  },
                  "apply": {
                    "type": "string",
                    "description": "Write the fix to disk if confidence ≥ 0.65 (default: false) [Live menu source: precision/logic-fix]"
                  },
                  "instructions": {
                    "type": "string",
                    "description": "Array of instruction strings e.g. ['use strict mode', 'no console.log', 'named exports only'] [Live menu source: precision/instruction-verify]"
                  },
                  "include_symbols": {
                    "type": "string",
                    "description": "Include export symbol tables (default: true) [Live menu source: precision/session-resume-context]"
                  },
                  "batches": {
                    "type": "string",
                    "description": "Array of {batch_id: string, files: string[]} objects [Live menu source: precision/batch-dependency-graph]"
                  },
                  "requirements": {
                    "type": "string",
                    "description": "Requirements to verify (if not auto-generated) [Live menu source: precision/verify-semantics]"
                  },
                  "code_snippet": {
                    "type": "string",
                    "description": "Code to check (use instead of file_path) [Live menu source: precision/import-verify]"
                  },
                  "task_type": {
                    "type": "string",
                    "description": "auto, crud, ui, api, utility, refactor (default: auto) [Live menu source: precision/require-extract]"
                  },
                  "checkpoint_name": {
                    "type": "string",
                    "description": "Checkpoint identifier [Live menu source: precision/checkpoint-save]"
                  },
                  "completed_files": {
                    "type": "string",
                    "description": "Files successfully written [Live menu source: precision/checkpoint-save]"
                  },
                  "remaining_files": {
                    "type": "string",
                    "description": "Files still to write [Live menu source: precision/checkpoint-save]"
                  },
                  "notes": {
                    "type": "string",
                    "description": "Any drift or issues to note [Live menu source: precision/checkpoint-save]"
                  },
                  "original_plan": {
                    "type": "string",
                    "description": "decompose-task output (subtasks array) [Live menu source: precision/drift-detect]"
                  },
                  "decompose_output": {
                    "type": "string",
                    "description": "Output from decompose-task (subtasks array) [Live menu source: precision/completion-tracker]"
                  },
                  "completed_subtasks": {
                    "type": "string",
                    "description": "Array of completed subtask IDs or names [Live menu source: precision/completion-tracker]"
                  },
                  "proposed_design": {
                    "type": "string",
                    "description": "Design description: services, data flow, file structure [Live menu source: precision/arch-validate]"
                  },
                  "check_exports": {
                    "type": "string",
                    "description": "Verify exported symbols still exist (default true) [Live menu source: precision/reverse-dep-validate]"
                  },
                  "baseline_id": {
                    "type": "string",
                    "description": "Identifier for the baseline (default: 'latest') [Live menu source: precision/baseline-test]"
                  },
                  "test_pattern": {
                    "type": "string",
                    "description": "Test pattern filter [Live menu source: precision/baseline-test]"
                  },
                  "original_files": {
                    "type": "string",
                    "description": "Files in the original task scope [Live menu source: precision/scope-expansion]"
                  },
                  "current_files": {
                    "type": "string",
                    "description": "Files actually changed so far [Live menu source: precision/scope-expansion]"
                  },
                  "original_estimate_minutes": {
                    "type": "string",
                    "description": "Original time estimate in minutes [Live menu source: precision/scope-expansion]"
                  },
                  "budget_minutes": {
                    "type": "string",
                    "description": "Time budget in minutes [Live menu source: precision/scope-expansion]"
                  },
                  "stop_on_failure": {
                    "type": "string",
                    "description": "Stop if any file fails (default true) [Live menu source: precision/per-file-commit]"
                  },
                  "depth": {
                    "type": "string",
                    "description": "'brief' (default) or 'detailed' (includes body preview) [Live menu source: precision/explain-code]"
                  },
                  "fix_style": {
                    "type": "string",
                    "description": "Run prettier/black (default true) [Live menu source: precision/lint-fix]"
                  },
                  "fix_lint": {
                    "type": "string",
                    "description": "Run eslint --fix (default true) [Live menu source: precision/lint-fix]"
                  },
                  "provider_file": {
                    "type": "string",
                    "description": "File that defines the interfaces/types [Live menu source: precision/api-contract-check]"
                  },
                  "consumer_files": {
                    "type": "string",
                    "description": "Array of files that use those interfaces [Live menu source: precision/api-contract-check]"
                  },
                  "files_mentioned": {
                    "type": "string",
                    "description": "Files you plan to change (helps risk scoring) [Live menu source: precision/task-route]"
                  },
                  "frontend_files": {
                    "type": "string",
                    "description": "Frontend files being changed [Live menu source: precision/fullstack-plan]"
                  },
                  "backend_files": {
                    "type": "string",
                    "description": "Backend files being changed [Live menu source: precision/fullstack-plan]"
                  },
                  "skip_tsc": {
                    "type": "string",
                    "description": "Skip TypeScript check (default false) [Live menu source: precision/proof-gate]"
                  },
                  "session_context": {
                    "type": "string",
                    "description": "Brief context about this session [Live menu source: precision/task-resume]"
                  },
                  "url": {
                    "type": "string",
                    "description": "URL to verify (must be reachable from server) [Live menu source: precision/browser-verify]"
                  },
                  "steps": {
                    "type": "string",
                    "description": "User-flow steps: [{action, selector, value, timeout_ms}] [Live menu source: precision/browser-verify]"
                  },
                  "timeout_ms": {
                    "type": "string",
                    "description": "Page load timeout in ms (default 15000) [Live menu source: precision/browser-verify]"
                  },
                  "capture_screenshot": {
                    "type": "string",
                    "description": "Save screenshot to disk (default true) [Live menu source: precision/browser-verify]"
                  },
                  "include_recommendations": {
                    "type": "string",
                    "description": "Include fix recommendations (default true) [Live menu source: precision/capability-reconcile]"
                  },
                  "ops_run": {
                    "type": "string",
                    "description": "Array of operation keys already executed [Live menu source: precision/proof-gate-check]"
                  },
                  "change_description": {
                    "type": "string",
                    "description": "What the change does [Live menu source: precision/proof-gate-check]"
                  },
                  "lane_used": {
                    "type": "string",
                    "description": "Lane that was used [Live menu source: precision/confidence-to-ship]"
                  },
                  "lookback_hours": {
                    "type": "string",
                    "description": "Hours to look back (default: 24) [Live menu source: precision/slim-audit]"
                  },
                  "outcome": {
                    "type": "string",
                    "description": "success|fail|timeout|partial [Live menu source: precision/benchmark-task-record]"
                  },
                  "retries": {
                    "type": "string",
                    "description": "Number of retries (default 0) [Live menu source: precision/benchmark-task-record]"
                  },
                  "proof_gates_run": {
                    "type": "string",
                    "description": "Array of proof gate ops run [Live menu source: precision/benchmark-task-record]"
                  },
                  "skip_frontend_qa": {
                    "type": "string",
                    "description": "Skip UI quality gate for pure backend tasks [Live menu source: precision/fullstack-execute]"
                  },
                  "message_count": {
                    "type": "string",
                    "description": "Number of messages in current conversation [Live menu source: precision/context-window-monitor]"
                  },
                  "estimated_tokens": {
                    "type": "string",
                    "description": "GPT-side token estimate if available [Live menu source: precision/context-window-monitor]"
                  },
                  "migration_file": {
                    "type": "string",
                    "description": "Relative path to migration SQL file [Live menu source: precision/migration-guard]"
                  },
                  "model": {
                    "type": "string",
                    "description": "Model name: gpt-4o (default), gpt-4-turbo, gpt-3.5-turbo, claude-sonnet, claude-opus [Live menu source: precision/session-cost-estimate]"
                  },
                  "icon": {
                    "type": "string",
                    "description": "Emoji icon (default 📁) [Live menu source: synapse/create-project]"
                  },
                  "page": {
                    "type": "string",
                    "description": "Page object: {id, title, icon, blocks: [{id, type, content, ...}]} [Live menu source: synapse/save-page]"
                  },
                  "q": {
                    "type": "string",
                    "description": "Search query [Live menu source: synapse/search]"
                  },
                  "template": {
                    "type": "string",
                    "description": "Full template JSON [Live menu source: synapse/update-template]"
                  },
                  "fileId": {
                    "type": "string",
                    "description": "File ID [Live menu source: sprint/delete-file]"
                  },
                  "folder": {
                    "type": "string",
                    "description": "{name, parent} [Live menu source: sprint/create-folder]"
                  },
                  "folderId": {
                    "type": "string",
                    "description": "Folder ID [Live menu source: sprint/delete-folder]"
                  },
                  "parentPageId": {
                    "type": "string",
                    "description": "Parent page ID (defaults to FCOS Main) [Live menu source: notion/create-page]"
                  },
                  "category": {
                    "type": "string",
                    "description": "Live FCOS menu parameter for store/store-list."
                  },
                  "price": {
                    "type": "number",
                    "description": "Live FCOS menu parameter for store/store-submit."
                  },
                  "app_id": {
                    "type": "string",
                    "description": "Live FCOS menu parameter for store/store-purchase."
                  },
                  "user_id": {
                    "type": "string",
                    "description": "Live FCOS menu parameter for store/affiliate-qualify."
                  },
                  "month": {
                    "type": "string",
                    "description": "Live FCOS menu parameter for store/affiliate-pool-distribute."
                  },
                  "pool_amount_gbp": {
                    "type": "number",
                    "description": "Live FCOS menu parameter for store/affiliate-pool-distribute."
                  },
                  "parameters": {
                    "type": "object",
                    "description": "Optional nested parameters object. FCOS accepts both flat top-level params and nested parameters payloads on /fcos/execute."
                  }
                },
                "additionalProperties": true,
                "description": "Dynamic execute schema derived from the live FCOS menu registry. Flat top-level params and nested parameters payloads are both accepted."
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Executed operation result with status and response body",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "executed": {
                      "type": "object",
                      "properties": {
                        "systemKey": {
                          "type": "string"
                        },
                        "operationKey": {
                          "type": "string"
                        },
                        "method": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      }
                    },
                    "status": {
                      "type": "integer"
                    },
                    "result": {}
                  }
                }
              }
            }
          }
        }
      }
    },
    "/fcos/brainz/strict-build/session": {
      "post": {
        "operationId": "createFcosBrainzStrictBuildSession",
        "summary": "Normalize a founder Brainz update request into the canonical strict_build transaction with explicit build mode, pack title, target-agent requirement, and next action.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "founderRequest"
                ],
                "properties": {
                  "founderRequest": {
                    "type": "string",
                    "description": "Founder request describing the Brainz update to perform."
                  },
                  "desiredOutcome": {
                    "type": "string",
                    "description": "Optional success target or business outcome."
                  },
                  "buildMode": {
                    "type": "string",
                    "enum": [
                      "build_my_brainz",
                      "build_their_brainz"
                    ]
                  },
                  "targetAgentLabel": {
                    "type": "string",
                    "description": "Required for build_their_brainz if it cannot be inferred from the founder request."
                  },
                  "packTitle": {
                    "type": "string",
                    "description": "Optional explicit Brainz pack title."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Strict-build session plan with normalized mode, target, validation requirements, and next action"
          }
        }
      }
    },
    "/fcos/brainz/strict-build/execute": {
      "post": {
        "operationId": "executeFcosBrainzStrictBuild",
        "summary": "Run the governed FCOS Brainz strict-build batch. This is the canonical founder-facing Brainz execution route.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "buildMode",
                  "packTitle",
                  "files"
                ],
                "properties": {
                  "buildMode": {
                    "type": "string",
                    "enum": [
                      "build_my_brainz",
                      "build_their_brainz"
                    ]
                  },
                  "packTitle": {
                    "type": "string"
                  },
                  "targetAgentLabel": {
                    "type": "string",
                    "description": "Required for build_their_brainz."
                  },
                  "noteMode": {
                    "type": "string",
                    "enum": [
                      "fcos_brainz"
                    ]
                  },
                  "now": {
                    "type": "string"
                  },
                  "files": {
                    "type": "array",
                    "description": "Bounded Brainz file batch. Max 20 files.",
                    "items": {
                      "type": "object",
                      "required": [
                        "noteKey",
                        "title",
                        "noteType",
                        "sensitivity",
                        "summary",
                        "copyBlock"
                      ],
                      "properties": {
                        "noteKey": {
                          "type": "string"
                        },
                        "title": {
                          "type": "string"
                        },
                        "noteType": {
                          "type": "string",
                          "enum": [
                            "login_detail",
                            "credential",
                            "server_session",
                            "operator_note",
                            "idea",
                            "project_note",
                            "reference"
                          ]
                        },
                        "sensitivity": {
                          "type": "string",
                          "enum": [
                            "open",
                            "internal",
                            "restricted",
                            "secret"
                          ]
                        },
                        "workspaceKind": {
                          "type": "string",
                          "enum": [
                            "think_tank",
                            "storage"
                          ]
                        },
                        "summary": {
                          "type": "string"
                        },
                        "copyBlock": {
                          "type": "string"
                        },
                        "notes": {
                          "type": "string"
                        },
                        "memoryHooks": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "links": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "sourceRefs": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Required per file in build_their_brainz mode."
                        },
                        "relationLinks": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "supersedes": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "supersededBy": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "branchParent": {
                          "type": "string"
                        },
                        "decisionState": {
                          "type": "string",
                          "enum": [
                            "none",
                            "draft",
                            "confirmed",
                            "superseded"
                          ]
                        },
                        "linkedSessionIds": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Brainz strict-build result with packKey, notes written, and validation warnings"
          }
        }
      }
    },
    "/fcos/brainz/strict-build/by-pack": {
      "get": {
        "operationId": "getFcosBrainzStrictBuildByPack",
        "summary": "Inspect a previously written FCOS Brainz strict-build pack by packKey.",
        "parameters": [
          {
            "name": "packKey",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Brainz strict-build pack inspection with relation link, build mode, target label, and written notes"
          }
        }
      }
    },
    "/fcos/direct-apply": {
      "post": {
        "operationId": "directApplyCodeChanges",
        "summary": "Apply exact code changes to a repo. 11 actions: create, search_replace, full_rewrite, append, prepend, insert_after, replace_lines, delete_lines, delete_file, rename.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "repo_key",
                  "changes",
                  "job_name"
                ],
                "properties": {
                  "repo_key": {
                    "type": "string",
                    "description": "Target repo: fcos-backend, builder-bridge-pro, builder-control-plane"
                  },
                  "job_name": {
                    "type": "string",
                    "description": "Human-readable name for this change"
                  },
                  "changes": {
                    "type": "array",
                    "description": "Array of code change objects",
                    "items": {
                      "type": "object",
                      "required": [
                        "file",
                        "action"
                      ],
                      "properties": {
                        "file": {
                          "type": "string",
                          "description": "File path within repo"
                        },
                        "action": {
                          "type": "string",
                          "enum": [
                            "create",
                            "search_replace",
                            "full_rewrite",
                            "append",
                            "prepend",
                            "insert_after",
                            "replace_lines",
                            "delete_lines",
                            "delete_file",
                            "rename"
                          ],
                          "description": "Change type"
                        },
                        "content": {
                          "type": "string",
                          "description": "New content (for create, full_rewrite, append, prepend)"
                        },
                        "search": {
                          "type": "string",
                          "description": "Text to find (for search_replace, insert_after)"
                        },
                        "replace": {
                          "type": "string",
                          "description": "Replacement text (for search_replace)"
                        },
                        "insert": {
                          "type": "string",
                          "description": "Text to insert (for insert_after)"
                        },
                        "start_line": {
                          "type": "integer",
                          "description": "Start line (for replace_lines, delete_lines)"
                        },
                        "end_line": {
                          "type": "integer",
                          "description": "End line (for replace_lines, delete_lines)"
                        },
                        "new_file": {
                          "type": "string",
                          "description": "New file path (for rename)"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Changes applied with job ID, status, and applied change count"
          }
        }
      }
    }
  }
}