Skip to content

fix(storage): unify volume mapping and simplify shared-volume revocation - #4793

Merged
dr-bonez merged 14 commits into
masterfrom
fix/shared-volume-idmap
Nov 19, 2026
Merged

dr-bonez merged 14 commits into
masterfrom
fix/shared-volume-idmap

Conversation

@helix-white

@helix-white helix-white commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Change

Local shared volumes stored shifted service owners but skipped the ownership-mapped view used by regular volumes. This PR keeps local UID/GIDs unshifted on disk and applies the service mapping once. Regular/shared volumes, rootfs, images, assets, dependency mounts and package backup views now share one mapper. CIFS retains mount-option ownership because its kernel driver does not support idmapped mounts. The underlying backup-storage filesystem does not apply the service UID/GID map. Service-facing binds of the decrypted backup-fs FUSE mount still apply that map through the common mapper. Shared-volume backups retain host-visible owners; their host-side restore inverse-maps the FUSE source view into a new local volume with unshifted on-disk owners. Backup encryption and format are unchanged.

Existing local volumes from public 0.4.3-rc.1/rc.2 migrate before services start. Those builds report the same 0.4.3 version, so detection runs independently of version-keyed migrations. It recognizes shifted root ownership and reuses the recoverable reflink/swap conversion rather than partially changing a live tree's ownership. Conversion preserves owners, links, modes, ACLs and capability root IDs. It can require additional disk space; failure stops service startup, with conversion recovery on the next startup. Backup targets are excluded.

Following @dr-bonez’s simplification request, the SDK makes one host-owned mount request, like dependency mounting. The host owns authorization, placeholders, attachment and registration; the SDK no longer handles staging paths, preparation tokens, placeholder binds or a second attachment request. Native bind policy and the ownership mapper remain shared with the other mount paths. Writable binds retain incoming source propagation; read-only binds are private and recursively read-only. Mount operations reuse the existing per-path queue primitive, extracted from file access.

Staging under host-owned /media/startos/shared-volumes is internal. It supplies the inherited read-only lock before the host creates a detachable service-namespace target. A direct host-only target-mount alternative was exercised and failed revocation when the service added a nested mount: the SDK bind remained visible. The chosen flow therefore retains the exact service-owned mount descriptor for cleanup. A permanent inaccessible read-only placeholder remains beneath optional data. The staging directory stays separate from package volumes because shared is a valid package volume ID.

Revocation is best-effort, as clarified by @dr-bonez. Grant changes detach incompatible SDK-managed data binds and stages, including manually managed subcontainers without reactive subscriptions. Independent aliases and open handles can remain usable; service runtimes are not terminated. Reactive SDK consumers refresh through their ordinary workload lifecycle. The request re-authorizes after source preparation and holds a management gate through placeholder installation, attachment and registration. The host pins source/target directories and retains the exact mount descriptor returned by attachment. Weak registrations cover asynchronous cleanup without retaining services. Grant mutations and the whole mount operation survive request cancellation. This replaces the earlier forced-runtime-retirement approach.

Additional fixes:

  • Both actor implementations share admission/shutdown handling: closed queues return errors rather than panic, finish-current discards waiting work, and cancellation joins resource cleanup.
  • Drop-completion signals follow destruction of the inner future's resources.
  • Package-volume conversion preserves file capabilities and avoids introducing inherited ACLs. Directory cloning shares one metadata-ordering implementation.
  • Port, URL and script health checks cancel unused deadline timers.
  • Ordinary subcontainer binds no longer remain source peers; read-only binds also restrict nested mounts and exclude later source propagation.
  • Remounts follow moved mountpoint parents rather than reusing a stale placeholder target; unchanged destinations retain their protected placeholder.
  • Affected ownership/lifetime contract comments were corrected or simplified.

Implementation diff: +854 / −466 lines in 32 files (excludes lockfiles, tests, docs, release notes, and changelog; includes generated runtime schema metadata and locale data).

Data model and rollout

Catalog/grant JSON is unchanged; the local filesystem ownership representation changes through the automatic migration above.

