Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 295 to 318

Compare

+28 −5 in 5 places
Lines 40–50 at 318 (were 40–45 at 295)
4040 indexVersion?: (version: Published) => void;
4141 /** Version of the selected membership event, independent of later publishes. */
4242 membershipVersion?: (atom: AtomId, version: number) => number | undefined;
43+ /**
44+ * membershipVersion reading the membership pages first, each page once (abso - Performance, 714): for a walk over
45+ * many atoms, such as SharedAdditions. Most atoms have one event, and the page says its version.
46+ */
47+ membershipVersions?: () => (atom: AtomId, version: number) => number | undefined;
4348 readonly name: string;
4449 readonly versions: Published[];
4550 /** Every atom published into this space (for shared, everything in it). */
Lines 63–75 at 318 (were 58–63 at 295)
5863 name,
5964 indexVersion: (version) => indexMembership(storage, prefix, version),
6065 membershipVersion: (atom, version) => membershipEvent(storage, prefix, atom, version)?.version,
66+ membershipVersions: () => {
67+ const pages = new PageReader(storage, prefix);
68+ return (atom, version) => {
69+ const known = pages.versionAt(atom, version);
70+ return known === null ? membershipEvent(storage, prefix, atom, version)?.version : known;
71+ };
72+ },
6173 versions: storedArray(storage, `${prefix}:versions`),
6274 own: new StoredSet(storage, `${prefix}:own`),
6375 publishedIn: new StoredMap(storage, `${prefix}:published`),
Lines 136–154 at 318 (were 124–129 at 295)
124136 }
125137 /** Whether atom is present at version, or undefined when its events must be read. */
126138 presentAt(atom: AtomId, version: number): boolean | undefined {
139+ const code = this.#code(atom);
140+ if (code === undefined || code === MIXED) return undefined;
141+ if (code === NONE) return false;
142+ return version >= code;
143+ }
144+ /** membershipVersion from the page: the version of its only event, or undefined; null when its events must be read. */
145+ versionAt(atom: AtomId, version: number): number | undefined | null {
146+ const code = this.#code(atom);
147+ if (code === undefined || code === MIXED) return null;
148+ if (code === NONE) return undefined;
149+ return version >= code ? code : undefined;
150+ }
151+ #code(atom: AtomId): number | undefined {
127152 this.#kept ??= this.#storage.read(`${this.#prefix}:pages:meta`, "kept") === 1;
128153 if (!this.#kept) return undefined;
129154 const seq = seqOf(atom);
Lines 160–166 at 318 (were 135–144 at 295)
135160 if (this.#pages.size >= 64) this.#pages.delete(this.#pages.keys().next().value!);
136161 this.#pages.set(index, page);
137162 }
138− const code = page[seq % PAGE] ?? NONE;
139− if (code === NONE) return false;
140− if (code === MIXED) return undefined;
141− return version >= code;
163+ return page[seq % PAGE] ?? NONE;
142164 }
143165}
144166
Lines 403–412 at 318 (were 381–389 at 295)
381403 return this.current.has(id) && !this.base.has(id);
382404 }
383405 *values(): SetIterator<AtomId> {
406+ const versionOf = this.space.membershipVersions?.() ?? this.space.membershipVersion!;
384407 for (let version = this.baseVersion + 1; version <= this.endVersion; version++) {
385408 for (const id of this.space.versions[version]!.atoms) {
386− if (this.space.membershipVersion!(id, this.endVersion) === version && this.has(id)) yield id;
409+ if (versionOf(id, this.endVersion) === version && this.has(id)) yield id;
387410 }
388411 }
389412 }
MCP
compare on this site's /mcp
CLI
abso diff 295 318 worker/project/spaces.ts --json
JSON
/christopher/abso-core/compare/295..318?file=worker%2Fproject%2Fspaces.ts&format=json