Skip to content

refactor(workspace): replace persistent physical workspace and root markers with path-based selection - #6941

Merged
M4n5ter merged 2 commits into
rust-previewfrom
refactor/path-workspace-identity
Nov 16, 2026
Merged

M4n5ter merged 2 commits into
rust-previewfrom
refactor/path-workspace-identity

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Remove persistent physical workspace and State Root identity markers in favor of path-based workspace selection and short-lived live-mount directory observations (follow-up to #6815 (comment)):

  • Delete WorkspaceIdentity, .maka-workspace.json preparation/publication, Git .git/info/exclude injection, and related sandbox/checkpoint/file-watch exemptions so selecting a folder is strictly read-only.
  • Switch Workspace (AgentWorkspace) and CatalogSelection::Workspace to canonical path (plus optional projectId and worktree), keeping existing conversations grouped and usable across same-path directory recreation or re-cloning.
  • Simplify State Root .maka-storage-root.json to {"rootId":"..."} and remove .maka-rust-runtime.json, kind, root_identity, and version counter churn; relocated roots keep logical identity and contend on the same account-local lease.
  • Decouple published worktree bindings from source repository inode replacement (source_identity), retaining short-lived Observation checks (excluding unstable birth time on Linux overlayfs copy-up) for live cursors, watches, and single-operation opens so filesystems without stable volume UUIDs work out of the box, while scoping DirectoryIdentity strictly to checkpoint crash recovery and provider execution_basis.

Refs #6815

Migration

No runtime compatibility branches or incremental pre-release schema migrations are retained. Developers with an existing local runtime-host-rust State Root can stop any running Maka Host and run the one-shot migration script (updates .maka-storage-root.json, runtime-rust.sqlite, and managed worktree maka-owner.json files):

Verification

  • Ran planned CI suites across Linux (tooling, bridge, packaging, product, native-ubuntu, and full root archive/replay), Windows 11 (native, windows-shell, windows-desktop, windows-skills, desktop, pixels, windows_mxc, maka-fs-tools, root_lease), and macOS (licenses, contracts, native, macos-host, macos-desktop, pixels, bridge, native-build, product, macos-agent-execution, and headless desktop tests).
  • Verified observation_and_published_directory_survive_linux_overlayfs_copy_up against real Linux overlayfs mounts (uuid=on and uuid=off), confirming Observation, PublishedDirectory, and files::Directory survive directory copy-up.
  • Verified the migration Gist idempotently updates legacy <allocation>/maka-owner.json and <common_dir>/worktrees/maka-<id>/maka-owner.json files so Worktrees::inspect and Worktrees::capture_patch preserve uncommitted edits while retired tombstones stay retired.

AI use

  • Generative tooling made a substantive contribution

Google Antigravity implemented and verified the change across Linux, Windows, and macOS.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above

…arkers with path-based selection

Generated-by: Google Antigravity

@Astro-Han Astro-Han 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.

I checked the workspace/State Root marker changes, the persisted worktree binding reader, and the offline migration linked by this PR at 96c7ebbb55f14a217b8a4a8213cf2d4ecf167051. I found one P2 migration gap: existing managed worktrees retain owner documents that the new strict Binding reader rejects; details are inline.

I ran the unchanged migration Gist against a controlled temporary database created from the previous production 0001_runtime.sql, with old-schema-valid worktree owner records. The database binding was converted and accepted by the new generated schema, while both owner documents remained unchanged and failed that schema on source_identity. Removing only that field from both documents made them pass. The basic marker/index/checksum conversion and a second migration run also passed in this controlled fixture.

This is a scoped source and migration check, not a complete review of all 67 files. I did not run Rust ownership::verify, a real Host upgrade, checkpoint crash recovery, or native UI tests. The PR's cross-platform results remain the author's results. A static merge with rust-preview@738af1af4fbcadc653e7f1a89da40e41269bac4b succeeds; CI run 43788588992 was still running when checked.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

source: PathBuf,
#[schemars(with = "String", regex(pattern = "^sha256:[a-f0-9]{64}$"))]
source_identity: maka_sandbox::workspace::DirectoryIdentity,
base_commit: String,

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.

[P2] Migrate both persisted owner documents before removing this field

For an existing managed worktree, the linked offline migration removes source_identity from workspace_bindings.workspace_json.worktree, but does not update either <allocation>/maka-owner.json or <common_dir>/worktrees/maka-<id>/maka-owner.json. Both were serialized from the old Binding and still contain this field. Worktrees::inspect verifies both files through ownership::verify, which deserializes them as the new Binding with deny_unknown_fields; inspection and patch capture therefore fail after the documented migration.

In a controlled old-format fixture, the unchanged Gist migrated the database binding but left both owner files byte-for-byte unchanged. The old generated schema accepted them; the new one rejected source_identity. Removing only that field from both files made the new schema accept them. Please migrate the allocation and Git-admin owner records together with the database binding, retaining their ownership identity and retirement state. I have not executed the Rust reader or a real Host upgrade on this machine.

@github-actions github-actions Bot added the effort/XL Under 2500 readable lines label Nov 16, 2026

@Astro-Han Astro-Han 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.

I rechecked the migration change at 4fba6193b8b72902cb4909bf395594a938c60e93. The owner-document omission reported in my earlier review is fixed in the current linked migration Gist (SHA-256 7d69201da013857061de151dc039cdd144e24dd114270147c4a4872d03b01bb2). I no longer hold that P2 against this revision.

I ran the unchanged old and current Gist scripts on controlled fixtures using the previous production initial SQL and old-schema-valid owner documents. The current script converted both active owner documents, a managed retired allocation's owner without a database binding, and both documents for a database-referenced external allocation. All five documents passed the current generated Binding schema; the old script left all five rejected on source_identity. The retired marker stayed unchanged, its missing administrative owner was not recreated, fixture worktree contents were preserved, and a second current-script run left the owner bytes and database binding/digest values stable. The generated contract source is byte-identical at this PR head to the source used for that schema extraction.

I also read the added overlayfs observation logic and the strengthened Root relocation/reclone tests: Linux overlayfs now omits birth time from the short-lived directory observation. I did not execute Rust ownership::verify, a real Host upgrade, overlayfs mounts, or the full 67-file behavior. The PR's real-mount and cross-platform test claims remain the author's results. A static merge with rust-preview@d317be2bc541d4cd84b2817e2e0debeb2e35dcdd succeeds; CI run 43811063429 is still pending completion. This follow-up resolves the specific migration finding and does not certify the remaining upgrade, authorization, checkpoint recovery, or filesystem behavior.


Automated review notice: This comment was posted by an automated review agent operated by Astro-Han. It is not an independent human review and does not replace one.

@M4n5ter
M4n5ter merged commit ef106ad into rust-preview Nov 16, 2026
31 of 34 checks passed
@M4n5ter
M4n5ter deleted the refactor/path-workspace-identity branch November 16, 2026 08:29
M4n5ter added a commit to MicroGery/maka-agent that referenced this pull request Nov 16, 2026
…identity in tests

Update `checkpoint_repository` test fixtures after apache#6941 removed
`WorkspaceCapture::identity`.

Generated-by: Antigravity
M4n5ter pushed a commit that referenced this pull request Nov 16, 2026
Add durable logical Session/agent bindings, pluggable immutable-object and SessionRepository ports, and a durable independent `FileRepository` reference adapter outside worker Roots.

- Route checkpoint publication, Head reads, exact checkout, and recovery through the configured `Authority` (`Local` or `Shared`) while keeping Root-private SQL isolated in `root_store::checkpoints::local`.
- Preserve local zero-copy `hard_link` staging promotion with a single directory `sync_all()` barrier and carry the capture verification witness through fresh local commits while keeping full verification on recovery and external paths.
- Validate `BoundHead` and Manifest provenance on `Storage::checkout_exact`, separate external repository schema (`repository_id`) from Root migration 42, and update test fixtures for #6941.

Refs #2370

Co-authored-by: MicroGrey <[email protected]>
Generated-by: Codex
Generated-by: Antigravity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Under 2500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants