From 5bfb18542d300d189b1abd7ea636cf13f4fa85b5 Mon Sep 17 00:00:00 2001 From: fstwn Date: Wed, 28 Oct 2026 14:14:45 +0100 Subject: [PATCH 1/3] docs(adr): scope of 0.6.4.2 (web and backend) and 0.6.4.3 (Grasshopper), decisions 8.179 and 8.180 --- docs/adr/DESIGN_DECISIONS.md | 2 ++ docs/adr/IMPLEMENTATION_PLAN_0.6.md | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/adr/DESIGN_DECISIONS.md b/docs/adr/DESIGN_DECISIONS.md index a73aff43..cf024030 100644 --- a/docs/adr/DESIGN_DECISIONS.md +++ b/docs/adr/DESIGN_DECISIONS.md @@ -313,6 +313,8 @@ into one **metadata object**. | 8.176 | **Privacy and imprint: the maintainer is the controller; no Google map preview** (user 2026-10-23; added to 0.6.4, amends 8.164 and 8.171). The privacy page and the imprint state that the catalog, part of a doctoral project at the DDU of TU Darmstadt, is run by the maintainer in person, who alone is the controller; TU Darmstadt does not operate the site and is not responsible for it. The hover preview of a location in the Browse table, an embedded Google map, is removed; the location stays a link that opens Google Maps in a new tab only on a click. With no Google frame left, the CSP drops its `frame-src` hosts. The cookies row no longer claims that nothing is loaded from other sites (the Location Map loads tiles from FOSSGIS, 8.171), and the imprint cites the DDG instead of the repealed TMG. | The embedded map sent every visitor who pointed at a location to Google (Ireland and USA) without a click and was not named on the privacy page; in Germany such an embed is widely held to need consent first. The Location Map (8.171) now covers seeing pieces on a map, so the only third party a visitor reaches without a click is the tile server of FOSSGIS, on that page. | | 8.177 | **Search by evidence method** (user 2026-10-27; 0.6.4.1). The catalog list takes `evidence_method=` (one name of the evidence vocabulary; an unknown name is a 422): only pieces with at least one published, current evidence record of that method are listed (current: not superseded by a later record, `superseded_by` empty; user 2026-10-27). It combines with every other filter, also with fit and near. The MCP tools `search_components`, `catalog_overview` and `similar_components` take it as `has_evidence`. The match runs on the identity: the ids come from the evidence collection (status `published`, not superseded, the method), which has an index on status and method; the access of the list to the pieces stays as it is. A filter in Browse follows later. | Asking for pieces "with reinforcement" took one `get_evidence` call per piece (chat report, 2026-10-27). `properties.rebar_diameter` is no substitute: an archival claim sets it without any bars. A general method filter serves every method, not only `reinforcement_layout`. | | 8.178 | **A reinforcement layout in the viewer, whatever its status** (user 2026-10-27; 0.6.4.1). The card of a `reinforcement_layout` record in the evidence list has "Show in viewer". It opens the component page on `?snapshot=&layout=`: the viewer shows the version the bars belong to and draws that one record in addition to the published layouts, whatever its status (draft, pending, rejected, superseded, published). The legend names the record and its status, and its bars stand out from the others. The server decides who may load the record, as for any record (7.0); a link to a record the caller may not see draws nothing more and says so. Without `layout=` the viewer stays as it is: published layouts only. Only reinforcement layouts for now; the same link for other positioned records later, if needed. | A submitted draft layout could be read as a card but not seen: the viewer draws published layouts only, while a draft version of a piece opens in the viewer through `?snapshot=`. A global "Show drafts" toggle was rejected: it mixes moderation states into the view of the piece, cannot tell several drafts apart, and would have to cover marks and versions too. One record per link can be sent to a moderator for review. | +| 8.179 | **Scope of 0.6.4.2: a second hardening, with Grasshopper** (user 2026-10-28; before 0.6.5). 0.6.4.2 collects the smaller open items and issues. It is a Grasshopper release: `invoke bump-version 0.6.4.2 --gh` first, then the export in Rhino 8. In: (1) the Grasshopper issues #32 (a missing or empty input of `ReinforcementLayout` is a warning, not an error), #33 (an output without a result is an empty Grasshopper tree, not `''` or `None`) and #36 (`ReadFromD2P` resolves the D2P component from a tagged member object); (2) a scan of every Grasshopper component for the same two faults, fixed in all of them, not only in `ReinforcementLayout`; (3) the descriptions of `ApplyFrame` (0.6.5 (e), moved here). Amended the same day (user): 0.6.4.2 leaves out the Grasshopper side, since the fix of (1) and (2) changes most components; (1) to (3) move to 0.6.4.3 (8.180). 0.6.4.2 is a web and backend release, bumped without `--gh`. In: the issues #35 (session expiry on a private component page), #37 (a reinforcement layout in the History graph opens the viewer), #39 (credits and imprint styled like the privacy page) and #34 (the organisation's website in the profile, "Add my organisation"). Further in 0.6.4.2 (user, same day): the Browse filter for the evidence method (the list parameter of 8.177); the two follow-ups of 8.178 (the diameter colour mode with a chosen layout, the legend key by layout id); `shadcn` (dev only) to >=4.22.1, run by the maintainer since `npm update` is blocked for the agents; the 61 warnings of `invoke test-release` sorted, the cheap ones fixed, the rest reported; the unused `bbxX` type removed from the web app. The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests go to 0.6.4.3. | +| 8.180 | **Scope of 0.6.4.3: Grasshopper only** (user 2026-10-28; after 0.6.4.2, before 0.6.5). A release that touches only the Grasshopper side: `invoke bump-version 0.6.4.3 --gh` first, then the export in Rhino 8. In: issue #40 (the scan of 8.179 (2): a missing or empty input is a warning, an output without a result is an empty Grasshopper tree, in every component, through helpers in the shared library), with #32 and #33 as its first cases; #36 (`ReadFromD2P` resolves the D2P component from a tagged member object); the descriptions of `ApplyFrame` (0.6.5 (e)). | **Facts confirmed (user, 2026-09-28):** the 35 ZirKuS reinforcement bars were modelled after the original drawing --> `basis: drawing` (step 6d). The 2024-07-24 deinstallation applies to all 16 diff --git a/docs/adr/IMPLEMENTATION_PLAN_0.6.md b/docs/adr/IMPLEMENTATION_PLAN_0.6.md index 4ab86844..4fd136e3 100644 --- a/docs/adr/IMPLEMENTATION_PLAN_0.6.md +++ b/docs/adr/IMPLEMENTATION_PLAN_0.6.md @@ -982,6 +982,10 @@ fold (once it is clear which quantities are searched); Atlas Search for typo-tol **0.6.4.1 --- hardening (user 2026-10-27, before 0.6.5):** first the MCP connector, from two chat reports. (a) Search by evidence method (8.177): `evidence_method` on the catalog list, `has_evidence` on the MCP search tools; Browse later. (b) Recognizable connector: instructions that name the domain in English and German (reused and salvaged building components, Bauteile, Wiederverwendung, concrete walls and beams, reinforcement / Bewehrung) and say to use these tools before a web search for such pieces; `website_url` and `icons` on the server; a title and `readOnlyHint` on every tool; tool descriptions that name the evidence methods. (c) The geometry summary drops the `reinforcements` count (always 0 since step 6d moved the bars to evidence, 7.8) and gains the reinforcement layouts of the version (records and bars) with a pointer to `get_evidence`. (d) The evidence list rows of a `reinforcement_layout` carry the bar count, basis, specs, diameters and cover; `performed_by` shows an organization instead of `null`. (e) The write model no longer accepts `geometry.reinforcements` (7.8). (b) to (e) confirmed by the user 2026-10-27; the server icon is the web app's `favicon.ico` until there is a CSC logo. (f) The "Similar pieces" card (8.174 amended): in the left rail on a wide screen, smaller tiles. (g) The `bbx` facet of `/identities/stats` buckets the largest side with edges from the metre era (0 to 1000, then ">=1000"), so in millimetres nearly every piece lands in the last bucket: edges in millimetres instead (for example 100, 250, 500, 1000, 2000, 5000, 10000), checked against the analytics page. (h) The Similar pieces card offers "Show more" only when the first answer says there are more than 6 neighbours, not when there are exactly 6. (g) and (h) added by the user 2026-10-27. (i) Frontend advisories: `undici` (high, fixed in 7.30.1) and `fast-uri` (two medium, two low, fixed in 3.1.9) come only through `shadcn`, the component generator, which is a `devDependency` already; the lockfile takes the fixed versions. (j) The import scripts (`scripts/import/requirements-import.txt`) move to Pillow 13.0.0 (20 alerts); they run locally, the accepted risk of the backend pin stays as it is. (k) E-mail verification drops the fallback to a token stored in plain text (the TODO for 0.6.2 in `auth.py`; such tokens expired 24 hours after 0.6.1.1). (i) to (k) added by the user 2026-10-27. (e) stays with `geometry.reinforcements` only (user 2026-10-27): `geometry.marker_points` is still written by the robot rubble scan pipeline, which is not in use now; both go to the backlog below. (l) Seven tests in `tests/grasshopper` hard-code the client `gh-userobjects/0.6.3.0` and fail since the version bump of 0.6.4.0 (CI does not run `tests/grasshopper`): they read the expected client from the `CSC_CLIENT` line of `DDU_CSC_Session.py` and check that it is not newer than `VERSION` (the rule of `check_version.py`), so a bump with or without `--gh` no longer breaks them; found during T1, built with T3 and a fix round after the bump. (m) "Show in viewer" on the card of a reinforcement layout (8.178, user 2026-10-27): the viewer draws that one record on its version whatever its status, so a submitted draft can be seen and checked; built as T4. +**0.6.4.2 --- second hardening, web and backend (user 2026-10-28, before 0.6.5; 8.179):** no Grasshopper changes (`bump-version` without `--gh`). (a) #35: on session expiry a component page that is not public to anonymous visitors (and a draft view on a public one) is no longer exempt from `SessionMonitor`; a public piece stays readable. (b) #37: a `reinforcement_layout` event in the History graph opens the layout in the viewer as "Show in viewer" does (8.178); other records scroll to their card, also a corrected one. (c) #39: credits and imprint take the box width, padding, text sizes and link style of the privacy page; wording, structure and the card title icons stay. (d) #34: `organization_url` in the profile, copied into the "You" performer, and "Add my organisation" in the performers field. (e) The Browse filter for the evidence method (8.177; the list already takes `evidence_method`). (f) 8.178 follow-ups: the diameter colour mode with a chosen layout; the legend key by layout id. (g) `shadcn` (dev only) to >=4.22.1, about two weeks old from 2026-11-01; the maintainer runs the update. (h) The 61 warnings of `invoke test-release`: sorted, the cheap ones fixed, the rest reported. (i) The unused `bbxX` type removed from `lib/analytics.ts` (whether the backend keeps the field depends on other readers, to be reported). + +**0.6.4.3 --- Grasshopper hardening (user 2026-10-28, after 0.6.4.2; 8.180):** only the Grasshopper side (`bump-version --gh` first, then the export in Rhino 8). (a) #40, with #32 and #33 as its first cases: the scan of 2026-10-28 found eleven components that report a missing input with `_addError` through `BuildError` (`Actor`, `ApplyFrame`, `Capture`, `ComputeFrame`, `CreateComponentIdentity`, `CreateComponentSnapshot`, `FetchReinforcementLayout`, `IdentityMetadata`, `Origin`, `ReinforcementLayout`, `SnapshotMetadata`; `AddEvidence` already warns), fourteen outputs started as `''` or `None`, and an `empty_outputs()` that returns `None` in 47 components. The fix belongs in the shared library (a missing-input error reported as a warning, an empty tree helper) and then in every component; the implementer lists each component and what changed. (b) #36: `ReadFromD2P` resolves the D2P component from a tagged member object, with a live check in Rhino by the maintainer. (c) The descriptions of `ApplyFrame`, moved from 0.6.5 (e). (d) The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests: cause found, fixed or explained. + **0.6.5 --- reinforcement from Grasshopper (about 6--8 days; moved from 0.6.4 by the user 2026-10-21):** (a) units in GH: every component scales by the document unit (a prerequisite for placing scans); (b) RL8, a GH builder for the `rebar_spec` claim and its display, grilled together with (c); (c) Ferroscan to reinforcement layout, @@ -990,7 +994,7 @@ as attachments, (d) several scans of one face; (c) "the image in 3D" later. (e) is (user 2026-10-27): its `Frame` output is the frame used, in the stored coordinates (where the piece sat before the move), not the frame of the moved piece. The descriptions of the component and of the output say so plainly and point to `DisassembleComponent`, whose `Frame` applies `csc_placement` and so -gives the frame where the moved piece sits; exported with the user objects of 0.6.5. +gives the frame where the moved piece sits; moved to 0.6.4.3 (8.180). **0.6.6 --- interoperability (about 5--7 days):** the IFC export (`compose?format=ifc`; first the `ifcopenshell` wheel check for the server, then IFC4 vs IFC4x3 and single piece vs selection); the timeline as PROV-O / From f6fe850a75980bebe78ba5493f0223962fad7711 Mon Sep 17 00:00:00 2001 From: fstwn Date: Wed, 28 Oct 2026 15:26:28 +0100 Subject: [PATCH 2/3] docs(adr): data model reference page (8.181), session expiry and sign-in return address (8.182) --- docs/adr/DESIGN_DECISIONS.md | 2 ++ docs/adr/IMPLEMENTATION_PLAN_0.6.md | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/adr/DESIGN_DECISIONS.md b/docs/adr/DESIGN_DECISIONS.md index cf024030..0eabed7b 100644 --- a/docs/adr/DESIGN_DECISIONS.md +++ b/docs/adr/DESIGN_DECISIONS.md @@ -315,6 +315,8 @@ into one **metadata object**. | 8.178 | **A reinforcement layout in the viewer, whatever its status** (user 2026-10-27; 0.6.4.1). The card of a `reinforcement_layout` record in the evidence list has "Show in viewer". It opens the component page on `?snapshot=&layout=`: the viewer shows the version the bars belong to and draws that one record in addition to the published layouts, whatever its status (draft, pending, rejected, superseded, published). The legend names the record and its status, and its bars stand out from the others. The server decides who may load the record, as for any record (7.0); a link to a record the caller may not see draws nothing more and says so. Without `layout=` the viewer stays as it is: published layouts only. Only reinforcement layouts for now; the same link for other positioned records later, if needed. | A submitted draft layout could be read as a card but not seen: the viewer draws published layouts only, while a draft version of a piece opens in the viewer through `?snapshot=`. A global "Show drafts" toggle was rejected: it mixes moderation states into the view of the piece, cannot tell several drafts apart, and would have to cover marks and versions too. One record per link can be sent to a moderator for review. | | 8.179 | **Scope of 0.6.4.2: a second hardening, with Grasshopper** (user 2026-10-28; before 0.6.5). 0.6.4.2 collects the smaller open items and issues. It is a Grasshopper release: `invoke bump-version 0.6.4.2 --gh` first, then the export in Rhino 8. In: (1) the Grasshopper issues #32 (a missing or empty input of `ReinforcementLayout` is a warning, not an error), #33 (an output without a result is an empty Grasshopper tree, not `''` or `None`) and #36 (`ReadFromD2P` resolves the D2P component from a tagged member object); (2) a scan of every Grasshopper component for the same two faults, fixed in all of them, not only in `ReinforcementLayout`; (3) the descriptions of `ApplyFrame` (0.6.5 (e), moved here). Amended the same day (user): 0.6.4.2 leaves out the Grasshopper side, since the fix of (1) and (2) changes most components; (1) to (3) move to 0.6.4.3 (8.180). 0.6.4.2 is a web and backend release, bumped without `--gh`. In: the issues #35 (session expiry on a private component page), #37 (a reinforcement layout in the History graph opens the viewer), #39 (credits and imprint styled like the privacy page) and #34 (the organisation's website in the profile, "Add my organisation"). Further in 0.6.4.2 (user, same day): the Browse filter for the evidence method (the list parameter of 8.177); the two follow-ups of 8.178 (the diameter colour mode with a chosen layout, the legend key by layout id); `shadcn` (dev only) to >=4.22.1, run by the maintainer since `npm update` is blocked for the agents; the 61 warnings of `invoke test-release` sorted, the cheap ones fixed, the rest reported; the unused `bbxX` type removed from the web app. The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests go to 0.6.4.3. | | 8.180 | **Scope of 0.6.4.3: Grasshopper only** (user 2026-10-28; after 0.6.4.2, before 0.6.5). A release that touches only the Grasshopper side: `invoke bump-version 0.6.4.3 --gh` first, then the export in Rhino 8. In: issue #40 (the scan of 8.179 (2): a missing or empty input is a warning, an output without a result is an empty Grasshopper tree, in every component, through helpers in the shared library), with #32 and #33 as its first cases; #36 (`ReadFromD2P` resolves the D2P component from a tagged member object); the descriptions of `ApplyFrame` (0.6.5 (e)). | +| 8.181 | **A data model reference page for users** (user 2026-10-28; added to 0.6.4.2). The web app gains a public page that explains the data model in a digestible reference form, built from the material that exists (`docs/adr/DATA_MODEL_SPEC.md`, `CONTEXT.md`, `vocab.py`). (a) Audience: catalog users --- members who add pieces and evidence, readers, Grasshopper and MCP users --- not developers. Content: the four entities (dataset, component identity, snapshot, evidence) and how they relate; the four rules of the model in plain words; per entity the fields a user sees or fills in, with meaning, type or unit, an example and whether the server derives it; the vocabularies, each value with its label and one line of meaning; an example record per evidence method. Left out: the API surface, permission internals, invariants, migration and the CPR mapping; they stay in the spec. (b) Sources (hybrid): the text, the examples and the field tables are written by hand in a typed content module of the web app, since the field descriptions of the models are technical; each vocabulary value gains a one-line description in `vocab.py`, served by `GET /vocab` and generated into `generated/Vocab.ts` (`*_DESCRIPTIONS`), so the page shows label and meaning from the backend and other readers (forms, MCP) can use them. Two tests keep it in step: a backend test fails on a vocabulary value without a description, a frontend test fails on a field named on the page that the generated models do not have. (c) Place: `/reference`, titled "Data Model", public without sign-in, in the style of the privacy page (#39); linked in the sidebar next to the Grasshopper item (`/gh-interface`, group `tools` in `lib/navigation.ts`), visible to anyone, not in the footer; a table of contents at the top and an anchor per entity and per vocabulary (`/reference#evidence`, `/reference#evidence-methods`), so that forms, the MCP connector and the Grasshopper descriptions can link a section later. (d) Examples: made up, not taken from the catalog. One made-up piece is followed through the whole model (for example a concrete beam: its dataset, its identity, two versions, evidence records of several methods), so each section shows the same piece. Each record is a table of field, value and a short comment, with its raw JSON folded below. No names of people or organisations (roles instead), ids marked as examples; the values follow the examples of the spec (Appendix A). Real records were rejected: they change or are withdrawn, carry names, and no single piece has every kind of evidence. (e) Authorship: the implementer drafts the text, the field tables, the vocabulary descriptions (one line, about 120 characters at most) and the example piece from the spec and `CONTEXT.md`, and marks the sentences where it read the spec loosely; the reviewer checks every statement against the spec and the decisions; the maintainer approves the wording on the dev stack. Built as T9 of 0.6.4.2, after T7 and before the warning cleanup T8 (about 2--3 days). | +| 8.182 | **Session expiry on a public piece; the return address after sign-in** (user 2026-10-28; 0.6.4.2, from the review of #35). (a) When the session ends on a component page whose view is public (8.179, #35), the page is signed out without a redirect and rendered again as anonymous: it stays readable, but what only a signed-in user sees (person names and e-mails of actors, people in the History graph, `added_by_username`) goes, and the navigation shows the user as signed out. A view that is not public leads to the sign-in page as before. (b) The return address after sign-in (`callbackUrl`) only accepts an address on this site: exactly one leading `/` and the same origin, checked by one shared function on the server and in the browser; anything else falls back to the default page. Closes an open redirect (`//evil.com`, `/\evil.com`) that was there before 0.6.4.2. | **Facts confirmed (user, 2026-09-28):** the 35 ZirKuS reinforcement bars were modelled after the original drawing --> `basis: drawing` (step 6d). The 2024-07-24 deinstallation applies to all 16 diff --git a/docs/adr/IMPLEMENTATION_PLAN_0.6.md b/docs/adr/IMPLEMENTATION_PLAN_0.6.md index 4fd136e3..4abbfb7f 100644 --- a/docs/adr/IMPLEMENTATION_PLAN_0.6.md +++ b/docs/adr/IMPLEMENTATION_PLAN_0.6.md @@ -982,7 +982,7 @@ fold (once it is clear which quantities are searched); Atlas Search for typo-tol **0.6.4.1 --- hardening (user 2026-10-27, before 0.6.5):** first the MCP connector, from two chat reports. (a) Search by evidence method (8.177): `evidence_method` on the catalog list, `has_evidence` on the MCP search tools; Browse later. (b) Recognizable connector: instructions that name the domain in English and German (reused and salvaged building components, Bauteile, Wiederverwendung, concrete walls and beams, reinforcement / Bewehrung) and say to use these tools before a web search for such pieces; `website_url` and `icons` on the server; a title and `readOnlyHint` on every tool; tool descriptions that name the evidence methods. (c) The geometry summary drops the `reinforcements` count (always 0 since step 6d moved the bars to evidence, 7.8) and gains the reinforcement layouts of the version (records and bars) with a pointer to `get_evidence`. (d) The evidence list rows of a `reinforcement_layout` carry the bar count, basis, specs, diameters and cover; `performed_by` shows an organization instead of `null`. (e) The write model no longer accepts `geometry.reinforcements` (7.8). (b) to (e) confirmed by the user 2026-10-27; the server icon is the web app's `favicon.ico` until there is a CSC logo. (f) The "Similar pieces" card (8.174 amended): in the left rail on a wide screen, smaller tiles. (g) The `bbx` facet of `/identities/stats` buckets the largest side with edges from the metre era (0 to 1000, then ">=1000"), so in millimetres nearly every piece lands in the last bucket: edges in millimetres instead (for example 100, 250, 500, 1000, 2000, 5000, 10000), checked against the analytics page. (h) The Similar pieces card offers "Show more" only when the first answer says there are more than 6 neighbours, not when there are exactly 6. (g) and (h) added by the user 2026-10-27. (i) Frontend advisories: `undici` (high, fixed in 7.30.1) and `fast-uri` (two medium, two low, fixed in 3.1.9) come only through `shadcn`, the component generator, which is a `devDependency` already; the lockfile takes the fixed versions. (j) The import scripts (`scripts/import/requirements-import.txt`) move to Pillow 13.0.0 (20 alerts); they run locally, the accepted risk of the backend pin stays as it is. (k) E-mail verification drops the fallback to a token stored in plain text (the TODO for 0.6.2 in `auth.py`; such tokens expired 24 hours after 0.6.1.1). (i) to (k) added by the user 2026-10-27. (e) stays with `geometry.reinforcements` only (user 2026-10-27): `geometry.marker_points` is still written by the robot rubble scan pipeline, which is not in use now; both go to the backlog below. (l) Seven tests in `tests/grasshopper` hard-code the client `gh-userobjects/0.6.3.0` and fail since the version bump of 0.6.4.0 (CI does not run `tests/grasshopper`): they read the expected client from the `CSC_CLIENT` line of `DDU_CSC_Session.py` and check that it is not newer than `VERSION` (the rule of `check_version.py`), so a bump with or without `--gh` no longer breaks them; found during T1, built with T3 and a fix round after the bump. (m) "Show in viewer" on the card of a reinforcement layout (8.178, user 2026-10-27): the viewer draws that one record on its version whatever its status, so a submitted draft can be seen and checked; built as T4. -**0.6.4.2 --- second hardening, web and backend (user 2026-10-28, before 0.6.5; 8.179):** no Grasshopper changes (`bump-version` without `--gh`). (a) #35: on session expiry a component page that is not public to anonymous visitors (and a draft view on a public one) is no longer exempt from `SessionMonitor`; a public piece stays readable. (b) #37: a `reinforcement_layout` event in the History graph opens the layout in the viewer as "Show in viewer" does (8.178); other records scroll to their card, also a corrected one. (c) #39: credits and imprint take the box width, padding, text sizes and link style of the privacy page; wording, structure and the card title icons stay. (d) #34: `organization_url` in the profile, copied into the "You" performer, and "Add my organisation" in the performers field. (e) The Browse filter for the evidence method (8.177; the list already takes `evidence_method`). (f) 8.178 follow-ups: the diameter colour mode with a chosen layout; the legend key by layout id. (g) `shadcn` (dev only) to >=4.22.1, about two weeks old from 2026-11-01; the maintainer runs the update. (h) The 61 warnings of `invoke test-release`: sorted, the cheap ones fixed, the rest reported. (i) The unused `bbxX` type removed from `lib/analytics.ts` (whether the backend keeps the field depends on other readers, to be reported). +**0.6.4.2 --- second hardening, web and backend (user 2026-10-28, before 0.6.5; 8.179):** no Grasshopper changes (`bump-version` without `--gh`). (a) #35: on session expiry a component page that is not public to anonymous visitors (and a draft view on a public one) is no longer exempt from `SessionMonitor`; a public piece stays readable, signed out and rendered again as anonymous (8.182 a). The return address after sign-in only accepts addresses on this site (8.182 b, an open redirect found in the review). (b) #37: a `reinforcement_layout` event in the History graph opens the layout in the viewer as "Show in viewer" does (8.178); other records scroll to their card, also a corrected one. (c) #39: credits and imprint take the box width, padding, text sizes and link style of the privacy page; wording, structure and the card title icons stay. (d) #34: `organization_url` in the profile, copied into the "You" performer, and "Add my organisation" in the performers field. (e) The Browse filter for the evidence method (8.177; the list already takes `evidence_method`). (f) 8.178 follow-ups: the diameter colour mode with a chosen layout; the legend key by layout id. (g) `shadcn` (dev only) to >=4.22.1, about two weeks old from 2026-11-01; the maintainer runs the update. (h) The 61 warnings of `invoke test-release`: sorted, the cheap ones fixed, the rest reported. (i) The unused `bbxX` type removed from `lib/analytics.ts` (whether the backend keeps the field depends on other readers, to be reported). (j) A data model reference page for users (8.181): the entities, the rules, field tables, the vocabularies and an example per evidence method; hand-written text and field tables, vocabulary descriptions from `vocab.py` through `GET /vocab`; `/reference`, "Data Model", in the sidebar next to Grasshopper; one made-up example piece through all sections; drafted by the implementer, wording approved by the maintainer; built before (h), about 2--3 days. **0.6.4.3 --- Grasshopper hardening (user 2026-10-28, after 0.6.4.2; 8.180):** only the Grasshopper side (`bump-version --gh` first, then the export in Rhino 8). (a) #40, with #32 and #33 as its first cases: the scan of 2026-10-28 found eleven components that report a missing input with `_addError` through `BuildError` (`Actor`, `ApplyFrame`, `Capture`, `ComputeFrame`, `CreateComponentIdentity`, `CreateComponentSnapshot`, `FetchReinforcementLayout`, `IdentityMetadata`, `Origin`, `ReinforcementLayout`, `SnapshotMetadata`; `AddEvidence` already warns), fourteen outputs started as `''` or `None`, and an `empty_outputs()` that returns `None` in 47 components. The fix belongs in the shared library (a missing-input error reported as a warning, an empty tree helper) and then in every component; the implementer lists each component and what changed. (b) #36: `ReadFromD2P` resolves the D2P component from a tagged member object, with a live check in Rhino by the maintainer. (c) The descriptions of `ApplyFrame`, moved from 0.6.5 (e). (d) The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests: cause found, fixed or explained. From 22cfe077951a7a10c78724e299bdd9bbdc129ab5 Mon Sep 17 00:00:00 2001 From: fstwn Date: Thu, 29 Oct 2026 11:36:53 +0100 Subject: [PATCH 3/3] fix: hardening 0.6.4.2 (session expiry, sign-in return address, History graph, legal pages, organisation website, Browse evidence filter, Data Model page, "element" wording, Add evidence, shadcn 4.22.1) Web and backend only, no Grasshopper changes (8.179). Session expiry keeps a public element readable as an anonymous visitor and the sign-in return address only accepts addresses on this site (#35, 8.182). A reinforcement layout in the History graph opens in the viewer, other records scroll to their card, a single-record group opens on the first click (#37). Credits and imprint follow the privacy page (#39). Profile website copied into the "You" performer, "Add my organisation" in the performers field (#34). Browse filter for the evidence method (8.177), 8.178 follow-ups, unused bbxX removed, test-release warnings sorted. New Data Model page at /reference in seven tabs, examples checked against the backend models (8.181). "Element" instead of "piece" in user-facing text, the spec and CONTEXT.md (8.183). "Add evidence" on the evidence records card, a "?" on the properties card (8.118 amended). shadcn pinned at 4.22.1 (dev only). --- .zenodo.json | 6 +- CHANGELOG.md | 51 + CONTEXT.md | 15 +- README.md | 16 +- VERSION | 2 +- docs/adr/DATA_MODEL_SPEC.md | 164 ++-- docs/adr/DESIGN_DECISIONS.md | 5 +- docs/adr/IMPLEMENTATION_PLAN_0.6.md | 9 +- pytest.ini | 3 + src/backend/apps/catalog/api/access.py | 2 +- src/backend/apps/catalog/api/access_tokens.py | 2 +- src/backend/apps/catalog/api/actors.py | 3 +- src/backend/apps/catalog/api/batches.py | 4 +- src/backend/apps/catalog/api/catalog_list.py | 21 +- src/backend/apps/catalog/api/datasets.py | 33 +- src/backend/apps/catalog/api/evidence.py | 6 +- .../apps/catalog/api/evidence_attachments.py | 2 +- .../apps/catalog/api/evidence_service.py | 6 +- src/backend/apps/catalog/api/history.py | 2 +- src/backend/apps/catalog/api/identity_edit.py | 26 +- .../apps/catalog/api/identity_filters.py | 10 +- .../apps/catalog/api/identity_lifecycle.py | 16 +- .../apps/catalog/api/identity_query.py | 18 - .../apps/catalog/api/identity_workflows.py | 39 +- src/backend/apps/catalog/api/profiles.py | 6 +- .../apps/catalog/api/snapshot_lifecycle.py | 6 +- src/backend/apps/catalog/api/snapshots.py | 2 +- src/backend/apps/catalog/component_map.py | 1 + src/backend/apps/catalog/documents.py | 14 +- src/backend/apps/catalog/evidence/payloads.py | 6 +- src/backend/apps/catalog/evidence/registry.py | 2 +- src/backend/apps/catalog/evidence/specs.py | 12 +- src/backend/apps/catalog/invariants.py | 6 +- src/backend/apps/catalog/lineage.py | 2 +- src/backend/apps/catalog/mcp_server.py | 32 +- src/backend/apps/catalog/models.py | 24 +- src/backend/apps/catalog/profile.py | 20 +- src/backend/apps/catalog/proxies/fit.py | 2 +- src/backend/apps/catalog/read_models.py | 22 +- src/backend/apps/catalog/vocab.py | 154 ++- src/backend/csc_version.py | 2 +- .../templates/mail/dataset_created.html.j2 | 2 +- .../templates/mail/dataset_created.txt.j2 | 2 +- src/backend/utility/utility.py | 3 +- .../app/admin/datasets/[did]/page.tsx | 18 +- src/frontend/app/analytics/page.tsx | 4 +- src/frontend/app/auth/signin/SignInForm.tsx | 19 +- src/frontend/app/auth/signin/page.tsx | 12 +- src/frontend/app/components/page.tsx | 5 +- src/frontend/app/credits/page.tsx | 86 +- src/frontend/app/imprint/page.tsx | 34 +- src/frontend/app/page.tsx | 4 +- src/frontend/app/privacy/page.tsx | 3 +- src/frontend/app/reference/page.tsx | 231 +++++ .../components/auth/SessionMonitor.tsx | 54 +- .../components/catalog/CatalogFilterBar.tsx | 16 + .../components/ComponentLocateById.tsx | 6 +- .../components/components/ComponentViewer.tsx | 10 +- .../components/detail/AddEvidenceButton.tsx | 38 + .../detail/ComponentActionsMenu.tsx | 6 +- .../detail/ComponentHistoryCard.tsx | 2 +- .../components/detail/ComponentPageView.tsx | 27 +- .../detail/ComponentPhotosLocationCard.tsx | 2 +- .../detail/ComponentPropertiesCard.tsx | 39 +- .../detail/ComponentRecordsCard.tsx | 38 +- .../detail/ComponentSimilarCard.tsx | 12 +- .../components/detail/EvidenceData.tsx | 8 +- .../components/detail/HistoryList.tsx | 4 +- .../components/history/SwimlaneGraph.tsx | 70 +- .../components/history/SwimlaneSvg.tsx | 8 +- .../components/map/LocationMapPageClient.tsx | 6 +- .../components/datasets/YourDatasets.tsx | 2 +- .../components/evidence/EvidenceCard.tsx | 2 +- .../components/evidence/PropertiesCard.tsx | 17 +- .../components/evidence/form/ActorsField.tsx | 29 +- .../components/evidence/form/ClaimEditor.tsx | 14 +- .../components/evidence/form/EvidenceForm.tsx | 2 +- .../evidence/form/PositionField.tsx | 2 +- .../evidence/form/RecordsEditor.tsx | 2 +- .../components/lineage/CirculationActions.tsx | 2 +- .../components/lineage/DeinstallActions.tsx | 6 +- .../lineage/ProvenanceEditDialog.tsx | 4 +- .../components/reference/DataTable.tsx | 67 ++ .../components/reference/ModelDiagram.tsx | 60 ++ src/frontend/components/reference/Prose.tsx | 42 + .../components/reference/ReferenceTabs.tsx | 136 +++ .../components/scan/ScanPageClient.tsx | 4 +- .../components/settings/ProfileSection.tsx | 34 +- .../components/snapshot/AddComponentEntry.tsx | 6 +- .../components/snapshot/DetailsStep.tsx | 16 +- .../components/snapshot/EditSnapshotForm.tsx | 10 +- .../components/snapshot/ParentTags.tsx | 4 +- src/frontend/components/snapshot/SizeStep.tsx | 6 +- .../components/snapshot/SnapshotForm.tsx | 24 +- .../components/snapshot/UnknownTag.tsx | 8 +- .../components/viewer/OpacitySlider.tsx | 10 +- src/frontend/generated/AccessModels.ts | 5 +- src/frontend/generated/CatalogModels.ts | 16 +- .../generated/EvidenceCreateModels.ts | 8 +- src/frontend/generated/Vocab.ts | 163 +++- src/frontend/generated/catalogExtras.ts | 2 +- src/frontend/lib/analytics.test.ts | 7 +- src/frontend/lib/analytics.ts | 8 +- src/frontend/lib/browse.test.ts | 38 +- src/frontend/lib/browse.ts | 36 +- src/frontend/lib/componentDetail.test.ts | 23 +- src/frontend/lib/componentDetail.ts | 28 +- src/frontend/lib/csp.test.ts | 4 +- src/frontend/lib/dataModelExamples.ts | 679 +++++++++++++ src/frontend/lib/dataModelExport.ts | 11 + src/frontend/lib/dataModelRows.ts | 43 + src/frontend/lib/dataModelTabs.test.ts | 116 +++ src/frontend/lib/dataModelTabs.ts | 93 ++ src/frontend/lib/dataModelText.test.ts | 296 ++++++ src/frontend/lib/dataModelText.ts | 697 +++++++++++++ src/frontend/lib/dataModelVocab.ts | 38 + src/frontend/lib/datasets.ts | 2 +- src/frontend/lib/evidence/issues.test.ts | 2 +- src/frontend/lib/evidence/issues.ts | 4 +- .../lib/evidence/methodGroups.test.ts | 4 +- src/frontend/lib/evidence/methodGroups.ts | 6 +- src/frontend/lib/fit.test.ts | 8 +- src/frontend/lib/fit.ts | 12 +- src/frontend/lib/history/recordTarget.test.ts | 143 +++ src/frontend/lib/history/recordTarget.ts | 66 ++ src/frontend/lib/history/scrollToRecord.ts | 24 + src/frontend/lib/history/swimlane.test.ts | 2 +- src/frontend/lib/legalPage.ts | 2 + src/frontend/lib/locationMap.test.ts | 16 +- src/frontend/lib/locationMap.ts | 14 +- src/frontend/lib/moderationCard.test.ts | 2 +- src/frontend/lib/moderationCard.ts | 4 +- src/frontend/lib/navigation.test.ts | 19 +- src/frontend/lib/navigation.ts | 4 +- src/frontend/lib/near.ts | 6 +- src/frontend/lib/pageView.ts | 43 + src/frontend/lib/privacyText.ts | 2 +- src/frontend/lib/profile.test.ts | 55 +- src/frontend/lib/profile.ts | 47 +- src/frontend/lib/propertiesEmpty.test.ts | 37 + src/frontend/lib/propertiesEmpty.ts | 20 + src/frontend/lib/publicSwitch.test.ts | 16 +- src/frontend/lib/publicSwitch.ts | 10 +- src/frontend/lib/reinforcementColors.test.ts | 54 + src/frontend/lib/reinforcementColors.ts | 19 +- src/frontend/lib/safeCallback.test.ts | 49 + src/frontend/lib/safeCallback.ts | 29 + src/frontend/lib/sessionExpiry.test.ts | 112 +++ src/frontend/lib/sessionExpiry.ts | 81 ++ src/frontend/lib/snapshotForm.test.ts | 4 +- src/frontend/lib/snapshotForm.ts | 6 +- src/frontend/lib/userText.test.ts | 92 ++ src/frontend/lib/viewerDepth.test.ts | 2 +- src/frontend/package-lock.json | 919 ++++++++++++------ src/frontend/package.json | 4 +- .../scripts/export-data-model-examples.ts | 21 + src/frontend/scripts/generate-models.ts | 16 +- tests/api/test_data_model_examples.py | 139 +++ tests/api/test_identity_routes.py | 3 +- tests/api/test_no_piece_in_user_text.py | 113 +++ tests/api/test_profile.py | 54 +- tests/api/test_stats_overview.py | 40 +- tests/api/test_vocab_descriptions.py | 59 ++ tests/catalog/test_limiter.py | 2 +- tests/fixtures/data_model_examples.json | 712 ++++++++++++++ 165 files changed, 6440 insertions(+), 1023 deletions(-) create mode 100644 src/frontend/app/reference/page.tsx create mode 100644 src/frontend/components/components/detail/AddEvidenceButton.tsx create mode 100644 src/frontend/components/reference/DataTable.tsx create mode 100644 src/frontend/components/reference/ModelDiagram.tsx create mode 100644 src/frontend/components/reference/Prose.tsx create mode 100644 src/frontend/components/reference/ReferenceTabs.tsx create mode 100644 src/frontend/lib/dataModelExamples.ts create mode 100644 src/frontend/lib/dataModelExport.ts create mode 100644 src/frontend/lib/dataModelRows.ts create mode 100644 src/frontend/lib/dataModelTabs.test.ts create mode 100644 src/frontend/lib/dataModelTabs.ts create mode 100644 src/frontend/lib/dataModelText.test.ts create mode 100644 src/frontend/lib/dataModelText.ts create mode 100644 src/frontend/lib/dataModelVocab.ts create mode 100644 src/frontend/lib/history/recordTarget.test.ts create mode 100644 src/frontend/lib/history/recordTarget.ts create mode 100644 src/frontend/lib/history/scrollToRecord.ts create mode 100644 src/frontend/lib/legalPage.ts create mode 100644 src/frontend/lib/pageView.ts create mode 100644 src/frontend/lib/propertiesEmpty.test.ts create mode 100644 src/frontend/lib/propertiesEmpty.ts create mode 100644 src/frontend/lib/safeCallback.test.ts create mode 100644 src/frontend/lib/safeCallback.ts create mode 100644 src/frontend/lib/sessionExpiry.test.ts create mode 100644 src/frontend/lib/sessionExpiry.ts create mode 100644 src/frontend/lib/userText.test.ts create mode 100644 src/frontend/scripts/export-data-model-examples.ts create mode 100644 tests/api/test_data_model_examples.py create mode 100644 tests/api/test_no_piece_in_user_text.py create mode 100644 tests/api/test_vocab_descriptions.py create mode 100644 tests/fixtures/data_model_examples.json diff --git a/.zenodo.json b/.zenodo.json index 95dbd376..a9228429 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,8 +1,8 @@ { - "title": "Catalog of Second Chances (CSC) - Digital Database and Corresponding Interfaces for ReUse of Architectural Components (v0.6.4.1)", - "version": "0.6.4.1", + "title": "Catalog of Second Chances (CSC) - Digital Database and Corresponding Interfaces for ReUse of Architectural Components (v0.6.4.2)", + "version": "0.6.4.2", "upload_type": "software", - "description": "

