diff --git a/.gitignore b/.gitignore index b7947f70..9ff5c309 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.* .docs .dpc .devplace diff --git a/CLAUDE.md b/CLAUDE.md index ca676613..a4e3368d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -97,6 +97,7 @@ Nested `CLAUDE.md` files (loaded automatically by Claude Code only when a file i | Path | Covers | |------|--------| | `devplacepy/routers/CLAUDE.md` | Full URL prefix map, route aggregation rules, HTML/JSON negotiation, FastAPI patterns, gists, feed/listing features, engagement (reactions/bookmarks/polls/heatmap/follow/block-mute), SEO implementation, polymorphic comments/votes | +| `devplacepy/routers/admin/CLAUDE.md` | The admin page specification (A1-A11): rendering, response contract, page anatomy, class vocabulary, time, caps, remote work, live refresh, assets, the nav registry, responsiveness | | `devplacepy/routers/projects/CLAUDE.md` | Project detail page, virtual filesystem routes, visibility/read-only UI, deletion confirmation | | `devplacepy/routers/docs/CLAUDE.md` | The `/docs` documentation site: `DOCS_PAGES`, audience tiers, prose rendering, API tester | | `devplacepy/routers/devrant/CLAUDE.md` | devRant-compatible REST API (`/api`) | @@ -222,6 +223,10 @@ The escape hatch is deliberately two-factor and must never be self-served: after New user-generated tables are classified in `REPORTABLE_TARGETS` (with `resolve_object_url` and `_report_button.html`) or in `UNREPORTABLE_TABLES` with a reason; the suite enforces it. No social login, payment, purchasable randomness, advertising, or cross-app tracking without their app-store obligations. Full detail in `devplacepy/services/moderation/CLAUDE.md`. +## Admin pages follow one specification (hard rule) + +Every `/admin` page is built to `devplacepy/routers/admin/CLAUDE.md`: backend-rendered first paint with no "Loading..." placeholder, one builder shared by the HTML route and the `/data` refresh endpoint, `respond()` with an `*Out` model, `admin-*` classes only, `local_dt` for every instant, every list paginated or capped, no remote call in a GET, `Poller` only, one Chart.js path, and the section list declared once in `devplacepy/admin_sections.py`. `tests/unit/admin_spec.py` enforces the mechanical rules. A new admin page that breaks the spec does not ship. + ## Modal pattern See `devplacepy/templates/CLAUDE.md` (modal system, partials, CDN). diff --git a/DEFINITION_OF_DONE.md b/DEFINITION_OF_DONE.md index b8adde88..1f45d3ac 100644 --- a/DEFINITION_OF_DONE.md +++ b/DEFINITION_OF_DONE.md @@ -49,6 +49,7 @@ Single-process races do not count. Threads do not count. Luck does not count. - One shared `templates` instance; `nav_active` for nav state; `static_url`/`assetUrl` for every asset, never a bare `/static/` href; `dp-*` web components (no duplicates, real-button triggers inside popovers so no-JS stays correct, Escape closes); new JS reuses `Http`/`Poller`/`JobPoller`/`OptimisticAction`/`FloatingWindow`/`ScrollMemory`. - Server pipeline renders content for SEO (`render_content`/`render_title`, with `local_dt`/`dt_ago` for timestamps); the client pipeline is only for live content (`DOMPurify` fail-closed). Notifications use `render_title`. Emoji shortcodes come from the one map; YouTube embeds follow `embeds.py` only; emails are masked; em dashes become hyphens. - CSS: tokens from `variables.css` only (file-scoped `--x-*` palette block per new file, then `--color-*`/`--space-*`); `--z-*` bands; closed breakpoints; `prefers-reduced-motion` disables animation; no literals, no `var()` fallbacks, one radius per element, matching dark theme on first paint. +- Admin pages conform to `devplacepy/routers/admin/CLAUDE.md` (A1-A11): server-rendered first paint, one builder for HTML and `/data`, `respond()` with an `*Out` model, `admin-*` classes, `local_dt`, capped lists, `Poller`, the `ADMIN_SECTIONS` registry; `tests/unit/admin_spec.py` passes. ## 6. Services and jobs diff --git a/README.md b/README.md index e4fb2885..26f8e430 100644 --- a/README.md +++ b/README.md @@ -774,6 +774,7 @@ Configuration on the Services tab: | `gateway_rsearch_cost_per_call` | 0.0 | Flat cost attributed to each external `rsearch` call (web search / AI answer / chat / image describe), recorded under backend `rsearch` so external AI spend appears in AI usage | | `gateway_max_retries` / `gateway_retry_backoff_ms` | 2 / 250 | Retry attempts and linear backoff on timeout, connection error, or upstream 5xx | | `gateway_circuit_threshold` / `gateway_circuit_cooldown_seconds` | 5 / 30 | Consecutive failures before the circuit breaker opens, and its cooldown | +| `gateway_target_circuit_enabled` | on | Per-model circuit breaker: one upstream error opens it for the cooldown and notifies every admin with the error details | | `gateway_usage_retention_hours` | 720 | How long per-call usage rows are kept before pruning (30 days) | | `gateway_model_context_map` | JSON map | Model to max-context-tokens map for context-window utilization tracking | @@ -798,7 +799,7 @@ token usage with averages and percentiles (p50/p90/p95/p99), latency (upstream r gateway overhead, semaphore queue wait, connection establishment), error rates by category, cost (per model, per caller, input vs output, projected monthly burn, caching savings), caller behavior, and an hourly breakdown - divided and combined. The gateway also retries -transient upstream failures and opens a circuit breaker after repeated failures. Time to +transient upstream failures, opens a circuit breaker after repeated failures, and opens a per-model breaker on the first error of a model and notifies every admin. Time to first token and inter-token latency are not reported because the gateway forwards non-streaming to the upstream. diff --git a/pyproject.toml b/pyproject.toml index 51b8d6bf..6762b808 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "devplacepy" -version = "1.1.26" +version = "1.1.27" description = "DevPlace - The Developer Social Network" requires-python = ">=3.12" dependencies = [