petro-agent Acerca del autor ↗About the author ↗ GitHub ↗
la narrativa de ingenieríathe engineering narrative

Cómo se construye
un agente medible
How to build
a measurable agent

Cuatro fases experimentales de palancas honestas — memoria, consecuencia, hipótesis, borradores — cada una con su experimento A/B y su número. Y las lecciones que se llevan a cualquier sistema de agentes. Four experimental phases of honest levers — memory, consequence, hypotheses, drafts — each with its A/B experiment and its number. Plus the lessons that transfer to any agent system.

volver al hubback to the hub

el sistemathe system

La arquitectura: un muro con puertas instrumentadasThe architecture: a wall with instrumented doors

EL MODELO — decide y redactaTHE MODEL — decides and writes EL MOTOR — computa y gatea (determinista)THE ENGINE — computes and gates (deterministic) OBSERVA — EDA, bins de profundidad, figuras,OBSERVE — EDA, depth bins, figures, journal (releer = no-op), digest cross-welljournal (re-read = no-op), cross-well digest DECIDE — método, zona,DECIDE — method, zone, hipótesis, reintentohypothesis, retry (0 números escritos)(writes 0 numbers) COMPUTA — funciones validadas con golden testsCOMPUTE — vetted golden-tested functions Vsh → PHIE → Sw → cutoffs → net pay → MCVsh → PHIE → Sw → cutoffs → net pay → MC VALIDA Y GATEA — objeciones tipadas, tier,VALIDATE & GATE — typed objections, tier, abstención; un LLM jamás decide una compuertaabstention; an LLM never decides a gate REDACTA Y REVISAWRITE & REVISE relee su borrador renderizadorereads its rendered draft VERIFICADOR — cada cifra de la prosa debeVERIFIER — every figure in the prose must existir en el ledger; si no, se RECHAZAexist in the ledger; otherwise REJECTED guard anti-stall: 3 accionesanti-stall guard: 3 identical idénticas → corta; el orquestadoractions → cut; the orchestrator es dueño de la terminaciónowns termination todo fallback queda SEÑALIZADO en el ledger — nunca se lee como análisis del agenteevery fallback is SIGNALED in the ledger — never read as the agent's analysis
El loop completo, con la frontera dibujada. Ámbar = el modelo (decide y redacta); azul = el motor determinista (observa, computa, gatea, verifica). El modelo escribe CERO números: cada cifra de su prosa debe existir en el ledger o el verificador la rechaza — pasó en vivo (2 revisiones rechazadas en v14). The full loop, boundary drawn. Amber = the model (decides and writes); blue = the deterministic engine (observes, computes, gates, verifies). The model writes ZERO numbers: every figure in its prose must exist in the ledger or the verifier rejects it — it happened live (2 revisions rejected in v14).

Todo lo demás del proyecto se apoya en esa separación: como el LLM jamás produce un número, cualquier diferencia entre corridas es diferencia de criterio — y el sistema entero funciona como banco de pruebas conductual entre modelos, seeds y entornos sobre aritmética idéntica. Everything else rests on that separation: since the LLM never produces a number, any difference between runs is a difference in judgment — and the whole system doubles as a behavioral test bench across models, seeds and environments over identical arithmetic.

experimentos A/BA/B experiments

Las 4 fases experimentales — cada una con su númeroThe 4 experimental phases — each with its number

Palanca (siempre hechos, nunca dirección)Lever (always facts, never direction) Efecto medidoMeasured effect
GA pack de estudio de campo (bins de medianas, topes competentes), evidencia comparativa de métodos, notas propias entre pozos, brief regional con doble gate anti-fugafield-study pack (median bins, competent tops), method comparison evidence, own notes across wells, regional brief with a double leak gate la decisión de zona pasa de 1/24 a 13/15 pozosthe zone decision goes from 1/24 to 13/15 wells
GB journal de observaciones (repetir una lectura = no-op medido), digest de análisis cross-well, herramientas de paridad (SP→Rw, MHI)observation journal (repeating a read = measured no-op), cross-well analysis digest, parity tools (SP→Rw, MHI) relecturas: ~80% → 0 (gpt-5 había quemado un pozo entero releyendo 2 observaciones 31 veces)re-reads: ~80% → 0 (gpt-5 had burned an entire well re-reading 2 observations 31 times)
GC reintento con su propio fracaso como evidencia (se publica SIEMPRE el intento 2 — sin selección Goodhart), hipótesis de intervalo baratas, objeciones con localización en profundidadretry with its own failure as evidence (attempt 2 is ALWAYS published — no Goodhart selection), cheap interval hypotheses, depth-localized objections las zonas se MUEVEN con la consecuencia: gpt-5 cruza de 958–1,680 a 2,953–4,350 ft y refina a 3,412–4,265 en el pozo siguiente vía sus notaszones MOVE with consequence: gpt-5 crosses from 958–1,680 to 2,953–4,350 ft and refines to 3,412–4,265 on the next well via its notes
GD ciclo de borradores: el escritor relee su informe renderizado y revisa su prosa; el claim verifier rechaza mecánicamente toda revisión con números sin respaldo. + thinking mode opt-indraft cycle: the writer rereads its rendered report and revises its prose; the claim verifier mechanically rejects any revision with unbacked numbers. + opt-in thinking mode 49 revisiones aceptadas, 2 rechazadas en vivo; ultra free 0→3/3 zonas profundas; opus 4/4 con precisión 1.0049 revisions accepted, 2 rejected live; free ultra 0→3/3 deep zones; opus 4/4 at precision 1.00
lo transferiblethe transferable

