@jmanuelcorral/openteam 0.1.38 → 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.
Files changed (162) hide show
  1. package/.opencode/command/openteam.md +5 -5
  2. package/AGENTS.md +50 -35
  3. package/README.es.md +759 -0
  4. package/README.md +213 -480
  5. package/dist/capabilities/types.d.ts +1 -1
  6. package/dist/cli/consoleServe.d.ts.map +1 -1
  7. package/dist/cli.js +1123 -232
  8. package/dist/commands/frontierCatalog.d.ts +27 -0
  9. package/dist/commands/frontierCatalog.d.ts.map +1 -0
  10. package/dist/commands/graph.d.ts +65 -0
  11. package/dist/commands/graph.d.ts.map +1 -0
  12. package/dist/commands/orchestratorAgent.d.ts +2 -1
  13. package/dist/commands/orchestratorAgent.d.ts.map +1 -1
  14. package/dist/commands/setup.d.ts +3 -18
  15. package/dist/commands/setup.d.ts.map +1 -1
  16. package/dist/config/load.d.ts.map +1 -1
  17. package/dist/config/migrations.d.ts +27 -0
  18. package/dist/config/migrations.d.ts.map +1 -0
  19. package/dist/config/resolve.d.ts +34 -0
  20. package/dist/config/resolve.d.ts.map +1 -0
  21. package/dist/config/schema.d.ts +235 -0
  22. package/dist/config/schema.d.ts.map +1 -1
  23. package/dist/console/assets.d.ts +9 -0
  24. package/dist/console/assets.d.ts.map +1 -0
  25. package/dist/console/render.d.ts.map +1 -1
  26. package/dist/context/redaction.d.ts +48 -0
  27. package/dist/context/redaction.d.ts.map +1 -0
  28. package/dist/context/schema.d.ts +115 -0
  29. package/dist/context/schema.d.ts.map +1 -0
  30. package/dist/context/types.d.ts +8 -0
  31. package/dist/context/types.d.ts.map +1 -0
  32. package/dist/contract/opencode.d.ts +1 -1
  33. package/dist/contract/opencode.d.ts.map +1 -1
  34. package/dist/graph/events.d.ts +25 -0
  35. package/dist/graph/events.d.ts.map +1 -0
  36. package/dist/graph/ids.d.ts +5 -0
  37. package/dist/graph/ids.d.ts.map +1 -0
  38. package/dist/graph/planner.d.ts +15 -0
  39. package/dist/graph/planner.d.ts.map +1 -0
  40. package/dist/graph/policies.d.ts +34 -0
  41. package/dist/graph/policies.d.ts.map +1 -0
  42. package/dist/graph/privacyPolicy.d.ts +29 -0
  43. package/dist/graph/privacyPolicy.d.ts.map +1 -0
  44. package/dist/graph/reducer.d.ts +27 -0
  45. package/dist/graph/reducer.d.ts.map +1 -0
  46. package/dist/graph/replay.d.ts +20 -0
  47. package/dist/graph/replay.d.ts.map +1 -0
  48. package/dist/graph/reviewerPolicy.d.ts +27 -0
  49. package/dist/graph/reviewerPolicy.d.ts.map +1 -0
  50. package/dist/graph/schema.d.ts +220 -0
  51. package/dist/graph/schema.d.ts.map +1 -0
  52. package/dist/graph/types.d.ts +40 -0
  53. package/dist/graph/types.d.ts.map +1 -0
  54. package/dist/graph/validate.d.ts +19 -0
  55. package/dist/graph/validate.d.ts.map +1 -0
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +873 -88
  58. package/dist/local/embeddings.d.ts +29 -0
  59. package/dist/local/embeddings.d.ts.map +1 -0
  60. package/dist/local/extractClient.d.ts +31 -0
  61. package/dist/local/extractClient.d.ts.map +1 -0
  62. package/dist/local/openai-compatible.d.ts +1 -0
  63. package/dist/local/openai-compatible.d.ts.map +1 -1
  64. package/dist/mcp/semanticRecall.d.ts +25 -0
  65. package/dist/mcp/semanticRecall.d.ts.map +1 -0
  66. package/dist/mcp/server.d.ts +22 -0
  67. package/dist/mcp/server.d.ts.map +1 -1
  68. package/dist/memory/consolidate.d.ts +21 -0
  69. package/dist/memory/consolidate.d.ts.map +1 -0
  70. package/dist/memory/extract.d.ts +68 -0
  71. package/dist/memory/extract.d.ts.map +1 -0
  72. package/dist/memory/fold.d.ts +24 -0
  73. package/dist/memory/fold.d.ts.map +1 -0
  74. package/dist/memory/index.d.ts +18 -0
  75. package/dist/memory/index.d.ts.map +1 -0
  76. package/dist/memory/inject.d.ts +29 -0
  77. package/dist/memory/inject.d.ts.map +1 -0
  78. package/dist/memory/log.d.ts +16 -0
  79. package/dist/memory/log.d.ts.map +1 -0
  80. package/dist/memory/merge.d.ts +38 -0
  81. package/dist/memory/merge.d.ts.map +1 -0
  82. package/dist/memory/rank.d.ts +32 -0
  83. package/dist/memory/rank.d.ts.map +1 -0
  84. package/dist/memory/recall.d.ts +30 -0
  85. package/dist/memory/recall.d.ts.map +1 -0
  86. package/dist/memory/temporal.d.ts +39 -0
  87. package/dist/memory/temporal.d.ts.map +1 -0
  88. package/dist/memory/types.d.ts +159 -0
  89. package/dist/memory/types.d.ts.map +1 -0
  90. package/dist/memory/vector.d.ts +18 -0
  91. package/dist/memory/vector.d.ts.map +1 -0
  92. package/dist/orchestrator/graphCancellation.d.ts +84 -0
  93. package/dist/orchestrator/graphCancellation.d.ts.map +1 -0
  94. package/dist/orchestrator/graphEffects.d.ts +63 -0
  95. package/dist/orchestrator/graphEffects.d.ts.map +1 -0
  96. package/dist/orchestrator/graphReview.d.ts +84 -0
  97. package/dist/orchestrator/graphReview.d.ts.map +1 -0
  98. package/dist/orchestrator/graphRuntime.d.ts +69 -0
  99. package/dist/orchestrator/graphRuntime.d.ts.map +1 -0
  100. package/dist/orchestrator/opencodeSessionAdapter.d.ts +117 -0
  101. package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -0
  102. package/dist/orchestrator/roles.d.ts +1 -1
  103. package/dist/orchestrator/roles.d.ts.map +1 -1
  104. package/dist/orchestrator/sdd.d.ts +38 -2
  105. package/dist/orchestrator/sdd.d.ts.map +1 -1
  106. package/dist/orchestrator/sddCompiler.d.ts +44 -0
  107. package/dist/orchestrator/sddCompiler.d.ts.map +1 -0
  108. package/dist/orchestrator/sessionReconciler.d.ts +74 -0
  109. package/dist/orchestrator/sessionReconciler.d.ts.map +1 -0
  110. package/dist/orchestrator/shadowComparator.d.ts +62 -0
  111. package/dist/orchestrator/shadowComparator.d.ts.map +1 -0
  112. package/dist/plugin/hooks.d.ts +13 -0
  113. package/dist/plugin/hooks.d.ts.map +1 -1
  114. package/dist/plugin/memoryInject.d.ts +25 -0
  115. package/dist/plugin/memoryInject.d.ts.map +1 -0
  116. package/dist/router/chooseModel.d.ts.map +1 -1
  117. package/dist/router/cost.d.ts +4 -0
  118. package/dist/router/cost.d.ts.map +1 -0
  119. package/dist/router/frontierBaseline.d.ts +13 -0
  120. package/dist/router/frontierBaseline.d.ts.map +1 -0
  121. package/dist/router/modelSelection.d.ts +18 -0
  122. package/dist/router/modelSelection.d.ts.map +1 -0
  123. package/dist/storage/graph/codec.d.ts +52 -0
  124. package/dist/storage/graph/codec.d.ts.map +1 -0
  125. package/dist/storage/graph/fsGraphJournal.d.ts +3 -0
  126. package/dist/storage/graph/fsGraphJournal.d.ts.map +1 -0
  127. package/dist/storage/graph/importLegacy.d.ts +62 -0
  128. package/dist/storage/graph/importLegacy.d.ts.map +1 -0
  129. package/dist/storage/graph/memoryGraphJournal.d.ts +11 -0
  130. package/dist/storage/graph/memoryGraphJournal.d.ts.map +1 -0
  131. package/dist/storage/graph/migrateLegacyBriefs.d.ts +32 -0
  132. package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -0
  133. package/dist/storage/graph/projections.d.ts +31 -0
  134. package/dist/storage/graph/projections.d.ts.map +1 -0
  135. package/dist/storage/graph/provider.d.ts +52 -0
  136. package/dist/storage/graph/provider.d.ts.map +1 -0
  137. package/dist/storage/graph/recovery.d.ts +38 -0
  138. package/dist/storage/graph/recovery.d.ts.map +1 -0
  139. package/dist/storage/graph/runRegistry.d.ts +17 -0
  140. package/dist/storage/graph/runRegistry.d.ts.map +1 -0
  141. package/dist/storage/graph/snapshot.d.ts +44 -0
  142. package/dist/storage/graph/snapshot.d.ts.map +1 -0
  143. package/dist/storage/graph/workspaceLease.d.ts +36 -0
  144. package/dist/storage/graph/workspaceLease.d.ts.map +1 -0
  145. package/dist/storage/graph/writer.d.ts +20 -0
  146. package/dist/storage/graph/writer.d.ts.map +1 -0
  147. package/dist/storage/index/memoryConsolidate.d.ts +24 -0
  148. package/dist/storage/index/memoryConsolidate.d.ts.map +1 -0
  149. package/dist/storage/index/memoryIndex.d.ts +52 -0
  150. package/dist/storage/index/memoryIndex.d.ts.map +1 -0
  151. package/dist/storage/index/memoryRecall.d.ts +23 -0
  152. package/dist/storage/index/memoryRecall.d.ts.map +1 -0
  153. package/dist/storage/index/memoryRuntime.d.ts +41 -0
  154. package/dist/storage/index/memoryRuntime.d.ts.map +1 -0
  155. package/dist/telemetry/events.d.ts +3 -1
  156. package/dist/telemetry/events.d.ts.map +1 -1
  157. package/dist/telemetry/graphProjection.d.ts +36 -0
  158. package/dist/telemetry/graphProjection.d.ts.map +1 -0
  159. package/dist/telemetry/hash.d.ts.map +1 -1
  160. package/dist/web/server.d.ts +4 -0
  161. package/dist/web/server.d.ts.map +1 -1
  162. package/package.json +14 -6
