instar 1.3.851 → 1.3.853
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/PlaywrightSeatLease.d.ts +39 -0
- package/dist/core/PlaywrightSeatLease.d.ts.map +1 -0
- package/dist/core/PlaywrightSeatLease.js +130 -0
- package/dist/core/PlaywrightSeatLease.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +41 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +11 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/server/routes.d.ts +3 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +36 -0
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +63 -63
- package/upgrades/1.3.853.md +31 -0
- package/upgrades/eli16/playwright-seat-lease.md +35 -0
- package/upgrades/eli16/pool-view-pin-fixture.md +3 -0
- package/upgrades/side-effects/playwright-seat-lease.md +84 -0
- package/upgrades/side-effects/pool-view-pin-fixture.md +7 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Side-Effects Review — Playwright operator-seat lease
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `playwright-seat-lease`
|
|
4
|
+
**Date:** `2026-07-16`
|
|
5
|
+
**Author:** Instar-codey
|
|
6
|
+
**Second-pass reviewer:** independent reviewer (Codex collaboration agent)
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Adds `PlaywrightSeatLease`, an atomic host-wide TTL lease stored under `~/.instar/state`; exposes an authenticated acquisition route; and extends the installed MCP PreToolUse hook to acquire or renew before every Playwright call. Tests cover renewal, conflict, expiry, corrupt-state recovery, route wiring, installed-hook content, and an end-to-end hook conflict.
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `external-operation-gate.js` Playwright preflight — **add** — blocks a tool only when the lease API positively reports another live holder.
|
|
15
|
+
- `PlaywrightSeatLease.acquire` — **add** — deterministically grants same-holder renewal, rejects a different live holder, and reclaims expired state.
|
|
16
|
+
|
|
17
|
+
## 1. Over-block
|
|
18
|
+
|
|
19
|
+
The host-wide default-seat key conservatively serializes Playwright calls even if two MCP installations happen to use physically distinct implicit defaults. This trades some possible parallelism for correctness. The ten-minute quiet-period TTL can also make a new drive wait after the former drive finished without explicitly releasing.
|
|
20
|
+
|
|
21
|
+
## 2. Under-block
|
|
22
|
+
|
|
23
|
+
Callers without a spawn-unique `INSTAR_SESSION_ID` and callers whose local server or lease store is unavailable fail open. A browser call exceeding the ten-minute bounded MCP execution window could outlive its lease because renewal occurs at tool-call boundaries; Instar's browser calls are bounded below that window. Only a confirmed conflict holds blocking authority. This coordinates trusted local agent sessions, not hostile processes that already possess the agent's bearer credential.
|
|
24
|
+
|
|
25
|
+
## 3. Level-of-abstraction fit
|
|
26
|
+
|
|
27
|
+
The lease is enforced at the MCP PreToolUse chokepoint, the only layer through which all agent Playwright calls pass. The authority is a filesystem-backed mutual-exclusion invariant, not a probabilistic detector. State is host-wide rather than registry-local because the contested resource is a physical browser profile shared across agent homes.
|
|
28
|
+
|
|
29
|
+
## 4. Signal vs authority compliance
|
|
30
|
+
|
|
31
|
+
- [x] Yes — but the blocking rule is a hard mutual-exclusion invariant, not brittle inference.
|
|
32
|
+
|
|
33
|
+
The gate does not infer whether another drive “looks active.” It blocks only on an unexpired, atomically written ownership record for the same physical seat, keyed by the spawn-unique session id rather than a reusable tmux name. Uncertainty or infrastructure failure does not fabricate a conflict.
|
|
34
|
+
|
|
35
|
+
## 4b. Judgment-point check
|
|
36
|
+
|
|
37
|
+
No competing-signals judgment point is introduced. Exclusive ownership of one mutable browser seat is an enumerable safety invariant: same holder renews, different live holder waits, expired holder is reclaimed.
|
|
38
|
+
|
|
39
|
+
## 5. Interactions
|
|
40
|
+
|
|
41
|
+
- **Shadowing:** Playwright lease acquisition runs before the existing mutability fast path, intentionally covering read-like snapshots; on success the existing external-operation classification continues unchanged.
|
|
42
|
+
- **Double-fire:** same-holder acquisition is idempotent and only extends expiry.
|
|
43
|
+
- **Races:** cross-process writes use an exclusive lock plus atomic rename. Stale lock files are recoverable after the bounded lock window.
|
|
44
|
+
- **Feedback loops:** no background loop, notice, retry, or autonomous action is added.
|
|
45
|
+
|
|
46
|
+
## 6. External surfaces
|
|
47
|
+
|
|
48
|
+
Other agents on the same host share the lease and may receive a plain busy response. A new machine-local state file stores only holder/session labels and timestamps, no cookies, page data, credentials, or URLs. No external service API changes and no operator-facing action is added.
|
|
49
|
+
|
|
50
|
+
## 6b. Operator-surface quality
|
|
51
|
+
|
|
52
|
+
No operator surface — not applicable.
|
|
53
|
+
|
|
54
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
55
|
+
|
|
56
|
+
**Machine-local BY DESIGN — `physical-credential-locality`.** The protected browser cookies and user-data directory physically live on one machine. Each machine therefore coordinates its own seat; replicating the lease would incorrectly block an independent browser on another host. It emits no user-facing notices, strands no topic-owned durable state, and generates no URLs.
|
|
57
|
+
|
|
58
|
+
## 8. Rollback cost
|
|
59
|
+
|
|
60
|
+
Revert and ship a patch. The leftover lease JSON is harmless and expires by timestamp; no migration or agent-state repair is required. The hook migrator will replace the enforcement hook with the reverted template.
|
|
61
|
+
|
|
62
|
+
## Conclusion
|
|
63
|
+
|
|
64
|
+
The review rejected live-profile cloning and moved coordination to a host-wide lease at the actual Playwright tool chokepoint. It also decoupled safety from the optional registry gate and replaced reusable-name ownership with spawn-unique identity. The remaining deliberate tradeoffs are a bounded post-drive wait and fail-open degradation when coordination itself is unavailable. Independent second-pass review now concurs.
|
|
65
|
+
|
|
66
|
+
## Second-pass review
|
|
67
|
+
|
|
68
|
+
**Reviewer:** independent reviewer (Codex collaboration agent)
|
|
69
|
+
**Independent read of the artifact:** concur
|
|
70
|
+
|
|
71
|
+
Concur for the dispatched dogfood contention case after the review-driven corrections: spawn-unique ownership closes predecessor impersonation; the fleet-available route closes the registry-gate hole; the ten-minute TTL covers the explicitly bounded Instar MCP execution window; and trusted-local-peer/fail-open boundaries are disclosed. The conservative post-drive hold is an accepted latency tradeoff, not a correctness blocker.
|
|
72
|
+
|
|
73
|
+
## Evidence pointers
|
|
74
|
+
|
|
75
|
+
- `tests/unit/PlaywrightSeatLease.test.ts`
|
|
76
|
+
- `tests/integration/playwright-profile-routes.test.ts`
|
|
77
|
+
- `tests/unit/hook-installation.test.ts`
|
|
78
|
+
|
|
79
|
+
## Class-Closure Declaration (display-only mirror)
|
|
80
|
+
|
|
81
|
+
No agent-authored-artifact defect — not applicable. This closes a missing concurrency primitive rather than a malformed prompt/hook contract class.
|
|
82
|
+
# CI follow-up
|
|
83
|
+
|
|
84
|
+
Added class-level documentation only; runtime behavior and the reviewed safety boundary are unchanged.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Side-effects review
|
|
2
|
+
|
|
3
|
+
- Runtime behavior is unchanged; only an integration-test fixture and its matching assertion changed.
|
|
4
|
+
- The PIN remains deterministic so failures are reproducible.
|
|
5
|
+
- The higher-entropy value sharply reduces accidental substring collisions in serialized envelopes.
|
|
6
|
+
- The PIN-gated view coverage continues to use the same fixture through the shared constant.
|
|
7
|
+
- Second pass: focused suite green; no additional seams identified.
|