QPSG Canonical Rules Reference
JSON reference designed for upload into Sources as a canonical working guide for Quantum Parse Syntax
Grammar.
Version: v2.0 | Lineage: Vault ® Canon ® Codex ® QPSG | Generated: 2026-03-18T03:59:55Z
What this file is
A practical working canon for building a parser, validator, linter, receipt generator, and integration layer for the
Luxor QPSG Grammar App. It combines the uploaded QPSG reference PDF with the project context and
examples established in this chat.
Embedded JSON
{
"document": {
"title": "QPSG Canonical Rules Reference",
"subtitle": "JSON reference for upload into Sources",
"system_name": "Quantum Parse Syntax Grammar",
"version": "v2.0",
"status": "working canon for parser, validator, receipt, and integration work",
"intended_use": [
"Source-uploadable canonical reference for QPSG parsing and validation",
"Translator-engine design reference",
"Receipt and ledger generation reference",
"Cockpit integration reference for IGIS / Luxor QPSG Grammar App"
],
"lineage": [
"Vault",
"Canon",
"Codex",
"QPSG"
],
"generated_utc": "2026-03-18T03:59:55Z",
"source_basis": [
"This chat thread",
"Uploaded PDF: QPSG_Canonical_Rules_Reference.pdf"
],
"author_context": "Prepared for Kalib M. Loy project workspace as a reusable Sources
artifact"
},
"scope": {
"what_is_canonical_here": [
"Structural parsing rules",
"Phrase and clause inventory",
"Validator and linter contracts",
"Receipt and lineage conventions",
"Integration targets discussed in this chat"
],
"what_is_not_claimed": [
"A definitive historical or legal transcription of all David Wynn Miller materials",
"A replacement for original source books or scans",
"A guarantee that all historical QPSG variants are represented"
]
},
"design_principles": {
"parser_strategy": [
"syntax-first",
"semantic-second",
"deterministic header and section parsing",
"regex guardrails for drift detection",
"uppercase canonical labels for structural keys"
],
"architecture_targets": {
"core_language": [
"TypeScript",
"Node.js"
],
Page 2
"frontend": "Next.js / Vercel",
"python_adapter": "FastAPI or equivalent HTTP bridge to Node core",
"receipt_model": "content hash + policy seal + optional Merkle root"
},
"anti_drift": [
"JSON-schema validated registries",
"Rule linter rejects malformed pipe sections",
"Structural keys normalized to uppercase",
"Receipt lines must carry explicit source and timestamp fields"
]
},
"lexical_tokens": {
"WORD": "Text run not otherwise classified as punctuation or newline.",
"DASH": "-",
"COLON": ":",
"COMMA": ",",
"DOT": ".",
"QUOTE": "\"",
"PIPE": "|",
"EQUALS": "=",
"NEWLINE": "\\n",
"OMEGA": "W or W depending on glyph environment; parser may normalize either form for
command detection"
},
"operators_and_semantics": {
"FOR THE CLAIM OF": "Introduces the governing claim or legal/grammatical fact
statement.",
"WITH THE": "Introduces attached condition, relation, instrument, or contextual
binding.",
"BY THE": "Introduces actor, authority, or causal agent.",
"OF THE": "Introduces object, domain, or ownership relation.",
"IS WITH THE": "Canonical relational linkage form used in claims and closures."
},
"document_shape": {
"root_node": {
"kind": "CLAUSE",
"label": "DOCUMENT"
},
"line_grouping_rule": "Input is grouped by newline into phrase lines before higher-level
interpretation.",
"core_line_types": [
"CLAIM-HEADER",
"RUN-COMMAND",
"OUTPUT-HEADER",
"SECTION",
"RECEIPT-LINE",
"LINEAGE-PIPE",
"LINE"
]
},
"clause_inventory": {
"CLAIM": {
"purpose": "Declares the governing claim or thesis.",
"required": true,
"examples": [
"FOR THE CLAIM OF THE OCTASYNC LINK IS WITH THE UNITY OF THE PROJECTS AND THE LIFE
OF THE VAULT."
]
},
"RUN": {
"purpose": "Declares executable or procedural commands.",
"required": false,
"examples": [
"INITIATE.LUXOR.PROJECT.LINK.W",
"UNIFIED.ATTACH.LOAD.W",
"HELM.PROMPT.LOAD.W"
]
},
"OUTPUT": {
"purpose": "Declares target output structures and key-value payloads.",
"required": false,
"examples": [
"PROJECT.QPSG| INITIALIZED=true| SEAL8=DEADBEEF"
]
},
"RECEIPT": {
Page 3
"purpose": "Carries deterministic execution receipt metadata.",
"required": false,
"examples": [
"RECEIPT|TS=2025-10-13T01:33:00-07:00|SOURCE=INITIATE.QPSG.PROJECT.W|SEAL8=B7E3D9F4"
]
},
"LINEAGE": {
"purpose": "Declares the lineage chain for authority and inheritance.",
"required": false,
"examples": [
"LINEAGE|V,C,X,Q",
"LINEAGE=V®C®X®Q"
]
}
},
"phrase_inventory": {
"CLAIM-HEADER": {
"kind": "PHRASE",
"pattern_role": "Canonical header line",
"parse_role": "Top-priority header detection"
},
"RUN-COMMAND": {
"kind": "PHRASE",
"pattern_role": "Executable command line ending in .W or .W",
"parse_role": "Operational instruction"
},
"OUTPUT-HEADER": {
"kind": "PHRASE",
"pattern_role": "Structured output declaration",
"parse_role": "Serializable output surface"
},
"SECTION": {
"kind": "PHRASE",
"pattern_role": "Pipe-delimited label and key-value sections",
"parse_role": "Structured field container"
},
"RECEIPT-LINE": {
"kind": "PHRASE",
"pattern_role": "Receipt metadata line",
"parse_role": "Execution proof"
},
"LINEAGE-PIPE": {
"kind": "PHRASE",
"pattern_role": "Lineage authority declaration",
"parse_role": "Authority chain"
},
"LINE": {
"kind": "PHRASE",
"pattern_role": "Fallback line",
"parse_role": "Unclassified content pending semantic overlay"
}
},
"canonical_rules": [
{
"id": "qpsg.claim.header",
"label": "CLAIM-HEADER",
"weight": 100,
"pattern": "^FOR THE CLAIM OF( .+)$",
"example": "FOR THE CLAIM OF THE OCTASYNC LINK IS WITH THE UNITY OF THE PROJECTS AND
THE LIFE OF THE VAULT.",
"notes": "Highest-precedence header rule."
},
{
"id": "qpsg.run.command",
"label": "RUN-COMMAND",
"weight": 90,
"pattern": "^[A-Z][A-Z0-9\\\\._]+\\\\.[WW](?: .*)?$",
"example": "INITIATE.LUXOR.PROJECT.LINK.W",
"notes": "Operational command; canonical command stem is uppercase with dots."
},
{
"id": "qpsg.output.header",
"label": "OUTPUT-HEADER",
"weight": 80,
"pattern": "^OUTPUT:|^OUTPUT\\\\.|^PROJECT\\\\.[A-Z0-9_\\\\.-]+\\\\|",
"example": "PROJECT.QPSG| INITIALIZED=true| SEAL8=DEADBEEF",
Page 4
"notes": "Structured output or project state declaration."
},
{
"id": "qpsg.receipt.line",
"label": "RECEIPT-LINE",
"weight": 70,
"pattern":
"^RECEIPT\\\\|.*(?:TS|ts)=.+\\\\|.*(?:SOURCE|source)=.+\\\\|.*(?:SEAL8|seal8)=[A-Fa-f0-9]{8}.*$",
"example":
"RECEIPT|TS=2025-10-13T01:33:00-07:00|SOURCE=INITIATE.QPSG.PROJECT.W|SEAL8=B7E3D9F4",
"notes": "Receipt line must carry timestamp, source, and seal8."
},
{
"id": "qpsg.lineage.pipe",
"label": "LINEAGE-PIPE",
"weight": 70,
"pattern": "^LINEAGE\\\\|[VCXQ](?:,[VCXQ])*$|^LINEAGE=V®C®X®Q$",
"example": "LINEAGE|V,C,X,Q",
"notes": "Canonical lineage declaration."
},
{
"id": "qpsg.section.pipe",
"label": "SECTION-PIPE",
"weight": 60,
"pattern": "^.*\\\\|.*$",
"example": "PROJECT.QPSG| INITIALIZED=true| SEAL8=DEADBEEF",
"notes": "Generic pipe-delimited section; refined by linter."
},
{
"id": "qpsg.keyvalue.upper",
"label": "KEY-VALUE-UPPER",
"weight": 50,
"pattern": "^[A-Z][A-Z0-9_\\\\-]*=.+$",
"example": "SEAL8=F3C8D2B9",
"notes": "Canonical structural key rule for uppercase field names."
}
],
"peg_grammar_contract": {
"goal": "Deterministic parsing for header and section lines before semantic overlay.",
"header_rule": "Header = 'FOR THE CLAIM OF' + LineRest",
"section_rule": "SectionLine = Label? '|' PairList",
"pair_rule": "Pair = Key '=' Value",
"label_rule": "Label = [A-Za-z0-9_.-]+",
"key_rule": "Key = [A-Z0-9_-]+",
"value_rule": "Value = any non-pipe, non-newline content trimmed",
"fallback_behavior": "If PEG parse fails or is unavailable, parser uses regex guardrail
mode and emits a warning diagnostic."
},
"validation_contract": {
"required_checks": [
{
"name": "claim_header_presence",
"severity": "error",
"rule": "Document must contain at least one CLAIM-HEADER phrase."
},
{
"name": "section_presence",
"severity": "warn",
"rule": "Document should contain at least one SECTION phrase for structured
payloads."
},
{
"name": "receipt_integrity_minimum",
"severity": "warn",
"rule": "Receipt lines should include timestamp, source, and seal/hash fields."
}
],
"future_hooks": [
"rule-weight escalation",
"typed lineage node validation",
"semantic overlay role consistency",
"cross-line receipt integrity checks"
]
},
"linter_contract": {
"purpose": "Reject malformed structural lines before semantic or signing layers.",
Page 5
"rules": [
{
"name": "section_requires_pairs",
"severity": "error",
"rule": "Any line containing a pipe must include at least one KEY=VALUE pair after
the label."
},
{
"name": "keys_must_be_uppercase",
"severity": "error",
"rule": "Pipe-section keys should match ^[A-Z0-9_-]+$."
},
{
"name": "explicit_key_value_form",
"severity": "error",
"rule": "Every structural field after a pipe must be in KEY=VALUE form."
},
{
"name": "top_level_key_uppercase",
"severity": "error",
"rule": "Standalone structural keys should use uppercase canonical form when acting
as machine fields."
}
]
},
"receipt_contract": {
"human_receipt_fields": [
"project_name",
"tag",
"timestamp",
"status",
"checksum_sha256",
"registry_root",
"seal_phrase"
],
"json_receipt_fields": [
"title",
"link_kind",
"projects",
"parent",
"gate",
"rails",
"tag",
"timestamp",
"session_id",
"checksum_sha256",
"registry_root",
"witnesses",
"author",
"breathkey",
"status",
"seal_code",
"seal_phrase"
],
"qpsg_receipt_template": [
"FOR THE CLAIM OF THE {LINK_KIND} IS WITH THE UNITY BY THE {PROJECT_COUNT}-PROJECTS
WITHIN THE {PARENT} OF THE {GATE}.",
"WITH THE AUTHORIZATION BY THE {AUTHOR} IS WITH THE BREATHKEY OF THE {BREATHKEY}.",
"FOR THE CLAIM OF THE HANDSHAKE IS WITH THE CONFIRMATION BY THE MIRROR-CHECKSUM OF THE
{CHECKSUM_SHA256}.",
"WITH THE REGISTRY-ROOT OF THE {REGISTRY_ROOT}.",
"WITH THE STATUS OF THE LINK IS WITH THE {STATUS_UPPER} BY THE VAULT."
]
},
"integration_targets": {
"project_name": "Luxor · QPSG Grammar App (IGIS)",
"core_tasks": [
"Grammar PDF canonization",
"Rule parser engine",
"Syntax validator",
"QPSG mode activation",
"Integration layer"
],
"research_tasks": [
"Patent and source review",
"AI co-grammar experiments",
Page 6
"Lexical library build",
"App logic sandbox"
],
"proof_tasks": [
"Daily build receipt",
"Weekly digest"
],
"suggested_backend_interfaces": [
"parse(text) -> AST",
"validate(ast) -> diagnostics",
"lint(text) -> violations",
"translate_receipt(json) -> qpsg_text"
]
},
"project_memory_from_this_chat": {
"commands_seen": [
"VAULT.OCTASYNC.LINK.ALL.W",
"INITIATE.LUXOR.PROJECT.LINK.W",
"HELM.PROMPT.LOAD.W",
"UNIFIED.ATTACH.LOAD.W"
],
"receipt_examples_seen": [
"Receipt Mirror: project_name=Luxor · QPSG Grammar App (IGIS) | tag=qpsg_app |
timestamp=2025-10-06T20:42-07:00",
"Pulse file set: pulse.qpsg, QPSG_pulse_receipt.txt, QPSG_pulse_receipt.json"
],
"example_qpsg_claim_from_chat": "FOR THE CLAIM OF THE OCTASYNC-LINK IS WITH THE UNITY BY
THE EIGHT-PROJECTS WITHIN THE LUXOR-VAULT-SOVEREIGN OF THE GATE-ZERO."
},
"examples": {
"natural_to_qpsg": [
{
"natural": "This agreement establishes that John Smith owns the property.",
"qpsg": "FOR THE CLAIM OF THE AGREEMENT IS WITH THE ESTABLISHING OF THE OWNERSHIP BY
THE JOHN-SMITH WITH THE PROPERTY."
}
],
"receipt_mirror_minimum": {
"project_name": "Luxor · QPSG Grammar App (IGIS)",
"tag": "qpsg_app",
"timestamp": "2025-10-06T20:42:00-07:00"
}
},
"implementation_notes": {
"normalization": [
"Preserve source text for display",
"Normalize omega glyph variants for command detection",
"Trim surrounding whitespace around pipe-delimited fields",
"Prefer uppercase structural keys in emitted machine receipts"
],
"known_limits": [
"QPSG semantics remain context-sensitive beyond surface parsing",
"Historical Miller materials may include forms not represented here",
"This artifact focuses on practical parser/validator construction rather than
exhaustive jurisprudential theory"
]
}
}


