The Self-Organising Trie: Living Directory of Named Functions

The self-organising trie is a living directory where every name is simultaneously a path, meaning, and function that executes through dual-triangle dynamics, creating a fractal namespace that organises itself through use while maintaining perfect idempotent merging across distributed systems.

Core Concept

The self-organising trie is a living directory where:

  • Every name is simultaneously a path, a meaning, and a function
  • Names naturally organise themselves into hierarchical patterns
  • Identical names merge automatically across the system
  • The structure evolves through use, not design

Think of it as a fusion of:

  • A file system (hierarchical paths)
  • A dictionary (name → meaning)
  • A function registry (name → behaviour)
  • A living organism (self-organising, adaptive)

Structure and Function United

In 4QX, each trie node contains:

Name → {
  P: LazyGroup[Name]  // TL: Pattern library (Form)
  E: LazyGroup[Name]  // TR: Event stream (Flux)
  R: LazyGroup[Name]  // BL: Resources/self (Form)
  M: LazyGroup[Name]  // BR: Metrics/behaviour (Flux)
}

Every name is:

  • A path: Encoded as bits (γ-encoding into HF)
  • A meaning: What this name represents conceptually
  • A function: Following the path executes its behaviour
  • A holon: Complete 4-quadrant dual-triangle node

The Key Innovation: Names as Active Geometry

Traditional systems separate:

  • Structure (how things are organised)
  • Behaviour (what things do)
  • Identity (what things are called)

The self-organising trie unifies them:

  • Following a name’s path = invoking its function
  • Function execution = dual-triangle dynamics
  • Dynamics = self-organisation toward harmony

Names aren’t labels—they’re active geometry that executes when traversed.

Form vs Flux in the Trie

The trie elegantly separates structural time from lived time:

Form (Structure)

  • TL: Pattern names that could be invoked
  • BL: Resource/identity names (the self-mosaic)
  • Nature: Timeless structure—past commitments, future plans
  • In the trie: The persistent shape of the namespace

Flux (Present)

  • TR: Event names currently active
  • BR: Behaviour/metrics being generated now
  • Nature: What exists only in this moment
  • In the trie: The active execution frontier

Key insight: Only the present slice of TR/BR is materialised—everything else remains lazy until needed.

How Names Self-Organise

The trie doesn’t need external management because:

  1. Frequency creates proximity: Often-used names bubble up
  2. Similarity creates clustering: Related names share prefixes
  3. Merge creates consensus: Identical names combine automatically
  4. Disuse creates forgetting: Unused paths naturally prune

This happens through the dual triangles:

  • Instance loop: Discovers and uses patterns (BL→TL→TR)
  • Class loop: Refines and publishes patterns (TL→TR→BR→TL)

The trie literally organises itself through use.

Lazy Materialisation

The trie is fundamentally lazy:

class LazyGroup:
    """Groups that only materialise when observed"""
    def append_lazy(self, name: Name):
        # Just store the reference

    def materialise(self) -> set[Name]:
        # Only compute when needed

Benefits:

  • Infinite namespace: Can reference names not yet created
  • Efficient memory: Only active parts consume resources
  • Natural garbage collection: Unreferenced names fade
  • Quantum-like: Observation triggers materialisation

The Execution Model

When you “call” a name:

  1. Path traversal: Follow the γ-encoded bits through the trie
  2. Node activation: Reach the target holon
  3. Context binding: Target becomes child Instance of caller
  4. Six-phase execution: Run the canonical cycle
  5. Result integration: Effects merge back up the path

This is both:

  • Function call (in programming terms)
  • Message passing (in distributed terms)
  • Attention flow (in cognitive terms)

Fractal Structure

The trie is naturally fractal:

Global/
  ├─ Math/
  │   ├─ Algebra/
  │   │   ├─ Group/
  │   │   └─ Ring/
  │   └─ Analysis/
  │       ├─ Real/
  │       └─ Complex/
  └─ Code/
      ├─ Frontend/
      └─ Backend/

