{
  "name": "AI For Engineers, Part 5: OpenAI Deep Dive — Reasoning, APIs, MCP & Agents",
  "badge": "AI FOR ENGINEERS · PART 05 / 09",
  "children": [
    {
      "name": "Ch. 01: Auditing OpenAI With the Four-Pillar Engineering Rubric",
      "children": [
        {
          "name": "Core Principle: Evaluate OpenAI as an inference, tool, and sandbox runtime built around fixed-weight neural networks."
        },
        {
          "name": "Flagship LLMs & RL Reasoning",
          "children": [
            {
              "name": "GPT multimodal Transformers handle fast token generation while o-series models allocate test-time reasoning token budgets."
            },
            {
              "name": "Rule / Formula: Inference = Fixed Weights + Tunable Compute"
            }
          ]
        },
        {
          "name": "Responses API, MCP & Workspaces",
          "children": [
            {
              "name": "Stateful response IDs, schema-constrained decoding, MCP clients, and Canvas or Projects organize context without retraining."
            },
            {
              "name": "Rule / Formula: State = Context Window + External Store"
            }
          ]
        },
        {
          "name": "Operator, Deep Research & Codex",
          "children": [
            {
              "name": "Three specialized control loops automate pixel GUI browsers, multi-hop cited investigations, and repository test suites."
            },
            {
              "name": "Rule / Formula: Agent = LLM + Tools + Multi-Step Loop"
            }
          ]
        },
        {
          "name": "Sandboxes, Allowlists & Gates",
          "children": [
            {
              "name": "OS filesystem jails, default-deny network policies, and tiered CLI or browser approvals bound autonomous execution."
            },
            {
              "name": "Rule / Formula: Autonomy ≤ Verified Sandbox Boundary"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 02: GPT Flagship Transformers & o-Series Reasoning Models",
      "children": [
        {
          "name": "Core Principle: GPT tiers optimize low-latency token generation; o-series models spend extra context tokens on RL-trained verification."
        },
        {
          "name": "Autoregressive Token Generation",
          "children": [
            {
              "name": "GPT flagship models process broad multimodal context; distilled Mini and Nano tiers cut per-token latency for high-volume pipelines."
            },
            {
              "name": "Rule / Formula: Depth & Width = Fixed by Architecture"
            }
          ]
        },
        {
          "name": "o3 & o4-mini Verification Chains",
          "children": [
            {
              "name": "Reinforcement learning trains o-series policies to emit, test, and revise intermediate reasoning tokens prior to final output."
            },
            {
              "name": "Rule / Formula: Policy Updated via Verifiable RL Rewards"
            }
          ]
        },
        {
          "name": "Hidden Reasoning Token Accounting",
          "children": [
            {
              "name": "Internal chain-of-thought tokens share the finite context window alongside system prompts, uploaded specs, and visible output."
            },
            {
              "name": "Rule / Formula: Window ≥ Prompt + Reasoning + Output"
            }
          ]
        },
        {
          "name": "Programmable Reasoning Effort",
          "children": [
            {
              "name": "Engineers set reasoning_effort to low, medium, or high in API calls to trade inference latency against multi-step logic checks."
            },
            {
              "name": "Rule / Formula: reasoning_effort ∈ [low, medium, high]"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 03: Audio, Vision, and Video Token Pipelines",
      "children": [
        {
          "name": "Core Principle: Unified acoustic and visual token embeddings remove fragile multi-model transcription glue."
        },
        {
          "name": "Native Acoustic Token Streaming",
          "children": [
            {
              "name": "Streams audio tokens bidirectionally over WebRTC or WebSockets in ~250–300 ms without intermediate speech-to-text conversion."
            },
            {
              "name": "Rule / Formula: Audio Frames → Acoustic Tokens → Audio Out"
            }
          ]
        },
        {
          "name": "Patch Tokenization & Plot Inspection",
          "children": [
            {
              "name": "Encodes PDF tables and engineering schematics into patch embeddings; o-series models crop and zoom regions via Python mid-thought."
            },
            {
              "name": "Rule / Formula: Image Patches → Vector Embeddings"
            }
          ]
        },
        {
          "name": "Autoregressive Diagram & UI Rendering",
          "children": [
            {
              "name": "Generates visual tokens conditioned directly on prompt constraints for legible multi-line labels, wireframes, and masked edits."
            },
            {
              "name": "Rule / Formula: Prompt Constraints → Visual Token Grid"
            }
          ]
        },
        {
          "name": "Spacetime Patch Diffusion Transformer",
          "children": [
            {
              "name": "Models 3D camera motion and temporal frame consistency across video clips via diffusion over compressed spacetime patches."
            },
            {
              "name": "Rule / Formula: Video = Spacetime Patches + Diffusion"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 04: File Search, Code Interpreter, Fine-Tuning & Evals",
      "children": [
        {
          "name": "Core Principle: Separate inference-time retrieval and Python math from true gradient-based weight customization."
        },
        {
          "name": "Chunking, Embeddings & Hybrid RAG",
          "children": [
            {
              "name": "Splits specs like SPEC-201 into token chunks, indexes vector embeddings plus keywords, and injects cited passages at inference."
            },
            {
              "name": "Rule / Formula: RAG = Retrieval Into Context (Fixed Weights)"
            }
          ]
        },
        {
          "name": "Sandboxed Linux Python Execution",
          "children": [
            {
              "name": "Runs deterministic pandas and NumPy scripts inside an isolated container so seal-housing peaks like 84.2°C are computed, not guessed."
            },
            {
              "name": "Rule / Formula: Math Verification → Container Python Exit 0"
            }
          ]
        },
        {
          "name": "Supervised & Reinforcement Fine-Tuning",
          "children": [
            {
              "name": "SFT updates weights on labeled input-target pairs; RFT updates o-series reasoning weights against custom automated graders."
            },
            {
              "name": "Rule / Formula: Fine-Tuning = Gradient Weight Update"
            }
          ]
        },
        {
          "name": "Regression Testing & Trace Graders",
          "children": [
            {
              "name": "Scores prompts, tool traces, and fine-tuned checkpoints against golden test cases using Python assertions before rollout."
            },
            {
              "name": "Rule / Formula: Deploy Only When Eval Pass Rate ≥ Threshold"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 05: Stateful Responses API & Schema-Constrained Outputs",
      "children": [
        {
          "name": "Core Principle: Constrained decoding enforces valid JSON on completed non-refused responses, while scripts verify facts."
        },
        {
          "name": "Unified Multi-Turn Tool Loop",
          "children": [
            {
              "name": "Chains reasoning steps, web or file search, Python execution, and custom function calls inside one server-managed request."
            },
            {
              "name": "Rule / Formula: Single Endpoint = Chat + Tools + Async"
            }
          ]
        },
        {
          "name": "Chaining via previous_response_id",
          "children": [
            {
              "name": "Persists conversation turns and encrypted o-series reasoning state server-side across sessions without modifying model weights."
            },
            {
              "name": "Rule / Formula: Turn N+1 Input = New Prompt + response_id"
            }
          ]
        },
        {
          "name": "Grammar-Constrained Token Decoding",
          "children": [
            {
              "name": "Compiles supported Pydantic/Zod schemas into token masks on completed non-refused responses; still handle refusals and truncation."
            },
            {
              "name": "Rule / Formula: Completed Non-Refused Output → Valid JSON"
            }
          ]
        },
        {
          "name": "Pair Schemas With Evidence Checks",
          "children": [
            {
              "name": "Schema conformance stops JSON parse crashes, but verify_document.py is still required to reject phantom IDs like SPEC-992."
            },
            {
              "name": "Rule / Formula: Typed JSON + Evidence Audit = Verified Data"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 06: Model Context Protocol Integration & Agents SDK",
      "children": [
        {
          "name": "Core Principle: MCP standardizes tool discovery across labs, while every loaded tool schema consumes context window tokens."
        },
        {
          "name": "Local Stdio & Remote HTTP Servers",
          "children": [
            {
              "name": "Responses API, Agents SDK, and Desktop apps connect directly to MCP servers exposing databases, Git repos, and telemetry logs."
            },
            {
              "name": "Rule / Formula: Client ↔ JSON-RPC ↔ MCP Tool Server"
            }
          ]
        },
        {
          "name": "Filter Tool Schemas Per Task",
          "children": [
            {
              "name": "Every MCP tool definition consumes prompt tokens; scope allowed_tools tightly so Attention stays focused on active evidence."
            },
            {
              "name": "Rule / Formula: Fewer Unused Schemas → Sharper Attention"
            }
          ]
        },
        {
          "name": "Handoffs & Deterministic Loops",
          "children": [
            {
              "name": "Open-source Python and TypeScript library managing tool call loops, typed context objects, and specialist agent transfers."
            },
            {
              "name": "Rule / Formula: Triage Agent → Handoff → Verifier Agent"
            }
          ]
        },
        {
          "name": "Pre- & Post-Inference Tripwires",
          "children": [
            {
              "name": "Runs fast classifier or regex checks concurrently with inference to halt policy violations or ungrounded outputs early."
            },
            {
              "name": "Rule / Formula: Guardrail Tripwire → Halt Tool Execution"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 07: Canvas, Projects & Custom GPTs: Context vs. Weights",
      "children": [
        {
          "name": "Core Principle: Uploading files to Projects or Custom GPTs packages inference context and Skills—it never retrains weights."
        },
        {
          "name": "Shareable Skills + Authenticated Actions",
          "children": [
            {
              "name": "Packages domain procedures, reference documents, and OAuth OpenAPI or MCP tools for org-wide use with zero weight changes."
            },
            {
              "name": "Rule / Formula: Custom GPT = Skill Package (Fixed Weights)"
            }
          ]
        },
        {
          "name": "Scoped Files & 5-Part System Prompts",
          "children": [
            {
              "name": "Bundles SPEC-201, LOG-104, and persistent Role-Context-Task-Format-Verification instructions across related threads."
            },
            {
              "name": "Rule / Formula: Project = Saved Prompt + Indexed Files"
            }
          ]
        },
        {
          "name": "Targeted Span Edits & Live Diffs",
          "children": [
            {
              "name": "Side-by-side document and code surface supporting inline line-range rewrites, version diffs, and sandboxed previews."
            },
            {
              "name": "Rule / Formula: Highlight Span → Scoped Token Rewrite"
            }
          ]
        },
        {
          "name": "Explicit Local IDE & Terminal Bridge",
          "children": [
            {
              "name": "Reads active buffers in VS Code, Xcode, JetBrains, or local shells to propose diffs without manual copy-paste."
            },
            {
              "name": "Rule / Formula: Paired Window → Scoped Context Read/Diff"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 08: Operator: Visual GUI Computer-Using Agent (CUA)",
      "children": [
        {
          "name": "Core Principle: Operator automates legacy web portals via pixel screenshots and RL action loops, gated by human takeover checkpoints."
        },
        {
          "name": "Vision + RL Browser Control Model",
          "children": [
            {
              "name": "Operates inside a disposable remote cloud browser with virtual cursor and keyboard for portals lacking APIs or MCP servers."
            },
            {
              "name": "Rule / Formula: GUI Portal (No API) → CUA Remote Browser"
            }
          ]
        },
        {
          "name": "Capture → Ground → Act → Verify",
          "children": [
            {
              "name": "Reads viewport screenshots at each step, predicts x-y click targets or keystrokes, and checks the next frame for UI errors."
            },
            {
              "name": "Rule / Formula: Pixels_t → Action_t → Verify Pixels_t+1"
            }
          ]
        },
        {
          "name": "Credential & CAPTCHA Human Handoff",
          "children": [
            {
              "name": "Pauses automatically on login screens and anti-bot gates so the user enters secrets privately inside Takeover Mode."
            },
            {
              "name": "Rule / Formula: Auth / CAPTCHA Detected → Human Takeover"
            }
          ]
        },
        {
          "name": "Explicit Pre-Commit Confirmation",
          "children": [
            {
              "name": "Requires affirmative human approval before sending external emails, submitting procurement orders, or mutating records."
            },
            {
              "name": "Rule / Formula: Irreversible Action → Mandatory User Confirm"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 09: Deep Research: Multi-Step Citation & Synthesis Agent",
      "children": [
        {
          "name": "Core Principle: Multi-hop search and inline citations narrow evidence gaps, yet engineers must still audit primary sources."
        },
        {
          "name": "5–30 Minute Asynchronous Investigation",
          "children": [
            {
              "name": "Decomposes complex engineering questions into iterative search branches, reading full PDFs and revising queries as facts emerge."
            },
            {
              "name": "Rule / Formula: Plan → Search → Read → Pivot → Synthesize"
            }
          ]
        },
        {
          "name": "Public Web + Private MCP Repositories",
          "children": [
            {
              "name": "Cross-references external standards and datasheets against internal GitHub, Drive, or SharePoint files while honoring ACLs."
            },
            {
              "name": "Rule / Formula: External Specs ∩ Internal Repo Evidence"
            }
          ]
        },
        {
          "name": "Logged Queries, Python & Inline Links",
          "children": [
            {
              "name": "Records every search term, discarded source, and intermediate Python computation alongside clickable source citations."
            },
            {
              "name": "Rule / Formula: Every Claim → Linked Source Passage"
            }
          ]
        },
        {
          "name": "Audit Numbers Against Primary Files",
          "children": [
            {
              "name": "Treat synthesized reports as drafts; run deterministic checks on critical limits like SPEC-201 85.0°C before sign-off."
            },
            {
              "name": "Rule / Formula: Cited Draft → Primary Source Verification"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 10: Codex Engineering Agent: Cloud Containers & CLI",
      "children": [
        {
          "name": "Core Principle: Codex pairs repository Skills in AGENTS.md with compiler and test-suite loops to produce verified diffs."
        },
        {
          "name": "Parallel Cloud Containers & Local CLI",
          "children": [
            {
              "name": "Cloud Codex runs parallel background tasks in isolated repo containers; Codex CLI pairs interactively inside your local shell."
            },
            {
              "name": "Rule / Formula: Cloud Async PRs + Local Terminal Loop"
            }
          ]
        },
        {
          "name": "Read → Edit → Test → Fix Tracebacks",
          "children": [
            {
              "name": "Executes real compilers, linters, and pytest suites inside the sandbox, iterating on failures until all checks return exit 0."
            },
            {
              "name": "Rule / Formula: Edit Diff → Run Test Suite → Exit Code 0"
            }
          ]
        },
        {
          "name": "Declarative Repository Instructions",
          "children": [
            {
              "name": "Loads build commands, architecture boundaries, and verify_document.py checks into the context window with fixed model weights."
            },
            {
              "name": "Rule / Formula: AGENTS.md = Repo Skill in Context Window"
            }
          ]
        },
        {
          "name": "Diff + Execution Log for Human Review",
          "children": [
            {
              "name": "Packages clean git diffs and full test transcripts into a reviewable pull request; never merges to main autonomously."
            },
            {
              "name": "Rule / Formula: Verified Diff + Test Log → Human PR Merge"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 11: Browser vs. Computer Use & Sandbox Permission Tiers",
      "children": [
        {
          "name": "Core Principle: Prefer typed APIs and MCP over pixel GUI loops, and lock every execution tier inside OS and network sandboxes."
        },
        {
          "name": "Text Browser, GUI, Shell & MCP",
          "children": [
            {
              "name": "ChatGPT Agent mode combines a text browser, Operator's visual GUI browser, a Linux terminal, and MCP clients in one VM."
            },
            {
              "name": "Rule / Formula: 1 Virtual Machine = Web + GUI + CLI + MCP"
            }
          ]
        },
        {
          "name": "API & MCP First, Pixel GUI Last",
          "children": [
            {
              "name": "Structured API, MCP, and CLI calls avoid multi-turn screenshot overhead with workload-dependent speedups; save GUI loops for legacy apps."
            },
            {
              "name": "Rule / Formula: Typed API / MCP > CLI > Pixel GUI Loop"
            }
          ]
        },
        {
          "name": "Decoupled Approval & Sandbox Modes",
          "children": [
            {
              "name": "Pairs approval policy (untrusted / on-request / never) with OS sandbox mode (read-only / workspace-write); legacy presets map onto both."
            },
            {
              "name": "Rule / Formula: Select Minimum Autonomy Required Per Task"
            }
          ]
        },
        {
          "name": "Seatbelt, Landlock & Net-Off",
          "children": [
            {
              "name": "MacOS Seatbelt, Linux Landlock, and containers restrict writes to the workspace folder with outbound network off by default."
            },
            {
              "name": "Rule / Formula: Write Scope = Workspace | Net = Default Off"
            }
          ]
        }
      ]
    },
    {
      "name": "Ch. 12: OpenAI Engineering Checklist & Handoff to Part 6",
      "children": [
        {
          "name": "Core Principle: Ground OpenAI models in deterministic verification and sandboxes; join us at the Studio Desk next for Anthropic."
        },
        {
          "name": "Right-Size Model & Reasoning Budget",
          "children": [
            {
              "name": "Use Mini/GPT tiers for low-latency routing and tune o-series reasoning_effort tokens for math, logic, and architecture checks."
            },
            {
              "name": "Rule / Formula: Match Token Compute to Failure Cost"
            }
          ]
        },
        {
          "name": "Separate Skills From Weight Training",
          "children": [
            {
              "name": "Use Projects, Custom GPTs, File Search, and AGENTS.md for inference context; use SFT or RFT only when updating model weights."
            },
            {
              "name": "Rule / Formula: Context Skills ≠ Gradient Weight Updates"
            }
          ]
        },
        {
          "name": "Verify Evidence & Jail Execution",
          "children": [
            {
              "name": "Pair Structured Outputs with verify_document.py to catch 94.2°C or SPEC-992 errors, and lock agents behind OS/network jails."
            },
            {
              "name": "Rule / Formula: Schema + Python Audit + Sandbox = Prod Safe"
            }
          ]
        },
        {
          "name": "Anthropic Deep Dive at the Studio Desk",
          "children": [
            {
              "name": "Aero-Blue and Aero-Pink transition to the Studio Desk to audit Claude hybrid thinking, MCP origins, Artifacts, and Claude Code."
            },
            {
              "name": "Rule / Formula: Next → Part 6: Anthropic (Studio Desk)"
            }
          ]
        }
      ]
    }
  ]
}
