Files
deepseek-harness/packages/core
Tianyi Cui 35473c2701 Merge branch 'codex/simp-unify-agent-session-id' into codex/simp-ui-identity-residue
# Conflicts:
#	AGENTS.md
#	docs/config-catalog.md
#	docs/event-producer-consumer.md
#	examples/acp-agent/tests/snapshots/advanced-toolchain/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/both-mode-turn/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/cancel/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/code-mode-turn/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/config-options/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/error-finish/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/escalation-approved/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-approved/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/escalation-rejected/session.jsonl
#	examples/acp-agent/tests/snapshots/escalation-rejected/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-edit/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-policy-reject/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-read-window/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-read/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-terminal-card/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-write-overwrite/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/fs-write/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/handshake/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-posttool-block/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-posttool-context/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/session.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-pretool-deny/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-promptsubmit-block/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-promptsubmit-context/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-cc-stop-continue/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-posttool-block/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-posttool-context/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-pretool-block/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-promptsubmit-block/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-promptsubmit-context/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/hook-codex-stop-continue/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/multi-turn/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/permission-switching/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/repeat-tool-guard/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/skill-load/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/subagent-fork/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/subagent-mixed/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/subagent-multi/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/subagent-spawn/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/text-turn/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/todo-plan/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/tool-call-turn/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/workflow-run/stdout.golden.jsonl
#	examples/acp-agent/tests/snapshots/workspace-edit/stdout.golden.jsonl
#	packages/ui/acp/README.md
#	packages/ui/acp/src/index.ts
#	packages/ui/jsonrpc/README.md
#	packages/ui/jsonrpc/src/server.ts
2026-07-18 12:25:33 +08:00
..
2026-07-15 11:28:45 +08:00

core/ — product API spine

The session log, system-prompt assembly, tool registry, agent vocabulary, and concrete loop that form the harness's default control spine. These are product packages — the stable surface plugins and consumers build against.

Package Role ctx key
scope/ Scoped-context registration primitive (scope tags, scope-filtered dispatch) (library — no ctx key)
session/ Event-sourced session log + in-memory store ctx.sessions
system-prompt/ Prompt-section + tool-schema assembly registry ctx.systemPrompt
tools/ Scoped tool registry + pre-policy, guards, around-dispatch, post-policy, and final-result observation ctx.tools
agent/ Agent interface, registry, agent/* event vocabulary ctx.agents
agent-loop/ The concrete loop plugin: ReactLoopAgent + the loop driver ctx.agentLoop

scope/ is the one non-service package here: a dependency-free library (createScope/scopeOf/scopeTarget) the registries and the loop build per-agent scoping on — it sits below session/ and system-prompt/ in the module graph precisely so they can consume it without a cycle.

agent-loop is the one concrete implementation of the agent seam and lives here because it is the harness's default product loop; everything else in core/ is interface/vocabulary. Plugins depend on the agent vocabulary, never on agent-loop directly, so the loop stays swappable.

The default composition that wires this spine into a runnable agent lives in examples/agent-spine-demo: one bundle plugin that loads the control spine plus selected default capabilities (timer + llm + sessions + system-prompt + tools + agents + invariants + the local skill family + tool-bash + workspace-context + agent-loop) and forwards agent-loop's agents list as its own config. It sits in examples/ — ready-to-run demo/reference bundles — not in core/: core/ ships the swappable spine pieces, while a demo bundle picks one concrete composition of them and adds a front door.