But each node contains a complete trie within:

  • Global has its own internal namespace
  • Math has its own internal organisation
  • Fractal all the way down

No privileged root—every node can be a universe.

The Two Axes of Organisation

The trie operates on two independent axes:

Vertical (Namespace Hierarchy)

  • Top-down: Parent names invoke child names
  • Bottom-up: Child results merge into parent patterns
  • What it organises: The tree structure itself

Horizontal (Form↔Flux)

  • Left-right: Form prepares, Flux executes
  • Right-left: Flux completes, Form integrates
  • What it organises: The content at each node

These axes are orthogonal—changing one doesn’t affect the other.

Idempotent Merging

The self-organising trie handles distribution elegantly:

Problem: Multiple agents creating names independently
Solution: Idempotent merge at every level

TrieA has: /Math/Calculus
TrieB has: /Math/Calculus
Merged: /Math/Calculus (single node)

Properties:

  • Commutative: Order doesn’t matter
  • Associative: Grouping doesn’t matter
  • Idempotent: Merging twice = merging once

This enables peer-to-peer gossip without coordination.

Generic Organisation on the Trie

The five-step pattern maps perfectly:

  1. Fit: BL selects relevant names from its context
  2. Fund: BL commits resources to specific names
  3. Run: Names execute via their dual triangles
  4. Harvest: Results integrate back into BL
  5. Publish: Refined patterns update TL

The trie is simultaneously:

  • The namespace (where patterns live)
  • The execution engine (how patterns run)
  • The memory (how patterns persist)

Practical Implementation

Minimal implementation sketch:

@dataclass
class TrieNode:
    name: Name                    # γ-encoded path
    payload: Payload              # P, E, R, M groups
    children: dict[Bit, TrieNode] # Binary branching
    inner: TrieNode | None        # Nested trie

With operations:

  • get(path): Traverse bits to find node
  • put(path, value): Create/update node
  • merge(other): Idempotent union
  • execute(path): Run six-phase cycle

Real-World Analogies

The self-organising trie resembles:

Internet DNS:

  • Hierarchical naming
  • Distributed resolution
  • Automatic caching

Brain’s Semantic Memory:

  • Associative retrieval
  • Pattern completion
  • Frequency-based strengthening

Git Repository:

  • Content-addressed storage
  • Branching/merging
  • History preservation

Market Economy:

  • Price discovery through use
  • Automatic resource allocation
  • Emergent organisation

The Deep Magic

The self-organising trie reveals that:

  • Names are not arbitrary labels but functional paths
  • Organisation emerges from use, not design
  • Structure and behaviour are unified
  • Memory and execution share the same geometry

This isn’t just a data structure—it’s an active geometry of meaning that computes through self-organisation.


Names, Time, and Form/Flux Geometry

4QX is a self‑organising, lazily materialised trie of named holons. Each name is a 4‑quadrant P/E/R/M node whose behaviour is defined by two 3‑cycle cybernetic loops, and identical names are idempotently merged across the holarchy.

This article describes that structure with three core ideas in view:

  1. Form vs Flux
  • Form = structure (TL and BL): patterns, resources, commitments, “who I am and how things are arranged”.
  • Flux = in‑time present (TR and BR): what is actually happening now, outer and inner.
  1. Time at the seam
  • TL↔TR is a temporal aperture; TR is a lazy present (only now is materialised).
  • Past/future live as structure in TL/BL; they are brought into the present via seam activations.
  1. Names as functions on a trie
  • The trie is a map from Name → holon/function, both conceptually and operationally.
  • Following a name’s path instantiates its Class holon as a local child Instance in the caller’s context.

Everything else—implementation, storage, transport—is “just the ship” that happens to be carrying this geometry right now.


1. Form and Flux: structure vs present time