@@ -1,4 +1,5 @@
1
1
  import type { OpenTeamConfig } from "../config/schema";
2
+ import { type ArtifactManifest, type ContextRef, type PrivacyClass } from "../context/schema";
2
3
  import type { TaskSignals } from "../router/types";
3
4
  import type { StorageProvider } from "../storage/provider";
4
5
  import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
@@ -7,8 +8,10 @@ import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
7
8
  * boundary de openteam. Por cada tarea:
8
9
  *
9
10
  * 1. Reanuda desde el ledger: si la tarea ya está `complete`, la salta.
10
- * 2. Persiste un **task brief** como fichero (higiene de contexto: el
11
- * implementer recibe solo su tarea, no el historial acumulado).
11
+ * 2. Persiste un **manifiesto redactado** de inputs del brief (referencia +
12
+ * digest, nunca el brief crudo) y entrega el brief íntegro al implementer
13
+ * **en memoria** vía el prompt (higiene de contexto: el implementer recibe
14
+ * solo su tarea, no el historial acumulado).
12
15
  * 3. Despacha el **implementer** con el brief.
13
16
  * 4. Despacha el **reviewer** (rol con alto code-quality) para revisar el
14
17
  * cambio; la generación del diff vive en el propio agente reviewer.
@@ -71,6 +74,39 @@ export type SddPlanResult = {
71
74
  failed: string[];
72
75
  skipped: string[];
73
76
  };
