@jmanuelcorral/openteam 0.1.40 → 0.1.42
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.md +15 -0
- package/README.es.md +1 -1
- package/README.md +1 -1
- package/dist/cli.js +457 -37
- package/dist/commands/graph.d.ts +73 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/migrations.d.ts +27 -0
- package/dist/config/migrations.d.ts.map +1 -0
- package/dist/config/resolve.d.ts +34 -0
- package/dist/config/resolve.d.ts.map +1 -0
- package/dist/config/schema.d.ts +57 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/assets.d.ts +9 -1
- package/dist/console/assets.d.ts.map +1 -1
- package/dist/console/opencodeClient.d.ts +6 -0
- package/dist/console/opencodeClient.d.ts.map +1 -1
- package/dist/console/protocol.d.ts +8 -0
- package/dist/console/protocol.d.ts.map +1 -1
- package/dist/console/render.d.ts +25 -0
- package/dist/console/render.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +48 -0
- package/dist/context/redaction.d.ts.map +1 -0
- package/dist/context/schema.d.ts +115 -0
- package/dist/context/schema.d.ts.map +1 -0
- package/dist/context/types.d.ts +8 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/graph/events.d.ts +25 -0
- package/dist/graph/events.d.ts.map +1 -0
- package/dist/graph/ids.d.ts +5 -0
- package/dist/graph/ids.d.ts.map +1 -0
- package/dist/graph/planner.d.ts +15 -0
- package/dist/graph/planner.d.ts.map +1 -0
- package/dist/graph/policies.d.ts +34 -0
- package/dist/graph/policies.d.ts.map +1 -0
- package/dist/graph/privacyPolicy.d.ts +29 -0
- package/dist/graph/privacyPolicy.d.ts.map +1 -0
- package/dist/graph/reducer.d.ts +27 -0
- package/dist/graph/reducer.d.ts.map +1 -0
- package/dist/graph/replay.d.ts +20 -0
- package/dist/graph/replay.d.ts.map +1 -0
- package/dist/graph/reviewerPolicy.d.ts +27 -0
- package/dist/graph/reviewerPolicy.d.ts.map +1 -0
- package/dist/graph/schema.d.ts +220 -0
- package/dist/graph/schema.d.ts.map +1 -0
- package/dist/graph/types.d.ts +40 -0
- package/dist/graph/types.d.ts.map +1 -0
- package/dist/graph/validate.d.ts +19 -0
- package/dist/graph/validate.d.ts.map +1 -0
- package/dist/index.js +46 -3
- package/dist/orchestrator/graphCancellation.d.ts +84 -0
- package/dist/orchestrator/graphCancellation.d.ts.map +1 -0
- package/dist/orchestrator/graphEffects.d.ts +63 -0
- package/dist/orchestrator/graphEffects.d.ts.map +1 -0
- package/dist/orchestrator/graphReview.d.ts +84 -0
- package/dist/orchestrator/graphReview.d.ts.map +1 -0
- package/dist/orchestrator/graphRuntime.d.ts +69 -0
- package/dist/orchestrator/graphRuntime.d.ts.map +1 -0
- package/dist/orchestrator/opencodeSessionAdapter.d.ts +117 -0
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -0
- package/dist/orchestrator/sdd.d.ts +38 -2
- package/dist/orchestrator/sdd.d.ts.map +1 -1
- package/dist/orchestrator/sddCompiler.d.ts +44 -0
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -0
- package/dist/orchestrator/sessionReconciler.d.ts +74 -0
- package/dist/orchestrator/sessionReconciler.d.ts.map +1 -0
- package/dist/orchestrator/shadowComparator.d.ts +62 -0
- package/dist/orchestrator/shadowComparator.d.ts.map +1 -0
- package/dist/orchestrator/worktreeAdapter.d.ts +39 -0
- package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -0
- package/dist/orchestrator/worktreeDispatch.d.ts +84 -0
- package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -0
- package/dist/orchestrator/worktreeReconciler.d.ts +74 -0
- package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -0
- package/dist/storage/graph/codec.d.ts +52 -0
- package/dist/storage/graph/codec.d.ts.map +1 -0
- package/dist/storage/graph/fsGraphJournal.d.ts +3 -0
- package/dist/storage/graph/fsGraphJournal.d.ts.map +1 -0
- package/dist/storage/graph/importLegacy.d.ts +62 -0
- package/dist/storage/graph/importLegacy.d.ts.map +1 -0
- package/dist/storage/graph/memoryGraphJournal.d.ts +11 -0
- package/dist/storage/graph/memoryGraphJournal.d.ts.map +1 -0
- package/dist/storage/graph/migrateLegacyBriefs.d.ts +32 -0
- package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -0
- package/dist/storage/graph/projections.d.ts +31 -0
- package/dist/storage/graph/projections.d.ts.map +1 -0
- package/dist/storage/graph/provider.d.ts +52 -0
- package/dist/storage/graph/provider.d.ts.map +1 -0
- package/dist/storage/graph/recovery.d.ts +38 -0
- package/dist/storage/graph/recovery.d.ts.map +1 -0
- package/dist/storage/graph/runRegistry.d.ts +17 -0
- package/dist/storage/graph/runRegistry.d.ts.map +1 -0
- package/dist/storage/graph/snapshot.d.ts +44 -0
- package/dist/storage/graph/snapshot.d.ts.map +1 -0
- package/dist/storage/graph/workspaceLease.d.ts +36 -0
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -0
- package/dist/storage/graph/worktreeRegistry.d.ts +29 -0
- package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -0
- package/dist/storage/graph/writer.d.ts +20 -0
- package/dist/storage/graph/writer.d.ts.map +1 -0
- package/dist/telemetry/graphProjection.d.ts +36 -0
- package/dist/telemetry/graphProjection.d.ts.map +1 -0
- package/dist/telemetry/graphView.d.ts +75 -0
- package/dist/telemetry/graphView.d.ts.map +1 -0
- package/dist/web/console.d.ts +6 -0
- package/dist/web/console.d.ts.map +1 -1
- package/dist/web/graphRoute.d.ts +36 -0
- package/dist/web/graphRoute.d.ts.map +1 -0
- package/dist/web/server.d.ts +21 -2
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +11 -0
- package/dist/web/start.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comparador de **paridad shadow** y tally de proyección idempotente (GE-044).
|
|
3
|
+
*
|
|
4
|
+
* Compara un run legacy con su espejo shadow (sin efectos) sobre dimensiones
|
|
5
|
+
* **normalizadas**: estado terminal, orden de nodos, roles, modelos, número de
|
|
6
|
+
* fixes y outcome. La ausencia de evidencia en cualquier lado es
|
|
7
|
+
* `inconclusive`. El informe es **reference-only**: solo códigos y veredicto,
|
|
8
|
+
* nunca contenido crudo. El tally de proyección es **idempotente** por run: una
|
|
9
|
+
* proyección duplicada no vuelve a contar.
|
|
10
|
+
*
|
|
11
|
+
* Puro y determinista: sin I/O, reloj, random ni estado global.
|
|
12
|
+
*/
|
|
13
|
+
/** Rol normalizado de un nodo del run. */
|
|
14
|
+
export type ShadowNodeRole = "implementer" | "reviewer";
|
|
15
|
+
/** Estado terminal normalizado de un run. */
|
|
16
|
+
export type ShadowRunStatus = "completed" | "failed" | "cancelled";
|
|
17
|
+
/** Outcome normalizado del review de un run. */
|
|
18
|
+
export type ShadowRunOutcome = "approved" | "rejected" | "inconclusive";
|
|
19
|
+
/** Resumen normalizado de un nodo (solo referencias/etiquetas acotadas). */
|
|
20
|
+
export type ShadowNodeSummary = {
|
|
21
|
+
readonly id: string;
|
|
22
|
+
readonly role: ShadowNodeRole;
|
|
23
|
+
readonly model: string;
|
|
24
|
+
};
|
|
25
|
+
/** Resumen normalizado de un run, apto para comparar paridad. */
|
|
26
|
+
export type ShadowRunSummary = {
|
|
27
|
+
readonly runID: string;
|
|
28
|
+
readonly status: ShadowRunStatus;
|
|
29
|
+
readonly outcome: ShadowRunOutcome;
|
|
30
|
+
readonly fixes: number;
|
|
31
|
+
readonly nodes: readonly ShadowNodeSummary[];
|
|
32
|
+
};
|
|
33
|
+
/** Dimensión en la que legacy y shadow divergen. */
|
|
34
|
+
export type ShadowDivergenceCode = "status" | "order" | "roles" | "models" | "fixes" | "outcome";
|
|
35
|
+
/** Veredicto de paridad. */
|
|
36
|
+
export type ShadowParityVerdict = "match" | "divergent" | "inconclusive";
|
|
37
|
+
/** Informe reference-only de paridad shadow. */
|
|
38
|
+
export type ShadowParityReport = {
|
|
39
|
+
readonly verdict: ShadowParityVerdict;
|
|
40
|
+
readonly divergences: readonly ShadowDivergenceCode[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Compara la paridad entre el run legacy y su espejo shadow. Si falta evidencia
|
|
44
|
+
* en cualquier lado, el veredicto es `inconclusive`. En caso contrario reporta
|
|
45
|
+
* las dimensiones divergentes de forma determinista.
|
|
46
|
+
*/
|
|
47
|
+
export declare function compareShadowRun(legacy: ShadowRunSummary | undefined, shadow: ShadowRunSummary | undefined): ShadowParityReport;
|
|
48
|
+
/** Acumulador idempotente de veredictos de paridad por run. */
|
|
49
|
+
export type ShadowParityTally = {
|
|
50
|
+
readonly seen: ReadonlySet<string>;
|
|
51
|
+
readonly match: number;
|
|
52
|
+
readonly divergent: number;
|
|
53
|
+
readonly inconclusive: number;
|
|
54
|
+
};
|
|
55
|
+
/** Tally vacío. */
|
|
56
|
+
export declare function emptyShadowTally(): ShadowParityTally;
|
|
57
|
+
/**
|
|
58
|
+
* Proyecta un veredicto en el tally. **Idempotente por run**: si el `runID` ya
|
|
59
|
+
* se contabilizó, devuelve el tally intacto (no doble conteo).
|
|
60
|
+
*/
|
|
61
|
+
export declare function tallyShadowParity(tally: ShadowParityTally, runID: string, report: ShadowParityReport): ShadowParityTally;
|
|
62
|
+
//# sourceMappingURL=shadowComparator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadowComparator.d.ts","sourceRoot":"","sources":["../../src/orchestrator/shadowComparator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,UAAU,CAAC;AAExD,6CAA6C;AAC7C,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEnE,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;AAExE,4EAA4E;AAC5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;CAC9C,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,CAAC;AAEd,4BAA4B;AAC5B,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;AAEzE,gDAAgD;AAChD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAC;CACvD,CAAC;AASF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,MAAM,EAAE,gBAAgB,GAAG,SAAS,GACnC,kBAAkB,CA4CpB;AAED,+DAA+D;AAC/D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,mBAAmB;AACnB,wBAAgB,gBAAgB,IAAI,iBAAiB,CAEpD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,iBAAiB,EACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,kBAAkB,GACzB,iBAAiB,CAanB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ExecLike } from "../local/foundry-local";
|
|
2
|
+
/** Taxonomía cerrada de errores del adapter de worktrees. */
|
|
3
|
+
export type WorktreeErrorCode = "invalid-run" | "git-failed" | "corrupt-list";
|
|
4
|
+
/** Error tipado de una operación inválida del ciclo de vida del worktree. */
|
|
5
|
+
export declare class WorktreeError extends Error {
|
|
6
|
+
readonly code: WorktreeErrorCode;
|
|
7
|
+
readonly detail: string;
|
|
8
|
+
constructor(code: WorktreeErrorCode, detail: string);
|
|
9
|
+
}
|
|
10
|
+
/** Información observada de un worktree del namespace de openteam. */
|
|
11
|
+
export type WorktreeInfo = {
|
|
12
|
+
readonly runID: string;
|
|
13
|
+
/** Ruta reportada por git (separadores `/`, usable por `node:fs`). */
|
|
14
|
+
readonly path: string;
|
|
15
|
+
readonly head: string | undefined;
|
|
16
|
+
readonly detached: boolean;
|
|
17
|
+
readonly locked: boolean;
|
|
18
|
+
};
|
|
19
|
+
/** Configuración inyectada del adapter. */
|
|
20
|
+
export type WorktreeAdapterConfig = {
|
|
21
|
+
readonly exec: ExecLike;
|
|
22
|
+
/** Working tree principal del repositorio (destino de `git -C`). */
|
|
23
|
+
readonly repoRoot: string;
|
|
24
|
+
/** Directorio raíz del namespace de worktrees por run. */
|
|
25
|
+
readonly worktreesDir: string;
|
|
26
|
+
};
|
|
27
|
+
/** Contrato del ciclo de vida idempotente y crash-safe de worktrees. */
|
|
28
|
+
export interface WorktreeAdapter {
|
|
29
|
+
/** Crea (o adopta) el worktree del run; reconstruye tras crash. */
|
|
30
|
+
create(runID: string): Promise<WorktreeInfo>;
|
|
31
|
+
/** Lista los worktrees del namespace de openteam. */
|
|
32
|
+
list(): Promise<WorktreeInfo[]>;
|
|
33
|
+
/** Elimina el worktree del run (idempotente). */
|
|
34
|
+
remove(runID: string): Promise<void>;
|
|
35
|
+
/** Poda entradas administrativas huérfanas (idempotente). */
|
|
36
|
+
prune(): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export declare function createWorktreeAdapter(config: WorktreeAdapterConfig): WorktreeAdapter;
|
|
39
|
+
//# sourceMappingURL=worktreeAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktreeAdapter.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeAdapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAqCvD,6DAA6D;AAC7D,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG,YAAY,GAAG,cAAc,CAAC;AAE9E,6EAA6E;AAC7E,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM;CAMpD;AAED,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,2CAA2C;AAC3C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,0DAA0D;IAC1D,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,wEAAwE;AACxE,MAAM,WAAW,eAAe;IAC9B,mEAAmE;IACnE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7C,qDAAqD;IACrD,IAAI,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC;IAChC,iDAAiD;IACjD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,6DAA6D;IAC7D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AA2ED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,qBAAqB,GAC5B,eAAe,CA8IjB"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { WorktreeBinding } from "../storage/graph/worktreeRegistry";
|
|
2
|
+
/**
|
|
3
|
+
* Seam de despacho al worktree del run (GE-073, D-W3).
|
|
4
|
+
*
|
|
5
|
+
* Decide, para un efecto del runtime de Graph, el `directory` con el que se crea
|
|
6
|
+
* la sub-sesión hija (`query.directory`) y verifica la correlación del contrato
|
|
7
|
+
* `PluginInput.directory`/`worktree` (GE-005). Es lógica pura y determinista:
|
|
8
|
+
* sin I/O, SDK, reloj ni estado global; el probe de salud del worktree y la
|
|
9
|
+
* consulta al registro (GE-072) los hace el llamante y entrega sus resultados
|
|
10
|
+
* como datos.
|
|
11
|
+
*
|
|
12
|
+
* Invariante de UX-neutralidad: con el aislamiento **desactivado**
|
|
13
|
+
* (`graph.worktrees.enabled` = `false`, el default) el directorio resuelto es
|
|
14
|
+
* exactamente el del workspace actual, de modo que el despacho es idéntico al
|
|
15
|
+
* de hoy. Con el aislamiento activo se exige un worktree sano vinculado al run
|
|
16
|
+
* y se cierra en falso (`WorktreeDispatchError`) si falta la vinculación, el
|
|
17
|
+
* directorio desapareció (`missing`) o está sucio (`unclean`). Ninguna ruta viva
|
|
18
|
+
* llama todavía a este seam; lo consumirá la integración del executor.
|
|
19
|
+
*/
|
|
20
|
+
/** Salud observada del worktree de un run (resultado del probe del llamante). */
|
|
21
|
+
export type WorktreeHealth = "ready" | "missing" | "unclean";
|
|
22
|
+
/** Estado del despacho respecto al aislamiento por worktree del run. */
|
|
23
|
+
export type WorktreeDispatchState = {
|
|
24
|
+
readonly kind: "disabled";
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: "unbound";
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: "missing";
|
|
29
|
+
readonly worktreePath: string;
|
|
30
|
+
} | {
|
|
31
|
+
readonly kind: "unclean";
|
|
32
|
+
readonly worktreePath: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: "ready";
|
|
35
|
+
readonly worktreePath: string;
|
|
36
|
+
};
|
|
37
|
+
/** Taxonomía cerrada de fallos al vincular el despacho a un worktree. */
|
|
38
|
+
export type WorktreeDispatchErrorCode = "unbound" | "missing" | "unclean" | "mismatch";
|
|
39
|
+
/** Error tipado de un despacho que no puede vincularse a un worktree sano. */
|
|
40
|
+
export declare class WorktreeDispatchError extends Error {
|
|
41
|
+
readonly code: WorktreeDispatchErrorCode;
|
|
42
|
+
readonly detail: string;
|
|
43
|
+
constructor(code: WorktreeDispatchErrorCode, detail: string);
|
|
44
|
+
}
|
|
45
|
+
/** Directorio efectivo del despacho de un efecto. */
|
|
46
|
+
export type DispatchDirectory = {
|
|
47
|
+
/**
|
|
48
|
+
* Directorio a pasar como `query.directory`. `undefined` = raíz del workspace
|
|
49
|
+
* (comportamiento actual cuando el aislamiento está desactivado).
|
|
50
|
+
*/
|
|
51
|
+
readonly directory: string | undefined;
|
|
52
|
+
/** Worktree correlacionado; `undefined` salvo con aislamiento activo. */
|
|
53
|
+
readonly worktree: string | undefined;
|
|
54
|
+
};
|
|
55
|
+
/** Correlación observada del contrato `PluginInput` de una sub-sesión. */
|
|
56
|
+
export type ObservedWorktreeCorrelation = {
|
|
57
|
+
readonly directory: string;
|
|
58
|
+
readonly worktree: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Combina el flag de aislamiento, la vinculación del registro (GE-072) y la
|
|
62
|
+
* salud observada del worktree en un estado de despacho. Cierra en falso por
|
|
63
|
+
* defecto: una salud ausente o desconocida se trata como `missing`.
|
|
64
|
+
*/
|
|
65
|
+
export declare function worktreeDispatchState(input: {
|
|
66
|
+
readonly enabled: boolean;
|
|
67
|
+
readonly binding: WorktreeBinding | undefined;
|
|
68
|
+
readonly health: WorktreeHealth | undefined;
|
|
69
|
+
}): WorktreeDispatchState;
|
|
70
|
+
/**
|
|
71
|
+
* Resuelve el directorio efectivo del despacho. Con el aislamiento desactivado
|
|
72
|
+
* devuelve el `workspaceDirectory` tal cual (idéntico al comportamiento actual);
|
|
73
|
+
* con un worktree sano devuelve su ruta como `directory` y `worktree`; en
|
|
74
|
+
* cualquier otro estado cierra en falso con `WorktreeDispatchError`.
|
|
75
|
+
*/
|
|
76
|
+
export declare function resolveDispatchDirectory(state: WorktreeDispatchState, workspaceDirectory: string | undefined): DispatchDirectory;
|
|
77
|
+
/**
|
|
78
|
+
* Verifica la correlación del contrato `PluginInput` (GE-005): el
|
|
79
|
+
* `directory`/`worktree` observado de la sub-sesión debe coincidir con el
|
|
80
|
+
* worktree leaseado del run. Lanza `WorktreeDispatchError("mismatch")` si
|
|
81
|
+
* alguno difiere; comparación de rutas normalizada por plataforma.
|
|
82
|
+
*/
|
|
83
|
+
export declare function assertWorktreeCorrelation(observed: ObservedWorktreeCorrelation, leasedWorktree: string): void;
|
|
84
|
+
//# sourceMappingURL=worktreeDispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktreeDispatch.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeDispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;;;;;;;;;;;;;;;GAiBG;AAEH,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7D,wEAAwE;AACxE,MAAM,MAAM,qBAAqB,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;CAAE,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D,yEAAyE;AACzE,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,CAAC;AAEf,8EAA8E;AAC9E,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM;CAM5D;AAED,qDAAqD;AACrD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B,CAAC;AAUF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CAC7C,GAAG,qBAAqB,CAgBxB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,qBAAqB,EAC5B,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,iBAAiB,CAanB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,2BAA2B,EACrC,cAAc,EAAE,MAAM,GACrB,IAAI,CAaN"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reconciliador de worktrees huérfanos tras un crash (GE-074, D-W4).
|
|
3
|
+
*
|
|
4
|
+
* Sigue el mismo contrato dry-run que los comandos de operador (GE-045,
|
|
5
|
+
* `src/commands/graph.ts`): es **lógica pura y determinista** que recibe un
|
|
6
|
+
* snapshot ya observado (worktrees listados por el adapter GE-071, qué runs
|
|
7
|
+
* siguen activos según el registro de runs GE-025, y el estado de merge-back
|
|
8
|
+
* probado por el llamante) y decide, sin ejecutar, qué acción es segura para
|
|
9
|
+
* cada worktree. La ejecución real (`prune`/merge-back) vive en la capa de
|
|
10
|
+
* wiring y sólo cuando el plan la autoriza.
|
|
11
|
+
*
|
|
12
|
+
* Política de reconciliación:
|
|
13
|
+
* - **Run activo** → `retain`: nunca se toca un worktree cuyo run sigue vivo.
|
|
14
|
+
* - **Huérfano limpio y sin commits** → `prune`: eliminación segura y reportada.
|
|
15
|
+
* - **Huérfano limpio con commits** → `merge-back`: explícito e idempotente;
|
|
16
|
+
* nunca descarta en silencio la rama del run. Una segunda pasada, cuando la
|
|
17
|
+
* rama ya está integrada (`alreadyMerged`), planifica `prune` en vez de
|
|
18
|
+
* volver a fusionar.
|
|
19
|
+
* - **Sucio o ambiguo** → `block`: se detiene para una decisión del operador.
|
|
20
|
+
*
|
|
21
|
+
* Invariante de UX-neutralidad (D-W4): con `graph.worktrees.enabled` = `false`
|
|
22
|
+
* (el default) el reconciliador es un **no-op** — devuelve un informe vacío, no
|
|
23
|
+
* planifica ni crea ni poda ningún worktree. Ninguna ruta viva lo llama todavía.
|
|
24
|
+
*/
|
|
25
|
+
/** Estado de merge-back observado de un worktree (probe de git del llamante). */
|
|
26
|
+
export type WorktreeMergeState = "clean-empty" | "clean-ahead" | "dirty";
|
|
27
|
+
/** Snapshot observado de un worktree candidato a reconciliar. */
|
|
28
|
+
export type WorktreeObservation = {
|
|
29
|
+
readonly runID: string;
|
|
30
|
+
readonly path: string;
|
|
31
|
+
/** El run sigue activo según el registro de runs (lease vigente). */
|
|
32
|
+
readonly runActive: boolean;
|
|
33
|
+
/** Estado de merge-back observado. */
|
|
34
|
+
readonly mergeState: WorktreeMergeState;
|
|
35
|
+
/**
|
|
36
|
+
* Sólo relevante con `mergeState: "clean-ahead"`: la rama del run ya está
|
|
37
|
+
* integrada en la base, de modo que la reconciliación es idempotente y puede
|
|
38
|
+
* podar en vez de volver a fusionar.
|
|
39
|
+
*/
|
|
40
|
+
readonly alreadyMerged?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** Acción planificada para un worktree, decidida sin ejecutarla. */
|
|
43
|
+
export type WorktreeReconcileAction = "retain" | "prune" | "merge-back" | "block";
|
|
44
|
+
/** Plan de reconciliación de un worktree concreto. */
|
|
45
|
+
export type WorktreeReconcilePlan = {
|
|
46
|
+
readonly runID: string;
|
|
47
|
+
readonly path: string;
|
|
48
|
+
readonly action: WorktreeReconcileAction;
|
|
49
|
+
/** Razón estable y machine-readable de la decisión. */
|
|
50
|
+
readonly reason: string;
|
|
51
|
+
/** `true` cuando la acción preserva invariantes sin override del operador. */
|
|
52
|
+
readonly safe: boolean;
|
|
53
|
+
};
|
|
54
|
+
/** Informe agregado de la reconciliación. */
|
|
55
|
+
export type WorktreeReconcileReport = {
|
|
56
|
+
/** Estado del flag de aislamiento en el momento de reconciliar. */
|
|
57
|
+
readonly enabled: boolean;
|
|
58
|
+
/** Plan por worktree, en el orden observado. */
|
|
59
|
+
readonly plans: readonly WorktreeReconcilePlan[];
|
|
60
|
+
readonly retained: number;
|
|
61
|
+
readonly pruned: number;
|
|
62
|
+
readonly mergeBack: number;
|
|
63
|
+
readonly blocked: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Planifica la reconciliación de un conjunto de worktrees observados. Con el
|
|
67
|
+
* aislamiento desactivado devuelve un informe vacío (no-op). Puro: no ejecuta
|
|
68
|
+
* git ni toca I/O.
|
|
69
|
+
*/
|
|
70
|
+
export declare function planWorktreeReconciliation(input: {
|
|
71
|
+
readonly enabled: boolean;
|
|
72
|
+
readonly worktrees: readonly WorktreeObservation[];
|
|
73
|
+
}): WorktreeReconcileReport;
|
|
74
|
+
//# sourceMappingURL=worktreeReconciler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worktreeReconciler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/worktreeReconciler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,iFAAiF;AACjF,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,aAAa,GAAG,OAAO,CAAC;AAEzE,iEAAiE;AACjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,OAAO,CAAC;AAEZ,sDAAsD;AACtD,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC;IACzC,uDAAuD;IACvD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,uBAAuB,GAAG;IACpC,mEAAmE;IACnE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACjD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAkCF;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE;IAChD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACpD,GAAG,uBAAuB,CAwB1B"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { GraphEventV1 } from "../../graph/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Códec estricto del journal de Graph: framing versionado con cadena de digest.
|
|
4
|
+
*
|
|
5
|
+
* Cada evento se serializa como un **frame** NDJSON con `{ v, seq, prev, sum,
|
|
6
|
+
* event }`, donde `sum = sha256(prev ∥ canonical(event))` y `prev` es el `sum`
|
|
7
|
+
* del frame anterior (o `GENESIS_DIGEST` en el primero). La cadena hace el log
|
|
8
|
+
* a prueba de manipulación: reescribir o reordenar un frame rompe el enlace.
|
|
9
|
+
*
|
|
10
|
+
* Reglas de decodificación (fail-closed salvo la cola parcial):
|
|
11
|
+
* - Sólo los frames **terminados en `\n`** son autoritativos.
|
|
12
|
+
* - Un segmento final sin `\n` es una **cola parcial reconocida** (escritura
|
|
13
|
+
* truncada) y se descarta sin error, señalando `partialTail`.
|
|
14
|
+
* - Frame ilegible/estructura inválida o basura intermedia → `bad-frame`.
|
|
15
|
+
* - `v` desconocido → `bad-version`; `seq` no contiguo → `bad-sequence`;
|
|
16
|
+
* `prev` que no enlaza → `chain-break`; `sum` que no cuadra → `bad-checksum`.
|
|
17
|
+
*
|
|
18
|
+
* Puro y determinista: sin I/O, reloj ni random; sólo SHA-256 y serialización.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CODEC_VERSION: 1;
|
|
21
|
+
/** Digest raíz de la cadena (antes del primer frame). */
|
|
22
|
+
export declare const GENESIS_DIGEST: string;
|
|
23
|
+
/** Digest de cadena de un frame dado su predecesor y su evento. */
|
|
24
|
+
export declare function frameDigest(prev: string, event: GraphEventV1): string;
|
|
25
|
+
/** Códigos de fallo de decodificación (todos cierran en falso). */
|
|
26
|
+
export type JournalCodecErrorCode = "bad-frame" | "bad-version" | "bad-sequence" | "chain-break" | "bad-checksum";
|
|
27
|
+
/** Error tipado de un frame corrupto o inconsistente. */
|
|
28
|
+
export declare class JournalCodecError extends Error {
|
|
29
|
+
readonly code: JournalCodecErrorCode;
|
|
30
|
+
readonly detail: string;
|
|
31
|
+
constructor(code: JournalCodecErrorCode, detail: string);
|
|
32
|
+
}
|
|
33
|
+
/** Un frame codificado más el digest de cadena que produce. */
|
|
34
|
+
export type EncodedFrame = {
|
|
35
|
+
line: string;
|
|
36
|
+
digest: string;
|
|
37
|
+
};
|
|
38
|
+
/** Codifica un frame para `event` en la posición `seq` sobre `prev`. */
|
|
39
|
+
export declare function encodeFrame(prev: string, seq: number, event: GraphEventV1): EncodedFrame;
|
|
40
|
+
/** Codifica una secuencia completa desde génesis a stream NDJSON con framing. */
|
|
41
|
+
export declare function encodeJournal(events: readonly GraphEventV1[]): string;
|
|
42
|
+
/** Resultado de decodificar un journal: prefijo válido y estado de la cola. */
|
|
43
|
+
export type DecodedJournal = {
|
|
44
|
+
events: GraphEventV1[];
|
|
45
|
+
/** Cabeza de la cadena tras el último frame válido (génesis si vacío). */
|
|
46
|
+
digest: string;
|
|
47
|
+
/** `true` si se descartó una cola parcial reconocida (escritura truncada). */
|
|
48
|
+
partialTail: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Decodifica un stream NDJSON con framing en su prefijo válido de eventos. */
|
|
51
|
+
export declare function decodeJournal(text: string): DecodedJournal;
|
|
52
|
+
//# sourceMappingURL=codec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/codec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD;;;;;;;;;;;;;;;;;GAiBG;AAEH,eAAO,MAAM,aAAa,EAAG,CAAU,CAAC;AAExC,yDAAyD;AACzD,eAAO,MAAM,cAAc,QAAiD,CAAC;AAsB7E,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,MAAM,CAErE;AAED,mEAAmE;AACnE,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,aAAa,GACb,cAAc,GACd,aAAa,GACb,cAAc,CAAC;AAEnB,yDAAyD;AACzD,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM;CAMxD;AAED,+DAA+D;AAC/D,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,GAClB,YAAY,CAId;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CASrE;AAED,+EAA+E;AAC/E,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAkDF,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAc1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsGraphJournal.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/fsGraphJournal.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,YAAY,CAAC;AA6BpB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CA2G/D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type LedgerEntry } from "../../orchestrator/ledger";
|
|
2
|
+
/**
|
|
3
|
+
* Importación **idempotente** y terminal del ledger legacy a la autoridad de
|
|
4
|
+
* Graph (GE-024).
|
|
5
|
+
*
|
|
6
|
+
* El ledger legacy solo registra desenlaces **terminales** por tarea. Esta capa
|
|
7
|
+
* mapea cada tarea terminal a un estado de run terminal (`completed`/`failed`)
|
|
8
|
+
* **una sola vez**, anclado por un `sourceDigest` (la línea de ledger canónica)
|
|
9
|
+
* y un `specDigest` (un descriptor sintético mínimo del run). Nunca inventa
|
|
10
|
+
* historia in-flight (no hay `running`/`dispatched`), salta los runs ya
|
|
11
|
+
* importados —de modo que un re-run es un no-op— y no transporta contenido
|
|
12
|
+
* crudo (solo identificadores y digests). Puro y determinista: sin I/O, reloj
|
|
13
|
+
* ni random; el único cómputo es el digest SHA-256.
|
|
14
|
+
*/
|
|
15
|
+
export declare const LEGACY_IMPORT_VERSION: 1;
|
|
16
|
+
/** Estado terminal de un run importado (nunca in-flight). */
|
|
17
|
+
export type LegacyRunStatus = "completed" | "failed";
|
|
18
|
+
/**
|
|
19
|
+
* Registro de autoridad de un run legacy importado. Terminal y reference-only:
|
|
20
|
+
* identificadores más digests de origen y de spec; nunca contenido.
|
|
21
|
+
*/
|
|
22
|
+
export type LegacyImportRecordV1 = {
|
|
23
|
+
readonly version: typeof LEGACY_IMPORT_VERSION;
|
|
24
|
+
readonly runID: string;
|
|
25
|
+
readonly taskID: string;
|
|
26
|
+
readonly status: LegacyRunStatus;
|
|
27
|
+
/** Digest de la línea de ledger canónica que originó el import. */
|
|
28
|
+
readonly sourceDigest: string;
|
|
29
|
+
/** Digest del descriptor sintético mínimo del run importado. */
|
|
30
|
+
readonly specDigest: string;
|
|
31
|
+
};
|
|
32
|
+
/** `runID` determinista de un task legacy importado. */
|
|
33
|
+
export declare function legacyRunID(taskID: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Plan de importación (dry-run): solo los registros nuevos, los runs saltados y
|
|
36
|
+
* contadores. No lleva contenido de las tareas; sirve como informe de dry-run.
|
|
37
|
+
*/
|
|
38
|
+
export type LegacyImportPlan = {
|
|
39
|
+
/** Registros terminales nuevos a importar (excluye los ya presentes). */
|
|
40
|
+
readonly records: readonly LegacyImportRecordV1[];
|
|
41
|
+
/** `runID` de tareas terminales cuyo run ya estaba importado. */
|
|
42
|
+
readonly skipped: readonly string[];
|
|
43
|
+
/** Total de tareas terminales distintas en el ledger. */
|
|
44
|
+
readonly total: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Planifica la importación terminal del ledger. Deduplica por `taskID` (el
|
|
48
|
+
* último estado gana, igual que el ledger) y excluye los runs ya presentes en
|
|
49
|
+
* `existingRunIDs`, de modo que un re-run con la misma autoridad produce un
|
|
50
|
+
* plan vacío (no-op).
|
|
51
|
+
*/
|
|
52
|
+
export declare function planLegacyImport(input: {
|
|
53
|
+
entries: readonly LedgerEntry[];
|
|
54
|
+
existingRunIDs?: Iterable<string>;
|
|
55
|
+
}): LegacyImportPlan;
|
|
56
|
+
/**
|
|
57
|
+
* Aplica el plan mezclando sus registros con la autoridad existente, deduplicado
|
|
58
|
+
* por `runID` (el existente gana) y con orden estable por `runID`. Idempotente:
|
|
59
|
+
* aplicar un plan ya presente deja la autoridad igual.
|
|
60
|
+
*/
|
|
61
|
+
export declare function applyLegacyImport(existing: readonly LegacyImportRecordV1[], plan: LegacyImportPlan): readonly LegacyImportRecordV1[];
|
|
62
|
+
//# sourceMappingURL=importLegacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importLegacy.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/importLegacy.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,2BAA2B,CAAC;AAEnC;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,qBAAqB,EAAG,CAAU,CAAC;AAEhD,6DAA6D;AAC7D,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,QAAQ,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,qBAAqB,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,mEAAmE;IACnE,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF,wDAAwD;AACxD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAElD;AA4BD;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,CAAC;IAClD,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IAChC,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;CACnC,GAAG,gBAAgB,CAiBnB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,SAAS,oBAAoB,EAAE,EACzC,IAAI,EAAE,gBAAgB,GACrB,SAAS,oBAAoB,EAAE,CAajC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { GraphSpecV1 } from "../../graph/schema";
|
|
2
|
+
import { type GraphJournal } from "./provider";
|
|
3
|
+
export type MemoryGraphJournalOptions = {
|
|
4
|
+
/** Journals crudos precargados (NDJSON) para tests de recuperación/corrupción. */
|
|
5
|
+
seed?: Record<string, {
|
|
6
|
+
spec: GraphSpecV1;
|
|
7
|
+
lines: readonly string[];
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
export declare function createMemoryGraphJournal(options?: MemoryGraphJournalOptions): GraphJournal;
|
|
11
|
+
//# sourceMappingURL=memoryGraphJournal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memoryGraphJournal.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/memoryGraphJournal.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,EACL,KAAK,YAAY,EAGlB,MAAM,YAAY,CAAC;AAiBpB,MAAM,MAAM,yBAAyB,GAAG;IACtC,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACxE,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,OAAO,GAAE,yBAA8B,GACtC,YAAY,CA8Fd"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StorageProvider } from "../provider";
|
|
2
|
+
/** Plan (dry-run) de migración: solo rutas y conteo, nunca contenido. */
|
|
3
|
+
export type BriefMigrationPlan = {
|
|
4
|
+
readonly workspaceDir: string;
|
|
5
|
+
readonly briefPaths: readonly string[];
|
|
6
|
+
readonly count: number;
|
|
7
|
+
};
|
|
8
|
+
/** Resultado de aplicar la migración: manifiestos escritos y conteo. */
|
|
9
|
+
export type BriefMigrationReport = {
|
|
10
|
+
readonly workspaceDir: string;
|
|
11
|
+
readonly migrated: readonly string[];
|
|
12
|
+
readonly count: number;
|
|
13
|
+
};
|
|
14
|
+
/** Código de fallo fail-closed de la migración. */
|
|
15
|
+
export type MigrationErrorCode = "unreadable" | "unknown-schema";
|
|
16
|
+
/** Error tipado de una migración abortada (deja el crudo intacto). */
|
|
17
|
+
export declare class MigrationError extends Error {
|
|
18
|
+
readonly code: MigrationErrorCode;
|
|
19
|
+
readonly path: string;
|
|
20
|
+
constructor(code: MigrationErrorCode, path: string);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Planifica la migración (dry-run). Lista los briefs crudos y devuelve sus
|
|
24
|
+
* rutas y conteo; **no** lee ni transporta el cuerpo de ningún brief.
|
|
25
|
+
*/
|
|
26
|
+
export declare function planLegacyBriefMigration(storage: StorageProvider, workspaceDir: string): Promise<BriefMigrationPlan>;
|
|
27
|
+
/**
|
|
28
|
+
* Aplica la migración: por cada brief crudo escribe el manifiesto redactado y
|
|
29
|
+
* borra el crudo (sin backup). Idempotente y fail-closed.
|
|
30
|
+
*/
|
|
31
|
+
export declare function applyLegacyBriefMigration(storage: StorageProvider, workspaceDir: string): Promise<BriefMigrationReport>;
|
|
32
|
+
//# sourceMappingURL=migrateLegacyBriefs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrateLegacyBriefs.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/migrateLegacyBriefs.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AA4BnD,yEAAyE;AACzE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,sEAAsE;AACtE,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM;CAMnD;AA6CD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAM7B;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,eAAe,EACxB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,oBAAoB,CAAC,CAuB/B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LegacyImportRecordV1, LegacyRunStatus } from "./importLegacy";
|
|
2
|
+
/**
|
|
3
|
+
* Proyecciones **reconstruibles** de progreso y resumen sobre la autoridad de
|
|
4
|
+
* runs importados (GE-024).
|
|
5
|
+
*
|
|
6
|
+
* La autoridad (registros terminales de import) es la única fuente de verdad;
|
|
7
|
+
* estas proyecciones son estado derivado y desechable: se recalculan por
|
|
8
|
+
* completo desde la autoridad, sin persistencia propia. Puras y deterministas:
|
|
9
|
+
* mismo input, mismo output, con orden estable por `runID`.
|
|
10
|
+
*/
|
|
11
|
+
/** Proyección de progreso: contadores por estado terminal. */
|
|
12
|
+
export type ProgressProjection = {
|
|
13
|
+
readonly total: number;
|
|
14
|
+
readonly completed: number;
|
|
15
|
+
readonly failed: number;
|
|
16
|
+
};
|
|
17
|
+
/** Entrada de resumen: estado terminal por run. */
|
|
18
|
+
export type SummaryEntry = {
|
|
19
|
+
readonly runID: string;
|
|
20
|
+
readonly taskID: string;
|
|
21
|
+
readonly status: LegacyRunStatus;
|
|
22
|
+
};
|
|
23
|
+
/** Proyección de resumen: estado por run en orden estable por `runID`. */
|
|
24
|
+
export type SummaryProjection = {
|
|
25
|
+
readonly runs: readonly SummaryEntry[];
|
|
26
|
+
};
|
|
27
|
+
/** Reconstruye los contadores de progreso desde la autoridad. */
|
|
28
|
+
export declare function projectProgress(records: readonly LegacyImportRecordV1[]): ProgressProjection;
|
|
29
|
+
/** Reconstruye el resumen por run desde la autoridad, ordenado por `runID`. */
|
|
30
|
+
export declare function projectSummary(records: readonly LegacyImportRecordV1[]): SummaryProjection;
|
|
31
|
+
//# sourceMappingURL=projections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projections.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/projections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE5E;;;;;;;;GAQG;AAEH,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,mDAAmD;AACnD,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,YAAY,EAAE,CAAC;CACxC,CAAC;AAEF,iEAAiE;AACjE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,kBAAkB,CAWpB;AAED,+EAA+E;AAC/E,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,iBAAiB,CASnB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { GraphEventV1, GraphSpecV1 } from "../../graph/schema";
|
|
2
|
+
import type { GraphState } from "../../graph/types";
|
|
3
|
+
/**
|
|
4
|
+
* `GraphJournal` — boundary de persistencia append-only del run de Graph.
|
|
5
|
+
*
|
|
6
|
+
* Modela un log de eventos por `runID` con dos garantías de integridad:
|
|
7
|
+
* - **Secuencia contigua**: los eventos se anexan con `seq` estrictamente
|
|
8
|
+
* creciente desde 0 (concurrencia optimista sobre la cabeza del log).
|
|
9
|
+
* - **Escritor único (fencing)**: cada journal tiene un `writerToken` vigente;
|
|
10
|
+
* un `takeOver` emite uno nuevo e invalida el anterior. Anexar con un token
|
|
11
|
+
* caduco cierra en falso con `writer-conflict`.
|
|
12
|
+
*
|
|
13
|
+
* `load` reconstruye el estado reducido reproduciendo el journal; si el log
|
|
14
|
+
* almacenado es ilegible o produce transiciones ilegales, surface `corrupt`.
|
|
15
|
+
*
|
|
16
|
+
* Este módulo **no** contiene I/O: solo tipos. `router/` nunca lo importa. Los
|
|
17
|
+
* adapters concretos (`memoryGraphJournal`, futuros durables FS/SQLite) lo
|
|
18
|
+
* implementan y comparten `tests/storage/graph/contract.ts`.
|
|
19
|
+
*/
|
|
20
|
+
/** Taxonomía cerrada de errores del journal. */
|
|
21
|
+
export type JournalErrorCode = "already-exists" | "not-found" | "writer-conflict" | "sequence-mismatch" | "duplicate-event" | "corrupt";
|
|
22
|
+
/** Error tipado de una operación inválida sobre el journal. */
|
|
23
|
+
export declare class JournalError extends Error {
|
|
24
|
+
readonly code: JournalErrorCode;
|
|
25
|
+
readonly detail: string;
|
|
26
|
+
constructor(code: JournalErrorCode, detail: string);
|
|
27
|
+
}
|
|
28
|
+
/** Referencia a un journal abierto por un escritor concreto. */
|
|
29
|
+
export type GraphJournalHandle = {
|
|
30
|
+
readonly runID: string;
|
|
31
|
+
readonly writerToken: string;
|
|
32
|
+
};
|
|
33
|
+
/** Resultado de `load`: spec, eventos y estado reducido reproducido. */
|
|
34
|
+
export type LoadedJournal = {
|
|
35
|
+
spec: GraphSpecV1;
|
|
36
|
+
events: GraphEventV1[];
|
|
37
|
+
state: GraphState;
|
|
38
|
+
};
|
|
39
|
+
/** Contrato del journal de eventos de un run de Graph. */
|
|
40
|
+
export interface GraphJournal {
|
|
41
|
+
/** Crea un journal vacío para el run del spec; `already-exists` si ya existe. */
|
|
42
|
+
create(spec: GraphSpecV1): Promise<GraphJournalHandle>;
|
|
43
|
+
/** Toma el relevo como escritor único, emitiendo un token nuevo; `not-found` si falta. */
|
|
44
|
+
takeOver(runID: string): Promise<GraphJournalHandle>;
|
|
45
|
+
/** Anexa un evento en la posición `expectedSeq` (cabeza del log). */
|
|
46
|
+
append(handle: GraphJournalHandle, event: GraphEventV1, expectedSeq: number): Promise<void>;
|
|
47
|
+
/** Carga el journal y reproduce su estado; `not-found`/`corrupt` si procede. */
|
|
48
|
+
load(runID: string): Promise<LoadedJournal>;
|
|
49
|
+
/** `true` si existe un journal para el run. */
|
|
50
|
+
exists(runID: string): Promise<boolean>;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;;;;;;;;;;;;;;GAgBG;AAEH,gDAAgD;AAChD,MAAM,MAAM,gBAAgB,GACxB,gBAAgB,GAChB,WAAW,GACX,iBAAiB,GACjB,mBAAmB,GACnB,iBAAiB,GACjB,SAAS,CAAC;AAEd,+DAA+D;AAC/D,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM;CAMnD;AAED,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,wEAAwE;AACxE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,0DAA0D;AAC1D,MAAM,WAAW,YAAY;IAC3B,iFAAiF;IACjF,MAAM,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACrD,qEAAqE;IACrE,MAAM,CACJ,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,YAAY,EACnB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,gFAAgF;IAChF,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC5C,+CAA+C;IAC/C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { GraphEventV1, GraphSpecV1 } from "../../graph/schema";
|
|
2
|
+
import type { GraphState } from "../../graph/types";
|
|
3
|
+
/**
|
|
4
|
+
* Recuperación determinista de un journal tras un fallo en un boundary de commit.
|
|
5
|
+
*
|
|
6
|
+
* Reproduce el prefijo autoritativo con una política de cola explícita:
|
|
7
|
+
* - una **cola parcial reconocida** (escritura truncada, sin `\n`) se descarta y
|
|
8
|
+
* se recupera el prefijo confirmado (`tail: "recovered"`), de modo que el
|
|
9
|
+
* intento truncado se puede reintentar sin duplicar autoridad;
|
|
10
|
+
* - un log limpio recupera todo commit confirmado (`tail: "clean"`).
|
|
11
|
+
*
|
|
12
|
+
* Cierra en falso sin adivinar ante una **corrupción intermedia** (frame ilegible
|
|
13
|
+
* en medio, cadena rota o checksum falseado) o una **ambigüedad de secuencia**
|
|
14
|
+
* (`seq` no contiguo), y también si el prefijo confirmado reproduce ilegalmente.
|
|
15
|
+
*
|
|
16
|
+
* Puro y determinista: sin I/O, reloj ni random. Opera sobre los bytes del
|
|
17
|
+
* journal para que la matriz de inyección de fallos sea byte a byte reproducible.
|
|
18
|
+
*/
|
|
19
|
+
/** Estado de la cola tras recuperar. */
|
|
20
|
+
export type RecoveryTail = "clean" | "recovered";
|
|
21
|
+
/** Resultado de recuperar un journal: prefijo autoritativo y estado reducido. */
|
|
22
|
+
export type RecoveredJournal = {
|
|
23
|
+
events: GraphEventV1[];
|
|
24
|
+
state: GraphState;
|
|
25
|
+
digest: string;
|
|
26
|
+
tail: RecoveryTail;
|
|
27
|
+
};
|
|
28
|
+
/** Taxonomía cerrada de fallos irrecuperables (paran en vez de adivinar). */
|
|
29
|
+
export type RecoveryErrorCode = "corrupt" | "sequence-ambiguity";
|
|
30
|
+
/** Error tipado de un journal que no puede recuperarse de forma segura. */
|
|
31
|
+
export declare class RecoveryError extends Error {
|
|
32
|
+
readonly code: RecoveryErrorCode;
|
|
33
|
+
readonly detail: string;
|
|
34
|
+
constructor(code: RecoveryErrorCode, detail: string);
|
|
35
|
+
}
|
|
36
|
+
/** Recupera el prefijo autoritativo y su estado desde los bytes del journal. */
|
|
37
|
+
export declare function recoverJournal(spec: GraphSpecV1, text: string): RecoveredJournal;
|
|
38
|
+
//# sourceMappingURL=recovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recovery.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/recovery.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;;;;;;;;;;;;;;GAeG;AAEH,wCAAwC;AACxC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AAEjD,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,YAAY,CAAC;CACpB,CAAC;AAEF,6EAA6E;AAC7E,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,oBAAoB,CAAC;AAEjE,2EAA2E;AAC3E,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM;CAMpD;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,MAAM,GACX,gBAAgB,CAwBlB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Error tipado de un registro de runs ilegible. */
|
|
2
|
+
export declare class RunRegistryError extends Error {
|
|
3
|
+
readonly code = "corrupt";
|
|
4
|
+
readonly detail: string;
|
|
5
|
+
constructor(detail: string);
|
|
6
|
+
}
|
|
7
|
+
/** Contrato del registro de runs activos del workspace. */
|
|
8
|
+
export interface RunRegistry {
|
|
9
|
+
/** Marca `runID` como activo (idempotente). */
|
|
10
|
+
markActive(runID: string): Promise<void>;
|
|
11
|
+
/** Marca `runID` como inactivo (idempotente). */
|
|
12
|
+
markInactive(runID: string): Promise<void>;
|
|
13
|
+
/** Lista los runs activos, ordenados. */
|
|
14
|
+
list(): Promise<string[]>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createRunRegistry(root: string): RunRegistry;
|
|
17
|
+
//# sourceMappingURL=runRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runRegistry.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/runRegistry.ts"],"names":[],"mappings":"AAqBA,oDAAoD;AACpD,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;CAK3B;AAED,2DAA2D;AAC3D,MAAM,WAAW,WAAW;IAC1B,+CAA+C;IAC/C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,iDAAiD;IACjD,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,yCAAyC;IACzC,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CA8C3D"}
|