Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- run: node scripts/verify-chapter-anatomy.mjs
- run: node scripts/verify-review-packet-coverage.mjs
- run: node scripts/verify-editorial-status.mjs
- run: node scripts/verify-gate-sync.mjs
- run: cargo fmt --check
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo test --all-targets
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,13 @@ node scripts/verify-cargo-examples.mjs
node scripts/verify-chapter-anatomy.mjs
node scripts/verify-review-packet-coverage.mjs
node scripts/verify-editorial-status.mjs
node scripts/verify-gate-sync.mjs
git diff --check
```

Además, el check remoto `rust` en GitHub Actions debe pasar antes de considerar
listo cualquier corte o PR autónomo.

## Gobernanza

- `AGENTS.md` es la guía de arranque para humanos e IA en este repositorio.
Expand Down
1 change: 1 addition & 0 deletions docs/compuertas-automaticas.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ un estado editorial superior.
| `node scripts/verify-chapter-anatomy.mjs` | Que cada capítulo conserve la anatomía editorial esperada antes de revisión humana. | Falta concepto, problema, alternativas, justificación, invariantes, modelo Rust, ejemplo, práctica o cierre editorial. | Joel decide si la explicación es correcta, suficiente y aprobable. |
| `node scripts/verify-review-packet-coverage.mjs` | Que el paquete de revisión humana cubra todos los capítulos y sus artefactos principales. | Falta un capítulo, ruta, comando de compuerta o frontera editorial. | Joel decide el resultado de la revisión; la compuerta solo evita omisiones. |
| `node scripts/verify-editorial-status.mjs` | Que ningún capítulo se marque como `reviewed` ni `published` por automatización. | Estado editorial elevado sin revisión humana explícita. | Solo Joel puede aprobar revisión o publicación de capítulos. |
| `node scripts/verify-gate-sync.mjs` | Que README, publicación candidata, guía de revisión, paquete humano y esta matriz mencionen las mismas compuertas obligatorias. | Documento operativo con una lista incompleta o desactualizada. | Joel decide si una nueva compuerta pertenece al flujo; el script solo evita deriva documental. |
| `cargo fmt --check` | Que el código Rust conserve formato estándar. | Archivo Rust fuera de formato. | No sustituye criterio sobre legibilidad pedagógica. |
| `cargo clippy --all-targets --all-features -- -D warnings` | Que biblioteca, pruebas y ejemplos no acumulen advertencias relevantes. | Warning de Clippy o patrón de código riesgoso. | Joel decide si una excepción futura requiere explicación curricular. |
| `cargo test --all-targets` | Que modelos, ejemplos compilables y pruebas de integración mantengan invariantes. | Prueba fallida, ejemplo que no compila o contrato roto. | No prueba exactitud conceptual completa del capítulo. |
Expand Down
4 changes: 4 additions & 0 deletions docs/guia-revision-corte.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,16 @@ Antes de mover cualquier capítulo a `reviewed`, deben pasar:
- `node scripts/verify-chapter-anatomy.mjs`;
- `node scripts/verify-review-packet-coverage.mjs`;
- `node scripts/verify-editorial-status.mjs`;
- `node scripts/verify-gate-sync.mjs`;
- `cargo fmt --check`;
- `cargo clippy --all-targets --all-features -- -D warnings`;
- `cargo test --all-targets`;
- `cargo test --doc`;
- `cargo bench --all-targets`;
- `git diff --check`.

El check remoto `rust` en GitHub Actions también debe estar en verde antes de
usar esta evidencia como base de aprobación humana.

La aprobación humana debe quedar registrada en el PR que cambie el estado
editorial.
5 changes: 5 additions & 0 deletions docs/paquete-revision-humana.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ node scripts/verify-course-links.mjs
node scripts/verify-manifest-consistency.mjs
node scripts/verify-cargo-examples.mjs
node scripts/verify-chapter-anatomy.mjs
node scripts/verify-review-packet-coverage.mjs
node scripts/verify-editorial-status.mjs
node scripts/verify-gate-sync.mjs
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets
Expand All @@ -40,6 +42,9 @@ cargo bench --all-targets
git diff --check
```

El check remoto `rust` en GitHub Actions también debe pasar antes de cerrar la
revisión del corte.

## Preguntas por capítulo

Para cada capítulo, revisar:
Expand Down
5 changes: 4 additions & 1 deletion docs/publicacion-candidata.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ Antes de considerar este corte como listo para revisión humana, deben pasar:
- `node scripts/verify-cargo-examples.mjs`;
- `node scripts/verify-chapter-anatomy.mjs`;
- `node scripts/verify-review-packet-coverage.mjs`;
- `node scripts/verify-editorial-status.mjs`;
- `node scripts/verify-gate-sync.mjs`;
- `cargo fmt --check`;
- `cargo clippy --all-targets --all-features -- -D warnings`;
- `cargo test --all-targets`;
- `cargo test --doc`;
- `cargo bench --all-targets`;
- `node scripts/verify-editorial-status.mjs`;
- `git diff --check`.

También debe pasar el check remoto `rust` en GitHub Actions.

## Benchmarks aplicables

Se ejecuta `cargo bench --all-targets` en este corte y pasa correctamente. El
Expand Down
67 changes: 67 additions & 0 deletions scripts/verify-gate-sync.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { readFileSync } from "node:fs";
import { join } from "node:path";

const root = join(import.meta.dirname, "..");
const failures = [];

const localGates = [
"node scripts/verify-course-links.mjs",
"node scripts/verify-manifest-consistency.mjs",
"node scripts/verify-cargo-examples.mjs",
"node scripts/verify-chapter-anatomy.mjs",
"node scripts/verify-review-packet-coverage.mjs",
"node scripts/verify-editorial-status.mjs",
"node scripts/verify-gate-sync.mjs",
"cargo fmt --check",
"cargo clippy --all-targets --all-features -- -D warnings",
"cargo test --all-targets",
"cargo test --doc",
"cargo bench --all-targets",
"git diff --check",
];

const remoteGates = ["check remoto `rust`"];

const documents = [
["README.md", "README"],
["docs/publicacion-candidata.md", "publicación candidata"],
["docs/guia-revision-corte.md", "guía de revisión"],
["docs/paquete-revision-humana.md", "paquete humano"],
["docs/compuertas-automaticas.md", "matriz de compuertas"],
];

function fail(message) {
failures.push(message);
}

function hasGate(markdown, gate) {
return markdown.includes(gate);
}

for (const [relativePath, label] of documents) {
const markdown = readFileSync(join(root, relativePath), "utf8");

for (const gate of localGates) {
if (!hasGate(markdown, gate)) {
fail(`${label}: falta compuerta ${gate}`);
}
}

for (const gate of remoteGates) {
if (!hasGate(markdown.toLowerCase(), gate)) {
fail(`${label}: falta compuerta ${gate}`);
}
}
}

if (failures.length > 0) {
console.error("Compuertas documentadas fuera de sincronía:");
for (const failure of failures) {
console.error(`- ${failure}`);
}
process.exit(1);
}

console.log(
`Compuertas sincronizadas: ${localGates.length + remoteGates.length} compuertas en ${documents.length} documentos.`,
);
1 change: 1 addition & 0 deletions scripts/verify-review-packet-coverage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ for (const command of [
"node scripts/verify-cargo-examples.mjs",
"node scripts/verify-chapter-anatomy.mjs",
"node scripts/verify-editorial-status.mjs",
"node scripts/verify-gate-sync.mjs",
"cargo fmt --check",
"cargo clippy --all-targets --all-features -- -D warnings",
"cargo test --all-targets",
Expand Down
Loading