77
+ /**
78
+ * Texto **completo** del brief en memoria para el prompt del implementer.
79
+ *
80
+ * GE-007 congela que el brief íntegro es un input de dispatch **en memoria**
81
+ * (byte a byte), nunca solo una ruta a fichero; un prompt path-only es una
82
+ * regresión funcional. GE-038 lo cablea al text part de `session.prompt`. Puro:
83
+ * no persiste nada.
84
+ */
85
+ export declare function implementerBriefInput(task: SddTask): string;
86
+ /** Opciones del manifiesto redactado de inputs del brief. */
87
+ export type BriefManifestOptions = {
88
+ /** Clase de privacidad del manifiesto (def: `internal`). */
89
+ privacyClass?: PrivacyClass;
90
+ /** Referencia estable del brief cuando persiste como artefacto revalidable. */
91
+ briefRef?: ContextRef;
92
+ };
93
+ /** Manifiesto redactado del brief más su elegibilidad para shadow. */
94
+ export type BriefManifestResult = {
95
+ manifest: ArtifactManifest;
96
+ /** Solo elegible si **cada** input seleccionado tiene referencia estable. */
97
+ shadowEligible: boolean;
98
+ };
99
+ /**
100
+ * Construye el manifiesto **redactado** de inputs del brief (GE-007).
101
+ *
102
+ * Sustituye el fichero de brief crudo por una referencia/digest ordenada:
103
+ * versión, taskID, clase de privacidad y una entrada por input con digest
104
+ * SHA-256 y tamaño en bytes; nunca título, extracto, prompt ni salida del
105
+ * modelo. Un brief sin referencia estable produce una entrada solo-digest y
106
+ * queda **inelegible** para shadow (no se fabrica una referencia). Puro y
107
+ * determinista: solo cómputo de digest, sin I/O.
108
+ */
109
+ export declare function briefInputManifest(task: SddTask, options?: BriefManifestOptions): BriefManifestResult;
74
110
  /** Extrae texto de una respuesta opaca del modelo (best-effort). Puro. */
