Skip to content

Commit 69d62bc

Browse files
committed
docs: fix phantom specifiers, the duplicate ADR 0019, and the Node floor
AGENTS.md routed request cancellation/progress and diagnostics to `@agent-device/capture-kit` subpaths that no package exports; both live in `@agent-device/host-kit/request` and `@agent-device/host-kit/diagnostics`. It also claimed `src/daemon/handlers/session.ts` was over budget after that extraction already landed at 242 lines. Two ADRs carried number 0019. The hop trace has its own claims to make, so it now numbers 0023, joins the index, and keeps the links from ADR 0019 and ADR 0022. The Node floor split was undocumented: `engines.node` stays at 22.12 because CI installs the published tarball on that floor, while contributors need 22.13 for the pinned pnpm. CONTRIBUTING now says so, and installation.md names the 22.12 floor and the web backend's Node 24 requirement. Extend the agent-guidance contract to resolve every `@agent-device/*` specifier AGENTS.md names against the owning package's `exports`, so a phantom subpath fails the gate instead of routing an agent to a module that does not exist.
1 parent 49fbaf6 commit 69d62bc

8 files changed

Lines changed: 52 additions & 11 deletions

AGENTS.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ Read the declaration rather than maintaining a prose copy:
5656
`src/commands/common-input-fields.ts` and `src/commands/input-audience.ts`
5757

5858
Shared selector parsing and matching belongs in `@agent-device/selectors`; request cancellation
59-
and progress in `@agent-device/capture-kit` (`request-cancel`, `request-progress`); cross-layer
60-
contracts in `@agent-device/contracts`; CLI flags in `src/commands/cli-grammar`; cross-surface schema
61-
composition in `src/cli-schema`.
59+
and progress in `@agent-device/host-kit/request`; cross-layer contracts in `@agent-device/contracts`;
60+
CLI flags in `src/commands/cli-grammar`; cross-surface schema composition in `src/cli-schema`.
6261

6362
Resolve registry completeness failures at the missing declaration. Diagnose other gate failures
6463
at their reported invariant; do not suppress them or add an allowlist to get a pass. Build interaction
@@ -87,8 +86,6 @@ under `contracts/fixtures/`.
8786
- Tests mirror source topology one-to-one. Split a source module and its test together; do not add to
8887
the legacy `interaction.test.ts` or platform `index.test.ts` aggregations. Pure moves carry their
8988
tests unchanged; rename-only hunks owe no new coverage.
90-
- `src/daemon/handlers/session.ts` is already over budget; extract the relevant platform-specific
91-
concept before adding behavior.
9289

9390
## Toolchain and worktree traps
9491

@@ -104,7 +101,7 @@ under `contracts/fixtures/`.
104101

105102
## Runtime and diagnostics seams
106103

107-
Diagnostics use `@agent-device/capture-kit/diagnostics`. Request diagnostics belong in the session request log;
104+
Diagnostics use `@agent-device/host-kit/diagnostics`. Request diagnostics belong in the session request log;
108105
session artifact paths come from `src/daemon/session-artifact-paths.ts`. App/device logs remain in `app.log`;
109106
Apple runner and xcodebuild output remains in `runner.log`.
110107

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ reviewable change. Detailed testing and device procedures live in the linked foc
77

88
Requirements:
99

10-
- Node.js 22 or newer
10+
- Node.js 22.13 or newer — the pinned pnpm requires it. The published package keeps a lower
11+
`engines.node` floor of 22.12, which CI verifies separately on the installed tarball.
1112
- pnpm at the version pinned in `package.json`
1213
- Android SDK tools (`adb`) for Android work
1314
- Xcode (`simctl`/`devicectl`) for Apple-platform work

docs/adr/0019-request-bound-platform-runtime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ there, not about retiring the directory.
877877

878878
**Entry-to-platform hop count.** Corrected 2026-09-03, re-measured for #2278 at `27a97ee619`:
879879
the counting definition, ordered chains, hop roles, and commit for this measurement are in
880-
[`0019-end-state-hop-trace.md`](./0019-end-state-hop-trace.md), which supersedes the numbers
880+
[`0023-end-state-hop-trace.md`](./0023-end-state-hop-trace.md), which supersedes the numbers
881881
below. A file-by-file re-trace at HEAD measured 41 hops for `press`/Android and 47/49 hops
882882
(shared 30 plus 17/19 per arm) for `snapshot`/iOS, which is now a dual-arm route (in-simulator
883883
AX bridge primary, XCTest runner fallback). The previously stated 38/29 named no ordered chain,

