Repository navigation
Commit 94a0b61
authored
refactor(replay): move the response and observation vocabulary out of the daemon (#2668)
* refactor(replay): move the response and observation vocabulary out of the daemon
First half of PR A for #2663: the replay unit stops importing two daemon
modules, with no file moved and no behaviour changed.
- `errorResponse`/`noActiveSessionError`/`DaemonFailureResponse` move to
`@agent-device/kernel/contracts` beside the `DaemonResponse` shape they build
(#2663's preferred disposition: they carry no daemon semantics). `src/daemon/
response.ts` keeps a daemon-local alias so the 58 non-replay handlers are
untouched; the unit imports the owning specifier. `DaemonResponse`/
`DaemonResponseData` now come from kernel/contracts too, cutting all 22
`daemon-request.ts` response-type edges.
- The ref-publication authority vocabulary (opaque evidence, capture,
projection, result, authority) moves to `@agent-device/contracts/replay`, the
cross-layer contract home both `internal-observation.ts` and the replay unit
already sit above. `src/daemon/replay/**` no longer imports
`src/daemon/internal-observation.ts`: `ReplaySession.observationStore` carries
a `bindAuthority(signal)` binder the handler draws from the bound session
store, so the unit gets the capability without naming the store pair or the
session name. `sessionName` threaded through four capture helpers purely to
re-bind that authority is now dead and removed.
Two findings against the issue, both verified:
- `req.internal` IS read in the unit (3 sites: `session-replay-action-runtime.ts:154`,
`session-replay-maestro-runtime.ts:132,330`, `test-command.ts:237`), contrary
to "No file in the unit reads `req.internal`". Those, plus the 10 remaining
`DaemonRequest`/`DaemonInvokeFn` edges, need the neutral dispatch envelope
#2652 established — the next step of PR A.
- The stated destination `packages/ad-replay/src/daemon-port/` conflicts with
`LOGICAL_MODULE_POLICIES`: `ad-replay` forbids `packages/maestro/`, and the
six Maestro-side replay files import `@agent-device/maestro`, while
`session-replay-maestro-failure.ts` also imports `@agent-device/ad-replay/
divergence`, so no existing engine package can host the port as written.
Part of #2663
* refactor(replay): repoint response constructors at kernel/contracts and delete the alias
Review finding on #2668: `src/daemon/response.ts` as a re-export gave
`errorResponse`, `noActiveSessionError`, `NO_ACTIVE_SESSION_MESSAGE` and
`DaemonFailureResponse` two import paths, which the no-internal-re-export rule
refuses. Completing the migration instead of keeping the alias: all 58
remaining importers now name `@agent-device/kernel/contracts` and
`src/daemon/response.ts` is gone. No gate table named the deleted path.
Also picking up the review's non-blocking notes:
- `sessionName`, left unread by `buildReplayFailureDivergence`,
`TargetBindingDivergenceContext` and the two target-binding response builders
once `sessionName` stopped re-binding the observation authority, is removed
from those signatures and from every caller. `ctx.sessionName` stays:
`dispatchStep` still passes it to `invokeReplayAction`.
- Six `@agent-device/kernel/contracts` imports the first commit inserted between
a function's JSDoc and the declaration are hoisted into the file's import
block, so each doc comment attaches to what it documents again.
Part of #26631 parent c576493 commit 94a0b61
88 files changed
Lines changed: 265 additions & 269 deletions
File tree
- packages
- contracts/src
- facades
- kernel/src
- src/daemon
- __tests__
- handlers
- interaction/internal
- replay/internal
- __tests__
- session-lifecycle/internal
- session-observability/internal
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
174 | 209 | | |
175 | 210 | | |
176 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
4 | 3 | | |
5 | 4 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments