Harden Cleverbrush reference implementation#26
Merged
Conversation
877a09d to
706bf4e
Compare
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.
Original request
Make xpenser a stronger demonstrator/test project for Cleverbrush Framework by inspecting the framework documentation and local source, reviewing for security and best practices, improving JSDoc documentation, and improving test coverage. Also use the wording “projects based on CleverBrush Framework” rather than “CleverBrush based projects.”
What changed
docs/cleverbrush-reference.mdand linked it fromREADME.mdto document the reference architecture, framework usage rules, security baseline, tests to keep, and a new-feature checklist for projects based on CleverBrush Framework..env.example.instrumentKnex(..., { sanitizeStatement: () => '<redacted>' }).schemaName()from cloned leaf/enum fragments and reusing named object schema instances where they are intended to become shared components.createOpenApiEndpoint()instead of globalserveOpenApi()middleware. Preview QA initially found/external-api/openapi.jsonreturning 404 because this framework version routes requests before unmatched global middleware can serve them.Reasoning
The implementation follows the current Cleverbrush docs and local framework source under
/root/projects/framework: named schemas are reference-based OpenAPI components and must be reused as single constants; auth schemes are reflected into OpenAPI security; the client supports middleware/batching composition; React forms are configured through registered schema renderers; andinstrumentKnexsupports statement sanitization. The changes are intentionally conservative: they strengthen the app as a reference implementation without changing user-facing workflows.Screenshots / preview evidence
Screenshots are not applicable for this PR because it changes documentation, configuration guardrails, generated API metadata, telemetry privacy, and tests rather than visual UI.
Manual preview QA passed at
https://xpenser-pr-026.cleverbrush.com:/external-api/openapi.jsonreturned 200 after the OpenAPI endpoint fix.xpenser API,bearerAuth,apiKey, and/api/auth/mesecurity alternatives./dashboardwith the authenticated app shell visible.Validation
Local validation completed on commit
706bf4e:npm run lintpassed.npm run typecheckpassed.npm testpassed: 57 files, 322 tests.npm run test:coveragepassed: 57 files, 322 tests, 60.5% statement coverage.git diff --checkpassed./cleverbrush/framework; docs were checked for OpenAPI generation, server/auth, batching, react-form, and OTel patterns./root/projects/frameworkforschemaNameregistry behavior,instrumentKnexsanitization support, and OpenAPI middleware/endpoint serving behavior.GitHub checks on commit
706bf4e:Lint and testpassed.Deploy PR environmentpassed.Playwright e2epassed.SigNoz verification:
http.server.duration.countmetrics forservice.name IN ('xpenser-web-pr-26', 'xpenser-api-pr-26')after manual preview QA.26; no matching logs, traces, or metrics were present.service.namefield values currently show earlier xpenser PR services but not PR Harden Cleverbrush reference implementation #26, and the metric query reportedhttp.server.duration.countwas last seen outside the checked range.