variant round: roll retired, chance is variant literature (strict parse, crypto pick on reception, picked-only rendering, /story variance metric); entity round: /story the whole deliverable, /table the play projection, the slidwin carry (smart contwin cutoff, whole exchanges, housekeeper reads session-minus-tail); dormant-session rework: universal session lifecycle (dormant->live->finished, sessions/<n> storage), move-at-stop, start lint + auto-send rule, rebaseable housekeeping, turn-0 -> carryover.jsonl, seed -> memory.json, draft-only save-package; format house rules enforced by the nine-rule check-repo (ascii bytes, no text-mutating css); smoke 105/105 + restart + reminder + browser pass green, irene hand-migrated to the new layout

This commit is contained in:
2026-11-15 14:35:00 +00:00
parent c51d31078e
commit fa3f23b474
51 changed files with 3477 additions and 1719 deletions
+19 -17
View File
@@ -1,4 +1,4 @@
// web/view-home.mjs — home: the run list (display names, live state,
// web/view-home.mjs -- home: the run list (display names, live state,
// the ownership garnish) plus the superuser admin (invites, users).
import { $, el } from './dom.mjs';
@@ -14,25 +14,25 @@ export async function enter(arg, seq) {
const list = $('run-list');
list.textContent = '';
if (!runs.length) {
list.appendChild(el('div', 'hint', 'no runs yet — start one from a package'));
list.appendChild(el('div', 'hint', 'no runs yet -- start one from a package'));
}
for (const r of runs) {
const mine = state.me && r.owner === state.me.id;
const card = el('button', 'card run-card');
// the name carries the content facts plus the ownership garnish;
// started-or-forked rides the meta — chrome, never model-facing
// started-or-forked rides the meta -- chrome, never model-facing
card.appendChild(el('span', 'card-name', `${r.display ?? r.id}${ownershipTag(r, mine)}`));
card.appendChild(el('span', 'card-meta', `${r.package} · ${r.forked ? `forked ${fmtUnix(r.forked)}` : `started ${r.created ?? '?'}`} · ring A ${r.fill?.a ?? 0} / B ${r.fill?.b ?? 0} · ${r.id}${r.models?.player ? ` · ${r.models.player}` : ''}`));
card.appendChild(el('span', 'card-meta', `${r.package} \u00b7 ${r.forked ? `forked ${fmtUnix(r.forked)}` : `started ${r.created ?? '?'}`} \u00b7 ring A ${r.fill?.a ?? 0} / B ${r.fill?.b ?? 0} \u00b7 ${r.id}${r.models?.player ? ` \u00b7 ${r.models.player}` : ''}`));
card.appendChild(el('span', `card-state ${runStateClass(r)}`, runStateText(r)));
// another user's draft is read-only: the play view says so; your own opens the editor
card.addEventListener('click', () => navigate(r.lastSession || !mine ? `/runs/${r.id}` : `/runs/${r.id}/setup`));
card.addEventListener('click', () => navigate(r.phase === 'dormant' && r.sessions === 1 && mine ? `/runs/${r.id}/setup` : `/runs/${r.id}`));
list.appendChild(card);
}
await renderAdmin(seq);
}
const ownershipTag = (r, mine) =>
(mine ? ' · yours' : r.owner == null ? ' · ownerless' : ` · ${r.ownerName ?? 'someone'}'s`);
(mine ? ' \u00b7 yours' : r.owner == null ? ' \u00b7 ownerless' : ` \u00b7 ${r.ownerName ?? 'someone'}'s`);
// all times UTC (house rule): unixtime -> "YYYY-MM-DD HH:MM:SS UTC"
function fmtUnix(t) {
@@ -41,16 +41,18 @@ function fmtUnix(t) {
}
function runStateText(r) {
if (!r.lastSession) return 'draft — not started yet';
if (r.open) return `session open${r.pendingAsk ? ' — waiting for your answer' : ''}`;
if (r.lastSession !== r.lastHousekept) return 'session closed, never housekept';
return 'session closed';
if (r.phase === 'live') return `session open${r.pendingAsk ? ' -- waiting for your answer' : ''}`;
if (r.phase === 'dormant') {
if (r.sessions === 1) return 'draft -- not started yet';
return r.ready === false ? 'dormant -- housekeeping pending' : `dormant -- session ${r.sessions} waits`;
}
return 'no sessions';
}
function runStateClass(r) {
if (!r.lastSession) return 'draft';
if (r.pendingAsk) return 'attention';
if (r.open) return 'ok';
if (r.lastSession !== r.lastHousekept) return 'attention';
if (r.phase === 'live') return 'ok';
if (r.phase === 'dormant' && r.sessions > 1 && r.ready === false) return 'attention';
if (r.sessions === 1 && r.phase === 'dormant') return 'draft';
return '';
}
@@ -64,7 +66,7 @@ async function renderAdmin(seq) {
invList.textContent = '';
for (const i of inv.invites) {
const row = el('div', 'admin-row');
row.appendChild(el('span', 'grow', `#${i.id} ${i.kind} — ${i.state}`));
row.appendChild(el('span', 'grow', `#${i.id} ${i.kind} -- ${i.state}`));
if (i.state === 'unclaimed') {
const b = el('button', null, 'revoke');
b.addEventListener('click', async () => {
@@ -78,10 +80,10 @@ async function renderAdmin(seq) {
userList.textContent = '';
for (const u of us.users) {
const row = el('div', 'admin-row');
row.appendChild(el('span', 'grow', `${u.name} · ${u.id}${u.superuser ? ' · op' : ''}`));
row.appendChild(el('span', 'grow', `${u.name} \u00b7 ${u.id}${u.superuser ? ' \u00b7 op' : ''}`));
if (u.id !== state.me.id) {
const b = el('button', 'danger', 'revoke');
// revocation destroys the identity — two-click armed, like
// revocation destroys the identity -- two-click armed, like
// every destructive act
armedButton(b, {
label: 'revoke',
@@ -101,7 +103,7 @@ $('new-run-btn').addEventListener('click', () => navigate('/new'));
$('invite-mint').addEventListener('click', async () => {
try {
const r = await api('/invites', { method: 'POST', body: {} });
$('invite-code').textContent = r.code; // shown once — it is never listed again
$('invite-code').textContent = r.code; // shown once -- it is never listed again
render();
} catch (e) {
banner(e.message);