Skip to content

fix(update): recognize FreeBSD boot identities in triage leases - #147243

Merged
vincentkoc merged 2 commits into
mainfrom
fix/freebsd-handoff-boot-id
Sep 13, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/freebsd-handoff-boot-id

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 13, 2026 •

Copy link
Copy Markdown
Member

Related: #45233

What Problem This Solves

FreeBSD foreground triage cannot obtain the boot identity required by managed handoff leases.

User Impact

FreeBSD can represent its kernel boot token in a foreground triage lease. Managed FreeBSD updates still require the separate process-identity and sealed-native-runtime work; this PR does not enable complete managed handoff.

The published 2026.9.4 reader rejects and preserves these FreeBSD lease rows instead of reclaiming them. No database schema-version change is needed.

Why This Change Was Made

Read exactly 16 binary bytes from kern.boot_id, which FreeBSD initializes once per boot, and encode them as lowercase hexadecimal. Reject missing, incomplete, failed, or timed-out reads. The extracted reader preserves the existing Linux, macOS, and Windows queries and when they run.

The kernel token avoids the mutable wall-clock value exposed by kern.boottime. See FreeBSD kernel implementation.

Evidence

At head 8c0f0df6ec3c0c06d21e603e1163e206b69e765b:

  • Independent source review and autoreview passed with no actionable P0/P1 findings.
  • Crabbox / Blacksmith proof: focused boot and ownership tests passed (23 passed, one Windows-specific test skipped); the four-file changed gate passed, including formatting, core and test typechecks, lint, and ownership/schema guards.
  • The production sealed-runtime build passed. Its artifact is 2,028,072 bytes, SHA-256 e1e864a077e280334f01ea06596dd05242d4e0ed545661a69186b1dc3469520b.
  • A fresh candidate store wrote a FreeBSD lease payload; independent children using the actual published 2026.9.4 sealed runtime returned unreadable on read and incompatible on update admission. After each operation, the exact row payload, database bytes, schema version, inode, and mode were unchanged; the candidate could still reread its lease. This Linux fixture proves serialized compatibility and preservation, not a full updater run or native FreeBSD handoff.
  • Native FreeBSD production-owner proof passed on FreeBSD 15.1-p3 / Node 24.20.0 using that exact built artifact: the owner returned the real 16 kernel bytes, an independent child read the same token, and a real missing-OID read produced the visible refusal. This isolated proof did not open the database or exercise reboot/full managed handoff.

Read the kernel boot token as exactly 16 binary bytes and preserve existing platform readers. Add the strict FreeBSD lease shape without a database-version change. Older decoders refuse and retain these rows. Process identity support remains a separate prerequisite for managed FreeBSD handoff.
@vincentkoc vincentkoc self-assigned this Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Sep 13, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 3:04 PM ET / 19:04 UTC (Revision 3).

ClawSweeper review

What this changes

Adds FreeBSD kernel boot-token reading and lease decoding while preserving the existing Linux, macOS, and Windows readers.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main lacks this capability, and the updated evidence addresses both prior review requests. No actionable patch defect was found; the broader FreeBSD support request remains separate.

Priority: P2
Reviewed head: 8c0f0df6ec3c0c06d21e603e1163e206b69e765b

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with useful native and cross-version evidence and no blocking correctness finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The captured native result and inspected successful FreeBSD workflow exercise the built lease-store reader against real kernel bytes, an independent child, and a real query failure. Reported fresh-store and published-reader preservation address the prior compatibility request; backing Testbox logs were inaccessible to this reviewer. Neither scenario claims reboot or complete managed-handoff coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The captured native result and inspected successful FreeBSD workflow exercise the built lease-store reader against real kernel bytes, an independent child, and a real query failure. Reported fresh-store and published-reader preservation address the prior compatibility request; backing Testbox logs were inaccessible to this reviewer. Neither scenario claims reboot or complete managed-handoff coverage.
Evidence reviewed 9 items Pinned patch and current-main comparison: The complete introduced delta contains the boot reader, its tests, lease-store wiring, and the FreeBSD schema variant. Comparing the affected existing modules against fetched main confirms the capability remains absent there; unrelated base changes were excluded from ownership judgments.
Production reachability and authority boundary: Foreground triage obtains the boot token before acquiring a lease. Acquisition still requires process identity, which the shared process reader does not provide on FreeBSD. Current-row checks, process ownership, transaction comparisons, and release rules remain unchanged; this patch does not enable complete FreeBSD handoff or introduce a demonstrated authorization bypass.
Authoritative kernel contract: The patch directly depends on kern.boot_id. FreeBSD's sysctl_bootid returns a read-only 16-byte value initialized once from seeded randomness, supporting binary reading rather than a mutable wall-clock boot time.
Findings None None.
Security None None.

