Commit Graph

464 Commits

Author SHA1 Message Date
0a77215fac fix(db): widen ai_sessions.status column from varchar(20) to varchar(30)
'requesting_escalation' is 23 characters, exceeding the varchar(20)
limit. This caused a StringDataRightTruncationError 500 on escalate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 01:23:33 +00:00
60334cde93 fix(db): add rollback on exception in get_db dependency
Prevents InFailedSQLTransaction cascade — when a request fails mid-
transaction, the connection is rolled back before being returned to
the pool, so subsequent requests on the same connection don't inherit
a poisoned transaction state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 01:10:07 +00:00
7c3be84b52 feat(flowpilot): add navigation guard for active sessions
Shows a confirmation modal when user tries to navigate away during an
active troubleshooting session. Options: "Stay in Session" or "Pause &
Leave" which auto-pauses the session before navigating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:44:48 +00:00
60b380ae1e fix(dashboard): auto-submit FlowPilot session when prefill from dashboard
When user types a problem on the dashboard and hits Enter, skip the
intake form and start the session immediately — no double-enter.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 00:18:43 +00:00
3d911d2dc9 feat(dashboard): FlowPilot cockpit dashboard + sidebar redesign
- Replace QuickStartPage with FlowPilot-centric dashboard
- Add StartSessionInput with Guided/Chat mode toggle
- Add PendingEscalations, ActiveFlowPilotSessions, PerformanceCards
- Add KnowledgeBaseCards, TeamSummary, RecentFlowPilotSessions
- Every number/card is a portal to its detail page
- Restructure sidebar: Resolve/Knowledge/Insights sections
- Remove redundant nav items (FlowPilot, Flow Editor, Flow Assist, etc.)
- Wire prefill from dashboard input to FlowPilot intake
- Update mobile nav to match new sidebar structure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:22:50 +00:00
6122dda71d fix(flowpilot): extract _build_session_detail helper, fix link_ticket 500
The same model_validate bug existed in link_ticket endpoint (line 467).
Extracted the manual AISessionDetail construction into a shared helper
_build_session_detail() used by both get_session and link_ticket.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 06:28:11 +00:00
0118b80b63 fix(flowpilot): fix session detail 500 — build AISessionDetail manually
Root cause: AISessionDetail.model_validate(session) tried to validate the
ORM relationship 'steps' which has field 'id', but AISessionStepResponse
expects 'step_id'. This caused a Pydantic ValidationError on every session
detail load.

Fix: Construct AISessionDetail manually from ORM fields, passing the
already-built step_responses list directly instead of relying on
model_validate to serialize the ORM steps relationship.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 06:25:57 +00:00
5eeff0c83a debug: add detailed error reporting for session detail serialization
Temporary debug commit — surfaces the actual exception when GET /ai-sessions/{id}
fails with 500, instead of generic "Internal server error" from middleware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 06:20:27 +00:00
7518fe643b fix(cors): return proper responses from middleware instead of re-raising
Root cause: Both RequestLoggingMiddleware and ErrorLoggingMiddleware used
BaseHTTPMiddleware and re-raised exceptions. When an exception (like a 401
from auth) was re-raised, the response never flowed back through
CORSMiddleware, so browsers received error responses without CORS headers.
This made 401 errors appear as CORS errors, breaking session resume and
other operations after token expiry.

Fix: Both middlewares now catch exceptions and return JSONResponse objects
(with correct status codes from HTTPException) instead of re-raising. This
ensures responses always flow through CORSMiddleware and receive proper
Access-Control-Allow-Origin headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 06:05:20 +00:00
9d202c67f2 fix(flowpilot): make action bar fixed to viewport bottom
Previous approach tried to fix the flex height chain, but it proved fragile
across grid → main → outlet → page transitions. New approach: action bar is
position:fixed at the bottom of the viewport, offset by sidebar width via
CSS variable --sidebar-w. Conversation area has pb-20 for clearance.

