Skip to content

Commit f071d64

Browse files
authored
Merge pull request #4531 from atomantic/cos/app-improve-portos-default-documentation-msyum9k0/agent-be4e4d18
docs: update and improve PortOS documentation
2 parents 1d1bfb2 + 22f07bf commit f071d64

4 files changed

Lines changed: 84 additions & 5 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ Full catalog (including design plans, ADRs, and research notes): [docs/README.md
402402
- [Architecture Overview](./docs/ARCHITECTURE.md) — System design, data flow, and service diagram
403403
- [API Reference](./docs/API.md) — REST endpoints, full route-domain index, and WebSocket events
404404
- [Companion App API](./docs/COMPANION_APP_API.md) — PortDeck native mobile client discovery and HTTP API contract
405+
- [Federated Media Providers](./docs/FEDERATED_MEDIA_PROVIDERS.md) — Authenticated, capacity-aware peer audio provider wire contract and setup
405406
- [Storage Classification Contract](./docs/STORAGE.md) — when data belongs in PostgreSQL vs the filesystem, plus the new-data-store checklist
406407
- [Backup & Restore](./docs/BACKUP.md) — filesystem snapshots + mandatory PostgreSQL dumps and how to restore them
407408
- [Port Allocation](./docs/PORTS.md) — Port conventions (5553-5561) and allocation guide
@@ -424,14 +425,17 @@ Full catalog (including design plans, ADRs, and research notes): [docs/README.md
424425
- [Voice Mode](./docs/features/voice.md) — local STT/TTS/LLM voice assistant setup
425426
- [Chief of Staff](./docs/features/chief-of-staff.md) — Autonomous agent orchestrator
426427
- [Operational Goals](./docs/GOALS_OPERATIONAL.md) — Runtime priorities the CoS reads when generating work
428+
- [Agent Context](./docs/features/agent-context.md) — Per-task execution context and history tracking
427429
- [Agent Skills](./docs/features/agent-skills.md) — Task-type-specific agent prompts
428430
- [Claude on Ollama](./docs/features/claude-ollama.md) — Run agent tasks on a local model
429431
- [CoS Agent Runner](./docs/features/cos-agent-runner.md) — Isolated agent process architecture
430432
- [CoS Enhancement](./docs/features/cos-enhancement.md) — Hybrid search, proactive execution, error recovery
433+
- [MTPLX](./docs/features/mtplx.md) — Multiplexed agent execution and terminal streaming
431434
- [Memory System](./docs/features/memory-system.md) — Semantic memory with vector search and importance decay
432435
- [Digital Twin](./docs/features/digital-twin.md) — Genome, chronotype, taste, and mortality-aware goals
433436
- [Identity System](./docs/features/identity-system.md) — Extended identity modeling (P1-P3)
434437
- [Soul System](./docs/features/soul-system.md) — Identity scaffold with behavioral testing
438+
- [Privacy Center](./docs/features/privacy-center.md) — Machine-local vault, data brokers, and organization change tracking
435439
- [Brain System](./docs/features/brain-system.md) — Offline-first second brain
436440
- [POST](./docs/features/post.md) — Daily cognitive training
437441
- [App Wizard](./docs/features/app-wizard.md) — App registration and scaffolding
@@ -442,6 +446,8 @@ Full catalog (including design plans, ADRs, and research notes): [docs/README.md
442446
- [JIRA Sprint Manager](./docs/features/jira-sprint-manager.md) — Autonomous JIRA triage and implementation
443447
- [Writers Room](./docs/features/writers-room.md) — Prose-to-media writing environment with explicit AI passes
444448
- [Sprite Export Contract](./docs/features/sprite-export-contract.md) — What a published sprite atlas guarantees a consuming game
449+
- [Video Text Encoders](./docs/features/video-text-encoders.md) — Dual-encoder memory and clip conditioning for video models
450+
- [Music Renderer Benchmarks](./docs/features/music-renderer-benchmarks.md) — Benchmarking profiles and listening test evidence for local renderers
445451
- [OpenClaw](./docs/features/openclaw-operator-chat.md) — In-app operator-agent chat
446452
- [Stacker News](./docs/features/stacker-news.md) — Territory management and content stewardship
447453
- [Messages Security Model](./docs/features/messages-security.md) — Prompt-injection boundary around untrusted message content

docs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ App management: [app-wizard](./features/app-wizard.md) · [autofixer](./features
3636

3737
Chief of Staff: [chief-of-staff](./features/chief-of-staff.md) · [cos-agent-runner](./features/cos-agent-runner.md) · [cos-enhancement](./features/cos-enhancement.md) · [agent-context](./features/agent-context.md) · [agent-skills](./features/agent-skills.md) · [memory-system](./features/memory-system.md) · [claude-ollama](./features/claude-ollama.md) · [mtplx](./features/mtplx.md) · [prompt-manager](./features/prompt-manager.md)
3838

39-
Identity & self: [digital-twin](./features/digital-twin.md) · [identity-system](./features/identity-system.md) · [soul-system](./features/soul-system.md) · [post](./features/post.md) (insights design spike: [plans/2026-06-03](./plans/2026-06-03-cross-domain-insights-engine.md))
39+
Identity & self: [digital-twin](./features/digital-twin.md) · [identity-system](./features/identity-system.md) · [soul-system](./features/soul-system.md) · [privacy-center](./features/privacy-center.md) · [post](./features/post.md) (insights design spike: [plans/2026-06-03](./plans/2026-06-03-cross-domain-insights-engine.md))
4040

4141
Knowledge: [brain-system](./features/brain-system.md) · [messages-security](./features/messages-security.md)
4242

docs/features/privacy-center.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Privacy Center
2+
3+
The Privacy Center is the PII (Personally Identifiable Information) management subsystem of PortOS. While the Digital Twin models aesthetic tastes, writing style, chronotype, and goals for AI prompts, the Privacy Center handles Sensitive Identity Data and Personal Records that must be protected, machine-local, and explicitly isolated.
4+
5+
> [!IMPORTANT]
6+
> **Privacy Boundary Contract**: Per ADR [privacy records machine-local](../decisions/2026-08-08-privacy-records-machine-local.md), records stored within the Privacy Center are strictly machine-local. They **NEVER** ride the federation layer, sync buckets, or peer-to-peer share networks, and are never included in LLM prompt contexts unless explicitly requested by the user.
7+
8+
---
9+
10+
## Subsystems
11+
12+
### 1. Vault
13+
The **Vault** is an encrypted, machine-local key-value store for sensitive personal documents and numbers:
14+
- Government identification (Passport numbers, SSN / Tax ID, Driver's license)
15+
- Financial identity (Bank account references, tax entity IDs)
16+
- Emergency contacts & private physical addresses
17+
18+
Data in the Vault is stored encrypted at rest (`server/lib/vaultCrypto.js`) using machine-derived key material and requires standard authentication when auth is enabled.
19+
20+
### 2. Organizations
21+
The **Organizations** registry maintains a list of third-party companies, services, and institutions that hold your personal data (e.g. financial institutions, utility providers, subscription services, medical providers). Each entry tracks:
22+
- Account references and data categories held
23+
- Contact channels and privacy policy links
24+
- Data retention & deletion policies
25+
26+
### 3. Changes Inventory
27+
When changing physical addresses, phone numbers, legal names, or primary emails, the **Changes** workflow provides a checklist and tracking matrix:
28+
- Inventory of organizations requiring update
29+
- Notification status per organization (pending, requested, confirmed)
30+
- Verification notes and dates updated
31+
32+
### 4. Data Brokers
33+
The **Data Brokers** module tracks exposure on data brokers, people-search sites, and marketing list aggregators. It manages:
34+
- Opt-out & CCPA / GDPR deletion request tracking
35+
- Direct opt-out URL shortcuts and template letters
36+
- Status verification dates and follow-up reminders
37+
38+
---
39+
40+
## Security Model & Data Flow
41+
42+
```mermaid
43+
flowchart TD
44+
User["User Interface (Settings / Privacy)"]
45+
Vault["Vault Storage (data/vault.json)"]
46+
Crypto["AES-256-GCM Encryption (vaultCrypto.js)"]
47+
Orgs["Organizations & Changes (Postgres DB)"]
48+
Federation["Federation & Peer Sync"]
49+
50+
User <-->|Local Read/Write| Crypto
51+
Crypto <-->|Encrypted At Rest| Vault
52+
User <-->|Local DB Access| Orgs
53+
54+
Vault -.-x|BLOCKED| Federation
55+
Orgs -.-x|BLOCKED| Federation
56+
```
57+
58+
1. **Isolation**: No endpoint under `/api/privacy/*` or `/data/vault*` participates in peer sync or cloud-folder share buckets (`data/sharing/`).
59+
2. **Prompt Injection Safety**: Privacy Center records are omitted from default RAG indices (BM25 & pgvector) used by AI agents and Chief of Staff tasks.
60+
3. **Auditability**: All modifications to Vault entries produce localized JSON audit entries without logging raw payload values.

server/lib/federatedMediaWire.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ const styleByWords = new Map(FEDERATED_AUDIO_STYLES.map((value) => [words(value)
3636
const instrumentByWords = new Map(FEDERATED_AUDIO_INSTRUMENTS.map((value) => [words(value), value]));
3737
const AUDIO_PROMPT_RE = /^Instrumental ([a-z ]+) music with a ([a-z]+) mood, (slow|moderate|fast) tempo, (low|medium|high) energy(?:, featuring ([a-z ]+(?: and [a-z ]+){0,5}))?\. No vocals or spoken words\.$/;
3838

39+
/**
40+
* Render a validated audio profile into a canonical prompt string.
41+
* Free-form text cannot cross the federation boundary (PII safety); consumers
42+
* send validated enum profiles, which this function formats into deterministic prompt prose.
43+
*
44+
* @param {object} profile - Audio profile conforming to federatedMediaAudioProfileSchema.
45+
* @returns {string|null} Canonical prompt string, or null if profile fails validation.
46+
*/
3947
export function renderFederatedMediaAudioPrompt(profile) {
4048
const parsed = federatedMediaAudioProfileSchema.safeParse(profile);
4149
if (!parsed.success) return null;
@@ -46,10 +54,15 @@ export function renderFederatedMediaAudioPrompt(profile) {
4654
return `Instrumental ${words(style)} music with a ${mood} mood, ${tempo} tempo, ${energy} energy${instrumentation}. No vocals or spoken words.`;
4755
}
4856

49-
// Provider-side validation receives only the rendered text (not the local
50-
// profile) so older wire-v1 providers can still accept newer consumers. Parse
51-
// the canonical grammar back into fixed tokens and require an exact round trip;
52-
// arbitrary prose, names, lyrics, and redaction-sensitive fields fail closed.
57+
/**
58+
* Validate that a prompt string conforms to the canonical federated audio grammar.
59+
* Provider-side validation receives only the rendered text (not the local profile)
60+
* so older wire-v1 providers can accept newer consumers. Parses the canonical grammar
61+
* back into fixed tokens and requires an exact round trip.
62+
*
63+
* @param {any} value - Input string to test.
64+
* @returns {boolean} True if input is a valid federated audio prompt string.
65+
*/
5366
export function isFederatedMediaAudioPrompt(value) {
5467
if (typeof value !== 'string') return false;
5568
const match = AUDIO_PROMPT_RE.exec(value);

0 commit comments

Comments
 (0)