You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ee47b59
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(contracts): one file per command family, one name per request
Addresses review on #1435.
contracts/client-api.ts was 1,064 LOC and grouped session, app, interaction,
replay, observability and recording contracts together, so it answered no one
question and crossed the >1,000-LOC architecture-debt tripwire in AGENTS.md:124.
Split it into 14 domain-family files by the command families that already exist
(client-connection, client-device-view, client-session, client-lease, client-app,
client-capture, client-target, client-gesture, client-selector-read,
client-replay, client-observability, client-settings, client-system,
client-request); the four Metro client shapes went into the existing
contracts/metro.ts so one file answers the Metro question. Largest resulting
file is 137 LOC. client/client-types.ts re-exports one wildcard per family, so
the published import path is unchanged.
Published surface verified unchanged against main two ways: the exported-name
set of all 11 published entrypoints is identical (70 names), and every
declaration in the built index.d.ts is byte-identical after normalization -- 0
names added, 0 shapes changed. index.d.ts got smaller (1,726 -> 1,682 lines):
10 declarations main duplicated into it now resolve through a shared chunk.
Also, from re-examining the two findings the review flagged as blind spots:
- CommandRequest was a third name for "a request" that no consumer needed.
Every core/command-descriptor/ use read only command/positionals/flags, in two
spellings (the full type and a Pick of it). Replaced by
contracts/dispatched-command.ts DispatchedCommand -- those three fields and
nothing else, with command/positionals Picked from the wire type so they
cannot drift. daemon/types.ts DaemonRequest now extends the wire shape
directly. Two request shapes again, at two ranks.
- The 7 remaining R6 inversions each get a mechanical reason rather than an
appeal to an ADR: the 4 AgentDeviceClient edges are a real zone-level cycle
(client-types.ts imports ProjectedNavigationCommandClient from commands/), and
no narrower port exists (26 call sites across 13 namespaces); the 2
DaemonCommandDescriptor edges are unavoidable because that shape is stated in
terms of the server-private DaemonRequest; the 1 DaemonCommandRoute edge is
unavoidable because the type is computed from the daemon's handler table.
Cleanups found on the way: three doc comments this branch had orphaned from
their declarations (SettleCommandOptions, RecordControlOptions,
ReloadMetroResult -- the last had drifted onto an unrelated type it
misdescribed) are reattached; intra-contracts imports normalized from
'../contracts/x.ts' to './x.ts', which is what the duplicate-import lint caught;
and stale references to the deleted file removed from the docs.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bfu8HofkhybiAm5LECfqur
// it is COMPUTED FROM the daemon's handler table and cannot exist
220
+
// below it. `commands/command-explain.ts` uses it to key an
221
+
// exhaustive `Record<DaemonCommandRoute, string>` of owner files; a
222
+
// hand-written union in contracts/ would drop that exhaustiveness.
223
+
//
224
+
// See docs/dependency-graph-findings.md §0 for the long form. The counts may only go DOWN. Fixing edges without lowering the number fails too, so the baseline
219
225
// cannot quietly stop describing the tree.
220
226
//
221
227
// Exported so scripts/depgraph can assert its own graph build reproduces it — see the
0 commit comments