diff --git a/.claude/launch.json b/.claude/launch.json index ef306c52..cf43afbc 100644 --- a/.claude/launch.json +++ b/.claude/launch.json @@ -6,7 +6,7 @@ "runtimeExecutable": "cmd", "runtimeArgs": [ "/c", - "set CSC_PUBLIC_API_URL=http://127.0.0.1:8791&& scripts\\dev\\run_csc_python.cmd -u scripts/dev/serve_dump.py --dump latest --assets .dev/assets-261012 --port 8791 --mongo-port 27791" + "set CSC_PUBLIC_API_URL=http://127.0.0.1:8791&& scripts\\dev\\run_csc_python.cmd -u scripts/dev/serve_dump.py --dump latest --assets .dev/assets --port 8791 --mongo-port 27791" ], "port": 8791 }, diff --git a/.zenodo.json b/.zenodo.json index efc2ad7e..0efc10dc 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.4)", - "version": "0.6.4.4", + "title": "Catalog of Second Chances (CSC) - Digital Database and Corresponding Interfaces for ReUse of Architectural Components (v0.6.4.5)", + "version": "0.6.4.5", "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.
Grasshopper hardening, and the beta notice takes its version from the release. Run CSC_Update in Grasshopper after the server is deployed.
<empty> or <null>, on every error path and when a component stops early. In a component that runs once per item, one missing, empty or failed item gives a null in its slot, so the outputs stay one to one with the input list; an input with no data at all gives empty outputs (#33, #40).ReadFromD2P:** the Component output carries the D2P component itself, and a remark names its type. When the D2P component of an element cannot be resolved, a warning names the element; a plain tag of BakeComponents stays null without a warning (#36).{version} where the number goes (#52).ApplyFrame says that its Frame output is the frame used, in the stored coordinates, and points to DisassembleComponent for the frame where the moved element sits. The Frame and BoundingBox descriptions of DisassembleComponent now say that they give the element where it sits.ReinforcementLayout:** the steel grade (Spec) is optional; bars without it are stored without a grade.AddEvidence:** an invalid identity id or evidence text is an error, no longer a warning.CSC_Update:** after it replaces the source of a component, the remark and the end of the run ask you to save the definition, close it and open it again before clicking Apply: until then Rhino 8 opens the script editor of that component read-only and the component reports \"Object reference not set to an instance of an object\".csc_gh 261102; CSC_Update brings it..env, take the version number out of BETA_BANNER_TEXT and BETA_LOGIN_MESSAGE, or write {version} in its place (for example BETA_BANNER_TEXT="VERSION {version}"). Restart the frontend.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.
The web controls follow the permission rules, and a component can move to another dataset. No Grasshopper change: CSC_Update is not needed for this release.
POST /identities/{id}/move and a control in the actions menu of the component, for a moderator of both datasets. One component at a time. A dataset emptied this way can be deleted. Until the nightly run the map may colour a moved component by its old dataset; who sees it is decided at read time (#50).has_open_snapshot and an evidence record has_open_correction, for contributors and moderators of the dataset and admins. Only the fact, no details (#47).GET /snapshots/pending and GET /snapshots?mine=1 carry identity_withdrawn, so the moderation queue and My work hide Publish and Submit there (#49).replacement_id. Recall, reject, back to draft and delete stay, so that an open snapshot can be cleared. A moderator reinstates the component first (#49).list_versions and get_version are now list_snapshots and get_snapshot; the parameter version_id is snapshot_id, and the answers say snapshots, current_snapshot and snapshot_count. A chat that calls an old name gets \"tool not found\" once and then sees the new list.component_snapshots gains an index on identity_id and status, for the check of an open snapshot. It is built when the server starts.summary.kind, so the server answered 422 although the form said nothing was missing.test_signin.py passes on Python 3.9.pull_production.ps1 passes SSH keepalive options, after a pull of the assets broke at 1.56 GB.Full history: CHANGELOG.md
", "creators": [ { "name": "Eschenbach, Max Benjamin", diff --git a/AGENTS.md b/AGENTS.md index c7211f44..3ae3aaf6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,6 +2,20 @@ Guidance for coding agents working in this repository. +## Standing rules + +- The maintainer makes every commit, push and production step. Do not stage, commit, push or run anything against + production; leave changes in the working tree and give the commands. Commit messages stay inline in the command. +- ASCII only in code and scripts, no emoji. In docs, write dashes as `--` and `---`. Icons come from `lucide-react`. +- No names of people or accounts in committed files; refer to roles. The legal pages and the author line of the + Grasshopper user objects are the exceptions. +- Packages must be about two weeks old: no dependency, action or lockfile entry younger than about 14 days. +- In user-facing text a catalogued building component is a "component" (on the Grasshopper page the other kind is a + "Grasshopper component"); "element" is only an item of a batch. A recorded state is a "snapshot"; "v1" is its number. +- Several docs and sources use CRLF. Keep the line ending of the file you edit. +- The root `README.md` states rules plainly, without decision references. Those belong in `docs/adr/`. +- The decision log `docs/adr/DESIGN_DECISIONS.md` is append-only: amend a row with an "Amended ..." sentence. + ## Agent skills ### Issue tracker diff --git a/CHANGELOG.md b/CHANGELOG.md index eafb4a63..14808b84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,61 @@ 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.5] - 2026-11-08 + +The web controls follow the permission rules, and a component can move to another dataset. No Grasshopper +change: `CSC_Update` is not needed for this release. + +### Added + +- **Move a component to another dataset:** `POST /identities/{id}/move` and a control in the actions menu of + the component, for a moderator of both datasets. One component at a time. A dataset emptied this way can be + deleted. Until the nightly run the map may colour a moved component by its old dataset; who sees it is decided + at read time (#50). +- **Delete a never-published component:** a control with a confirm dialog, for its creator or a moderator (#50). +- **API, open snapshots and corrections:** an identity carries `has_open_snapshot` and an evidence record + `has_open_correction`, for contributors and moderators of the dataset and admins. Only the fact, no details (#47). +- **API, lists of snapshots:** `GET /snapshots/pending` and `GET /snapshots?mine=1` carry `identity_withdrawn`, so + the moderation queue and My work hide Publish and Submit there (#49). + +### Changed + +- **Behaviour, a withdrawn component stays out of circulation:** reserve, re-enter, undo exit and undo deinstall + answer 409 on a withdrawn component. So does adding a photo to a withdrawn snapshot or to any snapshot of a + withdrawn component, and adding an attachment to a withdrawn record or to any record of a withdrawn + component, and correcting a snapshot of a withdrawn component, and submitting, publishing, promoting or + reinstating one, and reinstating an evidence record of it, and withdrawing a snapshot with `replacement_id`. + Recall, reject, back to draft and delete stay, so that an open snapshot can be cleared. A moderator reinstates the + component first (#49). +- **Behaviour, revoking an invitation:** only a moderator of the dataset, or an admin, revokes an invitation. + The creator loses the right with the role (#48). +- **Web, controls the backend allows:** a moderator adds an attachment to a published record, and edits the + name, notes and date of a withdrawn snapshot, the rest of the form stays disabled there; a contributor reaches + their own draft snapshot from the snapshot dialog; a new state, evidence and "out of circulation" stay available + when every snapshot is withdrawn; a site admin submits, recalls and returns to draft another person's record; an + author edits their evidence draft after losing the contributor role; the layout document of a superseded + record can be filled in (#48). +- **Web and backend, wording:** user text says "component" for a catalogued component again, also in error + messages, the Data Model page and the MCP tool descriptions. 0.6.4.2 had brought in "element", which left the web + mixing both words; "element" stays only for the items of a batch. A recorded state is a "snapshot", as in the + data model, where the web said "version" in most places; "v1" stays its number. +- **MCP, names:** the tools `list_versions` and `get_version` are now `list_snapshots` and `get_snapshot`; the + parameter `version_id` is `snapshot_id`, and the answers say `snapshots`, `current_snapshot` and `snapshot_count`. + A chat that calls an old name gets "tool not found" once and then sees the new list. +- **Web, page description:** the description search engines and link previews show reads "A digital database for + reclaimed architectural components." +- **Backend, index:** `component_snapshots` gains an index on `identity_id` and `status`, for the check of an + open snapshot. It is built when the server starts. + +### Fixed + +- **Web, controls that ended in a refusal:** controls the backend would refuse with a 403 or a 409 are hidden, + or disabled with the reason, before a form is filled in (#46, #47). +- **Web, claims:** a claim with a result saves. The form sent no `summary.kind`, so the server answered 422 although + the form said nothing was missing. +- **Tests:** `test_signin.py` passes on Python 3.9. +- **Backup:** `pull_production.ps1` passes SSH keepalive options, after a pull of the assets broke at 1.56 GB. + ## [0.6.4.4] - 2026-11-03 Grasshopper hardening, and the beta notice takes its version from the release. Run `CSC_Update` in diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..43c994c2 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/CONTEXT.md b/CONTEXT.md index 07d2cfc8..883b8f78 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 element is, where it came +A research catalog of reclaimed building components: what each physical component 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,13 +8,13 @@ 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. In user-facing text a -single one is an "element" (not to be confused with a Grasshopper component). -_Avoid_: item, part, piece +A physical reclaimed building component the catalog tracks --- a beam, a panel, a lump of rubble. In user-facing text a +single one is a "component"; on the Grasshopper page the other kind is a "Grasshopper component". +_Avoid_: item, part, piece, element (an element is only an item of a batch) **Component identity**: The catalog's permanent record of one physical component, from its arrival to long after its exit. -_Avoid_: entry, component (when the record is meant) +_Avoid_: entry; in user-facing text the record and its UUID are a "component" and a "component id", "identity" stays in code, the API and Grasshopper **Tag**: The physical QR label on a component; it carries only the identity's UUID, never a URL. @@ -22,7 +22,7 @@ _Avoid_: label, sticker **Snapshot**: One recorded state of a component --- its shape and state from a point in time until the next state. -_Avoid_: version (a snapshot *has* a version number), scan (one way to capture a snapshot's geometry) +_Avoid_: version (a snapshot *has* a version number; also in user-facing text), scan (one way to capture a snapshot's geometry) **Snapshot photo**: A general-impression picture of a component in one state, so people get an idea of it regardless of how its geometry is represented. Not evidence. diff --git a/README.md b/README.md index f1380f3f..46962907 100644 --- a/README.md +++ b/README.md @@ -29,8 +29,8 @@ framework ## Current Versions -- **CSC**: 0.6.4.4 --- backend, web frontend and Grasshopper interface are released together - under one version (tag `v0.6.4.4`); the single source is the `VERSION` file. +- **CSC**: 0.6.4.5 --- backend, web frontend and Grasshopper interface are released together + under one version (tag `v0.6.4.5`); the single source is the `VERSION` file. See `CHANGELOG.md` for release notes. @@ -112,7 +112,7 @@ session with the first. **A local copy of the newest dump** (for checking the web app against real data) starts from `.claude/launch.json`: `backend-local` (the newest `mongodb_collections_local/{waiting ? REVIEW_EXPLANATION - : 'An administrator has looked at this dataset: it may be visible to all signed-in users and its elements may be made public.'} + : 'An administrator has looked at this dataset: it may be visible to all signed-in users and its components may be made public.'}
{blocked}
}{lockNote}
} ) diff --git a/src/frontend/app/admin/validation/page.tsx b/src/frontend/app/admin/validation/page.tsx index 116d41eb..1492f599 100644 --- a/src/frontend/app/admin/validation/page.tsx +++ b/src/frontend/app/admin/validation/page.tsx @@ -15,7 +15,7 @@ type Tab = 'snapshots' | 'evidence' | 'verification' const TAB_HELP: RecordComponents for Rhino 8 and Grasshopper that read from and write to the catalog: fetch components, record - states and evidence, compute frames and descriptors. + snapshots and evidence, compute frames and descriptors.
diff --git a/src/frontend/app/layout.tsx b/src/frontend/app/layout.tsx index 9b06823b..ceeb823b 100644 --- a/src/frontend/app/layout.tsx +++ b/src/frontend/app/layout.tsx @@ -19,7 +19,7 @@ const inter = Inter({ subsets: ['latin'] }) export const metadata: Metadata = { title: 'CSC - Catalog of Second Chances', - description: 'A components and materials database.', + description: 'A digital database for reclaimed architectural components.', } // Beta/gh-interface flags come from the server's .env at request time. Without diff --git a/src/frontend/app/my-work/page.tsx b/src/frontend/app/my-work/page.tsx index 0e820d07..a200088d 100644 --- a/src/frontend/app/my-work/page.tsx +++ b/src/frontend/app/my-work/page.tsx @@ -29,6 +29,7 @@ import { submitRecords, submittableKeys, waitingLines, + WITHDRAWN_DRAFT_NOTE, type MyRecord, type Piece, type SubmitResult, @@ -323,6 +324,9 @@ function MyRecords({ enabled }: { enabled: boolean }) { {[row.piece, row.dataset].filter(Boolean).join(' / ')} + {row.status === 'draft' && row.identityWithdrawn && ( +{WITHDRAWN_DRAFT_NOTE}
+ )} {row.status === 'rejected' && row.reason && (Reason: {row.reason}
)} diff --git a/src/frontend/app/page.tsx b/src/frontend/app/page.tsx index 9cd596c4..b70d1c20 100644 --- a/src/frontend/app/page.tsx +++ b/src/frontend/app/page.tsx @@ -61,8 +61,8 @@ export default function Home() {Browse and filter components, open an element with its geometry and records, and on site record - elements and evidence from a phone.
+Browse and filter components, open a component with its geometry and records, and on site record + components and evidence from a phone.
{EXAMPLE_ID_NOTE}
- This is the element you look for. + This is the component you look for.
)} {status === 'bad' && (- This is not the element you look for. + This is not the component you look for.
)} diff --git a/src/frontend/components/components/ComponentProvenanceCard.tsx b/src/frontend/components/components/ComponentProvenanceCard.tsx index b49cc497..7941be07 100644 --- a/src/frontend/components/components/ComponentProvenanceCard.tsx +++ b/src/frontend/components/components/ComponentProvenanceCard.tsx @@ -14,6 +14,7 @@ import { import type { CatalogShallowRow } from '@/generated/catalogExtras' import InheritedMark from '@/components/lineage/InheritedMark' import ProvenanceEditDialog from '@/components/lineage/ProvenanceEditDialog' +import { everPublished } from '@/lib/everPublished' import { useMe } from '@/lib/me' import ComponentLineageIdentityBadges from './ComponentLineageIdentityBadges' import { @@ -59,20 +60,24 @@ const formatDate = formatDateAtPrecision type ComponentProvenanceCardProps = { catalog: CatalogComponent childIdentities?: CatalogShallowRow[] + /** the version rows: published once is not the same as a current version (8.193) */ + snapshots?: readonly { status?: string | null }[] } export default function ComponentProvenanceCard({ catalog, childIdentities = [], + snapshots, }: ComponentProvenanceCardProps) { const { identity } = catalog const parentIds = parentIdentityIds(identity) const origin = identity.origin const { me, moderates } = useMe() const [editOpen, setEditOpen] = useState(false) - // moderator(D); the creator while it is unpublished (8.9) --- the backend decides + // moderator(D); the creator while nothing was ever published (8.9, 8.193) --- the backend decides const canEdit = !!me && (moderates(identity.dataset) - || (!identity.current_snapshot_id && me._id === identity.created_by_user_id)) + || (!everPublished({ currentSnapshotId: identity.current_snapshot_id, versions: snapshots }) + && me._id === identity.created_by_user_id)) const [parentStatuses, setParentStatuses] = useState