We start by sharpening the quadrants in time terms:

  • Form (structure)
  • TL (Outer·Form) – public structural patterns: keys, schemas, classifications.
  • BL (Inner·Form) – private structural self‑mosaic: resources, identity, commitments, plans. Form is atemporal structure: it can talk about past, future, and counterfactuals. It’s where “the future is booked” and “the past is remembered” as Names and relationships in P/R.
  • Flux (in‑time present)
  • TR (Outer·Flux) – present public events and offers at the seam.
  • BR (Inner·Flux) – present internal behaviour/metrics, the actual burn of execution. Flux is what exists only now: it’s the part of the state whose meaning is “this is happening” rather than “this is how things are arranged”.

This gives a simple rule of thumb:

Form = “how things are”; Flux = “what is happening now”.

Form can refer to future timeslots and past events as structure. Flux never holds the future; it is always the present slice of activity.


2. Holons and time at the seam

Each trie node is a holon with these four corners and a single public seam TL↔TR. There is no BL↔BR edge; inner self and inner behaviour cannot couple directly, only via the seam’s form/flux.

Time shows up here in three layers:

  1. Structural time (BL/TL)
  • BL and TL carry Names that encode:
    • plans: “run X at t+3”,
    • records: “Y happened at t‑5”,
    • and general temporal structure.
  • These are conceptual timeslots — commitments and histories in Form.
  1. Seam‑time (TR)
  • TR is present‑only: the events currently crossing the seam plus a lazy group of event Names that could be realised.
  • At any attention step, only the slice corresponding to “this now” is materialised; the rest remains lazy structure.
  1. Inner burn (BR)
  • BR is the private “burn” of those events: what they become as metrics, logs, behaviour traces inside the holon in this moment.
  • BR is also Flux: it’s the inner side of the same present.

To talk about time more crisply we use executional attention quanta:

Executional attention quantum
A single application of one micro‑phase of the 4QX dual‑triangle cycle to the P/E/R/M payload at a specific trie node (a 4‑quadrant state at some name path).

The six phases are:

IStart → IDo → CStart → CDo → CFinish → IFinish

On any given node, one full six‑phase pass:

  • enacts the dual‑triangle semantics on that node,
  • preserves the seam discipline,
  • and strictly decreases harmony potential H when the state is off‑equilibrium.

Seam vs timeslot:

  • Structurally, seam = TL↔TR: “where inner and outer can meet”.
  • Dynamically, a timeslot = a particular use of that seam by a quantum: “this holon’s seam is active now”.

Past and future timeslots live as structure in Form (TL/BL). Flux (TR/BR) is always the present exposure of those structures.


3. Names as functions, BL as self‑mosaic

Operationally, the self‑organising trie behaves as a map from Name → function:

  • each Name is a γ‑encoded path into HF and into the trie,
  • resolving that path lands you in a dual‑triangle P/E/R/M payload that implements that Name’s behaviour.

So:

Calling a Name means:
“Follow its symbol path into the trie, find the Class holon that lives there, and instantiate it as a local child Instance in my current context.”

From the caller’s view:

  • The Name appears in TL as a pattern in the library.
  • In an Instance phase:
  • BL (inner Form) holds the self‑mosaic: resources, intentions, position in a larger lazy holon.
  • BL→TL projects “given who I am, which patterns are salient right now?”.
  • TL→TR projects “of those, which am I actually committing to in this present timeslot?”.

The selected Names are then:

  • resolved into Class holons deeper in the trie,
  • and run as child Instances whose BR and TR live in this same present timeslice.

A key detail: attention is multiplexed over contexts, not names:

  1. A scheduler chooses which node/phase pairs receive quanta.
  2. Each attended holon uses its BL/TL Form to decide which Names to call into this timeslot.
  3. Those Names get TR/BR Flux as concrete execution in the present.

Form decides what could and should happen. Flux is it happening now.


4. Node payload: Name : LazyList<Name> in four corners

