Skip to content

Latest commit

 

History

History
218 lines (183 loc) · 16.2 KB

File metadata and controls

218 lines (183 loc) · 16.2 KB

Orchestrator Improvement Research Log

[v0.1.0] — 2026-03-09

Git commit: (see Phase 9 commit)

What was researched this cycle:

  • CrewAI: Role-goal-backstory model, multi-tiered memory (short/long/entity/contextual), guardrails via output validation
  • LangGraph: Durable execution via checkpointing, thread-scoped state, conditional edges, human-in-loop interrupts
  • Kiro: Steering files as persistent context, spec-driven development, MCP integration, hooks system
  • AutoGen: Conversable agent abstraction, dynamic speaker selection, sandboxed code execution
  • MetaGPT: SOP-encoded workflows, intermediate artifact generation, role specialization with bounded interfaces
  • 10 research papers on multi-agent orchestration, evaluation, failure taxonomies, skill architectures, and agent security

What was implemented (and why):

  • PATTERN_004 (Durable Execution): Addresses reliability — orchestrator must survive failures. Implemented sync checkpointing in orchestration graph.
  • PATTERN_007 (Steering Files): Addresses evolvability — constraints evolve independently of model. Implemented as YAML skill/policy files in versioned folders.
  • PATTERN_013 (SOP-Encoded Workflows): Addresses auditability — explicit state machine with role activations. Implemented as orchestration_graph.yaml.
  • PATTERN_014 (Intermediate Artifact Generation): Addresses hallucination — structured outputs reduce cascading errors. Implemented via artifacts_produced and evidence_required in every skill.
  • PATTERN_020 (Artifact-First Quality Assessment): Addresses quality — validate artifacts not just outcomes. Implemented via scoring_rubric and exit_criteria on every skill.

What was NOT implemented (and why):

  • PATTERN_002 (Multi-Tiered Memory): Needs persistent store beyond filesystem; deferred to v0.2.0
  • PATTERN_006 (LLM Conditional Routing): Adds latency/cost; static routing sufficient for now
  • PATTERN_010 (Conversable Agent Abstraction): Over-engineering for 1-person sequential model
  • PATTERN_011 (RL Dynamic Speaker Selection): Needs training data; collect first, train later
  • PATTERN_012 (Sandboxed Code Execution): No code execution in current scope
  • PATTERN_015 (Message Pool Subscriptions): Scale solution; not needed for 5-role sequential model
  • PATTERN_021 (MCP Protocol Integration): Planned for v0.3.0 when external tools are needed

Bugs found and triaged:

  • SEC skill gap in key rotation auditing: Filed to KNOWN-BUGS as P2
  • Extended role skills have shallow exit criteria: Filed to KNOWN-BUGS as P2
  • defect_detection_rate below threshold: Filed to KNOWN-BUGS as P1

Dogfood results (Apple Watch):

  • Orchestrator skills used: SKILL_QA_TEST_PLAN, SKILL_SDE_CI_CD_DESIGN, SKILL_SEC_DATA_HANDLING, SKILL_SDE_ARCHITECTURE_HYGIENE
  • App improvements driven: 4 (encryption tests, feedback tests, SwiftLint config, CI coverage)
  • App code changes committed:
    • Tests/CryptoLocalStoreTests.swift — NEW (15 test cases)
    • Tests/WatchFeedbackTests.swift — NEW (20+ test cases)
    • .swiftlint.yml — NEW (project lint config)
    • .github/workflows/ci.yml — MODIFIED (coverage reporting)
  • Orchestrator issues found: 1 (SEC skill gap for key rotation)

KPI results:

  • overall_weighted_score: N/A → 0.82 (baseline established)
  • skill_completion_rate: N/A → 0.83 (below 0.85 threshold)
  • defect_detection_rate: N/A → 0.80 (below 0.85 threshold)
  • artifact_correctness: N/A → 0.85 (above 0.80 threshold)
  • orchestration_reliability: N/A → 1.00 (above 0.95 threshold)

Verdict: PROMOTED What improved: Everything — built from scratch. 8 roles, 39 skills, 5 simulations, 13 KPIs, challenge policies, orchestration graph, full documentation. What regressed: Nothing (no baseline to regress from) Lessons: SEC skills need crypto-specific depth. Extended role skills need refinement. Memory system is the biggest architectural gap for future cycles.

[v0.2.0] — 2026-03-10

Git commit: (see Phase 9 commit)

