Uh oh!
There was an error while loading. Please reload this page.
feat(graph): graph engine core — node kinds, registries, host effects - #983
Merged
Conversation
Add `@tangle-network/agent-runtime/graph`: the `NodeKind` contract, `Registry<T>`, the four core kinds (agent, supervisor, script, subgraph) and `createGraphEngine`. A host extends the engine by registering kinds and effects; the engine source names no host kind (a test greps for it), and ADC's `integration.invoke` and `notify` are written as fixtures against a fake host to prove it. Two kernel changes: - `scope.spawn` admits a verbatim `executor` on a parsed profile; the executable identity rule stays for factories, harnesses and the router. - An artifact with no `Spend` is refused by name before it replaces the live spend, so the child goes down and its reservation no longer leaks. Map #966, ticket #979. Version 0.162.0.
This was referenced Aug 22, 2026
tangletools
approved these changes
Aug 22, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved drewstone PR — 5ec25b8e
This PR was opened by the trusted drewstone account.
This approval is provisional and was applied by the local stand-in because the pr-reviewer webhook host is unreachable (2026-08-21). CI on this head is fully green. The full PR reviewer audit re-runs via the resweep when the service returns and will publish findings if it detects issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Map: #966 · ticket: #979 (engine build 1/4) · spec: #969 (contract), #970 (kinds), #978 (registry).
What lands
@tangle-network/agent-runtime/graph(new subpath), offline and kernel-hosted:NodeKind— declarative record:id/version,validateConfigby name (no zod), typedinputs/outputsports, declaredeffects,onCrash,budget,run(...)returning theAgentthatScope.spawnhosts.validateNodeKindrefuses implicitout/traceports, duplicate ports, unknown policies.narrowEffectshands a kind exactly what it declared, frozen, and refuses before the node runs when the host lacks one, listing what the host has.Registry<T>— enumerable, per-instance,requirerefuses by name and lists what is registered; handle prints<id>/v<n>.agent(→workerFromBackend),supervisor(→supervisorAgent),script(pure ⇒ exempt + content-addressed; metered-without-report ⇒ UNKNOWN),subgraph(validates and registers;runwaits for the scheduler, Engine build 2/4: scheduler over typed ports — three edge kinds, guards, joins, visit caps, terminals #980).createGraphEngine({ coreKinds, kinds, effects })+missingEffects().Two kernel changes the engine needed, each useful on its own:
scope.spawnrequired everyAgentSpec.profileto select a harness and model, including a spec carrying a verbatimexecutor— which sees only(task, signal), so nothing could fill it from ambient config. A script runs no model; claiming one would lie in the journal identity. A verbatim executor now needs a parsed profile, not an executable one; factories, harnesses and the router keep the full requirement. The script kind stampsexecution.correlation.nodeKindso identity never collides across kinds.Spendcrashed the child with a rawTypeErrorand leaked its reservation (reconcile ran onundefined).scope.spawnnow refuses it by name before it can replace the live spend; the child goes down, the reservation reconciles on what was proven, and the pool is sealed unknown as on any crash.Acceptance (#979 "done when") → proof
<id>/v<n>tests/graph/registry.test.tstests/graph/kind.test.ts,tests/graph/kinds.test.ts(realScope)integration.invoke+notifyasNodeKinds against a fake host; engine source names neithertests/graph/fixtures/adc-kinds.ts,tests/graph/adc-kinds.test.ts,tests/graph/generality.test.tsoracle: truerefused asdelegates/datatarget at compilecheck:version-bump(minor), docs regeneratedapi-surface.json, fixtures,docs/apiregeneratedVerification
pnpm run typecheck0 errors ·pnpm run lintclean ·pnpm run docs:api+docs:freshnessgreen ·check:version-bump→ minor.origin/maincheckout on the same host: identical failing-file set (macOS baseline:/varsymlinks,127.0.0.53, Linux-only paths), 0 regressions.tests/untracked-clone.test.tsflaked once under load and passes alone.tests/graph37/37,tests/kernel+src/runtime/supervisegreen except the127.0.0.53bind (baseline).Version 0.162.0; CHANGELOG entry included. Follow-ups: #980 scheduler, #981 fold + replay, #982
graphFromRunGraph.