Skip to content

feat: add device-aware lease contracts#887

Closed
thymikee wants to merge 3 commits into
mainfrom
advisor/001-device-aware-lease-contracts
Closed

feat: add device-aware lease contracts#887
thymikee wants to merge 3 commits into
mainfrom
advisor/001-device-aware-lease-contracts

Conversation

@thymikee

Copy link
Copy Markdown
Member

Summary

Add provider- and device-aware remote lease contracts so follow-on proxy/session work can share one lease metadata model.

Details: introduces ADR 0007 and CONTEXT vocabulary, extends lease payload/config/state types with optional leaseProvider, deviceKey, and clientId, updates LeaseRegistry to keep DeviceLease as the canonical model with a SimulatorLease compatibility alias, and rejects same backend/provider/device contention with DEVICE_LEASE_BUSY while preserving backend-only leases.

Also adds shared lease-context helpers for request/session fallback and diagnostics consumers. Touched-file count: 15. Scope expanded slightly from the original list to include src/daemon/request-admission.ts, src/remote-config-core.ts, and src/daemon/__tests__/lease-context.test.ts so the new shared contract is parsed and applied consistently. No connect proxy behavior or session cleanup is implemented here.

Validation

Verified with pnpm format, focused lease/context/handler tests, request execution scope tests, remote config option-schema tests, vocabulary grep, and pnpm typecheck.

@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.3 MB 1.3 MB +3.3 kB
JS gzip 437.1 kB 437.8 kB +701 B
npm tarball 575.0 kB 576.0 kB +970 B
npm unpacked 1.9 MB 1.9 MB +4.4 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 27.3 ms 27.6 ms +0.4 ms
CLI --help 47.4 ms 48.9 ms +1.5 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/9722.js +3.2 kB +820 B
dist/src/cli.js -726 B -361 B
dist/src/cli-help.js -151 B -55 B

@thymikee

Copy link
Copy Markdown
Member Author

Closing as superseded by #890, which integrates the lease contract, proxy connect, session admission/expiry, and diagnostics work. Please continue review there.

@thymikee thymikee closed this Jun 26, 2026
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-26 11:35 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant