@hasna/todos 0.15.29 → 0.15.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/cloud-router.d.ts +13 -1
- package/dist/cli/cloud-router.d.ts.map +1 -1
- package/dist/cli/commands/project-registration-commands.d.ts +2 -0
- package/dist/cli/commands/project-registration-commands.d.ts.map +1 -1
- package/dist/cli/commands/task-commands.d.ts.map +1 -1
- package/dist/cli/commands/task-manifest-commands.d.ts.map +1 -1
- package/dist/cli/index.js +2835 -334
- package/dist/contracts.js +52 -2
- package/dist/db/task-crud.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1447 -144
- package/dist/lib/task-parent-integrity.d.ts +14 -0
- package/dist/lib/task-parent-integrity.d.ts.map +1 -0
- package/dist/mcp/index.js +2031 -135
- package/dist/mcp/tools/task-crud.d.ts.map +1 -1
- package/dist/mcp.js +1 -1
- package/dist/project-registration/adoption-validation.d.ts +3 -0
- package/dist/project-registration/adoption-validation.d.ts.map +1 -0
- package/dist/project-registration/authority.d.ts +3 -1
- package/dist/project-registration/authority.d.ts.map +1 -1
- package/dist/project-registration/backend.d.ts +24 -1
- package/dist/project-registration/backend.d.ts.map +1 -1
- package/dist/project-registration/http.d.ts +3 -1
- package/dist/project-registration/http.d.ts.map +1 -1
- package/dist/project-registration/index.d.ts +2 -1
- package/dist/project-registration/index.d.ts.map +1 -1
- package/dist/project-registration/page-validation.d.ts +5 -0
- package/dist/project-registration/page-validation.d.ts.map +1 -0
- package/dist/project-registration/postgres.d.ts +13 -1
- package/dist/project-registration/postgres.d.ts.map +1 -1
- package/dist/project-registration/sqlite.d.ts +13 -1
- package/dist/project-registration/sqlite.d.ts.map +1 -1
- package/dist/project-registration/types.d.ts +68 -1
- package/dist/project-registration/types.d.ts.map +1 -1
- package/dist/project-registration.js +831 -58
- package/dist/registry.js +52 -2
- package/dist/release-provenance.json +5 -5
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +151 -0
- package/dist/sdk/v1.generated.d.ts +282 -0
- package/dist/sdk/v1.generated.d.ts.map +1 -1
- package/dist/server/index.js +2022 -126
- package/dist/server/openapi.d.ts +2856 -1357
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/v1.d.ts.map +1 -1
- package/dist/storage/postgres-adapter.d.ts.map +1 -1
- package/dist/storage/postgres-sync.d.ts +8 -0
- package/dist/storage/postgres-sync.d.ts.map +1 -1
- package/dist/storage.js +232 -19
- package/dist/task-manifest/authority.d.ts +13 -1
- package/dist/task-manifest/authority.d.ts.map +1 -1
- package/dist/task-manifest/backend.d.ts +5 -0
- package/dist/task-manifest/backend.d.ts.map +1 -1
- package/dist/task-manifest/index.d.ts +2 -2
- package/dist/task-manifest/index.d.ts.map +1 -1
- package/dist/task-manifest/plan-slug.d.ts +20 -0
- package/dist/task-manifest/plan-slug.d.ts.map +1 -1
- package/dist/task-manifest/postgres.d.ts +1 -0
- package/dist/task-manifest/postgres.d.ts.map +1 -1
- package/dist/task-manifest/schema-sql.d.ts.map +1 -1
- package/dist/task-manifest/schema.d.ts.map +1 -1
- package/dist/task-manifest/sqlite.d.ts +1 -0
- package/dist/task-manifest/sqlite.d.ts.map +1 -1
- package/dist/task-manifest/types.d.ts +21 -1
- package/dist/task-manifest/types.d.ts.map +1 -1
- package/dist/task-manifest.js +592 -61
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AAi3BA,wBAAgB,sBAAsB,CAAC,OAAO,SAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6jEnE"}
|
package/dist/server/v1.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/server/v1.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAuB,oBAAoB,EAAmD,MAAM,0BAA0B,CAAC;AAC3I,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA0BpB,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACtC,YAAY,CAAC,EAAE,OAAO,iBAAiB,CAAC;IACxC,iBAAiB,CAAC,EAAE,OAAO,sBAAsB,CAAC;IAClD,gBAAgB,CAAC,EAAE,OAAO,qBAAqB,CAAC;IAChD,+BAA+B,CAAC,EAAE,OAAO,oCAAoC,CAAC;IAC9E,wBAAwB,CAAC,EAAE,OAAO,6BAA6B,CAAC;CACjE;
|
|
1
|
+
{"version":3,"file":"v1.d.ts","sourceRoot":"","sources":["../../src/server/v1.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAuB,oBAAoB,EAAmD,MAAM,0BAA0B,CAAC;AAC3I,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,EAC7B,gBAAgB,EACjB,MAAM,YAAY,CAAC;AA0BpB,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACtC,YAAY,CAAC,EAAE,OAAO,iBAAiB,CAAC;IACxC,iBAAiB,CAAC,EAAE,OAAO,sBAAsB,CAAC;IAClD,gBAAgB,CAAC,EAAE,OAAO,qBAAqB,CAAC;IAChD,+BAA+B,CAAC,EAAE,OAAO,oCAAoC,CAAC;IAC9E,wBAAwB,CAAC,EAAE,OAAO,6BAA6B,CAAC;CACjE;AAmYD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB,CAiB1E;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,oBAAoB,GAAG,MAAM,CAapE;AA4ED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,OAAO,EACZ,GAAG,EAAE,GAAG,EACR,YAAY,GAAE,qBAA0B,GACvC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAiuC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-adapter.d.ts","sourceRoot":"","sources":["../../src/storage/postgres-adapter.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAcV,mBAAmB,EAYpB,MAAM,iBAAiB,CAAC;AAczB,OAAO,EAIL,KAAK,wBAAwB,EAE9B,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"postgres-adapter.d.ts","sourceRoot":"","sources":["../../src/storage/postgres-adapter.ts"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAcV,mBAAmB,EAYpB,MAAM,iBAAiB,CAAC;AAczB,OAAO,EAIL,KAAK,wBAAwB,EAE9B,MAAM,oBAAoB,CAAC;AA4B5B,MAAM,WAAW,wCAAwC;IACvD,MAAM,EAAE,wBAAwB,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAuBD,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,wCAAwC,GAChD,mBAAmB,CA4JrB"}
|
|
@@ -5,6 +5,14 @@ export interface TodosPostgresQueryResult<T = Record<string, unknown>> {
|
|
|
5
5
|
}
|
|
6
6
|
export interface TodosPostgresQueryClient {
|
|
7
7
|
query<T = Record<string, unknown>>(sql: string, values?: readonly unknown[]): Promise<TodosPostgresQueryResult<T>>;
|
|
8
|
+
/**
|
|
9
|
+
* Optional authoritative same-connection transaction callback.
|
|
10
|
+
*
|
|
11
|
+
* Query-only clients remain valid for reads and independent writes. Storage
|
|
12
|
+
* operations whose correctness depends on a lock followed by a fresh
|
|
13
|
+
* READ-COMMITTED statement fail closed when this callback is unavailable.
|
|
14
|
+
*/
|
|
15
|
+
transaction?<T>(fn: (client: TodosPostgresQueryClient) => Promise<T>): Promise<T>;
|
|
8
16
|
}
|
|
9
17
|
export interface CreatePostgresTodosSyncStoreOptions {
|
|
10
18
|
service?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-sync.d.ts","sourceRoot":"","sources":["../../src/storage/postgres-sync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAUzB,MAAM,MAAM,2BAA2B,GACnC,OAAO,GACP,UAAU,GACV,uBAAuB,GACvB,OAAO,GACP,QAAQ,GACR,YAAY,GACZ,WAAW,GACX,gBAAgB,GAChB,eAAe,CAAC;AAEpB,MAAM,WAAW,wBAAwB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnE,IAAI,EAAE,CAAC,EAAE,CAAC;CACX;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,SA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CAAC,IAAI,CAAC;CAU5D;AAED,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,mCAAwC,GAChD,sBAAsB,CAExB"}
|
package/dist/storage.js
CHANGED
|
@@ -7917,6 +7917,46 @@ function guardPlanRowsSqlite(planIds, db) {
|
|
|
7917
7917
|
}
|
|
7918
7918
|
}
|
|
7919
7919
|
|
|
7920
|
+
// src/lib/task-parent-integrity.ts
|
|
7921
|
+
function parentCycleError(taskId, parentId) {
|
|
7922
|
+
return new ResourceConflictError("TASK_PARENT_CYCLE", `TASK_PARENT_CYCLE: assigning parent ${parentId} to task ${taskId} would create or retain a parent cycle`);
|
|
7923
|
+
}
|
|
7924
|
+
function assertTaskParentIntegrity(taskId, parentId, getTask) {
|
|
7925
|
+
if (parentId === undefined || parentId === null)
|
|
7926
|
+
return;
|
|
7927
|
+
const visited = new Set;
|
|
7928
|
+
let cursor = parentId;
|
|
7929
|
+
while (cursor) {
|
|
7930
|
+
if (cursor === taskId || visited.has(cursor)) {
|
|
7931
|
+
throw parentCycleError(taskId, parentId);
|
|
7932
|
+
}
|
|
7933
|
+
visited.add(cursor);
|
|
7934
|
+
const parent = getTask(cursor);
|
|
7935
|
+
if (!parent)
|
|
7936
|
+
throw new TaskNotFoundError(cursor);
|
|
7937
|
+
cursor = parent.parent_id;
|
|
7938
|
+
}
|
|
7939
|
+
}
|
|
7940
|
+
async function assertTaskParentIntegrityAsync(taskId, parentId, getTask) {
|
|
7941
|
+
if (parentId === undefined || parentId === null)
|
|
7942
|
+
return;
|
|
7943
|
+
const visited = new Set;
|
|
7944
|
+
let cursor = parentId;
|
|
7945
|
+
while (cursor) {
|
|
7946
|
+
if (cursor === taskId || visited.has(cursor)) {
|
|
7947
|
+
throw parentCycleError(taskId, parentId);
|
|
7948
|
+
}
|
|
7949
|
+
visited.add(cursor);
|
|
7950
|
+
const parent = await getTask(cursor);
|
|
7951
|
+
if (!parent)
|
|
7952
|
+
throw new TaskNotFoundError(cursor);
|
|
7953
|
+
cursor = parent.parent_id;
|
|
7954
|
+
}
|
|
7955
|
+
}
|
|
7956
|
+
var init_task_parent_integrity = __esm(() => {
|
|
7957
|
+
init_types();
|
|
7958
|
+
});
|
|
7959
|
+
|
|
7920
7960
|
// src/lib/creator-identity.ts
|
|
7921
7961
|
function canonicalAgentRef(value) {
|
|
7922
7962
|
return value.trim().toLowerCase();
|
|
@@ -9440,6 +9480,7 @@ function createTaskStored(input, d) {
|
|
|
9440
9480
|
let id = uuid();
|
|
9441
9481
|
for (let attempt = 0;attempt < 3; attempt++) {
|
|
9442
9482
|
try {
|
|
9483
|
+
assertTaskParentIntegrity(id, input.parent_id, (candidateId) => getTask(candidateId, d));
|
|
9443
9484
|
d.run(`INSERT INTO tasks (id, short_id, project_id, parent_id, plan_id, task_list_id, cycle_id, title, description, status, priority, agent_id, assigned_to, session_id, working_dir, tags, metadata, version, created_at, updated_at, due_at, estimated_minutes, sla_minutes, confidence, retry_count, max_retries, retry_after, requires_approval, approved_by, approved_at, recurrence_rule, recurrence_parent_id, spawns_template_id, reason, spawned_from_session, assigned_by, created_by, assigned_from_project, task_type, machine_id)
|
|
9444
9485
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
9445
9486
|
id,
|
|
@@ -9818,6 +9859,7 @@ function updateTaskStored(id, input, db) {
|
|
|
9818
9859
|
throw new VersionConflictError(id, input.version, task.version);
|
|
9819
9860
|
}
|
|
9820
9861
|
input = sanitizeUpdateTaskInput(input);
|
|
9862
|
+
assertTaskParentIntegrity(id, input.parent_id, (candidateId) => getTask(candidateId, d));
|
|
9821
9863
|
const effectivePlanId = input.plan_id !== undefined ? input.plan_id : task.plan_id;
|
|
9822
9864
|
const linkedProjectId = linkedPlanProjectId(effectivePlanId, d);
|
|
9823
9865
|
if (linkedProjectId) {
|
|
@@ -9871,6 +9913,10 @@ function updateTaskStored(id, input, db) {
|
|
|
9871
9913
|
sets.push("project_id = ?");
|
|
9872
9914
|
params.push(input.project_id);
|
|
9873
9915
|
}
|
|
9916
|
+
if (input.parent_id !== undefined) {
|
|
9917
|
+
sets.push("parent_id = ?");
|
|
9918
|
+
params.push(input.parent_id);
|
|
9919
|
+
}
|
|
9874
9920
|
if (input.assigned_to !== undefined) {
|
|
9875
9921
|
sets.push("assigned_to = ?");
|
|
9876
9922
|
params.push(input.assigned_to);
|
|
@@ -9986,6 +10032,8 @@ function updateTaskStored(id, input, db) {
|
|
|
9986
10032
|
logTaskChange(id, "update", "priority", task.priority, input.priority, agentId, d);
|
|
9987
10033
|
if (input.title !== undefined && input.title !== task.title)
|
|
9988
10034
|
logTaskChange(id, "update", "title", task.title, input.title, agentId, d);
|
|
10035
|
+
if (input.parent_id !== undefined && input.parent_id !== task.parent_id)
|
|
10036
|
+
logTaskChange(id, "update", "parent_id", task.parent_id, input.parent_id, agentId, d);
|
|
9989
10037
|
if (input.assigned_to !== undefined && input.assigned_to !== task.assigned_to)
|
|
9990
10038
|
logTaskChange(id, "update", "assigned_to", task.assigned_to, input.assigned_to, agentId, d);
|
|
9991
10039
|
if (input.working_dir !== undefined && input.working_dir !== task.working_dir)
|
|
@@ -10043,7 +10091,8 @@ function updateTask(id, input, db) {
|
|
|
10043
10091
|
if (!before)
|
|
10044
10092
|
throw new TaskNotFoundError(id);
|
|
10045
10093
|
const guardedPlanIds = [before.plan_id, input.plan_id];
|
|
10046
|
-
|
|
10094
|
+
const needsSerializedWrite = input.parent_id !== undefined || guardedPlanIds.some(Boolean);
|
|
10095
|
+
if (!needsSerializedWrite)
|
|
10047
10096
|
return updateTaskStored(id, input, d);
|
|
10048
10097
|
return d.transaction(() => {
|
|
10049
10098
|
guardPlanRowsSqlite(guardedPlanIds, d);
|
|
@@ -10079,6 +10128,7 @@ var init_task_crud = __esm(() => {
|
|
|
10079
10128
|
init_checklists();
|
|
10080
10129
|
init_storage_tombstones();
|
|
10081
10130
|
init_prewrite_secrets();
|
|
10131
|
+
init_task_parent_integrity();
|
|
10082
10132
|
});
|
|
10083
10133
|
|
|
10084
10134
|
// src/db/task-status.ts
|
|
@@ -15065,6 +15115,7 @@ function assertSafeIdentifier(value) {
|
|
|
15065
15115
|
|
|
15066
15116
|
// src/storage/postgres-adapter.ts
|
|
15067
15117
|
init_redaction();
|
|
15118
|
+
init_task_parent_integrity();
|
|
15068
15119
|
|
|
15069
15120
|
// src/task-manifest/canonical.ts
|
|
15070
15121
|
import { createHash as createHash5 } from "crypto";
|
|
@@ -15108,8 +15159,8 @@ function createPostgresTodosStorageAdapter(options) {
|
|
|
15108
15159
|
resolveRef: (ref) => store.resolveTaskRef(ref),
|
|
15109
15160
|
list: (filter = {}) => store.listTasks(filter),
|
|
15110
15161
|
count: (filter = {}) => store.countTasks(filter),
|
|
15111
|
-
update: (id, input) => updateTask2(id, input, store),
|
|
15112
|
-
delete: (id, context) => store.
|
|
15162
|
+
update: (id, input, context) => updateTask2(id, input, store, context),
|
|
15163
|
+
delete: (id, context) => store.deleteTaskHierarchy(id, context),
|
|
15113
15164
|
start: (id, agentId) => startTask2(id, agentId, store),
|
|
15114
15165
|
complete: (id, agentId, options2) => completeTask2(id, agentId, options2, store),
|
|
15115
15166
|
fail: (id, agentId, reason, options2) => failTask2(id, agentId, reason, options2, store),
|
|
@@ -15642,22 +15693,70 @@ class PostgresJsonRecordStore {
|
|
|
15642
15693
|
return "identical";
|
|
15643
15694
|
throw new Error(divergentAuditHistoryReplayError(value.id));
|
|
15644
15695
|
}
|
|
15645
|
-
async
|
|
15696
|
+
async withTaskParentIntegrityTransaction(fn) {
|
|
15697
|
+
if (typeof this.options.client.transaction !== "function") {
|
|
15698
|
+
throw new Error("TASK_PARENT_ATOMICITY_UNAVAILABLE: PostgreSQL parent writes and task deletion require transaction(callback)");
|
|
15699
|
+
}
|
|
15700
|
+
return this.options.client.transaction(async (client) => {
|
|
15701
|
+
await client.query("/* todos:task-parent-integrity-lock */ SELECT pg_advisory_xact_lock(hashtextextended($1 || ':task-parent-integrity', 0))", [this.service]);
|
|
15702
|
+
return fn(client);
|
|
15703
|
+
});
|
|
15704
|
+
}
|
|
15705
|
+
async upsertTaskWithPlanMembershipGuard(value, guardedPlanIds, explicitProject, context = {}, parentGuard, queryClient) {
|
|
15646
15706
|
const planIds = [...new Set(guardedPlanIds.filter(Boolean))].sort();
|
|
15647
|
-
if (planIds.length === 0)
|
|
15707
|
+
if (planIds.length === 0 && !parentGuard)
|
|
15648
15708
|
return this.upsert("tasks", value, context);
|
|
15649
15709
|
await this.ensureSchema();
|
|
15710
|
+
if (parentGuard && !queryClient) {
|
|
15711
|
+
return this.withTaskParentIntegrityTransaction((client2) => this.upsertTaskWithPlanMembershipGuard(value, guardedPlanIds, explicitProject, context, parentGuard, client2));
|
|
15712
|
+
}
|
|
15713
|
+
const client = queryClient ?? this.options.client;
|
|
15650
15714
|
const updatedAt = value.updated_at;
|
|
15651
15715
|
const targetPlanId = value.plan_id;
|
|
15652
|
-
const result = await
|
|
15716
|
+
const result = await client.query(`/* todos:task-plan-membership-guard todos:task-parent-integrity-guard */ WITH RECURSIVE
|
|
15717
|
+
locked_task AS MATERIALIZED (
|
|
15718
|
+
SELECT payload FROM ${this.tableName}
|
|
15719
|
+
WHERE service = $1 AND object_type = 'tasks' AND object_id = $2 AND deleted_at IS NULL
|
|
15720
|
+
FOR UPDATE
|
|
15721
|
+
),
|
|
15653
15722
|
locked_plans AS MATERIALIZED (
|
|
15654
15723
|
SELECT object_id, payload FROM ${this.tableName}
|
|
15655
15724
|
WHERE service = $1 AND object_type = 'plans' AND deleted_at IS NULL
|
|
15656
15725
|
AND object_id IN (SELECT value FROM jsonb_array_elements_text($7::jsonb))
|
|
15657
15726
|
ORDER BY object_id
|
|
15658
15727
|
FOR UPDATE
|
|
15728
|
+
), parent_chain(object_id, payload, path, cycle) AS (
|
|
15729
|
+
SELECT parent.object_id, parent.payload, ARRAY[parent.object_id], false
|
|
15730
|
+
FROM ${this.tableName} AS parent
|
|
15731
|
+
WHERE $10::boolean
|
|
15732
|
+
AND $11::text IS NOT NULL
|
|
15733
|
+
AND parent.service = $1
|
|
15734
|
+
AND parent.object_type = 'tasks'
|
|
15735
|
+
AND parent.object_id = $11
|
|
15736
|
+
AND parent.deleted_at IS NULL
|
|
15737
|
+
UNION ALL
|
|
15738
|
+
SELECT ancestor.object_id,
|
|
15739
|
+
ancestor.payload,
|
|
15740
|
+
chain.path || ancestor.object_id,
|
|
15741
|
+
ancestor.object_id = ANY(chain.path)
|
|
15742
|
+
FROM parent_chain AS chain
|
|
15743
|
+
JOIN ${this.tableName} AS ancestor
|
|
15744
|
+
ON ancestor.service = $1
|
|
15745
|
+
AND ancestor.object_type = 'tasks'
|
|
15746
|
+
AND ancestor.object_id = chain.payload->>'parent_id'
|
|
15747
|
+
AND ancestor.deleted_at IS NULL
|
|
15748
|
+
WHERE NOT chain.cycle
|
|
15659
15749
|
), validation AS (
|
|
15660
15750
|
SELECT
|
|
15751
|
+
(NOT $10::boolean OR NOT $13::boolean OR EXISTS (SELECT 1 FROM locked_task)) AS task_found,
|
|
15752
|
+
(NOT $10::boolean OR NOT $13::boolean
|
|
15753
|
+
OR (SELECT (payload->>'version')::integer FROM locked_task) = $12::integer) AS version_matches,
|
|
15754
|
+
(NOT $10::boolean OR $11::text IS NULL
|
|
15755
|
+
OR EXISTS (SELECT 1 FROM parent_chain WHERE object_id = $11)) AS parent_found,
|
|
15756
|
+
(NOT $10::boolean OR $11::text IS NULL
|
|
15757
|
+
OR ($11::text <> $2
|
|
15758
|
+
AND NOT EXISTS (SELECT 1 FROM parent_chain WHERE object_id = $2)
|
|
15759
|
+
AND NOT EXISTS (SELECT 1 FROM parent_chain WHERE cycle))) AS parent_acyclic,
|
|
15661
15760
|
(SELECT count(*) FROM locked_plans) = jsonb_array_length($7::jsonb) AS all_plans_found,
|
|
15662
15761
|
($8::text IS NULL OR EXISTS (SELECT 1 FROM locked_plans WHERE object_id = $8)) AS target_plan_found,
|
|
15663
15762
|
(SELECT payload->>'project_id' FROM locked_plans WHERE object_id = $8) AS target_project_id
|
|
@@ -15678,7 +15777,13 @@ class PostgresJsonRecordStore {
|
|
|
15678
15777
|
)
|
|
15679
15778
|
SELECT $1, 'tasks', $2, guarded.payload, $4::timestamptz, NULL, $5, $6
|
|
15680
15779
|
FROM guarded
|
|
15681
|
-
WHERE guarded.
|
|
15780
|
+
WHERE guarded.task_found
|
|
15781
|
+
AND guarded.version_matches
|
|
15782
|
+
AND guarded.parent_found
|
|
15783
|
+
AND guarded.parent_acyclic
|
|
15784
|
+
AND guarded.all_plans_found
|
|
15785
|
+
AND guarded.target_plan_found
|
|
15786
|
+
AND NOT guarded.project_conflict
|
|
15682
15787
|
ON CONFLICT (service, object_type, object_id) DO UPDATE SET
|
|
15683
15788
|
payload = EXCLUDED.payload,
|
|
15684
15789
|
updated_at = EXCLUDED.updated_at,
|
|
@@ -15691,8 +15796,10 @@ class PostgresJsonRecordStore {
|
|
|
15691
15796
|
AND COALESCE(${this.tableName}.version, 0) <= COALESCE(EXCLUDED.version, 0))
|
|
15692
15797
|
RETURNING payload
|
|
15693
15798
|
)
|
|
15694
|
-
SELECT guarded.
|
|
15695
|
-
|
|
15799
|
+
SELECT guarded.task_found, guarded.version_matches, guarded.parent_found, guarded.parent_acyclic,
|
|
15800
|
+
guarded.all_plans_found, guarded.target_plan_found, guarded.project_conflict,
|
|
15801
|
+
(SELECT payload FROM stored) AS payload,
|
|
15802
|
+
(SELECT payload FROM locked_task) AS current_payload
|
|
15696
15803
|
FROM guarded`, [
|
|
15697
15804
|
this.service,
|
|
15698
15805
|
value.id,
|
|
@@ -15702,9 +15809,26 @@ class PostgresJsonRecordStore {
|
|
|
15702
15809
|
numberValue2(value.version),
|
|
15703
15810
|
jsonbParam(planIds),
|
|
15704
15811
|
targetPlanId,
|
|
15705
|
-
explicitProject
|
|
15812
|
+
explicitProject,
|
|
15813
|
+
Boolean(parentGuard),
|
|
15814
|
+
parentGuard?.parentId ?? null,
|
|
15815
|
+
parentGuard?.expectedVersion ?? null,
|
|
15816
|
+
parentGuard?.operation === "update"
|
|
15706
15817
|
]);
|
|
15707
15818
|
const row = result.rows[0];
|
|
15819
|
+
if (parentGuard && !row?.task_found) {
|
|
15820
|
+
throw new TaskNotFoundError(value.id);
|
|
15821
|
+
}
|
|
15822
|
+
if (parentGuard && !row?.version_matches) {
|
|
15823
|
+
const current = row?.current_payload ? payloadRecord2(row.current_payload) : await this.get("tasks", value.id);
|
|
15824
|
+
throw new VersionConflictError(value.id, parentGuard.expectedVersion, current?.version ?? -1);
|
|
15825
|
+
}
|
|
15826
|
+
if (parentGuard && !row?.parent_found && parentGuard.parentId) {
|
|
15827
|
+
throw new TaskNotFoundError(parentGuard.parentId);
|
|
15828
|
+
}
|
|
15829
|
+
if (parentGuard && !row?.parent_acyclic && parentGuard.parentId) {
|
|
15830
|
+
throw new ResourceConflictError("TASK_PARENT_CYCLE", `TASK_PARENT_CYCLE: assigning parent ${parentGuard.parentId} to task ${value.id} would create or retain a parent cycle`);
|
|
15831
|
+
}
|
|
15708
15832
|
if (!row?.all_plans_found || !row.target_plan_found) {
|
|
15709
15833
|
throw new PlanProjectLinkError("PLAN_PROJECT_LINK_PLAN_NOT_FOUND", `Plan membership changed through a missing plan: ${targetPlanId ?? planIds.join(", ")}`, { plan_ids: planIds, target_plan_id: targetPlanId });
|
|
15710
15834
|
}
|
|
@@ -15712,6 +15836,8 @@ class PostgresJsonRecordStore {
|
|
|
15712
15836
|
throw new ResourceConflictError("PLAN_PROJECT_LINK_CONFLICT", `Task project conflicts with linked plan ${targetPlanId}`);
|
|
15713
15837
|
}
|
|
15714
15838
|
if (!row.payload) {
|
|
15839
|
+
if (row.current_payload)
|
|
15840
|
+
return payloadRecord2(row.current_payload);
|
|
15715
15841
|
return await requireRecord("tasks", value.id, this);
|
|
15716
15842
|
}
|
|
15717
15843
|
return payloadRecord2(row.payload);
|
|
@@ -16037,6 +16163,80 @@ class PostgresJsonRecordStore {
|
|
|
16037
16163
|
version: numberValue2(existing["version"])
|
|
16038
16164
|
}, context);
|
|
16039
16165
|
}
|
|
16166
|
+
async deleteTaskHierarchy(id, context = {}) {
|
|
16167
|
+
await this.ensureSchema();
|
|
16168
|
+
return this.withTaskParentIntegrityTransaction(async (client) => {
|
|
16169
|
+
const timestamp2 = new Date().toISOString();
|
|
16170
|
+
const result = await client.query(`/* todos:task-parent-integrity-delete */ WITH RECURSIVE
|
|
16171
|
+
task_tree(object_id, path, cycle) AS (
|
|
16172
|
+
SELECT task.object_id, ARRAY[task.object_id], false
|
|
16173
|
+
FROM ${this.tableName} AS task
|
|
16174
|
+
WHERE task.service = $1
|
|
16175
|
+
AND task.object_type = 'tasks'
|
|
16176
|
+
AND task.object_id = $2
|
|
16177
|
+
AND task.deleted_at IS NULL
|
|
16178
|
+
UNION ALL
|
|
16179
|
+
SELECT child.object_id,
|
|
16180
|
+
tree.path || child.object_id,
|
|
16181
|
+
child.object_id = ANY(tree.path)
|
|
16182
|
+
FROM task_tree AS tree
|
|
16183
|
+
JOIN ${this.tableName} AS child
|
|
16184
|
+
ON child.service = $1
|
|
16185
|
+
AND child.object_type = 'tasks'
|
|
16186
|
+
AND child.payload->>'parent_id' = tree.object_id
|
|
16187
|
+
AND child.deleted_at IS NULL
|
|
16188
|
+
WHERE NOT tree.cycle
|
|
16189
|
+
), tombstoned AS (
|
|
16190
|
+
UPDATE ${this.tableName} AS task
|
|
16191
|
+
SET deleted_at = $3::timestamptz,
|
|
16192
|
+
updated_at = $3::timestamptz,
|
|
16193
|
+
source_machine_id = $4
|
|
16194
|
+
WHERE task.service = $1
|
|
16195
|
+
AND task.object_type = 'tasks'
|
|
16196
|
+
AND task.deleted_at IS NULL
|
|
16197
|
+
AND task.object_id IN (
|
|
16198
|
+
SELECT object_id FROM task_tree WHERE NOT cycle
|
|
16199
|
+
)
|
|
16200
|
+
RETURNING task.object_id
|
|
16201
|
+
), tombstoned_related AS (
|
|
16202
|
+
UPDATE ${this.tableName} AS related
|
|
16203
|
+
SET deleted_at = $3::timestamptz,
|
|
16204
|
+
updated_at = $3::timestamptz,
|
|
16205
|
+
source_machine_id = $4
|
|
16206
|
+
WHERE related.service = $1
|
|
16207
|
+
AND related.deleted_at IS NULL
|
|
16208
|
+
AND (
|
|
16209
|
+
(
|
|
16210
|
+
related.object_type = 'dependencies'
|
|
16211
|
+
AND (
|
|
16212
|
+
related.payload->>'task_id' IN (
|
|
16213
|
+
SELECT object_id FROM task_tree WHERE NOT cycle
|
|
16214
|
+
)
|
|
16215
|
+
OR related.payload->>'depends_on' IN (
|
|
16216
|
+
SELECT object_id FROM task_tree WHERE NOT cycle
|
|
16217
|
+
)
|
|
16218
|
+
)
|
|
16219
|
+
)
|
|
16220
|
+
OR (
|
|
16221
|
+
related.object_type IN ('comments', 'verifications', 'commits', 'refs')
|
|
16222
|
+
AND related.payload->>'task_id' IN (
|
|
16223
|
+
SELECT object_id FROM task_tree WHERE NOT cycle
|
|
16224
|
+
)
|
|
16225
|
+
)
|
|
16226
|
+
)
|
|
16227
|
+
RETURNING related.object_id
|
|
16228
|
+
)
|
|
16229
|
+
SELECT EXISTS (SELECT 1 FROM task_tree WHERE object_id = $2) AS found,
|
|
16230
|
+
(SELECT count(*) FROM tombstoned) AS deleted_count,
|
|
16231
|
+
(SELECT count(*) FROM tombstoned_related) AS related_deleted_count`, [
|
|
16232
|
+
this.service,
|
|
16233
|
+
id,
|
|
16234
|
+
timestamp2,
|
|
16235
|
+
context.requestId ?? this.sourceMachineId ?? null
|
|
16236
|
+
]);
|
|
16237
|
+
return Boolean(result.rows[0]?.found);
|
|
16238
|
+
});
|
|
16239
|
+
}
|
|
16040
16240
|
async getPlanProjectLinkReceipt(receiptId) {
|
|
16041
16241
|
const value = await this.get("plan_project_link_receipts", receiptId);
|
|
16042
16242
|
return value ? assertPlanProjectLinkReceipt(value) : null;
|
|
@@ -16457,9 +16657,8 @@ class PostgresJsonRecordStore {
|
|
|
16457
16657
|
}
|
|
16458
16658
|
async function createTask2(input, store, context) {
|
|
16459
16659
|
const timestamp2 = new Date().toISOString();
|
|
16460
|
-
|
|
16461
|
-
|
|
16462
|
-
}
|
|
16660
|
+
const taskId = randomUUID3();
|
|
16661
|
+
await assertTaskParentIntegrityAsync(taskId, input.parent_id, (id) => store.get("tasks", id));
|
|
16463
16662
|
const linkedPlan = input.plan_id ? await store.get("plans", input.plan_id) : null;
|
|
16464
16663
|
const requestedProjectId = input.project_id ?? context?.projectId ?? null;
|
|
16465
16664
|
if (linkedPlan?.project_id && requestedProjectId && requestedProjectId !== linkedPlan.project_id) {
|
|
@@ -16468,7 +16667,7 @@ async function createTask2(input, store, context) {
|
|
|
16468
16667
|
const effectiveProjectId = linkedPlan?.project_id ?? requestedProjectId;
|
|
16469
16668
|
const shortId = effectiveProjectId ? await nextTaskShortId2(effectiveProjectId, store, context) : null;
|
|
16470
16669
|
const task = {
|
|
16471
|
-
id:
|
|
16670
|
+
id: taskId,
|
|
16472
16671
|
short_id: shortId,
|
|
16473
16672
|
project_id: effectiveProjectId,
|
|
16474
16673
|
parent_id: input.parent_id ?? null,
|
|
@@ -16524,15 +16723,16 @@ async function createTask2(input, store, context) {
|
|
|
16524
16723
|
synced_at: null,
|
|
16525
16724
|
archived_at: null
|
|
16526
16725
|
};
|
|
16527
|
-
const storedTask = await store.upsertTaskWithPlanMembershipGuard(task, task.plan_id ? [task.plan_id] : [], input.project_id !== undefined || context?.projectId !== undefined, context);
|
|
16726
|
+
const storedTask = await store.upsertTaskWithPlanMembershipGuard(task, task.plan_id ? [task.plan_id] : [], input.project_id !== undefined || context?.projectId !== undefined, context, input.parent_id ? { operation: "create", expectedVersion: 0, parentId: input.parent_id } : undefined);
|
|
16528
16727
|
await logTaskChange2(storedTask.id, "created", "status", null, storedTask.status, storedTask.assigned_by ?? storedTask.agent_id, store, context);
|
|
16529
16728
|
return storedTask;
|
|
16530
16729
|
}
|
|
16531
|
-
async function updateTask2(id, input, store) {
|
|
16730
|
+
async function updateTask2(id, input, store, context) {
|
|
16532
16731
|
const existing = await requireRecord("tasks", id, store);
|
|
16533
16732
|
if (existing.version !== input.version) {
|
|
16534
|
-
throw new
|
|
16733
|
+
throw new VersionConflictError(id, input.version, existing.version);
|
|
16535
16734
|
}
|
|
16735
|
+
await assertTaskParentIntegrityAsync(id, input.parent_id, (candidateId) => store.get("tasks", candidateId));
|
|
16536
16736
|
const effectivePlanId = input.plan_id !== undefined ? input.plan_id : existing.plan_id;
|
|
16537
16737
|
const linkedPlan = effectivePlanId ? await store.get("plans", effectivePlanId) : null;
|
|
16538
16738
|
if (linkedPlan?.project_id) {
|
|
@@ -16557,10 +16757,19 @@ async function updateTask2(id, input, store) {
|
|
|
16557
16757
|
metadata: input.metadata ?? existing.metadata,
|
|
16558
16758
|
requires_approval: input.requires_approval ?? existing.requires_approval,
|
|
16559
16759
|
task_list_id: input.task_list_id !== undefined ? input.task_list_id : existing.task_list_id,
|
|
16760
|
+
parent_id: input.parent_id !== undefined ? input.parent_id : existing.parent_id,
|
|
16560
16761
|
created_by: existing.created_by,
|
|
16561
16762
|
completed_at: reopened ? null : input.completed_at !== undefined ? input.completed_at : existing.completed_at
|
|
16562
16763
|
};
|
|
16563
|
-
|
|
16764
|
+
const storedTask = await store.upsertTaskWithPlanMembershipGuard(task, [existing.plan_id, effectivePlanId].filter((planId) => Boolean(planId)), input.project_id !== undefined, context, {
|
|
16765
|
+
operation: "update",
|
|
16766
|
+
expectedVersion: input.version,
|
|
16767
|
+
parentId: input.parent_id !== undefined ? input.parent_id : existing.parent_id
|
|
16768
|
+
});
|
|
16769
|
+
if (input.parent_id !== undefined && input.parent_id !== existing.parent_id) {
|
|
16770
|
+
await logTaskChange2(id, "update", "parent_id", existing.parent_id, input.parent_id, existing.assigned_to ?? existing.agent_id, store, context);
|
|
16771
|
+
}
|
|
16772
|
+
return storedTask;
|
|
16564
16773
|
}
|
|
16565
16774
|
async function startTask2(id, agentId, store) {
|
|
16566
16775
|
const task = await requireRecord("tasks", id, store);
|
|
@@ -16624,7 +16833,11 @@ async function patchTask(task, patch, store) {
|
|
|
16624
16833
|
version: task.version + 1,
|
|
16625
16834
|
updated_at: new Date().toISOString()
|
|
16626
16835
|
};
|
|
16627
|
-
return store.upsertTaskWithPlanMembershipGuard(updated, [task.plan_id, updated.plan_id].filter((planId) => Boolean(planId)), Object.prototype.hasOwnProperty.call(patch, "project_id")
|
|
16836
|
+
return store.upsertTaskWithPlanMembershipGuard(updated, [task.plan_id, updated.plan_id].filter((planId) => Boolean(planId)), Object.prototype.hasOwnProperty.call(patch, "project_id"), {}, {
|
|
16837
|
+
operation: "update",
|
|
16838
|
+
expectedVersion: task.version,
|
|
16839
|
+
parentId: updated.parent_id
|
|
16840
|
+
});
|
|
16628
16841
|
}
|
|
16629
16842
|
var CLOUD_LOCK_EXPIRY_MINUTES = 30;
|
|
16630
16843
|
function sameCloudLockHolder(stored, incoming) {
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import type { TodosTaskManifestBackend } from "./backend.js";
|
|
2
|
-
import { type PostgresTodosTaskManifestAuthorityOptions, type SqliteTodosTaskManifestAuthorityOptions, type TodosTaskManifestApplyResult, type TodosTaskManifestAuthority, type TodosTaskManifestAuthorityOptions, type TodosTaskManifestBindingLookupRequest, type TodosTaskManifestBindingLookupResult, type TodosTaskManifestCapability, type TodosTaskManifestCompensateRequest, type TodosTaskManifestCompensationResult, type TodosTaskManifestPostgresClient } from "./types.js";
|
|
2
|
+
import { type PostgresTodosTaskManifestAuthorityOptions, type SqliteTodosTaskManifestAuthorityOptions, type TodosTaskManifestApplyResult, type TodosTaskManifestAuthority, type TodosTaskManifestAuthorityOptions, type TodosTaskManifestBindingLookupRequest, type TodosTaskManifestBindingLookupResult, type TodosTaskManifestCapability, type TodosTaskManifestCompensateRequest, type TodosTaskManifestCompensationResult, type TodosTaskManifestPostgresClient, type TodosTaskManifest, type TodosTaskManifestDirection } from "./types.js";
|
|
3
|
+
export declare function taskManifestRequestDigest(manifest: Omit<TodosTaskManifest, "idempotency_key">): string;
|
|
4
|
+
export declare function taskManifestCompensationRequestDigest(request: Omit<TodosTaskManifestCompensateRequest, "idempotency_key">): string;
|
|
5
|
+
export declare function deriveTodosTaskManifestApplyPreconditionDigest(input: Pick<TodosTaskManifest, "operation_id" | "step_id" | "project_id" | "task_list_id" | "if_binding_version">): string;
|
|
6
|
+
export declare function deriveTodosTaskManifestCompensationPreconditionDigest(input: Pick<TodosTaskManifestCompensateRequest, "operation_id" | "step_id" | "receipt_id" | "if_binding_version">): string;
|
|
7
|
+
export declare function deriveTodosTaskManifestIdempotencyKey(input: {
|
|
8
|
+
operation_id: string;
|
|
9
|
+
step_id: string;
|
|
10
|
+
direction: TodosTaskManifestDirection;
|
|
11
|
+
target_selector: string;
|
|
12
|
+
request_digest: string;
|
|
13
|
+
precondition_digest: string;
|
|
14
|
+
}): string;
|
|
3
15
|
export declare class PackageOwnedTodosTaskManifestAuthority implements TodosTaskManifestAuthority {
|
|
4
16
|
private readonly backend;
|
|
5
17
|
private readonly options;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authority.d.ts","sourceRoot":"","sources":["../../src/task-manifest/authority.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAsD,MAAM,cAAc,CAAC;AAUjH,OAAO,
|
|
1
|
+
{"version":3,"file":"authority.d.ts","sourceRoot":"","sources":["../../src/task-manifest/authority.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAsD,MAAM,cAAc,CAAC;AAUjH,OAAO,EAML,KAAK,yCAAyC,EAC9C,KAAK,uCAAuC,EAC5C,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,iCAAiC,EACtC,KAAK,qCAAqC,EAC1C,KAAK,oCAAoC,EACzC,KAAK,2BAA2B,EAChC,KAAK,kCAAkC,EACv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AE,MAAM,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAO7D,aAAa,CACjB,KAAK,EAAE,qCAAqC,GAC3C,OAAO,CAAC,oCAAoC,CAAC;IA6BhD,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9C,UAAU,CAAC,KAAK,EAAE,kCAAkC,GAAG,OAAO,CAAC,mCAAmC,CAAC;IAkFzG,OAAO,CAAC,OAAO;CAWhB;AAED,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,uCAAuC,GAC/C,0BAA0B,CAS5B;AAED,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,+BAA+B,EACvC,OAAO,GAAE,yCAA8C,GACtD,0BAA0B,CAY5B;AAED,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -2,8 +2,10 @@ import type { TodosTaskManifestApplyResult, TodosTaskManifestBindingLookupResult
|
|
|
2
2
|
export interface NormalizedTaskManifest {
|
|
3
3
|
manifest: TodosTaskManifest;
|
|
4
4
|
request_digest: string;
|
|
5
|
+
expected_idempotency_key: string;
|
|
5
6
|
result_digest: string;
|
|
6
7
|
receipt_id: string;
|
|
8
|
+
terminal_receipt_id: string;
|
|
7
9
|
graph: TodosTaskManifestGraph;
|
|
8
10
|
outbox: Array<{
|
|
9
11
|
id: string;
|
|
@@ -12,6 +14,7 @@ export interface NormalizedTaskManifest {
|
|
|
12
14
|
digest: string;
|
|
13
15
|
}>;
|
|
14
16
|
now: string;
|
|
17
|
+
plan_slug_provenance: "deterministic-v1";
|
|
15
18
|
}
|
|
16
19
|
export interface PreparedTaskManifestFaults {
|
|
17
20
|
points: ReadonlySet<TodosTaskManifestFaultPoint>;
|
|
@@ -30,6 +33,7 @@ export interface TaskManifestBindingLookupRow {
|
|
|
30
33
|
binding_version: unknown;
|
|
31
34
|
binding_tenant_id: unknown;
|
|
32
35
|
binding_operation_id: unknown;
|
|
36
|
+
binding_step_id: unknown;
|
|
33
37
|
binding_plan_id: unknown;
|
|
34
38
|
receipt_tenant_id: unknown;
|
|
35
39
|
receipt_authority: unknown;
|
|
@@ -37,6 +41,7 @@ export interface TaskManifestBindingLookupRow {
|
|
|
37
41
|
receipt_schema_version: unknown;
|
|
38
42
|
receipt_kind: unknown;
|
|
39
43
|
receipt_operation_id: unknown;
|
|
44
|
+
receipt_step_id: unknown;
|
|
40
45
|
receipt_plan_id: unknown;
|
|
41
46
|
}
|
|
42
47
|
export declare function validateTaskManifestBindingLookupRows(rows: TaskManifestBindingLookupRow[], tenantId: string, planId: string): Omit<TodosTaskManifestBindingLookupResult, "authority" | "route" | "schema_version" | "tenant_id">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/task-manifest/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,oCAAoC,EACpC,kCAAkC,EAClC,mCAAmC,EACnC,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,sBAAsB,CAAC;IAC9B,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/F,GAAG,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"backend.d.ts","sourceRoot":"","sources":["../../src/task-manifest/backend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,oC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AAC,CAAC;IAC1E,UAAU,CACR,KAAK,EAAE,kCAAkC,EACzC,OAAO,EAAE,wBAAwB,EACjC,qBAAqB,EAAE,MAAM,EAC7B,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,mCAAmC,CAAC,CAAC;CACjD;AAED,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB,EAAE,OAAO,CAAC;IAChC,YAAY,EAAE,OAAO,CAAC;IACtB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,4BAA4B,EAAE,EACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,IAAI,CACL,oCAAoC,EACpC,WAAW,GAAG,OAAO,GAAG,gBAAgB,GAAG,WAAW,CACvD,CAmDA;AAED,wBAAgB,aAAa,IAAI,yBAAyB,CAEzD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { PackageOwnedTodosTaskManifestAuthority, createPostgresTodosTaskManifestAuthority, createSqliteTodosTaskManifestAuthority, parseTodosTaskManifest, } from "./authority.js";
|
|
1
|
+
export { PackageOwnedTodosTaskManifestAuthority, createPostgresTodosTaskManifestAuthority, createSqliteTodosTaskManifestAuthority, deriveTodosTaskManifestApplyPreconditionDigest, deriveTodosTaskManifestCompensationPreconditionDigest, deriveTodosTaskManifestIdempotencyKey, parseTodosTaskManifest, taskManifestCompensationRequestDigest, taskManifestRequestDigest, } from "./authority.js";
|
|
2
2
|
export { PostgresTodosTaskManifestBackend } from "./postgres.js";
|
|
3
3
|
export { SqliteTodosTaskManifestBackend } from "./sqlite.js";
|
|
4
4
|
export { TodosTaskManifestHttpClient, createTodosTaskManifestHttpClient, handleTodosTaskManifestHttpRequest, } from "./http.js";
|
|
5
5
|
export { canonicalDigest as digestTodosTaskManifest, canonicalJson as canonicalTodosTaskManifestJson, deterministicUuid as deterministicTodosTaskManifestId } from "./canonical.js";
|
|
6
6
|
export { TODOS_TASK_MANIFEST_BOUNDS, parseTodosTaskManifestBindingLookup, parseTodosTaskManifestCompensation, } from "./schema.js";
|
|
7
7
|
export { postgresTodosTaskManifestSchemaSql, sqliteTodosTaskManifestSchemaSql } from "./schema-sql.js";
|
|
8
|
-
export { TODOS_TASK_MANIFEST_ROUTE, TODOS_TASK_MANIFEST_SCHEMA_VERSION, TodosTaskManifestError, supportsIdempotentOutboxDelivery, } from "./types.js";
|
|
8
|
+
export { TODOS_TASK_MANIFEST_ROUTE, TODOS_TASK_MANIFEST_CALLER_ROUTE, TODOS_TASK_MANIFEST_PLAN_SLUG_PROVENANCE, TODOS_TASK_MANIFEST_SCHEMA_VERSION, TodosTaskManifestError, supportsIdempotentOutboxDelivery, } from "./types.js";
|
|
9
9
|
export type * from "./types.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task-manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,wCAAwC,EACxC,sCAAsC,EACtC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/task-manifest/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,wCAAwC,EACxC,sCAAsC,EACtC,8CAA8C,EAC9C,qDAAqD,EACrD,qCAAqC,EACrC,sBAAsB,EACtB,qCAAqC,EACrC,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EACL,2BAA2B,EAC3B,iCAAiC,EACjC,kCAAkC,GACnC,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,aAAa,IAAI,8BAA8B,EAAE,iBAAiB,IAAI,gCAAgC,EAAE,MAAM,gBAAgB,CAAC;AACpL,OAAO,EACL,0BAA0B,EAC1B,mCAAmC,EACnC,kCAAkC,GACnC,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,kCAAkC,EAAE,gCAAgC,EAAE,MAAM,iBAAiB,CAAC;AACvG,OAAO,EACL,yBAAyB,EACzB,gCAAgC,EAChC,wCAAwC,EACxC,kCAAkC,EAClC,sBAAsB,EACtB,gCAAgC,GACjC,MAAM,YAAY,CAAC;AACpB,mBAAmB,YAAY,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import type { TodosTaskManifest } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Internal marker written to authority rows for applies that use the
|
|
4
|
+
* deterministic plan-slug contract introduced in v0.15.26.
|
|
5
|
+
*
|
|
6
|
+
* This stays out of the public manifest and receipt payloads.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TASK_MANIFEST_DETERMINISTIC_SLUG_PROVENANCE: "deterministic-v1";
|
|
2
9
|
/**
|
|
3
10
|
* Deterministic plan slug for task-manifest graph writes.
|
|
4
11
|
*
|
|
@@ -8,4 +15,17 @@ import type { TodosTaskManifest } from "./types.js";
|
|
|
8
15
|
* stable slug up front for exact readback and compensation parity.
|
|
9
16
|
*/
|
|
10
17
|
export declare function taskManifestPlanSlug(manifest: Pick<TodosTaskManifest, "plan">, planId: string): string;
|
|
18
|
+
export interface LegacySqlitePlanSlugRow {
|
|
19
|
+
id: string;
|
|
20
|
+
project_id: string | null;
|
|
21
|
+
name: string;
|
|
22
|
+
slug: string | null;
|
|
23
|
+
created_at: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Reproduce the collision-safe allocator used by SQLite schema repair for a
|
|
27
|
+
* legacy task-manifest plan. The caller compares the result with the stored
|
|
28
|
+
* row and may separately accept the pre-repair NULL state.
|
|
29
|
+
*/
|
|
30
|
+
export declare function sqliteLegacyTaskManifestPlanSlug(rows: readonly LegacySqlitePlanSlugRow[], planId: string, targetBase?: string): string | null;
|
|
11
31
|
//# sourceMappingURL=plan-slug.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-slug.d.ts","sourceRoot":"","sources":["../../src/task-manifest/plan-slug.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGtG"}
|
|
1
|
+
{"version":3,"file":"plan-slug.d.ts","sourceRoot":"","sources":["../../src/task-manifest/plan-slug.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,2CAA2C,EAAG,kBAA2B,CAAC;AAEvF;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAGtG;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,SAAS,uBAAuB,EAAE,EACxC,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAuBf"}
|
|
@@ -10,6 +10,7 @@ export declare class PostgresTodosTaskManifestBackend implements TodosTaskManife
|
|
|
10
10
|
constructor(client: TodosTaskManifestPostgresClient, options?: PostgresTodosTaskManifestAuthorityOptions);
|
|
11
11
|
private ensureSchema;
|
|
12
12
|
private insertSync;
|
|
13
|
+
private persistTerminal;
|
|
13
14
|
apply(input: NormalizedTaskManifest, faults: PreparedTaskManifestFaults): Promise<TodosTaskManifestApplyResult>;
|
|
14
15
|
readExact(receiptId: string): Promise<TodosTaskManifestApplyResult>;
|
|
15
16
|
lookupBindingByPlanId(planId: string): Promise<Omit<import("./types.js").TodosTaskManifestBindingLookupResult, "schema_version" | "authority" | "route" | "tenant_id">>;
|