devtools
Development-only library providing x-ray vision into running Boundary applications. Zero production overhead — loaded only via the :dev and :repl-clj aliases.
|
Note
|
Not published to Clojars. Included as a local dependency via libs/devtools.
|
Features
The DX Vision feature set spans six phases:
-
Guidance Engine — startup dashboard, post-scaffold tips, contextual help, command palette
-
Introspection — route table, config tree (secrets redacted), module/migration/test state analysis, schema exploration
-
Error Pipeline — BND-xxx error codes, classifier → enricher → formatter chain, auto-fix suggestions
-
Dev Dashboard — browser-based UI at
localhost:9999with live system views -
Advanced REPL — request/response recording, route testing, rapid prototyping
-
Dashboard Extensions + AI — jobs monitoring, config editor, security status, AI-powered code review
Error Pipeline
Layered pipeline: classify → enrich → format → output. All pure functions in core/, side effects in shell/.
BND Error Codes
| Range | Category |
|---|---|
BND-1xx |
Configuration errors |
BND-2xx |
Validation errors |
BND-3xx |
Persistence errors |
BND-4xx |
Authentication / authorization |
BND-5xx |
Interceptor pipeline |
BND-6xx |
FC/IS violations |
Auto-Fix
;; Fix the last error (safe fixes auto-apply, risky ones confirm)
(fix!)
;; Fix a specific exception
(fix! ex)
Safe fixes (e.g. setting an env var) apply automatically. Risky fixes (e.g. running a migration) always prompt for confirmation regardless of guidance level.
Dev Dashboard
Local web UI at http://localhost:9999 providing live insight into the running system.
Pages
| Page | What it shows |
|---|---|
|
System overview: components, routes, modules, environment |
|
Filterable route table with interceptor chains |
|
Live request stream (HTMX polling, 2s interval) |
|
Malli schema browser with example generation |
|
Database explorer: migrations, pool stats, query runner |
|
BND-coded errors with fix suggestions |
|
Job queue stats, failed jobs with retry button |
|
Editable config tree with secret redaction and diff preview |
|
Security posture: password policy, auth methods, MFA, CSRF, rate limiting |
|
In-app documentation browser |
Architecture
-
Integrant component (
:boundary/dashboard) starts Jetty on port 9999 -
Server-rendered Hiccup + HTMX polling for live updates
-
Request capture middleware wraps the main HTTP handler (port 3000)
-
Dark theme CSS in
resources/dashboard/assets/dashboard.css
Introspection & REPL Tools
;; Route table
(routes)
;; Config tree (secrets redacted)
(config)
;; Module summary
(modules)
;; Schema exploration
(schema-tree :user/CreateUser)
(schema-example :user/CreateUser)
(schema-diff :user/CreateUser :user/UpdateUser)
Request Recording
Capture HTTP request/response pairs for debugging and replay.
;; Start recording
(def session (recording/create-session))
;; After capturing entries, inspect them
(recording/format-entry-table session)
(recording/diff-entries session 0 1)
;; Save/load sessions
(recording/serialize-session session)
Route Testing
Add or remove routes on a running system without restart.
;; Add a temporary test route
(router/add-route {:path "/test" :method :get :handler my-handler})
;; Inject a tap interceptor for debugging
(router/inject-tap-interceptor route-name)
AI REPL Commands
Three AI-powered commands (require an AI provider to be configured):
;; Code review
(ai/review "path/to/file.clj")
;; Suggest missing test cases
(ai/test-ideas "path/to/file.clj")
;; FC/IS refactoring guide
(ai/refactor-fcis 'boundary.product.core.validation)
(new-feature!) Workflow
End-to-end feature scaffolding from a single REPL call:
(new-feature! "invoicing"
"Invoice module with customer, line-items, PDF export")
Steps: AI spec generation → confirm → scaffold → integrate → test.
Key namespaces
| Namespace | Layer | Responsibility |
|---|---|---|
|
core |
Exception → BND-xxx code mapping (5 strategies) |
|
core |
Adds stacktrace, suggestions, fix descriptor, URLs |
|
core |
Rich formatted output with BND code header |
|
core |
Pure fix descriptor registry |
|
core |
BND error catalog (BND-1xx through BND-6xx) |
|
core |
Startup dashboard, tips, command palette |
|
core |
Route table, config tree, module summary |
|
core |
Schema tree, diff, example generation |
|
core |
Request/response session management |
|
core |
Route addition/removal, tap interceptor injection |
|
core |
Malli schema → scaffold spec conversion |
|
core |
Config redaction, formatting, diff |
|
core |
Security posture analysis |
|
shell |
Unified REPL API |
|
shell |
Integrant component, Reitit router for dashboard |
|
shell |
Dev error enrichment middleware |
Testing
clojure -M:test:db/h2 :devtools