2026-09-23·by Sijie Wang#standmeet#architecture#design

agent-as-injectable-driver

Agent as an injectable driver

Parent: agent-core

✓ LANDED

The agent core is now an independently launchable module via Bridge/Driver pattern.

The design

Agent core = independently launchable module via Bridge/Driver.

The abstraction lives in backend/agentcore/ (deliberately OUTSIDE internal/):

  • driver.go: defines the Driver interface with methods: Persona, Skill, RunSkill, ExtMCPURL, Plugins, SearchCorpus, ListCorpus, GetCorpus, Resolve
    • Agent core is the Abstraction; Driver is the Implementor
  • bridge.go: adapts any Driver onto the loop's internal ports (driverSandboxsandbox.Runner, driverSkillGetter, driverMCPGetter, driverResolver → credential resolver)
  • agentcore.go: public facade over the eino loop types
  • Launch handle: BuildVisitorAgent(ctx, d Driver, in *LaunchInput) (visitor_build.go:50)

The proof it's real

eval-harness/ is a SEPARATE Go module whose EvalDriver (eval_driver.go) implements the interface and runs the REAL eino loop on canned data:

  • golden_assembly_test.go (golden-path scenarios)
  • plugin_assembly_test.go / booker_assembly_test.go (plugin-specific tests)
  • retrieval_assembly_test.go (retrieval / corpus tests)
  • launch_test.go (end-to-end) + the *_live_test.go set on a real model

Only eval launches through the handle today — "eval is just another consumer" holds in the type system, not yet in prod: as of 2026-09-07 (36789537d) BuildVisitorAgent has exactly one non-test caller (eval-harness/main.go:164, candidate.go:138), and no package under backend/internal or backend/cmd imports agentcore. The prod web path is internal/routes/public/sessions.gocapreg.AssembleVisitorBundleinference.RunAgentTurn. The intended end state — prod passes a prod Driver, eval passes an EvalDriver — is the "Remaining" item below.

Iron rules

  1. Re-export of internal/ types = a dependency, forbidden. Callers import only agentcore.
  2. Fixtures live ONLY in the caller (eval-harness). Backend stays fixture-free.
  3. Guarded by check-no-mock: ensures no mock/fixture code creeps into backend.

Class view — the textbook Bridge

Prod and eval are meant to differ by one constructor argument — that is the whole pattern (today only the eval side of it is wired; see above).

Earlier deviation (remediated)

The earlier deviation (fixture files welded into backend/agentcore/) has been REMEDIATED — the directory is fixture-free; canned data lives only behind the injected Driver ("the Driver IS the environment").

Remaining (roadmap layer③)

Promote inject-and-launch from test-only to first-class runtime: parallel prompt experiments — the missing "quality half" of eight-controls-applied.


See also: entry-agnostic-agent (inward/outward symmetry); eval-harness-on-prod-loop (historical context).

about this entry

One of sijie's wiki entries. The AI on this site is grounded in the same corpus and answers in sijie's voice, with citations back to entries like this one — answering costs sijie money, so it waits behind a code: enter an access code →