Q107: a task approval covers the content it was given; edits need a fresh one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c695fdb0f6
commit
4765683b86
12 files changed
+114
-52
No files matched your search
@@ -0,0 +1,12 @@
|
||||
// Existing task approvals are taken to cover the task as it stands now; from here on an edit needs a fresh one.
|
||||
export const approvalSubjectSnapshotSchema = `
|
||||
alter table approvals add column subject_snapshot text;
|
||||
update approvals set subject_snapshot = (
|
||||
select json_object('title', t.title, 'description', t.description, 'assignee', t.assignee_agent_id, 'risk', t.risk, 'workspace', t.workspace_id, 'filesystem', t.requires_filesystem)
|
||||
from tasks t where t.id = approvals.source_entity_id
|
||||
)
|
||||
where source_entity_type = 'task' and kind in ('task_risk', 'task_execution');
|
||||
|
||||
insert into schema_migrations(version, name, applied_at)
|
||||
values (85, 'approval_subject_snapshot', datetime('now'));
|
||||
`;
|
||||
@@ -83,6 +83,7 @@ import { connectorExecutionsSchema } from "./migrations/081-connector-executions
|
||||
import { connectorPendingAccountSchema } from "./migrations/082-connector-pending-account";
|
||||
import { connectorAccountLabelsSchema } from "./migrations/083-connector-account-labels";
|
||||
import { connectorGrantLimitsSchema } from "./migrations/084-connector-grant-limits";
|
||||
import { approvalSubjectSnapshotSchema } from "./migrations/085-approval-subject-snapshot";
|
||||
|
||||
interface Migration {
|
||||
version: number;
|
||||
@@ -175,6 +176,7 @@ const MIGRATIONS: Migration[] = [
|
||||
{ version: 82, name: "connector_pending_account", sql: connectorPendingAccountSchema },
|
||||
{ version: 83, name: "connector_account_labels", sql: connectorAccountLabelsSchema },
|
||||
{ version: 84, name: "connector_grant_limits", sql: connectorGrantLimitsSchema },
|
||||
{ version: 85, name: "approval_subject_snapshot", sql: approvalSubjectSnapshotSchema },
|
||||
];
|
||||
|
||||
const SCHEMA_VERSION = MIGRATIONS[MIGRATIONS.length - 1].version;
|
||||
|
||||
Reference in new issue
Block a user