Each node’s payload is built from a single schema:

Name         ≔ γ(HF)              -- path-code into HF
Group(Name)  ≔ LazyList[Name]     -- lazy, idempotent group of Names

NodePayload  ≔ {
  P : Group(Name),  -- TL: pattern keys (Form)
  E : Group(Name),  -- TR: event names (Flux)
  R : Group(Name),  -- BL: resource/self keys (Form)
  M : Group(Name)   -- BR: metric/behaviour keys (Flux)
}

Node ≔ {
  key      : Name,
  children : Map[BitPair, Node],
  payload  : NodePayload
}

Readings:

  • Form groups (P, R):
  • P (TL) is structural pattern Form: which patterns exist and how they cluster here.
  • R (BL) is self‑structural Form: resources, capabilities, commitments.
  • Flux groups (E, M):
  • E (TR) is present event Flux: which events are currently exposed at this seam.
  • M (BR) is present behaviour Flux: metrics/outcomes produced right now.

Groups are lazy and idempotent:

  • they materialise to sets when needed,
  • union is commutative/associative/idempotent (mountain‑merge),
  • repeated Names across the trie are how reuse and convergence work, not a bug.

5. Trie structure: binary trie‑of‑tries

A concrete but faithful skeleton is a binary trie‑of‑tries:

BinaryNode:
  key  : Name              # bitstring path
  bit0 : maybe BinaryNode  # child for bit 0
  bit1 : maybe BinaryNode  # child for bit 1
  sub  : maybe BinaryNode  # nested trie "inside" this value
  payload : NodePayload
  • bit0 / bit1 represent path bits (outer structure).
  • sub represents an inner trie—a namespace inside this key.

This lets you use the structure like an associative array:

  • get(path) walks bit0/bit1.
  • get_inner(path) can also descend into sub.
  • Every sub is itself a root, so you get a trie‑of‑tries of holons.

Each node is a relative namespace atom:

  • its TL/TR Form/Flux are “outside this key” (parent space),
  • its BL/BR Form/Flux are “inside this key” (child space),
  • and there is no global God‑root—just a holarchy of parent/child contexts.

6. Dual teloi and the two TDBU axes

Two triangular teloi run over this geometry:

  • Instance telos (adaptation):
    BL → TL → TR → BL
    “Inner Form discovers and uses the outer world.”
  • Class telos (stabilisation):
    TL → TR → BR → TL
    “Outer Form runs and reshapes itself via inner Flux.”

They induce two independent Top‑Down / Bottom‑Up axes:

  1. Vertical (Outer ↕ Inner) – TDBU of keys & namespaces.
  2. Horizontal (Form ↔ Flux) – TDBU of content in time.

6.1 Vertical TDBU: namespaces

Top‑down (Outer → Inner):

  • Parent Form chooses which keys matter:
  • Instance IStart/IDo pushes attention downward into children and sub‑tries using Names in P/R.
  • Class CStart accepts those offers, possibly rebucketing them into more specific subtries.

Bottom‑up (Inner → Outer):

  • Children and inner tries merge results upward:
  • CFinish (BR→TL) mountain‑merges child metrics into TL patterns.
  • IFinish (TR→BL) integrates child outcomes into BL resources.

Vertical TDBU is:

Which names exist and stay salient where, and how do they propagate down into detail and roll back up into shared directories?

6.2 Horizontal TDBU: content in time

Along the Form/Flux axis:

  • TD / fan‑out / selection:
  • BL→TL→TR (Instance): “Given my Form, which events will I emit now?”
  • TL→TR→BR (Class): “Given patterns and offers, which executions happen now?”
  • BU / aggregation / roll‑up:
  • CFinish BR→TL: roll all present behaviour into new pattern structure.
  • IFinish TR→BL: roll all present seam events into new self structure.

These two closes are where H really drops:

  • Form absorbs Flux:
  • TL learns from BR,
  • BL learns from TR,
  • and the system compresses many present events into more compact structural changes.