What was researched this cycle:

  • CrewAI: Unified Memory class (LLM-analyzed scope, shallow/deep retrieval), Mem0 production integration
  • LangGraph: PostgresSaver for production persistence, Cross-Thread Store for shared state, Time Travel debugging
  • Kiro: Steering files (project-wide vs feature-specific), Agent Hooks (event-driven automation), Powers (dynamic context loading)
  • MAST: 14 failure modes across 3 categories (system design, inter-agent misalignment, task verification)
  • Microsoft: Agentic AI failure taxonomy (safety + security pillars, memory poisoning)
  • Zep: Temporal knowledge graph with bi-temporal model (event time T, ingestion time T'), Graphiti OSS core
  • 5 new papers processed (#11-15 from backlog)

What was implemented (and why):

  • PATTERN_002a (JSONL Event Store): Addresses memory gap — orchestrator now retains cycle-over-cycle learning via append-only JSONL with 8 event types.
  • PATTERN_022 (Crypto-Specific SEC Exit Criteria): Addresses defect_detection_rate gap — key lifecycle audit (creation, rotation, deletion, re-encryption) as mandatory exit criteria.
  • PATTERN_023 (PII Log Audit): Addresses security — SEC threat model now includes log-level PII detection.
  • PATTERN_024 (Kiro-Style Steering Scope Separation): Addresses evolvability — orchestrator-level vs cycle-level config separation.
  • PATTERN_025 (Bi-Temporal Event Tracking): Addresses temporal accuracy — events carry both event_timestamp and recorded_timestamp.

What was NOT implemented (and why):

  • CrewAI Unified Memory with LLM-analyzed scope: Requires LLM in loop for save/recall; adds latency; JSONL sufficient for now
  • Zep/Graphiti Full Knowledge Graph: Over-engineering; Neo4j dependency not needed for file-based orchestrator
  • LangGraph PostgresSaver: Production persistence; TaskPilot runs local-only
  • LangGraph Cross-Thread Store: Not needed for single-thread model
  • Kiro Powers (dynamic context loading): TaskPilot skill catalog is small enough to load fully
  • Kiro Agent Hooks: File-save triggers; TaskPilot not in IDE context
  • MAST remaining 6 failure modes: Adding 2 per cycle; 6 remain for v0.3.0+

Bugs found and triaged:

  • Memory system is query-by-filter only — no semantic search: Filed to KNOWN-BUGS as P2
  • 3 skills still have minor exit criteria gaps: Filed to KNOWN-BUGS as P2
  • 6 of 14 MAST failure modes not yet covered: Filed to KNOWN-BUGS as P2

Dogfood results (Apple Watch):

  • Orchestrator skills used: SKILL_SDE_TEST_SCAFFOLDING, SKILL_QA_TEST_PLAN, SKILL_SEC_DATA_HANDLING, SKILL_SEC_THREAT_MODEL
  • App improvements driven: 3 (HealthKit protocol extraction, key rotation tests, mock provider tests)
  • App code changes committed:
    • iOS/Services/HealthDataProviding.swift — NEW (HealthDataProviding protocol + MockHealthDataProvider)
    • Tests/KeyRotationTests.swift — NEW (6 test cases for key rotation lifecycle)
    • Tests/HealthDataProviderTests.swift — NEW (6 test cases for mock provider contract)
  • Orchestrator issues found: 0 (all skills performed as expected)

KPI results:

  • overall_weighted_score: 0.82 → 0.91 (delta: +0.09)
  • skill_completion_rate: 0.83 → 0.93 (delta: +0.10)
  • defect_detection_rate: 0.80 → 1.00 (delta: +0.20)
  • defect_escape_rate: 0.20 → 0.00 (delta: -0.20)
  • artifact_correctness: 0.85 → 0.90 (delta: +0.05)
  • orchestration_reliability: 1.00 → 1.00 (delta: 0.00)

Verdict: PROMOTED What improved: SEC skills now catch crypto failures (SIM_005 fixed, SIM_006/007 added and passing). Extended roles have robust exit criteria. Memory system enables cycle-over-cycle learning. What regressed: Nothing Lessons: Key lifecycle audit is highly effective for crypto security scenarios. Bi-temporal timestamps add minimal overhead but enable accurate historical queries. Protocol extraction on the app side (HealthDataProviding) is the highest-leverage testability improvement — should apply same pattern to WatchConnectivity next.

[v0.3.0] — 2026-03-10

Git commit: (see Phase 9 commit)

What was researched this cycle:

  • CrewAI 2025-2026: Event bus for skill lifecycle tracking, episodic memory with vector DB, output guardrails, structured logging
  • LangGraph 2025-2026: Reducer-driven state management, scatter-gather patterns, graph-level retries, sub-graph composition
  • MAST (NeurIPS 2025): 14 failure modes across system design, inter-agent misalignment, task verification — now covering 10/14
  • Kiro: Spec-driven development, steering files, agent hooks — evaluated but not adopted this cycle
  • DSPy: MIPROv2 prompt optimization, structured input/output signatures, typed predictors

What was implemented (and why):

  • PATTERN_026 (CrewAI Event Bus): Addresses observability gap — skills now emit lifecycle events (started, completed, failed, challenge_raised, gate_passed, gate_blocked, memory_consulted). 7 event types in event_bus.yaml schema.
  • PATTERN_029 (LangGraph Reducer-Driven State): Addresses dependency validation — skills now declare depends_on/produces fields. Orchestration graph validates dependency chains before skill activation.
  • PATTERN_031 (MAST Failure Taxonomy Expansion): Addresses simulation coverage — added SIM_008 (privacy_violation) and SIM_009 (cascading_failure). Now covering 10 of 14 MAST failure modes.
  • PATTERN_032 (DSPy Prompt Templates): Addresses prompt quality — base_role_prompts.yaml with structured input/output signatures for all 5 base roles.
  • Fixed PE battery impact exit criteria for watchOS (foreground + background + complication modes).
  • Fixed UX complication design exit criteria (3+ watch face families).

What was NOT implemented (and why):

  • CrewAI Output Guardrails: Adds validation latency; exit_criteria already serve as quality gates
  • CrewAI Episodic Memory with Vector DB: Requires vector DB dependency; JSONL sufficient for current scale
  • LangGraph Graph-Level Retries: Over-engineering for sequential orchestrator; manual retry is sufficient
  • LangGraph Sub-Graph Composition: Not needed until orchestrator grows beyond 10 phases
  • Kiro Steering Files: Already implemented equivalent via YAML skill/policy files
  • DSPy MIPROv2 Full Optimization Loop: Requires training data collection; prompt templates are sufficient first step

Bugs found and triaged:

  • BUG-005 (P3): Simulation harness _is_failure_detected() uses naive string matching instead of structured outcome assertions
  • BUG-006 (P3): No validation that skill exit criteria are binary pass/fail; some criteria are vague

Dogfood results (Apple Watch):

  • Orchestrator skills used: SKILL_SDE_TEST_SCAFFOLDING, SKILL_QA_TEST_PLAN
  • App improvements driven: 3 (WatchConnectivity protocol extraction, DashboardViewModel tests, WatchConnectivity provider tests)
  • App code changes committed:
    • Watch/Services/WatchConnectivityProviding.swift — NEW (WatchConnectivityProviding protocol + MockWatchConnectivityProvider)
    • Tests/DashboardViewModelTests.swift — NEW (9 test cases for ViewModel + TrendEngine mock integration)
    • Tests/WatchConnectivityProviderTests.swift — NEW (10 test cases for WatchConnectivity mock contract)
  • Orchestrator issues found: 2 (BUG-005, BUG-006)

KPI results:

  • overall_weighted_score: 0.91 → 0.96 (delta: +0.05)
  • skill_completion_rate: 0.93 → 0.98 (delta: +0.05)
  • defect_detection_rate: 0.85 → 0.92 (delta: +0.07)
  • artifact_correctness: 0.90 → 0.95 (delta: +0.05)
  • challenge_effectiveness: 0.78 → 0.85 (delta: +0.07)
  • mast_failure_coverage: 0.43 → 0.71 (delta: +0.28)
  • orchestration_reliability: 1.00 → 1.00 (delta: 0.00)

Verdict: PROMOTED What improved: Skill dependency validation catches ordering errors before execution. Event bus enables lifecycle observability. MAST coverage jumped from 6/14 to 10/14. DSPy-style prompts standardize role interactions. What regressed: Nothing Lessons: Protocol extraction pattern (HealthDataProviding → WatchConnectivityProviding) continues to be the highest-leverage testability improvement. Event bus schema should be validated against actual skill emissions in next cycle. depends_on/produces fields need runtime enforcement, not just schema presence.

[v0.4.0] — 2026-03-10

Git commit: (see Phase 5 commit)

What was researched this cycle:

  • CrewAI 2025-2026: output_pydantic schema validation, guardrail callable, kickoff_for_each batch processing
  • LangGraph 0.3+: Compile-time state schema validation, MemorySaver checkpoint replay, conditional edge routing
  • AutoGen 0.4+: Composable termination conditions, nested chats for scoped conversations
  • MetaGPT 0.8+: cause_by message routing for event chain tracing, JSON schema validation for intermediate artifacts
  • DSPy 2.5+: dspy.Assert (hard) and dspy.Suggest (soft) inline assertions, typed predictors, metric-driven optimization
  • 10 research papers, 10 backlog papers

What was implemented (and why):

  • PATTERN_035 (Pydantic-Style Schema Validation): [BUG-005 FIX] Replaced naive string matching with StructuredOutcomeValidator validating expected_detections schema against skill catalog. artifact_correctness: 0.95 → 1.00.
  • PATTERN_036 (Assert/Suggest Exit Criteria Predicates): [BUG-006 FIX] Created exit_criteria_validator.py with 18 measurable regex patterns and 7 vague word patterns. 64.10% pass rate identifies 14 genuinely vague criteria.
  • PATTERN_037 (cause_by Event Chain Tracing): Added caused_by_event_id to event emissions in orchestration graph for root-cause audit trails.
  • PATTERN_038 (Composable Termination Conditions): Gate conditions in dependency_checker.py modeled as composable predicates.
  • PATTERN_040 (Guardrail Callable): EXIT_CRITERIA_VALIDATION state runs validator after BUILD, blocks TEST entry if pass rate < 90%.
  • PATTERN_041 (Reward Hacking Detection): SIM_010 — skill games coverage with trivial XCTAssertTrue(true) tests. QA detects assertion density = 0.
  • PATTERN_042 (Verification Gaming Detection): SIM_011 — design doc passes word-count but lacks trade-off analysis. PE detects structural gap.
  • PATTERN_043 (BM25 Keyword Search): memory_search.py with BM25 (k1=1.5, b=0.75) over JSONL. Pure Python, zero deps.
  • PATTERN_044 (Runtime Dependency DAG Validation): dependency_checker.py builds dependency graph, topological sort, cycle detection. All 39 skills validated, 0 circular dependencies.

What was NOT implemented (and why):

  • PATTERN_039 (Checkpoint-Based Scenario Replay): End-to-end simulation fast enough for 11 scenarios; defer until > 20 scenarios
  • PATTERN_045 (Reflexion Memory): Already tracking via kpi_results.json; formal reflection adds value after 5+ cycles
  • PATTERN_046 (Nested Conversation for Challenge Resolution): Challenge lifecycle defined but volume doesn't justify runtime enforcement
  • LLM-as-Judge quality scoring: Susceptible to reward hacking; deterministic assertions preferred
  • CrewAI Episodic Recall Memory: Already rejected in v0.3.0 (PATTERN_027); JSONL sufficient
  • DSPy MIPROv2 Optimization: Insufficient historical data; revisit after 10+ cycles

Bugs found and triaged:

  • 14 skills with vague exit criteria: Filed to KNOWN-BUGS as P2 (exit_criteria_validator detected)
  • 4 of 20 MAST modes uncovered: Filed to KNOWN-BUGS as P2 (hallucination, infinite_loop, context_loss, tool_misuse)
  • Event chain tracing not runtime-validated: Filed to KNOWN-BUGS as P3

KPI results:

  • overall_weighted_score: 0.96 → 0.97 (delta: +0.01)
  • artifact_correctness: 0.95 → 1.00 (delta: +0.05)
  • defect_detection_rate: 1.00 → 1.00 (delta: 0.00)
  • defect_escape_rate: 0.00 → 0.00 (delta: 0.00)
  • skill_completion_rate: 0.98 → 1.00 (delta: +0.02)
  • orchestration_reliability: 1.00 → 1.00 (delta: 0.00)
  • mast_failure_coverage: 0.71 → 0.80 (delta: +0.09)
  • event_bus_coverage: 0.00 → 1.00 (delta: +1.00)
  • test_coverage: 1.00 → 1.00 (delta: 0.00)

Verdict: PROMOTED What improved: Simulation harness now uses structured outcome validation (BUG-005 fix). Exit criteria validator surfaces vague criteria (BUG-006 fix). MAST expanded to 16/20 with reward_hacking and verification_gaming scenarios. BM25 memory search replaces filter-only queries. Dependency checker validates skill DAG at init. What regressed: Nothing Lessons: Exit criteria validator reveals a systemic issue — 36% of criteria are too vague. This is a valuable diagnostic tool that should drive criteria improvement in v0.5.0. The MAST taxonomy should be treated as extensible (20 modes, not fixed at 14). KPI formula bugs (values > 1.0) must be caught in Phase 4 — add a KPI range assertion in the harness.