deepseek-harness/packages/core/tools/src
Yichen Jiang e18aa2745c refactor(scope,agent-presets): per-preset standing mounts over a scope parent chain
A preset is now ONE composition per process, not one per session. The roster
mounts it once under a synthetic standing scope; each agent joins by having
its scope key parented to the mount's. Two mechanisms in dsh-scope carry the
whole change: registration views walk the parent chain (global → preset →
agent, nearest shadowing farthest — ScopedLayers.chainLayers), and scoped
event dispatch admits a listener tagged with an ancestor of the carrier key,
which is what lets a standing composition's plan/compaction/token listeners
observe each agent composed under it while a sibling preset's stay deaf.

The preset plugins already key their state by Session/Agent — they predate
presets and were written for the shared world — so sharing one instance is a
return to their design, not a rewrite. Preset ymls are unchanged: one mount
per preset means one Entry per preset, whose entry-local realms keep two
presets' services apart exactly as they kept two sessions' apart before.

The standing scope hangs off the service's UNTRACED context (selfCtx): a
method invoked through the traceable proxy sees this.ctx rebound to the
caller and carrying its shadow, and a subtree minted from that resolves every
service through the shadow's fiber instead of each entry's own inject store —
preset rows then fail on the very services they declare.

A standing mount survives its agents deliberately. The composition a running
session joined must outlive the file changing or disappearing underneath it;
reclamation happens at whole-tree teardown, and file edits reach only future
generations (the authoring layer swaps the pointer, never disposes a joined
generation).
2026-08-08 17:51:49 +08:00
..
code-mode.ts test(tools): pin the U+200C tail/head split; qualify the identifier-equivalence measurement 2026-08-06 02:09:27 +08:00
index.ts refactor(scope,agent-presets): per-preset standing mounts over a scope parent chain 2026-08-08 17:51:49 +08:00
invariant.ts fix(session): preserve plugin turn invariants 2026-07-28 15:18:48 +08:00
json-schema.ts fix(schema): align projected and enforced declarations 2026-07-23 01:05:41 +08:00
presentation.ts Merge remote-tracking branch 'origin/master' into feat/search-presenter 2026-07-31 14:40:29 +08:00
py-types.ts test(tools): pin the U+200C tail/head split; qualify the identifier-equivalence measurement 2026-08-06 02:09:27 +08:00
schema.ts refactor: migrate linting to Oxlint 2026-07-29 14:32:11 +08:00
testing.ts refactor: migrate linting to Oxlint 2026-07-29 14:32:11 +08:00
ts-types.ts docs(tools): mirror the determinism boundary onto the TypeScript renderer 2026-08-06 01:03:03 +08:00