Repository navigation
fix(daemon): compare every supplied lease label with one typed session lease - #4942
Conversation
Size Report
Startup median (7 runs, lower is better):
|
This comment has been minimized.
This comment has been minimized.
|
At 3a16b47 the change has two high-priority defects: nested batch steps drop a declared lease claim, and the session lease now stores canonical values that some readers still compare with the raw request value. A leased session then admits or hides requests depending on how the caller spells or batches them. The one failing check, Coverage, fails on
On base, A second independent pass found that the batch gap is wider than one field. An attested batch on a fresh session, with the right lease and run and a declared tenant that differs from the attested one, passes the collapsed registry check (request-admission.ts:88, :138). The hand-down wrapper at lease-context.ts:170 treats the tenant copied by A second independent pass found that non-string lease values vanish before comparison. The generic RPC schema accepts any object for A second independent pass found that the padded run id case also affects the leased-session check at lease-context.ts:258. A backend-only lease opened with a space-padded run id stores the trimmed run id, and the identical caller value on snapshot is then refused, while base accepted it. Provider, client and device-key labels differ the same way between registry normalization and session comparison. Please compare these labels with the registry's canonicalization and keep invalid and empty labels as mismatches. A second independent pass found that the session list and shutdown cases fail on lease id case. After an open with an upper-case lease id, A second independent pass found that the moved lease id normalizer throws on non-string input. On an ordinary unleased session with no required lease policy, a snapshot with a Not blocking, and fine to take or leave: Not verified here: tests and mutations were not run, the attested batch of [open, snapshot] was traced by reading and not run against a real daemon, which shipped clients send a non-lowercase lease id was not checked, and the other nested producers (selector capture, wait-current-surface, snapshot runtime binding) were not audited for cross-session targets. They appear to act on the parent session, which parent admission already compared. Before merge, hand down every parent displaced claim in |
3a16b47 to
60fbd62
Compare
|
Reply to #4942 (comment). Fixed at 60fbd62, rebased on 0.22 at 64f963a (#4941). Fixed
Each new test fails when its fix is removed (5 mutations). Optional notes
One placement note The table is in Not verified The other nested producers (selector capture, wait-current-surface, snapshot runtime binding) were not audited. They get the claims from the same wrapper when they use the handed-down |
This comment has been minimized.
This comment has been minimized.
|
This follow-up on the earlier review covers 60fbd62. The earlier findings from 3a16b47 are fixed, but a second independent pass found four gaps that still let a conflicting or null lease label reach the session. A second independent pass found that a batch step can drop the parent's lease claim (lease-context.ts:185). On a daemon without required lease policy or tenant isolation, submit a batch for a fresh named session with a conflicting A second independent pass found that explicit null claims disappear from admission (lease-context.ts:288). A snapshot of a leased session with the owner lease id and an explicit null A second independent pass found that the source-install adapter drops null before the shared guard (http-rpc-methods.ts:238). An A second independent pass found that alias selection changed for unleased requests (http-rpc-methods.ts:239). On an unleased named session with no auth hook, an Not blocking, and these can be taken or left: the alias case above also covers the numeric-first form ( Required evidence is satisfied, and there are no conflicts. The only check not passing is Body rules (one failure, one later cancelled run). That gate reads only the PR title and body, so it does not overlap this diff, and the current body passes the gate script locally. The failure most likely belongs to an earlier body revision, so it needs a re-run, not a code change. Not verified here: the tests and the author's five mutations were run, and the regression checks were traced by reading the 3a16b47 code paths. Not verified here: the Body rules job log was read. Not verified here: nested producers other than batch and replay (selector capture, wait-current-surface, snapshot runtime binding) were audited for requests built without the handed-down invoke. Not verified here: the eager-closure budget reason for placing Before merge, the four findings above need fixes, and Body rules needs a re-run on the current body. |
60fbd62 to
1e3d990
Compare
|
Reply to #4942 (comment). Fixed at 1e3d990. The base is 0.22 at 64f963a.
Each new test fails when its fix is removed (4 mutations). The PR body passes Not done: the other nested producers were not audited, and the follow-up issue for the shared alias table was not filed. |
This comment has been minimized.
This comment has been minimized.
|
The earlier findings at 60fbd62 are fixed on the code paths read at 1e3d990, but a second independent pass found two lease-label cases that still bypass the new check, so this needs two more fixes. A second independent pass found that request-admission.ts:61 drops an explicit null tenant. On the local socket, an owner can send a snapshot to an active tenant-scoped leased session with the correct lease id, tenant isolation, A second independent pass found that request-admission.ts:38 throws on a non-string tenant before the lease check runs. On a daemon without an HTTP auth hook, an owner can request a snapshot of an explicitly named, non-isolated leased session with the correct lease id and Not blocking: the 'a null claim' row in lease-context.test.ts:63 uses a Not verified here: tests, mutations and the author's local gates were not run, and regression validity was judged by reading the 60fbd62 code paths. Nested request producers other than batch, replay and find, which use request-router.ts:422, were not audited. The only check not passing is Body rules (cancelled). That job reads the PR title and body, and this delta touches none of that, so it looks unrelated. There are no conflicts. After the two fixes above, Body rules needs a re-run on the current body before merge. |
1e3d990 to
0106304
Compare
|
Reply to #4942 (comment). Fixed at 0106304. The base is 0.22 at e8adbb8.
Each test fails when its fix is removed (3 mutations). One behavior to know: under tenant isolation, a malformed string tenant is still an Not taken: the |
…n lease A leased session admits a request by its lease id and compares each label the request sends. Some labels never reached that comparison: the tenant a caller declared before HTTP attestation replaced it, a flag hidden by meta on the provider-artifact path, and an RPC alias that lost to its sibling. SessionState.lease is now one SessionLease picked from the admitted DeviceLease, and assertRequestPresentsLease(req, lease) is the one comparison for the session check and the active provider-artifact guard. Intake adapters record the labels they displace in DaemonRequest.internal.displacedLeaseClaims. Closes #4910 Closes #4935
Admission no longer copies the lease expiry onto the session, so open state is the only writer of session.lease.
0106304 to
2d6a161
Compare
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 2d6a161. The verdict and the full list are in the summary comment.
…gnore the session lease
This comment has been minimized.
This comment has been minimized.
|
At 62b3e30, both findings from the earlier review (#4942 (comment)) are fixed on the production route. A second independent pass found two remaining defects. CI is green: 15 checks, 0 not passing. There are no conflicts. A second independent pass found that an unattested HTTP request can lose its valid tenant flag before lease admission. Send A second independent pass also found a regression in idle accounting. Enable Not blocking: the Could the guard and its comments be deleted, so that one malformed-tenant refusal remains for non-isolated requests: the call after The open inline thread claiming Not verified here: no tests or mutations were run, and the claim that Both defects above must be fixed and checked with the validation runs described before merge. |
|
Fixed in
Both regression tests fail on |
This comment has been minimized.
This comment has been minimized.
|
Reviewed 116f6dc. The earlier findings from 62b3e30 (#4942 (comment)) are fixed, but a second independent pass found three regressions against the base tenant checks. Not verified here: any of this by running tests or mutations. The claims rest on reading the code paths. A second independent pass found that tenant routing now masks a malformed tenant for unleased requests. On unattested HTTP or the local socket, send a tenant-isolated command with meta.tenantId set to 5 and flags.tenant set to 'team'. Base dcbf9d8 rejects the selected meta tenant at packages/daemon/src/sessions/request-admission.ts:37-44. At the head, lines 42-61 route by the flag and replace meta.tenantId, and line 82 validates only the replacement. With no session lease, session_list returns a successful response. A standalone snapshot targeting an unleased local session named team:demo reaches lease admission, fails for the missing run id, and stamps lastActivityAtMs, so repeated requests can postpone expiry of the local claim. The rule: when no session lease applies to the command, the original selected tenant must pass the base validation before activity accounting. Keep the flag fallback routing and the displaced lease comparison for leased requests. A second independent pass found that newly refused lease-label mismatches still stamp session activity. A standalone snapshot against an active leased session sends the correct lease id and run id in meta and null in flags.runId. The head correctly refuses the null claim at lease-context.ts:248-253. But runAdmitted reaches its finally block with admissionCompleted false, and for a standalone request the guard still calls noteSessionActivity at request-execution-scope.ts:514. The refusal does not renew the remote lease heartbeat, but it does update lastActivityAtMs. The activity stamp should require admissionCompleted on standalone requests as well as bounded steps. A second independent pass found that a malformed tenant can enter the fresh-open device wait. Send an unisolated open for a fresh local session with meta.tenantId set to 'not a tenant', a valid waitMs, and a device already held by another session. Base dcbf9d8 rejects the tenant before device resolution. At the head, device selection and waitForDeviceOutsideLocks run before tenant validation, which happens at line 402. The request can emit contention progress and spend its full budget before returning INVALID_ARGS. The selected tenant should be validated after the preflight session lookup and before the lock plan or the device wait. The locked validation should stay for requests whose session state changes while they wait. Not blocking: the new typeof daemonRequest.meta?.tenantId === 'string' check in http-server.ts:692 repeats the routing rule that scopeRequestSession owns, while clientDeclaredTenant at line 612 still selects with ??, so tenantTrust.tenantId can hold 5 and meta and flags can diverge; one exported routing-tenant selector in request-admission.ts would fix that, and it can be taken or left. The earlier thread claiming session_list and devices skip malformed-tenant admission does not apply: runLocked always enters runAdmitted, and at the head those commands are refused at request-execution-scope.ts:402, which the HTTP test at http-server-proxy-session-lease.test.ts:509 covers, so it can be resolved: #4942 (comment) The only check that did not pass is Body rules, which was cancelled rather than failed; it checks the PR body and does not touch the daemon admission code, and the other 15 checks pass. There are no conflicts. Not verified here: that the proxy forwards meta.tenantId unchanged under clientToken auth, and the steps that run before runAdmitted with a malformed tenant (request_started event, diagnostics, preflight, open wait). Once the three issues above are fixed, re-run the cancelled Body rules check so CI is fully green. |
|
Fixed in
Each new real-daemon regression test fails with its own fix removed. All 1,064 focused tests, including eager-closure budgets, passed. Typecheck, lint, the Fallow audit against |
This comment has been minimized.
This comment has been minimized.
|
The delta at 7a092ca fixes the earlier findings from 116f6dc: refused standalone requests no longer renew session activity, and malformed tenants on A second independent pass found that a falsy non-string tenant now bypasses validation. On the local socket or an unattested command RPC with tenant isolation, send A second independent pass found that routing and policy can now mask the malformed-tenant refusal. In a workspace with two implicit unleased sessions, send an implicit A second independent pass found that final lease admission refusals still advance session activity. An owner sends The open inline thread about malformed tenants on commands that skip lease admission no longer applies at this head, so it can be resolved: The head also rewrites the base test that kept the activity stamp on an ordinary failed lease admission, so no refused standalone request stamps activity now. That matches the earlier ask and the PR description. For a non-isolated malformed tenant, head also records request start and finish events and runs the device-pin and policy checks before the tenant refusal; this changes which refusal wins and the event log, not the activity invariant. The only check that is not passing is Body rules. It was cancelled, not failed, and it validates the PR body text, so it does not exercise the daemon admission route; the other 15 checks pass. There are no conflicts. Re-run the cancelled check so CI is fully green after the fixes. Not verified here: tests and mutations were not run, and these findings rest on reading the head and 116f6dc code paths. |
|
Fixed in
The real-daemon cases fail when their fixes are removed, including the PID-pinned process refusal. All 1,095 focused tests, including eager-closure budgets, passed. Typecheck, lint, Fallow against |
This comment has been minimized.
This comment has been minimized.
|
The three rules from the earlier review (#4942 (comment)) are now met at 36a762e, but one defect remains. CI is green: every check passes except Proof, which is skipping. An earlier Body rules run was cancelled, and that check only validates PR body text. There are no conflicts. A second independent pass found that the early The earlier thread about malformed tenants on commands that skip lease admission no longer applies, so it can be resolved: every command now reaches Not verified here: tests, mutations and typecheck were not run, and the conclusions come from reading the 7a092ca and 36a762e code paths. The attested-tenant HTTP intake path for malformed originals was not exercised. It falls under the remaining labels in #4935, which are out of scope. After this fix, only maintainer judgement is needed before merge. |
|
Fixed in Early session scope and session address resolution now share the same error precedence. When routing throws, admission checks the original tenant without a target session. If tenant validation passes, the original routing error propagates. Both socket regressions return All 1,097 focused tests, including eager-closure budgets, passed. Typecheck, lint, Fallow against |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 9ae2505. The verdict and the full list are in the summary comment.
| export function assertRequestTenantAdmission( | ||
| unscopedReq: DaemonRequest, | ||
| session?: SessionState, | ||
| ): void { | ||
| const { meta, flags } = unscopedReq; | ||
| const rawTenant = meta?.tenantId ?? flags?.tenant; | ||
| const assertLease = () => { | ||
| assertRequestHoldsSessionLease(unscopedReq, session); | ||
| }; | ||
| if ( | ||
| !rawTenant && | ||
| resolveSessionIsolationMode(meta?.sessionIsolation ?? flags?.sessionIsolation) === 'tenant' | ||
| ) { | ||
| assertLease(); | ||
| throw missingIsolatedTenantError(); | ||
| } | ||
| const requestedSession = req.session || 'default'; | ||
| if (isTenantOwnedSessionName(tenant, requestedSession)) { | ||
| return { | ||
| ...req, | ||
| meta: { | ||
| ...req.meta, | ||
| tenantId: tenant, | ||
| sessionIsolation: isolation, | ||
| }, | ||
| }; | ||
| requireWellFormedTenant(rawTenant, assertLease); | ||
| } |
There was a problem hiding this comment.
No longer raised on bd4e032.
🆕 🟡 Minor · Missing-tenant branch in assertRequestTenantAdmission is unreachable; scopeRequestSession throws first
A request that resolves to tenant isolation with no rawTenant gets INVALID_ARGS "session isolation mode tenant requires --tenant" from scopeRequestSession, never the session-lease refusal. createRequestExecutionScope calls scopeRequestSession(unscopedReq)—which throws missingIsolatedTenantError() under exactly the same condition—before either call site of assertRequestTenantAdmission, making the !rawTenant && isolation === 'tenant' branch unreachable. Drop that branch and its re-throw, or move the check ahead of the scoping call so the lease refusal can win.
Details
Also raised here
Also raised at this location by persona javascript: requireWellFormedTenant's beforeRefusal callback is never given one outside assertRequestTenantAdmission — scopeRequestSession (request-admission.ts:46) calls requireWellFormedTenant(...) without the beforeRefusal argument, so a request that reaches admission with tenant isolation forced but the session not yet resolved gets the INVALID_ARGS refusal with no lease-mismatch priority. The parameter and its call-site indirection earn their keep only in assertRequestTenantAdmission (line 102); in scopeRequestSession the optional argument is dead weight that reads like a missed priority hook, so drop the optional parameter and inline the malformed-tenant throw there, or state the two priorities in the helper's doc comment.
persona: javascript, maintainability
Useful? Reply @apex-sentinel-staging like, or @apex-sentinel-staging dislike <why> if it is not.
Reply @apex-sentinel-staging note ... to add context, or @apex-sentinel-staging pivot ... if it is wrong — I will re-check the cited code.
There was a problem hiding this comment.
The branch is reachable. A fresh open with tenant isolation, meta.tenantId: false, and flags.tenant: "e2b" gets through scopeRequestSession: it uses the valid string flag to route to e2b:fresh. resolveRequestSessionName then calls assertRequestTenantAdmission with the original request and no existing session. Nullish selection still yields false, so the branch returns the missing-tenant refusal before device contention.
bd4e032e1f adds this real-daemon case. Removing only the branch made the fresh open check the device holder three times and made both existing inventory cases with 0 and false succeed. The branch stays.
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
|
The findings from the earlier review (#4942 (comment)) are fixed at bd4e032, and no code problem remains from reading the head code and the base db59d00 code paths. Not verified here: tests, mutations and typecheck were not run, and the local socket transport was not re-checked to keep meta.cwd=1 and meta.sessionIsolation='none' (the earlier reading of transport.ts:208-223 was relied on). Could contracts/src/lease-scope.ts own canonical lease-label normalization alongside normalizeLeaseId? Then registry allocation and session admission could share the same rules without making lease-registry-scope.ts depend on the request handling and command registry imports in core/lease-context.ts. Neither open inline thread applies at this head, so both can be resolved: #4942 (comment) (the missing-tenant branch is reachable with meta.tenantId=false and a valid flags.tenant) and #4942 (comment) (every command reaches assertRequestTenantAdmission through resolveRequestSessionName, and the session_list test.each([5, 0, false]) covers it). The only check that is not passing is Body rules, which was cancelled. It validates PR body text, and this change touches only daemon request admission code and tests, so it is likely unrelated. Re-run it to clear it. No conflicts are known. After that, the PR waits for maintainer judgement. |
|
On the design question (could |
|
The design answer covers the open question at bd4e032: moving the normalizer table into contracts would pull kernel and daemon-http normalizers into client import closures, which the eager-closure budget refuses, so it stays beside its only callers in lease-context.ts. No code findings remain and the second pass is clean. Nothing else blocks this head. |
…'s session (#4953) * fix(daemon): answer a busy device without naming another proxy client's session On a proxy shared under one token every client is one tenant, so a leased session belongs to another client, and busy-device answers that carried its address confirmed the session and handed out a handle. A reply may name a holder unless it is another client's: a leased session, or a tenant-scoped session the request does not already see. The open contention refusal, its wait progress, the doctor same-device list, the claimed-device projection, the reboot-takeover warning, and claim- conflict refusals answer generically for that holder; a claim is verified through its state dir. A local session of another workspace keeps its named address: #2580's recovery stands. Closes #4923 * refactor(daemon): keep the reply naming rule beside the session visibility rule in session-routing * fix(daemon): name the owner of a claim that resolves to no session, except to a tenant-scoped request * fix(daemon): name no unlistable holder to a tenant-scoped request * fix(daemon): treat every public-network caller as remote when naming a holder * fix(daemon): require listing visibility for shutdown replies * fix(daemon): gate workspace contention hints on holder visibility * docs: clarify claim owner visibility in device errors * test(daemon): give reply-visibility lease fixtures a backend and canonical lease ids after #4942
…n lease (#4942) * fix(daemon): compare every supplied lease label with one typed session lease A leased session admits a request by its lease id and compares each label the request sends. Some labels never reached that comparison: the tenant a caller declared before HTTP attestation replaced it, a flag hidden by meta on the provider-artifact path, and an RPC alias that lost to its sibling. SessionState.lease is now one SessionLease picked from the admitted DeviceLease, and assertRequestPresentsLease(req, lease) is the one comparison for the session check and the active provider-artifact guard. Intake adapters record the labels they displace in DaemonRequest.internal.displacedLeaseClaims. Closes #4910 Closes #4935 * chore(gates): drop lease-lifecycle from the session.lease writers Admission no longer copies the lease expiry onto the session, so open state is the only writer of session.lease. * fix(daemon): refuse a malformed tenant at routing for commands that ignore the session lease * fix(daemon): preserve tenant routing and refuse malformed tenants before activity * fix(daemon): validate original tenant before open wait and activity * fix(daemon): preserve tenant refusal order and stamp only invoked work * fix(daemon): preserve tenant errors during early session scope resolution * test(daemon): cover falsy tenant refusal before open wait
…'s session (#4953) * fix(daemon): answer a busy device without naming another proxy client's session On a proxy shared under one token every client is one tenant, so a leased session belongs to another client, and busy-device answers that carried its address confirmed the session and handed out a handle. A reply may name a holder unless it is another client's: a leased session, or a tenant-scoped session the request does not already see. The open contention refusal, its wait progress, the doctor same-device list, the claimed-device projection, the reboot-takeover warning, and claim- conflict refusals answer generically for that holder; a claim is verified through its state dir. A local session of another workspace keeps its named address: #2580's recovery stands. Closes #4923 * refactor(daemon): keep the reply naming rule beside the session visibility rule in session-routing * fix(daemon): name the owner of a claim that resolves to no session, except to a tenant-scoped request * fix(daemon): name no unlistable holder to a tenant-scoped request * fix(daemon): treat every public-network caller as remote when naming a holder * fix(daemon): require listing visibility for shutdown replies * fix(daemon): gate workspace contention hints on holder visibility * docs: clarify claim owner visibility in device errors * test(daemon): give reply-visibility lease fixtures a backend and canonical lease ids after #4942
…n lease (callstack#4942) * fix(daemon): compare every supplied lease label with one typed session lease A leased session admits a request by its lease id and compares each label the request sends. Some labels never reached that comparison: the tenant a caller declared before HTTP attestation replaced it, a flag hidden by meta on the provider-artifact path, and an RPC alias that lost to its sibling. SessionState.lease is now one SessionLease picked from the admitted DeviceLease, and assertRequestPresentsLease(req, lease) is the one comparison for the session check and the active provider-artifact guard. Intake adapters record the labels they displace in DaemonRequest.internal.displacedLeaseClaims. Closes callstack#4910 Closes callstack#4935 * chore(gates): drop lease-lifecycle from the session.lease writers Admission no longer copies the lease expiry onto the session, so open state is the only writer of session.lease. * fix(daemon): refuse a malformed tenant at routing for commands that ignore the session lease * fix(daemon): preserve tenant routing and refuse malformed tenants before activity * fix(daemon): validate original tenant before open wait and activity * fix(daemon): preserve tenant refusal order and stamp only invoked work * fix(daemon): preserve tenant errors during early session scope resolution * test(daemon): cover falsy tenant refusal before open wait
…'s session (callstack#4953) * fix(daemon): answer a busy device without naming another proxy client's session On a proxy shared under one token every client is one tenant, so a leased session belongs to another client, and busy-device answers that carried its address confirmed the session and handed out a handle. A reply may name a holder unless it is another client's: a leased session, or a tenant-scoped session the request does not already see. The open contention refusal, its wait progress, the doctor same-device list, the claimed-device projection, the reboot-takeover warning, and claim- conflict refusals answer generically for that holder; a claim is verified through its state dir. A local session of another workspace keeps its named address: callstack#2580's recovery stands. Closes callstack#4923 * refactor(daemon): keep the reply naming rule beside the session visibility rule in session-routing * fix(daemon): name the owner of a claim that resolves to no session, except to a tenant-scoped request * fix(daemon): name no unlistable holder to a tenant-scoped request * fix(daemon): treat every public-network caller as remote when naming a holder * fix(daemon): require listing visibility for shutdown replies * fix(daemon): gate workspace contention hints on holder visibility * docs: clarify claim owner visibility in device errors * test(daemon): give reply-visibility lease fixtures a backend and canonical lease ids after callstack#4942
…n lease (#4942) * fix(daemon): compare every supplied lease label with one typed session lease A leased session admits a request by its lease id and compares each label the request sends. Some labels never reached that comparison: the tenant a caller declared before HTTP attestation replaced it, a flag hidden by meta on the provider-artifact path, and an RPC alias that lost to its sibling. SessionState.lease is now one SessionLease picked from the admitted DeviceLease, and assertRequestPresentsLease(req, lease) is the one comparison for the session check and the active provider-artifact guard. Intake adapters record the labels they displace in DaemonRequest.internal.displacedLeaseClaims. Closes #4910 Closes #4935 * chore(gates): drop lease-lifecycle from the session.lease writers Admission no longer copies the lease expiry onto the session, so open state is the only writer of session.lease. * fix(daemon): refuse a malformed tenant at routing for commands that ignore the session lease * fix(daemon): preserve tenant routing and refuse malformed tenants before activity * fix(daemon): validate original tenant before open wait and activity * fix(daemon): preserve tenant refusal order and stamp only invoked work * fix(daemon): preserve tenant errors during early session scope resolution * test(daemon): cover falsy tenant refusal before open wait
…'s session (#4953) * fix(daemon): answer a busy device without naming another proxy client's session On a proxy shared under one token every client is one tenant, so a leased session belongs to another client, and busy-device answers that carried its address confirmed the session and handed out a handle. A reply may name a holder unless it is another client's: a leased session, or a tenant-scoped session the request does not already see. The open contention refusal, its wait progress, the doctor same-device list, the claimed-device projection, the reboot-takeover warning, and claim- conflict refusals answer generically for that holder; a claim is verified through its state dir. A local session of another workspace keeps its named address: #2580's recovery stands. Closes #4923 * refactor(daemon): keep the reply naming rule beside the session visibility rule in session-routing * fix(daemon): name the owner of a claim that resolves to no session, except to a tenant-scoped request * fix(daemon): name no unlistable holder to a tenant-scoped request * fix(daemon): treat every public-network caller as remote when naming a holder * fix(daemon): require listing visibility for shutdown replies * fix(daemon): gate workspace contention hints on holder visibility * docs: clarify claim owner visibility in device errors * test(daemon): give reply-visibility lease fixtures a backend and canonical lease ids after #4942
Summary
A leased session requires its lease ID and compares every supplied label with the admitted lease (ADR 0007). HTTP, RPC aliases and nested commands can displace labels before admission.
SessionLeasefrom the admitted lease. Compare meta, flags, aliases and displaced claims with one canonical form per field. Carry displaced claims into nested requests.Breaking for clients that send a conflicting label or a non-string label on a leased request.
Before / after
Validation
At
bd4e032e1f, focused Vitest (including eager-closure budgets), typecheck, lint and Fallow againstorigin/0.22pass. Removing the falsy-tenant refusal makes fresh open check device contention. The complete local affected gate passed at116f6dc98d. Hosted CI covers the current head.Closes #4910
Closes #4935