refactor(examples): DRY the acp-agent configs via base-core.yml + acp-tail.yml
The snapshot replay config duplicated most of base.yml + the acp tail just to swap llm-deepseek → llm-replay. Factor the shared pieces: - examples/base-core.yml: the providerless provider/tool core (llm, sessions, system-prompt, tools, agents, invariants, bash-local, tool-bash). base.yml is now base-core + the llm-deepseek adapter; the snapshot replay config is base-core + llm-replay. The replay config no longer hand-copies the core. - examples/acp-agent/acp-tail.yml: agent-loop (no pre-created agents) + persistence + the ACP bridge/system-prompt, shared by cordis.yml and the replay config so the three acp-agent configs can't drift. Its persistence root is `$DSH_SNAPSHOT_SESSIONS_ROOT ?? ./.sessions`. - Deleted cordis.snapshot-record.yml: recording now reuses the normal cordis.yml (real adapter), with the harness redirecting the persistence root via env. start.ts maps DSH_SNAPSHOT=record → cordis.yml. Verified: snapshot replay 8/8 keyless; record path works through cordis.yml; ACP e2e no-key boot green through the doubly-nested include (cordis.yml → base.yml → base-core.yml); coding-agent boots clean; all gates pass.
This commit is contained in:
@@ -46,7 +46,7 @@ Replay is positional: the Nth `stream()` call serves the Nth `ReplayEntry`. This
|
||||
|
||||
Recording runs the scenario with the real `llm-deepseek` adapter and the JSONL persistence backend, then copies the produced `.jsonl` into the scenario dir. Per-event appends are durable, but the harness shuts the subprocess down gracefully (close stdin → `await ctx.dispose()`) before harvesting so the final events are flushed. `llm-replay` itself does no recording — it is replay-only.
|
||||
|
||||
`examples/base.yml` always loads `@deepseek-ai/dsh-llm-deepseek`, whose `apply` throws when no API key is present ([packages/llm-deepseek/src/index.ts](../../../packages/llm-deepseek/src/index.ts)). So replay cannot reuse the normal config — it uses a dedicated `examples/acp-agent/cordis.snapshot.yml` that omits `llm-deepseek` and installs `llm-replay` in its place. Recording uses a config that loads the real adapter (no `llm-replay`). In replay mode `start.ts` also skips `.env` loading so a stray key cannot trigger a live call.
|
||||
`examples/base.yml` always loads `@deepseek-ai/dsh-llm-deepseek`, whose `apply` throws when no API key is present ([packages/llm-deepseek/src/index.ts](../../../packages/llm-deepseek/src/index.ts)). So replay cannot reuse the normal config — it uses a dedicated `examples/acp-agent/cordis.snapshot.yml` that installs `llm-replay` in place of the adapter. To avoid duplicating the rest of the tree, the providerless core is factored into `examples/base-core.yml` (shared by `base.yml = base-core + llm-deepseek` and the replay config = `base-core + llm-replay`), and the agent-loop/persistence/ACP-bridge tail into `examples/acp-agent/acp-tail.yml` (shared by `cordis.yml` and the replay config). Recording reuses the normal `cordis.yml` (real adapter) — its persistence root reads `$DSH_SNAPSHOT_SESSIONS_ROOT` when the harness sets it — so there is no separate record config. In replay mode `start.ts` skips `.env` loading so a stray key cannot trigger a live call.
|
||||
|
||||
### Two goldens: normalize, then snapshot
|
||||
|
||||
|
||||
Reference in New Issue
Block a user