aboutsummaryrefslogtreecommitdiff
path: root/CLAUDE.md
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-09 17:43:08 +0100
committerGitHub Enterprise <[email protected]>2026-03-09 17:43:08 +0100
commitb37b34ea6ad906f54e8104526e77ba66aed997da (patch)
treee80ce17d666aff6d2f0d73d4977128ffb4055476 /CLAUDE.md
parentadd fallback for zencache multirange (#816) (diff)
downloadzen-b37b34ea6ad906f54e8104526e77ba66aed997da.tar.xz
zen-b37b34ea6ad906f54e8104526e77ba66aed997da.zip
Dashboard overhaul, compute integration (#814)
- **Frontend dashboard overhaul**: Unified compute/main dashboards into a single shared UI. Added new pages for cache, projects, metrics, sessions, info (build/runtime config, system stats). Added live-update via WebSockets with pause control, sortable detail tables, themed styling. Refactored compute/hub/orchestrator pages into modular JS. - **HTTP server fixes and stats**: Fixed http.sys local-only fallback when default port is in use, implemented root endpoint redirect for http.sys, fixed Linux/Mac port reuse. Added /stats endpoint exposing HTTP server metrics (bytes transferred, request rates). Added WebSocket stats tracking. - **OTEL/diagnostics hardening**: Improved OTLP HTTP exporter with better error handling and resilience. Extended diagnostics services configuration. - **Session management**: Added new sessions service with HTTP endpoints for registering, updating, querying, and removing sessions. Includes session log file support. This is still WIP. - **CLI subcommand support**: Added support for commands with subcommands in the zen CLI tool, with improved command dispatch. - **Misc**: Exposed CPU usage/hostname to frontend, fixed JS compact binary float32/float64 decoding, limited projects displayed on front page to 25 sorted by last access, added vscode:// link support. Also contains some fixes from TSAN analysis.
Diffstat (limited to 'CLAUDE.md')
-rw-r--r--CLAUDE.md13
1 files changed, 10 insertions, 3 deletions
diff --git a/CLAUDE.md b/CLAUDE.md
index 405494acb..32c4b3d40 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -206,15 +206,22 @@ The codebase is organized into layered modules with clear dependencies:
- clang-format enforced via pre-commit hooks
- Use `std` containers; `eastl::fixed_vector` etc. for performance-critical paths where the number of elements
in the container is typically small or when the container is temporary and suitable for stack allocation.
+- For shared ownership, prefer intrusive reference counting via `TRefCounted<T>` (or `RefCounted`) with `Ref<T>`
+ over `std::shared_ptr`. Since the ownership policy is known at type definition time, the overhead of
+ `std::shared_ptr` (separate control block, etc.) is unnecessary.
- Exceptions used only for unexpected errors, not flow control
- Some `std` exception types like `runtime_error` are also available in the `zen` namespace and offer
convenience of formatting the exception message by allowing fmt-style formatting without using
`fmt::format` which can reduce clutter. To use these, please `#include <zencore/except_fmt.h>`
-- Logging is done via `ZEN_DEBUG(...)`, `ZEN_INFO(...)`, `ZEN_WARN`, `ZEN_ERROR` macros
- - Logging macros use `fmt::vformat` internally for message formatting. The first argument is the format string,
+- Logging is done via `ZEN_DEBUG(...)`, `ZEN_INFO(...)`, `ZEN_WARN(...)`, `ZEN_ERROR(...)` macros
+ - Prefer these over the older `ZEN_LOG_INFO`, `ZEN_LOG_WARN`, etc. variants which require an explicit log category parameter
+ - Logging macros use `fmt::vformat` internally for message formatting. The first argument is the format string,
which must be a string literal (turned into `std::string_view` in the macros)
- - Logging channels can be overridden on a scope-by-scope basis (per-class or even per-function) by implementing
+ - Logging channels can be overridden on a scope-by-scope basis (per-class or even per-function) by implementing
a `LoggerRef Log()` function
+- Avoid repetition. If the same pattern (e.g. data structure lookups, locking + find) appears multiple times,
+ factor it into a helper function and call that instead.
+- Avoid `auto` when the type is not explicitly visible on the right-hand side of the assignment. Spell out the type instead.
- `if`/`else` should use braces even for single-statement branches
**Includes:**