@floless/app 0.137.3 → 0.138.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 (47) hide show
  1. package/dist/floless-server.cjs +47890 -27033
  2. package/dist/internal-workflows/floless-rfi-gmail-send/.floless-owner.json +1 -0
  3. package/dist/internal-workflows/floless-rfi-gmail-send/floless-rfi-gmail-send.flo +32 -0
  4. package/dist/schemas/steel.model.v2.schema.json +218 -27
  5. package/dist/skills/floless-app-knowledge/SKILL.md +5 -2
  6. package/dist/skills/floless-app-rfi/SKILL.md +410 -0
  7. package/dist/skills/floless-app-routines/SKILL.md +7 -2
  8. package/dist/skills/floless-app-routines/references/routines-api.md +14 -5
  9. package/dist/skills/floless-app-steel-model/SKILL.md +34 -32
  10. package/dist/skills/floless-app-steel-takeoff/SKILL.md +498 -34
  11. package/dist/skills/floless-app-steel-takeoff/references/elevation-registration.md +6 -6
  12. package/dist/skills/floless-app-tweak-contract/SKILL.md +6 -2
  13. package/dist/templates/floless-workspace-knowledge.flo +20 -4
  14. package/dist/templates/steel-model.flo +27 -15
  15. package/dist/web/app.css +559 -131
  16. package/dist/web/app.js +216 -54
  17. package/dist/web/aware.js +982 -128
  18. package/dist/web/checkpoint-standard.js +218 -0
  19. package/dist/web/commands-filter.js +23 -0
  20. package/dist/web/commands-shell.js +237 -5
  21. package/dist/web/commands-steel.js +172 -47
  22. package/dist/web/connection-review-client.js +2 -2
  23. package/dist/web/display-units.js +243 -0
  24. package/dist/web/grid-core.js +474 -58
  25. package/dist/web/grid-display.js +344 -0
  26. package/dist/web/index.html +106 -66
  27. package/dist/web/instructor-reporter.js +5 -0
  28. package/dist/web/instructor.js +175 -33
  29. package/dist/web/json-schema-subset.js +145 -25
  30. package/dist/web/steel-3d-core.js +237 -151
  31. package/dist/web/steel-3d-view.js +366 -113
  32. package/dist/web/steel-catalog-picker.js +98 -15
  33. package/dist/web/steel-detail-refs.js +1 -1
  34. package/dist/web/steel-editor.html +6479 -921
  35. package/dist/web/steel-filter.html +404 -57
  36. package/dist/web/steel-model-adapter.js +1 -1
  37. package/dist/web/steel-model-commands.js +72 -66
  38. package/dist/web/steel-model-v2-client-validation.js +10 -3
  39. package/dist/web/steel-model-v2-commands.js +269 -77
  40. package/dist/web/steel-model-v2-projection.js +18 -17
  41. package/dist/web/steel-plan-transform.js +52 -9
  42. package/dist/web/steel-plan-view-id.js +1 -7
  43. package/dist/web/steel-read-confidence.js +454 -5
  44. package/dist/web/steel-units.js +39 -0
  45. package/dist/web/steel-view-generation.js +21 -7
  46. package/dist/web/workspaces.js +2178 -497
  47. package/package.json +5 -1
