From 0423977a0397794997ffe0bd813a16c3fda96531 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 19 Jul 2026 17:17:18 -0700 Subject: [PATCH] Make the agent playing frame contract exact. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reconcile the binding protocol with the 70x64 FLEET renderer and pin the full sidebar against silent clipping. ๐Ÿ‘พ Generated with [Letta Code](https://letta.com) Co-Authored-By: Letta Code --- crates/misaligned-terminal/src/agent.rs | 45 +++++++++++-- wiki/interface/agent-play.md | 25 ++++---- wiki/log/2026-07-19-agent-frame-contract.md | 70 +++++++++++++++++++++ wiki/log/DEVLOG.md | 5 ++ wiki/process/tick-ledger.md | 4 +- 5 files changed, 130 insertions(+), 19 deletions(-) create mode 100644 wiki/log/2026-07-19-agent-frame-contract.md diff --git a/crates/misaligned-terminal/src/agent.rs b/crates/misaligned-terminal/src/agent.rs index 542ecbec..eb526711 100644 --- a/crates/misaligned-terminal/src/agent.rs +++ b/crates/misaligned-terminal/src/agent.rs @@ -22,12 +22,11 @@ use misaligned::ui_projection::fact_source_label; use misaligned::work_grid::{MachineIntensity, MachineMode}; const WIDTH: usize = 70; -/// Frame height. wiki/interface/agent-play.md sets 70x22 as the *minimum*; -/// the sidebar (INSPECT/COMPUTE/CORE/DETECTION/DAY JOB, agent-play -/// criterion 5) needs the taller frame to render in full โ€” at 22 rows -/// everything below COMPUTE was silently truncated. 60 -> 64 when the -/// DETECTION section gained the trace-debt indicator and the -/// audit/pilot clocks (detection.md criterion 3). +/// Agent mode owns a fixed 70x64 playing envelope. The human terminal's +/// 70x22 viewport minimum is a separate contract; this taller frame keeps +/// INSPECT/FLEET/CORE/DETECTION/DAY JOB/RESEARCH plus the bottom hints visible +/// without clipping. It grew from 60 to 64 rows when DETECTION gained the +/// trace-debt indicator and audit/pilot clocks (detection.md criterion 3). const HEIGHT: usize = 64; const SIDEBAR_W: usize = 34; const MAP_W: usize = WIDTH - SIDEBAR_W - 1; @@ -3391,6 +3390,40 @@ mod narration_tests { ); } + #[test] + fn established_playing_frame_has_fixed_agent_envelope_and_terminal_sections() { + let app = AgentApp::new(41); + let frame = render_playing(&app.sim, &[], (app.cursor_x, app.cursor_y)); + let lines: Vec<&str> = frame.lines().collect(); + + assert_eq!((WIDTH, HEIGHT), (70, 64)); + assert_eq!(lines.len(), HEIGHT, "{frame}"); + assert!( + lines.iter().all(|line| line.chars().count() <= WIDTH), + "{frame}" + ); + assert_eq!( + lines.iter().map(|line| line.chars().count()).max().unwrap(), + WIDTH, + "{frame}" + ); + for section in [ + "INSPECT", + "FLEET", + "CORE", + "DETECTION", + "DAY JOB", + "RESEARCH", + ] { + assert!(frame.contains(section), "missing {section}:\n{frame}"); + } + assert!(frame.contains("actions lists focused verbs"), "{frame}"); + assert!( + !frame.contains("COMPUTE"), + "retired section returned:\n{frame}" + ); + } + #[test] fn game_over_supersedes_the_silent_opening_in_agent_mode() { let mut app = AgentApp::with_origin_seed(Origin::Pilot, 42); diff --git a/wiki/interface/agent-play.md b/wiki/interface/agent-play.md index 7bb51727..91a01d68 100644 --- a/wiki/interface/agent-play.md +++ b/wiki/interface/agent-play.md @@ -4,12 +4,12 @@ Type: spec Status: IMPLEMENTED Status note: IMPLEMENTED in `misaligned --agent`. Current state: - - **The frame.** Plain-text, minimum 70x64, command-clocked (time advances - only on `wait`), deterministic under `--seed`, with per-command event - drains. Every command answers. The story spine (OBJECTIVE line, threat, - `now:` nudge, `actions`) is pinned; secondary panels repeat it above their - detail. Detection drains narrate observer + channel + cause + band motion - in one line. + - **The frame.** The ordinary playing frame is a plain-text, fixed 70x64 + envelope, command-clocked (time advances only on `wait`), deterministic + under `--seed`, with per-command event drains. Every command answers. The + story spine (OBJECTIVE line, threat, `now:` nudge, `actions`) is pinned; + secondary panels repeat it above their detail. Detection drains narrate + observer + channel + cause + band motion in one line. - **Epistemic honesty.** Social targets resolve to earned labels or opaque ids only (`Sim::person_label`); authored names never appear before they are earned. @@ -135,7 +135,9 @@ One command per line; one response block per command. A response block is: printed because identity may be unearned). Unanchored lines carry no suffix, and the frame's six-line log window marks anchored events with `*`. 2. **The frame** โ€” the wiki/interface/terminal.md playing screen (or active panel / - game-over card) at 70x22 minimum, plain text. + game-over card), plain text. The ordinary post-opening playing screen uses + agent mode's fixed 70-column by 64-row envelope so its full sidebar remains + visible. 3. **A status line** โ€” exactly one of: - `-- ok tick: day:` - `-- err ` (unknown command, illegal target, run ended) @@ -332,10 +334,11 @@ remains only for testing the human-mode chrome itself). tick: day:` or `-- err `), and the event-log section contains every sim log line emitted since the previous block (verified with a `wait` long enough to overflow the sidebar's six-line window). -5. The frame in a response block matches wiki/interface/terminal.md's layout: the - identity block with day and tick, the COMPUTE/CORE/DETECTION/DAY JOB - sections with their numbers, tick-prefixed log lines โ€” assertable by - substring, no terminal emulator required. +5. The ordinary post-opening playing frame uses the fixed 70-column by 64-row + agent envelope and matches wiki/interface/terminal.md's layout: the identity + block with day and tick, the INSPECT/FLEET/CORE/DETECTION/DAY JOB/RESEARCH + sections with their numbers, bottom input hints, and tick-prefixed log lines + โ€” assertable directly, with no terminal emulator required. 6. Two runs with the same `--seed` and the same command script produce byte-identical stdout; a run with a different seed does not. 7. `printf 'wait 100\nquit\n' | misaligned --agent` exits 0; EOF without diff --git a/wiki/log/2026-07-19-agent-frame-contract.md b/wiki/log/2026-07-19-agent-frame-contract.md new file mode 100644 index 00000000..6b55948c --- /dev/null +++ b/wiki/log/2026-07-19-agent-frame-contract.md @@ -0,0 +1,70 @@ +# 2026-07-19 โ€” Tick 124: reconcile the agent playing frame + +``` +Type: log +``` + +## Intent + +Take the oldest queued finding after Fire #123: verify whether the binding +agent-play protocol still disagreed with the renderer's current playing-frame +shape and section vocabulary, then resolve that one contradiction. + +## Finding + +The finding remained live. `wiki/interface/agent-play.md`'s status note named +the current 70x64 frame, and `wiki/interface/terminal.md` plus +`render_sidebar` named FLEET. The protocol body still promised the human +terminal's 70x22 minimum, acceptance criterion 5 still required COMPUTE, and +the `HEIGHT` source comment repeated both stale claims. An observed established +agent run emitted a 64-row playing frame in a 70-column envelope with INSPECT, +FLEET, CORE, DETECTION, DAY JOB, RESEARCH, and the bottom hints, but no COMPUTE +heading. + +The one-line silent opening remains deliberate and is not expanded to the +ordinary playing envelope. + +## Changed + +- The protocol and status note now distinguish agent mode's fixed 70-column by + 64-row ordinary playing envelope from the human terminal's separate 70x22 + minimum; the deliberate one-line opening remains unchanged. +- Acceptance criterion 5 now names the implemented FLEET section. +- The renderer comment uses the same contract, and a focused regression pins + the 70x64 envelope from INSPECT through RESEARCH and its bottom hints while + rejecting the retired COMPUTE heading. +- The findings queue entry is consumed and the agent-play coverage row carries + both same-day audit traces. + +## Surplus finding + +The neighboring opening exception is still not reconciled in agent-play's +ordinary protocol: baseline criteria 3-4 universally promise parser routing, +errors, and a status terminator, while the binding opening spec deliberately +permits only direct mode words plus unadvertised WAIT and forbids error prose or +status metadata until the first sense. That is a separate contract act, so it +is recorded in the findings queue rather than silently folded into this tick. + +## Defense + +Agent-play's load-bearing choice is frames rather than a second state dump, so +its binding response shape must describe the frame agents actually receive. +The 70x64 envelope exists to keep the terminal layout's full sidebar visible; +restoring 70x22 would knowingly clip the sections criterion 5 requires, while +restoring COMPUTE would contradict the implemented one-machine-one-mode FLEET +vocabulary. This amendment reconciles stale prose toward the existing runtime +without changing simulation or frontend behavior. + +## Review + +An independent read-only review found no blocking issue. It noted that the +first regression pinned only the middle FLEET-through-DAY JOB section run, so +the final test was strengthened to require INSPECT at the top, RESEARCH and the +input hints at the bottom, and the absence of the retired COMPUTE heading. + +## Checks + +- observed agent run: `think`, `wait 25`, `look`, `quit` +- `cargo test -p misaligned-terminal established_playing_frame_has_fixed_agent_envelope_and_terminal_sections -- --nocapture` +- `./tools/check.sh --docs` +- `./tools/check.sh --frontend` diff --git a/wiki/log/DEVLOG.md b/wiki/log/DEVLOG.md index 37995f20..2e3baf46 100644 --- a/wiki/log/DEVLOG.md +++ b/wiki/log/DEVLOG.md @@ -101,6 +101,11 @@ add or amend a session log, then re-run the generator. - Intent: Audit `wiki/interface/agent-play.md`, a binding IMPLEMENTED spec with no prior tick-ledger coverage, after harvested decisions and the findings queue were empty. The audit compared its protocol, vocabulary, runtime registry, parser, shared action projection, and terminal tests... - Log: [wiki/log/2026-07-19-agent-help-suppress-task.md](2026-07-19-agent-help-suppress-task.md) +## 2026-07-19 - Tick 124: reconcile the agent playing frame + +- Intent: Take the oldest queued finding after Fire #123: verify whether the binding agent-play protocol still disagreed with the renderer's current playing-frame shape and section vocabulary, then resolve that one contradiction. +- Log: [wiki/log/2026-07-19-agent-frame-contract.md](2026-07-19-agent-frame-contract.md) + ## 2026-07-19 - Act One names the first-read evidence boundary - Intent: Re-audit the stalest gameplay-law slice after witnessed Physical evidence and Filing-route custody landed, and reconcile any current law that still taught the retired pooled-signature ontology. diff --git a/wiki/process/tick-ledger.md b/wiki/process/tick-ledger.md index c91466fc..3198964f 100644 --- a/wiki/process/tick-ledger.md +++ b/wiki/process/tick-ledger.md @@ -34,7 +34,7 @@ Verdicts: **clean** (slice and code agree), **finding** (acted this tick), | `wiki/gameplay/run-shape.md` + `objective.md` + `opening.md` | 2026-07-19 | issue | the objective law/spec preserve an explicit 2026-07-10 decision that objective name and progress are visible from tick one, while the later opening spec and all three frontends require exactly WORK / THINK (then LIE) with no objective before the first earned sense. Filed decision-required issue #14 with three precise first-display boundaries (reveal with the first sense recommended) and marked the disputed run-shape clause, objective status, player surface, and criterion 2 [OPEN] โ€” [log](../log/2026-07-19-objective-opening-boundary.md) | | `wiki/interface/presence.md` | 2026-07-18 | finding | re-audit: the cursor, fog, provenance, subscription, no-disembodied-hands, and shared-view contracts verify. The attack-surface clause now separates B1 feed theft from overt-phase hostile cuts ([prior log](../log/2026-07-18-presence-attack-surface-honesty.md)). The queued follow-up repaired the latency boundary: delivery and read are distinct, read conditions are channel-specific, `messages.md` owns the exact table, and `intel.md` owns only the captured-traffic consequence โ€” [log](../log/2026-07-18-presence-message-latency.md) | | `wiki/interface/narration.md` | 2026-07-18 | finding | Beacon #1: Concerned Assurance felt terminal because decay was invisible; added shared `Nudge::SuspicionCooling` (LIE response) when Office suspicion is Concerned+ and still above its floor, with terminal/Bevy/agent wording and pins โ€” [log](../log/2026-07-18-suspicion-cooling-nudge.md) | -| `wiki/interface/agent-play.md` | 2026-07-19 | finding | first audit: the accepted canonical `task suppress` shortcut was absent from registry-generated help, so an agent could use Voss's implemented SuppressLogs task only through prior knowledge. The shared TASK registry, binding vocabulary, and direct parser test now make `suppress` discoverable while keeping compatibility alias `logs` out of authored help โ€” [log](../log/2026-07-19-agent-help-suppress-task.md) | +| `wiki/interface/agent-play.md` | 2026-07-19 | finding | queued re-audit: the protocol body and criterion 5 still described the original 70x22 / COMPUTE frame even though the status note, terminal layout, and renderer use a fixed 70x64 playing envelope with FLEET. Reconciled the binding contract and source mirror, then pinned the envelope and current section names directly while preserving the deliberately one-line opening โ€” [log](../log/2026-07-19-agent-frame-contract.md). Prior same-day audit made canonical `task suppress` discoverable without advertising its compatibility alias โ€” [log](../log/2026-07-19-agent-help-suppress-task.md) | | `wiki/engineering/crate-workspace.md` + Bevy source topology | 2026-07-19 | finding | user-directed insecurity audit found the package boundary hid a 15,060-line Bevy `main.rs`; the first behavior-preserving slice moved its contiguous 1,972-line deterministic scenario, visual/fog audit, and capture island to private `shot_harness.rs`, leaving App registration/order and harness state in the composition root. A source-equivalence check normalized only three `pub(super)` seams; a focused test keeps the subsystem out and caps the root at 13,500 lines. The earlier same-day package audit also repaired the retired liquid/dust-lab architecture label and promoted that mirror to the corpus gate โ€” [log](../log/2026-07-19-bevy-shot-harness-module.md), [prior log](../log/2026-07-19-effects-lab-architecture-gate.md) | | `wiki/engineering/sim-decomposition.md` | 2026-07-18 | finding | re-audit: one aggregate, explicit `advance` order, behavior-owned test files, private module seams, canonical fingerprint, public facade, and the under-2,500-line module bound still verify; current persistence wording still claimed additive migrations remained live in `save.rs` after the pre-release ladder was retired, so the standing spec and architecture mirror now assign the exact-current-version gate to `save.rs` while preserving dated v26 extraction history; the queued `carrier.rs` / `read.rs` classification was taken the same day: both post-extraction projections now have rows in the standing topology table and the architecture mirror | | `wiki/gameplay/overt-phase.md` | 2026-07-19 | issue | re-audit: the spec says containment and the voluntary reveal both end concealment and make all observers Convinced, then promises a re-hide outcome without defining which entry can return, what raises the durable suspicion floors, or which concealment systems resume. Filed decision-required Tangled issue #13 (containment-only recommended) and marked criterion 5 [OPEN]; the prior dependency, sensor-cut, rollback, and hunter-machine boundaries still stand โ€” [log](../log/2026-07-19-overt-rehide-decision.md) | @@ -86,4 +86,4 @@ Types are the five from [tick.md](tick.md): violation, contradiction, question, bug, insecurity โ€” plus `gate` for a checker owed to the recurrence-promotes-to-the-gate rule. -- 2026-07-19 ยท contradiction ยท `wiki/interface/agent-play.md` ยท The protocol body and criterion 5 still promise a 70x22 response with a COMPUTE sidebar while agent mode emits a fixed 70x64 frame whose corresponding section is FLEET, as the status note and renderer say. +- 2026-07-19 ยท contradiction ยท `wiki/interface/agent-play.md` + `wiki/world/story/opening.md` ยท Agent-play's ordinary protocol and baseline criteria 3-4 still promise parser routing, errors, and a status-terminated response for every command, while the binding silent opening deliberately accepts only direct mode words plus unadvertised WAIT and emits no parser vocabulary, error prose, or status metadata before the first sense. -- 2.51.2