Keep the scratch flag out of the Core-generated contracts
governance / governance (pull_request) Successful in 19s
ci / test-and-build (pull_request) Successful in 49s

Why: src/contracts.ts is regenerated from Agent-System-Core by the Dev
composite; the scratch field added there is dropped on regeneration and
tsc then fails in make build.

Evidence: contracts.ts equals the Core-generated output; npx tsc -b
--noEmit, npx vitest run (685 tests) and check-knip pass locally (SELF).

Impact: ConversationView (Conversation & { scratch?: boolean }) in
api.ts carries the server-local flag, mirroring the Backend
conversationView; no behavior change.

Refs: Agent-System-Frontend#123, Agent-System-Dev#691;
agent-exec receipt u3f-run (cursor, success)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-22 06:06:01 +00:00
co-authored by Cursor
parent ec1ced3050
commit 6e611c5de0
6 changed files with 22 additions and 22 deletions
+5 -4
View File
@@ -1,16 +1,17 @@
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { auth } from '../src/auth'
import { canCreateProject, store } from '../src/store'
import type { Conversation, Project } from '../src/contracts'
import type { ConversationView } from '../src/api'
import type { Project } from '../src/contracts'
const project = (id: string): Project => ({ id, name: id, createdAt: '', updatedAt: '' })
const task = (id: string, projectId: string, scratch = false, updatedAt = ''): Conversation =>
const task = (id: string, projectId: string, scratch = false, updatedAt = ''): ConversationView =>
({ id, projectId, title: id, createdAt: '', updatedAt, ...(scratch ? { scratch: true } : {}) })
const response = (value: unknown, status = 200) => new Response(JSON.stringify(value), { status })
const detail = (conversation: Conversation) => response({ conversation, messages: [], runs: [], activeHitl: [], lastSeq: 0 })
const detail = (conversation: ConversationView) => response({ conversation, messages: [], runs: [], activeHitl: [], lastSeq: 0 })
let projects: Project[]
let tasks: Conversation[]
let tasks: ConversationView[]
let me: Record<string, unknown>
let requests: { path: string; init?: RequestInit }[]
let scratchCount: number