@jmanuelcorral/openteam 0.1.42 → 0.2.1

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 (97) hide show
  1. package/.opencode/openteam.example.json +6 -1
  2. package/README.es.md +5 -5
  3. package/README.md +5 -5
  4. package/dist/capabilities/types.d.ts +4 -4
  5. package/dist/classifier/types.d.ts +3 -3
  6. package/dist/cli.js +11 -0
  7. package/dist/commands/doctor.d.ts +2 -0
  8. package/dist/commands/doctor.d.ts.map +1 -1
  9. package/dist/commands/graph.d.ts +28 -2
  10. package/dist/commands/graph.d.ts.map +1 -1
  11. package/dist/config/graphFeatureGate.d.ts +101 -0
  12. package/dist/config/graphFeatureGate.d.ts.map +1 -0
  13. package/dist/config/migrations.d.ts.map +1 -1
  14. package/dist/config/resolve.d.ts +20 -1
  15. package/dist/config/resolve.d.ts.map +1 -1
  16. package/dist/config/schema.d.ts +22 -19
  17. package/dist/config/schema.d.ts.map +1 -1
  18. package/dist/console/render.d.ts.map +1 -1
  19. package/dist/context/redaction.d.ts +23 -0
  20. package/dist/context/redaction.d.ts.map +1 -1
  21. package/dist/context/schema.d.ts +3 -3
  22. package/dist/contract/opencode.d.ts +2 -2
  23. package/dist/contract/opencode.d.ts.map +1 -1
  24. package/dist/graph/certificate.d.ts +515 -0
  25. package/dist/graph/certificate.d.ts.map +1 -0
  26. package/dist/graph/ids.d.ts +9 -0
  27. package/dist/graph/ids.d.ts.map +1 -1
  28. package/dist/graph/privacyPolicy.d.ts.map +1 -1
  29. package/dist/graph/reducer.d.ts.map +1 -1
  30. package/dist/graph/replay.d.ts.map +1 -1
  31. package/dist/graph/reviewerPolicy.d.ts.map +1 -1
  32. package/dist/graph/schema.d.ts +33 -33
  33. package/dist/graph/schema.d.ts.map +1 -1
  34. package/dist/graph/soakLedger.d.ts +167 -0
  35. package/dist/graph/soakLedger.d.ts.map +1 -0
  36. package/dist/graph/types.d.ts +2 -0
  37. package/dist/graph/types.d.ts.map +1 -1
  38. package/dist/graph/validate.d.ts.map +1 -1
  39. package/dist/index.d.ts +52 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +2452 -279
  42. package/dist/local/registry.d.ts.map +1 -1
  43. package/dist/memory/types.d.ts +2 -2
  44. package/dist/orchestrator/graphFacade.d.ts +39 -0
  45. package/dist/orchestrator/graphFacade.d.ts.map +1 -0
  46. package/dist/orchestrator/graphIngress.d.ts +136 -0
  47. package/dist/orchestrator/graphIngress.d.ts.map +1 -0
  48. package/dist/orchestrator/graphShadow.d.ts +121 -0
  49. package/dist/orchestrator/graphShadow.d.ts.map +1 -0
  50. package/dist/orchestrator/ledger.d.ts +11 -30
  51. package/dist/orchestrator/ledger.d.ts.map +1 -1
  52. package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
  53. package/dist/orchestrator/roles.d.ts +3 -3
  54. package/dist/orchestrator/sddCompiler.d.ts +31 -3
  55. package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
  56. package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
  57. package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
  58. package/dist/plugin/graphShadowIngress.d.ts +165 -0
  59. package/dist/plugin/graphShadowIngress.d.ts.map +1 -0
  60. package/dist/plugin/graphTool.d.ts +63 -0
  61. package/dist/plugin/graphTool.d.ts.map +1 -0
  62. package/dist/plugin/hooks.d.ts +6 -0
  63. package/dist/plugin/hooks.d.ts.map +1 -1
  64. package/dist/plugin/legacyRunProducer.d.ts +60 -0
  65. package/dist/plugin/legacyRunProducer.d.ts.map +1 -0
  66. package/dist/plugin/reportRunSchema.d.ts +60 -0
  67. package/dist/plugin/reportRunSchema.d.ts.map +1 -0
  68. package/dist/plugin/sessionTracker.d.ts +42 -0
  69. package/dist/plugin/sessionTracker.d.ts.map +1 -0
  70. package/dist/plugin/shadowPipeline.d.ts +49 -0
  71. package/dist/plugin/shadowPipeline.d.ts.map +1 -0
  72. package/dist/plugin/soakObserver.d.ts +73 -0
  73. package/dist/plugin/soakObserver.d.ts.map +1 -0
  74. package/dist/storage/graph/codec.d.ts.map +1 -1
  75. package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +1 -1
  76. package/dist/storage/graph/migration.d.ts +91 -0
  77. package/dist/storage/graph/migration.d.ts.map +1 -0
  78. package/dist/storage/graph/provider.d.ts +1 -0
  79. package/dist/storage/graph/provider.d.ts.map +1 -1
  80. package/dist/storage/graph/recovery.d.ts.map +1 -1
  81. package/dist/storage/graph/runRegistry.d.ts.map +1 -1
  82. package/dist/storage/graph/soakRecorder.d.ts +59 -0
  83. package/dist/storage/graph/soakRecorder.d.ts.map +1 -0
  84. package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
  85. package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
  86. package/dist/storage/graph/writer.d.ts +15 -0
  87. package/dist/storage/graph/writer.d.ts.map +1 -1
  88. package/dist/storage/path.d.ts.map +1 -1
  89. package/dist/telemetry/events.d.ts +12 -12
  90. package/dist/telemetry/graphRuntimeHealth.d.ts +53 -0
  91. package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -0
  92. package/dist/telemetry/graphView.d.ts +1 -0
  93. package/dist/telemetry/graphView.d.ts.map +1 -1
  94. package/dist/telemetry/types.d.ts +4 -4
  95. package/package.json +7 -5
  96. package/dist/orchestrator/sdd.d.ts +0 -126
  97. package/dist/orchestrator/sdd.d.ts.map +0 -1
