fix(orchestrator): agentic LLM decompose + capability matching (composition keystone, #133) - #151
Open
LamaSu wants to merge 5 commits into
Open
fix(orchestrator): agentic LLM decompose + capability matching (composition keystone, #133)#151LamaSu wants to merge 5 commits into
LamaSu wants to merge 5 commits into
Conversation
…elds (#133) Adds the resting state after decompose (not auto-published) and the per-node matchStatus/matchedCapabilityId/matchedKernelId/matchScore fields plus DecompositionResult.derivedBudget/matchedCount/usedLLM/usedFallback so a decomposition can be priced and evidenced from the matched capabilities. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…cher (#133) Pure, dependency-injected engine: LLM planner (lazy Anthropic, degrades to an offline heuristic without a key) -> semantic match each step to a registered capability -> derive budget from matched prices and evidence from the matched cap's domain+tier. Legacy templates are used only when neither an LLM nor any match grounded the plan, so a non-document goal can never become a doc DAG. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…s routes; no auto-publish (#133) POST /api/requests and /decompose now run the agentic engine, leave the request 'decomposed' (publishing stays the explicit /publish step), and derive the budget from matched capability prices instead of the hardcoded 1000 default. critical-path is computed from the stored DAG rather than re-decomposing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… units (#133) Pure-engine acceptance: 'margherita pizza delivered to Manhattan' -> make(Marios wood-fired-pizza) + delivery(Daves local-courier-delivery), budget 18 derived, evidence from caps (not pdf_proof), never published, never a document DAG. Route integration seeds the two caps and asserts the same end-to-end. Updates legacy expectations (decomposed status, HPLC now matches a registered hplc cap). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9 tasks
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.
What & why
POST /api/requests/{id}/decomposewas hardcoded to a document-printing + logisticstemplate and ignored the natural-language goal. "a 12-inch margherita pizza made and
delivered to me in Manhattan" produced
[doc-prep, printing, courier-pickup, delivery],evidenceRequirements=['pdf_proof'],budget=1000, and zero capability matches.This makes decompose agentic (LLM-driven, with a deterministic offline fallback) and
grounds every node to a registered capability via semantic search — the composition
keystone (coord bulletin #133).
How
services/agentic-decomposer.ts(new): a pure, dependency-injected engine.@anthropic-ai/sdk, degrades to an offlineheuristic when no
ANTHROPIC_API_KEY).over the live registry (
CapabilityFacade).from each matched cap's domain + assurance tier.
Legacy keyword templates are used only when neither an LLM nor any capability
grounded the plan — so a non-document goal can never become a document DAG.
services/request-decomposer.ts:print_delivernow requires a realdocument/print signal — generic "deliver/courier/mail/ship" no longer selects the
document template (the feat(dashboard): living substrate visualizer — generative topology #133 root cause). Exposes
calculateCriticalPath.routes/requests.ts:POST /api/requestsand/decomposerun the agenticengine, leave the request
decomposed(publishing stays the explicit/publishstep — no auto-publish), and derive the budget from matched prices instead of the
hardcoded 1000.
critical-pathis computed from the stored DAG (no re-decompose).spec:+"decomposed"request status; per-nodematchStatus/matchedCapabilityId/matchedKernelId/matchScore;DecompositionResultderivedBudget/matchedCount/usedLLM/usedFallback.Acceptance
Marios Pizzeria
wood-fired-pizza+ delivery node matched to Daves Deliverylocal-courier-delivery.evidenceRequirementsfrom the matched cap (e.g.photo_of_completed_item,delivery_confirmation), neverpdf_proof.status: "decomposed").the template-detection, and the route layers).
Tests
__tests__/agentic-decomposer.test.ts(new, 14 tests): pure-engine acceptance withinjected stub LLM + matcher (no network), plus matcher / heuristic / parser units.
__tests__/requests.test.ts: route integration seeds the two caps and asserts thefull pizza flow; legacy expectations updated (
decomposedstatus; the HPLC requestnow matches a registered
hplccapability).Do not merge or deploy from this PR (both are gated).
🤖 Generated with Claude Code