Heating Mold Temple Temper Harden Anneal
Stage 6 · Anneal · Renewal Etapa 6 · Recocido · Renovación

Bring Existing Code Under Discipline Trae el Código Existente a la Disciplina

Annealing relieves internal stress in metal and readies it to be reshaped. In GS, Anneal is how an existing system is renewed: protected with oracle tests, remediated in priority order under cascade discipline, and — for large systems — strangled module by module rather than rewritten. When remediation is done, the system re-enters the cycle as if greenfield. El recocido alivia el estrés interno del metal y lo prepara para ser reformado. En GS, el Recocido es cómo se renueva un sistema existente: protegido con oracle tests, remediado en orden de prioridad bajo disciplina de cascada y — para sistemas grandes — estrangulado módulo por módulo en vez de reescrito. Cuando la remediación termina, el sistema re-entra al ciclo como si fuera greenfield.

Before You Anneal — Prerequisites Antes del Recocido — Prerrequisitos

Remediation needs the harness already in place La remediación necesita el harness ya instalado

Anneal is remediation — and you cannot safely remediate code that isn't yet protected. It assumes the existing project already has the three things below. If it doesn't, install them first: the Brownfield journey walks all three in sequence (Steps 03–06), starting from the audit you ran in Heating. El Recocido es remediación — y no podés remediar código que todavía no está protegido. Asume que el proyecto existente ya tiene las tres cosas de abajo. Si no las tiene, instalalas primero: el camino Brownfield recorre las tres en secuencia (Pasos 03–06), partiendo de la auditoría que corriste en Heating.

PrerequisitePrerrequisito What it isQué es WhereDónde
Spec from codeSpec desde el código docs/spec/SPEC.md generated from what existsgenerado desde lo que existe Brownfield Step 03Brownfield Paso 03 · /mold
Sentinel CONSTITUTION.mdCNT on docs + code + disciplinesCNT sobre docs + código + disciplinas Brownfield Step 05Brownfield Paso 05 · /mold
Harness hooks + CI + quality gateshooks + CI + quality gates Brownfield Step 06Brownfield Paso 06 · /temple
Already have all three? Continue with Step 01 below. The oracle tests you write next are the one piece of the harness that Anneal itself adds — characterization tests that pin the current behavior before you change it. ¿Ya tenés las tres? Continuá con el Paso 01 abajo. Los oracle tests que escribís a continuación son la única pieza del harness que el propio Recocido agrega — tests de caracterización que fijan el comportamiento actual antes de cambiarlo.

Step 01 — Oracle Tests Paso 01 — Oracle Tests

Boundary tests BEFORE touching structural code Tests de boundary ANTES de tocar código estructural

Before changing anything structural, install oracle tests at the system boundary. These tests verify the existing behavior — not the intended behavior. They are your safety net during remediation. If a remediation breaks an oracle test, you've changed behavior, not just structure. Antes de cambiar cualquier cosa estructural, instala oracle tests en el boundary del sistema. Estos tests verifican el comportamiento existente — no el comportamiento pretendido. Son tu red de seguridad durante la remediación. Si una remediación rompe un oracle test, cambiaste comportamiento, no solo estructura.

01
Paste this — Install Oracle TestsPega esto — Instala Oracle TestsRead docs/spec/SPEC.md and CONSTITUTION.md. Install oracle tests at the system boundary BEFORE any structural changes. For each HTTP endpoint (or equivalent system boundary): 1. Write an integration test that verifies the current behavior — what it actually does today. 2. Write an error-path test for each failure mode. 3. Place all oracle tests in: tests/oracle/ 4. These tests must NOT change during remediation. If one fails after a refactor, stop. Commit: test(oracle): install boundary tests before remediation After all oracle tests pass: run the GS audit again — the score is your baseline.Lee docs/spec/SPEC.md y CONSTITUTION.md. Instala oracle tests en el boundary del sistema ANTES de cualquier cambio estructural. Para cada endpoint HTTP (o boundary equivalente del sistema): 1. Escribe un test de integración que verifique el comportamiento actual — lo que realmente hace hoy. 2. Escribe un test de path de error para cada modo de falla. 3. Coloca todos los oracle tests en: tests/oracle/ 4. Estos tests NO deben cambiar durante la remediación. Si uno falla después de un refactor, detente. Commit: test(oracle): install boundary tests before remediation Después de que todos los oracle tests pasen: corre la auditoría GS nuevamente — ese puntaje es tu baseline.

Step 02 — Remediation Paso 02 — Remediación

Priority order, cascade discipline throughout Orden de prioridad, disciplina de cascada en todo momento

