Skip to content

feat(campaign): Lineage DAG — git-graph of candidates, multi-parent merges, visioned tracks, agent-managed governor#319

Merged
drewstone merged 1 commit into
mainfrom
feat/lineage-dag
Jul 7, 2026
Merged

feat(campaign): Lineage DAG — git-graph of candidates, multi-parent merges, visioned tracks, agent-managed governor#319
drewstone merged 1 commit into
mainfrom
feat/lineage-dag

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

The foundation for the multi-track / archive / customer-inbox vision. Today the improvement loop records a linear history with no parent pointers and collapses its within-run frontier to one gated winner. This adds the DAG.

What it is

  • Lineage DAG — nodes carry parentIds[]: 0 = root, 1 = mutation, 2+ = MERGE (collapse). A merge is not special-cased — it's just a multi-parent node the governor decides to create ("collapsing is a feature of the graph the supervisor chooses").
  • Visioned tracks (islands) — each track runs a distinct vision (proposer strategy): solve / outside-the-box / an adversarial contrarian that attacks the leader. This is the "solve N different ways + one tries to disprove it" pattern as first-class tracks — a usage pattern, not new plumbing.
  • Agent-managed Governorextend / branch / merge / prune / stop. heuristicGovernor is the deterministic reference policy; callbackGovernor is the LLM-supervisor slot (reads lineage.toGraph()).
  • runLineage orchestration + fs/mem persistence (append-only JSONL, resumable across runs).
  • Determinism enforced — no Date.now/Math.random/new Date; content-hash ids; monotone seq; seq-sorted queries. End-to-end re-run yields an identical graph.
  • Acyclic by construction (parents pre-exist + immutable ids + append-only), not a runtime guard; traversal stays cycle-safe on corrupted deserialized input.

Tests — 24/24

id determinism; generation derivation; idempotent add; acyclic invariant + traversal safety; diamond merge with ancestors/descendants; scalar + Pareto frontier (dominated tip excluded); JSONL round-trip; fs store in a tmp dir; governor extend/merge/prune/stop + determinism; end-to-end 3-vision run producing a merge, honoring prune, identical on re-run.

Additive; no existing behavior touched. Next: wire real step/merge seams (runImprovementLoop + GEPA crossover) for the first live multi-track run.

…h multi-parent merges, visioned tracks, agent-managed governor

The improvement loop today records a LINEAR history with no parent pointers and
collapses its within-run frontier to one gated winner, discarding the rest. This
adds the first-class structure the multi-track / archive / customer-inbox vision
needs:

- Lineage DAG: nodes carry parentIds[] — 0 = root, 1 = mutation, 2+ = MERGE
  (collapse). Merge is not special-cased; it is just a multi-parent node the
  governor chooses to create.
- Visioned tracks (islands): each track runs a distinct vision (a proposer
  strategy) — e.g. solve / outside-the-box / an adversarial 'contrarian' that
  attacks the leader (the 'solve N different ways + one disproves it' pattern).
- Agent-managed Governor: extend / branch / merge / prune / stop. heuristicGovernor
  is the deterministic reference policy; callbackGovernor is the LLM-supervisor
  slot (reads lineage.toGraph()). Collapsing is a decision, not control flow.
- runLineage orchestration + fs/mem persistence (append-only JSONL, resumable).
- DETERMINISM enforced: no Date.now/Math.random/new Date; content-hash ids;
  monotone seq; seq-sorted queries. End-to-end re-run yields an identical graph.
- Acyclic BY CONSTRUCTION (parents pre-exist + immutable ids + append-only), not
  a runtime guard; traversal stays cycle-safe on corrupted deserialized input.

24/24 tests: id determinism, generation derivation, idempotent add, acyclic
invariant, diamond merge + ancestors/descendants, scalar + Pareto frontier,
JSONL round-trip, fs store in a tmp dir, governor extend/merge/prune/stop +
determinism, and end-to-end 3-vision run with a produced merge + prune-honored
+ identical-on-rerun.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved drewstone PR — 0b5780f9

This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: drewstone_author · 2026-07-07T02:32:17Z

@drewstone drewstone merged commit 004ace7 into main Jul 7, 2026
1 check passed
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.

2 participants