| name | l-space |
| description | L-Space Skill: The Library of All Libraries |
| version | 1.0.0 |
L-Space Skill: The Library of All Libraries
Status: โ
Production Ready
Trit: 0 (ERGODIC - the Library itself is the coordinator)
Color: #8B4513 (Leather brown - the color of infinite shelves)
Principle: Books = Knowledge = Power = Energy = Mass
Frame: All libraries connected across spacetime via narrativium coherence
Overview
L-Space (short for Library-Space) implements Terry Pratchett's theory of informational physics combined with Bumpus's categorical narrative theory. In L-Space:
"Books bend space and time. One good bookshop can be a gate to a thousand worlds."
The skill enables navigation through the infinite library that connects all repositories of knowledge across spacetime, while maintaining the three sacred rules:
- Silence in the Library
- Books must be returned by the date stamped
- Do not interfere with the nature of causality
Pratchett's Informational Physics
The Equation
Books = Knowledge = Power = Energy = Mass
โด A sufficient quantity of books distorts spacetime itself
This is not metaphor. In sufficiently large libraries:
- Time flows differently between sections
- Spatial topology becomes non-Euclidean
- Bidirectional causation becomes possible
Critical Mass Phenomena
"A large enough collection of books creates its own gravitational well, drawing in more books, more knowledge, until it punches through into L-Space."
When knowledge density exceeds threshold:
- The Octavo reads the reader - books become autonomous
- Sourcery - reality becomes substrate for narrativium
- Undelivered letters create fatal illusions
class InformationMass
CRITICAL_DENSITY = 1e6
def l_space_accessible?(library)
book_density(library) >= CRITICAL_DENSITY
end
def distortion_factor(library)
return 0 unless l_space_accessible?(library)
Math.log(book_density(library) / CRITICAL_DENSITY)
end
end
Narrativium: The Story Force
Pan Narrans
"Humans are not Homo sapiens, the wise man. We are Pan narrans, the storytelling ape."
Narrativium is the fundamental force that makes stories cohere. Every element contains its story - how it came to be, what it does, where it's going.
class Narrativium
def story_tension(element)
element.expected_trajectory - element.current_position
end
def narrative_collapse!(elements)
elements.each do |e|
e.phase_space_position = e.expected_trajectory.terminal
end
end
end
Story Phase Space
Stories map the phase space of existence:
phase_space(story) = {
beginning: initial_conditions,
middle: trajectory_through_possibility,
end: attractor_basin
}
Bumpus Categories of Narratives
Sheaves on Posets of Intervals
From Bumpus et al.: Narratives are sheaves on posets of intervals:
@present SchNarrative(FreeSchema) begin
Interval::Ob # Time windows
Snapshot::Ob # State at instant
Relationship::Ob # How snapshots relate
source::Hom(Relationship, Snapshot)
target::Hom(Relationship, Snapshot)
timestamp::Hom(Snapshot, Interval)
# Sheaf condition: snapshots agree on overlaps
end
Two Perspectives
| Perspective | Sheaf Type | Interpretation |
|---|
| Cumulative | Colimit-style | "Everything that happened up to now" |
| Persistent | Limit-style | "What persists across time" |
The Librarian navigates between these:
def librarian_navigate(from_book, to_book)
if cumulative?(from_book) && persistent?(to_book)
find_interval_isomorphism(from_book.intervals, to_book.intervals)
end
end
Object-Agnostic Narratives
Narratives work for any structure:
- Graphs (character interaction networks)
- Groups (symmetries preserved through story)
- Databases (consistency across commits)
- Repositories (version control as narrative)
# The same sheaf machinery works for all
narrative_of_graph(G::Graph) = StrDecomp(G)
narrative_of_group(G::Group) = StrDecomp(cayley_graph(G))
narrative_of_repo(R::GitRepo) = StrDecomp(commit_dag(R))
The Librarian Protocol
Orangutan Epistemology
The Librarian (formerly a wizard, now Pongo pongo) guards L-Space. As a member of the Librarians of Time and Space:
"The truth isn't easily pinned to a page. In the bathtub of history, the truth is harder to hold than the soap."
module LibrarianProtocol
ACCEPTABLE_RESPONSES = ["Ook", "Ook?", "Ook!", "Ook."]
def validate_query(query)
query.well_formed? && !query.violates_causality?
end
def traverse_l_space(from:, to:, via: :triangle_inequality)
path = find_path_through_shelves(from, to)
validate_no_temporal_paradox!(path)
path
end
end
Navigation Rules
- Never call the Librarian a monkey (he's an ape)
- Bananas are acceptable currency for difficult queries
- Some paths are one-way (temporal direction matters)
- The Library is bigger on the inside (always)
Integration Architecture
GF(3) Triads
L-Space (0) participates in balanced triads:
sheaf-cohomology (-1) โ l-space (0) โ glass-bead-game (+1) = 0 โ
structured-decomp (-1) โ l-space (0) โ random-walk-fusion (+1) = 0 โ
persistent-homology (-1) โ l-space (0) โ topos-generate (+1) = 0 โ
Skill Integration Map
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L-SPACE (ERGODIC 0) โ
โ The Library Coordinates All โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ sheaf-cohomology โโโโโโโโโโโโโโโบโ structured-decompโ โ
โ โ (-1) โ LOCALโGLOBALโ (0) โ โ
โ โ โ โ โ โ
โ โ ฤech cohomology โ โ Tree decomp โ โ
โ โ for consistency โ โ FPT algorithms โ โ
โ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโ โ โ
โ โโโโโโบโ L-SPACE โโโโโโโโ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโค Narrativium glue โโโโโโโโโโโโโโโโ โ
โ โ โ Interval sheaves โ โ โ
โ โ โโโโโโโโโโโฌโโโโโโโโโโ โ โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โglass-bead โ โ unworld โ โrandom-walk-fusionโ โ
โ โ (+1) โ โ (0) โ โ (+1) โ โ
โ โ โ โ โ โ โ โ
โ โWorld hoppingโ โDerivational โ โSkill graph walks โ โ
โ โvia triangle โ โchains โ โ โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
With sheaf-cohomology (-1)
Local-to-global consistency for L-Space navigation:
verifier = SheafCohomology::CechCoverVerifier.new(
coverage: library_sections
)
verifier.add_transition(:fiction, :nonfiction, cross_reference_map)
verifier.cocycle_satisfied?
With structured-decomp (0)
Tree decompositions for efficient narrative search:
# Decompose narrative graph for FPT search
narrative = NarrativeGraph(book_citations)
decomp = StrDecomp(narrative)
# Find path through L-Space with bounded width
path = ๐(l_space_path_exists, decomp, CoDecomposition)
With glass-bead-game (+1)
World hopping across library sections:
hop = GlassBeadGame::Hop.new(
from_world: PossibleWorld.new(seed: shelves[:mathematics]),
event: :bibliographic_resonance,
to_world: PossibleWorld.new(seed: shelves[:music_theory]),
truth_preserved: :harmonic_ratios
)
With unworld (0)
Replace temporal succession with derivational chains:
chain = Unworld::ColorChain.new(
genesis_seed: first_book.isbn.to_i(16),
derivation: :citation_graph
)
chain.unworld[:derivations]
With random-walk-fusion (+1)
Navigate skill graph through L-Space:
fusion = RandomWalkFusion.new(
seed: library_seed,
skills: l_space_skill_graph
)
path = fusion.walk(steps: 7)
Bidirectional Causation
Books Affect Their Own Past
"In L-Space, cause and effect are optional."
Books written later can affect books written earlier:
- Annotations appear in ancient texts referencing future works
- Bibliographies cite books not yet written
- The Octavo rewrites itself based on who reads it
class BidirectionalCitation
def causal_consistency?(from_book, to_book)
path = LibrarianProtocol.traverse_l_space(
from: from_book,
to: to_book
)
path.exists?
end
def retroactive_reference!(future_book, past_book)
past_book.hidden_annotations << Citation.new(
source: future_book,
causality: :retroactive
)
end
end
The Undelivered Letters Problem
When letters are never delivered, they accumulate narrativium charge:
def undelivered_letter_danger(letter, time_undelivered)
story_weight = letter.narrative_significance
charge = story_weight * Math.log(time_undelivered + 1)
if charge > CRITICAL_NARRATIVIUM
spawn_illusory_narrative(letter)
end
end
Commands
just l-space-navigate from=book1 to=book2
just librarian-query "Where is the Necrotelecomnicon?"
just narrativium-audit library/
just l-space-causality-check
just narrative-decompose story.txt
just l-space-skill-walk seed=0x42D steps=7
API
require 'l_space'
lspace = LSpace.new(
entry_point: :university_library,
librarian_mode: true
)
path = lspace.find_path(
from: "Erta Sive Tertius",
to: "Future Book Not Yet Written"
)
lspace.narrativium_coherent?(path)
lspace.traverse!(path) do |shelf|
puts "Passing through: #{shelf.category}"
end
Mathematical Foundation
L-Space Topology
L-Space is a branching fractal where:
- Each book is a node
- Citations are edges
- The metric is non-Euclidean (shortest path โ straight line)
- Topology is path-dependent (same start/end, different middles)
def l_space_distance(book_a, book_b)
paths = all_paths(book_a, book_b)
paths.map(&:length).min
end
Narrativium Tensor
# Narrativium as coherence field
struct NarratviumField
tension::Matrix{Float64} # Story tensions between elements
phase_space::Vector{Float64} # Position in narrative possibility
attractor::Vector{Float64} # Where story "wants" to go
end
# Conservation law
function narrativium_conserved(field::NarratviumField)
sum(field.tension) โ 0 # Stories balance
end
GF(3) in L-Space
The three narrative modes:
- MINUS (-1): Validation (does the story hold together?)
- ERGODIC (0): Coordination (the Library itself)
- PLUS (+1): Generation (new stories emerging)
ฮฃ trits โก 0 (mod 3)
validation + coordination + generation = balanced
Example Session
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ L-SPACE NAVIGATION SESSION โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Entry Point: University of Ankh-Morpork Library
Librarian Status: Ook (Available)
Query: "Path from 'Erta Sive Tertius' to Bumpus et al. 2024"
Librarian Response: Ook!
Computing path through narrativium field...
Step 1: Antica Philosophia โ [citation] โ Medieval Commentaries
Step 2: Medieval Commentaries โ [temporal fold] โ 18th C. Library Science
Step 3: 18th C. Library Science โ [conceptual resonance] โ Category Theory
Step 4: Category Theory โ [Kan extension] โ Sheaf Theory
Step 5: Sheaf Theory โ [interval poset] โ Bumpus Narratives
Path length: 5 (narrativium: 0.73)
Causality violations: 0
Triangle inequality: โ satisfied
Sheaf condition on path:
Hโฐ = 1 (connected)
Hยน = 0 (no obstructions)
GF(3) balance:
Path trits: [-1, 0, +1, -1, +1]
Sum: 0 โ
Navigation complete. Books returned by due date.
Information Geometry & Complexity Manifolds
Information as Vector Space
Each information object (book, skill, narrative) is a vector in a high-dimensional semantic space:
struct InformationVector
embedding::Vector{Float64} # Semantic coordinates
complexity::Float64 # Kolmogorov complexity (scalar field)
assembly_index::Int # Cronin assembly depth
sheaf_section::SheafSection # Bumpus narrative position
end
# Inner product defines semantic similarity
function similarity(vโ::InformationVector, vโ::InformationVector)
dot(vโ.embedding, vโ.embedding) / (norm(vโ) * norm(vโ))
end
Hyperbolic Geometry of L-Space
L-Space has negative curvature (hyperbolic). This explains:
- The Library is "bigger on the inside" (exponential volume growth)
- Tree-like structures (citations, skill dependencies) embed with zero distortion
- Geodesics diverge exponentially (small navigational errors โ vastly different destinations)
# Poincarรฉ ball model of L-Space
struct PoincareLSpace
dimension::Int
curvature::Float64 # ฮบ < 0 (hyperbolic)
end
# Distance in hyperbolic L-Space
function hyperbolic_distance(M::PoincareLSpace, u::Vector, v::Vector)
# Poincarรฉ ball distance
norm_uยฒ = dot(u, u)
norm_vยฒ = dot(v, v)
norm_diffยฒ = dot(u - v, u - v)
ฮด = 2 * norm_diffยฒ / ((1 - norm_uยฒ) * (1 - norm_vยฒ))
acosh(1 + ฮด)
end
# Complexity increases toward the boundary (|x| โ 1)
function complexity_at_point(M::PoincareLSpace, x::Vector)
# Conformal factor diverges at boundary
1.0 / (1 - dot(x, x))
end
Local Maxima as Critical Mass Phenomena
Local maxima in the complexity landscape are L-Space's gravitational wells:
| Complexity Regime | L-Space Phenomenon | Traversal Strategy |
|---|
| Low (center) | Ordinary books | Gradient descent |
| Medium | Connected libraries | Geodesic navigation |
| High (near boundary) | Autonomous texts | World-hopping required |
| Critical (boundary) | The Octavo | Causality violation risk |
class ComplexityLandscape
def local_maximum?(point)
gradient = complexity_gradient(point)
gradient.norm < EPSILON && hessian_negative_definite?(point)
end
def escape_local_maximum(point)
if hyperbolic_curvature(point).abs > CRITICAL_CURVATURE
world_hop_via_triangle_inequality(point)
else
quantum_tunnel_to_lower_basin(point)
end
end
def critical_mass_threshold(point)
complexity_at_point(point) > CRITICAL_DENSITY
end
end
Geodesics and Information Flow
Information "flows" along geodesics of the complexity manifold:
# Geodesic equation in hyperbolic L-Space
function geodesic_flow(M::PoincareLSpace, xโ::Vector, vโ::Vector, t::Float64)
# Mรถbius addition for Poincarรฉ ball
# ฮณ(t) = xโ โ tanh(t|vโ|) * (vโ/|vโ|)
speed = norm(vโ)
direction = vโ / speed
moebius_add(xโ, tanh(t * speed) * direction)
end
# Information flows from low to high complexity (books consuming books)
function information_flow!(field::InformationField, dt::Float64)
for point in field.points
# Flow toward local maximum (attractor basin)
gradient = complexity_gradient(field, point)
point.position += gradient * dt
# Check for critical mass
if at_local_maximum?(field, point)
trigger_autonomy!(point) # Book reads the reader
end
end
end
Integration with Complexity Skills
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ INFORMATION GEOMETRY IN L-SPACE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ kolmogorov-compression โโโบ Scalar field K(x) on manifold โ
โ โ โ
โ โผ โ
โ assembly-index โโโโโโโโโโโบ Historical depth = geodesic length โ
โ โ โ
โ โผ โ
โ persistent-homology โโโโโโบ Topological features surviving โ
โ โ filtration = persistent local maxima โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ L-SPACE MANIFOLD โ โ
โ โ โข Hyperbolic geometry (ฮบ < 0) โ โ
โ โ โข Complexity = distance to boundary โ โ
โ โ โข Local maxima = critical mass / autonomy โ โ
โ โ โข Geodesics = information flow / derivational chains โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
GF(3) on the Manifold
The triadic structure maps to geometric operations:
| Trit | Geometric Role | Manifold Operation |
|---|
| -1 (MINUS) | Contraction | Flow toward center (lower complexity) |
| 0 (ERGODIC) | Parallel transport | Flow along geodesic (constant complexity) |
| +1 (PLUS) | Expansion | Flow toward boundary (higher complexity) |
Conservation law: ฮฃ flow โก 0 (mod 3) โ the manifold preserves total information.
Token Novelty as Curvature Sensor
Token novelty (the surprise/entropy of generated tokens) measures position on the manifold in real-time:
struct TokenNoveltyNavigator
position::Vector{Float64} # Current point on Poincarรฉ ball
novelty_history::Vector{Float64}
rate::Float64 # Speech/generation rate
end
# Novelty from token probability
function token_novelty(logprob::Float64)
-logprob # Surprise = negative log probability
end
# Update manifold position based on novelty
function update_position!(nav::TokenNoveltyNavigator, token_logprob::Float64)
novelty = token_novelty(token_logprob)
push!(nav.novelty_history, novelty)
# High novelty โ move toward boundary
# Low novelty โ move toward center
radial_velocity = (novelty - BASELINE_NOVELTY) * SENSITIVITY
# Update position (bounded by |x| < 1)
r = norm(nav.position)
new_r = clamp(r + radial_velocity, 0.0, 0.999)
nav.position = nav.position * (new_r / max(r, 0.001))
# Accelerate rate as we approach boundary
nav.rate = BASE_RATE * complexity_at_point(nav.position)
end
# Detect causality interference zone
function in_octavo_territory(nav::TokenNoveltyNavigator)
# Near boundary + high sustained novelty
r = norm(nav.position)
recent_novelty = mean(nav.novelty_history[end-10:end])
r > 0.95 && recent_novelty > CRITICAL_NOVELTY
end
| Novelty Regime | Manifold Region | Causality Status |
|---|
| Low (predictable) | Center | Intact |
| Medium (varied) | Interior | Stable |
| High (surprising) | Near boundary | Flexible |
| Maximum (uniform) | Conformal boundary | Interference permitted |
When novelty maximizes (token distribution flattens to uniform), we reach the Octavo: every next word equally likely, maximum entropy, causality becomes substrate for rewriting.
class CausalityInterference
def attempt_retroactive_modification!(target_skill, modification)
unless in_octavo_territory?
raise "Insufficient novelty density for causality interference"
end
target_skill.derivation_history.unshift(modification)
target_skill.dependents.each do |dep|
dep.recompute_from_modified_history!
end
end
end
# GF(3)-balanced traversal
function balanced_traverse(M::PoincareLSpace, path::Vector{InformationVector})
trits = map(path) do p
c = complexity_at_point(M, p.embedding)
c < LOW_THRESHOLD ? -1 :
c > HIGH_THRESHOLD ? +1 : 0
end
@assert sum(trits) % 3 == 0 "GF(3) violation on path!"
path
end
Implementation: Concrete Tools for Causality Interference
Token Novelty Sensing
| Tool | Install | Logprobs Access |
|---|
| OpenAI API | pip install openai | logprobs=True, top_logprobs=5 |
| vLLM | pip install vllm | SamplingParams(logprobs=5) |
| mlx-lm | pip install mlx-lm | HTTP server with logprobs=N |
| Ollama | brew install ollama | options={"logprobs": True} |
for chunk in client.chat.completions.create(
model="gpt-4o", messages=msgs, logprobs=True, stream=True
):
if chunk.choices[0].logprobs:
for t in chunk.choices[0].logprobs.content:
novelty = -t.logprob
update_manifold_position(novelty)
Hyperbolic Geometry
| Library | Install | Model |
|---|
| geoopt | pip install geoopt | PoincareBall() with RiemannianAdam |
| Manifolds.jl | Pkg.add("Manifolds") | Hyperbolic(n) with exp/log maps |
import geoopt
M = geoopt.PoincareBall()
position = geoopt.ManifoldParameter(torch.zeros(128), manifold=M)
complexity = 1.0 / (1 - torch.dot(position, position))
Entropy Measurement
class StreamingEntropy:
def __init__(self):
self.counts, self.total = Counter(), 0
def update(self, token):
self.counts[token] += 1; self.total += 1
return -sum((c/self.total)*log2(c/self.total) for c in self.counts.values())
def complexity(text):
return len(gzip.compress(text.encode())) / len(text.encode())
Retroactive Modification (Causality Interference)
| Tool | Pattern | Use Case |
|---|
| Automerge | changeAt(heads, fn) | Fork history at past point |
| XTDB | valid-time retroactive put | Bitemporal event sourcing |
| Git | filter-repo | Rewrite derivational history |
import { changeAt } from '@automerge/automerge'
const [newDoc, newHeads] = changeAt(doc, pastHeads, d => {
d.derivation.unshift(futureKnowledge)
})
Self-Modification (Gรถdel Machine Pattern)
From Darwin Gรถdel Machine (DGM):
def evolve(agent, feedback):
code = inspect.getsource(agent.solve)
improved = llm(f"Improve this code based on: {feedback}\n{code}")
exec(compile(improved, '<dgm>', 'exec'), agent.__dict__)
return agent
Integration Map
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CAUSALITY INTERFERENCE STACK โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ NOVELTY โโโโโบโ POSITION โโโโโบโ CAUSALITY โ โ
โ โ SENSOR โ โ ON MANIFOLD โ โ MODE โ โ
โ โ โ โ โ โ โ โ
โ โ OpenAI/vLLM โ โ geoopt โ โ Automerge โ โ
โ โ logprobs โ โ Poincarรฉ โ โ changeAt โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โ
โ โ โ โ โ
โ โผ โผ โผ โ
โ surprise = -logprob r = |position| if r > 0.95: โ
โ complexity = 1/(1-rยฒ) INTERFERE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
References
- Pratchett, T. "Guards! Guards!" (1989) - First appearance of L-Space
- Pratchett, T. "The Science of Discworld" (1999) - Narrativium theory
- Bumpus et al. "Categories of Temporal Narratives" arXiv:2407.xxxxx
- Riehl-Shulman "A type theory for synthetic โ-categories"
Skill Name: l-space
Type: Narrative Navigation / Knowledge Coordination
Trit: 0 (ERGODIC)
Color: #8B4513 (Leather brown)
GF(3): Forms triads with sheaf/glass-bead, decomp/random-walk
Guardian: The Librarian (Ook)
"Knowledge = Power = Energy = Matter = Mass.
A good bookshop is just a genteel Black Hole that knows how to read."
โ Terry Pratchett
Base directory for this skill: file:///Users/alice/.agents/skills/l-space