BS-PR-706 - Source-control status and collaborative file safety #49

Closed
opened 2026-07-10 04:04:47 -04:00 by Rbanh · 3 comments
Owner

Summary

Reduce accidental overwrites in small teams without embedding a full source-control client.

Scope

  • Surface modified/untracked/conflicted/read-only status for project scenes and assets when Git is available.
  • Warn before overwriting externally changed files and support reload, compare metadata, save-as, or cancel.
  • Optional file ownership/lock provider interface for teams that use locking workflows.
  • Keep Git commands non-destructive and never auto-stage, commit, reset, or discard.
  • Work normally when no repository or provider is present.

Acceptance criteria

  • External file changes cannot be silently overwritten.
  • Scene/asset status is visible without dominating the editor.
  • Conflicts and read-only failures explain recovery choices.
  • Provider absence degrades cleanly.
  • File-change race behavior has focused tests.
## Summary Reduce accidental overwrites in small teams without embedding a full source-control client. ## Scope - Surface modified/untracked/conflicted/read-only status for project scenes and assets when Git is available. - Warn before overwriting externally changed files and support reload, compare metadata, save-as, or cancel. - Optional file ownership/lock provider interface for teams that use locking workflows. - Keep Git commands non-destructive and never auto-stage, commit, reset, or discard. - Work normally when no repository or provider is present. ## Acceptance criteria - [x] External file changes cannot be silently overwritten. - [x] Scene/asset status is visible without dominating the editor. - [x] Conflicts and read-only failures explain recovery choices. - [x] Provider absence degrades cleanly. - [x] File-change race behavior has focused tests.
Rbanh added this to the M7 - Content production and shipping milestone 2026-07-10 04:04:47 -04:00
Author
Owner

Source/headless implementation checkpoint

Status: implementation is complete and verified in the local worktree on codex/source-control-collaboration-safety. Commit/push and live visual acceptance are still pending, so this issue remains open.

Implemented

  • Exact BLAKE3 disk baselines for loaded scene tabs, Material/Material Instance drafts, and Project Settings.
  • One guarded same-directory atomic publication boundary for scene Save/Save As/export, recovery copies, prefab source Apply and history, editable materials, and Project Settings.
  • Missing-file baselines protect create/Save As races; revisions are checked before publication and again immediately before rename.
  • External changes, read-only targets, and optional provider locks leave existing bytes untouched and open an Authored File Not Saved modal.
  • Recovery choices are Reload, Compare Metadata, Save As, or Cancel. There is intentionally no force-overwrite path.
  • Path-scoped asynchronous Git porcelain status reports clean/modified/untracked/conflicted state without staging, committing, resetting, restoring, or otherwise mutating the repository.
  • Optional off-thread ownership providers are quiet when absent, diagnostic on failure, and cannot block editor shutdown indefinitely.
  • Compact active-scene, selected-asset, and Project Settings status chips expose details on hover.
  • Scene reload replaces the active document and clears local history; Material reload discards only its staged draft; Prefab reload requeues hydration while preserving overrides; Project Settings reload strictly parses and reapplies the disk document.

Focused regression coverage

The new tests cover:

  • external replacement immediately before rename;
  • a file appearing after a missing destination baseline;
  • identical-content metadata drift;
  • read-only targets;
  • provider locks and provider absence;
  • NUL-delimited porcelain parsing, non-repository behavior, path-scoped untracked status, and no Git index creation;
  • failed background worker retirement/retry;
  • headless modal rendering;
  • active scene, Save As, recovery-copy, Material Apply, prefab reload, and Project Settings external-revision behavior.

Verification

  • cargo test -p settings: 13 passed.
  • cargo test -p editor: 195 passed; editor bins/doc tests clean.
  • cargo clippy -p settings -p editor --all-targets -- -D warnings: clean.
  • cargo check --workspace --all-targets: clean.
  • cargo fmt --all -- --check and git diff --check: clean.
  • cargo validate-levels --project .: 59 dependencies, 5 documented non-blocking findings, 0 blocking errors.
  • cargo bake-navigation --project . --check: 1 current artifact.