This works regardless of the height chain, email verification banner,
or any other variable-height elements above the session.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 06:00:11 +00:00
09a42a943a fix(flowpilot): use calc(100vh-56px) for session page height — matches tree editor pattern
The flex height chain through grid → main → outlet → page doesn't reliably
constrain height, causing the action bar to overflow below viewport. The tree
editor already solves this with h-[calc(100vh-56px)] (subtracting the topbar).
Apply the same proven pattern to FlowPilotSessionPage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:50:49 +00:00
d3211c3d24 fix(layout): add min-h-0 to main-content — prevents grid overflow
Root cause found via DOM inspection: main-content (a CSS grid item) had
default min-height:auto, which prevented the grid from constraining it
below its content height. Content grew to 994px in a 975px viewport,
pushing the FlowPilot action bar (Resolve/Escalate/Pause) 75px below
the visible area. overflow:hidden on the grid clipped it invisibly.

Fix: min-h-0 on main-content allows the grid to shrink it to fit,
completing the height chain all the way down to the action bar.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:37:16 +00:00
5fa9c57c17 fix(layout): add flex flex-col to ViewTransitionOutlet — fixes action bar visibility
Root cause: ViewTransitionOutlet wrapping <Outlet> had flex-1 min-h-0 but
display:block (no flex flex-col). Child pages using h-full flex-col couldn't
resolve height against a block parent, so content overflowed and the
FlowPilot action bar (Resolve/Escalate/Pause) rendered below the viewport.

Fix: Add flex flex-col to the outlet wrapper so the full flex height chain
works: app-shell grid → main flex-col → outlet flex-col → page flex-col.

Also removed the h-0 workaround from FlowPilotSessionPage since this
addresses the actual root cause.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:29:33 +00:00
0d1d8218b9 fix(flowpilot): render markdown in context messages + fix action bar height chain
Two issues:
1. AI context messages (teal bubble) rendered raw markdown (**bold** etc.)
   instead of parsed markdown — switched from <p> to <MarkdownContent>
2. Action bar still hidden — added h-0 to flex-1 wrapper to force explicit
   height allocation so h-full on FlowPilotSession resolves correctly

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 05:05:53 +00:00
5bd018ed5c fix(flowpilot): fix broken height chain hiding action bar (Resolve/Escalate/Pause)
The FlowPilotSession component uses h-full flex-col to position the action
bar at the bottom, but its parent div in FlowPilotSessionPage only had
flex-1 min-h-0 without flex flex-col. This broke the height chain, causing
the action bar to render below the visible area.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 04:55:33 +00:00
eed771cb27 fix: prevent InFailedSQLTransactionError in session creation
Root cause: embedding generation could break the DB transaction via a failed
SQL statement. The except block caught the Python error but left the transaction
in a failed state. Subsequent queries (_record_usage → subscription lookup)
then failed with InFailedSQLTransactionError.

Fixes:
- session_embedding_service: use begin_nested() savepoint so failures don't
  poison the parent transaction
- ai_sessions.py: add db.rollback() before _record_usage in all 3 error
  handlers (create, respond, pickup) to recover from broken transactions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 04:36:12 +00:00
2ed8a2af15 fix: 6 integration audit fixes — ticket filter, admin nav, FK scope, debounce, error messages
- Fix AISession.ticket_id → psa_ticket_id in list_sessions filter query
- Add Gallery nav item (LayoutGrid icon) to AdminSidebar navItems array
- Remove ForeignKey from FileUpload.session_id (Python model) + migration b8d2f4a6c091 to drop DB constraint, allowing column to reference either session type
- Add 400ms debounce on AI session search input in SessionHistoryPage (aiSearchInput state + useRef timeout pattern)
- Show friendly 503 error message in RichTextInput upload error handler (both initial upload and retry paths)
- Add overflow-x-auto to FlowPilotAnalyticsPage tab bar container

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 04:06:41 +00:00
cb54045593 docs: update CURRENT-STATE.md and stack priorities — Search & Evidence complete
Evidence: S3 storage, clipboard paste uploads, exports integration.
Search: structured filters, FTS, Command Palette, semantic similar sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:53:36 +00:00
5e009fd752 feat(search): add similar sessions UI in FlowPilot sidebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:52:19 +00:00
e356103408 feat(search): add semantic similar session matching via Voyage AI embeddings
Adds vector-based similar session discovery using the existing Voyage AI
embedding infrastructure and pgvector cosine similarity search.

