Close world compiler and MVP authority map

This commit is contained in:
Meta Vens 2026-08-16 23:42:36 +02:00
commit 934afe67e1
7 changed files with 111 additions and 49 deletions

View file

@ -297,8 +297,49 @@ impl WorldCompiler {
let receipts = self
.retrieve_all(&queries, &campaign.branch_origin.canon_cutoff, 10)
.await?;
let output=self.structured("destination_compile",&format!("campaign:{}:revision:{}",campaign.id,campaign.revision),&format!("Compile only the requested bounded destination region. Every new location id must be new. At least one new location must route back to origin id {} with a positive travel time. Do not rewrite existing geography. CAMPAIGN LOCATIONS:\n{}\nREQUEST:\n{}\nEVIDENCE:\n{}",origin_location_id,serde_json::to_string(&campaign.locations)?,destination_request,evidence_text(&receipts)),serde_json::to_value(schema_for!(CompiledExpansionSeed))?,receipt_ids(&receipts)).await?;
let seed: CompiledExpansionSeed = serde_json::from_value(output.0)?;
let snapshot = format!("campaign:{}:revision:{}", campaign.id, campaign.revision);
let base_prompt = format!(
"Compile only the requested bounded destination region. Every new location id must be new. At least one new location must route back to origin id {} with a positive travel time. Do not rewrite existing geography. CAMPAIGN LOCATIONS:\n{}\nREQUEST:\n{}\nEVIDENCE:\n{}",
origin_location_id,
serde_json::to_string(&campaign.locations)?,
destination_request,
evidence_text(&receipts)
);
let schema = serde_json::to_value(schema_for!(CompiledExpansionSeed))?;
let sources = receipt_ids(&receipts);
let mut compiler_receipts = Vec::new();
let mut correction = String::new();
let (seed, expansion) = loop {
let output = self
.structured(
"destination_compile",
&snapshot,
&format!("{base_prompt}{correction}"),
schema.clone(),
sources.clone(),
)
.await?;
compiler_receipts.push(output.1);
let seed: CompiledExpansionSeed = serde_json::from_value(output.0)?;
let expansion = crate::domain::RegionExpansion {
origin_location_id: origin_location_id.into(),
locations: seed.locations.clone(),
facts: seed.facts.clone(),
};
match validate_region_expansion(campaign, &expansion) {
Ok(()) => break (seed, expansion),
Err(error) if compiler_receipts.len() == 1 => {
correction = format!(
"\n\nLOCAL VALIDATOR REJECTED THE PREVIOUS CANDIDATE: {error}\nReturn a corrected complete candidate against the same CAMPAIGN, REQUEST, and EVIDENCE."
);
}
Err(error) => {
return Err(anyhow!(
"destination compiler failed local validation after one correction: {error}"
));
}
}
};
let evidence_ids = receipt_ids(&receipts);
let affected_sources: Vec<String> = receipts
.iter()
@ -327,12 +368,6 @@ impl WorldCompiler {
status: "review".into(),
})
.collect();
let expansion = crate::domain::RegionExpansion {
origin_location_id: origin_location_id.into(),
locations: seed.locations,
facts: seed.facts,
};
validate_region_expansion(campaign, &expansion)?;
Ok((
crate::domain::RegionExpansionPreview {
schema: "ghostlight.region_expansion_preview.v1".into(),
@ -344,7 +379,9 @@ impl WorldCompiler {
canon_candidates: candidates,
requires_approval: true,
},
vec![retrieval_receipt, output.1],
std::iter::once(retrieval_receipt)
.chain(compiler_receipts)
.collect(),
))
}

View file

