Merge ghostlight-verse/zero-drama-play-cleanup: strict play.rs schema refusal, drop dead HeimdallDependencyBinding, untrack probe PNGs, sync docs
# Conflicts: # AGENTS.md
3
.gitignore
vendored
|
|
@ -11,3 +11,6 @@ target/
|
|||
|
||||
# Claude Code agent worktrees (Hands/Soul isolation); never source
|
||||
.claude/worktrees/
|
||||
|
||||
# Captured probe screenshots (scripts and fixtures under probes/page/ stay tracked)
|
||||
probes/page/*.png
|
||||
|
|
|
|||
29
AGENTS.md
|
|
@ -5,15 +5,17 @@
|
|||
Ghostlight is a Rust world kernel and the play daemon built on it. Models
|
||||
propose; the kernel admits or refuses. The same kernel is meant to run the
|
||||
simulation behind Aetheria's public story, a persistent cast and storylets, as
|
||||
well as Ghostlight Dungeon, the single-player DM-led client (parked at
|
||||
tag `parked/ghostlight-eve-surface`). `README.md` says
|
||||
what exists today and what does not.
|
||||
well as Ghostlight Dungeon (`crates/ghostlight-dungeon` and
|
||||
`deployment/idunn/recipe.toml`, live on `main` for the Dungeon playtest; the
|
||||
earlier Eve surface is at tag `parked/ghostlight-eve-surface`). `README.md`
|
||||
says what exists today and what does not.
|
||||
|
||||
## Where State Lives
|
||||
|
||||
- Campaign state (targets, rulings, cut specs, reports, verdicts, findings,
|
||||
follow-ups) lives in the Eureka mind, not in this repo. The current campaign
|
||||
is `ghostlight-verse`; query it through the `eureka-state` tools.
|
||||
is `ghostlight-verse`; query it through the `huginn` CLI
|
||||
(`EUREKA_INSTANCE=weksa`, `HUGINN_ENDPOINT=rudp://10.77.0.1:17877`).
|
||||
- `notes/ghostlight-verse-target.md` and `notes/ghostlight-verse-map.md` are the
|
||||
campaign's prose target and map. Read the map for probed body facts.
|
||||
- This repo has no state directory, no state CLI, and no evidence ledger. Do not
|
||||
|
|
@ -56,20 +58,23 @@ what exists today and what does not.
|
|||
- Kernel: `crates/ghostlight/src/`. Its vocabulary and current mechanism:
|
||||
`docs/architecture/ghostlight-world-ontology.md`. The consumer contract:
|
||||
`docs/architecture/ghostlight-world-consumer-api.md`.
|
||||
- Parked Dungeon (daemon, play table, Eve surface, browser host, Idunn recipe):
|
||||
tag `parked/ghostlight-eve-surface`; not on main.
|
||||
- Dungeon daemon and Idunn recipe: `crates/ghostlight-dungeon/` and
|
||||
`deployment/idunn/recipe.toml` (the earlier Eve surface is at tag
|
||||
`parked/ghostlight-eve-surface`).
|
||||
- Persona membrane: `crates/ghostlight-persona-projection/src/lib.rs`.
|
||||
- Architecture rationale (the parked Dungeon's): `docs/architecture/ghostlight-dungeon-mvp.md`.
|
||||
- Architecture rationale (earlier Dungeon / parked Eve surface design record):
|
||||
`docs/architecture/ghostlight-dungeon-mvp.md`.
|
||||
`notes/ghostlight-implementation-plan.md` is the historical plan of the 2026-09
|
||||
rebuild, not the current plan.
|
||||
|
||||
## Build, Verify, Deploy
|
||||
|
||||
Nothing deploys from this repo: the Idunn target `ghostlight` is braked and stopped (deployment and
|
||||
lifecycle brakes engaged, unit stopped; retirement waits on
|
||||
`ghostlight-verse:follow_up:idunn-v2-target-retirement`) and no recipe exists on main. Kernel and verse tests run on Linux on Yggdrasil (the
|
||||
`ygg-verify` stopgap), not on the workstation; a Windows compile is not evidence
|
||||
about Linux, so say which host you used. Do not run `idunn up ghostlight`.
|
||||
`crates/ghostlight-dungeon` deploys to Yggdrasil from `deployment/idunn/recipe.toml`
|
||||
for the Dungeon playtest (brake release admitted in
|
||||
`ghostlight-verse:ruling:ghostlight-brake-release-granted`). Kernel, verse, and
|
||||
Dungeon tests run on Linux on Yggdrasil (the `ygg-verify` stopgap), not on the
|
||||
workstation; a Windows compile is not evidence about Linux, so say which host you
|
||||
used.
|
||||
|
||||
For infrastructure, SSH, Idunn, Odin, or Heimdall work, consult
|
||||
`F:\Projects\gamecult-ops` before acting.
|
||||
|
|
|
|||
28
README.md
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
**Ghostlight is a world kernel: typed world state that a language model can
|
||||
propose changes to and can never write.** The valuable part is
|
||||
`crates/ghostlight`. The Dungeon game, one client of it, is parked (below).
|
||||
`crates/ghostlight`. The live Dungeon playtest daemon (`crates/ghostlight-dungeon`,
|
||||
below) is one client of it; the earlier Eve surface is parked.
|
||||
|
||||
**The thesis.** World state is typed documents. Every change to it, and every
|
||||
narrative dependency on it, is an operation in a closed, predefined algebra.
|
||||
|
|
@ -13,9 +14,9 @@ committed. A model-as-game-master holds the world in a context window and
|
|||
drifts; here the world is a digest-chained journal that survives restarts and
|
||||
cannot be talked into contradicting itself.
|
||||
|
||||
**Use it as a structured state backend.** Do not judge it by the parked Dungeon's
|
||||
prose. The kernel is a library; prose comes from whichever model you plug into
|
||||
its ports.
|
||||
**Use it as a structured state backend.** Do not judge it by the Dungeon playtest's
|
||||
or the earlier parked Eve surface's prose. The kernel is a library; prose comes
|
||||
from whichever model you plug into its ports.
|
||||
|
||||
- `crates/ghostlight`: the sealed library. A consumer gets create/open
|
||||
(`WorldMailbox::open`, `create`), immutable snapshots (`snapshot`), command
|
||||
|
|
@ -71,22 +72,24 @@ advances it a number of ticks under a token cap, reporting per tick what each
|
|||
faction did and what it cost. Nothing loads AetheriaLore prose, models
|
||||
storylets, or produces episodes yet. Targets: `notes/ghostlight-verse-target.md`.
|
||||
|
||||
## Ghostlight Dungeon (parked)
|
||||
## Ghostlight Dungeon
|
||||
|
||||
The single-player, DM-led client and its daemon, Eve play surface and browser
|
||||
host are parked at tag `parked/ghostlight-eve-surface`. Nothing is deployed and
|
||||
nothing on main serves HTTP. The Dungeon returns when Thing 2 gives it a UI
|
||||
(follow-up `dungeon-ui-on-thing2`); the rebuild starts from the tag.
|
||||
`crates/ghostlight-dungeon` and `deployment/idunn/recipe.toml` are live on `main`
|
||||
for the Dungeon playtest: one Rust binary serving the compiled browser page,
|
||||
the Deru HTTPS API, and the Idunn/Odin CultNet runtime-presence endpoints. The
|
||||
earlier Eve surface remains at tag `parked/ghostlight-eve-surface` as history.
|
||||
|
||||
## Repo map
|
||||
|
||||
| Path | What it is |
|
||||
|---|---|
|
||||
| `crates/ghostlight/` | The sealed kernel library. |
|
||||
| `crates/ghostlight-dungeon/` | The live Dungeon playtest daemon (HTTP/browser surface, Heimdall sign-in, Idunn/Odin presence). |
|
||||
| `crates/ghostlight-persona-projection/` | Membrane between structured state and a prose-only Persona. |
|
||||
| `crates/ghostlight-verse/` | The `ghostlight-verse` operator command line (`genesis`, `run`). |
|
||||
| `deployment/idunn/` | Idunn deployment recipe (`recipe.toml`) for the Dungeon playtest on Yggdrasil. |
|
||||
| `AGENTS.md` | Invariants and where things are. |
|
||||
| `docs/architecture/ghostlight-dungeon-mvp.md` | The parked Dungeon's authority architecture (design record). |
|
||||
| `docs/architecture/ghostlight-dungeon-mvp.md` | Earlier Dungeon / parked Eve surface authority architecture (design record). |
|
||||
| `notes/` | The verse campaign's target and map, the handoff pointer, local smoke notes. |
|
||||
|
||||
`docs/public-architecture/`, `docs/articles/` and `docs/product/` are design
|
||||
|
|
@ -96,13 +99,14 @@ running machine. Pages ending in `-cut.md` or `-postmortem.md` are dated history
|
|||
|
||||
## Build and test
|
||||
|
||||
Nothing deploys from this repo. Linux verification runs on Yggdrasil, not on a
|
||||
workstation:
|
||||
Dungeon deploys to Yggdrasil through Idunn from `deployment/idunn/recipe.toml`.
|
||||
Linux verification runs on Yggdrasil, not on a workstation:
|
||||
|
||||
```sh
|
||||
cargo build --locked --workspace
|
||||
cargo test --locked -p ghostlight-persona-projection
|
||||
cargo test --locked -p ghostlight
|
||||
cargo test --locked -p ghostlight-dungeon
|
||||
cargo test --locked -p ghostlight-verse
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -261,25 +261,10 @@ pub struct HeimdallClient {
|
|||
jwks: Arc<StdMutex<JwksCache>>,
|
||||
}
|
||||
|
||||
/// Idunn's projection of a managed Heimdall dependency, when Heimdall is a
|
||||
/// v2-managed target (it is not, as of this cut: every v2 deploy of it has
|
||||
/// failed and it still runs as the legacy `heimdall.service`, so
|
||||
/// `runtime.rs` always passes `None` here). Not an Idunn dependency in
|
||||
/// `deployment/idunn/recipe.toml` right now, but the type stays owned here
|
||||
/// so `require_expected_heimdall_boundary` below can resume checking a
|
||||
/// discovered boundary against it the moment Heimdall returns as a managed
|
||||
/// dependency, without re-deriving this shape from scratch.
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub(crate) struct HeimdallDependencyBinding {
|
||||
pub(crate) provider_id: String,
|
||||
pub(crate) endpoint: SocketAddr,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
enum HeimdallBoundaryLocator {
|
||||
Odin {
|
||||
endpoint: SocketAddr,
|
||||
expected: Option<HeimdallDependencyBinding>,
|
||||
},
|
||||
#[cfg(test)]
|
||||
Fixed(ResolvedHeimdallBoundary),
|
||||
|
|
@ -562,11 +547,7 @@ impl VerifiedSessionRefresh {
|
|||
}
|
||||
|
||||
impl HeimdallClient {
|
||||
pub fn from_env(
|
||||
runtime_id: &str,
|
||||
odin_endpoint: SocketAddr,
|
||||
expected: Option<HeimdallDependencyBinding>,
|
||||
) -> anyhow::Result<Self> {
|
||||
pub fn from_env(runtime_id: &str, odin_endpoint: SocketAddr) -> anyhow::Result<Self> {
|
||||
if runtime_id.is_empty() || runtime_id.trim() != runtime_id {
|
||||
bail!("Ghostlight runtime identity is not canonical");
|
||||
}
|
||||
|
|
@ -594,7 +575,6 @@ impl HeimdallClient {
|
|||
providers,
|
||||
boundary_locator: HeimdallBoundaryLocator::Odin {
|
||||
endpoint: odin_endpoint,
|
||||
expected,
|
||||
},
|
||||
runtime_id: runtime_id.into(),
|
||||
shared_secret,
|
||||
|
|
@ -1023,13 +1003,7 @@ impl HeimdallBoundaryLocator {
|
|||
operation: &str,
|
||||
) -> anyhow::Result<ResolvedHeimdallBoundary> {
|
||||
let boundary = match self {
|
||||
Self::Odin { endpoint, expected } => {
|
||||
let boundary = discover_heimdall_boundary(*endpoint, runtime_id)?;
|
||||
if let Some(expected) = expected {
|
||||
require_expected_heimdall_boundary(&boundary, expected)?;
|
||||
}
|
||||
boundary
|
||||
}
|
||||
Self::Odin { endpoint } => discover_heimdall_boundary(*endpoint, runtime_id)?,
|
||||
#[cfg(test)]
|
||||
Self::Fixed(boundary) => boundary.clone(),
|
||||
};
|
||||
|
|
@ -1044,16 +1018,6 @@ impl HeimdallBoundaryLocator {
|
|||
}
|
||||
}
|
||||
|
||||
fn require_expected_heimdall_boundary(
|
||||
boundary: &ResolvedHeimdallBoundary,
|
||||
expected: &HeimdallDependencyBinding,
|
||||
) -> anyhow::Result<()> {
|
||||
if boundary.daemon_id != expected.provider_id || boundary.endpoint != expected.endpoint {
|
||||
bail!("discovered Heimdall boundary differs from Expected");
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn discover_heimdall_boundary(
|
||||
odin_endpoint: SocketAddr,
|
||||
runtime_id: &str,
|
||||
|
|
@ -1610,17 +1574,6 @@ mod tests {
|
|||
assert_eq!(resolved.endpoint, "127.0.0.1:4101".parse().unwrap());
|
||||
assert_eq!(resolved.daemon_id, "yggdrasil-heimdall");
|
||||
assert_eq!(resolved.operations, vec!["heimdall.auth.begin"]);
|
||||
let expected = HeimdallDependencyBinding {
|
||||
provider_id: "yggdrasil-heimdall".into(),
|
||||
endpoint: "127.0.0.1:4101".parse().unwrap(),
|
||||
};
|
||||
require_expected_heimdall_boundary(&resolved, &expected)
|
||||
.expect("exact Expected Heimdall should match discovery");
|
||||
let substitute = HeimdallDependencyBinding {
|
||||
provider_id: "another-heimdall".into(),
|
||||
endpoint: expected.endpoint,
|
||||
};
|
||||
assert!(require_expected_heimdall_boundary(&resolved, &substitute).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -240,7 +240,7 @@ pub(crate) async fn run(state_root_binding: Option<PathBuf>) -> anyhow::Result<(
|
|||
// Heimdall is discovered through Odin at use and is not an Idunn
|
||||
// dependency; loopback-only, non-secret-bearing, app-bound envelopes are
|
||||
// enforced regardless.
|
||||
let heimdall = Arc::new(HeimdallClient::from_env(&runtime_id, odin_endpoint, None)?);
|
||||
let heimdall = Arc::new(HeimdallClient::from_env(&runtime_id, odin_endpoint)?);
|
||||
require_no_runtime_custody_failure(&mut fatal_events)?;
|
||||
let mut state = AppState {
|
||||
catalog: Arc::new(Mutex::new(catalog)),
|
||||
|
|
@ -435,8 +435,7 @@ async fn runtime_readiness(state: &AppState) -> anyhow::Result<Value> {
|
|||
let mut health = canonical_readiness(state).await?;
|
||||
let opened = state.timelines.opened().await;
|
||||
let mut controller_status = "ok";
|
||||
let mut play_status = "ok".to_owned();
|
||||
for (id, host) in &opened {
|
||||
for (_id, host) in &opened {
|
||||
match tokio::time::timeout(Duration::from_millis(100), host.controllers.custody_probe())
|
||||
.await
|
||||
{
|
||||
|
|
@ -446,17 +445,12 @@ async fn runtime_readiness(state: &AppState) -> anyhow::Result<Value> {
|
|||
}
|
||||
Err(_) => controller_status = "busy",
|
||||
}
|
||||
// A retired unreadable play row is reported, not hidden.
|
||||
if let Some(sidecar) = host.play.retired_row_sidecar() {
|
||||
play_status = format!("a play-turn row of {id} was retired to {}", sidecar.display());
|
||||
}
|
||||
}
|
||||
if state.timelines.shared().permits.available_permits() == 0 && controller_status == "ok" {
|
||||
controller_status = "active";
|
||||
}
|
||||
health["openTimelines"] = json!(opened.len());
|
||||
health["controllerStatus"] = Value::String(controller_status.into());
|
||||
health["playStatus"] = Value::String(play_status);
|
||||
Ok(health)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,19 +4,20 @@ This is a pointer. It does not carry open work; the Eureka mind does.
|
|||
|
||||
## What exists
|
||||
|
||||
Nothing is deployed. The Dungeon (daemon, play table, Eve surface, browser host,
|
||||
`vendor/eve`, Idunn recipe) is parked at the tag `parked/ghostlight-eve-surface`
|
||||
and is not on main. A Thing 2 rebuild starts from that tag.
|
||||
`crates/ghostlight-dungeon` and `deployment/idunn/recipe.toml` are live on `main`
|
||||
for the Dungeon playtest (brake release admitted in
|
||||
`ghostlight-verse:ruling:ghostlight-brake-release-granted`). The earlier Eve
|
||||
surface remains at tag `parked/ghostlight-eve-surface` as history.
|
||||
|
||||
What is in the tree is the kernel (`crates/ghostlight`), the persona projection
|
||||
(`crates/ghostlight-persona-projection`) and the verse runner
|
||||
(`crates/ghostlight-verse`). `cargo test` runs them on Linux; use the
|
||||
`ygg-verify` stopgap on Yggdrasil, not the workstation, and say which host
|
||||
you used.
|
||||
(`crates/ghostlight-persona-projection`), the verse runner
|
||||
(`crates/ghostlight-verse`), and the Dungeon daemon (`crates/ghostlight-dungeon`).
|
||||
`cargo test` runs them on Linux; use the `ygg-verify` stopgap on Yggdrasil, not
|
||||
the workstation, and say which host you used.
|
||||
|
||||
The Idunn target `ghostlight` is braked and stopped, not retired. Its state is in
|
||||
`gamecult-ops/runbooks/ghostlight-dungeon-yggdrasil.md`. Do not run
|
||||
`idunn up ghostlight`, the v1 actuator, or `ghostlight-dungeon.service`.
|
||||
Dungeon deployment and lifecycle on Yggdrasil are managed through Idunn from
|
||||
`deployment/idunn/recipe.toml` (runbook: `gamecult-ops/runbooks/ghostlight-dungeon-yggdrasil.md`).
|
||||
Do not run the legacy v1 actuator or `ghostlight-dungeon.service`.
|
||||
|
||||
## Where open work is
|
||||
|
||||
|
|
@ -33,12 +34,13 @@ target and probed body facts are `notes/ghostlight-verse-target.md` and
|
|||
2. `AGENTS.md`: invariants and where things are.
|
||||
3. `docs/architecture/ghostlight-world-ontology.md`: the kernel's vocabulary and
|
||||
current mechanism.
|
||||
4. `docs/architecture/ghostlight-dungeon-mvp.md`: the parked Dungeon's authority
|
||||
architecture. History until Thing 2 revives it.
|
||||
4. `docs/architecture/ghostlight-dungeon-mvp.md`: the earlier Dungeon / parked Eve
|
||||
surface authority architecture (historical design record; `crates/ghostlight-dungeon`
|
||||
is the live playtest daemon).
|
||||
5. `docs/architecture/ghostlight-play-agent-cut.md`: the dated record of the play
|
||||
agent and of the first deploy on 2026-09-23 (findings PA.f198 to PA.f216).
|
||||
It is history; the mind says which findings are still open.
|
||||
|
||||
`notes/local-live-smoke.md` covers bringing up the Claude SDK sidecar by hand.
|
||||
`notes/local-live-smoke.md` covers local loopback/hosted smoke runs.
|
||||
`notes/ghostlight-implementation-plan.md` is the historical plan of the 2026-09
|
||||
rebuild.
|
||||
|
|
|
|||
|
|
@ -281,7 +281,7 @@ One row per persistent kind phase 1 touches. No cell may be empty.
|
|||
| Kind | Named by | Life over time | Who decides |
|
||||
|---|---|---|---|
|
||||
| World state and commit journal (`.cc`, redb) | `WorldId`; `revision`; digest chain | created Draft, approved, activated; one commit row per admitted command; earlier schemas refused, never migrated | the kernel, through `WorldMailbox`'s closed operation set; untouched in phase 1 |
|
||||
| Play turn row (play-turn store `.cc`) | `turn_id` (UUID); per-turn `question_token` | `Running` → `AwaitingPlayer` ↔ `Running` → `Closed` (narration or `fault`); an unreadable row is retired to a sidecar and play starts fresh | `PlayTable` (`play.rs`); the card is a projection of `PlayTurnView`, which phase 1 extends with the fault |
|
||||
| Play turn row (play-turn store `.cc`) | `turn_id` (UUID); per-turn `question_token` | `Running` → `AwaitingPlayer` ↔ `Running` → `Closed` (narration or `fault`); earlier schemas and unreadable rows are refused on open, never migrated or retired to a sidecar | `PlayTable` (`play.rs`); the card is a projection of `PlayTurnView`, which phase 1 extends with the fault |
|
||||
| App session (`app-sessions-v2.cc`) | cookie hash; `heimdall_session_id` + `access_revision` | issued at sign-in; refreshed when access is near expiry; revoked on logout, custody change, invalid receipt, and (phase 1) on a refresh that can no longer succeed | `AppSessionOwner`; Heimdall decides the upstream session and rotates refresh tokens |
|
||||
| Heimdall private command receipt (Heimdall Postgres) | `(app_slug, idempotency_key)` + request fingerprint | written once per executed command; replayed for an identical request; a different request under the key is refused | Heimdall; its fingerprint rule is a Heimdall follow-up, not a phase-1 cut |
|
||||
| Idunn generation (transient unit, release dir) | `sha256-<release>` | staged → started → Warming → lease → Active → superseded or failed; the previous Active stays until a new one is Ready | Idunn; retention and failed-unit collection are Idunn's follow-up |
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 128 KiB |
|
Before Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 111 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 307 KiB |
|
Before Width: | Height: | Size: 312 KiB |