How this fits together

OpenClaw’s update and automatic-triage leases coordinate installation ownership across processes. Boot identity helps distinguish unfinished work from an earlier boot before allowing recovery.

flowchart TD
  A[Automatic triage] --> B[Lease store]
  C[Operating system boot token] --> D[Platform reader]
  D --> E[Strict identity validation]
  E --> B
  B --> F[Current ownership and lifetime checks]
  F --> G[Permit recovery or preserve lease]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +37, Tests +126. Total +163 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 71 34 +37
Tests 1 126 0 +126
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 197 34 +163

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: src/infra/update-managed-service-handoff-boot.ts, serialized state: src/infra/update-managed-service-handoff-lease.ts, unknown-data-model-change: src/infra/update-managed-service-handoff-boot.ts, unknown-data-model-change: src/infra/update-managed-service-handoff-lease.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep boot identity under the existing lease owner, with full FreeBSD process and service support handled separately before promising managed updates.

Do we have a high-confidence way to reproduce the issue?

Not applicable as an established supported-platform regression: this adds a FreeBSD prerequisite. Current source confirms the previous rejection, and the native proof exercises the new reader.

Is this the best way to solve the issue?

Yes: the patch extends the existing owner with the kernel’s binary token and preserves existing platform behavior without adding a competing lease mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 8132c7cf75b3.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The captured native result and inspected successful FreeBSD workflow exercise the built lease-store reader against real kernel bytes, an independent child, and a real query failure. Reported fresh-store and published-reader preservation address the prior compatibility request; backing Testbox logs were inaccessible to this reviewer. Neither scenario claims reboot or complete managed-handoff coverage.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P2: This is a bounded FreeBSD platform improvement without evidence of an urgent regression in an existing supported setup.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The captured native result and inspected successful FreeBSD workflow exercise the built lease-store reader against real kernel bytes, an independent child, and a real query failure. Reported fresh-store and published-reader preservation address the prior compatibility request; backing Testbox logs were inaccessible to this reviewer. Neither scenario claims reboot or complete managed-handoff coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured native result and inspected successful FreeBSD workflow exercise the built lease-store reader against real kernel bytes, an independent child, and a real query failure. Reported fresh-store and published-reader preservation address the prior compatibility request; backing Testbox logs were inaccessible to this reviewer. Neither scenario claims reboot or complete managed-handoff coverage.

Evidence

