Skip to content

Surface detached split-root state checkouts - #80

Merged
kentwelcome merged 4 commits into
mainfrom
spacedock-ensign-support-detached-split-root-state
Aug 21, 2026
Merged

Surface detached split-root state checkouts#80
kentwelcome merged 4 commits into
mainfrom
spacedock-ensign-support-detached-split-root-state

Conversation

@kentwelcome

Copy link
Copy Markdown
Contributor

Make detached and other split-root checkout states visible so Spacetop can inspect available snapshots without overclaiming sync freshness.

What changed

  • Add typed storage backend and checkout disposition models.
  • Probe split-root Git topology with fail-closed path containment.
  • Render topology diagnostics and truthful partial sync outcomes.
  • Re-probe topology across reload, watcher, and sync paths.

Evidence

  • 590/590 unit tests passed; all enabled integration and doc tests passed.
  • 8/8 topology-sync and 7/7 topology/parser regressions passed.

Review guidance

Focus on state_checkout.rs path containment and lib.rs sync re-probe boundaries.


076

Closes spacedock-dev/spacedock#677

Copilot AI lite review requested due to automatic review settings August 21, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends Spacetop’s split-root workflow support by classifying storage backend separately from the runtime Git checkout disposition (attached / detached / wrong-branch / missing / probe-failed). It then surfaces those topology diagnostics in the TUI and ensures sync/reload paths re-probe topology so Spacetop can remain read-only while still truthfully inspecting whatever snapshot is available.

Changes:

  • Add typed models for workflow storage (WorkflowStorage) and split-root checkout disposition (StateCheckoutDisposition), plus a read-only topology probe (state_checkout.rs).
  • Update parsing/indexing/sources to load entities+archives from the typed storage location, and surface topology diagnostics in the UI footer/help and sync outcomes.
  • Add regression tests covering reload behavior, watcher relevance, UI stable strings, and verified-fast-forward sync boundaries.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
README.md Updates user-facing docs to describe split-root backends, dispositions, and verified sync behavior.
docs/development-policy.md Documents new topology classification responsibilities and verified-attached sync boundary.
AGENTS.md Updates repo contract/code map to include split-root topology classification and verified state sync rules.
crates/spacetop-core/src/domain/mod.rs Introduces WorkflowStorage and StateCheckoutDisposition into the typed domain model.
crates/spacetop-core/src/state_checkout.rs Adds read-only storage classification + Git topology probing with containment checks.
crates/spacetop-core/src/parser/readme.rs Parses state-branch: and classifies storage/topology during README parsing.
crates/spacetop-core/src/parser/snapshot.rs Reuses split_root_entity_dir for entity-dir resolution (fail-closed behavior).
crates/spacetop-core/src/parser.rs Removes direct export of the old resolve_entity_dir helper.
crates/spacetop-core/src/index.rs Exposes storage via the workflow index for app/UI consumption.
crates/spacetop-core/src/sources.rs Loads archives via the typed storage entity directory.
crates/spacetop-core/src/watcher.rs Treats split-root state directory events as watcher-relevant.
crates/spacetop-core/src/lib.rs Exposes the new state_checkout module publicly.
crates/spacetop-core/tests/state_checkout_fixtures.rs Adds real-git fixture tests for attached/detached/wrong/missing and external symlink behavior.
crates/spacetop/src/app/overview.rs Adds SyncStatus::SucceededWithState/Partial and app-layer topology diagnostics.
crates/spacetop/src/app.rs Exposes workflow_storage() so sync orchestration can consult current typed storage.
crates/spacetop/src/lib.rs Re-probes topology across sync and gates state sync to verified-attached split-root checkouts (plus new tests).
crates/spacetop/src/ui/footer.rs Renders topology diagnostics and adds new sync pill variants/color mapping.
crates/spacetop/src/ui/help.rs Updates help text to clarify “verified” fast-forward sync behavior.
crates/spacetop/src/ui/tests.rs Adds helper to build App with explicit storage for UI diagnostic tests.
crates/spacetop/src/ui/tests/task_list.rs Adds tests pinning stable footer diagnostics and new sync pill strings/colors; updates fixtures for storage.
crates/spacetop/tests/state_topology_reload.rs Adds integration test that reload re-probes topology while keeping archive scope readable.
crates/spacetop/src/ui/tests/preview.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/ui/tests/paths.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/ui/tests/overview.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/ui/tests/chrome.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/ui/graph/tests.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/ui/definition.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/app/tests.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/app/mouse.rs Updates test fixtures for new WorkflowDefinition.storage field.
crates/spacetop/src/app/keys.rs Updates test fixtures for new WorkflowDefinition.storage field.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread crates/spacetop/src/app/overview.rs Outdated
Comment on lines +112 to +116
impl StateTopologyDiagnostic {
pub fn label(&self) -> String {
match self {
Self::Detached => "State detached; snapshot may be stale".to_string(),
Self::WrongBranch {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 04b6b0d. I replaced the allocating label() -> String path with Display, so footer rendering writes the diagnostic directly into the final formatted string. The existing Ratatui topology-diagnostic test passes.

Comment thread crates/spacetop/src/lib.rs Outdated
Comment on lines +36 to +42
if rel.is_absolute()
|| rel
.components()
.any(|component| component == Component::ParentDir)
{
return None;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 04b6b0d. split_root_entity_dir now requires at least one normal path component, so ., ./, and ././ remain single-root even when state-branch: is set. A focused regression proves these forms trigger no Git probe; full tests and lint pass.

@kentwelcome
kentwelcome merged commit 1078375 into main Aug 21, 2026
1 check passed
@kentwelcome
kentwelcome deleted the spacedock-ensign-support-detached-split-root-state branch August 21, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

status --boot --json: entity_dir_present is a string and does not distinguish a detached split-root state checkout

2 participants