Add contract_gen.py: a pure, deterministic generator that discovers every
StrEnum/dataclass/card defined in contract.py (plus EntryMode,
ConversationItem, and SessionView) via introspection and emits the checked-in
contract_schema.json (JSON Schema draft 2020-12) and
web/.../contract/types.ts. The discriminated ConversationItem union is built
from _Card.__subclasses__(), one oneOf/union branch per card kind.
test_contract.py gains a lockstep test that byte-compares a fresh
generate() call against the checked-in files (guards drift/hand-edits) and a
jsonschema.validate test that proves the generated schema is itself valid
and accepts a real SessionView instance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
runAction sends base_version equal to view.version, but view was only updated from HTTP responses (create/action/refresh), never the SSE stream. While the engine auto-advances (diagnose to await_verify) the held version stayed frozen at create time, so the next action base_version CAS returned 409 conflict. Reconcile view from snapshot/state frames so its version tracks the session.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Extend the Workflow Copilot editor panel to fix pre-publish checklist
errors alongside failed runs.
- Detect blocking checklist items client-side via useChecklist(nodes,
edges, {flowType}) and offer a "Fix N checklist issues" entry next to
the failed-run entry, splitting config errors (auto-fixable) from
unconnected/plugin-missing items (surfaced but not auto-fixed in v1).
- Extend use-copilot-session's create path to POST checklist_errors
(new startChecklistFix) alongside the existing failed_run_id path
(startFix unchanged).
- Drive checklist.await_recheck: re-run the checklist against the
current draft and submit the recheck action with
passed = (fixable remaining === 0) and the full remaining list.
- Add copilot.checklist* i18n keys to en-US, matching the existing
copilot.* keys' en-US-only precedent for this feature.
Add a copilot toggle button next to Test Run in the workflow header and
a left-mounted panel that runs the copilot Fix flow (start fix, live
SSE progress log, approve_repair/run_verify/provide_testdata/publish/
undo/re_fix actions, and a message box), auto-resolving the app id
(workflow store `appId`), workspace id (`currentWorkspaceAtom`), and
the most recent failed run (`useWorkflowRunHistory`) instead of
requiring manual entry.
Extracts the session/SSE request logic from the standalone
`/workflow-copilot-debug` page into a shared
`app/components/workflow-copilot` module (`use-copilot-session`) so
both the debug page and the new panel drive the same implementation.
Adds a `showWorkflowCopilotPanel` store flag (defaults false) mirroring
the existing `showEnvPanel` pattern, so the feature is fully additive
and does not affect rag-pipeline/snippet editors that reuse the same
header/panel shell.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>