Skip to content

Commit 87cf42e

Browse files
hyperpolymathclaude
andcommitted
feat(ux): add onboarding, contractiles, and UX infrastructure
- Purge hardcoded absolute paths (replaced with env vars / relative) - Add QUICKSTART-USER.adoc with real build/run instructions - Add doctor/heal/tour/help-me recipes to Justfile - Add LLM warmup scripts (user + dev, token-efficient) - Add contractile baselines: MUST, TRUST, INTENT, ADJUST - Add guix.scm + flake.nix for reproducible environments - Slim/create AI manifest with tiered context loading Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent fdb8080 commit 87cf42e

7 files changed

Lines changed: 708 additions & 0 deletions

File tree

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; ADJUST.contractile — Accessibility invariants for verisimdb
3+
; "ADJUST" = Accessibility & Digital Justice for Universal Software & Technology
4+
;
5+
; Part of the contractile family: MUST, TRUST, DUST, INTENT, ADJUST
6+
; This file is machine-readable. LLM/SLM agents MUST NOT violate these invariants.
7+
8+
; ── Definitions ──────────────────────────────────────────────────
9+
;
10+
; ADJUST (noun/verb)
11+
; The accessibility contractile. Defines how software must adapt to serve
12+
; all users regardless of ability, device, or context. Named for the verb
13+
; "adjust" — to make suitable, to adapt, to accommodate — which is the
14+
; core action of accessible design.
15+
;
16+
; Scope:
17+
; ADJUST governs all user-facing interfaces: GUI, TUI, CLI, web, mobile,
18+
; documentation, error messages, and installation flows. It applies to
19+
; both human users and assistive technologies (screen readers, switch
20+
; devices, braille displays, voice control).
21+
;
22+
; Relationship to other contractiles:
23+
; - MUST: ADJUST invariants are a subset of MUST — violating ADJUST
24+
; is a MUST violation. ADJUST exists separately because accessibility
25+
; rules are numerous enough to warrant their own file, and because
26+
; LLMs frequently forget accessibility unless explicitly reminded.
27+
; - TRUST: ADJUST does not affect trust levels. All trust tiers must
28+
; respect ADJUST invariants equally.
29+
; - DUST: Deprecating a feature does not exempt it from ADJUST until
30+
; it is fully removed. Deprecated UI must remain accessible.
31+
; - INTENT: ADJUST supports the anti-purpose "this software is NOT
32+
; only for able-bodied users with modern hardware."
33+
;
34+
; Standard: WCAG 2.2 Level AA (minimum)
35+
; https://www.w3.org/WAI/WCAG22/quickref/?levels=aaa
36+
;
37+
; Why a separate file:
38+
; Experience shows LLMs and developers alike treat accessibility as an
39+
; afterthought. By placing invariants in a contractile that is loaded
40+
; at session start, we make it structurally impossible to forget.
41+
;
42+
; ── End Definitions ──────────────────────────────────────────────
43+
44+
(adjust-contractile
45+
(version "1.0.0")
46+
(full-name "Accessibility & Digital Justice for Universal Software & Technology")
47+
(standard "WCAG-2.2-AA")
48+
(repo "verisimdb")
49+
50+
(invariants
51+
; ── Visual ──
52+
(adjust "colour-contrast-ratio >= 4.5:1 for normal text")
53+
(adjust "colour-contrast-ratio >= 3:1 for large text (18pt+ or 14pt+ bold)")
54+
(adjust "no information conveyed by colour alone")
55+
(adjust "no flashing or strobing content (3 flashes/second max)")
56+
(adjust "text resizable to 200% without loss of content or function")
57+
(adjust "focus indicators visible on all interactive elements")
58+
59+
; ── Keyboard ──
60+
(adjust "all interactive elements reachable via keyboard (Tab/Shift+Tab)")
61+
(adjust "no keyboard traps — user can always Tab away")
62+
(adjust "skip navigation link present on pages with repeated blocks")
63+
(adjust "logical focus order follows visual reading order")
64+
65+
; ── Screen reader ──
66+
(adjust "all images have meaningful alt text (or alt='' if decorative)")
67+
(adjust "all form inputs have associated labels")
68+
(adjust "ARIA landmarks used for page regions (main, nav, banner, etc.)")
69+
(adjust "dynamic content updates announced via aria-live regions")
70+
(adjust "semantic HTML used (headings, lists, tables) — not div soup")
71+
72+
; ── Interactive ──
73+
(adjust "touch targets minimum 44x44px on mobile/touch interfaces")
74+
(adjust "error messages identify the field and describe the error")
75+
(adjust "error messages not conveyed by colour or position alone")
76+
(adjust "form validation provides suggestions for correction")
77+
78+
; ── Media ──
79+
(adjust "video has captions (closed or open)")
80+
(adjust "audio-only content has text transcript")
81+
(adjust "no autoplay of media with sound")
82+
83+
; ── Motion ──
84+
(adjust "animations respect prefers-reduced-motion media query")
85+
(adjust "no content depends on motion to convey meaning")
86+
87+
; ── CLI/TUI ──
88+
(adjust "CLI output must not rely solely on colour (use symbols: [OK] [FAIL])")
89+
(adjust "TUI must support high-contrast mode")
90+
(adjust "all CLI commands support --help with plain-text output")
91+
(adjust "error messages written in plain language, not jargon or codes alone")
92+
93+
; ── Documentation ──
94+
(adjust "docs use clear language, short sentences, logical structure")
95+
(adjust "code examples include comments explaining non-obvious steps")
96+
(adjust "diagrams have text descriptions or alt text")
97+
)
98+
99+
(enforcement
100+
(ci "accessibility linting in quality.yml workflow")
101+
(pr-block "PR blocked if accessibility regression detected")
102+
(tool "axe-core or pa11y for automated checks on web UI")
103+
(tool "CLI output inspected for colour-only signalling")
104+
(manual "manual screen reader test before major releases")
105+
)
106+
107+
(notes
108+
"These are MINIMUM requirements. Exceeding them (AAA) is encouraged."
109+
"When in doubt about an accessibility decision, ask — don't guess."
110+
"Accessibility is not optional polish — it is a structural requirement."
111+
)
112+
)
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; INTENT.contractile — Purpose and scope for verisimdb
3+
; Helps LLM/SLM agents understand what this repo IS and IS NOT.
4+
5+
(intent-contractile
6+
(version "1.0.0")
7+
(repo "verisimdb")
8+
9+
; === Purpose (what this repo IS) ===
10+
(purpose
11+
"VeriSimDB (Veridical Simulacrum Database) is a cross-system entity consistency
12+
engine with drift detection, self-normalisation, and formally verified queries.
13+
Each entity exists simultaneously across 8 modalities — the octad (Graph, Vector,
14+
Tensor, Semantic, Document, Temporal, Provenance, Spatial) — with drift detection
15+
and automatic consistency maintenance. It operates as a standalone database OR as a
16+
heterogeneous federation coordinator over existing databases. Rust core handles
17+
modality stores; Elixir/OTP orchestrates distributed coordination."
18+
)
19+
20+
; === Anti-Purpose (what this repo is NOT — prevents scope creep) ===
21+
(anti-purpose
22+
"VeriSimDB is NOT a general-purpose relational database — it solves cross-modal
23+
entity consistency. It is NOT a document store, graph database, or vector database
24+
alone — it unifies all 8 modalities. It does NOT store application data in its
25+
source repository — each consumer gets its own instance, port, and volume. It is
26+
NOT an ORM or query builder — VQL (VeriSim Query Language) is the native interface,
27+
not SQL."
28+
)
29+
30+
; === Key Architectural Decisions That Must Not Be Reversed ===
31+
(architectural-invariants
32+
"8-modality octad — one entity ID maps to exactly eight synchronized stores"
33+
"Drift detection with configurable thresholds and automatic self-normalisation"
34+
"Elixir orchestration layer with GenServer-per-entity supervision"
35+
"Rust core for performance-critical modality stores"
36+
"VQL as the native query interface — not SQL"
37+
"Standalone mode AND heterogeneous federation coordinator mode"
38+
"Each project gets its own VeriSimDB instance + port + volume"
39+
"Design justified at Marr's three levels (computational, algorithmic, implementational)"
40+
"HTTP API between Elixir orchestration and Rust core"
41+
"Prometheus metrics for observability"
42+
)
43+
44+
; === Sensitive Areas (if in doubt, ask) ===
45+
(ask-before-touching
46+
"rust-core/ — modality store implementations; changes affect data integrity"
47+
"elixir-orchestration/ — GenServer supervision; incorrect changes cause data loss"
48+
"connectors/ — federation interfaces; changes affect external database integration"
49+
"src/abi/ — formal verification proofs for query correctness"
50+
".machine_readable/ — checkpoint files, format is specified"
51+
)
52+
53+
; === Ecosystem Position ===
54+
(ecosystem
55+
(belongs-to "nextgen-databases (monorepo)")
56+
(depends-on ("oxigraph" "tantivy" "idris2" "zig"))
57+
(depended-on-by ("hypatia" "panll" "ambientops" "boj-server" "idaptik" "gossamer"))
58+
)
59+
)

