Phase 3: Factory to bone compilation #36

Closed
opened 2026-03-16 04:58:23 +00:00 by Mark · 2 comments
Owner

Overview

Compile stable factory workflows to fast, deterministic bone functions.

Background

Factories are currently slow (LLM-driven, 5s+ execution). After 1000+ invocations with stable patterns, compile to bones for <25ms execution.

Deliverables

3.1 Pattern detection in PathwayManager

  • Detect factory invocation patterns >1000 calls
  • Check success rate >90%
  • Verify input/output stability
  • Trigger compilation flag

3.2 Bone compilation

  • Convert factory workflow to deterministic function
  • Example: optimize_prompt → bone_optimize_prompt()
  • Store in substrate/bone_compiled.py
  • Fast-path execution (<25ms)

3.3 Bone registry

  • SQLite table for compiled bones
  • Version tracking (bone_v1, v2)
  • Fallback to factory if bone fails

3.4 Self-optimizing loop

  • Factory (slow, flexible) → Bone (fast, compiled)
  • Monitor bone performance in championships
  • Degrade back to factory if quality drops
  • Re-compile with improved patterns

Success Criteria

  • 50%+ of factory traffic uses bones
  • Bone execution <25ms
  • Factory fallback works when bone fails
  • Automatic re-compilation when patterns change

Dependencies

  • Phase 2 (prompt optimizer)
  • BoneCompiler (exists)
  • PathwayManager (exists)

Notes

This is the final optimization layer. Stable patterns become instant, while exploration stays slow and flexible.

## Overview Compile stable factory workflows to fast, deterministic bone functions. ## Background Factories are currently slow (LLM-driven, 5s+ execution). After 1000+ invocations with stable patterns, compile to bones for <25ms execution. ## Deliverables ### 3.1 Pattern detection in PathwayManager - [ ] Detect factory invocation patterns >1000 calls - [ ] Check success rate >90% - [ ] Verify input/output stability - [ ] Trigger compilation flag ### 3.2 Bone compilation - [ ] Convert factory workflow to deterministic function - [ ] Example: `optimize_prompt` → `bone_optimize_prompt()` - [ ] Store in `substrate/bone_compiled.py` - [ ] Fast-path execution (<25ms) ### 3.3 Bone registry - [ ] SQLite table for compiled bones - [ ] Version tracking (bone_v1, v2) - [ ] Fallback to factory if bone fails ### 3.4 Self-optimizing loop - [ ] Factory (slow, flexible) → Bone (fast, compiled) - [ ] Monitor bone performance in championships - [ ] Degrade back to factory if quality drops - [ ] Re-compile with improved patterns ## Success Criteria - [ ] 50%+ of factory traffic uses bones - [ ] Bone execution <25ms - [ ] Factory fallback works when bone fails - [ ] Automatic re-compilation when patterns change ## Dependencies - Phase 2 (prompt optimizer) - BoneCompiler (exists) - PathwayManager (exists) ## Notes This is the final optimization layer. Stable patterns become instant, while exploration stays slow and flexible.
Author
Owner

⏸️ Phase 3 Deferred

Status: Skipped pending execution data accumulation

Reason: Bone compilation requires pattern detection from 1000+ intent executions. Currently have ~0 real executions. Cannot detect stable patterns without data.

Revised Architecture:

Current tiers:
  _nerve/   → experimental (10 capabilities)
  _muscle/  → stable (5 capabilities)

Future tier (when data available):
  _bone/    → compiled, deterministic (fast path)

Promotion flow when ready:
  1. Collect 1000+ executions of muscle capability
  2. PathwayManager detects repeating patterns
  3. BoneCompiler proposes compiled version
  4. Championship: original vs compiled
  5. Winner promoted to _bone/

Blocked by: Need production usage to generate execution patterns

Unblocks: Proceed to other roadmap items

Commit: d03a1aa

## ⏸️ Phase 3 Deferred **Status:** Skipped pending execution data accumulation **Reason:** Bone compilation requires pattern detection from 1000+ intent executions. Currently have ~0 real executions. Cannot detect stable patterns without data. **Revised Architecture:** ``` Current tiers: _nerve/ → experimental (10 capabilities) _muscle/ → stable (5 capabilities) Future tier (when data available): _bone/ → compiled, deterministic (fast path) Promotion flow when ready: 1. Collect 1000+ executions of muscle capability 2. PathwayManager detects repeating patterns 3. BoneCompiler proposes compiled version 4. Championship: original vs compiled 5. Winner promoted to _bone/ ``` **Blocked by:** Need production usage to generate execution patterns **Unblocks:** Proceed to other roadmap items Commit: d03a1aa
Author
Owner

Phase 2.1 decision: add a deterministic provisioning reliability bone now, but this is not full Phase 3 compilation scope.

This work is limited to reliability guardrails for provisioning (provision_reliability_guard_v1) and remains inside core intent/contract flow.
Full factory-to-bone pipeline remains tracked in #36.

Phase 2.1 decision: add a deterministic provisioning reliability bone now, but this is **not** full Phase 3 compilation scope. This work is limited to reliability guardrails for provisioning (`provision_reliability_guard_v1`) and remains inside core intent/contract flow. Full factory-to-bone pipeline remains tracked in #36.
Mark closed this issue 2026-07-22 17:26:16 +00:00
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#36
No description provided.