Skip to content

Commit f200330

Browse files
hyperpolymathclaude
andcommitted
chore(6a2): commit 6a2 sweep — lithoglyph, quandledb, typeql-exp, verisim-core, verisimdb
43 AGENTIC/ECOSYSTEM/META/NEUROSYM/PLAYBOOK/STATE files across the nextgen-databases sub-projects, converted from SCM format by a prior session. All were in the working tree but never staged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3b75ecf commit f200330

22 files changed

Lines changed: 598 additions & 1584 deletions

File tree

Lines changed: 34 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,34 @@
1-
;; SPDX-License-Identifier: PMPL-1.0-or-later
2-
;; SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell (hyperpolymath)
3-
;;
4-
;; AGENTIC.scm - AI agent interaction patterns for Lithoglyph
5-
;; Media-Type: application/x-scheme
6-
7-
(define-module (lithoglyph agentic)
8-
#:version "1.0.0"
9-
#:updated "2026-03-13T00:00:00Z")
10-
11-
;; ============================================================================
12-
;; AUTONOMOUS AGENTS
13-
;; ============================================================================
14-
15-
(define autonomous-agents
16-
'((journal-replay-agent
17-
(role . "Autonomous journal replay and block recovery")
18-
(capabilities
19-
"- Monitor WAL (Write-Ahead Log) for uncommitted transactions
20-
- Replay journal entries after crash recovery
21-
- Verify block integrity via Forth kernel checksums
22-
- Escalate unrecoverable blocks to human operator")
23-
(decision-making
24-
(rules
25-
"IF wal.uncommitted > 0 AND last_crash < 5min THEN replay_journal
26-
IF block.checksum_mismatch THEN quarantine_block AND alert
27-
IF journal.entries > threshold THEN compact_journal
28-
IF replay.failure_count > 3 THEN escalate_to_operator")
29-
(constraints
30-
"- Must not modify blocks directly — always go through core-zig bridge
31-
- Must not skip WAL entries — strict sequential replay
32-
- Must verify Idris2 ABI invariants after replay"))
33-
(implementation
34-
(language . "Elixir GenServer")
35-
(planned-file . "lith-http/lib/lith_http/agents/journal_replay_agent.ex")))
36-
37-
(normalizer-agent
38-
(role . "Autonomous normalization and functional dependency discovery")
39-
(capabilities
40-
"- Run Lean 4 normalization proofs on schema changes
41-
- Discover functional dependencies via Factor GQL runtime
42-
- Suggest schema improvements based on FD analysis
43-
- Verify normalization forms (1NF through BCNF)")
44-
(decision-making
45-
(rules
46-
"IF schema.change THEN verify_normalization_proofs
47-
IF fd.violation THEN suggest_decomposition
48-
IF normalization.level < BCNF THEN flag_warning")
49-
(constraints
50-
"- No sorry in Lean 4 proofs — all must be constructive
51-
- FD discovery must complete within 30 seconds
52-
- Schema suggestions are advisory — never auto-apply"))
53-
(implementation
54-
(language . "Lean 4 + Factor")
55-
(files "normalizer/" "core-factor/")))
56-
57-
(provenance-agent
58-
(role . "Audit trail and narrative provenance tracking")
59-
(capabilities
60-
"- Record every mutation as a narrative event
61-
- Build provenance chains with causal links
62-
- Generate audit reports for compliance
63-
- Detect provenance gaps or inconsistencies")
64-
(decision-making
65-
(rules
66-
"IF mutation.provenance = null THEN reject_mutation
67-
IF provenance.chain.broken THEN alert AND quarantine
68-
IF audit.request THEN generate_full_trace")
69-
(constraints
70-
"- Every mutation MUST have provenance — no exceptions
71-
- Provenance records are append-only — never delete
72-
- Audit reports must include cryptographic hashes"))
73-
(implementation
74-
(language . "Elixir + Idris2")
75-
(planned-file . "lith-http/lib/lith_http/agents/provenance_agent.ex")))))
76-
77-
;; ============================================================================
78-
;; AI AGENT INTERACTION PATTERNS
79-
;; ============================================================================
80-
81-
(define ai-interaction-patterns
82-
'((code-generation
83-
(style . "conservative")
84-
(notes
85-
"- Lithoglyph spans 6+ languages — agents must respect each language's idioms
86-
- Forth: stack-based, minimal comments, test with gforth
87-
- Zig: explicit memory management, SAFETY comments on all unsafe casts
88-
- Idris2: dependent types, zero believe_me, formal proofs
89-
- Factor: concatenative, vocabulary-based
90-
- Lean 4: tactic proofs, no sorry
91-
- Elixir: OTP patterns, GenServer, supervision trees"))
92-
93-
(refactoring
94-
(style . "conservative")
95-
(notes
96-
"- IP rename (Lith/Form → Litho/Lithoglyph) is a coordinated effort
97-
- Never refactor bridge.zig — it is the canonical implementation
98-
- ffi/zig/ ONLY delegates to core-zig — never add logic there
99-
- Always verify Idris2 ABI type-checks after any change"))
100-
101-
(testing
102-
(style . "comprehensive")
103-
(notes
104-
"- core-forth: gforth test/lithoglyph-tests.fs (17 tests)
105-
- core-zig: zig build test
106-
- ffi/zig: zig build test
107-
- normalizer: lake build (52 Lean proofs)
108-
- Idris2 ABI: idris2 --check each file
109-
- BEAM Rust NIF: cargo build
110-
- BEAM Zig NIF: zig build
111-
- lith-http: mix test"))
112-
113-
(constraints
114-
(languages-allowed "forth" "zig" "idris2" "lean4" "factor" "elixir" "rust" "rescript" "nickel")
115-
(languages-banned "typescript" "go" "python" "java" "node")
116-
(patterns-banned "believe_me" "assert_total" "sorry" "unsafePerformIO" "Admitted")
117-
(tools-banned "npm" "docker" "makefile"))))
118-
119-
;; ============================================================================
120-
;; HYPATIA INTEGRATION
121-
;; ============================================================================
122-
123-
(define hypatia-integration
124-
'((scanner-config
125-
(workflow . ".github/workflows/hypatia-scan.yml")
126-
(rules
127-
"- believe_me detection (Idris2) — CRITICAL severity
128-
- sorry detection (Lean 4) — CRITICAL severity
129-
- unsafe Zig casts without SAFETY comment — HIGH severity
130-
- SQL injection patterns — CRITICAL severity
131-
- Hardcoded secrets — CRITICAL severity"))
132-
(gitbot-fleet
133-
(bots "rhodibot" "echidnabot" "sustainabot")
134-
(auto-fix-confidence-threshold . 0.85)
135-
(requires-human-review "believe_me elimination" "ABI changes" "bridge modifications"))))
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# AGENTIC.a2ml — AI agent constraints and capabilities
5+
[metadata]
6+
version = "0.1.0"
7+
last-updated = "2026-04-11"
8+
9+
[agent-permissions]
10+
can-edit-source = true
11+
can-edit-tests = true
12+
can-edit-docs = true
13+
can-edit-config = true
14+
can-create-files = true
15+
16+
[agent-constraints]
17+
# What AI agents must NOT do:
18+
# - Never use banned language patterns (believe_me, unsafeCoerce, etc.)
19+
# - Never commit secrets or credentials
20+
# - Never use banned languages (TypeScript, Python, Go, etc.)
21+
# - Never place state files in repository root (must be in .machine_readable/)
22+
# - Never use AGPL license (use PMPL-1.0-or-later)
23+
24+
[maintenance-integrity]
25+
fail-closed = true
26+
require-evidence-per-step = true
27+
allow-silent-skip = false
28+
require-rerun-after-fix = true
29+
release-claim-requires-hard-pass = true
30+
31+
[automation-hooks]
32+
# on-enter: Read 0-AI-MANIFEST.a2ml, then STATE.a2ml
33+
# on-exit: Update STATE.a2ml with session outcomes
34+
# on-commit: Run just validate-rsr
Lines changed: 19 additions & 170 deletions
Original file line numberDiff line numberDiff line change
@@ -1,173 +1,22 @@
1-
;; SPDX-License-Identifier: PMPL-1.0-or-later
2-
;; ECOSYSTEM.scm - Ecosystem position for Lith
3-
;; Media-Type: application/vnd.ecosystem+scm
4-
5-
(ecosystem
6-
(version "1.0")
7-
(name "Lith")
8-
(naming-note "Temporary name - 'Lith' is Google-owned trademark. Final name TBD before v1.0.0")
9-
(type "database-engine")
10-
(purpose "Narrative-first, reversible, audit-grade database for domains
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# ECOSYSTEM.a2ml — Lithoglyph ecosystem position
5+
[metadata]
6+
version = "1.0"
7+
last-updated = "2026-04-11"
8+
9+
[project]
10+
name = "Lithoglyph"
11+
purpose = "Narrative-first, reversible, audit-grade database for domains
1112
where provenance, auditability, and human understanding matter
12-
more than raw performance.")
13-
14-
(position-in-ecosystem
15-
(category "Databases")
16-
(subcategory "Multi-Model / Document-Graph Hybrid")
17-
(unique-value
18-
"Provenance-native: Every mutation requires actor + rationale"
19-
"Reversible: Append-only journal with inverses for any operation"
20-
"Narrative: Schemas, constraints, migrations are human-readable artefacts"
21-
"Self-normalizing: Discovers FDs and proposes schema improvements with proofs"
22-
"Audit-grade: Complete history from genesis, time-travel queries"))
23-
24-
(related-projects
25-
;; Core ecosystem - Sibling projects
26-
(gql-dt
27-
(relationship "sibling-language")
28-
(repo "github.com/hyperpolymath/gql-dt")
29-
(status "implementation-in-progress")
30-
(completion 75)
31-
(description "GQLdt: Dependently-Typed Lith Query Language. Lean 4 implementation
32-
with compile-time type checking, refinement types, and proof-carrying
33-
migrations. Two-tier design: GQLdt (admin) and GQL (user-friendly).")
34-
(tech-stack "Lean 4 + Idris2 ABI + Zig FFI + ReScript bindings")
35-
(integration-points
36-
(type-system "BoundedNat, BoundedInt, NonEmptyString, Confidence, PromptScores")
37-
(provenance "ActorId, Rationale, Timestamp, Tracked types")
38-
(serialization "CBOR proof blobs, JSON API, binary storage")
39-
(parser "Complete parser for INSERT/SELECT/UPDATE/DELETE with type inference")
40-
(permissions "Two-tier permission system with TypeWhitelist"))
41-
(alignment-status
42-
(fundep-types "Lith should adopt schema-bound FunDep S type from gql-dt")
43-
(proofs "Waiting for gql-dt M7 (Idris2 ABI) + M8 (Zig FFI)")
44-
(bindings "Waiting for gql-dt M9 (ReScript bindings)")
45-
(ffi "Compatible - both use CBOR-encoded proof blobs via Zig FFI")))
46-
47-
(formbase
48-
(relationship "sibling-application")
49-
(repo "github.com/hyperpolymath/formbase")
50-
(status "ui-prototype")
51-
(completion 30)
52-
(description "Open-source Airtable alternative built on Lith. Spreadsheet-database
53-
hybrid with provenance by default, full reversibility, PROMPT scores,
54-
and multi-view support (Grid/Kanban/Calendar/Gallery/Form).")
55-
(tech-stack "Gleam/BEAM backend + ReScript+React UI + Yjs CRDT + WebSocket")
56-
(dependency "Requires Lith language bindings (M12) for integration")
57-
(roadmap "v0.1.0 Core Grid view in progress"))
58-
59-
(lithoglyph-studio
60-
(relationship "sibling-tool")
61-
(repo "github.com/hyperpolymath/lithoglyph-studio")
62-
(status "planned")
63-
(description "Zero-friction admin GUI for Lith. Visual schema designer,
64-
GQL query builder, provenance explorer, journal viewer, and
65-
normalization proof visualizer."))
66-
67-
(lithoglyph-debugger
68-
(relationship "sibling-tool")
69-
(repo "github.com/hyperpolymath/lithoglyph-debugger")
70-
(status "scaffolding-complete")
71-
(completion 35)
72-
(description "Proof-carrying debugger. Step through GQL queries, inspect
73-
constraint violations, visualize normalization proofs, and
74-
explore journal replay scenarios.")
75-
(alignment-status
76-
(journal-types "Need Migration/NormalizationStep entry types from Lith")
77-
(provenance "Need Confidence + ProofBlob types from gql-dt")
78-
(proofs "LosslessProof stubs need real Lean 4 implementations")))
79-
80-
(lithoglyph-analytics
81-
(relationship "sibling-extension")
82-
(repo "github.com/hyperpolymath/lithoglyph-analytics")
83-
(status "planned")
84-
(description "Analytics layer for Lith. OLAP-style queries, time-series
85-
analysis, provenance-aware aggregations."))
86-
87-
(lithoglyph-beam
88-
(relationship "sibling-integration")
89-
(repo "github.com/hyperpolymath/lithoglyph-beam")
90-
(status "planned")
91-
(description "Erlang/BEAM ecosystem integration. Native Elixir/Gleam bindings,
92-
OTP supervision tree, distributed Lith clusters."))
93-
94-
(lithoglyph-geo
95-
(relationship "sibling-extension")
96-
(repo "github.com/hyperpolymath/lithoglyph-geo")
97-
(status "planned")
98-
(description "Geospatial extensions for Lith. PostGIS-style spatial types,
99-
indexes, and queries with provenance tracking."))
100-
101-
(zotero-lith
102-
(relationship "sibling-integration")
103-
(repo "github.com/hyperpolymath/zotero-lith")
104-
(status "planned")
105-
(description "Zotero plugin for Lith. Academic reference management with
106-
provenance tracking, DOI linking, and citation graphs."))
107-
108-
;; External inspirations and comparisons
109-
(datomic
110-
(relationship "inspiration")
111-
(description "Immutable database with time-travel. Lith shares the
112-
immutability philosophy but adds provenance and narrative."))
113-
114-
(arangodb
115-
(relationship "comparison")
116-
(description "Multi-model database (document + graph). Lith is similar
117-
but prioritizes auditability over performance."))
118-
119-
(sqlite
120-
(relationship "comparison")
121-
(description "Embedded database. Lith aims for similar simplicity
122-
but with built-in versioning and provenance."))
123-
124-
(event-sourcing
125-
(relationship "pattern-inspiration")
126-
(description "Lith's journal is conceptually similar to event sourcing
127-
but with first-class inverses and provenance."))
128-
129-
(git
130-
(relationship "philosophy-inspiration")
131-
(description "Content-addressable, append-only, complete history.
132-
Lith applies git's philosophy to structured data.")))
133-
134-
(target-domains
135-
(investigative-journalism
136-
"Track sources, verify claims, maintain evidence chains.
137-
Every fact has provenance. Retractions are reversible corrections.")
138-
139-
(governance-and-policy
140-
"Audit trails for decisions. Who approved what, when, why.
141-
Regulation compliance with explainable constraints.")
142-
143-
(agentic-ecosystems
144-
"AI agents need to explain their reasoning. Lith provides
145-
the audit infrastructure for accountable AI systems.")
146-
147-
(archives-and-preservation
148-
"Long-term data preservation with complete provenance.
149-
Future researchers can trace every change.")
150-
151-
(scientific-research
152-
"Reproducibility requires knowing exactly what data existed when.
153-
Time-travel queries reconstruct historical states."))
13+
more than raw performance."
14+
role = "database-engine"
15415

155-
(what-this-is
156-
"A database engine that treats data history as sacred"
157-
"A query language (GQL/GQLdt) designed for provenance and narrative"
158-
"A storage format (blocks + journal) optimized for auditability"
159-
"A philosophy: databases should explain themselves"
160-
"An ecosystem of tools for narrative-first data management"
161-
"Layered architecture: Forth (storage) + Zig (FFI) + Factor (runtime) + Elixir (clustering)"
162-
"Integration with formal methods: Lean 4 via gql-dt for proof-carrying migrations"
163-
"Open source under PMPL-1.0-or-later (Palimpsest License)")
16+
[position-in-ecosystem]
17+
category = "Databases"
16418

165-
(what-this-is-not
166-
"Not a drop-in SQL replacement (GQL is intentionally different)"
167-
"Not optimized for OLAP workloads (narrative overhead, use lithoglyph-analytics for that)"
168-
"Not a distributed database yet (single-node PoC complete, clustering in M14)"
169-
"Not a real-time streaming platform (use CDC integration for streaming)"
170-
"Not a full-text search engine (integrate with Meilisearch/Typesense)"
171-
"Not a time-series database (different access patterns, use InfluxDB/TimescaleDB)"
172-
"Not trying to be the fastest database (auditability > performance)"
173-
"Not called 'Lith' - that's Google's trademark (final name TBD before v1.0.0)"))
19+
[related-projects]
20+
projects = [
21+
# No related projects recorded
22+
]

0 commit comments

Comments
 (0)