@@ -0,0 +1,91 @@
1
+ import { z } from "zod";
2
+ import { type LegacyImportPlan, type LegacyImportRecordV1 } from "./importLegacy";
3
+ /**
4
+ * Herramienta de migración completa: dry-run, backup, apply idempotente y
5
+ * rollback drill (GE-053).
6
+ *
7
+ * Amplía el import terminal de GE-024 con:
8
+ * - **Backup versionado**: captura la autoridad pre-migración como artefacto
9
+ * reference-only. Solo contiene campos allow-listed (identifiers + digests),
10
+ * nunca briefs ni contenido crudo. Validado con Zod en el boundary de carga.
11
+ * - **Rollback idempotente**: restaura la autoridad desde un backup sin
12
+ * resucitar nada que no estuviera en él. Aplicar dos veces deja el mismo
13
+ * estado.
14
+ * - **Guard de efectos activos**: si hay runs con efectos in-flight, la
15
+ * migración se bloquea con motivo estable; la autoridad activa nunca
16
+ * retrocede al path legacy.
17
+ * - **Manejo de interrupción**: un apply interrumpido deja la autoridad en un
18
+ * estado parcial que un rerun puede completar (gracias a la idempotencia de
19
+ * `planLegacyImport`); nunca se genera autoridad tornada.
20
+ *
21
+ * Puro y determinista: sin I/O, reloj ni random. El caller (wiring layer)
22
+ * ejecuta la persistencia.
23
+ */
24
+ export declare const MIGRATION_BACKUP_VERSION: 1;
25
+ /** Schema Zod del backup: validado en el boundary de carga. */
26
+ export declare const MigrationBackupSchema: z.ZodObject<{
27
+ version: z.ZodLiteral<1>;
28
+ createdAt: z.ZodString;
29
+ authorityDigest: z.ZodString;
30
+ records: z.ZodArray<z.ZodObject<{
31
+ version: z.ZodLiteral<1>;
32
+ runID: z.ZodString;
33
+ taskID: z.ZodString;
34
+ status: z.ZodEnum<{
35
+ completed: "completed";
36
+ failed: "failed";
37
+ }>;
38
+ sourceDigest: z.ZodString;
39
+ specDigest: z.ZodString;
40
+ }, z.core.$strip>>;
41
+ }, z.core.$strip>;
42
+ export type MigrationBackup = z.infer<typeof MigrationBackupSchema>;
43
+ /** Código de fallo clasificado de la migración. */
44
+ export type MigrationToolErrorCode = "corrupt-ledger" | "unknown-version" | "active-effects-in-flight" | "backup-validation-failed" | "backup-digest-mismatch";
45
+ /** Error tipado, fail-closed, de la herramienta de migración. */
46
+ export declare class MigrationToolError extends Error {
47
+ readonly code: MigrationToolErrorCode;
48
+ constructor(code: MigrationToolErrorCode, detail?: string);
49
+ }
50
+ /** Plan extendido de migración con bloqueo y no-op tracking. */
51
+ export type MigrationPlan = {
52
+ /** Plan de import subyacente (vacío en no-op o bloqueado). */
53
+ readonly importPlan: LegacyImportPlan;
54
+ /** `true` cuando no hay nada que importar. */
55
+ readonly isNoOp: boolean;
56
+ /** Motivo de bloqueo, si lo hay. */
57
+ readonly blocked: string | undefined;
58
+ };
59
+ /** Opciones para planificar una migración. */
60
+ export type PlanMigrationInput = {
61
+ /** Contenido crudo del ledger (texto completo). */
62
+ readonly ledgerText: string | undefined;
63
+ /** IDs de runs ya importados en la autoridad actual. */
64
+ readonly existingRunIDs: Iterable<string>;
65
+ /** `true` si hay efectos activos (no terminales) en vuelo. */
66
+ readonly hasActiveEffects: boolean;
67
+ };
68
+ /**
69
+ * Planifica la migración. Fail-closed: un ledger ilegible o efectos activos
70
+ * bloquean la migración con un error clasificado.
71
+ */
72
+ export declare function planMigration(input: PlanMigrationInput): MigrationPlan;
73
+ /**
74
+ * Crea un backup reference-only de la autoridad actual. Lanza `RedactionError`
75
+ * si algún registro transporta contenido crudo (nunca debería pasar; es un
76
+ * guard defensivo).
77
+ */
78
+ export declare function createMigrationBackup(authority: readonly LegacyImportRecordV1[], timestamp: string): MigrationBackup;
79
+ /**
80
+ * Valida un backup cargado del disco. Fail-closed: un backup de versión
81
+ * desconocida o malformado lanza `MigrationToolError`.
82
+ */
83
+ export declare function validateBackup(raw: unknown): MigrationBackup;
84
+ /**
85
+ * Restaura la autoridad desde un backup validado. Idempotente: aplicar dos
86
+ * veces deja el mismo estado. No resucita nada que no estuviera en el backup.
87
+ */
88
+ export declare function rollbackFromBackup(backup: MigrationBackup): readonly LegacyImportRecordV1[];
89
+ /** Digest estable de la autoridad completa (para integridad del backup). */
90
+ export declare function computeAuthorityDigest(records: readonly LegacyImportRecordV1[]): string;
91
+ //# sourceMappingURL=migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/migration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAE1B,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;;;;;;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GG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,CA+B5D;AAMD;;;GAGG;AAEH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,GACtB,SAAS,oBAAoB,EAAE,CAYjC;AAMD,4EAA4E;AAC5E,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GACvC,MAAM,CAaR"}
@@ -33,6 +33,7 @@ export type GraphJournalHandle = {
33
33
  /** Resultado de `load`: spec, eventos y estado reducido reproducido. */
34
34
  export type LoadedJournal = {
35
35
  spec: GraphSpecV1;
36
+ /** Ordenados por seq (invariante append-only). */
36
37
  events: GraphEventV1[];
37
38
  state: GraphState;
38
39
  };
@@ -1 +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,E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AE,MAAM,EAKlD;CACF;AAED,gFAAgF;AAChF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,MAAM,GACX,gBAAgB,CAwBlB"}
@@ -1 +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"}
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;IAExB,YAAY,MAAM,EAAE,MAAM,EAIzB;CACF;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,59 @@
1
+ import { type SoakDuplicateEffectPair, type SoakModelVerificationPair, type SoakObservation, type SoakPlatform, type SoakPrivacyPair } from "../../graph/soakLedger";
2
+ /**
3
+ * **Grabador de observaciones soak** (GE-055a).
4
+ *
5
+ * Frontera de I/O: lectura/escritura de cadenas JSONL por grabador con
6
+ * puertos inyectados (filesystem y reloj). Determinista dados los mismos
7
+ * inputs — testable al 100% sin acceso real a disco.
8
+ */
9
+ /** Puerto de filesystem mínimo para leer/escribir cadenas. */
10
+ export type FsPort = {
11
+ readonly readFile: (path: string) => Promise<string>;
12
+ readonly writeFile: (path: string, content: string) => Promise<void>;
13
+ readonly exists: (path: string) => Promise<boolean>;
14
+ readonly readDir: (path: string) => Promise<readonly string[]>;
15
+ readonly mkdir: (path: string) => Promise<void>;
16
+ };
17
+ /** Puerto de reloj para timestamps. */
18
+ export type ClockPort = {
19
+ readonly now: () => string;
20
+ };
21
+ /** Puerto de generación de ID. */
22
+ export type IdPort = {
23
+ readonly randomUUID: () => string;
24
+ };
25
+ /** Puertos combinados para el grabador. */
26
+ export type RecorderPorts = {
27
+ readonly fs: FsPort;
28
+ readonly clock: ClockPort;
29
+ readonly id: IdPort;
30
+ };
31
+ /**
32
+ * Obtiene o genera el ID del grabador local. El ID es un UUID aleatorio
33
+ * almacenado en `{basePath}/soak-recorder-id`. No se deriva de hostname,
34
+ * username ni ningún dato identificativo.
35
+ */
36
+ export declare function ensureRecorderId(ports: RecorderPorts, basePath: string): Promise<string>;
37
+ /**
38
+ * Lee todas las cadenas de observación del directorio de evidencia.
39
+ * Cada fichero `*.jsonl` se lee como una cadena independiente.
40
+ */
41
+ export declare function readAllChains(ports: RecorderPorts, evidenceDir: string): Promise<SoakObservation[][]>;
42
+ /** Datos de entrada para una nueva observación (sin campos derivados). */
43
+ export type ObservationInput = {
44
+ readonly platform: SoakPlatform;
45
+ readonly opencodeVersion: string;
46
+ readonly provenance: "genuine-usage" | "ci-synthetic";
47
+ readonly traceDigest: string;
48
+ readonly criticalDivergences: number | null;
49
+ readonly privacy: SoakPrivacyPair | null;
50
+ readonly duplicateEffects: SoakDuplicateEffectPair | null;
51
+ readonly modelVerification: SoakModelVerificationPair | null;
52
+ };
53
+ /**
54
+ * Añade una observación a la cadena del grabador local. Calcula seq,
55
+ * timestamp y chainDigest automáticamente. Ejecuta assertReferenceOnly
56
+ * antes de persistir.
57
+ */
58
+ export declare function appendObservation(ports: RecorderPorts, evidenceDir: string, recorderId: string, input: ObservationInput): Promise<SoakObservation>;
59
+ //# sourceMappingURL=soakRecorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"soakRecorder.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/soakRecorder.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,yBAAyB,EAC9B,KAAK,eAAe,EAEpB,KAAK,YAAY,EACjB,KAAK,eAAe,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;GAMG;AAMH,8DAA8D;AAC9D,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpD,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,MAAM,EAAE,CAAC,CAAC;IAC/D,QAAQ,CAAC,KAAK,EAAE,CAAC,IA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CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CA8ErE"}
1
+ {"version":3,"file":"worktreeRegistry.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/worktreeRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiCxB,QAAA,MAAM,aAAa;;;iBAGjB,CAAC;AAIH,sDAAsD;AACtD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE5D,8DAA8D;AAC9D,MAAM,MAAM,yBAAyB,GACjC,UAAU,GACV,aAAa,GACb,cAAc,GACd,SAAS,CAAC;AAEd,gEAAgE;AAChE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,IAAI,EAAE,yBAAyB,EAAE,MAAM,EAAE,MAAM,EAK1D;CACF;AAED,oEAAoE;AACpE,MAAM,WAAW,gBAAgB;IAC/B,uEAAuE;IACvE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACpE,iFAAiF;IACjF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACpD,oDAAoD;IACpD,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,sDAAsD;IACtD,IAAI,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;CACpC;AAaD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CA8ErE"}
@@ -17,4 +17,19 @@ export declare function appendDurable(file: string, content: string): void;
17
17
  export declare function readText(file: string): string | undefined;
18
18
  /** `true` si la ruta existe (fichero o directorio). */
19
19
  export declare function pathExists(path: string): boolean;
20
+ /**
21
+ * Canonicaliza una ruta con la forma **real** del sistema de ficheros: expande
22
+ * los alias 8.3 de Windows (`RUNNER~1` a `runneradmin`) y resuelve symlinks
23
+ * (`/var` a `/private/var` en macOS).
24
+ *
25
+ * `realpathSync.native` falla con `ENOENT` en rutas que aún no existen, así que
26
+ * se resuelve el **ancestro existente más profundo** y se re-anexa el resto sin
27
+ * canonicalizar. Eso permite canonicalizar el destino de un worktree antes de
28
+ * crearlo y seguir comparándolo con la ruta que git reporta después.
29
+ *
30
+ * El recorrido está acotado por la raíz de la propia ruta, que se trata fuera
31
+ * del bucle: es el único punto donde `dirname` deja de reducir. Nunca lanza; si
32
+ * ni la raíz resuelve, devuelve la ruta absoluta original.
33
+ */
34
+ export declare function realPathDeep(target: string): string;
20
35
  //# sourceMappingURL=writer.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/storage/graph/writer.ts"],"names":[],"mappings":"AAYA;;;;;;;;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;AAWD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAkBnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/storage/path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2EAA2E;AAC3E,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM;CAI5B;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkB1D;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGvD"}
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/storage/path.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,2EAA2E;AAC3E,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAkB1D;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAE7D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,oFAAoF;AACpF,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAGvD"}
@@ -20,14 +20,14 @@ export declare const RouteEventSchema: z.ZodObject<{
20
20
  promptHash: z.ZodString;
21
21
  promptChars: z.ZodNumber;
22
22
  tier: z.ZodEnum<{
23
- trivial: "trivial";
24
- simple: "simple";
25
- moderate: "moderate";
26
23
  hard: "hard";
24
+ moderate: "moderate";
25
+ simple: "simple";
26
+ trivial: "trivial";
27
27
  }>;
28
28
  routeKind: z.ZodEnum<{
29
- local: "local";
30
29
  frontier: "frontier";
30
+ local: "local";
31
31
  }>;
32
32
  selected: z.ZodObject<{
33
33
  providerID: z.ZodString;
@@ -108,10 +108,10 @@ export declare const ActivityEventSchema: z.ZodObject<{
108
108
  sessionID: z.ZodString;
109
109
  type: z.ZodLiteral<"activity">;
110
110
  kind: z.ZodEnum<{
111
- route: "route";
112
111
  agent: "agent";
113
- decision: "decision";
114
112
  commit: "commit";
113
+ decision: "decision";
114
+ route: "route";
115
115
  }>;
116
116
  agent: z.ZodOptional<z.ZodString>;
117
117
  summary: z.ZodString;
@@ -141,14 +141,14 @@ export declare const OpenTeamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
141
141
  promptHash: z.ZodString;
142
142
  promptChars: z.ZodNumber;
143
143
  tier: z.ZodEnum<{
144
- trivial: "trivial";
145
- simple: "simple";
146
- moderate: "moderate";
147
144
  hard: "hard";
145
+ moderate: "moderate";
146
+ simple: "simple";
147
+ trivial: "trivial";
148
148
  }>;
149
149
  routeKind: z.ZodEnum<{
150
- local: "local";
151
150
  frontier: "frontier";
151
+ local: "local";
152
152
  }>;
153
153
  selected: z.ZodObject<{
154
154
  providerID: z.ZodString;
@@ -219,10 +219,10 @@ export declare const OpenTeamEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
219
219
  sessionID: z.ZodString;
220
220
  type: z.ZodLiteral<"activity">;
221
221
  kind: z.ZodEnum<{
222
- route: "route";
223
222
  agent: "agent";
224
- decision: "decision";
225
223
  commit: "commit";
224
+ decision: "decision";
225
+ route: "route";
226
226
  }>;
227
227
  agent: z.ZodOptional<z.ZodString>;
228
228
  summary: z.ZodString;
@@ -0,0 +1,53 @@
1
+ import type { GraphEventV1 } from "../graph/schema";
2
+ import type { GraphJournalHealth } from "../graph/types";
3
+ import type { WorktreeReconcileReport } from "../orchestrator/worktreeReconciler";
4
+ import type { LeaseRecord } from "../storage/graph/workspaceLease";
5
+ import type { GraphViewHealth } from "./graphView";
6
+ /**
7
+ * Productor puro de métricas de runtime-health del grafo (GE-052).
8
+ *
9
+ * Pliega una lista de eventos de journal, el estado del journal, el lease, el
10
+ * informe de worktrees y el kill switch en un `GraphViewHealth` que el web
11
+ * viewer ya consume (GE-084) pero que hasta ahora carecía de productor real.
12
+ *
13
+ * Semántica de cada métrica:
14
+ * - `unknownEffects`: `node.dispatched` cuyo `attemptID` no tiene un evento
15
+ * terminal (`node.succeeded`/`node.failed`/`node.cancelled`) con el mismo
16
+ * `attemptID`. Deduplicado: repetir el mismo evento no duplica la cuenta.
17
+ * - `staleCompletions`: evento terminal de nodo cuyo `attemptID` aparece
18
+ * *después* del evento terminal de run (`run.completed`/`run.failed`/
19
+ * `run.cancelled`). Acotado como contador para utilidad del operador.
20
+ * - `recoveryRequired`: `journal === "corrupt" || unknownEffects > 0`.
21
+ * - `conflicts`: lease activo no propio (holder ≠ input.holder) +
22
+ * `worktrees.blocked`.
23
+ * - `killSwitch`: passthrough del config.
24
+ *
25
+ * Invariantes:
26
+ * - **Puro y determinista**: sin I/O, reloj, random, env ni logs.
27
+ * - **Idempotente**: plegar la misma lista con duplicados produce la misma
28
+ * salida.
29
+ * - **Reference-only**: solo booleanos y contadores acotados; el guard
30
+ * `assertReferenceOnly` rechaza cualquier campo crudo.
31
+ * - **Sin autoridad**: no decide, concede ni muta nada.
32
+ */
33
+ /** Entradas para el cómputo de salud de runtime. */
34
+ export type GraphRuntimeHealthInput = {
35
+ readonly events: readonly GraphEventV1[];
36
+ readonly journal: GraphJournalHealth;
37
+ readonly lease: LeaseRecord | undefined;
38
+ readonly holder: string;
39
+ readonly worktrees?: WorktreeReconcileReport;
40
+ readonly killSwitch: boolean;
41
+ };
42
+ /**
43
+ * Predicado compartido: determina si se requiere recuperación.
44
+ * Extraído para que el CLI (`renderGraphStatus`) y la web health banner
45
+ * compartan la misma lógica sin duplicación.
46
+ */
47
+ export declare function isRecoveryRequired(journal: GraphJournalHealth, unknownEffects: number): boolean;
48
+ /**
49
+ * Computa las métricas de runtime-health a partir de fuentes allow-listed.
50
+ * Idempotente y reference-only; el guard final lo garantiza.
51
+ */
52
+ export declare function computeGraphRuntimeHealth(input: GraphRuntimeHealthInput): GraphViewHealth;
53
+ //# sourceMappingURL=graphRuntimeHealth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphRuntimeHealth.d.ts","sourceRoot":"","sources":["../../src/telemetry/graphRuntimeHealth.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,oDAAoD;AACpD,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,uBAAuB,CAAC;IAC7C,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;CAC9B,CAAC;AAgBF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,kBAAkB,EAC3B,cAAc,EAAE,MAAM,GACrB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,uBAAuB,GAC7B,eAAe,CAwDjB"}
@@ -47,6 +47,7 @@ export type GraphViewEdge = {
47
47
  export type GraphViewHealth = {
48
48
  readonly recoveryRequired: boolean;
49
49
  readonly unknownEffects: number;
50
+ readonly staleCompletions: number;
50
51
  readonly conflicts: number;
51
52
  readonly killSwitch: boolean;
52
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"graphView.d.ts","sourceRoot":"","sources":["../../src/telemetry/graphView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9D;;;;;;;;;;;GAWG;AAEH,mFAAmF;AACnF,MAAM,MAAM,kBAAkB,GAC1B,SAAS,GACT,OAAO,GACP,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,WAAW,CAAC;AAEhB,0CAA0C;AAC1C,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,cAAc,CAAC;AAErE,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC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,aAAa,EAAE,CAAC;IACzC,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;CAClC,CAAC;AAEF,mFAAmF;AACnF,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD,CAAC;AA8FF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,cAAc,GAAG,qBAAqB,CAgB3E"}
@@ -5,14 +5,14 @@ export declare const CostRecordSchema: z.ZodObject<{
5
5
  promptHash: z.ZodString;
6
6
  promptChars: z.ZodNumber;
7
7
  tier: z.ZodEnum<{
8
- trivial: "trivial";
9
- simple: "simple";
10
- moderate: "moderate";
11
8
  hard: "hard";
9
+ moderate: "moderate";
10
+ simple: "simple";
11
+ trivial: "trivial";
12
12
  }>;
13
13
  routeKind: z.ZodEnum<{
14
- local: "local";
15
14
  frontier: "frontier";
15
+ local: "local";
16
16
  }>;
17
17
  selected: z.ZodObject<{
18
18
  providerID: z.ZodString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmanuelcorral/openteam",
3
- "version": "0.1.42",
3
+ "version": "0.2.1",
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",
@@ -66,6 +66,8 @@
66
66
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
67
67
  "test": "bun test",
68
68
  "test:cov": "bun test --coverage",
69
+ "certify:shadow": "bun test tests/certification/graph-shadow.test.ts",
70
+ "certify:release": "bun test tests/certification/graph-release.test.ts",
69
71
  "coverage:check": "node scripts/check-coverage.mjs",
70
72
  "typecheck": "tsc --noEmit",
71
73
  "lint": "biome check .",
@@ -80,13 +82,13 @@
80
82
  },
81
83
  "dependencies": {
82
84
  "@clack/prompts": "1.7.0",
83
- "@opencode-ai/plugin": "1.17.13",
84
- "@opencode-ai/sdk": "1.17.13",
85
+ "@opencode-ai/plugin": "1.18.18",
86
+ "@opencode-ai/sdk": "1.18.18",
85
87
  "zod": "4.4.3"
86
88
  },
87
89
  "devDependencies": {
88
- "@biomejs/biome": "2.5.2",
90
+ "@biomejs/biome": "2.5.9",
89
91
  "@types/bun": "1.3.14",
90
- "typescript": "6.0.3"
92
+ "typescript": "7.0.2"
91
93
  }
92
94
  }
@@ -1,126 +0,0 @@
1
- import type { OpenTeamConfig } from "../config/schema";
2
- import { type ArtifactManifest, type ContextRef, type PrivacyClass } from "../context/schema";
3
- import type { TaskSignals } from "../router/types";
4
- import type { StorageProvider } from "../storage/provider";
5
- import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
6
- /**
7
- * Loop de **subagent-driven-development** (SDD), adaptado de obra/superpowers al
8
- * boundary de openteam. Por cada tarea:
9
- *
10
- * 1. Reanuda desde el ledger: si la tarea ya está `complete`, la salta.
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).
15
- * 3. Despacha el **implementer** con el brief.
16
- * 4. Despacha el **reviewer** (rol con alto code-quality) para revisar el
17
- * cambio; la generación del diff vive en el propio agente reviewer.
18
- * 5. Si el veredicto pide arreglos, despacha **UN** fix subagent con TODOS los
19
- * findings (no uno por finding), con un número de rondas acotado.
20
- * 6. Escribe el resultado en el ledger durable.
21
- *
22
- * Es una capa de orquestación **inyectable y determinista**: cliente opencode,
23
- * storage, reloj, generadores de id y el intérprete de review se inyectan, así
24
- * que se prueba con fakes/memory provider. No hace I/O de git ni shell: los
25
- * artefactos persistidos son metadatos **redactados** (nunca prompts ni la
26
- * respuesta cruda del modelo).
27
- */
28
- /** Directorio de artefactos del loop SDD (estado derivado). */
29
- export declare const DEFAULT_SDD_WORKSPACE_DIR = ".opencode/openteam/sdd";
30
- /** Rol reviewer por defecto. */
31
- export declare const DEFAULT_REVIEWER_ROLE_ID = "reviewer";
32
- export type SddTask = {
33
- /** Id estable y sin `:` (kebab-case) usado para ledger y artefactos. */
34
- id: string;
35
- /** Rol que implementa (y arregla) la tarea. */
36
- implementerRoleID: string;
37
- /** Título humano corto. */
38
- title: string;
39
- /** Brief accionable de la tarea (cuerpo del prompt del implementer). */
40
- brief: string;
41
- /** Señales de routing para la tarea. */
42
- task: TaskSignals;
43
- /** Rol reviewer específico (sobreescribe `deps.reviewerRoleID`). */
44
- reviewerRoleID?: string;
45
- };
46
- export type ReviewVerdict = {
47
- needsFix: boolean;
48
- /** Resumen redactado de findings para el fix dispatch. */
49
- findings?: string;
50
- };
51
- export type SddDeps = CoordinatorDeps & {
52
- storage: StorageProvider;
53
- config: OpenTeamConfig;
54
- workspaceDir?: string;
55
- ledgerPath?: string;
56
- reviewerRoleID?: string;
57
- interpretReview?: (review: RoleTaskResult) => ReviewVerdict;
58
- /** Máximo de rondas de fix+re-review (def: 1). */
59
- maxFixRounds?: number;
60
- parentSessionID?: string;
61
- directory?: string;
62
- };
63
- export type SddTaskStatus = "complete" | "failed" | "skipped";
64
- export type SddTaskOutcome = {
65
- taskID: string;
66
- status: SddTaskStatus;
67
- implement?: RoleTaskResult;
68
- review?: RoleTaskResult;
69
- fixes: RoleTaskResult[];
70
- };
71
- export type SddPlanResult = {
72
- outcomes: SddTaskOutcome[];
73
- completed: string[];
74
- failed: string[];
75
- skipped: string[];
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;
110
- /** Extrae texto de una respuesta opaca del modelo (best-effort). Puro. */
111
- export declare function extractResponseText(response: unknown): string;
112
- /**
113
- * Veredicto por defecto: escanea el texto de la review en busca de marcadores de
114
- * severidad. Conservador y determinista; los llamadores pueden inyectar su
115
- * propio intérprete vía `deps.interpretReview`.
116
- */
117
- export declare function defaultReviewVerdict(review: RoleTaskResult): ReviewVerdict;
118
- /** Ejecuta una única tarea del loop SDD (con reanudación desde el ledger). */
119
- export declare function runSddTask(task: SddTask, deps: SddDeps): Promise<SddTaskOutcome>;
120
- /**
121
- * Ejecuta un plan SDD **en orden** (las tareas son secuenciales por diseño; la
122
- * paralelización de tareas independientes es otra capa). Reanuda saltando las ya
123
- * completas y resume el resultado por estado.
124
- */
125
- export declare function runSddPlan(tasks: readonly SddTask[], deps: SddDeps): Promise<SddPlanResult>;
126
- //# sourceMappingURL=sdd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdd.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sdd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AASvB;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAElE,gCAAgC;AAChC,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,MAAM,MAAM,OAAO,GAAG;IACpB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,+CAA+C;IAC/C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,EAAE,WAAW,CAAC;IAClB,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,eAAe,GAAG;IACtC,OAAO,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,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