docs/adr/0022-daemon-platform-runtime-coupling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ or owning issue. #2278 audited all four concerns at `27a97ee619`.
7979
4. **The entry-to-platform hop trace was re-run with hop roles**
8080
(policy / orchestration / translation / adapter / pass-through + terminal) and a deletion
8181
test per pass-through/translation hop. The updated artifact is
82-
[`0019-end-state-hop-trace.md`](0019-end-state-hop-trace.md): 41 hops for `press`/Android and
82+
[`0023-end-state-hop-trace.md`](0023-end-state-hop-trace.md): 41 hops for `press`/Android and
8383
47/49 per arm for the now dual-arm `snapshot`/iOS route (shared 30 + AX bridge 17 / runner
8484
fallback 19). The deletion test proves a single distinct removable hop
8585
(`commands/runtime-types.ts`); the request-spine guards (auth comparison, cancellation gate,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ADR-0019 end-state: entry-to-platform hop trace
1+
# ADR-0023: end-state entry-to-platform hop trace
22

33
Backs the "Entry-to-platform hop count" paragraph in
44
[0019-request-bound-platform-runtime.md](./0019-request-bound-platform-runtime.md#end-state-proposed-2026-09-02-maintainer-decision-pending).

docs/adr/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
| [0020 Composable Recorded Fragments (Proposed)](0020-composable-recorded-fragments.md) | lifecycle-free recorded fragment capture/composition, entry guards, fragment-local addresses/digests, staleness, and native `.ad`/Maestro composition |
2525
| [0021 Host — Simlock-Backed Managed Device Allocation and the Host Supervisor](0021-host-simlock-managed-device-allocation.md) | local-first Simlock-managed execution, Host identity/admin boundaries, shape allocation, durable managed-device lease mapping, lifecycle ownership, and supervised maintenance |
2626
| [0022 Daemon — Platform Runtime Coupling Audit and Ownership Ratchets](0022-daemon-platform-runtime-coupling.md) | daemon imports of root `platform-runtime-*` modules, the R76 edge classification inventory, R75 session-authority ratchet, entry-to-platform hop routes and roles |
27+
| [0023 End-State Entry-to-Platform Hop Trace](0023-end-state-hop-trace.md) | the hop counting definition, the ordered `press`/Android and dual-arm `snapshot`/iOS chains, per-hop roles, and the deletion test behind the numbers ADR 0019 and ADR 0022 quote |
2728

2829
ADRs record *why*; the registries and gates they describe are the living source of truth — when
2930
prose and a registry disagree, the registry wins and the ADR needs a follow-up.

scripts/__tests__/agent-guidance-contract.test.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const BYTE_BUDGETS = {
1212
const FOCUSED_DOC_BUDGET = 10_000;
1313
const AGENT_DOCS_TOTAL_BUDGET = 40_000;
1414

15+
type PackageManifest = {
16+
name: string;
17+
exports?: Record<string, unknown>;
18+
};
19+
1520
async function read(relativePath: string): Promise<string> {
1621
return readFile(path.join(ROOT, relativePath), 'utf8');
1722
}
@@ -56,6 +61,40 @@ test('CONTEXT.md remains a glossary rather than an architecture or workflow docu
5661
assert.doesNotMatch(content, /(?:^|\s)(?:docs|packages|scripts|src|test)\//);
5762
});
5863

64+
test('AGENTS.md routes each shared primitive to a package that publishes it', async () => {
65+
const content = await read('AGENTS.md');
66+
const specifiers = [
67+
...new Set(
68+
[...content.matchAll(/@agent-device\/[a-z0-9-]+(?:\/[a-z0-9-]+)*/g)].map((match) => match[0]),
69+
),
70+
];
71+
assert.ok(specifiers.length > 0, 'AGENTS.md must route shared primitives by workspace specifier');
72+
73+
const published = new Map<string, Set<string>>();
74+
for (const directory of await readdir(path.join(ROOT, 'packages'))) {
75+
const manifest = JSON.parse(
76+
await read(path.join('packages', directory, 'package.json')),
77+
) as PackageManifest;
78+
published.set(manifest.name, new Set(Object.keys(manifest.exports ?? {})));
79+
}
80+
81+
for (const specifier of specifiers) {
82+
const [scope = '', name = '', ...segments] = specifier.split('/');
83+
const packageName = `${scope}/${name}`;
84+
const subpaths = published.get(packageName);
85+
assert.ok(
86+
subpaths,
87+
`${specifier}: AGENTS.md names a workspace package that packages/ does not publish`,
88+
);
89+
if (segments.length === 0) continue;
90+
const subpath = `./${segments.join('/')}`;
91+
assert.ok(
92+
subpaths.has(subpath),
93+
`${specifier}: AGENTS.md names a subpath ${packageName} does not export`,
94+
);
95+
}
96+
});
97+
5998
test('the AGENTS.md task router points only at files that exist', async () => {
6099
const content = await read('AGENTS.md');
61100
const table = content.match(/\| When the task involves \| Read \|([\s\S]*?)\n\n/)?.[1];

website/docs/docs/installation.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ One-off `npx` usage is fine for humans and scripts that intentionally fetch from
6565

6666
## Requirements
6767

68-
- Node.js 22+
68+
- Node.js 22.12 or newer
69+
- Node.js 24 or newer for web automation, which hard-fails below it. The rest of the CLI keeps the
70+
22.12 floor, so check `node --version` in the shell that runs `agent-device web setup` and
71+
`agent-device doctor` before trusting a web result.
6972
- Xcode for iOS simulator/device automation (`simctl` + `devicectl`)
7073
- Android SDK / ADB for Android
7174
- HarmonyOS Command Line Tools for HarmonyOS (`hdc` available through `HDC_SDK_PATH`, `DEVECO_SDK_HOME`, or `HARMONYOS_COMMAND_LINE_TOOLS`)

0 commit comments

Comments
 (0)