Mercurial
comparison .claude/skills/zenbu-bazel-c/SKILL.md @ 255:5ec271d612ae
[dowa] Enforce arena ownership
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Tue, 04 Aug 2026 15:12:18 -0700 |
| parents | 117c4d53c9a4 |
| children | 04fee26ecce0 |
comparison
equal
deleted
inserted
replaced
| 254:2b6e732087ff | 255:5ec271d612ae |
|---|---|
| 23 - `gui_ze`: Bazel macros for bundling/copying web assets. | 23 - `gui_ze`: Bazel macros for bundling/copying web assets. |
| 24 - `design_system`: light-DOM Web Components, shared CSS tokens, and a Seobeo | 24 - `design_system`: light-DOM Web Components, shared CSS tokens, and a Seobeo |
| 25 component catalog. | 25 component catalog. |
| 26 | 26 |
| 27 Avoid broad searches in `third_party/`, Bazel output directories, virtualenvs, `node_modules`, and generated bundles unless the task specifically requires them. | 27 Avoid broad searches in `third_party/`, Bazel output directories, virtualenvs, `node_modules`, and generated bundles unless the task specifically requires them. |
| 28 | |
| 29 For cross-codebase audits, inspect `BUILD` files and Bazel dependencies first. | |
| 30 Use the dependency graph to identify actual first-party consumers before broad | |
| 31 text search, then audit only those targets and their transitive owners. | |
| 28 | 32 |
| 29 ## Build and test commands | 33 ## Build and test commands |
| 30 | 34 |
| 31 Use Bazel targets from the repository root: | 35 Use Bazel targets from the repository root: |
| 32 | 36 |
| 56 - Prefer Dowa's integer and boolean aliases (`uint8`, `uint16`, `uint32`, | 60 - Prefer Dowa's integer and boolean aliases (`uint8`, `uint16`, `uint32`, |
| 57 `uint64`, `int8`, `int16`, `int32`, `int64`, and `boolean`) plus | 61 `uint64`, `int8`, `int16`, `int32`, `int64`, and `boolean`) plus |
| 58 `TRUE`/`FALSE` in first-party C. Do not introduce `<stdint.h>` `_t` aliases | 62 `TRUE`/`FALSE` in first-party C. Do not introduce `<stdint.h>` `_t` aliases |
| 59 or `<stdbool.h>` `bool` when a Dowa type already expresses the value. | 63 or `<stdbool.h>` `bool` when a Dowa type already expresses the value. |
| 60 - C code generally uses `Dowa_Arena` for request-scoped allocations. | 64 - C code generally uses `Dowa_Arena` for request-scoped allocations. |
| 65 - An arena owns every pointer returned by `Dowa_Arena_Allocate`, aligned arena | |
| 66 allocation, arena string helpers, and arena array/hash-map macros. Never pass | |
| 67 those pointers to libc `free()`, `Dowa_Free`, or an element-level destroy | |
| 68 function. | |
| 69 - Release a locally created arena exactly once with `Dowa_Arena_Free()` on | |
| 70 every return path. Do not release a borrowed request arena; its owner must | |
| 71 free it. | |
| 72 - Prefer `Dowa_Free` over raw libc `free()` for separately heap-allocated | |
| 73 first-party pointers. Keep the allocation source explicit when heap and arena | |
| 74 ownership coexist in one function. | |
| 61 - HTTP responses are usually `Seobeo_Request_Entry *resp = NULL` maps filled with `Dowa_HashMap_Push_Arena`. | 75 - HTTP responses are usually `Seobeo_Request_Entry *resp = NULL` maps filled with `Dowa_HashMap_Push_Arena`. |
| 62 - Route handlers return response maps; streaming handlers receive `Seobeo_Handle *` directly. | 76 - Route handlers return response maps; streaming handlers receive `Seobeo_Handle *` directly. |
| 63 - Existing code favors explicit status/content-type/body response fields. | 77 - Existing code favors explicit status/content-type/body response fields. |
| 64 - Use `Seobeo_Log` for seobeo-aware logging instead of introducing another logger. | 78 - Use `Seobeo_Log` for seobeo-aware logging instead of introducing another logger. |
| 65 - Keep Bazel dependencies precise. Add deps to the smallest target that needs them. | 79 - Keep Bazel dependencies precise. Add deps to the smallest target that needs them. |