The Catalog of Second Chances (CSC) is a prototypical digital component database. It catalogs digital representations of uniquely identifiable architectural components for reuse. Furthermore, it provides corresponding interfaces and tools to leverage them via a backend REST-API, a web-frontend as well as a interface for direct interaction within Rhino Grasshopper.

Changes in v0.6.4.1 (2026-10-27)

Hardening: the MCP connector, the component page and dependencies.

Added

  • Search by evidence method: the catalog list takes evidence_method=<method> (one name of the evidence vocabulary, an unknown name is a 422) and keeps only pieces with at least one published, current record of that method, for example reinforcement_layout for the pieces with a reinforcement layout. It combines with every other filter, also with fit and near. The MCP tools search_components, catalog_overview and similar_components take it as has_evidence. A filter in Browse follows later.
  • A reinforcement layout in the viewer: the card of a reinforcement layout in the evidence list has \"Show in viewer\", for every status, so a submitted draft can be seen before it is published. The viewer opens the version the bars belong to and draws that layout on top of the published ones, which turn faint; the legend names it with its status, and an x takes it out again. The link can be sent on: whoever may not see the record gets a short note and no bars.

Changed

  • MCP connector: the server introduces itself as the Catalog of Second Chances, with a link to the website and an icon, and its instructions tell a chat to use these tools for reused building components before a web search (in English and German). Every tool has a title and is marked read-only, and the descriptions name the evidence methods.
  • MCP, reinforcement: get_component and get_version count the reinforcement layouts of the version from its evidence records (records, bars, diameters) instead of the old inline field, which always gave 0. In get_evidence a layout record carries a summary of its bars, and performed_by shows the organization.
  • Similar pieces: on a wide screen the card sits in the left rail below Provenance, with smaller tiles, three to a row, so it no longer pushes the evidence records down. On a narrow screen it keeps its place after Photos and location. \"Show more\" appears only when there are more than six similar pieces.
  • Statistics: the size facet of /identities/stats (bbxX) buckets the largest side of each piece in millimetres (0, 100, 250, 500, 1000, 2000, 5000, 10000 and more); the old edges came from the metre era and put nearly every piece in the last bucket. Pieces without a size are left out instead of counting as the largest.
  • Write model: creating or changing a version rejects the old inline field geometry.reinforcements; a reinforcement layout is an evidence record.

Security

  • E-mail verification accepts only the hashed token. The fallback to a token stored in plain text is gone (such tokens expired a day after 0.6.1.1); an account that is still unverified can ask for a new mail.
  • Dependencies: the frontend lockfile takes undici 7.30.1 and fast-uri 3.1.9 (one high, two medium and two low advisories; both come only through the development tool shadcn, the production install was not affected). The local import scripts move to Pillow 13.0.0.

Server notes

  • No step needed: no new setting, collection or index.
  • In claude.ai the connector can be renamed to \"Catalog of Second Chances\" (Settings, Connectors); the name the server gives itself is shown when it is added again.

Full history: CHANGELOG.md

", + "description": "

The Catalog of Second Chances (CSC) is a prototypical digital component database. It catalogs digital representations of uniquely identifiable architectural components for reuse. Furthermore, it provides corresponding interfaces and tools to leverage them via a backend REST-API, a web-frontend as well as a interface for direct interaction within Rhino Grasshopper.

Changes in v0.6.4.2 (2026-10-29)

Second hardening: the web app and the backend. The Grasshopper fixes follow in 0.6.4.3.

Added

  • Data Model page: /reference explains the data model for catalog users: the dataset, the component identity, its versions and the evidence records, how they relate, the rules of the model, the fields a user sees or fills in, every vocabulary with a short meaning per value, and one made-up concrete beam followed through all of them as an example, in seven tabs. It is public and linked in the sidebar next to Grasshopper. GET /vocab gives each vocabulary value a one-line description.
  • Browse, evidence method: a filter for elements with a published record of one evidence method, for example the elements with a reinforcement layout.
  • Profile, website of the organisation: the profile holds the website of the user's organisation (http or https). New evidence records copy it into the \"You\" performer, and \"Add my organisation\" in the performers field adds the organisation as a performer of its own.

Changed

  • History: a reinforcement layout in the History graph opens in the viewer, as \"Show in viewer\" does. A corrected record opens the corrected records before the page scrolls to it, and on another element the page scrolls once its records have loaded.
  • Viewer: with a reinforcement layout opened by its link, the diameter colours and their legend follow the bars of that layout.
  • Credits and imprint use the layout and text sizes of the privacy page.
  • Component page: the evidence card has its own \"Add evidence\" button, like the properties card, and the properties card explains with a \"?\" that its values come from the evidence. In the History graph, a group of one record opens that record with the first click.
  • Wording: a single building component is called an \"element\" in the web app, the mails, the API descriptions and the MCP connector, instead of \"piece\". The Grasshopper descriptions follow in 0.6.4.3.
  • Statistics: /identities/stats no longer returns the size facet bbxX, which no page showed.
  • An unknown evidence method or token scope gives a 422 on every server, also with an older Starlette.

Security

  • Session expiry on a component page: when the session ends, a page that shows more than an anonymous visitor may see (a private element, a draft or pending version, a record only the user may load) signs the user out and leads to the sign-in page, which returns to the same address. A public element stays readable and is shown again as an anonymous visitor sees it.
  • Sign-in: the return address after sign-in only accepts addresses on this site.
  • Dependencies: the development tool shadcn moves to 4.22.1, pinned exactly; no package in the lockfile was published after 2026-10-19. Two dev-only advisories of npm audit stay open, both through shadcn: body-parser (high; its fix came out on 2026-10-22) and deepmerge (low; no fix yet). The production install has none.

Server notes

  • No step needed: no new setting, collection or index. The profile field is optional.

Full history: CHANGELOG.md

