chore(examples): conform web UI demo to main's API surface#231
Merged
Conversation
With GET /libraries (#227) and GET /projects (#229) on main, the demo now bootstraps. This conforms the rest of it to main's actual API: - features.js capability map: panels check a flag and degrade to a clear "not available in this build" state instead of calling endpoints that 404. libraries/projectsList on (landed); library writes, project settings/sources, coordination/required-sections, and hard-delete stay off. - Repoint getSpecTree -> GET /specs/:id (the single-spec read already returns the tree). Drop the explicit deleteReference call — references are derived from paragraph text, so the paragraph PATCH re-derives them. - Restore the reference-web arcs by fetching project-scoped outbound references (GET /projects/:id/specs/:specId/references, ADR-024) per loaded spec. Verified end-to-end with Playwright: clean boot, default project auto-created, all bootstrap calls 200/201, zero console 404s, gated endpoints never hit. Closes #230 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds a new ChangesWeb UI Demo API Conformance
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
Author
|
Worked with a docx file, but not a sec file. This is okay for this phase of development. |
This was referenced Jun 21, 2026
thewrz
added a commit
that referenced
this pull request
Jun 22, 2026
…libraries/:id (#233) * feat(api): library write endpoints — POST /libraries/clients, PATCH /libraries/:id Re-enables the demo's Library panel (gated behind libraryWrites in #231). - POST /libraries/clients: create a client-tier library. Body { name, parentLibraryId? }; parent defaults to the Default Company Master (resolved by name), and an explicit parent must be company-tier (422 otherwise). owner is set to the name. 201; 409 on duplicate name; 404 unknown parent. - PATCH /libraries/:id: rename (name only — owner unchanged, §8). Only client-tier libraries are renameable; built-in masters return 422 (renaming them would break name-based resolution). 200; 404 unknown; 409 duplicate. - New updateLibraryName query; openapi documents both; contract gate covers them. Closes #232 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(api): tier-check the default client-library parent + harden test Addresses two CodeRabbit findings on #233: - resolveClientParent now validates the seeded Default Company Master is company-tier (500 if misconfigured), matching the explicit-parent path — defends against a misconfigured seed attaching a client to a non-company parent. - The library test's companyMasterId helper matches by name (Default Company Master), not just tier, so the "default parent resolves by name" contract can't be masked by a stray extra company-tier library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thewrz
added a commit
that referenced
this pull request
Jun 22, 2026
…raries (#235) * feat(api): PUT /projects/:id/sources — replace a project's source libraries Re-enables the demo's project-sources editing (gated behind projectSources in #231). - PUT /projects/:id/sources → replace the ordered source-library list. Body { sourceLibraryIds } (≥1, unique, each company/client-tier — reuses validateSourceLibraries, the same check as POST /projects). 200 with the updated { projectId, sources }; 404 unknown project; 422 invalid/reference-tier source; 400 empty/duplicate body. - Transactional delete+reinsert (the two project_sources unique constraints rule out a single-statement CTE). Re-ordering does NOT re-resolve already-derived specs — copies are immutable (ADR-015 D2); sources affect future resolution + the broken-ref availableFrom advisory only. - openapi documents it; contract gate covers it. Closes #234 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * fix(api): UUID-validate project id + unify setProjectSources error surface Addresses three CodeRabbit findings on #235: - setProjectSourcesHandler now validates :id as a UUID up front (400) instead of letting a malformed id reach the DB and surface as a 500 (22P02). - setProjectSources moves validateSourceLibraries + pool.connect inside the try so every failure (incl. a failed connect) goes through one DatabaseError surface; InvalidSourceLibraryError still re-throws unwrapped → 422. Client is nullable with guarded rollback/release. - Adds 400 regression tests for duplicate sourceLibraryIds and a malformed id. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The web UI demo (merged frontend-only in #225) was built against the mockup island's richer API. Now that
GET /libraries(#227) andGET /projects(#229) are onmain, the demo's bootstrap works again — but it still called endpointsmaindoesn't have (library writes, project settings/sources, coordination/required-sections, hard delete). This conforms the demo tomain's real surface and restores the linkage web.What (examples-only)
features.jscapability map — each panel checks its flag and degrades to a clear "not available in this build" state instead of 404ing.libraries/projectsListon (landed); the rest off, flipped on as future endpoints land.getSpecTree→GET /specs/:id(the single-spec read already returns the tree) and drop the explicitdeleteReferencecall — refs are derived from paragraph text, so the paragraph PATCH re-derives them.GET /projects/:id/specs/:specId/references, ADR-024) per loaded spec — the single-spec read no longer bundles them.Testing
main: clean boot, default project auto-created, every bootstrap call 200/201, 0 console errors/404s, gated endpoints never hitnode --checkon every edited JS file; NUL-scanned.SEC/DOCX → board populates, arcs draw🤖 Co-authored by Claude Opus 4.8. Closes #230.
Summary by CodeRabbit
New Features
Refactor