What I checked:

  • Pinned patch and current-main comparison: The complete introduced delta contains the boot reader, its tests, lease-store wiring, and the FreeBSD schema variant. Comparing the affected existing modules against fetched main confirms the capability remains absent there; unrelated base changes were excluded from ownership judgments. (src/infra/update-managed-service-handoff-boot.ts:11, 8c0f0df6ec3c)
  • Production reachability and authority boundary: Foreground triage obtains the boot token before acquiring a lease. Acquisition still requires process identity, which the shared process reader does not provide on FreeBSD. Current-row checks, process ownership, transaction comparisons, and release rules remain unchanged; this patch does not enable complete FreeBSD handoff or introduce a demonstrated authorization bypass. (src/infra/update-managed-service-handoff-lease.ts:370, 8c0f0df6ec3c)
  • Authoritative kernel contract: The patch directly depends on kern.boot_id. FreeBSD's sysctl_bootid returns a read-only 16-byte value initialized once from seeded randomness, supporting binary reading rather than a mutable wall-clock boot time. (sys/kern/kern_mib.c:519, 88e7371d9dc2)
  • Native production-owner proof: Inspected the workflow and decoded its driver as text without executing it. It verifies the built artifact SHA-256 e1e864a077e280334f01ea06596dd05242d4e0ed545661a69186b1dc3469520b, invokes the real lease-store boot reader, compares actual kernel bytes across independent processes, and checks refusal through a real missing-OID query. GitHub reports the native job succeeded: https://github.com/vincentkoc/plugins-workspace/actions/runs/34775676548/job/103773230122. Database operations and reboot were explicitly outside this scenario. (.github/workflows/freebsd-boot-owner-proof.yml:34, 383d1ac3c88a)
  • Prior proof requests and serialized compatibility: The captured body at sourceRevision 0e04dbf2ee65937fdb19831fe1419b0f1381c49c11d03e05438979a99ee4d6db reports fresh-store creation and actual published 2026.9.4 child readers returning unreadable/incompatible while preserving payload, database bytes, schema version, inode, and mode. Together with native proof, this addresses both previous rank-up requests. These preservation results are contributor-reported: the review host could not retrieve the backing log archive. The linked Testbox session is cancelled, which does not independently establish failure of its reported interactive commands. (8c0f0df6ec3c)
  • Latest-release boundary: The supplied latest release, v2026.9.4, likewise lacks the FreeBSD boot variant. Its strict decoder supports the reported refusal of the new payload rather than silently interpreting it as an existing platform. (src/infra/update-managed-service-handoff-schema.ts:9, 3a9d69db306c)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-13T17:55:59.098Z sha 011c49b :: blocked before merge. :: none
  • reviewed 2026-09-13T18:32:23.612Z sha 8c0f0df :: blocked before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 13, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 13, 2026 18:51
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 13, 2026
@vincentkoc
vincentkoc merged commit c8b3787 into main Sep 13, 2026
267 of 269 checks passed
@vincentkoc
vincentkoc deleted the fix/freebsd-handoff-boot-id branch September 13, 2026 19:08
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit 'cf45ff4d6a9c13164463db860285a02c1c4f2e8c':
  test(macos): observe readiness cancellation and deadline ownership (#145056)
  fix(ci): route QA Profile Evidence to its run-status owner test (#147293)
  fix(install): preserve runtime links when Node validation fails (#147221)
  test(auto-reply): reuse memory session fixtures (#147262)
  fix: hide subagent sessions from Activity (#147253)
  ci: record resources for slow runtime test commands (#147254)
  fix(update): recognize FreeBSD boot identities in triage leases (#147243)
  refactor(active-memory): share closing tag line scan (#147031)
  fix: resume Settings autosave after Reload Config (#147136)
  fix(cli): keep conversation context after cancellation (#147139)
  fix(channels): make system-agent approval cards actionable (#147152)
  refactor: retain shared database handles until their last worker closes (#147246)
  refactor(slack): share workspace-qualified target resolution (#147024)
  refactor(msteams): remove duplicate quoted-table test (#147270)
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit 'ac59d5e09eb468dc23cf95e447608b57e71b52af': (176 commits)
  improve(gateway): avoid redundant startup preflight work (#147285)
  test(macos): observe readiness cancellation and deadline ownership (#145056)
  fix(ci): route QA Profile Evidence to its run-status owner test (#147293)
  fix(install): preserve runtime links when Node validation fails (#147221)
  test(auto-reply): reuse memory session fixtures (#147262)
  fix: hide subagent sessions from Activity (#147253)
  ci: record resources for slow runtime test commands (#147254)
  fix(update): recognize FreeBSD boot identities in triage leases (#147243)
  refactor(active-memory): share closing tag line scan (#147031)
  fix: resume Settings autosave after Reload Config (#147136)
  fix(cli): keep conversation context after cancellation (#147139)
  fix(channels): make system-agent approval cards actionable (#147152)
  refactor: retain shared database handles until their last worker closes (#147246)
  refactor(slack): share workspace-qualified target resolution (#147024)
  refactor(msteams): remove duplicate quoted-table test (#147270)
  fix(qa): bind coverage IDs to producer assertions (#144000)
  fix(linux): explain FreeBSD desktop setup prerequisites (#147211)
  fix(memory): split embedding batches rejected for an input array item cap (#139541)
  test: isolate timing metadata persistence from inherited settings (#147112)
  refactor(status): retire test-only helper publication (#147071)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
…claw#147243)

* fix(update): recognize FreeBSD boot identities in triage leases

Read the kernel boot token as exactly 16 binary bytes and preserve existing platform readers. Add the strict FreeBSD lease shape without a database-version change. Older decoders refuse and retain these rows. Process identity support remains a separate prerequisite for managed FreeBSD handoff.

* refactor(update): isolate managed handoff boot identity reader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant