Commit Graph
14 Commits
Author SHA1 Message Date
Charles Yao f9b38f9be0 fix(workflow-copilot): reachable reject at approval gate, client-only-action guard, contract doc fixes 2026-08-22 01:55:17 -07:00
Charles YaoandClaude Opus 4.8 7b2e975c5f feat(workflow-copilot): typed contract schemas (TS + JSON) with lockstep check
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>
2026-08-22 01:10:47 -07:00
Charles Yao d089a84da7 refactor(workflow-copilot): re-express Fix conversation items onto the card vocabulary 2026-08-22 00:48:03 -07:00
Charles Yao 55752cd435 feat(workflow-copilot): 17-kind card vocabulary + submit payload types 2026-08-22 00:00:46 -07:00
Charles Yao eb1ee3981a feat(workflow-copilot): Action/CheckpointRef + SessionView entry_mode/phase/actions/checkpoint 2026-08-21 23:36:53 -07:00
Charles Yao 6bceb1be62 feat(workflow-copilot): contract enums + Build/Edit PcState sets 2026-08-21 23:24:13 -07:00
Charles Yao 6d4e9dd59b feat(copilot): port canned placeholder agent 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 0bd9b1f94a feat(copilot): port checklist handlers + merged fix registry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:05 -07:00
Charles Yao b0177e9044 docs(copilot): document save_run id-preservation contract (T6 review) 2026-08-18 21:45:05 -07:00
Charles YaoandClaude Opus 4.8 37008011e2 feat(copilot): port run-fix handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles YaoandClaude Opus 4.8 04f350d2e5 feat(copilot): port runner with version-CAS advance
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles YaoandClaude Opus 4.8 95f2a11023 feat(copilot): port ports, value types, errors
Port dify-enterprise/server/pkg/enterprise/biz/copilot/{ports,errors}.go to
api/core/workflow_copilot as pure Python.

- errors.py: ConflictError, NotFoundError, BusyError (Exception subclasses,
  replacing Go's sentinel error values).
- models.py: add Diagnosis, Risk, MutationIntent, ChangeSet, NodeEvent,
  ApplyResult value dataclasses (Go: ports.go); tighten FixContext.diagnosis/
  staged_repair/risk/change_set from Any to these real types now that they
  live in the same module (avoids a models<->ports import cycle).
- ports.py: CopilotAgent / DifyPort / Repository as @runtime_checkable
  Protocols, snake_case methods per the port plan; DifyPort methods take
  actor: Actor instead of Go's ForwardAuth.
- test_ports.py: constructs each value type, asserts trivial stubs satisfy
  each Protocol via isinstance, and checks the error types.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-18 21:45:04 -07:00
Charles Yao 1b98b0fb29 feat(copilot): port domain models 2026-08-18 21:45:04 -07:00
Charles Yao d779b1629a feat(copilot): port PcState machine to api/core/workflow_copilot 2026-08-18 21:45:04 -07:00