@ -231,8 +231,9 @@ individual identity.
actor slot. The gestalt owns shared baseline state. The member delta owns
individual divergence.
- **Inputs:** relevance/perception proposal, expected campaign revision,
expected gestalt version, expected member-delta version, current scene, and
reviewed consequences.
expected gestalt version, optional existing member-delta version, current
scene, and reviewed consequences. A first encounter may propose a bounded
identity and initial delta for a member not yet present in the catalog.
- **Outputs:** a materialized actor derived from baseline plus delta, or an
updated persistent delta plus optional reviewed aggregate gestalt changes and
a materialization receipt.
@ -241,10 +242,10 @@ individual identity.
- **Forbidden writers:** proximity checks, Persona output, scheduler, scene
rendering, and relevance heuristics may propose promotion or demotion but
cannot create, erase, merge, or rewrite a person.
- **Shared paths:** first encounter, named interaction, return to a known
member, leaving perception, scene teardown, reload, and offscreen catch-up
all use `MaterializeGestaltMember` or `DematerializeGestaltMember` through the
campaign mailbox.
- **Shared paths:** first encounter uses `IndividuateGestaltMember`; return to a
known member uses `MaterializeGestaltMember`; leaving perception uses
`DematerializeGestaltMember`. Scene teardown, reload, and offscreen catch-up
reach those commands through the campaign mailbox.
- **Cut line:** dematerialization never deletes the member delta. Gestalt ticks
never overwrite member-specific memories, relationships, possessions,
injuries, promises, or identity.
@ -257,12 +258,14 @@ blacksmith remains John when encountered again.
After each committed player event, a cheap structured relevance stage receives
only the current gestalt/member catalog, materialized member IDs, player
location, and event summary. It proposes one `GestaltPresencePlan`. The kernel
validates exact gestalt/member versions, known IDs, current materialization
state, and scene location, then applies the entire demotion/promotion set as one
atomic `ReconcileGestaltPresence` command before the participant appraisal
wave. Automatic plans cannot write aggregate gestalt learning. A malformed,
invented, stale, or partially invalid plan changes nothing.
location, and event summary. It proposes one `GestaltPresencePlan`, including
at most the bounded first-relevance identities needed by the scene. The kernel
validates exact gestalt/member versions, identity uniqueness, current
materialization state, and scene location, then applies the whole plan through
revisioned commands before the participant appraisal wave. Automatic plans
cannot write aggregate gestalt learning. A malformed, conflicting, stale, or
partially invalid plan changes nothing. The compiler may seed likely members,
but it is not required to predict every future person at campaign creation.
### The ownership decision

View file

@ -33,18 +33,19 @@ per-campaign WorldKernel mailbox is the sole canonical writer. Ghostlight owns
the generalized Projector → Persona → Interpreter organ; Epiphany retains her
canonical Persona mind and will consume the shared organ through an adapter.
The Epiphany extraction map is complete. The active bounded organ is the world
compiler. Its Rust seam now retrieves hashed VoidBot witnesses, generates
distinct openings and roles, compiles approval-gated custom starts, rejects
invalid topology, and atomically admits campaign plus evidence only on
approval. The browser now exposes generated opening/role selection and custom
starts. A live DeepSeek plus VoidBot custom compilation passed with 30 witnessed
source chunks and remained an uncommitted approval preview. A disposable HTTP
run then proved approval persistence, authenticated-session survival across
restart, and rejection of consumed invite reuse using hashed auth state in a
separate `.cc`. Next, add material-gap decisions, on-demand destination
compilation, and canon-candidate persistence. Existing Ghostlight fixtures
remain regression evidence.
The hosted MVP is implemented and in final acceptance. Ghostlight owns the
generalized projection membrane; Epiphany consumes its pinned crate while
retaining her own Mind and consequence authority. The Rust daemon now owns
VoidBot-grounded compilation and approval, stable topology, campaign mailboxes,
fiction-first d20 receipts, parallel Persona waves, automatic gestalt
individuation and folding, model-driven strategic ticks, exact-channel news,
CultMesh/Eve publication, invite-isolated campaigns, and `.cc` export. Live
acceptance has proved two invite sessions, Vault compilation, three concurrent
NPC reactions, a 15.16-second four-actor wave, and material offscreen agency
without player puppeting. Re-enter through the authoritative architecture and
the latest exact deployment evidence; do not resume the superseded compiler
foundation checklist below. Existing Ghostlight fixtures remain regression
evidence.
## Prior research pipeline focus

View file

