[Feature] Add bounded hierarchy copy, visibility, escalation, and vacancy routing rules #18

Closed
opened 2026-07-28 18:59:05 +02:00 by zemion · 1 comment
Owner

Outcome

Postbox can route attention or an explicit linked copy to a function postbox higher in a selected organization hierarchy without granting unlimited ancestor access.

Acceptance criteria

  • Default to no hierarchy propagation.
  • Model copy, attention/escalation, and shared visibility as distinct semantics; do not treat them as interchangeable.
  • For the first production slice, implement explicit linked-copy routing with source provenance, maximum depth, stop unit/type, selected structure/relation, target function mapping, and loop/deduplication protection.
  • Evaluate and snapshot the route at delivery time. A later organization move does not retroactively expose an old message.
  • Gate routing by message classification, tenant policy, sender authority, retention, and target availability.
  • Represent vacancy separately from failure; allow bounded escalation after a configured delay without granting plaintext access to a personal account.
  • Keep source and copy states linked but independently readable/acknowledgeable; make fan-out visible in delivery evidence.
  • Provide a dry-run explanation API and tests for no route, one parent, depth limit, parallel structures, vacancy, duplicate paths, restricted classification, and tenant isolation.

Dependencies

## Outcome Postbox can route attention or an explicit linked copy to a function postbox higher in a selected organization hierarchy without granting unlimited ancestor access. ## Acceptance criteria - Default to no hierarchy propagation. - Model `copy`, `attention/escalation`, and `shared visibility` as distinct semantics; do not treat them as interchangeable. - For the first production slice, implement explicit linked-copy routing with source provenance, maximum depth, stop unit/type, selected structure/relation, target function mapping, and loop/deduplication protection. - Evaluate and snapshot the route at delivery time. A later organization move does not retroactively expose an old message. - Gate routing by message classification, tenant policy, sender authority, retention, and target availability. - Represent vacancy separately from failure; allow bounded escalation after a configured delay without granting plaintext access to a personal account. - Keep source and copy states linked but independently readable/acknowledgeable; make fan-out visible in delivery evidence. - Provide a dry-run explanation API and tests for no route, one parent, depth limit, parallel structures, vacancy, duplicate paths, restricted classification, and tenant isolation. ## Dependencies - [Organizations hierarchy contract](https://git.add-ideas.de/GovOPlaN/govoplan-organizations/issues/5) - Function-scoped templates and addresses (#17) - Parent user story: #16
Author
Owner

Codex State: done

Summary

  • Implemented immutable, default-off hierarchy routing policies with separate linked-copy, vacancy-attention, and shared-visibility semantics.
  • Deliveries now freeze structure/relation paths, target and holder provenance, classification/producer/retention gates, stop conditions, and deduplicated bounded targets into route evidence.
  • Added independent linked-copy messages and receipts, dry-run explanations, delayed vacancy escalation with cancellation when vacancy resolves, and the optional Core periodic routing worker.
  • Added selector-backed template administration for structures, relations, target functions/templates, depth, fan-out, retention, and escalation.

Changed Files

  • src/govoplan_postbox/backend/hierarchy_routing.py
  • src/govoplan_postbox/backend/service.py
  • src/govoplan_postbox/backend/router.py
  • src/govoplan_postbox/backend/schemas.py
  • webui/src/features/postbox/PostboxAdminPanel.tsx
  • src/govoplan_core/core/postbox.py
  • src/govoplan_core/celery_app.py
  • src/govoplan_organizations/backend/directory.py

Verification

  • Postbox backend suite: 16 tests passed; Ruff passed.
  • Organizations hierarchy suite: 6 tests passed; Core routing/contract suites: 6 tests passed.
  • Full tools/checks/check-focused.sh passed, including 117 Core tests, migration composition, all module permutations, Postbox TypeScript, and the full-product build.

Next / Blocked

  • Postbox #17 remains open for richer template lifecycle and structure-scoped template work; shared visibility remains explicitly unsupported rather than conflated with copies.
## Codex State: done ### Summary - Implemented immutable, default-off hierarchy routing policies with separate linked-copy, vacancy-attention, and shared-visibility semantics. - Deliveries now freeze structure/relation paths, target and holder provenance, classification/producer/retention gates, stop conditions, and deduplicated bounded targets into route evidence. - Added independent linked-copy messages and receipts, dry-run explanations, delayed vacancy escalation with cancellation when vacancy resolves, and the optional Core periodic routing worker. - Added selector-backed template administration for structures, relations, target functions/templates, depth, fan-out, retention, and escalation. ### Changed Files - `src/govoplan_postbox/backend/hierarchy_routing.py` - `src/govoplan_postbox/backend/service.py` - `src/govoplan_postbox/backend/router.py` - `src/govoplan_postbox/backend/schemas.py` - `webui/src/features/postbox/PostboxAdminPanel.tsx` - `src/govoplan_core/core/postbox.py` - `src/govoplan_core/celery_app.py` - `src/govoplan_organizations/backend/directory.py` ### Verification - `Postbox backend suite: 16 tests passed; Ruff passed.` - `Organizations hierarchy suite: 6 tests passed; Core routing/contract suites: 6 tests passed.` - `Full tools/checks/check-focused.sh passed, including 117 Core tests, migration composition, all module permutations, Postbox TypeScript, and the full-product build.` ### Next / Blocked - Postbox #17 remains open for richer template lifecycle and structure-scoped template work; shared visibility remains explicitly unsupported rather than conflated with copies.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: GovOPlaN/govoplan-postbox#18