Builds the browser game around the existing Rust runtime: a window into the universe, not a second simulation. Pure std, no external crates. New crates: - protocol: versioned, hashable client/server messages + hand-rolled JSON value and total parser (malformed packet -> Err, never panic). - game_runtime: authoritative match state. Resolves turns through the INDEPENDENT interpreter (runtime_under_test::native_resolve), not the reference engine; filters visibility/knowledge; records and regenerates replays. A match is a pure function of (seed, roster, ordered inputs). - web_assets/web_client: embedded browser client (arena, rune editor, knowledge panels, replay viewer) + static HTTP delivery. - server: std::net HTTP + WebSocket (hand-rolled SHA-1/base64/RFC-6455 framing), turn timer, disconnect handling, panic-proof dispatch, poison-tolerant lock. - web_tests: dependency-free WebSocket test client + Phase H gates. Trust hardening per review: - game_runtime no longer delegates to reference_runtime::execute; it runs the independent interpreter that the runtime-equivalence gate proves correct. - Protocol/socket/replay/visibility/resilience gates are merge-blocking (added to the merge_group-required job in merge-gates.yml): 1k matches/0 drift, 10k fuzz/0 panics, 100 headless socket E2E, 0 hidden-state leaks. - Rendered-browser E2E is marked EXTERNAL-BLOCKED: Playwright runs advisory-only (continue-on-error, artifacts) until CI infrastructure with a browser exists; it is treated as unsatisfied, not green. The headless 100-match gate is labeled protocol-level coverage, not rendered-browser coverage. - README documents the hand-rolled crypto/parser audit risk explicitly. Fixes an integer-overflow panic in observed-volatility inference (i64 sum / abs near i64::MIN) that could poison the server mutex. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
109 lines
4.7 KiB
CSS
109 lines
4.7 KiB
CSS
:root {
|
|
--bg: #0e1014;
|
|
--panel: #171a21;
|
|
--ink: #d7dce5;
|
|
--dim: #828b9c;
|
|
--accent: #6ad0ff;
|
|
--warn: #ffb454;
|
|
--bad: #ff6a6a;
|
|
--good: #7be08a;
|
|
--grid: #2a2f3a;
|
|
}
|
|
* { box-sizing: border-box; }
|
|
body {
|
|
margin: 0;
|
|
background: var(--bg);
|
|
color: var(--ink);
|
|
font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
}
|
|
header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
padding: 10px 16px;
|
|
background: #11131a;
|
|
border-bottom: 1px solid var(--grid);
|
|
}
|
|
h1 { font-size: 18px; margin: 0; color: var(--accent); }
|
|
h2 { font-size: 14px; margin: 0 0 8px; color: var(--accent); }
|
|
h3 { font-size: 12px; margin: 12px 0 6px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
|
|
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
|
|
.badge.off { background: #3a1f23; color: var(--bad); }
|
|
.badge.on { background: #1f3a26; color: var(--good); }
|
|
.timer { margin-left: auto; color: var(--warn); }
|
|
main {
|
|
display: grid;
|
|
grid-template-columns: 1.2fr 1.2fr 1fr;
|
|
grid-template-rows: auto auto;
|
|
gap: 12px;
|
|
padding: 12px;
|
|
}
|
|
.panel { background: var(--panel); border: 1px solid var(--grid); border-radius: 8px; padding: 12px; }
|
|
#arena-panel { grid-row: span 2; }
|
|
#log-panel { grid-row: span 2; }
|
|
|
|
.arena {
|
|
display: grid;
|
|
gap: 2px;
|
|
background: var(--grid);
|
|
border: 1px solid var(--grid);
|
|
width: max-content;
|
|
}
|
|
.cell {
|
|
width: 34px; height: 34px;
|
|
background: #10131a;
|
|
display: flex; align-items: center; justify-content: center;
|
|
font-size: 16px; cursor: pointer; position: relative;
|
|
}
|
|
.cell.self { outline: 2px solid var(--accent); }
|
|
.cell.target { outline: 2px solid var(--warn); }
|
|
.cell.dead { opacity: 0.35; }
|
|
.cell .hp { position: absolute; bottom: 0; right: 2px; font-size: 9px; color: var(--dim); }
|
|
|
|
.actions { display: flex; gap: 24px; margin-top: 12px; align-items: center; }
|
|
.dpad { display: flex; flex-direction: column; align-items: center; gap: 2px; }
|
|
.dpad-row { display: flex; gap: 2px; }
|
|
button {
|
|
background: #222733; color: var(--ink); border: 1px solid var(--grid);
|
|
border-radius: 5px; padding: 6px 10px; cursor: pointer; font: inherit;
|
|
}
|
|
button:hover { border-color: var(--accent); }
|
|
button:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
.hint { color: var(--dim); font-size: 12px; }
|
|
|
|
.library { display: flex; gap: 6px; margin-bottom: 8px; }
|
|
.slot { border: 1px dashed var(--grid); border-radius: 5px; padding: 4px 8px; cursor: pointer; color: var(--dim); }
|
|
.slot.active { border-color: var(--accent); color: var(--accent); }
|
|
.tokens { display: flex; flex-wrap: wrap; gap: 4px; min-height: 30px; padding: 6px; background: #10131a; border-radius: 5px; }
|
|
.token { background: #232a36; border: 1px solid var(--grid); border-radius: 4px; padding: 2px 6px; font-size: 12px; cursor: pointer; }
|
|
.token:hover { border-color: var(--bad); }
|
|
.editor-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
|
|
.editor-controls label { display: flex; flex-direction: column; font-size: 10px; color: var(--dim); }
|
|
.editor-controls input { width: 64px; background: #10131a; border: 1px solid var(--grid); color: var(--ink); border-radius: 4px; padding: 3px; }
|
|
.editor-controls select { background: #10131a; border: 1px solid var(--grid); color: var(--ink); border-radius: 4px; padding: 4px; }
|
|
|
|
.diagnostics { margin-top: 12px; background: #10131a; border-radius: 5px; padding: 8px; }
|
|
.diag-row { margin: 2px 0; }
|
|
.diag-key { color: var(--dim); }
|
|
.warn { color: var(--warn); }
|
|
|
|
.domains { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
|
|
.domain { background: #10131a; border: 1px solid var(--grid); border-radius: 5px; padding: 6px; }
|
|
.domain .name { color: var(--accent); font-size: 12px; }
|
|
.lane { display: inline-block; min-width: 40px; text-align: right; padding: 1px 4px; margin: 1px; border-radius: 3px; font-size: 11px; }
|
|
.lane.known { background: #15251a; color: var(--good); }
|
|
.lane.newly_observed { background: #2a2410; color: var(--warn); }
|
|
.lane.unknown { background: #25151a; color: var(--dim); }
|
|
.lane.suspected { background: #1a1a2a; color: #9aa0ff; }
|
|
.lane.contradicted { background: #2a1525; color: #ff9ae0; }
|
|
.redactions { color: var(--bad); font-size: 12px; }
|
|
|
|
.log { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
|
|
.log li { padding: 2px 0; border-bottom: 1px solid #1c2029; font-size: 12px; }
|
|
.replay-controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
|
|
.hashes { margin-top: 8px; font-size: 11px; color: var(--dim); word-break: break-all; }
|
|
.hash-ok { color: var(--good); }
|
|
.hash-bad { color: var(--bad); }
|
|
ul#inferred { margin: 0; padding-left: 16px; color: var(--dim); font-size: 12px; }
|