Repository navigation
feat(device-status): report per device whether a new session can take it - #4547
Conversation
`device status --json` answered how many claim records name a device, not whether `open` accepts one now, so a caller that read the hidden stale-claim count as a block gave up on devices whose owner had provably exited (#4524). Report each claimed device once with `acquirable`, `blockedBy` when it is not, and the `owner` to act on. The answer comes from the decisions an acquisition already applies: the owner half of `foreignClaimSettlement` and the pre-gateway resource check `open` and `device release --stale` run, so no second classifier decides ownership. `status` never touches a device, so it passes no boot observer and reads a live owner as blocking, as `boot`, `install` and `shutdown` do. Share one refusal vocabulary: the table `device release --stale` kept privately is now `deviceClaimRefusalReason`, and retention reasons are typed as `ClaimRecoveryRetentionReason`, so status and release name a block identically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
The acquirability term is defined where device status documents it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…n in device status Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… as a new entry Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review completed against the latest diff
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 11 files (changes from recent commits).
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
…ck reads Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…verdict replaced Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ ApproveSince the last review: 0 new · 0 still open · 0 no longer raised No open findings. 1 finding below 💬 Talking to SentinelIn a finding's thread, reply with:
On this conversation, comment Earlier reviewsReview of
|
|
I reviewed aa910df. CI is green (22 checks, none failing), there is one documentation problem to fix before merge, and I did not run the tests myself. There are no conflicts. The Not blocking, and you can take or leave these: (1) the four "status and open agree" tests in cli-device-status.test.ts compare The open inline threads on the commands.md owner sentence and the hidden-stale wording still apply even though they are marked resolved. This thread and this one are fixed at this head, so you can resolve them. I read the diff but did not run the tests. By reading, the main status test would fail on the merge base because |
The sentence claimed a hidden stale claim alone never means a device is unavailable. Only a dead or superseded owner settles, so a hidden claim whose owner PID was reused, or whose state directory is gone, still reports acquirable:false and `open` refuses it with DEVICE_IN_USE, as does a dead owner whose recording still awaits disposal. State one rule in the owning help text and match both docs pages: the count names hidden records and answers nothing about availability, so read acquirable. Name the hidden owner kinds and pending cleanup that do block. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Acquirability is a --json answer, and each device weighs every claim, so the human view, which renders claims and notices, should not pay for it. Drop the claim that a device no claim names is acquirable: a device can be unreported for another reason, such as a host whose live claims name only its own app devices. Say what the agreement tests pin: the shared inspection, asked as `open` asks it, not a claim taken through `acquireDeviceClaim`. Note why the reporter's acquirer is deliberately unadoptable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Fixed in fd61024. On the non-blocking items:
Both still-applying inline threads are resolved at this head, along with the two you marked fixed. |
|
Coverage re-ran on this head, not because of a code change. The job failed once at fd61024 in |
|
I found no problems in fd61024. The two findings from the earlier review (#4547 (comment)) are fixed: CI shows 22 checks with none failing at this commit. The one Coverage failure was in Of the open inline threads from other reviewers, these four are fixed at this commit, so you can resolve them: the One small note, not raised before and not required: the help's This is ready for human review. |
Summary
device status --jsonanswered how many claim records name a device, not whether a new session cantake it, so a caller that read a non-zero
hiddenStaleClaimsas "busy" gave up on devices whose ownerhad provably exited (#4524).
data.devices[]now carries one entry per claimed device:acquirable,blockedBywhen it is not,and
ownernaming the holder, or on an acquirable device the reclaimable owneropenwould settle.Status asks
inspectDeviceClaimAdmission, the one pure verdict thatopen's pre-acquisition check(
composite-resource-admission) also reads. It wrapsinspectDeviceClaimAcquisitionand theretained-resource check, so claim order (host before app), canonical claim paths, abandoned claims and
unreadable claims follow
openby construction. Status adds one policy: a reclaimable owner with anopen durable resource reports
<kind>-cleanup-pending, since status never runs recovery (#4238).Out of scope: acquisition's own locked re-decision (
acquireDeviceClaim) is pre-existing and stilldecides separately under its claim locks. An abandoned claim of a running daemon is reported as blocked
by that live owner;
openthrough that same daemon may still take it (documented).Scope additions: the refusal-reason table
device release --stalekept privately is nowdeviceClaimRefusalReason, and the inspection and admission types name their reasons(
ClaimRecoveryRetentionReason,DeviceClaimAdmission.retainedBy), soblockedByis a typed union.DeviceClaimReconciliationResult.reason, the reconciler seam below that, staysstring. Statusstays daemonless, touches no device and passes no boot observer; human text output is unchanged, and
the acquirability report is computed only for
--json. The answer is an inspection, not areservation.
Validation
Base
d78be6c887. The whole-project run below is at 22b06fc; later commits were checked with focused tests,tsc,oxlint,check:layeringand the eager-closure budget test.vitest run --project unit-core(whole project): 2019 files, 18829 passed, 10 skipped.pnpm build,tsc -b tsconfig.typecheck.json,oxlint --deny-warnings,oxfmt --check— clean.vitest run --project unit-coreoverpackages/daemon-contracts/src,cli-device-status.test.ts,src/commands/schema,cli-help.test.ts,test/repo-guards, plustsc -bandoxfmt --check— clean. The rule text is owned bycli-help.ts;commands.mdandsessions.mdmatch it.device-claim-admission.test.tscovers the verdict;cli-device-status.test.tshas one status-vs-openagreement test per case: abandoned claim of a running daemon, noncanonical file name, unreadable claim root, host-before-app order. Closure budgets andcheck:layeringpass locally; CI validates the rest.opencan change the answer between inspection and acquisition.Closes #4524
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.