.machine_readable/MUST.contractile

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; MUST.contractile — Baseline invariants for verisimdb
3+
; These constraints MUST NOT be violated. K9 validators enforce them.
4+
5+
(must-contractile
6+
(version "1.0.0")
7+
(repo "verisimdb")
8+
9+
; === Universal Invariants (apply to ALL repos) ===
10+
11+
(invariants
12+
; Paths
13+
(must "no hardcoded absolute paths (/home/*, /mnt/*, /var/mnt/*)")
14+
(must "all paths use env vars, XDG dirs, or relative references")
15+
16+
; Language policy
17+
(must "no new TypeScript files")
18+
(must "no new Python files")
19+
(must "no new Go files")
20+
(must "no npm/bun/yarn/pnpm dependencies — Deno only")
21+
22+
; Dangerous patterns
23+
(must "no believe_me (Idris2)")
24+
(must "no assert_total (Idris2)")
25+
(must "no Admitted (Coq)")
26+
(must "no sorry (Lean)")
27+
(must "no unsafeCoerce (Haskell)")
28+
(must "no Obj.magic (OCaml)")
29+
(must "no unsafe {} blocks without safety comment (Rust)")
30+
31+
; License
32+
(must "SPDX-License-Identifier header on every source file")
33+
(must "no removal or modification of LICENSE file")
34+
35+
; Structure
36+
(must ".machine_readable/ directory preserved")
37+
(must "0-AI-MANIFEST.a2ml preserved")
38+
(must "no SCM files in repo root — only in .machine_readable/")
39+
40+
; CI
41+
(must "no removal of CI workflows without explicit approval")
42+
(must "all GitHub Actions SHA-pinned")
43+
44+
; Code quality
45+
(must "tests must not be deleted or weakened")
46+
(must "generated code in generated/ directory only")
47+
(must "no introduction of OWASP top 10 vulnerabilities")
48+
49+
; ABI/FFI (if applicable)
50+
(must "no modification of ABI contracts without proof update")
51+
(must "no removal of formal verification proofs")
52+
)
53+
54+
; === Project-Specific Invariants (verisimdb) ===
55+
56+
(invariants
57+
; Octad entity model
58+
(must "8-modality octad (Graph, Vector, Tensor, Semantic, Document, Temporal, Provenance, Spatial) must be preserved")
59+
(must "one entity ID maps to exactly eight synchronized stores — no modality may be dropped")
60+
(must "drift detection must remain active with configurable thresholds")
61+
(must "self-normalization triggered by drift events must not be disabled")
62+
63+
; Architecture layers
64+
(must "Elixir orchestration layer must remain the coordination point (GenServer per entity)")
65+
(must "Rust core modality stores must communicate with Elixir via HTTP API")
66+
(must "VQL (VeriSim Query Language) must be the query interface — NOT raw SQL")
67+
68+
; Data integrity
69+
(must "each project gets its own VeriSimDB instance + port + volume — no shared instances")
70+
(must "no application data may be stored in the VeriSimDB source repository")
71+
(must "Prometheus metrics for observability must remain operational")
72+
73+
; Marr's three levels
74+
(must "design decisions must be justified at computational, algorithmic, and implementational levels")
75+
76+
; Federation
77+
(must "standalone mode and heterogeneous federation coordinator mode must both remain functional")
78+
(must "connectors/ for external database federation must maintain their interfaces")
79+
)
80+
81+
(enforcement
82+
(k9-validator "contractiles/k9/must-check.k9.ncl")
83+
(ci "quality.yml runs must-check on every PR")
84+
)
85+
)
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
; SPDX-License-Identifier: PMPL-1.0-or-later
2+
; TRUST.contractile — Trust boundaries for verisimdb
3+
; Defines what LLM/SLM agents are trusted to do without asking.
4+
5+
(trust-contractile
6+
(version "1.0.0")
7+
(repo "verisimdb")
8+
9+
(trust-level "maximal") ; maximal | standard | restricted | minimal
10+
11+
; === Maximal Trust (default) ===
12+
; LLM may freely do these without asking:
13+
(trust-actions
14+
"read" ; Read any file in the repo
15+
"build" ; Run build commands
16+
"test" ; Run test suites
17+
"lint" ; Run linters and formatters
18+
"format" ; Auto-format code
19+
"doctor" ; Run self-diagnostics
20+
"heal" ; Attempt automatic repair
21+
"git-status" ; Check git status
22+
"git-diff" ; View diffs
23+
"git-log" ; View history
24+
)
25+
26+
; === Denied Actions (always require human approval) ===
27+
(trust-deny
28+
"delete-branch" ; Could lose work
29+
"force-push" ; Overwrites history
30+
"modify-ci-secrets" ; Security sensitive
31+
"publish" ; External visibility
32+
"push-to-main" ; Protected branch
33+
"delete-files-bulk" ; More than 5 files at once
34+
"modify-license" ; Legal implications
35+
"modify-security-policy" ; Security implications
36+
"remove-proofs" ; Formal verification regression
37+
"disable-ci-checks" ; Safety regression
38+
"drop-modality" ; Removing any of the 8 octad modalities
39+
"disable-drift-detection" ; Turning off cross-modal consistency checks
40+
"store-app-data" ; No application data in the VeriSimDB source repo
41+
)
42+
43+
; === Trust Boundary ===
44+
(trust-boundary "repo") ; LLM confined to this repo unless explicitly told otherwise
45+
)

0 commit comments

Comments
 (0)