feat(campaign): Lineage DAG — git-graph of candidates, multi-parent merges, visioned tracks, agent-managed governor#319
Merged
Merged
Conversation
…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
approved these changes
Jul 7, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ 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
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 free
to 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.
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
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").extend / branch / merge / prune / stop.heuristicGovernoris the deterministic reference policy;callbackGovernoris the LLM-supervisor slot (readslineage.toGraph()).runLineageorchestration + fs/mem persistence (append-only JSONL, resumable across runs).Date.now/Math.random/new Date; content-hash ids; monotoneseq; seq-sorted queries. End-to-end re-run yields an identical graph.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/mergeseams (runImprovementLoop + GEPA crossover) for the first live multi-track run.