Skip to content

perf(daemon): classify a device claim owner only for refusals and settlement - #5210

Merged
thymikee merged 1 commit into
mainfrom
perf/device-claim-admission-lazy-classify
Nov 29, 2026
Merged

thymikee merged 1 commit into
mainfrom
perf/device-claim-admission-lazy-classify

Conversation

@thymikee

@thymikee thymikee commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Claim admission took a process-identity snapshot (ps on POSIX, a CIM query on Windows) before knowing whether the claim record alone answered. Covered claims, current-owner held claims, and this daemon's abandoned claims are now decided from the decoded record. The same entry is classified only for a conflict or a foreign settlement.

Not changed: the claim scan of a macOS or web host still takes its list snapshot.

Security (ownership boundary): no ownership decision changed. The record-only checks never read the classification, keep their order and inputs, and still run under the same claim locks. A claim reaching a refusal or foreign settlement is classified before that decision, so reboot proof, reconciliation permission and public reasons see the same value. Host-scoped, stale-release and startup-sweep paths are untouched.

Value

Owner classifications per call, base → head:

  • covered or held claim: 1 → 0
  • transient refusal or preview over a foreign or other-session owner: 2 → 1
  • open refusal: 1 → 1

Validation

Tested a25a0d7f5: device-claim-settlement.test.ts, 33/33. Against base sources, 6 new cases fail on counts (10 instead of 0; 2 instead of 1).

A scratch comparison of preview and acquire, for install and open, over live, superseded, dead, reused-PID, other-session, in-flight and undecodable claims gave identical status and classification at base and head.

Other tests, typecheck and gates are left to CI. No independent review; the author re-read the diff.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

…tlement

Claim admission took a process-identity snapshot before it knew whether the
record alone answered. Covered, held, and abandoned claims of this daemon are
now decided from the decoded record, and the same entry is classified only when
a conflict or a foreign settlement needs the owner.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.70 MB 6.70 MB -94 B
Package (unpacked) 6.69 MB 6.69 MB -94 B
Package (download) 2.04 MB 2.04 MB -13 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 19.9 ms 18.9 ms -1.1 ms
CLI --help 44.8 ms 41.3 ms -3.5 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of a25a0d7

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (47e3fbe2758c).

💬 Talking to Sentinel

In a finding's thread, reply with:

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.

@thymikee

Copy link
Copy Markdown
Member Author

The PR is ready at a25a0d7, with no code changes required.

Not blocking, take or leave: as a follow-up issue, host-scoped settlement could scan with record-only entries and classify only the scoped claims that are not this daemon's abandoned ones, because a macOS or web host open currently classifies every owner in the store before the record answers, and an overload of classifyDeviceClaimEntry that returns InspectedDeviceClaim for a non-null entry would remove the non-null assertions at the new call sites.

All checks that ran pass, including Coverage, Integration Tests and the smoke jobs. Proof is skipped, and the cancelled Body rules runs, which check the pull request description, were followed by a passing one. Not verified here: no tests or live runs were executed, base failure counts were traced only by reading the code, Windows CIM behavior was not exercised, and it was not checked which CI smoke jobs reach the covered or held claim routes. A live device run was not judged necessary, since only the point at which host claim-file admission runs ps or CIM changes and the decisions stay the same. Nothing from this review needs to happen before merge.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 29, 2026
@thymikee
thymikee merged commit 35f5588 into main Nov 29, 2026
22 of 24 checks passed
@thymikee
thymikee deleted the perf/device-claim-admission-lazy-classify branch November 29, 2026 15:19
thymikee added a commit that referenced this pull request Nov 29, 2026
…roc-first

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* origin/main:
  perf(apple): reuse the process identity for native-build cache locks (#5203)
  perf(apple): read the native-build toolchain identity with two concurrent probes (#5206)
  perf(macos): reuse the helper fingerprint between unchanged calls (#5207)
  docs(agents): add performance guidance (#5208)
  perf(daemon): classify a device claim owner only for refusals and settlement (#5210)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant