Lines 1–19 at 318 (were 1–10 at 0)
11// What the project looks like now: status, the paths in a folder, and the labels. They read through 22// SnapshotHost; today the host is the project in memory. 4−import type { AtomId, View } from "../../src/engine/index.ts";
4+import type { AtomId, ReadView } from "../../src/engine/index.ts"; 55import { ProjectError } from "./project-error.ts"; 6−import { countRefusals } from "./project-helpers.ts";
7−import type { AgentState, AgentStatus, EditsVia, Refusal, Starting, StatusAnswer } from "./project-types.ts";
6+import { countRefusals, type projectFileIn } from "./project-helpers.ts"; 16+} from "./project-types.ts"; 817import { last, SHARED, type Space, sharedBaseOf } from "./spaces.ts"; 1019/** What the snapshot reads need from a project. */ Lines 23–29 at 318 (were 14–19 at 0)
1423 queue(): readonly { readonly agent: string; readonly id: number }[]; 1524 readonly refusals: readonly Refusal[]; 1625 readonly labels: ReadonlyMap<string, readonly number[]>; 26+ readonly tells: ReadonlyMap<number, TellRecord>; 1929 draft(agent: AgentState): AtomId[]; Lines 39–66 at 318 (were 29–40 at 0)
2939 setOf(space: Space): ReadonlySet<AtomId>; 3040 spaceNamed(name: string | null): Space; 3141 checkVersion(space: Space, version: number): void; 32− viewAt(space: Space, version: number): View;
33− agentView(agent: AgentState): View;
42+ viewAt(space: Space, version: number): ReadView; 43+ /** A version's file list from kept version shapes, when every version up to it has one (pathindex.ts). */ 44+ keptPaths?(space: Space, version: number): string[] | undefined; 45+ agentView(agent: AgentState): ReadView; 47+ /** Shared's project file (224), or undefined before init or without one. */ 48+ projectFile(): ReturnType<typeof projectFileIn>; 52+ * An agent with nothing of its own sees exactly its base version, so its paths are that version's kept file list 53+ * (pathindex.ts), when there is one: no layout of every known file (abso - Performance, abso 711). 55+function viewPaths(host: SnapshotHost, agent: AgentState): string[] { 57+ agent.mine.length === 0 58+ ? host.keptPaths?.(host.spaceNamed(agent.space === SHARED ? null : agent.space), agent.base) 60+ return kept ?? host.agentView(agent).paths(); 3864 * The paths in an agent's view now (#37): what its folder should hold. 3965 * Reading it changes nothing. Binary files are included. Lines 74–80 at 318 (were 48–54 at 0)
4975 version: agent.base, 5076 draft: agent.space === SHARED ? null : agent.space, 51− files: host.agentView(agent).paths(),
77+ files: viewPaths(host, agent), Lines 88–94 at 318 (were 62–68 at 0)
6288 const space = host.spaceNamed(draft); 6389 const v = version ?? last(space); 6490 host.checkVersion(space, v); 65− return { version: v, draft, files: host.viewAt(space, v).paths() };
91+ return { version: v, draft, files: host.keptPaths?.(space, v) ?? host.viewAt(space, v).paths() }; Lines 106–112 at 318 (were 80–86 at 0)
81107 version: agent.base, 82108 draft: agent.space === SHARED ? null : agent.space, 83− files: host.agentView(agent).paths(),
109+ files: viewPaths(host, agent), Lines 169–192 at 318 (were 143–147 at 0)
145171 const announcements = [...waiting].map(([text, names]) => ({ text, waiting: names })); 146− return { version: host.version(), agents, drafts, refusals: countRefusals(host.refusals), announcements };
172+ // Who has heard each of the newest tells, and when (277): the news and heard entries' times. 173+ const tells: TellStatus[] = [...host.tells.values()].toReversed().map((t) => ({ 178+ .toSorted(([a], [b]) => (a < b ? -1 : 1)) 179+ .map(([agent, h]) => ({ agent, heard: h !== null, at: h?.at ?? null })), 181+ // Both project files in shared (224): say which one counts, never quietly. 182+ const file = host.projectFile(); 184+ version: host.version(), 187+ refusals: countRefusals(host.refusals), 190+ ...(file?.ignored ? { projectFile: { used: "abso.json" as const, ignored: file.ignored } } : {}),