Apply the remediation plan from your audit under full cascade discipline. Work in priority order: highest-impact, lowest-score properties first. Each item is one of three operation types: refactor, fix, or new spec entry. The harness rejects any commit that skips the discipline. Aplica el plan de remediación de tu auditoría bajo disciplina de cascada completa. Trabaja en orden de prioridad: propiedades de mayor impacto y menor puntaje primero. Cada item es uno de tres tipos de operación: refactor, fix o nueva entrada de spec. El harness rechaza cualquier commit que saltee la disciplina.

02
Paste this — Remediation Plan ExecutionPega esto — Ejecución del Plan de RemediaciónRead docs/spec/SPEC.md, CONSTITUTION.md, and the GS audit report from Step 02. Apply the remediation plan in priority order. Rules: 1. Work one item at a time. Complete and commit before starting the next. 2. Each remediation item is one of: - REFACTOR: ADR first → structural change → oracle tests still pass - FIX: failing test first → patch → oracle tests still pass - SPEC UPDATE: add missing F-NNN or NFR to SPEC.md → derive code from it 3. After every 3 items, run the full test suite including oracle tests. 4. Update STATUS.md after each session. 5. Pause before: any DB schema change, any public API change, any change touching more than 10 files. After completing the remediation plan, run the GS audit again for the after-score.Lee docs/spec/SPEC.md, CONSTITUTION.md y el reporte de auditoría GS del Paso 02. Aplica el plan de remediación en orden de prioridad. Reglas: 1. Trabaja un item a la vez. Completa y commitea antes de comenzar el siguiente. 2. Cada item de remediación es uno de: - REFACTOR: ADR primero → cambio estructural → oracle tests siguen pasando - FIX: test fallido primero → parche → oracle tests siguen pasando - SPEC UPDATE: agrega F-NNN o NFR faltante a SPEC.md → deriva código desde él 3. Después de cada 3 items, corre la suite completa de tests incluyendo oracle tests. 4. Actualiza STATUS.md después de cada sesión. 5. Pausa antes de: cualquier cambio de schema de BD, cualquier cambio de API pública, cualquier cambio que toque más de 10 archivos. Después de completar el plan de remediación, corre la auditoría GS nuevamente para el puntaje posterior.

Step 03 — Large Codebases: The Strangler Fig Paso 03 — Codebases Grandes: La Higuera Estranguladora

Strangle the old system module by module — never a big-bang rewrite Estrangula el sistema viejo módulo por módulo — nunca una reescritura big-bang
For large brownfield systems, don't apply Tier 2 to the whole codebase at once. Identify the seam — the boundary where new GS-disciplined code will grow. Apply NFR gates and CD pipeline to the new module only. Route a percentage of traffic to it. The old code degrades gracefully as the new module grows. This is the Strangler Fig pattern applied to GS adoption: the new system strangles the old one without a big-bang rewrite. Para sistemas brownfield grandes, no apliques Tier 2 a toda la codebase de una vez. Identifica la costura — el límite donde crecerá el nuevo código bajo disciplina GS. Aplica gates NFR y pipeline de CD solo al nuevo módulo. Ruteá un porcentaje del tráfico hacia él. El código viejo degrada graciosamente mientras crece el nuevo módulo. Este es el patrón Strangler Fig aplicado a la adopción de GS: el nuevo sistema estrangula al viejo sin una reescritura big-bang.

Step 04 — Re-enter the Cycle Paso 04 — Re-entra al Ciclo

Anneal feeds back into Heating for the next module El Recocido retroalimenta al Calentamiento para el siguiente módulo

Once remediated, the module is greenfield-grade: spec-governed, harness-protected, disciplined. New work on it follows Temple's ongoing loop. The forge cycle closes and begins again — anneal feeds back into heating for the next module or the next phase. Una vez remediado, el módulo es de grado greenfield: gobernado por spec, protegido por harness, disciplinado. El trabajo nuevo sobre él sigue el loop continuo del Temple. El ciclo de la forja se cierra y comienza de nuevo — el recocido retroalimenta al calentamiento para el siguiente módulo o la siguiente fase.

Anneal → (re-audit) → Heating → Mold → Temple … for the next seam. Recocido → (re-auditoría) → Calentamiento → Moldeado → Temple … para la siguiente costura.
← Harden: Tier 2 Heating: Next Module →
Full Path Ruta Completa
Brownfield → Brownfield →
Brownfield journey — the full existing-project path. Recorrido brownfield — la ruta completa del proyecto existente.
Audit Auditoría
Diagnose → Diagnostica →
Re-run the audit for an after-score. Vuelve a correr la auditoría para un puntaje posterior.
Ongoing Continuo
Temple → Temple →
Ongoing work loop. Loop de trabajo continuo.
Cycle Ciclo
Forge → Forja →
The full cycle. El ciclo completo.