@jmanuelcorral/openteam 0.1.40 → 0.1.41
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 +39 -2
- package/dist/commands/graph.d.ts +65 -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 +39 -0
- package/dist/config/schema.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 +39 -2
- 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/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/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/package.json +1 -1
|
@@ -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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { GraphEventV1, GraphSpecV1 } from "../../graph/schema";
|
|
2
|
+
import type { GraphState } from "../../graph/types";
|
|
3
|
+
/**
|
|
4
|
+
* Snapshots versionados del estado reducido con equivalencia al replay total.
|
|
5
|
+
*
|
|
6
|
+
* Un snapshot captura el `GraphState` tras aplicar los primeros `count` eventos
|
|
7
|
+
* junto al digest de cadena de ese prefijo (`prefixDigest`). Cargar puede así
|
|
8
|
+
* arrancar desde el snapshot y reproducir sólo la cola, obteniendo exactamente
|
|
9
|
+
* el mismo estado que reproducir el journal completo desde génesis.
|
|
10
|
+
*
|
|
11
|
+
* El journal sigue siendo la autoridad: el snapshot es un acelerador desechable.
|
|
12
|
+
* - Borrarlo no pierde autoridad: se recae al replay total del journal.
|
|
13
|
+
* - Un snapshot corrupto o de versión desconocida no se confía: se recae **sólo**
|
|
14
|
+
* al replay estricto del journal (nunca a un estado a medio validar).
|
|
15
|
+
*
|
|
16
|
+
* La integridad se ancla con un checksum sobre el sobre y el hash del estado, y
|
|
17
|
+
* el `prefixDigest` ata el snapshot a un prefijo concreto del journal.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SNAPSHOT_VERSION = 1;
|
|
20
|
+
/** Snapshot del estado reducido en un punto del journal. */
|
|
21
|
+
export type GraphSnapshot = {
|
|
22
|
+
version: number;
|
|
23
|
+
runID: string;
|
|
24
|
+
count: number;
|
|
25
|
+
prefixDigest: string;
|
|
26
|
+
state: GraphState;
|
|
27
|
+
};
|
|
28
|
+
/** Construye un snapshot puro tras los primeros `count` eventos del journal. */
|
|
29
|
+
export declare function snapshotAt(spec: GraphSpecV1, events: readonly GraphEventV1[], count: number): GraphSnapshot;
|
|
30
|
+
/** Persiste el snapshot de forma durable en `<root>/<runID>/snapshot.json`. */
|
|
31
|
+
export declare function writeSnapshot(root: string, snapshot: GraphSnapshot): void;
|
|
32
|
+
/**
|
|
33
|
+
* Lee el snapshot si es íntegro y de versión conocida; devuelve `undefined`
|
|
34
|
+
* (para recaer al replay) si falta, es ilegible, tiene versión desconocida o su
|
|
35
|
+
* checksum no cuadra.
|
|
36
|
+
*/
|
|
37
|
+
export declare function readSnapshot(root: string, runID: string): GraphSnapshot | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Resuelve el estado del run: si el snapshot ata al prefijo del journal, arranca
|
|
40
|
+
* desde él y reproduce la cola; en cualquier otro caso recae al replay estricto
|
|
41
|
+
* y total del journal, que es la autoridad.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveState(spec: GraphSpecV1, events: readonly GraphEventV1[], snapshot: GraphSnapshot | undefined): GraphState;
|
|
44
|
+
//# sourceMappingURL=snapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/snapshot.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAIpD;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAIlC,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC;AAkDF,gFAAgF;AAChF,wBAAgB,UAAU,CACxB,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,KAAK,EAAE,MAAM,GACZ,aAAa,CASf;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAIzE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,SAAS,CA8B3B;AA4BD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,WAAW,EACjB,MAAM,EAAE,SAAS,YAAY,EAAE,EAC/B,QAAQ,EAAE,aAAa,GAAG,SAAS,GAClC,UAAU,CAKZ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type RunRegistry } from "./runRegistry";
|
|
3
|
+
declare const leaseRecordSchema: z.ZodObject<{
|
|
4
|
+
runID: z.ZodString;
|
|
5
|
+
holder: z.ZodString;
|
|
6
|
+
token: z.ZodString;
|
|
7
|
+
released: z.ZodBoolean;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
/** Registro persistido de un lease del workspace. */
|
|
10
|
+
export type LeaseRecord = z.infer<typeof leaseRecordSchema>;
|
|
11
|
+
/** Taxonomía cerrada de errores del lease. */
|
|
12
|
+
export type LeaseErrorCode = "held" | "not-holder" | "not-found" | "corrupt";
|
|
13
|
+
/** Error tipado de una operación inválida sobre el lease. */
|
|
14
|
+
export declare class LeaseError extends Error {
|
|
15
|
+
readonly code: LeaseErrorCode;
|
|
16
|
+
readonly detail: string;
|
|
17
|
+
constructor(code: LeaseErrorCode, detail: string);
|
|
18
|
+
}
|
|
19
|
+
/** Concesión de un lease a un holder concreto. */
|
|
20
|
+
export type LeaseHandle = {
|
|
21
|
+
readonly runID: string;
|
|
22
|
+
readonly holder: string;
|
|
23
|
+
readonly token: string;
|
|
24
|
+
};
|
|
25
|
+
/** Contrato del lease exclusivo del workspace. */
|
|
26
|
+
export interface WorkspaceLease {
|
|
27
|
+
/** Adquiere el run para `holder`; readquisición del mismo holder es idempotente. */
|
|
28
|
+
acquire(runID: string, holder: string): Promise<LeaseHandle>;
|
|
29
|
+
/** Libera el run de forma durable; el registro deja de listarlo. */
|
|
30
|
+
release(handle: LeaseHandle): Promise<void>;
|
|
31
|
+
/** Devuelve el registro persistido del lease, o `undefined` si no existe. */
|
|
32
|
+
inspect(runID: string): Promise<LeaseRecord | undefined>;
|
|
33
|
+
}
|
|
34
|
+
export declare function createWorkspaceLease(root: string, registry?: RunRegistry): WorkspaceLease;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=workspaceLease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspaceLease.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/workspaceLease.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAuBpE,QAAA,MAAM,iBAAiB;;;;;iBAKrB,CAAC;AAEH,qDAAqD;AACrD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,8CAA8C;AAC9C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,SAAS,CAAC;AAE7E,6DAA6D;AAC7D,qBAAa,UAAW,SAAQ,KAAK;IACnC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM;CAMjD;AAED,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,kDAAkD;AAClD,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC7D,oEAAoE;IACpE,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,6EAA6E;IAC7E,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAAC;CAC1D;AAED,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,WAAqC,GAC9C,cAAc,CA0EhB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Primitiva de durabilidad del journal FS: escrituras que sólo retornan tras
|
|
3
|
+
* `fsync` del descriptor, de modo que el boundary de confirmación coincide con
|
|
4
|
+
* la persistencia real (no con el buffer del SO). Es la única razón por la que
|
|
5
|
+
* el journal no se apoya en `StorageProvider.append`, que no fuerza `fsync`.
|
|
6
|
+
*
|
|
7
|
+
* Aísla `node:fs` para que el resto del adapter permanezca declarativo. No
|
|
8
|
+
* interpreta contenido: sólo bytes, directorios y el boundary de flush.
|
|
9
|
+
*/
|
|
10
|
+
/** Crea el directorio (recursivo, idempotente). */
|
|
11
|
+
export declare function ensureDir(dir: string): void;
|
|
12
|
+
/** Escribe (trunca) un fichero y fuerza `fsync` antes de retornar. */
|
|
13
|
+
export declare function writeDurable(file: string, content: string): void;
|
|
14
|
+
/** Anexa al final de un fichero y fuerza `fsync` antes de retornar. */
|
|
15
|
+
export declare function appendDurable(file: string, content: string): void;
|
|
16
|
+
/** Lee el contenido UTF-8 de un fichero; `undefined` si no existe. */
|
|
17
|
+
export declare function readText(file: string): string | undefined;
|
|
18
|
+
/** `true` si la ruta existe (fichero o directorio). */
|
|
19
|
+
export declare function pathExists(path: string): boolean;
|
|
20
|
+
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/writer.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AAEH,mDAAmD;AACnD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQhE;AAED,uEAAuE;AACvE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAQjE;AAED,sEAAsE;AACtE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKzD;AAED,uDAAuD;AACvD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ErrorClass, GraphEventType, GraphEventV1 } from "../graph/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Proyección de telemetría **reference-only** de eventos de Graph (GE-037).
|
|
4
|
+
*
|
|
5
|
+
* `projectGraphEvent` mapea un evento validado a un registro de telemetría con
|
|
6
|
+
* un conjunto de campos **allow-listed y acotados**: envoltura (`v`, `seq`,
|
|
7
|
+
* `runID`, `type`) más identificadores/digests concretos según el tipo. Nunca
|
|
8
|
+
* copia el evento entero ni transporta contenido crudo; el artefacto se reduce
|
|
9
|
+
* a su referencia (`uri`, `sha256`, `bytes`). Un guard final rechaza cualquier
|
|
10
|
+
* campo de contenido crudo. Puro y determinista: sin I/O, reloj ni random.
|
|
11
|
+
*/
|
|
12
|
+
/** Registro de telemetría de un evento Graph: solo campos allow-listed. */
|
|
13
|
+
export type GraphTelemetryRecord = {
|
|
14
|
+
readonly v: number;
|
|
15
|
+
readonly seq: number;
|
|
16
|
+
readonly runID: string;
|
|
17
|
+
readonly type: GraphEventType;
|
|
18
|
+
readonly nodeID?: string;
|
|
19
|
+
readonly operationID?: string;
|
|
20
|
+
readonly attemptID?: string;
|
|
21
|
+
readonly errorClass?: ErrorClass;
|
|
22
|
+
readonly specDigest?: string;
|
|
23
|
+
readonly artifact?: {
|
|
24
|
+
readonly uri: string;
|
|
25
|
+
readonly sha256: string;
|
|
26
|
+
readonly bytes: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Proyecta un evento Graph a un registro de telemetría reference-only. Solo
|
|
31
|
+
* emite los campos allow-listed presentes en el evento y reduce el artefacto a
|
|
32
|
+
* su referencia; el guard reference-only asegura que ningún derivado futuro
|
|
33
|
+
* introduzca contenido crudo.
|
|
34
|
+
*/
|
|
35
|
+
export declare function projectGraphEvent(event: GraphEventV1): GraphTelemetryRecord;
|
|
36
|
+
//# sourceMappingURL=graphProjection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphProjection.d.ts","sourceRoot":"","sources":["../../src/telemetry/graphProjection.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEhF;;;;;;;;;GASG;AAEH,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAClB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,GAAG,oBAAoB,CAe3E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jmanuelcorral/openteam",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
|
|
6
6
|
"license": "MIT",
|