Skip to content

feat(loops+otel): topology edge lineage for loop visualization (#80) — 0.35.0#81

Merged
tangletools merged 3 commits into
mainfrom
feat/loop-topology-lineage
May 31, 2026
Merged

feat(loops+otel): topology edge lineage for loop visualization (#80) — 0.35.0#81
tangletools merged 3 commits into
mainfrom
feat/loop-topology-lineage

Conversation

@tangletools
Copy link
Copy Markdown
Contributor

Resolves #80. Also carries the 0.34.0 version bump (supersedes #79 — close that), so main catches up 0.33.0 → 0.35.0 in one merge.

What #80 asked + what landed

The kernel computed topology edges (which iteration each round branches from / dispatches) then dropped them before they reached a trace — so the Tangle Intelligence loop-graph viewer could only infer edges for the two built-in drivers and couldn't render createDynamicDriver topologies faithfully. Now emitted (additive, backward-compatible):

  • loop.plan: + parentIndex (branch source; root for round 0) + childIndices (dispatched iterations).
  • loop.iteration.{started,dispatch,ended}: + groupId (plan round) + parentIndex.
  • loop.iteration.ended: + outputPreview (bounded ~280-char drawer string).
  • Kernel branchPoint(): round k>0 branches from best-valid (else latest) iteration → refine renders as a chain, fanout→refine chains off the fanout winner. Inferred; planner-declared override is a clean future extension.
  • OTEL span tree: loop.round + tangle.loop.move.{round,parent_index,child_indices}; loop.iteration + tangle.loop.iteration.{group_id,parent_index,duration_ms,output_preview}; root + tangle.loop.duration_ms.

Convention decision (documented on #80)

gen_ai. semconv wins for fields OTel standardizes* (gen_ai.agent.name, gen_ai.usage.input/output_tokens, gen_ai.operation.name) — NOT duplicated into bespoke tangle.*. tangle.loop.* covers only what OTel doesn't (move/topology, verdict, placement, cost, lineage, preview, rollups). The consumer's spansToLoopEvents aligns to read gen_ai.* for agent/tokens (small, one-time).

Published as 0.35.0. Full suite 404 green, tsc + biome clean.

drewstone added 3 commits May 30, 2026 19:46
…ization (#80)

Closes the visualization gap from #80: the kernel computed the topology edges
(which iteration each round branches from / dispatches) and discarded them
before they reached a trace, so a viewer could only INFER edges for the two
built-in drivers and could not render createDynamicDriver topologies faithfully.

Now emitted (additive, backward-compatible):
- loop.plan: + parentIndex (branch source; root for round 0) + childIndices
  (the iterations this round dispatched) — the move's edges, emitted not guessed.
- loop.iteration.{started,dispatch,ended}: + groupId (plan round) + parentIndex
  (the iteration this one descends from).
- loop.iteration.ended: + outputPreview (bounded ~280-char string for a drawer).
- Kernel branchPoint(): round k>0 branches from the best-valid (else latest)
  iteration so far — so refine renders as a chain, fanout→refine chains off the
  fanout winner. Inferred, not driver-declared (a planner-declared override is a
  clean future extension).

OTel span tree (buildLoopOtelSpans):
- loop.round (move) span: + tangle.loop.move.{round,parent_index,child_indices}.
- loop.iteration span: + tangle.loop.iteration.{group_id,parent_index,duration_ms,output_preview}.
- loop (root): + tangle.loop.duration_ms.

Convention (decided on #80): gen_ai.* semantic conventions win for fields OTel
standardizes (gen_ai.agent.name, gen_ai.usage.input/output_tokens,
gen_ai.operation.name) — NOT duplicated into bespoke tangle keys; tangle.loop.*
covers only what OTel does not (move/topology, verdict, placement, cost,
lineage, output_preview, rollups).

Tests: buildLoopOtelSpans lineage (move child_indices/parent_index + iteration
group_id/parent_index/duration_ms/output_preview + root duration_ms); kernel
emits childIndices/parentIndex on loop.plan + groupId/outputPreview on iteration
ended. Full suite 404 green, tsc + biome clean.
@tangletools tangletools merged commit 67dbbca into main May 31, 2026
1 of 3 checks passed
@tangletools tangletools deleted the feat/loop-topology-lineage branch May 31, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(loops): emit topology + planner-move telemetry for visualization

2 participants