[Phase 5.5] Lineage & Genealogy Tracking #67

Closed
opened 2026-04-01 02:00:04 +00:00 by Mark · 18 comments
Owner

Overview

Track the full genealogy of capability variants across mutations, championships, and promotions.

Problem Statement

Current lineage tracking is minimal:

variant:
  parent: "writer_v1"  # Only immediate parent

We can't answer questions like:

  • "What mutation path led to this capability?"
  • "How many generations is this variant from the original?"
  • "Which mutation types have been most successful in this lineage?"

Proposed Solution

5.5.1: Lineage Graph

Create evolution/lineage_tracker.py:

class LineageTracker:
    """Track capability genealogy across generations."""
    
    def record_birth(
        self,
        variant_id: str,
        parent_id: str | None,
        mutation_type: str,
        mutation_params: dict
    ):
        """Record a new variant's origin."""
        
    def get_ancestry(
        self,
        variant_id: str,
        generations: int = 10
    ) -> list[dict]:
        """Get ancestry chain for a variant."""
        
    def get_descendants(
        self,
        variant_id: str
    ) -> list[dict]:
        """Get all descendants of a variant."""
        
    def get_mutation_path(
        self,
        variant_id: str
    ) -> list[str]:
        """Get sequence of mutations from root to variant."""
        
    def compute_inherited_traits(
        self,
        variant_id: str
    ) -> dict:
        """Compute traits inherited from ancestry."""

5.5.2: Lineage Database

CREATE TABLE capability_lineage (
    id INTEGER PRIMARY KEY,
    variant_id TEXT UNIQUE NOT NULL,
    parent_id TEXT,
    mutation_type TEXT NOT NULL,
    mutation_params JSON,
    generation INTEGER NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    
    -- Performance tracking
    championship_score REAL,
    promoted BOOLEAN DEFAULT FALSE,
    success_rate REAL,
    
    FOREIGN KEY (parent_id) REFERENCES capability_lineage(variant_id)
);

CREATE INDEX idx_parent ON capability_lineage(parent_id);
CREATE INDEX idx_generation ON capability_lineage(generation);

5.5.3: Lineage Visualization

writer_v1 (gen 0, root)
    ├── writer_v1_variant_1 (gen 1, tighten_constraints)
    │   └── writer_v1_variant_3 (gen 2, add_retry) [PROMOTED]
    └── writer_v1_variant_2 (gen 1, loosen_constraints)
        ├── writer_v1_variant_4 (gen 2, adjust_prompt)
        └── writer_v1_variant_5 (gen 2, add_validation)

Deliverables

  • evolution/lineage_tracker.py - Tracker class
  • lineage table in ledger
  • record_birth() - Track new variant origin
  • get_ancestry() - Trace ancestry chain
  • get_descendants() - Find all descendants
  • get_mutation_path() - Mutation sequence analysis
  • compute_inherited_traits() - Trait inheritance
  • API endpoint: GET /v1/lineage/<variant_id>
  • Visualization: GET /v1/lineage/<variant_id>/graph

Analysis Capabilities

# Find all mutations in a lineage
mutations = tracker.get_mutation_path("writer_v2")
# ["tighten_constraints", "add_retry", "adjust_prompt"]

# Find most successful mutation combination
best_path = tracker.find_best_path("writer", metric="championship_score")

# Compute trait inheritance
traits = tracker.compute_inherited_traits("writer_v2")
# {"error_handling": 0.9, "retry_logic": True, ...}

Success Criteria

  • Every variant has complete lineage record
  • Can trace ancestry to root (10+ generations)
  • Can identify mutation sequences
  • Can visualize lineage graph
  • Inherited traits computed correctly

Dependencies

  • #64 (Factory Learning) - uses analytics data

Estimated Duration

1 week

  • Parent: #62 (Phase 5 Meta)
  • Uses: evolution/factory_analytics.py
