Data Definition Document: Unified Knowledge
Domain: Unified (audit, communications, identity, library, notifications, search, signals, vault, workflow)
Logical Sub-Domain: Knowledge (Composite)
Physical Packages: vault, library, communications
Related Documents: Process Blueprint
Context: This document defines the Data Structures, Relationships, and Field-Level Truth for the Knowledge stack.
Source: packages/modules/unified/{vault,library,communications}/src/schema.ts
0. Entity Relationship Diagram (ERD)
erDiagram
%% Core Entities
USER ||--o{ VAULT_RECORD : "owns/accesses"
UNIT ||--o{ VAULT_RECORD : "context"
%% Vault
VAULT_RECORD {
string id PK
enum type "contract, deed, invoice"
string retentionPolicy
timestamp expiresAt
}
%% Library
LIBRARY_BOOK ||--|{ LIBRARY_TOPIC : "contains"
LIBRARY_BOOK {
string id PK
string title
string[] audience "public, resident"
}
LIBRARY_TOPIC {
string id PK
string parentId FK "self-ref"
string content "MDX"
}
%% Communications
COMM_CHANNEL ||--|{ COMM_POST : "hosts"
COMM_POST ||--|{ COMM_COMMENT : "has"
USER ||--o{ COMM_POST : "authors"
COMM_CHANNEL {
string id PK
enum type "public, private"
}
COMM_POST {
string id PK
enum status "draft, published"
}
1. Vault
Entity: VaultRecord
Represents a secured file (PDF, Image) with legal retention context.
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Unique ID (UUID). |
type |
string |
Yes | Enum: input_scan, system_output, legacy_file. |
title |
string |
Yes | Display name. |
blobUrl |
url |
Yes | Direct link to Cloud Storage. |
integrityHash |
string |
No | SHA-256 hash for tamper evidence. |
retentionPolicy |
string |
Yes | Enum: indefinite, 7_year, 1_year. |
expiresAt |
Timestamp |
No | Date when the record SHOULD be purged. |
accessScope.userId |
string |
No | If private to a user. |
accessScope.unitId |
string |
No | If context is a Property Unit. |
2. Library
Entity: LibraryBook
A container for structured content (e.g. "Resident Handbook").
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Unique ID. |
slug |
string |
Yes | URL-friendly identifier. |
title |
string |
Yes | Display title. |
audience |
string[] |
Yes | RBAC Roles: public, resident, board. |
status |
string |
Yes | Enum: active, archived. |
Entity: LibraryTopic
A single chapter or page within a Book.
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Unique ID. |
bookId |
string |
Yes | Parent Book ID. |
parentId |
string |
No | Parent Topic ID (for nesting). |
title |
string |
Yes | Chapter Title. |
content |
string(mdx) |
No | The actual body content (Markdown/MDX). |
order |
int |
Yes | Sort order index. |
3. Communications (Discussions)
Entity: CommChannel
A forum or category for posts (e.g. "General", "Lost & Found").
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Unique ID. |
name |
string |
Yes | Display name. |
type |
string |
Yes | Enum: public, private, announcement. |
allowComments |
boolean |
Yes | If false, read-only. |
Entity: CommPost
A user-submitted thread.
| Field | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Unique ID. |
channelId |
string |
Yes | Parent Channel. |
authorId |
string |
Yes | User ID of the creator. |
title |
string |
Yes | Headline. |
content |
string |
No | Post body. |
status |
string |
Yes | Enum: draft, published, archived. |
stats.likes |
int |
Yes | Engagement counter. |
4. Changelog
| Date | Author | Description | Reference |
|---|---|---|---|
| 2026-01-24 | Antigravity | Initial creation after Migration | Walkthrough |