75
111
  export declare function extractResponseText(response: unknown): string;
76
112
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sdd.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sdd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,i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SddTask } from "./sdd";
3
+ /**
4
+ * Compilador **puro** de una tarea SDD legacy a un `GraphSpecV1` estático
5
+ * (GE-041).
6
+ *
7
+ * La cadena implement → review → revise → re-review se expande a un DAG
8
+ * acíclico versionado: un nodo `implementer` inicial, su `reviewer`, y por cada
9
+ * ronda de revisión un nuevo `implementer` (revise) con su `reviewer`
10
+ * (re-review). El spec resultante:
11
+ *
12
+ * - es **reference-only**: los nodos solo llevan ids, roles y un `anchor`
13
+ * (taskID + digest), nunca el brief crudo;
14
+ * - es **determinista**: la misma tarea produce el mismo spec y el mismo
15
+ * digest (`graphSpecDigest`);
16
+ * - **falla antes de dispatch** ante un rol inválido, un autor que también
17
+ * revisa, o un id de tarea que no es un `NodeID` válido.
18
+ *
19
+ * Sin I/O, reloj ni random: solo cómputo de digest y validación estructural.
20
+ */
21
+ /** Código de fallo de compilación (falla antes de cualquier dispatch). */
22
+ export type SddCompileErrorCode = "invalid-role" | "author-is-reviewer" | "invalid-spec";
23
+ /** Error tipado de una compilación rechazada. */
24
+ export declare class SddCompileError extends Error {
25
+ readonly code: SddCompileErrorCode;
26
+ readonly detail: string;
27
+ constructor(code: SddCompileErrorCode, detail: string);
28
+ }
29
+ /** Opciones de compilación. */
30
+ export type SddCompileOptions = {
31
+ /** Rol del reviewer (def: el de la tarea o `reviewer`). */
32
+ reviewerRoleID?: string;
33
+ /** Rondas de revisión revise/re-review a expandir (def: 1). */
34
+ revisionRounds?: number;
35
+ };
36
+ /** Digest SHA-256 estable del spec compilado (reproducible). */
37
+ export declare function graphSpecDigest(spec: GraphSpecV1): string;
38
+ /**
39
+ * Compila una tarea SDD legacy a un `GraphSpecV1` validado. Lanza
40
+ * `SddCompileError` ante rol/autor/spec inválidos, siempre **antes** de
41
+ * cualquier dispatch.
42
+ */
43
+ export declare function compileSddTask(task: SddTask, options?: SddCompileOptions): GraphSpecV1;
44
+ //# sourceMappingURL=sddCompiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sddCompiler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sddCompiler.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA4B,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,oBAAoB,GACpB,cAAc,CAAC;AAEnB,iDAAiD;AACjD,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM;CAMtD;AAED,+BAA+B;AAC/B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAuCF,gEAAgE;AAChE,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAEzD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,iBAAsB,GAC9B,WAAW,CA0Db"}
@@ -0,0 +1,74 @@
1
+ import type { NodeStatus } from "../graph/types";
2
+ /**
3
+ * Reconciliador de ventanas de crash de create/prompt (GE-032).
4
+ *
5
+ * Tras un fallo a mitad de crear la sub-sesión hija o despachar el prompt, el
6
+ * runtime no sabe si el efecto llegó a empezar. Este módulo clasifica la
7
+ * ventana usando la **sesión hija correlacionada** de opencode y decide sin
8
+ * reintentar a ciegas:
9
+ *
10
+ * - `not-started`: no hay hija correlacionada; el efecto puede despacharse.
11
+ * - `active`: existe una única hija correlacionada aún en curso; se **adopta**.
12
+ * - `completed`: existe una única hija correlacionada terminada; se **adopta**.
13
+ * - `unknown`: la evidencia es ambigua (varias hijas correlacionadas); se
14
+ * **bloquea** el reintento ciego y se exige reconciliación segura.
15
+ *
16
+ * Un nodo con recibo ya escrito (terminal) hace que la reconciliación sea un
17
+ * **no-op idempotente**. Puro y determinista: sin I/O, reloj ni random; el
18
+ * runtime le pasa la evidencia ya observada a través de puertos inyectados.
19
+ */
20
+ /** Clasificación de la ventana de crash de un efecto. */
21
+ export type CrashWindowClass = "not-started" | "active" | "completed" | "unknown";
22
+ /** Decisión de reconciliación derivada de la ventana. */
23
+ export type ReconcileDecision = "dispatch" | "adopt" | "block" | "noop";
24
+ /** Estado observado de una sesión hija de opencode. */
25
+ export type ObservedChildState = "active" | "completed";
26
+ /** Sesión hija observada con su título de correlación y estado. */
27
+ export type ObservedChild = {
28
+ readonly sessionID: string;
29
+ readonly title: string;
30
+ readonly state: ObservedChildState;
31
+ };
32
+ /** Evidencia correlacionada sobre la hija de un intento concreto. */
33
+ export type ChildObservation = {
34
+ readonly kind: "none";
35
+ } | {
36
+ readonly kind: "active";
37
+ readonly sessionID: string;
38
+ } | {
39
+ readonly kind: "completed";
40
+ readonly sessionID: string;
41
+ } | {
42
+ readonly kind: "ambiguous";
43
+ readonly detail: string;
44
+ };
45
+ /** Entrada de la reconciliación de un nodo. */
46
+ export type ReconcileInput = {
47
+ readonly nodeStatus: NodeStatus;
48
+ readonly observation: ChildObservation;
49
+ };
50
+ /** Resultado de la reconciliación: ventana, decisión y hija adoptada si aplica. */
51
+ export type ReconcileResult = {
52
+ readonly window: CrashWindowClass;
53
+ readonly decision: ReconcileDecision;
54
+ readonly sessionID?: string;
55
+ };
56
+ /**
57
+ * Título de correlación determinista de la hija del intento `(runID, op,
58
+ * attempt)`. El runtime lo fija como título de la sub-sesión al crearla, de
59
+ * modo que un reinicio pueda reencontrar exactamente la misma hija.
60
+ */
61
+ export declare function correlationTitle(runID: string, operationID: string, attemptID: string): string;
62
+ /**
63
+ * Reduce las hijas observadas a la evidencia correlacionada del intento. Cero
64
+ * coincidencias es `none`; exactamente una determina `active`/`completed`;
65
+ * más de una es `ambiguous` (no se puede adoptar una sola con seguridad).
66
+ */
67
+ export declare function observeChild(expectedTitle: string, children: readonly ObservedChild[]): ChildObservation;
68
+ /**
69
+ * Clasifica la ventana de crash de un nodo y decide la acción segura. Un nodo
70
+ * terminal (recibo ya escrito) es un no-op idempotente; un nodo `pending` no ha
71
+ * empezado; un nodo `running` se clasifica por la evidencia correlacionada.
72
+ */
73
+ export declare function reconcileSession(input: ReconcileInput): ReconcileResult;
74
+ //# sourceMappingURL=sessionReconciler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionReconciler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sessionReconciler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AAEH,yDAAyD;AACzD,MAAM,MAAM,gBAAgB,GACxB,aAAa,GACb,QAAQ,GACR,WAAW,GACX,SAAS,CAAC;AAEd,yDAAyD;AACzD,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAExE,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAExD,mEAAmE;AACnE,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;CACpC,CAAC;AAEF,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACvD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,+CAA+C;AAC/C,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC;CACxC,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAIF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,MAAM,CAER;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,aAAa,EAAE,MAAM,EACrB,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,gBAAgB,CAelB;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CAiCvE"}
@@ -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"}
@@ -7,8 +7,21 @@ export type ChatMessageHook = NonNullable<Hooks["chat.message"]>;
7
7
  export type ChatMessageHookOptions = {
8
8
  sink?: EventSink;
9
9
  now?: () => number;
10
+ /**
11
+ * Inyección de memoria M6 (opt-in). Dado el texto del prompt, devuelve un bloque
12
+ * de contexto a **prepender** al primer part de texto, o `null` para no inyectar.
13
+ * Se invoca **después** de elegir modelo y emitir telemetría, de modo que no
14
+ * altera el determinismo del router ni el hash del prompt.
15
+ */
16
+ injectMemory?: (queryText: string) => Promise<string | null>;
10
17
  };
