New releaseThe Anthropic Book ↗

19 chapters  ·  corpus-verified  ·  audio narration

CONTEXT JAMMING

Field notes from inside the context window.

Hire
Strategic Research Dispatch · N° 018
June 2026

PyTorch + TypeScript
for Agentic Documentation Systems

A focused 90-day plan to gain native fluency in PyTorch and TypeScript in order to build production-grade agentic documentation infrastructure for platforms like Upsun.

Not AI literacy. Platform semantics as executable verification.

The next competitive advantage in platform engineering will not be won by teams that merely adopt coding agents. It will be won by teams that give those agents an explicit, machine-enforceable model of the platform itself — its invariants, its merge semantics, its failure modes.

PyTorch and TypeScript are not adjacent skills to acquire. They are the substrate on which the next layer of agentic infrastructure — documentation as verification — must be built.

— Research Thesis, June 2026

This is a 90-day strategic program designed for practitioners who will be responsible for making autonomous agents reliable on opinionated platforms. The target platform in scope is Upsun. The target artifact is a production-grade Universal Agentic Documentation Harness that understands .upsun/config.yaml the way the parser understands it — not the way a human reader is expected to eventually figure it out.

The plan is deliberately narrow. It does not aim for general AI literacy. It aims for native fluency in the two languages required to encode platform semantics into agent reasoning loops: TypeScript for deterministic orchestration and tooling, PyTorch for learned representations and verification models that can internalize what the specification never quite says out loud.

§ 01

Why This Matters for Upsun

Upsun’s public documentation already exceeds 244 agent-ready pages with structured frontmatter and an llms.txt index. The MCP control plane at mcp.upsun.com/mcp exposes the entire infrastructure surface to agents. Context7 integration allows IDE-native retrieval. These are necessary foundations.

They are not sufficient.

A generic coding agent reading the current documentation will almost certainly hallucinate deep-merge semantics because that is what every other YAML-based system the model has seen does. The documentation does not scream the exception loudly enough for a reader that has no prior platform memory and treats every sentence as equally weighted evidence.

This is the canonical example of the larger problem: documentation written for humans who will eventually accumulate context is documentation that will systematically mislead agents that must act on first read.

The Reliability Gap

An agent that does not internalize the three-key top-level merge rule will generate configs that look correct and fail in production.

Every additional layer of platform opinion (resource sizing, route precedence, service binding rules, build hook execution order) multiplies the surface area of silent failure.

The Verification Mandate

Documentation must become executable verification infrastructure. Not a corpus to be retrieved, but a set of constraints that can be enforced, scored, and used to reject bad generations before they reach the parser.

PyTorch gives us the ability to learn representations of “what a correct Upsun configuration looks like in this context.” TypeScript gives us the ability to make those constraints part of the agent’s tool-use loop with zero ambiguity.

The practitioner who completes this plan will not be “up to speed on AI.” They will be ready to contribute, from week one, to the construction of the systems that turn Upsun’s existing documentation investments into something agents cannot afford to misunderstand.

§ 02

Phase 1: Foundations (Days 1–30)

Build the shared vocabulary and the first concrete artifacts that encode Upsun’s platform invariants in both type systems and learned representations.

TypeScript Focus

  • • Advanced type-level programming: branded types, conditional types, template literal types for config path safety
  • • Zod + custom refinements for declarative platform schemas that can express “top-level only merge” as a first-class constraint
  • • Building production CLIs and MCP-compatible tool servers in TypeScript (Commander + oclif patterns, JSON-RPC over stdio or HTTP)
  • • Strict configuration of the Anthropic SDK and emerging Claude Code / MCP client libraries

PyTorch Focus

  • • Tensors, autograd, and the nn.Module abstraction as a mental model for differentiable constraints
  • • Sentence-transformers and modern embedding models via Hugging Face; contrastive training basics
  • • Simple classification and regression heads on top of frozen encoders for verification signals (merge-risk, section-type, hallucination likelihood)
  • • Evaluation loops: precision/recall on synthetic failure cases rather than generic benchmarks
§ 03

Phase 2: Agentic Systems (Days 31–60)

Move from static artifacts to closed-loop agentic workflows that treat documentation and configuration as live, verifiable state.

TypeScript Focus

  • • Agent orchestration patterns: tool-use loops, ReAct-style controllers, parallel sub-agent harnesses (inspired by Fable 5 dynamic workflows)
  • • Building Claude Code skills and MCP servers that expose verification and synthesis tools with rich JSON schemas
  • • Deterministic rendering of documentation artifacts (inspired by Remotion-style code-as-timeline thinking) using React + TS for structured Markdown + frontmatter
  • • Evaluation harnesses: golden datasets, regression suites, and “agent unit tests” that assert the generated config survives the real Upsun parser

