@floless/app 0.156.0 → 0.158.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/cli-actions.mjs +28 -5
  2. package/dist/floless-server.cjs +110947 -67461
  3. package/dist/schemas/drawing-check.profile.v1.schema.json +15 -2
  4. package/dist/schemas/steel.model.v2.schema.json +25 -1
  5. package/dist/skills/floless-app-actions/SKILL.md +82 -17
  6. package/dist/skills/floless-app-knowledge/SKILL.md +34 -2
  7. package/dist/skills/floless-app-knowledge/references/schema.md +4 -1
  8. package/dist/skills/floless-app-new-workflow/SKILL.md +23 -7
  9. package/dist/skills/floless-app-onboarding/SKILL.md +31 -1
  10. package/dist/skills/floless-app-report-issue/SKILL.md +3 -3
  11. package/dist/skills/floless-app-rfi/SKILL.md +40 -6
  12. package/dist/skills/floless-app-routines/SKILL.md +9 -2
  13. package/dist/skills/floless-app-steel-model/SKILL.md +35 -1
  14. package/dist/skills/floless-app-steel-model/references/detail-from-a-screenshot.md +4 -2
  15. package/dist/skills/floless-app-steel-takeoff/SKILL.md +51 -1
  16. package/dist/skills/floless-app-tweak-contract/SKILL.md +25 -5
  17. package/dist/skills/floless-app-workflows/SKILL.md +46 -10
  18. package/dist/skills/floless-app-workflows/references/agent-steps.md +119 -0
  19. package/dist/web/agent-steps.js +864 -47
  20. package/dist/web/agents.js +28 -8
  21. package/dist/web/app.css +620 -17
  22. package/dist/web/app.js +110 -11
  23. package/dist/web/aware-update-client.js +1 -0
  24. package/dist/web/aware.js +921 -220
  25. package/dist/web/chat-landing-scene.js +372 -0
  26. package/dist/web/chat.css +263 -1
  27. package/dist/web/chat.js +2660 -86
  28. package/dist/web/commands-drawing-check.js +17 -0
  29. package/dist/web/commands-shell.js +1059 -8
  30. package/dist/web/commands-steel.js +6 -0
  31. package/dist/web/connections.js +1 -0
  32. package/dist/web/drawing-check-editor.html +33 -5
  33. package/dist/web/drawing-check-editor.js +538 -22
  34. package/dist/web/drawing-check-overlay.js +13 -0
  35. package/dist/web/flo-avatar.js +28 -3
  36. package/dist/web/guide.js +7 -2
  37. package/dist/web/index.html +143 -8
  38. package/dist/web/instructor.js +4 -4
  39. package/dist/web/kb-categories.js +351 -0
  40. package/dist/web/kb-graph-worker.js +73 -0
  41. package/dist/web/model-view-query.js +12 -2
  42. package/dist/web/pages.js +978 -39
  43. package/dist/web/panels.js +5 -2
  44. package/dist/web/parser-setup-recovery.js +12 -4
  45. package/dist/web/project-access.js +549 -0
  46. package/dist/web/run-page-view.js +353 -0
  47. package/dist/web/startup-admission.js +132 -0
  48. package/dist/web/steel-3d-core.js +9 -0
  49. package/dist/web/steel-editor.html +681 -22
  50. package/dist/web/steel-model-v2-commands.js +63 -5
  51. package/dist/web/step-rename.js +287 -0
  52. package/dist/web/tab-signal.js +323 -0
  53. package/dist/web/terminal-requests.js +103 -13
  54. package/dist/web/tool-updates.js +1 -0
  55. package/dist/web/workspace-root-management.js +39 -0
  56. package/dist/web/workspaces.js +2883 -146
  57. package/launch-starting-page.mjs +181 -0
  58. package/launch.mjs +97 -12
  59. package/package.json +5 -1
@@ -80,7 +80,8 @@ members. Do not write the shared document yet.
80
80
 
81
81
  ## 7. Prove fit before saving
82
82
 
83
- Send the candidate contract to `POST /api/contract/<appId>/scene?project=<project>` and inspect the new
83
+ Send the candidate contract to `POST /api/contract/<appId>/scene?project=<project>` — in a FloLess chat or with
84
+ `floless-app do`, that is the `steel.check-fit` action with the candidate as `model` — and inspect the new
84
85
  joints' `fitEvidence` and `diagnostics`. The engine—not the AI—must prove that bearing faces meet with no
85
86
  gap or overlap, nothing interpenetrates, bolt grip equals the plies actually clamped, heads and nuts bear
