@intentic/engine 1.223.0 → 1.225.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/README.md +11 -11
- package/dist/reconcile/moves.js +2 -2
- package/dist/reconcile/moves.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# @intentic/engine
|
|
2
2
|
|
|
3
|
-
The stateless **reconcile engine**. It walks a `DesiredStateGraph` in dependency order and converges it through the **Provider SPI
|
|
3
|
+
The stateless **reconcile engine**. It walks a `DesiredStateGraph` in dependency order and converges it through the **Provider SPI**: never constructing providers itself, only consuming a `ResourceType → Provider` map. Depends on [`@intentic/graph`](../graph) + [`@intentic/resources`](../resources); the real providers live in [`@intentic/providers`](../providers).
|
|
4
4
|
|
|
5
5
|
## Responsibilities
|
|
6
6
|
|
|
7
|
-
- `apply
|
|
8
|
-
- `plan
|
|
9
|
-
- `reconcile
|
|
7
|
+
- `apply`, converge once: per node, `read` → `diff` → `create`/`update`/`noop`, gating on readiness.
|
|
8
|
+
- `plan`, dry run: classify every node without mutating infra.
|
|
9
|
+
- `reconcile`: loop apply→read until a plan reads all-noop ("state reads true"), returning a `ConvergeResult`.
|
|
10
10
|
- Define the **Provider SPI** the rest of the system implements: `Provider`, `Providers`, `Observed`, `DiffResult`, `ProviderContext`.
|
|
11
11
|
- Emit structured `EngineEvent`s (for the CLI's ndjson/json output) and handle readiness, orphans, and pruning.
|
|
12
12
|
|
|
13
13
|
## Key files
|
|
14
14
|
|
|
15
|
-
- [src/reconcile/apply.ts](src/reconcile/apply.ts) / [src/reconcile/plan.ts](src/reconcile/plan.ts) / [src/reconcile/reconcile-loop.ts](src/reconcile/reconcile-loop.ts)
|
|
16
|
-
- [src/provider.ts](src/provider.ts) / [src/types.ts](src/types.ts)
|
|
17
|
-
- [src/readiness.ts](src/readiness.ts)
|
|
18
|
-
- [src/resolve-inputs.ts](src/resolve-inputs.ts)
|
|
19
|
-
- [src/reconcile/orphans.ts](src/reconcile/orphans.ts) / [src/reconcile/prune.ts](src/reconcile/prune.ts)
|
|
15
|
+
- [src/reconcile/apply.ts](src/reconcile/apply.ts) / [src/reconcile/plan.ts](src/reconcile/plan.ts) / [src/reconcile/reconcile-loop.ts](src/reconcile/reconcile-loop.ts): the converge/dry-run/loop logic.
|
|
16
|
+
- [src/provider.ts](src/provider.ts) / [src/types.ts](src/types.ts): the SPI and engine types (`Provider`, `DiffResult`, `EngineConfig`, `Step`, `Orphan`).
|
|
17
|
+
- [src/readiness.ts](src/readiness.ts): `httpProbe` / `waitReady` (readiness gates), and `pollUntil`, the one waiting loop every "is it up yet" in the engine and the providers is written on.
|
|
18
|
+
- [src/resolve-inputs.ts](src/resolve-inputs.ts): resolve refs/secrets into concrete provider inputs.
|
|
19
|
+
- [src/reconcile/orphans.ts](src/reconcile/orphans.ts) / [src/reconcile/prune.ts](src/reconcile/prune.ts) (drift cleanup; [src/providers](src/providers)) `createFakeProviders` (in-memory SPI for tests).
|
|
20
20
|
|
|
21
21
|
## How it fits
|
|
22
22
|
|
|
23
|
-
The execution core. `state-resolver` produces the graph; `providers` supplies the concrete SPI map; the `cli` wires them together and runs `reconcile`. The engine stays infra-agnostic
|
|
23
|
+
The execution core. `state-resolver` produces the graph; `providers` supplies the concrete SPI map; the `cli` wires them together and runs `reconcile`. The engine stays infra-agnostic: all I/O is behind the SPI.
|
|
24
24
|
|
|
25
25
|
## Conventions & gotchas
|
|
26
26
|
|
|
27
|
-
- The engine never imports `providers
|
|
27
|
+
- The engine never imports `providers`: it takes a `Providers` map as input, so it can run against fakes.
|
|
28
28
|
- `diff` must be **pure** (read does the I/O); apply is the only mutating step. `EngineEvent` is part of the public contract for embedders. See [ARCHITECTURE.md](../../ARCHITECTURE.md).
|
package/dist/reconcile/moves.js
CHANGED
|
@@ -15,7 +15,7 @@ export const applyMoves = async (graph, config) => {
|
|
|
15
15
|
throw new Error(`moved: "from" and "to" are the same id "${move.from}"`);
|
|
16
16
|
}
|
|
17
17
|
if (graph.resources[move.from] !== undefined) {
|
|
18
|
-
throw new Error(`moved: source "${move.from}" still exists in the desired state
|
|
18
|
+
throw new Error(`moved: source "${move.from}" still exists in the desired state, a rename must remove the old id`);
|
|
19
19
|
}
|
|
20
20
|
const node = graph.resources[move.to];
|
|
21
21
|
if (node === undefined) {
|
|
@@ -24,7 +24,7 @@ export const applyMoves = async (graph, config) => {
|
|
|
24
24
|
const type = node.type;
|
|
25
25
|
const provider = requireProvider(config.providers, type, move.to);
|
|
26
26
|
if (provider.restamp === undefined) {
|
|
27
|
-
log(`moved: ${type} cannot rename in place
|
|
27
|
+
log(`moved: ${type} cannot rename in place, "${move.from}" → "${move.to}" will be recreated (its data is NOT preserved)`);
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
30
30
|
const ctx = makeContext(move.to, store, env, log);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moves.js","sourceRoot":"","sources":["../../src/reconcile/moves.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAS9D,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,EAAE,KAAwB,EAAE,MAAoB,EAAmB,EAAE;IAChG,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACd,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACtC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACtC,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,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C;IACD,OAAO,OAAO,CAAC;AACnB,CAAC,CAAC;AAOF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAA2B,EAAE,KAAsB,EAAqB,EAAE;IAC3G,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClE,MAAM,SAAS,GAAiC,EAAE,CAAC;IACnD,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QACnC,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;IAC9G,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC;AACrC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.225.0",
|
|
4
4
|
"description": "Stateless reconcile engine: plan/apply, the Provider SPI, and the reconcile loop.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "2.8.1",
|
|
34
|
-
"@intentic/
|
|
35
|
-
"@intentic/
|
|
34
|
+
"@intentic/graph": "1.225.0",
|
|
35
|
+
"@intentic/resources": "1.225.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "24.13.2",
|
|
39
39
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
40
40
|
"vitest": "4.1.10",
|
|
41
|
-
"@intentic/
|
|
42
|
-
"@intentic/
|
|
41
|
+
"@intentic/sdk": "1.225.0",
|
|
42
|
+
"@intentic/tsconfig": "0.0.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsgo",
|