Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions loopx/semantics/project_registry_io_manifest_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -1535,31 +1535,31 @@
},
{
"site": "loopx/history.py::<module>.collect_history::codec_read:load_registry#1",
"line": 301,
"line": 327,
"column": 20,
"kind": "codec_read",
"api": "load_registry",
"classification": "codec_api"
},
{
"site": "loopx/history.py::<module>.inspect_index_duplicates::codec_read:load_registry#1",
"line": 542,
"line": 571,
"column": 16,
"kind": "codec_read",
"api": "load_registry",
"classification": "codec_api"
},
{
"site": "loopx/history.py::<module>.rebuild_index_artifact_collisions::codec_read:load_registry#1",
"line": 756,
"line": 785,
"column": 16,
"kind": "codec_read",
"api": "load_registry",
"classification": "codec_api"
},
{
"site": "loopx/history.py::<module>.repair_index_duplicates::codec_read:load_registry#1",
"line": 646,
"line": 675,
"column": 16,
"kind": "codec_read",
"api": "load_registry",
Expand Down
19 changes: 15 additions & 4 deletions tests/control_plane_ts/deferred_hard_lease_lifecycle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {JsonObject} from "../../loopx/control_plane/effect_program.ts";
import {FileAuthorityStore} from "../../loopx/control_plane/coordination/file_authority_store.ts";
import {SqliteAuthorityStore} from "../../loopx/control_plane/coordination/sqlite_authority_store.ts";
import {canonicalAuthoritySha256} from "../../loopx/control_plane/coordination/authority_store_codec.ts";
import {sqliteAuthorityRuntime} from "../../loopx/control_plane/coordination/sqlite_runtime.ts";
import {TODO_DOMAIN_ITEM_SCHEMA, TODO_DOMAIN_READ_RECORD_SCHEMA, TODO_DOMAIN_RECORD_CONTRACT} from
"../../loopx/control_plane/coordination/coordination_state_contract.ts";
import {executeCoordinationTodoUpdate, type CoordinationTodoUpdateInput} from
Expand All @@ -22,6 +23,12 @@ const TODO = "todo_task";
const OWNER = "agent-a";
const AGENTS = [OWNER, "agent-b"];

function sqliteSkipReason(): string | undefined {
try { sqliteAuthorityRuntime(); return undefined; }
catch { return "requires a WAL-fixed SQLite runtime with finalized statements"; }
}
const sqliteSkip = sqliteSkipReason();

async function seeded(provider: "file" | "sqlite", overrides: JsonObject = {}, lease?: JsonObject) {
const root = await mkdtemp(join(tmpdir(), `loopx-deferred-${provider}-`));
const path = join(root, "authority");
Expand Down Expand Up @@ -72,7 +79,9 @@ function oldLease(status: "active" | "released", expires_at: string): JsonObject
}

for (const provider of ["file", "sqlite"] as const) {
test(`${provider}: deferred resume is one CAS transition and never grants execution`, async () => {
const skip = provider === "sqlite" ? sqliteSkip : undefined;

test(`${provider}: deferred resume is one CAS transition and never grants execution`, {skip}, async () => {
const store = await seeded(provider);
const before = await read(store);
assert.equal(leaseOwnerRejection({status: "deferred", claimed_by: OWNER, excluded_agents: []}, OWNER, AGENTS),
Expand All @@ -99,7 +108,8 @@ for (const provider of ["file", "sqlite"] as const) {
"coordination_operation_identity_mismatch");
});

test(`${provider}: expired lease is retired atomically, while live execution and foreign edits fail closed`, async () => {
test(`${provider}: expired lease is retired atomically, while live execution and foreign edits fail closed`,
{skip}, async () => {
const expired = await seeded(provider, {}, oldLease("active", "2026-09-05T22:30:00Z"));
const resumed = await executeCoordinationTodoUpdate(expired, resume("retire-expired"));
assert.equal(resumed.status, "applied", JSON.stringify(resumed));
Expand All @@ -123,7 +133,8 @@ for (const provider of ["file", "sqlite"] as const) {
}
});

test(`${provider}: an unclaimed deferred Todo stays unclaimed; excluded actors cannot reopen it`, async () => {
test(`${provider}: an unclaimed deferred Todo stays unclaimed; excluded actors cannot reopen it`,
{skip}, async () => {
const unclaimed = await seeded(provider, {claimed_by: null});
const applied = await executeCoordinationTodoUpdate(unclaimed, resume("unclaimed-resume"));
assert.equal(applied.status, "applied", JSON.stringify(applied));
Expand All @@ -138,7 +149,7 @@ for (const provider of ["file", "sqlite"] as const) {
assert.deepEqual(await read(excluded), before);
});

test(`${provider}: deferred supersede closes one Todo and retires expired lease lineage`, async () => {
test(`${provider}: deferred supersede closes one Todo and retires expired lease lineage`, {skip}, async () => {
const store = await seeded(provider, {}, oldLease("active", "2026-09-05T22:30:00Z"));
const input = supersede("supersede-once");
const before = await read(store);
Expand Down
Loading