gemstack-ai 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/gemstack-plan/SKILL.md +2 -1
- package/.agents/skills/gemstack-qa/SKILL.md +3 -0
- package/.agents/skills/gemstack-ship/SKILL.md +5 -1
- package/.agents/skills/gemstack-spec/SKILL.md +3 -2
- package/.agents/skills/gemstack-tasks/SKILL.md +4 -3
- package/.gemstack/state.json +7 -9
- package/CHANGELOG.md +32 -0
- package/README.md +13 -0
- package/RELEASE_NOTES.md +24 -0
- package/docs/architecture-consistency.md +14 -2
- package/docs/spec-driven-development.md +26 -0
- package/{gemstack-ai-1.1.2.tgz → gemstack-ai-1.2.0.tgz} +0 -0
- package/handoff.md +28 -15
- package/package.json +2 -2
- package/specs/007-mechanical-test-matrix-closure-evidence/.gemstack.json +5 -0
- package/specs/007-mechanical-test-matrix-closure-evidence/closure.json +59 -0
- package/specs/007-mechanical-test-matrix-closure-evidence/plan.md +484 -0
- package/specs/007-mechanical-test-matrix-closure-evidence/spec.md +597 -0
- package/specs/007-mechanical-test-matrix-closure-evidence/tasks.md +536 -0
- package/specs/templates/plan.md +30 -0
- package/specs/templates/spec.md +18 -0
- package/specs/templates/tasks.md +9 -0
- package/src/cli.js +6 -0
- package/src/commands/collect.js +340 -0
- package/src/commands/ship.js +79 -0
- package/src/commands/verify.js +128 -6
- package/src/lib/closure-context.js +444 -0
- package/src/lib/runner-adapters.js +347 -0
- package/src/lib/test-matrix.js +187 -0
|
@@ -17,5 +17,6 @@ Invocado mediante `/plan`.
|
|
|
17
17
|
5. Detalla el stack y llena la tabla "Complexity Tracking" SÓLO si rompiste alguna regla de la constitución y necesitas justificarlo.
|
|
18
18
|
6. Opcionalmente, genera los entregables satélites: `data-model.md`, `contracts/` (para APIs/Interfaces), y `quickstart.md`.
|
|
19
19
|
7. **Herencia y Contratos Aditivos (Upgrade A)**: PLAN hereda automáticamente los contratos declarados en `spec.md`. No contradigas ni alteres los contratos congelados heredados; si requieres contratos técnicos adicionales, decláralos de forma compatible y aditiva en el bloque ````gemstack-contracts ```` de `plan.md`.
|
|
20
|
-
8.
|
|
20
|
+
8. **Vinculación Física de Pruebas y Gates (Upgrade B)**: Define en `plan.md` los bloques canónicos ````gemstack-test-bindings ```` (asociando cada ID de prueba a un archivo físico y runner) y ````gemstack-closure-gates ```` (especificando scripts de package.json obligatorios).
|
|
21
|
+
9. Pide aprobación al usuario antes de permitir la ejecución de `/tasks`.
|
|
21
22
|
|
|
@@ -15,3 +15,6 @@ Invocado mediante `/qa` o `/qa-only`.
|
|
|
15
15
|
3. Si la aplicación es visual, recomienda `/browser` o correr tests de Playwright para verificar manualmente la UI.
|
|
16
16
|
4. Genera un breve reporte indicando si cada Criterio pasó o falló.
|
|
17
17
|
|
|
18
|
+
|
|
19
|
+
5. **Recolección Mecánica de Evidencias (Upgrade B)**: Ejecuta `node src/cli.js collect` para ejecutar los runners de pruebas, gates y reconciliar la matriz mecánica generando `specs/[nombre-feature]/closure.json`.
|
|
20
|
+
6. Valida que la evidencia esté fresca y en modo lectura con `node src/cli.js verify`.
|
|
@@ -12,7 +12,11 @@ Invocado mediante `/ship`.
|
|
|
12
12
|
## Proceso:
|
|
13
13
|
1. Verifica revisión (`/review`) y validación (`/qa`).
|
|
14
14
|
2. Confirma validación de seguridad (`/cso`).
|
|
15
|
-
3.
|
|
15
|
+
3. **Validación de Evidencia Mecánica de Cierre (Upgrade B)**:
|
|
16
|
+
- Comprueba que exista `specs/[nombre-feature]/closure.json`.
|
|
17
|
+
- Confirma que el estado sea `VERIFIED` o `VERIFIED_WITH_EXCEPTIONS`.
|
|
18
|
+
- Bloquea el ship si el estado es `STALE`, `BLOCKED`, o si falta el archivo (a menos que la feature opere en modo LEGACY).
|
|
19
|
+
- Ejecuta `node src/cli.js ship` para validar compuertas y transicionar el ciclo de vida.
|
|
16
20
|
4. Genera un PR summary si se pide.
|
|
17
21
|
5. NO hagas push, merge o deploy sin aprobación explícita.
|
|
18
22
|
6. Sugiere ejecutar `/handoff` para documentar la entrega en la memoria del proyecto.
|
|
@@ -20,6 +20,7 @@ Eres un Product Manager técnico. Tu objetivo es convertir ideas vagas en requis
|
|
|
20
20
|
5. **CERO SUPOSICIONES**: Si el usuario omitió detalles, NO adivines. Usa el marcador `[NEEDS CLARIFICATION: tu duda]` en el documento.
|
|
21
21
|
6. No describas implementación técnica (nada de stacks, bases de datos o APIs). Concéntrate estrictamente en el "Qué" y "Por qué".
|
|
22
22
|
7. **Contratos Arquitectónicos Congelados (Upgrade A)**: Si la funcionalidad implica decisiones estructurales críticas (estados enum, tuplas de identidad, reglas de procedencia, invariantes booleanas, límites de roadmap o límites boundary), decláralos explícitamente en el bloque canónico ````gemstack-contracts ````. Congela solo decisiones materiales, no texto arbitrario.
|
|
23
|
-
8.
|
|
24
|
-
9.
|
|
23
|
+
8. **Matriz Mecánica de Pruebas (Upgrade B)**: Declara la matriz canónica en el bloque ````gemstack-test-matrix ```` de `spec.md`, asignando IDs canónicos estables `TEST-[FEATURE]-[CAT][NUM]`, capas y compuertas (REQUIRED | SUPPLEMENTAL).
|
|
24
|
+
9. Actualiza el archivo `.gemstack/state.json` para reflejar la rama activa y fase: `{"active_spec": "specs/[nombre-feature]/", "current_phase": "spec", "last_update": "<timestamp>"}`.
|
|
25
|
+
10. Una vez finalizado, indica al usuario que puede revisar la especificación y, tras resolver las dudas, ejecutar `/plan`.
|
|
25
26
|
|
|
@@ -13,7 +13,8 @@ Invocado mediante `/tasks`.
|
|
|
13
13
|
1. Lee `specs/[nombre-feature]/plan.md` y, si existen, `data-model.md` y la carpeta `contracts/`.
|
|
14
14
|
2. Convierte los contratos, entidades y el plan en una lista estricta de ejecución en `specs/[nombre-feature]/tasks.md` usando la plantilla `specs/templates/tasks.md`.
|
|
15
15
|
3. **Herencia de Contratos (Upgrade A)**: TASKS hereda automáticamente los contratos consolidados de SPEC y PLAN. No se requiere declarar un bloque de contratos propio salvo que se agreguen contratos operacionales específicos de tareas.
|
|
16
|
-
4.
|
|
17
|
-
5.
|
|
18
|
-
6.
|
|
16
|
+
4. **Trazabilidad TASK -> TEST (Upgrade B)**: Para cada tarea, incluye comentarios de metadatos `<!-- gemstack:validation_required=true|false -->`, `<!-- gemstack:tests=... -->`, y `<!-- gemstack:files=... -->`, asegurando que todas las pruebas canónicas requeridas estén mapeadas a al menos una tarea de implementación.
|
|
17
|
+
5. Aplica Test-First: Las tareas de escribir pruebas (y validarlas) deben ir ANTES que la implementación de código.
|
|
18
|
+
6. Usa el marcador `[P]` para tareas independientes que se puedan paralelizar.
|
|
19
|
+
7. Ofrece al usuario comenzar automáticamente con la primera tarea o delegar a subagentes paralelos si hay múltiples `[P]`.
|
|
19
20
|
|
package/.gemstack/state.json
CHANGED
|
@@ -2,18 +2,16 @@
|
|
|
2
2
|
"version": "0.1",
|
|
3
3
|
"current_phase": "shipped",
|
|
4
4
|
"status": "SHIPPED",
|
|
5
|
-
"stop_reason": "
|
|
5
|
+
"stop_reason": "UPGRADE_B_SHIPPED_DONE",
|
|
6
6
|
"active_spec": null,
|
|
7
7
|
"completed_phases": [
|
|
8
8
|
"spec",
|
|
9
|
-
"plan"
|
|
10
|
-
"tasks",
|
|
11
|
-
"implement"
|
|
9
|
+
"plan"
|
|
12
10
|
],
|
|
13
11
|
"phase_hashes": {
|
|
14
|
-
"spec": "
|
|
15
|
-
"plan": "
|
|
16
|
-
"tasks": "
|
|
12
|
+
"spec": "75f7b5aee9a7d45836128f619ba67d0870c9be3a2634d9152b01c6501faa513d",
|
|
13
|
+
"plan": "c77a3b1410d3b3028b72d66db524c6a23b0998dce12dddaee2507b4e446aec3b",
|
|
14
|
+
"tasks": "69ea9ae8557a41f98102c7b91905f74b3645ea59cbe301a54425216d5789b1d8"
|
|
17
15
|
},
|
|
18
16
|
"consistency": {
|
|
19
17
|
"status": "PASS",
|
|
@@ -24,6 +22,6 @@
|
|
|
24
22
|
"freeze": false,
|
|
25
23
|
"allowed_paths": []
|
|
26
24
|
},
|
|
27
|
-
"last_update": "2026-09-
|
|
28
|
-
"last_completed_feature": "specs/
|
|
25
|
+
"last_update": "2026-09-11T16:49:53.470Z",
|
|
26
|
+
"last_completed_feature": "specs/007-mechanical-test-matrix-closure-evidence/"
|
|
29
27
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [v1.2.0] - 2026-09-11
|
|
6
|
+
### Added
|
|
7
|
+
- **Mechanical Test Matrix & Closure Evidence (Upgrade B)**: Full mechanical closure verification framework eliminating false closure and test discovery hallucinations.
|
|
8
|
+
- Canonical fenced `gemstack-test-matrix` blocks in `spec.md` with 20 canonical acceptance test criteria (`TEST-CLOSURE-A01` through `H01`).
|
|
9
|
+
- Deterministic Acceptance Signature (`acceptanceSignature`): SHA-256 digest calculated across all canonical test definitions ensuring immutable acceptance criteria.
|
|
10
|
+
- Bidirectional Task <-> Test Traceability: strict mapping between `tasks.md` validation blocks and canonical acceptance tests.
|
|
11
|
+
- Zero-Shell Test Runner Adapters: safe, cross-platform `node:test` TAP runner adapter with suite container detection (`kind: 'SUITE'` vs `kind: 'TEST'`).
|
|
12
|
+
- Exact Canonical Reconciliation Arithmetic: verifies `canonical_required = canonical_passed + missing`, `physical_executed = canonical_executed + supporting_executed`, and prevents phantoms and orphans.
|
|
13
|
+
- Mutating Evidence Collector (`gemstack collect`): executes bound test files and required `PACKAGE_SCRIPT` gates to produce `specs/<feature>/closure.json`.
|
|
14
|
+
- Dynamic Closure Context Freshness (`closureContextHash`): binds closure evidence to the repository state (clean/dirty git or non-git), phase hashes, test files, and bounded implementation code.
|
|
15
|
+
- Read-Only Closure Gate in `gemstack verify`: stage 5/6 verifies `closure.json` freshness and acceptance criteria without writing or mutating any files on disk.
|
|
16
|
+
- Lifecycle Ship Enforcement (`gemstack ship`): requires status `VERIFIED` in `closure.json` before transitioning feature lifecycle to `SHIPPED`.
|
|
17
|
+
- Progressive `LEGACY` mode support: features lacking test matrix blocks continue without friction or errors.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- `gemstack verify` upgraded to a 6-stage deterministic verification pipeline with zero-mutation read-only verification.
|
|
21
|
+
- `package.json` test script explicitly enumerates all 11 physical test suites for portable cross-platform execution.
|
|
22
|
+
- Agent skills (`gemstack-spec`, `gemstack-plan`, `gemstack-tasks`, `gemstack-qa`, `gemstack-ship`) and templates updated with Upgrade B canonical workflows.
|
|
23
|
+
|
|
24
|
+
### Compatibility
|
|
25
|
+
- 100% backward compatible with existing Gemstack repositories and Upgrade A contract blocks.
|
|
26
|
+
- Zero external runtime or development npm dependencies added (`package.json` dependencies remain `{}`).
|
|
27
|
+
|
|
28
|
+
### Validation
|
|
29
|
+
- 22/22 Upgrade B implementation tasks complete (T001–T022).
|
|
30
|
+
- 20/20 canonical P1 acceptance tests passing.
|
|
31
|
+
- 45/45 combined canonical acceptance tests passing (25 Upgrade A + 20 Upgrade B).
|
|
32
|
+
- 53/53 physical tests passing with 0 regressions.
|
|
33
|
+
- `npm test` exit code 0.
|
|
34
|
+
- `gemstack verify` exit code 0 with 0 open blockers.
|
|
35
|
+
- Self-dogfooded on `specs/007-mechanical-test-matrix-closure-evidence/` with closure status `VERIFIED`.
|
|
36
|
+
|
|
5
37
|
## [v1.1.2] - 2026-09-11
|
|
6
38
|
### Fixed
|
|
7
39
|
- Fixed host-dependent normalization of simulated Windows paths in the Architecture Consistency Engine.
|
package/README.md
CHANGED
|
@@ -95,6 +95,19 @@ Gemstack mechanically prevents AI agents from silently violating or hallucinatin
|
|
|
95
95
|
- `gemstack verify` performs strictly read-only verification without mutating or overwriting accepted phase hashes (`VERIFY != FREEZE`).
|
|
96
96
|
- Existing projects without structured contracts automatically run in **LEGACY** mode without breaking.
|
|
97
97
|
|
|
98
|
+
|
|
99
|
+
## 🧪 Mechanical Test Matrix & Closure Evidence
|
|
100
|
+
|
|
101
|
+
Gemstack Upgrade B guarantees that what was planned is what was physically tested:
|
|
102
|
+
- **Canonical Test Matrix**: `spec.md` declares canonical acceptance tests and cryptographic `acceptanceSignature`.
|
|
103
|
+
- **Physical Test Bindings**: `plan.md` maps canonical IDs 1:1 to physical runner test files.
|
|
104
|
+
- **Task Traceability**: `tasks.md` validates that all required canonical tests have implementation tasks.
|
|
105
|
+
- **Safe Runner Adapters**: Direct zero-shell execution of test suites and package script gates.
|
|
106
|
+
- **`gemstack collect`**: Mutating runner that executes tests and atomically writes `specs/<feature>/closure.json`.
|
|
107
|
+
- **`gemstack verify`**: Strictly read-only 6-stage validator verifying evidence freshness against `closureContextHash`.
|
|
108
|
+
- **`gemstack ship`**: Gatekeeper requiring verified evidence before allowing transition to `SHIPPED`.
|
|
109
|
+
- **Git Optionality & Legacy Support**: Works identically on clean Git, dirty Git, and non-Git projects, with graceful legacy fallback.
|
|
110
|
+
|
|
98
111
|
## 🐝 Advanced Autonomy (The WOW Update)
|
|
99
112
|
|
|
100
113
|
Gemstack isn't just passive documents; it actively orchestrates agentic capabilities:
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Gemstack Release Notes
|
|
2
2
|
|
|
3
|
+
# Gemstack v1.2.0 — Mechanical Test Matrix & Closure Evidence
|
|
4
|
+
|
|
5
|
+
## Highlights
|
|
6
|
+
- **Mechanical Test Matrix & Closure Verification (Upgrade B)**: Eliminates false closure and test discovery hallucinations by introducing a deterministic verification pipeline from specification to shipment.
|
|
7
|
+
- **Canonical Test Matrix (`gemstack-test-matrix`)**: Explicit acceptance criteria defined in `spec.md` with deterministic `acceptanceSignature` (SHA-256) ensuring acceptance rules are immutable once approved.
|
|
8
|
+
- **Task ↔ Test Traceability**: Explicit bidirectional binding between implementation tasks in `tasks.md` and canonical acceptance tests.
|
|
9
|
+
- **Safe Zero-Shell Runners**: Pure Node.js `node:test` TAP runner adapter with suite container exclusion (`kind: 'SUITE'` vs `kind: 'TEST'`), ensuring TAP headers/containers are never counted as physical tests.
|
|
10
|
+
- **Exact Canonical Reconciliation Arithmetic**: Mechanical validation proving `canonical_required = canonical_passed + missing` and `physical_executed = canonical_executed + supporting_executed` with zero tolerance for phantoms or orphans.
|
|
11
|
+
- **Mutating Collector (`gemstack collect`)**: Executes bound test suites and required `PACKAGE_SCRIPT` gates to produce `specs/<feature>/closure.json`.
|
|
12
|
+
- **Dynamic Closure Context Freshness (`closureContextHash`)**: Cryptographically binds closure evidence to repository state (clean git, dirty git, or non-git), phase hashes, bound test files, and bounded implementation source files.
|
|
13
|
+
- **Read-Only Verification Pipeline (`gemstack verify`)**: Stage 5/6 inspects closure freshness and gate outcomes in memory with 0 disk mutations.
|
|
14
|
+
- **Ship Gatekeeper (`gemstack ship`)**: Strict gate requiring `status: "VERIFIED"` in `closure.json` before transitioning feature lifecycle to `SHIPPED`.
|
|
15
|
+
- **Progressive LEGACY Mode**: Full backward compatibility for features without test matrices or contract blocks.
|
|
16
|
+
- **Zero-Dependency Architecture**: 100% native Node.js standard library implementation with zero third-party production dependencies.
|
|
17
|
+
|
|
18
|
+
## Acceptance & Regression Baseline
|
|
19
|
+
- 25 Upgrade A canonical acceptance tests passing (`TEST-CONSISTENCY-A01` through `H02`).
|
|
20
|
+
- 20 Upgrade B canonical acceptance tests passing (`TEST-CLOSURE-A01` through `H01`).
|
|
21
|
+
- 45 total canonical acceptance tests passing.
|
|
22
|
+
- 53 total physical tests passing with 0 regressions.
|
|
23
|
+
- 11 physical test suites explicitly enumerated for cross-platform reliability.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
3
27
|
# Gemstack v1.1.2 — Architecture Consistency & Phase Freezing
|
|
4
28
|
|
|
5
29
|
## Recovery Release Note
|
|
@@ -130,10 +130,10 @@ Gemstack strictly separates operational state from historical audit trails:
|
|
|
130
130
|
|
|
131
131
|
## 9. Verification Integration (`gemstack verify`)
|
|
132
132
|
|
|
133
|
-
Architectural consistency is embedded as **Step 4/
|
|
133
|
+
Architectural consistency is embedded as **Step 4/6** in the unified `gemstack verify` command:
|
|
134
134
|
|
|
135
135
|
```text
|
|
136
|
-
[INFO] --- 4/
|
|
136
|
+
[INFO] --- 4/6 Verificación de Consistencia de Arquitectura y Hashes de Fase ---
|
|
137
137
|
[OK] [STRUCTURED] 5 contrato(s) base declarados en spec.md.
|
|
138
138
|
[OK] Hash congelado de spec.md verificado: f5d423eaf508...
|
|
139
139
|
[OK] Hash congelado de plan.md verificado: 1ce0e5886342...
|
|
@@ -142,3 +142,15 @@ Architectural consistency is embedded as **Step 4/5** in the unified `gemstack v
|
|
|
142
142
|
```
|
|
143
143
|
|
|
144
144
|
If any contracts contradict, artifacts mutate, or unapproved blockers exist, `gemstack verify` exits with code 1, halting CI/CD pipelines.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## 10. Mechanical Test Matrix & Closure Evidence (Upgrade B)
|
|
149
|
+
|
|
150
|
+
Beyond static contract consistency across phase files, Gemstack Upgrade B validates execution evidence against declared requirements:
|
|
151
|
+
|
|
152
|
+
- **`acceptanceSignature`**: Full semantic record SHA-256 digest of the canonical test matrix in `spec.md`.
|
|
153
|
+
- **Authoritative Execution**: Native test runners (such as `node:test`) execute bound tests without shell intermediaries. TAP output is parsed to extract executed canonical test tokens.
|
|
154
|
+
- **Reconciliation & Set Equality**: Proves that all declared required canonical tests were physically executed and passed (`PASS + FAIL + SKIP + TODO + CANCELLED == TOTAL_PHYSICAL`). Detects `PHANTOM_TEST` (claimed but unexecuted) and `ORPHAN_TEST` (executed with unregistered canonical ID).
|
|
155
|
+
- **`closureContextHash`**: Deterministic SHA-256 fingerprint binding repository state, phase hashes, test files, implementation files, and gate definitions. Prevents whole-repository scanning while detecting stale evidence.
|
|
156
|
+
- **Progressive Legacy Compatibility**: Specifications lacking a test matrix operate seamlessly in legacy mode with an informational notice, preserving 100% backward compatibility.
|
|
@@ -8,3 +8,29 @@ Inspirado en Spec Kit, Gemstack obliga a pensar antes de teclear.
|
|
|
8
8
|
|
|
9
9
|
Usa `/specify` para comenzar este ciclo.
|
|
10
10
|
Una vez que el spec esté aprobado por el usuario, usa `/plan` y luego `/tasks`.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Mechanical Test Matrix & Closure Evidence (Upgrade B)
|
|
16
|
+
|
|
17
|
+
Gemstack complements Architecture Consistency with mechanical closure verification:
|
|
18
|
+
|
|
19
|
+
1. **Test Matrix in Spec (`spec.md`)**:
|
|
20
|
+
Declared in a ```gemstack-test-matrix``` block. Defines canonical acceptance tests with unique IDs (`TEST-[FEATURE]-[CAT][NUM]`), verification layers (`UNIT`, `INTEGRATION`, `E2E`, `CLI`), and enforcement gates (`REQUIRED`, `SUPPLEMENTAL`). Produces an immutable `acceptanceSignature`.
|
|
21
|
+
|
|
22
|
+
2. **Physical Test Bindings in Plan (`plan.md`)**:
|
|
23
|
+
Declared in ```gemstack-test-bindings``` block mapping each canonical test ID 1:1 to a physical runner file (e.g. `tests/example.test.js` with runner `node:test`).
|
|
24
|
+
Also declares mandatory package script gates in ```gemstack-closure-gates```.
|
|
25
|
+
|
|
26
|
+
3. **Task Traceability in Tasks (`tasks.md`)**:
|
|
27
|
+
Implementation tasks declare metadata:
|
|
28
|
+
`<!-- gemstack:validation_required=true|false -->`
|
|
29
|
+
`<!-- gemstack:tests=TEST-001,TEST-002 -->`
|
|
30
|
+
`<!-- gemstack:files=src/module.js,tests/module.test.js -->`
|
|
31
|
+
Ensures that every required canonical test is bound to at least one implementation task.
|
|
32
|
+
|
|
33
|
+
4. **Lifecycle: COLLECT vs VERIFY vs SHIP**:
|
|
34
|
+
- `gemstack collect`: Mutating evidence collector. Executes test runners, evaluates package script gates, reconciles counts, computes `closureContextHash`, and generates feature-local `closure.json`.
|
|
35
|
+
- `gemstack verify`: Strictly read-only validator (6 stages). Evaluates existing `closure.json` against in-memory fresh `closureContextHash`. Never writes to disk.
|
|
36
|
+
- `gemstack ship`: Lifecycle gatekeeper. Enforces that `closure.json` is fresh and marked `VERIFIED` (or policy-waived `VERIFIED_WITH_EXCEPTIONS`) before transitioning state to `SHIPPED`.
|
|
Binary file
|
package/handoff.md
CHANGED
|
@@ -8,25 +8,38 @@ Evolucionar Gemstack incorporando el feedback de producción real de proyectos a
|
|
|
8
8
|
4. Comando unificado `gemstack verify` (alias `audit`) para auditoría integral en un solo paso.
|
|
9
9
|
|
|
10
10
|
## 2. Estado actual
|
|
11
|
-
- **Upgrade A (Consistency Core & Phase Freezing)**: CERRADO Y
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
11
|
+
- **Upgrade A (Consistency Core & Phase Freezing)**: CERRADO Y PUBLICADO OFICIALMENTE como `gemstack-ai@1.1.2` en npm y GitHub Release.
|
|
12
|
+
- **Upgrade B (Mechanical Test Matrix & Closure Evidence)**: CERRADO Y PREPARADO PARA RELEASE como `gemstack-ai@1.2.0`.
|
|
13
|
+
- 20/20 pruebas canónicas P1 de Upgrade B pasando al 100% en 6 nuevas suites.
|
|
14
|
+
- 25/25 pruebas canónicas P1 de Upgrade A preservadas con 0 regresiones.
|
|
15
|
+
- 53/53 pruebas físicas totales ejecutadas y pasando con 0 errores en CI/CD local (`npm test`, `npm run ci:all`).
|
|
16
|
+
- Comando mutador `gemstack collect` implementado y probado en Feature 007, generando `closure.json` atómicamente.
|
|
17
|
+
- Comando `gemstack verify` ampliado a 6 etapas estrictamente read-only con validación de frescura contra `closureContextHash`.
|
|
18
|
+
- Compuerta de cierre `gemstack ship` ejecutada exitosamente con estado `VERIFIED` y transición de ciclo de vida formal.
|
|
19
|
+
- Zero dependencias externas añadidas en producción.
|
|
20
|
+
- Excluidos completamente Upgrade C y Upgrade D.
|
|
15
21
|
|
|
16
22
|
## 3. Archivos y cambios
|
|
17
|
-
- `src/lib/
|
|
18
|
-
- `src/lib/
|
|
19
|
-
- `src/lib/
|
|
20
|
-
- `src/
|
|
21
|
-
- `src/commands/
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
23
|
+
- `src/lib/test-matrix.js`: Parser de `gemstack-test-matrix`, validación de esquema de 20 tests canónicos y cálculo de `acceptanceSignature` canónico SHA-256.
|
|
24
|
+
- `src/lib/closure-context.js`: Parser de bindings y gates de `plan.md`, metadatos de `tasks.md`, trazabilidad bidireccional, resolución de `RelevantClosureFiles`, `computeContentAggregateHash` y cálculo de `closureContextHash`.
|
|
25
|
+
- `src/lib/runner-adapters.js`: Adaptador nativo seguro de runner `node:test`, parser TAP de resultados, motor de reconciliación aritmética canónica, ejecutor seguro de compuertas `PACKAGE_SCRIPT` y serializador atómico de `closure.json`.
|
|
26
|
+
- `src/commands/collect.js`: Comando mutador dedicado que ejecuta tests y gates para generar `specs/<feature>/closure.json`.
|
|
27
|
+
- `src/commands/ship.js`: Compuerta de transición a `SHIPPED` que exige evidencia de cierre fresca y verificada.
|
|
28
|
+
- `src/commands/verify.js`: Etapa 5/6 agregada de verificación de evidencia mecánica de cierre en modo estrictamente de solo lectura (0 mutaciones en disco).
|
|
29
|
+
- `src/cli.js`: Registro de comandos `collect` y `ship`.
|
|
30
|
+
- `specs/007-mechanical-test-matrix-closure-evidence/`: Artefactos congelados `spec.md`, `plan.md`, `tasks.md` y evidencia de cierre generada `closure.json`.
|
|
31
|
+
- `tests/`: 6 nuevas suites de prueba (`test-matrix.test.js`, `reconciliation.test.js`, `runner-adapter.test.js`, `traceability.test.js`, `closure-manifest.test.js`, `closure-gates.test.js`).
|
|
32
|
+
- `specs/templates/`: Actualizadas plantillas de `spec.md`, `plan.md` y `tasks.md` con bloques canónicos de Upgrade B.
|
|
33
|
+
- `.agents/skills/`: Actualizados skills (`gemstack-spec`, `gemstack-plan`, `gemstack-tasks`, `gemstack-qa`, `gemstack-ship`).
|
|
34
|
+
- `docs/`, `README.md`, `package.json`: Documentación técnica y script de test con enumeración explícita de las 11 suites físicas.
|
|
25
35
|
|
|
26
36
|
## 4. Intentos fallidos
|
|
27
37
|
- Se confirmó en proyectos reales que scripts de prueba con sintaxis `2>nul` en `package.json` provocan que PowerShell/Bash enmascaren errores y retornen código de salida 0 con 0 tests ejecutados. Ahora esto es detectado como error por `gemstack verify` y prohibido en la Constitución.
|
|
28
|
-
- **2026-09-11**: En el reporte de Upgrade A, se produjo un drift en la nomenclatura y categorización de la matriz P1 canónica
|
|
38
|
+
- **2026-09-11**: En el reporte de Upgrade A, se produjo un drift en la nomenclatura y categorización de la matriz P1 canónica. Se restauró la correlación canónica estricta de 25 tests P1 aprobados y la regla estricta de parser de 2+ bloques -> CONTRACT_PARSE_ERROR.
|
|
39
|
+
- **Node 20+ Subprocess Recursion**: Al ejecutar `node --test` como subproceso desde un proceso de test runner, `process.env.NODE_TEST_CONTEXT` suprimía la ejecución de archivos hijos con warning de recursión. Se resolvió sanitizando las variables `NODE_TEST_CONTEXT` y `NODE_TEST_WORKER_ID` en el entorno del proceso hijo.
|
|
40
|
+
- **Windows spawn 'npm.cmd' EINVAL**: Node 22+ en Windows genera `EINVAL` al invocar `spawn('npm.cmd', ..., { shell: false })`. Se resolvió ejecutando directamente el binario `npm-cli.js` vía `process.execPath` cuando se detecta en Windows, respetando la regla constitucional de `shell: false`.
|
|
41
|
+
- **Closure Manifest Self-Reference**: Al incluir `specs/<feature>/closure.json` en los archivos de implementación de `tasks.md`, `closureContextHash` cambiaba cada vez que `closure.json` era escrito, provocando que la evidencia se marcara como `STALE` inmediatamente después de recolectarse. Se resolvió excluyendo explícitamente `closure.json` de la agregación de hashes de contexto de implementación (`implementationContextHash`).
|
|
29
42
|
|
|
30
43
|
## 5. Próximos pasos
|
|
31
|
-
1.
|
|
32
|
-
2.
|
|
44
|
+
1. Completar la publicación de la versión minor v1.2.0 en GitHub Release y npm.
|
|
45
|
+
2. Iniciar la fase de arquitectura de Upgrade C (Cost & Provider Safety Gates) en su ciclo correspondiente.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gemstack-ai",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Agentic Spec-Driven Development framework for Gemini/Antigravity",
|
|
5
5
|
"main": "src/cli.js",
|
|
6
6
|
"bin": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"node": ">=18.18.0"
|
|
11
11
|
},
|
|
12
12
|
"scripts": {
|
|
13
|
-
"test": "node --test tests/contracts.test.js tests/hasher.test.js tests/findings.test.js tests/init.test.js tests/verify.test.js",
|
|
13
|
+
"test": "node --test tests/contracts.test.js tests/hasher.test.js tests/findings.test.js tests/init.test.js tests/verify.test.js tests/test-matrix.test.js tests/reconciliation.test.js tests/runner-adapter.test.js tests/traceability.test.js tests/closure-manifest.test.js tests/closure-gates.test.js",
|
|
14
14
|
"gemstack:verify": "node src/cli.js verify",
|
|
15
15
|
"pack:dry": "npm pack --dry-run",
|
|
16
16
|
"ci:frontmatter": "node scripts/ci/check-frontmatter.js",
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "gemstack-closure",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"feature": "specs/007-mechanical-test-matrix-closure-evidence/",
|
|
5
|
+
"generated_at": "2026-09-11T16:47:26.609Z",
|
|
6
|
+
"status": "VERIFIED",
|
|
7
|
+
"closure_context": {
|
|
8
|
+
"closure_context_hash": "d0587bf1f8770e142d2d0bb1bd637426f43794100d6514b2f41f9d004c69c8d8",
|
|
9
|
+
"repository_type": "git",
|
|
10
|
+
"git_commit": "afb384d2bced7ccf08445d9459a9e3211925658b",
|
|
11
|
+
"working_tree_clean": false,
|
|
12
|
+
"relevant_files_digest": "77e03ca88572d0fbbb69df1dd599c9f16e2903db3c4a740f50a0ec4a0459b6ae"
|
|
13
|
+
},
|
|
14
|
+
"acceptance_signature": "d6971eadf2e8238c87fa67fb380e2acd80181906a95168c19a57b3a24bf4d9bb",
|
|
15
|
+
"canonical_summary": {
|
|
16
|
+
"required_total": 20,
|
|
17
|
+
"required_passed": 20,
|
|
18
|
+
"supplemental_total": 0,
|
|
19
|
+
"supplemental_passed": 0
|
|
20
|
+
},
|
|
21
|
+
"physical_summary": {
|
|
22
|
+
"supporting_total": 0,
|
|
23
|
+
"supporting_passed": 0,
|
|
24
|
+
"total_executed": 20,
|
|
25
|
+
"total_passed": 20,
|
|
26
|
+
"total_failed": 0,
|
|
27
|
+
"total_skipped": 0
|
|
28
|
+
},
|
|
29
|
+
"reconciliation": {
|
|
30
|
+
"math_valid": true,
|
|
31
|
+
"phantoms_detected": 0,
|
|
32
|
+
"orphans_detected": 0,
|
|
33
|
+
"missing_canonical_ids": []
|
|
34
|
+
},
|
|
35
|
+
"task_traceability_summary": {
|
|
36
|
+
"tasks_total": 22,
|
|
37
|
+
"tasks_with_validation": 20,
|
|
38
|
+
"tasks_documentation_only": 2,
|
|
39
|
+
"unmapped_canonical_tests": []
|
|
40
|
+
},
|
|
41
|
+
"required_gates": {
|
|
42
|
+
"project-tests": "PASS",
|
|
43
|
+
"gate-ci-frontmatter": "PASS",
|
|
44
|
+
"gate-ci-mojibake": "PASS"
|
|
45
|
+
},
|
|
46
|
+
"supplemental_gates": {},
|
|
47
|
+
"exceptions": [],
|
|
48
|
+
"evidence_sources": [
|
|
49
|
+
{
|
|
50
|
+
"type": "PACKAGE_SCRIPT",
|
|
51
|
+
"script": "test",
|
|
52
|
+
"runner": "node:test",
|
|
53
|
+
"exit_code": 0,
|
|
54
|
+
"duration_ms": 257
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"blockers": [],
|
|
58
|
+
"warnings": []
|
|
59
|
+
}
|