- New AISessionEmbedding model with vector(1024) column
- session_embedding_service: generate + upsert embeddings, find similar sessions
- Embeddings generated on session create (from problem_summary/domain) and
  updated on resolve (adds resolution_summary)
- GET /ai-sessions/{id}/similar endpoint returns top-N similar sessions
- Migration a7c9e3b1f402 creates ai_session_embeddings table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:48:09 +00:00
ce68fa84ca feat(search): add PostgreSQL FTS on AI sessions with Command Palette integration
- Migration: add generated tsvector column + GIN index on ai_sessions (problem_summary, resolution_summary, escalation_reason, problem_domain)
- Backend: wire FTS into list_sessions q param; add GET /ai-sessions/search endpoint returning AISessionSearchResult (registered before /{session_id} to avoid UUID routing conflict)
- Frontend: add AISessionSearchResult type, aiSessionsApi.search() method, and Command Palette group "FlowPilot Sessions" using Zap icon navigating to /pilot/:id

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:42:01 +00:00
c3afc7a059 feat(search): add structured filters to AI session list endpoint and frontend
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:34:54 +00:00
1d5454c31b feat(evidence): add RichTextInput with clipboard paste and wire into FlowPilot
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:31:03 +00:00
f87f3d47de feat(evidence): add upload types and API client for frontend
- FileUploadResponse and PendingUpload types in types/upload.ts
- uploadsApi with upload(), getUrl(), list(), remove() methods
- Exported from types/index.ts and api/index.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:22:57 +00:00
241ea1e458 feat(evidence): add file upload/download API endpoints with tests
- POST /uploads: multipart upload with content-type/size validation, per-session limits, S3 storage
- GET /uploads/{id}/url: presigned download URL with account ownership check
- GET /uploads: list uploads for a session
- DELETE /uploads/{id}: delete with ownership enforcement (403 for non-owners)
- Returns 503 gracefully when STORAGE_ENDPOINT is not configured
- 15 integration tests covering auth, validation, 503 behavior, and ownership

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:22:52 +00:00
c7d602cfa5 feat(evidence): add S3 storage service and file_uploads model
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 03:15:37 +00:00
4bbdce5123 docs: add Search & Recall + Evidence implementation plan
10 tasks: S3 storage service, upload endpoints, RichTextInput with clipboard
paste, FlowPilot integration, export evidence, structured filters, FTS,
Command Palette search, semantic similar matching, similar sessions UI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 02:48:10 +00:00
9395e5ecf7 docs: add Search & Recall + Evidence-Rich Sessions design document
Evidence: Railway Object Storage, file_uploads model, clipboard paste UX.
Search: structured filters, PostgreSQL FTS on sessions, semantic similar matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 02:45:52 +00:00
7bbcf0face fix(analytics): 4 UX polish fixes — resolution time column, empty states, type badges, select styling
- CoverageHeatmap: add Avg Resolution column with inverse color thresholds (green <10 min, amber 10–20 min, red >20 min); updated colSpan to 7
- FlowPilotAnalyticsPage: show positive empty state when knowledge gaps list is empty instead of rendering nothing
- FlowQualityTable: add tree_type badge next to flow name (Troubleshooting/Project/Maintenance with distinct colors)
- FlowPilotAnalyticsPage: add [&>option] Tailwind classes to period select for improved dark-theme contrast in Chrome/Firefox

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:07:40 +00:00
acf98d3a01 test(analytics): add PSA metrics endpoint tests — funnel, time entries, daily trend
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 01:06:30 +00:00
9a1dba0e5f fix(analytics): fix 8 frontend UX issues — routing, accessibility, error states, sort indicators
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:39:44 +00:00
94fbb38f84 fix(analytics): fix 6 backend audit issues — domain matching, funnel counts, decimal casts, dead queries
- Issue 1: Normalize domain lookup to lowercase on both sides (flow category names and session problem_domain) to fix case-sensitive mismatch in coverage endpoint
- Issue 2: Count distinct ai_session_id (not PsaPostLog.id) in doc_pushed funnel step to avoid inflating counts on retried sessions
- Issue 3: Clamp recency_score to [0.0, 1.0] with min/max to handle negative days_since from future timestamps (clock skew/test data)
- Issue 4: Wrap func.sum(case(...)) results with int() in dashboard endpoint to handle Decimal returns from asyncpg
- Issue 5: Remove dead domain_flow_counts_result query (result fetched but never consumed) to eliminate unnecessary DB round-trip
- Issue 6: Replace select(Tree) with select(Tree.id, Tree.name, Tree.tree_type) in flow-quality endpoint to avoid loading large tree_structure JSONB column

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:36:30 +00:00
e89f067f78 docs: update CURRENT-STATE.md — Phase 5 Analytics Enhancement complete
Tabbed analytics with coverage heatmap, flow quality scoring, PSA metrics
panel, flow usage tracking, and PSA activity logging all complete.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:23:00 +00:00
c2ff88a417 feat(analytics): add flow quality table and PSA metrics panel
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:21:46 +00:00
647ad0e2d5 feat(analytics): add tabbed layout with coverage heatmap
Add Phase 5 types (CoverageResponse, FlowQualityResponse, EnhancedPsaMetrics)
and API methods. Refactor FlowPilotAnalyticsPage with tab bar (Overview,
Coverage, Flow Quality, PSA) with lazy data loading. Create CoverageHeatmap
component with color-coded resolution/escalation/guided rate cells.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:16:09 +00:00
ae51e6e83c feat(analytics): wire flow usage tracking into session matching and resolution
- In `start_session`: increment `flow.usage_count` and set `flow.last_matched_at`
  when a flow is matched to a new session; errors are caught without blocking
