deepseek-harness/packages/core/agent-loop/tests
Tianyi Cui 06cebf1bf4 fix(scope): make the dispatch carrier method-transparent for native-private subjects
ds-review-bot delta-round finding, verified: cordis hands the carrier to
listeners as `this`, and the event declarations type it Scoped<Agent> — so
driving the subject through it (this.send(...) in an agent/* listener) is a
SUPPORTED shape. The withProps-based carrier delegated gets with the PROXY
as receiver, so ReactLoopAgent's send/steer/cancel — which read the
native-private #carrier through a getter — threw TypeError when called that
way (private members do not exist on proxy receivers).

scopeTarget now builds its own proxy: overlay props (the composed filter and
the carrier mark) answer from a null-shadowed literal via hasOwn (`in` would
let Object.prototype's toString/constructor shadow the subject's), every
other get delegates with the BASE as receiver (getters see the real object)
and returns functions bound to the base (method calls execute on the real
receiver), sets land on the base. A proxy-invariant guard reports frozen own
function props unchanged (binding them would violate the get invariant).
This kills the class at the seam — any subject with native privates works,
today's agents and whatever carries them next — instead of patching the one
#carrier field.

Pinned both ways: a scope.spec matrix (native-#private method/getter through
the carrier mutates the real object; set delegation; frozen-own-prop
invariant; overlay non-shadowing) and the bot's exact end-to-end scenario
(an agent/session-start listener calling this.send drives a real turn) —
both fail with TypeError against the withProps carrier.
2026-07-09 14:21:58 +08:00
..
agent.spec.ts simplify(agent): drop the unused public Agent.abort(), keep whenIdle() 2026-06-21 09:05:21 +08:00
cancel.spec.ts refactor(events): remove the agent/stream-chunk mirror of assistant/chunk 2026-07-02 23:42:16 +08:00
config-session-id.spec.ts review: the persona becomes the system-prompt plugin's deployment config 2026-07-05 23:23:46 +08:00
coverage-edges.spec.ts refactor(events): remove the turn boundary mirror events 2026-07-02 03:26:45 +08:00
inbox.spec.ts Reorganize packages into a modular hierarchy 2026-06-20 22:55:20 +08:00
interception.spec.ts fix(loop): record a durable prompt/blocked for every vetoed prompt 2026-07-02 17:03:53 +08:00
loop.spec.ts loop: every request is built from the log — boundary snapshot, header events, config-only waterfall 2026-07-06 03:07:34 +08:00
mock-adapter.ts Reorganize packages into a modular hierarchy 2026-06-20 22:55:20 +08:00
properties.spec.ts feat(types): brand bash ids + stop brand erosion; extract Branded to dsh-brand 2026-06-21 07:19:59 +08:00
request-cache.e2e.ts loop: every request is built from the log — boundary snapshot, header events, config-only waterfall 2026-07-06 03:07:34 +08:00
request-log.spec.ts loop: every request is built from the log — boundary snapshot, header events, config-only waterfall 2026-07-06 03:07:34 +08:00
request-reconstruction.spec.ts fix review findings: one frozen seed through the waterfall; stale agent/request docs 2026-07-06 04:17:29 +08:00
resume.spec.ts feat(events): interception seams — the typed-Decision surface for hooks 2026-06-30 17:11:18 +08:00
review-fixes.spec.ts loop: every request is built from the log — boundary snapshot, header events, config-only waterfall 2026-07-06 03:07:34 +08:00
scope-lifecycle.spec.ts fix(scope): make the dispatch carrier method-transparent for native-private subjects 2026-07-09 14:21:58 +08:00
tool-order.spec.ts feat(core): scope-aware registries and session dispatch carriers 2026-07-09 01:09:21 +08:00