86
87
  on real faces, and welds lie on the drawn joint line. Also confirm each placed joint produced its own
@@ -89,7 +90,8 @@ parts and inspect the rendered connection at useful zoom.
89
90
  If the engine reports a problem, give the user the relevant member/end and measured problem as a
90
91
  question. Leave the shared contract unchanged and keep the flat reference placeholder. Only after the
91
92
  new joints pass should the complete candidate replace the shared contract using the ETag from the latest
92
- read. If that write is stale, re-read, rebuild the candidate on the new document, and prove it again.
93
+ read (`steel.save-model` with that `etag`, which the person confirms on a card; `steel.read-model` is the read
94
+ that gives the tag). If that write is stale, re-read, rebuild the candidate on the new document, and prove it again.
93
95
 
94
96
  ## 8. Finish without hiding uncertainty
95
97
 
@@ -7,7 +7,7 @@ description: >-
7
7
  two-phase Drawing Filter process: first prepare and save the deterministic Filter, then read only the
8
8
  selected evidence into model-global members, registered plan views, observations, and revision history.
9
9
  metadata:
10
- version: 0.70.0
10
+ version: 0.71.0
11
11
  ---
12
12
 
13
13
  # Steel Takeoff — read drawings into `steel.model/v2`
@@ -188,6 +188,8 @@ it from the exact manifest, saved Filter, candidate, proof, project incarnation,
188
188
 
189
189
  ### Say the questions out loud — publishing quietly is the failure this whole flow exists to prevent
190
190
 
191
+ > **In a Quick read** this section's questions are decisions you record instead: see "Quick model reads".
192
+
191
193
  Every audit response carries **`audit.rfis`**: the questions this read could not settle. The server
192
194
  derives them from what you stated — you cannot author one, merge two, or leave one out. They are there
193
195
  whether the read was refused or went through.
@@ -301,6 +303,8 @@ How to say it:
301
303
 
302
304
  ### Carrying one as an RFI — what to actually send
303
305
 
306
+ > **Never in a Quick read**: a Quick read files no RFI in this version. See "Quick model reads".
307
+
304
308
  When the user cannot answer, the question becomes a **durable record** with a lifecycle, like an issue
305
309
  on GitHub: it stands open, it can be sent to the Engineer of Record, answered days later, and closed.
306
310
  It is not a note in the chat and not a line in the audit — it survives the read.
@@ -600,6 +604,46 @@ named values really are non-steel before publishing. Note those `dismissed=` cou
600
604
  SMALLER than the census `lineCounts` you attested for the same value: the census counts every line
601
605
  carrying it, the report counts only the ones this verdict dismissed through it.
602
606
 
607
+ ## Quick model reads: decide, record, never ask
608
+
609
+ A read can be a **Quick model**. The person chose it on the card that queued the read, and with it
610
+ agreed that you decide where a guided read would ask them. The instruction says so in its first
611
+ sentence: "This read is a QUICK MODEL". Never infer it from the project, never ask about it, and never
612
+ change it: the build mode is the person's and the server holds it.
613
+
614
+ In a Quick read:
615
+
616
+ - **Every ask in this skill becomes a decision you record**, with
617
+ `POST /api/projects/<projectId>/revision-requests/<requestId>/ai-decisions` and
618
+ `{ decisions: [ ... ] }` (1 to 500 per call). Each row is `{ subject, group, question, options,
619
+ chosen, why, evidence, confidence }`: the question a guided read would have asked, its plain choices,
620
+ the one you take, one sentence on what in the drawings settled it, what you read and where, and
621
+ `high`, `medium` or `low`. Low confidence is still a decision: choose what the drawings most support
622
+ and say why. Never leave it to the person.
623
+ - **What you decide, by channel:**
624
+
625
+ | A guided read would... | In a Quick read you record |
626
+ |---|---|
627
+ | ask a height on a height card (Establish each member's elevation) | `{ channel: "height", memberId, end: 0 or 1 }` with `valueMm` (world mm), then submit the end as `unknown` as usual: the server writes it as the AI's height |
628
+ | ask the read setup card: scale, origin, levels | `{ channel: "setup", row: "scale", viewId }` with `value: { mmPerPx }`; `{ channel: "setup", row: "origin" }` with `value: { xAxisId, yAxisId, xLabel, yLabel }`; `{ channel: "setup", row: "level", viewId }` with `value: { mm }` or `{ noSingleLevel: true }`. Then author exactly those values in the model |
629
+ | ask or confirm a plan level (`plan-elevation-proposal`) | read the sheets first, take the proposal's readings as evidence, and record the level decision; never relay its ask |
630
+ | ask a scale (`ask-and-confirm`, `ask-and-wait`, `scaleQuestionBriefing`, a known printed dimension) | measure and choose it yourself, and record the scale decision quoting what settled it |
631
+ | ask the bubble-token question | `{ channel: "audit-gap", gapKind: "bubble-token", fields: { sheet } }` with the reading the sheet supports |
632
+ | talk through the audit questions, offer or file an RFI | **settle every question you can first**: look again (the sheets it names, sections, schedules, notes, the page pictures), decide the answer the drawings support, repair the model to match, and record `{ channel: "audit-gap", gapKind: <row kind>, fields: { rfiId: <row id> } }` with the question in your own words (at most 600 characters); then audit again. A height is the exception: settle it with the height decision above, never by writing `z`; on a member already in the published model it is recorded but not applied, so count it as answered but not applied, not as open. An RFI is the last step, never a way to hand work back: only a question you genuinely cannot settle after trying stays open, and those must be as few as possible. Nothing is filed in this version: submit `rfiSelection: { requestId, gaps: [] }` and say in your closing summary how many questions you settled and how many stay open, by priority, naming the first open group |
633
+
634
+ - **The honesty rules do not bend.** A decision is the AI's and is recorded as the AI's. Never write
635
+ `answered`, `assumed` or `decided` into the model yourself: the server writes those. A height the drawings
636
+ state always wins over a decision. A decision for a member already in the published model is kept with
637
+ the read but is not applied to that member in this version.
638
+ - **What still stops a Quick read:** the Drawing Filter Save (the person's, as above), and any audit
639
+ recovery whose owner is `"user"` (park with `needs-you`, as in a guided read). Name each one; never
640
+ work around it.
641
+ - **What answers 409 in a Quick read:** `height-questions` and `setup-questions` (`quick-read-decides`),
642
+ every RFI write route (`quick-read-acts-as-person`), and a submit that selects questions to file
643
+ (`quick-read-files-no-rfis`). Each says what to do instead; do it.
644
+
645
+ Each section below that asks the person says "In a Quick read" and points here.
646
+
603
647
  ## Find the active request
604
648
 
605
649
  Use the authoritative local request address carried in the queued request. Fetch the current request and
@@ -764,6 +808,8 @@ refusal produces exactly the confident wrong answer the step exists to prevent.
764
808
 
765
809
  ### The read setup card: scale, origin and plan levels, answered by the person
766
810
 
811
+ > **In a Quick read** this section's questions are decisions you record instead: see "Quick model reads".
812
+
767
813
  Every read needs the same setup answers: each plan view's drawing scale (`mm_per_px`), the model
768
814
  origin, and each plan view's level (`elevation_mm`). **Ask them on ONE read setup card, never in
769
815
  prose.** On the owner's Take 5 read these went wrong in chat: the scale was asked three times, the
@@ -1163,6 +1209,8 @@ perimeter runs governed by a general note all survive a length filter. Each earn
1163
1209
 
1164
1210
  ### Establish each member's elevation
1165
1211
 
1212
+ > **In a Quick read** this section's questions are decisions you record instead: see "Quick model reads".
1213
+
1166
1214
  Every framing endpoint needs a source-backed world-millimetre elevation, and the drawings will not hand
1167
1215
  it to you in one place. Like the member rules above, this is a **candidate signal, not a
1168
1216
  drafting law. Drawing truth wins, always.**
@@ -1660,6 +1708,8 @@ working project contract; approval and bake strip them from published artifacts.
1660
1708
 
1661
1709
  ## Submit through revision-read
1662
1710
 
1711
+ > **In a Quick read** `rfiSelection` is always `{ requestId, gaps: [] }`, on every submit, re-read and restage. See "Quick model reads".
1712
+
1663
1713
  When an observation in any supported source view traces a member but the source views cannot yet prove its
1664
1714
  world placement, do not invent world coordinates or put that member in `contract.members`. Keep every
1665
1715
  direct active observation, member binding, and endpoint-lineage row in the contract, and send the member
@@ -2,7 +2,7 @@
2
2
  name: floless-app-tweak-contract
3
3
  description: Handle a pending floless tweak-contract request from the Steel Model editor. Use when a user asks the terminal AI a question about selected model items or asks it to change a member, grid, plan view, connection, or other field in the current steel.model/v2 project contract. Resolve typed selections from the current native model, answer queries without writing, or apply only the requested edit with optimistic concurrency and without approving it.
4
4
  metadata:
5
- version: 0.11.0
5
+ version: 0.12.0
6
6
  ---
7
7
 
8
8
  # Handle a `tweak-contract` request
@@ -11,11 +11,30 @@ This verb reads or edits the current native `steel.model/v2` working document. A
11
11
  the current document without writing; a `modify` applies a requested change. Neither mode reads drawings,
12
12
  prepares a Drawing Filter, creates a revision, approves the model, or bakes the workflow.
13
13
 
14
+ ## Which calls to use
15
+
16
+ Prefer the FloLess action over the raw route it runs: same route, same checks, and the person's card or the
17
+ model tag is handled for you. Inside a FloLess AI chat these are `floless_action_read` /
18
+ `floless_action_call` / `floless_action_propose`; in a terminal, `floless-app do <id> --json` (see
19
+ `floless-app-actions`). The ones this verb uses:
20
+
21
+ - `steel.read-model` reads the project's model and its model tag (`etag`) — the GET below.
22
+ - `steel.model-details` reads the derived sizes, lengths and weights of the selected items — the properties POST.
23
+ - `steel.check-fit` and `steel.confidence` check an edited copy before it is saved, without saving it.
24
+ - `steel.save-model` saves the complete edited model with the tag you read — the PUT below. It is a change the
25
+ person confirms on a card, so call it as a proposal (from a terminal add `--wait`); a model that has moved
26
+ since is refused, never overwritten.
27
+ - Smaller edits have their own actions: `steel.set-display-units`, the `steel.member-ends-*` verbs,
28
+ `steel.place-connection`, `steel.reopen-connection` and the favourites.
29
+
30
+ The headless read-only run described under "Selection" is different: it has no actions and no raw routes,
31
+ only the operation-shaped tools the host offers, and it never writes. Nothing in this section widens it.
32
+
14
33
  ## Loop
15
34
 
16
35
  1. Discover the active FloLess server and fetch pending requests as described by `floless-app-queue`.
17
36
  Select the exact `tweak-contract` request and record its `requestId`, `appId`, `project`, and text.
18
- 2. GET the project-scoped contract. Keep the response ETag. Refuse any document whose `type` is not
37
+ 2. GET the project-scoped contract (`steel.read-model`). Keep the response ETag (the action's `etag`). Refuse any document whose `type` is not
19
38
  `steel.model/v2` or whose `origin` is not `native`.
20
39
  3. Read `schemas/steel.model.v2.schema.json` before editing. Root `members[]` and `grid` are model-global;
21
40
  `plans[]` are registered drawing views with observations and presentation refs.
@@ -31,8 +50,8 @@ prepares a Drawing Filter, creates a revision, approves the model, or bakes the
31
50
  especially the saved Filter, plan registration, source hashes, observations, views, details, and
32
51
  confidential draft state.
33
52
  5. For `modify` only, PUT the complete contract back to the same project-scoped route with `If-Match: <ETag>` and the
34
- request header required by the server. If the ETag is stale, refetch and reapply the edit; never
35
- overwrite concurrent work.
53
+ request header required by the server (`steel.save-model` with `etag` and `model` does exactly this). If the
54
+ ETag is stale, refetch and reapply the edit; never overwrite concurrent work.
36
55
  6. Resolve a query after answering, or a modification only after its write succeeds. Do not approve or
37
56
  mint a History version.
38
57
 
@@ -49,7 +68,8 @@ prepares a Drawing Filter, creates a revision, approves the model, or bakes the
49
68
  - When `target.baseEtag` differs from the fresh GET's ETag, re-resolve every id and tell the user what
50
69
  moved or disappeared before answering or editing.
51
70
  - Read authored fields directly from the contract GET. For server-derived member properties, POST
52
- `/api/contract/<appId>/properties?project=<project>` with `{ "items": target.items }`. Use the
71
+ `/api/contract/<appId>/properties?project=<project>` with `{ "items": target.items }` (`steel.model-details`
72
+ with `items`, outside a headless read-only run). Use the
53
73
  response's units for requested values; mention provenance only when the user asks for it. Its `etag`
54
74
  must equal the contract GET's ETag; if it
55
75
  differs, re-GET and retry so authored and derived values never come from different generations.
@@ -1,8 +1,8 @@
1
1
  ---
2
2
  name: floless-app-workflows
3
- description: This skill should be used when building, modifying, or reasoning about FloLess .flo workflows for floless.app — especially reusable apps that take inputs (e.g. a phase number) and run across different Tekla models, exec nodes that run Roslyn C# against the live model, Blender animations of a building (blender/exec Python rendered headlessly — construction sequence, fly-through, sun study), the in-app HTML Viewer, the Code tab, or "Debug in VS". Covers the exec contract, the install→validate→compile→run loop, app inputs templating, reading approved Workspace project data and immutable approved Revit model snapshots through the floless-workspace REST seam plus its themed pickers, and the server seams (aware-adapter, app-reader, index).
3
+ description: This skill should be used when building, modifying, or reasoning about FloLess .flo workflows for floless.app — especially reusable apps that take inputs (e.g. a phase number) and run across different models from any source (Tekla, Revit, Rhino, SketchUp, an IFC file, the FloLess steel model, a Workspace project), exec nodes that run code against a live host model (e.g. Roslyn C# in Tekla), Blender animations of a building (blender/exec Python rendered headlessly — construction sequence, fly-through, sun study), the in-app HTML Viewer, the Code tab, or "Debug in VS". Covers the exec contract, the install→validate→compile→run loop, app inputs templating, reading approved Workspace project data and immutable approved Revit model snapshots through the floless-workspace REST seam plus its themed pickers, and the server seams (aware-adapter, app-reader, index).
4
4
  metadata:
5
- version: 0.7.2
5
+ version: 0.8.7
6
6
  ---
7
7
 
8
8
  # Building reusable .flo workflows in floless.app
@@ -16,7 +16,9 @@ an LLM — it renders AWARE state, triggers `aware` verbs, and relays user inten
16
16
 
17
17
  The deliverable floless.app produces is a **reusable FloLess `.flo` app** (which runs on AWARE): one that declares
18
18
  `inputs:` with defaults and runs unchanged across different models. The canonical example
19
- lives at `demos/tekla-bom-by-phase/` — study it before building a new one.
19
+ lives at `demos/tekla-bom-by-phase/` — study it before building a new one. It is a Tekla
20
+ workflow only because Tekla came first: the shape (inputs → core logic → viewer) is the same
21
+ for any host or for none, so don't assume the user's model is in Tekla — ask what it is in.
20
22
 
21
23
  > **Pasted a request?** If the user pastes a message beginning with a
22
24
  > `[floless-request type=tweak|use-template id=…]` marker, that's a request **copied from the
@@ -164,6 +166,18 @@ Two rules that bite immediately:
164
166
  Do **not** write a file. AWARE ships no html-report render binary, and inline HTML keeps the
165
167
  app model-agnostic (no filesystem permission, no hardcoded path). The HTML Viewer renders
166
168
  whatever the node returns.
169
+ - **A report with files (images, a 3D model, data) — `report_folder`.** Every successful real run's
170
+ report becomes the next version of the workflow's Page. When the report needs files beside it,
171
+ write them under one folder as `<folder>/assets/...` (up to two folders deep inside `assets/`,
172
+ Page file types only, 50 MB per file), reference them from the HTML as `assets/...`, and return
173
+ the folder's full path with the HTML: `return new { ok = true, html = ..., report_folder = dir };`.
174
+ Give each run a folder of its own (for example a timestamp in its name): FloLess reads the folder
175
+ when the run finishes, so a later run writing into the same folder could mix its files in.
176
+ The Page version is the returned `html` plus those files; the run's HTML Viewer still shows
177
+ `html` alone, where those relative files don't load (they show in the Page: Open in Pages). A
178
+ folder FloLess can't use (a link, a file type a Page can't carry, over a limit) saves the report
179
+ without its files and says why. AWARE `viewer-3d` views and complete model property reports are
180
+ captured on their own — no `report_folder` needed.
167
181
  - **No `System.Net`** (so no `WebUtility.HtmlEncode`) — escape with a manual lambda.
168
182
 
169
183
  ## Building animations: `blender/exec` (Python, rendered headlessly)
@@ -365,6 +379,23 @@ picker, HTTP-200 gate, and one Run/HTML Viewer path for Revit and Tekla Parser.
365
379
  the whole report to one approved revision and current module entitlement; do not add a page-size
366
380
  or object/property cap, or treat an incomplete stream as a report. See `references/workspace-data.md`.
367
381
 
382
+ ## Put a saved Agent in a workflow (Agent steps) — AWARE 0.160.0+
383
+
384
+ An **Agent step** runs one Agent the person saved on the Agents page as a step of the workflow: the only
385
+ way a model may reason at run time, and only with the person's recorded confirmation that its answer may
386
+ differ each run. Read `references/agent-steps.md` before adding one. The rules in short:
387
+
388
+ - Use one only for work that needs judgement at run time; anything a fixed rule can do stays an ordinary node.
389
+ - Find the Agent with `agent-steps.agents`, then get the step from FloLess with the `agent-steps.block` action and copy it byte for byte (the step and its
390
+ `<id>-ok` predicate); never type the pinned fields. Wire what feeds it into the step, and `<id>-ok` into the
391
+ first node that uses the answer.
392
+ - Put a **confirm** step (and an `e.body.proceed == true` predicate) before anything that writes, and make the
393
+ write read only the confirm step's `approvedValues`.
394
+ - Add `nondeterministic-output: acknowledged` (AWARE's marker; not consent), then check the workflow with
395
+ `agent-steps.check-source` before you call it ready.
396
+ - **The person confirms in FloLess's approval dialog; you never do.** Open it for them with `agent-steps.confirm`.
397
+ - Never describe such a workflow, or its output, as deterministic. `kb:` on a step is not supported yet.
398
+
368
399
  ## Consult and cite the project's knowledge at run time — retrieval only
369
400
 
370
401
  Use `floless-workspace/read-knowledge` only when a run must retrieve a project's compiled knowledge
@@ -392,8 +423,9 @@ model.
392
423
  matching the subject is legitimate retrieval, not an excuse to invent a citation; make the report
393
424
  say so honestly.
394
425
 
395
- Never add an agent/LLM node, vector store, or KB-drift Run gate to this path. Interpretation belongs
396
- at compose time; runtime knowledge may only be retrieved, cited, or deterministically gated.
426
+ Never add a model node, vector store, or KB-drift Run gate to this path. Interpretation belongs at
427
+ compose time; runtime knowledge may only be retrieved, cited, or deterministically gated. (An Agent step
428
+ may not reason over the knowledge base yet: `kb:` on a step is answered "not supported yet".)
397
429
 
398
430
  ## Author against the project's knowledge, not your priors — COMPOSE TIME
399
431
 
@@ -441,11 +473,12 @@ When work is tied to a Workspace project (the user names one, or a queued reques
441
473
  user when they have diverged. Re-reading the feed to "pin the latest" would record a generation
442
474
  whose contents never touched your work, which is the one failure this record exists to prevent.
443
475
 
444
- Compose time only: what you learn is baked into the `.flo`. A model in the run path is refused by
445
- AWARE (`E_APP_RUNTIME_MODEL_FORBIDDEN`) and would void "build once, run forever" — **outside the one
446
- curated carve-out**, `vision.extract`, which is admitted only because it is `category: curated` and
447
- declares `capabilities.runtime-model-extraction: true`, and which extracts but never decides. See
448
- `references/visual-inputs.md`. Nothing you author for knowledge belongs in that carve-out.
476
+ Compose time only: what you learn is baked into the `.flo`. An ordinary model node in the run path is
477
+ refused by AWARE (`E_APP_RUNTIME_MODEL_FORBIDDEN`). Two routes are admitted, and neither is a way to reach
478
+ knowledge at run time: the curated `vision.extract` (`category: curated`, declaring
479
+ `capabilities.runtime-model-extraction: true`; it extracts but never decides — see
480
+ `references/visual-inputs.md`), and a consented **Agent step** (see "Put a saved Agent in a workflow",
481
+ which cannot reason over the knowledge base yet). Nothing you author for knowledge belongs in either.
449
482
 
450
483
  ## How the UI surfaces map to AWARE state
451
484
 
@@ -590,6 +623,9 @@ past a few hard facts, split it into a `references/` file and link it.
590
623
  Enforced by `npm run verify:flo` in CI. See "Every node's Description must be plain English".
591
624
  - Determinism is AWARE's: `<app>.lock` is the approved artifact; Run is gated on a fresh
592
625
  source-hash. Never let the UI run on drift.
626
+ - **A model reaches the run path only as an Agent step,** with the person's own confirmation that its
627
+ answer may differ each run. You never confirm for them, never add any other model node, and never call
628
+ such a workflow or its output deterministic. See `references/agent-steps.md`.
593
629
  - **Never edit a MAINTAINED app's `.flo` in place.** A maintained app is FloLess-published
594
630
  (`publisher: floless`) and not forked — it tracks our update channel and its output is our
595
631
  responsibility. To run it across projects with different data, **Duplicate** it (stays maintained,
@@ -0,0 +1,119 @@
1
+ # Agent steps — putting a saved Agent in a workflow (AWARE 0.160.0+)
2
+
3
+ An **Agent step** runs one Agent the person saved on the Agents page as a step of a workflow. It is the
4
+ one place a model may reason while a workflow runs, and it is opt-in on both sides: AWARE runs it only
5
+ when the source carries the acknowledgement marker, and FloLess approves the workflow only after the
6
+ **person** ticks that its answer may differ each run.
7
+
8
+ Everything else in the workflow stays deterministic. The `.flo` → `.lock` gate still applies to the
9
+ whole workflow: the step and its instructions are pinned by the lock, and only the step's answer varies.
10
+
11
+ ## When to use one, and when not
12
+
13
+ - **Use it** when the work genuinely needs judgement at run time: reading a free-text note and
14
+ classifying it, summarising what came back from a read, choosing between options a person described.
15
+ - **Do not use it** for anything a fixed rule can do. A filter, a threshold, a lookup, a format
16
+ conversion or a value you can read from the project's knowledge at compose time belongs in an
17
+ ordinary node, where it gives the same answer every run.
18
+ - **Never** put a model in a workflow any other way: no other agent or node that calls an LLM. The
19
+ Agent step is the only route, because it carries the person's consent, the labels and the run record.
20
+
21
+ ## Build it
22
+
23
+ 1. **Find the Agent.** List the Agents you can put in this workflow with the `agent-steps.agents`
24
+ action (name, id, which AI answers, revision — the same choice the canvas offers) and pick one by id.
25
+ (`agents.list` is the full workspace list; a chat working on one workflow is not given it.) If none fits, say so and offer to create one on the Agents page; do not invent one.
26
+ 2. **Get the pinned step from FloLess, never type it.** Call the `agent-steps.block` action with the
27
+ Agent's id and, when you know them, the workflow id, a starting node id, one plain-English
28
+ description, the `context` template that feeds it (for example `{{ read-notes.result.text }}`),
29
+ the provider and the answer format (`{"format":"text"}` or `{"format":"json","fields":{…}}`).
30
+ It returns YAML with two parts:
31
+ - `nodes:` — the step itself (`agent: floless-agent-step`, `command: reason`) and its **`<id>-ok`**
32
+ predicate, which stops the run cleanly when the Agent could not answer;
33
+ - `connections:` — `<id>` → `<id>-ok`.
34
+ Copy both parts **byte for byte**. The pinned fields (instructions, agent id and revision, provider,
35
+ scope, output, limits) are what the lock approves; a retyped field is a different step.
36
+ 3. **Wire it.** Add your own connections: the node that feeds the step → `<id>`, and `<id>-ok` → the
37
+ first node that uses the answer. Every node that uses the answer must come **after `<id>-ok`**, so it
38
+ never runs on a step that did not answer.
39
+ 4. **Read the answer by its path.** A text answer is `{{ <id>.body.text }}`; a JSON answer's field is
40
+ `{{ <id>.body.answer.<field> }}`. Questions and assumptions the Agent raised are listed in the run
41
+ record for the person; do not try to act on them in the workflow.
42
+ 5. **Hold every write behind a confirmation.** If anything after the step changes a model, a file or a
43
+ design program, put a **confirm** step before it: a `floless-agent-step` node with
44
+ `command: confirm`, whose body carries `run-id: "{{ run.id }}"`, `node-id` (its own id), a plain-English
45
+ `summary` of what will change, the `values` the write will use, and optional `timeout-minutes`. Follow it with a
46
+ predicate `e.body.proceed == true`, and make the write read **only** `{{ <confirm-id>.body.approvedValues… }}`.
47
+ No AI runs in a confirm step; a person approves exactly the values shown. An unattended run (a
48
+ routine) gets `proceed: false` at once, so the write is skipped and recorded as not made.
49
+ 6. **Add the acknowledgement marker.** The top-level line `nondeterministic-output: acknowledged`
50
+ (the block helper also returns it). It is only the marker AWARE needs before it will install or
51
+ compile an Agent step, so you can author, install and compile freely. **It is not consent.**
52
+ 7. **Write plain-English Descriptions** as for every node; the step's description says which Agent it
53
+ asks and that its answer is written by an AI and may differ each time.
54
+ 8. **If the Agent should check against the project's Knowledge, pin a query, never browse.** Ask the
55
+ block helper with `kbQuery` (a few plain words to look for), and `kbProject` (a project id the Agent
56
+ reads; it defaults to the only one) and `kbMaxPages` (1 to 8, default 4) when needed. The step then
57
+ carries `kb: { project, q, max-pages }`. Before the Agent starts, **FloLess** reads the best-matching
58
+ pages of that project's published Knowledge and gives them to it as evidence; the Agent has no
59
+ Knowledge search of its own in a step, so do not tell it to look anything up. The pages it may cite
60
+ are only those; a citation outside them is dropped and becomes a question for the person. A JSON
61
+ answer then also has `{{ <id>.body.citations }}` (the slugs it says it used); a text answer ends with
62
+ a `Sources:` line. If the project has no published Knowledge, or nothing matches, the step still runs
63
+ and its answer says it rests on no Knowledge — if a missing standard must stop the run, gate on the
64
+ answer with a predicate. Changing the query is a change the person confirms again. Values you can
65
+ read from the Knowledge yourself at compose time still belong baked into ordinary nodes.
66
+ 9. **Check before you say it is ready.** Call `agent-steps.check-source` with the workflow text (or
67
+ `agent-steps.check-workflow` once it is installed). It says whether each step still matches its saved
68
+ Agent: newer instructions, a deleted Agent, or a project the step can no longer read. Fix what it
69
+ reports by asking for a fresh block, never by editing pinned fields.
70
+
71
+ ## The person confirms — never you
72
+
73
+ Before the workflow can be approved and run, the person ticks in FloLess's approval dialog that it has
74
+ an AI step whose answer may differ each run. They tick it again whenever an Agent step is added or its
75
+ instructions change. **You never give that confirmation and nothing in a chat can answer the dialog.**
76
+ Hand them the screen with the human-only `agent-steps.confirm` action, and say in plain words what they
77
+ are confirming.
78
+
79
+ ## What the person sees
80
+
81
+ FloLess labels the workflow and its output wherever they show: the canvas (the step's **AI Agent step**
82
+ badge, and a quieter mark on nodes it found using or decided by the answer), Inspect, the execution
83
+ trace, the Last run panel, the report (an "AI-generated content" pill and a footer) and history rows.
84
+ The report's note is the person's to turn off, per workflow (the Agent step's Inspect panel) or for all
85
+ reports (the ≡ menu); FloLess's own screens stay labelled either way. Never turn it off for them.
86
+ Marks on other nodes are what FloLess *found*; it always says other steps may depend on the answer in
87
+ ways it cannot trace. Never describe the rest of such a workflow, or its output, as deterministic.
88
+
89
+ ## Unattended runs
90
+
91
+ A routine cannot ask mid-run. An Agent step in an unattended run follows the safe default: it does the
92
+ work read-only, labels what rests on an assumption, and lists its questions for the person at the top of
93
+ the result. A confirm step in an unattended run never approves; the write is recorded as not made.
94
+
95
+ A workflow that **waits for a trigger** (a watcher: an On trigger routine, or ▶ Run on a watching workflow)
96
+ runs its Agent step **once for each event that reaches it**, unattended:
97
+
98
+ - **The person confirms it twice, in FloLess's own dialog.** Besides the usual tick, a second tick says the
99
+ AI step may run on its own each time the trigger fires, with the wait between answers they set there.
100
+ You never tick either for them and cannot: the chat can only open the workflow for them (`agent-steps.confirm`),
101
+ where they confirm it with Approve or ▶ Run.
102
+ - **Each step waits between answers**, 1 minute unless the person sets another wait or turns it off. An
103
+ event inside the wait skips the AI step: its `ok` is false with `reason: cooldown`, so the steps behind
104
+ its `-ok` check do not run for that event, and the skip is listed for the person. Do not work around it.
105
+ You may make the wait LONGER (`agent-steps.lengthen-trigger-wait`); a shorter wait or none lets the AI
106
+ run more often and only the person can set it: open the workflow for them (`agent-steps.confirm`) and tell
107
+ them to select the AI step and use **Change** under *When the trigger fires* in Inspect, which asks them to confirm.
108
+ - **Every change behind a confirm step is held** in a saved watcher (nobody is watching it). In a live run
109
+ a person started with Run, the change card shows only while they have the live run on screen.
110
+ - **What happened for each event** is listed per event (`agent-steps.trigger-history`): answered, skipped
111
+ because of the wait, not answered, and the questions and held changes waiting for the person. Read it
112
+ when the person asks what the watcher did; never claim an event was answered without it.
113
+ - Watchers' AI steps share the AI conversations with the person's own Agents and use at most 2 of the 4
114
+ at once, so an event can wait its turn and end as "did not answer in time". That is expected, not a fault.
115
+
116
+ ## Not supported yet
117
+
118
+ - On an AWARE older than 0.160.0 the step cannot run and FloLess hides the controls; say so and suggest
119
+ updating AWARE rather than working around it.