Commit Graph
11 Commits
Author SHA1 Message Date
canvas-bot 9cbee11756 fix: studio createDraft split, llm fallback offers tools, topbar a11y pass
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled
Three Oracle-flagged gaps:

1. Studio createDraft 500 (was masked by retries). Empirical curl
   reproducer proved POST /api/ea2/flow returns 201 with the minimal
   shape but intermittently 500s when config.wizard.* is in the
   initial body. Split: POST creates the draft minimally, then a
   follow-up PUT attaches the wizard config best-effort. Draft
   creation now lands reliably.

2. LLM 'temporarily unavailable' was a dead end for the user. Now
   the assistant returns ok:true with a concrete menu of tools the
   user CAN use right now ('list processes', 'start <name>',
   'open <hub>', 'tell <name> that ...', 'remember ...', 'recall ...').
   The reply renders as a normal assistant message, not a red error.

3. Topbar UI/UX Pro Max pass:
   - Added aria-label to the ⌘K and avatar buttons (icon-only a11y)
   - Removed the duplicate topbar-mid chips on Mission (Mission scene
     already shows family/defName/version inline). Cleaner topbar.
   - Added focus-visible outlines (2px amber, 2px offset) on all
     topbar action buttons + user-menu items
   - Hover/active scale on the avatar (1.04 / 0.97) with 160ms ease
   - Tabular numerals for the ⌘K kbd and notification badge
   - prefers-reduced-motion respected

30/30 vitest pass. tsc + vite build green.
2026-06-15 20:04:59 +04:00
canvas-bot 5abb3595fc fix(wizard): retry createDraft on 500/502/503/504 + human error message
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled
POST /api/ea2/flow currently returns 500 after 19s on demo upstream.
Retry once with backoff, then surface a clear 'EA2 backend temporarily
unable to create new processes' message naming the status. The user
gets actionable info instead of a raw 500.
2026-06-15 19:42:32 +04:00
shad d5a9c81b9c feat(dogfood-wave1): Studio retries, Chat error, LLM gateway, kill snapshot, topbar cleanup (#14)
build-and-publish / test (push) Has been cancelled
build-and-publish / image (push) Has been cancelled
2026-06-15 14:30:04 +00:00
shad cc037a149e fix(oracle-r4): curation contradiction + wizard view enrichment
Oracle round-7 remediation, items 2 + 7:

- flowCuration.NON_BUSINESS_SOURCE_CONTEXTS no longer lists
  EA2_DRAFT_PROCESS:process_creation (it's in STARTABLE_SOURCE_CONTEXTS).
  Adds CANVAS_AGENT_MEMORY + CANVAS_AGENT_VAULT_ROOT to NON_BUSINESS so
  vault docs never leak into hubs / catalogue.
- wizardApi.createView now accepts a fields list and emits proper field
  defs (name slug, label, type from {string,number,boolean,textarea}).
- Wizard.handleDataSave rebuilds every step's view with the user's
  draft.fields after Generate phase, then rewires the presentation
  edges to the new views. Steps now expose real business fields, not a
  generic 'Notes' textarea.
2026-06-14 15:07:57 +04:00
shad 338864a8e1 fix(wizard): unique names on createStep/View/Version to avoid (tenant_id,name,kind) collisions 2026-06-14 14:44:51 +04:00
shad b951724c5f feat(wizard): produce fully startable EA2 flows
Reverse-engineered the EA2 runtime startability contract by diffing
pr_to_po_def (startable) against wizard-created drafts (500). Minimum
shape required:

  Parent flow (kind=definition, status=published)
  + Step flow (kind=definition, status=published, dispatch_kind=human)
  + View doc (kind=definition, status=active, layout={fields,layout:form})
  + Version doc (kind=definition, status=active)
  + defines edge: parent -> step (role=child)
  + defines edge: step -> step (role=dispatch self-edge)
  + defines edge: step -> view (role=presentation)
  + governs edge collection 'governs': version -> parent (role=governs)

wizardApi.ops gains: createView, createVersion, childEdge, dispatchEdge,
presentationEdge, governsEdge. createStepEdge renamed to childEdge to
reflect the actual EA2 role. Steps now create with status=published
(was draft) so they're visible to the runtime.

Wizard.handleStructureSave emits all of the above in two apply-batches
(creates then wires). Verified live: posted a probe flow with this
contract, /api/runtime/transactions returned 200 + a running
transaction with step_run_id.
2026-06-14 14:42:55 +04:00
shad b7145c325b fix(wizard): use real EA2 flow/defines collections for steps
EA2's apply-batch doc collections are restricted to ['data','flow','rule',
'version','view']; there is no 'ea2_node'. Steps are themselves 'flow'
documents (kind='definition') linked to the parent flow via the 'defines'
edge collection with role='next' (or 'presentation').

handleStructureSave now does two batches:
1) create N step flows, capture server-assigned keys
2) wire parent->step1->...->stepN with create_edge on 'defines'
2026-06-14 12:23:22 +04:00
shad 7b4f76c1de fix(wizard): drop data field from create_edge ops
EA2 server rejects data on create_edge with extra_forbidden despite the
OpenAPI schema marking it optional. flow_key is implicit from the node refs.
2026-06-14 12:19:06 +04:00
shad 82de744985 fix(wizard): match real EA2 apply-batch contract
Wizard was sending ops in the SDX-era shape:
  { collection, op: 'insert', flow_key, _key, ... }
with actor + flow_key duplicated at the request root.

Real EA2 contract (verified against ea2.baseline.svc/openapi.json):
  POST /api/ea2/apply-batch
  body: { request_id (8..128), ops: BatchOp[] (1..500), description? }
  additionalProperties=false at request root
  ops are a discriminated union by 'op':
    create / update / delete (nodes by coll+key+data)
    create_edge / delete_edge (edges by edge_coll+from+to)
  actor/tenant resolved from Bearer token, not body.

Adds typed CreateOp/UpdateOp/DeleteOp/CreateEdgeOp/DeleteEdgeOp + wizardApi.ops
helpers (createNode, createEdge, publishFlow) so call sites don't have to
remember the discriminator shape.

Wizard.handleStructureSave + handlePublish updated to use the helpers.
2026-06-14 12:14:09 +04:00
shad fab3b988b4 fix(wizard): include request_id in apply-batch payload
Backend EA2 apply-batch requires a request_id (idempotency key). Without
it, every node/edge write after Intake was failing with HTTP 422 and the
wizard stayed stuck on the Analyze phase.

Verified via qa/audit_wizard_writes.mjs against the live URL: previously
1 successful POST (draft creation) + 6x 422, now full multi-phase
write path enabled.
2026-06-14 12:08:26 +04:00
shad 4bc7ae228a feat: rebuild Process Studio into multi-phase Process Creation Wizard\n\n- Replace toy Studio.tsx with proper Wizard.tsx canvas\n- Build 6-step flow: Intake -> Analyze -> Generate -> Validate -> Draft saved -> Publish\n- Implement incremental EA2 writes via wizardApi.ts (flow, batch apply)\n- Use localStorage for draft recovery across reloads\n- Apply industrial-blueprint UI styling matching core doctrine\n- Add Vitest tests for Wizard components and API wrappers 2026-06-14 03:47:26 +04:00