", "creators": [ { "name": "Eschenbach, Max Benjamin", diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d43c277..98747280 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,57 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.4.2] - 2026-10-29 + +Second hardening: the web app and the backend. The Grasshopper fixes follow in 0.6.4.3. + +### Added + +- **Data Model page:** `/reference` explains the data model for catalog users: the dataset, the + component identity, its versions and the evidence records, how they relate, the rules of the + model, the fields a user sees or fills in, every vocabulary with a short meaning per value, and + one made-up concrete beam followed through all of them as an example, in seven tabs. It is public + and linked in the sidebar next to Grasshopper. `GET /vocab` gives each vocabulary value a one-line description. +- **Browse, evidence method:** a filter for elements with a published record of one evidence method, + for example the elements with a reinforcement layout. +- **Profile, website of the organisation:** the profile holds the website of the user's + organisation (http or https). New evidence records copy it into the "You" performer, and "Add my + organisation" in the performers field adds the organisation as a performer of its own. + +### Changed + +- **History:** a reinforcement layout in the History graph opens in the viewer, as "Show in viewer" + does. A corrected record opens the corrected records before the page scrolls to it, and on another + element the page scrolls once its records have loaded. +- **Viewer:** with a reinforcement layout opened by its link, the diameter colours and their legend + follow the bars of that layout. +- **Credits and imprint** use the layout and text sizes of the privacy page. +- **Component page:** the evidence card has its own "Add evidence" button, like the properties card, + and the properties card explains with a "?" that its values come from the evidence. In the History + graph, a group of one record opens that record with the first click. +- **Wording:** a single building component is called an "element" in the web app, the mails, the API + descriptions and the MCP connector, instead of "piece". The Grasshopper descriptions follow in + 0.6.4.3. +- **Statistics:** `/identities/stats` no longer returns the size facet `bbxX`, which no page showed. +- An unknown evidence method or token scope gives a 422 on every server, also with an older + Starlette. + +### Security + +- **Session expiry on a component page:** when the session ends, a page that shows more than an + anonymous visitor may see (a private element, a draft or pending version, a record only the user may + load) signs the user out and leads to the sign-in page, which returns to the same address. A + public element stays readable and is shown again as an anonymous visitor sees it. +- **Sign-in:** the return address after sign-in only accepts addresses on this site. +- **Dependencies:** the development tool `shadcn` moves to 4.22.1, pinned exactly; no package in the + lockfile was published after 2026-10-19. Two dev-only advisories of `npm audit` stay open, both through + `shadcn`: `body-parser` (high; its fix came out on 2026-10-22) and `deepmerge` (low; no fix yet). The + production install has none. + +### Server notes + +- No step needed: no new setting, collection or index. The profile field is optional. + ## [0.6.4.1] - 2026-10-27 Hardening: the MCP connector, the component page and dependencies. diff --git a/CONTEXT.md b/CONTEXT.md index 365dca89..07d2cfc8 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -1,6 +1,6 @@ # Catalog of Second Chances (CSC) -A research catalog of reclaimed building components: what each physical piece is, where it came +A research catalog of reclaimed building components: what each physical element is, where it came from, what state it is in, and what is known about it --- so it can be designed with and reused. ## Language @@ -8,8 +8,9 @@ from, what state it is in, and what is known about it --- so it can be designed ### Components and records **Component**: -A physical reclaimed building element the catalog tracks --- a beam, a panel, a lump of rubble. -_Avoid_: item, part +A physical reclaimed building element the catalog tracks --- a beam, a panel, a lump of rubble. In user-facing text a +single one is an "element" (not to be confused with a Grasshopper component). +_Avoid_: item, part, piece **Component identity**: The catalog's permanent record of one physical component, from its arrival to long after its exit. @@ -113,18 +114,18 @@ A user's hold on a component in circulation, signalling that they intend to use An installed, returned or lost component coming back with a new origin; the previous origin--exit cycle is archived. **Lineage**: -The split and merge relations between identities. Children inherit their parents' past --- origin, material, trade name, manufacture date, original function --- unless they state their own. +The split and merge relations between identities. Children inherit their parents' past --- origin, material, trade name, manufacturer, manufacture date, material separability, original function --- unless they state their own; in a merge, a unit is inherited only where all parents agree. **Batch**: -One identity standing for several homogeneous pieces --- same type, material and nominal size --- whose snapshot quantity is greater than one (the CPR word). +One identity standing for several homogeneous elements --- same type, material and nominal size --- whose snapshot quantity is greater than one (the CPR word). The single items of a batch are its elements. _Avoid_: lot, stack, group **Draw**: -Taking one or more pieces out of a batch as a child identity; the batch stays in circulation until nothing remains. +Taking one or more elements out of a batch as a child identity; the batch stays in circulation until nothing remains. _Avoid_: cut, split (a cut changes shape), take **Remaining**: -The pieces of a batch not yet drawn; derived, never entered. +The elements of a batch not yet drawn; derived, never entered. _Avoid_: stock, available ### Evidence and properties diff --git a/README.md b/README.md index f90a21c3..33998272 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ framework ## Current Versions -- **CSC**: 0.6.4.1 --- backend, web frontend and Grasshopper interface are released together - under one version (tag `v0.6.4.1`); the single source is the `VERSION` file. +- **CSC**: 0.6.4.2 --- backend, web frontend and Grasshopper interface are released together + under one version (tag `v0.6.4.2`); the single source is the `VERSION` file. See `CHANGELOG.md` for release notes. @@ -530,7 +530,7 @@ and a JWT does not work in place of it. ## Using CSC from Claude Claude can read the catalog as you: ask it to find components, show one with its -versions and measurements, compare, or look at what happened to a piece. It +versions and measurements, compare, or look at what happened to an element. It only reads, and it sees what you see on the website; nothing it can reach is private to anybody else. Administrators can connect it for now (the roles are `CSC_PAT_ROLES`). @@ -548,16 +548,16 @@ sent back to) before you press Allow, and press Deny when it is not the tool you just connected. **What it can do.** Ten read-only tools: `search_components` (the filters of -Browse and `has_evidence`, which keeps only pieces with a published, current +Browse and `has_evidence`, which keeps only elements with a published, current record of one evidence method, for example `reinforcement_layout` for "with -reinforcement", a page at a time), `catalog_overview` (how many pieces, counted +reinforcement", a page at a time), `catalog_overview` (how many elements, counted by material, original function, dataset, shape class and circulation, the range of each sorted side in millimetres, and how many have a location; it takes the same filters), `get_component` (with the reinforcement layouts of the current version as counts), `list_versions`, `get_version` (geometry as counts and a link, never the meshes; the reinforcement layouts of the version as counts), `get_evidence`, `list_datasets`, `get_dataset`, `get_timeline` and -`similar_components` (the pieces nearest in shape over the whole descriptor, not +`similar_components` (the elements nearest in shape over the whole descriptor, not on the two-dimensional similarity map, with their distance in standardised units; it takes the same filters, which apply before the ranking). Every answer carries the web link of the record, and a record that is not public is marked @@ -701,7 +701,7 @@ so the two heavy jobs never run together (server memory): the frequent geometry run skips its run while the lock is held, the nightly run and the map wait up to 15 minutes instead of losing their slot. A write that changes what the geometry stages read (a new version, a file, the geometry, the colour, -an override, the function of the piece) marks the snapshot (`derivation_due`); +an override, the function of the element) marks the snapshot (`derivation_due`); the frequent run derives only marked snapshots, the nightly run checks all of them (`main_geometry.py --due` / without it). @@ -848,7 +848,7 @@ which is the origin of abovementioned Catalog Explorer. ## Citing -When using, extending or building upon this piece of softare in your work, please reference it accordingly: +When using, extending or building upon this piece of software in your work, please reference it accordingly: ### BibTex diff --git a/VERSION b/VERSION index f4362155..adbb4a57 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.4.1 +0.6.4.2 diff --git a/docs/adr/DATA_MODEL_SPEC.md b/docs/adr/DATA_MODEL_SPEC.md index 66cd903a..21637460 100644 --- a/docs/adr/DATA_MODEL_SPEC.md +++ b/docs/adr/DATA_MODEL_SPEC.md @@ -44,7 +44,7 @@ landscape section 10.6. ``` Dataset ----------------------------- "which project" --- membership, roles, visibility (section 3.6) | - +-1:N-> ComponentIdentity ----------- "which physical piece" + +-1:N-> ComponentIdentity ----------- "which physical element" | original_function (IFC name), material (+ class, trade name) | origin / exit / past_cycles how it entered and left circulation (section 3.1.1, section 3.1.3) | parent_identities[] + inherited_fields split / merge lineage (section 3.1.2) @@ -123,7 +123,7 @@ IFC element-class **names only**. No IFC structure is imported. | `IfcBuildingElementProxy` | Unknown | function not known | | `CscDebris` | Debris | CSC extension: no prior function as a discrete element (rubble, aggregate) | -Semantics: **what the piece was** in its previous life. The reuse function is a design decision +Semantics: **what the element was** in its previous life. The reuse function is a design decision made in design tools outside CSC (decision 7.11) and is never recorded here. > CPR: the *declared use* (Art 3(22), Annex V 1(c)) is fixed by the manufacturer at placing on @@ -217,7 +217,7 @@ context is that snapshot into `snapshot.properties`). **Findings vs. overall grade (decision 7.9).** Findings (`spalling`, `cracking`, `corrosion`) are severities, 0 none ... 3 severe; the inspection form offers only those whose material group matches -the piece (section 2.10 `group`). `condition_grade` keeps the 0.5 direction (higher = better). The UI +the element (section 2.10 `group`). `condition_grade` keeps the 0.5 direction (higher = better). The UI **condition badge** = the snapshot's folded `condition_grade` if present, else `3 - max(finding severity)`; no inspection --> "not assessed". More material-specific findings (chipped edges, surface wear, rot, residue) are additive vocabulary rows --> deferred (6.8). @@ -243,8 +243,8 @@ precision is a legitimate, expected value for `origin.at`.) Applies to `manufact ### 2.8 `origin.kind` (identity) -How the piece entered circulation (section 3.1.1). The distinction matters regulatorily: only a -deinstalled piece can be a CPR *used product*; demolition output is waste until end-of-waste; +How the element entered circulation (section 3.1.1). The distinction matters regulatorily: only a +deinstalled element can be a CPR *used product*; demolition output is waste until end-of-waste; production residue is a by-product question, not a reuse one. | value | label | definition | regulatory reading | @@ -257,14 +257,14 @@ production residue is a by-product question, not a reuse one. ### 2.9 `exit.kind` (identity) -How the piece left circulation (section 3.1.3). +How the element left circulation (section 3.1.3). -| value | label | physical piece | terminal? | notes | +| value | label | physical element | terminal? | notes | |---|---|---|---|---| | `split` | Split | ceased to exist as this identity | yes | server-set when a child's first snapshot is published (8.8); children via lineage | | `merged` | Merged | ceased to exist as this identity | yes | server-set like `split` when the child has >1 parent (8.8) | | `installed` | Installed | exists, in a construction work | no --- re-entry allowed | reuse accomplished; `construction_work` optional (where it went). A later deinstallation starts a new CPR life (Art 3(53)) | -| `recycled` | Recycled | material recovered, not the piece | yes | crushed to aggregate, melted, ... | +| `recycled` | Recycled | material recovered, not the element | yes | crushed to aggregate, melted, ... | | `disposed` | Disposed | landfilled / waste | yes | | | `returned` | Returned | exists, left CSC custody | no | back to owner / supplier | | `lost` | Lost | unknown | no | whereabouts not recorded | @@ -344,7 +344,7 @@ judgement, noted in the table --- all are overridable (`material_class_source: a | `mixed` | Mixed / composite element | other | 17 09 04 | --- | | `unknown` | Unknown | other | 17 09 04 | --- | -Multi-material pieces (Annex IV 1.2(e) "main materials", plural) --> `secondary_materials[]`, +Multi-material elements (Annex IV 1.2(e) "main materials", plural) --> `secondary_materials[]`, **deferred** (additive, 6.8). Until then `material` is the main material. ### 2.11 Connections and circularity classes (decision 8.38) @@ -393,7 +393,7 @@ Conventions unchanged from 0.5: `_id` = UUID string; timestamps ISO-8601 UTC str "material_class": "17 01 01", "material_class_source": "derived" | "assigned", // section 2.10 --- EU List of Waste ch. 17 "trade_name": "..." | null, // section 2.10 --- brand / product name (e.g. "Corian") "manufacturer": "..." | null, // free text (DIN SPEC 91484 Table 2); inheritable (8.38) - "connection_features": "..." | null, // anchors, cast-in plates, holes on the piece itself (8.38); not inherited + "connection_features": "..." | null, // anchors, cast-in plates, holes on the element itself (8.38); not inherited "material_separability": { "class": "", "assessed_by": [ /* actor */ ], "note": "..." | null } | null, // section 2.11; inheritable // CPR: "main materials used" --- Annex IV 1.2(e); input to product family (Annex VII) "dataset": "beyond_debris", // FK --> datasets._id (section 3.6); no longer a free string @@ -458,7 +458,7 @@ Added: `original_function`, `material_class(+_source)`, `trade_name`, `manufactu `past_cycles`, `inherited_fields`, `inherited_from`, `withdrawn`, `properties`, `properties_version`, `created_by_user_id`. -#### 3.1.1 `origin` --- how the piece entered circulation +#### 3.1.1 `origin` --- how the element entered circulation One block per identity, describing its **latest** origin: the event that took it out of its previous context (a building, a demolition, a production line, a stock) and made it available @@ -468,16 +468,16 @@ mixed an organisation, an address, a place and a stray note in one string. | field | meaning | applies to `kind` | |---|---|---| | `kind` | section 2.8 --- decides which regulatory reading applies | all | -| `at` / `at_precision` | when the piece left its previous context (deinstalled, recovered from demolition, cut off, taken from stock). Precision per section 2.7; `year` is legitimate (CE mark carries the year only, CPR Art 18(2)(a)) | all | +| `at` / `at_precision` | when the element left its previous context (deinstalled, recovered from demolition, cut off, taken from stock). Precision per section 2.7; `year` is legitimate (CE mark carries the year only, CPR Art 18(2)(a)) | all | | `place` | where that happened: `name`, postal `address`, optional `location` | all | | `construction_work` | the **works** it left --- never the company (that is `performed_by`). CPR Art 3 sense: "buildings and civil engineering works ... including ... roads, bridges, tunnels". `name` (e.g. "Lichtwiese Campus Infrastructure --- pedestrian bridge"), `use` (e.g. "pedestrian bridge"), `year_built`; `identifier` is free-form now, intended for a digital-building-logbook or cadastral id (EPBD, section 10.6) | `deinstallation`, `demolition` only (I16) | -| `position_in_work` | where in the works the piece sat (floor, axis, element mark); a drawing goes in as an `archival_document` (8.38) | `deinstallation`, `demolition` | +| `position_in_work` | where in the works the element sat (floor, axis, element mark); a drawing goes in as an `archival_document` (8.38) | `deinstallation`, `demolition` | | `connection_types` | how it was fixed in the works (section 2.11) | `deinstallation`, `demolition` | | `detachability` | DGNB class of how it could be released from the works, with who assessed it (section 2.11) | `deinstallation`, `demolition` | | `method` | free text: how it was deinstalled / recovered --- the Art 21(3) "process of deinstalling" | all; expected for `deinstallation` | | `performed_by` | actors (section 3.3.1): deinstaller, demolition contractor, fabricator that produced the offcut, stockist | all | | `notes` | anything that fits nowhere else | all | -| `planned` | `true` while the piece is **in place**: identified in its works, not yet deinstalled; `at` is then the planned date or null. Cleared by the deinstall act (section 3.1.6, decision 8.104) | `deinstallation`, `demolition` | +| `planned` | `true` while the element is **in place**: identified in its works, not yet deinstalled; `at` is then the planned date or null. Cleared by the deinstall act (section 3.1.6, decision 8.104) | `deinstallation`, `demolition` | `origin` is `null` only on identities created without any provenance; migration never produces `null` (it writes `kind: unknown`). CPR export: Annex V 1(h) is filled from `origin` **iff** @@ -486,7 +486,7 @@ mixed an organisation, an address, a place and a stray note in one string. #### 3.1.2 Lineage inheritance (split / merge children) -A cut does not change a piece's past. The **inheritable fields** --- `origin`, +A cut does not change an element's past. The **inheritable fields** --- `origin`, `manufactured_at` + `manufactured_precision` (one unit), `material` + `material_class` + `material_class_source` (one unit, decision 8.32), `trade_name`, `manufacturer`, `material_separability` (8.38), `original_function` --- are @@ -509,15 +509,15 @@ materialized on the child by the **server**, never copied by clients. `dataset` - Same pattern as property inheritance (section 4.4, decision 2.4) and `shape_class_source`: flat, queryable fields that cannot go stale because the server owns the propagation. -#### 3.1.3 `exit` --- how the piece left circulation +#### 3.1.3 `exit` --- how the element left circulation -The counterpart of `origin`. `exit == null` means the piece is in the catalogue's circulation -(available, reservable). Replaces 0.5 `consumed_at`, which conflated a piece that no longer +The counterpart of `origin`. `exit == null` means the element is in the catalogue's circulation +(available, reservable). Replaces 0.5 `consumed_at`, which conflated an element that no longer exists (split, recycled) with one that exists elsewhere (installed, returned). - **Split / merge are server-derived from published children (decision 8.8).** Creating a child (an identity with `parent_identities`) changes nothing on the parent: while the child's v0 is a - draft or pending, the parent stays in circulation and shows "a cut from this piece is awaiting + draft or pending, the parent stays in circulation and shows "a cut from this element is awaiting review". **Publishing the child's first snapshot** sets each parent's `exit = {kind: split | merged, at: , recorded_by_user_id: null}` (`merged` when the child has >1 parent) and clears the parent's reservation. **Not for a batch**: a draw only lowers `remaining`; the batch's `split` follows at `remaining == 0` (section 3.1.6). The server @@ -525,7 +525,7 @@ exists (split, recycled) with one that exists elsewhere (installed, returned). such child **identity** (the cut was recorded by mistake) clears the server-set exit. Withdrawing a child's *snapshot* does not: a child counts once it has ever been published (a `published` or `withdrawn` snapshot, the 8.9 test), because the cut happened. A client-set `split` without catalogued children is - legal ("cut up, pieces not recorded") and is never touched by this rule. + legal ("cut up, elements not recorded") and is never touched by this rule. - **Which parents can be cut (decision 8.34)**: published, not withdrawn, and either in circulation or already split / merged. `installed` / `returned` / `lost` parents re-enter first; `recycled` / `disposed`, withdrawn and unpublished parents are refused (409). Checked at @@ -534,15 +534,15 @@ exists (split, recycled) with one that exists elsewhere (installed, returned). authored exit is ever overwritten. - **Everything else is authored**: `POST /identities/{id}/exit` (`moderator(D)`, section 7.0) with the block. `construction_work` only for `kind == installed` (I18). -- **Re-entry** (an `installed` or `returned` piece comes back, e.g. from a temporary pavilion): +- **Re-entry** (an `installed` or `returned` element comes back, e.g. from a temporary pavilion): `POST /identities/{id}/reenter` with a new `origin`. The server appends `{origin, exit}` to `past_cycles`, clears `exit`, writes the new `origin`. Evidence dated inside an archived gap resolves to `after_exit` (section 4.1); the next snapshot defaults to the new `origin.at` (8.19). `split`, `merged`, `recycled`, - `disposed` are terminal --- re-entry is rejected (the physical piece no longer exists as this + `disposed` are terminal --- re-entry is rejected (the physical element no longer exists as this identity). `past_cycles` is never client-writable. -- **Reservation** is only possible with `exit == null` (0.5 rule, unchanged); in-place pieces can be reserved (8.104). +- **Reservation** is only possible with `exit == null` (0.5 rule, unchanged); in-place elements can be reserved (8.104). - **Exit from in place** (8.104): `recycled`, `disposed`, `lost` are allowed while `origin.planned`; `installed`, - `returned` are refused (409), since the piece never left its works. + `returned` are refused (409), since the element never left its works. - **Batches** (8.105): a drawn child does not split its batch; the batch gets the server-set `split` only when `remaining` reaches 0 (section 3.1.6). @@ -550,7 +550,7 @@ exists (split, recycled) with one that exists elsewhere (installed, returned). **In place.** `origin.planned == true`. Counts as in circulation (`exit == null`): listed by default with a badge, reservable. Circulation filter: `active` (no exit) with the sub-values `in_place` (`origin.planned`) and -`deinstalled` (not planned; web label "Not in place", since it also holds offcuts, surplus and unknown origins, 8.115), and `exited`. The v0 of an in-place piece starts at its survey date, not at `origin.at`. +`deinstalled` (not planned; web label "Not in place", since it also holds offcuts, surplus and unknown origins, 8.115), and `exited`. The v0 of an in-place element starts at its survey date, not at `origin.at`. **Deinstall** --- `POST /identities/{id}/deinstall {at, at_precision, method?, performed_by?, notes?, kind?}`, `moderator(D)`: sets `planned: false`, writes the given fields into the existing origin (`kind` may switch @@ -559,7 +559,7 @@ reservable. Circulation filter: `active` (no exit) with the sub-values `in_place evidence valid time lies after `at`, and only when `at` is set and the latest origin change was the deinstall act (else 409; a moderator PATCHes the origin; 8.115). CPR Annex V 1(h) is filled only when `kind == deinstallation` and not planned (section 10.3). -**Batch.** An identity whose current snapshot has `quantity > 1`: homogeneous pieces (same type, material, nominal +**Batch.** An identity whose current snapshot has `quantity > 1`: homogeneous elements (same type, material, nominal size; one proxy describes each). `snapshot.quantity` is the recorded batch size and stays frozen. `remaining = quantity - sum(quantity of the published children drawn from it)` is derived and served on the identity read. **Draw** = creating a child with the batch as its only parent and a `quantity` <= `remaining` (else @@ -572,7 +572,7 @@ whole-identity: to hold part of a batch, draw a sub-batch; while a batch is rese the batch's `quantity`; a correction may change it, but not below the drawn sum (I32). The `remaining` check is atomic, so concurrent draws cannot overdraw. **Deinstalling a batch** (or any parent) propagates like a parent PATCH of `origin` (section 3.1.2) to the descendants that still inherit `origin`, and each child's timeline -records it; a piece deinstalled on its own owns its origin and is not touched. Undo propagates the same way +records it; an element deinstalled on its own owns its origin and is not touched. Undo propagates the same way (decision 8.110). **The moment of the cut** is the child's first snapshot's `effective_from` (valid time, section 4.1). @@ -619,11 +619,11 @@ The tombstone body (every JSON read of the record answers 200 with it; file rout Version lists and the lineage graph show a withdrawn snapshot outside D as a bare row (version, dates, `status: withdrawn`, no name); the passport leaves it out. -**Implementation notes (P3).** Withdrawing a piece that other withdrawn pieces name as their +**Implementation notes (P3).** Withdrawing an element that other withdrawn elements name as their `duplicate_of` needs a `duplicate_of` of its own, and those followers are re-pointed to it (I19 stays flat); without one the request is refused (409). Purge (`DELETE /identities/{id}?purge=1`, -`DELETE /snapshots/{sid}?purge=1`; admin; body `{confirm_id, reason}`) refuses a piece that other -pieces name as parent or `duplicate_of`, and the current snapshot (promote or withdraw first); it +`DELETE /snapshots/{sid}?purge=1`; admin; body `{confirm_id, reason}`) refuses an element that other +elements name as parent or `duplicate_of`, and the current snapshot (promote or withdraw first); it writes one `purged_records` stub per removed id (identity, its snapshots, its evidence). #### 3.1.5 Unpublished identity (decision 8.9) @@ -700,7 +700,7 @@ Migration: `created_by_user_id` = the `added_by_user_id` of the identity's v0 (s "photo_count": 0, "mesh_ply_resolutions": { "0": ["reduced", "detailed"] }, "point_cloud_files": [0], // DERIVED, 0.6.2: the indices of `geometry.point_clouds` whose full cloud is stored as a file (`point_clouds//.ply`); set by the upload route, removed by the delete route; absent on versions uploaded before 0.6.2 (8.148) - "derivation_due": "...", // DERIVED, optional: a timestamp set by every write that changes a stage input (a new version or correction, a PLY upload or removal, a PATCH of `geometry`, `color`, `shape_class` or `complexity`, a change of the piece's `original_function`); the frequent geometry cron (`main_geometry.py --due`) reads only marked snapshots (partial index) and unsets it after a run without errors if it still holds the value read; not in the etag, not in the change log (8.136) + "derivation_due": "...", // DERIVED, optional: a timestamp set by every write that changes a stage input (a new version or correction, a PLY upload or removal, a PATCH of `geometry`, `color`, `shape_class` or `complexity`, a change of the element's `original_function`); the frequent geometry cron (`main_geometry.py --due`) reads only marked snapshots (partial index) and unsets it after a run without errors if it still holds the value read; not in the etag, not in the change log (8.136) "etag": "...", "created": "...", "lastmodified": "..." // CPR: etag = integrity hash --- Art 78(h) } ``` @@ -769,7 +769,7 @@ until it is resubmitted as a draft (decision 8.18; same for evidence). | class | fields | before publish | after publish | |---|---|---|---| -| **frozen** --- claims about the piece's state | inline `geometry.*` (meshes, point_clouds, authored proxies); mesh + point-cloud PLY files; `capture` except `capture.notes` (incl. fixture files); `fragment`, `quantity` | author / `moderator(D)` | never in place --> correction (below) | +| **frozen** --- claims about the element's state | inline `geometry.*` (meshes, point_clouds, authored proxies); mesh + point-cloud PLY files; `capture` except `capture.notes` (incl. fixture files); `fragment`, `quantity` | author / `moderator(D)` | never in place --> correction (below) | | **overrides** | `shape_class` / `complexity` set by hand (`*_source: assigned`) | author / `moderator(D)` | `moderator(D)` in place (8.3); never overwritten by a recompute | | **derived** --- server only | `descriptors`, fitted proxies + `deviation_maps`, `shape_class` / `complexity` when `derived`, `properties`, `frame`, `bbx`, previews, `mesh_ply_resolutions`, `point_cloud_files` | server | server, any time (crons, recompute routes). **Never accepted from a client** --- `descriptors` leaves `UpdateComponentSnapshotModel` | | **mutable metadata** | `name`, `notes`, `location`, `color`, `photo_credit` (8.128) | author / `moderator(D)` | `moderator(D)` in place | @@ -804,12 +804,12 @@ the capture but is **not the component** out of `geometry`: coordinates of an authored or hand-oriented model. Not to be confused with the snapshot's derived `frame`, the canonical orientation (section 4.3). - `markers` --- labelled reference points: `role: rig` (fixed on the capture rig, e.g. the four - blue markers of the DDU gripper) or `role: component` (stuck on the piece, e.g. green markers). -- `fixtures` --- meshes captured together with the piece that are not part of it (the gripper that + blue markers of the DDU gripper) or `role: component` (stuck on the element, e.g. green markers). +- `fixtures` --- meshes captured together with the element that are not part of it (the gripper that held a stone during scanning), one PLY each under `capture//fixtures/`. No derivation (section 4.3) ever reads markers or fixtures, and they never satisfy I1. The 0.5 -convention "`meshes[0]` is the piece, anything else is whatever" (descriptors read only index 0) +convention "`meshes[0]` is the element, anything else is whatever" (descriptors read only index 0) ends: every entry of `geometry.meshes` / `point_clouds` is the component. ### 3.3 `component_evidence` @@ -996,7 +996,7 @@ Every list query defaults to `superseded_by: null`; `?include=superseded` lifts ### 3.4 `designs` --- removed (decision 7.11) -CSC records pieces, not designs. Evaluating a design built from catalog components happens in GH +CSC records elements, not designs. Evaluating a design built from catalog components happens in GH on fetched passports; published, editable designs belong in tools built for that (e.g. Speckle). The `designs` collection, its routes, the web `/designs` pages and the GH design components go. @@ -1025,7 +1025,7 @@ bytes. **Photo metadata (decision 7.13)** --- for snapshot photos and evidence images alike, the upload pipeline removes the EXIF GPS block, owner / artist and body serial number, and keeps orientation, -capture time (`DateTimeOriginal`) and camera make / model. Where a piece is stays the snapshot's +capture time (`DateTimeOriginal`) and camera make / model. Where an element is stays the snapshot's chosen `location`, never the photo's GPS. New env vars: `SNAPSHOT_PROXIES_DIR` (the `proxies/` folder above) and `SNAPSHOT_CAPTURE_DIR` @@ -1062,7 +1062,7 @@ policy: the merge pattern is removed; `datasets` and `materials` are collections disabled) may create a dataset with `POST /datasets` (name; the `_id` slug is derived from the name, made unique with a numeric suffix, and immutable). The creator becomes `moderator` and `contributor` of it; the dataset starts `visibility: members` and `reviewed: false`. A dataset that is not reviewed -cannot be `catalog`, and no piece of it can be made public (the metadata PATCH, the create with +cannot be `catalog`, and no element of it can be made public (the metadata PATCH, the create with `is_public`, `POST /datasets/{did}/public`; the dry run still answers) until an admin sets `reviewed: true` with `PATCH /datasets/{did}` (the only admin-only field; 409 otherwise). The reviewed flag is not a member right: admins pass the gate. Datasets created by an admin, and every dataset that @@ -1071,7 +1071,7 @@ documents without it). A non-admin may create `CSC_MAX_DATASETS_PER_USER` datase counted by `created_by_user_id`; admins are not limited; 403 beyond). The last `moderator` of a dataset cannot be removed or demoted with `PUT /datasets/{did}/members/{user_id}` (409; an admin may). A dataset is deleted with `DELETE /datasets/{did}` by `moderator(D)` or an admin, **only while it holds -no identity** (409 with the count otherwise, for admins too: move the pieces first, section 7.0); +no identity** (409 with the count otherwise, for admins too: move the elements first, section 7.0); open invitations to it are revoked. Creating a dataset mails the admins ("Dataset created"); a mail failure never blocks the create. @@ -1089,11 +1089,11 @@ An anonymous caller never receives a person: responses on the public tier carry As one predicate: `admin or member(D) or (logged_in and D.visibility == catalog) or is_public`. Unpublished records: section 7.0. -**The public flag in the web (decision 8.131).** `is_public` is set per piece with the ordinary +**The public flag in the web (decision 8.131).** `is_public` is set per element with the ordinary metadata PATCH (`moderator(D)`, or the creator while unpublished, 8.9; the "Public" switch in "Edit details") and for a whole dataset with `POST /datasets/{did}/public` (`moderator(D)`): it sets the -flag on the dataset's pieces that were ever published (3.1.5) and are not withdrawn, where it -differs, and logs each change like a metadata PATCH. No piece follows another: children never +flag on the dataset's elements that were ever published (3.1.5) and are not withdrawn, where it +differs, and logs each change like a metadata PATCH. No element follows another: children never inherit the flag (6.2). ### 3.7 `users` changes @@ -1204,7 +1204,7 @@ their own `status_history` (8.30); derived fields (`properties`, `frame`, proxie `orcid` inside `old` / `new` values. - **Purge** (section 3.1.4) deletes the record's entries with the record. - The migration writes no entries: history starts at cutover (`cause: migration` is for later - data-repair scripts). `reserved` is not logged --- a booking, not a fact about the piece; + data-repair scripts). `reserved` is not logged --- a booking, not a fact about the element; `current_snapshot_id` is (promote / fallback, cause `patch`). - Indexes: `(record_id, at)`, `(identity_id, at)`. @@ -1222,18 +1222,18 @@ existing product's passport, Art 76(1), 75(2)(e) --- the snapshot chain *is* tha - Set when the snapshot is created: now, or the author's value for a state that began earlier (the snapshot form, section 7.6). A correction inherits its predecessor's (section 3.2.2). -- **Default for v0 (decision 8.10):** `origin.at` with its precision when known --- the piece is +- **Default for v0 (decision 8.10):** `origin.at` with its precision when known --- the element is assumed unchanged since it left its previous context; else `capture.captured_at`; else `created`. A child's v0 (cut from a parent) starts at the cut: `created` or the author's date --- never the parent's inherited `origin.at`. Later versions: now or the author's date; the first snapshot - after a **re-entry** defaults to the new `origin.at` (8.19). The v0 of an **in-place** piece (`origin.planned`, section 3.1.6) starts at its survey date (the author's date, else `capture.captured_at`, else `created`), never at the planned `origin.at` (8.104). + after a **re-entry** defaults to the new `origin.at` (8.19). The v0 of an **in-place** element (`origin.planned`, section 3.1.6) starts at its survey date (the author's date, else `capture.captured_at`, else `created`), never at the planned `origin.at` (8.104). - **Evidence outside the snapshot history** (8.10): resolution `before_first` (e.g. an inspection - while the piece was still installed) or `after_exit` (e.g. inspected in the building it went + while the element was still installed) or `after_exit` (e.g. inspected in the building it went into) feeds no snapshot's `properties` --- no snapshot records that state. The record belongs to the identity like all evidence (I5): identity-scoped quantities fold from it as from any evidence, and every record --- of either scope --- is listed on the identity page and the timeline under "before cataloguing" / "after leaving circulation". **Archived cycles count too (8.19):** - a date between a `past_cycles[k].exit.at` and the next cycle's `origin.at` (the time the piece + a date between a `past_cycles[k].exit.at` and the next cycle's `origin.at` (the time the element was installed elsewhere, returned or lost before it re-entered) also resolves to `after_exit`. - After publish, `moderator(D)`-editable via `PATCH /snapshots/{sid}` (section 7.1) --- decision 6.6. - Always set: there are no virtual snapshots (decision 7.12). @@ -1273,9 +1273,9 @@ elif boxscore > T_IRREGULAR: irregular # hull << OBB: pocke else: block ``` -Elongation is tested before the hull score (decision 8.56): a clearly elongated or flat piece +Elongation is tested before the hull score (decision 8.56): a clearly elongated or flat element is linear or planar even when its hull is uneven (zirkus timber, aggregations); only the -remaining compact pieces can be irregular. A piece that passes both tests takes the class of +remaining compact elements can be irregular. An element that passes both tests takes the class of its stronger elongation (decision 8.58): a long thin strip (e1/e2 3.3, e2/e3 25) is planar, a batten or board (e1/e2 20, e2/e3 5) linear. @@ -1290,7 +1290,7 @@ override writes `"assigned"` and is not overwritten by recompute. Setting the ov ### 4.2b Complexity --- `complexity.py` (decision 6.15) Ordinal 0--3 (0 simple, 1 normal, 2 complex, 3 very complex). Inputs: primary-proxy residual -`p95_mm / e1` (how far the piece departs from its proxy), `boxscore` (hull concavity), and +`p95_mm / e1` (how far the element departs from its proxy), `boxscore` (hull concavity), and `shape_class == composite` => >= 2. Thresholds tuned by the same script as section 4.2 against the **71 `beyond_debris` (0.5: `sas_cita_scans`) ratings, which are authored per element** (user) --- the only genuine labels; confusion table part of the deliverable. **Frozen 2026-10-02 (decision 8.59):** residual @@ -1338,13 +1338,13 @@ any change of an upstream result --- a recompute, a moderator override of `shape stale and they rerun; no stage order can loop. Authored proxies are never refitted but still feed stage 1--2 (frame from the authored primitive). -**The frame (stage 1, decision 7.10)** is the piece's standard orientation and size, used by GH +**The frame (stage 1, decision 7.10)** is the element's standard orientation and size, used by GH (`ApplyFrame`, filters, arrangement), the web filters and columns, the component map, the descriptors and the shape class. It is **not a proxy**: 1. Minimum-volume oriented bounding box of all component geometry (meshes, clouds, authored primitives' surfaces; never `capture` markers / fixtures) --- `trimesh.bounds.oriented_bounds`. - Edge-aligned for box-like pieces; vertex PCA is not used (it lands on diagonals when two + Edge-aligned for box-like elements; vertex PCA is not used (it lands on diagonals when two extents are similar or vertex density is uneven). 2. Axes by extent: **longest --> x, middle --> y, shortest --> z** (lying on its largest face); **`original_function == IfcColumn` and longest >= 2 x middle extent: longest --> z, middle --> @@ -1361,7 +1361,7 @@ descriptors and the shape class. It is **not a proxy**: differ by a 180 degree flip). `frame.o` = box centre; `bbx` = extents along x / y / z. 4. **Never upside down against the input (decision 8.53).** Before step 3's `trace(R)`: when the canonical z of a candidate lies within 60 degrees of the stored z axis (|z . Z| >= 0.5), only - candidates with `z . Z > 0` are valid --- the piece keeps the input's up direction. Step 3 + candidates with `z . Z > 0` are valid --- the element keeps the input's up direction. Step 3 then decides among the rest. The frame report (rehearsal, tuning tables) lists every snapshot whose canonical z points against stored z (`z . Z < 0`) and every axis-order change against 0.5, for review. @@ -1420,12 +1420,12 @@ on the mesh topology and never on the convex hull: 1. Sample: meshes and authored primitives area-uniformly; point clouds thinned to the same size; fixed seed; all component geometry, never `capture` markers / fixtures (I23). 2. 64 non-zero eigenpairs of `L phi = lambda M phi`; time grid **fixed in area-normalised units** - (one grid for the catalogue, not per shape), so values compare across pieces. + (one grid for the catalogue, not per shape), so values compare across elements. 3. Per-point HKS, mass-weighted mean + variance pooling, L2-normalised (as in `hks_features.py`). Intrinsic, so it needs no frame (8.1). Why points: in the 260916 probe every mesh failure came from a mesh in disconnected pieces (scan islands; unmerged seams) --- the sample never failed (169 / 169) -and ranks pieces like the intact mesh (rho 0.98); the hull always works but describes the envelope +and ranks elements like the intact mesh (rho 0.98); the hull always works but describes the envelope only (rho 0.34). Errors raise and are recorded by the runner; `HKS_VERSION` versions the result. ### 4.4 Property fold --- `properties.py` @@ -1610,7 +1610,7 @@ role)`; the frontend merely hides controls. `admin` passes every check. D = the | move identity D1 --> D2 | `moderator(D1) and moderator(D2)` | | set evidence `verification` | `self_attested` / back to `unverified`: the recorder, unless a reviewer set the state; `reviewed` / `accredited` / any downgrade: `reviewer(D)` or `admin`, never the recorder or a `performed_by` user (8.12, I27) | | supersede published evidence | `contributor(D)` (new record enters `pending`) | -| reserve | any authenticated user who can read the piece, while it is not reserved | +| reserve | any authenticated user who can read the element, while it is not reserved | | release | the reserving user, or `moderator(D)` (as 0.5) | | manage D's members, D's `visibility` / `name` / `description` | `moderator(D)` | | invite a user (8.14); add a member by exact email (8.20) | `admin` (any dataset, or none); `moderator(D)` (into D only) | @@ -1725,7 +1725,7 @@ Decision 8.11: | request | header | |---|---| | any write (POST / PUT / PATCH / DELETE), and any request with a login token | required: known client, version >= minimum, else **426 Upgrade Required** with a body naming the fix ("update via CSC_Update" / "reload the page") | -| anonymous GET / HEAD | optional --- the `/id/{uuid}` resolver, public pieces, curl / Python readers | +| anonymous GET / HEAD | optional --- the `/id/{uuid}` resolver, public elements, curl / Python readers | | a known client below its minimum | **426**, always | Exempt: CORS preflight (`OPTIONS`), `/ghinterface/*` (the updater), `/docs`, `/redoc`, @@ -1744,10 +1744,10 @@ GET /id/{uuid} frontend route AND API route, permanent --- never renamed, n tombstone page / JSON (members of D: the full record, 8.17); `current_snapshot_id == null` --> the component page with "no current state"; purged --> **410**; unknown --> 404 --- except for a signed-in caller with `contributor` in some dataset: the page "this tag is not in the catalog - yet" with *New component* and *Cut from pieces* (the snapshot form, section 7.6; decision 8.87). -- Visibility rules (section 3.6) apply after the redirect. A piece the viewer cannot see does - **not** hide behind a 404 (decision 8.11) --- whoever scans a tag holds the piece: anonymous --> - a page "this component is not public" with a sign-in link (callback to the piece); logged in + yet" with *New component* and *Cut from elements* (the snapshot form, section 7.6; decision 8.87). +- Visibility rules (section 3.6) apply after the redirect. An element the viewer cannot see does + **not** hide behind a 404 (decision 8.11) --- whoever scans a tag holds the element: anonymous --> + a page "this component is not public" with a sign-in link (callback to the element); logged in without access --> "you have no access to this component", without dataset details. - Scanners (`identify`, `locate-by-id`, `transmit-id`, GH) accept a raw UUID **or** any URL whose last path segment is a UUID --- so a future URL-bearing tag works with no code change. @@ -1762,9 +1762,9 @@ one `POST /evidence/bulk`: | shortcut | what it does | typical use | |---|---|---| -| fan-out | one submission --> several atomic records (rule 1.3) | 3 rebound test areas on one piece; one visual inspection noting spalling, cracking, corrosion | -| repeat from my last record | instrument, performers, standard, lab details prefilled from the user's latest record of the same method in the same dataset; dates default to now; readings / results always start empty | the next piece of a site survey; the next core from the same lab report | -| apply to several pieces | one claim --> one record per selected piece | an archival drawing or datasheet covering a whole batch of elements | +| fan-out | one submission --> several atomic records (rule 1.3) | 3 rebound test areas on one element; one visual inspection noting spalling, cracking, corrosion | +| repeat from my last record | instrument, performers, standard, lab details prefilled from the user's latest record of the same method in the same dataset; dates default to now; readings / results always start empty | the next element of a site survey; the next core from the same lab report | +| apply to several elements | one claim --> one record per selected element | an archival drawing or datasheet covering a whole batch of elements | Field explanations are "?" popovers (tap on touch, hover/focus on desktop); their text is the payload field descriptions served by `/evidence/methods` and `/schema/evidence`, never a @@ -1797,7 +1797,7 @@ capture, location, dimension inputs) --- reached from four places: | entry point | reached from | creates | |---|---|---| | new component | scan an unused tag (`/id/{uuid}`, section 7.5); `/add-component` | identity + v0 | -| cut from ... | scan an unused tag, then the parent's tag(s); "Cut a piece from it" on the parent's page | child identity; server inherits (section 3.1.2); publishing its v0 sets the parents' `exit` split / merged (section 3.1.3, 8.8) | +| cut from ... | scan an unused tag, then the parent's tag(s); "Cut an element from it" on the parent's page | child identity; server inherits (section 3.1.2); publishing its v0 sets the parents' `exit` split / merged (section 3.1.3, 8.8) | | record new state | component page | next version, `effective_from` = now unless set; only for a changed **shape** --- damage without shape change is evidence | | correct | a published snapshot | superseding snapshot (section 3.2.2), prefilled, geometry kept unless dimensions are re-entered, same `effective_from` | @@ -1820,7 +1820,7 @@ DELETE /datasets/{did} moderator(D) | admin: only wh GET /users/me the caller: username, full_name, email, role, memberships, moderated_datasets, profile (organization, organization_ror, orcid, default_role) PATCH /users/me the caller: full_name, organization, organization_ror, orcid, default_role; 422 names a bad field (8.133) PUT /datasets/{did}/members/{user_id} moderator(D): body = {roles: [...]}; empty set = remove; the last moderator cannot be removed or demoted (409, except by an admin) -POST /datasets/{did}/public moderator(D): body = {is_public, dry_run?}; every published, not withdrawn piece of D public / private; --> {changed, skipped} (8.131); all pieces are validated first, one that fails stops the call with a 422 that names it (nothing written); refused 409 on a dataset that is not reviewed (8.139) +POST /datasets/{did}/public moderator(D): body = {is_public, dry_run?}; every published, not withdrawn element of D public / private; --> {changed, skipped} (8.131); all elements are validated first, one that fails stops the call with a 422 that names it (nothing written); refused 409 on a dataset that is not reviewed (8.139) POST /datasets/{did}/members moderator(D): body = {email, roles}; exact match --> added + notified, no account --> invitation (8.20) GET /users/search?q= admin: prefix search over username, name, email (member editor lookup, 8.20) GET /users admin: + memberships per user; ?q= ?dataset= ?dataset_role= ?no_dataset=1 ?role= ?state=enabled|disabled|unverified ?invited=1 (8.21) @@ -1854,7 +1854,7 @@ GET /identities/{id}/export/pdf the human-readable passport s The photo credit of the current snapshot (`photo_credit`, 8.128) is exported: JSON-LD carries `photo_credit` as `csc:photoCredit` with its `text` (`csc:text`) and, where the credit has one, its `url`; the PDF passport prints it in the state block as "Photo credit" (a (c) in the text becomes the -copyright sign; the link only for http / https). A piece without a credit exports neither. +copyright sign; the link only for http / https). An element without a credit exports neither. All three read what the component read returns for the caller (section 3.6): the public tier for a public viewer, people named in evidence only for members (8.13). The storage is unchanged --- @@ -1886,7 +1886,7 @@ ontologies sit at the boundary (`ONTOLOGIES.md`). GET /identities/{id}/history?depth=1|2&expand=groups|all the lanes and events of a component and its relatives ``` -The piece is the middle lane (level 0), its parents lie above (negative levels), its children below +The element is the middle lane (level 0), its parents lie above (negative levels), its children below (positive); `depth` = generations in each direction (default 1, max 2; 422 beyond). Read access as the component read (401 / 403 / 404 as there). Only projections of the documents are read. @@ -1905,9 +1905,9 @@ the component read (401 / 403 / 404 as there). Only projections of the documents "more": 0 } // lanes left out beyond twelve (MAX_LANES) ``` -- **Lanes.** The piece first, then by distance (parents before children, then catalog number); +- **Lanes.** The element first, then by distance (parents before children, then catalog number); at most 12 lanes, the rest only as `more`. A relative the caller may not see is a stub (`visible: - false`, no content), and the walk does not continue through it. A withdrawn piece the caller sees + false`, no content), and the walk does not continue through it. A withdrawn element the caller sees only as a tombstone (8.17) is a stub with `withdrawn: true`, `withdrawn_at` and `catalog_number`. A link is listed only where both lanes are kept: `cut` = the child has one parent, `assemble` = it has several (split / merge, 8.8); its place in time is the child's first version (a correction keeps @@ -1920,7 +1920,7 @@ the component read (401 / 403 / 404 as there). Only projections of the documents `expand=all`: one event per record with `id`, `method`, `status`, `quantity`, `corrected`), `exit` (also of earlier cycles), `withdrawal`. Withdrawn evidence is not listed. A version or record appears only if the caller sees it in full (drafts: their author and `moderator(D)`). -- **Tiers.** An anonymous caller gets the public tier: full lanes only for public pieces, stubs for +- **Tiers.** An anonymous caller gets the public tier: full lanes only for public elements, stubs for all others, no people anywhere (8.101); the response is sent with `Vary: Authorization`. ## 8. Migration from 0.5 @@ -1974,7 +1974,7 @@ until memberships are assigned), idempotent, 70 fixture files. | 7 | 12 | `migrate_material_vocab.py` | --- | seed `materials` (section 2.10); map `corian --> mineral_composite` + `trade_name: "Corian"`, `concrete --> concrete`, `brick --> fired_clay`, `aerated-concrete --> autoclaved_aerated_concrete`, `asphalt --> asphalt`, `steel --> steel`, `wood --> timber`; derive `material_class` (`derived`). Aborts on any unmapped value. Runs before 10b (inheritance compares `material`/`trade_name`). | | 8 | 3 | `migrate_type_to_original_function.py` | --- | `panel-->IfcPlate`, `beam-->IfcBeam`, `column-->IfcColumn`, `slab-->IfcSlab`, `brick-->IfcBuildingElementPart` (6.13; no 0.5 identity uses it), `pipe-->IfcPipeSegment`, `profile-->IfcMember`, `connector-->IfcDiscreteAccessory`, `rubble-->CscDebris`, `other-->IfcBuildingElementProxy`. Drops `type` (no alias, section 8.0). | | 9 | 10 | `migrate_salvage_to_origin.py` | --- | Hand-mapped, not string-copied --- the 0.5 data holds only 4 distinct `salvage_source` values (table below). `salvaged_at` --> `origin.at`, precision `day` (all stored values are midnight). Identities with no salvage data get `origin.kind` from their dataset (table below). Drops `salvage_source`, `salvaged_at`. | -| 10 | 10c | `migrate_consumed_to_exit.py` | --- | 42 consumed identities (260916): by rule: consumed with catalogued children --> `{kind: split, at: (I18), precision exact, recorded_by_user_id: null}` (in 260916 that equals `consumed_at` to the microsecond for all 37; a difference is reported); consumed without children in `ddu_build_with_debris` --> `{kind: installed, notes: "modified by students during the workshop; resulting pieces not catalogued"}`, in `ddu_aggregations` --> `{kind: lost, notes: same}`, `at` = `consumed_at`; anything else aborts. **260916: 37 split (36 panels + 1 aggregations piece that was cut again), 5 installed, 0 lost** --- the draft's "1 lost" was that aggregations piece before its own cut was catalogued. All others `exit: null`, `past_cycles: []`. Drops `consumed_at`. | +| 10 | 10c | `migrate_consumed_to_exit.py` | --- | 42 consumed identities (260916): by rule: consumed with catalogued children --> `{kind: split, at: (I18), precision exact, recorded_by_user_id: null}` (in 260916 that equals `consumed_at` to the microsecond for all 37; a difference is reported); consumed without children in `ddu_build_with_debris` --> `{kind: installed, notes: "modified by students during the workshop; resulting pieces not catalogued"}`, in `ddu_aggregations` --> `{kind: lost, notes: same}`, `at` = `consumed_at`; anything else aborts. **260916: 37 split (36 panels + 1 aggregations element that was cut again), 5 installed, 0 lost** --- the draft's "1 lost" was that aggregations element before its own cut was catalogued. All others `exit: null`, `past_cycles: []`. Drops `consumed_at`. | | 11 | 10b | `migrate_lineage_inheritance.py` | 3, 10, 12 | after 3 and 10. For every identity with `parent_identities`: set `inherited_from`; for each inheritable field equal to the parent's value --> list it in `inherited_fields`. **`manufactured_at` on the 45 children holds their creation timestamp (GH wrote it)** --> overwrite with the parent's (all `unknown`) and list it as inherited; the cut moment survives as the child's first-snapshot `effective_from` (step 1). Roots get `inherited_fields: []`, `inherited_from: null`. | | 12 | 6 | `migrate_attributes_cleanup.py` | 1c | `attributes.primitive` --> dropped (now derivable); `attributes.scan` --> `capture.notes`; `attributes.3d_scan_metadata` --> `capture{method: photogrammetry, captured_at: created_utc}` **on the identity's v0 snapshot** (7.7; device and software are not in the metadata); `attributes.scan` --> `capture.notes: "scan "`; local paths dropped. 260916: 141 captures (70 robot scans, 71 `beyond_debris`). | | 13 | 6c | `migrate_capture_context.py` | 6 | the 70 `ddu_build_with_debris` snapshots (7.7): `geometry.marker_points` --> `capture.markers` by **order**: the import wrote the four blue rig markers first (`blue_1..4`, `role: rig`; asserted within 50 mm of the marker plane), then the green ones on the stone (`green_1..`, `role: component`; asserted z > 100 mm) --- in 260916 all 70 scans follow it, while the "+/-120 mm cross" of the draft fails on 7 (rotated or shifted planes); the source OBJs are not available. `meshes[1]` (`end_effector`) --> `capture.fixtures[0]`, its `detailed.ply` (else `reduced.ply`; one scan has neither --- its inline mesh is exported) moved to `capture//fixtures/0.ply`, inline copy and `reduced.ply` dropped, `mesh_ply_resolutions["1"]` removed; `capture.coordinate_system = {name: "DDU robot gripper marker plane"}`. Drops `geometry.marker_points`. Asserts every moved mesh is the effector: every vertex within r 170 mm of the gripper axis, z -260 ... 310 mm (the robot pipeline cut it out with a cylinder r 160, h 300 --- `3d_scan_metadata.step4.cylinder_split`). 260916: 70 snapshots, 337 markers, 70 fixture files. | @@ -2002,7 +2002,7 @@ Step 10 mapping (dump 260916): | *(none)* `ddu_build_with_debris` | 70 | `kind: demolition`, rest null | | *(none)* `spa_example_data` | 9 | `kind: unknown` | | *(none)* `ddu_aggregations` without parent | 4 | as the Rosskopf row (`offcut`) | -| *(none)* child without salvage data | 1 | its parents' origin when they agree (the one piece cut from an aggregations child); step 10b lists it as inherited | +| *(none)* child without salvage data | 1 | its parents' origin when they agree (the one element cut from an aggregations child); step 10b lists it as inherited | | all 16 `dbu_zirkus` | 16 | `kind: deinstallation`, `place: {name: "TU Darmstadt Lichtwiese Campus", address: "Guenther-Behnisch-Strasse, 64287 Darmstadt, Germany"}`, `construction_work: {name: "Lichtwiese Campus Infrastructure --- pedestrian bridge", use: "pedestrian bridge"}`, `at: 2024-07-24` (day) --- one deinstallation for all 16 (user, 2026-09-28) | Frontend: regenerate models; replace every `type` and `extrusions` consumer. Grasshopper: bump @@ -2022,7 +2022,7 @@ assigned in the first draft; the numbering is kept so older references stay vali 6. *(decided 6.13: merges --> union of ranges, weakest confidence x k)* 7. *(decided 6.10: controlled `materials` collection + LoW ch. 17 class + `trade_name`)* 8. *(decided 6.13: `email` only admin + moderator(D))* -9. *(decided 7.1: one web form from the component page --- fan-out, repeat-from-last, multi-piece; no sheet, no CSV import, no GH evidence component in 0.6. Decided 7.2: no campaign concept, `campaign_id` dropped)* +9. *(decided 7.1: one web form from the component page --- fan-out, repeat-from-last, multi-element; no sheet, no CSV import, no GH evidence component in 0.6. Decided 7.2: no campaign concept, `campaign_id` dropped)* 10. *(decided 6.7: 0.6.0.0 on `v-0.6.0.0`; no aliases; client header; GH bridge in 0.6)* 11. *(decided 6.14: one runner, ordered stages, cheap stages synchronous)* 12. *(decided: `condition` dropped; see section 2.6 `condition_grade`, section 8 6b)* @@ -2050,7 +2050,7 @@ itself arrives by delegated act (Art 75(1)); mandatory use follows 18 months aft | Remanufactured product | Art 3(25): transformed in a way *essential* to performance | a CSC identity after a cutting / re-engineering snapshot chain, once a harmonised spec says the transformation was essential | | Placing on the market | Art 3(5): "the first making available on the Union market of a used product **after a deinstallation**" | a CSC component handed to a reuse project --- unless directly reused | | Direct reuse carve-out | Recital 34: "products directly reused in a construction work should not be considered as placed on the market again" | the research/prototype path stays outside the regulation | -| Who becomes the manufacturer | Art 26(2): whoever places a used or remanufactured product on the market takes on Art 22 obligations (DoPC, CE, DPP) | not CSC itself; **the operator who lists a piece for reuse** --- CSC is their documentation tool | +| Who becomes the manufacturer | Art 26(2): whoever places a used or remanufactured product on the market takes on Art 22 obligations (DoPC, CE, DPP) | not CSC itself; **the operator who lists an element for reuse** --- CSC is their documentation tool | | Rights vs. deinstaller | Art 21(3): that manufacturer may demand "information about the previous use of the product and about the process of deinstalling it" | CSC must be able to record the deinstallation *process*, not just a date | | Life cycle of a used product | Art 3(53): starts "from the latest deinstallation from the construction work" | CSC's timeline origin for LCA is the deinstallation date | | 3D-dataset | Art 3(11): "a set of numerical data describing the shape of an object by its outer dimensions and its cavities" | a CSC snapshot geometry, in the regulation's own words | @@ -2143,14 +2143,14 @@ of how directly it binds: | instrument | status (Sep 2026) | what it fixes | CSC consequence | |---|---|---|---| -| **ESPR --- Reg. (EU) 2024/1781**, Arts 9--15 + Annex III | in force; DPP registry to be set up by the Commission by **19 Jul 2026** (Art 13); product-group delegated acts pending | the DPP *framework*: data requirements, unique product / operator / facility identifiers (Art 12), registry (Art 13), web portal (Art 14). CPR Art 79 applies these to construction products | `identifiers[]` (section 10.2) must hold an ESPR-registry-issued identifier once it exists; the QR on the piece is the ESPR data carrier | +| **ESPR --- Reg. (EU) 2024/1781**, Arts 9--15 + Annex III | in force; DPP registry to be set up by the Commission by **19 Jul 2026** (Art 13); product-group delegated acts pending | the DPP *framework*: data requirements, unique product / operator / facility identifiers (Art 12), registry (Art 13), web portal (Art 14). CPR Art 79 applies these to construction products | `identifiers[]` (section 10.2) must hold an ESPR-registry-issued identifier once it exists; the QR on the element is the ESPR data carrier | | **EN 182xx family --- CEN/CLC JTC 24** ("Digital product passport: framework and system", standardisation request M/604) | first six published **27 May 2026**, cited in the OJ **15 Jul 2026** (Implementing Decision (EU) 2026/1736); two still to be cited | EN 18216 data exchange protocols ; **EN 18219 unique identifiers** ; **EN 18220 data carriers** (optical 2D, RFID, NFC) ; **EN 18221 data storage, archiving, persistence** ; **EN 18222 APIs for passport lifecycle management and searchability** ; EN 18223 system interoperability ; EN 18239 access rights, security, confidentiality ; EN 18246 data authentication, reliability, integrity | these are the *technical* targets for section 10.4: identifier syntax (18219), QR payload (18220), archiving (18221: every change archived, point-in-time retrieval, a backup service provider; the 25 years come from CPR Art 75(2)(i)), the API surface an export must speak (18222), tombstones + hashes (18246). **Obtain 18219/18220/18221/18222 before implementing `identifiers[]` and the export.** | | **CIRPASS-2** (Digital Europe, May 2024 -- Apr 2027) | running; 13 lighthouse pilots, one of them **construction, led by Cobuilder** | the reference pilot for a construction DPP; will produce the de-facto data model the delegated act inherits | watch item; the pilot's construction data model (Cobuilder's "Define"/bSDD-based dictionary) is the likeliest shape of Recital 92's "common data dictionary" | | **EN 15804+A2** (EPD core rules) | established | the 13 core + 6 additional environmental indicators | **CPR Annex II (a)--(m) = the 13 core, (n)--(s) = the 6 additional --- a 1:1 match.** The `env_*` quantities (section 10.3) should carry EN 15804 indicator codes (GWP-total, GWP-fossil, GWP-biogenic, GWP-luluc, ODP, AP, EP-freshwater, EP-marine, EP-terrestrial, POCP, ADP-minerals&metals, ADP-fossil, WDP; PM, IRP, ETP-fw, HTP-c, HTP-nc, SQP) as their `unit`-adjacent identifier. Used products: modules from the latest deinstallation only (Art 3(53), Recital 36). Data source candidates: Oekobaudat (`docs/adr/FUTURE.md`), ISO 22057 EPD data templates | -| **EPBD --- Dir. (EU) 2024/1275** | renovation-passport schemes by **29 May 2026** (Annex VIII); digital building logbooks where available; whole-life-carbon disclosure per EN 15978 / Level(s) 1.2 | the *building-side* twin of the product passport: what the piece is deinstalled *from* and installed *into* | `origin.construction_work.identifier` / `exit.construction_work.identifier` (section 3.1.1) should be able to carry a building identifier that a digital building logbook would recognise; a design's WLC (computed outside CSC, 7.11) needs each component's `env_*` | +| **EPBD --- Dir. (EU) 2024/1275** | renovation-passport schemes by **29 May 2026** (Annex VIII); digital building logbooks where available; whole-life-carbon disclosure per EN 15978 / Level(s) 1.2 | the *building-side* twin of the product passport: what the element is deinstalled *from* and installed *into* | `origin.construction_work.identifier` / `exit.construction_work.identifier` (section 3.1.1) should be able to carry a building identifier that a digital building logbook would recognise; a design's WLC (computed outside CSC, 7.11) needs each component's `env_*` | | **Level(s)** (EU building sustainability framework) | established, voluntary | indicator 1.2 life-cycle GWP, 2.1 bill of quantities/materials, 2.4 design for deconstruction & reuse | CSC components are exactly Level(s) 2.4's input; a GH definition over fetched catalog data could produce a 2.1 bill of materials (designs are not stored in CSC, 7.11) | | **Battery Reg. (EU) 2023/1542** | battery passport mandatory **Feb 2027** | the first live DPP --- the working reference for registry, access tiers, QR resolution | implementation patterns only; no data overlap | -| **Waste Framework Dir. 2008/98/EC** | established | end-of-waste: a piece is a *product* only if it "is not waste or has ceased to be waste" (Art 3(20)/(25)) | `origin` should be able to record the end-of-waste basis (never waste / ceased to be waste + reference) --- **deferred** (additive optional field on `origin`, 6.8) | +| **Waste Framework Dir. 2008/98/EC** | established | end-of-waste: an element is a *product* only if it "is not waste or has ceased to be waste" (Art 3(20)/(25)) | `origin` should be able to record the end-of-waste basis (never waste / ceased to be waste + reference) --- **deferred** (additive optional field on `origin`, 6.8) | | **DIN SPEC 91484:2023** | published; German, voluntary | pre-demolition audit data set for reusable products | national precursor of Annex V 1(h) + Annex IV; cross-check pending (section Sources) | Not yet law, watch: the Commission's announced **Circular Economy Act** (expected 2026) and any @@ -2192,7 +2192,7 @@ the schema stores enough to re-check it. Checked against the full texts on 2026- together. - **Surface state** changes the number: ground vs. as found, dry / damp / wet, carbonation depth, member age, surface temperature (hammer use 0--50 deg C). The member must be >= 100 mm thick - and firmly fixed; smaller pieces only if firmly supported. **Calibration:** five anvil readings + and firmly fixed; smaller elements only if firmly supported. **Calibration:** five anvil readings before and after each series, within +-3 of the manufacturer value. - **The rebound number is not a strength** (EN 12504-2, note 2). EN 13791:2019 converts it only through a correlation with cores taken at the same test locations (>= 8, better 10 pairs; @@ -2206,7 +2206,7 @@ the schema stores enough to re-check it. Checked against the full texts on 2026- **Drilled core in compression (EN 12504-1:2019, EN 12390-3:2019, machine EN 12390-4, assessment EN 13791).** Three acts at different times: -1. **Sampling** --- the core is drilled out of the piece: diameter (typically 50 / 100 / 150 mm), +1. **Sampling** --- the core is drilled out of the element: diameter (typically 50 / 100 / 150 mm), position, orientation to the casting direction, wet / dry drilling, date. 2. **Specimen preparation** --- measured diameter, lengths as drilled and prepared, end preparation (ground / capped / sawn), length-to-diameter ratio (2:1 class 1.95--2.05, 1:1 @@ -2367,7 +2367,7 @@ impractical, then 1:1 and three cores per location). Context resolves at `sample "url": "https://..." | null, "retrieved_at": "2026-10-05" | null }, // 8.106: http(s) only; the date the link was read "claim": { "text": "B225", "interpretation": "..." } | null } // summary: {concrete_class, range: ["B225"], claimed} or {compressive_strength, range:[18,28], MPa, claimed} -// or none (8.106): a **document** --- documents the piece, never enters the fold; the only method whose summary is optional +// or none (8.106): a **document** --- documents the element, never enters the fold; the only method whose summary is optional // visual_inspection { "observations": [ { "quantity": "spalling", "value": 1, "note": "..." } ] } // value = severity 0--3 for findings, grade 0--3 (3 good) for condition_grade (section 2.6) @@ -2419,7 +2419,7 @@ One record per source: a drawing, a scan survey, one exposure. Viewers draw the snapshot named by `position.snapshot_id`; a new snapshot (new coordinates) needs a new layout record. GH: the `ReinforcementLayout` builder (curves + spec + diameter, `DocumentUrl` / `DocumentRetrievedAt` for the drawing) posted by the generic `AddEvidence` component --- the one evidence path in the 0.6 bridge. Its optional -`ComponentPassport` input maps curves drawn on a moved piece back to the stored coordinates: with the passport's +`ComponentPassport` input maps curves drawn on a moved element back to the stored coordinates: with the passport's client-side `csc_placement` Q the points go placed --> stored through the inverse of `placement_transform(Q)` (8.98) and `SnapshotID` comes from the passport (a different explicit `SnapshotID` is an error). Document units are taken as millimetres, 1:1, like the `Fetch...Geometry` components and `ApplyFrame` do: nothing is scaled, a document in another unit only gets a diff --git a/docs/adr/DESIGN_DECISIONS.md b/docs/adr/DESIGN_DECISIONS.md index 0eabed7b..272b0930 100644 --- a/docs/adr/DESIGN_DECISIONS.md +++ b/docs/adr/DESIGN_DECISIONS.md @@ -252,7 +252,7 @@ into one **metadata object**. | 8.115 | **P9 review: undo, quantity, filter label, timeline event** (user 2026-10-06, review of the P9 build). (a) `undo-deinstall` only undoes the act: refused (409) when `origin.at` is null ("set the date by PATCH first") or when the identity's latest origin change in the change log is not the deinstall act; an imported or hand-set deinstalled origin cannot be turned "in place" by it. (b) **Every** identity's later states keep v0's `quantity`, not only batches; a correction is the only way to change it (I32), so a drawn single piece cannot turn into a batch by a state change. (c) The web label of the circulation value `deinstalled` is **Not in place** (it also lists offcuts, surplus and unknown origins, which were never installed); the API value stays. (d) The timeline gets one event `deinstalled` at `origin.at` from the change-log entry of the act (3.1.6). (e) Small fixes: a non-integer draw quantity answers 422, not 500; a draw from a batch without an authored proxy and without size or geometry gets the message "the batch has no authored proxy to copy; give a size or geometry"; the per-batch publish locks are released after use. (f) For P12 step 3b: the rehearsal copied 312 MB of attachments (one file per record; the hard links of 8.108 are not built) --- decided together with the rights question (8.110 d). | Rejected: undo on any deinstalled origin (turns imported pieces back in place without a trace); the quantity frozen for batches only (a later state could create a batch). | | 8.116 | **P10 before the build: route, P9 items, conservative bound, CERO scope** (user 2026-10-06, coordinator check of P10 against the spec and P9). (a) JSON-LD on `GET /identities/{id}/compose?format=jsonld` (the passport), as spec 7.8. (b) From P9: CPR Annex V 1(h) only when deinstalled and not planned; batch `quantity` and `remaining` in JSON-LD and PDF; a document's `url` / `retrieved_at` as links in JSON-LD and CERO; the PDF says "In place, deinstallation planned " for a planned origin. (c) A mapping column `conservative: low | high | None` per quantity: low for the compressive strengths, density, elastic modulus, cover depth; high for chloride content, carbonation depth, crack width, mass; None = a value only when the range is a single value. Categorical values only when the fold is unambiguous; ordinal hazards (severity) take the worst level. (d) CERO (v0.1, concrete elements) only for `concrete` and `autoclaved_aerated_concrete`; other materials 409 "CERO covers concrete elements only", no CERO link in the web. (e) `steel_grade` gets an IFC / bSDD mapping only where IFC 4.3 has one (`Pset_MaterialSteel.StructuralGrade` to verify), else none. (f) Exports read through the passport's path: people stripped for anonymous callers (8.101), viewer-specific ETags and `Vary`, 401 / 403 as `compose`, attachment names in the PDF for members only (8.13). (g) PDF: QR code from `reportlab.graphics.barcode.qr`; a bundled OFL font (Noto Sans, licence in `licenses/`) for characters outside Latin-1; preview image = the snapshot preview, else the first photo, else none. (h) `@id` = `{FRONTEND_URL}/id/{uuid}`, no new setting. (i) `pyld` and `rdflib` in `requirements-dev.txt` only, for validation tests; route tests in `tests/api`. (j) Done-when adds an imported in-place batch (no 1(h), batch line), a recycling-hall piece (1(h) filled, no CERO) and a public viewer's export without people. | Rejected: CERO values for steel / timber pieces (outside CERO's scope); one global bound direction; a new base-URL setting. | | 8.117 | **P10 review: export hardening and IRIs** (user 2026-10-06, review of the P10 build). (a) The `ifc:` prefix is the bSDD class identifier for IFC 4.3 (`https://identifier.buildingsmart.org/uri/buildingsmart/ifc/4.3/class/`), buildingSMART's resolvable identifier; IFC-OWL may follow as a further mapping (FUTURE). (b) `@vocab` `{FRONTEND_URL}/vocab/v1#` stays a namespace; a resolvable vocabulary page is FUTURE. (c) Context and PDF footer links come from the request URL; P12 step 4b checks them on production. (d) Fixes: the export test writes non-ASCII as `\u` escapes and the PDF test carries a character outside Latin-1; `/export/pdf` and `/export/cero` get the rate limiter and the PDF a small in-process LRU cache keyed by its ETag; the PDF ETag includes the preview file's mtime / size and the path of the stand-in photo; the file name falls back to the id without a catalogue number; in JSON-LD a quantity whose bSDD code is taken uses its CERO term before the CSC term. (e) **Client address for rate limits**: the web proxy forwards the client address as `X-Forwarded-For`; the backend trusts that header only from loopback or the known proxy and then takes the entry the trusted proxy appended (the rightmost untrusted hop), never the leftmost a caller can set --- this also closes the spoofable login limits. Signed-in callers are limited per token, anonymous callers per IP. A 429 shows a readable message in the web ("Too many downloads, try again in a minute"). | Rejected: one shared bucket for every web user (a seminar group hits 429 within a minute); the leftmost `X-Forwarded-For` entry; unlimited anonymous PDF renders; an unverified IFC-OWL namespace now. | -| 8.118 | **P11 UI revision: style and structure** (user 2026-10-06, grilling of the UI / UX review in `.dev/ui-review/`; the wireframes are accepted in principle). **Style stays**: the existing shadcn components and the CI colours (the blue and the magenta) are kept; margins and paddings may shrink to gain screen space, and secondary shades (e.g. in dark mode) may be adapted for a better UX. (Q1) Component page actions: **Reserve / Release** stays a visible button and **Add evidence** stays visible in the Properties card; everything else --- Download passport (PDF), CERO, geometry, Locate, Cut a piece / Draw pieces, Record new state, Edit details, and the moderation group --- goes into one Actions menu (bottom sheet on a phone, dropdown on desktop), grouped Record / Moderate. (Q2) Phone order: header strip, banner when it applies, then the **viewer** with a toolbar (detail level, orientation, an Overlay menu) in place of the settings panel, then the facts card. (Q3) Snapshot versions are **read-only rows** in the History card (version, status, "since ", corrected / withdrawn); Correct a version, Make current and Withdraw sit in the Moderate group of the Actions menu, which asks for the version. (Q4) **My work** replaces Dashboard and Reserved: waiting for you (moderators / reviewers, with counts), my reservations (Release), my drafts, pending and rejected records --- snapshots and evidence together, with status and rejection reason --- and recent components; the backend gets `GET /snapshots?mine=1&status=...` (the caller's own snapshots only; evidence has `recorded_by=me`). (Q6) Browse on a phone is a **card list** (thumbnail, name + number, "function / material / X x Y x Z mm", a status chip, "N pieces" for a batch); desktop keeps a table of 8 columns (thumbnail, name + number, function, material, dataset, size, shape class, status) with a column picker for the rest. (Q7) **One Scan page** with the modes Identify / Locate / Transmit; on a phone the camera starts on open, the paste field sits under it, the explanation behind a "?"; one sidebar entry and one top-bar icon. (Q8) **Anonymous visitors browse**: Browse, the map and the component page in the public tier (public pieces only, no people, 8.101); their sidebar shows Browse, Grasshopper, API docs and Sign in; the home page's first button is "Browse the catalog". (Q9) No sidebar entry "Out of circulation": Browse has one circulation switch --- In circulation (default; sub-filter In place / Not in place) / Out of circulation / All --- kept in the URL (`?circulation=...`) so teaching links keep working. (Q10) The switch says **In circulation / Out of circulation / All** (glossary); "Active Catalog" goes everywhere. (Q12) **Scope**: all MUST (M1, M2, M4, M5, M6; M3 done by 8.101) and all SHOULD (S1 Scan page, S2 Moderation page with tabs and counts, S3 sidebar with 12 entries, S4 merged cards, S5 form steps and method order, S6 Settings / Materials, S7 terminology and day-precision dates) of the review, plus C-1 (home page), 8.101 M2, 8.102 (History card) and the leftovers of P9 / P10 (the cut dataset default without a parent in the link, the in-place map popup on real data, undo deinstallation in the browser). The other COULD items are grilled separately. Built in three stages, each reviewed and shown to the user: (1) component page with the History card; (2) Browse, My work, sidebar, Scan, Moderation; (3) forms, Settings / Materials, terminology, home page. Q5 is settled by 8.101, Q11 by 8.102. (C-2) **Map in P11** (stage 2): the plot at full width without the outer card, one toolbar (layout, descriptor, colour by dataset / shape class / material / circulation incl. in place) with a legend, the status as "N components" with the cache date behind a "?". (C-3) **Analytics in P11** (stage 2): the shared filter bar (applied on change), one line "N components in M datasets, K pieces" instead of the tiles, the Overview tab opens with the function and material charts, Top Descriptor Keys moves to the Descriptors tab, a new Circulation chart (in place / not in place / out of circulation). (C-4) **Footer in P11** (stage 3): the full footer only on the public pages (home, sign in / register, Credits, Imprint, Browse and the component page for anonymous visitors); in the signed-in app one thin line (Imprint, Credits, Cookie settings), none inside forms; the Imprint stays reachable from every page (account menu in the app). (C-5) **Grasshopper page in P11** (stage 3): a short page --- download card with the version from the backend; installation (the library via CSC_Update, the restart note, the junction for development); a **component reference generated** from the release tag's sources (name, subcategory, description, inputs and outputs with their descriptions from the `RunScript` signature and `OUTPUTS`, 8.112), through the `/ghinterface` routes or a JSON built at release time. All 0.5 text goes. With C-2 to C-5 every COULD of the review is in P11. **Stage 1 as built (user 2026-10-06):** History sits at the bottom of the right column on desktop (the graph needs the width); the Evidence layer is off in Graph view (no evidence nodes until the swimlane graph); an Actions entry "Versions awaiting action" keeps submit / recall / publish / reject / reinstate / delete of unfinished versions reachable; JSON-LD stays in the PDF footer and the API, CERO is an Actions entry; the camera / gallery buttons show only while the piece has an unpublished version (6.6); "Record changed" rows leave the History list and stay in the collapsed change history; the "Public demo view" banner is replaced by "Not public: only members of and the moderators see this piece."; `can_undo_deinstall` is a response-only flag, computed only for moderators of the dataset and admins. **Stage 2, API (user 2026-10-06)**: for Q8, `GET /identities`, `/identities/count`, `/identities/map`, `/identities/stats` and `/identities/meta/datasets` answer anonymous callers with the public tier only (`is_public` pieces, no people, no unpublished states; the map cache filtered by the same visible set), rate-limited per client address; the web proxy lets `/components`, `/components/map`, `/analytics` and component pages through anonymously; `GET /identities?q=` is a free-text filter (name, catalog number, id prefix); `GET /snapshots?mine=1&status=...` lists the caller's own snapshots. **Stage 2 as built (user 2026-10-07)**: the anonymous sidebar shows Browse, Map, Analytics, Grasshopper, API docs and Sign in; map points carry dataset / material / shape_class and the stats response `byCirculation` and `pieces` (additive; the map cache is rebuilt in P12); the sidebar has 14 entries for an admin (every entry a page); Moderation stays at `/admin/validation` with tabs, the old pages redirect; count / stats / map / meta answer with the viewer's cache headers (`Vary: Authorization`, 8.101); Browse shows a placeholder instead of requesting a missing preview. **Stage 3, API (user 2026-10-07)**: `GET /ghinterface/reference` parses the release tag's component sources with `ast` only (never executes them) into one JSON (name, nickname, subcategory, description, inputs with descriptions, outputs from `OUTPUTS`), cached per release tag; it and `GET /ghinterface/version` answer anonymous callers, rate-limited per client address; the other `/ghinterface` routes stay signed-in. `GET /datasets` rows gain `member_count` (moderators of the dataset and admins only, else absent) and `component_count` (published pieces the caller may see). Settings "Account" reads `GET /users/me`; admins read "Administrator: all datasets, all roles". **Stage 3 review (user 2026-10-07)**: an anonymous caller of `/ghinterface/reference` gets the release the backend runs, `?channel=` only for signed-in callers (the server's GitHub token must not be spent by anonymous ref cycling; CSC_Update shares it); the download of the UserObjects stays signed-in; the unreferenced 0.5 screenshots in `public/gh-interface/` are deleted; Appendix A is walked line by line by the implementer on the acceptance instance with every role (checklist with screenshots), the review checks the signed-out lines and the checklist. **Grasshopper page, revised (user 2026-10-07, at the stage 3 acceptance; replaces the short page of C-5)**: per component a card as on the 0.5 page --- screenshot (the old files in `public/gh-interface/` come back; a placeholder where none matches; new screenshots are added later), the generated description, inputs and outputs, and "Copy Grasshopper component to clipboard" (the component's XML, pasted into a definition); the installation section leads with the copy-and-run path: copy the CSC_Update component, paste it into a definition and run it, which installs the UserObjects and `csc_gh`; the download stays as the second path. `GET /ghinterface/xml/{name}` answers anonymous callers too (read-only, the backend's release tag only, no `channel`, rate-limited per client address), so the copy buttons and the copy-and-run installation work signed out; the zip download stays signed-in. The layout need not be one card per component (a grouped, expandable form is fine) as long as screenshot, description, inputs and outputs read clearly. | Rejected: a new visual style; all actions in the menu (Reserve one tap further); the PDF as a second visible button. | +| 8.118 | **P11 UI revision: style and structure** (user 2026-10-06, grilling of the UI / UX review in `.dev/ui-review/`; the wireframes are accepted in principle). **Style stays**: the existing shadcn components and the CI colours (the blue and the magenta) are kept; margins and paddings may shrink to gain screen space, and secondary shades (e.g. in dark mode) may be adapted for a better UX. (Q1) Component page actions: **Reserve / Release** stays a visible button and **Add evidence** stays visible in the Properties card; everything else --- Download passport (PDF), CERO, geometry, Locate, Cut a piece / Draw pieces, Record new state, Edit details, and the moderation group --- goes into one Actions menu (bottom sheet on a phone, dropdown on desktop), grouped Record / Moderate. (Q2) Phone order: header strip, banner when it applies, then the **viewer** with a toolbar (detail level, orientation, an Overlay menu) in place of the settings panel, then the facts card. (Q3) Snapshot versions are **read-only rows** in the History card (version, status, "since ", corrected / withdrawn); Correct a version, Make current and Withdraw sit in the Moderate group of the Actions menu, which asks for the version. (Q4) **My work** replaces Dashboard and Reserved: waiting for you (moderators / reviewers, with counts), my reservations (Release), my drafts, pending and rejected records --- snapshots and evidence together, with status and rejection reason --- and recent components; the backend gets `GET /snapshots?mine=1&status=...` (the caller's own snapshots only; evidence has `recorded_by=me`). (Q6) Browse on a phone is a **card list** (thumbnail, name + number, "function / material / X x Y x Z mm", a status chip, "N pieces" for a batch); desktop keeps a table of 8 columns (thumbnail, name + number, function, material, dataset, size, shape class, status) with a column picker for the rest. (Q7) **One Scan page** with the modes Identify / Locate / Transmit; on a phone the camera starts on open, the paste field sits under it, the explanation behind a "?"; one sidebar entry and one top-bar icon. (Q8) **Anonymous visitors browse**: Browse, the map and the component page in the public tier (public pieces only, no people, 8.101); their sidebar shows Browse, Grasshopper, API docs and Sign in; the home page's first button is "Browse the catalog". (Q9) No sidebar entry "Out of circulation": Browse has one circulation switch --- In circulation (default; sub-filter In place / Not in place) / Out of circulation / All --- kept in the URL (`?circulation=...`) so teaching links keep working. (Q10) The switch says **In circulation / Out of circulation / All** (glossary); "Active Catalog" goes everywhere. (Q12) **Scope**: all MUST (M1, M2, M4, M5, M6; M3 done by 8.101) and all SHOULD (S1 Scan page, S2 Moderation page with tabs and counts, S3 sidebar with 12 entries, S4 merged cards, S5 form steps and method order, S6 Settings / Materials, S7 terminology and day-precision dates) of the review, plus C-1 (home page), 8.101 M2, 8.102 (History card) and the leftovers of P9 / P10 (the cut dataset default without a parent in the link, the in-place map popup on real data, undo deinstallation in the browser). The other COULD items are grilled separately. Built in three stages, each reviewed and shown to the user: (1) component page with the History card; (2) Browse, My work, sidebar, Scan, Moderation; (3) forms, Settings / Materials, terminology, home page. Q5 is settled by 8.101, Q11 by 8.102. (C-2) **Map in P11** (stage 2): the plot at full width without the outer card, one toolbar (layout, descriptor, colour by dataset / shape class / material / circulation incl. in place) with a legend, the status as "N components" with the cache date behind a "?". (C-3) **Analytics in P11** (stage 2): the shared filter bar (applied on change), one line "N components in M datasets, K pieces" instead of the tiles, the Overview tab opens with the function and material charts, Top Descriptor Keys moves to the Descriptors tab, a new Circulation chart (in place / not in place / out of circulation). (C-4) **Footer in P11** (stage 3): the full footer only on the public pages (home, sign in / register, Credits, Imprint, Browse and the component page for anonymous visitors); in the signed-in app one thin line (Imprint, Credits, Cookie settings), none inside forms; the Imprint stays reachable from every page (account menu in the app). (C-5) **Grasshopper page in P11** (stage 3): a short page --- download card with the version from the backend; installation (the library via CSC_Update, the restart note, the junction for development); a **component reference generated** from the release tag's sources (name, subcategory, description, inputs and outputs with their descriptions from the `RunScript` signature and `OUTPUTS`, 8.112), through the `/ghinterface` routes or a JSON built at release time. All 0.5 text goes. With C-2 to C-5 every COULD of the review is in P11. **Stage 1 as built (user 2026-10-06):** History sits at the bottom of the right column on desktop (the graph needs the width); the Evidence layer is off in Graph view (no evidence nodes until the swimlane graph); an Actions entry "Versions awaiting action" keeps submit / recall / publish / reject / reinstate / delete of unfinished versions reachable; JSON-LD stays in the PDF footer and the API, CERO is an Actions entry; the camera / gallery buttons show only while the piece has an unpublished version (6.6); "Record changed" rows leave the History list and stay in the collapsed change history; the "Public demo view" banner is replaced by "Not public: only members of and the moderators see this piece."; `can_undo_deinstall` is a response-only flag, computed only for moderators of the dataset and admins. **Stage 2, API (user 2026-10-06)**: for Q8, `GET /identities`, `/identities/count`, `/identities/map`, `/identities/stats` and `/identities/meta/datasets` answer anonymous callers with the public tier only (`is_public` pieces, no people, no unpublished states; the map cache filtered by the same visible set), rate-limited per client address; the web proxy lets `/components`, `/components/map`, `/analytics` and component pages through anonymously; `GET /identities?q=` is a free-text filter (name, catalog number, id prefix); `GET /snapshots?mine=1&status=...` lists the caller's own snapshots. **Stage 2 as built (user 2026-10-07)**: the anonymous sidebar shows Browse, Map, Analytics, Grasshopper, API docs and Sign in; map points carry dataset / material / shape_class and the stats response `byCirculation` and `pieces` (additive; the map cache is rebuilt in P12); the sidebar has 14 entries for an admin (every entry a page); Moderation stays at `/admin/validation` with tabs, the old pages redirect; count / stats / map / meta answer with the viewer's cache headers (`Vary: Authorization`, 8.101); Browse shows a placeholder instead of requesting a missing preview. **Stage 3, API (user 2026-10-07)**: `GET /ghinterface/reference` parses the release tag's component sources with `ast` only (never executes them) into one JSON (name, nickname, subcategory, description, inputs with descriptions, outputs from `OUTPUTS`), cached per release tag; it and `GET /ghinterface/version` answer anonymous callers, rate-limited per client address; the other `/ghinterface` routes stay signed-in. `GET /datasets` rows gain `member_count` (moderators of the dataset and admins only, else absent) and `component_count` (published pieces the caller may see). Settings "Account" reads `GET /users/me`; admins read "Administrator: all datasets, all roles". **Stage 3 review (user 2026-10-07)**: an anonymous caller of `/ghinterface/reference` gets the release the backend runs, `?channel=` only for signed-in callers (the server's GitHub token must not be spent by anonymous ref cycling; CSC_Update shares it); the download of the UserObjects stays signed-in; the unreferenced 0.5 screenshots in `public/gh-interface/` are deleted; Appendix A is walked line by line by the implementer on the acceptance instance with every role (checklist with screenshots), the review checks the signed-out lines and the checklist. **Grasshopper page, revised (user 2026-10-07, at the stage 3 acceptance; replaces the short page of C-5)**: per component a card as on the 0.5 page --- screenshot (the old files in `public/gh-interface/` come back; a placeholder where none matches; new screenshots are added later), the generated description, inputs and outputs, and "Copy Grasshopper component to clipboard" (the component's XML, pasted into a definition); the installation section leads with the copy-and-run path: copy the CSC_Update component, paste it into a definition and run it, which installs the UserObjects and `csc_gh`; the download stays as the second path. `GET /ghinterface/xml/{name}` answers anonymous callers too (read-only, the backend's release tag only, no `channel`, rate-limited per client address), so the copy buttons and the copy-and-run installation work signed out; the zip download stays signed-in. The layout need not be one card per component (a grouped, expandable form is fine) as long as screenshot, description, inputs and outputs read clearly. | Rejected: a new visual style; all actions in the menu (Reserve one tap further); the PDF as a second visible button. Amended 2026-10-28 (user, 0.6.4.2): Q1, "Add evidence" is a button of the evidence records card, not of the Properties card: the action makes a record, and properties are derived, never typed in, so a button on the Properties card suggests editing them. The Properties card keeps only a quiet link "add evidence" in its empty state (no properties yet), with the same rule for who sees it; its "?" says that properties are worked out from the evidence. | | 8.119 | **Deviation maps: points assigned by surface normal, sample sized to the map** (user 2026-10-07, after the P11 acceptance showed #709's distance overlay narrowing along the beam). Diagnosis: `_box_unwrap` assigned each sample to the nearest box plane; #709's underside lies 50--350 mm inside the obb, so beyond the gap where a side plane is nearer its points jumped to the sides (of 919 downward-facing samples 406 on `-z`, 343 on `+y`); and 50 000 samples over about 11.9 m^2 at 11 mm cells filled only 24--47 % of the cells. (a) Each sample goes to the face whose outward normal best matches its surface normal; the nearest plane only when the best `|n . face|` is below 0.5 (edges); the same for prism faces and caps; the hull keeps its angular map. The distance channel then shows a recessed surface's depth as a gradient. (b) The surface sample is sized to the maps: about 3 points per cell of the sampled area, at least 50 000, at most 300 000. Map files keep their size. All fitted proxies are re-derived (P12 step 3 runs the geometry runner anyway). Test: #709's downward-facing samples land on `-z` for at least 90 %. | Rejected: ray projection per face (exact under occlusion, costly without Embree; later if (a) is not enough); keeping the nearest-plane rule; display-only filling of the gaps. | | 8.120 | **Nobody publishes directly; self-moderation from the queue** (user 2026-10-07). Submitting a snapshot or an evidence record never publishes it, for any role incl. moderators and admins: the submit route loses `?publish=1` (and `&promote=1`), the web forms, the evidence lifecycle actions and the Grasshopper upload (`csc_gh.upload`) only submit, and every new record waits in the moderation queue as `pending`. Publishing is always the separate `POST /snapshots/{sid}/publish` / `POST /evidence/{eid}/publish` by `moderator(D)`; a moderator may publish their own submission from the queue (a deliberate second step; the queue card marks it "Own record"). The external catalogue import (8.108) submits and then publishes through those routes as a scripted moderation step. | Rejected: auto-publish for moderators / admins (records skip the queue); a strict four-eyes rule (blocks datasets with one moderator; a per-dataset setting may follow, FUTURE). | | 8.121 | **P12 preparation review: sweep only on request, map distance to the face plane, outline cap** (user 2026-10-07, after the review of the P12 preparation and the incident in which a local geometry run deleted one derived preview in the local asset original). (a) `main_geometry.py` sweeps orphaned previews only with an explicit `--sweep` flag, default off; only the production cron (`uberspaceconfig/crontab`) sets it; the guard "no snapshot in the database" stays. On the server the asset folder is the one the production database describes, so the sweep there is right (P12 checklist). Local `dev.env` points every `SNAPSHOT_*_DIR` at `.dev/assets/` (a copy of the assets, gitignored), never at an original. (b) The deviation maps' distance channel measures the signed distance to the plane (or surface) of the face the point is assigned to (8.119 a), so a recess shows its full depth on the face it is drawn on; the residual figures (`rms`, `p95`, `max`, `inlier_ratio`) stay the distance to the nearest proxy surface. (c) The planar prism's outline input is capped at 50 000 points (strided before `_thin`); the outline does not need the map density; measure the largest flat piece (the aerated concrete wall) once. (d) **A planar accept check with a box fallback** (user 2026-10-07, from the measurement of (c)): a plain rectangular scanned slab fitted a ragged prism with p95 about 1.5 m, because `_accept` only guarded linear prisms. A planar prism is accepted only when its p95 is at most one thickness (`PRISM_PLANAR_TOLERANCE` 1.0; the 11 planar prisms of dump 261001 sit at 0.07--0.39, notched slabs at 0.003--0.006, the broken plain wall at 7.6) and its rms is not worse than the frame's box on the same sample (the rms, not the p95: a notch covers too little surface for the p95 to tell box and prism apart); otherwise the box is the primary proxy. On 261001 none of the 11 planar pieces switches. | Rejected: a sweep on every full pass whatever the stages; the map distance to the nearest surface (understates recesses on the face they belong to). | @@ -315,8 +315,9 @@ into one **metadata object**. | 8.178 | **A reinforcement layout in the viewer, whatever its status** (user 2026-10-27; 0.6.4.1). The card of a `reinforcement_layout` record in the evidence list has "Show in viewer". It opens the component page on `?snapshot=&layout=`: the viewer shows the version the bars belong to and draws that one record in addition to the published layouts, whatever its status (draft, pending, rejected, superseded, published). The legend names the record and its status, and its bars stand out from the others. The server decides who may load the record, as for any record (7.0); a link to a record the caller may not see draws nothing more and says so. Without `layout=` the viewer stays as it is: published layouts only. Only reinforcement layouts for now; the same link for other positioned records later, if needed. | A submitted draft layout could be read as a card but not seen: the viewer draws published layouts only, while a draft version of a piece opens in the viewer through `?snapshot=`. A global "Show drafts" toggle was rejected: it mixes moderation states into the view of the piece, cannot tell several drafts apart, and would have to cover marks and versions too. One record per link can be sent to a moderator for review. | | 8.179 | **Scope of 0.6.4.2: a second hardening, with Grasshopper** (user 2026-10-28; before 0.6.5). 0.6.4.2 collects the smaller open items and issues. It is a Grasshopper release: `invoke bump-version 0.6.4.2 --gh` first, then the export in Rhino 8. In: (1) the Grasshopper issues #32 (a missing or empty input of `ReinforcementLayout` is a warning, not an error), #33 (an output without a result is an empty Grasshopper tree, not `''` or `None`) and #36 (`ReadFromD2P` resolves the D2P component from a tagged member object); (2) a scan of every Grasshopper component for the same two faults, fixed in all of them, not only in `ReinforcementLayout`; (3) the descriptions of `ApplyFrame` (0.6.5 (e), moved here). Amended the same day (user): 0.6.4.2 leaves out the Grasshopper side, since the fix of (1) and (2) changes most components; (1) to (3) move to 0.6.4.3 (8.180). 0.6.4.2 is a web and backend release, bumped without `--gh`. In: the issues #35 (session expiry on a private component page), #37 (a reinforcement layout in the History graph opens the viewer), #39 (credits and imprint styled like the privacy page) and #34 (the organisation's website in the profile, "Add my organisation"). Further in 0.6.4.2 (user, same day): the Browse filter for the evidence method (the list parameter of 8.177); the two follow-ups of 8.178 (the diameter colour mode with a chosen layout, the legend key by layout id); `shadcn` (dev only) to >=4.22.1, run by the maintainer since `npm update` is blocked for the agents; the 61 warnings of `invoke test-release` sorted, the cheap ones fixed, the rest reported; the unused `bbxX` type removed from the web app. The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests go to 0.6.4.3. | | 8.180 | **Scope of 0.6.4.3: Grasshopper only** (user 2026-10-28; after 0.6.4.2, before 0.6.5). A release that touches only the Grasshopper side: `invoke bump-version 0.6.4.3 --gh` first, then the export in Rhino 8. In: issue #40 (the scan of 8.179 (2): a missing or empty input is a warning, an output without a result is an empty Grasshopper tree, in every component, through helpers in the shared library), with #32 and #33 as its first cases; #36 (`ReadFromD2P` resolves the D2P component from a tagged member object); the descriptions of `ApplyFrame` (0.6.5 (e)). | -| 8.181 | **A data model reference page for users** (user 2026-10-28; added to 0.6.4.2). The web app gains a public page that explains the data model in a digestible reference form, built from the material that exists (`docs/adr/DATA_MODEL_SPEC.md`, `CONTEXT.md`, `vocab.py`). (a) Audience: catalog users --- members who add pieces and evidence, readers, Grasshopper and MCP users --- not developers. Content: the four entities (dataset, component identity, snapshot, evidence) and how they relate; the four rules of the model in plain words; per entity the fields a user sees or fills in, with meaning, type or unit, an example and whether the server derives it; the vocabularies, each value with its label and one line of meaning; an example record per evidence method. Left out: the API surface, permission internals, invariants, migration and the CPR mapping; they stay in the spec. (b) Sources (hybrid): the text, the examples and the field tables are written by hand in a typed content module of the web app, since the field descriptions of the models are technical; each vocabulary value gains a one-line description in `vocab.py`, served by `GET /vocab` and generated into `generated/Vocab.ts` (`*_DESCRIPTIONS`), so the page shows label and meaning from the backend and other readers (forms, MCP) can use them. Two tests keep it in step: a backend test fails on a vocabulary value without a description, a frontend test fails on a field named on the page that the generated models do not have. (c) Place: `/reference`, titled "Data Model", public without sign-in, in the style of the privacy page (#39); linked in the sidebar next to the Grasshopper item (`/gh-interface`, group `tools` in `lib/navigation.ts`), visible to anyone, not in the footer; a table of contents at the top and an anchor per entity and per vocabulary (`/reference#evidence`, `/reference#evidence-methods`), so that forms, the MCP connector and the Grasshopper descriptions can link a section later. (d) Examples: made up, not taken from the catalog. One made-up piece is followed through the whole model (for example a concrete beam: its dataset, its identity, two versions, evidence records of several methods), so each section shows the same piece. Each record is a table of field, value and a short comment, with its raw JSON folded below. No names of people or organisations (roles instead), ids marked as examples; the values follow the examples of the spec (Appendix A). Real records were rejected: they change or are withdrawn, carry names, and no single piece has every kind of evidence. (e) Authorship: the implementer drafts the text, the field tables, the vocabulary descriptions (one line, about 120 characters at most) and the example piece from the spec and `CONTEXT.md`, and marks the sentences where it read the spec loosely; the reviewer checks every statement against the spec and the decisions; the maintainer approves the wording on the dev stack. Built as T9 of 0.6.4.2, after T7 and before the warning cleanup T8 (about 2--3 days). | +| 8.181 | **A data model reference page for users** (user 2026-10-28; added to 0.6.4.2). The web app gains a public page that explains the data model in a digestible reference form, built from the material that exists (`docs/adr/DATA_MODEL_SPEC.md`, `CONTEXT.md`, `vocab.py`). (a) Audience: catalog users --- members who add pieces and evidence, readers, Grasshopper and MCP users --- not developers. Content: the four entities (dataset, component identity, snapshot, evidence) and how they relate; the four rules of the model in plain words; per entity the fields a user sees or fills in, with meaning, type or unit, an example and whether the server derives it; the vocabularies, each value with its label and one line of meaning; an example record per evidence method. Left out: the API surface, permission internals, invariants, migration and the CPR mapping; they stay in the spec. (b) Sources (hybrid): the text, the examples and the field tables are written by hand in a typed content module of the web app, since the field descriptions of the models are technical; each vocabulary value gains a one-line description in `vocab.py`, served by `GET /vocab` and generated into `generated/Vocab.ts` (`*_DESCRIPTIONS`), so the page shows label and meaning from the backend and other readers (forms, MCP) can use them. Two tests keep it in step: a backend test fails on a vocabulary value without a description, a frontend test fails on a field named on the page that the generated models do not have. (c) Place: `/reference`, titled "Data Model", public without sign-in, in the style of the privacy page (#39); linked in the sidebar next to the Grasshopper item (`/gh-interface`, group `tools` in `lib/navigation.ts`), visible to anyone, not in the footer; a table of contents at the top and an anchor per entity and per vocabulary (`/reference#evidence`, `/reference#evidence-methods`), so that forms, the MCP connector and the Grasshopper descriptions can link a section later. (d) Examples: made up, not taken from the catalog. One made-up piece is followed through the whole model (for example a concrete beam: its dataset, its identity, two versions, evidence records of several methods), so each section shows the same piece. Each record is a table of field, value and a short comment, with its raw JSON folded below. No names of people or organisations (roles instead), ids marked as examples; the values follow the examples of the spec (Appendix A). Real records were rejected: they change or are withdrawn, carry names, and no single piece has every kind of evidence. (e) Authorship: the implementer drafts the text, the field tables, the vocabulary descriptions (one line, about 120 characters at most) and the example piece from the spec and `CONTEXT.md`, and marks the sentences where it read the spec loosely; the reviewer checks every statement against the spec and the decisions; the maintainer approves the wording on the dev stack. Built as T9 of 0.6.4.2, after T7 and before the warning cleanup T8 (about 2--3 days). Amended 2026-10-28 (user, after the first look at the page): (c) the page is not one long column but seven tabs along the top (Overview with the diagram and the four rules; Dataset; Identity with origin and exit; Versions; Evidence with result, place, check, lifecycle and actors; Lists of values; Example), which replace the table of contents; inside a tab the vocabularies and the evidence records of the example are folded sections, closed by default. The tab is in the address (`/reference#evidence`); a link to a section further down opens its tab and its folded section and scrolls to it, so the anchors keep working. On a phone the tab bar scrolls sideways in itself, the page does not. The background mesh stays. Amended again the same day (user): the Data Model page has no background mesh. | | 8.182 | **Session expiry on a public piece; the return address after sign-in** (user 2026-10-28; 0.6.4.2, from the review of #35). (a) When the session ends on a component page whose view is public (8.179, #35), the page is signed out without a redirect and rendered again as anonymous: it stays readable, but what only a signed-in user sees (person names and e-mails of actors, people in the History graph, `added_by_username`) goes, and the navigation shows the user as signed out. A view that is not public leads to the sign-in page as before. (b) The return address after sign-in (`callbackUrl`) only accepts an address on this site: exactly one leading `/` and the same origin, checked by one shared function on the server and in the browser; anything else falls back to the default page. Closes an open redirect (`//evil.com`, `/\evil.com`) that was there before 0.6.4.2. | +| 8.183 | **"Element", not "piece"** (user 2026-10-28; 0.6.4.2 and 0.6.4.3). "Piece" is not the maintainer's word; in user-facing text a single physical building component is an "element" (chosen so it is not confused with a Grasshopper component). "Component" keeps its meaning (the glossary entry); the single items of a batch are its elements. Origin: the agent sessions since 2026-10-09 (about 720 uses in the web app, 300 in the backend, 135 in the Grasshopper sources). (a) 0.6.4.2: every text a user sees in the web app, the Data Model page included; the backend's error messages, the mail templates, the MCP tool descriptions and the OpenAPI descriptions; the README; the unreleased 0.6.4.2 CHANGELOG entry; `CONTEXT.md` ("piece" under _Avoid_ for Component) and `DATA_MODEL_SPEC.md`, so that briefs and agents stop copying the word. (b) 0.6.4.3: the Grasshopper descriptions, with the re-export. (c) Unchanged: code comments, earlier CHANGELOG entries and this log (append-only). Each hit is read before it changes: "piece" in another sense ("a piece of information") stays. "Element" in the IFC sense (`IfcBuildingElement`) agrees in meaning. | **Facts confirmed (user, 2026-09-28):** the 35 ZirKuS reinforcement bars were modelled after the original drawing --> `basis: drawing` (step 6d). The 2024-07-24 deinstallation applies to all 16 diff --git a/docs/adr/IMPLEMENTATION_PLAN_0.6.md b/docs/adr/IMPLEMENTATION_PLAN_0.6.md index 4abbfb7f..7cf41526 100644 --- a/docs/adr/IMPLEMENTATION_PLAN_0.6.md +++ b/docs/adr/IMPLEMENTATION_PLAN_0.6.md @@ -982,9 +982,9 @@ fold (once it is clear which quantities are searched); Atlas Search for typo-tol **0.6.4.1 --- hardening (user 2026-10-27, before 0.6.5):** first the MCP connector, from two chat reports. (a) Search by evidence method (8.177): `evidence_method` on the catalog list, `has_evidence` on the MCP search tools; Browse later. (b) Recognizable connector: instructions that name the domain in English and German (reused and salvaged building components, Bauteile, Wiederverwendung, concrete walls and beams, reinforcement / Bewehrung) and say to use these tools before a web search for such pieces; `website_url` and `icons` on the server; a title and `readOnlyHint` on every tool; tool descriptions that name the evidence methods. (c) The geometry summary drops the `reinforcements` count (always 0 since step 6d moved the bars to evidence, 7.8) and gains the reinforcement layouts of the version (records and bars) with a pointer to `get_evidence`. (d) The evidence list rows of a `reinforcement_layout` carry the bar count, basis, specs, diameters and cover; `performed_by` shows an organization instead of `null`. (e) The write model no longer accepts `geometry.reinforcements` (7.8). (b) to (e) confirmed by the user 2026-10-27; the server icon is the web app's `favicon.ico` until there is a CSC logo. (f) The "Similar pieces" card (8.174 amended): in the left rail on a wide screen, smaller tiles. (g) The `bbx` facet of `/identities/stats` buckets the largest side with edges from the metre era (0 to 1000, then ">=1000"), so in millimetres nearly every piece lands in the last bucket: edges in millimetres instead (for example 100, 250, 500, 1000, 2000, 5000, 10000), checked against the analytics page. (h) The Similar pieces card offers "Show more" only when the first answer says there are more than 6 neighbours, not when there are exactly 6. (g) and (h) added by the user 2026-10-27. (i) Frontend advisories: `undici` (high, fixed in 7.30.1) and `fast-uri` (two medium, two low, fixed in 3.1.9) come only through `shadcn`, the component generator, which is a `devDependency` already; the lockfile takes the fixed versions. (j) The import scripts (`scripts/import/requirements-import.txt`) move to Pillow 13.0.0 (20 alerts); they run locally, the accepted risk of the backend pin stays as it is. (k) E-mail verification drops the fallback to a token stored in plain text (the TODO for 0.6.2 in `auth.py`; such tokens expired 24 hours after 0.6.1.1). (i) to (k) added by the user 2026-10-27. (e) stays with `geometry.reinforcements` only (user 2026-10-27): `geometry.marker_points` is still written by the robot rubble scan pipeline, which is not in use now; both go to the backlog below. (l) Seven tests in `tests/grasshopper` hard-code the client `gh-userobjects/0.6.3.0` and fail since the version bump of 0.6.4.0 (CI does not run `tests/grasshopper`): they read the expected client from the `CSC_CLIENT` line of `DDU_CSC_Session.py` and check that it is not newer than `VERSION` (the rule of `check_version.py`), so a bump with or without `--gh` no longer breaks them; found during T1, built with T3 and a fix round after the bump. (m) "Show in viewer" on the card of a reinforcement layout (8.178, user 2026-10-27): the viewer draws that one record on its version whatever its status, so a submitted draft can be seen and checked; built as T4. -**0.6.4.2 --- second hardening, web and backend (user 2026-10-28, before 0.6.5; 8.179):** no Grasshopper changes (`bump-version` without `--gh`). (a) #35: on session expiry a component page that is not public to anonymous visitors (and a draft view on a public one) is no longer exempt from `SessionMonitor`; a public piece stays readable, signed out and rendered again as anonymous (8.182 a). The return address after sign-in only accepts addresses on this site (8.182 b, an open redirect found in the review). (b) #37: a `reinforcement_layout` event in the History graph opens the layout in the viewer as "Show in viewer" does (8.178); other records scroll to their card, also a corrected one. (c) #39: credits and imprint take the box width, padding, text sizes and link style of the privacy page; wording, structure and the card title icons stay. (d) #34: `organization_url` in the profile, copied into the "You" performer, and "Add my organisation" in the performers field. (e) The Browse filter for the evidence method (8.177; the list already takes `evidence_method`). (f) 8.178 follow-ups: the diameter colour mode with a chosen layout; the legend key by layout id. (g) `shadcn` (dev only) to >=4.22.1, about two weeks old from 2026-11-01; the maintainer runs the update. (h) The 61 warnings of `invoke test-release`: sorted, the cheap ones fixed, the rest reported. (i) The unused `bbxX` type removed from `lib/analytics.ts` (whether the backend keeps the field depends on other readers, to be reported). (j) A data model reference page for users (8.181): the entities, the rules, field tables, the vocabularies and an example per evidence method; hand-written text and field tables, vocabulary descriptions from `vocab.py` through `GET /vocab`; `/reference`, "Data Model", in the sidebar next to Grasshopper; one made-up example piece through all sections; drafted by the implementer, wording approved by the maintainer; built before (h), about 2--3 days. +**0.6.4.2 --- second hardening, web and backend (user 2026-10-28, before 0.6.5; 8.179):** no Grasshopper changes (`bump-version` without `--gh`). (a) #35: on session expiry a component page that is not public to anonymous visitors (and a draft view on a public one) is no longer exempt from `SessionMonitor`; a public piece stays readable, signed out and rendered again as anonymous (8.182 a). The return address after sign-in only accepts addresses on this site (8.182 b, an open redirect found in the review). (b) #37: a `reinforcement_layout` event in the History graph opens the layout in the viewer as "Show in viewer" does (8.178); other records scroll to their card, also a corrected one. (c) #39: credits and imprint take the box width, padding, text sizes and link style of the privacy page; wording, structure and the card title icons stay. (d) #34: `organization_url` in the profile, copied into the "You" performer, and "Add my organisation" in the performers field. (e) The Browse filter for the evidence method (8.177; the list already takes `evidence_method`). (f) 8.178 follow-ups: the diameter colour mode with a chosen layout; the legend key by layout id. (g) `shadcn` (dev only) to 4.22.1, pinned exactly; the maintainer ran the update on 2026-10-29 with `--before=2026-10-20`, and `npm audit fix` with the same limit, so no package in the lockfile is younger than nine days. `npm audit fix` without a date had lifted `shadcn` to 4.23.0 (two days old) and was undone. `body-parser` (high, fixed only in 2.4.0 of 2026-10-22) and `deepmerge` (one low advisory, counted three times by npm through `@shadcn/registry` and `shadcn`; no fix) stay open, dev only, through `shadcn`. (h) The 61 warnings of `invoke test-release`: sorted, the cheap ones fixed, the rest reported. (i) The unused `bbxX` type removed from `lib/analytics.ts` (whether the backend keeps the field depends on other readers, to be reported). (j) A data model reference page for users (8.181): the entities, the rules, field tables, the vocabularies and an example per evidence method; hand-written text and field tables, vocabulary descriptions from `vocab.py` through `GET /vocab`; `/reference`, "Data Model", in the sidebar next to Grasshopper, seven tabs with folded lists (8.181 c amended); one made-up example piece through all sections; drafted by the implementer, wording approved by the maintainer; built before (h), about 2--3 days. (k) "Element" instead of "piece" in all user-facing text, the spec and `CONTEXT.md` (8.183 a). (l) Component page (user 2026-10-28): "Add evidence" moves to the evidence records card (8.118 Q1 amended), the properties card keeps only a quiet link in its empty state; the properties card gets a "?" that says properties are values derived from the evidence. -**0.6.4.3 --- Grasshopper hardening (user 2026-10-28, after 0.6.4.2; 8.180):** only the Grasshopper side (`bump-version --gh` first, then the export in Rhino 8). (a) #40, with #32 and #33 as its first cases: the scan of 2026-10-28 found eleven components that report a missing input with `_addError` through `BuildError` (`Actor`, `ApplyFrame`, `Capture`, `ComputeFrame`, `CreateComponentIdentity`, `CreateComponentSnapshot`, `FetchReinforcementLayout`, `IdentityMetadata`, `Origin`, `ReinforcementLayout`, `SnapshotMetadata`; `AddEvidence` already warns), fourteen outputs started as `''` or `None`, and an `empty_outputs()` that returns `None` in 47 components. The fix belongs in the shared library (a missing-input error reported as a warning, an empty tree helper) and then in every component; the implementer lists each component and what changed. (b) #36: `ReadFromD2P` resolves the D2P component from a tagged member object, with a live check in Rhino by the maintainer. (c) The descriptions of `ApplyFrame`, moved from 0.6.5 (e). (d) The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests: cause found, fixed or explained. +**0.6.4.3 --- Grasshopper hardening (user 2026-10-28, after 0.6.4.2; 8.180):** only the Grasshopper side (`bump-version --gh` first, then the export in Rhino 8). (a) #40, with #32 and #33 as its first cases: the scan of 2026-10-28 found eleven components that report a missing input with `_addError` through `BuildError` (`Actor`, `ApplyFrame`, `Capture`, `ComputeFrame`, `CreateComponentIdentity`, `CreateComponentSnapshot`, `FetchReinforcementLayout`, `IdentityMetadata`, `Origin`, `ReinforcementLayout`, `SnapshotMetadata`; `AddEvidence` already warns), fourteen outputs started as `''` or `None`, and an `empty_outputs()` that returns `None` in 47 components. The fix belongs in the shared library (a missing-input error reported as a warning, an empty tree helper) and then in every component; the implementer lists each component and what changed. (b) #36: `ReadFromD2P` resolves the D2P component from a tagged member object, with a live check in Rhino by the maintainer. (c) The descriptions of `ApplyFrame`, moved from 0.6.5 (e). (d) The 8 `PytestUnhandledThreadExceptionWarning` of the Grasshopper tests: cause found, fixed or explained. (e) "Element" instead of "piece" in the Grasshopper descriptions (8.183 b). **0.6.5 --- reinforcement from Grasshopper (about 6--8 days; moved from 0.6.4 by the user 2026-10-21):** (a) units in GH: every component scales by the document unit (a prerequisite for placing scans); (b) RL8, a GH builder @@ -1028,9 +1028,8 @@ and the privacy page a German text (the maintainer's own); a rule for the implem written in both languages. Grasshopper and MCP texts stay English. **Outside a release (the maintainer):** the Atlas traffic measurement of 0.6.1.0 (c); the backend CI job back to `ubuntu-latest` once MongoDB -8.0 starts on the runner's kernel (SERVER-121912); `shadcn` (dev only) lifted to >=4.22.1 once that -version is about two weeks old, which clears the six remaining dev findings of `npm audit` (found in the -review of 0.6.4.1). +8.0 starts on the runner's kernel (SERVER-121912); the two open dev findings of `npm audit` +(`body-parser`, `deepmerge`, both through `shadcn`) once fixed versions exist and are about two weeks old (0.6.4.2 (g)). **Later or ideas:** the GH sign-in on macOS (Keychain); Ferroscan "the image in 3D"; MCP opened to members (after 0.6.3.1); the CSC logo and brand, then the logo in mails, Open Graph and the favicon; the partners on diff --git a/pytest.ini b/pytest.ini index 68f684cc..42ea4c35 100644 --- a/pytest.ini +++ b/pytest.ini @@ -4,3 +4,6 @@ markers = slow: expensive tests (headless Rhino, a migration on a dump, fits on real PLYs, > ~5 s); skipped by default, run by `invoke test-release` or `pytest -m ""` # slow tests stay out of the everyday run; `-m ""` (or `invoke test-release`) brings them back addopts = -m "not slow" +# a coplanar point set has zero volume: trimesh divides by it on purpose-built test input (frame, descriptors) +filterwarnings = + ignore:invalid value encountered in divide:RuntimeWarning:trimesh.triangles diff --git a/src/backend/apps/catalog/api/access.py b/src/backend/apps/catalog/api/access.py index db2dbd70..2c8c00a9 100644 --- a/src/backend/apps/catalog/api/access.py +++ b/src/backend/apps/catalog/api/access.py @@ -116,7 +116,7 @@ async def identity_ever_published(request: Request, UNREVIEWED = ('This dataset has not been reviewed by an admin yet: it stays ' - 'visible to its members only, and its pieces cannot be made ' + 'visible to its members only, and its elements cannot be made ' 'public until it is reviewed.') diff --git a/src/backend/apps/catalog/api/access_tokens.py b/src/backend/apps/catalog/api/access_tokens.py index b025a853..69f26a01 100644 --- a/src/backend/apps/catalog/api/access_tokens.py +++ b/src/backend/apps/catalog/api/access_tokens.py @@ -175,7 +175,7 @@ def _too_many() -> HTTPException: def _check_days(days: int) -> int: if days not in tk.PAT_LIFETIME_DAYS: raise HTTPException( - status.HTTP_422_UNPROCESSABLE_ENTITY, + 422, 'days must be one of ' + ', '.join( str(d) for d in tk.PAT_LIFETIME_DAYS)) return days diff --git a/src/backend/apps/catalog/api/actors.py b/src/backend/apps/catalog/api/actors.py index 541774c5..cfc5d6ff 100644 --- a/src/backend/apps/catalog/api/actors.py +++ b/src/backend/apps/catalog/api/actors.py @@ -38,7 +38,8 @@ ACTOR_KINDS = ('user', 'person', 'organization') PERSONAL = ('name', 'email', 'orcid') # the personal fields of an account's profile (8.133 g) -PROFILE_FIELDS = ('full_name', 'organization', 'organization_ror', 'orcid') +PROFILE_FIELDS = ('full_name', 'organization', 'organization_ror', + 'organization_url', 'orcid') class RedactBody(BaseModel): diff --git a/src/backend/apps/catalog/api/batches.py b/src/backend/apps/catalog/api/batches.py index 74b3182f..cef5adc8 100644 --- a/src/backend/apps/catalog/api/batches.py +++ b/src/backend/apps/catalog/api/batches.py @@ -164,7 +164,7 @@ async def check_draw_fits(request: Request, batch: Dict[str, Any], size = await batch_size(request, batch) raise HTTPException( status_code=409, - detail=f'Only {max(remaining, 0)} of {size} pieces remain in ' + detail=f'Only {max(remaining, 0)} of {size} elements remain in ' f'the batch; the draw takes {quantity} (8.105).') @@ -175,7 +175,7 @@ async def check_batch_correction(request: Request, identity: Dict[str, Any], if quantity < drawn: raise HTTPException( status_code=409, - detail=f'{drawn} pieces were drawn from this batch; its ' + detail=f'{drawn} elements were drawn from this batch; its ' f'quantity cannot go below that (I32).') diff --git a/src/backend/apps/catalog/api/catalog_list.py b/src/backend/apps/catalog/api/catalog_list.py index 894c425d..5caa4021 100644 --- a/src/backend/apps/catalog/api/catalog_list.py +++ b/src/backend/apps/catalog/api/catalog_list.py @@ -232,7 +232,7 @@ async def _candidate_ids(request: Request, args: Dict[str, Any], @router.get( '/identities/{identity_id}/similar', - summary='The pieces nearest to one in descriptor space (kNN)', + summary='The elements nearest to one in descriptor space (kNN)', ) @local_limiter.limit(LIST_RATE, key_func=signed_in_or_ip) async def get_similar_identities( @@ -247,13 +247,13 @@ async def get_similar_identities( count: int = Query(10, ge=1, le=sim.MAX_NEIGHBOURS, description='how many neighbours, 1 to 50'), ): - """The ``count`` pieces nearest to this one in the full descriptor space + """The ``count`` elements nearest to this one in the full descriptor space of ``basis`` (decision 8.174): Euclidean distance after each dimension is - standardised over the catalog (smaller is more similar). The pieces ranked + standardised over the catalog (smaller is more similar). The elements ranked are those this caller may see that pass the filters of the list (also a dimension and a near search): the filters come first, then the ranking, so "similar and can hold X and within 50 km" returns the k nearest that pass. - The piece itself is never one of them. A piece the caller cannot see is + The element itself is never one of them. An element the caller cannot see is 404; one without the descriptor of the basis is 422; before the matrix of the basis has been computed (``main_component_map.py``) the answer is 409.""" @@ -288,7 +288,7 @@ async def get_similar_identities( feature, matrix.mean, matrix.std, matrix.flat) if query is None: raise HTTPException( - status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, + status_code=422, detail=f'This component has no {basis_label(basis)} ' f'descriptor, so it cannot be compared.') args = await _pipelines_args(request, filters, current_user) @@ -364,15 +364,15 @@ async def get_identities_locations( current_user: Annotated[Optional[User], Depends(get_optional_current_user)], filters: Annotated[CatalogFilters, Depends(catalog_filters)], layer: NearLayer = Query( - 'current', description='which place of a piece is a point: ' + 'current', description='which place of an element is a point: ' 'current (the location of the current ' 'version) or origin (the origin building)'), ): - """Every piece this caller may see that matches the filters and has a + """Every element this caller may see that matches the filters and has a point on the layer (decisions 8.170, 8.171), with what the map colours - and labels it by; the pieces without a point are only counted + and labels it by; the elements without a point are only counted (``left_out``). The filters, the visibility and a near or fit search are - those of the list. A piece never appears for someone who may not see it, + those of the list. An element never appears for someone who may not see it, and neither does it count.""" if current_user is None: filters = public_filters(filters) @@ -655,7 +655,6 @@ def topn(items): 'createdMonthly': _normalize_stats_facet_lists( raw.get('createdMonthly') ), - 'bbxX': _normalize_stats_facet_lists(raw.get('bbx')), # the overview of the MCP tool (8.173): the range of each sorted # side in mm, the pieces with a point on each location layer, and # the counted pieces that are not public @@ -693,7 +692,7 @@ async def list_identities_route( size: int = Query(0, description='Page size (0=get all)'), sortkey: Optional[str] = Query( None, description='Sort key; volume = the product of the three bbx ' - 'sides (a piece without bbx last); match = the ' + 'sides (an element without bbx last); match = the ' 'closeness to the dimension search (needs ' 'fit_mode); distance = the distance to the near ' 'point (needs near_lat and near_lon). Default: ' diff --git a/src/backend/apps/catalog/api/datasets.py b/src/backend/apps/catalog/api/datasets.py index 25fbc881..4515f51f 100644 --- a/src/backend/apps/catalog/api/datasets.py +++ b/src/backend/apps/catalog/api/datasets.py @@ -33,6 +33,7 @@ clean_text, normalize_orcid, normalize_ror, + normalize_url, ) from apps.catalog.permissions import dataset_roles from apps.catalog.vocab import ( @@ -86,6 +87,7 @@ class Me(BaseModel): # the personal profile (8.133) organization: Optional[str] = None organization_ror: Optional[str] = None + organization_url: Optional[str] = None orcid: Optional[str] = None default_role: ActorRole = 'operator' @@ -119,7 +121,7 @@ class DatasetView(BaseModel): 'moderator(D) and admin only, else absent') component_count: Optional[int] = Field( default=None, - description='list rows only: published pieces the caller may see') + description='list rows only: published elements the caller may see') model_config = {'populate_by_name': True} @@ -142,7 +144,7 @@ class DatasetPatch(BaseModel): visibility: Optional[Visibility] = None reviewed: Optional[bool] = Field( None, description='admin only: the dataset may be catalog and its ' - 'pieces public (8.139)') + 'elements public (8.139)') class MemberRoles(BaseModel): @@ -227,7 +229,8 @@ def _me_view(user: User, memberships: List[Membership], email=user.email, role=user.role, memberships=memberships, moderated_datasets=moderated, organization=user.organization, - organization_ror=user.organization_ror, orcid=user.orcid, + organization_ror=user.organization_ror, + organization_url=user.organization_url, orcid=user.orcid, default_role=user.default_role or 'operator') @@ -239,6 +242,7 @@ class ProfilePatch(BaseModel): full_name: Optional[str] = Field(None, max_length=200) organization: Optional[str] = Field(None, max_length=200) organization_ror: Optional[str] = Field(None, max_length=200) + organization_url: Optional[str] = Field(None, max_length=1000) orcid: Optional[str] = Field(None, max_length=60) default_role: Optional[ActorRole] = None @@ -251,7 +255,8 @@ async def patch_me( body: ProfilePatch, ): """``full_name``, ``organization``, ``organization_ror`` (a ROR id or - URL), ``orcid`` (format and check digit) and ``default_role``. Records + URL), ``organization_url`` (the web page of the organization, http or + https), ``orcid`` (format and check digit) and ``default_role``. Records take the values over when they are written; a later change never rewrites a record.""" sent = body.model_dump(exclude_unset=True) @@ -268,6 +273,10 @@ async def patch_me( changes['organization_ror'] = ( normalize_ror(sent['organization_ror']) if clean_text(sent['organization_ror']) else None) + if 'organization_url' in sent: + changes['organization_url'] = ( + normalize_url(sent['organization_url']) + if clean_text(sent['organization_url'], 1000) else None) if 'orcid' in sent: changes['orcid'] = (normalize_orcid(sent['orcid']) if clean_text(sent['orcid']) else None) @@ -560,7 +569,7 @@ async def put_dataset_member( class PublicBody(BaseModel): model_config = ConfigDict(extra='forbid') - is_public: bool = Field(description='the flag to set on the pieces') + is_public: bool = Field(description='the flag to set on the elements') dry_run: bool = Field(False, description='only count what would change') @@ -575,7 +584,7 @@ class PublicResult(BaseModel): @router.post('/datasets/{did}/public', response_model=PublicResult, - summary='Make every published piece of a dataset public or ' + summary='Make every published element of a dataset public or ' 'private (moderator(D))') async def set_dataset_public( request: Request, @@ -583,10 +592,10 @@ async def set_dataset_public( did: str, body: PublicBody, ): - """Sets ``is_public`` on the pieces of the dataset that were ever + """Sets ``is_public`` on the elements of the dataset that were ever published (3.1.5) and are not withdrawn, where the flag differs, and logs each change like a metadata PATCH (``cause: patch``). Unpublished and - withdrawn pieces are left alone, and so are children: no piece follows + withdrawn elements are left alone, and so are children: no element follows another (6.2). ``dry_run`` only counts.""" dataset = (await load_dataset(request, current_user, did, 'set_dataset_public')).record @@ -618,7 +627,7 @@ async def set_dataset_public( invalid[identity['_id']] = str(exc.detail) if invalid: raise HTTPException(status_code=422, detail={ - 'message': f'{len(invalid)} of {len(pieces)} pieces do not pass ' + 'message': f'{len(invalid)} of {len(pieces)} elements do not pass ' f'validation; nothing was changed. Correct them first.', 'pieces': invalid}) changed = skipped = 0 @@ -646,8 +655,8 @@ async def delete_dataset( current_user: Annotated[User, Depends(get_current_active_user)], did: str, ): - """Only while the dataset holds no piece at all (no identity, whatever - its state; for an admin too: move the pieces first, ``move_identity``). + """Only while the dataset holds no element at all (no identity, whatever + its state; for an admin too: move the elements first, ``move_identity``). The open invitations into it are revoked with it (8.139 f).""" await load_dataset(request, current_user, did, 'delete_dataset') pieces = await request.app.mongodb_component_identities.count_documents( @@ -655,7 +664,7 @@ async def delete_dataset( if pieces: raise HTTPException( status_code=409, - detail='The dataset still holds pieces: move them to another ' + detail='The dataset still holds elements: move them to another ' 'dataset first.') now = now_iso() revoked = await request.app.mongodb_invitations.update_many( diff --git a/src/backend/apps/catalog/api/evidence.py b/src/backend/apps/catalog/api/evidence.py index b6ebaaf7..e3b84028 100644 --- a/src/backend/apps/catalog/api/evidence.py +++ b/src/backend/apps/catalog/api/evidence.py @@ -222,7 +222,7 @@ async def create_evidence_bulk( ): """contributor(D) of every target. Fan-out (three rebound areas, one inspection noting several findings) and apply-to-several (a claim for - a batch of pieces) end here (7.6). Every record is validated before + a batch of elements) end here (7.6). Every record is validated before the first is inserted; one problem rejects the whole request and names the record by its position.""" identities: Dict[str, Dict[str, Any]] = {} @@ -347,7 +347,7 @@ async def list_identity_evidence( 'whole day)'), status: str = Query('published', description='a status, or all'), include: Optional[str] = Query( - None, description='comma list: context (the state of the piece each ' + None, description='comma list: context (the state of the element each ' 'record belongs to), superseded (corrected ones)'), ): """Published, non-superseded records by default; what the caller may @@ -650,7 +650,7 @@ async def get_timeline( ): """Archived cycles, the origin, every state and correction, every evidence record (where it falls: before cataloguing, in the history, - after the piece left circulation), changes of the metadata and the exit. + after the element left circulation), changes of the metadata and the exit. What the caller may not see is left out; a withdrawn record outside the dataset is a bare row; outside the dataset a metadata change shows only its date (8.36).""" diff --git a/src/backend/apps/catalog/api/evidence_attachments.py b/src/backend/apps/catalog/api/evidence_attachments.py index f334d04f..eff67c81 100644 --- a/src/backend/apps/catalog/api/evidence_attachments.py +++ b/src/backend/apps/catalog/api/evidence_attachments.py @@ -221,7 +221,7 @@ async def list_attachments( evidence_id: str, ): """The list as the viewer may see it. Anonymous readers of a public - piece get media type, size, checksum and date --- no names, no + element get media type, size, checksum and date --- no names, no uploaders --- and "sign in to download" (8.13).""" loaded = await load_evidence(request, current_user, evidence_id, allow_tombstone=True) diff --git a/src/backend/apps/catalog/api/evidence_service.py b/src/backend/apps/catalog/api/evidence_service.py index d8e7bbf6..de5d43b1 100644 --- a/src/backend/apps/catalog/api/evidence_service.py +++ b/src/backend/apps/catalog/api/evidence_service.py @@ -67,7 +67,7 @@ # WHAT A CLIENT SENDS --------------------------------------------------------- class PositionInput(BaseModel): - """Where on the piece (3.3.2). ``kind: none`` with a description is + """Where on the element (3.3.2). ``kind: none`` with a description is always enough; a point is picked on the 3D viewer and needs the snapshot whose stored coordinates it uses.""" model_config = ConfigDict(extra='forbid') @@ -82,7 +82,7 @@ class PositionInput(BaseModel): None, description='Picked point in stored coordinates; for a rebound ' 'grid the server sets the grid centre') description: Optional[str] = Field( - None, description='Where on the piece, in words, e.g. "north face, ' + None, description='Where on the element, in words, e.g. "north face, ' 'mid-span"') @@ -334,7 +334,7 @@ def gate_identity(identity: Dict[str, Any], and parse_ts(observed_at) > parse_ts(exit_['at']): raise HTTPException( status_code=409, - detail=f'The component no longer exists as this piece ' + detail=f'The component no longer exists as this element ' f'({exit_["kind"]}, {exit_["at"]}): only observations ' f'from before that date are recorded (I28).') diff --git a/src/backend/apps/catalog/api/history.py b/src/backend/apps/catalog/api/history.py index dfe13ebe..abccd168 100644 --- a/src/backend/apps/catalog/api/history.py +++ b/src/backend/apps/catalog/api/history.py @@ -126,7 +126,7 @@ async def get_identity_history( 'groups', description='groups: evidence per day and method; all: ' 'every record its own event'), ): - """The piece is the middle lane (level 0), parents have negative levels + """The element is the middle lane (level 0), parents have negative levels and children positive ones. Every lane has ``id``, ``role``, ``level`` and ``visible``; a visible one also its header and ``events``. ``links`` join a parent and a child lane (``cut``: one parent; ``assemble``: diff --git a/src/backend/apps/catalog/api/identity_edit.py b/src/backend/apps/catalog/api/identity_edit.py index 0cf2e7da..0c2355e5 100644 --- a/src/backend/apps/catalog/api/identity_edit.py +++ b/src/backend/apps/catalog/api/identity_edit.py @@ -600,7 +600,7 @@ async def exit_identity( body: ExitBody, ): """Installed, recycled, disposed, returned, lost --- or a hand-set - ``split`` without catalogued pieces. ``merged`` is only ever set by the + ``split`` without catalogued elements. ``merged`` is only ever set by the server (8.8). ``construction_work`` only for ``installed`` (I18).""" identity = (await load_identity(request, current_user, identity_id, 'exit')).record @@ -618,12 +618,12 @@ async def exit_identity( if body.kind == 'merged': raise HTTPException(status_code=422, detail='merged is set by the server when a ' - 'merged piece is published (8.8).') + 'merged element is published (8.8).') if (identity.get('origin') or {}).get('planned') \ and body.kind not in IN_PLACE_EXIT_KINDS: raise HTTPException( status_code=409, - detail=f'A piece still in place leaves as ' + detail=f'An element still in place leaves as ' f'{", ".join(IN_PLACE_EXIT_KINDS)} only; it never left ' f'its works, so it was not {body.kind}. Record its ' f'deinstallation first (8.104).') @@ -653,7 +653,7 @@ async def undo_exit( if exit_.get('recorded_by_user_id') is None: raise HTTPException( status_code=409, - detail='This split / merge follows from published pieces cut ' + detail='This split / merge follows from published elements cut ' 'from it; withdraw those to undo it (8.8).') after = _validated({**identity, 'exit': None}) written = await _write(request, identity, after, @@ -671,7 +671,7 @@ async def reenter_identity( body: ReenterBody, ): """ - An installed, returned or lost piece comes back with a new origin; the + An installed, returned or lost element comes back with a new origin; the old ``{origin, exit}`` goes to ``past_cycles`` (3.1.3). Terminal exits cannot re-enter (I18). The next snapshot defaults to the new ``origin.at`` (8.19). A re-entered child owns its new origin. @@ -684,7 +684,7 @@ async def reenter_identity( 'circulation.') if exit_.get('kind') in TERMINAL_EXIT_KINDS: raise HTTPException(status_code=409, - detail=f'A {exit_["kind"]} piece no longer exists ' + detail=f'A {exit_["kind"]} element no longer exists ' f'as this component; it cannot re-enter ' f'(I18).') cycles = [*(identity.get('past_cycles') or []), @@ -761,12 +761,12 @@ async def undo_deinstall_refusal(request: Request, identity: Dict[str, Any] origin = identity.get('origin') or {} if origin.get('planned') or origin.get('kind') not in ( 'deinstallation', 'demolition'): - return 'The piece is not a deinstalled one.' + return 'The element is not a deinstalled one.' exit_ = identity.get('exit') if (exit_ and exit_.get('recorded_by_user_id') is not None and exit_.get('kind') not in IN_PLACE_EXIT_KINDS): - return (f'The piece left as {exit_["kind"]}, which only a ' - f'deinstalled piece can do (8.104).') + return (f'The element left as {exit_["kind"]}, which only a ' + f'deinstalled element can do (8.104).') if not origin.get('at'): return ('The deinstallation has no date; set the date by PATCH ' 'of the origin first (8.115).') @@ -783,7 +783,7 @@ async def undo_deinstall_refusal(request: Request, identity: Dict[str, Any] @router.post('/identities/{identity_id}/deinstall', - summary='Record the deinstallation of an in-place piece ' + summary='Record the deinstallation of an in-place element ' '(moderator(D))') async def deinstall_identity( request: Request, @@ -794,7 +794,7 @@ async def deinstall_identity( """ ``planned`` becomes false and the given fields go into the existing origin; ``kind`` may switch to ``demolition``. A reservation survives; - no snapshot is created. The origin is now the piece's own, and every + no snapshot is created. The origin is now the element's own, and every descendant that still inherits it follows, like a parent's PATCH of ``origin`` (3.1.2, 8.110). """ @@ -803,7 +803,7 @@ async def deinstall_identity( origin = identity.get('origin') or {} if not origin.get('planned'): raise HTTPException(status_code=409, - detail='The piece is not in place; there is ' + detail='The element is not in place; there is ' 'nothing to deinstall.') if identity.get('withdrawn'): raise HTTPException(status_code=409, @@ -811,7 +811,7 @@ async def deinstall_identity( if (identity.get('exit') or {}).get('recorded_by_user_id') is not None: # a split the server keeps from cut pieces does not stop it raise HTTPException(status_code=409, - detail='The piece left circulation while in ' + detail='The element left circulation while in ' 'place; undo that exit first.') given = body.model_dump(mode='json', exclude_none=True) new_origin = {**origin, 'planned': False, **given} diff --git a/src/backend/apps/catalog/api/identity_filters.py b/src/backend/apps/catalog/api/identity_filters.py index 908cff16..c6cec7b8 100644 --- a/src/backend/apps/catalog/api/identity_filters.py +++ b/src/backend/apps/catalog/api/identity_filters.py @@ -228,14 +228,14 @@ def catalog_filters( q: str = Query('', max_length=FILTER_MAX_LENGTH, description='name, catalogue number or id'), evidence_method: Optional[EvidenceMethod] = Query( - None, description='only pieces with at least one published, current ' + None, description='only elements with at least one published, current ' 'evidence record of this method (8.177), for example ' 'reinforcement_layout; combines with every other ' 'filter'), fit_mode: Optional[FitMode] = Query( None, description='dimension search (8.169): about = every side ' 'within fit_tol of fit_size; can_hold = every side ' - 'of the piece at least fit_size'), + 'of the element at least fit_size'), fit_size: Optional[str] = Query( None, max_length=FILTER_MAX_LENGTH, description='three sizes in mm in any order, for example ' @@ -251,12 +251,12 @@ def catalog_filters( None, description='near search: longitude, -180 to 180; needs ' 'near_lat'), near_layer: Optional[NearLayer] = Query( - None, description='which point of a piece is measured: current (the ' + None, description='which point of an element is measured: current (the ' 'location of the current version, default) or ' 'origin (the origin building)'), radius_km: Optional[float] = Query( - None, description='near search: only pieces within this many km; ' - 'without it every piece with a point on the layer, ' + None, description='near search: only elements within this many km; ' + 'without it every element with a point on the layer, ' 'nearest first'), ) -> CatalogFilters: """FastAPI dependency: the catalog filters from the query string.""" diff --git a/src/backend/apps/catalog/api/identity_lifecycle.py b/src/backend/apps/catalog/api/identity_lifecycle.py index 2be3ca70..c2de46f0 100644 --- a/src/backend/apps/catalog/api/identity_lifecycle.py +++ b/src/backend/apps/catalog/api/identity_lifecycle.py @@ -45,7 +45,7 @@ class WithdrawIdentityBody(BaseModel): reason: str = Field(min_length=1) duplicate_of: Optional[str] = Field( - None, description='the canonical piece this one duplicates') + None, description='the canonical element this one duplicates') class PurgeBody(BaseModel): @@ -95,8 +95,8 @@ async def withdraw_identity( """ Hidden everywhere by default; members of D see it in full, everyone else who could see it a tombstone (8.17). With ``duplicate_of`` the - resolver and the component page lead to the canonical piece; pieces - that named this one as their canonical piece follow along (I19). + resolver and the component page lead to the canonical element; elements + that named this one as their canonical element follow along (I19). """ identity = (await load_identity(request, current_user, identity_id, 'withdraw_identity')).record @@ -118,15 +118,15 @@ async def withdraw_identity( if target.get('withdrawn'): raise HTTPException( status_code=422, - detail='duplicate_of is withdrawn itself; name the piece it ' + detail='duplicate_of is withdrawn itself; name the element it ' 'leads to (I19).') followers = await request.app.mongodb_component_identities.count_documents( {'withdrawn.duplicate_of': identity_id}) if followers and duplicate_of is None: raise HTTPException( status_code=409, - detail=f'{followers} withdrawn piece(s) name this one as their ' - f'canonical piece; give duplicate_of so they follow ' + detail=f'{followers} withdrawn element(s) name this one as their ' + f'canonical element; give duplicate_of so they follow ' f'(I19).') now = now_iso() withdrawn = {'at': now, 'by_user_id': current_user.id, @@ -222,7 +222,7 @@ async def delete_identity( if referenced: raise HTTPException( status_code=409, - detail=f'Other pieces name this one (catalog numbers ' + detail=f'Other elements name this one (catalog numbers ' f'{referenced}); resolve those links first.') snapshots = await db.mongodb_component_snapshots.find( {'identity_id': identity_id}, {'_id': 1}).to_list(length=None) @@ -304,7 +304,7 @@ async def resolve_id( """ ``Accept: text/html`` --> 302 to the component page; otherwise 302 to the passport. A withdrawn duplicate --> 301 to ``/id/{duplicate_of}``; - other withdrawn pieces and pieces without a current state still + other withdrawn elements and elements without a current state still redirect (the page shows the tombstone / "no current state"); purged --> 410; unknown or never published (unless the caller may see it) --> 404. Visibility applies after the redirect (8.11). diff --git a/src/backend/apps/catalog/api/identity_query.py b/src/backend/apps/catalog/api/identity_query.py index b6fceab4..1db423b9 100644 --- a/src/backend/apps/catalog/api/identity_query.py +++ b/src/backend/apps/catalog/api/identity_query.py @@ -336,24 +336,6 @@ def build_count_pipeline( {'$eq': ['$is_public', True]}, 0, 1]}}, }}, ], - 'bbx': [ - # the largest side (``_sides``, sorted largest first, as in the - # ``sides`` facet); a piece without three numbers has no size and is - # in no bucket, not in the default one - {'$match': {'_sides': {'$type': 'array'}}}, - { - '$bucket': { - 'groupBy': {'$arrayElemAt': ['$_sides', 0]}, - # millimetres, as bbx is stored: a bucket is labelled with - # its lower edge, the rest is '>=10000' - 'boundaries': [ - 0, 100, 250, 500, 1000, 2000, 5000, 10000, - ], - 'default': '>=10000', - 'output': {'count': {'$sum': 1}}, - } - }, - ], } diff --git a/src/backend/apps/catalog/api/identity_workflows.py b/src/backend/apps/catalog/api/identity_workflows.py index 57545bf6..b7bce46f 100644 --- a/src/backend/apps/catalog/api/identity_workflows.py +++ b/src/backend/apps/catalog/api/identity_workflows.py @@ -102,8 +102,13 @@ async def list_reserved_identities( ) -def _labelled(values, labels): - return [{'value': v, 'label': labels.get(v, v)} for v in values] +def _labelled(values, labels, name=None): + """Value and label; with the vocabulary's name also its one-line + description when the vocabulary has them (8.181 b).""" + described = vocab.VOCAB_DESCRIPTIONS.get(name or '', {}) + return [{'value': v, 'label': labels.get(v, v), + **({'description': described[v]} if v in described else {})} + for v in values] @router.get( @@ -114,36 +119,36 @@ async def get_vocabularies(): """Code vocabularies with display labels; materials: GET /materials.""" return JSONResponse(status_code=200, content={ 'original_function': _labelled(vocab.ORIGINAL_FUNCTIONS, - vocab.ORIGINAL_FUNCTION_LABELS), + vocab.ORIGINAL_FUNCTION_LABELS, name='original_function'), # the shape class a function suggests (a hint, never set for the # user); the label is the shape class, absent for a proxy 'shape_class_hint': [{'value': f, 'label': h} for f, h in vocab.SHAPE_CLASS_HINTS.items() if h], 'shape_class': _labelled(vocab.SHAPE_CLASSES, - vocab.SHAPE_CLASS_LABELS), + vocab.SHAPE_CLASS_LABELS, name='shape_class'), 'origin_kind': _labelled(vocab.ORIGIN_KINDS, - vocab.ORIGIN_KIND_LABELS), - 'exit_kind': _labelled(vocab.EXIT_KINDS, vocab.EXIT_KIND_LABELS), - 'status': _labelled(vocab.STATUSES, {}), - 'precision': _labelled(vocab.PRECISIONS, {}), - 'dgnb_class': _labelled(vocab.DGNB_CLASSES, vocab.DGNB_CLASS_LABELS), + vocab.ORIGIN_KIND_LABELS, name='origin_kind'), + 'exit_kind': _labelled(vocab.EXIT_KINDS, vocab.EXIT_KIND_LABELS, name='exit_kind'), + 'status': _labelled(vocab.STATUSES, {}, name='status'), + 'precision': _labelled(vocab.PRECISIONS, {}, name='precision'), + 'dgnb_class': _labelled(vocab.DGNB_CLASSES, vocab.DGNB_CLASS_LABELS, name='dgnb_class'), 'connection_type': _labelled(vocab.CONNECTION_TYPES, - vocab.CONNECTION_TYPE_LABELS), + vocab.CONNECTION_TYPE_LABELS, name='connection_type'), 'construction_method': _labelled(vocab.CONSTRUCTION_METHODS, - vocab.CONSTRUCTION_METHOD_LABELS), - 'material_group': _labelled(vocab.MATERIAL_GROUPS, {}), + vocab.CONSTRUCTION_METHOD_LABELS, name='construction_method'), + 'material_group': _labelled(vocab.MATERIAL_GROUPS, {}, name='material_group'), 'inherit_unit': _labelled(vocab.INHERITABLE_FIELDS, vocab.INHERIT_UNIT_LABELS), 'change_cause': _labelled(vocab.CHANGE_CAUSES, vocab.CHANGE_CAUSE_LABELS), 'evidence_method': _labelled(vocab.EVIDENCE_METHODS, - vocab.EVIDENCE_METHOD_LABELS), + vocab.EVIDENCE_METHOD_LABELS, name='evidence_method'), 'source_tier': _labelled(vocab.SOURCE_TIERS + ('inherited',), - vocab.SOURCE_TIER_LABELS), + vocab.SOURCE_TIER_LABELS, name='source_tier'), 'verification_state': _labelled(vocab.VERIFICATION_STATES, - vocab.VERIFICATION_STATE_LABELS), + vocab.VERIFICATION_STATE_LABELS, name='verification_state'), 'quantity': _labelled(tuple(vocab.QUANTITY_BY_NAME), - vocab.QUANTITY_LABELS), + vocab.QUANTITY_LABELS, name='quantity'), }) @@ -189,7 +194,7 @@ async def reserve_identity( if identity.get('exit'): raise HTTPException( status_code=409, - detail='A piece out of circulation cannot be reserved (I18)', + detail='An element out of circulation cannot be reserved (I18)', ) reserved = identity.get('reserved') or '' diff --git a/src/backend/apps/catalog/api/profiles.py b/src/backend/apps/catalog/api/profiles.py index 83beb87f..078505ac 100644 --- a/src/backend/apps/catalog/api/profiles.py +++ b/src/backend/apps/catalog/api/profiles.py @@ -2,8 +2,8 @@ """ The profile of an account in the records it takes part in (decision 8.133 e): when an evidence record or an origin is written, an actor of kind ``user`` -gets the empty ``name`` / ``organization`` / ``organization_ror`` / ``orcid`` -from that account's profile. A copy at write time: typed values win, and a +gets the empty ``name`` / ``organization`` / ``organization_ror`` / ``url`` / +``orcid`` from that account's profile. A copy at write time: typed values win, and a later change of the profile never rewrites a record. """ @@ -17,7 +17,7 @@ from apps.catalog.profile import fill_actor PROFILE_FIELDS = {'_id': 1, 'full_name': 1, 'organization': 1, - 'organization_ror': 1, 'orcid': 1} + 'organization_ror': 1, 'organization_url': 1, 'orcid': 1} async def profiles_of(request: Request, user_ids: Iterable[str] diff --git a/src/backend/apps/catalog/api/snapshot_lifecycle.py b/src/backend/apps/catalog/api/snapshot_lifecycle.py index 99ae0b2a..e6f5085f 100644 --- a/src/backend/apps/catalog/api/snapshot_lifecycle.py +++ b/src/backend/apps/catalog/api/snapshot_lifecycle.py @@ -397,7 +397,7 @@ async def _publish_locked(request: Request, user: User, snapshot: dict, reason='the batch was overdrawn') raise HTTPException( status_code=409, - detail='The batch has fewer pieces left than this draw takes ' + detail='The batch has fewer elements left than this draw takes ' '(8.105).') current = identity.get('current_snapshot_id') if predecessor is not None: @@ -438,8 +438,8 @@ async def create_snapshot( identity_id: str, body: SnapshotDraftBody, ): - """contributor(D). ``effective_from`` defaults to now. Only for a piece - in circulation: an exited piece re-enters first (section 3.1.3).""" + """contributor(D). ``effective_from`` defaults to now. Only for an element + in circulation: an exited element re-enters first (section 3.1.3).""" identity = (await load_identity(request, current_user, identity_id, 'create_snapshot')).record if identity.get('withdrawn'): diff --git a/src/backend/apps/catalog/api/snapshots.py b/src/backend/apps/catalog/api/snapshots.py index 3ae0347c..bc1ed793 100644 --- a/src/backend/apps/catalog/api/snapshots.py +++ b/src/backend/apps/catalog/api/snapshots.py @@ -71,7 +71,7 @@ async def list_my_snapshots( """ The versions the caller added (``added_by_user_id``), for "My work" (8.118 Q4): drafts, pending and rejected ones by default, each with its - piece and, when rejected, the reason. Nobody lists another person's + element and, when rejected, the reason. Nobody lists another person's snapshots here. """ if not mine: diff --git a/src/backend/apps/catalog/component_map.py b/src/backend/apps/catalog/component_map.py index aba970b3..881b2367 100644 --- a/src/backend/apps/catalog/component_map.py +++ b/src/backend/apps/catalog/component_map.py @@ -199,6 +199,7 @@ def _embed_umap(matrix: np.ndarray) -> np.ndarray: min_dist=0.1, metric='euclidean', random_state=42, + n_jobs=1, # a seed makes UMAP single-threaded: say so instead of the warning ) return reducer.fit_transform(scaled).astype(np.float64) diff --git a/src/backend/apps/catalog/documents.py b/src/backend/apps/catalog/documents.py index e0b1e29d..9013f467 100644 --- a/src/backend/apps/catalog/documents.py +++ b/src/backend/apps/catalog/documents.py @@ -240,7 +240,7 @@ class Place(_Block): class ConstructionWork(_Block): - """The works a piece left or went into --- never the company.""" + """The works an element left or went into --- never the company.""" name: str identifier: Optional[str] = None year_built: Optional[int] = None @@ -257,10 +257,10 @@ class CircularityClass(_Block): class Origin(_Block): - """How the piece entered circulation (section 3.1.1).""" + """How the element entered circulation (section 3.1.1).""" kind: OriginKind planned: bool = Field( - False, description='true while the piece is in place: identified in ' + False, description='true while the element is in place: identified in ' 'its works, not yet deinstalled (decision 8.104)') at: Optional[Timestamp] = None at_precision: Precision = 'unknown' @@ -290,7 +290,7 @@ def _construction_work_kind(self) -> 'Origin': class Exit(_Block): - """How the piece left circulation (section 3.1.3).""" + """How the element left circulation (section 3.1.3).""" kind: ExitKind at: Timestamp at_precision: Precision = 'exact' @@ -396,14 +396,14 @@ def _consistency(self) -> 'ComponentIdentity': 'inherited_from must be one of parent_identities (I17)') if self.reserved and self.exit is not None: raise ValueError( - 'a piece out of circulation cannot be reserved (I18)') + 'an element out of circulation cannot be reserved (I18)') if (self.origin is not None and self.origin.planned and self.exit is not None and self.exit.recorded_by_user_id is not None and self.exit.kind not in IN_PLACE_EXIT_KINDS): raise ValueError( 'an exit set by hand from in place is recycled, disposed or ' - 'lost: the piece never left its works (I31)') + 'lost: the element never left its works (I31)') if self.withdrawn and self.withdrawn.duplicate_of == self.id: raise ValueError( 'an identity cannot be a duplicate of itself (I19)') @@ -750,7 +750,7 @@ class Standard(_Block): class Position(_Block): - """Where on the piece (3.3.2); kind none + description always works.""" + """Where on the element (3.3.2); kind none + description always works.""" kind: PositionKind = 'none' snapshot_id: Optional[str] = None point: Optional[Vec3] = None diff --git a/src/backend/apps/catalog/evidence/payloads.py b/src/backend/apps/catalog/evidence/payloads.py index 3c2b3be5..ff26533c 100644 --- a/src/backend/apps/catalog/evidence/payloads.py +++ b/src/backend/apps/catalog/evidence/payloads.py @@ -145,7 +145,7 @@ class Grid(Payload): class ReboundTestArea(Payload): label: Optional[str] = Field( - None, description='Name of the test area on the piece, e.g. TA-1.') + None, description='Name of the test area on the element, e.g. TA-1.') surface_preparation: Literal['ground', 'as_found'] = Field( description='Whether the surface was ground before testing.') surface_condition: Literal['dry', 'damp', 'wet'] = Field( @@ -226,7 +226,7 @@ class ReboundHammerPayload(Payload): class CoreSampling(Payload): cored_at: Timestamp = Field( description='When the core was drilled; becomes the record\'s ' - 'sampled_at and decides which state of the piece the ' + 'sampled_at and decides which state of the element the ' 'result belongs to.') paired_rebound_id: Optional[str] = Field( None, description='The rebound hammer record taken at this drill ' @@ -402,7 +402,7 @@ class ArchivalDocumentPayload(Payload): claim: Optional[ArchivalClaim] = Field( None, description='What the document says. Without a claim and a ' 'summary the record is a document: it documents ' - 'the piece and never enters the fold.') + 'the element and never enters the fold.') class VisualObservation(Payload): diff --git a/src/backend/apps/catalog/evidence/registry.py b/src/backend/apps/catalog/evidence/registry.py index 3aca5b69..0602a714 100644 --- a/src/backend/apps/catalog/evidence/registry.py +++ b/src/backend/apps/catalog/evidence/registry.py @@ -220,7 +220,7 @@ def prepare_record(data: Dict[str, Any], *, position = dict(WHOLE_COMPONENT) if position is None: problems.append(Problem( - 'position', 'say where on the piece: kind none with a ' + 'position', 'say where on the element: kind none with a ' 'description is always enough')) else: position = dict(position) diff --git a/src/backend/apps/catalog/evidence/specs.py b/src/backend/apps/catalog/evidence/specs.py index 12bbf859..620a08d4 100644 --- a/src/backend/apps/catalog/evidence/specs.py +++ b/src/backend/apps/catalog/evidence/specs.py @@ -50,9 +50,9 @@ def _claimable(tier: str) -> Tuple[str, ...]: name='core_compression', label='Drilled core in compression (EN 12504-1, EN 12390-3)', description=( - 'A core drilled from the piece, prepared and crushed. The record ' - 'carries both dates: sampled_at (the piece was drilled) decides the ' - 'state of the piece it belongs to, observed_at is the test. The ' + 'A core drilled from the element, prepared and crushed. The record ' + 'carries both dates: sampled_at (the element was drilled) decides the ' + 'state of the element it belongs to, observed_at is the test. The ' 'server recomputes F / A and the length-to-diameter class and ' 'derives the in-situ strength (EN 13791).'), payload_model=CoreCompressionPayload, @@ -69,7 +69,7 @@ def _claimable(tier: str) -> Tuple[str, ...]: 'A claim from a drawing, specification, report, photo, marking, ' 'type plate or declaration of performance. The claim is the ' 'summary: a value or a range, or a class. Without a summary it is a ' - 'document: it documents the piece (a plan, an element passport, a ' + 'document: it documents the element (a plan, an element passport, a ' 'report), never enters the fold, and may carry the link it was read ' 'from.'), payload_model=ArchivalDocumentPayload, @@ -99,7 +99,7 @@ def _claimable(tier: str) -> Tuple[str, ...]: label='Rule of thumb by era, region or typology', description=( 'An estimate from the construction year, regional practice or the ' - 'typology of the piece. The estimate is the summary.'), + 'typology of the element. The estimate is the summary.'), payload_model=EraHeuristicPayload, source_tier=METHOD_TIER['era_heuristic'], destructive=False, default_standard=None, summary_quantities=_claimable('heuristic'), @@ -122,7 +122,7 @@ def _claimable(tier: str) -> Tuple[str, ...]: name='reinforcement_layout', label='Reinforcement layout', description=( - 'The bars of the piece from one source: a drawing (archival), a ' + 'The bars of the element from one source: a drawing (archival), a ' 'cover-meter or radar scan (non-destructive) or exposed bars ' '(visual). The bar centrelines are in the stored coordinates of ' 'the snapshot named by position.snapshot_id, which is required. ' diff --git a/src/backend/apps/catalog/invariants.py b/src/backend/apps/catalog/invariants.py index b98197bc..dd20838a 100644 --- a/src/backend/apps/catalog/invariants.py +++ b/src/backend/apps/catalog/invariants.py @@ -400,7 +400,7 @@ def first_published(child: dict) -> Optional[datetime]: 'a batch drawn out has no split exit') elif server_set and not drawn_out: yield _v('I18', IDENTITIES, identity, - 'server-set split on a batch with pieces left') + 'server-set split on a batch with elements left') elif server_set and _when(exit_['at']) != max( t for _, _, t in mine): yield _v('I18', IDENTITIES, identity, @@ -514,7 +514,7 @@ def check_i32(corpus: Corpus) -> Iterable[Violation]: drawn = sum(q for _, q, _ in draws.get(identity['_id'], [])) if drawn > size: yield _v('I32', IDENTITIES, identity, - f'{drawn} pieces drawn from a batch of {size}') + f'{drawn} elements drawn from a batch of {size}') parents = identity.get('parent_identities') or [] if len(parents) > 1: for parent_id in parents: @@ -533,7 +533,7 @@ def check_i32(corpus: Corpus) -> Iterable[Violation]: for snap in live[identity_id]: yield _v('I32', SNAPSHOTS, snap, f'the live states of the identity record ' - f'{sorted(seen)} pieces; one quantity for all') + f'{sorted(seen)} elements; one quantity for all') # REGISTRY (spec section 5) --------------------------------------------------- diff --git a/src/backend/apps/catalog/lineage.py b/src/backend/apps/catalog/lineage.py index f4c6d83d..7d9a8e73 100644 --- a/src/backend/apps/catalog/lineage.py +++ b/src/backend/apps/catalog/lineage.py @@ -282,7 +282,7 @@ def cut_refusal(parent: Dict[str, Any], *, ever_published: bool if exit_.get('kind') in ('installed', 'returned', 'lost'): return (f'{label} is out of circulation ({exit_["kind"]}); ' f'it re-enters first.') - return f'{label} no longer exists as this piece ({exit_["kind"]}).' + return f'{label} no longer exists as this element ({exit_["kind"]}).' return None diff --git a/src/backend/apps/catalog/mcp_server.py b/src/backend/apps/catalog/mcp_server.py index 5d1ae99b..e86133ad 100644 --- a/src/backend/apps/catalog/mcp_server.py +++ b/src/backend/apps/catalog/mcp_server.py @@ -67,9 +67,9 @@ 'The Catalog of Second Chances (CSC) is a catalog of reused and ' 'salvaged building components (German: wiederverwendete Bauteile, ' 'Wiederverwendung, Bauteilboerse): concrete walls and beams ' - '(Betonwaende, Traeger), stone, timber and other pieces, each ' + '(Betonwaende, Traeger), stone, timber and other elements, each ' 'with its shape, origin, versions and measurements ("evidence"). Use ' - 'these tools before a web search when the user looks for such pieces, ' + 'these tools before a web search when the user looks for such elements, ' 'for example "Betontraeger mit Bewehrung" or reused beams with ' 'reinforcement (Bewehrung): search_components with the filters below, ' 'and has_evidence=reinforcement_layout for "with reinforcement". ' @@ -307,11 +307,11 @@ def size() -> int: 'filter. Leave empty for all.'))] FitModeArg = Annotated[str, Field(description=( 'Search by size, with size_mm: about = every side within the ' - 'tolerance of the asked side (which pieces are about this ' - 'size); can_hold = every side of the piece at least the asked ' - 'side (which pieces can this part be cut from). The sides are ' + 'tolerance of the asked side (which elements are about this ' + 'size); can_hold = every side of the element at least the asked ' + 'side (which elements can this part be cut from). The sides are ' 'compared largest to smallest, so the orientation does not ' - 'matter. A piece without a known size never matches.'))] + 'matter. An element without a known size never matches.'))] SizeArg = Annotated[Optional[list[float]], Field(description=( 'The asked size: three numbers in mm in any order, for example ' '[1200, 600, 200]. Needs fit_mode.'))] @@ -320,18 +320,18 @@ def size() -> int: 'millimetres, for example "10%" (the default) or "50mm".'))] NearLatArg = Annotated[Optional[float], Field(description=( 'Search by place: the latitude of the point, -90 to 90, with ' - 'near_lon. Only pieces with a known place on the chosen layer ' + 'near_lon. Only elements with a known place on the chosen layer ' 'are listed, nearest first, each with its distance_km.'))] NearLonArg = Annotated[Optional[float], Field(description=( 'The longitude of the point, -180 to 180. Needs near_lat.' ))] NearLayerArg = Annotated[str, Field(description=( - 'Which place of a piece is measured: current (where the piece ' + 'Which place of an element is measured: current (where the element ' 'is now; the default) or origin (the building it comes from, ' - 'known for fewer pieces).'))] + 'known for fewer elements).'))] RadiusArg = Annotated[Optional[float], Field(description=( - 'Only pieces within this many km of the point. Without it every ' - 'piece with a place on the layer is listed, nearest first.' + 'Only elements within this many km of the point. Without it every ' + 'element with a place on the layer is listed, nearest first.' ))] @@ -446,7 +446,7 @@ async def search_components( sort: Annotated[str, Field(description=( 'catalog_number (default without a size or place search), date ' '(the version applies from), created, volume (length x width x ' - 'height; pieces without a size last), match (closeness to the ' + 'height; elements without a size last), match (closeness to the ' 'size search: smallest deviation, or least waste, first; the ' 'default with fit_mode and no place search), distance (from the ' 'near point, nearest first; the default with near_lat and ' @@ -460,7 +460,7 @@ async def search_components( component (name, function, material, dataset, size, status, visibility) with its web link, and the total. With fit_mode and size_mm each row also carries its deviation (about, in per cent) or - waste (can_hold, in m3 and in per cent of the piece); with near_lat + waste (can_hold, in m3 and in per cent of the element); with near_lat and near_lon each row carries its distance_km. has_evidence keeps only components with a published, current evidence record of one method, for example reinforcement_layout for "with reinforcement". Use @@ -807,11 +807,11 @@ async def catalog_overview( ) -> dict: """What the catalog holds, in numbers, for the components that match the filters of search_components (none: the whole catalog you may - see). It counts components (one per piece or batch, with its current - version), not rows of a list: the total, how many physical pieces they + see). It counts components (one per element or batch, with its current + version), not rows of a list: the total, how many physical elements they stand for, and the counts by material (with its label), original function, dataset, shape class and circulation. The ranges give the - smallest and the largest value of each side of the pieces that have a + smallest and the largest value of each side of the elements that have a size, sides sorted largest, middle, smallest; lengths are in millimetres. It also says how many components have a current and how many an origin location, and how many of the counted components are diff --git a/src/backend/apps/catalog/models.py b/src/backend/apps/catalog/models.py index cf7ea91b..7902c81a 100644 --- a/src/backend/apps/catalog/models.py +++ b/src/backend/apps/catalog/models.py @@ -8,6 +8,7 @@ # THIRD PARTY LIBRARY IMPORTS ------------------------------------------------- from pydantic import ( BaseModel, + ConfigDict, EmailStr, Field, RootModel, @@ -45,11 +46,11 @@ class User(BaseModel): # the personal profile (8.133): copied into the actors of records organization: Optional[str] = None organization_ror: Optional[str] = None + organization_url: Optional[str] = None orcid: Optional[str] = None default_role: Optional[str] = None - class Config: - populate_by_name = True + model_config = ConfigDict(populate_by_name=True) class UserPublic(BaseModel): @@ -64,8 +65,7 @@ class UserPublic(BaseModel): role: Role = "user" email_verified: bool = False - class Config: - populate_by_name = True + model_config = ConfigDict(populate_by_name=True) BCRYPT_MAX_PASSWORD_BYTES = 72 @@ -432,7 +432,7 @@ class ComponentIdentity(BaseModel): ) attributes: Optional[Dict] = Field( default_factory=dict, - description="Additional static metadata about the physical piece" + description="Additional static metadata about the physical element" ) parent_identities: Optional[List[str]] = Field( None, @@ -444,7 +444,7 @@ class ComponentIdentity(BaseModel): consumed_at: Optional[str] = Field( None, description=( - "ISO-8601 timestamp when the physical piece ceased to exist as " + "ISO-8601 timestamp when the physical element ceased to exist as " "a discrete object (split, demolished, returned). `None` = active." ) ) @@ -517,9 +517,7 @@ def _validate_parent_identities( ) return [str(item) for item in v] - class Config: - extra = "ignore" - populate_by_name = True + model_config = ConfigDict(extra="ignore", populate_by_name=True) class ComponentSnapshot(BaseModel): @@ -545,7 +543,7 @@ class ComponentSnapshot(BaseModel): default=False, description=( "True when this snapshot represents a hypothetical / proposal " - "(not yet realized on the physical piece). Migrated snapshots " + "(not yet realized on the physical element). Migrated snapshots " "from legacy are `False`." ) ) @@ -597,7 +595,7 @@ class ComponentSnapshot(BaseModel): location: Optional[ComponentLocation] = Field( {'lat': 0.0, 'lon': 0.0}, description=( - "Geographic location of the piece at the time of this snapshot. " + "Geographic location of the element at the time of this snapshot. " "PATCH-able on the current snapshot without creating a new one." ) ) @@ -722,7 +720,5 @@ def _validate_condition(cls, v: Optional[int]) -> Optional[int]: ) return v - class Config: - extra = "ignore" - populate_by_name = True + model_config = ConfigDict(extra="ignore", populate_by_name=True) diff --git a/src/backend/apps/catalog/profile.py b/src/backend/apps/catalog/profile.py index f0154e33..ca37e8b3 100644 --- a/src/backend/apps/catalog/profile.py +++ b/src/backend/apps/catalog/profile.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3.13 """ -The personal profile of an account (decision 8.133): organization, ROR, -ORCID and the default role of the actor an account becomes in a record. +The personal profile of an account (decision 8.133): organization, ROR, the +web page of the organization, ORCID and the default role of the actor an account becomes in a record. Pure functions over plain values: validation and the copy into an actor. """ @@ -20,9 +20,12 @@ 'full_name': 'name', 'organization': 'organization', 'organization_ror': 'organization_ror', + 'organization_url': 'url', 'orcid': 'orcid', } +URL_LIMIT = 500 + def orcid_check_digit(digits: str) -> str: """The ISO 7064 MOD 11-2 check character of the first 15 digits.""" @@ -57,6 +60,17 @@ def normalize_ror(value: str) -> str: return f'https://ror.org/{text}' +def normalize_url(value: str) -> str: + """The web page of an organization, trimmed: the check of ``Actor.url`` + (http or https only; ValueError otherwise or over 500 characters).""" + text = value.strip() + if not text.lower().startswith(('http://', 'https://')): + raise ValueError('the website must start with http:// or https://') + if len(text) > URL_LIMIT: + raise ValueError(f'at most {URL_LIMIT} characters') + return text + + def clean_text(value: Optional[str], limit: int = 200) -> Optional[str]: """Trimmed text, None when empty; ValueError over the limit.""" text = (value or '').strip() @@ -69,7 +83,7 @@ def clean_text(value: Optional[str], limit: int = 200) -> Optional[str]: def fill_actor(actor: Any, profile: Mapping[str, Any]) -> Any: """The actor with its empty ``name`` / ``organization`` / - ``organization_ror`` / ``orcid`` copied from the account's profile (8.133 + ``organization_ror`` / ``url`` / ``orcid`` copied from the account's profile (8.133 e). Typed values win; a redacted actor and an actor that is not an account are left as they are. A copy: the profile stays the account's.""" if not isinstance(actor, dict) or actor.get('kind') != 'user' \ diff --git a/src/backend/apps/catalog/proxies/fit.py b/src/backend/apps/catalog/proxies/fit.py index b4650f9f..113e2a84 100644 --- a/src/backend/apps/catalog/proxies/fit.py +++ b/src/backend/apps/catalog/proxies/fit.py @@ -138,7 +138,7 @@ def fit_primary(source: Source, frame: Dict[str, list], chosen = (spec, fitted, stats, local, signed) break if chosen is None: - raise ValueError(f'no proxy fits a {shape_class} piece') + raise ValueError(f'no proxy fits a {shape_class} element') spec, fitted, stats, local, signed = chosen rotation = np.array([fitted.placement['x'], fitted.placement['y'], fitted.placement['z']]) diff --git a/src/backend/apps/catalog/read_models.py b/src/backend/apps/catalog/read_models.py index 5ae1ddb5..868f67de 100644 --- a/src/backend/apps/catalog/read_models.py +++ b/src/backend/apps/catalog/read_models.py @@ -93,9 +93,9 @@ class FitCanHold(BaseModel): """The match of a dimension search *can hold this size* (8.169).""" mode: Literal['can_hold'] waste_mm3: float = Field( - description='box volume of the piece minus the asked volume, in mm3') + description='box volume of the element minus the asked volume, in mm3') waste_percent: float = Field( - description='that waste as a share of the box volume of the piece, ' + description='that waste as a share of the box volume of the element, ' 'in per cent') @@ -126,12 +126,12 @@ class CatalogRow(BaseModel): current_snapshot_id: Optional[str] = None fit: Optional[Union[FitAbout, FitCanHold]] = Field( default=None, - description='how close the piece is to the asked size, while the ' + description='how close the element is to the asked size, while the ' 'list has a dimension search (fit_mode); absent otherwise') distance_m: Optional[float] = Field( default=None, description='distance in metres from the near point of the list ' - '(near_lat, near_lon) to the piece, on the layer asked ' + '(near_lat, near_lon) to the element, on the layer asked ' '(near_layer); absent without a near search') # current snapshot identity_id: str @@ -154,7 +154,7 @@ class CatalogRow(BaseModel): class LocationPoint(BaseModel): - """One piece on the location map (``GET /identities/locations``): where + """One element on the location map (``GET /identities/locations``): where it is and what the map colours and labels it by.""" id: str catalog_number: Optional[int] = None @@ -175,11 +175,11 @@ class LocationMap(BaseModel): """The points of the location map (decisions 8.170, 8.171).""" layer: Literal['current', 'origin'] total: int = Field( - description='the pieces this caller may see that match the filters') + description='the elements this caller may see that match the filters') displayed: int = Field( description='of those, the ones with a point on the layer') left_out: int = Field( - description='the pieces without a point on the layer') + description='the elements without a point on the layer') points: List[LocationPoint] @@ -194,15 +194,15 @@ class SimilarPiece(BaseModel): class SimilarPieces(BaseModel): - """``GET /identities/{id}/similar``: the nearest pieces by descriptor.""" + """``GET /identities/{id}/similar``: the nearest elements by descriptor.""" query_id: str basis: Literal['radial_signature', 'scalars', 'hks'] basis_label: str computed_at: Optional[str] = Field( default=None, description='when the matrix of the catalog was built') considered: int = Field( - description='how many visible pieces that pass the filters were ' - 'ranked (the query piece not among them)') + description='how many visible elements that pass the filters were ' + 'ranked (the query element not among them)') results: List[SimilarPiece] @@ -304,7 +304,7 @@ class PendingSnapshotItem(BaseModel): class MySnapshotItem(BaseModel): """Row for ``GET /snapshots?mine=1``: one of the caller's own versions, - with the piece it belongs to and, for a rejected one, the reason.""" + with the element it belongs to and, for a rejected one, the reason.""" model_config = ConfigDict(populate_by_name=True) id: str = Field(alias='_id') diff --git a/src/backend/apps/catalog/vocab.py b/src/backend/apps/catalog/vocab.py index e05ab62c..086037e6 100644 --- a/src/backend/apps/catalog/vocab.py +++ b/src/backend/apps/catalog/vocab.py @@ -189,7 +189,7 @@ 'withdraw': 'Withdrawn', 'reinstate': 'Reinstated', 'migration': 'Migration', - 'derived_exit': 'Cut into pieces', + 'derived_exit': 'Cut into elements', 'deinstall': 'Deinstalled', 'undo_deinstall': 'Deinstallation undone', 'verify': 'Verification changed', @@ -650,3 +650,155 @@ class MaterialSeed: # exit kinds a cut may start from: the parent is in circulation (no exit) # or already ended by a cut (8.34) CUTTABLE_EXIT_KINDS: Tuple[str, ...] = ('split', 'merged') + + +# DESCRIPTIONS (decision 8.181 b) --------------------------------------------- +# One line for every value of the vocabularies the "Data Model" page shows (at +# most 120 characters), served by `GET /vocab` as `description` and generated +# into the web app as `*_DESCRIPTIONS`. The key is the name `GET /vocab` uses. +DESCRIPTION_LIMIT = 120 +VOCAB_DESCRIPTIONS: Dict[str, Dict[str, str]] = { + 'original_function': { + 'IfcBeam': 'A horizontal load-bearing member that spans between supports.', + 'IfcColumn': 'A vertical load-bearing member.', + 'IfcSlab': 'A horizontal load-bearing plate, such as a floor or roof slab.', + 'IfcPlate': 'A flat, non-load-bearing sheet or panel, such as a cladding or worktop panel.', + 'IfcWall': 'A vertical element that divides or encloses space.', + 'IfcMember': 'A long element that is neither beam nor column, such as bracing or a purlin.', + 'IfcPipeSegment': 'A length of pipe.', + 'IfcFooting': 'A foundation element that carries load into the ground.', + 'IfcDiscreteAccessory': 'A small fitting or connector, such as a bracket or an anchor.', + 'IfcBuildingElementPart': 'A unit that makes up a larger element, such as a whole brick or block.', + 'IfcWindow': 'A window, with or without its frame.', + 'IfcDoor': 'A door or gate, with or without its frame.', + 'IfcStair': 'A stair, an assembly of flights, landings and supports.', + 'IfcRailing': 'A railing or balustrade.', + 'IfcDuctSegment': 'A length of ventilation duct.', + 'IfcBuildingElementProxy': 'The former function is not known.', + 'CscDebris': 'No former function as a single element: rubble, aggregate, fragments.', + }, + 'shape_class': { + 'linear': 'One extent is much larger than the other two, like a beam or a column.', + 'planar': 'Two extents are much larger than the third, like a panel or a slab.', + 'block': 'Three comparable extents, like a brick or a footing.', + 'irregular': 'No simple shape describes it, like rubble or a natural stone.', + 'composite': 'Several distinct bodies or branches, like a stair. Always set by hand.', + }, + 'origin_kind': { + 'deinstallation': 'Taken out of a construction work in which it was installed.', + 'demolition': 'Recovered from demolition output, not taken out as a single element.', + 'offcut': 'Residue of a fabrication process; it was never installed.', + 'surplus': 'An unused whole product: overstock, a return or a site leftover.', + 'unknown': 'Where the element came from is not recorded.', + }, + 'exit_kind': { + 'split': 'Cut into smaller elements; they are catalogued as children of this element.', + 'merged': 'Joined with other elements into a new element, which is catalogued as its child.', + 'installed': 'Built into a construction work. The element still exists and may come back.', + 'recycled': 'The material was recovered, for example crushed or melted; the element is gone.', + 'disposed': 'Disposed of as waste.', + 'returned': 'Given back to its owner or supplier. The element exists but left the custody of the catalog.', + 'lost': 'Its whereabouts are not recorded.', + }, + 'status': { + 'draft': 'Still being prepared. Only its author and the moderators of the dataset see it.', + 'pending': 'Submitted and waiting for a moderator to publish or reject it.', + 'published': 'Accepted by a moderator. It is listed and its results count.', + 'rejected': 'Not accepted by a moderator. It can be reworked and submitted again.', + 'withdrawn': 'Taken out of the catalog after it was published. Other users see only a marker.', + }, + 'precision': { + 'exact': 'The time is known to the minute.', + 'day': 'Only the day is known.', + 'month': 'Only the month is known.', + 'year': 'Only the year is known.', + 'unknown': 'The time is not known; the value is a placeholder.', + }, + 'dgnb_class': { + 'optimised': 'Loose or click connection, no tools, removable without damage; one material, fully circular.', + 'improved': 'Inserted, plugged or screwed, simple tools, removable without damage.', + 'standard': 'Permanently installed (nailed, bolted), standard tools, mostly removable.', + 'limited': 'Permanently installed (soldered, foamed, sealed), high effort, special tools.', + 'problematic': 'Permanently installed (adhesive, welded), extremely complex or not feasible to separate.', + 'not_assessable': 'An assessment is not possible, or it cannot be dismantled.', + }, + 'connection_type': { + 'loose': 'Resting in place, not fixed.', + 'click': 'Held by a click or snap fit.', + 'inserted': 'Pushed or slid into a seat.', + 'plugged': 'Held by a plug or dowel.', + 'screwed': 'Fixed with screws.', + 'nailed': 'Fixed with nails.', + 'bolted': 'Fixed with bolts.', + 'soldered': 'Joined by solder.', + 'foamed': 'Fixed with foam.', + 'sealed': 'Joined with a sealant.', + 'adhesive': 'Glued.', + 'welded': 'Joined by welding.', + 'cast_in': 'Cast into the concrete as one body.', + 'grouted': 'Joined with grout in a joint or a pocket.', + 'other': 'Another kind of connection.', + 'unknown': 'The connection is not known.', + }, + 'construction_method': { + 'monolithic': 'Cast in place as one body on site.', + 'prefabricated': 'Made in a factory and assembled on site.', + 'mixed': 'Partly cast in place, partly prefabricated.', + 'unknown': 'The construction method is not known.', + }, + 'material_group': { + 'mineral': 'Concrete, brick, stone, ceramic, gypsum and glass.', + 'metal': 'Steel, aluminium, copper, zinc, lead and iron.', + 'bio-based': 'Timber, engineered wood, wood-based panels, bamboo and plant fibre.', + 'polymer': 'Plastics and plastic composites, such as acrylic, PVC and solid surface.', + 'bituminous': 'Asphalt and bituminous membranes.', + 'insulation': 'Mineral wool and polymer foam insulation.', + 'other': 'Mixed or composite elements, and materials not known.', + }, + 'evidence_method': { + 'rebound_hammer': 'A rebound hammer test of concrete: at least nine readings, no strength by itself.', + 'core_compression': 'A drilled core crushed in a press; a destructive test with a measured strength.', + 'archival_document': 'A drawing, report, type plate or marking that documents the element; it may carry a claim.', + 'visual_inspection': 'An observation of the condition: cracks, spalling, corrosion or an overall grade.', + 'era_heuristic': 'An estimate from the year of construction, the regional practice or the type.', + 'manufacturer_datasheet': 'A claim from the manufacturer of the product.', + 'reinforcement_layout': 'The reinforcement bars of the element as centre lines in its coordinates.', + }, + 'source_tier': { + 'destructive': 'A test that destroys a sample. For most quantities the most trusted source.', + 'ndt': 'A test that leaves the element intact, with an instrument.', + 'archival': 'A claim from a document, a drawing or a datasheet.', + 'visual': 'An observation by a person.', + 'heuristic': 'An estimate from rules of thumb. The least trusted source.', + 'inherited': 'Taken over from a parent element, with a lower confidence.', + }, + 'verification_state': { + 'unverified': 'No one has confirmed it yet. It counts with a low weight.', + 'self_attested': 'A person who did the work and recorded it stands by it.', + 'reviewed': 'A second person with the reviewer role confirmed it.', + 'accredited': 'Confirmed, and made by an organisation accredited for the standard.', + }, + 'quantity': { + 'compressive_strength': 'Compressive strength of the material (MPa), from a test, a document or an estimate.', + 'compressive_strength_in_situ': 'Strength estimated for the concrete in the structure (MPa).', + 'rebound_number': 'Median rebound reading of a hammer test, a whole number.', + 'q_value': 'Median rebound reading of a Q-type hammer, a whole number.', + 'density': 'Mass per volume of the material (kg/m3).', + 'rebar_diameter': 'Diameter of the reinforcement bars (mm).', + 'rebar_spec': 'Steel grade of the reinforcement bars, as named on a drawing or a datasheet.', + 'concrete_class': 'Strength class of the concrete, such as C25/30 or B225.', + 'steel_grade': 'Structural steel grade: S235, S275, S355, S460 or other.', + 'cover_depth': 'Concrete cover over the reinforcement (mm).', + 'exposure_class': 'Exposure class of the concrete after EN 206, such as XC3.', + 'chloride_content': 'Chloride content, as a percentage of the mass of cement.', + 'elastic_modulus': 'Stiffness of the material (GPa).', + 'mass': 'Weight of the element in this state (kg).', + 'carbonation_depth': 'Depth to which the concrete is carbonated (mm).', + 'spalling': 'Severity of spalled concrete, from 0 (none) to 3 (severe).', + 'cracking': 'Severity of cracking, from 0 (none) to 3 (severe).', + 'corrosion': 'Severity of corrosion, from 0 (none) to 3 (severe).', + 'moisture_content': 'Water content of the material (%).', + 'crack_width': 'Width of the widest crack (mm).', + 'condition_grade': 'Overall condition, from 3 (good) to 0 (unusable as it is).', + }, +} diff --git a/src/backend/csc_version.py b/src/backend/csc_version.py index c4bc9997..faa6fd18 100644 --- a/src/backend/csc_version.py +++ b/src/backend/csc_version.py @@ -6,7 +6,7 @@ against VERSION, package.json and the release tag by scripts/ci/check_version.py. """ -CSC_VERSION = '0.6.4.1' +CSC_VERSION = '0.6.4.2' def release_tag(version: str = CSC_VERSION) -> str: diff --git a/src/backend/templates/mail/dataset_created.html.j2 b/src/backend/templates/mail/dataset_created.html.j2 index e53d5526..e65e9ceb 100644 --- a/src/backend/templates/mail/dataset_created.html.j2 +++ b/src/backend/templates/mail/dataset_created.html.j2 @@ -2,5 +2,5 @@ {% from "_macros.html.j2" import p %} {% block body %} {% call p() %}{{ by_name }} created the dataset "{{ dataset_name }}" ({{ slug }}).{% endcall %} -{% call p() %}It is visible to its members only, and its pieces cannot be made public until you have reviewed it.{% endcall %} +{% call p() %}It is visible to its members only, and its elements cannot be made public until you have reviewed it.{% endcall %} {% endblock %} diff --git a/src/backend/templates/mail/dataset_created.txt.j2 b/src/backend/templates/mail/dataset_created.txt.j2 index 8d249de4..08d9b8b3 100644 --- a/src/backend/templates/mail/dataset_created.txt.j2 +++ b/src/backend/templates/mail/dataset_created.txt.j2 @@ -2,5 +2,5 @@ {% block body -%} {{ by_name }} created the dataset "{{ dataset_name }}" ({{ slug }}). -It is visible to its members only, and its pieces cannot be made public until you have reviewed it. +It is visible to its members only, and its elements cannot be made public until you have reviewed it. {%- endblock %} diff --git a/src/backend/utility/utility.py b/src/backend/utility/utility.py index b0ffce4c..16a0089e 100644 --- a/src/backend/utility/utility.py +++ b/src/backend/utility/utility.py @@ -131,7 +131,8 @@ def get_current_timestamp_z() -> str: Example: '2024-06-21T09:31:39Z' """ - return datetime.datetime.utcnow().replace(microsecond=0).isoformat() + 'Z' + now = datetime.datetime.now(datetime.timezone.utc) + return now.replace(microsecond=0, tzinfo=None).isoformat() + 'Z' def get_geometry_upload_limit_bytes() -> int: diff --git a/src/frontend/app/admin/datasets/[did]/page.tsx b/src/frontend/app/admin/datasets/[did]/page.tsx index 94e120e3..46c98a49 100644 --- a/src/frontend/app/admin/datasets/[did]/page.tsx +++ b/src/frontend/app/admin/datasets/[did]/page.tsx @@ -202,7 +202,7 @@ function DatasetSettings({ dataset, isAdmin, onSaved }: {