- In `resolve_session`: recalculate `flow.success_rate` as (resolved / total)
  across all sessions ever matched to the flow after each resolution; errors
  are caught without blocking the session close

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:11:12 +00:00
a567d6d245 feat(analytics): add PSA activity logging and enhanced PSA metrics endpoint
- Log `note_posted` and `time_entry_posted` activities to `psa_activity_logs`
  after each successful PSA push in `psa_documentation_service.py`; errors
  are caught and logged without blocking the main push flow
- Add `PsaFunnel`, `PsaDailyTrend`, and `EnhancedPsaMetrics` Pydantic schemas
- Add `GET /analytics/flowpilot/psa-metrics?period=30d` endpoint (team_admin,
  rate-limited 15/min) returning time entry totals, push funnel
  (sessions → linked → doc pushed → time entry logged), and daily trend

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:11:07 +00:00
7ec626f45a feat(analytics): add coverage heatmap and flow quality scoring endpoints
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:08:09 +00:00
779b29dbc4 feat(analytics): add flow tracking columns and psa_activity_logs table
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 00:00:34 +00:00
4d43ddcb90 docs: add Phase 5 analytics enhancement implementation plan
10 tasks: flow tracking columns, coverage endpoint, flow quality endpoint,
PSA activity logging, flow matching wiring, frontend tabs with heatmap,
quality table, and PSA metrics panel.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:33:20 +00:00
8b408f3418 docs: add Phase 5 analytics enhancement design document
Tabbed analytics page with coverage heatmap, flow quality scoring,
and PSA metrics. Extends existing FlowPilot analytics infrastructure.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 22:31:25 +00:00
76512c69d8 docs: update CURRENT-STATE.md — Phase 4 complete, all 5 slices done
Public Templates Gallery, Notifications, Session Export polish,
Mobile/Responsive pass, and Enterprise Readiness all complete.
Updated What's Next to reflect Phase 5 priorities.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:39:52 +00:00
a404fb13ed feat(enterprise): add SSO/SAML groundwork — model columns and stub service
- Add sso_enabled, sso_provider, sso_config (JSONB) columns to Account model
  (migration included in branding commit 58e3f27f3e8f)
- Create sso_service.py stub with initiate_sso_login, process_sso_callback,
  validate_sso_config — all raise NotImplementedError (Phase 5)