@ -1,8 +1,10 @@
# Ghostlight Current System Map
GhostlightDungeon is the active runtime program. Its authority map is
`docs/architecture/ghostlight-dungeon-mvp.md`. The runtime is not yet complete;
the existing validated artifact seams remain regression evidence.
GhostlightDungeon is the active hosted runtime. Its authority map is
`docs/architecture/ghostlight-dungeon-mvp.md`. The implemented Rust daemon,
CultCache campaign stores, CultMesh/Eve surfaces, browser lowerer, and Starfire
process/release scripts are the live machine; the older validated artifact
seams remain regression evidence only.
## GhostlightDungeon target flow
@ -36,6 +38,21 @@ the campaign revision and world time untouched. Background inference checks
live-turn pressure before launch and again before commit; return catch-up uses
the same command path with player-turn priority.
Population scale uses reversible individuation:
```text
gestalt baseline + existing member delta, or a first-relevance identity proposal
-> WorldKernel validates gestalt/member/revision/location
-> atomic durable member delta + temporary ActorState
-> ordinary Persona appraisal and world commands
-> expired relevance lease outside player perception
-> atomic fold into the member delta; active slot removed
-> gestalt receives strategic ticks without erasing the individual
```
The temporary actor slot is derived. It never owns identity, relationship,
memory, equipment, injury, or obligation state.
The browser command boundary is deliberately smaller than `WorldCommand`.
Authenticated HTTP admits only player-owned Speak, unfilled Assess, Attempt,
and Wait requests. Actor identity must match the campaign player. Compiler

View file

@ -177,9 +177,9 @@ stake prose alone never impersonates world mutation.
- Do not expose model chain-of-thought or secrets.
- Serve the embedded web bundle on TCP `8831`. Firewall access is limited to Starfire’s private LAN and `10.77.0.0/24`; no public listener or Yggdrasil web gateway is added.
- Use two single-use invite links that establish separate HttpOnly sessions. Campaigns are single-player; simultaneous co-op is outside the MVP.
- Install `GhostlightDungeon` as an automatic Windows service under a dedicated virtual service identity. ACL the runtime root to administrators and the service identity.
- Run `GhostlightDungeon` as a normal detached process under the Starfire operator account. Record its PID, executable, and logs; explicit start, stop, health, release, and rollback scripts own lifecycle. ACL the runtime root to administrators and that operator account.
- Read the DeepSeek key from stdin during setup, protect it with machine-scoped DPAPI plus file ACLs, and never place it in source, arguments, logs, or environment projections.
- Build immutable release directories from the exact Git commit, switch the active release atomically, record provenance in CultCache, and configure service restart recovery.
- Build immutable release directories from the exact Git commit, switch the active release through the guarded junction, and record provenance in CultCache plus the immutable release manifest. Process restart is explicit; Windows service installation and automatic boot recovery are outside this MVP by operator choice.
### Repository and operational documentation
@ -229,7 +229,7 @@ Publish JSON Schema only as the schema catalog. Runtime documents and exports us
- all actor stages execute in parallel waves;
- a four-actor live turn completes within 20 seconds;
- background inference yields immediately to live work.
- Final deployment smoke verifies service restart, LAN and WireGuard access, blocked public access, DeepSeek inference, VoidBot-grounded retrieval, scheduler continuation, state persistence, CultMesh/Eve publication, and exact deployed commit provenance.
- Final deployment smoke verifies explicit process restart, LAN and WireGuard access, blocked public access, DeepSeek inference, VoidBot-grounded retrieval, scheduler continuation, state persistence, CultMesh/Eve publication, and exact deployed commit provenance.
## Assumptions and exclusions

View file

@ -21,9 +21,13 @@ reversible gestalt materialization, isolated sessions/campaigns, CultMesh/Eve
publication, and away-time scheduling. Strategic ticks now use a flash-model
typed proposal; the WorldKernel forbids player puppeting, invented IDs,
unreachable movement, and unbounded information or population-pressure edits.
The active cut is acceptance and deployment truth: exercise live scheduled and
return-time ticks, the gestalt round trip, model failure, four-actor latency,
remote CultMesh publication, restart, and exact release provenance.
The implementation cut is closed. Final acceptance evidence covers hosted
VoidBot compilation, invite isolation, automatic gestalt presence, three NPC
reactions, a 15.16-second four-actor parallel wave, model-driven institutional,
gestalt, and remote-actor away simulation, exact-channel news, full workspace
tests, legacy Pallas/Lucent/Corvid validation, CultMesh publication, explicit
process restart, and exact release provenance. Future work belongs in a new
post-MVP plan rather than silently extending this one.
## Prior research-program phase

