@jmanuelcorral/openteam 0.2.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.opencode/command/openteam.md +2 -1
- package/.opencode/openteam.example.json +27 -8
- package/AGENTS.md +5 -2
- package/README.es.md +155 -59
- package/README.md +418 -62
- package/dist/capabilities/types.d.ts +3 -3
- package/dist/capabilities/types.d.ts.map +1 -1
- package/dist/classifier/localClassifier.d.ts +0 -2
- package/dist/classifier/localClassifier.d.ts.map +1 -1
- package/dist/cli/consoleServe.d.ts +30 -1
- package/dist/cli/consoleServe.d.ts.map +1 -1
- package/dist/cli/graphOperator.d.ts +22 -0
- package/dist/cli/graphOperator.d.ts.map +1 -0
- package/dist/cli/graphStatusSnapshot.d.ts +16 -0
- package/dist/cli/graphStatusSnapshot.d.ts.map +1 -0
- package/dist/cli/graphViewProvider.d.ts +30 -0
- package/dist/cli/graphViewProvider.d.ts.map +1 -0
- package/dist/cli/migrateAdapter.d.ts +12 -0
- package/dist/cli/migrateAdapter.d.ts.map +1 -0
- package/dist/cli/purgeAdapter.d.ts +10 -0
- package/dist/cli/purgeAdapter.d.ts.map +1 -0
- package/dist/cli/setupAdapters.d.ts.map +1 -1
- package/dist/cli.js +13480 -5176
- package/dist/commands/agents.d.ts +102 -2
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/baseline.d.ts.map +1 -1
- package/dist/commands/clearCache.d.ts +23 -0
- package/dist/commands/clearCache.d.ts.map +1 -0
- package/dist/commands/dispatch.d.ts +197 -4
- package/dist/commands/dispatch.d.ts.map +1 -1
- package/dist/commands/doctor.d.ts +40 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/frontierCatalog.d.ts +8 -14
- package/dist/commands/frontierCatalog.d.ts.map +1 -1
- package/dist/commands/graph.d.ts +0 -27
- package/dist/commands/graph.d.ts.map +1 -1
- package/dist/commands/local.d.ts.map +1 -1
- package/dist/commands/migrate.d.ts +11 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/purge.d.ts +132 -0
- package/dist/commands/purge.d.ts.map +1 -0
- package/dist/commands/report.d.ts +1 -0
- package/dist/commands/report.d.ts.map +1 -1
- package/dist/commands/setup.d.ts +62 -5
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/config/errors.d.ts +10 -0
- package/dist/config/errors.d.ts.map +1 -0
- package/dist/config/legacyMigration.d.ts +82 -0
- package/dist/config/legacyMigration.d.ts.map +1 -0
- package/dist/config/legacyPaths.d.ts +105 -0
- package/dist/config/legacyPaths.d.ts.map +1 -0
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/opencode.d.ts +63 -0
- package/dist/config/opencode.d.ts.map +1 -0
- package/dist/config/persist.d.ts +8 -0
- package/dist/config/persist.d.ts.map +1 -1
- package/dist/config/resolve.d.ts +1 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/runtime.d.ts +62 -0
- package/dist/config/runtime.d.ts.map +1 -0
- package/dist/config/schema.d.ts +145 -77
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/console/assets.d.ts +2 -2
- package/dist/console/assets.d.ts.map +1 -1
- package/dist/console/configView.d.ts +74 -0
- package/dist/console/configView.d.ts.map +1 -0
- package/dist/console/opencodeClient.d.ts +8 -6
- package/dist/console/opencodeClient.d.ts.map +1 -1
- package/dist/console/protocol.d.ts +30 -6
- package/dist/console/protocol.d.ts.map +1 -1
- package/dist/console/render.d.ts +30 -1
- package/dist/console/render.d.ts.map +1 -1
- package/dist/console/types.d.ts +1 -1
- package/dist/console/types.d.ts.map +1 -1
- package/dist/context/redaction.d.ts +27 -19
- package/dist/context/redaction.d.ts.map +1 -1
- package/dist/context/schema.d.ts +26 -26
- package/dist/context/schema.d.ts.map +1 -1
- package/dist/context/types.d.ts +3 -3
- package/dist/contract/opencode.d.ts +39 -23
- package/dist/contract/opencode.d.ts.map +1 -1
- package/dist/graph/certificate.d.ts +37 -16
- package/dist/graph/certificate.d.ts.map +1 -1
- package/dist/graph/langgraph/adapter.d.ts +56 -0
- package/dist/graph/langgraph/adapter.d.ts.map +1 -0
- package/dist/graph/langgraph/certification.d.ts +64 -0
- package/dist/graph/langgraph/certification.d.ts.map +1 -0
- package/dist/graph/langgraph/checkpointReplay.d.ts +49 -0
- package/dist/graph/langgraph/checkpointReplay.d.ts.map +1 -0
- package/dist/graph/langgraph/checkpointer.d.ts +49 -0
- package/dist/graph/langgraph/checkpointer.d.ts.map +1 -0
- package/dist/graph/langgraph/engine.d.ts +34 -0
- package/dist/graph/langgraph/engine.d.ts.map +1 -0
- package/dist/graph/langgraph/graphModel.d.ts +37 -0
- package/dist/graph/langgraph/graphModel.d.ts.map +1 -0
- package/dist/graph/langgraph/reducer.d.ts +18 -0
- package/dist/graph/langgraph/reducer.d.ts.map +1 -0
- package/dist/graph/langgraph/retirement.d.ts +59 -0
- package/dist/graph/langgraph/retirement.d.ts.map +1 -0
- package/dist/graph/langgraph/types.d.ts +65 -0
- package/dist/graph/langgraph/types.d.ts.map +1 -0
- package/dist/graph/privacyPolicy.d.ts +7 -0
- package/dist/graph/privacyPolicy.d.ts.map +1 -1
- package/dist/graph/soakLedger.d.ts.map +1 -1
- package/dist/graph/types.d.ts +0 -2
- package/dist/graph/types.d.ts.map +1 -1
- package/dist/index.d.ts +48 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11596 -4180
- package/dist/local/cacheAdapter.d.ts +7 -0
- package/dist/local/cacheAdapter.d.ts.map +1 -0
- package/dist/local/concurrency.d.ts +52 -0
- package/dist/local/concurrency.d.ts.map +1 -0
- package/dist/local/embeddings.d.ts +10 -10
- package/dist/local/embeddings.d.ts.map +1 -1
- package/dist/local/extractClient.d.ts +13 -10
- package/dist/local/extractClient.d.ts.map +1 -1
- package/dist/local/lemonade.d.ts +4 -0
- package/dist/local/lemonade.d.ts.map +1 -0
- package/dist/local/registry.d.ts +16 -0
- package/dist/local/registry.d.ts.map +1 -1
- package/dist/local/types.d.ts +1 -1
- package/dist/local/types.d.ts.map +1 -1
- package/dist/mcp/semanticRecall.d.ts +18 -1
- package/dist/mcp/semanticRecall.d.ts.map +1 -1
- package/dist/mcp/server.d.ts +41 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/memory/embedText.d.ts +4 -0
- package/dist/memory/embedText.d.ts.map +1 -0
- package/dist/memory/extract.d.ts +33 -18
- package/dist/memory/extract.d.ts.map +1 -1
- package/dist/memory/fold.d.ts +3 -2
- package/dist/memory/fold.d.ts.map +1 -1
- package/dist/memory/index.d.ts +1 -0
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/inject.d.ts.map +1 -1
- package/dist/memory/log.d.ts +15 -4
- package/dist/memory/log.d.ts.map +1 -1
- package/dist/memory/merge.d.ts +18 -1
- package/dist/memory/merge.d.ts.map +1 -1
- package/dist/memory/traverse.d.ts +80 -0
- package/dist/memory/traverse.d.ts.map +1 -0
- package/dist/memory/types.d.ts +53 -7
- package/dist/memory/types.d.ts.map +1 -1
- package/dist/messages/commands.d.ts +84 -0
- package/dist/messages/commands.d.ts.map +1 -0
- package/dist/messages/index.d.ts +46 -0
- package/dist/messages/index.d.ts.map +1 -0
- package/dist/opencodeArtifacts/index.d.ts +33 -0
- package/dist/opencodeArtifacts/index.d.ts.map +1 -0
- package/dist/opencodeArtifacts/orchestratorAgent.d.ts +29 -0
- package/dist/opencodeArtifacts/orchestratorAgent.d.ts.map +1 -0
- package/dist/opencodeArtifacts/slashCommand.d.ts +31 -0
- package/dist/opencodeArtifacts/slashCommand.d.ts.map +1 -0
- package/dist/orchestrator/coordinator.d.ts +188 -2
- package/dist/orchestrator/coordinator.d.ts.map +1 -1
- package/dist/orchestrator/graphCancellation.d.ts +40 -37
- package/dist/orchestrator/graphCancellation.d.ts.map +1 -1
- package/dist/orchestrator/graphEffects.d.ts +24 -24
- package/dist/orchestrator/graphEffects.d.ts.map +1 -1
- package/dist/orchestrator/graphFacade.d.ts +16 -16
- package/dist/orchestrator/graphFacade.d.ts.map +1 -1
- package/dist/orchestrator/graphIngress.d.ts +49 -45
- package/dist/orchestrator/graphIngress.d.ts.map +1 -1
- package/dist/orchestrator/graphReview.d.ts +24 -23
- package/dist/orchestrator/graphReview.d.ts.map +1 -1
- package/dist/orchestrator/graphRuntime.d.ts +27 -26
- package/dist/orchestrator/graphRuntime.d.ts.map +1 -1
- package/dist/orchestrator/graphShadow.d.ts +70 -69
- package/dist/orchestrator/graphShadow.d.ts.map +1 -1
- package/dist/orchestrator/opencodeSessionAdapter.d.ts +25 -25
- package/dist/orchestrator/opencodeSessionAdapter.d.ts.map +1 -1
- package/dist/orchestrator/permissions.d.ts.map +1 -1
- package/dist/orchestrator/ralphLoop.d.ts +57 -0
- package/dist/orchestrator/ralphLoop.d.ts.map +1 -0
- package/dist/orchestrator/roles.d.ts +50 -8
- package/dist/orchestrator/roles.d.ts.map +1 -1
- package/dist/orchestrator/roster.d.ts +103 -0
- package/dist/orchestrator/roster.d.ts.map +1 -0
- package/dist/orchestrator/rosterPersistence.d.ts +22 -0
- package/dist/orchestrator/rosterPersistence.d.ts.map +1 -0
- package/dist/orchestrator/runtimeSelection.d.ts +46 -0
- package/dist/orchestrator/runtimeSelection.d.ts.map +1 -0
- package/dist/orchestrator/sddCompiler.d.ts +34 -34
- package/dist/orchestrator/sddCompiler.d.ts.map +1 -1
- package/dist/orchestrator/sessionReconciler.d.ts +31 -29
- package/dist/orchestrator/sessionReconciler.d.ts.map +1 -1
- package/dist/orchestrator/shadowComparator.d.ts +23 -23
- package/dist/orchestrator/shadowComparator.d.ts.map +1 -1
- package/dist/orchestrator/subsessions.d.ts.map +1 -1
- package/dist/orchestrator/worktreeAdapter.d.ts +12 -12
- package/dist/orchestrator/worktreeAdapter.d.ts.map +1 -1
- package/dist/orchestrator/worktreeDispatch.d.ts +34 -34
- package/dist/orchestrator/worktreeDispatch.d.ts.map +1 -1
- package/dist/orchestrator/worktreeReconciler.d.ts +37 -36
- package/dist/orchestrator/worktreeReconciler.d.ts.map +1 -1
- package/dist/plugin/availability.d.ts.map +1 -1
- package/dist/plugin/capture.d.ts +12 -12
- package/dist/plugin/capture.d.ts.map +1 -1
- package/dist/plugin/commandTool.d.ts +1 -1
- package/dist/plugin/commandTool.d.ts.map +1 -1
- package/dist/plugin/graphShadowIngress.d.ts +50 -48
- package/dist/plugin/graphShadowIngress.d.ts.map +1 -1
- package/dist/plugin/graphTool.d.ts +25 -23
- package/dist/plugin/graphTool.d.ts.map +1 -1
- package/dist/plugin/hooks.d.ts +10 -10
- package/dist/plugin/hooks.d.ts.map +1 -1
- package/dist/plugin/legacyRunProducer.d.ts +22 -22
- package/dist/plugin/legacyRunProducer.d.ts.map +1 -1
- package/dist/plugin/memoryInject.d.ts +6 -6
- package/dist/plugin/memoryInject.d.ts.map +1 -1
- package/dist/plugin/memoryTool.d.ts +36 -0
- package/dist/plugin/memoryTool.d.ts.map +1 -0
- package/dist/plugin/orchestrateTool.d.ts +230 -0
- package/dist/plugin/orchestrateTool.d.ts.map +1 -0
- package/dist/plugin/reportRunSchema.d.ts +8 -8
- package/dist/plugin/reportRunSchema.d.ts.map +1 -1
- package/dist/plugin/sessionTracker.d.ts +15 -15
- package/dist/plugin/sessionTracker.d.ts.map +1 -1
- package/dist/plugin/shadowPipeline.d.ts +2 -1
- package/dist/plugin/shadowPipeline.d.ts.map +1 -1
- package/dist/plugin/soakObserver.d.ts +18 -11
- package/dist/plugin/soakObserver.d.ts.map +1 -1
- package/dist/plugin/toolcalls.d.ts +3 -3
- package/dist/router/chooseModel.d.ts.map +1 -1
- package/dist/router/frontierBaseline.d.ts +3 -3
- package/dist/router/modelSelection.d.ts +12 -4
- package/dist/router/modelSelection.d.ts.map +1 -1
- package/dist/router/types.d.ts +6 -1
- package/dist/router/types.d.ts.map +1 -1
- package/dist/storage/graph/snapshot.d.ts.map +1 -1
- package/dist/storage/graph/soakRecorder.d.ts +14 -1
- package/dist/storage/graph/soakRecorder.d.ts.map +1 -1
- package/dist/storage/graph/workspaceLease.d.ts +1 -1
- package/dist/storage/graph/workspaceLease.d.ts.map +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts +1 -1
- package/dist/storage/graph/worktreeRegistry.d.ts.map +1 -1
- package/dist/storage/httpStorageProvider.d.ts +2 -2
- package/dist/storage/index/bunSqlite.d.ts +1 -0
- package/dist/storage/index/bunSqlite.d.ts.map +1 -1
- package/dist/storage/index/memoryConsolidate.d.ts +2 -0
- package/dist/storage/index/memoryConsolidate.d.ts.map +1 -1
- package/dist/storage/index/memoryEmbeddings.d.ts +51 -0
- package/dist/storage/index/memoryEmbeddings.d.ts.map +1 -0
- package/dist/storage/index/memoryIndex.d.ts +36 -4
- package/dist/storage/index/memoryIndex.d.ts.map +1 -1
- package/dist/storage/index/memoryRecall.d.ts +1 -1
- package/dist/storage/index/memoryRecall.d.ts.map +1 -1
- package/dist/storage/index/memoryRuntime.d.ts +2 -0
- package/dist/storage/index/memoryRuntime.d.ts.map +1 -1
- package/dist/storage/index/sqliteIndex.d.ts +18 -1
- package/dist/storage/index/sqliteIndex.d.ts.map +1 -1
- package/dist/storage/path.d.ts.map +1 -1
- package/dist/telemetry/aggregate.d.ts +12 -12
- package/dist/telemetry/aggregate.d.ts.map +1 -1
- package/dist/telemetry/cost.d.ts.map +1 -1
- package/dist/telemetry/decisions.d.ts +11 -11
- package/dist/telemetry/decisions.d.ts.map +1 -1
- package/dist/telemetry/eventLog.d.ts +41 -25
- package/dist/telemetry/eventLog.d.ts.map +1 -1
- package/dist/telemetry/events.d.ts +79 -34
- package/dist/telemetry/events.d.ts.map +1 -1
- package/dist/telemetry/fanout.d.ts +18 -0
- package/dist/telemetry/fanout.d.ts.map +1 -0
- package/dist/telemetry/graphProjection.d.ts +12 -12
- package/dist/telemetry/graphProjection.d.ts.map +1 -1
- package/dist/telemetry/graphRuntimeHealth.d.ts +26 -26
- package/dist/telemetry/graphRuntimeHealth.d.ts.map +1 -1
- package/dist/telemetry/graphView.d.ts +20 -20
- package/dist/telemetry/graphView.d.ts.map +1 -1
- package/dist/telemetry/otel.d.ts +86 -0
- package/dist/telemetry/otel.d.ts.map +1 -0
- package/dist/telemetry/otelConfig.d.ts +128 -0
- package/dist/telemetry/otelConfig.d.ts.map +1 -0
- package/dist/telemetry/otelExporter.d.ts +7 -0
- package/dist/telemetry/otelExporter.d.ts.map +1 -0
- package/dist/telemetry/read.d.ts +18 -4
- package/dist/telemetry/read.d.ts.map +1 -1
- package/dist/telemetry/types.d.ts +3 -2
- package/dist/telemetry/types.d.ts.map +1 -1
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/web/configApi.d.ts +154 -0
- package/dist/web/configApi.d.ts.map +1 -0
- package/dist/web/configRoute.d.ts +57 -0
- package/dist/web/configRoute.d.ts.map +1 -0
- package/dist/web/console.d.ts +8 -0
- package/dist/web/console.d.ts.map +1 -1
- package/dist/web/paths.d.ts +4 -3
- package/dist/web/paths.d.ts.map +1 -1
- package/dist/web/server.d.ts +30 -1
- package/dist/web/server.d.ts.map +1 -1
- package/dist/web/start.d.ts +15 -0
- package/dist/web/start.d.ts.map +1 -1
- package/dist/web/storageRoute.d.ts +2 -2
- package/package.json +13 -7
- package/dist/cli/tunnel.d.ts +0 -89
- package/dist/cli/tunnel.d.ts.map +0 -1
- package/dist/commands/orchestratorAgent.d.ts +0 -30
- package/dist/commands/orchestratorAgent.d.ts.map +0 -1
- package/dist/commands/slashCommand.d.ts +0 -39
- package/dist/commands/slashCommand.d.ts.map +0 -1
- package/dist/orchestrator/ledger.d.ts +0 -28
- package/dist/orchestrator/ledger.d.ts.map +0 -1
- package/dist/storage/graph/importLegacy.d.ts +0 -62
- package/dist/storage/graph/importLegacy.d.ts.map +0 -1
- package/dist/storage/graph/migrateLegacyBriefs.d.ts +0 -32
- package/dist/storage/graph/migrateLegacyBriefs.d.ts.map +0 -1
- package/dist/storage/graph/migration.d.ts +0 -91
- package/dist/storage/graph/migration.d.ts.map +0 -1
- package/dist/storage/graph/projections.d.ts +0 -31
- package/dist/storage/graph/projections.d.ts.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* GE-050 —
|
|
2
|
+
* GE-050 — active SDD ingress behind a gate closed by default.
|
|
3
3
|
*
|
|
4
|
-
* R1
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* capability
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
4
|
+
* R1 delivers the production entry point that the active runtime never had and
|
|
5
|
+
* leaves it **unreachable**. The central property is that "unreachable by
|
|
6
|
+
* supported configuration" is STRUCTURAL, not a promise: the gate is a
|
|
7
|
+
* capability that the config parser cannot construct (its brand is a symbol
|
|
8
|
+
* private to this module), so no `.opencode/openteam.json` — no matter how it
|
|
9
|
+
* is written — can open it. Only `unsafeGrantActiveIngress` produces it, and no
|
|
10
|
+
* production module calls it.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* kill switch
|
|
15
|
-
*
|
|
12
|
+
* The returned reason is always the **outermost necessary** block, so a
|
|
13
|
+
* diagnostic never suggests a remedy that would not work: in R1, turning off
|
|
14
|
+
* the kill switch or broadening the allow-list changes nothing while the gate
|
|
15
|
+
* remains closed, and ingress says so.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* This module is a **composition** layer: it does not reimplement the runtime,
|
|
18
|
+
* review, or cancellation; it orchestrates them and translates their results
|
|
19
|
+
* into a total (never throws) and reference-only result.
|
|
20
20
|
*/
|
|
21
21
|
import type { ResolvedGraphConfig } from "../config/resolve";
|
|
22
22
|
import type { GraphJournal } from "../storage/graph/provider";
|
|
@@ -25,54 +25,58 @@ import type { GraphEffectExecutor } from "./graphEffects";
|
|
|
25
25
|
import type { RevisionPlan } from "./graphReview";
|
|
26
26
|
import { type RuntimeStepOutcome } from "./graphRuntime";
|
|
27
27
|
import { type SddTask } from "./sddCompiler";
|
|
28
|
-
/**
|
|
28
|
+
/** Module-private brand: nothing outside here can manufacture it. */
|
|
29
29
|
declare const ACTIVE_INGRESS_BRAND: unique symbol;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* config
|
|
31
|
+
* Internal permission for active ingress. It is intentionally opaque: because
|
|
32
|
+
* it carries a private symbol brand, no JSON-derived object (and therefore no
|
|
33
|
+
* user config) is assignable to this type.
|
|
34
34
|
*/
|
|
35
35
|
export type ActiveIngressCapability = {
|
|
36
36
|
readonly [ACTIVE_INGRESS_BRAND]: true;
|
|
37
|
-
/**
|
|
37
|
+
/** Declared reason for the grant; only for internal traces. */
|
|
38
38
|
readonly grantedFor: string;
|
|
39
39
|
};
|
|
40
40
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Sole producer of the capability. It is not invoked from any production
|
|
42
|
+
* module; it exists so tests and future pilots (R2+) can open the gate
|
|
43
|
+
* explicitly, leaving the grant visible in the code that uses it.
|
|
44
44
|
*/
|
|
45
45
|
export declare function unsafeGrantActiveIngress(grantedFor: string): ActiveIngressCapability;
|
|
46
|
-
/**
|
|
47
|
-
export type IngressLegacyReason = "gate-closed" | "kill-switch" | "graph-disabled" | "not-allow-listed";
|
|
48
|
-
|
|
46
|
+
/** Reason why a request remains on the legacy path. */
|
|
47
|
+
export type IngressLegacyReason = "gate-closed" | "kill-switch" | "cutover-gate-denied" | "graph-disabled" | "not-allow-listed";
|
|
48
|
+
export type IngressGateViolations = NonNullable<ResolvedGraphConfig["gateViolations"]>;
|
|
49
|
+
type IngressLegacyBlock = {
|
|
50
|
+
readonly reason: IngressLegacyReason;
|
|
51
|
+
readonly gateViolations?: IngressGateViolations;
|
|
52
|
+
};
|
|
53
|
+
/** Routing decision for an SDD task. */
|
|
49
54
|
export type IngressDecision = {
|
|
50
55
|
readonly route: "graph";
|
|
51
56
|
readonly taskID: string;
|
|
52
|
-
} | {
|
|
57
|
+
} | ({
|
|
53
58
|
readonly route: "legacy";
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
/** Política de admisión: config resuelta, allow-list y puerta interna. */
|
|
59
|
+
} & IngressLegacyBlock);
|
|
60
|
+
/** Admission policy: resolved config, allow-list, and internal gate. */
|
|
57
61
|
export type IngressPolicy = {
|
|
58
62
|
readonly graph: ResolvedGraphConfig;
|
|
59
63
|
readonly allowList: readonly string[];
|
|
60
64
|
readonly capability?: ActiveIngressCapability;
|
|
61
65
|
};
|
|
62
66
|
/**
|
|
63
|
-
*
|
|
67
|
+
* Decides the route for a task. Pure and deterministic.
|
|
64
68
|
*
|
|
65
|
-
*
|
|
66
|
-
* `not-allow-listed`,
|
|
69
|
+
* Precedence: `gate-closed` → `kill-switch` →
|
|
70
|
+
* `cutover-gate-denied` → `graph-disabled` → `not-allow-listed`, that is, the
|
|
71
|
+
* outermost block first.
|
|
67
72
|
*/
|
|
68
73
|
export declare function decideIngress(policy: IngressPolicy, taskID: string): IngressDecision;
|
|
69
|
-
/**
|
|
74
|
+
/** Ingress failure class. It never carries user payload. */
|
|
70
75
|
export type IngressErrorCode = "compile-failed" | "unknown-run" | "no-reviewer" | "lease-held" | "journal-failed";
|
|
71
|
-
/**
|
|
72
|
-
export type IngressOutcome = {
|
|
76
|
+
/** Total outcome of an ingress operation. Reference-only. */
|
|
77
|
+
export type IngressOutcome = ({
|
|
73
78
|
readonly kind: "legacy";
|
|
74
|
-
|
|
75
|
-
} | {
|
|
79
|
+
} & IngressLegacyBlock) | {
|
|
76
80
|
readonly kind: "accepted";
|
|
77
81
|
readonly runID: string;
|
|
78
82
|
readonly step: RuntimeStepOutcome;
|
|
@@ -95,21 +99,21 @@ export type IngressOutcome = {
|
|
|
95
99
|
readonly code: IngressErrorCode;
|
|
96
100
|
readonly detail: string;
|
|
97
101
|
};
|
|
98
|
-
/**
|
|
102
|
+
/** Review rejection request: anchors the in-progress review. */
|
|
99
103
|
export type IngressRejectRequest = {
|
|
100
104
|
readonly runID: string;
|
|
101
105
|
readonly nodeID: string;
|
|
102
106
|
readonly currentRevision: number;
|
|
103
107
|
readonly currentOperationID: string;
|
|
104
108
|
};
|
|
105
|
-
/**
|
|
109
|
+
/** Reviewer reassignment request after a technical failure. */
|
|
106
110
|
export type IngressReassignRequest = {
|
|
107
111
|
readonly runID: string;
|
|
108
112
|
readonly authorID: string;
|
|
109
113
|
readonly failedReviewers: readonly string[];
|
|
110
114
|
readonly candidates: readonly string[];
|
|
111
115
|
};
|
|
112
|
-
/**
|
|
116
|
+
/** Injected ingress dependencies. All I/O enters here. */
|
|
113
117
|
export type GraphIngressDeps = {
|
|
114
118
|
readonly policy: IngressPolicy;
|
|
115
119
|
readonly journal: GraphJournal;
|
|
@@ -119,10 +123,10 @@ export type GraphIngressDeps = {
|
|
|
119
123
|
readonly revisionLimit?: number;
|
|
120
124
|
};
|
|
121
125
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
+
* Active ingress surface. Total for classified infrastructure failures
|
|
127
|
+
* (compilation, journal, lease), which are returned as a result. An
|
|
128
|
+
* unclassified error **does** propagate: a bug must not masquerade as a routing
|
|
129
|
+
* decision, because then it would be indistinguishable from a policy.
|
|
126
130
|
*/
|
|
127
131
|
export interface GraphIngress {
|
|
128
132
|
start(task: SddTask): Promise<IngressOutcome>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphIngress.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphIngress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAA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,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAChD;AAkBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAgJvE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Sha256, type TaskAnchor } from "../context/schema";
|
|
2
2
|
import type { Capability } from "../graph/types";
|
|
3
|
-
/**
|
|
3
|
+
/** Normalized verdict of a review. */
|
|
4
4
|
export type ReviewVerdict = {
|
|
5
5
|
readonly decision: "approved";
|
|
6
6
|
} | {
|
|
@@ -10,19 +10,19 @@ export type ReviewVerdict = {
|
|
|
10
10
|
readonly decision: "inconclusive";
|
|
11
11
|
readonly reason: string;
|
|
12
12
|
};
|
|
13
|
-
/**
|
|
13
|
+
/** What the runtime dispatched and what the approval must be anchored to. */
|
|
14
14
|
export type ReviewExpectation = {
|
|
15
15
|
readonly anchor: TaskAnchor;
|
|
16
16
|
readonly artifactSha256: Sha256;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* Parses the verdict conservatively. Unstructured or invalid input is
|
|
20
|
+
* `inconclusive`; a rejection is honored with its reason; an approval requires
|
|
21
|
+
* an anchor and artifact digest that match what was dispatched, and any
|
|
22
|
+
* discrepancy degrades to `inconclusive` (fail-closed).
|
|
23
23
|
*/
|
|
24
24
|
export declare function parseReviewVerdict(raw: unknown, expected: ReviewExpectation): ReviewVerdict;
|
|
25
|
-
/**
|
|
25
|
+
/** Reviewer effect lockout decision before dispatch. */
|
|
26
26
|
export type ReviewerEffectDecision = {
|
|
27
27
|
readonly kind: "allow";
|
|
28
28
|
} | {
|
|
@@ -30,30 +30,30 @@ export type ReviewerEffectDecision = {
|
|
|
30
30
|
readonly capability: Capability;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
33
|
+
* Locks the reviewer effect to read-only. Returns `reject` with the first
|
|
34
|
+
* planned mutating capability (input order, deterministic); if all capabilities
|
|
35
|
+
* are read-only, `allow`.
|
|
36
36
|
*/
|
|
37
37
|
export declare function reviewerEffectDecision(capabilities: readonly Capability[]): ReviewerEffectDecision;
|
|
38
|
-
/**
|
|
38
|
+
/** Lineage plan after a rejection: linked new revision or exhaustion. */
|
|
39
39
|
export type RevisionPlan = {
|
|
40
40
|
readonly kind: "revise";
|
|
41
41
|
readonly nodeID: string;
|
|
42
|
-
/**
|
|
42
|
+
/** Index of the new revision (0 is the initial implementation). */
|
|
43
43
|
readonly revision: number;
|
|
44
|
-
/**
|
|
44
|
+
/** Operation for the new revision, distinct from the previous one. */
|
|
45
45
|
readonly operationID: string;
|
|
46
|
-
/**
|
|
46
|
+
/** Operation it derives from (append-only link). */
|
|
47
47
|
readonly previousOperationID: string;
|
|
48
48
|
} | {
|
|
49
49
|
readonly kind: "exhausted";
|
|
50
50
|
readonly revision: number;
|
|
51
51
|
};
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
53
|
+
* Plans the revision that links a rejection. If room remains under the limit,
|
|
54
|
+
* produces a new revision with a distinct `operationID` that points to the
|
|
55
|
+
* previous one (`previousOperationID`), preserving append-only history; if the
|
|
56
|
+
* margin is exhausted, `exhausted`.
|
|
57
57
|
*/
|
|
58
58
|
export declare function planRevision(input: {
|
|
59
59
|
readonly runID: string;
|
|
@@ -62,19 +62,20 @@ export declare function planRevision(input: {
|
|
|
62
62
|
readonly currentOperationID: string;
|
|
63
63
|
readonly limit?: number;
|
|
64
64
|
}): RevisionPlan;
|
|
65
|
-
/**
|
|
65
|
+
/** Result of reassigning the reviewer after a technical failure. */
|
|
66
66
|
export type ReviewerReassignment = {
|
|
67
67
|
readonly kind: "reassign";
|
|
68
68
|
readonly reviewerID: string;
|
|
69
|
-
/**
|
|
69
|
+
/** A technical reviewer failure does not re-execute the implementation. */
|
|
70
70
|
readonly rerunImplementation: false;
|
|
71
71
|
} | {
|
|
72
72
|
readonly kind: "no-reviewer";
|
|
73
73
|
};
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
75
|
+
* Reassigns the review to the first eligible candidate (input order), never the
|
|
76
|
+
* author nor a reviewer that has already failed. The implementation is not
|
|
77
|
+
* re-executed: its artifact is preserved. With no eligible candidates,
|
|
78
|
+
* `no-reviewer`.
|
|
78
79
|
*/
|
|
79
80
|
export declare function reassignReviewer(input: {
|
|
80
81
|
readonly authorID: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphReview.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphReview.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,MAAM,EAEX,KAAK,UAAU,EAEhB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CA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;IACnE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACtC,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,GAAG,YAAY,CAaf;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,2EAA2E;IAC3E,QAAQ,CAAC,mBAAmB,EAAE,KAAK,CAAC;CACrC,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC;AAErC;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC,GAAG,oBAAoB,CAevB"}
|
|
@@ -4,36 +4,37 @@ import type { GraphJournal } from "../storage/graph/provider";
|
|
|
4
4
|
import type { WorkspaceLease } from "../storage/graph/workspaceLease";
|
|
5
5
|
import type { GraphEffectExecutor } from "./graphEffects";
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Graph single-writer runtime (GE-031, GE-033).
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* (`node.dispatched`)
|
|
12
|
-
* (`node.succeeded`/`node.failed`)
|
|
13
|
-
*
|
|
14
|
-
* `running`
|
|
15
|
-
* `blocked`.
|
|
9
|
+
* A `step` (idempotently) acquires the workspace lease, ensures the
|
|
10
|
+
* `run.started` event, and advances **at most one effect**: it commits the
|
|
11
|
+
* intention (`node.dispatched`) to the journal before invoking the executor and
|
|
12
|
+
* the receipt (`node.succeeded`/`node.failed`) after. It resumes after a restart
|
|
13
|
+
* by taking over the journal (`takeOver`) and does not re-dispatch an in-flight
|
|
14
|
+
* effect: a `running` node without a receipt is left for reconciliation
|
|
15
|
+
* (GE-032) by returning `blocked`. Lease fencing prevents a second simultaneous
|
|
16
|
+
* orchestrator.
|
|
16
17
|
*
|
|
17
|
-
*
|
|
18
|
-
* (`transient`/`timeout`)
|
|
19
|
-
* `operationID`
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
18
|
+
* Retries (GE-033): a `failed` node with a retryable error class
|
|
19
|
+
* (`transient`/`timeout`) and within the limit is dispatched again with the same
|
|
20
|
+
* `operationID` and a new `attemptID` derived from the journal, so the decision
|
|
21
|
+
* and ID reappear the same after a restart. The backoff delay is a pure function
|
|
22
|
+
* of the attempt index that the runtime exposes in the step result; it neither
|
|
23
|
+
* sleeps nor consults the clock.
|
|
23
24
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* The runtime isolates all orchestration logic; real I/O lives in injected
|
|
26
|
+
* ports (`WorkspaceLease`, `GraphJournal`, `GraphEffectExecutor`), so it is
|
|
27
|
+
* tested with deterministic doubles without network or SDK.
|
|
27
28
|
*/
|
|
28
|
-
/**
|
|
29
|
+
/** Result of one runtime `step`. */
|
|
29
30
|
export type RuntimeStepOutcome = {
|
|
30
31
|
readonly kind: "dispatched";
|
|
31
32
|
readonly nodeID: string;
|
|
32
33
|
readonly operationID: string;
|
|
33
34
|
readonly attemptID: string;
|
|
34
|
-
/**
|
|
35
|
+
/** Attempt index (0 is the first); grows on each retry. */
|
|
35
36
|
readonly attempt: number;
|
|
36
|
-
/**
|
|
37
|
+
/** Suggested deterministic delay before this attempt, in ms. */
|
|
37
38
|
readonly backoffMs: number;
|
|
38
39
|
} | {
|
|
39
40
|
readonly kind: "completed";
|
|
@@ -46,23 +47,23 @@ export type RuntimeStepOutcome = {
|
|
|
46
47
|
readonly kind: "terminal";
|
|
47
48
|
readonly status: RunStatus;
|
|
48
49
|
};
|
|
49
|
-
/**
|
|
50
|
+
/** Injected runtime dependencies; none performs I/O inside this module. */
|
|
50
51
|
export type GraphRuntimeDeps = {
|
|
51
52
|
readonly spec: GraphSpecV1;
|
|
52
53
|
readonly journal: GraphJournal;
|
|
53
54
|
readonly lease: WorkspaceLease;
|
|
54
55
|
readonly effects: GraphEffectExecutor;
|
|
55
56
|
readonly holder: string;
|
|
56
|
-
/**
|
|
57
|
+
/** Attempt limit per retryable node; defaults to `DEFAULT_RETRY_LIMIT`. */
|
|
57
58
|
readonly retryLimit?: number;
|
|
58
59
|
};
|
|
59
|
-
/** Runtime
|
|
60
|
+
/** Runtime that advances a Graph run step by step. */
|
|
60
61
|
export interface GraphRuntime {
|
|
61
|
-
/**
|
|
62
|
+
/** Acquires the lease and ensures `run.started`; idempotent. */
|
|
62
63
|
start(): Promise<void>;
|
|
63
|
-
/**
|
|
64
|
+
/** Advances at most one effect and returns the step result. */
|
|
64
65
|
step(): Promise<RuntimeStepOutcome>;
|
|
65
|
-
/**
|
|
66
|
+
/** Repeats `step` until a non-dispatching state (terminal, completed, etc.). */
|
|
66
67
|
runToCompletion(): Promise<RuntimeStepOutcome>;
|
|
67
68
|
}
|
|
68
69
|
export declare function createGraphRuntime(deps: GraphRuntimeDeps): GraphRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphRuntime.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphRuntime.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"graphRuntime.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphRuntime.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAa,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EACV,YAAY,EAGb,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAEV,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oCAAoC;AACpC,MAAM,MAAM,kBAAkB,GAC1B;IACE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC9B;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAA;CAAE,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EA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