Context
A feature module can be written in three places: inside a service, in the private figentra-os repository’spackages/ (@figentra/*, 0126 decision 7 and FO5/FO7), or in this
repository’s public @stackra/* packages. Without a rule, logic that two products need ends up copied, or a Figentra business
rule leaks into a public package. The owner decided the placement on 2026-10-21, after reviewing the trade-offs.
Decision
- Three homes.
- A.
@stackra/*(public,packages/<category>/<name>). Mechanisms and generic capability kits with no Figentra business rules. A package in this home ships configurable modules (forRootanddefineConfig). - B. figentra-os
packages/(@figentra/*, private). OS domain modules and logic used by two or more OS services or OS apps. - C. Default:
services/<svc>/src/modules/<feature>/. Kind folders as in 0130.
- A.
- Placement test. Start a feature in its service (C). Move it to B when a second OS consumer (another service or an OS app) needs it. Move it to A only when it holds zero Figentra business rules and a second product, not Figentra, would use it.
- Moving is moving a folder. A module moves by moving its folder and its package entry. Its key, its permissions and its contracts do not change, so consumers keep working.
- A service root module is wiring only (0111). It holds no business logic. The provider wiring is written by gen, not by hand (0263).
- A module from home A or B contributes exactly as one from home C (0111 decision 4). Its folders follow the kind folders of 0130.
- Shared logic is never copied between services. Logic shared by services goes to home B; a service never imports another service’s module (0260).
Consequences
- A feature starts cheap, in the one service that needs it, and moves only when a second consumer appears.
- Home A carries a higher bar: a package with one Figentra rule in it is not public.
- Home B needs a private package flow in figentra-os and its own validator run; the placement test does not remove that cost.
- A reviewer can reject a module placed in the wrong home by applying the test, without a tool.
Enforcement
planned —pnpm validate rejects a @stackra/* package that imports an @figentra/* package, and the figentra-os validator
(scaffolded from the same generator, 0126) rejects a service importing another
service’s source. The placement test itself is a review check. Nothing checks it mechanically yet.