Files
pages/docs/design/user-space-publication.md
T
Anya Tokugawa c1175d389f Implement Knowledge City platform, organizer and DAV integration
Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming.

Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
2026-09-27 14:44:43 +09:00

3.6 KiB

User-space visibility and anonymous publication

Status: implemented for local /u/{username} namespaces. The feature is opt-in and defaults to the authenticated Domain audience. It does not add user namespaces to the global anonymous tree.

Policy model

The owner configures the policy at /u/{username}/_/edit. Four independent audiences are stored:

  • profile metadata (display name and profile-facing fields),
  • avatar,
  • the /u/{username} Wiki root document,
  • descendant Wiki documents.

Each audience is private, domain, or public. Descendant Paths can have an exact policy that narrows the descendant default to domain or private; an exact policy also restricts its subtree. It cannot broaden its parent default. The policy row has a compare-and-swap version, and each successful change is recorded as an append-only before/after event.

public is valid only while the Domain is enabled, its Campus is enabled, authorization is enforcing, and the Domain publication ceiling is public. Changing that ceiling to authenticated immediately closes the user-space projection. Saving an owner policy cannot raise the Domain ceiling.

Projection contract

User-space publication is a deliberate live-head projection. Once the owner selects public, the current language head and future edits under that audience are visible without a separate immutable publication manifest. The settings UI therefore describes it as an automatic publication choice. This differs from the ordinary explicit-Revision approval flow and must not be inferred from a Domain ceiling alone.

Anonymous requests resolve through a user-space-specific reader. It:

  1. resolves an active local username and re-evaluates the Domain ceiling;
  2. evaluates root/descendant/override visibility;
  3. requires one canonical Path binding for the Object;
  4. chooses a bounded current language head;
  5. builds a bounded navigation snapshot containing only visible user Paths;
  6. renders through the normal safe HTML/content projection.

The same snapshot supplies /v/children, /v/tree/u/{username} and /v/browser/u/{username}. User spaces remain excluded from the global anonymous tree. UUID, Revision, document-hash, aliases, reserved /_/ routes, and ordinary City publication cannot be used to bypass this reader. The avatar has its own audience check and is returned with private, no-store.

Authenticated readers are also constrained by the user policy. The owner and a Domain administrator can recover the namespace; other members cannot read a private root, descendant, avatar, Object or Revision even when a broader Domain grant exists. Request-local policy caching is permitted, but there is no process-wide authorization cache, so revocation applies on the next request.

Structural changes and bounds

Exact overrides follow an atomic Path rename, including recursive subtree rename. A protected override cannot be moved outside its owner's user namespace, and deleting its Path deletes the stale exact override. The current limits are 256 saved overrides, 512 rows in the edit listing, the common navigation entry budget, and the common projection input limit. Exceeding a bound fails closed.

Remaining work

  • Add a paginated override editor for user spaces larger than the current edit listing budget.
  • Decide whether administrators need an audited emergency policy editor; the current UI intentionally remains owner-only while the Domain ceiling is the superior control.
  • Connect user-space automatic publication to the future human approval policy without converting existing private/domain policies.
  • Add export/restore tooling for policy events and explicit policy-history UI.