P2: move compactor -> compact/ + step instrumentation -> run/steps.go

- compact/compactor.go: the per-run stateful context compactor (token-threshold
  gate, fast-tier middle summarisation, fold memory) lifted from mort's
  skillexec/compactor.go. Self-contained; its only dependency is a ModelResolver
  func (model.ParseModelForContext satisfies it) + a token threshold.
- run/steps.go: the step-emission/instrumentation (stepEmitter, tool->kind/
  summary mapping with redaction, Result.Steps accumulation) from agentexec,
  repointed onto executus/tool.

Both build green. With the run-loop mechanics, RunnableAgent DTO, run.Ports,
compactor, and step instrumentation now all in place, the remaining P2 work is
the run.Executor itself (wiring these + majordomo's agent loop), which makes
executus runnable.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-26 20:36:32 -04:00
committed by steve
parent d9b44387f5
commit 130c2bdfab
3 changed files with 741 additions and 2 deletions
+3 -2
View File
@@ -45,7 +45,8 @@ CORE (majordomo + stdlib):
identity/ caller identity seams [P0 ✓]
run/ run-loop mechanics + RunnableAgent DTO + [P2 wip]
nil-safe run.Ports (Audit/Budget/Critic/
Checkpointer/PaletteSource) defined; the
Checkpointer/PaletteSource) + step
instrumentation (steps.go) done; the
agentexec+skillexec -> run.Executor MERGE
(consuming Ports) is the remaining P2 work [P2]
dispatchguard/ loop/depth/fan-out caps [P0 ✓]
@@ -55,7 +56,7 @@ CORE (majordomo + stdlib):
(convar->config.Source; UsageSink/TraceSink seams; GenerateWith[T]
structured output — no separate structured/ pkg)
llmmeta/ shared meta-LLM helper over model/ [P1 ✓]
compact/ context compactor (WithCompactor hook) [P2]
compact/ context compactor (WithCompactor hook) [P2]
tools/{web,net,store,compose,meta,comms} generic tools [P3]
BATTERIES (opt-in siblings, each nil-safe + a default):