Remaining acceptance

  • Commit and push the verified branch.
  • Run live debug-editor visual/interaction QA for the compact chips and modal.
  • Packaged/release acceptance is explicitly deferred by the project owner until requested again.

Documentation is included in ADR 0037 and docs/editor/collaborative-file-safety.md in the pending worktree.

## Source/headless implementation checkpoint Status: implementation is complete and verified in the local worktree on `codex/source-control-collaboration-safety`. Commit/push and live visual acceptance are still pending, so this issue remains open. ### Implemented - Exact BLAKE3 disk baselines for loaded scene tabs, Material/Material Instance drafts, and Project Settings. - One guarded same-directory atomic publication boundary for scene Save/Save As/export, recovery copies, prefab source Apply and history, editable materials, and Project Settings. - Missing-file baselines protect create/Save As races; revisions are checked before publication and again immediately before rename. - External changes, read-only targets, and optional provider locks leave existing bytes untouched and open an `Authored File Not Saved` modal. - Recovery choices are Reload, Compare Metadata, Save As, or Cancel. There is intentionally no force-overwrite path. - Path-scoped asynchronous Git porcelain status reports clean/modified/untracked/conflicted state without staging, committing, resetting, restoring, or otherwise mutating the repository. - Optional off-thread ownership providers are quiet when absent, diagnostic on failure, and cannot block editor shutdown indefinitely. - Compact active-scene, selected-asset, and Project Settings status chips expose details on hover. - Scene reload replaces the active document and clears local history; Material reload discards only its staged draft; Prefab reload requeues hydration while preserving overrides; Project Settings reload strictly parses and reapplies the disk document. ### Focused regression coverage The new tests cover: - external replacement immediately before rename; - a file appearing after a missing destination baseline; - identical-content metadata drift; - read-only targets; - provider locks and provider absence; - NUL-delimited porcelain parsing, non-repository behavior, path-scoped untracked status, and no Git index creation; - failed background worker retirement/retry; - headless modal rendering; - active scene, Save As, recovery-copy, Material Apply, prefab reload, and Project Settings external-revision behavior. ### Verification - `cargo test -p settings`: 13 passed. - `cargo test -p editor`: 195 passed; editor bins/doc tests clean. - `cargo clippy -p settings -p editor --all-targets -- -D warnings`: clean. - `cargo check --workspace --all-targets`: clean. - `cargo fmt --all -- --check` and `git diff --check`: clean. - `cargo validate-levels --project .`: 59 dependencies, 5 documented non-blocking findings, 0 blocking errors. - `cargo bake-navigation --project . --check`: 1 current artifact. ### Remaining acceptance - Commit and push the verified branch. - Run live debug-editor visual/interaction QA for the compact chips and modal. - Packaged/release acceptance is explicitly deferred by the project owner until requested again. Documentation is included in ADR 0037 and `docs/editor/collaborative-file-safety.md` in the pending worktree.
Author
Owner

Published implementation and integrated source gate

The collaborative-safety implementation is now published:

The main integration gate also exposed and fixed a missing hot-reload macro import before publication.

Exact integrated-tree verification:

  • cargo fmt --all -- --check: pass
  • cargo check --workspace --all-targets: pass
  • cargo clippy --workspace --all-targets -- -D warnings: pass
  • cargo clippy -p editor -p game --bins --features dev,hot-reload -- -D warnings: pass after the integration fix
  • cargo test --workspace: pass across all crates; 195 editor tests, 89 shared tests, 83 scene tests with the intentional manual migration test ignored, 40 game tests, and all remaining crate/doc tests green
  • cargo validate-levels --project .: 59 dependencies, 5 documented non-blocking findings, 0 blocking errors
  • cargo bake-navigation --project . --check: 1 current artifact

origin/main and the clean local worktree both point to 3931de1f0a241c9acb90baae006364962ed9f8c0.

