-- Gate steps per agent type (auto-generated from Excel)

-- === Agent I (I) ===
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (1, (SELECT id FROM gates WHERE gate_number = 0), 'I', 'Submit request (Request form)', 'Requestor submits basic request; Product ensures it is logged and routed.', 0);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (2, (SELECT id FROM gates WHERE gate_number = 0), 'I', 'Create/Update Agent Registry (Cat I)', 'Product creates registry entry with mandatory fields (purpose/description/owner/team/status).', 1);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (3, (SELECT id FROM gates WHERE gate_number = 0), 'I', 'Confirm triggers (data? connectors? actions? cost?)', 'Record whether agent touches sensitive data, uses connectors, performs write/actions, or may incur notable cost.', 2);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (4, (SELECT id FROM gates WHERE gate_number = 0), 'I', 'Tailoring recorded (Cat I lightweight path)', 'Document that Cat I follows lightweight path unless triggers are true.', 3);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (5, (SELECT id FROM gates WHERE gate_number = 0), 'I', 'Registry & Tailoring approved? (G0)', 'Product confirms registry complete and triggers assessed; Tech Lead confirms classification makes sense.', 4);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (6, (SELECT id FROM gates WHERE gate_number = 1), 'I', 'Define internal use case', 'Capture why it’s being built and who uses it internally.', 5);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (7, (SELECT id FROM gates WHERE gate_number = 1), 'I', 'Define success criteria', 'Define measurable internal outcome (time saved, quality, reduction in errors).', 6);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (8, (SELECT id FROM gates WHERE gate_number = 1), 'I', 'Approved for internal use? (G1)', 'Product confirms use case + success criteria exist and use is internal-only.', 7);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (9, (SELECT id FROM gates WHERE gate_number = 3), 'I', 'Define capabilities & boundaries (can/can’t do)', 'Document boundaries to prevent misuse and scope creep.', 8);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (10, (SELECT id FROM gates WHERE gate_number = 3), 'I', 'Define basic evaluation approach (sanity prompt set)', 'Create a small prompt set to validate outputs and basic safety.', 9);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (11, (SELECT id FROM gates WHERE gate_number = 3), 'I', 'If triggered: data handling notes', 'Define permitted data, retention, and redaction approach if any sensitive data exists.', 10);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (12, (SELECT id FROM gates WHERE gate_number = 3), 'I', 'If triggered: security/compliance quick check', 'Confirm connectors/permissions are appropriate and basic controls are in place.', 11);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (13, (SELECT id FROM gates WHERE gate_number = 3), 'I', 'Concept Approved? (G3 - trigger-based)', 'Only used if triggers are true; confirm concept controls are sufficient before broader use.', 12);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (14, (SELECT id FROM gates WHERE gate_number = 5), 'I', 'Build/configure agent', 'Implement or configure the agent and store version/config references.', 13);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (15, (SELECT id FROM gates WHERE gate_number = 5), 'I', 'Run sanity prompt set (basic evaluation)', 'Run quick tests; fix obvious issues; document limitations.', 14);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (16, (SELECT id FROM gates WHERE gate_number = 5), 'I', 'Tag version (v1)', 'Record a version so future changes are traceable.', 15);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (17, (SELECT id FROM gates WHERE gate_number = 5), 'I', 'Ready for internal use? (G5)', 'Product confirms basic evaluation done, version tagged, and limitations documented.', 16);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (18, (SELECT id FROM gates WHERE gate_number = 7), 'I', 'Runbook/support notes delivered (if broad use/critical)', 'If the agent becomes business-critical or widely used, provide runbook/troubleshooting notes.', 17);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (19, (SELECT id FROM gates WHERE gate_number = 7), 'I', 'Support model confirmed (ownership + escalation)', 'Confirm who supports it, escalation path, and ownership.', 18);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (20, (SELECT id FROM gates WHERE gate_number = 7), 'I', 'Handover completed? (G7 - trigger-based)', 'Confirm support acceptance only when triggered by criticality/scale.', 19);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (21, (SELECT id FROM gates WHERE gate_number = 11), 'I', 'Usage monitoring (basic)', 'Track basic usage/adoption; ensure it remains internal-only.', 20);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (22, (SELECT id FROM gates WHERE gate_number = 12), 'I', 'Deprecate/archive agent in registry', 'Update registry status and communicate internally if needed.', 21);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (23, (SELECT id FROM gates WHERE gate_number = 12), 'I', 'Revoke connectors/permissions (if any)', 'Remove access and integrations to close exposure.', 22);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (24, (SELECT id FROM gates WHERE gate_number = 12), 'I', 'EOL complete? (G12)', 'Confirm archived, access revoked (if applicable), and no remaining use.', 23);

-- === Agent IB (IB) ===
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (25, (SELECT id FROM gates WHERE gate_number = 0), 'IB', 'Submit request (Request form)', 'Requestor submits request; Product logs and routes.', 0);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (26, (SELECT id FROM gates WHERE gate_number = 0), 'IB', 'Create/Update Agent Registry (Cat IB)', 'Create registry entry with mandatory fields; ensure category IB recorded.', 1);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (27, (SELECT id FROM gates WHERE gate_number = 0), 'IB', 'Confirm triggers (high cost + data/connectors/actions)', 'Confirm high-cost trigger and any data/connector/action risks.', 2);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (28, (SELECT id FROM gates WHERE gate_number = 0), 'IB', 'Define cost controls (budget/limits/kill switch/alerts)', 'Set budget thresholds, alerts, and kill switch procedure with named owner.', 3);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (29, (SELECT id FROM gates WHERE gate_number = 0), 'IB', 'Tailoring recorded (IB path)', 'Document required gates for IB (cost governance, monitoring, beta/pilot, reviews).', 4);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (30, (SELECT id FROM gates WHERE gate_number = 0), 'IB', 'Tailoring approved? (G0)', 'Product confirms registry complete + cost controls defined; Finance confirms budget/alerts are acceptable.', 5);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (31, (SELECT id FROM gates WHERE gate_number = 1), 'IB', 'Define internal use case + success criteria', 'Capture internal value and measurable outcomes.', 6);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (32, (SELECT id FROM gates WHERE gate_number = 1), 'IB', 'Rough cost-of-run estimate', 'Estimate cost per run and expected usage band; identify whether it’s sustainably within budget.', 7);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (33, (SELECT id FROM gates WHERE gate_number = 1), 'IB', 'Approved to prioritise? (G1)', 'Sponsor approves investment in higher-cost internal agent.', 8);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (34, (SELECT id FROM gates WHERE gate_number = 2), 'IB', 'Create sizing tickets (build + eval + monitoring)', 'Create work items including monitoring and cost governance tasks.', 9);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (35, (SELECT id FROM gates WHERE gate_number = 2), 'IB', 'Prioritise vs other work', 'Rank against other initiatives given cost profile.', 10);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (36, (SELECT id FROM gates WHERE gate_number = 2), 'IB', 'Prioritisation Approved? (G2)', 'Confirm backlog position is agreed.', 11);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (37, (SELECT id FROM gates WHERE gate_number = 3), 'IB', 'Define capabilities & boundaries', 'Define what it can/can’t do; avoid misuse internally.', 12);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (38, (SELECT id FROM gates WHERE gate_number = 3), 'IB', 'Define safety controls (internal guardrails)', 'Define guardrails appropriate for internal use; include human escalation if needed.', 13);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (39, (SELECT id FROM gates WHERE gate_number = 3), 'IB', 'Define evaluation plan (test set, pass/fail)', 'Create measurable quality checks.', 14);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (40, (SELECT id FROM gates WHERE gate_number = 3), 'IB', 'Define data handling rules (if data)', 'Define allowed data sources and retention rules.', 15);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (41, (SELECT id FROM gates WHERE gate_number = 3), 'IB', 'Concept Approved? (G3)', 'Confirm evaluation approach + monitoring needs + cost controls are aligned before build.', 16);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (42, (SELECT id FROM gates WHERE gate_number = 4), 'IB', 'Monitoring design (usage + cost)', 'Design dashboards and alerts for spend and usage.', 17);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (43, (SELECT id FROM gates WHERE gate_number = 4), 'IB', 'Permissions/connector review (if applicable)', 'Approve connectors and least-privilege access.', 18);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (44, (SELECT id FROM gates WHERE gate_number = 4), 'IB', 'Versioning/material-change policy', 'Define when changes require re-check (model/prompt/connectors).', 19);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (45, (SELECT id FROM gates WHERE gate_number = 4), 'IB', 'Design Approved? (G4)', 'Confirm monitoring, permissions and change policy ready.', 20);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (46, (SELECT id FROM gates WHERE gate_number = 5), 'IB', 'Build agent', 'Implement and configure agent; track version.', 21);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (47, (SELECT id FROM gates WHERE gate_number = 5), 'IB', 'Evaluation run + cost burn test', 'Run burn test; validate spend within limits; run evaluation set.', 22);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (48, (SELECT id FROM gates WHERE gate_number = 5), 'IB', 'Release candidate tagged', 'Tag reproducible build/config.', 23);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (49, (SELECT id FROM gates WHERE gate_number = 5), 'IB', 'Build complete? (G5)', 'Confirm evaluation passed, burn test OK, RC tagged, known issues recorded.', 24);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (50, (SELECT id FROM gates WHERE gate_number = 6), 'IB', 'Deployment plan + rollback/kill switch confirmed', 'Ensure kill switch works and rollback is possible.', 25);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (51, (SELECT id FROM gates WHERE gate_number = 6), 'IB', 'Confirm cost monitoring + limits live', 'Alerts/dashboards tested and owners assigned.', 26);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (52, (SELECT id FROM gates WHERE gate_number = 6), 'IB', 'Hypercare plan (internal)', 'Define internal hypercare coverage if business-critical.', 27);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (53, (SELECT id FROM gates WHERE gate_number = 6), 'IB', 'Launch ready? (G6)', 'Confirm ready for pilot rollout with spend controls and monitoring active.', 28);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (54, (SELECT id FROM gates WHERE gate_number = 7), 'IB', 'Runbook/support notes delivered', 'Provide troubleshooting notes for internal BAU.', 29);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (55, (SELECT id FROM gates WHERE gate_number = 7), 'IB', 'Support model confirmed (ownership + escalation)', 'Assign owner and escalation path; ensure cost alerts are routed.', 30);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (56, (SELECT id FROM gates WHERE gate_number = 7), 'IB', 'Handover completed? (G7)', 'Support accepts ownership.', 31);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (57, (SELECT id FROM gates WHERE gate_number = 10), 'IB', 'Internal pilot/beta (limited users)', 'Limit audience; monitor spend and quality.', 32);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (58, (SELECT id FROM gates WHERE gate_number = 10), 'IB', 'Beta monitoring window', 'Track spend vs budget; report anomalies.', 33);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (59, (SELECT id FROM gates WHERE gate_number = 10), 'IB', 'Beta Exit Approved? (G10)', 'Approve scale-up or return to fix.', 34);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (60, (SELECT id FROM gates WHERE gate_number = 11), 'IB', 'Cost monitoring vs budget', 'Ongoing spend governance and reporting.', 35);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (61, (SELECT id FROM gates WHERE gate_number = 11), 'IB', 'Quarterly review (keep/optimise/deprecate)', 'Review value vs cost; decide continue or retire.', 36);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (62, (SELECT id FROM gates WHERE gate_number = 11), 'IB', 'Exit hypercare? (G11)', 'Confirm stable operations and controlled spend.', 37);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (63, (SELECT id FROM gates WHERE gate_number = 12), 'IB', 'Deprecate/archive + revoke permissions/connectors', 'Archive agent; revoke access; stop any ongoing spend.', 38);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (64, (SELECT id FROM gates WHERE gate_number = 12), 'IB', 'EOL complete? (G12)', 'Confirm archived, access revoked, spend ended, data handled if applicable.', 39);

