Skip to content

feat: NTF v1.1 branch field + trace-view par lane coloring - #24

Merged
NekomyaDev merged 2 commits into
mainfrom
feature/par-branches
Jul 29, 2026
Merged

feat: NTF v1.1 branch field + trace-view par lane coloring#24
NekomyaDev merged 2 commits into
mainfrom
feature/par-branches

Conversation

@NekomyaDev

Copy link
Copy Markdown
Owner

What

NTF v1.1 (additive, frozen-v1 compatible): records emitted inside a par map / par all / par race branch now carry a branch label ("par[0]", "par[1]", ...) so parallel lanes are distinguishable in traces.

Runtime (runtime/nudge_runtime/__init__.py)

  • threading.local()-based branch context (_current_branch / _run_with_branch)
  • llm.call, tool.call, and fn.return records include "branch" when inside a par lane; omitted otherwise (purely additive — v1 validators keep passing)
  • par_map / par_all / par_race wrap their workers with per-index labels

trace-view (crates/nudgec/src/traceview.html)

  • Branch badge on each record row (par[0], par[1], ...)
  • Per-branch lane coloring via a deterministic hash over an 8-color palette
  • Old v1 traces without branch render unchanged

Why

Parallel agents were the one place the receipt went blurry: N interleaved LLM calls with no way to tell which lane produced what. Now the receipt shows lanes.

Test

  • Sandbox-tested with par_map([1,2,3], work): records carry branch: par[0]/par[1]/par[2]
  • Viewer renders old v1 traces (no branch) identically to before ✓

@NekomyaDev
NekomyaDev merged commit 439d323 into main Jul 29, 2026
2 checks passed
@NekomyaDev
NekomyaDev deleted the feature/par-branches branch July 29, 2026 14:37
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.

1 participant