Grilling
Entities Layer Model Brainstorm Brief
Entities Layer Model Brainstorm Brief
Context
- Source: user
/brainstormsession, 2026-10-30, T3 thread ondevpunks-intelligencePR #79, after CTO review feedback on that PR. - CTO feedback: review of
wearedevpunks/devpunks-intelligence#79,
meeting transcript
https://notes.granola.ai/t/fb4de828-5c61-4a6c-bda1-1a5cf6850d19. The user accepted the feedback: "yes thats right. feedback is right". - The closed Frontend Composition Layer
grill (PR #272) defined the current model
app → composition → features → modules → integrations. This topic supersedes parts of it.
Bounded System And Operators
The system is the frontend layer model and its enforcement across four repositories:
| Repository | Owned part |
|---|---|
wearedevpunks/skills | frontend-domain-structure skill text (skills/agnostic/frontend/frontend-domain-structure/) |
wearedevpunks/harness-intelligence | frontend-layers Oxlint plugin (apps/cli/src/data/lint/frontend-layers/), its skill-parity test, the react-frontend-layers lint asset, the npm-synced ci-solution-structure copy |
collective-intelligence-platform/ci-app | ci-solution-structure skill and @collective-intelligence/lint (packages/public/lint/) |
wearedevpunks/devpunks-intelligence | Recruiter Portal restructure (PR #79) and a shared Oxlint config package for every workspace |
Operators: developers and agents that place frontend code, reviewers (human and agent) that check placement, and the CTO and team that accept the folder structure. Team process for the portal structure: Manuel posts the proposed structure in chat, Simone validates it, Stefan commits it.
Problem
Evidence from devpunks-intelligence@5971a9ab
(app/frontend/recruiter-portal/src/):
composition/providers/mixes global setup with business providers:portal-root.tsxSharedCandidatespatcheshiring_statuswhenhrStatus === "HR OK";active-search-providers.tsxandcv-workspace-providers.tsxeach serve one route group.InterviewAssignmentProvidershas no consumer.composition/portal/pages/active-search/layout.tsxandpages/cv-workspace/layout.tsxare layouts inside page folders.- 13
route.tsxfiles import./index; about 25index.ts(x)files hold implementation; the largest arefeatures/challenges/views/*/index.tsx(390, 319, 155 non-export lines). modules/mixes agnostic code (form,navigation-guard,react-instance,session,theme) with domain code (candidates,developer-options,interview-assignments).integrations/mixes third-party adapters (ci-runtime, the pdf-lib and html-to-image export incandidate-cv) with domain data sources, server bridges (candidate-access,interview-api,portal-server) and simulated runtimes.- Folder names repeat a prefix:
integrations/candidate-{access,challenges,cv,data,database,intake},features/candidate-{access,cv,database,intake}. candidate-accessis not about candidates: it is portal access for all roles (candidate, hr, manager, tech;server/features/candidate-access/model/policy.ts).composition/portal/architecture.test.tschecks server and protocol isolation, browser storage, Backoffice isolation and route gating. It does not check the layer layout;tools/oxlint/frontend-layers/index.mjsdoes.- The installed skill texts call Modules a shared domain capability
(
frontend-domain-structurereferences/structure.md;ci-solution-structuretiers:modules= "a domain capability that several features need",foundation= generic machinery). - The
ci-solution/package-entrypointrule reports 2 findings in the portal'soxlint.local.ts: relative imports of../../../.oxlintrc.jsonand../.oxlintrc.json. Other workspaces reach the same files through JSONextendsand--config ../.oxlintrc.jsonscripts, which the rule does not see. Oxlint 1.87.oxlintrc.jsonextendsaccepts only relative file paths; a package name fails withNotFound(tested 2026-10-30).
Accepted Shape
Layers
- Layer order:
app → composition → features → entities → modules → integrations. Each layer imports only lower layers.server/stays outside the layers. - Every layer is split by domain. Each domain's
indexexports its common primitives (providers, hooks, components, ports). Higher layers combine lower ones through dependency injection and composition. composition/contains:providers/: global root providers only (CI runtime and QueryClient, mock-session retention, Toaster).proxy/.routing/(wasportal/):index.ts,access/,shells/<name>/,pages/<page>/.
- A layout file exists only in
routing/shells/<name>/, one layout per folder, with only the files it governs. A shell combines feature providers with the data sources that composition selects. - A page folder holds
index.ts(re-export only),route.tsxand the page template at its root. Other components and hooks go incomponents/andhooks/only when needed. One folder per route: the six flat files inpages/challenges/split.pages/keeps its name. features/<capability>/combines several entities into one user-facing capability. A feature owns its workflow, policy, state and providers. It takes its dependencies as inputs.entities/<entity>/is repository-like, one folder per business entity: contract, port, CRUD and query machinery, entity providers, data sources inapi/andsimulated/subpaths, and entity-bound UI inviews/(pickers, badges, formatters).modules/is business-agnostic: it carries no product terms.integrations/holds third-party adapters only (CI SDK runtime, pdf-lib, html-to-image, LogRocket-style).
Rules
- A feature never imports another feature. An entity never imports another entity. Logic that spans two entities lives in a feature.
- Code that is not a clear single-entity concern is a feature. Code that combines several entities is a feature.
- Only
composition/and tests import*/api/and*/simulated/data sources. Features and entity views use the entity root. - Only
entities/*/api/,features/*/api/andapp/api/importserver/. - A cross-domain import targets a domain index or a subpath index
(
@/entities/candidate/cv). Subpaths of one domain import each other freely. - An
indexfile only re-exports. Production code never imports its own folder's./index; tests may. - No repeated name prefix: one domain folder with subpaths
(
entities/candidate/cv, notcandidate-cv). - Folders named
simulated/replacemock*folders.
Recruiter Portal mapping
entities/candidate/(withcv/,intake/,options/fromdeveloper-options,views/),entities/challenge/(templates, authoring, review),entities/interview/(assignment read contract, projection, booking).features/candidate/withcv/,database/,intake/;features/access/(role policy, flow catalog, access screens, sidebar,api/for session and gate);active-searchandinterview-summariesstay features.- The
SharedCandidatessync moves into a feature; the portal shell wires it. Feature-scoped providers move into their features.InterviewAssignmentProvidersis deleted. integrations/portal-serversplits:readSession,requestPathandcheckAccesstofeatures/access/api;readInterviewSnapshotandreadInterviewScopetoentities/interview/api;getRuntimetointegrations/ci.
Enforcement and skills
- The
frontend-domain-structureskill text and thefrontend-layersplugin carry the new model and rules. Until the Registry ships them, the portal's local plugin copy enforces them. - The
ci-solution-structurepackage tiers follow the same names:packages/entities/<name>for entity repositories,packages/modules/<name>for agnostic code;foundationis retired. - A shared Oxlint config package in
devpunks-intelligenceholds the root and frontend policies. Every workspace moves to anoxlint.config.tsthat imports it by package name. This clears the 2ci-solution/package-entrypointfindings. - The decisions supersede
devpunks-intelligenceARC-003 and ARC-004 (apps/wiki/content/docs/project/specs/hr/recruiter-portal-architecture-quality/ARCHITECTURE.md).
Rejected Shapes
- Low-level layer named
bridge: implies middleware or adapter semantics (CTO feedback). - Atomic design names (atoms, molecules): UI-specific (CTO feedback).
modules/as the domain layer with a newfoundation/for agnostic code: user stated modules are agnostic.- Layer name
kernel/: replaced byentities/once the layer became per-entity and repository-like. repositories/,models/,data/:repositoriesexcludes the providers and views;modelsclashes with featuremodel/subfolders;datais too generic.- All adapters, real or simulated, in
integrations/; laterintegrations/simulated/<entity>: replaced byapi/andsimulated/subpaths inside each entity. integrations/api/for the app's own API: the user movedapi/out of integrations.- Entities that import other entities, or only their types.
- Cross-entity sync logic placed in an entity (
entities/interviewpatching candidates). - A shared
commondomain per layer: needs a peer-import exception. features/candidate/access: access is portal access, not a candidate concern.- Mandatory empty
components/andhooks/in every page folder. - Renaming
pages/topage-templates/: not selected. - Tests banned from importing
./index: tests exercise the public entry. - Enforcement in
architecture.test.tsonly, or no enforcement until the upstream release. - Package tiers that keep
modules/foundationwith a documented mapping: the same word would mean opposite things one level apart. - Inlining the shared lint policies, or exporting
.oxlintrc.jsonfrom the rootdp-aipackage.
User-Stated Preferences
- "modules is meant to be business-agnostic tho."
- "yes thats right. feedback is right"
- "what we meant is providers inside composition should be global root providers. not providers from certain features etc..."
- "this new lower level folder layer could. below features/ but business aware"
- "overall the idea is that we should persist domain based split. features can have providers."
- "we must abstract by dependency and composition, so that each layer can have its common primitives exported"
- "fix it" (on: other workspaces reach the shared lint policy through relative paths the rule does not check)
- "keep in mind that we picture kernel/ to be kinda like repository/ in backend code."
- "fatures/ was too broad since it could technically include wiring machinery for entities crud etc... whereas composition/ was too higher level"
- "features can combine kernels into proper single features. eg: hr feature includes developers an salaries entity domains"
- "repetition of prefix-* is bad. no [...] candidate-challenges/ candidate-cv/ just one [...] candidate/ with subpaths"
- "candidate entity" (on:
developer-options) - "i guess theyre features if theyre not a clear kernel for one entity. if they combine multiple entities theyre a feature"
- "we use integrations for 3rd party data. also api data for the actual app. simulated seems fitting in there"
- "mhh actually in this case i guess /api is out of integrations. kernel handles api/ and simulated/"
- "if not business entity why not in /features?"
- "only thing, lets rename kernel" →
entities/ - "ok this is agreed. well done we reached a good state."
- "no actually this is a new grill that touches ci-app harness-intelligence and this repo here"
- "yeah grill should probably live in harness-intelligence"
Open Forks
- Feature-owned data sources (
features/access/api): dofeatures/*/apiandfeatures/*/simulatedfollow the same names and import rule as entities? Proposed default: yes. modules/agnostic check: product terms cannot be detected by import rank. Proposed default: rank rules in lint; the agnostic test stays a review rule in the skill.- Lint tooling package name and location. Proposed default:
packages/oxlint-config,@devpunks/oxlint-config, subpath exports./repositoryand./frontend. - Existing CI solutions with
tier:modulesandtier:foundationtags. Proposed default: the tier rename ships with a migration note in theci-solution-structureenforcement reference and a minor version of@collective-intelligence/lint. - Lint rule set for the new rules (entity rank, peer-entity ban, data
source import rule, index re-export only, no non-test
./indeximport, layout placement,simulated/naming). Proposed default: all of them infrontend-layers, with the skill-parity test updated. - Canonical glossary for Entity, Feature, Module, Integration, Data Source, Shell and Page Template. Proposed default: pin them in this grill.
- File-by-file moves for
active-search,interview-summariesandchallenges. Proposed default: decided at L3 in this grill from code evidence.
Evidence Anchors
devpunks-intelligence@5971a9ab:app/frontend/recruiter-portal/src/composition/providers/portal-root.tsx(SharedCandidates),composition/providers/index.tsx,composition/portal/index.ts,composition/portal/architecture.test.ts,composition/portal/pages/*/route.tsx,app/frontend/recruiter-portal/tools/oxlint/frontend-layers/index.mjs,app/frontend/recruiter-portal/oxlint.local.ts,server/features/candidate-access/model/policy.ts,integrations/portal-server/index.ts.devpunks-intelligenceaccepted architecture:apps/wiki/content/docs/project/specs/hr/recruiter-portal-architecture-quality/ARCHITECTURE.mdARC-003, ARC-004 (grill Q10, Q15).wearedevpunks/skills@1730646:skills/agnostic/frontend/frontend-domain-structure/{SKILL.md,references/structure.md,references/react/structure.md}.harness-intelligence@886966be7:apps/cli/src/data/lint/frontend-layers/{index.mjs,frontend-layers.test.ts,skill-parity.test.ts},apps/cli/skills/npm/collective-intelligence-lint/ci-solution-structure/.ci-app@5b906d6ed5:packages/public/lint/{src/index.ts,src/rule.ts,skills/ci-solution-structure/SKILL.md}.- Oxlint 1.87.0
configuration_schema.jsonproperties.extends: JSONextendsentries are paths relative to the config file.