@@ -26,14 +26,15 @@ submodule. Read them before adding or reshaping public API:
2626| --- | --- |
2727| ` ../specs/architecture.md ` | Layering, the six-platform matrix, naming, build |
2828| ` ../specs/object-model.md ` | Identity objects vs value objects |
29+ | ` ../specs/api-style.md ` | Method vocabulary, parameter/return types, failure reporting, doc comments |
2930| ` ../specs/platform-seam.md ` | PIMPL, narrow seams, ` NativeObjectProvider ` |
3031| ` ../specs/event-system.md ` | ` Event ` / ` EventEmitter ` , threading, lazy listening |
3132| ` ../specs/managers.md ` | Singletons, registries, the handle table |
3233| ` ../specs/c-abi.md ` | What codegen produces and how types cross the boundary |
3334| ` ../specs/handle-ownership.md ` | C ABI handle ownership and invalidation |
3435
35- ` ../DESIGN_REVIEW.md ` tracks the * unresolved * inconsistencies; the specs describe what is
36- already settled .
36+ Each spec also records the open questions and known legacy gaps of its own area inline;
37+ there is no separate issue list .
3738
3839## Non-negotiables
3940
@@ -52,6 +53,37 @@ already settled.
5253 [ src/foundation/id_allocator.h] ( src/foundation/id_allocator.h ) — append only, never
5354 renumber.
5455
56+ ## Public API style
57+
58+ The full rules and the review checklist are in ` ../specs/api-style.md ` . Everything public in
59+ ` src/*.h ` is exported verbatim to C, Dart, Rust and C#, so the short version is:
60+
61+ - ** Properties** are ` SetX(v) ` + ` GetX() const ` , booleans ` SetX(bool is_x) ` + ` IsX() const ` ,
62+ declared as an adjacent pair. Getters are always ` const ` — codegen only turns ` const `
63+ no-arg ` Get ` /` Is ` /` Has ` methods into binding properties.
64+ - ** Actions** are bare imperative verbs with a fixed opposite (` Show ` /` Hide ` , ` Open ` /` Close ` ,
65+ ` Maximize ` /` Unmaximize ` , ` Enable ` /` Disable ` ) and an ` IsXxx() const ` state query.
66+ - ** No new overloads** — they surface as ` native_x_verb_with_<params> ` . Different meaning,
67+ different name (` RemoveItemById ` , ` RemoveItemAt ` ).
68+ - ** Types** : strings in as ` const std::string& ` , out by value; geometry and enums by value;
69+ identity objects only as ` std::shared_ptr<T> ` (` nullptr ` = none), never ` const T& ` / ` T* ` ;
70+ ` std::optional ` wraps strings only; floating point is ` double ` ; IDs use the ` XxxId ` alias.
71+ - ** Enums** : ` enum class ` , PascalCase values, no ` k ` prefix, sequential from 0, first value
72+ is the neutral default, append only.
73+ - ** Failure** : never throw across the public API. ` void ` when it cannot fail, ` bool ` when a
74+ platform may not support it (document what ` false ` means), ` nullptr ` for lookups and
75+ factories. Do not invent another error channel.
76+ - ** Platform differences live in the doc comment** , not the signature: every API exists on
77+ all six platforms, and one that behaves differently carries the six-line
78+ ` @note Platform availability: ` block (✅ / ⚠️ / ❌).
79+ - ** "Intercept before X" is a cancellable event on the object** , not another
80+ ` SetWillXxxHook ` ; internal entry points stay out of the ` public: ` section.
81+ - After editing a header, run ` ./codegen ` from the workspace root and make sure no
82+ ` skipped ` warning names the new API.
83+
84+ Where existing headers disagree, the spec says which side is the rule — do not copy the
85+ nearest neighbour.
86+
5587## Naming
5688
5789- C++ — classes and methods ` PascalCase ` , members ` snake_case_ ` , files ` snake_case.h ` ,
0 commit comments