This document explains the dictionary data management system for Blesséd Dialect.
The dictionary uses JSON files with schema validation to provide:
- ✅ Version control via Git
- ✅ Human-readable, inspectable data
- ✅ ACID-like guarantees through atomic commits
- ✅ Referential integrity protection
- ✅ Fork-friendly⁵ contribution workflow
- ✅ Zero backend infrastructure required
src/data/
├── schema.ts # TypeScript types + Zod validation schemas
├── loader.ts # Data loading and caching utilities
└── dictionary/
├── words.json # All word entries
└── phrases.json # All phrase/idiom entries
scripts/
├── add-word.js # Interactive CLI for adding words
├── add-phrase.js # Interactive CLI for adding phrases
└── validate-dictionary.js # Validation script for data integrity
Each entry (word or phrase) has this structure:
{
// Core identifiers
id: number; // Unique across ALL entries (words + phrases)
term: string; // The word or phrase
letter: string; // Single uppercase letter A-Z for alphabetical grouping
// Dual definition system - Rosetta Stone approach
definitionStandard: string; // American Standard English definition
definitionDialect: string; // Blesséd Dialekt definition (reveals deeper meaning)
// Optional enrichment
usageExamples?: UsageExample[]; // Array of usage examples with context
harmReductionNotes?: HarmReductionNote[]; // Safety and context warnings (1:N)
etymology?: string; // Word origin and evolution
pronunciation?: string; // How to pronounce (IPA or description)
crossReferences?: number[]; // IDs of related entries
intentionalityRating?: 1|2|3|4|5; // How deliberate is usage (1=casual, 5=highly intentional)
dateAdded?: string; // ISO date: YYYYY-MM月DD
contributors?: string[]; // GitHub usernames or names
notes?: string; // Any additional notes
}{
context: string; // Description of the situation
example: string; // The actual usage example
translation?: string; // Optional American Standard English equivalent
}Critical for safety and context. 1:N relationship - one definition can have multiple harm reduction notes, each with multiple categories:
{
categories: string[]; // Array of categories (at least one required)
note: string; // The harm reduction guidance
severity?: "info" | "caution" | "warning" | "critical";
}Harm Reduction Categories:
life_at_stake- Physical safety, survival concernstissue_at_stake- Bodily harm, health concernsessential_liberty_at_stake- Fundamental freedoms, autonomysocial_kontrakt_at_stake- Community bonds, trust, relationshipsproperty_at_stake- Material resources, belongingstrigger_warning- Psychological safetycontext_required- Needs situational understandingpotential_misinterpretation- Easily misunderstoodpower_dynamics- Hierarchical or coercive implicationscultural_sensitivity- Cultural context mattersreclaimed_term- Term with complex history of reclamationother- Other considerations
The old definition field is deprecated but still supported during migration. New entries should use definitionStandard and definitionDialect instead.
- ID must be unique - No duplicates across words and phrases combined
- Letter must match term - First letter of term (ignoring superscripts)
- All fields required - No empty or missing fields
- Letter must be A-Z - Single uppercase character only
# Add a word
npm run add-word
# Add a phrase/idiom
npm run add-phraseThe scripts handle:
- Auto-generating unique IDs
- Suggesting the correct letter
- Validating input
- Sorting entries alphabetically
- Formatting JSON consistently
Edit src/data/dictionary/words.json or phrases.json directly.
Always validate after editing:
npm run validate-dict- Atomicity: All changes in a commit happen together or not at all
- Consistency: Validation ensures data meets schema requirements
- Isolation: Git branches isolate changes until merged
- Durability: Committed changes are permanently recorded in Git history
- TypeScript types - Compile-time type checking
- Zod schemas - Runtime validation when data loads
- Validation script - Pre-commit integrity checks
- Build process - Fails if data is invalid
# Before committing changes:
npm run validate-dict # Check data integrity
npm run dev # Test in browser
npm run build # Ensure build succeeds
git diff # Review your changes
git add .
git commit -m "Add new term: XYZ"- Every change is tracked with author and timestamp
- Full history available via
git log - Revert mistakes with
git revert - Compare versions with
git diff - Branch and experiment safely
Since data is in Git:
- Remote repository (GitHub) is automatic backup
- Fork creates another backup
- Clone to local machine creates another backup
- Git history preserves all previous versions
import { getWords, getPhrases, getAllEntries } from "@/data/loader";
const words = getWords(); // Get all words
const phrases = getPhrases(); // Get all phrases
const all = getAllEntries(); // Get everything
const nextId = getNextAvailableId(); // For manual entry creation# View words
cat src/data/dictionary/words.json | jq .
# Count entries
cat src/data/dictionary/words.json | jq '.words | length'
# Find specific term
cat src/data/dictionary/words.json | jq '.words[] | select(.term == "Borlaug")'
# Get all terms starting with B
cat src/data/dictionary/words.json | jq '.words[] | select(.letter == "B") | .term'- Small dataset (< 100 entries) loads instantly
- Client-side filtering/search is fast
- No database queries or network requests
If the dictionary grows to thousands of entries:
- Consider lazy loading by letter
- Add search indexing
- Implement virtual scrolling
- Split JSON files by letter
For now, the simple approach works perfectly.
If you later need a database:
- Export JSON to database format
- Keep JSON as backup/seed data
- Add API endpoints
- Update loader.ts to fetch from API
- Keep validation scripts for data quality
The current system makes migration easy because data is already structured and validated.
The Knowledge Base (KB) requires symbolic keyboards to become thermodynamically stable. Without accessible symbols, kinetic calmunication⁵ faces enormous difficulty. This system manages keyboard layouts that are more symbolic and expressive than standard keyboards without losing core functionality.
src/data/dictionary/
└── keyboard-layouts.json # All keyboard layout metadata
{
// Identification
id: string; // Unique identifier (e.g., "calm-kb-v1")
name: string; // Human-readable name
version: string; // Semantic versioning (e.g., "1.0.0")
description: string; // What this layout provides
// Repository and downloads
repoUrl: string; // GitHub or other repo for debate and evolution
downloadUrl?: string; // Direct download link
installInstructions?: string;
// Expressiveness ratings (1-10 scale)
symbolicExpressiveness: number; // How expressive vs standard KB
coreFunctionalityRetained: number; // How much standard functionality preserved
// Issues and tradeoffs
knownIssues?: KeyboardLayoutIssue[]; // Documented problems
tradeoffs?: string[]; // General tradeoff descriptions
// Metadata
maintainers?: string[];
dateCreated?: string; // Format: YYYYY-MM月DD
dateUpdated?: string; // Format: YYYYY-MM月DD
license?: string;
tags?: string[];
}Each KB can document known problems, warnings, and tradeoffs:
{
category: string; // Type of issue (see categories below)
description: string; // Detailed explanation
severity: "minor" | "moderate" | "major" | "blocking";
affectedSystems?: string[]; // e.g., ["macOS", "Linux", "Windows"]
workaround?: string; // How to mitigate the issue
}Issue Categories:
terminal_function_keys- Problems with F1-F12, etc. in terminal appsmodifier_conflicts- Issues with Ctrl, Alt, Cmd combinationsunicode_support- Character rendering issuesapplication_compatibility- Specific app conflictsaccessibility- Screen reader or accessibility tool issuesperformance- Lag or responsiveness problemsother- Other considerations
Keyboard layouts are versionable and forkable:
- Each KB links to a GitHub repository for community debate
- Version numbers follow semantic versioning (MAJOR.MINOR.PATCH)
- Contributors can fork and evolve layouts
- Issues and improvements are tracked via Git
- Create the keyboard layout files (platform-specific)
- Set up a Git repository for the layout
- Add entry to
src/data/dictionary/keyboard-layouts.json - Document known issues, tradeoffs, and workarounds
- Provide installation instructions
- Submit PR to include in the directory
Keyboard layouts are conjoint to the Knowledge Base:
- Without symbolic access, many terms cannot be expressed
- Layouts enable the kinetic expression essential to Blesséd Dialekt
- The relationship is bidirectional: dictionary defines symbols, KBs provide access
The home page will provide:
- KB Browser: View all available keyboard layouts
- Comparison Tool: Compare expressiveness vs functionality ratings
- Issue Warnings: See known problems before downloading
- Download Links: Direct access to layout files
- Evolution Timeline: See how layouts develop over time
Advantages over alternatives:
| Feature | JSON + Git | Database | Markdown Files |
|---|---|---|---|
| Version control | ✅ Perfect | ✅ Good | |
| Human-readable | ✅ Yes | ❌ No | ✅ Yes |
| Easy to fork | ✅ Yes | ❌ No | ✅ Yes |
| Referential integrity | ✅ Validated | ✅ Native | |
| Zero infrastructure | ✅ Yes | ❌ Needs server | ✅ Yes |
| Querying | ✅ Powerful | ❌ Limited | |
| PR-friendly | ✅ Very | ❌ Not really | ✅ Yes |
For an open-source, community-driven language project, JSON + Git is the sweet spot.
Questions? See CONTRIBUTING.md or open an issue.