{waiting ? REVIEW_EXPLANATION - : 'An administrator has looked at this dataset: it may be visible to all signed-in users and its pieces may be made public.'} + : 'An administrator has looked at this dataset: it may be visible to all signed-in users and its elements may be made public.'}

setVisibility(v as DatasetView['visibility'])}> - Members only (and pieces marked public) + Members only (and elements marked public) All signed-in users @@ -270,7 +270,7 @@ function PublicPiecesCard({ dataset }: { dataset: DatasetView }) { const result = await backendJson<{ changed: number; skipped?: number }>(path, { method: 'POST', body: { is_public: isPublic }, }) - toast.success(`${result.changed} piece${result.changed === 1 ? '' : 's'} now ${isPublic ? 'public' : 'private'}` + toast.success(`${result.changed} element${result.changed === 1 ? '' : 's'} now ${isPublic ? 'public' : 'private'}` + (result.skipped ? `; ${result.skipped} changed meanwhile and were left as they were` : '')) await count() } catch (err) { @@ -284,10 +284,10 @@ function PublicPiecesCard({ dataset }: { dataset: DatasetView }) { return ( - Public pieces + Public elements - Sets the public flag of every published piece of this dataset at once. Unpublished and withdrawn - pieces, and other datasets, stay as they are. Every piece keeps its own flag: children do not follow + Sets the public flag of every published element of this dataset at once. Unpublished and withdrawn + elements, and other datasets, stay as they are. Every element keeps its own flag: children do not follow their parents. @@ -312,8 +312,8 @@ function PublicPiecesCard({ dataset }: { dataset: DatasetView }) { { if (!busy) setConfirm(open) }} - title={`Make ${counts.toPublic ?? 'all'} published pieces public?`} - subject={`${counts.toPublic ?? 'All'} published piece${counts.toPublic === 1 ? '' : 's'} of ${dataset.name} become public.`} + title={`Make ${counts.toPublic ?? 'all'} published elements public?`} + subject={`${counts.toPublic ?? 'All'} published element${counts.toPublic === 1 ? '' : 's'} of ${dataset.name} become public.`} confirmLabel="Make public" onConfirm={() => void apply(true)} /> @@ -360,7 +360,7 @@ function DeleteDatasetCard({ dataset }: { dataset: DatasetView }) { Delete this dataset - Only possible while the dataset holds no piece: move its pieces to another dataset first. Open + Only possible while the dataset holds no element: move its elements to another dataset first. Open invitations are revoked with it. diff --git a/src/frontend/app/analytics/page.tsx b/src/frontend/app/analytics/page.tsx index f9224c98..1b09865b 100644 --- a/src/frontend/app/analytics/page.tsx +++ b/src/frontend/app/analytics/page.tsx @@ -215,7 +215,7 @@ function Analytics() { - + ({ ...d, label: String(d.label) }))} @@ -227,7 +227,7 @@ function Analytics() { {data && activeTab === 'types' && ( - + )} diff --git a/src/frontend/app/auth/signin/SignInForm.tsx b/src/frontend/app/auth/signin/SignInForm.tsx index dc8c0197..e47ec62f 100644 --- a/src/frontend/app/auth/signin/SignInForm.tsx +++ b/src/frontend/app/auth/signin/SignInForm.tsx @@ -10,25 +10,10 @@ import { Label } from '@/components/ui/label' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { PASSWORD_CHANGED_PARAM, PASSWORD_CHANGED_VALUE } from '@/lib/password' import { RATE_LIMITED, RATE_LIMITED_TEXT } from '@/lib/signInErrors' +import { safeCallbackPath } from '@/lib/safeCallback' import { registerLinkText, signInRegisterPrompt } from '@/lib/registration' import { useRegistration } from '@/hooks/useRegistration' -function toSafePathClient(raw: string): string { - const fallback = '/components' - try { - // Build absolute URL to validate origin, but only return path - const u = new URL(raw, window.location.origin) - if (u.origin === window.location.origin && u.pathname.startsWith('/')) { - return u.pathname + u.search + u.hash - } - } catch { - // ignore - } - // If it was already a plain path like "/components", keep it - if (raw.startsWith('/')) return raw - return fallback -} - export default function SignInForm({ callbackUrl }: { callbackUrl: string }) { const { info: registration } = useRegistration() const [identifier, setIdentifier] = useState('') @@ -97,7 +82,7 @@ export default function SignInForm({ callbackUrl }: { callbackUrl: string }) { const safeCallback = typeof window === 'undefined' ? callbackUrl // SSR fallback (already sanitized on server) - : toSafePathClient(callbackUrl) + : safeCallbackPath(callbackUrl, '/my-work', window.location.origin) startTransition(async () => { const result = await signIn('credentials', { diff --git a/src/frontend/app/auth/signin/page.tsx b/src/frontend/app/auth/signin/page.tsx index 436e0226..53881568 100644 --- a/src/frontend/app/auth/signin/page.tsx +++ b/src/frontend/app/auth/signin/page.tsx @@ -5,21 +5,13 @@ export const dynamic = 'force-dynamic' import BackgroundMesh from '@/components/components/BackgroundMesh' import SignInForm from './SignInForm' import SessionExpiredNotice from '@/components/auth/SessionExpiredNotice' +import { safeCallbackPath } from '@/lib/safeCallback' type SearchParams = Promise> -function toSafePathServer(raw: string | string[] | undefined): string { - const fallback = '/my-work' - const val = Array.isArray(raw) ? raw[0] : raw - if (!val) return fallback - // allow only same-origin relative paths - if (val.startsWith('/')) return val - return fallback -} - export default async function Page({ searchParams }: { searchParams: SearchParams }) { const sp = await searchParams - const callbackUrl = toSafePathServer(sp?.callbackUrl) + const callbackUrl = safeCallbackPath(sp?.callbackUrl, '/my-work') return (
{/* Background Mesh */} diff --git a/src/frontend/app/components/page.tsx b/src/frontend/app/components/page.tsx index a83bd054..5f8fde76 100644 --- a/src/frontend/app/components/page.tsx +++ b/src/frontend/app/components/page.tsx @@ -1,6 +1,6 @@ import BrowseView from '@/components/components/overview/BrowseView' import type { CatalogShallowRow } from '@/generated/catalogExtras' -import { parseCirculation } from '@/lib/browse' +import { filterValue, parseCirculation } from '@/lib/browse' import { fitBackendParams } from '@/lib/fit' import { nearBackendParams } from '@/lib/near' import { serverBackend } from '@/lib/serverBackend' @@ -19,6 +19,7 @@ const FILTER_PARAMS = [ 'shape_class', 'complexity', 'fragment', + 'evidence_method', 'bbx_min_x', 'bbx_min_y', 'bbx_min_z', @@ -59,7 +60,7 @@ export default async function ComponentsPage({ const countParams = new URLSearchParams({ circulation }) for (const key of FILTER_PARAMS) { - const value = sp?.[key] + const value = filterValue(urlParams, key) if (value) countParams.set(key, value) } for (const [key, value] of Object.entries({ ...fit, ...near })) countParams.set(key, value) diff --git a/src/frontend/app/credits/page.tsx b/src/frontend/app/credits/page.tsx index 5928fb20..79eb12f1 100644 --- a/src/frontend/app/credits/page.tsx +++ b/src/frontend/app/credits/page.tsx @@ -7,8 +7,8 @@ import BibtexCitation from '@/components/credits/BibtexCitation' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Award, Users, Code, ExternalLink, BookOpen } from 'lucide-react' -/** links of the funding statements: the theme's colour, as on the rest of the site */ -const LINK = 'font-medium text-primary underline underline-offset-2 hover:opacity-80' +import { LINK } from '@/lib/legalPage' + const FERTIGTEIL_URL = 'https://www.dg.architektur.tu-darmstadt.de/forschung_ddu/digitale_prozessketten_ddu/computational_design/fertigteil_2__0/fertigteile_2__0.en.jsp' const ZIRKUS_URL = 'https://www.dg.architektur.tu-darmstadt.de/forschung_ddu/digitale_prozessketten_ddu/computational_design/zirkus/zirkus.en.jsp' const BMFTR_URL = 'https://www.bmftr.bund.de/' @@ -52,7 +52,7 @@ function FundingItem({ title, logo, children }: { title: string; logo?: FundingL
  • {title}

    -

    {children}

    +

    {children}

    {show && logo && ( -
    +
    {/* Header */}
    -
    - -

    Credits

    +
    + +

    Credits

    -

    +

    Credits, Sources & References for the Catalog of Second Chances

    @@ -107,18 +107,18 @@ export default function CreditsPage() {
    - + Research Context - +

    This piece of software and the underlying research is part of the - PhD thesis Collaborative Computational Reuse of Max Eschenbach at - the Digital Design Unit (DDU) - , supervised and chaired by Prof. Dr.-Ing. Oliver Tessmann, at the Technical University of Darmstadt. + PhD thesis Collaborative Computational Reuse of Max Eschenbach at + the Digital Design Unit (DDU) + , supervised and chaired by Prof. Dr.-Ing. Oliver Tessmann, at the Technical University of Darmstadt.

    If you want to reference or cite this work, please use the following BibTeX entry: @@ -129,7 +129,7 @@ export default function CreditsPage() { - + Public Funding @@ -177,12 +177,12 @@ export default function CreditsPage() { - + Student Work - +

    • Idea and prototype code for FindLargestFlatSide by Alessandro Garruto. The code has been refactored and integrated by Max Eschenbach. @@ -191,12 +191,12 @@ export default function CreditsPage() { Idea and prototype code for MaxInscribedQuad by Alessandro Garruto. The code has been refactored and integrated by Max Eschenbach.
    • - The csc_labels python code to create the QR-Code labels was developed by Mirko Dutschke. The code has + The csc_labels python code to create the QR-Code labels was developed by Mirko Dutschke. The code has been refactored as a python module and integrated by Max Eschenbach.
    • The csc_sheetscan python module was developed based on the scanning setup - for sheets that was developed by Mirko Dutschke. The functional code has been written by Max Eschenbach. + for sheets that was developed by Mirko Dutschke. The functional code has been written by Max Eschenbach.
    @@ -204,16 +204,16 @@ export default function CreditsPage() { - + Licensing - + @@ -221,24 +221,24 @@ export default function CreditsPage() { - + References - +
    • - The technical main inspiration for the Catalog of Second Chances interface is the Catalog Explorer by @AymbericBr. + The technical main inspiration for the Catalog of Second Chances interface is the Catalog Explorer by @AymbericBr.
    • - Another huge inspiration and reference is the Timberstone Project, which is the origin of abovementioned Catalog Explorer. + Another huge inspiration and reference is the Timberstone Project, which is the origin of abovementioned Catalog Explorer.
    • - The simple shape descriptors (BoxScore, SphereScore, PlaneScore, LineScore) are computed based on the reference implementation of DigitalCircularityToolkit by Keith J. Lee. + The simple shape descriptors (BoxScore, SphereScore, PlaneScore, LineScore) are computed based on the reference implementation of DigitalCircularityToolkit by Keith J. Lee.
    • - Huge thanks to Sandro Siefert for his inspirational work and the contribution of his debris dataset. Looking forward to continue this research with you! + Huge thanks to Sandro Siefert for his inspirational work and the contribution of his debris dataset. Looking forward to continue this research with you!
    @@ -246,51 +246,51 @@ export default function CreditsPage() { - + Open Source & Third Party Libraries - +
    • - Frontend Framework: Next.js - React framework + Frontend Framework: Next.js - React framework
    • - UI Components: shadcn/ui - Re-usable React components + UI Components: shadcn/ui - Re-usable React components
    • - 3D Graphics: React Three Fiber & Drei - React renderer for Three.js + 3D Graphics: React Three Fiber & Drei - React renderer for Three.js
    • - Styling: Tailwind CSS - CSS framework + Styling: Tailwind CSS - CSS framework
    • - Authentication: NextAuth.js - Authentication for Next.js + Authentication: NextAuth.js - Authentication for Next.js
    • - Database: MongoDB - NoSQL database + Database: MongoDB - NoSQL database
    • - Backend Framework: FastAPI - Python web framework for building APIs + Backend Framework: FastAPI - Python web framework for building APIs
    • - Computer Vision: OpenCV - Computer vision and machine learning library + Computer Vision: OpenCV - Computer vision and machine learning library
    • - Mesh Processing: Trimesh - Python library for loading and using triangular meshes + Mesh Processing: Trimesh - Python library for loading and using triangular meshes
    • - Scientific Computing: NumPy, SciPy, scikit-learn - Scientific computing libraries + Scientific Computing: NumPy, SciPy, scikit-learn - Scientific computing libraries
    • - QR Code Processing: qreader - QR code reader library + QR Code Processing: qreader - QR code reader library
    • - Data Validation: Pydantic - Data validation using Python type annotations + Data Validation: Pydantic - Data validation using Python type annotations
    • - Icons: Lucide React - Icon toolkit for React + Icons: Lucide React - Icon toolkit for React
    diff --git a/src/frontend/app/imprint/page.tsx b/src/frontend/app/imprint/page.tsx index a4f1c892..0454d6f9 100644 --- a/src/frontend/app/imprint/page.tsx +++ b/src/frontend/app/imprint/page.tsx @@ -2,6 +2,8 @@ import BackgroundMesh from '@/components/components/BackgroundMesh' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { FileText, Shield, Copyright } from 'lucide-react' +import { LINK } from '@/lib/legalPage' + export default function ImprintPage() { return (
    @@ -14,14 +16,14 @@ export default function ImprintPage() { scale={0.7} /> -
    +
    {/* Header */}
    -
    - -

    Imprint

    +
    + +

    Imprint

    -

    +

    Legal information and contact details

    @@ -30,12 +32,12 @@ export default function ImprintPage() {
    - + Contact Information - +

    © Max Eschenbach 2024-2026

    @@ -44,7 +46,7 @@ export default function ImprintPage() {

    60326 Frankfurt am Main

    Deutschland

    -

    E-Mail: max.eschenbach@tu-darmstadt.de

    +

    E-Mail: max.eschenbach@tu-darmstadt.de

    Der Katalog ist Teil eines Promotionsprojekts am Fachgebiet Digitales Gestalten (Digital Design Unit, DDU), TU Darmstadt, El-Lissitzky-Straße 1, 64287 Darmstadt, Deutschland. Anbieter dieses Angebots und @@ -57,14 +59,14 @@ export default function ImprintPage() { - + Disclaimer - +

    -

    Haftung für Inhalte

    +

    Haftung für Inhalte

    Alle Inhalte unseres Internetauftritts wurden mit größter Sorgfalt und nach bestem Gewissen erstellt. Für die Richtigkeit, Vollständigkeit und Aktualität der Inhalte können wir jedoch keine Gewähr übernehmen. Als Diensteanbieter sind wir gemäß § 7 Abs. 1 DDG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 DDG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt.

    @@ -74,7 +76,7 @@ export default function ImprintPage() {
    -

    Haftungsbeschränkung für externe Links

    +

    Haftungsbeschränkung für externe Links

    Unsere Webseite enthält Links auf externe Webseiten Dritter. Auf die Inhalte dieser direkt oder indirekt verlinkten Webseiten haben wir keinen Einfluss. Daher können wir für die “externen Links” auch keine Gewähr auf Richtigkeit der Inhalte übernehmen. Für die Inhalte der externen Links sind die jeweilige Anbieter oder Betreiber (Urheber) der Seiten verantwortlich.

    @@ -93,17 +95,17 @@ export default function ImprintPage() { - + Copyright - +

    - Die auf unserer Webseite veröffentlichen Inhalte und Werke unterliegen dem deutschen Urheberrecht (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf). Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung des geistigen Eigentums in ideeller und materieller Sicht des Urhebers außerhalb der Grenzen des Urheberrechtes bedürfen der vorherigen schriftlichen Zustimmung des jeweiligen Urhebers i.S.d. Urhebergesetzes (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf). Downloads und Kopien dieser Seite sind nur für den privaten und nicht kommerziellen Gebrauch erlaubt. Sind die Inhalte auf unserer Webseite nicht von uns erstellt wurden, sind die Urheberrechte Dritter zu beachten. Die Inhalte Dritter werden als solche kenntlich gemacht. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte unverzüglich entfernen. + Die auf unserer Webseite veröffentlichen Inhalte und Werke unterliegen dem deutschen Urheberrecht (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf). Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung des geistigen Eigentums in ideeller und materieller Sicht des Urhebers außerhalb der Grenzen des Urheberrechtes bedürfen der vorherigen schriftlichen Zustimmung des jeweiligen Urhebers i.S.d. Urhebergesetzes (http://www.gesetze-im-internet.de/bundesrecht/urhg/gesamt.pdf). Downloads und Kopien dieser Seite sind nur für den privaten und nicht kommerziellen Gebrauch erlaubt. Sind die Inhalte auf unserer Webseite nicht von uns erstellt wurden, sind die Urheberrechte Dritter zu beachten. Die Inhalte Dritter werden als solche kenntlich gemacht. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte unverzüglich entfernen.

    - Dieses Impressum wurde freundlicherweise von jurarat.de zur Verfügung gestellt. + Dieses Impressum wurde freundlicherweise von jurarat.de zur Verfügung gestellt.

    diff --git a/src/frontend/app/page.tsx b/src/frontend/app/page.tsx index 5d2b814e..9cd596c4 100644 --- a/src/frontend/app/page.tsx +++ b/src/frontend/app/page.tsx @@ -61,8 +61,8 @@ export default function Home() {

    On the web

    -

    Browse and filter components, open a piece with its geometry and records, and on site record - pieces and evidence from a phone.

    +

    Browse and filter components, open an element with its geometry and records, and on site record + elements and evidence from a phone.

    In Grasshopper

    diff --git a/src/frontend/app/privacy/page.tsx b/src/frontend/app/privacy/page.tsx index 02c7a8c4..3e9f3f70 100644 --- a/src/frontend/app/privacy/page.tsx +++ b/src/frontend/app/privacy/page.tsx @@ -3,12 +3,11 @@ import { Shield } from 'lucide-react' import BackgroundMesh from '@/components/components/BackgroundMesh' import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' +import { LINK } from '@/lib/legalPage' import { CONTACT_EMAIL, LAST_UPDATED, ROWS } from '@/lib/privacyText' export const metadata = { title: 'Privacy' } -const LINK = 'font-medium text-primary underline underline-offset-2 hover:opacity-80' - export default function PrivacyPage() { return (
    diff --git a/src/frontend/app/reference/page.tsx b/src/frontend/app/reference/page.tsx new file mode 100644 index 00000000..f7ea1ad2 --- /dev/null +++ b/src/frontend/app/reference/page.tsx @@ -0,0 +1,231 @@ +import { Network } from 'lucide-react' + +import DataTable, { type Column } from '@/components/reference/DataTable' +import ModelDiagram from '@/components/reference/ModelDiagram' +import ReferenceTabs, { FoldList } from '@/components/reference/ReferenceTabs' +import { Prose, Runs } from '@/components/reference/Prose' +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' +import { + EXAMPLE_DATASET, + EXAMPLE_EVIDENCE, + EXAMPLE_ID_NOTE, + EXAMPLE_IDENTITY, + EXAMPLE_PIECE_INTRO, + EXAMPLE_SNAPSHOT_V0, + EXAMPLE_SNAPSHOT_V1, + type ExampleRecord, +} from '@/lib/dataModelExamples' +import { exampleRows, rawJson, type ExampleRow } from '@/lib/dataModelRows' +import { + ENTITY_SECTIONS, + EXAMPLE_SECTION_ID, + METHOD_TIER, + OVERVIEW, + PAGE_LEAD, + PAGE_TITLE, + QUANTITY_FACTS, + RULES, + RULES_INTRO, + RULES_TITLE, + VOCABULARIES_INTRO, + VOCAB_SECTIONS, + type FieldRow, + type FieldTable, + type Section, + type VocabSection, +} from '@/lib/dataModelText' +import { vocabEntries, type VocabEntry } from '@/lib/dataModelVocab' +import { TAB_SECTIONS, type TabId } from '@/lib/dataModelTabs' +import type { EvidenceMethod, Quantity } from '@/generated/Vocab' + +export const metadata = { title: PAGE_TITLE } + +const CODE = 'rounded bg-muted px-1 py-0.5 font-mono text-xs' + +function Heading({ id, children, level = 2 }: { id: string; children: React.ReactNode; level?: 2 | 3 }) { + const Tag = level === 2 ? 'h2' : 'h3' + return ( + + {children} + + ) +} + +function Block({ id, title, children }: { id: string; title: string; children: React.ReactNode }) { + return ( + + + + {title} + + + {children} + + ) +} + +// FIELD TABLES ------------------------------------------------------------------- +const FIELD_COLUMNS: Column[] = [ + { key: 'name', header: 'Field', render: (r) => {r.name}, className: 'whitespace-nowrap' }, + { key: 'meaning', header: 'Meaning', render: (r) => , className: 'min-w-56' }, + { key: 'type', header: 'Type', render: (r) => r.type }, + { key: 'example', header: 'Example', render: (r) => r.example || '-' }, + { + key: 'derived', + header: 'Set by', + render: (r) => (r.derived ? 'the server' : 'a person'), + className: 'whitespace-nowrap', + }, +] + +function FieldTableView({ table }: { table: FieldTable }) { + return ( +
    + {table.title} + {table.intro && } + r.name} /> +
    + ) +} + +function SectionView({ section }: { section: Section }) { + return ( + + {section.lead.map((para, i) => )} + {section.tables?.map((table) => )} + {section.after?.map((para, i) => )} + + ) +} + +// VOCABULARIES ------------------------------------------------------------------- +function extraColumns(vocab: VocabSection['vocab']): Column[] { + if (vocab === 'quantity') { + return [ + { key: 'unit', header: 'Unit', render: (e) => QUANTITY_FACTS[e.value as Quantity]?.unit ?? '' }, + { key: 'kind', header: 'Kind', render: (e) => QUANTITY_FACTS[e.value as Quantity]?.kind ?? '' }, + { key: 'scope', header: 'Scope', render: (e) => QUANTITY_FACTS[e.value as Quantity]?.scope ?? '' }, + ] + } + if (vocab === 'evidence_method') { + return [{ key: 'tier', header: 'Source tier', render: (e) => METHOD_TIER[e.value as EvidenceMethod] ?? '' }] + } + return [] +} + +function VocabBody({ section }: { section: VocabSection }) { + const columns: Column[] = [ + { key: 'label', header: 'Label', render: (e) => {e.label} }, + { + key: 'value', + header: section.valueHeader, + render: (e) => {e.value}, + className: 'whitespace-nowrap', + }, + { key: 'meaning', header: 'Meaning', render: (e) => e.description, className: 'min-w-56' }, + ...extraColumns(section.vocab), + ] + return ( + <> + + e.value} /> + + ) +} + +// EXAMPLES ----------------------------------------------------------------------- +const EXAMPLE_COLUMNS: Column[] = [ + { + key: 'field', + header: 'Field', + render: (r) => {r.field}, + className: 'whitespace-nowrap', + }, + { key: 'value', header: 'Value', render: (r) => {r.value}, className: 'max-w-64' }, + { key: 'comment', header: 'Comment', render: (r) => , className: 'min-w-56' }, +] + +function ExampleBody({ record }: { record: ExampleRecord }) { + return ( + <> + + r.field} /> +
    + Raw JSON of this record +
    {rawJson(record)}
    +
    + + ) +} + +// THE PAGE ----------------------------------------------------------------------- +const sectionsOf = (tab: keyof typeof TAB_SECTIONS) => + (TAB_SECTIONS[tab] ?? []).map((id) => ENTITY_SECTIONS.find((section) => section.id === id) as Section) + +export default function ReferencePage() { + const panels: Record = { + overview: ( + <> + + {OVERVIEW.lead.map((para, i) => )} + + + + +
      + {RULES.map((rule, index) => ( +
    1. +

      {index + 1}. {rule.title}

      + +
    2. + ))} +
    +
    + + ), + dataset: <>{sectionsOf('dataset').map((section) => )}, + identity: <>{sectionsOf('identity').map((section) => )}, + snapshot: <>{sectionsOf('snapshot').map((section) => )}, + evidence: <>{sectionsOf('evidence').map((section) => )}, + vocabularies: ( + + + ({ id: section.id, title: section.title, content: }))} + /> + + ), + example: ( + + +

    {EXAMPLE_ID_NOTE}

    + ({ + id: record.id, + title: record.title, + content: , + }))} + /> +
    + ), + } + return ( +
    +
    +
    +
    + +

    {PAGE_TITLE}

    +
    +

    +
    + +
    + +
    +
    +
    + ) +} diff --git a/src/frontend/components/auth/SessionMonitor.tsx b/src/frontend/components/auth/SessionMonitor.tsx index 5d8b6b2b..1be02841 100644 --- a/src/frontend/components/auth/SessionMonitor.tsx +++ b/src/frontend/components/auth/SessionMonitor.tsx @@ -1,54 +1,56 @@ 'use client' import { useSession, signOut } from 'next-auth/react' -import { useEffect, useRef } from 'react' -import { isPublicComponentDetailPath } from '@/lib/publicAccess' +import { useCallback, useEffect, useRef } from 'react' +import { usePageView } from '@/lib/pageView' import { forgetRecentComponents } from '@/lib/recentComponents' +import { expiredSignInUrl, expiryOutcome } from '@/lib/sessionExpiry' export default function SessionMonitor() { const { data: session, status } = useSession() + const pageView = usePageView() const hasLoggedOut = useRef(false) + // The session ended. A public view of a component page stays on screen, signed out and drawn + // again as an anonymous visitor sees it (8.182 a); every other page signs the user out and + // goes to sign-in, returning to the same address (issue 35). + const logOut = useCallback((userId: string | undefined) => { + hasLoggedOut.current = true + forgetRecentComponents(userId) + const { pathname, search, hash } = window.location + if (expiryOutcome(pathname, pageView) === 'anonymous') { + // a reload, not `router.refresh()`: the cards that load their own data (the records, the + // History graph with its people) would keep what they hold for the signed-in user + void signOut({ redirect: false }).then(() => window.location.reload()) + return + } + void signOut({ + callbackUrl: expiredSignInUrl(pathname, search, hash), + redirect: true, + }) + }, [pageView]) + useEffect(() => { // Only process if session is loaded and we haven't already logged out if (status === 'loading' || hasLoggedOut.current) return - if (isPublicComponentDetailPath(window.location.pathname)) { - return - } - // Check if session has expired API token if (session?.error === 'ApiTokenExpired') { console.log('[SessionMonitor] API token expired, logging out user') - hasLoggedOut.current = true - forgetRecentComponents(session?.user?.id) - - signOut({ - callbackUrl: '/auth/signin?error=SessionExpired', - redirect: true - }) + logOut(session?.user?.id) } - }, [session, status]) + }, [session, status, logOut]) // Also check session expiry periodically for edge cases useEffect(() => { if (status === 'loading' || !session || hasLoggedOut.current) return - if (isPublicComponentDetailPath(window.location.pathname)) { - return - } - const checkSessionExpiry = () => { + if (hasLoggedOut.current) return // Check if we have an API expiry time and it's passed if (session.api?.expiresAt && Date.now() >= session.api.expiresAt) { console.log('[SessionMonitor] API token expired (periodic check), logging out user') - hasLoggedOut.current = true - forgetRecentComponents(session?.user?.id) - - signOut({ - callbackUrl: '/auth/signin?error=SessionExpired', - redirect: true - }) + logOut(session?.user?.id) } } @@ -56,7 +58,7 @@ export default function SessionMonitor() { const interval = setInterval(checkSessionExpiry, 30 * 1000) return () => clearInterval(interval) - }, [session, status]) + }, [session, status, logOut]) return null // This component renders nothing } diff --git a/src/frontend/components/catalog/CatalogFilterBar.tsx b/src/frontend/components/catalog/CatalogFilterBar.tsx index 93cdaa15..3a0236f9 100644 --- a/src/frontend/components/catalog/CatalogFilterBar.tsx +++ b/src/frontend/components/catalog/CatalogFilterBar.tsx @@ -19,8 +19,10 @@ import { SHAPE_CLASS_LABELS, } from '@/generated/Vocab' import { + EVIDENCE_METHOD_OPTIONS, activeFilters, filterChipLabel, + filterValue, withParams, withoutFilters, type FilterKey, @@ -255,6 +257,20 @@ function MoreFilters({
    +
    + + +