- Add GET /accounts/me/sso endpoint returning enabled status and provider
- Add SSO section in AccountSettingsPage with Enterprise badge and Contact Us link

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:35:45 +00:00
21d6d09c05 feat(enterprise): add multi-PSA adapter stubs for Autotask and Halo PSA
- Create AutotaskProvider stub with all abstract methods raising NotImplementedError
- Create HaloPSAProvider stub with all abstract methods raising NotImplementedError
- Add PSA provider grid in IntegrationsPage showing ConnectWise (active),
  Autotask (Coming Soon), and Halo PSA (Coming Soon) with appropriate badges

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:35:39 +00:00
2f56327f81 feat(enterprise): add custom branding system — logo, accent color, company name
- Add branding_logo_url, branding_primary_color, branding_company_name columns to Account model
- Add Alembic migration (58e3f27f3e8f) for branding and SSO columns
- Add GET/PATCH /accounts/me/branding endpoints (owner-only for PATCH)
- Add BrandingSettingsPage with logo URL input, color picker, preview section
- Add /account/branding route (ProtectedRoute owner) in router.tsx
- Add Branding link card in AccountSettingsPage

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:35:35 +00:00
1f4a8a6389 fix(responsive): audit and fix FlowPilot + analytics components for mobile/tablet
Add responsive Tailwind classes across 11 FlowPilot-related components:
- FlowPilotSession: collapsible mobile sidebar summary, responsive padding
- FlowPilotActionBar: stacked buttons on mobile, responsive resolve modal
- FlowPilotIntake: responsive submit area, padding, heading sizes
- FlowPilotStepCard: responsive padding (p-3/p-4/p-5), stacked action buttons
- FlowPilotOptions: responsive padding, 44px touch targets
- SessionDocView: responsive card padding, touch-friendly star ratings
- EscalateModal: stacked buttons on mobile with min touch targets
- EscalationQueue: responsive card padding, touch targets
- InSessionScriptGenerator: responsive padding, stacked continue buttons
- ReviewQueuePage: responsive two-panel layout (stacked on mobile)
- FlowPilotAnalyticsPage: responsive header, chart card padding

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:19:52 +00:00
967a2b2c59 feat(export): add branding footer to all 5 export formats and PDF spinner
- Add "Generated with ResolutionFlow — https://resolutionflow.com" footer
  to markdown, text, HTML, PSA formats (both troubleshooting and procedural
  variants — 8 generators total)
- Fix PDF @page CSS: "Powered by ResolutionFlow" now appears on every PDF,
  not just for users with a custom logo (removed the has_custom_logo conditional)
- Add Loader2 spinner icon to PDF download button in ExportPreviewModal
  when pdfLoading is true, replacing the static Download icon

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:09:26 +00:00
12a373a2a2 feat(gallery): add admin gallery curation endpoints and management page (Task 6)
Add super-admin-only backend endpoints for toggling is_gallery_featured and
gallery_sort_order on flows and scripts, plus a frontend GalleryManagementPage
with toggle switches, editable sort order fields, and name/featured filters.
13 integration tests; all pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 20:04:40 +00:00
2b657fc4ac feat(gallery): add public templates gallery frontend (Tasks 4 & 5)
Add types, API client, page component, card components, detail modal,
and /templates route for the public templates gallery. Uses raw fetch()
for unauthenticated access, glass-card design system, and URL-synced
filters with debounced search.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 19:18:58 +00:00
bacdb9d466 feat(public-gallery): add public templates gallery API (Tasks 2 & 3)
Implements a no-auth read-only API for the public templates gallery page:
- Schemas in schemas/public_templates.py (PublicFlowTemplate, PublicScriptTemplate, PublicGalleryResponse, PublicFlowDetail, PublicScriptDetail)
- Five endpoints under /api/v1/public/templates: listing, flow detail, script detail, categories with counts, full-text search
- Tree preview truncated to 3 levels max; script_body never exposed
- Rate limited at 30/minute; paginated with category/type/sort filters
- 25 passing integration tests covering feature flags, truncation, script body protection, search, categories, and 404 behavior

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 19:12:34 +00:00