@intentic/graph 1.224.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 +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# @intentic/graph
|
|
2
2
|
|
|
3
|
-
The product-agnostic **desired-state IR** and its compiler
|
|
3
|
+
The product-agnostic **desired-state IR** and its compiler: the data structure every other package is built around. A node's `type` is an opaque string here; the closed vocabulary lives in [`@intentic/resources`](../resources). This is the base of the dependency graph (depended on by every other package, depends on nothing internal).
|
|
4
4
|
|
|
5
5
|
## Responsibilities
|
|
6
6
|
|
|
7
7
|
- Define the serializable graph types: `DesiredStateGraph`, `RawNode`/`ResourceNode`, `Ref`, `SecretRef`, `Readiness`.
|
|
8
8
|
- Compile a map of `RawNode`s into a validated, dependency-ordered `DesiredStateGraph` (`compile`).
|
|
9
9
|
- Provide the primitives others compose with: typed refs between nodes, env-sourced secrets, HTTP readiness gates, and ownership stamps.
|
|
10
|
-
- It does **not** know which resource kinds exist, how to reconcile them, or how to talk to infra
|
|
10
|
+
- It does **not** know which resource kinds exist, how to reconcile them, or how to talk to infra: those belong to `resources`/`engine`/`providers`.
|
|
11
11
|
|
|
12
12
|
## Key files
|
|
13
13
|
|
|
14
|
-
- [src/types.ts](src/types.ts)
|
|
15
|
-
- [src/compile.ts](src/compile.ts)
|
|
16
|
-
- [src/topo.ts](src/topo.ts)
|
|
17
|
-
- [src/ref.ts](src/ref.ts)
|
|
18
|
-
- [src/stamp.ts](src/stamp.ts)
|
|
19
|
-
- [src/serialize.ts](src/serialize.ts)
|
|
14
|
+
- [src/types.ts](src/types.ts): the IR types (`DesiredStateGraph`, `RawNode`, `Ref`, `SecretRef`, `Readiness`).
|
|
15
|
+
- [src/compile.ts](src/compile.ts), `compile`: RawNode map → graph (validates refs, fills order).
|
|
16
|
+
- [src/topo.ts](src/topo.ts): `toNodeMap`, `linearize` (topological dependency order).
|
|
17
|
+
- [src/ref.ts](src/ref.ts): `makeRef`/`refKey`/`isRef`, `env` (env-sourced secret), `httpOk` (readiness gate).
|
|
18
|
+
- [src/stamp.ts](src/stamp.ts): `formatStamp`/`parseStamp` (resource ownership stamps).
|
|
19
|
+
- [src/serialize.ts](src/serialize.ts): stable serialization of the graph.
|
|
20
20
|
|
|
21
21
|
## How it fits
|
|
22
22
|
|
|
@@ -24,6 +24,6 @@ Foundational layer. `resources` constrains node `type`s on top of it; `need-reso
|
|
|
24
24
|
|
|
25
25
|
## Conventions & gotchas
|
|
26
26
|
|
|
27
|
-
- Refs are typed pointers to another node's outputs
|
|
27
|
+
- Refs are typed pointers to another node's outputs: never inline a downstream value; emit a `Ref` so ordering and resolution stay correct.
|
|
28
28
|
- Secrets are `SecretRef`s with a `source` (`env` or `generated`); keep them as refs, never bake plaintext into a node.
|
|
29
29
|
- Co-located tests in [src/index.test.ts](src/index.test.ts). See [ARCHITECTURE.md](../../ARCHITECTURE.md) for the full pipeline.
|