Commit Graph
12792 Commits
Author SHA1 Message Date
Charles YaoandClaude Opus 4.8 893ffedbf0 feat(dify-builder): add DIFY_BUILDER_SKILL_LEARNING_POLICY config + FeatureService surface (C-2)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 12:38:04 -07:00
Charles YaoandClaude Opus 4.8 6f02649374 feat(dify-builder): add DifyBuilderAgent.learn_from_build seam (canned) (C-2)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 12:33:44 -07:00
Charles YaoandClaude Opus 4.8 e4b0195528 feat(dify-builder): add build.await_learning state + skill_learning_policy context field (C-2)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 12:24:19 -07:00
Charles YaoandClaude Opus 4.8 859e78606f fix(dify-builder): correct mis-cased FE import paths (difyBuilder- → dify-builder-)
The rename camelCased 'copilot' inside kebab-case filenames in import
specifiers (use-difyBuilder-session, ./difyBuilder-session-view) while the
files themselves were kebab-cased on disk — next build module-not-found.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 11:35:38 -07:00
Charles YaoandClaude Opus 4.8 7e83264330 refactor: rename Workflow Copilot → Dify Builder
Project rename across api/ + web/: modules, symbols, routes
(/console/api/dify-builder/*), feature flag (DIFY_BUILDER_ENABLED),
Celery queue/tasks, the 7 DB tables (via migration df1b0114de40),
and regenerated contract artifacts. Behavior unchanged; 430 tests green,
ruff clean. Branch renamed feat/copilot-py-backend → dify-builder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 11:18:35 -07:00
Charles YaoandClaude Opus 4.8 478e8bf1fe fix(copilot): drive recovery_restart through working FIX/FIX_CHECKLIST entry states
The runner's check_recovery/recovery_continue/recovery_restart short-circuit
committed the transition and returned immediately, without entering the
advance loop. recovery_restart in FIX/FIX_CHECKLIST mode (the forced path for
structural_invalidating drift) lands on the *working* fix.diagnose /
checklist.diagnose entry state, which the runner must drive by running its
handler -- the early return stranded the session there with no UI actions.
Fix: rest only when the landed state is waiting/terminal (covers stop/resume,
check_recovery, recovery_continue, and BUILD/EDIT restarts unchanged);
otherwise consume the action and fall through to the existing advance loop.

Also: parity-test recovery.entry_state_for against the states
service.create_*_session actually assigns; add classify()-through-runner
coverage for the three remaining recovery classes and target_node_ids guard
branches; pin recovery_ref_for's message for config_only/structural_compatible;
and qualify dify_port.py's graph_ops delegations (module import) so
structural_fingerprint/node_ids no longer read as unqualified self-recursion.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 10:42:53 -07:00
Charles YaoandClaude Opus 4.8 b810869941 feat(copilot): surface SessionView.recovery via RecoveryRef + regen artifacts (C-1)
Adds RecoveryRef to the contract, recovery_ref_for() to recovery.py, and
wires it into get_session_view() beside the existing CheckpointRef pattern.
Regenerates contract_schema.json and the FE types.ts from contract.py
(additive only: RecoveryRef + SessionView.recovery). Also updates
test_wiring.py's exact asdict() round-trip assertion to include the new
recovery: None default, since dataclasses.asdict(SessionView) is exhaustive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 10:14:45 -07:00
Charles YaoandClaude Opus 4.8 ec6c6181a9 feat(copilot): recovery classification + runner check_recovery/continue/restart short-circuit (C-1)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 10:02:14 -07:00
Charles YaoandClaude Opus 4.8 f2b8ead9a4 feat(copilot): add RecoveryClass contract enum + regen artifacts (C-1)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 09:56:07 -07:00
Charles YaoandClaude Opus 4.8 6dbd2d3587 feat(copilot): record last_structure_fingerprint at all 10 snapshot-hash sites (C-1)
Every fc.last_snapshot_hash assignment across handlers_fix.py, handlers_build.py,
and handlers_edit.py now sets fc.last_structure_fingerprint alongside it, using
result.structure_fingerprint at apply-repair sites and
env.dify.structural_fingerprint(graph) at read-graph/restore sites.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 09:48:43 -07:00
Charles YaoandClaude Opus 4.8 a789dd4858 feat(copilot): DifyPort.structural_fingerprint + graph_node_ids, apply_repair stamps fingerprint (C-1)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 09:37:43 -07:00
Charles YaoandClaude Opus 4.8 39665a8bc2 feat(copilot): add recovery fields to ApplyResult + CopilotContext + serde (C-1)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 09:28:54 -07:00
Charles YaoandClaude Opus 4.8 529db1f879 feat(copilot): add graph_ops.structural_fingerprint + node_ids (C-1)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 09:22:15 -07:00
Charles YaoandClaude Opus 4.8 f8ee3ce274 copilot: Slice 4 final-review polish (revert docstrings + test parity)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 05:58:52 -07:00
Charles YaoandClaude Opus 4.8 47937f739f copilot: pause/resume (runner stop/resume short-circuit + RunStatus.PAUSED)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 05:42:18 -07:00
Charles YaoandClaude Opus 4.8 7b41d09549 copilot: surface SessionView.checkpoint from fc.checkpoint_id
Populate the frozen SessionView.checkpoint field from the session context's
active checkpoint_id. When set, build a CheckpointRef with the checkpoint_id
and a generic "Restore point" label; otherwise None.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 05:33:17 -07:00
Charles YaoandClaude Opus 4.8 1f79eb4748 copilot: real Build + Edit revert-restore via perform_revert
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 05:23:39 -07:00
Charles YaoandClaude Opus 4.8 655e060c10 copilot: perform_revert helper + real Fix revert-restore
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 05:11:01 -07:00
Charles YaoandClaude Opus 4.8 8481cd6017 copilot: Repository.invalidate_conversation_items (approval-card invalidation)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 04:57:54 -07:00
Charles YaoandClaude Opus 4.8 2f1e342ed0 copilot: DifyPort.restore_graph (whole-graph draft restore)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 04:50:09 -07:00
Charles YaoandClaude Opus 4.8 e464c2879f copilot: CopilotContext lifecycle fields (paused, checkpoint_seq) + serde
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 04:41:27 -07:00
Charles YaoandClaude Opus 4.8 5d6e1c717b copilot: full Edit-flow acceptance + loop-idempotency tests
Add 4 end-to-end tests for the complete Edit flow: test_full_edit_flow_goal_to_publish
(capability_check → send_edit_goal → submit_edit_rules → approve_repair → run_affected_tests
→ review → publish_workflow → EDIT_PUBLISH terminal), test_full_edit_flow_keep_draft_completes_without_publish
(same but keep_draft without publishing), test_continue_adjusting_then_reapprove_is_idempotent
(loop back via re_fix), and test_revert_then_retry_after_revert_reapprove_is_idempotent
(loop via undo then re_fix). All tests drive the real Runner + edit_registry + PlaceholderAgent
+ FakeEditDifyPort with version-CAS for each advance().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 02:39:06 -07:00
Charles YaoandClaude Opus 4.8 ef255c4dde copilot: Edit service wiring + create_edit_session + merged registry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 02:27:55 -07:00
Charles YaoandClaude Opus 4.8 606cff1964 copilot: Edit test_affected_paths + review + reverted handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 02:17:26 -07:00
Charles YaoandClaude Opus 4.8 5287d579d9 copilot: Edit plan_approval (the edit) + apply_changes handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 02:07:26 -07:00
Charles YaoandClaude Opus 4.8 17dd777a29 copilot: Edit capability_check + impact_analysis handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 01:53:47 -07:00
Charles YaoandClaude Opus 4.8 529e1626df test(copilot): FakeEditDifyPort pre-seeded graph fake
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 01:44:10 -07:00
Charles YaoandClaude Opus 4.8 dddf6b16fd copilot: canned Edit cognition on PlaceholderAgent + CopilotAgent Edit methods
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 01:37:06 -07:00
Charles YaoandClaude Opus 4.8 f668959ece copilot: CopilotContext Edit fields + serde defaults
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-23 01:29:17 -07:00
Charles YaoandClaude Opus 4.8 8f39028fda copilot: make handle_plan_approval idempotent on loop-back rebuilds
continue_adjusting/revert/retry_after_revert all return to
build.initial_plan without resetting the already-built graph. Re-walking
find_resources -> confirm_resources -> approve_plan then re-emits the same
fixed create_node/connect intents, and the second apply_repair raised
ValueError on the colliding node id, dead-ending the session at
build.plan_approval.

Fix: before applying, read the current draft graph and drop any
create_node whose node_id already exists or connect whose (from, to) edge
already exists, so a re-approve after a loop-back is a no-op apply_repair
rather than a crash. built_node_ids is still set from the full 4-node set
regardless of what was actually applied this pass.

Adds an end-to-end loop test via the real Runner covering both the
continue_adjusting and retry_after_revert paths, asserting the session
reaches build.execution with the graph still at 4 nodes / 3 edges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 23:45:45 -07:00
Charles YaoandClaude Opus 4.8 a2a308fe58 copilot: full Build-flow acceptance + Build service-table tests
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 23:03:52 -07:00
Charles YaoandClaude Opus 4.8 747441ee55 copilot: Build publish + governance_feedback + reverted handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 22:45:07 -07:00
Charles YaoandClaude Opus 4.8 b6e857b931 copilot: Build test_and_repair (canned) + review handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 22:34:52 -07:00
Charles YaoandClaude Opus 4.8 ed4db951e6 copilot: Build resource_recommendation + plan_approval (the build) + execution
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 22:17:56 -07:00
Charles YaoandClaude Opus 4.8 2ed1a5b42a copilot: strengthen Build goal_analysis merge test discrimination
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 22:07:25 -07:00
Charles YaoandClaude Opus 4.8 3204c31b06 copilot: Build goal_analysis + initial_plan handlers
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 22:00:12 -07:00
Charles YaoandClaude Opus 4.8 25b897353d copilot: Build session bootstrap + capability_check handler + merged registry
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 21:49:48 -07:00
Charles YaoandClaude Opus 4.8 d0f6b09319 copilot: canned Build cognition on PlaceholderAgent + CopilotAgent Build methods
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 21:35:59 -07:00
Charles YaoandClaude Opus 4.8 4be0e77ade copilot: rename FixContext -> CopilotContext + additive Build fields
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 21:24:48 -07:00
Charles YaoandClaude Opus 4.8 32077736ba test(workflow-copilot): widen _StubDifyPort.apply_repair with on_canvas param
Completes Slice 1 Task 9's 'widen all DifyPort implementers' invariant — the
whole-branch review caught this third conformance stub that the per-task
reviews (aware of only WorkflowServiceDifyPort + FakeDifyPort) missed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 11:13:05 -07:00
Charles Yao b3b4776e95 feat(workflow-copilot): opt-in per-intent canvas-event emission through apply_repair 2026-08-22 10:57:37 -07:00
Charles YaoandClaude Opus 4.8 c8c1a7052d feat(workflow-copilot): apply_repair dispatches all 5 verbs + real graph diff feeds change_set
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 10:46:12 -07:00
Charles YaoandClaude Opus 4.8 18e45a1964 feat(workflow-copilot): diff_graphs real before/after graph diff
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 10:34:43 -07:00
Charles Yao df584c7221 feat(workflow-copilot): canned node-default-config registry for Build's 4 node types 2026-08-22 10:28:44 -07:00
Charles YaoandClaude Opus 4.8 59b781ac50 feat(workflow-copilot): apply_insert_between graph mutation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 10:22:44 -07:00
Charles YaoandClaude Opus 4.8 5c950b1a9a feat(workflow-copilot): apply_connect graph mutation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 10:15:45 -07:00
Charles Yao 5006a34226 feat(workflow-copilot): apply_delete_node graph mutation 2026-08-22 10:08:58 -07:00
Charles YaoandClaude Opus 4.8 0097f7d2b1 fix(workflow-copilot): ruff-clean create_node tests + explicit-position sentinel + deepcopy config
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 10:04:19 -07:00
Charles YaoandClaude Opus 4.8 7a8e27c06d feat(workflow-copilot): apply_create_node graph mutation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 09:54:58 -07:00
Charles YaoandClaude Opus 4.8 1e3578d341 feat(workflow-copilot): document + enforce MutationIntent's per-op arg contract
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-08-22 09:48:05 -07:00