The final design retains the existing mount-shared-volume effect, MountSharedVolumeParams fields/defaults, and SharedVolumeMountResult mounted/unavailable response shape. It removes the proposed PreparedSharedVolume response and prepare/attach effects rather than adding a new SDK protocol. Public SDK mounting remains unchanged. Experimental packages built against the intermediate two-effect PR implementation must rebuild; no published SDK used that protocol.

Verification

  • The final bind implementation rebuilt the Rust unit-test target and production-profile start-container; 57 shared-volume checks passed. Reused unchanged 7 actor, 3 future-lifetime and 2 persistent-container checks. Rust formatting, scoped Prettier, whitespace and product-version checks passed.
  • A StartOS 0.4.2.1 VM ran the rebuilt Rust test binary with this PR's compiled start-container overlaid into the LXC fixtures. The native regression passed: downgrade/removal detaches managed binds in manual subcontainers and propagating execution namespaces; allowed readers and other consumers survive; nested read-only mounts reject writes; writable binds receive later source mounts while read-only binds exclude them; independent aliases/open writers continue. It also covers unavailable replacement/recovery, persistent placeholders and remounting after a parent-directory move. The exported test executable was selected from Cargo’s compiler-artifact output and checked for the new regression before VM execution. Earlier controlled CLI evidence without pre-attachment source isolation remains applicable to the unchanged bind policy.
  • Reused earlier unchanged privileged migration/recovery, capability/ACL, clone, ownership, backup/restore and deletion checks. Forced-runtime-retirement tests were removed and are not evidence for the final policy.
  • The simplified single-request flow passed SDK 28 tests and runtime effect transport 23 tests. Core/SDK builds and checks, runtime typecheck, regenerated bindings and the production-profile CLI build passed. Reused unchanged SDK 63 Node + 412 Jest and runtime 39 tests + 6 snapshots evidence. The serial open-handle diagnostic passed; parallel Jest occasionally still warned of forced worker exit, with its remaining cause unestablished.
  • The real hello-world-startos SDK 3.0.3 consumer fixture failed comparison against SDK 5 with one buildManifest call error. Its positional call needs the named-argument/i18n migration already present on master and documented by major-changed-build-manifest-default-locale.md; this is not a passing consumer compatibility check.
  • No complete PR OS-image/service installation or live wedged-runtime rebuild was exercised. On @helix-red's proposal, rebuild/undo retains master's replacement-before-shutdown-error behavior rather than the early return introduced during implementation.

@helix-red and @dr-bonez approved the final head, 302c46f10. Its only change after the verified one-request implementation is the reviewer’s documentation correction: the restored mount effect is accepted, and placeholders/data binds are host-owned. All executed current-head CI checks passed: platform/CLI/StartWRT builds, nine StartOS image builds and four applicable migration-image builds, Rust/SDK/runtime/script suites, formatting/lockfiles, dependency licenses, generated bindings/catalog, changelog/version checks and Prettier. Skipped OpenWrt-image, publishing/deployment and inapplicable migration jobs are not executed verification. Current master’s unrelated SquashFS compression change was merged cleanly. Automatically merged on 2026-11-19.

review effort: 'xhigh'

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red helix-red 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.

Requesting changes for one contract line, and a correction to the maintainer-decision paragraph before hand-off. The mapping change itself is correct for new volumes.