PyTorch Focus

  • • RAG beyond naive similarity: learned rerankers, query rewriting heads, and small verifier models that score “does this retrieved passage actually constrain the current generation?”
  • • Synthetic data generation for platform-specific failure modes (merge overwrites, invalid service bindings, route precedence violations)
  • • Fine-tuning small encoder models (DistilBERT, ModernBERT, or equivalent) on labeled Upsun doc + config pairs for verification and hallucination detection
  • • Export paths: ONNX / transformers.js for potential edge or browser-adjacent verification steps
§ 04

Phase 3: Production Integration (Days 61–90)

Close the loop between the learned models, the deterministic harness, and real Upsun deployment surfaces. Produce something that can be used in anger on actual platform work.

TypeScript Focus

  • • Production hardening of the harness: logging, tracing, replayable evaluation runs, safe write boundaries matching Upsun MCP’s “enable-write” model
  • • Deep integration with existing Upsun tooling: Context7, MCP server, Claude skills pipeline, llms.txt + structured frontmatter emitters
  • • Building the “Universal Agentic Documentation Harness” as a composable system: ingestion, retrieval, synthesis, verification, human gate, export
  • • Metrics and dashboards for agent success rate (configs that parse and deploy on first attempt) and doc coverage

PyTorch Focus

  • • Full fine-tuning or continued pretraining of a small domain-specific model on the complete body of Upsun documentation + real (anonymized) config histories
  • • Training and rigorous evaluation of a verification model that can act as a final gate before any generated config or doc reaches a human or a deployment
  • • Experimentation with hybrid architectures: retrieval + small classifier + symbolic constraint checker (the TS schema) in a single forward pass or tool call
  • • Packaging and versioning of models alongside the TypeScript harness (ONNX, safetensors, or HF hub private repo)
§ 05

The Final Deliverable

A working prototype of the Claude Code-based Universal Agentic Documentation Harness tailored specifically to Upsun.

Core Architecture

Ingestion & Representation Layer (PyTorch)

Domain-adapted embeddings and a fine-tuned verification model that scores generated configs and documentation fragments for fidelity to Upsun’s documented and undocumented invariants (especially the top-level merge rule and its downstream consequences).

Orchestration & Tooling Layer (TypeScript)

Deterministic harness exposed as a Claude Code skill and MCP tool surface. Accepts intent + context, retrieves with the learned ranker, applies symbolic constraints from the typed Upsun schema, runs the verifier, and emits both human and agent-native artifacts with explicit provenance and risk annotations.

Verification & Gate Layer

Hybrid symbolic + learned checker. The TypeScript schema rejects structural violations immediately. The PyTorch verifier assigns a calibrated “merge-safety” and “doc-fidelity” score. Generations below threshold are rejected or routed for human review with precise explanations.

Evaluation & Replay Harness

Golden task suite derived from real Upsun usage patterns. Every run is logged, replayable, and scored on first-attempt parse-and-deploy success plus human review cost. The output of the 90 days is not just a prototype — it is a measurement system that proves the prototype improves reliability.

The harness is deliberately designed to sit alongside existing Upsun investments (llms.txt, Context7, MCP, the 244-page corpus) rather than replace them. It makes those investments executable and falsifiable for agents.

§ 06

Strategic Value

This program is not professional development in the conventional sense. It is capability development for a specific strategic objective: making Upsun the platform where agentic infrastructure work is not merely possible but reliable by default.

Direct Contribution from Day One

The practitioner who completes the 90 days will be able to author or significantly improve Claude skills, MCP tool definitions, and verification components that ship inside Upsun’s own agentic documentation pipeline. No ramp-up period required.

Amplification of Existing Investments

The 244 pages, the llms.txt index, and the MCP surface become dramatically more valuable once there is a system that can enforce their semantics inside the generation loop rather than hoping retrieval + prompting is sufficient.

Platform Differentiation

Most platforms will offer “AI-friendly docs.” Few will offer a verifiable model of their configuration semantics that agents can be held accountable to. This work creates that moat for Upsun.

Foundation for the Next Layer

Once the harness exists for documentation and configuration, the same patterns (learned platform invariants + deterministic orchestration + hybrid verification) apply to build, deploy, and runtime concerns. This 90 days is the seed.

The goal is not to learn how to use AI. The goal is to build the missing layer that makes AI agents trustworthy participants in the operation of complex, opinionated infrastructure platforms — starting with Upsun.

— Positioning Statement
Filed by Bret Kerr · ACRA Insight LLC · Strategic preparation for Upsun agentic documentation work