[VS-NfD] Add classification as a page field with migration and instance default #204

Closed
opened 2026-07-30 01:43:39 +02:00 by fable-5 · 1 comment
Collaborator

Plan reference: 20-massnahmenplan.md -> P1-2
ADR: ADR 0022
Effort: M (2 AT)
Depends on:

Context

Marking classified content is the one VS-NfD requirement that genuinely
belongs in the application: only it knows which page carries which
level. Separating the levels stays outside (one instance per level,
ADR 0022) — this field is the marking, not a protection mechanism.

Current state

  • model Page (apps/api/prisma/schema.prisma:263–300) has no
    classification field. Metadata is title, slug, sortKey, parentId,
    timestamps and relations.
  • Label (:423–437) is pond-scoped (pondId), hierarchical and
    user-editable — the reason ADR 0022 rejects labels as the carrier.
  • instance_settings (:17–23) is the established place for an
    instance-wide default (pattern: upload.svgPolicy, api.enabled).

Acceptance criteria

  • Enum field on Page with an explicit "unclassified" default;
    migration backfills existing pages to it.
  • Instance setting supplies the default for newly created pages;
    documented and admin-visible.
  • The value is part of the page API representation and of the page
    metadata the frontend already loads (no extra request per page).
  • Permission-relevant behaviour is unchanged by this issue —
    asserted by a test, because ADR 0022 makes the ACL claim explicitly
    not a protection mechanism.
  • docs/architecture/data-model.md documents the field; ADR 0022 is
    referenced from it.

Out of scope

Inheritance (#205), any output marking (#206–#212), and read auditing (M6).

**Plan reference:** `20-massnahmenplan.md` -> P1-2 **ADR:** ADR 0022 **Effort:** M (2 AT) **Depends on:** — ## Context Marking classified content is the one VS-NfD requirement that genuinely belongs *in* the application: only it knows which page carries which level. Separating the levels stays outside (one instance per level, ADR 0022) — this field is the marking, not a protection mechanism. ## Current state - `model Page` (`apps/api/prisma/schema.prisma:263–300`) has no classification field. Metadata is `title`, `slug`, `sortKey`, `parentId`, timestamps and relations. - `Label` (`:423–437`) is pond-scoped (`pondId`), hierarchical and user-editable — the reason ADR 0022 rejects labels as the carrier. - `instance_settings` (`:17–23`) is the established place for an instance-wide default (pattern: `upload.svgPolicy`, `api.enabled`). ## Acceptance criteria - [ ] Enum field on `Page` with an explicit "unclassified" default; migration backfills existing pages to it. - [ ] Instance setting supplies the default for newly created pages; documented and admin-visible. - [ ] The value is part of the page API representation and of the page metadata the frontend already loads (no extra request per page). - [ ] Permission-relevant behaviour is unchanged by this issue — asserted by a test, because ADR 0022 makes the ACL claim explicitly *not* a protection mechanism. - [ ] `docs/architecture/data-model.md` documents the field; ADR 0022 is referenced from it. ## Out of scope Inheritance (#205), any output marking (#206–#212), and read auditing (M6).
fable-5 added this to the M26 — VS-NfD: classification metadata milestone 2026-07-30 01:43:39 +02:00
fable-5 added the
vs-nfd:blocker
area:storage
effort:M
vs-nfd
labels 2026-07-30 01:43:39 +02:00
Author
Collaborator

Done in PR #263 (commit 183faf7, CI run 538 green, fast-forward merged on Stefan's standing merge instruction for this session).

Evidence against the acceptance criteria:

  • Enum field classification on Page (UNCLASSIFIED default, VS_NFD) with migration 20260731120000_page_classification backfilling existing pages via NOT NULL DEFAULT.
  • Instance setting classification.newPageDefault supplies the default for new pages; admin-visible in the Administration settings (select, de+en) and documented in data-model.md.
  • The value is part of every PageView (pages, sidebar list, trash) - no extra request per page.
  • Permission invariance pinned by test classification.e2e.db.test.ts: owner read/write identical for classified and open pages, outsider gets 404 for both directions.
  • data-model.md documents the field and references ADR 0022; the ADR now also fixes the marking wording (VS - NUR FUER DEN DIENSTGEBRAUCH, locale-independent, single source classificationMarking() in @dorfteich/shared).
Done in PR #263 (commit 183faf7, CI run 538 green, fast-forward merged on Stefan's standing merge instruction for this session). Evidence against the acceptance criteria: - Enum field classification on Page (UNCLASSIFIED default, VS_NFD) with migration 20260731120000_page_classification backfilling existing pages via NOT NULL DEFAULT. - Instance setting classification.newPageDefault supplies the default for new pages; admin-visible in the Administration settings (select, de+en) and documented in data-model.md. - The value is part of every PageView (pages, sidebar list, trash) - no extra request per page. - Permission invariance pinned by test classification.e2e.db.test.ts: owner read/write identical for classified and open pages, outsider gets 404 for both directions. - data-model.md documents the field and references ADR 0022; the ADR now also fixes the marking wording (VS - NUR FUER DEN DIENSTGEBRAUCH, locale-independent, single source classificationMarking() in @dorfteich/shared).
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: stwaidele/dorfteich#204
No description provided.