swarm: local-swarm integration harness + one-flip primitive seam + telemetry
- primitive_seam.el: SWARM_PRIMITIVE_SEAM selects stub (default, hermetic) vs decorated (reshape's dharma-bus primitives). Every seam call is an afferent signal; telemetry (seam_mode + afferent tick) rides the vertical result path. - primitive_binding.el: THE ONE FLIP POINT — bound_think/attend/learn today fall back to the stub; when the reshape's decorated primitives land, flip one line each and set SWARM_PRIMITIVE_SEAM=decorated. No other change anywhere. - swarm.el: default blueprint routes think through the seam; the @manager aggregates afferent counters from worker results (containment-safe, no shared bus register) and journals a swarm.telemetry record; telemetry in the return. - harness_local_swarm.el: 17/17 GREEN on :8901 with the stub — 8 native-thread workers at concurrency 4, reduce+vote convergence, CCR scoping+non-leak, all three containment rules (incl. live Rule-2 denial), durable work-tracking, afferent telemetry observed. Runs identically under seam=decorated today (binding fallback), proving the flip path executes. Engram writes stay opt-in (durable journal is the substrate); daemon healthy.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// primitive_binding.el — THE ONE FLIP POINT.
|
||||
//
|
||||
// This file is the single seam between the swarm and the real agentic
|
||||
// primitives. Binding the reshape's decorated primitives is a one-line change
|
||||
// HERE and nothing else changes anywhere in the swarm.
|
||||
//
|
||||
// The api-reshape agent (wt/api-reshape) is wiring the primitives as DECORATED
|
||||
// El on the dharma_* event bus over the engram — think/attend/learn/ground/assert
|
||||
// become decorated fns that emit afferent events onto the bus. The moment they
|
||||
// land, flip `bound_think` (and its siblings) to call them.
|
||||
//
|
||||
// TODAY (stub fallback, compiles + runs now against :8901):
|
||||
// fn bound_think(...) { return primitive_think(ctx, instruction) }
|
||||
//
|
||||
// THE FLIP (when reshape's decorated primitives land — one line each):
|
||||
// fn bound_think(...) { return think(ctx, instruction) } // decorated, on dharma bus
|
||||
//
|
||||
// Keep the stub as fallback: `bound_think` is only reached when the seam mode is
|
||||
// "decorated" (SWARM_PRIMITIVE_SEAM=decorated). Until you flip these bodies AND
|
||||
// set that env, the harness runs entirely on the hermetic stub.
|
||||
|
||||
// bound_think — decorated `think` over a worker's compiled context.
|
||||
fn bound_think(ctx: String, instruction: String) -> String {
|
||||
// FLIP HERE -> `return think(ctx, instruction)` once the decorated primitive lands.
|
||||
return primitive_think(ctx, instruction)
|
||||
}
|
||||
|
||||
// bound_attend — decorated retrieval over the dharma bus (falls back to the
|
||||
// HTTP/engram attend today).
|
||||
fn bound_attend(query: String, limit: Int) -> String {
|
||||
// FLIP HERE -> `return attend(query, limit)` once decorated.
|
||||
return primitive_attend(query, limit)
|
||||
}
|
||||
|
||||
// bound_learn — decorated write onto the bus (falls back to opt-in engram write).
|
||||
fn bound_learn(corr_id: String, observation: String) -> String {
|
||||
// FLIP HERE -> `return learn(corr_id, observation)` once decorated.
|
||||
return primitive_learn(corr_id, observation)
|
||||
}
|
||||
Reference in New Issue
Block a user