Skip to content

perf(daemon): judge host claim scan owners only when liveness decides - #5217

Merged
thymikee merged 2 commits into
mainfrom
perf/decode-only-host-claim-scan
Nov 29, 2026
Merged

thymikee merged 2 commits into
mainfrom
perf/decode-only-host-claim-scan

Conversation

@thymikee

@thymikee thymikee commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #5210. The macOS and web host claim scan classified every listed claim, then never read that classification, so reopening a held claim still ran ps. The scan now only decodes. Owners are judged only for host-scoped claims this daemon did not abandon; the preview judges them in one snapshot.

No ownership decision changed:

  • Locked settlement still re-reads each claim and snapshots under that claim's lock. A pre-lock batch was rejected because settlement unlinks claims. Several foreign claims therefore cost one snapshot each, one fewer than before.
  • Unreadable and abandoned-own claims were already decided from the record.
  • Conflicts, classifications, reasons, and hints come from the judged entry, including retained settlements.
  • The lock-free preview drops its second file read. It skips decoded claims outside their canonical path, which acquisition never reads; a misnamed copy no longer repeats its canonical claim.

Before / after

Only snapshot count and latency differ. Measured at 3b3282f.

real ps, temporary claim store, 40 calls per round, 2 alternating rounds, busy host
scenario                        snapshots  median ms per round, base -> head
open reopen, held host claim    1 -> 0     9.9, 9.5  -> 1.3, 1.4
uncovered install               1 -> 0     3.9, 3.4  -> 1.2, 1.4
preview, own abandoned claim    2 -> 0     4.6, 4.1  -> 0.10, 0.11
open refusal, live app claim    2 -> 1     6.5, 10.8 -> 4.3, 5.0
preview, live app claim         2 -> 1     4.2, 7.4  -> 2.2, 2.5
open refusal, dead app claim    2 -> 1     5.4, 5.3  -> 3.6, 4.0
preview, dead app claim         2 -> 1     3.0, 3.3  -> 1.7, 1.8

Validation

Tested f5779c9.

  • device-claims-host-scan.test.ts and device-claims-app.test.ts: 44 passed.
  • The 6 new misnamed-file tests failed against 3b3282f source.
  • At 3b3282f, base a0c616c: 14 of 14 new tests failed on base. Mutations: returning the unjudged record failed 2; judging abandoned claims failed 6.
  • Gates and typecheck: CI, pending.
  • Self-review only. No live device run; native execution is unchanged.

🤖 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

The macOS and web host claim scan classified every listed claim and never read
that classification: settlement re-read and judged each claim again. The scan now
only decodes. Owners are judged for host-scoped claims this daemon did not
abandon, in one snapshot per judged set, under the claim lock when settling.

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

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.70 MB 6.70 MB +27 B
Package (unpacked) 6.70 MB 6.70 MB +27 B
Package (download) 2.04 MB 2.04 MB +58 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.8 ms 21.1 ms -0.7 ms
CLI --help 46.8 ms 44.0 ms -2.8 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

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

@apex-sentinel-staging

This comment has been minimized.

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of f5779c9

Since the review of 3b3282f: 0 new · 0 still open · 0 no longer raised

No open findings.

1 finding below minor hidden (user_settings.min_severity).

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

💬 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

This PR is ready at f5779c9, and no code changes are required.

Not blocking, take or leave: the new canonical-filename helper could also serve the inline checks in stale claim release and orphan reconciliation, and one shared selector (unreadable, or host-scoped and canonical) could feed both the preview and the locked settlement loop, because with a hand-copied or hand-renamed claim file the two may name a different blocking claim or disagree on whether to read the file.

The canonical filename thread no longer applies and can be resolved: the preview now filters decoded claims to their canonical filename, with misnamed-file cases in the host scan tests, and only the hand-edited ordering difference noted above remains.

All checks pass, including Coverage, Integration Tests and Smoke Tests (macos); Proof is skipped.

Not verified here: tests and mutations were not run locally, so base-failure and mutation counts were judged by reading and the pass state comes from CI; the latency table measured at 3b3282f was not reproduced; no live macOS or web claim run was done, and this host-side claim bookkeeping is exercised through the production acquire and preview functions; the listing-order and case-insensitive volume scenarios come from reading the code.

Nothing found here needs to change 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 497076d into main Nov 29, 2026
22 checks passed
@thymikee
thymikee deleted the perf/decode-only-host-claim-scan branch November 29, 2026 17:31
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