@@ -0,0 +1,410 @@
1
+ ---
2
+ name: floless-app-rfi
3
+ description: File, send, and manage RFIs on a floless.app project from the terminal. Use when the user asks to raise an RFI, send it through the connected Gmail account, record a manual send, chase one, record an answer that came back from the engineer, mark an answer as applied, close or reopen an RFI, or asks what questions are still outstanding on a project. Also use when a size the AI could not work out is one the user cannot answer either, so the question has to become a durable record instead of a message that scrolls away.
4
+ metadata:
5
+ version: 0.2.2
6
+ ---
7
+
8
+ # File and manage a project's RFIs
9
+
10
+ ## What an RFI is here
11
+
12
+ **A record with a lifecycle, like an issue on a tracker** — authored with a question, standing open,
13
+ addressed to somebody, answerable days later, closable. It is not a note in the chat and not a line in
14
+ a report. It survives re-reads and model rebuilds.
15
+
16
+ FloLess owns that record. This skill drives its routes; it never writes the file, never invents a
17
+ question, and never composes a location.
18
+
19
+ ## The rule — ask FIRST, file only what nobody could answer
20
+
21
+ An RFI is **step three**, and skipping step two is the failure this whole design exists to delete.
22
+
23
+ 1. Something cannot be worked out — a size, an elevation, what a band of linework is.
24
+ 2. **Ask the user, in the chat, while you are working.** Name the thing the way a detailer would, say
25
+ where it is, and offer a way forward — the value you would proceed with, or two options with the
26
+ trade named. Never a bare "cannot determine".
27
+ 3. **Only if the user still cannot answer does an RFI get filed.**
28
+
29
+ And the user always ends with a model. An RFI carries a question forward; it never withholds steel.
30
+
31
+ ## Resolve the server and the project
32
+
33
+ 1. Resolve the running FloLess base URL. Prefer the port supplied by the request or context; otherwise
34
+ read `~/.floless/port`, then try the installed default `http://127.0.0.1:4317`. Confirm with
35
+ `GET /api/health`.
36
+ 2. Resolve the project with `GET /api/projects`. Keep the returned `id` and `app`; never build an id
37
+ from a display name. If the name is ambiguous, ask the user to choose.
38
+
39
+ **A healthy server is not a usable one.** The workspace API is behind a subscription gate. Any RFI call
40
+ can answer `402 {ok:false, error:"subscription required", state, reason, signInUrl}` — report `state`,
41
+ `reason` and the sign-in link to the user and stop. Do not retry.
42
+
43
+ ## Read the list before writing anything
44
+
45
+ ```
46
+ GET /api/projects/<projectId>/rfis
47
+ -> { ok, fileRevision, sizeTruth, sizeTruthDetail?, rfis: [ … ] }
48
+ ```
49
+
50
+ Newest first. Each row carries `id` (`RFI-001`, `RFI-002`, …), `seq`, `recordRevision`, `kind`,
51
+ `status` (`open` | `sent` | `answered` | `closed`), `disposition`, `question`, `subjects`, `targets`,
52
+ `raisedAt`, `raisedBy`, and — for the current cycle only — `answer`, `sent`, `applied`, `closed`.
53
+ `text` is the composed body to paste into an email; it is **absent** when the record has no question to
54
+ compose, so check for it rather than sending an empty message.
55
+
56
+ ### Recover a drawing read whose model published but whose RFI filing failed
57
+
58
+ When a drawing-read response contains `rfiFailure`, the model and its History version already exist.
59
+ Do not re-read the drawings and do not re-submit the model. Retry only the failed sidecar write:
60
+
61
+ ```
62
+ POST /api/projects/<projectId>/versions/<versionN>/rfis
63
+ <the exact original rfiSelection body>
64
+ ```
65
+
66
+ Use the exact `requestId`, gap order, `gapKey`, `proposed`, and `tried` values originally submitted.
67
+ For an omission-only failure where no explicit selection was submitted, send
68
+ `{ "requestId": "<the read request id>", "gaps": [] }`. The server checks the immutable audit and
69
+ the retry receipt on that exact version, derives a confirmed re-read's still-applicable subset, and
70
+ files each occurrence at the original `versionN`. Repeating the same call is safe and does not advance
71
+ the RFI file revision after everything is already present.
72
+
73
+ A 409 means the stored version does not authorise that exact retry, its evidence changed, or recovery
74
+ is pending. Quote the server's sentence and stop; never alter the selection to make it pass. A 503 is a
75
+ storage fault and may be retried later with the same body. On success, say which rows were created,
76
+ reused, reopened, superseded, already present, unplaceable, or over capacity.
77
+
78
+ **"A size question" means `kind: "unknown-size"` and nothing else.** It is the only kind FloLess can
79
+ apply, and the only one that answers with a section designation. Other kinds have size-sounding names —
80
+ `size-disagrees-with-schedule`, `unreadable-schedule-value` — and they are **prose** questions like every
81
+ other kind: a written answer, and a close as `answer-accepted`. Read `kind` off the row; never infer it
82
+ from what the question is about.
83
+
84
+ `sizeTruth: "unavailable"` means the model could not be read. **It does not stop everything** — sending,
85
+ answering, reopening and every close except `resolved` still work, because they are statements about the
86
+ correspondence rather than about the steel. It stops exactly three: **filing a new one**, `apply`, and
87
+ closing as `resolved` — the three that need to ask the steel something. Say the degraded condition out
88
+ loud, quoting `sizeTruthDetail`, and carry on with the rest.
89
+
90
+ ## Filing a new one
91
+
92
+ ### Which member
93
+
94
+ Filing needs a **model member id**. Get it from the user, from the question you were already asking
95
+ them, or by reading the current model at `GET /api/contract/<appId>?project=<projectId>` and matching
96
+ on `members[].id` and `members[].profile`. Never invent one from a mark or a display name, and ask when
97
+ more than one member fits. The server arbitrates — it refuses an id the model does not have.
98
+
99
+ ### The route
100
+
101
+ **Creating a record and acting on it are one call.** There is no create-only affordance, on purpose: a
102
+ create-then-send that fails halfway leaves an open record with no date and no recipient.
103
+
104
+ ```
105
+ POST /api/projects/<projectId>/rfis
106
+ {
107
+ "operationKey": "<unique for this intent>",
108
+ "memberId": "<model member id>",
109
+ "action": "send",
110
+ "expectedRfiId": null,
111
+ "expectedRfiRevision": null,
112
+ "to": "<who it goes to>"
113
+ }
114
+ ```
115
+
116
+ `action` is `send` or `answer` and nothing else. To file with an answer already in hand:
117
+
118
+ ```
119
+ { "operationKey": "…", "memberId": "…", "action": "answer",
120
+ "expectedRfiId": null, "expectedRfiRevision": null,
121
+ "answer": { "form": "profile", "profile": "<section designation>" } }
122
+ ```
123
+
124
+ Answers `200 { ok, replayed, fileRevision, rfi }`. **You do not write the question or its location** —
125
+ the server composes both from what the read already recorded about that member, and always ties the
126
+ record to the member itself.
127
+
128
+ The two `expected…` fields are the gap-head precondition from the RFI list you just read. Use both
129
+ `null` when that member has no current record. If the list already has the current record for this
130
+ gap, send its `id` and `recordRevision` instead. Keep those exact two values with the same
131
+ `operationKey` when retrying the same intent; re-read and mint a new key only for a new intent.
132
+
133
+ **It is not always a NEW record.** The server matches on the member's gap, so if a record for that member
134
+ already exists it is re-observed, or reopened, or superseded by a linked replacement — and the `rfi` you
135
+ get back may be an id that was already there. Read `id` off the response rather than announcing a new
136
+ one, and say *"added to RFI-002"* when that is what happened. The corollary is a refusal that will look
137
+ like it belongs to somebody else's request. Filing with `action: "send"` against a still-unresolved
138
+ member whose record is already `answered` returns **`400 rfi-not-open` — *"an RFI can only be sent while
139
+ it is open (this one is answered)"***; with `action: "answer"` the same record answers
140
+ `rfi-not-answerable`, and if the member has since been given a size you get `rfi-member-resolved` before
141
+ either. None of those is a failure to file — the question is filed already. Read the list and tell the
142
+ user where it stands rather than reporting the refusal as-is.
143
+
144
+ Three refusals name the state rather than saying "cannot":
145
+
146
+ | code | means | do |
147
+ |---|---|---|
148
+ | `rfi-size-truth-unavailable` (409) | the model could not be read, so nothing can tell whether that member still needs a size | report the cause it quotes, and do not file blind |
149
+ | `rfi-member-resolved` (409) | that member already has a size FloLess can price | tell the user there is nothing to ask about it |
150
+ | `rfi-member-unknown` (404) | the model has no such member | you have the wrong id — go back and resolve it |
151
+
152
+ ### What CANNOT be filed this way
153
+
154
+ **This route files one kind of question — an unresolved size.** Every other kind (an elevation, a
155
+ connection that does not fit, an unclassified layer, a page nobody could review, a size that disagrees
156
+ with a schedule, and a dozen more) is filed **by the reader, during a drawing read or re-read**,
157
+ as `rfiSelection` on the submit. See `floless-app-steel-takeoff` → "Carrying one as an RFI".
158
+
159
+ So if the user wants one of those raised outside a read, **say so plainly, and do not promise a later
160
+ filing that will not happen**. These kinds ride an audited drawing-read submit; the standalone route
161
+ above still promotes only `unknown-size`. A re-read carries its selection through the staged human
162
+ review and files it only when that review is confirmed. If the model moves and the review is re-staged,
163
+ the prior selection is deliberately invalidated and must be submitted again for the new `stageId`,
164
+ including an explicit empty choice when nothing remains unanswered. Keep an out-of-read question in the
165
+ chat where the user can answer it, and say that it cannot be filed as a record yet. Do not improvise a
166
+ call for it.
167
+
168
+ ## Acting on a record
169
+
170
+ ```
171
+ POST /api/projects/<projectId>/rfis/<rfiId>/<action>
172
+ { "operationKey": "<unique for this intent>", "recordRevision": <from the row you just read>, … }
173
+ ```
174
+
175
+ | action | legal while | extra fields |
176
+ |---|---|---|
177
+ | `send` | `open` | `to` — required, ≤200 chars. The server records the manual transport as `email`; callers cannot choose it. **This is Mark sent: it records that somebody sent it outside FloLess. It does not deliver mail.** Never tell the user it went out on the strength of this route's 200 |
178
+ | `answer` | `open` or `sent` | `answer` — `{ "form": "profile", "profile": "…" }` for a size question, `{ "form": "prose", "text": "…" }` for every other kind |
179
+ | `apply` | `answered`, **size questions only** | none — the server mints the receipt itself |
180
+ | `close` | not already closed | `disposition`, and `note` for every disposition except `resolved` |
181
+ | `reopen` | `closed` | `why` |
182
+
183
+ ## Sending through the connected Gmail account
184
+
185
+ This is a different operation from `send` / **Mark sent** above. It submits the server-composed whole
186
+ RFI through the Google account connected to AWARE. Outlook, aliases/shared mailboxes, CC/Bcc,
187
+ attachments, HTML, replies, and editable subject/body are deliberate carve-outs.
188
+
189
+ Read readiness first:
190
+
191
+ ```
192
+ GET /api/projects/<projectId>/rfis/gmail-readiness
193
+ -> { ok, readiness: { status, message, generation? } }
194
+ ```
195
+
196
+ `ready` is the only sendable state. For `connect-google`, direct the user to connect Google Workspace
197
+ in Integrations (or use AWARE's Google Workspace connect flow when the user explicitly chooses CLI).
198
+ For `update-aware`, `update-agent`, `fix-google-access`, `busy`, or `unavailable`, quote `message` and
199
+ stop. The feature is pinned to the AWARE and Google Workspace agent versions it has actually verified;
200
+ never work around a version or provenance refusal.
201
+
202
+ Before the irreversible call, show the exact single recipient and ask the user to confirm this send.
203
+ The browser or terminal supplies only the recipient, the current record revision, and a one-time key.
204
+ The server owns the subject and complete body:
205
+
206
+ ```
207
+ POST /api/projects/<projectId>/rfis/<rfiId>/deliver
208
+ {
209
+ "operationKey": "<unique for this delivery intent>",
210
+ "recordRevision": <from the row you just read>,
211
+ "to": "engineer@example.com"
212
+ }
213
+ ```
214
+
215
+ Accept one plain ASCII mailbox only—no display name, recipient list, line break, CC, or Bcc. Never add
216
+ `subject`, `body`, `sender`, or provider credentials: unknown fields are refused, and OAuth tokens never
217
+ cross FloLess. Repeating the same immutable delivery intent uses the same operation key; a different
218
+ recipient or revision is a new intent and needs a new key.
219
+
220
+ Read `attempt.status` (or the RFI row's `delivery.status`) rather than inferring success from HTTP 200:
221
+
222
+ - `recorded` means **Accepted by Gmail for delivery**. It does not prove inbox delivery. Report the
223
+ receipt identifiers when present.
224
+ - `failed` means the provider handoff was proven not to have happened. Say nothing was sent; the user
225
+ may choose a new attempt after the row is re-read.
226
+ - `prepared` means FloLess durably reserved the exact attempt but did not finish recording its result.
227
+ Continue only that attempt:
228
+
229
+ ```
230
+ POST /api/projects/<projectId>/rfis/<rfiId>/delivery-attempts/<attemptId>/continue
231
+ { "operationKey": "<unique recovery key>" }
232
+ ```
233
+
234
+ - `outcome-unknown` means Gmail may have accepted it. **Never send it again.** Ask the user to search
235
+ the connected sender's Sent folder for the exact `reconciliationMarker`. Do not use Continue in
236
+ this state: Continue is only for a still-`prepared` attempt and never creates a second provider
237
+ attempt. If the user positively finds the exact message and marker, record that fact with:
238
+
239
+ ```
240
+ POST /api/projects/<projectId>/rfis/<rfiId>/delivery-attempts/<attemptId>/confirm-sent
241
+ { "operationKey": "<unique confirmation key>" }
242
+ ```
243
+
244
+ There is deliberately no “not found, resend” action. A search miss cannot prove Gmail did not accept
245
+ the message. While a delivery is `prepared` or `outcome-unknown`, ordinary RFI mutations—including
246
+ Mark sent—stay blocked so the record cannot tell two incompatible stories.
247
+
248
+ **Dispositions.**
249
+
250
+ - `resolved` — a size question whose answer has been applied. Needs no note.
251
+ - `answer-accepted` — a human read the answer and accepted it, **and it owes a note like the rest**. For
252
+ every kind **except** a size, and only from `answered`. This is what closes a prose question, and the
253
+ record then reads *answered, not applied by FloLess* rather than implying the model moved.
254
+ - `withdrawn`, `superseded`, `wont-fix` — a human decision, so each owes a note (≤1000 chars).
255
+
256
+ Only `resolved` is exempt from the note, because its meaning is carried by the receipt rather than by a
257
+ sentence somebody wrote.
258
+
259
+ ### `apply` records that the answer is in the steel — it does not put it there
260
+
261
+ This is the step that is easy to get wrong, in two directions.
262
+
263
+ `apply` refuses while the member has **no size FloLess can price**, and says so:
264
+
265
+ > set `<member>` to `<section>` in the model first — FloLess records the answer, it does not write it
266
+ > for you
267
+
268
+ It also refuses while the member carries a **different** priceable section from the answer. Catalogue
269
+ values are compared by the primary catalogue row they resolve to, so decimal/fraction, metric/imperial,
270
+ and harmless spelling aliases for the same section still match. Project-weighted custom profiles fall
271
+ back to the weight map's canonical literal identity: case and separator style fold, but meaningful
272
+ internal whitespace does not. A mismatch answers `rfi-member-profile-mismatch`, names both sections,
273
+ and tells the user to set the member to the answered section or close and reopen the RFI to record a
274
+ different answer. Do not apply over that refusal.
275
+
276
+ An answered trailing **`FLAT` is part of the claim**: it means that section rolled 90° about the member
277
+ axis. The accepted contract stores that as the ordinary catalogue profile plus `rot: 90`, so `apply`
278
+ checks both. The same profile at 0° is still a mismatch, and a resolved receipt reopens if that roll later
279
+ drifts. Flat-stock product names (`PL`, `PLATE`, `BAR`, `FB`, or `FLAT`) are not roll instructions.
280
+
281
+ Two paths put the answered size into the steel, and both belong to the user:
282
+
283
+ 1. **The size box on that RFI row in the Steel editor** — the designed path. It exists only when the
284
+ editor can place the member; where it cannot, the row says so instead and there is no box.
285
+ 2. **The editor's Ask AI box**, which queues a contract-edit request you then handle with
286
+ `floless-app-tweak-contract`.
287
+
288
+ If neither has happened, **stop before `apply`** and tell the user which member needs which section.
289
+ Do not edit the model from this skill — writing the contract is `floless-app-tweak-contract`'s job, and
290
+ it carries the trap that makes that job worth delegating: a weight written in POUNDS PER FOOT into a map
291
+ that is read as kilograms per metre prices the model about a third light, with nothing to flag it.
292
+
293
+ ## Retries, revisions and refusals
294
+
295
+ - **`operationKey`** goes on every write. One key per intent. Retry the *same* intent with the *same*
296
+ key — the server performs no second mutation and answers `replayed: true` with the record's **current**
297
+ view, which may have moved on since. A **different** payload under a key already used is
298
+ `rfi-operation-key-conflict` (409); mint a new key for a new intent.
299
+ **Two reasons a retry may not replay.** Promotion checks the model *before* it looks the key up, so
300
+ replaying a promotion whose member has since been given a size answers `409 rfi-member-resolved` rather
301
+ than `replayed: true` — and that refusal does **not** tell you whether the first call landed, because it
302
+ is decided before the ledger is ever consulted. And the ledger is a bounded retry **cache**, not a
303
+ history: it keeps the most recent 1,000 keys per project and trims the oldest, so a retry of a
304
+ long-superseded operation is treated as a fresh one and can act a second time. Retry promptly, and on
305
+ any refusal — or any retry of something old — re-fetch the list and read what the record actually says
306
+ instead of assuming the write was lost.
307
+ - **`recordRevision`** comes from the row you just read, never from memory.
308
+
309
+ ### What is legal, by `kind` and `status`
310
+
311
+ Three review rounds went wrong writing one recovery per error code. **The recovery is not a property of
312
+ the code — it is a property of the record**, and it takes `kind` and `status` together. So read those two
313
+ fields off the row and look the move up here. Every status-shaped refusal below is this table being
314
+ consulted after the fact instead of before it.
315
+
316
+ **A size question (`kind: "unknown-size"`)** — the only kind FloLess can apply:
317
+
318
+ | status | what it can do |
319
+ |---|---|
320
+ | `open` | `send`; `answer` with a section designation; `close` as `withdrawn` / `superseded` / `wont-fix`, with a note |
321
+ | `sent` | `answer` with a section designation; those same three closes |
322
+ | `answered`, not yet applied | put the answered section in the model, then `apply`; or those same three closes. **Not** `answer-accepted` — a size closes by applying |
323
+ | `answered`, already applied | `close` as `resolved`, with no note, provided the member still carries the answered section; or those same three closes |
324
+ | `closed` | `reopen`, with a reason |
325
+
326
+ **Every other kind** — a prose question, which FloLess never applies:
327
+
328
+ | status | what it can do |
329
+ |---|---|
330
+ | `open` | `send`; `answer` with prose; `close` as `withdrawn` / `superseded` / `wont-fix`, with a note |
331
+ | `sent` | `answer` with prose; those same three closes |
332
+ | `answered` | `close` as `answer-accepted`, with a note; or those same three closes. **Never** `apply`, and never `resolved` |
333
+ | `closed` | `reopen`, with a reason |
334
+
335
+ Two moves have a prerequisite outside the record, and both are checked against the live model: `apply`
336
+ needs the member to price, to carry the answered section, and the record to name exactly one member;
337
+ `close` as `resolved` needs an applied answer whose member still carries that same answered section.
338
+ The RFI view carries the server's current three-state truth for both the profile answer and its later
339
+ receipt, so a stale browser cannot offer `apply` or `resolved` merely because its own copy still looks
340
+ right. While the model is unreadable neither is available.
341
+
342
+ **Replacing an answer that is already applied takes four steps.** The server refusal names the legal
343
+ first move — close this RFI and reopen it to record a different answer — rather than recommending a
344
+ reopen while the record is still `answered`. The complete sequence is: `close` with a disposition the
345
+ user chooses and a note → `reopen` with a reason → `answer` again → put the new section in the model →
346
+ `apply`.
347
+
348
+ ### The refusals, and what each one tells you
349
+
350
+ This table says **what happened**. For what to do next, go back to the record's row and read the table
351
+ above — that is the whole point of the split.
352
+
353
+ | code | status | what happened |
354
+ |---|---|---|
355
+ | `rfi-revision-stale` | 409 | somebody changed the record while you were looking at it. This refusal does **not** carry the record — re-fetch the list |
356
+ | `rfi-reconciled` | 409 | a record closed as `resolved` has a member that is **unresolved again or carries a different section from the answer** — its size cleared, its weights edited, the environment switched, the member removed, or its profile changed — so FloLess reopened it. The message names which truth changed. This refusal **does** carry `rfi` and `fileRevision` |
357
+ | `rfi-not-open` / `rfi-not-answerable` / `rfi-not-closed` / `rfi-already-closed` | 400 | the verb does not fit this record's status. The message names the status it found |
358
+ | `rfi-not-answered` | 400 | either a `close` as `answer-accepted` on a record nobody has answered, or an `apply` on a record that is not `answered` **but still holds a profile answer** — a `closed` size record whose member prices gets its receipt minted, then fails on the status |
359
+ | `rfi-profile-required` | 400 | a size question was answered with a sentence. A size answer is a section designation |
360
+ | `rfi-answer-not-a-profile` | 400 | `apply` found no section designation to apply — the record is a prose kind, or it is `unknown-size` with no profile answer yet. The receipt is minted before the verb is checked, so this fires ahead of `rfi-not-applicable`; it is preceded in turn by the member-count check, so a record naming other than exactly one member answers `rfi-subject-ambiguous` first |
361
+ | `rfi-not-applicable` | 400 | `apply` on a kind FloLess cannot apply |
362
+ | `rfi-subject-ambiguous` | 400 | `apply` on a record that names other than **exactly one** member — none, or several |
363
+ | `rfi-already-applied` | 400 | from **`apply`**: this answer is already applied. The refusal names the legal close-and-reopen route; follow the complete four-step sequence above |
364
+ | `rfi-member-not-resolved` | 400 | `apply` while the member has no size FloLess can price |
365
+ | `rfi-member-profile-mismatch` | 400 | `apply` while the member carries a different priceable section from the answered section. The message names both and the legal repair |
366
+ | `rfi-not-applied` / `rfi-subject-unresolved` / `rfi-subject-profile-mismatch` / `rfi-not-resolvable` / `rfi-size-must-apply` | 400 | a `close` whose disposition does not fit this record; the profile-mismatch form names the live and answered sections |
367
+ | `rfi-note-required` / `rfi-why-required` / `rfi-recipient-required` / `rfi-channel-required` / `rfi-disposition-required` / `rfi-answer-required` | 400 | a required field is missing **or invalid** — the same code covers both. A note or reason must be non-blank, ≤1000 characters and free of control characters; `to` is the same at ≤200. The route supplies the fixed manual channel (`email`); `rfi-channel-required` protects older/corrupt stored transitions rather than inviting a caller-provided channel. An answer must be the right FORM for the kind (a `{form:"profile"}` answer to a prose question is `rfi-answer-required`, not a form error). Fix the value, or ask the user — do not just re-send it |
368
+ | `rfi-revision-required` / `rfi-operation-key-required` / `rfi-body-unknown-field` | 400 | the envelope is wrong. An unknown field is refused outright, never ignored |
369
+ | `rfi-not-found` | 404 | no record with that id in this project — re-fetch the list, do not retry the id |
370
+ | `rfi-would-corrupt` | 500 | the server refused to write a file its own parser would reject. A server-side fault, not yours — report it and stop |
371
+ | `rfi-store-unavailable` | 503 | the record file could not be read **or written**. Sometimes transient (another program holding it), sometimes not (the file is over its size ceiling, or a permission failure that will repeat). **The quoted cause is what tells you which** — read it before deciding to retry |
372
+ | `rfi-store-invalid` / `rfi-store-poisoned` | 409 | the record file needs repair. Do not retry; say the store needs attention |
373
+ | `rfi-history-full` | 409 | the record holds 500 events, the cap for ordinary actions | it can still be **closed or reopened** — wind it up rather than acting on it further |
374
+ | `rfi-history-exhausted` | 409 | the record holds 600 events, the cap for everything | nothing more can be done to it; say it needs attention |
375
+ | `rfi-store-full` / `rfi-would-exceed-size` | 409 | the project's record file is at capacity | closing records does not free this — say the store needs attention |
376
+
377
+ **Any other `rfi-*` code**: quote the server's sentence verbatim, re-fetch the list, and read what the
378
+ record actually says — never retry blind, and never invent a reason of your own.
379
+
380
+ Never paper over a refusal. Quote the sentence the server gave — it is written for the user, and it
381
+ names the way forward.
382
+
383
+ ## Say it back
384
+
385
+ An RFI filed in silence is the silence this design exists to delete. After every write, tell the user
386
+ what now stands, in their language and not the wire's:
387
+
388
+ > Filed as **RFI-004** — what size is the beam at grid C/3. Recorded as sent to the engineer by email
389
+ > today.
390
+
391
+ Name the id, the question and the thing it is about the way a detailer would. **Say what FloLess
392
+ recorded, never what it did on the user's behalf** — it did not send the email and it did not put the
393
+ size in the steel, and a sentence that implies either is the kind of quiet false claim this whole design
394
+ exists to delete. When you list what is outstanding, group by status and lead with what is blocking
395
+ steel.
396
+
397
+ ## Guardrails
398
+
399
+ - **Ask before you file.** An RFI is for what the user could not answer, not for what you did not ask.
400
+ - **Never invent a question, a location or an answer.** The server composes the first two; the third
401
+ comes from a person.
402
+ - **Never write the model from here.** `apply` records; it does not edit. Let its live-model check prove
403
+ that the steel carries the answered section before recording the application.
404
+ - **Distinguish delivery from bookkeeping.** Only a connected-Gmail attempt ending `recorded` proves
405
+ Gmail accepted the message for delivery. Mark sent merely records an external send. Neither proves
406
+ inbox delivery, and FloLess still does not set sizes.
407
+ - **One key per intent**, and never reuse a key for different content.
408
+ - **Never fabricate a recipient or a channel** to get past `send` — ask who it goes to.
409
+ - **Do not treat a question as a reason to withhold the model.** State what was assumed in the meantime,
410
+ and file the question beside it.
@@ -2,7 +2,7 @@
2
2
  name: floless-app-routines
3
3
  description: This skill should be used when the user wants to set up a floless.app workflow (.flo app) to run automatically — "routines" — either on a timer (schedule) or on a live event (trigger). Triggers on requests like "schedule tekla-bom-by-phase every weekday at 7am", "run this workflow every 2 hours", "run my BOM whenever the Tekla model changes", "watch the model and run X on each change", "set up a trigger routine", "list my routines", "disable the morning routine", "delete that routine". Covers the floless.app routines REST API (create / list / edit / enable-disable / delete / run-now), the schedule presets, the event-trigger kind, the confirm-first rule, and the runnable gate.
4
4
  metadata:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  ---
7
7
 
8
8
  # Setting up floless.app routines (automatic .flo runs)
@@ -137,7 +137,8 @@ curl -s -X PATCH http://127.0.0.1:4317/api/routines/<id> -H 'content-type: appli
137
137
  # Change a schedule's timing — PATCH only the fields that change (schedule kind only)
138
138
  curl -s -X PATCH http://127.0.0.1:4317/api/routines/<id> -H 'content-type: application/json' -d '{"schedule":{"kind":"daily","time":"06:30"}}'
139
139
 
140
- # Run now — SCHEDULE kind only (a trigger 400s: its control is enable/disable)
140
+ # Run now — SCHEDULE kind only (a trigger 400s: its control is enable/disable).
141
+ # 409 `{"running":true}` while that routine is already queued or mid-run: nothing was started.
141
142
  curl -s -X POST http://127.0.0.1:4317/api/routines/<id>/run
142
143
 
143
144
  # Delete (a trigger's live watcher is stopped first)
@@ -155,6 +156,10 @@ curl -s -X DELETE http://127.0.0.1:4317/api/routines/<id>
155
156
  - **Run-now is schedule-only.** `POST /api/routines/:id/run` on a trigger returns **400**
156
157
  ("a trigger routine runs on its event — enable/disable it instead"). Don't offer run-now for a
157
158
  trigger; the control is the enable/disable toggle (start/stop the live watcher).
159
+ - **Run-now while that routine is already queued or running is a 409, not a second run.** The
160
+ response carries `running: true` — nothing was started. Tell the user it is already running (or
161
+ waiting its turn behind another routine); never report "started". A scheduled fire that lands in
162
+ the same window is dropped the same way — the server logs it, and the next fire is recomputed.
158
163
  - **The server runs it, not Claude.** Once created, floless.app runs the routine locally — the
159
164
  scheduler fires a schedule on its timer; a trigger's long-lived watcher runs as long as it's
160
165
  enabled and the desktop app is up. A host-unavailable schedule fire records an honest `failed`
@@ -92,7 +92,7 @@ bounded by the ~1-minute scheduler tick. Supports `* , - /` and lists.
92
92
  | POST | `/api/routines` | schedule: `{ name, workflow, schedule, inputs?, enabled? }` · trigger: `{ kind:"trigger", name, workflow, inputs?, enabled? }` | `201 { ok, routine }` · `400` invalid/ineligible · `409` at cap |
93
93
  | PATCH | `/api/routines/:id` | any of `{ name, schedule, inputs, enabled }` (a trigger ignores `schedule`; `enabled` start/stops its watcher) | `{ ok, routine }` · `404` · `400` |
94
94
  | DELETE | `/api/routines/:id` | — | `{ ok }` · `404` (stops the watcher first for a trigger) |
95
- | POST | `/api/routines/:id/run` | — | `{ ok }` (schedule: enqueues a real run now) · `400` for a **trigger** · `404` |
95
+ | POST | `/api/routines/:id/run` | — | `{ ok }` (schedule: enqueues a real run now) · `400` for a **trigger** · `404` · `409 { running: true }` if that routine is already queued or mid-run |
96
96
 
97
97
  Supporting reads (same server):
98
98
  - `GET /api/health` → `{ ok, license, ... }` — preflight.
@@ -109,16 +109,25 @@ Supporting reads (same server):
109
109
  or `POST /:id/run` on a **trigger** (`{ "error": "a trigger routine runs on its event — enable/disable it instead" }`).
110
110
  - `402` — no valid subscription (the app must be signed in).
111
111
  - `404` — no routine with that id.
112
- - `409` — `{ "error": "Routine limit reached (15). Delete one first." }` — the cap (both kinds share
113
- it). Relay it and offer to delete an existing routine.
112
+ - `409` — **two different refusals; tell them apart by the `running` flag, never by the status alone.**
113
+ - On `POST /api/routines` (create): `{ "error": "Routine limit reached (15). Delete one first." }` —
114
+ the cap (both kinds share it). Relay it and offer to delete an existing routine.
115
+ - On `POST /:id/run`: `{ "running": true, "error": "this routine is already running or waiting its
116
+ turn" }` — that routine is already queued or mid-run and **nothing was started**. Say it is
117
+ already running or waiting; do NOT relay a cap message and do NOT offer to delete anything.
118
+ Retrying is pointless until that fire completes.
114
119
 
115
120
  ## Notes on behavior (so expectations are right)
116
121
 
117
122
  - **Local time, DST-safe.** Schedules are wall-clock local; 07:00 stays 07:00 across a DST change.
118
123
  - **Missed fires skip forward.** If the server was down at fire time, the next fire is the next
119
124
  future occurrence (no catch-up burst on boot).
120
- - **Serialized.** Scheduled runs share the single active-run lock with manual ▶ Run; a fire that
121
- coincides with another run waits its turn (the host bridge does one exec at a time).
125
+ - **Serialized, and one run per routine.** Scheduled runs share the single active-run lock with
126
+ manual ▶ Run, so a fire that coincides with a run of a DIFFERENT workflow waits its turn (the host
127
+ bridge does one exec at a time). A fire for a routine that is already queued or mid-run is
128
+ **dropped**, not queued behind itself: a routine whose run outlasts its interval would otherwise
129
+ run back-to-back forever. On the scheduled path the drop is silent to the user (the server logs it
130
+ and `nextFireAt` moves on); on `POST /:id/run` it is the `409 { running: true }` above.
122
131
  - **Inputs.** Only the app's declared inputs are kept, coerced to their declared type; omit an
123
132
  input to use the app's default. Keys are validated `[A-Za-z0-9._-]`.
124
133
  - **Triggers (event-driven).** A `kind:"trigger"` routine hosts a long-lived `aware app run` of a
@@ -2,7 +2,7 @@
2
2
  name: floless-app-steel-model
3
3
  description: The front-door guide for turning a structural steel drawing set into an editable native steel.model/v2 model in floless.app. It orchestrates project setup, set knowledge, AWARE detailer agents, Drawing Filter review, registered plan views, model reading, connection detailing, clash checks, and exports. Use for asks such as "model this steel job from the drawings", "take off this whole set", "start a steel model project", or "/floless-app-steel-model". It is re-runnable and preserves the Filter → Save → read → review → History process end to end.
4
4
  metadata:
5
- version: 0.11.0
5
+ version: 0.12.1
6
6
  ---
7
7
 
8
8
  # Steel Model — guide a steel drawing set into an editable model
@@ -28,7 +28,7 @@ re-invoke ("we already set up the folder, provision the agents").
28
28
 
29
29
  > Companion skills (all ship with floless.app — invoke them, don't duplicate them):
30
30
  > - **`reading-structural-drawings`** — the reading *discipline* (massing + coordinate frame FIRST,
31
- > members LAST, cross-validate every view). Follow it whenever skimming or classifying the set
31
+ > members LAST, cross-validate every view). Follow it whenever reading or classifying the set
32
32
  > (stages 2 and 5) — it stops the classic failures (two buildings read as one, a sloped roof read
33
33
  > as flat, grids conflated across sheets).
34
34
  > - **`floless-app-steel-takeoff`** — reads one framing plan into the contract (the heavy vision
@@ -120,37 +120,37 @@ wait for the user's OK before the next stage.
120
120
 
121
121
  A steel job has many files and derived artifacts — keep them together. Ask the user to pick or
122
122
  create a **dedicated project folder** (e.g. `~/projects/<job-name>/`). Everything lives there: the
123
- drawing PDF(s), the knowledge files (stage 2), and any exported contracts / IFC / BOM. If they
123
+ drawing PDF(s), `company-rules.md` (stage 2), and any exported contracts / IFC / BOM. If they
124
124
  already have one, use it. Record the absolute path for the rest of the run.
125
125
 
126
126
  **Gate:** confirm the folder path and that the drawing set (PDF) is in it (or get its path).
127
127
 
128
- ### 2. Learn the set → plain-English knowledge files
129
-
130
- Before reading geometry, skim the set and capture what matters into a few short Markdown files in
131
- the project folder (a few files, **not** a framework):
132
-
133
- - **`set-index.md`** — one line per sheet: number, title, and what it is (framing plan / elevation /
134
- section / detail / schedule). This is the map the later stages classify against.
135
- - **`general-notes.md`** — the General Notes that bind the whole job: design spec, default
136
- connection type, bolt/weld standard, material grades, anything that overrides a single sheet.
137
- - **`company-rules.md`** *(ask first)* — **ask whether the firm has company-specific standards.** Two
138
- kinds, both captured here: (1) **connection-library mappings** (e.g. "moment → detail 50S504 → Tekla
139
- component 146") that feed the connection-library pre-fill in stage 6 (the editor's Connections panel
140
- reads these as `source:"company-rules"`); and (2) **firm DETAILING standards** — default bolt grade +
141
- length-from-grip, usual gages, near/far-side, shear-tab shape/edge/clearance — that the Steel Takeoff
142
- reader applies to a connection's `joints[].params` when detailing (see `floless-app-steel-takeoff`
143
- §5.5b). The file is machine-local / the firm's private IP (it may live in the user's own synced Drive)
144
- — **never committed.** If the firm has none, skip it — don't invent rules.
145
-
146
- Read the set with the terminal AI's own vision, following the **`reading-structural-drawings`**
147
- discipline while skimming (massing + coordinate frame first — it's what makes the sheet
148
- classification reliable). If the set has **no abbreviations/legend sheet** (a partial set is common),
149
- fall back to **`steel-drawing-abbreviations`** — the standard US/AISC abbreviations + shape legend —
150
- for note/profile codes (TYP, TOS, UON, `(E)`/`(N)`, HSS, WT). The project's own legend always overrides.
151
-
152
- **Gate:** show `set-index.md` (the sheet map) and confirm the classification looks right — the user
153
- knows their set better than any read.
128
+ ### 2. Read the whole set → the design-set knowledge record
129
+
130
+ Before any geometry, **read** the set — not skim it — in the `reading-structural-drawings` order:
131
+ Pass 0 inventory first (index, legend, notes), then elevations and sections before any plan.
132
+
133
+ What you learn is the **design-set knowledge** record (`set-knowledge/v1`), not loose notes: every
134
+ sheet with its role, the abbreviations, the level datums as drawn, the notes that bind the whole job,
135
+ the schedules and what keys them, cross-references, and the questions the set does not answer. Every
136
+ claim quotes the drawing and the server re-checks the quote; an open question, or a page with nothing
137
+ on it, records what was checked instead. The record is written against the request's steel manifest,
138
+ and a re-scan replaces that manifest and drops the record with it — so the reader submits it in
139
+ stage 6 after **Filter → Save** (which pins the manifest) and **before its first member**
140
+ (`floless-app-steel-takeoff` → "Build the design-set knowledge first"); the audit and the final
141
+ commit both refuse a read without it. The reading happens HERE; the reader only records it.
142
+
143
+ No legend sheet? `steel-drawing-abbreviations` is the fallback; the set's own legend always overrides.
144
+
145
+ **`company-rules.md`** — **ask whether the firm has company-specific standards.** It is the firm's
146
+ private IP, not the set's content: it stays in the project folder and is **never committed**.
147
+ Two kinds: (1) connection mappings ("moment → detail 50S504 → Tekla component 146") that pre-fill
148
+ the editor's Connections panel as `source:"company-rules"`; (2) firm DETAILING defaults — bolt grade
149
+ + length-from-grip, gages, near/far-side, shear-tab shape/edge/clearance — for the user to apply
150
+ when detailing (no reader step does yet). If the firm has none, skip it — don't invent rules.
151
+
152
+ **Gate:** show the sheet list with each sheet's role, the level datums as drawn, and the open
153
+ questions; confirm the classification looks right — the user knows their set better than any read.
154
154
 
155
155
  ### 3. Provision the AWARE agents
156
156
 
@@ -271,9 +271,11 @@ decision protocol. Never auto-approve work produced by this reading pipeline.
271
271
  **Done** when each framing plan has an approved, editor-reviewed contract and the user knows which
272
272
  on-canvas tool does what. The 3D/IFC/Tekla exports are on-demand from the editor; the **BOM is
273
273
  exported two ways** — on-demand via the editor's *Export BOM (CSV)/(Excel)* buttons, **and written
274
- to `~/.floless/exports/steel-model/steel-model-bom.{csv,xlsx}` automatically every time the workflow
275
- is Run** (two `file/write` export steps at the end of the chain). Tell the user they can **freeze**
276
- those export steps (right-click → Freeze) once the BOM is right, so a re-Run won't overwrite the files.
274
+ to `~/.floless/exports/steel-model/steel-model-bom-<units>.{csv,xlsx}` automatically every time the
275
+ workflow is Run** (two `file/write` export steps at the end of the chain), where `<units>` is `ft-in`
276
+ or `mm` — a job shown in millimetres bills in kilograms and tonnes, and the two are different files so
277
+ one can never sit where the other is expected. Tell the user they can **freeze** those export steps
278
+ (right-click → Freeze) once the BOM is right, so a re-Run won't overwrite the files.
277
279
 
278
280
  ### 7. Match each detail to a connection TYPE that models it — or refuse
279
281