{"flow":"onboarding","definition":{"id":"onboarding","operation_count":5,"support_operation_count":1,"operations":[{"method":"get","path":"/v1/projects/{project_id}/onboarding"},{"method":"post","path":"/v1/projects/{project_id}/onboarding"},{"method":"post","path":"/v1/projects/{project_id}/onboarding/review"},{"method":"post","path":"/v1/projects/{project_id}/onboarding/proof"},{"method":"post","path":"/v1/projects/{project_id}/onboarding/verify"}],"support_operations":[{"method":"get","path":"/v1/onboarding/source-snapshot.mjs"}],"statuses":["planned","approved","proving","verified"],"status_actions":{"planned":"Get explicit human review, then POST /review.","approved":"Implement, test, commit clean source, then POST /proof.","proving":"Run real approved paths, then POST /verify.","verified":"Installation is complete because evidence_status.source is source_verified."},"prerequisite_operations":[{"method":"post","path":"/v1/auth/posthog","schema_url":"/v1/openapi.json?path=%2Fv1%2Fauth%2Fposthog&method=post"},{"method":"post","path":"/v1/auth/posthog/poll","schema_url":"/v1/openapi.json?path=%2Fv1%2Fauth%2Fposthog%2Fpoll&method=post"},{"method":"post","path":"/v1/projects","schema_url":"/v1/openapi.json?path=%2Fv1%2Fprojects&method=post"},{"method":"post","path":"/v1/projects/{project_id}/credentials","schema_url":"/v1/openapi.json?path=%2Fv1%2Fprojects%2F%7Bproject_id%7D%2Fcredentials&method=post"}],"source_snapshot_helper":{"method":"get","path":"/v1/onboarding/source-snapshot.mjs"}},"paths":{"/v1/projects/{project_id}/onboarding":{"get":{"tags":["Onboarding"],"security":[{"ownerApiKey":[]}],"x-agentry-flow":"onboarding","operationId":"read_onboarding","summary":"Read current onboarding state","description":"Read before each action. A 404 means discovery has not started; create a source snapshot, deeply scan the shipped product and deployment surfaces, then submit the complete plan.","parameters":[{"$ref":"#/components/parameters/projectId"}],"responses":{"200":{"description":"Current planned, approved, proving, or verified state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3State"}}}},"default":{"$ref":"#/components/responses/AgentError"}}},"post":{"tags":["Onboarding"],"security":[{"ownerApiKey":[]}],"x-agentry-flow":"onboarding","operationId":"start_onboarding","summary":"Start or replace onboarding from complete discovery","description":"First audit a bounded window of the connected customer-owned PostHog Cloud project. Persist only counts, timestamps, signal/property identifiers, project identity, and a query-receipt hash; never raw payloads. Then deeply scan shipped docs and UI, routes/actions/jobs/webhooks, persistence, tests, existing telemetry, and CI/provider configuration. Map the actor and entry through every material durable transition, first value, and business result. Historical rows are non-authorizing and do not prove current source placement. Names are opaque. Do not truncate the flow to a fixed size.","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/ifMatchStart"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3StartRequest"}}}},"responses":{"200":{"description":"Replacement planned state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3State"}}}},"201":{"description":"New planned state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3State"}}}},"default":{"$ref":"#/components/responses/AgentError"}},"x-agentry-request-body-policy":{"kind":"json","max_bytes":524288},"x-agentry-retry-policy":{"kind":"monotonic_state_machine","rationale":"The exact plan body and current ETag create or replace one project onboarding state; exact replay returns the current matching plan.","idempotency_key_required":false}}},"/v1/projects/{project_id}/onboarding/review":{"post":{"tags":["Onboarding"],"security":[{"ownerApiKey":[]}],"x-agentry-flow":"onboarding","operationId":"review_onboarding","summary":"Approve or replace the exact plan","description":"Show the full plan to the human. Only their explicit decision approves the exact plan hash or replaces it with a fresh complete plan.","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/ifMatchCurrent"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3ReviewRequest"}}}},"responses":{"200":{"description":"Approved state or replacement planned state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3State"}}}},"default":{"$ref":"#/components/responses/AgentError"}},"x-agentry-request-body-policy":{"kind":"json","max_bytes":524288},"x-agentry-retry-policy":{"kind":"monotonic_state_machine","rationale":"The current ETag and exact plan hash bind the human approval or replacement.","idempotency_key_required":false}}},"/v1/projects/{project_id}/onboarding/proof":{"post":{"tags":["Onboarding"],"security":[{"ownerApiKey":[]}],"x-agentry-flow":"onboarding","operationId":"start_onboarding_proof","summary":"Start live proof from the final committed source","description":"After approval, use the customer's existing official PostHog SDKs to capture analytics after every approved durable success and exceptions at approved failure exits. Agentry provides no browser or server telemetry credential. Test, commit a clean shipped tree, run the source helper with --final, and submit only its snapshot. Attach the returned short-lived runtime marker as the agentry_onboarding_proof PostHog event property while exercising real product paths. Use the separate CI marker header only on trusted Agentry deploy attribution. Neither marker authorizes writes.","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/ifMatchCurrent"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3ProofStartRequest"}}}},"responses":{"201":{"description":"Proving state plus a one-time PostHog event-property marker and a distinct CI header marker.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3ProofStartResponse"}}}},"default":{"$ref":"#/components/responses/AgentError"}},"x-agentry-request-body-policy":{"kind":"json","max_bytes":4096},"x-agentry-retry-policy":{"kind":"ephemeral_non_idempotent","rationale":"A proof start intentionally revokes any prior marker pair and returns fresh one-time runtime and CI markers; state CAS prevents scope drift.","idempotency_key_required":false}}},"/v1/projects/{project_id}/onboarding/verify":{"post":{"tags":["Onboarding"],"security":[{"ownerApiKey":[]}],"x-agentry-flow":"onboarding","operationId":"verify_onboarding","summary":"Establish source_verified from reviewed real execution","x-agentry-request-body":"none","description":"Send no body. Through the connected read-only PostHog OAuth query path, verification checks the short-lived proof property on every approved event/property and on the selected $exception failure marker/context. It separately checks trusted Agentry CI deploy attribution against the active proof session. No PostHog row is matched by an Agentry browser/server credential or public-key hash. If incomplete, follow the structured remaining analytics, safe_error, and deploy groups, run only those real paths, read the new ETag, and retry. Historical rows never satisfy this operation. Completion requires evidence_status.source=source_verified and a bounded source-verification receipt.","parameters":[{"$ref":"#/components/parameters/projectId"},{"$ref":"#/components/parameters/ifMatchCurrent"}],"responses":{"200":{"description":"Structured remaining source proof or a source_verified state and receipt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingV3VerifyResponse"}}}},"default":{"$ref":"#/components/responses/AgentError"}},"x-agentry-request-body-policy":{"kind":"none","max_bytes":0},"x-agentry-retry-policy":{"kind":"monotonic_state_machine","rationale":"Incomplete verification is read-only; a green receipt and proof completion commit atomically under the proving-state ETag.","idempotency_key_required":false}}},"/v1/onboarding/source-snapshot.mjs":{"get":{"operationId":"get_onboarding_source_snapshot_helper","summary":"Download the source snapshot helper","description":"Public Node 20+ helper. Run it before planning; after implementation and a clean commit run it with --final. It prints only the source snapshot accepted by start and proof.","tags":["Onboarding support"],"security":[],"x-agentry-flow":"onboarding","x-agentry-support-operation":true,"responses":{"200":{"description":"Executable ECMAScript module.","content":{"text/javascript":{"schema":{"type":"string"}}}},"304":{"description":"Cached helper is current."},"default":{"$ref":"#/components/responses/AgentError"}}}}},"count":6,"missing_operations":[],"components":{"securitySchemes":{"ownerApiKey":{"type":"http","scheme":"bearer","bearerFormat":"agentry_sk_"}},"parameters":{"projectId":{"name":"project_id","in":"path","required":true,"schema":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"}},"ifMatchStart":{"name":"If-Match","in":"header","required":false,"schema":{"type":"string","pattern":"^\"[A-Za-z0-9._:-]+\"$"},"description":"Omit only when no onboarding exists; replacing a current plan requires state.etag."},"ifMatchCurrent":{"name":"If-Match","in":"header","required":true,"schema":{"type":"string","pattern":"^\"[A-Za-z0-9._:-]+\"$"},"description":"Current state.etag. On 412, read state and retry only if still applicable."}},"schemas":{"OnboardingV3State":{"oneOf":[{"$ref":"#/components/schemas/OnboardingV3PlannedState"},{"$ref":"#/components/schemas/OnboardingV3ApprovedState"},{"$ref":"#/components/schemas/OnboardingV3ProvingState"},{"$ref":"#/components/schemas/OnboardingV3VerifiedState"}],"discriminator":{"propertyName":"status"}},"OnboardingV3StartRequest":{"type":"object","properties":{"intent":{"type":"string","const":"start"},"plan":{"$ref":"#/components/schemas/OnboardingV3Plan"}},"required":["intent","plan"],"additionalProperties":false},"OnboardingV3ReviewRequest":{"oneOf":[{"type":"object","properties":{"decision":{"type":"string","const":"approve"},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["decision","plan_sha256"],"additionalProperties":false},{"type":"object","properties":{"decision":{"type":"string","const":"replace"},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"replacement_plan":{"$ref":"#/components/schemas/OnboardingV3Plan"}},"required":["decision","plan_sha256","replacement_plan"],"additionalProperties":false}],"discriminator":{"propertyName":"decision"}},"OnboardingV3ProofStartRequest":{"type":"object","properties":{"implementation_source_snapshot":{"$ref":"#/components/schemas/OnboardingV3SourceSnapshot"}},"required":["implementation_source_snapshot"],"additionalProperties":false},"OnboardingV3ProofStartResponse":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/OnboardingV3ProvingState"},"one_time_markers":{"type":"object","properties":{"runtime":{"$ref":"#/components/schemas/OnboardingV3RuntimeProofMarker"},"ci":{"$ref":"#/components/schemas/OnboardingV3CiProofMarker"}},"required":["runtime","ci"],"additionalProperties":false}},"required":["state","one_time_markers"],"additionalProperties":false},"OnboardingV3VerifyResponse":{"oneOf":[{"type":"object","properties":{"ok":{"type":"boolean","const":false},"state":{"$ref":"#/components/schemas/OnboardingV3ProvingState"},"remaining":{"$ref":"#/components/schemas/OnboardingV3Remaining"}},"required":["ok","state","remaining"],"additionalProperties":false},{"type":"object","properties":{"ok":{"type":"boolean","const":true},"state":{"$ref":"#/components/schemas/OnboardingV3VerifiedState"},"remaining":{"$ref":"#/components/schemas/OnboardingV3Remaining"}},"required":["ok","state","remaining"],"additionalProperties":false}],"discriminator":{"propertyName":"ok"}},"OnboardingV3PlannedState":{"type":"object","properties":{"status":{"type":"string","const":"planned"},"installation_complete":{"type":"boolean","const":false},"evidence_status":{"type":"object","properties":{"historical":{"type":"string","enum":["not_established","historically_observed"]},"source":{"type":"string","const":"pending"}},"required":["historical","source"],"additionalProperties":false},"etag":{"type":"string","pattern":"^\"[A-Za-z0-9._:-]+\"$"},"next_action":{"$ref":"#/components/schemas/OnboardingV3PlannedNextAction"},"contract_version":{"type":"string","const":"3"},"project_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"onboarding_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"revision":{"type":"integer","minimum":1},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"updated_at":{"type":"integer","minimum":0},"plan":{"$ref":"#/components/schemas/OnboardingV3Plan"}},"required":["status","installation_complete","evidence_status","etag","next_action","contract_version","project_id","onboarding_id","revision","plan_sha256","updated_at","plan"],"additionalProperties":false},"OnboardingV3ApprovedState":{"type":"object","properties":{"status":{"type":"string","const":"approved"},"installation_complete":{"type":"boolean","const":false},"evidence_status":{"type":"object","properties":{"historical":{"type":"string","enum":["not_established","historically_observed"]},"source":{"type":"string","const":"pending"}},"required":["historical","source"],"additionalProperties":false},"etag":{"type":"string","pattern":"^\"[A-Za-z0-9._:-]+\"$"},"next_action":{"$ref":"#/components/schemas/OnboardingV3ApprovedNextAction"},"contract_version":{"type":"string","const":"3"},"project_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"onboarding_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"revision":{"type":"integer","minimum":1},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"updated_at":{"type":"integer","minimum":0},"approved_at":{"type":"integer","minimum":0},"plan":{"$ref":"#/components/schemas/OnboardingV3Plan"}},"required":["status","installation_complete","evidence_status","etag","next_action","contract_version","project_id","onboarding_id","revision","plan_sha256","updated_at","approved_at","plan"],"additionalProperties":false},"OnboardingV3ProvingState":{"type":"object","properties":{"status":{"type":"string","const":"proving"},"installation_complete":{"type":"boolean","const":false},"evidence_status":{"type":"object","properties":{"historical":{"type":"string","enum":["not_established","historically_observed"]},"source":{"type":"string","const":"pending"}},"required":["historical","source"],"additionalProperties":false},"etag":{"type":"string","pattern":"^\"[A-Za-z0-9._:-]+\"$"},"next_action":{"$ref":"#/components/schemas/OnboardingV3ProvingNextAction"},"contract_version":{"type":"string","const":"3"},"project_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"onboarding_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"revision":{"type":"integer","minimum":1},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"updated_at":{"type":"integer","minimum":0},"implementation_source_snapshot":{"$ref":"#/components/schemas/OnboardingV3SourceSnapshot"},"proof_session":{"type":"object","properties":{"proof_session_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"status":{"type":"string","const":"open"},"started_at":{"type":"integer","minimum":0},"expires_at":{"type":"integer","minimum":0}},"required":["proof_session_id","status","started_at","expires_at"],"additionalProperties":false},"plan":{"$ref":"#/components/schemas/OnboardingV3Plan"}},"required":["status","installation_complete","evidence_status","etag","next_action","contract_version","project_id","onboarding_id","revision","plan_sha256","updated_at","implementation_source_snapshot","proof_session","plan"],"additionalProperties":false},"OnboardingV3VerifiedState":{"type":"object","properties":{"status":{"type":"string","const":"verified"},"installation_complete":{"type":"boolean","const":true},"evidence_status":{"type":"object","properties":{"historical":{"type":"string","enum":["not_established","historically_observed"]},"source":{"type":"string","const":"source_verified"}},"required":["historical","source"],"additionalProperties":false},"etag":{"type":"string","pattern":"^\"[A-Za-z0-9._:-]+\"$"},"next_action":{"type":"null"},"contract_version":{"type":"string","const":"3"},"project_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"onboarding_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"revision":{"type":"integer","minimum":1},"plan_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"updated_at":{"type":"integer","minimum":0},"implementation_source_snapshot":{"$ref":"#/components/schemas/OnboardingV3SourceSnapshot"},"proof_session":{"type":"object","properties":{"proof_session_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$"},"status":{"type":"string","const":"satisfied"},"started_at":{"type":"integer","minimum":0},"expires_at":{"type":"integer","minimum":0}},"required":["proof_session_id","status","started_at","expires_at"],"additionalProperties":false},"receipt":{"$ref":"#/components/schemas/OnboardingV3VerifiedReceipt"},"plan":{"$ref":"#/components/schemas/OnboardingV3Plan"}},"required":["status","installation_complete","evidence_status","etag","next_action","contract_version","project_id","onboarding_id","revision","plan_sha256","updated_at","implementation_source_snapshot","proof_session","receipt","plan"],"additionalProperties":false},"AgentErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":160},"message":{"type":"string","minLength":1,"maxLength":2000},"next_action":{"type":"string","minLength":1,"maxLength":2000},"details":{"type":"object","additionalProperties":true}},"required":["code","message"],"additionalProperties":false}},"required":["error"],"additionalProperties":false},"OnboardingV3Plan":{"type":"object","properties":{"business_question":{"type":"string","minLength":1,"maxLength":1000},"plan_markdown":{"type":"string","minLength":1,"maxLength":65536,"description":"Human-readable actor or interacting actors, entry, complete connected value flow, first value, business result, failures, and deploy rationale. Multi-actor products include the producer/setup side through the consumer result. Never include credentials or raw telemetry."},"source_snapshot":{"$ref":"#/components/schemas/OnboardingV3SourceSnapshot"},"historical_evidence":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/OnboardingV3HistoricalEvidence"}],"description":"Null when no bounded PostHog history has established a matching signal. Historical rows are non-authorizing and never prove current source placement."},"milestones":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3Milestone"},"minItems":1,"description":"Every material durable transition in the selected value flow."},"failures":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3Failure"},"minItems":1,"contains":{"type":"object","required":["safe_live_proof"],"properties":{"safe_live_proof":{"type":"boolean","const":true}}},"minContains":1,"maxContains":1},"deploy":{"$ref":"#/components/schemas/OnboardingV3Deploy"}},"required":["business_question","plan_markdown","source_snapshot","historical_evidence","milestones","failures","deploy"],"additionalProperties":false},"OnboardingV3SourceSnapshot":{"type":"object","properties":{"git_head_sha":{"oneOf":[{"type":"string","pattern":"^[a-f0-9]{7,64}$"},{"type":"null"}]},"source_fingerprint_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"source_fingerprint_algorithm":{"type":"string","const":"agentry-source-tree-sha256-v1"}},"required":["git_head_sha","source_fingerprint_sha256","source_fingerprint_algorithm"],"additionalProperties":false},"OnboardingV3RuntimeProofMarker":{"type":"object","properties":{"property_name":{"type":"string","const":"agentry_onboarding_proof"},"value":{"type":"string","minLength":20,"maxLength":1000},"environment_variable":{"type":"string","const":"AGENTRY_ONBOARDING_PROOF"},"browser_session_storage_key":{"type":"string","const":"agentry_onboarding_proof"}},"required":["property_name","value","environment_variable","browser_session_storage_key"],"additionalProperties":false},"OnboardingV3CiProofMarker":{"type":"object","properties":{"header_name":{"type":"string","const":"X-Agentry-Onboarding-Proof"},"value":{"type":"string","minLength":20,"maxLength":1000},"environment_variable":{"type":"string","const":"AGENTRY_ONBOARDING_PROOF"}},"required":["header_name","value","environment_variable"],"additionalProperties":false},"OnboardingV3Remaining":{"type":"object","properties":{"analytics":{"type":"object","properties":{"blockers":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3ProofBlocker"}},"milestones":{"type":"array","items":{"type":"object","properties":{"milestone_index":{"type":"integer","minimum":0},"event":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"posthog_boundary":{"type":"string","enum":["browser_posthog","server_posthog"]}},"required":["milestone_index","event","posthog_boundary"],"additionalProperties":false}},"properties":{"type":"array","items":{"type":"object","properties":{"milestone_index":{"type":"integer","minimum":0},"event":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"properties":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."},"minItems":1,"description":"Approved keys that must be present and nonempty together on the proof-tagged PostHog event."},"requirement":{"type":"string","enum":["present_and_nonempty_together"]}},"required":["milestone_index","event","properties","requirement"],"additionalProperties":false}}},"required":["blockers","milestones","properties"],"additionalProperties":false},"safe_error":{"oneOf":[{"type":"null"},{"type":"object","properties":{"marker":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"posthog_boundary":{"type":"string","enum":["browser_posthog","server_posthog"]},"marker_missing":{"type":"boolean"},"context":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"context_requirement":{"type":"string","const":"present_and_nonempty_together"},"blockers":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3ProofBlocker"}}},"required":["marker","posthog_boundary","marker_missing","context","context_requirement","blockers"],"additionalProperties":false}]},"deploy":{"oneOf":[{"type":"null"},{"type":"object","properties":{"environment":{"type":"string","minLength":1,"maxLength":160},"blockers":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3ProofBlocker"},"minItems":1}},"required":["environment","blockers"],"additionalProperties":false}]}},"required":["analytics","safe_error","deploy"],"additionalProperties":false},"OnboardingV3PlannedNextAction":{"type":"object","properties":{"id":{"type":"string","const":"review_exact_plan"},"instruction":{"type":"string","const":"Show the bounded historical PostHog evidence, exact source-backed plan, and plan_sha256 to the human, then submit only their explicit approve or replace decision."},"requires_human":{"type":"boolean","const":true},"operation":{"type":"object","properties":{"method":{"type":"string","const":"POST"},"path":{"type":"string","minLength":1,"maxLength":500,"description":"Exact project-scoped operation that completes this action after its checklist."}},"required":["method","path"],"additionalProperties":false},"checklist":{"type":"array","prefixItems":[{"type":"string","const":"Show the historical evidence window and query receipt separately from the source targets, properties, safe error, deploy boundary, and plan_sha256."},{"type":"string","const":"State explicitly that historically_observed rows do not prove current source placement."},{"type":"string","const":"Wait for the human to explicitly approve the exact hash or request a replacement."},{"type":"string","const":"POST that decision with If-Match set to this state.etag."}],"minItems":4,"maxItems":4},"completion_condition":{"type":"string","const":"The returned state is approved for this exact plan_sha256."},"guide_anchor":{"type":"string","const":"https://github.com/agentry-sh/agentry/blob/main/INSTALL.md#4-review-and-approve-the-exact-plan"}},"required":["id","instruction","requires_human","operation","checklist","completion_condition","guide_anchor"],"additionalProperties":false},"OnboardingV3ApprovedNextAction":{"type":"object","properties":{"id":{"type":"string","const":"instrument_and_start_proof"},"instruction":{"type":"string","const":"Implement the approved plan through the customer's existing official PostHog SDKs, test it, commit a clean tree, capture the final source snapshot, then start proof."},"requires_human":{"type":"boolean","const":false},"operation":{"type":"object","properties":{"method":{"type":"string","const":"POST"},"path":{"type":"string","minLength":1,"maxLength":500,"description":"Exact project-scoped operation that completes this action after its checklist."}},"required":["method","path"],"additionalProperties":false},"checklist":{"type":"array","prefixItems":[{"type":"string","const":"Use the customer's existing official PostHog SDK configuration; Agentry issues no browser or server telemetry credential."},{"type":"string","const":"Add every approved direct-to-PostHog analytics and error capture while preserving correct existing telemetry."},{"type":"string","const":"Add the short-lived proof property only when its browser session-storage or trusted server environment value is present; never bundle a marker."},{"type":"string","const":"Run relevant tests, commit a clean shipped tree, and capture its final source snapshot."},{"type":"string","const":"POST the final snapshot with If-Match set to this state.etag."}],"minItems":5,"maxItems":5},"completion_condition":{"type":"string","const":"The returned state is proving and fresh runtime and CI proof markers were received."},"guide_anchor":{"type":"string","const":"https://github.com/agentry-sh/agentry/blob/main/INSTALL.md#5-apply-approved-telemetry-changes-directly-to-posthog"}},"required":["id","instruction","requires_human","operation","checklist","completion_condition","guide_anchor"],"additionalProperties":false},"OnboardingV3ProvingNextAction":{"type":"object","properties":{"id":{"type":"string","const":"exercise_and_verify"},"instruction":{"type":"string","const":"Deploy the approved final source with the CI marker, then exercise every approved real milestone and safe error with the short-lived PostHog proof property, then verify."},"requires_human":{"type":"boolean","const":false},"operation":{"type":"object","properties":{"method":{"type":"string","const":"POST"},"path":{"type":"string","minLength":1,"maxLength":500,"description":"Exact project-scoped operation that completes this action after its checklist."}},"required":["method","path"],"additionalProperties":false},"checklist":{"type":"array","prefixItems":[{"type":"string","const":"If either one-time marker was not received, is unavailable, or expired, reread state and restart the proof operation with the same final snapshot and current ETag; keep only the new pair. This is the sole recovery exception to next_action.operation."},{"type":"string","const":"For browser_posthog proof, set the marker only in sessionStorage.agentry_onboarding_proof for the proof tab. For server_posthog proof, set AGENTRY_ONBOARDING_PROOF only in the trusted runtime."},{"type":"string","const":"Attach that exact marker as the agentry_onboarding_proof property on the approved PostHog analytics and exception captures; it is correlation data, never authorization."},{"type":"string","const":"Run the reviewed real deploy with the CI proof marker and final source fingerprint so the committed instrumentation is live."},{"type":"string","const":"Exercise every approved milestone through the real product with that runtime proof marker."},{"type":"string","const":"Exercise the one approved non-mutating safe error with the runtime proof marker."},{"type":"string","const":"POST a bodyless verify request with If-Match set to this state.etag; repeat only returned remaining work."}],"minItems":7,"maxItems":7},"completion_condition":{"type":"string","const":"The returned state has evidence_status.source source_verified, installation_complete true, and next_action null."},"guide_anchor":{"type":"string","const":"https://github.com/agentry-sh/agentry/blob/main/INSTALL.md#6-prove-the-deployed-result"}},"required":["id","instruction","requires_human","operation","checklist","completion_condition","guide_anchor"],"additionalProperties":false},"OnboardingV3VerifiedReceipt":{"type":"object","properties":{"evidence_status":{"type":"string","const":"source_verified"},"source_verified_at":{"type":"integer","minimum":0},"analytics":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3ObservedMilestone"},"minItems":1},"error":{"type":"object","properties":{"marker":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"posthog_boundary":{"type":"string","enum":["browser_posthog","server_posthog"]},"required_context":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"observed_context":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"row_count":{"type":"integer","minimum":1}},"required":["marker","posthog_boundary","required_context","observed_context","row_count"],"additionalProperties":false},"deploy":{"type":"object","properties":{"environment":{"type":"string","minLength":1,"maxLength":160},"source_snapshot":{"$ref":"#/components/schemas/OnboardingV3SourceSnapshot"},"row_count":{"type":"integer","minimum":1}},"required":["environment","source_snapshot","row_count"],"additionalProperties":false}},"required":["evidence_status","source_verified_at","analytics","error","deploy"],"additionalProperties":false},"OnboardingV3HistoricalEvidence":{"type":"object","properties":{"status":{"type":"string","const":"historically_observed"},"source":{"type":"string","const":"posthog_cloud"},"posthog_project_id":{"type":"integer","minimum":1},"observed_at":{"type":"integer","minimum":0},"window":{"type":"object","properties":{"from":{"type":"integer","minimum":0},"to":{"type":"integer","minimum":0}},"required":["from","to"],"additionalProperties":false},"query_receipt_sha256":{"type":"string","pattern":"^[a-f0-9]{64}$"},"observations":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3HistoricalObservation"},"minItems":1,"maxItems":200,"description":"Bounded counts, timestamps, signal identifiers, and property identifiers from PostHog. This is non-authorizing historical evidence, never source proof."}},"required":["status","source","posthog_project_id","observed_at","window","query_receipt_sha256","observations"],"additionalProperties":false},"OnboardingV3Milestone":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"meaning":{"type":"string","minLength":1,"maxLength":1000,"description":"Durable value progress proved after this target succeeds."},"posthog_boundary":{"type":"string","enum":["browser_posthog","server_posthog"]},"properties":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"targets":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3SourceTarget"},"minItems":1}},"required":["event","meaning","posthog_boundary","properties","targets"],"additionalProperties":false},"OnboardingV3Failure":{"type":"object","properties":{"marker":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"meaning":{"type":"string","minLength":1,"maxLength":1000,"description":"Business-impacting failure proved at this exact exit."},"posthog_boundary":{"type":"string","enum":["browser_posthog","server_posthog"]},"context":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"safe_live_proof":{"type":"boolean"},"targets":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3SourceTarget"},"minItems":1}},"required":["marker","meaning","posthog_boundary","context","safe_live_proof","targets"],"additionalProperties":false},"OnboardingV3Deploy":{"type":"object","properties":{"environment":{"type":"string","minLength":1,"maxLength":160},"sha_source":{"type":"string","enum":["git_head"]},"targets":{"type":"array","items":{"$ref":"#/components/schemas/OnboardingV3SourceTarget"},"minItems":1}},"required":["environment","sha_source","targets"],"additionalProperties":false},"OnboardingV3ProofBlocker":{"type":"string","enum":["proof_session_project_mismatch","proof_session_not_active","proof_session_outside_window","runtime_marker_binding_invalid","ci_credential_binding_unavailable","source_git_sha_missing","analytics_read_failed","safe_error_read_failed","deploy_read_failed","deploy_not_observed"]},"OnboardingV3ObservedMilestone":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":200,"description":"Repository-chosen opaque value; spelling is not an acceptance signal."},"posthog_boundary":{"type":"string","enum":["browser_posthog","server_posthog"]},"required_properties":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"observed_properties":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."}},"row_count":{"type":"integer","minimum":1}},"required":["event","posthog_boundary","required_properties","observed_properties","row_count"],"additionalProperties":false},"OnboardingV3HistoricalObservation":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"analytics"},"event":{"type":"string","minLength":1,"maxLength":200,"description":"PostHog event identifier; never a payload sample."},"observed_properties":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."},"maxItems":100,"description":"Bounded property identifiers only; never raw values or payload samples."},"row_count":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","event","observed_properties","row_count"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"error"},"issue_id":{"type":"string","minLength":8,"maxLength":200,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:-]*$","description":"Stable PostHog Error Tracking issue identifier; never an error message."},"observed_properties":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160,"description":"Repository-chosen opaque key available at this exact boundary. Direct personal data and secret keys are rejected."},"maxItems":100,"description":"Bounded property identifiers only; never raw values or payload samples."},"row_count":{"type":"integer","minimum":1,"maximum":9007199254740991}},"required":["kind","issue_id","observed_properties","row_count"],"additionalProperties":false}],"discriminator":{"propertyName":"kind"}},"OnboardingV3SourceTarget":{"type":"object","properties":{"file":{"type":"string","minLength":1,"maxLength":800,"description":"Repository-relative shipped source or configuration path."},"anchor":{"type":"string","minLength":1,"maxLength":500,"description":"Exact source text locating the outcome boundary in this file."}},"required":["file","anchor"],"additionalProperties":false}},"responses":{"AgentError":{"description":"Agent-readable failure with a stable code and recovery action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentErrorResponse"}}}}}},"component_mode":"reachable_references","canonical_url":"/v1/openapi.json","next_action":"Follow the flow transitions in order. Use paths[path][method] for flow operations, then query /v1/openapi.json?path=...&method=... when you need one operation in isolation."}