Read AGENTS.md — it has the registry-discipline rules and the full list of anti-patterns we refuse to write. Short version:
- Registry entry before surface code. New module?
MODULE_REGISTRYfirst. New page?PAGE_DEFINITIONSfirst. - No per-module booleans in surface state. One generic
is_module_enabled(name)query. - No hardcoded page ID match arms in visibility logic. Derive from
required_moduleinPageDefinition. - No inline colors. Theme layer only.
- Cross-platform logic belongs in core. If you're writing the same thing in
app.rsandContentView.swift, it's core logic. - After FFI changes: run
build-ios-framework.shand commitGenerated/+xcframework.
If something's missing: open a PR, draft a module, or file an issue with a concrete repro.
- Add constant +
ModuleManifesttoMODULE_REGISTRYinShared/ArcadiaCore/src/config/modules.rs. - Create
Shared/ArcadiaCore/src/modules/x.rswith acommands()fn returning&[ModuleCommand]. - Register in
Shared/ArcadiaCore/src/modules/mod.rs. - Done. GUI, CLI, and iOS module list updates automatically — no surface edits required.
- Add
NavigationPageDefinitiontoPAGE_DEFINITIONSinnavigation.rs. Setrequired_moduleif visibility depends on a module. - Add the page ID to the relevant
GROUP_DEFINITIONS.pagesslice, or create a new group. - Implement the page panel: Desktop →
gui/app/new panel file; iOS → new view file. - Route it in the surface content switch via the page ID — derive visibility from
required_module, not a hardcoded match.
- Add SVG to
Desktop/assets/icons/. - Add match arm to
icon_path()inDesktop/src/gui/theme/mod.rs. - Use the key in
NavigationPageDefinition.glyphorNavigationGroupDefinition.glyph.
- Desktop: add named constant or helper fn to
Desktop/src/gui/theme/mod.rsor the relevant component token file undertheme/modules/. - iOS: add computed property to
AppThemeinAppTheme.swift. - Never inline
rgb(0x...)orColor(hex:)in view files.
Extend SurfaceSnapshot.extra and add a SurfacePatch variant in modules/surface.rs. Wire both surfaces to consume the new extra field from snapshot. Do not create ad-hoc remote-session.* verbs — keep the protocol under surface.*.
Edit MODULE_REGISTRY name and constant. Add a migration to ModulesConfig::merge_defaults() following the LEGACY_LAN_MODULE_NAME pattern. Do not rename at call sites.
Current test coverage is sparse. Priority areas for expansion:
# Run existing tests
cd Shared && cargo test -p arcadia-core
# What to add:
# - surface.snapshot / parse_surface_snapshot round-trips
# - NavigationRegistryOwned JSON serialization/deserialization
# - ModulesConfig migration (merge_defaults with legacy keys)
# - thin-client preference persistence (set → get → re-load)
# - LAN routing integration (execute_command with net_as)
# - Module enable/disable with dependency enforcementiOS ArcadiaCore.xcframework rebuild after FFI changes is currently manual. Adding a CI step that fails when Generated/ drifts from ffi.rs is a high-priority gap — see roadmap.md.