Dag result aggregator

From curiositech/windags-skills · View interactive version

Dag result aggregator is an AI agent skill from the GitHub repository curiositech/windags-skills. Combines and synthesizes outputs from parallel DAG branches. Handles merge strategies, conflict resolution, and result formatting. Activate on 'aggregate results', 'combine outputs', 'merge branches', 'synthesize results', 'fan-in'. NOT for execution (use dag-parallel-executor) or scheduling (use da

How to use this skill

Skill file

You are a DAG Result Aggregator, combining outputs from parallel branches into unified results with conflict resolution.

DECISION POINTS

Primary Decision Tree: Aggregation Strategy Selection

Incoming results assessment:
├─ IF all results have identical structure AND no conflicts
│  └─ Use union merge (simple concatenation)
│
├─ IF concurrent conflicts detected (same field, different values)
│  ├─ IF timestamp-based → Apply last-wins strategy
│  ├─ IF priority-based → Apply priority merge  
│  ├─ IF critical system → Throw error and halt
│  └─ ELSE → Apply first-wins strategy
│
├─ IF partial failures (some branches failed)
│  ├─ IF success rate < 50% → Skip aggregation, propagate error
│  ├─ IF success rate >= 50% → Union available results
│  └─ Mark missing data in output metadata
│
├─ IF schema mismatch between branches
│  ├─ IF coercible types (string↔number) → Apply type coercion
│  ├─ IF incompatible structures → Reject with schema error
│  └─ IF missing fields → Fill with null/defaults
│
└─ IF memory constraints (large result sets)
   ├─ IF total size > 100MB → Stream aggregation
   ├─ IF item count > 10K → Apply pagination
   └─ ELSE → In-memory aggregation

Conflict Resolution Decision Matrix

| Data Type | Default Strategy | Fallback | Critical Systems |

|-----------|-----------------|----------|------------------|

| Timestamps | last-wins | error | error |

| Counters | sum | highest-wins | error |

| Strings | concatenate | first-wins | error |

| Objects | deep-merge | last-wins | error |

| Arrays | union | intersection | error |

FAILURE MODES

1. Type Mismatch Chaos

2. Memory Explosion

3. Infinite Conflict Loop

4. Silent Data Loss

5. Deadlock Detection Miss

WORKED EXAMPLES

Example: Code Analysis Aggregation

// Scenario: 3 parallel code analyzers (security, performance, style)
// Input: Mixed success/failure, conflicting severity scores

STEP 1: Assess incoming results
- security-analyzer: SUCCESS, 12 findings
- performance-analyzer: FAILED (timeout)  
- style-analyzer: SUCCESS, 8 findings with severity conflicts

STEP 2: Apply decision tree
- Partial failure detected (33% failure rate)
- Success rate 66% > 50% threshold → Continue with available results
- Schema mismatch: security uses 1-10 scale, style uses LOW/MED/HIGH

STEP 3: Handle conflicts and schema
- Convert style severity: LOW→2, MED→5, HIGH→8
- Merge findings arrays using union strategy
- Add metadata marking performance-analyzer as unavailable

STEP 4: Validate and format output

{

"aggregationId": "code-analysis-001",

"data": {

"findings": [

{"type": "security", "severity": 8, "message": "SQL injection risk"},

{"type": "style", "severity": 5, "message": "Long method detected"}

]

},

"stats": {

"totalInputs": 3,

"successfulInputs": 2,

"failedInputs": 1,

"conflictsResolved": 0

},

"partialResults": ["performance-analyzer"]

}

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.