fix: updated diagrams and docs - #238
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughDocumentation updates across architecture, components, frontend, and configuration: middleware stack reordered with MetricsMiddleware outermost and CSRF protection documented; schema management moved from migrations to declarative per-document indexes via Beanie; worker debug command prefixed with Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/reference/configuration.md (1)
110-110: Clarify “Default” vs “example in config.toml” wording.This line currently reads like both “no default” and “has a default.” Consider explicitly splitting as “code default: none” and “config.toml default:
http://jaeger:4317” to avoid operator confusion.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/reference/configuration.md` at line 110, The table row for OTLP_TRACES_ENDPOINT is ambiguous about defaults; update the entry for `OTLP_TRACES_ENDPOINT` so it clearly shows two distinct defaults: "code default: none" (or "no default") and "config.toml example/default: `http://jaeger:4317`", e.g., replace the current cell text with something like "code default: none; config.toml default/example: `http://jaeger:4317`" so readers cannot confuse the absence of a runtime default with the example value in config.toml.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/architecture/middleware.md`:
- Around line 90-93: Update the CSRF section to document the double-submit
cookie pattern used by CSRFMiddleware: specify that the server issues two
cookies—an httpOnly access_token cookie and a readable csrf_token cookie—and
that mutating requests (POST/PUT/DELETE) must include the csrf_token value in
the X-CSRF-Token header; note GET and safe methods are exempt. Mention the
frontend behavior: files matching frontend/src/**/*.{ts,svelte} auto-inject
authStore.csrfToken into the X-CSRF-Token header for non-GET requests and that
implementations must read the csrf_token cookie and send it in the header to
match CSRFMiddleware validation. Ensure the doc references the exact symbols:
CSRFMiddleware, access_token, csrf_token, X-CSRF-Token, and authStore.csrfToken.
---
Nitpick comments:
In `@docs/reference/configuration.md`:
- Line 110: The table row for OTLP_TRACES_ENDPOINT is ambiguous about defaults;
update the entry for `OTLP_TRACES_ENDPOINT` so it clearly shows two distinct
defaults: "code default: none" (or "no default") and "config.toml
example/default: `http://jaeger:4317`", e.g., replace the current cell text with
something like "code default: none; config.toml default/example:
`http://jaeger:4317`" so readers cannot confuse the absence of a runtime default
with the example value in config.toml.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
docs/assets/images/system_diagram.svgis excluded by!**/*.svg
📒 Files selected for processing (6)
docs/architecture/middleware.mddocs/architecture/rate-limiting.mddocs/components/schema-manager.mddocs/components/workers/index.mddocs/frontend/routing.mddocs/reference/configuration.md
There was a problem hiding this comment.
5 issues found across 6 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/architecture/middleware.md">
<violation number="1" location="docs/architecture/middleware.md:11">
P2: The documented "outermost first" middleware order is reversed; `CORSMiddleware` should be listed before `MetricsMiddleware` for actual request-entry order.</violation>
<violation number="2" location="docs/architecture/middleware.md:92">
P2: The CSRF documentation omits `PATCH`, but the middleware validates CSRF tokens for PATCH requests too.</violation>
<violation number="3" location="docs/architecture/middleware.md:92">
P2: The CSRF protection documentation is incomplete and could lead to incorrect implementations. The actual CSRF mechanism uses a double-submit cookie pattern: an `httpOnly` `access_token` cookie, a readable `csrf_token` cookie, and the `X-CSRF-Token` header — all three are required on state-changing requests. Only mentioning the header omits critical details about the cookie components of the protection scheme.</violation>
</file>
<file name="docs/components/schema-manager.md">
<violation number="1" location="docs/components/schema-manager.md:9">
P2: The docs claim Beanie `Settings` declaratively defines MongoDB validators, but the codebase only defines indexes there. This is inaccurate documentation.</violation>
<violation number="2" location="docs/components/schema-manager.md:11">
P2: The docs incorrectly state that MongoDB documents define a TTL index for idempotency keys; idempotency is stored in Redis, not MongoDB documents.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|



Summary by cubic
Updated system diagram and docs: middleware order with CORS/CSRF (frontend header), rate-limit config via TOML, declarative Beanie indexes, new /admin/executions route, uv run command, and tracing OTLP + K8s CPU request defaults.
Written for commit a22c331. Summary will update on new commits.
Summary by CodeRabbit