You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
Parent epic: #738
Depends on: #739
Admission requirement: apply docs/awcms-mini/21_module_admission_governance.md before implementation.
Context
Many derived applications need reusable document metadata, versions, classifications, evidence/attachments, resource relations, retention references, and concurrency-safe numbering. The base must provide infrastructure only; it must not embed domain documents such as letters, invoices, purchase orders, journal batches, medical records, or contracts.
Objective
Add an optional generic document-infrastructure capability with immutable versions, classification, evidence links, generic resource references, access/audit controls, and scoped numbering sequences.
Scope
Complete module-admission decision/ADR before scaffold.
Add immutable document versions with content/file references, media type, size, checksum, source, created-by, and supersession metadata.
Reuse existing/approved managed-object storage contracts rather than storing large binary content in PostgreSQL.
Add typed relationships between documents and module-owned resources through generic references/capability validation, not direct table writes.
Add evidence records for reserved/canceled/replaced/voided versions or numbers.
Add concurrency-safe numbering sequences with:
scope type/ID;
format/prefix/suffix rules using a bounded template grammar;
reset policies;
reservation, commit, cancel, and gap evidence;
effective dates/versioning;
no silent number reuse.
Add permission-gated APIs/UI for document registry, versions, relations, classifications, number sequences, reservations, canceled numbers, and history.
High-risk actions—reserve/cancel/void/restore/reclassify—require idempotency where applicable, reason, permission, and audit.
Out of scope
Domain-specific document schemas/content editors or legal templates.
Electronic signature/TTE provider integration.
Full records-management certification or one universal retention schedule.
General ledger, invoice accounting, procurement, or government correspondence business rules.
Acceptance criteria
Admission decision/ADR confirms module category and capability dependencies.
Generic documents, immutable versions, classifications, resource relations, and evidence are tenant-safe and module-neutral.
Binary content is referenced through an approved file/object capability, not stored as unbounded database blobs.
Sequence allocation remains unique under concurrent requests and supports reservation/commit/cancel with durable evidence.
Committed/canceled numbers and immutable versions are never silently reused or rewritten.
At least five neutral fixtures—correspondence evidence, contract attachment, invoice reference, approval evidence, and asset-disposal evidence—demonstrate reuse without adding their domain rules.
Classification/confidentiality, business scope, RLS, ABAC, secure-download, checksum, concurrency, idempotency, and audit negative tests pass.
OpenAPI/AsyncAPI, ERD/data dictionary, architecture/admission docs, threat model, storage/retention integration, admin/user guide, repository inventory, and changeset are updated.
bun run modules:dag:check, bun run api:spec:check, bun run security:readiness, tests, UI/E2E, build, and bun run check pass.
Parent epic: #738
Depends on: #739
Admission requirement: apply
docs/awcms-mini/21_module_admission_governance.mdbefore implementation.Context
Many derived applications need reusable document metadata, versions, classifications, evidence/attachments, resource relations, retention references, and concurrency-safe numbering. The base must provide infrastructure only; it must not embed domain documents such as letters, invoices, purchase orders, journal batches, medical records, or contracts.
Objective
Add an optional generic document-infrastructure capability with immutable versions, classification, evidence links, generic resource references, access/audit controls, and scoped numbering sequences.
Scope
Security and integrity requirements
tenant_id,ENABLE+FORCE RLS, tenant-first indexes, least-privilege roles, and default-deny permissions.Out of scope
Acceptance criteria
bun run modules:dag:check,bun run api:spec:check,bun run security:readiness, tests, UI/E2E, build, andbun run checkpass.