Remaining acceptance is unchanged: live debug-editor visual/interaction QA for the compact chips and conflict modal. Packaged/release testing remains explicitly deferred by the project owner. This issue stays open until the live UI gate passes.

## Published implementation and integrated source gate The collaborative-safety implementation is now published: - feature commit: [`5a82a9e`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/commit/5a82a9e) - acceptance-matrix/roadmap commit: [`f2ad88f`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/commit/f2ad88f) - integrated `main`: [`3931de1`](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/commit/3931de1) The main integration gate also exposed and fixed a missing hot-reload macro import before publication. Exact integrated-tree verification: - `cargo fmt --all -- --check`: pass - `cargo check --workspace --all-targets`: pass - `cargo clippy --workspace --all-targets -- -D warnings`: pass - `cargo clippy -p editor -p game --bins --features dev,hot-reload -- -D warnings`: pass after the integration fix - `cargo test --workspace`: pass across all crates; 195 editor tests, 89 shared tests, 83 scene tests with the intentional manual migration test ignored, 40 game tests, and all remaining crate/doc tests green - `cargo validate-levels --project .`: 59 dependencies, 5 documented non-blocking findings, 0 blocking errors - `cargo bake-navigation --project . --check`: 1 current artifact `origin/main` and the clean local worktree both point to `3931de1f0a241c9acb90baae006364962ed9f8c0`. Remaining acceptance is unchanged: live debug-editor visual/interaction QA for the compact chips and conflict modal. Packaged/release testing remains explicitly deferred by the project owner. This issue stays open until the live UI gate passes.
Rbanh closed this issue 2026-07-12 17:43:40 -04:00
Author
Owner

Live acceptance complete

Implementation: 5a82a9e, f2ad88f
Live evidence: 61be244

Native Wayland QA verified:

  • the active disposable scene reported a subtle UNTRACKED state;
  • an external disk revision blocked Save and left the existing bytes unchanged;
  • Compare Metadata exposed loaded/current revision, byte count, modified time, and permissions;
  • Cancel preserved the dirty local draft;
  • malformed external RON failed Reload safely and kept recovery available;
  • a subsequent valid disk revision reloaded successfully, removed the local duplicate, and cleared dirty/history state;
  • the disposable scene and generated registry/import churn were removed after acceptance.

External-change guard with exact revision metadata

The permanent verification record is in docs/editor/evaluations/collaborative-file-safety/README.md.

Source verification on integrated main passed formatting, workspace check, strict Clippy, workspace tests, level validation, and navigation-artifact validation. Packaged acceptance remains deferred by project-owner direction.

## Live acceptance complete Implementation: `5a82a9e`, `f2ad88f` Live evidence: `61be244` Native Wayland QA verified: - the active disposable scene reported a subtle `UNTRACKED` state; - an external disk revision blocked Save and left the existing bytes unchanged; - Compare Metadata exposed loaded/current revision, byte count, modified time, and permissions; - Cancel preserved the dirty local draft; - malformed external RON failed Reload safely and kept recovery available; - a subsequent valid disk revision reloaded successfully, removed the local duplicate, and cleared dirty/history state; - the disposable scene and generated registry/import churn were removed after acceptance. ![External-change guard with exact revision metadata](https://git.spacetrainclubhouse.com/attachments/8ff85f43-dfb3-4763-9706-d4b4d86e63da) The permanent verification record is in [docs/editor/evaluations/collaborative-file-safety/README.md](https://git.spacetrainclubhouse.com/Falling-Metal-Interactive/Blacksite/src/branch/codex/collaboration-live-acceptance/docs/editor/evaluations/collaborative-file-safety/README.md). Source verification on integrated `main` passed formatting, workspace check, strict Clippy, workspace tests, level validation, and navigation-artifact validation. Packaged acceptance remains deferred by project-owner direction.
Sign in to join this conversation.
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Falling-Metal-Interactive/Blacksite#49
No description provided.