View file

@ -1,7 +1,7 @@
experiment:
name: Ghostlight
status: active_mvp_build
phase: ghostlight_dungeon_foundation
phase: ghostlight_dungeon_final_acceptance
premise: >
Build a durable research and implementation home for socially persistent
generative agents whose behavior emerges from personality, culture,
@ -67,13 +67,13 @@ live_architecture:
- One per-campaign WorldKernel mailbox owns canonical state and revision numbers.
- Every player, NPC, institution, scheduler, import, and reload transition uses the same typed WorldCommand validation and atomic CultCache commit path.
- Ghostlight owns generalized Projector to Persona to Interpreter machinery; consuming Personas retain their own canonical minds and commit authority.
- Epiphany will consume the extracted Ghostlight organ through a narrow adapter after her current machinery is mapped into move, stay, split, and delete decisions.
- Epiphany consumes the extracted Ghostlight projection crate at an exact Git revision while retaining her canonical Mind, effect admission, and consequence authority.
- Gestalt Personas own shared population state; first-relevance individuation and later folding are revisioned WorldKernel commits, and durable member deltas preserve specific people between appearances.
- Model-driven strategic ticks can change remote actors, institutions, gestalts, clocks, and exact-channel news while the absent player remains outside their write authority.
- Existing v0 training fixtures are regression evidence and have no runtime write authority.
persistence_spine:
- Ghostlight is migrating machine-managed persistent state behind `cultcache-py`, linked as `vendor/cultcache-py`.
- `state/ghostlight-state.cultcache.jsonl` is the current CultCache-backed store for migrated branch and evidence records.
- `state/branches.json` and `state/evidence.jsonl` remain readable export surfaces during migration so humans, diffs, and older validators do not lose the plot.
- New persistent state seams should use `tools/ghostlight_state_store.py` instead of direct file writes.
- The hosted runtime uses Rust CultCache/redb `.cc` stores: one store per campaign plus service auth and CultMesh stores.
- `state/ghostlight-state.cultcache.jsonl`, `state/branches.json`, and `state/evidence.jsonl` belong to the older research pipeline and have no hosted runtime authority.
- `schemas/agent-state.schema.json` is also the first shared cross-runtime payload contract. CultNet clients should move `ghostlight.agent_state.v0` documents unchanged inside typed document envelopes instead of inventing forked state ontologies per repo.
state_model:
- Layer personality through organization, disposition, behavior, presentation, situational activation, relationships, goals, and values.
@ -255,5 +255,5 @@ data_flow:
current_status:
summary: GhostlightDungeon is the active MVP program. The approval-gated compiler persists exact VoidBot evidence, canon candidates, bounded topology, gestalt baselines, and durable member deltas. Fiction-first player and NPC attempts use deterministic initiative, model assessment, server-side d20, and prevalidated typed outcome deltas. Present NPCs appraise events in parallel; gestalt populations materialize durable individuals and fold them back without losing identity. Ghostlight owns the generalized Persona projection membrane and Epiphany consumes it at an exact Git revision. CampaignRegistry isolates per-campaign stores/mailboxes and sessions. CultMesh/Eve publication owns hosted state sight. Away-time ticks now use revision-bound flash-model strategic proposals validated by WorldKernel; invalid plans, player puppeting, invented IDs, and unreachable movement cannot mutate state.
next_action: Run authenticated live scheduler/return-catch-up and four-actor latency acceptance, then connect the published local CultMesh/Eve state to Odin when a Starfire Odin RUDP catalog is listening. Restart, scoped LAN/WireGuard firewall, exact-release provenance, model-failure isolation, and gestalt round-trip are verified.
next_action: Preserve the final deployed release and acceptance receipts, then treat additional rulesets, Vault adapters, multiplayer, and richer Persona projections as post-MVP work requiring a new authority map.
gestalt_population: Gestalt Personas own shared population baselines; persistent member deltas own named individuality; WorldKernel materialization commands compose and demote active actors without deleting member identity.