Hallazgos de sistemaSystem findings

  • La memoria son tres memorias. Intra-ciclo (journal: mata el desperdicio), entre-pozos (notas+digest: da consistencia y compone hallazgos) y de CONSECUENCIA (su intento fallido, medido y localizado: la única que mueve el juicio). Cada una arregla una falla distinta; falta una y el agente repite, se contradice o no aprende. Memory is three memories. Within-cycle (journal: kills waste), cross-well (notes+digest: consistency and compounding), and CONSEQUENCE (its own failed attempt, measured and localized: the only one that moves judgment). Each fixes a different failure; drop one and the agent repeats, contradicts itself, or doesn't learn.
  • El gemelo qwen: el A/B de thinking más limpio. Mismo linaje, misma data, mismo stack: sin thinking 0 zonas profundas en 12 pozos; la variante thinking fue directa al Mississippiano (3,858–4,429 ft). Y el contraejemplo: gpt-5, que razona por defecto, EMPEORÓ con reasoning explícito (precisión 0.77→0.00). El thinking enciende híbridos apagados; no mejora a quien ya piensa. The qwen twin: the cleanest thinking A/B. Same lineage, data and stack: without thinking, 0 deep zones in 12 wells; the thinking variant went straight to the Mississippian (3,858–4,429 ft). And the counterexample: gpt-5, which reasons by default, got WORSE with explicit reasoning (precision 0.77→0.00). Thinking switches on dormant hybrids; it doesn't improve models already thinking.
  • ultra super qwen gpt-5 nano glm opus v13 · sin thinkingv13 · no thinking 0/4 0/4 0/4 2/4 v14 · free + thinkingv14 · free + thinking 3/3 0/4 1/4 v14 · pago + thinkingv14 · paid + thinking 2/3 1/4 3/4 4/4 celda = zonas con tope ≥2,297 ft (bloque consolidado) / pozos del batchcell = zones with top ≥2,297 ft (consolidated block) / batch wells
    La matriz que aisló la palanca. Cada celda: cuántas zonas con tope ≥2,297 ft (el bloque consolidado real) eligió esa config. El thinking ENCIENDE la zonificación profunda en los híbridos que corrían apagados (ultra 0/4→3/3; el gemelo qwen 0/4→2/3) y no arregla a los rígidos (super) ni a los que ya razonan (gpt-5 empeora). Cuatro familias de vendors, mismo patrón. Las celdas «—» no son ceros: esa configuración NO SE CORRIÓ para ese modelo — el pool evolucionó con el proyecto (glm-5.2 y opus-4.8 entraron en la fase final de pago; nano solo existe como free; el leg sin-thinking corrió con el pool de su momento). The matrix that isolated the lever. Each cell: how many zones with top ≥2,297 ft (the real consolidated block) that config chose. Thinking SWITCHES ON deep zoning in hybrids that ran dormant (ultra 0/4→3/3; the qwen twin 0/4→2/3), and fixes neither the rigid (super) nor those already reasoning (gpt-5 gets worse). Four vendor families, same pattern. The “—” cells are not zeros: that configuration WAS NOT RUN for that model — the pool evolved with the project (glm-5.2 and opus-4.8 joined in the final paid leg; nano only exists as free; the no-thinking leg ran with its moment's pool).
  • La iteración amplifica lo que el modelo ya es. 15 ciclos de "mira tu informe y reintenta" sobre un pozo fijo: el rígido (super 120B) aprende UNA vez y plancha idéntico 5 iteraciones; el explorador (nano 30B thinking) rebota y clava el óptimo en la 4ª (3,530–3,858 ft, PHIE 0.189 — mejor que modelos 15× más grandes); el sin-brújula (gpt-oss-20b) deriva confiado hacia la roca equivocada. La iteración no es una mejora: es un amplificador. Iteration amplifies what the model already is. 15 cycles of "look at your report and retry" on a fixed well: the rigid one (super 120B) learns ONCE and flatlines identically for 5 iterations; the explorer (nano 30B thinking) bounces and nails the optimum on the 4th (3,530–3,858 ft, PHIE 0.189 — beating models 15× its size); the compass-less one (gpt-oss-20b) drifts confidently toward the wrong rock. Iteration isn't an upgrade: it's an amplifier.
  • 2,953–4,429 ft 0 1.6k 3.3k 4.6k 1 2 3 4 5 6 7 8 9 iteración / iteration nano 30B thinking super 120B gpt-oss-20b
    Tres personalidades, una curva cada una (tope de zona elegido por iteración; banda ámbar = topes productores). nano explora, empeora dos veces y clava el óptimo en la 4ª; super aprende un paso y se sella; gpt-oss rebota somero sin brújula. La iteración no mejora a nadie: amplifica lo que cada modelo ya es. ¿Por qué solo tres? El experimento exigía hasta 15 ciclos por modelo en un pozo fijo bajo la cuota gratuita diaria: se eligieron tres personalidades opuestas del pool free (rígido 120B · explorador 30B con thinking · 20B sin brújula). La curva de gpt-oss se corta en el ciclo 10 por 429 persistente del proveedor — no es convergencia. Three personalities, one curve each (chosen zone top per iteration; amber band = producing tops). nano explores, gets worse twice and nails the optimum on the 4th; super learns one step and seals; gpt-oss bounces shallow with no compass. Iteration upgrades nobody: it amplifies what each model already is. Why only three? The experiment demanded up to 15 cycles per model on a fixed well under the free daily quota: three opposite personalities were picked from the free pool (rigid 120B · exploring 30B with thinking · compass-less 20B). gpt-oss's curve cuts at cycle 10 due to persistent provider 429s — that is not convergence.
  • Goodhart aparece solo. Si el "éxito" es que el validador calle, un agente puede elegir una zona estéril: sin pay no hay nada implausible (gpt-5 lo hizo 4 veces). Puntúa interpretación defendible, no ausencia de objeciones — y publica SIEMPRE el reintento, no "el que convergió". Goodhart shows up on its own. If "success" is a quiet validator, an agent can pick a barren zone: with no pay nothing is implausible (gpt-5 did it 4 times). Score defensible interpretation, not absence of objections — and always publish the retry, not "whichever converged".
  • La honestidad es del sistema; el juicio es del modelo. Quita el andamiaje y el mismo modelo vuelve a promediar overburden con confianza. El sistema garantiza que nunca mienta; no puede garantizar que acierte — pero sí medir cuánto. Honesty belongs to the system; judgment to the model. Remove the scaffold and the same model confidently averages overburden again. The system guarantees it never lies; it can't guarantee it's right — but it can measure how right.
la cuentathe bill

Costos medidos (no estimados)Measured costs (not estimates)

Config Costo por batch (4 pozos, reintentos + borradores)Cost per batch (4 wells, retries + drafts) $ por pozo-aceptable$ per acceptable well
nemotron-ultra free + thinking$0 (cuota 1000 req/día)(1000 req/day quota)$0
glm-5.2~$2~$0.7
qwen3-max-thinking~$3.5~$1.7
gpt-5~$5(ceros estériles)(sterile zeros)
opus-4.8 + thinking~$13~$3.3
Total pagado del proyecto (v7→v14, todos los legs)Total paid for the project (v7→v14, all legs)≈ $50

El driver de costo es la SALIDA (el thinking se factura como output). La frontera calidad/costo la definen ultra-free y glm-5.2; opus compra la última milla — precisión 1.00 y las únicas convergencias legítimas — a 6× el precio de glm. The cost driver is OUTPUT (thinking bills as output). The quality/cost frontier is set by free-ultra and glm-5.2; opus buys the last mile — precision 1.00 and the only legitimate convergences — at 6× glm's price.

a producciónto production

Si fueras a producción mañanaIf you shipped tomorrow

  • Pipeline free-primero: ultra+thinking para el barrido; escalar a glm-5.2 donde abstenga feo; reservar opus para pozos de decisión. Free-first pipeline: ultra+thinking for the sweep; escalate to glm-5.2 where it abstains badly; reserve opus for decision wells.
  • Guard anti-cero-estéril si usas gpt-5 (exigir pay>0 en la convergencia). Nano solo con presupuesto de iteración (≥4 ciclos). Super y gpt-oss-20b: no. Anti-sterile-zero guard if you use gpt-5 (require pay>0 on convergence). Nano only with an iteration budget (≥4 cycles). Super and gpt-oss-20b: don't.
  • Presupuesta la infraestructura: cuota free de 1000 req/día por cuenta, pools free populares perma-429, y verifica la API key tras cada recarga (aprendido con un 401 a mitad de batch). Budget the infrastructure: 1000 req/day free quota per account, popular free pools perma-429, and verify the API key after every top-up (learned via a 401 mid-batch).
  • Y la regla que paga todo lo demás: cada capacidad nueva del motor entra con golden tests ANTES de usarse, y toda string visible al agente pasa auditoría de fuga. La velocidad del proyecto salió de esa disciplina, no a pesar de ella. And the rule that pays for everything else: every new engine capability lands with golden tests BEFORE use, and every agent-visible string passes a leak audit. The project's speed came from that discipline, not despite it.