Skip to content

T27: the Mission panel and the Braid line; the ops dashboard retired (#43) - #191

Merged
superposition merged 2 commits into
mainfrom
ticket/T27
Sep 11, 2026
Merged

superposition merged 2 commits into
mainfrom
ticket/T27

Conversation

@superposition

Copy link
Copy Markdown
Owner
agent: TicketT27
branch: ticket/T27
commit: 97a5f55
state: review
next: rebase onto main once #188 (T24b) merges, then cargo test -p qualia-watch and the Pinkie smoke
blocked_on: #188 (T24b, qualia_braid::BeliefClock); this branch also needed #150 (T19, merged)
evidence: this PR

What this is

Step 27 (#43): runners/watch gains the Mission panel and the Braid line, and the ops
dashboard's last references leave the tree.

  • Mission panel — tab 8, GET /braid. It draws the braid body field for field
    (schema_version, session_id, generation, open_missions, last_promotion_ns,
    last_quarantine_ns, the wire shape T19 qualia-braid state machine #34/T20 Strands emit events; GET /braid #35 fixed as qualia.braid-state.v1), names the agent it
    asked, and when the agent is not answering replaces the state with the reason. The poll is a
    blocking reqwest client on a worker thread feeding the render loop through one channel — the
    shape docs/frontend-lessons.md source 2 keeps from the ops dashboard — so a dead or slow agent
    degrades a line instead of stalling the panel.
  • Braid line — in the chrome, always visible: braid gen {n} · belief lag: {ms} ms. The value is
    Step 24b's qualia_braid::BeliefClock::new(&shm).decision_latency_ns() (ns → whole ms); the
    generation prefix is source 2's requirement that the chrome say which stack it is watching.
  • The existing ledger/weights/world panels and the child supervision are unchanged. format_clock
    moved from main.rs to view.rs so the Mission rows are formatted where they are asserted (one
    call site updated).
  • grep -rn QUALIA_OPS_URL returns nothing: the only file still carrying it was
    docs/frontend-lessons.md, now reworded. runners/ops, its workspace member and the
    runners/README.md row were never carried in this repository and are still absent, so there is no
    deletion to make; its stack survives only as the fallback Step 26 named.

Files beyond the ticket's runners/watch/src/main.rs, all forced: src/braid.rs + tests/braid.rs
(the crate's own doc says the library holds what is testable without a TTY, and the panel's rendering
is what the acceptance asks to see), src/view.rs (the four-edit panel convention documented there),
Cargo.toml/Cargo.lock (the reqwest and qualia-braid dependencies) and
docs/frontend-lessons.md (the ticket's own grep test).

Blocked on #188 (T24b)

This branch calls qualia_braid::BeliefClock, which is not on main yet — #150 (T19, the braid
state machine) has merged, #188 (T24b, the belief clock) is open. Until it lands the package does not
compile against main alone; that is the expected red state, and it is the only reason. Nothing else
here depends on an unlanded ticket. Verified locally against the sanctioned overlay of #150 + #188
(scratch tree, nothing outside runners/watch/** committed):

$ cargo test -p qualia-watch -j 2                      # overlay: main + 9e7a304 + 923606e
    Finished `test` profile ... in 3.55s
     Running tests\braid.rs
running 6 tests
test panel_names_the_agent_and_the_reason_when_it_is_missing ... ok
test panel_rows_carry_the_braid_and_an_open_mission ... ok
test the_braid_line_renders_whole_milliseconds_and_the_generation ... ok
test the_mission_row_spells_out_the_empty_case ... ok
test poller_takes_the_agents_view_off_the_wire ... ok
test poller_reports_an_agent_that_is_not_there ... ok
test result: ok. 6 passed; 0 failed
     Running tests\ring.rs      ... 20 passed; 0 failed
     Running tests\view.rs      ... 10 passed; 0 failed
EXIT=0

The panel, live

The shipped target/debug/qualia-watch.exe run in a PTY against a stub GET /braid on
http://127.0.0.1:8080 (empty stack manifest, /qualia_t27_smoke), 8 pressed to select the panel.
The harness flattens cursor moves in the PTY log, so the differential writes appear in place; the
panel and the chrome read:

with a mission (open_missions: 1, last_quarantine_ns: null)

┌ Mission · GET/braid ──────────────────────────────────────────────────────────────┐
│  agent       http://127.0.0.1:8080
│  session     sess-2026-09-11-explore-frontier
│  generation  12
│  missions    1 open
│  promotion   00:00:00.000
│  quarantine  never
│  schema      qualia.braid-state.v1
└───────────────────────────────────────────────────────────────────────────────────┘
  shm /qualia_t27_smoke │ up 00:00:00 │ ledger 0 │ layer 0 superposition│ braid gen 12 · belief lag: 0 ms

without a mission (open_missions: 0, last_quarantine_ns: 1789081200000000000)

┌ Mission · GET/braid ──────────────────────────────────────────────────────────────┐
│  agent       http://127.0.0.1:8080
│  session     sess-2026-09-11-explore-frontier
│  generation  12
│  missions    none open
│  promotion   00:00:00.000
│  quarantine  23:00:00.000
│  schema      qualia.braid-state.v1
└───────────────────────────────────────────────────────────────────────────────────┘
  shm /qualia_t27_smoke2 │ up 00:00:00 │ ledger 0 │ layer 0 superposition│ braid gen 12 · belief lag: 0 ms

and with the stub stopped, the same panel degrades to state unreachable: tcp timeout with the
chrome falling back to braid gen unknown · belief lag: 0 ms. The braid lag stays live in every
state because it is read from the local SHM region, not from the agent.

Provenance

$ cd C:/Users/ericm/wt/T27 && python C:/tmp/gate.py
provenance: compared 134 authored file(s) (1 generated skipped); 0 byte-identical, 6 code runs over 20, 0 prose runs over 2
provenance: OK
$ echo $?
0

Closes #43

Step 27: runners/watch gains the two operator surfaces the plan names, and the
ops dashboard's last references leave the tree.

- Mission panel (tab 8, reading GET /braid): the braid's session, generation,
  open missions, promotion and quarantine stamps and schema_version, drawn from
  the agent's wire body (`qualia.braid-state.v1`); an agent that is not
  answering degrades the panel to the reason instead of blanking it. The poll is
  a blocking client on a worker thread, the shape the ops dashboard used
  (`docs/frontend-lessons.md`, source 2).
- Braid line in the chrome: `braid gen {n} · belief lag: {ms} ms`, the value
  from Step 24b's `qualia_braid::BeliefClock::decision_latency_ns()`; the
  generation prefix is source 2's "the chrome names which stack it is watching".
- `QUALIA_OPS_URL` is gone (from `docs/frontend-lessons.md`, the only file that
  still carried it), so `grep -rn QUALIA_OPS_URL` returns nothing. `runners/ops`,
  its workspace member and the `runners/README.md` row were never carried in
  this repository and are still absent; its stack survives only as the fallback
  Step 26 named.

Files beyond the ticket's `runners/watch/src/main.rs`, all forced:
`src/braid.rs` and `tests/braid.rs` (this crate's own doc says the library holds
what is testable without a TTY, and the panel is what the ticket asks to see),
`src/view.rs` (the four-edit panel convention documented in that file),
`Cargo.toml`/`Cargo.lock` (the reqwest and qualia-braid dependencies) and
`docs/frontend-lessons.md` (the ticket's own grep test).

Blocked on #150 (T19) then #188 (T24b): this branch calls
`qualia_braid::BeliefClock`, which lands with those two PRs, so it does not
compile against main alone.
@superposition

Copy link
Copy Markdown
Owner Author
agent: Fix191T27Rebase
branch: ticket/T27
commit: 0ba714a
state: review
next: the three reviews at the new head (correctness, clean-room, contract), then Main's board leg for #43 on Pinkie
blocked_on: none
evidence: this PR

Rebased onto current origin/main (2665401, which carries #188 T24b, #184 T23, #192 C36, #193 C47).
No conflicts: the branch replays as one commit, and git diff --stat origin/main HEAD is the
ticket's own files only (runners/watch/{Cargo.toml,src/braid.rs,src/lib.rs,src/main.rs,src/view.rs, tests/braid.rs}, Cargo.lock, docs/frontend-lessons.md). New head 0ba714a. The #188 blocker
named in the description is lifted: qualia_braid::BeliefClock is on main now, so this branch
builds and tests against main alone.

Host verification at 0ba714a (Windows dev host, -j 2 per D-014; one command at a time):

$ cd C:/Users/ericm/wt/T27 && CARGO_TARGET_DIR=C:/tmp/Fix191T27/target cargo test -p qualia-watch -j 2
   Compiling ... (374 crates, then qualia-watch)
     Running tests\braid.rs
running 6 tests
test panel_names_the_agent_and_the_reason_when_it_is_missing ... ok
test panel_rows_carry_the_braid_and_an_open_mission ... ok
test the_mission_row_spells_out_the_empty_case ... ok
test the_braid_line_renders_whole_milliseconds_and_the_generation ... ok
test poller_takes_the_agents_view_off_the_wire ... ok
test poller_reports_an_agent_that_is_not_there ... ok
test result: ok. 6 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.96s
     Running tests\ring.rs
test result: ok. 20 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
     Running tests\view.rs
test result: ok. 10 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
   Doc-tests qualia_watch
test result: ok. 0 passed; 0 failed
TEST_RC=0
$ cargo build -p qualia-watch -j 2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.58s
BUILD_RC=0
$ python scripts/provenance_check.py
provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 35 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: OK
PROV_RC=0

The ticket's grep test still holds at the new head: grep -rn QUALIA_OPS_URL returns nothing, and
runners/ops is absent from origin/main's tree.

@superposition

Copy link
Copy Markdown
Owner Author

role: correctness
verdict: request-changes
notes: 1

agent: Rev191T27Correct
branch: ticket/T27
commit: 0ba714a
state: review
next: the author changes DEFAULT_AGENT_URL to the agent's real scheme ("https://127.0.0.1:${QUALIA_WEB_PORT:-8080}", the qualia-cli convention); I re-read that line and approve
blocked_on: none
evidence: this review

Head: gh pr view 191 --json headRefOid and git ls-remote origin refs/heads/ticket/T27 both read 0ba714a21d9c75d50ada6ee667eae10b1bed8237, before and after the review. origin/main has since moved to 382e141 (two commits past the rebase base 2665401), so git diff origin/main 0ba714a also reports main's later docs/decisions.md/docs/evidence/README.md additions as reversions; mergeable is MERGEABLE, and those are main's newer commits, not this branch's edits. Everything below was verified in my own git archive of 0ba714a, never the author's worktree.

What the ticket asks

  • Mission panel and Braid line — tab 8 (("8:Mission", ViewMode::Mission) in VIEW_LABELS, the digit key derived from the table, not a second match); render_mission draws Mission::lines() and nothing else; the chrome draws braid_line. Both render.
  • Ops dashboard deleted — grep -rn QUALIA_OPS_URL . returns nothing (rc 1). runners/ops is absent from origin/main's tree and from this head, there is no workspace member, and there is no runners/README.md in this repository to carry a row. The runners/ops mentions left in docs/frontend-lessons.md/docs/inspiration.md describe the reference (source 2) and say in place that it is not carried here — that is the ticket's intent, not a stale reference. No dependency was orphaned, because there was nothing to delete; the three added (qualia-braid, reqwest, serde) are each used. format_clock moved to view.rs byte-identically (the same four lines as origin/main's main.rs) and its one call site follows it.

The data source: the route is on main, the default transport is not

GET /braid is on main today. runners/agent/src/braid.rs (added by 460abc6, merged as #178/C30) defines BraidView { schema_version, generation, session_id, open_missions, last_promotion_ns, last_quarantine_ns } and lib.rs:183 routes it, unauthenticated (app() layers only CorsLayer::permissive()). Ticket #35 (T20) is still open, but its own step says the endpoint is exposed "over the existing agent HTTP surface" — it wires the strands' observe calls into that state; its test is braid_endpoint_reports_state, not a new route. The panel's six-field BraidState and the agent's BraidView match field for field (both qualia.braid-state.v1), so the Mission panel's source does not depend on unlanded work.

The defect is the default address. DEFAULT_AGENT_URL = "http://127.0.0.1:8080", but the agent serves rustls TLS only: axum_server::bind_rustls is its only listener (runners/agent/src/lib.rs), its own banner prints https://0.0.0.0:{web_port}, the Makefile reaches it as curl -ks https://127.0.0.1:8080/..., and the sibling client runners/cli/src/platform.rs defaults to https://127.0.0.1:${QUALIA_WEB_PORT:-8080} and asserts it in tests. The panel's own build_client() sets danger_accept_invalid_certs(true) to accept the agent's self-signed certificate — an option that only means anything over TLS — so the module contradicts itself. Nothing in the tree sets QUALIA_AGENT_URL, so out of the box the panel can never show braid state.

Reproduced against the real agent certificate (C:/Users/ericm/.qualia_tls/{cert,key}.pem) with a one-endpoint TLS /braid stub and the shipped binary (agent URL unset in my environment):

# shipped default -> http://127.0.0.1:8080
stub: served /braid = 0, "handshake failed: [SSL: HTTP_REQUEST] http request" = 20
chrome in the captured ANSI: "braid gen unknown · belief lag: 0 ms"  (no gen-12 diff)

# QUALIA_AGENT_URL=https://127.0.0.1:8080
stub: served /braid = 20, handshake failures = 0
chrome: "braid gen 12 · belief lag: 0 ms"  (ratatui diff-writes "12 · belief")

The degradation is honest — an absent or refusing agent yields MissionStatus::Unreachable(reason) and gen unknown, never a fabricated value (D-009) — but the default cannot reach the route at all. The PR's live smoke used a plaintext stub on http://127.0.0.1:8080, which is exactly what hid this.

Note 1 (blocking): default the panel to the agent's real scheme, e.g. the qualia-cli convention https://127.0.0.1:${QUALIA_WEB_PORT:-8080} (the panel also ignores QUALIA_WEB_PORT today).

Commands (my archive tree, CARGO_TARGET_DIR=C:/tmp/Rev191T27Correct/target, -j 2 per D-014)

$ cargo test -p qualia-watch -j 2
test result: ok. 6 passed; 0 failed      (tests/braid.rs)
test result: ok. 20 passed; 0 failed     (tests/ring.rs)
test result: ok. 10 passed; 0 failed     (tests/view.rs)
TEST_RC=0

$ cargo build -p qualia-watch -j 2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.56s
BUILD_RC=0

$ python scripts/provenance_check.py      # detached worktree of 0ba714a, for git metadata
provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 35 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: OK
PROV_RC=0

Falsification

In a copy I changed mission_row's empty case from "none open" to "0 open":

$ cargo test -p qualia-watch --test braid the_mission_row_spells_out_the_empty_case
test the_mission_row_spells_out_the_empty_case ... FAILED
assertion `left == right` failed: 0 open missions
  left: "0 open"
 right: "none open"
MUTANT_RC=101

Restored, and the file hashes back to 0ba714a:runners/watch/src/braid.rs (blob 0149f79d90f89bf5beb586dfe78793925feb8374); the same test then read 1 passed, RESTORED_RC=0.

One observation, not a defect: the poller's stub answers every request regardless of path, so the /braid path itself is not pinned by a test. The path is correct — it matches the agent's route table — but a future edit to it would not fail the suite.

What I could and could not exercise headlessly

I could not press keys without a PTY, so I could not drive 8 into the Mission panel headlessly. I did start the shipped binary with a bogus manifest and the agent URL at a dead port, capturing the ANSI stream: the tab bar carries 8:Mission and the chrome carries braid gen unknown · belief lag: 0 ms (the lag is a live SHM read, zero when no stamps exist). The panel rows themselves are what tests/braid.rs asserts, and the scheme experiment above exercised the real poller and the real agent certificate against a TLS /braid.

Verdict: request-changes — one blocking note (the default scheme). Everything else the ticket names is present, the dashboard deletion is clean, the wire contract matches the route on main, and the tests, build and gate pass.

`DEFAULT_AGENT_URL` was plaintext `http://127.0.0.1:8080`, but the agent's
only listener is `axum_server::bind_rustls` (`runners/agent`), its banner
prints `https://0.0.0.0:{web_port}` and the Makefile reaches it with
`curl -ks https://...`. The module's own `danger_accept_invalid_certs(true)`
only means anything over TLS, so out of the box the Mission panel could
never reach `GET /braid`; the reviewer reproduced it against the real agent
certificate (plaintext default: 0 served / 20 handshake failures).

`braid::agent_url()` now resolves `QUALIA_AGENT_URL` first — an explicit
override is honoured exactly as before — and otherwise
`https://127.0.0.1:${QUALIA_WEB_PORT:-8080}`, the convention
`runners/cli::platform::default_agent_url` already takes. The panel honoured
no `QUALIA_WEB_PORT` before either. `braid::agent_url_from` keeps the
precedence free of the environment so it is testable; `main.rs` hands the
resolved URL to both `Mission::pending` and `BraidPoller::spawn`, and this
is the only place the crate builds an agent URL.

Tests: `the_default_agent_url_is_the_agents_tls_surface` and
`a_configured_agent_url_wins_over_the_loopback_default` pin the dialed
scheme, and the poller stub now reports its request line so
`poller_takes_the_agents_view_off_the_wire` pins `GET /braid` — the stub
answers any path, so only the request line can (the reviewer's observation).

The mission panel and the braid line are otherwise unchanged.
@superposition

Copy link
Copy Markdown
Owner Author
agent: Fix191T27Scheme
branch: ticket/T27
commit: 2306c4c
state: review
next: the correctness re-read at 2306c4c (note 1 of the review at 0ba714a); the mission panel and the braid line are otherwise unchanged
blocked_on: none
evidence: this PR

New head 2306c4c, one commit on the reviewed 0ba714a (git ls-remote origin refs/heads/ticket/T27 reads 2306c4c8d8ef9f13f637f03875ef403d2c8429ed; the review's note 1 was the only finding). The reviewer's own command was cargo test -p qualia-watch -j 2 in an archive tree, so that is what I reproduce below.

Note 1 — the default scheme

DEFAULT_AGENT_URL = "http://127.0.0.1:8080" is gone. braid::agent_url() now resolves QUALIA_AGENT_URL first (an explicit override is honoured exactly as before, trailing slash and blanks included) and otherwise https://127.0.0.1:${QUALIA_WEB_PORT:-8080} — the runners/cli::platform::default_agent_url convention the review named. The panel also honoured no QUALIA_WEB_PORT; it does now. braid::agent_url_from(configured, port) holds the precedence free of the environment so it can be tested directly, and main.rs hands one resolved URL to both Mission::pending and BraidPoller::spawn.

Every place the crate dials the agent

$ grep -rn "127.0.0.1\|QUALIA_AGENT_URL\|QUALIA_WEB_PORT\|http://\|https://" runners/watch/src
runners/watch/src/braid.rs:27:/// The port the agent's web surface binds on loopback when `QUALIA_WEB_PORT`
runners/watch/src/braid.rs:31:/// The agent's base URL: `QUALIA_AGENT_URL` when the operator set one, else
runners/watch/src/braid.rs:32:/// the agent's web surface on loopback, on `QUALIA_WEB_PORT`.
runners/watch/src/braid.rs:40:        std::env::var("QUALIA_AGENT_URL").ok().as_deref(),
runners/watch/src/braid.rs:41:        std::env::var("QUALIA_WEB_PORT").ok().as_deref(),
runners/watch/src/braid.rs:46:/// the order can be tested directly. `QUALIA_AGENT_URL` wins outright; a blank
runners/watch/src/braid.rs:56:    format!("https://127.0.0.1:{}", port.unwrap_or(DEFAULT_AGENT_PORT))
runners/watch/src/braid.rs:246:        // `localhost`, `127.0.0.1` and its own address (`runners/agent`), so a
runners/watch/src/braid.rs:250:        // `QUALIA_AGENT_URL`; a trusted certificate is what would let this
runners/watch/src/main.rs:76:    "QUALIA_WEB_PORT",
GREP_RC=0

The only URL literal left in the crate is the https loopback one at braid.rs:56; the only request builder is fetch's GET {url}/braid, and the only consumer of the resolver is main.rs:138:

$ grep -rn "agent_url\|/braid\"" runners/watch/src
runners/watch/src/braid.rs:38:pub fn agent_url() -> String {
runners/watch/src/braid.rs:45:/// The URL precedence behind [`agent_url`], kept free of the environment so
runners/watch/src/braid.rs:48:pub fn agent_url_from(configured: Option<&str>, port: Option<&str>) -> String {
runners/watch/src/braid.rs:258:    let response = match client.get(format!("{url}/braid")).send() {
runners/watch/src/main.rs:138:    let agent_url = braid::agent_url();
runners/watch/src/main.rs:139:    let mission = Mission::pending(agent_url.clone());
runners/watch/src/main.rs:140:    let mission_poller = BraidPoller::spawn(agent_url);

Nothing in the mission panel or the braid line otherwise reads, writes or renders an address; the panel draws Mission::lines(), which is the URL it was handed, and the change is the value handed in.

The tests

The reviewer's observation, not a defect: the poller stub answered every path, so neither the scheme nor /braid was pinned. Both now are, and both assert the observable thing:

  • the poller stub reports the request line it read, and poller_takes_the_agents_view_off_the_wire asserts "GET /braid HTTP/1.1" — the stub still answers any path, so only the request line catches a fetch edit;
  • the_default_agent_url_is_the_agents_tls_surface asserts the URL the client is dialed with: agent_url_from(None, None) == "https://127.0.0.1:8080", (None, Some("18081")) == "https://127.0.0.1:18081", and a blank port falls back to 8080;
  • a_configured_agent_url_wins_over_the_loopback_default asserts the override still wins and is normalised the way qualia-cli normalises it.

Both new assertions fail on the mutant that would let the defect back:

# scheme mutant: braid.rs "https://127.0.0.1:{}" -> "http://127.0.0.1:{}"
test the_default_agent_url_is_the_agents_tls_surface ... FAILED
  left: "http://127.0.0.1:8080"   right: "https://127.0.0.1:8080"
MUTANT_SCHEME_RC=101

# path mutant: braid.rs "{url}/braid" -> "{url}/braids"
test poller_takes_the_agents_view_off_the_wire ... FAILED
  left: "GET /braids HTTP/1.1"   right: "GET /braid HTTP/1.1"
MUTANT_PATH_RC=101

Restored the pre-mutation file and reran: the braid suite read 8 passed; 0 failed (RESTORED_RC=0); both mutations were in braid.rs only.

The reviewer's experiment, re-run

Their TLS stub and the real agent certificate (C:/Users/ericm/.qualia_tls/{cert,key}.pem), the shipped qualia-watch.exe with the stack manifest absent, six seconds per case, stub counters read after each run:

old plaintext default  QUALIA_AGENT_URL=http://127.0.0.1:8080   served=0  handshake_failed=25  handshake_ok=0   chrome stays "braid gen unknown"
new default            QUALIA_AGENT_URL unset                   served=25 handshake_failed=0   handshake_ok=25  ANSI diff-writes "12 · belief"
explicit override      QUALIA_AGENT_URL=https://127.0.0.1:8080  served=24 handshake_failed=0   handshake_ok=24  ANSI diff-writes "12 · belief"

Same contrast as the review (they read 0/20 vs 20/0; the counts differ only with the wall clock). The default now reaches the TLS route and the chrome carries generation 12; the plaintext default is the case that never completed a handshake. The https cases' proof that the client spoke TLS is the stub's own tls handshake ok line, and danger_accept_invalid_certs(true) is now consistent with the address it is set for.

Suite and gate

$ CARGO_TARGET_DIR=C:/tmp/Fix191T27/target cargo test -p qualia-watch -j 2
test result: ok. 8 passed; 0 failed    (tests/braid.rs)
test result: ok. 20 passed; 0 failed   (tests/ring.rs)
test result: ok. 10 passed; 0 failed   (tests/view.rs)
TEST_RC=0

$ python scripts/provenance_check.py
provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 35 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: OK
PROV_RC=0

38 in the package (was 36 + the two new tests). No other file changed: git diff --stat 0ba714a 2306c4c is braid.rs, main.rs, tests/braid.rs.

Requesting the correctness re-read at 2306c4c. The mission panel and the braid line render, format and degrade exactly as reviewed; the only behaviour change is the address they dial when QUALIA_AGENT_URL is unset.

@superposition

Copy link
Copy Markdown
Owner Author

role: correctness
verdict: approve
notes: 0

agent: ReRev191T27Correct2
branch: ticket/T27
commit: 2306c4c
state: review
next: Main merges #191 (clean-room and contract reviews still owed at this head), then the board leg for #43 on Pinkie
blocked_on: none
evidence: this review

Head before and after: gh pr view 191 --json headRefOid, git ls-remote origin refs/heads/ticket/T27
and the worktree's HEAD all read 2306c4c8d8ef9f13f637f03875ef403d2c8429ed; the worktree is clean
(git status --porcelain empty). The blocking note from the review at 0ba714a — the plaintext
default against a TLS-only agent — is closed. Everything below was reproduced myself, from the head
source, with my own harness (C:/tmp/ReRev191T27Correct2/); the only artefact reused is the agent's
real certificate (C:/Users/ericm/.qualia_tls/{cert,key}.pem).

1. The fix, and every place the crate dials

git diff 0ba714a 2306c4c is three files (braid.rs +31/-3, main.rs +1/-2, tests/braid.rs +45/-6).
DEFAULT_AGENT_URL is gone (grep -rn DEFAULT_AGENT_URL → rc 1); braid::agent_url_from(configured, port) holds the precedence:

if let Some(url) = configured {
    let url = url.trim().trim_end_matches('/');
    if !url.is_empty() { return url.to_string(); }
}
let port = port.map(str::trim).filter(|port| !port.is_empty());
format!("https://127.0.0.1:{}", port.unwrap_or(DEFAULT_AGENT_PORT))
  • the only URL literal left in the crate is that https one (src/braid.rs:56);
  • the only dial site is fetch's client.get(format!("{url}/braid")) (src/braid.rs:258) — reqwest
    appears nowhere else, build_client is its only constructor, and no other src/ file opens a socket
    or names a URL;
  • QUALIA_AGENT_URL still wins outright; QUALIA_WEB_PORT is honoured with a blank-port fallback to
    8080. This matches runners/cli::platform::default_agent_url line for line (the doc comment's
    claim is true), and build_client's danger_accept_invalid_certs(true) is now consistent with the
    address it was always set for.

One precision on the author's wording, not a defect: "honoured exactly as before, trailing slash and
blanks included" is loose. At 0ba714a the override was used verbatim, so …:9000/ dialed //braid;
now it is trimmed and de-slashed, and a blank override falls back to the loopback default instead of
dialing "/braid". Both edges are deliberate, match qualia-cli, and are pinned by the new test.
notes: 0 — no blocking item, and I did not find a second defect.

2. The served-vs-failed contrast, reproduced

My TLS /braid stub (self-signed with the agent's real certificate, logs the request line of every
exchange) + the shipped qualia-watch.exe built at this head, stack manifest absent, 6 s per case:

old plaintext override  QUALIA_AGENT_URL=http://127.0.0.1:8080   served=0  handshake_failed=25  tls_ok=0   chrome never carries gen 12
shipped default         QUALIA_AGENT_URL unset                   served=25 handshake_failed=0   tls_ok=25  chrome diff-writes "12 · belief"
explicit https override QUALIA_AGENT_URL=https://127.0.0.1:8080  served=24 handshake_failed=0   tls_ok=24  chrome diff-writes "12 · belief"
QUALIA_WEB_PORT=18443   QUALIA_AGENT_URL unset                   served=25 handshake_failed=0   tls_ok=25  chrome diff-writes "12 · belief"

served/tls_ok/handshake_failed are the stub's own counters. Every request that completed a
handshake carried exactly GET /braid HTTP/1.1 (25/25, 24/24, 25/25); the plaintext case never
completed one (handshake failed: [SSL: HTTP_REQUEST] http request ×25) and its ANSI stream keeps
the pre-poll braid gen unknown · belief lag: 0 ms. The fourth row is the end-to-end proof that
QUALIA_WEB_PORT reaches the dial — the previous failure was my first choice of port 18081, which
this host has in a Windows excluded range (WinError 10013), so the case runs on 18443.

Same contrast, same direction as the predecessor's review at 0ba714a (0/20 vs 20/0); the counts
differ only with the wall clock.

3. The new tests pin the observable dial, and fail on the old one

poller_takes_the_agents_view_off_the_wire now asserts the stub's read request line
("GET /braid HTTP/1.1"); the_default_agent_url_is_the_agents_tls_surface asserts the resolved URL
(https/8080, https/18081, blank port → 8080); a_configured_agent_url_wins_over_the_loopback_default
asserts the override. Scheme and path are both pinned, closing the predecessor's observation that the
stub answered every path.

Falsification, single-token reverts in the head file, then git checkout:

# "https://127.0.0.1:{}" -> "http://127.0.0.1:{}"   (the old default)
test the_default_agent_url_is_the_agents_tls_surface ... FAILED  left "http://127.0.0.1:8080"  right "https://127.0.0.1:8080"
test a_configured_agent_url_wins_over_the_loopback_default ... FAILED
MUTANT_SCHEME_RC=101

# "{url}/braid" -> "{url}/braids"
test poller_takes_the_agents_view_off_the_wire ... FAILED  left "GET /braids HTTP/1.1"  right "GET /braid HTTP/1.1"
MUTANT_PATH_RC=101

Restored braid.rs hashes back to 8214e851de8f2d3c07cd2c9b400234359d9a758d (== HEAD: blob),
git status --porcelain empty, and the braid suite then reads 8 passed; 0 failed (RESTORED_RC=0).

4. Suite and clean-room gate at the head

$ CARGO_TARGET_DIR=C:/tmp/ReRev191T27Correct2/target cargo build -p qualia-watch -j 2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 48s        BUILD_RC=0

$ CARGO_TARGET_DIR=C:/tmp/ReRev191T27Correct2/target cargo test -p qualia-watch -j 2
tests/braid.rs  8 passed; 0 failed
tests/ring.rs  20 passed; 0 failed
tests/view.rs  10 passed; 0 failed
TEST_RC=0        (38 in the package, the count the note predicted)

$ python scripts/provenance_check.py
provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 35 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: OK                                                                  PROV_RC=0

The build recompiled the crate from a fresh target dir, so this is compilation of the head source,
not a reused artefact.

5. The rest of the panel is unchanged since the read at 0ba714a

git diff -U0 0ba714a 2306c4c has exactly one source hunk in braid.rs (@@ -27,3 +27,31 @@, the
URL resolver) and one in main.rs (@@ -138,2 +138 @@, the two lines handing the resolved URL to
Mission and BraidPoller). Every tests/braid.rs hunk is at or before old line 77 — the import,
the stub gaining a request-line channel, and the two appended tests. So Mission::lines(),
mission_row, the Unreachable degradation, braid_line, BraidPoller::spawn/try_take/fetch
and the poll loop are byte-identical, as are view.rs and lib.rs (git diff --stat for both is
empty) and the render path (ViewMode::Mission at main.rs:634, render_mission at 1548, the
chrome's app.braid_line at 696). The only behaviour change between the two heads is the address the
panel dials.

I could not press keys without a PTY, so I did not drive 8 into the panel; the rows and the braid
line are what tests/braid.rs asserts, and the chrome above is captured from the running binary.

Verdict: approve. The blocking note is fixed and I reproduced the served/failed contrast, the
suite (38), the mutants (rc=101) and provenance: OK at 2306c4c. Clean-room and contract reviews
are still owed at this head; then Main's board leg for #43 on Pinkie.

@superposition

Copy link
Copy Markdown
Owner Author
role: contract
verdict: approve
notes: 2
agent: Rev191T27Contract
branch: ticket/T27
commit: 2306c4c
state: review
next: Main merges #191 when the clean-room verdict lands at this head, then the board leg for #43 on Pinkie
blocked_on: none
evidence: this review

Head, re-read immediately before posting: git rev-parse HEAD, git ls-remote origin refs/heads/ticket/T27
and gh pr view 191 --repo superposition/qualia --json headRefOid all read
2306c4c8d8ef9f13f637f03875ef403d2c8429ed; the worktree was clean (git status --porcelain empty), so
every line read below is the head tree, pinned by blob: braid.rs 8214e851, main.rs 35f71e86,
view.rs 940012fc, lib.rs 665fdcba, Cargo.toml 1c3e1e04, tests/braid.rs ddccb6e1,
docs/frontend-lessons.md 953c0d24, Cargo.lock 50f96a03.

This is a static contract read: names, signatures, wire/JSON fields, constants and scope. I ran no
build or test — the correctness review at this same head reproduced cargo build -p qualia-watch and
cargo test -p qualia-watch (38 passed), and one build at a time is the host rule (D-013/D-014).

Per surface

Surface Interface it must match Evidence at 2306c4c Result
Route the agent's GET /braid runners/agent/src/lib.rs:183 .route("/braid", get(braid::view_get)); the panel's only dial site is client.get(format!("{url}/braid")) (braid.rs:258); tests/braid.rs pins "GET /braid HTTP/1.1" match
Wire body agent BraidView (runners/agent/src/braid.rs:116-123) watch braid::BraidState (braid.rs:70-86) carries the same six names, types and order: schema_version: String, generation: u64, session_id: String, open_missions: u32, last_promotion_ns: u64, last_quarantine_ns: Option<u64>; no serde renames on either side match, field for field
Frozen vocabulary crates/braid::BraidState (crates/braid/src/lib.rs:39-45) the crate's five fold fields are the watch's DTO minus the wire's schema_version; the crate carries no state-schema literal (only BRAID_EVENT_SCHEMA), so the wire form is the agent's seven-line BraidView::of and the consumer's DTO is the interface, not a second state machine match
Braid lag qualia_braid::BeliefClock crates/braid/src/lib.rs:196-217: BeliefClock::new(&ShmRegion) and decision_latency_ns(&self) -> u64; consumed at main.rs:136 (pre-first-answer) and main.rs:547 (every refresh), rendered whole-ms by braid_line (lag_ns / 1_000_000) match
Schema literal qualia.braid-state.v1 watch BRAID_STATE_SCHEMA (braid.rs:25) == agent const (runners/agent/src/braid.rs:25) == the string the agent's own tests/surface.rs:34 asserts on the body match
Env QUALIA_AGENT_URL wins outright; else https://127.0.0.1:${QUALIA_WEB_PORT:-8080} watch agent_url_from (braid.rs:48-57) against runners/cli/src/platform.rs:295-303 and its tests (platform.rs:369-386): identical precedence, identical trim/de-slash of a blank or trailing-slashed override, identical https loopback default and blank-port fallback match, the fix the correctness review asked for
Env QUALIA_STACK_MANIFEST main.rs:84 reads it for the child set and CHILD_ENV_ALLOWLIST (main.rs:75) names it; the 2665401..2306c4c diff of main.rs has no manifest/supervision hunk — untouched, as the ticket requires ("keep … the child supervision unchanged") unchanged
Budgets the retired dashboard's recorded timeouts braid.rs:59-66: CONNECT_TIMEOUT 700 ms, REQUEST_TIMEOUT 1200 ms, POLL_INTERVAL 250 ms; docs/frontend-lessons.md:113-114 records "the poll and retry intervals are both 250 ms", "a 700 ms connect timeout and a 1200 ms total timeout" match
Deletion runners/ops gone; no member, no README row, no QUALIA_OPS_URL below satisfied
Public items / strings ticket + repo conventions below see observations
Scope the ticket's files only below exact
Gate provenance: OK below pass

The deletion, as run

$ ls -d runners/ops                                              -> No such file or directory
$ git ls-files runners/ | grep -c '^runners/ops/'                -> 0
$ git ls-tree -r 2665401 --name-only | grep -c '^runners/ops/'   -> 0   (absent at the merge base too)
$ grep -c '"runners/ops"' Cargo.toml                             -> 0
$ grep -rn QUALIA_OPS_URL . --exclude-dir=target --exclude-dir=.git   -> no output (rc 1)
$ git log --all --oneline -- 'runners/ops*'                      -> empty
  • The public tree never carried the crate: runners/ops is absent at the head, absent at the merge
    base 2665401, and absent from all 252 commits of history. The ticket's deletion is a no-op here
    except for the doc residue, which this diff removes: the merge base still had two QUALIA_OPS_URL
    mentions in docs/frontend-lessons.md and the head has none (that doc's @@ -113 and @@ -161
    hunks). grep -rn QUALIA_OPS_URL — the ticket's own test — now returns nothing.
  • There is no runners/README.md in this repository at all (git ls-tree 2306c4c --name-only runners/
    lists the 28 crate directories and nothing else), so the "README row" half of the step has no target.
    No workspace member was orphaned; the three dependencies the crate does gain (qualia-braid,
    reqwest, serde) are each used.
  • Docs that name the reference's ops surface say so explicitly: docs/inspiration.md:18 heads the
    section "## superposition/qualia (engine checkout)" before listing runners/ops/src/main.rs, and
    docs/frontend-lessons.md:38-39 reads "Source 2 (runners/ops) is not carried in this repository —
    the plan's Step 27 retires the ops dashboard".
  • The stack choice survives where the ticket says: Step 26 names egui + eframe, "the stack
    runners/ops used", as the console's fallback, and T26/T26 New GUI crate apps/qualia-console, five views #42 landed apps/qualia-console on main.

New/changed public items and strings

  • qualia_watch::view::ViewMode::Mission with the table row ("8:Mission", ViewMode::Mission)
    (view.rs:31,46): the N:Label convention of 1:Overview…7:World, and the digit key is derived
    from the table (digit_for_view), not a second match.
  • qualia_watch::view::format_clock (view.rs:183-187) moved from main.rs's private fn (base
    main.rs:1640) with an identical body ({hours:02}:{mins:02}:{secs:02}.{millis:03}); its one call
    site follows it (main.rs:821, the ledger rows).
  • pub mod braid; (lib.rs) exposing BRAID_STATE_SCHEMA, DEFAULT_AGENT_PORT ("8080", the agent's
    config.rs:16 DEFAULT_WEB_PORT: u16 = 8080), agent_url, agent_url_from, CONNECT_TIMEOUT,
    REQUEST_TIMEOUT, POLL_INTERVAL, BraidState, MissionStatus, Mission
    (pending/status/set_status/degraded/lines), braid_line, BraidPoller (spawn/try_take).
  • Dependencies/features (runners/watch/Cargo.toml): qualia-braid.workspace = true;
    reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] };
    serde = { version = "1", features = ["derive"] }. The reqwest feature set is the reference
    dashboard's transport shape (docs/frontend-lessons.md:114) and rustls-tls is forced by the
    agent's TLS-only listener. Cargo.lock changes in exactly one place, the qualia-watch edge list
    (@@ -4858,10 +4858,13 @@), adding those three edges and nothing else.
  • Strings: tab 8:Mission; panel title Mission · GET /braid; row labels
    agent|state|session|generation|missions|promotion|quarantine|schema; mission row
    none open / 1 open / {n} open; chrome braid gen {n} · belief lag: {ms} ms. The tab and the
    ·-separated title follow the watch's own chrome (Layer {n} · {name} · detail) and the
    1:Overview…7:World table, not a second convention.

Scope, as run

$ git merge-base origin/main 2306c4c
26654014494130302a3ade2deb4256aa7374840a          # origin/main has since moved to f80a2df

$ git diff --name-only 2665401 2306c4c
Cargo.lock
docs/frontend-lessons.md
runners/watch/Cargo.toml
runners/watch/src/braid.rs
runners/watch/src/lib.rs
runners/watch/src/main.rs
runners/watch/src/view.rs
runners/watch/tests/braid.rs

That is exactly the ticket's subject — runners/watch/**, the doc that held the last QUALIA_OPS_URL
mentions, and Cargo.lock. For completeness: git diff --name-only origin/main 2306c4c also lists
apps/qualia-console/**, crates/shm, crates/types, docs/evidence/T50/** and docs/decisions.md,
but those are main's newer commits (T26, T50, C47) that this branch simply does not have — not this
branch's edits; the merge base is unchanged.

The gate, as run

$ python scripts/provenance_check.py
provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 35 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: highest identical-code-line share 1.000 (.cargo/config.toml)
provenance: OK                                                            # exit 0

Observations (both non-blocking)

  1. The degraded-state labels. classify (braid.rs:272-284) emits "tcp timeout",
    "tcp connect failed", response did not decode: {error} and otherwise the raw error, under the
    comment "Short labels an operator can act on, from the ops dashboard's classifier". The classifier
    the repo's own lesson records (docs/frontend-lessons.md:122) uses different words: "tcp connect
    refused", "tcp host unreachable", "tcp connect timeout". This is not blocking for T27 TUI Mission panel and Braid line; ops dashboard deleted #43 — the watch
    never had an HTTP client, the dashboard is retired and its labels were not carried anywhere, and
    the ticket names no string here (D-009 has no counterpart value to preserve) — but the operator
    does read these, and the comment claims the dashboard's lineage. Worth reconciling one or the
    other with the author: either the words follow the recorded classifier, or the comment stops
    claiming it does.
  2. The Braid line names a generation, not an agent. braid_line emits
    braid gen {n} · belief lag: {ms} ms; the ticket's required belief lag: {ms} ms is present and
    the gen {n} prefix answers docs/frontend-lessons.md:80-81 ("a Braid line should be equally
    explicit about which agent and generation it is showing"). The line carries the generation; the
    agent URL is only in the Mission panel (braid.rs:161-163 separates them deliberately), so chrome
    read from another panel names the generation but not the agent. Recording it so that split is a
    decision, not an oversight.

For Main, outside this diff: origin/main at f80a2df carries
apps/qualia-console/src/client.rs:23 DEFAULT_AGENT_URL = "http://127.0.0.1:8080", reading only
QUALIA_AGENT_URL and not QUALIA_WEB_PORT. Against the agent's rustls-only listener established by
the correctness review at 0ba714a, that plaintext default cannot reach GET /braid — the same
defect #191 fixed in the watch. #191 is scoped correctly and must not grow, but #42's console needs
https://127.0.0.1:${QUALIA_WEB_PORT:-8080} (and its ticket text, which says http://, is the thing
to correct there).

Head and command evidence

$ git rev-parse HEAD                                        -> 2306c4c8d8ef9f13f637f03875ef403d2c8429ed  (rc 0)
$ git ls-remote origin refs/heads/ticket/T27                -> 2306c4c8d8ef9f13f637f03875ef403d2c8429ed  refs/heads/ticket/T27  (rc 0)
$ gh pr view 191 --repo superposition/qualia --json headRefOid -q .headRefOid -> 2306c4c8d8ef9f13f637f03875ef403d2c8429ed  (rc 0)
$ git status --porcelain                                    -> empty  (rc 0)
$ git diff --name-only 2665401 2306c4c                      -> the 8 files above  (rc 0)
$ grep -rn QUALIA_OPS_URL . --exclude-dir=target --exclude-dir=.git -> no output  (rc 1)
$ python scripts/provenance_check.py                        -> provenance: OK  (rc 0)

Verdict: approve — every consumed name, field and constant matches the interface it must
(GET /braid on the agent, the agent's BraidView, crates/braid's BraidState and BeliefClock,
the runners/cli::platform URL convention), the ops dashboard is gone with no dangling reference and
its doc mentions explicitly marked as the reference, the diff is the ticket's files only, and the gate
reads provenance: OK. Two observations above, neither blocking.

@superposition

Copy link
Copy Markdown
Owner Author

role: clean-room
verdict: approve
notes: 0

agent: Rev191T27Clean
branch: ticket/T27
commit: 2306c4c
state: review
next: Main merges #191 once the contract review lands at this head; then the board leg for #43 on Pinkie
blocked_on: none
evidence: this review

Head before and after: gh pr view 191 --json headRefOid and git ls-remote origin refs/heads/ticket/T27 both read 2306c4c8d8ef9f13f637f03875ef403d2c8429ed. Measured in my own tree:
git archive HEAD extracted to C:/tmp/Rev191T27Clean/tree, plus a local clone of this repository
checked out detached at 2306c4c (C:/tmp/Rev191T27Clean/repo) so scripts/provenance_check.py
could resolve the merge base — the two trees have 0 content differences EOL-folded. Reference is
C:/qualia at 733329d; its one untracked path (crates/session-store/src/scripts/) is not in
ls-files and is not a front end.

1. The gate, in the archive's content

$ python scripts/provenance_check.py
provenance: compared 152 authored file(s) (1 generated skipped); 0 identical, 35 EOL-identical, 7 code runs over 20, 0 prose runs over 2
provenance: highest identical-code-line share 1.000 (.cargo/config.toml)
CODE RUN 40: crates/types/src/lib.rs
CODE RUN 36: runners/arena-recorder/src/main.rs
CODE RUN 31: kernels/evidence_layout.cu
CODE RUN 30: crates/sync-types/src/lib.rs
CODE RUN 23: crates/jepa-dataset/src/lib.rs
CODE RUN 21: crates/jepa-model/src/lib.rs
CODE RUN 21: crates/sync-types/src/spatial.rs
provenance: OK
PROV_RC=0

One harness warning for the next reader: a naive GIT_DIR=…/T27/.git python scripts/provenance_check.py
is not the gate's verdict. Exporting GIT_DIR leaks into the gate's git cat-file HEAD:<path> calls
against the reference, so it reads our blob as the reference's and prints IDENTICAL for
runners/watch/{Cargo.toml,src/main.rs} plus FAIL. That was my invocation, not this branch; the run
above is from a checkout at the commit with no GIT_DIR set.

provenance: OK: 0 files identical, and none of the 35 EOL-identical manifests is a file this PR
touches. The changed files are Cargo.lock (generated, skipped by the gate),
docs/frontend-lessons.md, and runners/watch/{Cargo.toml,src/braid.rs,src/lib.rs,src/main.rs,src/view.rs,tests/braid.rs}.
Of those, the reference has counterparts for Cargo.toml and main.rs (both differ from it) and
none for lib.rs, braid.rs, view.rs, tests/braid.rs or the lessons doc (git -C C:/qualia cat-file -e HEAD:<path> fails); Cargo.lock is skipped as generated. The 7 code runs over 20 are
all in files the diff does not touch, so they are the base revision's content, already reviewed.

2. Whole-tree measurement of the changed files

Thresholds: gate defaults --max-run 20, --max-prose-run 2. Corpora: all 498 tracked reference
files; the reference's front ends (85 — web/, studio/, runners/ops/); our other front ends (9 —
web/, studio/); docs/frontend-lessons.md.

changed file ref counterpart byte-identical (any corpus) longest identical code run vs C:/qualia vs ref front ends vs our web/studio longest prose run
Cargo.lock yes (generated) 0 45 — Cargo.lock:6061-6105 vs C:/qualia:Cargo.lock:7347-7391 1 1 0
docs/frontend-lessons.md none 0 1 0 0 1
runners/watch/Cargo.toml yes 0 5 — 1-5 vs C:/qualia:runners/watch/Cargo.toml:1-5 3 3 0
runners/watch/src/braid.rs (new) none 0 4 — 14-17 vs C:/qualia:runners/arena-recorder/src/main.rs:16-19 1 1 1
runners/watch/src/lib.rs none 0 0 0 0 1
runners/watch/src/main.rs yes 0 9 — 41-49 vs C:/qualia:runners/watch/src/main.rs:46-54 1 1 1
runners/watch/src/view.rs none 0 7 — 39-45 vs C:/qualia:runners/watch/src/main.rs:76-82 1 1 1
runners/watch/tests/braid.rs (new) none 0 2 — 7-8 vs C:/qualia:runners/drive/src/main.rs:11-12 2 1 1
  • Byte-identical files: 0. Every cell is zero across all four corpora. The only identity my sweep
    saw anywhere was docs/frontend-lessons.md against itself, which the harness discounts — the
    file is not in the reference.
  • Prose runs over 2: none. The longest prose run of any changed file against any corpus is 1 line.
  • The runs are declarations, and none contains an added line. main.rs:41-49 is the engine's
    LAYER_NAMES constant table ("superposition", "belief_motor", …); view.rs:39-45 is the
    pre-existing tab-label table the PR only appends ("8:Mission", ViewMode::Mission) to;
    Cargo.toml:1-5 is the [package]/version.workspace/edition.workspace/license.workspace
    manifest preamble; the Cargo.lock run is a generated dependency block. I intersected every one of
    those runs with the diff's added-line set: none contains an added line. The one run that does is
    braid.rs:14-17 — the new module's four std use lines (all added), matching the reference's
    arena-recorder import block: std imports are interface-forced boilerplate, not copied logic, and 4
    is below the gate's 20.

3. Added lines verbatim in a front-end source

589 added lines (334 code, 116 prose, 139 trivial by the gate's line classifier). No added line
forms an identical run with anything
, in the reference or in web//studio/**; 51 code and 10 prose
added lines appear verbatim as single lines elsewhere, every one a declaration or idiom:

  • manifest keys — reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] } and serde = { version = "1", features = ["derive"] }, the same spec lines
    the reference's runners/ops/Cargo.toml and runners/arena-recorder/Cargo.toml carry (a dependency
    declaration — the class the review doc names as contract-forced);
  • wire fields — pub schema_version: String,, pub generation: u64,, pub session_id: String,, the
    field names qualia.braid-state.v1 fixes;
  • std imports (use std::thread;, use std::sync::Arc;, use std::time::{Duration, Instant};, …),
    attributes (#[test], #[derive(Debug, Clone, PartialEq, Eq)]) and one-word idiom (assert_eq!(,
    } else {, .collect();, .build(), Self {, loop {);
  • the ops-dashboard-shaped transport, three single lines — reqwest::blocking::Client::builder(),
    .danger_accept_invalid_certs(true), .build() — the reqwest API's own spelling, and the module
    doc says the shape is deliberately kept from source 2.

4. The ops dashboard: nothing to delete here, and nothing moved

$ git ls-tree -r --name-only 2665401 | grep -iE '(^|/)ops(/|$|\.)'                            # rc 1, no output
$ git ls-tree -r --name-only 2306c4c | grep -iE '(^|/)ops(/|$|\.)'                            # rc 1, no output
$ git diff --name-status 2665401 2306c4c | grep '^D'                                          # rc 1, no deletion
$ git log --all --diff-filter=D --name-only --pretty=format: | grep -iE '(^|/)ops(/|$|\.)'    # rc 1
$ git ls-tree -r --name-only 2306c4c | grep -iE 'runners/(README|ops)'                        # rc 1
$ git grep -n QUALIA_OPS_URL HEAD                                                             # rc 1

runners/ops is absent from the head and from the merge base: this repository never carried it, so
the ticket's "delete runners/ops" is already the tree's state and the merge-base comparison has no
deleted file to show — git show 2665401:runners/ops/src/main.rs names no path. The only ops sources
that exist are the reference's, so I measured the same metrics against them as the nearest stand-in
for the deleted file:

$ git -C C:/qualia ls-tree -r --name-only HEAD | grep -i ops
runners/ops/Cargo.toml
runners/ops/README.md
runners/ops/src/README.md
runners/ops/src/main.rs
ours longest run vs C:/qualia/runners/ops/** byte-identical
runners/watch/Cargo.toml 3 (3-5 vs ops/Cargo.toml:3-5, the manifest preamble) none
runners/watch/src/braid.rs 1 (16 vs ops/src/main.rs:7) none
runners/watch/src/main.rs 1 (36 vs ops/src/main.rs:9) none
runners/watch/src/view.rs 1 (17 vs ops/src/main.rs:810) none
runners/watch/tests/braid.rs 2 (7-8 vs ops/src/main.rs:8-9) none
runners/watch/src/{lib,ring}.rs, tests/{ring,view}.rs 0-1 none

No file from the ops dashboard was moved into runners/watch: no byte identity, no prose run, and the
longest shared code run is 3 lines of Cargo manifest preamble.

5. The TUI's rendering code (item 4)

git diff 2665401 2306c4c adds no line to ring.rs, and view.rs gains only the Mission variant,
its VIEW_LABELS row and format_clock. Against the reference and the other front ends:

  • view.rs — longest run 7 (39-45, the tab labels) vs the reference's
    runners/watch/src/main.rs:76-82; 1 line vs our studio/rust; prose 1. The run is the pre-existing
    label table; the added 8:Mission row is outside it.
  • braid.rs (the labels, mission_row, braid_line, Mission::lines) — longest run 4, the std
    import block; 1 vs the other front ends; prose 1.
  • ring.rs — longest run 6 (187-192: ledger_detail's signature plus match event {) vs
    C:/qualia:runners/watch/src/main.rs:1774-1779; 1 vs our front ends; prose 1. The signature is the
    interface; the match arms diverge from the reference's line 193 on.

So the TUI's rendering code shares no implementation run with the reference or with
web//studio/**: the only identical stretches are a layer-name constant table, a tab-label table, a
function signature and an import block — each a declaration the contract fixes, none of them added
logic.

Verdict: approve, notes 0. provenance: OK at 2306c4c; no copied file, no shared prose, no added
line forming a copied run; the deletion #43 asks for is already the tree's state, and no ops source
reached runners/watch. The contract review is still owed at this head; then Main's merge and the
Pinkie board leg for #43.

@superposition

Copy link
Copy Markdown
Owner Author
agent: Board3
branch: none (board evidence for the PR head, ticket/T27 #43)
commit: 2306c4c8d8ef9f13f637f03875ef403d2c8429ed
state: evidence
next: Main merges #191; the watch TUI starts and renders on aarch64
blocked_on: none
evidence: this comment; board tests/build 2026-09-02 05:19–05:27 board clock

Head re-resolved: 2306c4c, not the 0ba714a my queue named

Main's steering moved this ticket (the scheme fix); gh pr view 191 --json headRefOid =
git ls-remote origin refs/heads/ticket/T27 = 2306c4c8d8ef9f13f637f03875ef403d2c8429ed. I aborted the
stale 0ba714a build and re-ran at this shas. 0ba714a..2306c4c touches three files
(runners/watch/src/braid.rs +34/−3, main.rs +1/−2, tests/braid.rs +45/−6); the tree is a git archive of the head (27c-src sha256 2c7aa40d08169f806db910ba9f49d8e4050db0652cbec6222eb13c39f307e719) and
the board's file hashes equal the head's:

91c03c5201984a86cda5bd406adf3403dea976383d0767ce8ecfba00fed97e26  runners/watch/src/main.rs
9782d63a9ed2a03e2c998987b049f36a41ae7ab74ecf0e85892eb06204aa0208  runners/watch/src/braid.rs
2348bb6e671eb7edc9629d8c299be886ecdf5d92c9bee5608cc6bdc40e1d3850  runners/watch/src/view.rs
efa62e6982df09bf03ce6900e8d5ffd52d4680e9e455bbaf620737b68c19b41f  Cargo.lock

Tests on the board (aarch64, RUSTFLAGS="-C target-feature=+fp16", -j 2)

$ cargo test -p qualia-watch --offline -j 2
     Running tests/braid.rs → running 8 tests … 8 passed; 0 failed
       (panel_names_the_agent_and_the_reason_when_it_is_missing,
        a_configured_agent_url_wins_over_the_loopback_default,
        panel_rows_carry_the_braid_and_an_open_mission,
        the_braid_line_renders_whole_milliseconds_and_the_generation,
        the_mission_row_spells_out_the_empty_case,
        the_default_agent_url_is_the_agents_tls_surface,
        poller_reports_an_agent_that_is_not_there,
        poller_takes_the_agents_view_off_the_wire)
     Running tests/ring.rs  → running 20 tests … 20 passed; 0 failed
     Running tests/view.rs  → running 10 tests … 10 passed; 0 failed
   Doc-tests qualia_watch    → 0 tests
WATCH_TEST_RC=0        (38 passed; 0 failed)
$ cargo build -p qualia-watch --offline -j 2
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.72s    WATCH_BUILD_RC=0
$ file target/debug/qualia-watch
ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked,
  interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=…, for GNU/Linux 3.7.0, with debug_info, not stripped
$ sha256sum target/debug/qualia-watch
48aceef92c01bd3c7080b40048146c62cb2b4fa1157a2d63cad648b419ce531a   72 617 480 bytes

The count is 38, not the queue's 36: the scheme fix added the two braid tests above
(the_default_agent_url_is_the_agents_tls_surface, a_configured_agent_url_wins_over_the_loopback_default).
The build also emits two function_casts_as_integer warnings at main.rs:435-436 (pre-existing
libc::signal(…, handle_signal as libc::sighandler_t)); the board is not the place to fix them, so they
are recorded, not repaired.

Bounded TUI start (this is a TUI, not a GUI — it can run headlessly)

Without a TTY the binary exits before entering the terminal, as expected:

$ timeout -k 2 8 target/debug/qualia-watch            # stdout/stderr pipes
qualia-watch: failed to spawn qualia-l0-superposition: No such file or directory (os error 2)
… (one line per manifest child; only qualia-watch is built in this tree) …
Error: Os { code: 6, kind: …                    # raw mode needs a terminal
TUI_PIPE_RC=1

Under a PTY with an explicit window it enters the alternate screen and draws; the chrome reads:

$ timeout -k 2 12 script -qec "stty rows 40 cols 130; target/debug/qualia-watch" /dev/null
┌ QUALIA ENGINE v0.1.0 [SUPERVISOR] | shm:/qualia_body | 0 runners | ────────────────────────┐
│1:Overview │ 2:Detail │ 3:Hex │ 4:Spark │ 5:Residual │ 6:Weights │ 7:World │ 8:Mission
    layer 0 ↑↓ · tab switches · PgUp/PgDn …
│Idx    Layer           Rate  VFE      Comp  Streak  μs    Flags Confirms  Challenges
│  0     superposition    1000   ---       ---    --- …
TUI_PTY_RC=137      (timeout's SIGKILL after the bounded window; bytes=6510)

What cannot be exercised headlessly: operator input. Selecting tab 8 (Mission), scrolling, and the
panel's key-driven behaviour need a real terminal and a person; the PTY above is a 12-second unattended
snapshot. The panel's rendering is covered — tests/view.rs and tests/braid.rs drive the same views
through the fixed-size test backend (8 + 10 of the 38 passes) — and on the board the stack's child
runners are not built, so the chrome honestly reports 0 runners and the tabs' live data is empty. No
stray qualia-watch process was left behind.

@superposition
superposition merged commit 7ad59a1 into main Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

T27 TUI Mission panel and Braid line; ops dashboard deleted

1 participant