-- === Agent II (II) ===
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (65, (SELECT id FROM gates WHERE gate_number = 0), 'II', 'Submit request (Request form)', 'Requestor submits; Product logs/routes.', 0);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (66, (SELECT id FROM gates WHERE gate_number = 0), 'II', 'Create/Update Agent Registry (Cat II)', 'Create registry entry; ensure category II recorded and visible.', 1);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (67, (SELECT id FROM gates WHERE gate_number = 0), 'II', 'Confirm triggers (client-facing + data + connectors + actions + cost)', 'Confirm client exposure, data sensitivity, connectors, permissions/actions, and likely cost/usage.', 2);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (68, (SELECT id FROM gates WHERE gate_number = 0), 'II', 'Create tailoring document (Cat II required gates)', 'Document required gates and approvers; include cost governance steps when triggered.', 3);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (69, (SELECT id FROM gates WHERE gate_number = 0), 'II', 'Define cost controls (recommended/triggered)', 'Set budgets/alerts/limits when usage could be significant; assign cost owner; define kill switch if needed.', 4);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (70, (SELECT id FROM gates WHERE gate_number = 0), 'II', 'Tailoring Approved? (G0)', 'Confirm governance path, ownership, risk controls, and cost controls (where triggered) before progressing.', 5);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (71, (SELECT id FROM gates WHERE gate_number = 1), 'II', 'Define client use case', 'Define who uses it, where, why; align with account/client workflow.', 6);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (72, (SELECT id FROM gates WHERE gate_number = 1), 'II', 'Define success criteria', 'Define measurable client outcomes and internal success measures.', 7);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (73, (SELECT id FROM gates WHERE gate_number = 1), 'II', 'Define intended use boundaries (must not do)', 'Write prohibited uses, escalation and safe-use constraints for client exposure.', 8);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (74, (SELECT id FROM gates WHERE gate_number = 1), 'II', 'Ideation Approved? (G1)', 'Sponsor approves moving forward; ensure boundaries and viability understood.', 9);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (75, (SELECT id FROM gates WHERE gate_number = 2), 'II', 'Size + prioritise', 'Sizing and ranking vs other work; include cost/effort implications.', 10);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (76, (SELECT id FROM gates WHERE gate_number = 2), 'II', 'Prioritisation Approved? (G2)', 'Confirm capacity and sequencing decision; ensure cost impact accepted.', 11);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (77, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Capabilities & boundaries', 'Define scope and behavior boundaries.', 12);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (78, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Safety controls (guardrails + escalation/human handoff)', 'Define guardrails, refusal rules, and handoff to humans.', 13);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (79, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Evaluation plan (test set, pass/fail)', 'Define measurable quality/safety test set and thresholds.', 14);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (80, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Data handling rules', 'Define data sources, retention, and redaction; confirm acceptable use.', 15);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (81, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Compliance review', 'Formal sign-off on risk posture.', 16);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (82, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Legal review (waiver/MSA needs)', 'Confirm waivers/terms/disclaimers needed for client exposure.', 17);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (83, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Cost-of-run estimate + cost governance approach', 'Estimate cost per run and expected usage; confirm how spend is governed/allocated.', 18);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (84, (SELECT id FROM gates WHERE gate_number = 3), 'II', 'Concept Approved? (G3)', 'Approve concept only when safety/data/legal/support/cost stance is acceptable.', 19);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (85, (SELECT id FROM gates WHERE gate_number = 4), 'II', 'Architecture/security design (permissions, connectors)', 'Approve connector usage and least privilege.', 20);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (86, (SELECT id FROM gates WHERE gate_number = 4), 'II', 'Monitoring design (usage + safety incidents + cost)', 'Define dashboards for usage, safety events, and costs; alert routing.', 21);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (87, (SELECT id FROM gates WHERE gate_number = 4), 'II', 'Waiver/MSA finalised (if required)', 'Complete contractual/waiver steps.', 22);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (88, (SELECT id FROM gates WHERE gate_number = 4), 'II', 'Versioning/material-change policy', 'Define which changes force revalidation (model/prompt/connectors/data).', 23);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (89, (SELECT id FROM gates WHERE gate_number = 4), 'II', 'Design Approved? (G4)', 'Confirm permissions, monitoring, versioning, legal readiness and cost monitoring readiness.', 24);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (90, (SELECT id FROM gates WHERE gate_number = 5), 'II', 'Build agent', 'Implement agent per design.', 25);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (91, (SELECT id FROM gates WHERE gate_number = 5), 'II', 'Eval + safety tests', 'Run eval suite; capture evidence.', 26);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (92, (SELECT id FROM gates WHERE gate_number = 5), 'II', 'Release candidate tagged', 'Tag deployable version/config.', 27);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (93, (SELECT id FROM gates WHERE gate_number = 5), 'II', 'Cost burn test (if triggered by volume/cost)', 'Run burn test; confirm spend within limits; adjust controls if needed.', 28);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (94, (SELECT id FROM gates WHERE gate_number = 5), 'II', 'Red-team lite (misuse prompts)', 'Run misuse prompts; confirm no critical unsafe behavior.', 29);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (95, (SELECT id FROM gates WHERE gate_number = 5), 'II', 'Build Complete? (G5)', 'Confirm tests passed, cost within limits (if triggered), RC tagged, known issues recorded.', 30);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (96, (SELECT id FROM gates WHERE gate_number = 6), 'II', 'Deployment plan + rollback/kill switch', 'Define safe release and rollback for client exposure.', 31);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (97, (SELECT id FROM gates WHERE gate_number = 6), 'II', 'Hypercare plan', 'Plan stabilisation coverage.', 32);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (98, (SELECT id FROM gates WHERE gate_number = 6), 'II', 'Training + comms plan (internal + client)', 'Prepare client enablement and internal readiness.', 33);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (99, (SELECT id FROM gates WHERE gate_number = 6), 'II', 'Legal approval confirmed', 'Final legal sign-off for client use.', 34);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (100, (SELECT id FROM gates WHERE gate_number = 6), 'II', 'Cost controls live + monitoring alerts tested (if triggered)', 'Ensure spend monitoring and alerts are live before client rollout.', 35);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (101, (SELECT id FROM gates WHERE gate_number = 6), 'II', 'Launch Ready? (G6)', 'Approve readiness across ops/legal/security/cost before client exposure.', 36);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (102, (SELECT id FROM gates WHERE gate_number = 7), 'II', 'Runbook/support notes delivered', 'Provide troubleshooting and escalation docs.', 37);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (103, (SELECT id FROM gates WHERE gate_number = 7), 'II', 'Support model confirmed (ownership + escalation)', 'Confirm BAU ownership and escalation chain.', 38);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (104, (SELECT id FROM gates WHERE gate_number = 7), 'II', 'Service desk routing configured (recommended)', 'Set ticket routing and categories if using service desk.', 39);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (105, (SELECT id FROM gates WHERE gate_number = 7), 'II', 'Handover completed? (G7)', 'Support accepts ownership and readiness.', 40);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (106, (SELECT id FROM gates WHERE gate_number = 8), 'II', 'Deploy to staging', 'Deploy RC to staging environment.', 41);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (107, (SELECT id FROM gates WHERE gate_number = 8), 'II', 'Smoke/regression tests', 'Run staging tests; log defects.', 42);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (108, (SELECT id FROM gates WHERE gate_number = 8), 'II', 'Staging Approved? (G8)', 'Confirm staging stable for UAT.', 43);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (109, (SELECT id FROM gates WHERE gate_number = 9), 'II', 'Execute UAT plan', 'Run UAT scripts with stakeholders/clients; record evidence.', 44);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (110, (SELECT id FROM gates WHERE gate_number = 9), 'II', 'Client sign-off', 'Obtain client acceptance.', 45);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (111, (SELECT id FROM gates WHERE gate_number = 9), 'II', 'Verify disclaimers/terms in experience', 'Confirm disclosures/terms are correctly presented.', 46);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (112, (SELECT id FROM gates WHERE gate_number = 9), 'II', 'UAT Passed? (G9)', 'Approve UAT completion and acceptance.', 47);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (113, (SELECT id FROM gates WHERE gate_number = 10), 'II', 'Go/No-Go decision', 'Formal go/no-go with reason-based rollback paths.', 48);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (114, (SELECT id FROM gates WHERE gate_number = 10), 'II', 'Deploy to live', 'Execute go-live.', 49);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (115, (SELECT id FROM gates WHERE gate_number = 10), 'II', 'Production verification / smoke checks', 'Verify key flows and monitoring.', 50);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (116, (SELECT id FROM gates WHERE gate_number = 10), 'II', 'Beta pilot + monitoring window (required)', 'Run beta with limited exposure; monitor incidents and spend.', 51);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (117, (SELECT id FROM gates WHERE gate_number = 10), 'II', 'Beta Exit / Live Accepted? (G10)', 'Approve move from beta to broader use.', 52);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (118, (SELECT id FROM gates WHERE gate_number = 11), 'II', 'Hypercare monitoring + incident handling', 'Operate hypercare; resolve incidents.', 53);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (119, (SELECT id FROM gates WHERE gate_number = 11), 'II', 'Track success/adoption', 'Monitor KPIs and adoption.', 54);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (120, (SELECT id FROM gates WHERE gate_number = 11), 'II', 'Track cost vs budget (if triggered)', 'Track spend vs budget; adjust controls.', 55);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (121, (SELECT id FROM gates WHERE gate_number = 11), 'II', 'Quarterly recertification review', 'Review safety, data, access and material changes.', 56);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (122, (SELECT id FROM gates WHERE gate_number = 11), 'II', 'Exit Hypercare? (G11)', 'Exit hypercare when stable and outcomes acceptable.', 57);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (123, (SELECT id FROM gates WHERE gate_number = 12), 'II', 'Deprecate + offboard + clean data + archive', 'Plan deprecation; offboard users; ensure safe data handling.', 58);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (124, (SELECT id FROM gates WHERE gate_number = 12), 'II', 'Archive registry + revoke permissions/connectors', 'Revoke access/integrations and archive the agent.', 59);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (125, (SELECT id FROM gates WHERE gate_number = 12), 'II', 'EOL Complete? (G12)', 'Confirm no users, no access, cost closed, and data handled per policy.', 60);

-- === Agent III (III) ===
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (126, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Submit request (Request form)', 'Requestor submits request; Product ensures request is logged/triaged; Sponsor aware of intent.', 0);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (127, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Create/Update Agent Registry', 'Product creates/updates registry record with mandatory fields; Tech Lead validates technical description; others are aware for early visibility.', 1);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (128, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Confirm triggers (commercial + client facing + cost)', 'Product records triggers and implications; consulted roles confirm trigger accuracy and required controls.', 2);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (129, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Create tailoring document', 'Product drafts tailoring doc listing gates/artefacts/approvers; consulted roles confirm required reviews and artefacts for this agent.', 3);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (130, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Define cost controls (budget/limits/kill switch/alerts)', 'Tech Lead designs budgets/limits/alerts/kill switch; Finance sets thresholds/owner; Security/IT confirms feasible enforcement.', 4);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (131, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Draft commercial intent (sell model)', 'Commercial defines how it will be sold, to whom, and in what form; Finance sanity checks economics; Sales confirms buyer/client reality.', 5);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (132, (SELECT id FROM gates WHERE gate_number = 0), 'III', 'Tailoring approved? (G0)', 'Product gathers sign-offs; approvers confirm classification, triggers, owners, cost controls, and tailoring are correct.', 6);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (133, (SELECT id FROM gates WHERE gate_number = 1), 'III', 'Define buyer/client use case', 'Product documents use case and target users; Sales/Commercial confirm market/client need; Tech Lead sanity checks feasibility; Sponsor owns decision to proceed.', 7);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (134, (SELECT id FROM gates WHERE gate_number = 1), 'III', 'Define success criteria (business + client)', 'Product defines measurable outcomes; Commercial validates relevance; Sponsor approves success targets.', 8);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (135, (SELECT id FROM gates WHERE gate_number = 1), 'III', 'Define intended use boundaries', 'Compliance drafts do/don’t boundaries and prohibited uses; Legal confirms enforceable wording; Product ensures incorporated into requirements.', 9);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (136, (SELECT id FROM gates WHERE gate_number = 1), 'III', 'Ideation approved? (G1)', 'Sponsor approves moving forward; Product confirms artifacts exist; Commercial/Sales confirm viability.', 10);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (137, (SELECT id FROM gates WHERE gate_number = 2), 'III', 'Sizing + Dependencies', 'Tech Lead provides effort/dependencies; Product captures in sizing tickets; CS/Support flags operational constraints.', 11);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (138, (SELECT id FROM gates WHERE gate_number = 2), 'III', 'Cost-of-run estimate', 'Tech Lead estimates cost per run/usage; Finance validates approach; Commercial compares to pricing hypothesis.', 12);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (139, (SELECT id FROM gates WHERE gate_number = 2), 'III', 'Prioritise', 'Product ranks vs other work; Sponsor/Commercial/Finance confirm priority and investment logic.', 13);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (140, (SELECT id FROM gates WHERE gate_number = 2), 'III', 'Prioritise approved? (G2)', 'Product records final priority decision; consulted roles agree; Exec/Gov only involved if governance escalation/capacity conflict.', 14);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (141, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Capabilities & boundaries', 'Product defines what agent can/can’t do and scope boundaries; Tech Lead validates feasibility; Compliance ensures boundaries align to policy.', 15);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (142, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Safety controls + escalation/handoff', 'Compliance defines guardrails/refusals/human handoff; CS/Support confirms escalation practical; Tech Lead confirms implementable.', 16);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (143, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Evaluation plan + test set', 'QA builds test set and pass/fail criteria; Compliance defines safety checks; Product agrees acceptance standards.', 17);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (144, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Data handling rules', 'Compliance defines allowed data sources/retention/redaction; Security/IT validates controls; Legal confirms contractual compliance.', 18);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (145, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Compliance review', 'Compliance formally signs off concept risk posture and required controls.', 19);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (146, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Legal review', 'Legal confirms waiver/MSA/terms/disclaimers path and any constraints.', 20);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (147, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Commercial review (PPPP draft)', 'Commercial drafts Positioning/Pricing/Packaging/Proposition; Finance sanity checks; Marketing provides messaging input; Product aligns requirements.', 21);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (148, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Liability/support stance draft', 'Legal drafts liability/disclaimer/support stance; Support confirms operationally feasible; Commercial ensures aligns to offer.', 22);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (149, (SELECT id FROM gates WHERE gate_number = 3), 'III', 'Concept approved? (G3)', 'Product confirms concept artifacts complete and collects approvals; consulted reviewers sign off risk, viability, and support stance.', 23);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (150, (SELECT id FROM gates WHERE gate_number = 4), 'III', 'Architecture + security design (permissions + connectors)', 'Architecture defines design decisions; Security/IT approves permissions/connectors; Compliance confirms policy alignment.', 24);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (151, (SELECT id FROM gates WHERE gate_number = 4), 'III', 'Monitoring design (usage, costs, safety, incidents)', 'Tech Lead defines metrics/alerts; Finance ensures cost metrics; Support ensures operational usefulness; Compliance ensures safety monitoring.', 25);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (152, (SELECT id FROM gates WHERE gate_number = 4), 'III', 'Versioning/material-change policy', 'Tech Lead defines what changes trigger revalidation (model/prompt/connectors/data); Compliance validates; Product adopts into process.', 26);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (153, (SELECT id FROM gates WHERE gate_number = 4), 'III', 'Waiver/MSA + contract finalized', 'Legal finalizes waiver/MSA/contract terms; Commercial/Finance validate commercial terms; Sales aligns with client.', 27);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (154, (SELECT id FROM gates WHERE gate_number = 4), 'III', 'Build ready tickets + docs', 'Product ensures tickets have acceptance criteria and links to design; Tech Lead confirms build-ready; QA/DevOps informed for downstream readiness.', 28);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (155, (SELECT id FROM gates WHERE gate_number = 4), 'III', 'Design approved? (G4)', 'Tech Lead collects design sign-offs confirming security/monitoring/versioning/contract readiness and build-ready scope.', 29);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (156, (SELECT id FROM gates WHERE gate_number = 5), 'III', 'Build agent', 'Engineer implements agent per tickets; Tech Lead oversees; Product kept aligned.', 30);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (157, (SELECT id FROM gates WHERE gate_number = 5), 'III', 'Evaluate + safety tests', 'QA executes eval + safety test plan and captures evidence; Compliance reviews safety outcomes; Product informed of pass/fail.', 31);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (158, (SELECT id FROM gates WHERE gate_number = 5), 'III', 'Cost burn test', 'Tech Lead runs load/burn simulation; Finance confirms within limits; Product accepts or sends back for redesign.', 32);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (159, (SELECT id FROM gates WHERE gate_number = 5), 'III', 'Release candidate tagged', 'DevOps tags RC version/config; Deployment confirms deployability; QA/Product informed which version is being tested/released.', 33);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (160, (SELECT id FROM gates WHERE gate_number = 5), 'III', 'Build complete? (G5)', 'Tech Lead confirms tests passed, burn within limits, RC tagged, and known issues disposition agreed; consulted roles sign off.', 34);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (161, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Deployment + rollback/kill switch', 'Deployment prepares runbook including rollback and kill switch; Security/IT validates access/controls; Tech Lead validates feasibility.', 35);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (162, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Hypercare plan', 'CS/Support defines hypercare duration, coverage, escalation, metrics, and responsibilities; Product agrees exit criteria.', 36);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (163, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Training comm plan (internal and client)', 'Marketing prepares comms + enablement assets; Sales/CS align audience and delivery; Product confirms accuracy.', 37);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (164, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'PPPP finalized (position, pricing, packaging, proposition)', 'Commercial finalizes offer definition; Finance validates pricing model/billing assumptions; Marketing aligns messaging.', 38);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (165, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Billing readiness confirmed', 'Finance validates billing setup, cross-charges, invoicing readiness and reporting; Commercial aligns to offer.', 39);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (166, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Legal approval confirmed', 'Legal provides final go-live legal approval; Compliance confirms policy alignment.', 40);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (167, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Support model/SLA confirmed', 'Support confirms ownership, SLA tiers, on-call/escalation, staffing; Product confirms obligations are acceptable.', 41);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (168, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Contract storage + renewal reminders set', 'Procurement/Ops ensures contracts stored centrally and renewal/notice reminders configured to group-owned mailbox/tooling.', 42);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (169, (SELECT id FROM gates WHERE gate_number = 6), 'III', 'Launch ready? (G6)', 'Product confirms all readiness items complete and collects approvals; if gaps, loop back to Stage 6 or Stage 5 for code changes.', 43);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (170, (SELECT id FROM gates WHERE gate_number = 7), 'III', 'Runbook/support notes delivered', 'Tech Lead delivers troubleshooting, known issues, escalation details; CS/Support verifies completeness; Product informed.', 44);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (171, (SELECT id FROM gates WHERE gate_number = 7), 'III', 'Support model confirmed (ownership + escalation)', 'Support confirms named ownership and escalation path; Product acknowledges.', 45);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (172, (SELECT id FROM gates WHERE gate_number = 7), 'III', 'Service desk routing configured (required)', 'CS/Support configures ticket categories/routing/runbook links; Support validates usability; Product informed.', 46);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (173, (SELECT id FROM gates WHERE gate_number = 7), 'III', 'Handover complete? (G7)', 'CS/Support confirms operational ownership and tooling; Tech Lead confirms knowledge transfer; Security/IT consulted if access controls required.', 47);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (174, (SELECT id FROM gates WHERE gate_number = 8), 'III', 'Deploy to staging', 'Deployment pushes RC to staging; Tech Lead confirms config; QA notified to test.', 48);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (175, (SELECT id FROM gates WHERE gate_number = 8), 'III', 'Smoke/regression tests + monitoring verification', 'QA runs staging smoke/regression and checks monitoring signals; Tech Lead supports fixes; Support informed for readiness.', 49);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (176, (SELECT id FROM gates WHERE gate_number = 8), 'III', 'Staging approved? (G8)', 'QA confirms staging stable and critical defects addressed; Tech Lead/Deployment sign off environment readiness.', 50);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (177, (SELECT id FROM gates WHERE gate_number = 9), 'III', 'Execute UAT plan', 'UAT owner runs scripts; CS/Support coordinates; Product tracks outcomes; Tech Lead supports fixes.', 51);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (178, (SELECT id FROM gates WHERE gate_number = 9), 'III', 'Client sign-off', 'Sales/account obtains written client acceptance; Product informed.', 52);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (179, (SELECT id FROM gates WHERE gate_number = 9), 'III', 'Disclaimers/terms verified', 'Legal verifies disclosures/terms are correct in-client experience; Compliance confirms policy alignment.', 53);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (180, (SELECT id FROM gates WHERE gate_number = 9), 'III', 'UAT passed? (G9)', 'Product records completion; UAT owner approves; client/legal/compliance sign off acceptance requirements.', 54);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (181, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Go/No-Go decision', 'Product chairs decision; consulted roles confirm readiness; document reason-based No-Go routing.', 55);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (182, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Deploy to live', 'Deployment executes go-live; Tech Lead supports; Product informed.', 56);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (183, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Production verification/smoke checks', 'QA verifies core workflows and monitoring; Support confirms operational readiness signals.', 57);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (184, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Beta pilot + monitoring window (required)', 'Support runs beta monitoring, triage and escalation; Compliance watches safety; Finance watches spend.', 58);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (185, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Beta exit decision', 'Product records beta outcomes and decides proceed/hold; consulted roles sign off thresholds met.', 59);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (186, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Live accepted? (G10)', 'Product confirms GA acceptance and records approvals; if No, route back (Stage 6/8-9/5/3-4).', 60);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (187, (SELECT id FROM gates WHERE gate_number = 10), 'III', 'Hypercare monitoring + incident management', 'Support manages incidents and escalations; Tech Lead fixes as required; Product informed.', 61);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (188, (SELECT id FROM gates WHERE gate_number = 11), 'III', 'Track KPIs + adoption', 'Product monitors outcomes/adoption and decides follow-up work.', 62);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (189, (SELECT id FROM gates WHERE gate_number = 11), 'III', 'Track cost vs budget + margin', 'Finance tracks spend/margin; Commercial reviews offer viability; Product informed.', 63);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (190, (SELECT id FROM gates WHERE gate_number = 11), 'III', 'Quarterly recertification review', 'Compliance reviews safety/data/change history; Security/IT reviews access/connectors; Product confirms actions; Legal informed unless terms change.', 64);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (191, (SELECT id FROM gates WHERE gate_number = 11), 'III', 'Exit hypercare? (G11)', 'Support confirms stability; Product confirms KPI state; Finance confirms cost control; Sponsor signs off exit.', 65);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (192, (SELECT id FROM gates WHERE gate_number = 12), 'III', 'Deprecation plan + comms', 'CS/Support drafts comms and timeline; Sales/account manages client messaging; Product accountable.', 66);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (193, (SELECT id FROM gates WHERE gate_number = 12), 'III', 'Offboard users + clean data', 'CS/Support executes offboarding; Compliance ensures data cleanup; Security/IT supports access removal.', 67);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (194, (SELECT id FROM gates WHERE gate_number = 12), 'III', 'Closing billing/contracts', 'Procurement executes contract closure/notice; Finance stops billing; Legal validates obligations; Commercial confirms product retirement impacts.', 68);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (195, (SELECT id FROM gates WHERE gate_number = 12), 'III', 'Archive registry + revoke permissions & connectors', 'Security/IT revokes connectors/permissions and updates records; Product informed; Compliance confirms policy closure.', 69);
INSERT INTO gate_steps (id, gate_id, category, step_name, description, sort_order)
  VALUES (196, (SELECT id FROM gates WHERE gate_number = 12), 'III', 'EOL complete? (G12)', 'Product confirms closure evidence; consulted roles sign off no remaining users/data/cost/contract risk.', 70);

