From c489a78f34bfbf8aa88b8ef1adf67c6cb185f1ff Mon Sep 17 00:00:00 2001 From: ZDDC Date: Fri, 29 May 2026 14:36:56 -0500 Subject: [PATCH] feat(server): enable edit-history on the project-level personal workspace Per the working-folder design: /working// is each user's personal workspace (public by default, owned by the creator who can privatize via .zddc). The post-reshape defaults had stripped that node to a bare aggregator, so personal markdown drafts got no history. Add history: true + an auto_own (un-fenced) per-user-home rule to the project-level working node. archive//working/ keeps its own history: true. Scope stays working-only (staging/reviewing unchanged). Co-Authored-By: Claude Opus 4.7 (1M context) --- zddc/internal/zddc/defaults.zddc.yaml | 17 +++++++++++++++++ zddc/internal/zddc/lookups_test.go | 17 +++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/zddc/internal/zddc/defaults.zddc.yaml b/zddc/internal/zddc/defaults.zddc.yaml index 4cffa80..2b12a03 100644 --- a/zddc/internal/zddc/defaults.zddc.yaml +++ b/zddc/internal/zddc/defaults.zddc.yaml @@ -206,7 +206,24 @@ paths: working: default_tool: browse available_tools: [browse] + # Project-level working is BOTH an outstanding-only aggregator of + # the per-party archive//working/ slots AND the home for + # each user's personal workspace at /working//. virtual: true + # Edit-history versioning for personal markdown drafts (inherits + # to the / homes below). archive//working/ carries + # its own history: true separately. + history: true + paths: + "*": + # Per-user personal workspace: /working//. + # auto_own (NOT auto_own_fenced) makes the creator the owner + # (rwcda + a .zddc they can edit) while leaving the home PUBLIC + # by default — the owner opts into privacy by adding + # inherit:false / restricting permissions in their own .zddc. + default_tool: browse + available_tools: [browse] + auto_own: true staging: default_tool: browse available_tools: [browse] diff --git a/zddc/internal/zddc/lookups_test.go b/zddc/internal/zddc/lookups_test.go index 028f463..366e9ab 100644 --- a/zddc/internal/zddc/lookups_test.go +++ b/zddc/internal/zddc/lookups_test.go @@ -49,10 +49,11 @@ func TestDefaultToolAt_FromEmbeddedConvention(t *testing.T) { } // TestHistoryAt_Defaults — the embedded convention enables edit-history -// versioning on archive//working/ and (because history is -// subtree-inheriting and ignores the auto_own_fenced homes' inherit:false) -// on the per-user homes and any depth beneath them. Sibling slots do not -// get history. +// versioning on BOTH (a) the project-level personal workspace +// /working/ + its per-user / homes, and (b) the per-party +// archive//working/ + its homes. History is subtree-inheriting and +// ignores the homes' inherit:false fences. Sibling slots (staging, +// reviewing, mdl, incoming, received) do NOT get history. func TestHistoryAt_Defaults(t *testing.T) { resetCache() root := t.TempDir() @@ -60,9 +61,17 @@ func TestHistoryAt_Defaults(t *testing.T) { path string want bool }{ + // Project-level personal workspace. + {filepath.Join(root, "Project-X", "working"), true}, + {filepath.Join(root, "Project-X", "working", "alice@example.com"), true}, + {filepath.Join(root, "Project-X", "working", "alice@example.com", "notes"), true}, + // Per-party working. {filepath.Join(root, "Project-X", "archive", "Acme", "working"), true}, {filepath.Join(root, "Project-X", "archive", "Acme", "working", "alice@example.com"), true}, {filepath.Join(root, "Project-X", "archive", "Acme", "working", "alice@example.com", "notes"), true}, + // Sibling slots get no history. + {filepath.Join(root, "Project-X", "staging"), false}, + {filepath.Join(root, "Project-X", "reviewing"), false}, {filepath.Join(root, "Project-X", "archive", "Acme", "mdl"), false}, {filepath.Join(root, "Project-X", "archive", "Acme", "incoming"), false}, {filepath.Join(root, "Project-X", "archive", "Acme", "staging"), false},