ZDDC/zddc/internal
ZDDC f7958d7b22 feat(dispatch): trailing slash → browse, no slash → canonical default tool
URL convention for directories under a project:

- <dir>/  (with trailing slash)  → browse (the directory view; same
                                     behaviour as today)
- <dir>   (without trailing slash) → the canonical default tool for
                                     that directory's context, served
                                     inline (no 301 hop)

Tool mapping via the new apps.DefaultAppAt(root, dir):

  - working/...               → mdedit
  - staging/...               → transmittal
  - archive/                  → archive
  - archive/<party>/          → archive
  - archive/<party>/incoming|received|issued/...  → archive
  - archive/<party>/mdl/...   → tables (the per-party MDL grid editor)

Directories outside the canonical layout (project root, scratch
folders) keep the legacy 301-to-trailing-slash redirect since no
default tool fits.

This generalises and replaces the bespoke
"GET archive/<party>/mdl/ → 302 mdl.table.html" redirect added in PR4.
The new dispatcher rule serves the table app inline at the bare-mdl
URL by routing through RecognizeTableRequest with the canonical
.table.html suffix appended; relative fetches resolve identically
because both URLs share the same parent directory.

Tests: TestDefaultAppAt covers all canonical positions plus
case-fold and out-of-tree edges. TestDispatchSlashRouting (replacing
the now-obsolete TestDispatchMdlRedirect) verifies the slash-vs-no-
slash distinction at every canonical folder + non-canonical
fallback.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-07 11:26:32 -05:00
..
apps feat(dispatch): trailing slash → browse, no slash → canonical default tool 2026-05-07 11:26:32 -05:00
archive refactor(archive): use shared zddc.ParseTransmittalFolder 2026-05-07 09:14:19 -05:00
config feat(archive): periodic rescan + admin reindex endpoint 2026-05-06 08:50:51 -05:00
fs feat(fs): synthesise per-user virtual home in working/ listings 2026-05-07 09:20:25 -05:00
handler feat(handler): expose inherit fence in /.profile/effective-policy 2026-05-07 11:02:33 -05:00
jsonschema feat: form-data system v0 (sixth tool + zddc-server endpoints) 2026-05-02 20:12:16 -05:00
listing feat(fs): synthesise per-user virtual home in working/ listings 2026-05-07 09:20:25 -05:00
policy feat(server): authenticated CRUD + verb-based RBAC with WORM archive folders 2026-05-05 15:58:04 -05:00
tlsutil feat(server): TLS hardening per NIST SP 800-52 Rev. 2 + HSTS 2026-05-04 17:55:52 -05:00
zddc docs(zddc): tighten inherit/strict-mode docstrings + AllowedAtLevel deprecation 2026-05-07 11:10:31 -05:00