PSF: Foundry Progress Sync. 57 high-fidelity blueprints established. Open Fleet routing (Kimi/Qwen) active. GTD updated.

This commit is contained in:
2026-04-07 10:34:16 -04:00
parent 77c0dac025
commit 3b3381a1ac
377 changed files with 34308 additions and 588 deletions

View File

@@ -5,7 +5,7 @@
#+DEPENDS_ON: skill-router skill-performance-auditor
* Overview
The *Economist Agent* manages the PSF's compute resources. It predicts the "Cost of Thought" for a task and autonomously selects the most cost-effective LLM provider or local model based on complexity and remaining budget.
The *Economist Agent* manages compute resources by prioritizing high-performance open-source models (Kimi, Qwen) to minimize costs while maintaining architectural integrity.
* Phase A: Demand (PRD)
:PROPERTIES:
@@ -13,12 +13,7 @@ The *Economist Agent* manages the PSF's compute resources. It predicts the "Cost
:END:
** 1. Purpose
Optimize token usage and compute overhead without sacrificing architectural integrity.
** 2. User Needs
- *Predictive Budgeting:* Estimate token cost before triggering SOTA models.
- *Provider Switching:* Dynamically route tasks between local (Ollama) and cloud (Gemini) models.
- *Audit Reports:* Provide transparency on compute consumption.
Optimize token usage by leveraging open-weights models via OpenRouter.
* Phase B: Blueprint (PROTOCOL)
:PROPERTIES:
@@ -26,38 +21,27 @@ Optimize token usage and compute overhead without sacrificing architectural inte
:END:
** 1. Architectural Intent
The *Economist Agent* provides cost-governance for the Neural Engine. It intercepts `think` requests and determines the optimal Model/Provider based on task complexity, priority, and current budget constraints.
Dynamically route tasks to the "Open Fleet" (Kimi/Qwen).
** 2. Semantic Interfaces
*** Routing Logic (2026 Fleet)
*** Routing Logic (2026 Open Fleet)
#+begin_src lisp :tangle ../projects/org-skill-economist/src/economist-logic.lisp
(in-package :org-agent)
(defun economist-route-task (context)
"Analyzes the stimulus context and returns a prioritized list of providers.
High-priority or complex tasks (e.g., :architect) get powerful models.
Routine tasks (e.g., :heartbeat, :persistence) get cheap/flash models."
(let* ((payload (getf context :payload))
(sensor (getf payload :sensor))
(complexity (ignore-errors (uiop:symbol-call :org-agent.skills.org-skill-router :router-classify-complexity context))))
(cond
;; Explicit user interaction or Reasoning tasks
((or (member sensor '(:user-command)) (eq complexity :REASONING)) '(:openrouter))
;; Cognitive or Reflexive tasks
(t '(:openrouter))))) ; Route through OpenRouter to avoid direct Google 429s
(declare (ignore context))
'(:openrouter)) ; Exclusively use OpenRouter for the Open Fleet
(defun economist-get-model-for-provider (provider &optional context)
"Returns the specific model ID recommended for the given provider/complexity.
Updated for April 2026 SOTA. Prefers Gemini 3.0/2.5 Flash for reflexes."
"Returns Open-Source SOTA model IDs. Updated April 2026."
(let ((complexity (ignore-errors (uiop:symbol-call :org-agent.skills.org-skill-router :router-classify-complexity context))))
(case provider
(:openrouter
(case complexity
(:REASONING "anthropic/claude-3.5-sonnet")
(:COGNITION "moonshotai/kimi-k2.5")
(t "google/gemini-3-flash-preview")))
(:REASONING "qwen/qwen-2.5-72b-instruct") ; Heavy lifting
(:COGNITION "moonshotai/kimi-k2.5") ; Interaction
(t "qwen/qwen-2.5-72b-instruct"))) ; Standard reflex
(t nil))))
#+end_src
@@ -72,9 +56,10 @@ The *Economist Agent* provides cost-governance for the Neural Engine. It interce
* Registration
#+begin_src lisp
(defskill :skill-economist
:priority 100 ; High priority to ensure cost-checks happen first
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :cost-audit))
:neuro (lambda (context) nil)
:symbolic (lambda (action context) (economist-route-task context)))
(progn
(defskill :skill-economist
:priority 100
:trigger (lambda (context) (eq (getf (getf context :payload) :sensor) :cost-audit))
:neuro (lambda (context) nil)
:symbolic (lambda (action context) (economist-route-task context))))
#+end_src