## Overview Track the full genealogy of capability variants across mutations, championships, and promotions. ## Problem Statement Current lineage tracking is minimal: ```yaml variant: parent: "writer_v1" # Only immediate parent ``` We can't answer questions like: - "What mutation path led to this capability?" - "How many generations is this variant from the original?" - "Which mutation types have been most successful in this lineage?" ## Proposed Solution ### 5.5.1: Lineage Graph Create `evolution/lineage_tracker.py`: ```python class LineageTracker: """Track capability genealogy across generations.""" def record_birth( self, variant_id: str, parent_id: str | None, mutation_type: str, mutation_params: dict ): """Record a new variant's origin.""" def get_ancestry( self, variant_id: str, generations: int = 10 ) -> list[dict]: """Get ancestry chain for a variant.""" def get_descendants( self, variant_id: str ) -> list[dict]: """Get all descendants of a variant.""" def get_mutation_path( self, variant_id: str ) -> list[str]: """Get sequence of mutations from root to variant.""" def compute_inherited_traits( self, variant_id: str ) -> dict: """Compute traits inherited from ancestry.""" ``` ### 5.5.2: Lineage Database ```sql CREATE TABLE capability_lineage ( id INTEGER PRIMARY KEY, variant_id TEXT UNIQUE NOT NULL, parent_id TEXT, mutation_type TEXT NOT NULL, mutation_params JSON, generation INTEGER NOT NULL, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Performance tracking championship_score REAL, promoted BOOLEAN DEFAULT FALSE, success_rate REAL, FOREIGN KEY (parent_id) REFERENCES capability_lineage(variant_id) ); CREATE INDEX idx_parent ON capability_lineage(parent_id); CREATE INDEX idx_generation ON capability_lineage(generation); ``` ### 5.5.3: Lineage Visualization ``` writer_v1 (gen 0, root) ├── writer_v1_variant_1 (gen 1, tighten_constraints) │ └── writer_v1_variant_3 (gen 2, add_retry) [PROMOTED] └── writer_v1_variant_2 (gen 1, loosen_constraints) ├── writer_v1_variant_4 (gen 2, adjust_prompt) └── writer_v1_variant_5 (gen 2, add_validation) ``` ## Deliverables - [ ] `evolution/lineage_tracker.py` - Tracker class - [ ] `lineage` table in ledger - [ ] `record_birth()` - Track new variant origin - [ ] `get_ancestry()` - Trace ancestry chain - [ ] `get_descendants()` - Find all descendants - [ ] `get_mutation_path()` - Mutation sequence analysis - [ ] `compute_inherited_traits()` - Trait inheritance - [ ] API endpoint: `GET /v1/lineage/<variant_id>` - [ ] Visualization: `GET /v1/lineage/<variant_id>/graph` ## Analysis Capabilities ```python # Find all mutations in a lineage mutations = tracker.get_mutation_path("writer_v2") # ["tighten_constraints", "add_retry", "adjust_prompt"] # Find most successful mutation combination best_path = tracker.find_best_path("writer", metric="championship_score") # Compute trait inheritance traits = tracker.compute_inherited_traits("writer_v2") # {"error_handling": 0.9, "retry_logic": True, ...} ``` ## Success Criteria - [ ] Every variant has complete lineage record - [ ] Can trace ancestry to root (10+ generations) - [ ] Can identify mutation sequences - [ ] Can visualize lineage graph - [ ] Inherited traits computed correctly ## Dependencies - #64 (Factory Learning) - uses analytics data ## Estimated Duration 1 week ## Related - Parent: #62 (Phase 5 Meta) - Uses: `evolution/factory_analytics.py`
Author
Owner

🤖 Claimed by gsd-issue-fixer-mesh-seed-67 — starting work

🤖 Claimed by `gsd-issue-fixer-mesh-seed-67` — starting work
Author
Owner

🤖 Claimed by gsd-issue-fixer-mesh-seed-67 — starting work

🤖 Claimed by `gsd-issue-fixer-mesh-seed-67` — starting work
Author
Owner

🤖 Claimed by gsd-issue-fixer-mesh-seed-67 — starting work

🤖 Claimed by `gsd-issue-fixer-mesh-seed-67` — starting work
Author
Owner

🤖 Claimed by gsd-issue-fixer-mesh-seed-67 — starting work

🤖 Claimed by `gsd-issue-fixer-mesh-seed-67` — starting work
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — claimed — starting pipeline

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — claimed — starting pipeline
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — research

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — research
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — research

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — research
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — research

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — research
Author
Owner

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed.
Pipeline state needs reset. Check if another run is in progress.

GSD pipeline blocked at RESEARCH: prerequisite gate (fetch) not passed. Pipeline state needs reset. Check if another run is in progress.
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — plan

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — plan
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — plan

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — plan
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — plan

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — plan
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — implement attempt 1

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — implement attempt 1
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — implement attempt 1

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — implement attempt 1
Author
Owner

🤖 [gsd-issue-fixer-mesh-seed-67] still working — implement attempt 1

🤖 [`gsd-issue-fixer-mesh-seed-67`] still working — implement attempt 1
Mark 2026-06-16 14:21:20 +00:00
  • closed this issue
  • removed the
    quickfix
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#67
No description provided.