11
18
  export declare function deriveTaskSignals(input: Parameters<ChatMessageHook>[0], output: Parameters<ChatMessageHook>[1]): TaskSignals;
19
+ /**
20
+ * Prepend el bloque de memoria al primer part de texto del mensaje. Devuelve
21
+ * `true` si inyectó. No añade parts nuevos (superficie de contrato acotada:
22
+ * mutar `text` de un part existente), y es un no-op si no hay part de texto.
23
+ */
24
+ export declare function injectMemoryBlock(output: Parameters<ChatMessageHook>[1], block: string): boolean;
12
25
  export declare function createChatMessageHook(config: OpenTeamConfig, getAvailable: AvailabilityProvider, options?: ChatMessageHookOptions): ChatMessageHook;
13
26
  export declare function createHooks(config: OpenTeamConfig, getAvailable: AvailabilityProvider, options?: ChatMessageHookOptions): Hooks;
14
27
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/plugin/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;AAEjE,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,CAAC;AA8CF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EACrC,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,GACrC,WAAW,CAqBb;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,oBAAoB,EAClC,OAAO,GAAE,sBAA2B,GACnC,eAAe,CAiCjB;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,oBAAoB,EAClC,OAAO,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2B,GACnC,KAAK,CAIP"}
@@ -0,0 +1,25 @@
1
+ import type { Embedder } from "../local/embeddings";
2
+ import { type MemoryInjectionParams } from "../memory/inject";
3
+ import type { MemoryIndex } from "../storage/index/memoryIndex";
4
+ /**
5
+ * Compone el callback `injectMemory` de M6 (push a `chat.message`) a partir del
6
+ * índice de memoria, un `Embedder` local y la política de recall/inyección.
7
+ * Aísla el wiring para que `index.ts` sea un caller fino y esto quede cubierto
8
+ * por tests. El único I/O es el embedding de la query (dentro de `recallMemory`);
9
+ * el formateo del bloque es puro (`buildMemoryBlock`).
10
+ */
11
+ export type MemoryInjectorDeps = {
12
+ index: MemoryIndex;
13
+ embedder: Embedder;
14
+ /** Reloj inyectado (epoch ms) para el `asOf` "ahora". */
15
+ now: () => number;
16
+ };
17
+ export type MemoryInjectorPolicy = {
18
+ ownerKey: string;
19
+ minSimilarity: number;
20
+ maxResults: number;
21
+ includeShared: boolean;
22
+ injection: MemoryInjectionParams;
23
+ };
24
+ export declare function buildMemoryInjector(deps: MemoryInjectorDeps, policy: MemoryInjectorPolicy): (queryText: string) => Promise<string | null>;
25
+ //# sourceMappingURL=memoryInject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoryInject.d.ts","sourceRoot":"","sources":["../../src/plugin/memoryInject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAGhE;;;;;;GAMG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,yDAAyD;IACzD,GAAG,EAAE,MAAM,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,qBAAqB,CAAC;CAClC,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,oBAAoB,GAC3B,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAe/C"}
@@ -1 +1 @@
1
- {"version":3,"file":"chooseModel.d.ts","sourceRoot":"","sources":["../../src/router/chooseModel.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAIV,eAAe,EACf,YAAY,EACb,MAAM,SAAS,CAAC;AAoXjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CA8HhE"}
1
+ {"version":3,"file":"chooseModel.d.ts","sourceRoot":"","sources":["../../src/router/chooseModel.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAIV,eAAe,EACf,YAAY,EACb,MAAM,SAAS,CAAC;AAsMjB,wBAAgB,WAAW,CAAC,KAAK,EAAE,YAAY,GAAG,eAAe,CA8HhE"}
@@ -0,0 +1,4 @@
1
+ import type { ModelSelection, RoutingInput } from "./types";
2
+ export declare function estimatedCostUSD(input: RoutingInput, model: ModelSelection): number;
3
+ export declare function roundUSD(value: number): number;
4
+ //# sourceMappingURL=cost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cost.d.ts","sourceRoot":"","sources":["../../src/router/cost.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAW5D,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,cAAc,GACpB,MAAM,CAcR;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE9C"}
@@ -0,0 +1,13 @@
1
+ import type { ComplexityTier } from "../capabilities/types";
2
+ import type { ModelSelection, RoutingInput } from "./types";
3
+ /**
4
+ * Resolución pura del baseline frontier (cheapest-capable o pinned). Vive
5
+ * separada del resto del router para aislar la dependencia del catálogo de
6
+ * capacidades. Sin I/O ni estado.
7
+ */
8
+ export type FrontierResolution = {
9
+ model: ModelSelection;
10
+ rationale: string[];
11
+ };
12
+ export declare function resolveFrontierBaseline(input: RoutingInput, tier: ComplexityTier): FrontierResolution;
13
+ //# sourceMappingURL=frontierBaseline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frontierBaseline.d.ts","sourceRoot":"","sources":["../../src/router/frontierBaseline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5D;;;;GAIG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,cAAc,CAAC;IACtB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,cAAc,GACnB,kBAAkB,CA4BpB"}
@@ -0,0 +1,18 @@
1
+ import type { ModelRef, OpenTeamConfig } from "../config/schema";
2
+ import type { AvailableModel, ModelSelection, RoutingInput } from "./types";
3
+ /**
4
+ * Utilidades puras de selección de modelos para el router: identidad,
5
+ * comparación, deduplicación y resolución de los modelos disponibles.
6
+ * Sin I/O, sin reloj, sin aleatoriedad — igual que el resto de `router/`.
7
+ */
8
+ export declare function modelKey(model: ModelSelection): string;
9
+ export declare function sameModel(left: ModelRef, right: ModelSelection): boolean;
10
+ export declare function compareModels(left: ModelSelection, right: ModelSelection): number;
11
+ export declare function uniqueModelSelections(models: ModelSelection[]): ModelSelection[];
12
+ export declare function localDefault(config: OpenTeamConfig): ModelSelection;
13
+ export declare function resolveConfiguredFrontierBaseline(config: OpenTeamConfig): ModelSelection;
14
+ export declare function availableModels(input: RoutingInput): AvailableModel[];
15
+ export declare function listedModel(input: RoutingInput, model: ModelSelection): AvailableModel | undefined;
16
+ export declare function frontierAvailable(input: RoutingInput, model: ModelSelection): boolean;
17
+ export declare function availableLocalFallbacks(input: RoutingInput, selected: ModelSelection): ModelSelection[];
18
+ //# sourceMappingURL=modelSelection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modelSelection.d.ts","sourceRoot":"","sources":["../../src/router/modelSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5E;;;;GAIG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CAEtD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,GAAG,OAAO,CAExE;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,cAAc,GACpB,MAAM,CAER;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,cAAc,EAAE,GACvB,cAAc,EAAE,CAQlB;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAKnE;AAED,wBAAgB,iCAAiC,CAC/C,MAAM,EAAE,cAAc,GACrB,cAAc,CAShB;AAwBD,wBAAgB,eAAe,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,EAAE,CAIrE;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,cAAc,GACpB,cAAc,GAAG,SAAS,CAI5B;AAED,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,cAAc,GACpB,OAAO,CAET;AAaD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,YAAY,EACnB,QAAQ,EAAE,cAAc,GACvB,cAAc,EAAE,CAUlB"}
@@ -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,3 @@
1
+ import { type GraphJournal } from "./provider";
2
+ export declare function createFsGraphJournal(root: string): GraphJournal;
3
+ //# sourceMappingURL=fsGraphJournal.d.ts.map
@@ -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"}