chain multi-step requests across known skills

Add the run-ledger chained-run path and make a compound request run its
known skills in order instead of authoring one monolithic skill.

- scheduler/skill: `assess:outcome` gains a `continue` verdict; a continued
  step is re-dispatched with a bounded run ledger (max_reentries + a
  monotonic-progress guard), and the ledger is rendered into the routing and
  assessment state.
- navigation leaf guard (`confirm_skill_fit`) becomes same/part/different and
  is ledger-aware, so the first step of a compound request runs instead of
  being rejected into `create_skill` (a real run picked calculator.calculate
  at 0.99 and was rejected into create_skill).
- results flow forward through `request.run_ledger` (`last_result` helper);
  `simplex.send_message` sends the prior step's result rather than asking the
  LLM bridge to recompute it. Documented in CODEGEN.md.
- `assess:outcome` stays the sole continuation authority: the guard only
  decides whether a skill contributes, never forces a continuation (a forced
  continue on `part` overrode a correct `done` on the final step and authored
  a spurious category).
- verbosity levels, structured SchedulerReply fields, and a send_message
  hermetic test for the chained-result path.
This commit is contained in:
gabby committed 2026-10-10 07:25:17 +00:00
1 parent 9ba14fdab0
commit ab0defca1e
20 files changed
+1046 -324

No files matched your search

+8
View File
@@ -72,6 +72,13 @@ class Request:
reentries: int = 0
resume: dict[str, Any] = field(default_factory=dict)
user_input: str | None = None
#: Compact, deterministic record of the chain of skills already run toward
#: this request: one ``{query, skill (category.name), outcome}`` entry per
#: step. It threads through a continuation so the next step's routing and
#: the outcome assessment see what was already done; empty on a first-step
#: request. Bounded by construction (each outcome is bounded to the
#: speakable budget, and the chain is capped).
run_ledger: list[dict[str, Any]] = field(default_factory=list)
def copy_for_requeue(self) -> "Request":
return Request(
@@ -83,4 +90,5 @@ class Request:
priority=self.priority,
reentries=self.reentries + 1,
resume=dict(self.resume),
run_ledger=[dict(entry) for entry in self.run_ledger],
)