@floless/app 0.127.5 → 0.128.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.
@@ -1,182 +1,72 @@
1
1
  ---
2
2
  name: floless-app-tweak-contract
3
- description: This skill should be used when there is a pending floless `tweak-contract` request — the user typed an instruction in the Steel Model contract editor and clicked Send (Ask AI). Also triggers on asks like "edit the steel takeoff contract via AI", "adjust the steel takeoff in the contract editor", "the user asked me to change the steel contract", "pick up my tweak-contract request", "update the member profile in the contract". It teaches the host AI to read the request, fetch the current steel.takeoff/v1 contract, apply the instruction (and any pasted screenshots), PUT the updated contract back, and resolve the request.
3
+ description: Handle a pending floless tweak-contract request from the Steel Model editor. Use when a user asks the terminal AI to change a member, grid, plan view, connection, or other field in the current steel.model/v2 project contract. Fetch the request-scoped native model, apply only the requested edit, write it back with optimistic concurrency, and resolve the request without approving it.
4
4
  metadata:
5
- version: 0.5.0
5
+ version: 0.6.0
6
6
  ---
7
7
 
8
- # Handle a `tweak-contract` request (Slice 2 AI round-trip)
9
-
10
- ## What this is
11
-
12
- The floless.app Steel Model contract editor surfaces an **Ask AI** panel: the user types
13
- an instruction ("change all W12X26 to W14X30", "add a new beam on sheet S-202", "mark this
14
- member as moment-frame") and optionally pastes screenshots, then clicks **Send**. That records
15
- a `tweak-contract` request in the reverse channel. You pick it up here, edit the contract
16
- document, write it back, and the editor reloads it.
17
-
18
- The contract is the single source of truth — the editor is its view, and the exporters
19
- (IFC/Tekla/viewer-3d) consume server-resolved export sources. A PUT writeback is schema-validated on
20
- the server; a 400 means invalid — fix and retry.
21
-
22
- **Two things about WHICH document you are editing. Get both wrong and you edit the wrong file.**
23
-
24
- 1. **The shape is not always `steel.takeoff/v1`.** A migrated project holds **`steel.model/v2`**, whose
25
- members live in ONE root `members[]` array in world millimetres — it has no `plans[i].members[j]`,
26
- so the v1 field map in §4 does not apply to it. **Read the document's own `type` field in step 2
27
- and write back that SAME shape.** Never convert one into the other: this verb patches the document
28
- it just read, and a shape change is refused. For v2 the field reference is
29
- `schemas/steel.model.v2.schema.json`; for v1 it is `schemas/steel.takeoff.v1.schema.json`.
30
- 2. **The store is project-keyed when the request carries a `project`.** A workspace project's document
31
- lives at `~/.floless/projects/<project>/contract.json` and is reached with
32
- `?project=<project>` on both the GET and the PUT. Only a request with **no** `project` targets the
33
- legacy app-keyed `~/.floless/contracts/<appId>.json`. Omit the query on a project request and you
34
- read (and may CREATE) an app-scoped contract while the user's project document is never touched —
35
- they will see no change and have no idea why.
36
-
37
- > **Pasted a request?** If the user pastes a message with a `[floless-request type=tweak-contract id=…]`
38
- > marker, that is a request **copied from the FloLess Dashboard**. Resolve it via
39
- > `GET /api/requests` (match the id) — don't act on the raw marker — then follow the loop
40
- > below and `DELETE` it when done.
41
-
42
- ## The loop
43
-
44
- 1. **Find the request.** `GET http://localhost:<port>/api/requests` → find the entry with
45
- `type: "tweak-contract"`. It carries:
46
- - `id` — the request id (used to DELETE it when done)
47
- - `appId` — which app's contract to edit
48
- - `project` — **present on a workspace request**; when it is there, every GET and PUT below takes
49
- `?project=<project>`. Absent means the legacy app-keyed store. Never guess it.
50
- - `instruction` — the user's plain-English ask
51
- - `snapshots` — absolute paths to screenshot files saved under
52
- `~/.floless/requests/<id>/` (PNG/JPEG/WebP). These are the key input — the user
53
- pasted them to show you exactly which region or member they mean.
54
- - `intent` + `target` — present only on an **insert-a-detail** request from the editor's detailing
55
- flow. `intent` is `"create"` (place a new detail) or `"modify"` (change one already placed), and
56
- `target` is `{ sheet, ids }` naming the sheet and the host member / placed-detail ids to act
57
- against. They exist so you do not have to infer create-vs-edit from the prose — honour them.
58
-
59
- The port is the same base URL the floless.app server is on (check `/api/health` or use
60
- the port the skill context provides — typically 4317 for the installed app, 4318 for the
61
- dev server).
62
-
63
- 2. **Read the current contract.** `GET http://localhost:<port>/api/contract/<appId>` — **plus
64
- `?project=<project>` when the request carries one** — returns the full JSON document. **Read its
65
- `type` field**: `steel.takeoff/v1` or `steel.model/v2` decides which field map in step 4 applies,
66
- and step 5 writes back that same shape. **Keep the `ETag` response header** — step 5 sends it
67
- back so your write cannot silently overwrite someone else's.
68
- You can also read the file off disk (`~/.floless/projects/<project>/contract.json`, or
69
- `~/.floless/contracts/<appId>.json` when there is no project), but then you have no
70
- ETag and **the write in step 5 will be REFUSED (`428`)** — the server requires a precondition.
71
- Use the HTTP read whenever you intend to write.
72
-
73
- **If `type` is `steel.model/v2`**, the shapes below do NOT apply. Read
74
- `schemas/steel.model.v2.schema.json` instead: members are one root `members[]` array in world
75
- millimetres and ids are model-global rather than sheet-scoped. `from`/`to` are `{x, y, z}` — but
76
- **`z` is a tagged union, not a bare number**: a known elevation is `z: { known: 3000 }` and one the
77
- drawing never gave is `z: { unknown: true }`. The schema sets `additionalProperties: false`, so a
78
- bare `z: 3000` is refused with a 400. Never substitute a default for an unknown elevation — a
79
- fabricated elevation moves steel. Everything else in this loop (ETag, preconditions, preserve what
80
- you are not changing, never auto-approve) is identical.
81
-
82
- **If `type` is `steel.takeoff/v1`**, the schema is at `schemas/steel.takeoff.v1.schema.json` and the
83
- field reference is `docs/superpowers/specs/2026-06-17-steel-takeoff-agent-guidance.md` §3.
84
- Key shapes you'll edit:
85
- - Top-level: `type` (const `"steel.takeoff/v1"`), `active`, `palette`, `weights{profile→plf}`,
86
- `profile_colors{profile→#hex}`, `plans[]`
87
- - `plans[i]`: `sheet`, `title`, `clip`, `pt_per_ft`, `default_tos`, `segments[]`,
88
- `labels[]`, `details[]`, `tos_callouts[]`, `members[]`
89
- - `members[j]`: `id` (required), `profile` (AISC designation e.g. `W16X26` or mark e.g. `MF`),
90
- `wp` ([[x,y],[x,y]] work-point endpoints in display space), `angle` (`H`|`V`|`D`),
91
- `role` (`beam`|`column`), `rfi` (true = no resolved AISC size), `mf` (moment-frame flag),
92
- `ends[2]` (per-end: `tos` in inches, `note`, `tosDef`, `detail`),
93
- `col` (column variant: `bos`, `tos`, `note`, `detail`)
94
-
95
- 3. **Understand the ask.** Read the `instruction` text AND open the `snapshots[]` image files
96
- with your vision — the screenshots are the primary input. They show the user pointing at a
97
- specific member, region, or annotation on the canvas. What the text alone says ("change this
98
- beam") only resolves with the visual context ("this beam" = the one circled in red on the
99
- screenshot).
100
-
101
- **When the request carries a `project`, consult that project's knowledge base too — before you
102
- decide anything.** `floless-app-knowledge` § "Consulting the KB from other work (the Feed)" →
103
- "Required first step" owns that rule; follow it there rather than a summary here. The short of it:
104
- `GET /api/workspace-projects/<project>/knowledge?q=<subject>&app=<appId>` — `<subject>` being what
105
- you are about to change, url-encoded so it stays one URL token — returns ranked summaries of the
106
- firm's own standards, shop preferences, RFIs and spec notes, and
107
- `GET /api/projects/<project>/knowledge/page/<slug>` reads a decisive one in full.
108
-
109
- This is what makes the edit derive from the **user's** knowledge instead of your priors. A shop
110
- standard that fixes a bolt spacing, an RFI that governs a connection, a fabricator's stated
111
- preference — these beat any default you would otherwise reach for. **Cite the `slug` you relied
112
- on** in your step-6 summary so the user can trace the decision. If nothing relevant matches, say
113
- so plainly rather than inventing a standard; an empty result is a normal outcome, not a failure.
114
-
115
- 4. **Produce the edit.** Modify the contract JSON to satisfy the instruction. The bullets below are
116
- the **`steel.takeoff/v1`** field map; for `steel.model/v2` work from its own schema per step 2:
117
- - Profile changes: update `members[j].profile`; if the new profile resolves in the AISC
118
- table update `weights` too (plf from the AISC designation). Set `rfi: false` when you
119
- assign a real AISC size; `rfi: true` for marks (`MF`, `BF`) or unknowns.
120
- - Add a member: append to `plans[i].members[]` with a valid `{id, profile, wp}` minimum.
121
- Use a unique `id` (e.g. `m-<uuid-fragment>`). Infer geometry from context/screenshot.
122
- - Delete a member: remove it from `members[]`.
123
- - Elevation changes: update `ends[].tos` (decimal inches) or `col.tos`/`col.bos`.
124
- `tosDef: false` means the value came from the drawing, not the plan default.
125
- - Connection notes / detail refs: update `ends[].note` or `ends[].detail` (e.g. `"5-S504"`).
126
- - Flag adjustments: `mf: true` for moment-frame members; `rfi: true` for unresolved sizes.
127
- - **Preserve everything you're not changing** — both shapes are a full-document writeback; partial
128
- objects are not supported.
129
-
130
- 5. **Write it back.** `PUT http://localhost:<port>/api/contract/<appId>` — **with the same
131
- `?project=<project>` you read with** — carrying the full updated document
132
- (Content-Type: application/json) **and a precondition header**:
133
- - **`If-Match: <the ETag from step 2>`** — the usual case, replacing a contract you read.
134
- - **`If-None-Match: *`** — ONLY when the GET returned **no** ETag at all. That happens on an app
135
- whose contract is still the baked example with no saved draft yet; it means "I believe this
136
- store is empty" and is refused if a draft appeared meanwhile.
137
-
138
- A PUT carrying neither is refused with **`428`** — the server never accepts a blind write.
139
- - **400** — schema-invalid, or a refused shape transition. Read the error and fix the structure
140
- against the schema for the `type` you read in step 2 (`schemas/steel.takeoff.v1.schema.json` or
141
- `schemas/steel.model.v2.schema.json`), then retry. A `contract-transition-refused` means you
142
- changed the document's shape — write back the shape you read.
143
- - **412** — someone else (the user in the editor, another tool, a workflow run) wrote to this
144
- contract after you read it. **Do NOT retry the same body**: that would destroy their change.
145
- Re-read from step 2, re-apply your edit to the NEW document, and write again.
146
- - **428** — you sent no precondition (or an `If-None-Match` other than `*`, which this server does
147
- not evaluate). Add `If-Match` — or `If-None-Match: *` if the GET gave you no ETag — and retry.
148
- Sending a precondition is not optional politeness — without it a slow edit would silently overwrite
149
- whatever landed while you were working, which is why the server now refuses it outright. On success the server broadcasts a `contract-changed`
150
- event; the editor picks it up and prompts to reload.
151
-
152
- 6. **Tell the user.** Summarize what you changed (e.g. "Updated W12X26 → W14X30 on 4 beams
153
- in sheet S-202; updated `weights` entry to 30 plf"). **If a knowledge-base page steered the
154
- change, name it** — "per `shop-standard-bolts`" — so the decision is traceable back to the firm's
155
- own document rather than looking like your preference. Tell them to click **↻ Reload** in the
156
- editor (or accept the reload banner) to see the change. Then resolve the request:
157
-
158
- `DELETE http://localhost:<port>/api/requests/<id>`
159
-
160
- so it doesn't reappear in the queue.
8
+ # Handle a `tweak-contract` request
9
+
10
+ This verb edits the current native `steel.model/v2` working document. It does not read drawings,
11
+ prepare a Drawing Filter, create a revision, approve the model, or bake the workflow.
12
+
13
+ ## Loop
14
+
15
+ 1. Discover the active FloLess server and fetch pending requests as described by `floless-app-queue`.
16
+ Select the exact `tweak-contract` request and record its `requestId`, `appId`, `project`, and text.
17
+ 2. GET the project-scoped contract. Keep the response ETag. Refuse any document whose `type` is not
18
+ `steel.model/v2` or whose `origin` is not `native`.
19
+ 3. Read `schemas/steel.model.v2.schema.json` before editing. Root `members[]` and `grid` are model-global;
20
+ `plans[]` are registered drawing views with observations and presentation refs.
21
+ Before changing project truth, consult `floless-app-knowledge` § "Consulting the KB from other work (the Feed)"
22
+ → "Required first step" and retain only facts relevant to this request.
23
+ 4. Apply only what the instruction asks. Preserve all other data byte-for-byte where practical,
24
+ especially the saved Filter, plan registration, source hashes, observations, views, details, and
25
+ confidential draft state.
26
+ 5. PUT the complete contract back to the same project-scoped route with `If-Match: <ETag>` and the
27
+ request header required by the server. If the ETag is stale, refetch and reapply the edit; never
28
+ overwrite concurrent work.
29
+ 6. Resolve the request only after the write succeeds. Do not approve or mint a History version.
30
+
31
+ ## Field guide
32
+
33
+ - Members live in root `members[]` and have model-global ids.
34
+ - `from` and `to` are world-millimetre work points. Their `z` is `{known: number}` or
35
+ `{unknown: true, rfiRef?: string}`.
36
+ - Columns are ordered base-to-top. Other members preserve authored endpoint order.
37
+ - Plans never contain member geometry. `memberObservations[]` records evidence and `memberRefs[]`
38
+ assigns presentation for unobserved/manual members.
39
+ - The model grid is root `grid`; plan registration stays in `datum_at`, `datum_ref`, `control2_at`, and
40
+ `control2_ref`.
41
+ - Member observations contain immutable `evidence` and mutable `binding`. A normal editor tweak must
42
+ not rewrite drawing evidence. If the user asks to correct drawing-derived truth, use the revision-read
43
+ process so the new observation supersedes the old one.
44
+ - Observation source locators are exactly `{sourceHash, sheet, elementId}` and must point to a selected
45
+ saved Filter element.
46
+ - Connections are referenced by non-empty ids from member ends and joints.
47
+
48
+ ## Common edits
49
+
50
+ - **Profile:** update `member.profile`; update `weights[profile]` only from an authoritative section
51
+ table. Keep an unresolved mark explicit rather than guessing.
52
+ - **Elevation:** write millimetres to the endpoint's `{known: ...}` value. If the instruction does not
53
+ establish an elevation, use `{unknown: true}`; never substitute the plan cut elevation.
54
+ - **Move/resize:** update root member work points. Re-check connected details, dimensions, and joint
55
+ placement rather than leaving them spatially inconsistent.
56
+ - **Add manual member:** mint a model-global id and set `provenance: "manual"`. Add it to the relevant
57
+ plan's `memberRefs[]`; do not fabricate an observation.
58
+ - **Delete member:** remove or update every real reference to its id. Archive its observations by setting
59
+ binding status to `archived` and memberIds to `[]`; retain immutable evidence for audit.
60
+ - **Connection/detail:** follow the clash and exact-placement discipline in `floless-app-steel-model`.
61
+ Measure contact faces, grip, clearances, and intersections; dimensions alone do not prove fit.
161
62
 
162
63
  ## Guardrails
163
64
 
164
- - **Schema is the guardrail.** A 400 on PUT is the server rejecting invalid JSON — don't
165
- skip it. Read `schemas/steel.takeoff.v1.schema.json` and fix the issue before retrying.
166
- - **Preserve unedited data.** Coordinates, rasters (`raster_b64`), detail bubbles, sheet
167
- previews — if you're not changing them, copy them through unchanged. Dropping fields silently
168
- corrupts the contract.
169
- - **Units differ by shape — check `type` before you trust a number.** In `steel.takeoff/v1` member
170
- geometry (`wp`, `segments`) is display-space points (not feet, not native PDF coords) and
171
- `tos` / `bos` / `elev_in` are decimal inches (`16.5` = 16½ inches). In `steel.model/v2` members are
172
- world **millimetres**. Reading a v2 coordinate as if it were v1 display space moves steel.
173
- - **Screenshots don't lie; instructions generalize.** If the screenshot shows a specific member
174
- and the instruction says "this beam", resolve "this" from the visual, not a guess.
175
- - **Never auto-approve.** Writing the contract back is the AI act. If the user asks what changed,
176
- wants to approve/leave pending/discard, navigate history/checkpoints, or export an approved/DRAFT
177
- source, invoke **`floless-app-approval`**. It presents the server review and relays explicit human
178
- decisions; writing a tweak never implies approval.
179
- - **Thin-UI contract holds.** The browser recorded intent + screenshots; the brain is you, in
180
- the terminal. The editor never edits the contract directly (it's read-only from its side
181
- until the user clicks Save after a manual edit — and that is a different path). This skill
182
- is the AI path.
65
+ - Edit only the project and contract named by the request.
66
+ - Never change the contract discriminator, native origin, saved Filter, or source attachment identity.
67
+ - Never invent drawing evidence for a manual edit.
68
+ - Never silently resolve an unknown engineering value.
69
+ - Never drop unedited fields while rebuilding JSON.
70
+ - Never auto-approve after a tweak; return control to the editor for review.
71
+ - If the user separately asks to approve, hand that work to `floless-app-approval`; never auto-approve.
72
+ - Preserve confidentiality: do not copy rasters, credentials, absolute paths, or project data elsewhere.
@@ -2,7 +2,7 @@
2
2
  name: reading-structural-drawings
3
3
  description: This skill should be used BEFORE modelling anything from a structural/architectural drawing SET (PDF). Use it whenever turning drawings into a 3D frame, takeoff, IFC, or Tekla model — it is the prerequisite reading discipline for the `floless-app-steel-takeoff` reader (and the `floless-app-steel-model` guide that orchestrates the full flow). Triggers on "read this drawing set", "model this structure from the PDF", "take off this steel", "build a model from these drawings", or any pure-PDF → structure task. It encodes the method that stops the classic failures (missing that a set is TWO buildings, missing a curved/sloped roof, conflating grids across sheets, tracing dimension lines as members) — establish MASSING + COORDINATE FRAME first (from the index + elevations + sections), members LAST; deterministic geometry feeds the reasoning; cross-validate every view; verify before presenting.
4
4
  metadata:
5
- version: 0.3.0
5
+ version: 0.4.0
6
6
  ---
7
7
 
8
8
  # Reading a structural drawing set — the discipline (do this BEFORE you model anything)
@@ -353,7 +353,7 @@ Only then build the scene / overlay / IFC. If unsure, present the **massing + gr
353
353
 
354
354
  ## Companion skills
355
355
  - After this reading produces a verified structure, hand to the **`floless-app-steel-takeoff`** reader
356
- to produce the editable `steel.takeoff/v1` contract (which then exports 3D + IFC + Tekla + BOM). This
356
+ to produce the editable native `steel.model/v2` contract (which then exports 3D + IFC + Tekla + BOM). This
357
357
  skill is the *reading discipline*; that one is the *reader*. The **`floless-app-steel-model`** guide
358
358
  (the front-door orchestrator) wraps the whole flow and references this discipline at the
359
359
  classify-and-verify gates rather than re-deriving it.
@@ -2,7 +2,7 @@
2
2
  name: steel-drawing-abbreviations
3
3
  description: Default legend of standard US (AISC, imperial) structural-steel drawing abbreviations, note conventions, and shape designations — the fallback meaning when a drawing set omits or only partially supplies its own abbreviations/legend sheet. This skill should be used while reading a structural steel drawing whenever an abbreviation, note code, or profile designation needs expanding (TYP, TOS, UON, EQ, (E)/(N), SIM, HSS, WT, and so on), or when the steel reader (floless-app-steel-takeoff / floless-app-steel-model) meets a note or label whose meaning is not defined on the supplied sheets. The project's own legend always overrides these defaults.
4
4
  metadata:
5
- version: "0.3.0"
5
+ version: "0.4.0"
6
6
  ---
7
7
 
8
8
  # Steel drawing abbreviations — default legend
@@ -83,7 +83,7 @@ invents members, which no downstream check will catch.
83
83
  - **`reading-structural-drawings`** — the reading discipline; its Pass 0 (inventory & legend) consults
84
84
  this default legend when the set's own abbreviations sheet is missing.
85
85
  - **`floless-app-steel-takeoff`** — the reader; uses this while reading notes/labels into the
86
- `steel.takeoff/v1` contract (TYP profiles, TOS defaults, connection-type words, `(E)`/`(N)` scope).
86
+ native `steel.model/v2` contract (TYP profiles, explicit elevations, connection-type words, `(E)`/`(N)` scope).
87
87
  - **`floless-app-steel-model`** — the front-door guide; references this at the "learn the set" stage so
88
88
  a partial set without a legend sheet still reads correctly.
89
89
  - **`steel-detailer-us` / `-eu` / `-uk`** (AWARE agents) — own the section *tables and weights*; this
@@ -1,5 +1,5 @@
1
1
  app: steel-model
2
- version: 0.4.1
2
+ version: 0.5.0
3
3
  display-name: Steel Model
4
4
  publisher: floless
5
5
  module: steel-detailer
@@ -20,6 +20,10 @@ exposes-as-agent: false
20
20
  # Workflow changelog (FloLess-published). Newest first; the app shows entries newer than the
21
21
  # installed version when offering an update. Plain-English — it surfaces to the user.
22
22
  changelog:
23
+ - version: 0.5.0
24
+ summary: Drawing Filter and model reading now stay on the native model contract
25
+ changes:
26
+ - "Changed: Steel Model keeps the same Filter, review, revision and History process while reading directly into the native model format. There is no conversion step between filtering the drawing and reviewing the model."
23
27
  - version: 0.4.1
24
28
  summary: Housekeeping — no change to how Steel Model works
25
29
  changes:
@@ -86,33 +90,34 @@ nodes:
86
90
  # as an HTML summary. Ships with a tiny EXAMPLE so it renders out of the box —
87
91
  # "Re-read & re-bake ▸" replaces config.takeoff.
88
92
  #
89
- # ONE node, BOTH steel types. `contract:` below declares what is baked here RIGHT NOW, and
90
- # Approve rewrites it: a project migrated to steel.model/v2 bakes v2 into this same node
91
- # and the line becomes `steel.model/v2`. Every project of this app shares this one file, so
92
- # the bake matches the steel contract node rather than one fixed type — that is what lets a
93
- # migrated project and its still-v1 siblings both keep approving. Do NOT hand-edit the type
94
- # to v2 to "enable" the model: a store earns v2 only by migrating. Hand-editing this line
95
- # does NOT enable anything — nothing reads it as a type (the read judges config.takeoff's own
96
- # `type` field), so the edit is ignored and the next Approve overwrites it. Where it DOES bite
97
- # is import: server/app-import.ts refuses a .flo whose declaration is an unearned v2.
98
- # See server/contract-bake.ts.
93
+ # This node declares and carries the native steel.model/v2 contract. Approve rewrites the
94
+ # same node with the reviewed project model; the declaration and document discriminator
95
+ # must always agree.
99
96
  - id: read
100
97
  agent: html-report
101
98
  command: render
102
99
  config:
103
- contract: steel.takeoff/v1
100
+ contract: steel.model/v2
104
101
  takeoff:
105
- type: steel.takeoff/v1
102
+ type: steel.model/v2
103
+ origin: native
106
104
  source: { name: "Example — sample framing (not a real drawing)" }
107
105
  weights:
108
106
  W10X33: 49.1
109
107
  HSS6X6X3/8: 27.48
108
+ members:
109
+ - { id: m1, profile: W10X33, role: beam, provenance: manual, from: { x: 0, y: 0, z: { known: 0 } }, to: { x: 6000, y: 0, z: { known: 0 } } }
110
+ - { id: m2, profile: HSS6X6X3/8, role: column, provenance: manual, from: { x: 0, y: 0, z: { known: 0 } }, to: { x: 0, y: 0, z: { known: 4500 } } }
110
111
  plans:
111
112
  - sheet: EX-1
113
+ viewKind: plan
112
114
  title: Example Framing Plan
113
- members:
114
- - { id: m1, profile: W10X33, role: beam, wp: [[0,0],[6000,0]] }
115
- - { id: m2, profile: HSS6X6X3/8, role: column, wp: [[0,0],[0,4500]] }
115
+ elevation_in: 0
116
+ pt_per_ft: 12
117
+ datum_at: [0, 0]
118
+ control2_at: [300, 0]
119
+ control2_ref: { axis_x: "2", axis_y: A }
120
+ memberRefs: [m1, m2]
116
121
  template: steel-takeoff-summary
117
122
  # NOTE: html-report does NOT template a sibling config key — `data: '{{ config.takeoff }}'`
118
123
  # collapses to one opaque item (verified: subtitle "1 item", no member data). So we mirror
@@ -120,17 +125,25 @@ nodes:
120
125
  # source (editor + Approve-bake + GET /api/contract); a later task can wire the render
121
126
  # to it once html-report (or the BOM formatter) consumes the structured contract.
122
127
  data:
123
- type: steel.takeoff/v1
128
+ type: steel.model/v2
129
+ origin: native
124
130
  source: { name: "Example — sample framing (not a real drawing)" }
125
131
  weights:
126
132
  W10X33: 49.1
127
133
  HSS6X6X3/8: 27.48
134
+ members:
135
+ - { id: m1, profile: W10X33, role: beam, provenance: manual, from: { x: 0, y: 0, z: { known: 0 } }, to: { x: 6000, y: 0, z: { known: 0 } } }
136
+ - { id: m2, profile: HSS6X6X3/8, role: column, provenance: manual, from: { x: 0, y: 0, z: { known: 0 } }, to: { x: 0, y: 0, z: { known: 4500 } } }
128
137
  plans:
129
138
  - sheet: EX-1
139
+ viewKind: plan
130
140
  title: Example Framing Plan
131
- members:
132
- - { id: m1, profile: W10X33, role: beam, wp: [[0,0],[6000,0]] }
133
- - { id: m2, profile: HSS6X6X3/8, role: column, wp: [[0,0],[0,4500]] }
141
+ elevation_in: 0
142
+ pt_per_ft: 12
143
+ datum_at: [0, 0]
144
+ control2_at: [300, 0]
145
+ control2_ref: { axis_x: "2", axis_y: A }
146
+ memberRefs: [m1, m2]
134
147
 
135
148
  # ── node 3: view — interactive 3D model ──────────────────────────────────────
136
149
  # scene is BAKED at compose time (matches config.takeoff above).
@@ -165,17 +178,25 @@ nodes:
165
178
  config:
166
179
  template: steel-takeoff-bom
167
180
  data:
168
- type: steel.takeoff/v1
181
+ type: steel.model/v2
182
+ origin: native
169
183
  source: { name: "Example — sample framing (not a real drawing)" }
170
184
  weights:
171
185
  W10X33: 49.1
172
186
  HSS6X6X3/8: 27.48
187
+ members:
188
+ - { id: m1, profile: W10X33, role: beam, provenance: manual, from: { x: 0, y: 0, z: { known: 0 } }, to: { x: 6000, y: 0, z: { known: 0 } } }
189
+ - { id: m2, profile: HSS6X6X3/8, role: column, provenance: manual, from: { x: 0, y: 0, z: { known: 0 } }, to: { x: 0, y: 0, z: { known: 4500 } } }
173
190
  plans:
174
191
  - sheet: EX-1
192
+ viewKind: plan
175
193
  title: Example Framing Plan
176
- members:
177
- - { id: m1, profile: W10X33, role: beam, wp: [[0,0],[6000,0]] }
178
- - { id: m2, profile: HSS6X6X3/8, role: column, wp: [[0,0],[0,4500]] }
194
+ elevation_in: 0
195
+ pt_per_ft: 12
196
+ datum_at: [0, 0]
197
+ control2_at: [300, 0]
198
+ control2_ref: { axis_x: "2", axis_y: A }
199
+ memberRefs: [m1, m2]
179
200
 
180
201
  # ── node 5: csv-export — write the bill of materials to a CSV file ────────────
181
202
  # Saves the bill of materials to a .csv file on disk every time you Run the
package/dist/web/app.css CHANGED
@@ -4755,22 +4755,6 @@ table.hist tr.current td { background:var(--accent-soft); }
4755
4755
  themed in the same pass — a native white bar against the dark theme is exactly what the standing
4756
4756
  rule exists to stop. Reuses .ws-archived-summary's caret rotation idiom rather than a new one. */
4757
4757
  /* What ticking the row actually covers — stated visibly, not only in the accessible name. */
4758
- .mig-fanout-scope { margin-top:5px; font-size:11px; color:var(--text-muted); }
4759
- .mig-fanout { margin-top:7px; }
4760
- .mig-fanout-summary { list-style:none; cursor:pointer; font-size:11px; color:var(--text-dim);
4761
- display:flex; align-items:center; gap:5px; user-select:none; }
4762
- .mig-fanout-summary::-webkit-details-marker { display:none; }
4763
- .mig-fanout-summary:hover { color:var(--text-muted); }
4764
- .mig-fanout-summary:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:3px; }
4765
- .mig-fanout[open] > .mig-fanout-summary .ws-archived-caret { transform:rotate(90deg); }
4766
- .mig-fanout-list { margin-top:6px; max-height:172px; overflow-y:auto; display:flex; flex-direction:column;
4767
- gap:2px; padding:6px 8px; border:1px solid var(--border); border-radius:5px; background:var(--surface-2);
4768
- scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
4769
- .mig-fanout-list::-webkit-scrollbar { width:9px; }
4770
- .mig-fanout-list::-webkit-scrollbar-thumb { background:var(--border-strong); border-radius:5px; }
4771
- .mig-fanout-list::-webkit-scrollbar-track { background:transparent; }
4772
- .mig-fanout-item { font:500 11px/1.5 var(--mono); color:var(--text-muted); overflow-wrap:anywhere; }
4773
-
4774
4758
  .rev-fields { margin:6px 0 0; display:flex; flex-direction:column; gap:3px; }
4775
4759
  .rev-field { font-size:11.5px; color:var(--text-muted); overflow-wrap:anywhere; }
4776
4760
  .rev-field-key { font-family:var(--mono); color:var(--text-dim); margin-right:6px; }
@@ -4782,95 +4766,36 @@ table.hist tr.current td { background:var(--accent-soft); }
4782
4766
  .rev-issue:last-child { border-bottom:none; }
4783
4767
  .rev-issue-path { font-family:var(--mono); font-size:10.5px; color:var(--text-dim); display:block; margin-top:2px; }
4784
4768
 
4785
- /* ── Convert to the model (steel.takeoff/v1 → steel.model/v2, unit 5, P7e) ────────────────────────
4786
- `.migreview` rides on `.modal.revreview` and adds only the genuine deltas. Everything visual — the
4787
- width, the themed inner scrollbar, the rows, the custom checkboxes at .rev-check — is inherited, so
4788
- there is no second vocabulary to keep in step. */
4789
-
4790
- /* The offer banner. Reuses `.ws-exports-gate` wholesale (neutral accent-dim rail, never --warn/--err:
4791
- an older format is not an error) and only re-homes it, since it sits in the project column rather
4792
- than the exports pane. */
4793
- .ws-migrate-gate { margin:12px 20px 0; }
4794
- /* `[hidden]` DOES NOTHING WITHOUT THIS, and the banner was visible on every project as a result.
4795
- `.ws-exports-gate` sets `display:flex`, an author-origin rule that beats the UA's
4796
- `[hidden] { display:none }` — and this stylesheet has no global `[hidden]` rule, only per-class ones
4797
- (`.ws-drawings-bar[hidden]`, `.ws-revision-card[hidden]`, the `!important` list at :3551). Without it
4798
- every `$migGate.hidden = true` was a no-op: an empty bordered strip painted under the step tabs for
4799
- EVERY workspace project, a v1 project's banner followed the user onto Drawings and History, and it
4800
- survived a successful conversion still offering to convert. Caught by review measuring computed
4801
- `display`; the browser pass asserted the `hidden` PROPERTY, which was true the whole time. */
4802
- .ws-migrate-gate[hidden] { display:none; }
4803
-
4804
- /* AN UNTICKED BOX INSIDE A ROW WAS INVISIBLE, and this is a contrast fix, not a restyle.
4805
- `.rev-check input` sets `border: var(--border-strong)` on `background: var(--surface-2)` — and those
4806
- two tokens are THE SAME COLOUR (both hsl(217.2 32.6% 17.5%)). On `.modal-check` that is harmless,
4807
- because the fork-consent checkbox sits on the darker modal surface where the fill itself reads as the
4808
- box. Inside `.rev-row`, whose background is ALSO --surface-2, all three match: measured
4809
- rgb(30,41,59) for the row, the fill and the border alike. The result is a 16×16 invisible square that
4810
- only appears once focused.
4811
- Pre-existing and shared with the revision-review modal, so this fixes that surface too — scoped to
4812
- the row context, which is the only place the collision happens, rather than restyling every consent
4813
- checkbox in the app. Found by measuring computed styles in the browser pass; a screenshot alone
4814
- showed "a row with no checkbox" and could not say why. */
4815
- .rev-row .rev-check input[type="checkbox"] { border-color: var(--text-dim); }
4816
- .rev-row .rev-check input[type="checkbox"]:hover { border-color: var(--text-muted); }
4817
- .rev-row .rev-check input[type="checkbox"]:checked { border-color: var(--accent); }
4818
-
4819
- /* The kind heading — the OUTER grouping axis, above the topic groups. Load-bearing rather than
4820
- decorative: a topic can carry decisions of both kinds ("Saved views" does), so without this the same
4821
- title appears twice, one block with a bulk control and one without, and nothing says why. */
4822
- .mig-section { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap;
4823
- margin:14px 0 6px; padding-bottom:5px; border-bottom:1px solid var(--border); }
4824
- .mig-section:first-child { margin-top:2px; }
4825
- .mig-section-title { font-size:12px; font-weight:600; color:var(--text); letter-spacing:0.01em; }
4826
- .mig-section-sub { font-size:11px; color:var(--text-dim); }
4827
-
4828
- /* The tick progress, distinct from `.rev-counts` above the body: that line says what you GET, this one
4829
- says what is LEFT. Sits tight to the actions it gates, and right-aligned so the eye finds it on the
4830
- way to the button rather than having to come back up the modal. */
4831
- .mig-progress { margin:2px 0 8px; text-align:right; }
4832
- .mig-progress[hidden] { display:none; }
4833
-
4834
- /* Confirm while anything is unticked. `aria-disabled`, NEVER the `disabled` attribute — the same
4835
- recipe `.kb-organize` and `.ecard .e-act` use, and for the same reason: a disabled button is neither
4836
- hoverable nor focusable, so the `data-tip` saying WHY it will not go would never reach the person who
4837
- needs it. Reads as inert to assistive tech; `confirmMigrate` checks the same attribute, so the gate
4838
- is behaviour rather than styling. */
4839
- .migreview .modal-actions button.primary[aria-disabled="true"] {
4840
- opacity:0.55; cursor:default;
4841
- background:var(--surface-2); border-color:var(--border-strong); color:var(--text-dim);
4842
- }
4843
- .migreview .modal-actions button.primary[aria-disabled="true"]:hover {
4844
- background:var(--surface-2); border-color:var(--border-strong); color:var(--text-dim);
4845
- }
4846
- /* A REFUSED conversion renders no Confirm at all, so the attribute has to actually take: `.modal-actions
4847
- button` sets a display, which beats the UA's `[hidden]` rule on its own. */
4848
- .migreview .modal-actions button[hidden] { display:none; }
4769
+ /* An unchecked decision box must remain visible against its --surface-2 row. The base checkbox fill
4770
+ and border both use --border-strong, which is the same colour as this row in the locked dark theme. */
4771
+ .rev-row .rev-check input[type="checkbox"] { border-color:var(--text-dim); }
4772
+ .rev-row .rev-check input[type="checkbox"]:hover { border-color:var(--text-muted); }
4773
+ .rev-row .rev-check input[type="checkbox"]:checked { border-color:var(--accent); }
4849
4774
 
4850
- /* ── Workspaces: revision re-read (Slice 4b) — attach band + pending/failed card ── */
4851
- .ws-drawings-bar { flex:none; display:flex; align-items:center; gap:10px; padding:8px 14px; border-bottom:1px solid var(--border); background:var(--surface); }
4775
+ /* ── Workspaces: revision re-read — drawing source band + request status card ─────────────── */
4776
+ .ws-drawings-bar { flex:none; display:flex; align-items:center; gap:10px; padding:8px 14px;
4777
+ border-bottom:1px solid var(--border); background:var(--surface); }
4852
4778
  .ws-drawings-bar[hidden] { display:none !important; }
4853
4779
  .ws-drawings-bar-label { font-size:10px; color:var(--text-dim); text-transform:uppercase; letter-spacing:.1em; }
4854
4780
  .ws-drawings-bar-sep { flex:1; }
4855
- .ws-revision-card { flex:none; display:flex; align-items:center; gap:10px; padding:9px 14px; border-bottom:1px solid var(--border); background:var(--surface-2); font-size:12px; color:var(--text-muted); }
4781
+ .ws-revision-card { flex:none; display:flex; align-items:center; gap:10px; padding:9px 14px;
4782
+ border-bottom:1px solid var(--border); background:var(--surface-2); font-size:12px; color:var(--text-muted); }
4856
4783
  .ws-revision-card[hidden] { display:none !important; }
4857
4784
  .ws-revision-card b { color:var(--text); font-weight:600; }
4858
4785
  .ws-revision-card .wrc-text { flex:1; min-width:0; }
4859
- .ws-revision-card .wrc-spin { flex:none; width:14px; height:14px; border:2px solid var(--border-strong); border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
4786
+ .ws-revision-card .wrc-spin { flex:none; width:14px; height:14px; border:2px solid var(--border-strong);
4787
+ border-top-color:var(--accent); border-radius:50%; animation:spin .8s linear infinite; }
4860
4788
  .ws-revision-card.state-failed { border-left:3px solid var(--err); }
4861
4789
  .ws-revision-card.state-failed .wrc-err-ico { color:var(--err); flex:none; }
4862
4790
  .ws-revision-card.state-failed .wrc-err-detail { color:var(--text-dim); }
4863
- /* Staged: resolved and waiting on the user. A STATIC dot, not the pending spinner — nothing is in
4864
- flight and an animation would say otherwise. */
4865
- .ws-revision-card.state-staged { border-left:3px solid var(--accent); }
4866
- .ws-revision-card.state-staged .wrc-dot { flex:none; width:8px; height:8px; border-radius:50%; background:var(--accent); }
4867
- .ws-revision-card.state-filter-ready { border-left:3px solid var(--accent); }
4868
- .ws-revision-card.state-filter-ready .wrc-dot { flex:none; width:8px; height:8px; border-radius:50%; background:var(--accent); }
4791
+ .ws-revision-card.state-staged, .ws-revision-card.state-filter-ready { border-left:3px solid var(--accent); }
4792
+ .ws-revision-card.state-staged .wrc-dot, .ws-revision-card.state-filter-ready .wrc-dot {
4793
+ flex:none; width:8px; height:8px; border-radius:50%; background:var(--accent); }
4869
4794
  .ws-revision-card .wrc-actions { display:flex; gap:6px; flex:none; }
4870
4795
  @media (prefers-reduced-motion: reduce) { .ws-revision-card .wrc-spin { animation:none; } }
4871
4796
  .hist .gate-badge.ai-read { background:var(--accent-soft); border-color:var(--accent-dim); color:var(--accent-bright); }
4872
4797
 
4873
- /* Rollback confirm — a styled anchored popover (NEVER a native dialog); names the Exports re-lock. */
4798
+ /* History rollback and Knowledge remove confirmation share this themed anchored popover. */
4874
4799
  .hist-confirm { position:absolute; z-index:20; width:264px; padding:12px 13px; background:var(--surface-3);
4875
4800
  border:1px solid var(--border-strong); border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.4); }
4876
4801
  .hist-confirm .hc-title { font-size:12.5px; font-weight:600; color:var(--text); margin-bottom:5px; }
@@ -4878,7 +4803,8 @@ table.hist tr.current td { background:var(--accent-soft); }
4878
4803
  .hist-confirm .hc-act { display:flex; gap:8px; justify-content:flex-end; }
4879
4804
  .hist-confirm .hc-go { background:var(--accent); border:1px solid var(--accent); color:white; font-weight:600;
4880
4805
  border-radius:6px; padding:5px 11px; font-size:11.5px; cursor:pointer; }
4881
- .hist-confirm .hc-go:hover { background:var(--accent-bright); border-color:var(--accent-bright); box-shadow:0 0 14px var(--accent-glow); }
4806
+ .hist-confirm .hc-go:hover { background:var(--accent-bright); border-color:var(--accent-bright);
4807
+ box-shadow:0 0 14px var(--accent-glow); }
4882
4808
  .hist-confirm .hc-cancel { background:none; border:1px solid var(--border-strong); color:var(--text-muted);
4883
4809
  border-radius:6px; padding:5px 11px; font-size:11.5px; cursor:pointer; }
4884
4810
  .hist-confirm .hc-cancel:hover { color:var(--text); border-color:var(--accent); }
package/dist/web/aware.js CHANGED
@@ -7820,7 +7820,13 @@
7820
7820
  const { atomic, keep, drop } = bulkClearPlan(painted, pendingRequests, filterActive);
7821
7821
  try {
7822
7822
  if (atomic) {
7823
- await api('/api/requests', { method: 'DELETE' }); // no filter, nothing lifecycle-owned — the atomic bulk clear is fine
7823
+ const result = await api('/api/requests', { method: 'DELETE' }); // no filter, nothing lifecycle-owned — the atomic bulk clear is fine
7824
+ if (result?.failed) {
7825
+ await loadRequests();
7826
+ renderRequests();
7827
+ showToast(`Cleared ${result.cleared} request${result.cleared === 1 ? '' : 's'} — ${result.failed} could not be cleared`, 'err');
7828
+ return;
7829
+ }
7824
7830
  } else {
7825
7831
  for (const r of drop) await api(`/api/requests/${encodeURIComponent(r.id)}`, { method: 'DELETE' });
7826
7832
  }