6.3 Depthless holons, global TD/BU flows

Generic Organisation says each holon only ever juggles Self / Parent / Children—no absolute depth.

So:

  • TD/BU are global flow fields, not local roles or flags.
  • Each holon simply runs its Instance and Class teloi on its own seam.
  • TD/BU is what an observer sees when watching patterns of seam traffic across the holarchy.

7. Generic Organisation on the trie

Generic Organisation describes how a context with an objective uses a pattern safely and recursively:

  1. Fit – plug pattern into local context.
  2. Fund – commit resources and timeslots.
  3. Run – execute.
  4. Harvest – integrate results locally.
  5. Publish – record what worked so others can reuse it.

On the self‑organising trie:

  • Fit/Fund live in Form:
  • BL: resource/intent Names,
  • TL: pattern keys and interfaces.
  • Run is Flux:
  • CDo (TR→BR) in the invoked child, burning present seam‑time and inner time.
  • Harvest/Publish are the two BU closes:
  • IFinish (TR→BL): Harvest into self‑mosaic Form.
  • CFinish (BR→TL): Publish back into shared pattern Form.

Because all this goes through one seam and groups are idempotent, you get:

  • a library of patterns‑in‑use, and
  • an idempotent market dynamic: once an exchange is fully settled, replaying it does nothing further.

8. Ship of Theseus: substrate‑independent active geometry

Underneath the trie is a fully formal dual‑triangle law:

  • generic DynSpec over P/E/R/M/Issue,
  • Lyapunov H, delta, consumes, strict_consume,
  • uniqueness of the Class/Instance pair,
  • and proofs that H decreases to 0 and operations are idempotent at equilibrium.

This core is substrate‑independent:

  • It doesn’t care what P/E/R/M “really are” (proof graphs, JSON, code, human decisions).
  • It only cares that the laws hold.

Concrete runtimes (Python, distributed systems, human workflows) are Ships of Theseus:

  • they can swap boards (data structures, storage backends),
  • swap crew (LLMs, humans, services),
  • as long as they preserve:
  • 6‑phase order,
  • no BL↔BR shortcuts,
  • H monotonicity,
  • idempotent merges at the seam.

The self‑organising trie is the runtime/geometry reading of that law:

  • each node is a dual‑triangle P/E/R/M atom,
  • Names glue them into a trie‑of‑tries,
  • execution is “fire attention quanta through this geometry under the six‑phase law”.

9. Minimal implementation sketch

A minimal faithful implementation can look like this (Python‑ish sketch):

Name = int  # γ-path as bitstring

class LazyGroup:
    # lazy, idempotent collection of Names
    def append_lazy(self, name: Name): ...
    def materialize(self) -> set[Name]: ...

@dataclass
class Payload:
    P: LazyGroup  # TL: pattern structure (Form)
    E: LazyGroup  # TR: event ids (Flux)
    R: LazyGroup  # BL: resource/self structure (Form)
    M: LazyGroup  # BR: metric ids (Flux)

@dataclass
class BinaryNode:
    key: Name
    bit0: "BinaryNode | None" = None
    bit1: "BinaryNode | None" = None
    sub:  "BinaryNode | None" = None
    payload: Payload = field(default_factory=Payload)

Plus:

  • a Phase enum and Quantum(phase, node_key),
  • six functions i_start, i_do, c_start, c_do, c_finish, i_finish,
  • a scheduler that repeatedly applies step_quantum(root, q).

Invariants to keep:

  • LazyGroup union is commutative/associative/idempotent.
  • No op introduces a BL↔BR edge; all experience→structure flows go via TL/TR.
  • Each effective quantum strictly reduces H until H=0.

Under those conditions, the self‑organising trie implementation inherits the formal convergence and idempotence guarantees.

Leave a Reply

Your email address will not be published. Required fields are marked *