Merge ghostlight-verse/multiresolution-gestalt-map: the multiresolution Gestalt target doc (docs/targets/multiresolution-gestalt.md)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-12-03 06:40:20 +01:00
commit 40a28c0b69

View file

@ -0,0 +1,358 @@
# Multiresolution Gestalt: Target
Date: 2026-12-03. Campaign `ghostlight-verse` in the Weksa mind. Imagination pass
`gestalt-map`, session `weksa-self-20261202`. Base: Ghostlight `main` `93da896`;
the room cut builds on branch `ghostlight-verse/dungeon-npc-voice` at `d2c91ca`.
This page is the target shape and the authority map. Cut specs, questions,
research and ideas live in the mind; their ids are listed here so the page can
be read alone. Query them with
`huginn view <id>` or `huginn pass ghostlight-verse gestalt-map`.
## Why
Operator, 2026-12-03 (ruling `ghostlight-verse:ruling:multiresolution-gestalt`):
> Multiresolution Gestalt is core to the whole idea of Ghostlight, using a turn
> to simulate groups of people (and groups of groups, etc.) is how you can scale
> to massive worlds, as well as simulate massive worlds in parallel. For
> Ghostlight Dungeon, the DM should be dispatching Gestalt turns for the whole
> world, then the region, subregion, all the way down to the room the player is
> in (cut along the most semantically relevant lines, usually institutional
> rather than geographic) at varying rates, while also dispatching Elaborator
> agents to add depth to whatever the player happens to be looking at. Lots of
> knobs which it can use to fit the simulation's quality to the player's needs
> and budget.
Rulings this page stands on: `multiresolution-gestalt`, `dungeon-dm-owns-the-gears`,
`dungeon-models-dm-opus`, `dungeon-credit-burn`, `deru-play-profile`,
`aetheria-sim-first`, `two-ghostlight-consumers`, and the verse-sim rulings of
2026-10-10: `verse-sim-pipeline` (the verse runs multiresolution gestalts on a
schedule), `gestalt-machinery-port` (port the pre-rebuild machinery, do not
redesign it), `teardown-was-authority-sprawl` (port ideas onto the grammar
kernel, never ad hoc mutation rules), `gestalt-fission-auto` (splits are
admitted during runs), `grammar-scope-ruled`, `verse-cadence-ruled` (manual
under a hard token cap, then nightly under a monthly cap), `grouped-record-and-carry`,
`dungeon-vault-import-run-ahead` (elaborators run ahead of the player).
## What exists (Body at `93da896`)
- **The kernel is the only writer.** `WorldMailbox` admits a closed command
set; a subject acts only through its own opportunity (`ExerciseDecision`,
`DeclineDecision`, both of which stamp `last_opportunity_at`).
Subjects are `Person`, `Institution`, `Population` (`lib.rs:385`). Institution
structure is typed: offices with incumbents (`selection`, `lib.rs:921`),
authority grants over a subject or a place subtree (`authority`, `lib.rs:915`,
`patch.rs AuthorityTarget`). Places form a containment tree. There is no
population membership (`CausalBoundary::IndividuationRequired` is "declared,
never derived", `lib.rs:4358`).
- **The flat cover.** `cover.rs` partitions every active opportunity into
Singleton and Group cells under `CoverBudget {cells, constituent_cap,
urgency_slots}`, with a rotation window that guarantees every subject a
singleton turn within `ceil(N/R)` ticks. It is pure, derived and dropped each
tick; a Group cell is one inference over N labelled, never-unioned views,
each constituent submitting its own command (`controllers.rs run_group`).
The adjacency it reads is `agency_graph` (`lib.rs:3923`), exposed only on
`WorldMailbox` (`mailbox.rs:488`), never on a controller port.
- **The verse runner** (`verse/run.rs`, binary `ghostlight-verse`) advances a
world tick by tick under a token cap: open a tick document that freezes the
cover (`open_or_find`, `run.rs:1143`), run each cell through
`ControllerRunner::run_cell`, advance the clock once, checkpoint. Spend is
reserved before each call and settled after by `RecordingInferencePort`
(`verse/calls.rs:552`). It is the only world-scale scheduler today, and it is
one level deep: every faction every tick, at one resolution.
- **The Dungeon DM** (`ghostlight-dungeon/src/play.rs`, Opus) reads
`table_view`, `dispatch`es Personas, commits with authoring and actor tools,
and owns time through `advance_time`. Branch `dungeon-npc-voice` adds
`react`: one Persona-model call for the room's onlookers
(`PersonaLane::gestalt`), whose sections come back as drafts the DM commits
through each person's `__speak`. Nothing outside the DM's dispatches moves.
- **Run-ahead** (`run_ahead.rs`) starts a bounded elaboration sweep after each
closed turn (`api.rs:443`), sized by `Scale` session and permit counts
(`begin.rs:39`). Its claim order is jurisdiction order, then derivation order
(`elaboration.rs:963`): it does not know where the player is or looks.
- **The pre-rebuild design** (`docs/articles/multiresolution-gestalts.md`, tag
`parked/ghostlight-pre-rebuild`
`docs/architecture/ghostlight-multiresolution-agency.md`) had the agency
graph, a budgeted connected cover, cohesive versus arena cells, detail debt,
approval-gated fission and population baselines with member deltas. The
cover, arena cells and detail debt (as the rotation window) are ported.
The hierarchy, rates, focus and membership are not.
## Prior art that shaped this
Research notes of pass `gestalt-map` (`ghostlight-verse:research:gestalt-map.*`):
- `brom-lod-membrane`. IVE (Šerý, Poch, Šafrata, Brom 2006; Brom, Šerý, Poch,
IVA 2007): detail is an elastic membrane cut through a location tree; an
important object presses it down; LOD influence between neighbours makes a
crater, not a hole, around the player; locations expand eagerly and shrink
lazily in a garbage-collection pass; a process above the membrane runs
atomically and is partially evaluated when detail drops; one dedicated
"genius" can drive several actors at once. This is the shape of focus,
promotion, demotion and hysteresis below.
- `navarro-mesoscopic`. Navarro, Corruble, Flacher, Zucker (AAMAS 2013):
aggregate the minds, keep the bodies; partial disaggregation of only the
members something interacts with. Full macro aggregation lost emergent
micro phenomena and consistency fell. A Ghostlight Group cell is already
mesoscopic: one decision call, every member's state stays its own.
- `mrm-aggregation-failures`. The multiresolution-modelling literature's known
failures at level boundaries: chain disaggregation, transition latency,
thrashing, and mapping inconsistency between representations; MRE keeps
every representation with mapping functions (Reynolds, Natrajan, Srinivasan
1997). Ghostlight avoids the class by keeping one representation.
- `holonic-mas`. Holons (Gerber, Siekmann, Vierke 1999; Fischer, Schillo,
Siekmann 2003; Gaud et al. 2008): a group appears outward as one agent whose
head speaks for members that gave up part of their autonomy; recursive;
reorganised at run time. Ghostlight's head is an institution subject with
its own controller, and that is why the cut goes along institutions first.
- `dwarf-fortress-world-vs-site`. Dwarf Fortress runs world history coarsely
and keeps it running during play; off-site events reach the active site only
through in-world channels (a liaison, invaders who physically travel). The
Dungeon's equivalent: off-screen waves write kernel acts, and the player
learns of them only through knowledge and travel.
- `paradox-pops`. Victoria 3 aggregates people into pops keyed by profession,
culture, religion, workplace and state, and cost scales with the number of
pops, not of people; interest groups are fractions of pops. Aggregation keys
are typed attributes, not a model's judgement.
- `sunshine-hill-alibi`. Alibi generation (Sunshine-Hill and Badler, AIIDE
2010; dissertation 2011): fill in an agent's goals and history only when
inspected, consistent with what was already observed. That is what an
elaborator does when the player opens a node nobody authored.
- `ghostlight-pre-rebuild-gestalt` and `ghostlight-flat-cover-today`: the repo
facts above.
## Vocabulary
- **Node.** A vertex of the gestalt hierarchy: `World` (root), an
`Institution` node anchored at an institution subject, a `Place` node
anchored at a place entity, or a `Subject` leaf.
- **Voice.** A subject that acts in a node's turn. An open node's voices are
its children's anchors and its loose subjects; a closed institution node's
only voice is the institution itself.
- **Gestalt turn (node turn).** One wave's work for one node: its voices,
partitioned into cells by `derive_cover` when they exceed the constituent
cap, each cell one inference through the existing lanes.
- **Wave.** The set of node turns one planning pass chose, frozen with
deterministic ids before any inference.
- **Focus.** The places and nodes detail is pressed down around: the player's
place always, plus what the DM names. Distance is counted in hierarchy steps
from the focus.
- **Rate.** A period in fictional minutes per distance band. A node is due
when its most neglected voice was last attended at least one period ago.
- **Room.** The player's place and the subjects positioned in it. The one
level that is always geographic, because presence is physical.
## Invariants
- **G1 `kernel-only-writer`.** Every effect of a turn at any level reaches the
world as an ordinary submission by an exact subject (`ExerciseDecision`,
`DeclineDecision`) or a confined patch through the mailbox (elaborator, play
table). The hierarchy, waves, knobs, focus and ledgers never enter
`WorldState`, a `CommandEnvelope` or a scope digest.
- **G2 `one-representation`** (a group turn is legible at the finer level).
Ghostlight aggregates attention, never state. A coarse turn acts only through
subjects that exist, so the finer level reads exactly what it wrote. Opening
a node writes nothing and needs no disaggregation; closing one writes
nothing and discards nothing. A group turn's uncommitted prose is not canon,
as a Persona's draft is not.
- **G3 `bounded-and-reported`.** Every model call of every level reserves its
bound in a ledger before it is made and is settled and reported after, by
lane (room, wave, elaboration), node and distance. A call that could pass its
allowance is not made; the node is reported deferred, never dropped silently.
- **G4 `institutions-first`.** The hierarchy is derived from world state, and
a subject's home is decided by institutional ties before places: office
incumbency, then authority over the subject, then authority over a place
subtree containing it, then place containment, then the root.
- **G5 `one-planner`.** The Dungeon and the verse plan waves with one pure
function over (hierarchy, opportunities, knobs, focus, wave ordinal). The
drivers differ only in who sets the knobs, when a wave runs, and who owns
time.
- **G6 `no-starvation`.** Every voice of every due node is attended within its
rate period times the rotation bound of `derive_cover`; deferral is visible
in the wave report.
- **G7 `cohesion-needs-authority`.** Only an institution subject speaks for
others, through its own affordances. Every other grouping is an arena in
which each act names its exact subject (the grouped lane's per-handle rule).
- **G8 `replayable-waves`.** Hierarchy, wave and command ids are pure over
world state, knobs and the wave ordinal, so a resumed wave re-submits the
same ids and the kernel answers with the original receipts.
## Identity, lifecycle and authority
| Thing | Named by | Life over time | Who decides |
|---|---|---|---|
| Node (resolution level / group node) | `NodeId`: sha256 over a fixed namespace, the world id and the anchor (`World`, `Institution(SubjectId)`, `Place(EntityId)`, `Subject(SubjectId)`) | Derived on every read from the current world state; exists while its anchor exists and has at least one live descendant voice; never stored. A world change moves a subject to another parent on the next read, with no migration step | `derive_hierarchy` (kernel-private, beside `agency_graph`), exposed only on `WorldMailbox::hierarchy` |
| Node state open/closed | (node, wave) | Decided per wave by the planner from focus and depth; held only in the frozen wave | The planner, from the driver's knobs |
| Gestalt turn (node turn) | `(world, node, wave ordinal)`; its cells' ids from `cover.rs` with the wave ordinal in place of the tick | Frozen in the wave document before the first inference; each cell runs through `ControllerRunner::run_cell`, resumes from its controller-work row, ends committed, declined, refused or deferred | Cells decide what voices do; the kernel admits; the wave runner owns order and checkpoints and nothing else |
| Wave | Verse: the tick ordinal (clock advances). Dungeon: `(timeline, closed turn sequence)` | Opened (frozen) once, run, closed once; an open wave is finished as frozen by the next run | The driver opens and closes it; the planner chooses its content |
| Room turn | The DM's `react` call slot in the play turn, as `dispatch` today | Inside one play turn, recorded and resumed by the play turn store | The DM's judgement (`dungeon-dm-owns-the-gears`) |
| Level rate | Distance band (0 = the focus's own node, 1, 2, ..., and `rest`) mapped to a period in fictional minutes | Standing value in the knobs; changed by the DM tool or the verse run config; takes effect at the next wave | Dungeon: the DM. Verse: the operator's run config |
| DM knobs (rates, depth, budget, focus) | One `GestaltKnobs` document per Dungeon timeline; the verse's `VerseRunConfig` | Persisted per timeline, survives reload; default at Begin; each wave records the knob values it was planned under | The DM through one `tune` tool; the player only by asking the DM; never the kernel |
| Focus entry | Place or node id, with a lease in fictional minutes | Added by the DM or implied by the player's place; the player's place never expires; others expire at lease end (lazy shrink) | The DM; expiry by the planner reading `now` |
| Promotion (opening a node) | The node in a wave that plans it open | Happens when the focus comes within `depth` of it, or the DM forces it, or its detail debt makes it due; writes nothing | The planner |
| Demotion (closing a node) | The node in a wave that plans it closed | Only after the lease of the focus that opened it ends and the next wave plans it closed (shrink lazily); writes nothing | The planner |
| Spend ledger window | Verse: the run. Dungeon: the post-turn window | Reserve before each call, settle after, report by lane, node and distance | The recording port (`RecordingInferencePort` core) |
## Authority map
### Who owns the hierarchy
- **Owner.** `derive_hierarchy(&WorldState) -> Hierarchy`, a pure kernel-private
function beside `agency_graph`, reached only through `WorldMailbox::hierarchy`.
- **Inputs.** `selection` (offices, incumbents), `authority` grants over
subjects and place subtrees, `positions`, place containment,
`controller_assignments` (only subjects with a non-Human controller are
voices; the player is placed but never a voice).
- **Outputs.** A tree: `World` root; institution nodes; place nodes only where
some live subject has no institutional home; subject leaves. Each node lists
its children, its anchor voice (if any) and its loose subjects. Also the
focus path of any place: the chain of nodes that govern it.
- **Home-parent rule.** A subject's parent is the first that exists of: the
institution in which it holds an office (several: the one with the fewest
live members, then the lowest id); the institution holding an authority grant
over it; the innermost institution holding a grant over a place subtree that
contains its position; the innermost place node containing its position; the
root. An institution's own parent follows the same rule. A cycle is broken
at its lowest id, which then hangs from the root. Other ties stay visible as
context, not as second parents (question `gestalt-multi-affiliation`).
- **Derived state.** The whole hierarchy, node ids, focus paths. Nothing is
stored. An elaborator, the DM or a Persona changes the hierarchy only by
changing the world through ordinary commands (granting an office, a grant,
a move).
- **Forbidden writers.** No hierarchy document, no declared tree, no cache that
outlives one read, no model output.
- **Shared paths.** The Dungeon wave, the verse tick, the DM's view of what is
due and the elaborator's focus all read the same `hierarchy()`.
### Who schedules
- **Owner.** One pure planner, `plan_wave(world, ordinal, &Hierarchy,
&[DecisionOpportunity], &GestaltKnobs, &Focus, now) -> Wave`. It opens nodes
along each focus path up to `depth`, closes everything else, takes the due
nodes by rate, orders them nearest-focus first then most overdue, partitions
each node's voices into cells with `derive_cover` (the agency graph
restricted to those voices) and cuts the list at the knobs' turn bound.
- **Two drivers, one planner.**
- *Dungeon.* The DM owns the gears inside a turn: the room is its `react`
call. Above the room, the DM sets standing knobs and focus with `tune`;
after each closed play turn the Dungeon plans one wave and runs it, while
the player reads the narration; the DM may force a node now with
`run_world`. Time stays the DM's (`advance_time`); a wave never advances
the clock. (Question `gestalt-dungeon-trigger` asks whether the DM
should instead call every wave itself.)
- *Verse.* A tick plans a wave with no focus (or the operator's), runs it,
and advances the clock by the frozen span. The tick document freezes the
wave instead of the flat cover.
- **Derived state.** `derive_cover` is no longer the scheduler; it is the
within-node cell partition. `Resolution::{Detail, Coarse}` stays a derived
label. Due-ness is derived from kernel `last_opportunity_at`; no second
schedule store exists.
- **Forbidden writers.** No background timer, no wall clock, no code path that
runs a world wave the knobs did not plan. Run-ahead stops choosing its own
claim order (below).
### How Gestalt and Elaborator turns share the budget
- **Owner.** One ledger per window: the reserve-before-call, settle-after core
of `RecordingInferencePort`, with every call record tagged by lane
(`room`, `wave`, `elaboration`), node and distance.
- **Allowances.** The knobs split a window's token budget between the `wave`
and `elaboration` lanes. The room lane is the DM's play turn, bounded by its
round budget and the per-call output cap, and is reported but never starved
by background lanes: background lanes run after the turn closes.
- **Elaboration focus.** The elaborator's sweep takes the focus as its first
claim key: boundaries and deficits under focus places first, then the
current order. It answers "what is the player looking at" with structure,
where waves answer it with action.
- **Demotions.** `Scale::sweep_sessions` and `sweep_permits` stop deciding
how much elaboration happens; the elaboration allowance does, and permits
stay a concurrency bound. The verse's `COVER` constant becomes a knob value.
The verse's run token cap is the wave lane's allowance.
### Deletion line
Before the hierarchy lands nothing is deleted. In order: `react`'s mandatory
subject list becomes an override (room derived); the verse's one-line
`derive_cover` call over all opportunities is replaced by `plan_wave`; the
Dungeon's unfocused post-turn sweep is replaced by the focused, allowance-bounded
one; `Scale`'s sweep counts are deleted when the allowance lands.
## The shape in one walk
Deru stands in the Ironmarket tap-room. He insults the guild factor.
1. Room. The DM `dispatch`es the factor and `react`s the room: one call, every
onlooker in the tap-room from their own slice. The DM commits what is said.
2. The turn closes. The Dungeon plans a wave with focus = the tap-room.
The focus path is tap-room → Ironmarket Guild (it holds the market district's
grant) → City Council → Crown → World. With depth 2, the Guild and the
Council are open: the guild's officers and the watch captain act in their
own cells; the Crown is closed and acts as one voice at its slower rate
when due; the rest of the world turns as closed institution voices only when
their band's period has passed.
3. Every act goes through the kernel. The factor's grudge is a commitment and a
pressure; the guild's order to its enforcers is the guild's act, heard by its
audience.
4. The elaborator spends its allowance on boundaries under the tap-room and its
exits first.
5. Next turn, the DM's view shows what moved off-screen and what is due. When
Deru walks into the guild hall, its officers already have their own state:
nothing to disaggregate.
## How the verse runner fits
The verse runner is the unattended driver of the same planner. It keeps its
tick document, its token cap, its resume rules and its clock advance; only
the content it freezes changes, from one flat cover to one planned wave. With no
focus and a depth knob, a verse tick turns the world's institutions as closed
voices at their band rates, and `derive_cover` still bounds each node's cells.
Ruling `verse-cadence-ruled` (manual under a hard cap, then nightly) is its
trigger; the Dungeon's closed turn is the other.
## Cut sequence
Each cut is one `cut_spec` in the mind, `ghostlight-verse:cut_spec:cut-<cut>.r1`,
sized for one Sonnet Hands. Rejected alternatives are the ideas
`ghostlight-verse:idea:gestalt-map.*`, each with its Recorded resolution.
1. `gestalt-room`: `react` becomes the room-level Gestalt turn: the room
derived from the player's place, sections keyed by handle, non-Persona
subjects routed instead of failing the call. On `dungeon-npc-voice`.
2. `gestalt-hierarchy`: `derive_hierarchy` and `WorldMailbox::hierarchy`.
3. `gestalt-planner`: `plan_wave`, `GestaltKnobs`, `Focus`, due-ness. Depends on 2.
4. `gestalt-wave-driver`: the shared wave runner; verse ticks freeze planned
waves. Depends on 3.
5. `gestalt-ledger`: lane, node and distance on call records; lane
allowances; the Dungeon gets a ledger. Depends on 4.
6. `elaboration-focus`: the sweep's focus-first claim order; Dungeon
run-ahead spends the elaboration allowance on the player's focus. Depends on 5.
7. `dungeon-world-waves`: a wave after each closed play turn; off-screen acts
and due nodes in the DM's view. Depends on 1, 4, 5.
8. `dm-gestalt-knobs`: the DM's `tune` and `run_world` tools; knobs persisted
per timeline; focus leases. Depends on 6, 7.
9. `closed-voice-digest`: a closed institution's view carries a capped digest
of its folded members' salient state. Depends on 3.
## Questions
- `ghostlight-verse:question:gestalt-hierarchy-owner`: derived, declared or
model-proposed hierarchy. Recommended: derived.
- `ghostlight-verse:question:gestalt-multi-affiliation`: one home parent or a
voice in every institution. Recommended: one home parent.
- `ghostlight-verse:question:gestalt-dungeon-trigger`: the DM calls every wave,
or sets knobs that a post-turn step runs. Recommended: standing knobs.
- `ghostlight-verse:question:gestalt-rate-clock`: rates in fictional minutes or
in play turns. Recommended: fictional minutes.
- `ghostlight-verse:question:gestalt-population-membership`: port population
baselines and member deltas now, or individuate through elaborators.
Recommended: defer.
## Not in scope
- Population membership, baselines, member deltas and fission (the question
above holds it; ruling `gestalt-fission-auto` governs fission when it comes).
- A model-chosen cut per wave (the old six-axis demand model).
- Eve or any play-surface change beyond the DM's own view.
- Cost tuning: allowances and rates are measured in the burn
(`dungeon-credit-burn`), not designed here.