Sync full ProjectOS monorepo from GitHub 7f633f5 (part 2)
Browse filesFiles changed (31)
- release/generated-docs/DEPENDENCY.mdAdded+4
- release/generated-docs/FABRICS.mdAdded+68
- release/generated-docs/FRONTIER.mdAdded+4
- release/generated-docs/GOVERNANCE.mdAdded+20
- release/generated-docs/IDENTITY.mdAdded+6
- release/generated-docs/KNOWLEDGE.mdAdded+10
- release/generated-docs/MCP.mdAdded+29
- release/generated-docs/MODELS.mdAdded+10
- release/generated-docs/PROVIDERS.mdAdded+15
- release/generated-docs/RUNTIME.mdAdded+8
- release/generated-docs/SCHEMA.mdAdded+20
- release/generated-docs/SNAPSHOTS.mdAdded+4
- release/generated-docs/STORAGE.mdAdded+28
- release/generated-docs/TRUST.mdAdded+6
- release/generated-docs/WORKSPACES.mdAdded+11
- release/manifest.jsonAdded+16
- release/migration-manifest.jsonAdded+34
- release/migrations/manifest.jsonAdded+34
- release/projectos-bootstrap.xmlAdded+215
- release/projectos-manifest.jsonAdded+16
- release/projectos-rules.schAdded+114
- release/projectos-schema.xsdAdded+318
- release/snapshot-manifest.jsonAdded+9
- release/storage/package-manifest.jsonAdded+12
- release/storage/postgres/schema.sqlAdded+255
- release/storage/sqlite/schema.sqlAdded+254
- schemas/ProjectOS.schAdded+114
- schemas/ProjectOS.xsdAdded+318
- scripts/validate-generated-snapshots.mjsAdded+24
- scripts/validate-manifest.ps1Added+24
- scripts/validate-release.mjsAdded+51
1234<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Dependency
Dependency Fabric records missing models, datasets, permissions, tools, and infrastructure in `dependency_findings`. Open findings are deduplicated by project, category, and name; they can be resolved or waived without erasing history. Current model routes: 5; workspace routes: 6.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Fabrics
## Identity
Resolves who is acting, what they own, and which roles apply.
Capabilities: Ownership graph, Role registry, LDAP, Entra, OAuth, and SAML connectors
## Trust
Evaluates sources, datasets, and models against workspace trust requirements.
Capabilities: Source verification, Dataset and model verification, Trust scores
## Research
Connects research sources and organizes evidence for project decisions.
Capabilities: Web and paper discovery, Documentation connectors, Research source attribution
## Knowledge
Organizes project memory into research, lessons, canon, frontier, and archive.
Capabilities: Project memory, Canonical knowledge, Snapshots and archive
## Logic
Builds plans and checks feasibility, consistency, and competing claims.
Capabilities: Intent analysis, Planning and validation, Consensus and contradictions
## Delta
Compares current and target states to identify gaps and useful evolution.
Capabilities: Current and frontier state, Gap analysis, Evolution and obsolescence
## Dependency
Finds unmet runtime, access, model, tool, library, and dataset requirements.
Capabilities: Missing permissions, Missing tools and models, Missing libraries, datasets, and infrastructure
## Governance
Applies policy gates, approval decisions, overrides, and audit recording.
Capabilities: Policy registry, Approval queue, Audit history
## Execution
Dispatches approved work to the appropriate execution adapter.
Capabilities: PowerShell, Python, and Node, Docker and Git, MCP tools
## Storage
Defines local and enterprise storage for project artifacts and vectors.
Capabilities: SQLite and sqlite-vec, PostgreSQL and pgvector, Snapshots, consolidation, and archives
## Canvas
Provides visual workspaces for diagrams, whiteboards, and knowledge views.
Capabilities: Whiteboard canvas, Diagram engine, Knowledge views1234<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Frontier
The Frontier tracks research that has not yet been accepted into canon. Candidate records and observations are stored in `frontier_items` and `frontier_observations`; promotion requires Logic validation and Governance approval before changing status and creating a canon entry.1234567891011121314151617181920<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Governance
- **Policy Engine** — Evaluates plans against the active policy registry.- **Approval Engine** — Routes gated actions to the right reviewer.- **Trust Validation** — Checks identity, sources, datasets, and models.- **Override Engine** — Records scoped exceptions with justification.- **Audit Log** — Keeps an attributable record of decisions and actions.- **Policy Registry** — Maintains versioned workspace rules.
Promotion and other governed actions create auditable records in `governance_reviews`; a pending or rejected review does not authorize execution or canon promotion.
## Permission rules
| ID | Resource | Action | Effect | Approval || --- | --- | --- | --- | --- || workspace-read | workspace | read | allow | false || workspace-write | workspace | write | require-approval | true || tool-execution | tools | execute | require-approval | true || external-network | external-network | access | deny | true |123456<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Identity
Resolves who is acting, what they own, and which roles apply.
Identity remains an integration boundary; provider credentials and directory connectors are configured separately.12345678910<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Knowledge
- **Project memory** — Working context and decisions.- **Research** — Sources, findings, and evidence.- **Lessons** — Reusable outcomes and reflections.- **Canon** — The current trusted project record.- **Frontier** — Emerging ideas and state of the art.- **Snapshots** — Point-in-time project state.- **Archive** — Preserved retired work.1234567891011121314151617181920212223242526272829<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># MCP
The registry separates adapters from profile membership and declares the authentication method for each server. Secrets are referenced by environment-variable name or an OS keyring profile; secret values are never generated into configuration or release files. GitHub's default OAuth flow requires browser approval rather than a saved PAT.
## Server library
| Entry | Adapter | Trust | Access | Authentication | Credential reference || --- | --- | --- | --- | --- | --- || filesystem | filesystem | High | read-only | none | None || git | git | High | read-only | none | None || github-readonly | github | Verified | read-only | oauth | None || github-write | github | High | read-write | oauth | None || postgres-readonly | postgres | Verified | read-only | keyring | PROJECTOS_POSTGRES_READ_PROFILE || postgres-write | postgres | High | read-write | keyring | PROJECTOS_POSTGRES_WRITE_PROFILE || fetch | fetch | Medium | read-only | none | None || memory | memory | High | read-only | none | None |
## Profiles
| Profile | Enabled | Servers | Purpose || --- | --- | --- | --- || workspace | true | filesystem, memory | Workspace files and persistent MCP memory. || research | true | fetch, github-readonly | Public web research and read-only GitHub context. || implementation | true | filesystem, github-readonly | Workspace files and read-only GitHub context. || database-readonly | true | postgres-readonly | Read-only PostgreSQL access using an OS keyring profile. || database-write | false | postgres-write | Explicitly disabled write access; requires a separate least-privilege database role and approval policy. |
The ProjectOS MCP Fabric validates credential references and connects selected profiles. GitHub and PostgreSQL write access are disabled by default.12345678910<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Models
| Role | Provider || --- | --- || operations | omni || research | sonar || implementation | copilot || ml | qwen || logic | claude |123456789101112131415<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Providers
## Storage providers
- SQLite- PostgreSQL
## Model providers
- omni- sonar- copilot- qwen- claude12345678<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Runtime
- Profile: Privileged- Snapshots: true- Automatic routing: true- Consolidation: true- Startup order: schema → bootstrap → fabrics → identity → trust → storage → knowledge → logic → governance → operations → agents → registries → council → mcp → desktop1234567891011121314151617181920<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Schema
## Validation inputs
- XSD: `schemas/ProjectOS.xsd`- Schematron: `schemas/ProjectOS.sch`
The XSD enforces manifest structure, typed values, positive dimensions and retention periods, and unique registry keys. Schematron enforces cross-section rules for storage provider dependencies, migration backups, canon retention, MCP registry completeness, and symbol alias collisions.
## Canonical symbols
| Canonical symbol | Aliases || --- | --- || ProjectRepository | IProjectRepository, ProjectRepo, ProjectStore || CanonRepository | ICanonRepository, CanonRepo, CanonStore || SnapshotRepository | ISnapshotRepository, SnapshotRepo, SnapshotStore || FrontierRepository | IFrontierRepository, FrontierRepo, FrontierStore || ArchiveRepository | IArchiveRepository, ArchiveRepo, ArchiveStore || EmbeddingRepository | IEmbeddingRepository, EmbeddingRepo, EmbeddingStore |1234<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Snapshots
Snapshots capture project state, events, canon entries and revisions, frontier records and observations, archives, embeddings, dependency findings, delta runs and gaps, and governance reviews with a schema version and content checksum. The configured retention period is 90 days. Snapshot and item records are stored in `snapshots` and `snapshot_items`; the release snapshot manifest hashes bootstrap, runtime, and storage configuration.12345678910111213141516171819202122232425262728<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Storage
## Providers
- SQLite- PostgreSQL
## Vector stores
| Provider | Dimensions || --- | --- || sqlite-vec | 1536 || pgvector | 1536 |
## Retention
- Snapshots: 90 days- Archives: 7 years- Canon retained permanently: yes
## Migration policy
- Automatic migration: enabled- Backup before migration: required- Validate after migration: enabled
SQLite tables are declared in `packages/storage-fabric/sqlite/schema.sql`; PostgreSQL and pgvector tables are declared in `packages/storage-fabric/pgvector/schema.sql`.123456<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Trust
Evaluates sources, datasets, and models against workspace trust requirements.
Trust checks are evaluated before governed execution and knowledge promotion.1234567891011<!-- Generated by ProjectOS Schema Engine from bootstrap.xml. --># Workspaces
| Role | Workspace || --- | --- || research | VSCode || implementation | Zed || ml | PyCharm || logic | IntelliJ || database | DataGrip || canvas | HFSpace |12345678910111213141516{ "project": "ProjectOS", "version": "2.0", "mode": "local", "generatedAt": "2026-10-31T07:37:41.171Z", "bootstrap": "bootstrap.xml", "schema": "ProjectOS.xsd", "rules": "ProjectOS.sch", "generatedDirectory": "generated/", "documentationDirectory": "docs/", "storageDirectory": "storage/", "snapshotManifest": "generated/snapshots/snapshot-manifest.json", "migrationManifest": "migrations/manifest.json", "mcpRegistry": "generated/registries/mcp.json", "mcpProfiles": "generated/registries/mcp-profiles.json"}12345678910111213141516171819202122232425262728293031323334{ "schema": 1, "version": 2, "policy": { "autoMigrate": true, "backupBeforeMigration": true, "validateSchema": true }, "tables": [ "projects", "project_events", "snapshots", "snapshot_items", "canon_entries", "canon_revisions", "frontier_items", "frontier_observations", "archive_records", "knowledge_embeddings", "dependency_findings", "delta_runs", "delta_gaps", "delta_dependencies", "governance_reviews" ], "steps": [ "Back up the local database before applying migrations when configured.", "Apply SQLite schema version 2, including dependency findings, delta persistence, and governance review tables.", "Apply idempotent schema updates and record the applied schema versions.", "Validate the expected table set before the API becomes ready.", "Backfill app_state into normalized repositories in a transaction.", "Verify counts and checksums before switching reads or removing app_state." ]}12345678910111213141516171819202122232425262728293031323334{ "schema": 1, "version": 2, "policy": { "autoMigrate": true, "backupBeforeMigration": true, "validateSchema": true }, "tables": [ "projects", "project_events", "snapshots", "snapshot_items", "canon_entries", "canon_revisions", "frontier_items", "frontier_observations", "archive_records", "knowledge_embeddings", "dependency_findings", "delta_runs", "delta_gaps", "delta_dependencies", "governance_reviews" ], "steps": [ "Back up the local database before applying migrations when configured.", "Apply SQLite schema version 2, including dependency findings, delta persistence, and governance review tables.", "Apply idempotent schema updates and record the applied schema versions.", "Validate the expected table set before the API becomes ready.", "Backfill app_state into normalized repositories in a transaction.", "Verify counts and checksums before switching reads or removing app_state." ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215<?xml version="1.0" encoding="UTF-8"?><ProjectOS version="2.0" name="ProjectOS" mode="local"> <bootstrap schema="schemas/ProjectOS.xsd" schematron="schemas/ProjectOS.sch" output="configs" /> <runtime profile="Privileged" snapshots="true" automaticRouting="true" consolidation="true" startupOrder="schema,bootstrap,fabrics,identity,trust,storage,knowledge,logic,governance,operations,agents,registries,council,mcp,desktop" /> <decisionFormula> <step name="Question" description="A person or connected system submits a question or requested outcome." /> <step name="Operations Agent" description="Coordinates intent analysis, routing, validation, and execution planning." /> <step name="Determine Intent" description="Classifies the request as research, implementation, infrastructure, evolution, or governance work." /> <step name="Choose Council Template" description="Selects a council template with the relevant specialists." /> <step name="Assign Models" description="Selects model providers and capabilities that match the task and trust requirements." /> <step name="Assign Datasets" description="Attaches project knowledge and datasets with source and permission context." /> <step name="Assign Tools" description="Selects tools required by the plan, subject to policy and permission checks." /> <step name="Assign Workspace" description="Binds the plan to a project workspace and runtime boundary." /> <step name="Validate Through Logic" description="Checks feasibility, consistency, assumptions, and contradictions before action." gate="true" /> <step name="Validate Through Governance" description="Checks trust, policies, permissions, and approval requirements before action." gate="true" /> <step name="Execute" description="Runs only actions that are available, authorized, and within the configured runtime." /> <step name="Store Knowledge" description="Records useful evidence, decisions, and outcomes with provenance." /> <step name="Snapshot" description="Captures the project state needed to reproduce or review the work." /> <step name="Consolidate" description="Merges compatible learning into organized project knowledge." /> <step name="Update Canon" description="Updates the canonical project record with reviewed, durable findings." /> </decisionFormula> <projectLifecycle> <stage name="Research" description="Discover the problem and evidence." /> <stage name="Active" description="Coordinate work and decisions." /> <stage name="Production" description="Deliver stable project outcomes." /> <stage name="Evolving" description="Improve capabilities continuously." /> <stage name="Frontier Comparison" description="Compare current project state with emerging approaches." /> <stage name="Delta Analysis" description="Identify the gaps between current and target state." /> <stage name="Missing Dependencies" description="Surface unavailable requirements." /> <stage name="Evolution Suggestions" description="Propose the next improvements." /> <stage name="Obsolete" description="Mark work that is ready for retirement." /> <stage name="Snapshot" description="Preserve a durable project state." /> <stage name="Archive" description="Store completed work and its history." /> <stage name="Template" description="Make proven project patterns reusable." /> </projectLifecycle> <fabrics> <fabric name="Identity" icon="◉" description="Resolves who is acting, what they own, and which roles apply."><capability name="Ownership graph" /><capability name="Role registry" /><capability name="LDAP, Entra, OAuth, and SAML connectors" /></fabric> <fabric name="Trust" icon="⬡" description="Evaluates sources, datasets, and models against workspace trust requirements."><capability name="Source verification" /><capability name="Dataset and model verification" /><capability name="Trust scores" /></fabric> <fabric name="Research" icon="⌕" description="Connects research sources and organizes evidence for project decisions."><capability name="Web and paper discovery" /><capability name="Documentation connectors" /><capability name="Research source attribution" /></fabric> <fabric name="Knowledge" icon="▧" description="Organizes project memory into research, lessons, canon, frontier, and archive."><capability name="Project memory" /><capability name="Canonical knowledge" /><capability name="Snapshots and archive" /></fabric> <fabric name="Logic" icon="⌘" description="Builds plans and checks feasibility, consistency, and competing claims."><capability name="Intent analysis" /><capability name="Planning and validation" /><capability name="Consensus and contradictions" /></fabric> <fabric name="Delta" icon="Δ" description="Compares current and target states to identify gaps and useful evolution."><capability name="Current and frontier state" /><capability name="Gap analysis" /><capability name="Evolution and obsolescence" /></fabric> <fabric name="Dependency" icon="⛓" description="Finds unmet runtime, access, model, tool, library, and dataset requirements."><capability name="Missing permissions" /><capability name="Missing tools and models" /><capability name="Missing libraries, datasets, and infrastructure" /></fabric> <fabric name="Governance" icon="⬡" description="Applies policy gates, approval decisions, overrides, and audit recording."><capability name="Policy registry" /><capability name="Approval queue" /><capability name="Audit history" /></fabric> <fabric name="Execution" icon="▶" description="Dispatches approved work to the appropriate execution adapter."><capability name="PowerShell, Python, and Node" /><capability name="Docker and Git" /><capability name="MCP tools" /></fabric> <fabric name="Storage" icon="▤" description="Defines local and enterprise storage for project artifacts and vectors."><capability name="SQLite and sqlite-vec" /><capability name="PostgreSQL and pgvector" /><capability name="Snapshots, consolidation, and archives" /></fabric> <fabric name="Canvas" icon="▱" description="Provides visual workspaces for diagrams, whiteboards, and knowledge views."><capability name="Whiteboard canvas" /><capability name="Diagram engine" /><capability name="Knowledge views" /></fabric> </fabrics> <councils> <council name="Research Council" icon="◎" description="Combines research and knowledge specialists to answer evidence questions."><member>Research Agent</member><member>Knowledge Agent</member><member>Trust review</member></council> <council name="Architecture Council" icon="◇" description="Reviews boundaries, dependencies, and system-level trade-offs."><member>Logic Agent</member><member>Dependency Agent</member><member>Infrastructure Agent</member></council> <council name="Implementation Council" icon="⚒" description="Coordinates implementation from an approved plan through a reviewable change."><member>Implementation Agent</member><member>Logic Agent</member><member>Tool Execution Agent</member></council> <council name="Infrastructure Council" icon="⌂" description="Checks environments, storage, runtime, and deployment dependencies."><member>Infrastructure Agent</member><member>Dependency Agent</member><member>Governance Agent</member></council> <council name="Evolution Council" icon="↻" description="Compares project state with the frontier and ranks improvement opportunities."><member>Delta Agent</member><member>Evolution Agent</member><member>Knowledge Agent</member></council> <council name="Governance Council" icon="⬡" description="Reviews policies, trust, approvals, and recorded exceptions."><member>Governance Agent</member><member>Trust validation</member><member>Approval engine</member></council> </councils> <agents> <agent name="Research Agent" description="Finds evidence and records sources relevant to a question." /> <agent name="ML Agent" description="Reviews model choices, evaluation needs, and model-specific constraints." /> <agent name="Logic Agent" description="Checks plans for feasibility, consistency, and contradictions." /> <agent name="Knowledge Agent" description="Retrieves and organizes project memory and research." /> <agent name="Dependency Agent" description="Identifies missing tools, permissions, libraries, data, or infrastructure." /> <agent name="Delta Agent" description="Compares current project state with a target or frontier." /> <agent name="Evolution Agent" description="Turns comparison results into sequenced improvement suggestions." /> <agent name="Infrastructure Agent" description="Plans runtime, storage, and environment requirements." /> <agent name="Tool Execution Agent" description="Coordinates approved tool calls through configured adapters." /> <agent name="Governance Agent" description="Applies policy checks and identifies human approval needs." /> <agent name="Canonicalization Agent" description="Turns verified outcomes into structured, reusable canon." /> <agent name="Implementation Agent" description="Plans approved implementation work." /> </agents> <models> <model role="operations" provider="omni" /> <model role="research" provider="sonar" /> <model role="implementation" provider="copilot" /> <model role="ml" provider="qwen" /> <model role="logic" provider="claude" /> </models> <storage local="SQLite,sqlite-vec" enterprise="PostgreSQL,pgvector"> <providers> <provider name="SQLite" enabled="true" /> <provider name="PostgreSQL" enabled="true" /> </providers> <vectorStores> <vectorStore provider="sqlite-vec" dimensions="1536" /> <vectorStore provider="pgvector" dimensions="1536" /> </vectorStores> <retention snapshotDays="90" archiveYears="7" keepCanonForever="true" /> <migration autoMigrate="true" backupBeforeMigration="true" validateSchema="true" /> </storage> <governanceControls> <control name="Policy Engine" description="Evaluates plans against the active policy registry." /> <control name="Approval Engine" description="Routes gated actions to the right reviewer." /> <control name="Trust Validation" description="Checks identity, sources, datasets, and models." /> <control name="Override Engine" description="Records scoped exceptions with justification." /> <control name="Audit Log" description="Keeps an attributable record of decisions and actions." /> <control name="Policy Registry" description="Maintains versioned workspace rules." /> </governanceControls> <knowledgeAreas> <area name="Project memory" description="Working context and decisions." /> <area name="Research" description="Sources, findings, and evidence." /> <area name="Lessons" description="Reusable outcomes and reflections." /> <area name="Canon" description="The current trusted project record." /> <area name="Frontier" description="Emerging ideas and state of the art." /> <area name="Snapshots" description="Point-in-time project state." /> <area name="Archive" description="Preserved retired work." /> </knowledgeAreas> <permissions> <permission id="workspace-read" resource="workspace" action="read" effect="allow" requiresApproval="false" /> <permission id="workspace-write" resource="workspace" action="write" effect="require-approval" requiresApproval="true" /> <permission id="tool-execution" resource="tools" action="execute" effect="require-approval" requiresApproval="true" /> <permission id="external-network" resource="external-network" action="access" effect="deny" requiresApproval="true" /> </permissions> <workspaces> <workspace role="research" name="VSCode" /> <workspace role="implementation" name="Zed" /> <workspace role="ml" name="PyCharm" /> <workspace role="logic" name="IntelliJ" /> <workspace role="database" name="DataGrip" /> <workspace role="canvas" name="HFSpace" /> </workspaces> <mcpServers> <server name="filesystem" adapter="filesystem" trust="High" enabled="true" authMode="none" /> <server name="git" adapter="git" trust="High" enabled="false" authMode="none" /> <server name="github-readonly" adapter="github" trust="Verified" enabled="true" authMode="oauth" accessMode="read-only" /> <server name="github-write" adapter="github" trust="High" enabled="false" authMode="oauth" accessMode="read-write" /> <server name="postgres-readonly" adapter="postgres" trust="Verified" enabled="true" credentialRef="PROJECTOS_POSTGRES_READ_PROFILE" authMode="keyring" accessMode="read-only" /> <server name="postgres-write" adapter="postgres" trust="High" enabled="false" credentialRef="PROJECTOS_POSTGRES_WRITE_PROFILE" authMode="keyring" accessMode="read-write" /> <server name="fetch" adapter="fetch" trust="Medium" enabled="true" authMode="none" /> <server name="memory" adapter="memory" trust="High" enabled="true" authMode="none" /> <profiles> <profile name="workspace" enabled="true" description="Workspace files and persistent MCP memory."> <serverRef name="filesystem" /> <serverRef name="memory" /> </profile> <profile name="research" enabled="true" description="Public web research and read-only GitHub context."> <serverRef name="fetch" /> <serverRef name="github-readonly" /> </profile> <profile name="implementation" enabled="true" description="Workspace files and read-only GitHub context."> <serverRef name="filesystem" /> <serverRef name="github-readonly" /> </profile> <profile name="database-readonly" enabled="true" description="Read-only PostgreSQL access using an OS keyring profile."> <serverRef name="postgres-readonly" /> </profile> <profile name="database-write" enabled="false" description="Explicitly disabled write access; requires a separate least-privilege database role and approval policy."> <serverRef name="postgres-write" /> </profile> </profiles> </mcpServers> <namingConventions> <convention canonical="ProjectRepository"> <alias>IProjectRepository</alias> <alias>ProjectRepo</alias> <alias>ProjectStore</alias> </convention> <convention canonical="CanonRepository"> <alias>ICanonRepository</alias> <alias>CanonRepo</alias> <alias>CanonStore</alias> </convention> <convention canonical="SnapshotRepository"> <alias>ISnapshotRepository</alias> <alias>SnapshotRepo</alias> <alias>SnapshotStore</alias> </convention> <convention canonical="FrontierRepository"> <alias>IFrontierRepository</alias> <alias>FrontierRepo</alias> <alias>FrontierStore</alias> </convention> <convention canonical="ArchiveRepository"> <alias>IArchiveRepository</alias> <alias>ArchiveRepo</alias> <alias>ArchiveStore</alias> </convention> <convention canonical="EmbeddingRepository"> <alias>IEmbeddingRepository</alias> <alias>EmbeddingRepo</alias> <alias>EmbeddingStore</alias> </convention> <languageProfiles> <languageProfile name="CSharp" interfacePrefix="I" /> <languageProfile name="TypeScript" interfacePrefix="" /> <languageProfile name="Java" interfacePrefix="" /> <languageProfile name="OpenAPITypeScript" interfacePrefix="I" /> </languageProfiles> </namingConventions> <documentation> <output name="Architecture" enabled="true" /> <output name="Bootstrap" enabled="true" /> <output name="Schema" enabled="true" /> <output name="Agents" enabled="true" /> <output name="Councils" enabled="true" /> <output name="Fabrics" enabled="true" /> <output name="Storage" enabled="true" /> <output name="Knowledge" enabled="true" /> <output name="Canon" enabled="true" /> <output name="Frontier" enabled="true" /> <output name="Delta" enabled="true" /> <output name="Dependency" enabled="true" /> <output name="Governance" enabled="true" /> <output name="Identity" enabled="true" /> <output name="Trust" enabled="true" /> <output name="Runtime" enabled="true" /> <output name="Database" enabled="true" /> <output name="API" enabled="true" /> <output name="MCP" enabled="true" /> <output name="Workspaces" enabled="true" /> <output name="Models" enabled="true" /> <output name="Providers" enabled="true" /> <output name="Snapshots" enabled="true" /> <output name="Archive" enabled="true" /> </documentation></ProjectOS>12345678910111213141516{ "project": "ProjectOS", "version": "2.0", "mode": "local", "generatedAt": "2026-10-31T07:37:41.171Z", "bootstrap": "bootstrap.xml", "schema": "ProjectOS.xsd", "rules": "ProjectOS.sch", "generatedDirectory": "generated/", "documentationDirectory": "docs/", "storageDirectory": "storage/", "snapshotManifest": "generated/snapshots/snapshot-manifest.json", "migrationManifest": "migrations/manifest.json", "mcpRegistry": "generated/registries/mcp.json", "mcpProfiles": "generated/registries/mcp-profiles.json"}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114<?xml version="1.0" encoding="UTF-8"?><sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt"> <sch:title>ProjectOS v2 manifest rules</sch:title> <sch:pattern id="manifest-shape"> <sch:rule context="ProjectOS"> <sch:assert test="@version = '2.0'">The manifest version must be 2.0.</sch:assert> <sch:assert test="count(decisionFormula/step) = 15">The decision formula must define all 15 stages.</sch:assert> <sch:assert test="count(decisionFormula/step[@gate = 'true']) = 2">The decision formula must include logic and governance gates.</sch:assert> <sch:assert test="count(projectLifecycle/stage) = 12">The project lifecycle must define all 12 stages.</sch:assert> <sch:assert test="count(fabrics/fabric) = 11">The manifest must define the 11 ProjectOS fabrics.</sch:assert> <sch:assert test="count(councils/council) = 6">The manifest must define six council templates.</sch:assert> <sch:assert test="count(agents/agent) = 12">The manifest must define 12 specialist agents.</sch:assert> <sch:assert test="count(models/model) >= 1">At least one model routing entry is required.</sch:assert> <sch:assert test="count(workspaces/workspace) >= 1">At least one workspace route is required.</sch:assert> <sch:assert test="count(permissions/permission) >= 1">At least one permission rule is required.</sch:assert> <sch:assert test="normalize-space(runtime/@profile) != ''">The runtime profile must be named.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="catalog-quality"> <sch:rule context="fabrics/fabric"> <sch:assert test="normalize-space(@name) != ''">Every fabric needs a name.</sch:assert> <sch:assert test="normalize-space(@description) != ''">Every fabric needs a description for the dashboard.</sch:assert> <sch:assert test="count(capability) >= 1">Every fabric must declare at least one capability.</sch:assert> </sch:rule> <sch:rule context="councils/council"> <sch:assert test="normalize-space(@description) != ''">Every council needs a description.</sch:assert> <sch:assert test="count(member) >= 1">Every council must assign at least one member.</sch:assert> </sch:rule> <sch:rule context="agents/agent"> <sch:assert test="normalize-space(@description) != ''">Every agent needs a description.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="unique-registries"> <sch:rule context="ProjectOS"> <sch:assert test="count(fabrics/fabric) = count(fabrics/fabric[not(@name = preceding-sibling::fabric/@name)])">Fabric names must be unique.</sch:assert> <sch:assert test="count(councils/council) = count(councils/council[not(@name = preceding-sibling::council/@name)])">Council names must be unique.</sch:assert> <sch:assert test="count(agents/agent) = count(agents/agent[not(@name = preceding-sibling::agent/@name)])">Agent names must be unique.</sch:assert> <sch:assert test="count(models/model) = count(models/model[not(@role = preceding-sibling::model/@role)])">Model roles must be unique.</sch:assert> <sch:assert test="count(workspaces/workspace) = count(workspaces/workspace[not(@role = preceding-sibling::workspace/@role)])">Workspace roles must be unique.</sch:assert> <sch:assert test="count(permissions/permission) = count(permissions/permission[not(@id = preceding-sibling::permission/@id)])">Permission rule identifiers must be unique.</sch:assert> <sch:assert test="normalize-space(storage/@local) != '' and normalize-space(storage/@enterprise) != ''">Both local and enterprise storage targets must be named.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="registry-quality"> <sch:rule context="models/model"> <sch:assert test="normalize-space(@role) != '' and normalize-space(@provider) != ''">Each model route needs a role and provider.</sch:assert> </sch:rule> <sch:rule context="workspaces/workspace"> <sch:assert test="normalize-space(@role) != '' and normalize-space(@name) != ''">Each workspace route needs a role and workspace name.</sch:assert> </sch:rule> <sch:rule context="permissions/permission"> <sch:assert test="@effect = 'allow' or @effect = 'deny' or @effect = 'require-approval'">Permission effects must be allow, deny, or require-approval.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="logic-required"> <sch:rule context="CouncilTemplate"> <sch:assert test="Member[@Ref='LogicAgent']">LogicAgent required.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="storage-provider"> <sch:rule context="storage"> <sch:assert test="count(providers/provider[@enabled='true' or @enabled='1']) > 0">At least one storage provider must be enabled.</sch:assert> <sch:assert test="count(vectorStores/vectorStore) > 0">At least one vector store must be configured.</sch:assert> <sch:assert test="count(vectorStores/vectorStore[@provider='sqlite-vec']) = 0 or count(providers/provider[@name='SQLite' and (@enabled='true' or @enabled='1')]) > 0">sqlite-vec requires the SQLite provider to be enabled.</sch:assert> <sch:assert test="count(vectorStores/vectorStore[@provider='pgvector']) = 0 or count(providers/provider[@name='PostgreSQL' and (@enabled='true' or @enabled='1')]) > 0">pgvector requires the PostgreSQL provider to be enabled.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="canon-retention"> <sch:rule context="storage/retention"> <sch:assert test="@keepCanonForever='true' or @keepCanonForever='1'">Canon storage must be retained permanently.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="migration-backup"> <sch:rule context="storage/migration"> <sch:assert test="@autoMigrate='false' or @autoMigrate='0' or @backupBeforeMigration='true' or @backupBeforeMigration='1'">Automatic migrations require backups.</sch:assert> <sch:assert test="@autoMigrate='false' or @autoMigrate='0' or @validateSchema='true' or @validateSchema='1'">Automatic migrations require schema validation.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="symbol-registry"> <sch:rule context="namingConventions"> <sch:assert test="count(convention) > 0">At least one canonical symbol convention is required.</sch:assert> <sch:assert test="count(convention/alias[. = /ProjectOS/namingConventions/convention/@canonical]) = 0">A symbol alias cannot collide with a canonical symbol name.</sch:assert> </sch:rule> <sch:rule context="convention"> <sch:assert test="normalize-space(@canonical) != ''">Each symbol convention needs a canonical name.</sch:assert> <sch:assert test="count(alias) > 0">Each canonical symbol needs at least one alias.</sch:assert> </sch:rule> <sch:rule context="languageProfiles/languageProfile"> <sch:assert test="normalize-space(@name) != ''">Each language profile needs a name.</sch:assert> <sch:assert test="@interfacePrefix or @interfacePrefix = ''">Each language profile must define its interface prefix, which may be empty.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="documentation-outputs"> <sch:rule context="documentation"> <sch:assert test="count(output[@enabled='true' or @enabled='1']) > 0">At least one documentation output must be enabled.</sch:assert> <sch:assert test="count(output[@name='Architecture' and (@enabled='true' or @enabled='1')]) = 1">Architecture documentation must be enabled.</sch:assert> <sch:assert test="count(output[@name='Bootstrap' and (@enabled='true' or @enabled='1')]) = 1">Bootstrap documentation must be enabled.</sch:assert> <sch:assert test="count(output[@name='Schema' and (@enabled='true' or @enabled='1')]) = 1">Schema documentation must be enabled.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="mcp-registry"> <sch:rule context="mcpServers"> <sch:assert test="count(server) > 0">At least one MCP server entry is required.</sch:assert> <sch:assert test="count(server) = count(server[normalize-space(@name) != ''])">Every MCP server needs a name.</sch:assert> <sch:assert test="count(server) = count(server[normalize-space(@adapter) != ''])">Every MCP server needs a registered adapter name.</sch:assert> <sch:assert test="count(server[@authMode='environment' or @authMode='keyring']) = count(server[@authMode='environment' or @authMode='keyring'][normalize-space(@credentialRef) != ''])">Environment and keyring authentication require a credential reference.</sch:assert> <sch:assert test="count(profiles/profile) > 0">At least one MCP profile is required.</sch:assert> </sch:rule> <sch:rule context="mcpServers/profiles"> <sch:assert test="count(profile[@name='database-write' and @enabled='true']) = 0">The database-write profile must stay disabled until a write role and approval policy are configured.</sch:assert> <sch:assert test="count(../server[@name='github-write' and @enabled='true']) = 0">GitHub write access must stay disabled until a write-scoped credential is configured.</sch:assert> </sch:rule> </sch:pattern></sch:schema>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="ProjectOS"> <xs:complexType> <xs:sequence> <xs:element name="bootstrap" type="bootstrapType" /> <xs:element name="runtime" type="runtimeType" /> <xs:element name="decisionFormula" type="stepsType" /> <xs:element name="projectLifecycle" type="stagesType" /> <xs:element name="fabrics" type="fabricsType" /> <xs:element name="councils" type="councilsType" /> <xs:element name="agents" type="agentsType" /> <xs:element name="models" type="modelsType" /> <xs:element name="storage" type="storageType" /> <xs:element name="governanceControls" type="controlsType" /> <xs:element name="knowledgeAreas" type="knowledgeAreasType" /> <xs:element name="permissions" type="permissionsType" /> <xs:element name="workspaces" type="workspacesType" /> <xs:element name="mcpServers" type="mcpServersType" /> <xs:element name="namingConventions" type="namingConventionsType" /> <xs:element name="documentation" type="documentationType" /> </xs:sequence> <xs:attribute name="version" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="mode" type="xs:string" use="required" /> </xs:complexType> <xs:key name="storageProviderNames"> <xs:selector xpath="storage/providers/provider" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="storageVectorProviders"> <xs:selector xpath="storage/vectorStores/vectorStore" /> <xs:field xpath="@provider" /> </xs:key> <xs:key name="canonicalSymbols"> <xs:selector xpath="namingConventions/convention" /> <xs:field xpath="@canonical" /> </xs:key> <xs:key name="symbolAliases"> <xs:selector xpath="namingConventions/convention/alias" /> <xs:field xpath="." /> </xs:key> <xs:key name="languageProfileNames"> <xs:selector xpath="namingConventions/languageProfiles/languageProfile" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="documentationOutputs"> <xs:selector xpath="documentation/output" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="mcpServerNames"> <xs:selector xpath="mcpServers/server" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="mcpProfileNames"> <xs:selector xpath="mcpServers/profiles/profile" /> <xs:field xpath="@name" /> </xs:key> <xs:keyref name="mcpProfileServerRefs" refer="mcpServerNames"> <xs:selector xpath="mcpServers/profiles/profile/serverRef" /> <xs:field xpath="@name" /> </xs:keyref> </xs:element> <xs:complexType name="bootstrapType"> <xs:attribute name="schema" type="xs:string" use="required" /> <xs:attribute name="schematron" type="xs:string" use="required" /> <xs:attribute name="output" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="runtimeType"> <xs:attribute name="startupOrder" type="xs:string" use="required" /> <xs:attribute name="profile" type="xs:string" use="required" /> <xs:attribute name="snapshots" type="xs:boolean" use="required" /> <xs:attribute name="automaticRouting" type="xs:boolean" use="required" /> <xs:attribute name="consolidation" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="stepsType"> <xs:sequence><xs:element name="step" type="stepType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="stepType"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" /> <xs:attribute name="gate" type="xs:boolean" /> </xs:complexType> <xs:complexType name="stagesType"> <xs:sequence><xs:element name="stage" type="stageType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="stageType"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" /> </xs:complexType> <xs:complexType name="fabricsType"> <xs:sequence><xs:element name="fabric" type="fabricType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="fabricType"> <xs:sequence><xs:element name="capability" type="namedItemType" minOccurs="0" maxOccurs="unbounded" /></xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="icon" type="xs:string" /> <xs:attribute name="description" type="xs:string" /> </xs:complexType> <xs:complexType name="councilsType"> <xs:sequence><xs:element name="council" type="councilType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="councilType"> <xs:sequence><xs:element name="member" type="xs:string" minOccurs="0" maxOccurs="unbounded" /></xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="icon" type="xs:string" /> <xs:attribute name="description" type="xs:string" /> </xs:complexType> <xs:complexType name="agentsType"> <xs:sequence><xs:element name="agent" type="describedItemType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="describedItemType"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" /> <xs:attribute name="icon" type="xs:string" /> </xs:complexType> <xs:simpleType name="storageProviderName"> <xs:restriction base="xs:string"> <xs:enumeration value="SQLite" /> <xs:enumeration value="PostgreSQL" /> <xs:enumeration value="Archive" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="vectorProviderName"> <xs:restriction base="xs:string"> <xs:enumeration value="sqlite-vec" /> <xs:enumeration value="pgvector" /> </xs:restriction> </xs:simpleType> <xs:complexType name="storageProviderType"> <xs:attribute name="name" type="storageProviderName" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="storageProvidersType"> <xs:sequence> <xs:element name="provider" type="storageProviderType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="vectorStoreType"> <xs:attribute name="provider" type="vectorProviderName" use="required" /> <xs:attribute name="dimensions" type="xs:positiveInteger" use="required" /> </xs:complexType> <xs:complexType name="vectorStoresType"> <xs:sequence> <xs:element name="vectorStore" type="vectorStoreType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="storageRetentionType"> <xs:attribute name="snapshotDays" type="xs:positiveInteger" use="required" /> <xs:attribute name="archiveYears" type="xs:positiveInteger" use="required" /> <xs:attribute name="keepCanonForever" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="storageMigrationType"> <xs:attribute name="autoMigrate" type="xs:boolean" use="required" /> <xs:attribute name="backupBeforeMigration" type="xs:boolean" use="required" /> <xs:attribute name="validateSchema" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="storageType"> <xs:sequence> <xs:element name="providers" type="storageProvidersType" /> <xs:element name="vectorStores" type="vectorStoresType" /> <xs:element name="retention" type="storageRetentionType" /> <xs:element name="migration" type="storageMigrationType" /> </xs:sequence> <xs:attribute name="local" type="xs:string" use="required" /> <xs:attribute name="enterprise" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="controlsType"> <xs:sequence><xs:element name="control" type="describedItemType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="knowledgeAreasType"> <xs:sequence><xs:element name="area" type="describedItemType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="modelsType"> <xs:sequence><xs:element name="model" type="modelType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="modelType"> <xs:attribute name="role" type="xs:string" use="required" /> <xs:attribute name="provider" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="permissionsType"> <xs:sequence><xs:element name="permission" type="permissionType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="permissionType"> <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="resource" type="xs:string" use="required" /> <xs:attribute name="action" type="xs:string" use="required" /> <xs:attribute name="effect" type="xs:string" use="required" /> <xs:attribute name="requiresApproval" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="workspacesType"> <xs:sequence><xs:element name="workspace" type="workspaceType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="workspaceType"> <xs:attribute name="role" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType> <xs:simpleType name="mcpTrustLevelType"> <xs:restriction base="xs:token"> <xs:enumeration value="Low" /> <xs:enumeration value="Medium" /> <xs:enumeration value="High" /> <xs:enumeration value="Verified" /> </xs:restriction> </xs:simpleType> <xs:complexType name="mcpServersType"> <xs:sequence> <xs:element name="server" type="mcpServerType" minOccurs="1" maxOccurs="unbounded" /> <xs:element name="profiles" type="mcpProfilesType" minOccurs="1" maxOccurs="1" /> </xs:sequence> </xs:complexType> <xs:complexType name="mcpServerType"> <xs:attribute name="name" type="symbolNameType" use="required" /> <xs:attribute name="adapter" type="symbolNameType" use="required" /> <xs:attribute name="trust" type="mcpTrustLevelType" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="optional" default="true" /> <xs:attribute name="credentialRef" type="environmentVariableNameType" use="optional" /> <xs:attribute name="authMode" type="mcpAuthModeType" use="required" /> <xs:attribute name="accessMode" type="mcpAccessModeType" use="optional" default="read-only" /> </xs:complexType> <xs:complexType name="mcpProfilesType"> <xs:sequence><xs:element name="profile" type="mcpProfileType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="mcpProfileType"> <xs:sequence><xs:element name="serverRef" type="mcpServerRefType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> <xs:attribute name="name" type="symbolNameType" use="required" /> <xs:attribute name="description" type="xs:string" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="optional" default="true" /> </xs:complexType> <xs:complexType name="mcpServerRefType"> <xs:attribute name="name" type="symbolNameType" use="required" /> </xs:complexType> <xs:simpleType name="mcpAccessModeType"> <xs:restriction base="xs:token"> <xs:enumeration value="read-only" /> <xs:enumeration value="read-write" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="mcpAuthModeType"> <xs:restriction base="xs:token"> <xs:enumeration value="none" /> <xs:enumeration value="oauth" /> <xs:enumeration value="environment" /> <xs:enumeration value="keyring" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="environmentVariableNameType"> <xs:restriction base="xs:token"> <xs:pattern value="[A-Z_][A-Z0-9_]*" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="symbolNameType"> <xs:restriction base="xs:token"> <xs:minLength value="1" /> </xs:restriction> </xs:simpleType> <xs:complexType name="namingConventionsType"> <xs:sequence> <xs:element name="convention" type="symbolConventionType" minOccurs="1" maxOccurs="unbounded" /> <xs:element name="languageProfiles" type="languageProfilesType" /> </xs:sequence> </xs:complexType> <xs:complexType name="symbolConventionType"> <xs:sequence> <xs:element name="alias" type="symbolNameType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="canonical" type="symbolNameType" use="required" /> </xs:complexType> <xs:complexType name="languageProfilesType"> <xs:sequence> <xs:element name="languageProfile" type="languageProfileType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="languageProfileType"> <xs:attribute name="name" type="symbolNameType" use="required" /> <xs:attribute name="interfacePrefix" type="xs:string" use="required" /> </xs:complexType> <xs:simpleType name="documentationOutputNameType"> <xs:restriction base="xs:token"> <xs:enumeration value="Architecture" /> <xs:enumeration value="Bootstrap" /> <xs:enumeration value="Schema" /> <xs:enumeration value="Agents" /> <xs:enumeration value="Councils" /> <xs:enumeration value="Fabrics" /> <xs:enumeration value="Storage" /> <xs:enumeration value="Knowledge" /> <xs:enumeration value="Canon" /> <xs:enumeration value="Frontier" /> <xs:enumeration value="Delta" /> <xs:enumeration value="Dependency" /> <xs:enumeration value="Governance" /> <xs:enumeration value="Identity" /> <xs:enumeration value="Trust" /> <xs:enumeration value="Runtime" /> <xs:enumeration value="Database" /> <xs:enumeration value="API" /> <xs:enumeration value="MCP" /> <xs:enumeration value="Workspaces" /> <xs:enumeration value="Models" /> <xs:enumeration value="Providers" /> <xs:enumeration value="Snapshots" /> <xs:enumeration value="Archive" /> </xs:restriction> </xs:simpleType> <xs:complexType name="documentationType"> <xs:sequence> <xs:element name="output" type="documentationOutputType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="documentationOutputType"> <xs:attribute name="name" type="documentationOutputNameType" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="namedItemType"> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType></xs:schema>123456789{ "schema": 1, "timestamp": "2026-10-31T07:37:41.171Z", "project": "ProjectOS", "bootstrapHash": "sha256:6b21ad2a11f34f6976e7533430251acf6f694763fe086c5307c7f6d1e2eaecab", "runtimeHash": "sha256:7f7ce051acbc510849e40ff4ceb81b75691497fa0ca7b866265b175795acd639", "storageHash": "sha256:fe8bfd3a0643b842864575a0d7d9854b4a6144af5fd9b5b4c9c2a82e2c1156e1", "mcpHash": "sha256:de8b5554fe7fea13f95693475adf7a29b93c7102f62504d27c5918a39d9c5277"}123456789101112{ "package": "@projectos/storage-fabric", "version": "0.1.0", "repositories": [ "ProjectRepository", "CanonRepository", "SnapshotRepository", "FrontierRepository", "ArchiveRepository", "EmbeddingRepository" ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE IF NOT EXISTS storage_schema_migrations ( version INTEGER PRIMARY KEY, name TEXT NOT NULL, applied_at TIMESTAMPTZ NOT NULL DEFAULT now());
CREATE TABLE IF NOT EXISTS projects ( project_id TEXT PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', stage TEXT NOT NULL DEFAULT 'Research', state_json JSONB NOT NULL DEFAULT '{}'::jsonb, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), archived_at TIMESTAMPTZ);
CREATE INDEX IF NOT EXISTS projects_stage_updated_idx ON projects(stage, updated_at DESC);CREATE INDEX IF NOT EXISTS projects_state_gin_idx ON projects USING GIN (state_json);
CREATE TABLE IF NOT EXISTS project_events ( event_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, event_type TEXT NOT NULL, payload_json JSONB NOT NULL DEFAULT '{}'::jsonb, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), created_by TEXT);
CREATE INDEX IF NOT EXISTS project_events_project_created_idx ON project_events(project_id, created_at DESC);
CREATE TABLE IF NOT EXISTS snapshots ( snapshot_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, snapshot_type TEXT NOT NULL CHECK (snapshot_type IN ('manual', 'scheduled', 'pre_change', 'canon', 'frontier', 'archive')), label TEXT NOT NULL, source TEXT NOT NULL DEFAULT 'local', schema_version TEXT NOT NULL DEFAULT '1', state_json JSONB NOT NULL, checksum TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), created_by TEXT, metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb);
CREATE INDEX IF NOT EXISTS snapshots_project_created_idx ON snapshots(project_id, created_at DESC);CREATE INDEX IF NOT EXISTS snapshots_type_created_idx ON snapshots(snapshot_type, created_at DESC);CREATE INDEX IF NOT EXISTS snapshots_metadata_gin_idx ON snapshots USING GIN (metadata_json);
CREATE TABLE IF NOT EXISTS snapshot_items ( snapshot_item_id TEXT PRIMARY KEY, snapshot_id TEXT NOT NULL REFERENCES snapshots(snapshot_id) ON DELETE CASCADE, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, ordinal INTEGER NOT NULL DEFAULT 0 CHECK (ordinal >= 0), payload_json JSONB NOT NULL, content_hash TEXT NOT NULL, UNIQUE (snapshot_id, entity_type, entity_id));
CREATE INDEX IF NOT EXISTS snapshot_items_entity_idx ON snapshot_items(entity_type, entity_id);
CREATE TABLE IF NOT EXISTS canon_entries ( entry_id TEXT PRIMARY KEY, project_id TEXT REFERENCES projects(project_id) ON DELETE SET NULL, slug TEXT NOT NULL, title TEXT NOT NULL, body TEXT NOT NULL, entry_type TEXT NOT NULL CHECK (entry_type IN ('principle', 'decision', 'pattern', 'policy', 'knowledge', 'procedure')), status TEXT NOT NULL DEFAULT 'draft' CHECK (status IN ('draft', 'active', 'superseded', 'archived')), version INTEGER NOT NULL DEFAULT 1 CHECK (version > 0), source_snapshot_id TEXT REFERENCES snapshots(snapshot_id) ON DELETE SET NULL, supersedes_entry_id TEXT REFERENCES canon_entries(entry_id) ON DELETE SET NULL, metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb, valid_from TIMESTAMPTZ, valid_until TIMESTAMPTZ, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), UNIQUE (project_id, slug, version));
CREATE INDEX IF NOT EXISTS canon_entries_project_status_idx ON canon_entries(project_id, status, updated_at DESC);CREATE INDEX IF NOT EXISTS canon_entries_type_status_idx ON canon_entries(entry_type, status);CREATE INDEX IF NOT EXISTS canon_entries_metadata_gin_idx ON canon_entries USING GIN (metadata_json);
CREATE TABLE IF NOT EXISTS canon_revisions ( revision_id TEXT PRIMARY KEY, entry_id TEXT NOT NULL REFERENCES canon_entries(entry_id) ON DELETE CASCADE, version INTEGER NOT NULL CHECK (version > 0), title TEXT NOT NULL, body TEXT NOT NULL, source_snapshot_id TEXT REFERENCES snapshots(snapshot_id) ON DELETE SET NULL, change_summary TEXT NOT NULL DEFAULT '', metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), created_by TEXT, UNIQUE (entry_id, version));
CREATE INDEX IF NOT EXISTS canon_revisions_entry_created_idx ON canon_revisions(entry_id, created_at DESC);
CREATE TABLE IF NOT EXISTS frontier_items ( frontier_id TEXT PRIMARY KEY, project_id TEXT REFERENCES projects(project_id) ON DELETE CASCADE, domain TEXT NOT NULL, item_type TEXT NOT NULL CHECK (item_type IN ('technology', 'capability', 'practice', 'dependency', 'research', 'risk')), title TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', rationale TEXT NOT NULL DEFAULT '', status TEXT NOT NULL DEFAULT 'candidate' CHECK (status IN ('candidate', 'tracking', 'adopted', 'rejected', 'obsolete')), confidence DOUBLE PRECISION CHECK (confidence IS NULL OR (confidence >= 0 AND confidence <= 1)), impact TEXT NOT NULL DEFAULT 'medium' CHECK (impact IN ('low', 'medium', 'high', 'critical')), first_seen_at TIMESTAMPTZ NOT NULL DEFAULT now(), last_reviewed_at TIMESTAMPTZ, review_after TIMESTAMPTZ, metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), updated_at TIMESTAMPTZ NOT NULL DEFAULT now());
CREATE INDEX IF NOT EXISTS frontier_items_project_status_idx ON frontier_items(project_id, status, updated_at DESC);CREATE INDEX IF NOT EXISTS frontier_items_domain_review_idx ON frontier_items(domain, review_after);CREATE INDEX IF NOT EXISTS frontier_items_metadata_gin_idx ON frontier_items USING GIN (metadata_json);
CREATE TABLE IF NOT EXISTS frontier_observations ( observation_id TEXT PRIMARY KEY, frontier_id TEXT NOT NULL REFERENCES frontier_items(frontier_id) ON DELETE CASCADE, source_name TEXT NOT NULL, source_uri TEXT, observed_at TIMESTAMPTZ NOT NULL DEFAULT now(), summary TEXT NOT NULL, evidence_json JSONB NOT NULL DEFAULT '{}'::jsonb, confidence DOUBLE PRECISION CHECK (confidence IS NULL OR (confidence >= 0 AND confidence <= 1)), created_at TIMESTAMPTZ NOT NULL DEFAULT now());
CREATE INDEX IF NOT EXISTS frontier_observations_frontier_idx ON frontier_observations(frontier_id, observed_at DESC);
CREATE TABLE IF NOT EXISTS archive_records ( archive_id TEXT PRIMARY KEY, project_id TEXT REFERENCES projects(project_id) ON DELETE SET NULL, resource_type TEXT NOT NULL, resource_id TEXT NOT NULL, snapshot_id TEXT REFERENCES snapshots(snapshot_id) ON DELETE SET NULL, payload_json JSONB NOT NULL, checksum TEXT NOT NULL, archive_reason TEXT NOT NULL DEFAULT '', archived_at TIMESTAMPTZ NOT NULL DEFAULT now(), archived_by TEXT, retention_until TIMESTAMPTZ, restored_at TIMESTAMPTZ, metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb);
CREATE INDEX IF NOT EXISTS archive_records_project_archived_idx ON archive_records(project_id, archived_at DESC);CREATE INDEX IF NOT EXISTS archive_records_resource_idx ON archive_records(resource_type, resource_id, archived_at DESC);CREATE INDEX IF NOT EXISTS archive_records_retention_idx ON archive_records(retention_until) WHERE restored_at IS NULL;
CREATE TABLE IF NOT EXISTS knowledge_embeddings ( embedding_id TEXT PRIMARY KEY, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, model_key TEXT NOT NULL, dimensions INTEGER NOT NULL DEFAULT 1536 CHECK (dimensions = 1536), embedding VECTOR(1536) NOT NULL, content_hash TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), UNIQUE (entity_type, entity_id, model_key));
CREATE INDEX IF NOT EXISTS knowledge_embeddings_entity_idx ON knowledge_embeddings(entity_type, entity_id);CREATE INDEX IF NOT EXISTS knowledge_embeddings_cosine_hnsw_idx ON knowledge_embeddings USING HNSW (embedding vector_cosine_ops);
CREATE TABLE IF NOT EXISTS dependency_findings ( finding_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, kind TEXT NOT NULL CHECK (kind IN ('model', 'dataset', 'permission', 'tool', 'infrastructure')), name TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', status TEXT NOT NULL DEFAULT 'open' CHECK (status IN ('open', 'resolved', 'waived')), source TEXT NOT NULL DEFAULT 'manual', metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb, detected_at TIMESTAMPTZ NOT NULL DEFAULT now(), resolved_at TIMESTAMPTZ);
CREATE INDEX IF NOT EXISTS dependency_findings_project_status_idx ON dependency_findings(project_id, status, detected_at DESC);CREATE INDEX IF NOT EXISTS dependency_findings_kind_name_idx ON dependency_findings(kind, name, status);
CREATE TABLE IF NOT EXISTS delta_runs ( delta_run_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, current_label TEXT NOT NULL, target_label TEXT NOT NULL, current_state_json JSONB NOT NULL, target_state_json JSONB NOT NULL, status TEXT NOT NULL CHECK (status IN ('complete', 'blocked')), created_at TIMESTAMPTZ NOT NULL DEFAULT now(), created_by TEXT);
CREATE INDEX IF NOT EXISTS delta_runs_project_created_idx ON delta_runs(project_id, created_at DESC);
CREATE TABLE IF NOT EXISTS delta_gaps ( gap_id TEXT PRIMARY KEY, delta_run_id TEXT NOT NULL REFERENCES delta_runs(delta_run_id) ON DELETE CASCADE, dimension TEXT NOT NULL, current_values_json JSONB NOT NULL, target_values_json JSONB NOT NULL, missing_values_json JSONB NOT NULL, severity TEXT NOT NULL CHECK (severity IN ('gap', 'blocker')), status TEXT NOT NULL DEFAULT 'open' CHECK (status IN ('open', 'resolved', 'accepted')), created_at TIMESTAMPTZ NOT NULL DEFAULT now());
CREATE INDEX IF NOT EXISTS delta_gaps_run_status_idx ON delta_gaps(delta_run_id, status);
CREATE TABLE IF NOT EXISTS delta_dependencies ( delta_dependency_id TEXT PRIMARY KEY, delta_run_id TEXT NOT NULL REFERENCES delta_runs(delta_run_id) ON DELETE CASCADE, finding_id TEXT NOT NULL REFERENCES dependency_findings(finding_id) ON DELETE RESTRICT, created_at TIMESTAMPTZ NOT NULL DEFAULT now(), UNIQUE (delta_run_id, finding_id));
CREATE INDEX IF NOT EXISTS delta_dependencies_run_idx ON delta_dependencies(delta_run_id);
CREATE TABLE IF NOT EXISTS governance_reviews ( review_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, action TEXT NOT NULL, resource_type TEXT NOT NULL, resource_id TEXT NOT NULL, decision TEXT NOT NULL DEFAULT 'pending' CHECK (decision IN ('pending', 'approved', 'rejected')), requested_by TEXT, requested_at TIMESTAMPTZ NOT NULL DEFAULT now(), reviewed_by TEXT, reviewed_at TIMESTAMPTZ, reason TEXT NOT NULL DEFAULT '', metadata_json JSONB NOT NULL DEFAULT '{}'::jsonb);
CREATE INDEX IF NOT EXISTS governance_reviews_project_decision_idx ON governance_reviews(project_id, decision, requested_at DESC);CREATE INDEX IF NOT EXISTS governance_reviews_resource_idx ON governance_reviews(action, resource_type, resource_id, decision);
INSERT INTO storage_schema_migrations(version, name)VALUES (1, 'initial-storage-schema')ON CONFLICT (version) DO NOTHING;
INSERT INTO storage_schema_migrations(version, name)VALUES (2, 'knowledge-delta-dependency-governance-lifecycle')ON CONFLICT (version) DO NOTHING;123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS storage_schema_migrations ( version INTEGER PRIMARY KEY, name TEXT NOT NULL, applied_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')));
CREATE TABLE IF NOT EXISTS projects ( project_id TEXT PRIMARY KEY, name TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', stage TEXT NOT NULL DEFAULT 'Research', state_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(state_json)), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), archived_at TEXT);
CREATE INDEX IF NOT EXISTS projects_stage_updated_idx ON projects(stage, updated_at DESC);
CREATE TABLE IF NOT EXISTS project_events ( event_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, event_type TEXT NOT NULL, payload_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(payload_json)), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), created_by TEXT);
CREATE INDEX IF NOT EXISTS project_events_project_created_idx ON project_events(project_id, created_at DESC);
CREATE TABLE IF NOT EXISTS snapshots ( snapshot_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, snapshot_type TEXT NOT NULL CHECK (snapshot_type IN ('manual', 'scheduled', 'pre_change', 'canon', 'frontier', 'archive')), label TEXT NOT NULL, source TEXT NOT NULL DEFAULT 'local', schema_version TEXT NOT NULL DEFAULT '1', state_json TEXT NOT NULL CHECK (json_valid(state_json)), checksum TEXT NOT NULL, created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), created_by TEXT, metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)));
CREATE INDEX IF NOT EXISTS snapshots_project_created_idx ON snapshots(project_id, created_at DESC);CREATE INDEX IF NOT EXISTS snapshots_type_created_idx ON snapshots(snapshot_type, created_at DESC);
CREATE TABLE IF NOT EXISTS snapshot_items ( snapshot_item_id TEXT PRIMARY KEY, snapshot_id TEXT NOT NULL REFERENCES snapshots(snapshot_id) ON DELETE CASCADE, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, ordinal INTEGER NOT NULL DEFAULT 0 CHECK (ordinal >= 0), payload_json TEXT NOT NULL CHECK (json_valid(payload_json)), content_hash TEXT NOT NULL, UNIQUE (snapshot_id, entity_type, entity_id));
CREATE INDEX IF NOT EXISTS snapshot_items_entity_idx ON snapshot_items(entity_type, entity_id);
CREATE TABLE IF NOT EXISTS canon_entries ( entry_id TEXT PRIMARY KEY, project_id TEXT REFERENCES projects(project_id) ON DELETE SET NULL, slug TEXT NOT NULL, title TEXT NOT NULL, body TEXT NOT NULL, entry_type TEXT NOT NULL CHECK (entry_type IN ('principle', 'decision', 'pattern', 'policy', 'knowledge', 'procedure')), status TEXT NOT NULL DEFAULT 'draft' CHECK (status IN ('draft', 'active', 'superseded', 'archived')), version INTEGER NOT NULL DEFAULT 1 CHECK (version > 0), source_snapshot_id TEXT REFERENCES snapshots(snapshot_id) ON DELETE SET NULL, supersedes_entry_id TEXT REFERENCES canon_entries(entry_id) ON DELETE SET NULL, metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)), valid_from TEXT, valid_until TEXT, created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), UNIQUE (project_id, slug, version));
CREATE INDEX IF NOT EXISTS canon_entries_project_status_idx ON canon_entries(project_id, status, updated_at DESC);CREATE INDEX IF NOT EXISTS canon_entries_type_status_idx ON canon_entries(entry_type, status);
CREATE TABLE IF NOT EXISTS canon_revisions ( revision_id TEXT PRIMARY KEY, entry_id TEXT NOT NULL REFERENCES canon_entries(entry_id) ON DELETE CASCADE, version INTEGER NOT NULL CHECK (version > 0), title TEXT NOT NULL, body TEXT NOT NULL, source_snapshot_id TEXT REFERENCES snapshots(snapshot_id) ON DELETE SET NULL, change_summary TEXT NOT NULL DEFAULT '', metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), created_by TEXT, UNIQUE (entry_id, version));
CREATE INDEX IF NOT EXISTS canon_revisions_entry_created_idx ON canon_revisions(entry_id, created_at DESC);
CREATE TABLE IF NOT EXISTS frontier_items ( frontier_id TEXT PRIMARY KEY, project_id TEXT REFERENCES projects(project_id) ON DELETE CASCADE, domain TEXT NOT NULL, item_type TEXT NOT NULL CHECK (item_type IN ('technology', 'capability', 'practice', 'dependency', 'research', 'risk')), title TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', rationale TEXT NOT NULL DEFAULT '', status TEXT NOT NULL DEFAULT 'candidate' CHECK (status IN ('candidate', 'tracking', 'adopted', 'rejected', 'obsolete')), confidence REAL CHECK (confidence IS NULL OR (confidence >= 0 AND confidence <= 1)), impact TEXT NOT NULL DEFAULT 'medium' CHECK (impact IN ('low', 'medium', 'high', 'critical')), first_seen_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), last_reviewed_at TEXT, review_after TEXT, metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), updated_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')));
CREATE INDEX IF NOT EXISTS frontier_items_project_status_idx ON frontier_items(project_id, status, updated_at DESC);CREATE INDEX IF NOT EXISTS frontier_items_domain_review_idx ON frontier_items(domain, review_after);
CREATE TABLE IF NOT EXISTS frontier_observations ( observation_id TEXT PRIMARY KEY, frontier_id TEXT NOT NULL REFERENCES frontier_items(frontier_id) ON DELETE CASCADE, source_name TEXT NOT NULL, source_uri TEXT, observed_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), summary TEXT NOT NULL, evidence_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(evidence_json)), confidence REAL CHECK (confidence IS NULL OR (confidence >= 0 AND confidence <= 1)), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')));
CREATE INDEX IF NOT EXISTS frontier_observations_frontier_idx ON frontier_observations(frontier_id, observed_at DESC);
CREATE TABLE IF NOT EXISTS archive_records ( archive_id TEXT PRIMARY KEY, project_id TEXT REFERENCES projects(project_id) ON DELETE SET NULL, resource_type TEXT NOT NULL, resource_id TEXT NOT NULL, snapshot_id TEXT REFERENCES snapshots(snapshot_id) ON DELETE SET NULL, payload_json TEXT NOT NULL CHECK (json_valid(payload_json)), checksum TEXT NOT NULL, archive_reason TEXT NOT NULL DEFAULT '', archived_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), archived_by TEXT, retention_until TEXT, restored_at TEXT, metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)));
CREATE INDEX IF NOT EXISTS archive_records_project_archived_idx ON archive_records(project_id, archived_at DESC);CREATE INDEX IF NOT EXISTS archive_records_resource_idx ON archive_records(resource_type, resource_id, archived_at DESC);CREATE INDEX IF NOT EXISTS archive_records_retention_idx ON archive_records(retention_until) WHERE restored_at IS NULL;
CREATE TABLE IF NOT EXISTS knowledge_embeddings ( embedding_id TEXT PRIMARY KEY, entity_type TEXT NOT NULL, entity_id TEXT NOT NULL, model_key TEXT NOT NULL, dimensions INTEGER NOT NULL CHECK (dimensions > 0), embedding_json TEXT NOT NULL CHECK (json_valid(embedding_json) AND json_type(embedding_json) = 'array'), content_hash TEXT NOT NULL, created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), UNIQUE (entity_type, entity_id, model_key));
CREATE INDEX IF NOT EXISTS knowledge_embeddings_entity_idx ON knowledge_embeddings(entity_type, entity_id);
CREATE TABLE IF NOT EXISTS dependency_findings ( finding_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, kind TEXT NOT NULL CHECK (kind IN ('model', 'dataset', 'permission', 'tool', 'infrastructure')), name TEXT NOT NULL, description TEXT NOT NULL DEFAULT '', status TEXT NOT NULL DEFAULT 'open' CHECK (status IN ('open', 'resolved', 'waived')), source TEXT NOT NULL DEFAULT 'manual', metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)), detected_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), resolved_at TEXT);
CREATE INDEX IF NOT EXISTS dependency_findings_project_status_idx ON dependency_findings(project_id, status, detected_at DESC);CREATE INDEX IF NOT EXISTS dependency_findings_kind_name_idx ON dependency_findings(kind, name, status);
CREATE TABLE IF NOT EXISTS delta_runs ( delta_run_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, current_label TEXT NOT NULL, target_label TEXT NOT NULL, current_state_json TEXT NOT NULL CHECK (json_valid(current_state_json)), target_state_json TEXT NOT NULL CHECK (json_valid(target_state_json)), status TEXT NOT NULL CHECK (status IN ('complete', 'blocked')), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), created_by TEXT);
CREATE INDEX IF NOT EXISTS delta_runs_project_created_idx ON delta_runs(project_id, created_at DESC);
CREATE TABLE IF NOT EXISTS delta_gaps ( gap_id TEXT PRIMARY KEY, delta_run_id TEXT NOT NULL REFERENCES delta_runs(delta_run_id) ON DELETE CASCADE, dimension TEXT NOT NULL, current_values_json TEXT NOT NULL CHECK (json_valid(current_values_json)), target_values_json TEXT NOT NULL CHECK (json_valid(target_values_json)), missing_values_json TEXT NOT NULL CHECK (json_valid(missing_values_json)), severity TEXT NOT NULL CHECK (severity IN ('gap', 'blocker')), status TEXT NOT NULL DEFAULT 'open' CHECK (status IN ('open', 'resolved', 'accepted')), created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')));
CREATE INDEX IF NOT EXISTS delta_gaps_run_status_idx ON delta_gaps(delta_run_id, status);
CREATE TABLE IF NOT EXISTS delta_dependencies ( delta_dependency_id TEXT PRIMARY KEY, delta_run_id TEXT NOT NULL REFERENCES delta_runs(delta_run_id) ON DELETE CASCADE, finding_id TEXT NOT NULL REFERENCES dependency_findings(finding_id) ON DELETE RESTRICT, created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), UNIQUE (delta_run_id, finding_id));
CREATE INDEX IF NOT EXISTS delta_dependencies_run_idx ON delta_dependencies(delta_run_id);
CREATE TABLE IF NOT EXISTS governance_reviews ( review_id TEXT PRIMARY KEY, project_id TEXT NOT NULL REFERENCES projects(project_id) ON DELETE CASCADE, action TEXT NOT NULL, resource_type TEXT NOT NULL, resource_id TEXT NOT NULL, decision TEXT NOT NULL DEFAULT 'pending' CHECK (decision IN ('pending', 'approved', 'rejected')), requested_by TEXT, requested_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')), reviewed_by TEXT, reviewed_at TEXT, reason TEXT NOT NULL DEFAULT '', metadata_json TEXT NOT NULL DEFAULT '{}' CHECK (json_valid(metadata_json)));
CREATE INDEX IF NOT EXISTS governance_reviews_project_decision_idx ON governance_reviews(project_id, decision, requested_at DESC);CREATE INDEX IF NOT EXISTS governance_reviews_resource_idx ON governance_reviews(action, resource_type, resource_id, decision);
-- Kept for compatibility with the current local API while normalized storage is introduced.CREATE TABLE IF NOT EXISTS app_state ( state_key TEXT PRIMARY KEY, value_json TEXT NOT NULL CHECK (json_valid(value_json)), updated_at TEXT NOT NULL);
INSERT OR IGNORE INTO storage_schema_migrations(version, name)VALUES (1, 'initial-storage-schema');
INSERT OR IGNORE INTO storage_schema_migrations(version, name)VALUES (2, 'knowledge-delta-dependency-governance-lifecycle');123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114<?xml version="1.0" encoding="UTF-8"?><sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt"> <sch:title>ProjectOS v2 manifest rules</sch:title> <sch:pattern id="manifest-shape"> <sch:rule context="ProjectOS"> <sch:assert test="@version = '2.0'">The manifest version must be 2.0.</sch:assert> <sch:assert test="count(decisionFormula/step) = 15">The decision formula must define all 15 stages.</sch:assert> <sch:assert test="count(decisionFormula/step[@gate = 'true']) = 2">The decision formula must include logic and governance gates.</sch:assert> <sch:assert test="count(projectLifecycle/stage) = 12">The project lifecycle must define all 12 stages.</sch:assert> <sch:assert test="count(fabrics/fabric) = 11">The manifest must define the 11 ProjectOS fabrics.</sch:assert> <sch:assert test="count(councils/council) = 6">The manifest must define six council templates.</sch:assert> <sch:assert test="count(agents/agent) = 12">The manifest must define 12 specialist agents.</sch:assert> <sch:assert test="count(models/model) >= 1">At least one model routing entry is required.</sch:assert> <sch:assert test="count(workspaces/workspace) >= 1">At least one workspace route is required.</sch:assert> <sch:assert test="count(permissions/permission) >= 1">At least one permission rule is required.</sch:assert> <sch:assert test="normalize-space(runtime/@profile) != ''">The runtime profile must be named.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="catalog-quality"> <sch:rule context="fabrics/fabric"> <sch:assert test="normalize-space(@name) != ''">Every fabric needs a name.</sch:assert> <sch:assert test="normalize-space(@description) != ''">Every fabric needs a description for the dashboard.</sch:assert> <sch:assert test="count(capability) >= 1">Every fabric must declare at least one capability.</sch:assert> </sch:rule> <sch:rule context="councils/council"> <sch:assert test="normalize-space(@description) != ''">Every council needs a description.</sch:assert> <sch:assert test="count(member) >= 1">Every council must assign at least one member.</sch:assert> </sch:rule> <sch:rule context="agents/agent"> <sch:assert test="normalize-space(@description) != ''">Every agent needs a description.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="unique-registries"> <sch:rule context="ProjectOS"> <sch:assert test="count(fabrics/fabric) = count(fabrics/fabric[not(@name = preceding-sibling::fabric/@name)])">Fabric names must be unique.</sch:assert> <sch:assert test="count(councils/council) = count(councils/council[not(@name = preceding-sibling::council/@name)])">Council names must be unique.</sch:assert> <sch:assert test="count(agents/agent) = count(agents/agent[not(@name = preceding-sibling::agent/@name)])">Agent names must be unique.</sch:assert> <sch:assert test="count(models/model) = count(models/model[not(@role = preceding-sibling::model/@role)])">Model roles must be unique.</sch:assert> <sch:assert test="count(workspaces/workspace) = count(workspaces/workspace[not(@role = preceding-sibling::workspace/@role)])">Workspace roles must be unique.</sch:assert> <sch:assert test="count(permissions/permission) = count(permissions/permission[not(@id = preceding-sibling::permission/@id)])">Permission rule identifiers must be unique.</sch:assert> <sch:assert test="normalize-space(storage/@local) != '' and normalize-space(storage/@enterprise) != ''">Both local and enterprise storage targets must be named.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="registry-quality"> <sch:rule context="models/model"> <sch:assert test="normalize-space(@role) != '' and normalize-space(@provider) != ''">Each model route needs a role and provider.</sch:assert> </sch:rule> <sch:rule context="workspaces/workspace"> <sch:assert test="normalize-space(@role) != '' and normalize-space(@name) != ''">Each workspace route needs a role and workspace name.</sch:assert> </sch:rule> <sch:rule context="permissions/permission"> <sch:assert test="@effect = 'allow' or @effect = 'deny' or @effect = 'require-approval'">Permission effects must be allow, deny, or require-approval.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="logic-required"> <sch:rule context="CouncilTemplate"> <sch:assert test="Member[@Ref='LogicAgent']">LogicAgent required.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="storage-provider"> <sch:rule context="storage"> <sch:assert test="count(providers/provider[@enabled='true' or @enabled='1']) > 0">At least one storage provider must be enabled.</sch:assert> <sch:assert test="count(vectorStores/vectorStore) > 0">At least one vector store must be configured.</sch:assert> <sch:assert test="count(vectorStores/vectorStore[@provider='sqlite-vec']) = 0 or count(providers/provider[@name='SQLite' and (@enabled='true' or @enabled='1')]) > 0">sqlite-vec requires the SQLite provider to be enabled.</sch:assert> <sch:assert test="count(vectorStores/vectorStore[@provider='pgvector']) = 0 or count(providers/provider[@name='PostgreSQL' and (@enabled='true' or @enabled='1')]) > 0">pgvector requires the PostgreSQL provider to be enabled.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="canon-retention"> <sch:rule context="storage/retention"> <sch:assert test="@keepCanonForever='true' or @keepCanonForever='1'">Canon storage must be retained permanently.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="migration-backup"> <sch:rule context="storage/migration"> <sch:assert test="@autoMigrate='false' or @autoMigrate='0' or @backupBeforeMigration='true' or @backupBeforeMigration='1'">Automatic migrations require backups.</sch:assert> <sch:assert test="@autoMigrate='false' or @autoMigrate='0' or @validateSchema='true' or @validateSchema='1'">Automatic migrations require schema validation.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="symbol-registry"> <sch:rule context="namingConventions"> <sch:assert test="count(convention) > 0">At least one canonical symbol convention is required.</sch:assert> <sch:assert test="count(convention/alias[. = /ProjectOS/namingConventions/convention/@canonical]) = 0">A symbol alias cannot collide with a canonical symbol name.</sch:assert> </sch:rule> <sch:rule context="convention"> <sch:assert test="normalize-space(@canonical) != ''">Each symbol convention needs a canonical name.</sch:assert> <sch:assert test="count(alias) > 0">Each canonical symbol needs at least one alias.</sch:assert> </sch:rule> <sch:rule context="languageProfiles/languageProfile"> <sch:assert test="normalize-space(@name) != ''">Each language profile needs a name.</sch:assert> <sch:assert test="@interfacePrefix or @interfacePrefix = ''">Each language profile must define its interface prefix, which may be empty.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="documentation-outputs"> <sch:rule context="documentation"> <sch:assert test="count(output[@enabled='true' or @enabled='1']) > 0">At least one documentation output must be enabled.</sch:assert> <sch:assert test="count(output[@name='Architecture' and (@enabled='true' or @enabled='1')]) = 1">Architecture documentation must be enabled.</sch:assert> <sch:assert test="count(output[@name='Bootstrap' and (@enabled='true' or @enabled='1')]) = 1">Bootstrap documentation must be enabled.</sch:assert> <sch:assert test="count(output[@name='Schema' and (@enabled='true' or @enabled='1')]) = 1">Schema documentation must be enabled.</sch:assert> </sch:rule> </sch:pattern> <sch:pattern id="mcp-registry"> <sch:rule context="mcpServers"> <sch:assert test="count(server) > 0">At least one MCP server entry is required.</sch:assert> <sch:assert test="count(server) = count(server[normalize-space(@name) != ''])">Every MCP server needs a name.</sch:assert> <sch:assert test="count(server) = count(server[normalize-space(@adapter) != ''])">Every MCP server needs a registered adapter name.</sch:assert> <sch:assert test="count(server[@authMode='environment' or @authMode='keyring']) = count(server[@authMode='environment' or @authMode='keyring'][normalize-space(@credentialRef) != ''])">Environment and keyring authentication require a credential reference.</sch:assert> <sch:assert test="count(profiles/profile) > 0">At least one MCP profile is required.</sch:assert> </sch:rule> <sch:rule context="mcpServers/profiles"> <sch:assert test="count(profile[@name='database-write' and @enabled='true']) = 0">The database-write profile must stay disabled until a write role and approval policy are configured.</sch:assert> <sch:assert test="count(../server[@name='github-write' and @enabled='true']) = 0">GitHub write access must stay disabled until a write-scoped credential is configured.</sch:assert> </sch:rule> </sch:pattern></sch:schema>123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="ProjectOS"> <xs:complexType> <xs:sequence> <xs:element name="bootstrap" type="bootstrapType" /> <xs:element name="runtime" type="runtimeType" /> <xs:element name="decisionFormula" type="stepsType" /> <xs:element name="projectLifecycle" type="stagesType" /> <xs:element name="fabrics" type="fabricsType" /> <xs:element name="councils" type="councilsType" /> <xs:element name="agents" type="agentsType" /> <xs:element name="models" type="modelsType" /> <xs:element name="storage" type="storageType" /> <xs:element name="governanceControls" type="controlsType" /> <xs:element name="knowledgeAreas" type="knowledgeAreasType" /> <xs:element name="permissions" type="permissionsType" /> <xs:element name="workspaces" type="workspacesType" /> <xs:element name="mcpServers" type="mcpServersType" /> <xs:element name="namingConventions" type="namingConventionsType" /> <xs:element name="documentation" type="documentationType" /> </xs:sequence> <xs:attribute name="version" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="mode" type="xs:string" use="required" /> </xs:complexType> <xs:key name="storageProviderNames"> <xs:selector xpath="storage/providers/provider" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="storageVectorProviders"> <xs:selector xpath="storage/vectorStores/vectorStore" /> <xs:field xpath="@provider" /> </xs:key> <xs:key name="canonicalSymbols"> <xs:selector xpath="namingConventions/convention" /> <xs:field xpath="@canonical" /> </xs:key> <xs:key name="symbolAliases"> <xs:selector xpath="namingConventions/convention/alias" /> <xs:field xpath="." /> </xs:key> <xs:key name="languageProfileNames"> <xs:selector xpath="namingConventions/languageProfiles/languageProfile" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="documentationOutputs"> <xs:selector xpath="documentation/output" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="mcpServerNames"> <xs:selector xpath="mcpServers/server" /> <xs:field xpath="@name" /> </xs:key> <xs:key name="mcpProfileNames"> <xs:selector xpath="mcpServers/profiles/profile" /> <xs:field xpath="@name" /> </xs:key> <xs:keyref name="mcpProfileServerRefs" refer="mcpServerNames"> <xs:selector xpath="mcpServers/profiles/profile/serverRef" /> <xs:field xpath="@name" /> </xs:keyref> </xs:element> <xs:complexType name="bootstrapType"> <xs:attribute name="schema" type="xs:string" use="required" /> <xs:attribute name="schematron" type="xs:string" use="required" /> <xs:attribute name="output" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="runtimeType"> <xs:attribute name="startupOrder" type="xs:string" use="required" /> <xs:attribute name="profile" type="xs:string" use="required" /> <xs:attribute name="snapshots" type="xs:boolean" use="required" /> <xs:attribute name="automaticRouting" type="xs:boolean" use="required" /> <xs:attribute name="consolidation" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="stepsType"> <xs:sequence><xs:element name="step" type="stepType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="stepType"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" /> <xs:attribute name="gate" type="xs:boolean" /> </xs:complexType> <xs:complexType name="stagesType"> <xs:sequence><xs:element name="stage" type="stageType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="stageType"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" /> </xs:complexType> <xs:complexType name="fabricsType"> <xs:sequence><xs:element name="fabric" type="fabricType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="fabricType"> <xs:sequence><xs:element name="capability" type="namedItemType" minOccurs="0" maxOccurs="unbounded" /></xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="icon" type="xs:string" /> <xs:attribute name="description" type="xs:string" /> </xs:complexType> <xs:complexType name="councilsType"> <xs:sequence><xs:element name="council" type="councilType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="councilType"> <xs:sequence><xs:element name="member" type="xs:string" minOccurs="0" maxOccurs="unbounded" /></xs:sequence> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="icon" type="xs:string" /> <xs:attribute name="description" type="xs:string" /> </xs:complexType> <xs:complexType name="agentsType"> <xs:sequence><xs:element name="agent" type="describedItemType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="describedItemType"> <xs:attribute name="name" type="xs:string" use="required" /> <xs:attribute name="description" type="xs:string" /> <xs:attribute name="icon" type="xs:string" /> </xs:complexType> <xs:simpleType name="storageProviderName"> <xs:restriction base="xs:string"> <xs:enumeration value="SQLite" /> <xs:enumeration value="PostgreSQL" /> <xs:enumeration value="Archive" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="vectorProviderName"> <xs:restriction base="xs:string"> <xs:enumeration value="sqlite-vec" /> <xs:enumeration value="pgvector" /> </xs:restriction> </xs:simpleType> <xs:complexType name="storageProviderType"> <xs:attribute name="name" type="storageProviderName" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="storageProvidersType"> <xs:sequence> <xs:element name="provider" type="storageProviderType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="vectorStoreType"> <xs:attribute name="provider" type="vectorProviderName" use="required" /> <xs:attribute name="dimensions" type="xs:positiveInteger" use="required" /> </xs:complexType> <xs:complexType name="vectorStoresType"> <xs:sequence> <xs:element name="vectorStore" type="vectorStoreType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="storageRetentionType"> <xs:attribute name="snapshotDays" type="xs:positiveInteger" use="required" /> <xs:attribute name="archiveYears" type="xs:positiveInteger" use="required" /> <xs:attribute name="keepCanonForever" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="storageMigrationType"> <xs:attribute name="autoMigrate" type="xs:boolean" use="required" /> <xs:attribute name="backupBeforeMigration" type="xs:boolean" use="required" /> <xs:attribute name="validateSchema" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="storageType"> <xs:sequence> <xs:element name="providers" type="storageProvidersType" /> <xs:element name="vectorStores" type="vectorStoresType" /> <xs:element name="retention" type="storageRetentionType" /> <xs:element name="migration" type="storageMigrationType" /> </xs:sequence> <xs:attribute name="local" type="xs:string" use="required" /> <xs:attribute name="enterprise" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="controlsType"> <xs:sequence><xs:element name="control" type="describedItemType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="knowledgeAreasType"> <xs:sequence><xs:element name="area" type="describedItemType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="modelsType"> <xs:sequence><xs:element name="model" type="modelType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="modelType"> <xs:attribute name="role" type="xs:string" use="required" /> <xs:attribute name="provider" type="xs:string" use="required" /> </xs:complexType> <xs:complexType name="permissionsType"> <xs:sequence><xs:element name="permission" type="permissionType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="permissionType"> <xs:attribute name="id" type="xs:string" use="required" /> <xs:attribute name="resource" type="xs:string" use="required" /> <xs:attribute name="action" type="xs:string" use="required" /> <xs:attribute name="effect" type="xs:string" use="required" /> <xs:attribute name="requiresApproval" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="workspacesType"> <xs:sequence><xs:element name="workspace" type="workspaceType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="workspaceType"> <xs:attribute name="role" type="xs:string" use="required" /> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType> <xs:simpleType name="mcpTrustLevelType"> <xs:restriction base="xs:token"> <xs:enumeration value="Low" /> <xs:enumeration value="Medium" /> <xs:enumeration value="High" /> <xs:enumeration value="Verified" /> </xs:restriction> </xs:simpleType> <xs:complexType name="mcpServersType"> <xs:sequence> <xs:element name="server" type="mcpServerType" minOccurs="1" maxOccurs="unbounded" /> <xs:element name="profiles" type="mcpProfilesType" minOccurs="1" maxOccurs="1" /> </xs:sequence> </xs:complexType> <xs:complexType name="mcpServerType"> <xs:attribute name="name" type="symbolNameType" use="required" /> <xs:attribute name="adapter" type="symbolNameType" use="required" /> <xs:attribute name="trust" type="mcpTrustLevelType" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="optional" default="true" /> <xs:attribute name="credentialRef" type="environmentVariableNameType" use="optional" /> <xs:attribute name="authMode" type="mcpAuthModeType" use="required" /> <xs:attribute name="accessMode" type="mcpAccessModeType" use="optional" default="read-only" /> </xs:complexType> <xs:complexType name="mcpProfilesType"> <xs:sequence><xs:element name="profile" type="mcpProfileType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> </xs:complexType> <xs:complexType name="mcpProfileType"> <xs:sequence><xs:element name="serverRef" type="mcpServerRefType" minOccurs="1" maxOccurs="unbounded" /></xs:sequence> <xs:attribute name="name" type="symbolNameType" use="required" /> <xs:attribute name="description" type="xs:string" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="optional" default="true" /> </xs:complexType> <xs:complexType name="mcpServerRefType"> <xs:attribute name="name" type="symbolNameType" use="required" /> </xs:complexType> <xs:simpleType name="mcpAccessModeType"> <xs:restriction base="xs:token"> <xs:enumeration value="read-only" /> <xs:enumeration value="read-write" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="mcpAuthModeType"> <xs:restriction base="xs:token"> <xs:enumeration value="none" /> <xs:enumeration value="oauth" /> <xs:enumeration value="environment" /> <xs:enumeration value="keyring" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="environmentVariableNameType"> <xs:restriction base="xs:token"> <xs:pattern value="[A-Z_][A-Z0-9_]*" /> </xs:restriction> </xs:simpleType> <xs:simpleType name="symbolNameType"> <xs:restriction base="xs:token"> <xs:minLength value="1" /> </xs:restriction> </xs:simpleType> <xs:complexType name="namingConventionsType"> <xs:sequence> <xs:element name="convention" type="symbolConventionType" minOccurs="1" maxOccurs="unbounded" /> <xs:element name="languageProfiles" type="languageProfilesType" /> </xs:sequence> </xs:complexType> <xs:complexType name="symbolConventionType"> <xs:sequence> <xs:element name="alias" type="symbolNameType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> <xs:attribute name="canonical" type="symbolNameType" use="required" /> </xs:complexType> <xs:complexType name="languageProfilesType"> <xs:sequence> <xs:element name="languageProfile" type="languageProfileType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="languageProfileType"> <xs:attribute name="name" type="symbolNameType" use="required" /> <xs:attribute name="interfacePrefix" type="xs:string" use="required" /> </xs:complexType> <xs:simpleType name="documentationOutputNameType"> <xs:restriction base="xs:token"> <xs:enumeration value="Architecture" /> <xs:enumeration value="Bootstrap" /> <xs:enumeration value="Schema" /> <xs:enumeration value="Agents" /> <xs:enumeration value="Councils" /> <xs:enumeration value="Fabrics" /> <xs:enumeration value="Storage" /> <xs:enumeration value="Knowledge" /> <xs:enumeration value="Canon" /> <xs:enumeration value="Frontier" /> <xs:enumeration value="Delta" /> <xs:enumeration value="Dependency" /> <xs:enumeration value="Governance" /> <xs:enumeration value="Identity" /> <xs:enumeration value="Trust" /> <xs:enumeration value="Runtime" /> <xs:enumeration value="Database" /> <xs:enumeration value="API" /> <xs:enumeration value="MCP" /> <xs:enumeration value="Workspaces" /> <xs:enumeration value="Models" /> <xs:enumeration value="Providers" /> <xs:enumeration value="Snapshots" /> <xs:enumeration value="Archive" /> </xs:restriction> </xs:simpleType> <xs:complexType name="documentationType"> <xs:sequence> <xs:element name="output" type="documentationOutputType" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> <xs:complexType name="documentationOutputType"> <xs:attribute name="name" type="documentationOutputNameType" use="required" /> <xs:attribute name="enabled" type="xs:boolean" use="required" /> </xs:complexType> <xs:complexType name="namedItemType"> <xs:attribute name="name" type="xs:string" use="required" /> </xs:complexType></xs:schema>123456789101112131415161718192021222324import assert from 'node:assert/strict';import { createHash } from 'node:crypto';import { readFile } from 'node:fs/promises';import { resolve } from 'node:path';
const root = resolve(import.meta.dirname, '..');const readJson = async (path) => JSON.parse(await readFile(resolve(root, path), 'utf8'));const digest = (value) => `sha256:${createHash('sha256').update(value).digest('hex')}`;const [bootstrapXml, runtime, storage, mcp, mcpProfiles, manifest] = await Promise.all([ readFile(resolve(root, 'bootstrap.xml'), 'utf8'), readJson('generated/runtime.json'), readJson('generated/storage/storage.json'), readJson('generated/registries/mcp.json'), readJson('generated/registries/mcp-profiles.json'), readJson('generated/snapshots/snapshot-manifest.json')]);
assert.equal(manifest.schema, 1, 'snapshot manifest schema version must be 1');assert.equal(manifest.project, 'ProjectOS', 'snapshot manifest must identify ProjectOS');assert.equal(manifest.bootstrapHash, digest(bootstrapXml), 'bootstrap hash must match the source manifest');assert.equal(manifest.runtimeHash, digest(JSON.stringify(runtime)), 'runtime hash must match the generated runtime');assert.equal(manifest.storageHash, digest(JSON.stringify(storage)), 'storage hash must match generated storage settings');assert.equal(manifest.mcpHash, digest(JSON.stringify({ servers: mcp, profiles: mcpProfiles })), 'MCP hash must match generated server and profile registries');console.log('Generated snapshot manifests and hashes are valid.');123456789101112131415161718192021222324param( [string]$ProjectRoot = (Join-Path $PSScriptRoot '..'), [string]$ManifestPath = (Join-Path $ProjectRoot 'bootstrap.xml'), [string]$SchemaPath = (Join-Path $ProjectRoot 'schemas/ProjectOS.xsd'))
$ErrorActionPreference = 'Stop'$schemaPath = (Resolve-Path $SchemaPath).Path$manifestPath = (Resolve-Path $ManifestPath).Path$schemas = [System.Xml.Schema.XmlSchemaSet]::new()[void]$schemas.Add($null, $schemaPath)
$settings = [System.Xml.XmlReaderSettings]::new()$settings.ValidationType = [System.Xml.ValidationType]::Schema$settings.Schemas = $schemas$reader = [System.Xml.XmlReader]::Create($manifestPath, $settings)try { while ($reader.Read()) { }}finally { $reader.Close()}
Write-Output 'bootstrap.xml validates against schemas/ProjectOS.xsd.'123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import assert from 'node:assert/strict';import { access, readFile } from 'node:fs/promises';import { resolve } from 'node:path';
const root = resolve(import.meta.dirname, '..');const readJson = async (path) => JSON.parse(await readFile(resolve(root, path), 'utf8'));const required = [ 'manifest.json', 'bootstrap.xml', 'ProjectOS.xsd', 'ProjectOS.sch', 'migrations/manifest.json', 'generated/snapshots/snapshot-manifest.json', 'generated/runtime.json', 'generated/registries/mcp.json', 'generated/registries/mcp-profiles.json', 'docs/ARCHITECTURE.md', 'docs/mcp-adapters.md', 'storage/sqlite/schema.sql', 'storage/postgres/schema.sql'];for (const path of required) await access(resolve(root, 'release', path));
const [manifest, snapshot, generatedSnapshot, migration] = await Promise.all([ readJson('release/manifest.json'), readJson('release/generated/snapshots/snapshot-manifest.json'), readJson('generated/snapshots/snapshot-manifest.json'), readJson('release/migrations/manifest.json')]);assert.equal(manifest.project, 'ProjectOS');assert.equal(manifest.bootstrap, 'bootstrap.xml');assert.equal(manifest.schema, 'ProjectOS.xsd');assert.equal(manifest.rules, 'ProjectOS.sch');assert.deepEqual(snapshot, generatedSnapshot, 'release and generated snapshot manifests must match');for (const table of ['dependency_findings', 'delta_runs', 'delta_gaps', 'delta_dependencies', 'governance_reviews']) { assert.ok(migration.tables.includes(table), `release migration manifest must include ${table}`);}const [sourceBootstrap, bundledBootstrap, sourceSchema, bundledSchema, sourceRules, bundledRules, generatedMcp, releaseMcp, generatedMcpProfiles, releaseMcpProfiles, generatedDocs, releaseDocs, sourceMcpGuide, releaseMcpGuide] = await Promise.all([ readFile(resolve(root, 'bootstrap.xml'), 'utf8'), readFile(resolve(root, 'release/bootstrap.xml'), 'utf8'), readFile(resolve(root, 'schemas/ProjectOS.xsd'), 'utf8'), readFile(resolve(root, 'release/ProjectOS.xsd'), 'utf8'), readFile(resolve(root, 'schemas/ProjectOS.sch'), 'utf8'), readFile(resolve(root, 'release/ProjectOS.sch'), 'utf8'), readJson('generated/registries/mcp.json'), readJson('release/generated/registries/mcp.json'), readJson('generated/registries/mcp-profiles.json'), readJson('release/generated/registries/mcp-profiles.json'), readFile(resolve(root, 'generated/docs/ARCHITECTURE.md'), 'utf8'), readFile(resolve(root, 'release/docs/ARCHITECTURE.md'), 'utf8'), readFile(resolve(root, 'docs/mcp-adapters.md'), 'utf8'), readFile(resolve(root, 'release/docs/mcp-adapters.md'), 'utf8')]);assert.equal(bundledBootstrap, sourceBootstrap, 'release bootstrap must match the canonical source');assert.equal(bundledSchema, sourceSchema, 'release XSD must match the source schema');assert.equal(bundledRules, sourceRules, 'release Schematron must match the source rules');assert.deepEqual(releaseMcp, generatedMcp, 'release MCP registry must match generated configuration');assert.deepEqual(releaseMcpProfiles, generatedMcpProfiles, 'release MCP profile registry must match generated configuration');assert.equal(releaseDocs, generatedDocs, 'release documentation must match generated documentation');assert.equal(releaseMcpGuide, sourceMcpGuide, 'release MCP setup guide must match the source guide');console.log('Release package layout and manifests are valid.');release/generated-docs/DEPENDENCY.mdAdded+4
release/generated-docs/FABRICS.mdAdded+68
release/generated-docs/FRONTIER.mdAdded+4
release/generated-docs/GOVERNANCE.mdAdded+20
release/generated-docs/IDENTITY.mdAdded+6
release/generated-docs/KNOWLEDGE.mdAdded+10
release/generated-docs/MCP.mdAdded+29
release/generated-docs/MODELS.mdAdded+10
release/generated-docs/PROVIDERS.mdAdded+15
release/generated-docs/RUNTIME.mdAdded+8
release/generated-docs/SCHEMA.mdAdded+20
release/generated-docs/SNAPSHOTS.mdAdded+4
release/generated-docs/STORAGE.mdAdded+28
release/generated-docs/TRUST.mdAdded+6
release/generated-docs/WORKSPACES.mdAdded+11
release/manifest.jsonAdded+16
release/migration-manifest.jsonAdded+34
release/migrations/manifest.jsonAdded+34
release/projectos-bootstrap.xmlAdded+215
release/projectos-manifest.jsonAdded+16
release/projectos-rules.schAdded+114
release/projectos-schema.xsdAdded+318
release/snapshot-manifest.jsonAdded+9
release/storage/package-manifest.jsonAdded+12
release/storage/postgres/schema.sqlAdded+255
release/storage/sqlite/schema.sqlAdded+254
schemas/ProjectOS.schAdded+114
schemas/ProjectOS.xsdAdded+318
scripts/validate-generated-snapshots.mjsAdded+24
scripts/validate-manifest.ps1Added+24
scripts/validate-release.mjsAdded+51