Entities Layer Model
Spec: Entities Layer Model
Context
The frontend-domain-structure skill defines Modules as shared domain code
and Integrations as the owner of mock runtimes. The CTO review of
devpunks-intelligence PR #79 showed the result: business providers in
Composition, layouts inside page folders, route.tsx importing its own
index, domain code in modules/, and domain data sources in
integrations/. The user accepted that feedback
(Q16).
This spec adds a repository-like Entity layer below Feature, makes
Module business-agnostic, restricts Integration to third-party
adapters, defines Composition as global providers, proxy and routing, and
enforces it in the frontend-layers plugin. The ci-solution-structure
package tiers take the same words. One Registry Baseline ships the change.
devpunks-intelligence, emera-platform and apito adopt it, one open pull
request each. Canonical terms: glossary.
Non-Goals
- A
warntransition for the new rules (Q41). - A local plugin-copy stopgap in any consumer (Q42).
- Restating the app layer model in
ci-solution-structure(Q43). - Stricter lint presets in
devpunks-intelligenceworkspaces (Q48). - A lint check for product terms in Modules (Q24).
- Renaming
pages/(Q5). - Adopting the Baseline in ci-emera, ci-assolombarda or pegasus.
Requirements and Outcomes
OUT-001: The skill teaches the entities layer model
frontend-domain-structure states the order app | routes → composition → features → entities → modules → integrations → ui, the Composition shape,
the Feature, Entity, Module, Integration and Data Source meanings, the import
rules and a migration map. Every text that restates the model agrees.
Architecture: OUT-001, ARC-001, ARC-004.
OUT-002: Lint enforces the model
The frontend-layers plugin implements exactly the skill's rule table, ships
in the react-frontend-layers asset as error, and consumers' formatters
leave the copied plugins unchanged.
Architecture: OUT-002, ARC-002, ARC-003.
OUT-003: Package tiers use the same words
ci-solution-structure names packages/entities and agnostic
packages/modules, retires foundation, carries a migration note, and ships
in @collective-intelligence/lint 0.2.0, which HI pins.
Architecture: OUT-003, ARC-005.
OUT-004: One Registry Baseline carries the change
A published Registry Baseline contains the synced skill texts, the plugin,
the asset, the oxfmt merge and the 0.2.0 package skill, with a
BASELINE_CHANGELOG.md entry that links the migration map.
Architecture: OUT-004, ARC-006, FLOW-001.
OUT-005: devpunks-intelligence adopts the Baseline in PR #79
PR #79 carries the new Baseline, the shared @devpunks/oxlint-config package
for every workspace, and the Recruiter Portal restructure.
Architecture: OUT-005, ARC-007, ARC-008, FLOW-003.
OUT-006: emera-platform and apito adopt the Baseline
Each repository has one open pull request that installs the new Baseline and migrates its frontend layout (and, for emera-platform, its package tiers).
Architecture: OUT-006, ARC-009, ARC-010.
Acceptance Criteria
- AC-001:
structure.mdlists the layersapp/routes,composition,features,entities,modules,integrations,uiin that rank, and defines Composition asproviders/,proxy/,routing/withrouting/{index.ts,access/,shells/<name>/,pages/<page>/}.- Covers: OUT-001
- Architecture: AC-001
- AC-002: The skill defines Entity (contract, port, CRUD/query, providers,
remote/{index,server}.ts,simulated/,views/), Feature (combines Entities, owns providers), Module (no product terms, as a review rule) and Integration (third-party only), and states that only Composition and tests importremote/andsimulated/.- Covers: OUT-001
- Architecture: AC-002
- AC-003:
references/migration.mdmapsmodules/<domain>→entities/<entity>,composition/<surface>/{shell,pages}→composition/routing/{shells,pages}, mock folders →*/simulated, andSKILL.mdpoints to it when such folders exist.- Covers: OUT-001
- Architecture: AC-003
- AC-004:
create-plan/references/architecture-convergence.md,implement-spec/references/architecture-conformance.md,hi-cli/references/managed-lint.md,ask-hi/references/discovery-and-docs.md, the HI wiki pagesskill-packs.mdx,skill-reference.mdx,hooks.mdxand the catalog description inapps/cli/src/data/catalog/lint.tsstate the new order and terms.- Covers: OUT-001
- Architecture: AC-004
- AC-005:
skill-parity.test.tspasses with the 14 rule idslayer-order,route-imports,no-peer-feature,no-peer-entity,public-entrypoint,data-source-imports,index-reexports-only,no-self-index-import,layout-placement,composition-shape,no-prefix-siblings,no-prototype-folder,known-top-level,ui-placement.- Covers: OUT-002
- Architecture: AC-005
- AC-006: For each rule,
frontend-layers.test.tshas a fixture that reports the violation and a clean fixture that passes, including:server/imported fromentities/*/remote/passes and fromfeatures/<f>/componentsfails; a client import ofremote/server.tspassespublic-entrypoint; a*.test.tsfile is exempt fromdata-source-importsandno-self-index-importonly.- Covers: OUT-002
- Architecture: AC-006
- AC-007:
hi updatein a repository with.oxfmtrc.jsonadds**/tools/oxlint/**to itsignorePatternsonce; in a repository without it, the report names the pattern and no formatter file is created.- Covers: OUT-002
- Architecture: AC-007
- AC-008: The
react-frontend-layersasset sets every rule in AC-005 to"error".- Covers: OUT-002
- Architecture: AC-008
- AC-009:
ci-solution-structurenames tiersorganization,features,entities,modules,toolingwith tagstier:entitiesandtier:modules, states the Modules no-product-terms invariant, and has a migration note fortier:foundationand the oldtier:modules; README andCHANGELOG.mdagree;test:packpasses.- Covers: OUT-003
- Architecture: AC-009
- AC-010: npm
@collective-intelligence/lint@0.2.0is published and HIcollectiveIntelligenceLintVersionequals"0.2.0"with the synced skill byte-equal to the package.- Covers: OUT-003
- Architecture: AC-010
- AC-011: The Registry root
registry.jsonnames a newlatestBaseline whose readback matches the build, andBASELINE_CHANGELOG.mdfor it names the sync tag, lint 0.2.0 and the migration map link.- Covers: OUT-004
- Architecture: AC-011
- AC-012: In PR #79,
hi check --jsonreportscurrentat the new Baseline and managed lint, type-check, tests and build of the Recruiter Portal pass.- Covers: OUT-005
- Architecture: AC-012
- AC-013: In PR #79, every workspace lint script uses its
oxlint.config.ts, each imports@devpunks/oxlint-config/<subpath>by package name,pnpm-workspace.yamlhas a catalog withoxlintand@oxlint/pluginsat 1.90.0, the effective rules per workspace equal the pre-change JSON chain, and noci-solution/package-entrypointfinding remains.- Covers: OUT-005
- Architecture: AC-013
- AC-014: In PR #79, the Recruiter Portal tree matches the mapping in the architecture (entities
candidate,challenge,interview,vocabulary; featuresaccess,candidate/{cv,database,intake},interview/{assignment,summaries},challenge,vocabulary,dashboard,active-search;composition/{providers,proxy,routing};modules/async;integrations/{ci,document}), and the recruiter-portal-architecture-quality ARCHITECTURE.md marks ARC-003 and ARC-004 superseded by this spec.- Covers: OUT-005
- Architecture: AC-014
- AC-015: emera-platform has one open PR where
hi check --jsonreportscurrent,packages/foundation/*becamepackages/modules/*,packages/modules/*becamepackages/entities/*, tier tags,turbo.jsonboundaries andtools/boundaries/boundaries.test.tsuse the new names, and its lint, type-check and tests pass or each remaining failure is reported in the PR.- Covers: OUT-006
- Architecture: AC-015
- AC-016: apito has one open PR where
hi check --jsonreportscurrentand its frontend layout passes the newfrontend-layersrules, or each remaining finding is listed in the PR.- Covers: OUT-006
- Architecture: AC-016
Spec Invariants
| INV | Rule | Source (Q anchor) | Form | Pattern | Seam | Model |
|---|---|---|---|---|---|---|
| INV-001 | Each layer imports only lower layers. | Q1, Q19 | example | none | frontend-layers layer-order on fixture trees | none |
| INV-002 | No Feature imports a Feature; no Entity imports an Entity. | Q9 | example | none | no-peer-feature, no-peer-entity | none |
| INV-003 | Only Composition and tests import a Data Source. | Q10, Q23 | example | none | data-source-imports | none |
| INV-004 | A remote/ Data Source exposes browser code through index.ts and server code through server.ts. | Q50 | example | none | public-entrypoint; build of a client importing server.ts | none |
| INV-005 | An index file only re-exports. | Q11 | example | none | index-reexports-only | none |
Constraints
- Rule text and rule ids change together;
skill-parity.test.tsis the gate (Q26). - Consumers start only after the Registry publishes the Baseline (Q46, Q52).
- Upstream pull requests merge as soon as their checks pass; each consumer gets exactly one open pull request for review (Q51, Q52).
- The Recruiter Portal keeps its behavior; the restructure moves code and changes no user flow (Q46).
Dependency Readiness
Ready.
wearedevpunks/skillsbaseorigin/main@173064678783ce7d7593d749590e29448cf4fe7f.collective-intelligence-platform/ci-appbaseorigin/main@5bad70fcc605a305f68b3954ced10cb5a6498e0b; release.github/workflows/release-npm-packages.yml(workflow_dispatch, bumpminor).wearedevpunks/harness-intelligencebaseorigin/main@886966be7with this spec onteam/stefan/entities-layer-model; Baseline release by.github/workflows/release.ymlonmainwhenBASELINE_CHANGELOG.mdchanges.- Consumers depend on the published Baseline (OUT-004).
Branch/Base Intent
| Touched Repository | Branch | Base | Constraint | Evidence |
|---|---|---|---|---|
wearedevpunks/skills | team/stefan/entities-layer-model | main | Merge when green; then tag sync/entities-layer-model-<sha12> on the merge commit | Q52 |
collective-intelligence-platform/ci-app | team/stefan/entities-layer-model | main | Merge when green; then release 0.2.0 | Q29, Q52 |
wearedevpunks/harness-intelligence | team/stefan/entities-layer-model (this branch) | main | Merge when green after skills tag and lint 0.2.0; merge publishes the Baseline | Q52, S9 |
wearedevpunks/devpunks-intelligence | codex/active-search-recruiter-portal-followup (PR #79) | develop | Leave open for review | Q46, Q51 |
collective-intelligence-solutions/emera-platform | team/stefan/entities-layer-model | main | Leave open for review | Q51, Q52 |
Collective-Intelligence-Solutions/apito | team/stefan/entities-layer-model | main | Leave open for review | Q51, Q52 |
Architecture Source
- Immutable blob URL: https://github.com/wearedevpunks/harness-intelligence/blob/f5cd2185cd3eac78d749c85901a17add1b996b66/apps/wiki/content/docs/project/specs/cli/entities-layer-model/ARCHITECTURE.md
- Commit: f5cd2185cd3eac78d749c85901a17add1b996b66
- Path:
apps/wiki/content/docs/project/specs/cli/entities-layer-model/ARCHITECTURE.md - Content sha256: 5140f3256ea27e6e0728340c361879bf778e30ab96a02d13d15e1cc036e414db
Accepted Technical Decisions
- Rule set, ranks and test predicate: architecture "Modules and Interfaces" rule table (Q26, Q27, Q50).
- Data Source subpaths
remote/(index.tsbrowser-safe,server.tswithimport "server-only") andsimulated/(Q44, Q50). - Only
entities/*/remote/,features/*/remote/andapp/api/importserver/(Q10, Q26). - oxfmt: managed JSON merge of
**/tools/oxlint/**into an existing.oxfmtrc.jsononly (Q28, Q49). - ci-app: one PR updates the skill, README,
CHANGELOG.md,references/enforcement.md;minorrelease to 0.2.0 (Q29). @devpunks/oxlint-config(packages/oxlint-config, tooling tier): subpaths./repository,./backend,./frontend,./packages,./infra; peeroxlint; catalogoxlintand@oxlint/plugins1.90.0; dormant ultracite/anti-slopoxlint.config.tscontent deleted;app/backend/extensionskeeps./tools/oxlint/imports.mjs(Q25, Q40, Q48).- Recruiter Portal mapping: architecture ARC-008 table (Q14–Q16, Q31–Q39).
Accepted Testing Decisions
- Plugin rules: real oxlint on fixture trees in
frontend-layers.test.ts, one report case and one accept case per rule; parity byskill-parity.test.ts. - oxfmt merge: installer test against a temporary repository with and without
.oxfmtrc.json. - Consumers: managed lint, type-check, tests and build of each touched workspace; the Recruiter Portal's existing behavior tests prove the restructure preserves behavior.
Verification Seams
frontend-layersplugin through the oxlint CLI.hi update/hi check --jsonagainst the local or published Registry.- Registry readback at
https://api.harness-intelligence.devpunks.com/r. - Consumer workspace scripts (
lint,type-check,test,build).