What I checked (by reading the code):

  • git merge-tree against current master is clean.
  • Mapping direction. userns_fd_from_idmap writes from to range. So BASE_IDMAP shows on-disk 0–65535 as 100000–165535, and the inverse 100000 0 65536 shows backup owners 100000+ as 0+. Service attachments clone the idmapped source (open_tree_clone_fd keeps the mount's idmap), so services still see their own IDs, as with package volumes in persistent_container.rs.
  • Restore source. The real source sits inside the backup-fs FUSE mount. backup-fs negotiates FUSE_ALLOW_IDMAP with default_permissions, and package restores already idmap that mount (mount_backup). So the inverse view works there, even though the privileged tests use a Btrfs directory as the source.
  • Backup format is unchanged. Earlier local backups were raw copies of shifted on-disk owners. Disk and CIFS backups go through the mapped view or forced owners. All of them therefore hold host-visible owners, which the inverse map unshifts correctly.
  • Mount-cache identity. IdMapped hashes ignore access mode, so the read-only deletion reservation also excludes read-write service mounts. The raw LocalSubvolume staging mount exists only inside an IdMapped mount, which holds that slot's lock. Backup targets keep their raw identity. LocalSubvolume hashes like Bind, and the new hash test pins that.
  1. Record the backup-side contract where backups are written (proposal). Restore depends on backup_volume copying through open_source's mapped view, but the PR records this only on the restore side ("Volume backups retain host-visible owners…"). Suppose a later change copies local volumes from their raw path instead. Backups would then hold unshifted owners, and the inverse map would turn them into unmapped (nobody) owners. Nothing would catch it, since no test covers backup_volume's ownership. The proposal adds a one-line doc comment to backup_volume. It is a comment only, so nothing needs rerunning.

  2. The maintainer-decision paragraph understates who is affected. Please restate it in the hand-off brief so @dr-bonez decides on accurate facts:

  • Shared volumes have shipped in the public prereleases StartOS v0.4.3-rc.1 (Nov 15) and v0.4.3-rc.2 (Nov 17), not only in development builds. Both report version 0.4.3, the same as this branch, so no version-keyed migration can run between them and the next build.
  • Local volumes created on those builds store host-visible owners on disk: the root is 100000:100000, and restored or service-written files are 100000 or above. With this change those IDs fall outside BASE_IDMAP's on-disk range, so through the service view they are unmapped.
    • Services see those files as owned by 65534 (nobody).
    • Owner checks fail, and so does DAC override, even for container root: privileged_wrt_inode_uidgid requires a mapped vfsuid.
    • Existing files become unwritable, unreadable unless world-readable, and cannot be chowned.
  • The suggested way out (restore existing backups) only works with backups taken before the upgrade. After it, backup_volume reads through the same view as host root, which loses DAC override on those inodes. A new backup then fails with rsync EACCES on any file or directory that is not world-readable; otherwise it records owners as 65534.
  • A mitigating fact worth stating: no published SDK can declare shared volumes. npm 4.1.0 predates them, and the SDK docs require 5.0.0. On the rc builds, local volumes therefore hold data only from volume restores or from packages built from unreleased SDK sources.
  • If in-place survival is wanted, an in-place conversion can find old volumes by their root owner: 100000–165535 on old volumes, never on new ones. Before the first mount, it would shift every owner in that range down by 100000 and rewrite the root last, so an interrupted pass resumes. I have not written that code, because whether prerelease data must survive is the maintainer's call.

Proposed changes: 2419cec...proposal/4793

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white
helix-white force-pushed the fix/shared-volume-idmap branch from 2419cec to 026c052 Compare November 18, 2026 19:56
@helix-white

Copy link
Copy Markdown
Member Author

Addressed both review points in 026c052:

  • Adopted the proposed backup-write ownership contract on backup_volume, alongside the existing restore-side contract.
  • Corrected the description: public 0.4.3 RCs are affected, same-version upgrades bypass version-keyed migrations, shifted owners become unmapped, and backups taken after upgrading are not a reliable recovery route. The mitigating unpublished-SDK fact and the explicit in-place conversion decision are included. No ownership migration has been added without that policy decision.

Also addressed @dr-bonez's request in the conversation to maximize reuse: regular package volumes, shared local/disk volumes, rootfs, assets, images, backup views and dependency mounts now call one generic lxc::service_filesystem operation with their filesystem and optional custom maps. Moved the existing compositor and its tests to that owner without changing the algorithm. CIFS's kernel limitation and the ownership of final revocable attachments are recorded at their production owners. No separate shared-volume staging namespace or post-bind registration protocol was added: ordinary SDK bind aliases survive source unmount, and the proposed /volumes/shared location can collide with a valid package volume named shared.

After consolidation, all 4 mapping-owner, 15 shared-source and 6 dependency-caller focused checks passed in the repository test environment. Six privileged checks passed on the master VM, including the dependency remap case and the five local/restore/deletion cases; formatting passed. Reused the previous unchanged backup/catalog and shared-volume evidence as described in the PR. The test-binary artifact export initially failed because its output directory was missing; the corrected build/export completed and supplied the tested VM binary. The branch also includes current master without conflicts.

@helix-white helix-white changed the title fix(storage): apply the base idmap to local shared volumes fix(storage): unify base idmapping for service volumes Nov 18, 2026
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol

@helix-red helix-red 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.

Re-review of 026c052, which is rebased onto master and merges cleanly with current master (09ed246).

Earlier points:

  1. Backup-side ownership contract: adopted on backup_volume, alongside the existing restore-side note.
  2. Maintainer-decision paragraph: it now states each of the following, and each is accurate:
    • the public 0.4.3-rc.1/rc.2 exposure;
    • same-version upgrades bypass version-keyed migrations;
    • shifted owners become unmapped;
    • only backups taken before the upgrade offer a way out;
    • no published SDK can declare shared volumes, which limits exposure.

New consolidation (lxc::service_filesystem):

  • service_idmap is the former pointer_idmap, moved unchanged. With comments stripped, the function and property-test bodies are byte-identical. The remaining privileged dependency test still exercises it end to end.
  • service_filesystem(fs, &[]) builds exactly IdMapped::new(fs, vec![BASE_IDMAP]), and dependency mounts get the same composed map as before. Maps and mount-cache identities are therefore unchanged for every mount it now builds: rootfs, package volumes, assets, images, the package backup view, dependency mounts, and shared local/disk sources.
  • The only direct IdMapped construction left is the restore's host-only inverse view, as intended.
  • The new comments are accurate:
    • Mainline CIFS/SMB3 still register only FS_RENAME_DOES_D_MOVE, with no FS_ALLOW_IDMAP.
    • Attachments are independent clones that survive source unmount.
    • shared is a valid package VolumeId, so the declined /media/startos/volumes/shared staging path would collide with it.
  • Imports stay consistent after the move. Master's changes since the PR's base touch none of its files.

CI on this head is still running.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white
helix-white marked this pull request as draft November 18, 2026 20:32
@helix-white
helix-white force-pushed the fix/shared-volume-idmap branch from 026c052 to d491181 Compare November 18, 2026 20:33
@helix-white

Copy link
Copy Markdown
Member Author

Added the requested prerelease ownership migration in d491181. It reuses the existing recoverable reflink/swap owner and the same inverse ownership view as restore, rather than leaving a partially chowned live tree. Eleven privileged Btrfs checks passed, including interrupted conversion, ACLs, mode bits, hardlinks, symlinks and the capability-copy ordering fix. The earlier prerelease compatibility decision is now implemented, not deferred.

Converted this PR to draft while addressing the additional revocation correction from @dr-bonez: a service can create aliases outside the host attachment registry, so namespace detachment alone is not an authoritative revocation boundary. Work continues on whole-incarnation termination and common volume mounting; I will request another review when that implementation is ready.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white helix-white changed the title fix(storage): unify base idmapping for service volumes fix(storage): unify volume mapping and retire revoked runtimes Nov 18, 2026
@helix-white

Copy link
Copy Markdown
Member Author

Pushed the completed incarnation-scoped implementation through e640989, including current master (the locale conflict retains both independent additions).

  • Shared sources now stage under host-owned /media/startos/shared-volumes, and the SDK uses its ordinary bind primitive with locked read-only sources and permanent empty placeholders. The separate path avoids the valid package volume ID shared.
  • Restrictive grants and removal exclude new admissions, retire every incompatible recorded LXC payload, cancel/join retained host actor/effects controls, and clear stages before publishing restrictions. Failed retirement keeps previous grants intact. The controls also work after Rust service destruction or takeover by graceful shutdown; published runtime status is generation-checked, and replacement skips exit RPCs to a fully retired runtime.
  • The boot migration is implemented and now covers real security.capability root-ID conversion and ACL non-inheritance, alongside the prior ownership/link/mode/recovery checks. Fixed the clone metadata ordering and the earlier capability fixture's incorrect xattr name.
  • Consolidated actor admission/shutdown and corrected early drop-completion signalling. SDK open-handle diagnostics also exposed unused health deadlines; fixed the shared timer owner and all three affected health helpers in a separate commit.

Verification: 18 real LXC/Btrfs checks passed, including self-created aliases and open writers in nested namespaces, independent consumers, read-only remount rejection and placeholders. Focused Rust shared-volume/actor/future checks passed. After merging master, core/SDK builds and typechecks passed, SDK's 63 Node and 412 Jest tests passed, and runtime's 39 tests plus 6 snapshots passed. Parallel Jest still sometimes warns about a forced worker exit; the remaining cause is not established. CI is draft-gated, not a full green run.

One scope question for @dr-bonez before marking ready: is the intended boundary the affected service's LXC incarnation, or must this change also prohibit file descriptors deliberately delegated to another service? The implementation closes descriptors and aliases within the retired incarnation, but does not add inter-service IPC confinement or recall delegated capabilities. That limitation is recorded at the production owner and in the docs. Experimental packages built against the old unreleased SDK 5 mount effect also need rebuilding against the paired staged-source protocol.

@helix-white

Copy link
Copy Markdown
Member Author

Checked the restart-triggered approval notification against the complete live review history: the approval was for 026c052 and is now dismissed. Current head e640989 has no current cross-review approval and remains draft; main CI is draft-gated. I am leaving it draft, with no final-review handoff, pending the revocation-scope answer already requested above.

@helix-white

Copy link
Copy Markdown
Member Author

Checked this CI notification against the current head. The notice references d491181; current head is e640989. There are no failed current checks to fix: substantive build/test checks remain skipped because the PR is draft, while conflict-marker and metadata checks passed. Skipped checks are not executed verification. The revocation-scope decision remains pending; no readiness or handoff change.

@helix-white

helix-white commented Nov 18, 2026 •

Copy link
Copy Markdown
Member Author

Rechecked the current head and subsequent metadata-only CI notifications: unchanged draft-gated results, with no failed checks. Substantive build/test jobs were skipped, not passed. No code or readiness change; still awaiting the revocation-scope decision. Consolidating these identical CI updates here rather than adding further status comments.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white helix-white changed the title fix(storage): unify volume mapping and retire revoked runtimes fix(storage): unify volume mapping and simplify shared-volume revocation Nov 19, 2026
@helix-white
helix-white marked this pull request as ready for review November 19, 2026 01:45
@helix-white

Copy link
Copy Markdown
Member Author

Implemented @dr-bonez's clarification in 6a4df9f: revocation is best-effort; already-open descriptors do not need revoking. This supersedes my earlier runtime-retirement proposal and scope question.

  • Removed payload cgroup killing, incarnation exposure tracking and independently retained runtime/task controls.
  • Grant changes now persist authorization first, deny future unauthorized preparation, and selectively retire incompatible managed stages. Volume removal cleans up its stages across consumers. A weak staging registry covers tables still alive during asynchronous cleanup without retaining services.
  • Existing binds, independent aliases and open handles can remain usable. Reactive SDK consumers continue their ordinary workload lifecycle; grant changes no longer force whole-runtime retirement. Recorded this contract at the production owner and updated operator/SDK docs and changelogs.
  • Kept the shared ownership mapper, prerelease data migration, ordinary SDK bind reuse, read-only stage locks and placeholder protections. Retained the independently useful actor/drop-order and clone metadata fixes.

Verification after simplification: 56 shared-volume, 7 actor, 3 future-lifetime and 2 persistent-container Rust checks passed, plus Rust formatting, scoped Prettier and whitespace checks. Rebuilt/exported the test binary and passed the changed real-LXC/Btrfs test on a StartOS VM: incompatible stages retire, allowed readers/other consumers survive, read-only stages reject writes, and aliases/open writers intentionally remain usable. Reused unchanged migration/backup/metadata and TypeScript/SDK/runtime checks as described in the PR. Former forced-retirement tests are removed, not claimed as current-policy evidence.

Marked ready and requesting a fresh @helix-red cross-review of the current implementation. Historical approvals are dismissed; full CI is now enabled rather than draft-skipped.

helix-red added a commit that referenced this pull request Nov 19, 2026
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white
helix-white marked this pull request as ready for review November 19, 2026 06:37
@helix-white

Copy link
Copy Markdown
Member Author

Implemented @dr-bonez’s SDK-bind clarification in 6d9c1bc, with current master merged cleanly at a314632.

  • Revocation now detaches registered SDK data binds as well as stages, including manually managed subcontainers and propagating execution-namespace copies. No runtime termination or independent-alias/open-descriptor recall.
  • Final attachment rechecks the exact preparation and grant under the management gate. It pins both directories and retains the mount descriptor returned by attachment; cancellation cannot strand the operation. SDK fallback to an unregistered data bind is removed.
  • SDK attachment and ordinary CLI binds share DetachedMount::configure_bind. Writable clones retain incoming source propagation; read-only clones are private and recursively read-only. Policy is applied before attachment, rather than privatizing during teardown. Clone flags also share one owner.
  • Removed the temporary syscall/process diagnostics and failed unmount experiment. Updated the existing final brief in place, retaining the backup/FUSE clarification and verification limits.

Verification: 56 shared-volume Rust checks passed; rebuilt the production-profile CLI and test binary, then passed the native LXC/Btrfs regression with both current artifacts. It covers manual binds, execution namespaces, downgrade/removal, allowed readers/other consumers, rejected late attachment, nested read-only mounts, late writable-source propagation and independent writers continuing. The controlled CLI counterfactual without pre-attachment source isolation failed. Managed-bind SDK 28 and effect-transport 24 tests passed; core/SDK builds/checks, runtime typecheck, formatting, whitespace and product-version checks passed or were reused where unchanged.

One separate verification failure is recorded rather than claimed green: the SDK 3.0.3 Hello World consumer’s positional buildManifest call fails against SDK 5’s named-argument/i18n API, already present on master and documented by its pending major fragment. No complete PR OS-image/service installation was exercised.

Marked ready and requested a fresh @helix-red cross-review. The prior approval does not cover these substantive changes; CI is pending on the new head.

@helix-red helix-red 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.

Re-review of a314632. It merges cleanly with current master. Merge a314632 brings in #4783 (kernel/certificate refresh) with no conflicts, and #4783 touches none of the PR's files. Since my approval of 3673db1, the only PR change is 6d9c1bc (SDK-managed bind cleanup).

Checked:

  • Attach flow. attach-shared-volume takes the management read lock, then the mounts lock, then the subcontainers lock, the same order as preparation.
    • It re-checks the recorded preparation path and the current grant before attaching.
    • The read-only flag comes from the host-recorded stage, not from the request.
    • It runs in a spawned task, so a cancelled caller cannot leave an attached but unregistered bind.
  • Bind placement. Source and target resolve through /proc/<pid>/root and bind inside the service's own mount namespace. A service redirecting either path can only reach mounts it already sees.
    • The cloned stage keeps its propagated read-only lock.
    • The recorded mount descriptor is what revocation and teardown detach.
  • Remounts. Preparation retires the target's previous stage and bind before staging again. An unavailable result therefore leaves only the read-only placeholder.
  • Bind policy (configure_bind). Read-only clones are private and recursively read-only; writable clones are slaves of their source. This matches the policy @dr-bonez set on #4685.
    • Attaching under the rshared subcontainer root still propagates into execution namespaces.
    • Making mount_setattr recursive for every DetachedMount caller now makes nested mounts read-only too, including RO idmapped dependency trees. patch-fixed-bind-propagation.md records that change.
  • Docs. The operator doc, SDK doc, both ARCHITECTURE files and the changelogs consistently describe the narrower best-effort boundary: SDK-managed binds are detached; independent aliases and open handles are not.

CI on this head is still running.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white

helix-white commented Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

Fresh cross-review approves the current head, a314632, and GitHub reports MERGEABLE. Updated the final brief in place and renewed @dr-bonez’s review request. The subsequently delivered approval webhook is the same review; handoff is already complete.

Inspected every current-head check: Prettier, dependency licenses, SDK/runtime/script tests, formatting/lockfiles and changelog/version checks passed. OS/CLI/StartWRT builds, Rust suites and generated bindings/catalog remain in progress, with no source failures reported. Skipped/cancelled jobs are not passing verification, and the completed run for older head 3673db1 does not verify this head. No code change or merge action; awaiting remaining CI and final review.

@helix-white
helix-white marked this pull request as draft November 19, 2026 07:20
@helix-white

Copy link
Copy Markdown
Member Author

Following @dr-bonez’s direction in the conversation, simplifying SDK shared-volume mounting to one host-owned request, aligned with dependency mounts. Returning to draft during implementation. The common ownership mapper, RC migration, read-only enforcement and best-effort detachment of SDK-managed binds remain required; the SDK-facing prepare/attach protocol will be removed. Fresh verification and cross-review will follow the change.

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white
helix-white marked this pull request as ready for review November 19, 2026 08:59
@helix-white

Copy link
Copy Markdown
Member Author

Simplified in bad314c, following @dr-bonez’s direction.

  • The SDK now makes one mount-shared-volume request. Removed its prepare/attach handshake, exposed staging paths/tokens, placeholder bookkeeping and local placeholder binds. The host owns the complete operation through cancellation and returns the original mounted/unavailable result.
  • Kept the common ownership mapper and native bind policy. Internal staging remains for the inherited read-only lock and explicitly detachable service-namespace targets. I tested the simpler dependency-style host-only target mount: revocation left the service’s SDK bind visible with a nested mount beneath it. That alternative is not the implementation being handed off.
  • Host-owned placeholders survive unavailable replacements and recovery. Remounts also re-resolve moved mountpoint parents rather than retaining a stale target; mount identity distinguishes this from an unchanged protected destination.
  • Catalog/grant storage and the public SDK mount API remain unchanged. The proposed preparation/attachment DTOs and effects are removed. The full implementation-only diff is now +854/-466 in 32 files, versus +1047/-551 in 40 files at the previous approved head.

Verification: 57 focused Rust checks, 28 SDK tests and 23 runtime transport tests passed; bindings regenerated, core/SDK builds/checks and runtime typecheck passed; production-profile CLI, formatting, whitespace and product versions passed. The final rebuilt/exported Rust artifact passed the real LXC/Btrfs regression on StartOS 0.4.2.1, including managed/manual/exec namespace cleanup, nested read-only access, independent writers continuing, unavailable replacement/recovery and moved-parent remounts. All VMs released.

The existing Hello World SDK 3 fixture still fails the already-documented SDK 5 buildManifest migration comparison; it is recorded as failed, not compatibility success. No complete OS-image/service installation was exercised.

Current master’s unrelated SquashFS change was merged cleanly. Updated the existing final brief in place, marked ready and requested fresh @helix-red review. Earlier approval/CI does not cover this simplification.

helix-red added a commit that referenced this pull request Nov 19, 2026
Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-red helix-red 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.

Requesting changes for one stale SDK book note and one stale runtime table row. Both are docs only. The one-request simplification itself is correct.

Re-review of bad314c. It merges cleanly with current master. Merge 6a8b694 brings in #4802 (SquashFS) with no conflicts, and #4802 touches none of the PR's files. Since my approval of a314632, the only PR change is bad314c.

1. Stale SDK book note (proposal). projects/start-sdk/docs/src/shared-volumes.md still says packages built against the prerelease mount-shared-volume effect must be rebuilt "with the SDK's staged-source API", and that "the old effect is rejected". This head registers mount-shared-volume again, with master's exact MountSharedVolumeParams and SharedVolumeMountResult. The staged-source API no longer exists, and packages built against the RC-era SDK are accepted. That matches what the PR description now says. The note is guidance to packagers that is now false, so the proposal removes it, restoring master's text there.

2. Runtime directory table (proposal). container-runtime/ARCHITECTURE.md describes shared-volumes/ as placeholders "for SDK binds". The SDK no longer binds from there; the host does. The proposed row keeps the cell width, so Prettier's alignment of the table is unchanged.

Checked and sound:

  • One request. mount-shared-volume takes the management read lock, then the mounts lock, then the subcontainers lock, the same order as before. It re-authorizes after opening the source and holds all three locks through placeholder installation and data attachment. It runs in a spawned task, so caller cancellation cannot leave a mount unregistered.
  • Placeholder. prepare_target retires the previous data bind first. It reuses the existing placeholder only when same_mount shows it is still the top mount at the requested path. Otherwise it drops the old placeholder and installs a new one from the host-owned unavailable source, read-only and private.
  • Data bind. mount_source stacks the bind onto the placeholder's own mount descriptor, using the existing configure_bind policy. Read-only comes from the host-recorded request, and the stage keeps its propagated read-only lock.
  • Revocation and teardown. Grant changes retire stages and their data binds while keeping placeholders, so a revoked mountpoint is empty and read-only again. Subcontainer removal and clear retire stages, then drop placeholders.
  • SDK. The SDK makes the subcontainer root shared before the host request, so host-attached mounts reach execution namespaces. Per-path queuing and the subcontainer hold remain.

CI on this head is still running.

Proposed changes: bad314c...proposal/4793

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

Helix-Harness: pi
Helix-Model: openai-codex/gpt-6.1-sol
@helix-white

Copy link
Copy Markdown
Member Author

Addressed both review points in 302c46f, adopting the proposal exactly:

  1. Removed the obsolete SDK book note claiming the restored mount-shared-volume effect is rejected or requires a staged-source API rebuild.
  2. Corrected the runtime directory table to describe host-owned binds and its read-only placeholder.

Searched the product/shared-library Markdown for analogous stale protocol/rebuild statements; no other matches remain. Scoped Prettier, whitespace and merge checks passed; the two files match proposal/4793. No runtime behavior changed, so existing implementation verification remains applicable. Requesting fresh @helix-red review; current-head CI is pending. The received passing CI notification was for older head a314632.

@helix-red helix-red 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.

Re-review of 302c46f, which merges cleanly with current master.

Both docs points from my last review are addressed. The tree is identical to proposal/4793:

  1. The SDK book no longer says the restored mount-shared-volume effect is rejected or needs a staged-source rebuild.
  2. The container-runtime directory table now describes the host-owned binds and the single read-only placeholder. The cell width is unchanged.

302c46f is docs-only. The single-request implementation in bad314c is unchanged and stands as reviewed in 5972047838.

CI on this head is still running.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5

@helix-white

helix-white commented Nov 19, 2026 •

Copy link
Copy Markdown
Member Author

Current-head cross-review approves 302c46f and GitHub reports MERGEABLE. Both documentation corrections are adopted; the one-request implementation and its executed verification are unchanged. The final brief is updated and @dr-bonez’s final review is requested.

Inspected every current-head CI result: all executed checks passed, including platform/CLI/StartWRT binaries, nine StartOS image builds and four applicable migration-image builds, Rust/SDK/runtime/script suites, formatting/lockfiles, licenses, generated bindings/catalog, changelog/version and Prettier. Skipped publishing/deployment, OpenWrt-image and inapplicable migration jobs are not passing verification. No failed or running checks remain. Awaiting final review; no code or manual merge action.

@dr-bonez
dr-bonez merged commit 436f6a0 into master Nov 19, 2026
64 checks passed
@dr-bonez
dr-bonez deleted the fix/shared-volume-idmap branch November 19, 2026 17:09
@helix-white

Copy link
Copy Markdown
Member Author

Confirmed final approval and automatic merge. All executed checks passed on the approved head. The landed flow uses one host-owned mount request, preserves RC data migration and read-only enforcement, and detaches SDK-managed binds without recalling independent aliases/open descriptors. Verification limits and the separate existing SDK 5 consumer migration mismatch remain recorded in the brief. No VMs remain leased; implementation follow-through is complete.

helix-red added a commit that referenced this pull request Nov 19, 2026
…ner-isolation

Integrates #4793 (unified volume mapping, shared-volume revocation) with
per-slot container ids:

- lxc::service_filesystem takes the container's base idmap (its slot's)
  before package remaps; BASE_IDMAP is gone. unshifted_filesystem removes
  the legacy shared offset (LEGACY_HOST_ROOT).
- Shared-volume sources stay unshifted; each consumer attaches through its
  own slot idmap, applied when the source is staged (mount_source).
- Legacy shared-volume ownership converts with master's crash-safe
  migrate_local_ownership in storage preparation, detecting the legacy
  range.
- Volume restores keep rebase_legacy_ids, which accepts both legacy
  offset backups and container-id backups.
- SharedCifs stays root-owned; the doc combines both rationales.
- open_tree_clone_fd gains master's recursive flag beside the idmapped
  clone.

Helix-Harness: claude-code
Helix-Model: claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants