@p31/cognitive-passport-schema
v1.1.0
Published
Cognitive Passport schema — W3C VC-aligned sovereign identity credential for P31
Maintainers
Readme
Cognitive Passport Schema
Version: 1.1.0 License: AGPL-3.0 Status: Production-ready
Overview
The Cognitive Passport is a W3C VC-aligned credential schema for sovereign identity. It captures human-readable accommodation summaries and machine-readable style/role/AI-context blocks that drive personalization across P31 surfaces.
This schema is the source of truth for Cognitive Passport documents. It is:
- W3C VC 2.0/2.1 aligned — compatible with EUDI Wallet framework
- Forward-compatible — v1.1.0 is an additive overlay on v1.0.0
- Machine-readable — drives AI tools, theme engines, and bus bar navigation
- Human-readable — captures identity, cognition, communication, and accessibility preferences
Schema Structure
{
"$schema": "p31.cognitivePassport/1.1.0",
"identity": { ... },
"cognition": { ... },
"communication": { ... },
"accessibility": { ... },
"stylePreferences": { ... },
"context": { ... }
}Blocks (all optional)
| Block | Purpose | Drives |
|-------|---------|--------|
| identity | Self-description (name, pronouns, role, access level) | Bus bar nav, AI context |
| cognition | Processing style, learning preferences, strengths/challenges | AI tools |
| communication | Tone, response length, format preferences | PHOS guide register |
| accessibility | Screen comfort, motion, contrast, font size, density | p31SubjectPrefs |
| stylePreferences | Theme, mode, appearance, glass, animations | p31Theme engine |
| context | Current focus, tools used, domain, notes | AI context export |
Usage
As a JSON Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://p31ca.org/schema/cognitive-passport-v1-1.schema.json",
"type": "object"
}In Code
import schema from './spec/cognitive-passport-v1-1.schema.json';
// Validate a passport document
function validatePassport(doc: unknown): boolean {
// Use AJV or similar JSON Schema validator
const ajv = new Ajv();
const validate = ajv.compile(schema);
return validate(doc);
}As a W3C VC Credential
The Cognitive Passport can be exported as a W3C Verifiable Credential:
{
"@context": [
"https://www.w3.org/2018/credentials/v1",
"https://www.w3.org/2018/credentials/v2"
],
"type": ["VerifiableCredential", "CognitivePassportCredential"],
"issuer": "did:key:z6Mk...",
"credentialSubject": {
"id": "did:key:z6Mk...",
"identity": { ... },
"cognition": { ... },
"accessibility": { ... }
}
}Additivity
All v1.1.0 fields are optional. A v1.0.0 document that omits every v1.1.0 block validates against this schema unchanged.
This means:
- Existing v1.0.0 documents remain valid
- New documents can adopt v1.1.0 incrementally
- Readers gracefully degrade when v1.1.0 blocks are absent
Integration Points
| Surface | Consumes | Drives |
|---------|----------|--------|
| Bus Bar | identity.accessLevel | Navigation slots |
| PHOS Guide | communication.preferredTone + stylePreferences.phosRegister | Greeting/hint/fallback verbosity |
| Theme Engine | stylePreferences.theme/mode/appearance | window.p31Theme.setTheme() |
| Subject Prefs | accessibility.* | window.p31SubjectPrefs.set() |
| AI Context | context.currentFocus/toolsUsed/domain | Copy-for-LLM export buttons |
VC 2.1 Alignment
This schema is forward-compatible with W3C VC Data Model 2.1:
- Uses
@contextv1 + v2 URIs - Supports
validFrom/validUntiltimestamps - Compatible with StatusList2021 revocation
- Ready for EUDI Wallet import (December 2026 deadline)
Publishing
npm
npm publish @p31/cognitive-passport-schemaGitHub
git remote add origin https://github.com/p31labs/cognitive-passport-schema.git
git push -u origin mainLicense
AGPL-3.0 — See LICENSE for details.
