Entities Layer Model Plan
Plan: Entities Layer Model
Context Pointers
| Artifact | Immutable identity | Use |
|---|---|---|
| SPEC | e092c1d87c68 SPEC.md | OUT-001…OUT-006, AC-001…AC-016, INV-001…INV-005 |
| ARCHITECTURE | f5cd2185cd3e ARCHITECTURE.md (sha256 5140f325…) | ARC-001…ARC-010, FLOW-001…FLOW-003, rule table, portal mapping, #spec-traceability |
| Grill | apps/wiki/content/docs/project/grilling/entities-layer-model-grill-{status,log}.md at d7afc81b3c07 (closed R8) | Q1–Q52 decisions; glossary |
Freshness: before each task, compare the pair blob URLs above with the branch head; a changed SPEC or ARCHITECTURE invalidates dependent task proof.
architecture_applicability: architecture-bearing: tasks change layer ownership, public entrypoints and cross-domain dependency rules across four repositories and migrate callers (ARC-001, ARC-008).- AFK: the user delegated every judgment ("IF ANY QUESTION OR DOUBT ARISES I
TRUST YOUR JUDGEMENT"); no
$grillinground or$wait-whatapproval is held.
Initial Situation and Problem
The installed model calls Modules shared domain code and Integrations the mock owner. PR #79 review showed the cost (SPEC Context). The fix spans skill text, lint code, package tiers, a Baseline release and three consumer migrations.
Solution Shape
FLOW-001 (ARCHITECTURE): skills text and ci-app tiers land first, HI syncs both
and implements the rules, one HI merge publishes the Baseline, then each
consumer runs hi update, migrates and opens one PR.
Resolved Decision Ledger
All Q1–Q52 accepted (ARCHITECTURE Source Disposition). Execution-only choices made in planning (AFK, recorded here):
- E1: Branch name
team/stefan/entities-layer-modelin every repository (SPEC Branch/Base Intent). - E2: Skills sync tag
sync/entities-layer-model-<sha12>on the skills merge commit, as insync-skills-repo.mjspin practice (S9). - E3: ci-app release by
workflow_dispatchofrelease-npm-packages.ymlwith bumpminorafter merge (Q29). - E4: HI Baseline publication is automatic on the
mainmerge that changesBASELINE_CHANGELOG.md(.github/workflows/release.yml; runbookci-verification-and-publication.md#registry-publication). - E5: Upstream PRs merge as soon as required checks pass (Q52); consumer PRs stay open (Q51).
Assumptions and Constraints
- One PR per Touched Repository;
devpunks-intelligencereuses PR #79. - Consumers use separate checkouts/worktrees; never the shared main checkouts
(
~/repos/collective-intelligenceholds others' worktrees;~/repos/skillslocalmainholds a foreign unpushed commit; HI main checkout is dirty). - Shared machine: heavy runs in
systemd-run --user --scopewith memory limits (/AGENTS.md).
Codebase Findings
- Skills: contract tests
tests/frontend-domain-structure.contract.test.mjs,tests/frontend-layer-consumers.contract.test.mjs; runnode --test tests/*.test.mjs. - HI plugin:
apps/cli/src/data/lint/frontend-layers/{index.mjs,frontend-layers.test.ts,skill-parity.test.ts}; assetapps/cli/src/data/catalog/lint.ts:237-270;locate/isEntrypointneed subpath awareness;folderRuledrops file names (Q26 code consequence). - HI pins:
apps/cli/scripts/sync-skills-repo.mjs:22-24,apps/cli/src/data/catalog/package-skills.ts:18. - ci-app lint:
packages/public/lintscriptstest(bun test src && test:pack),lint,format:check;tools/test-pack.ts:62requires reference filestiers,package-shape,composition,enforcement. - devpunks-intelligence lint routes: ARCHITECTURE FLOW-003; F4 report in grill status.
- emera-platform:
turbo.json:4-45boundaries,tools/boundaries/boundaries.test.ts:22-29,84-93.
Wiki Context
- Knowledge used:
- Entities Layer Model Glossary, selected as the canonical terms; fresh (this delivery).
- CI verification and publication, selected by "Registry publication"; claims E4 and readback; fresh, verified against
.github/workflows/release.yml. - Frontend Composition Layer spec, as prior art for the asset and parity tasks; fresh for current code, superseded for the model.
- Stale or contradictory claims: the Frontend Composition Layer glossary is superseded (marked in the page).
- Returned findings: knowledge no-op; the grill closure already synthesized the glossary.
Backlog Sync
- Result: partial, then blocked. Linear
linear-free-v1, RootHARNESS INTELLIGENCE(I-3), Product AreaCLI, Initiative IP-456 (reused). - Written and read back: milestone
V4.11 Entities Layer Model(42c956f9-375d-4b66-9772-9d33ab217593), Epic IP-559, Stories IP-560 (OUT-001, OUT-002) and IP-561 (OUT-003). - Blocked: Linear returned "You've exceeded the free issue limit for this workspace". Residual delta: Stories for OUT-004, OUT-005 and OUT-006, all 10 Tasks, and their blocker edges (validated by
validate-task-blocker-graph.mjs: ok). task_identity_mode: planning-only.backlog_sync_skip_reasonfor every task: "Linear free issue limit reached after IP-561; Tasks not projected." Resume: free capacity or a paid plan, then rerunwrite-backlogwith this residual delta.
Dependency Graph and Waves
Wave (wave_boundary) | Tasks | Gate |
|---|---|---|
| W1 | T1, T2, T4, T7 | Each task's own validation; T1, T2 merged |
| W2 | T3, T5 | Parity and pin readback |
| W3 | T6 | Baseline published and read back |
| W4 | T8, T9, T10 | One open PR each, checks reported |
Waves label the earliest frontier; a task starts when its own depends_on
gates pass.
Architecture Contract
Target Ownership Topology
wearedevpunks/skills frontend-domain-structure layer meaning + rule table (ARC-001)
harness-intelligence frontend-layers plugin rule code = table (ARC-002)
installer oxfmt merge ARC-003
Registry Baseline ARC-006
ci-app ci-solution-structure tier words (ARC-005)
consumers their own layout ARC-007, ARC-008, ARC-009Must not absorb: the plugin never defines a rule that the skill table lacks;
ci-solution-structure never restates the app layer model; consumers never
edit copied plugins.
Declared Dependency Graph
Allowed: skills → HI (sync tag); ci-app npm → HI (pin); HI → Registry →
consumers (hi update). Forbidden: consumer-local rule edits; HI build reading
an unmerged skills ref; app code importing simulated/ or remote/ outside
Composition and tests (INV-003).
Responsibility Acceptance Criteria
| criterion_id | Owner | Observable assertion | Evidence | due_architecture_wave |
|---|---|---|---|---|
| RAC-1 | skills | AC-001…AC-004 text present | skills contract tests | A1 |
| RAC-2 | HI plugin | AC-005, AC-006, AC-008 | frontend-layers.test.ts, skill-parity.test.ts | A2 |
| RAC-3 | HI installer | AC-007 | installer test | A2 |
| RAC-4 | ci-app + HI pin | AC-009, AC-010 | test:pack; npm view; pin readback | A2 |
| RAC-5 | Registry | AC-011 | Registry readback | A3 |
| RAC-6 | devpunks-intelligence | AC-012…AC-014 | hi check, portal gates, lint per workspace | A4 |
| RAC-7 | emera-platform, apito | AC-015, AC-016 | hi check, lint/type-check/tests | A4 |
Architecture Waves
A1 source texts (T1, T2) → A2 enforcement and pins (T3, T4, T5) → A3 release (T6) → A4 adoption (T7…T10). Each wave ends with a convergence checkpoint: rule table equals plugin ids; pins equal published sources; consumers pass the released rules.
Public Seam Contract
| Seam | Owner | Consumers |
|---|---|---|
structure.md ## Lint Rules table | skills | HI parity test, agents |
frontend-layers rule ids | HI | consumer oxlint.config.ts aliases |
@collective-intelligence/lint@0.2.0 skill | ci-app | HI sync:package-skills |
Registry latest | HI | hi update |
@devpunks/oxlint-config/{repository,backend,frontend,packages,infra} | devpunks-intelligence | its workspaces |
Migration Ledger
| Temporary seam | Introduced by | Allowed consumers | Removal | Expiry | Proof |
|---|---|---|---|---|---|
| none | — | — | — | — | Ledger empty at start and close |
Tasks
Common fields for every task: task_identity_mode: planning-only,
backlog_item_id: not_applicable, backlog_item_url: not_applicable,
relation_mode: unprojected, backlog_sync_skip_reason as in Backlog Sync,
status: pending, log: [], files edited/created: [],
shared_runtime_resources: none unless stated, runtime_cleanup = remove
task worktrees' build outputs and temp files.
T1 — skills: entities layer model text, migration map, restatements
- depends_on: []; wave_boundary: W1; architecture_wave: A1
- location:
wearedevpunks/skillsworktree offorigin/main, branchteam/stefan/entities-layer-model - owned_paths:
skills/agnostic/frontend/frontend-domain-structure/**,skills/agnostic/planning/create-plan/references/architecture-convergence.md,skills/agnostic/planning/implement-spec/references/architecture-conformance.md,skills/agnostic/cli/hi-cli/references/managed-lint.md,skills/agnostic/cli/ask-hi/references/discovery-and-docs.md,tests/frontend-domain-structure.contract.test.mjs,tests/frontend-layer-consumers.contract.test.mjs - read_dependencies: ARCHITECTURE Modules and Interfaces (layer tree, rule table), Q1–Q11, Q19, Q20, Q23, Q24, Q27, Q30, Q41, Q44, Q45, Q50
- description: rewrite
SKILL.md,references/structure.md(layers, Composition, Entity, Data Source, rules table with the 14 ids),references/react/structure.md; addreferences/migration.md(Q45 map) with aSKILL.mdpointer; update the four restatements (AC-004 skills part). - spec: OUT-001; AC-001…AC-004; INV-001…INV-005; ARC-001, ARC-004
- tdd_status: required; tdd_target: contract tests assert new layer list, Composition shape, Data Source rules, migration.md map, consumer restatements; RED:
node --test tests/frontend-domain-structure.contract.test.mjs tests/frontend-layer-consumers.contract.test.mjsfails on new assertions; GREEN: same passes; test_form: example; invariant_refs: INV-001…INV-005; sensitivity_evidence: each new assertion fails on the pre-change text - validation:
node --test tests/*.test.mjs - review_mode: cli; runtime_validation: not applicable (text)
- merge: PR to
main, merge when green (E5); then tagsync/entities-layer-model-<sha12>(E2) - assigned_skills: frontend-domain-structure, writing-for-agents, tdd; implementation_skill_guidance: writing-for-agents — leading words, single source of truth, prune restatements; frontend-domain-structure — the new text is the authority, keep rule table ids exact
- codebase_design_notes: rule table is the parity seam; keep ids stable
- behavior_owner: skills; integration_surface: sync tag; public_seam: rule table; topology_delta: Modules agnostic, Entities added; forbidden_ownership: none; temporary_seams: none; responsibility_acceptance_criteria: RAC-1
T2 — ci-app: tier rename, migration note, release 0.2.0
- depends_on: []; wave_boundary: W1; architecture_wave: A1
- location: new worktree of
collective-intelligence-platform/ci-appofforigin/main, branchteam/stefan/entities-layer-model - owned_paths:
packages/public/lint/skills/ci-solution-structure/**,packages/public/lint/README.md,packages/public/lint/CHANGELOG.md - read_dependencies: Q13, Q21, Q29, Q43; ARCHITECTURE package tiers tree
- description: rename tiers (
entities, agnosticmodules, retirefoundation), tags and boundary examples; Modules no-product-terms invariant; "shared UI package" wording; migration note inreferences/enforcement.md; README and CHANGELOG## Unreleasedentry. Keep reference file names (test-pack.ts:62). - spec: OUT-003; AC-009, AC-010; ARC-005
- tdd_status: not-required (docs-only skill text); evidence:
bun run --cwd packages/public/lint test(includestest:pack) andlint,format:checkpass; grep finds nofoundationtier name outside the migration note - validation: as above
- review_mode: cli; runtime_validation: npm readback
npm view @collective-intelligence/lint@0.2.0 version - merge: PR to
main, merge when green; thengh workflow run release-npm-packages.ymlwith bumpminor(E3); verify 0.2.0 published - assigned_skills: writing-for-agents; implementation_skill_guidance: writing-for-agents — same words as app layers, no app model restatement
- behavior_owner: ci-app; integration_surface: npm; public_seam: package skill; topology_delta: tier rename; forbidden_ownership: app layer text; temporary_seams: none; responsibility_acceptance_criteria: RAC-4
T3 — HI: frontend-layers rules, tests, parity, asset, skills sync
- depends_on: [T1]; wave_boundary: W2; architecture_wave: A2
- location: HI
team/stefan/entities-layer-model(this branch) - owned_paths:
apps/cli/src/data/lint/frontend-layers/**,apps/cli/src/data/catalog/lint.ts(react-frontend-layers entry and description),apps/cli/scripts/sync-skills-repo.mjs(pin constants),apps/cli/skills/**(sync output, notnpm/),.agents/skills/**synced copies if the repo keeps them in sync,apps/cli/src/registry/builders/lint.test.tsif rule aliases are listed - read_dependencies: ARCHITECTURE rule table; Q26, Q27, Q50; T1 tag
- description: set
defaultRepositoryRef/defaultRepositoryCommitto the T1 tag; runbun run --cwd apps/cli sync:skills; implement rank map withentitiesandui, subpath-awarelocate, test predicate (.test./.spec./.stories.), file-name path rule,Program.bodycontent rule; add the 7 new and change 4 rules; asset sets all 14 toerror. - spec: OUT-002; AC-005, AC-006, AC-008; INV-001…INV-005; ARC-002
- tdd_status: required; RED: new describe blocks in
frontend-layers.test.ts(report + accept per rule) fail;skill-parity.test.tsfails after sync until ids match; GREEN:bun run --cwd apps/cli test -- src/data/lint/frontend-layerspasses; test_form: example; sensitivity_evidence: each new rule's report fixture fails with that rule removed - validation: focused vitest above,
bun run --cwd apps/cli check-types,bun run --cwd apps/cli lint - review_mode: cli
- assigned_skills: tdd, frontend-domain-structure, codebase-design; implementation_skill_guidance: tdd — one report and one accept fixture per rule through the oxlint CLI; codebase-design — keep
importRule/folderRulehelpers deep, add helpers rather than special cases - behavior_owner: HI plugin; public_seam: rule ids; topology_delta: rules for entities; temporary_seams: none; responsibility_acceptance_criteria: RAC-2
T4 — HI: oxfmt ignore merge for copied plugins
- depends_on: []; wave_boundary: W1; architecture_wave: A2
- location: HI branch
- owned_paths: installer merge-target code for
.oxfmtrc.json(locate the JSON merge registry inapps/cli/src/registry/**), its tests,skills/.../hi-clitext belongs to T1 - read_dependencies: Q28, Q49
- description: when the consumer has
.oxfmtrc.json, merge**/tools/oxlint/**intoignorePatterns(idempotent); otherwise add a report row naming the pattern; never create a formatter file. - spec: OUT-002; AC-007; ARC-003
- tdd_status: required; RED: installer test with and without
.oxfmtrc.jsonfails; GREEN: passes; test_form: example - validation: focused vitest for the new test;
check-types;lint - review_mode: cli
- assigned_skills: tdd, codebase-design; implementation_skill_guidance: tdd — drive through the update pipeline seam; codebase-design — reuse the existing JSON merge mechanism
- behavior_owner: HI installer; temporary_seams: none; responsibility_acceptance_criteria: RAC-3
T5 — HI: pin @collective-intelligence/lint 0.2.0 and sync package skill
- depends_on: [T2]; wave_boundary: W2; architecture_wave: A2
- location: HI branch
- owned_paths:
apps/cli/src/data/catalog/package-skills.ts,apps/cli/skills/npm/collective-intelligence-lint/**,.devpunks/specs/lint/assets/ci-solution.jsonif generated, related tests - description: set
collectiveIntelligenceLintVersion = "0.2.0"; runbun run --cwd apps/cli sync:package-skills; confirm byte equality with the npm package. - spec: OUT-003; AC-010; ARC-005
- tdd_status: not-required (pin + generated sync); evidence: sync receipt version 0.2.0; affected catalog tests pass
- validation:
bun run --cwd apps/cli test -- src/data/catalog;check-types - review_mode: cli
- assigned_skills: none beyond repository guidance
- responsibility_acceptance_criteria: RAC-4
T6 — HI: wiki restatements, changelog, merge and Baseline release
- depends_on: [T1, T3, T4, T5]; wave_boundary: W3; architecture_wave: A3
- location: HI branch →
main - owned_paths:
apps/wiki/content/docs/harness/skills-and-packs/{skill-packs,skill-reference}.mdx,apps/wiki/content/docs/harness/validation-and-tools/hooks.mdx,BASELINE_CHANGELOG.md, this spec'sIMPLEMENTATION-NOTES.md - description: update HI wiki restatements (AC-004 HI part);
BASELINE_CHANGELOG.mdUnreleased entry naming the sync tag, lint 0.2.0, the 14 rules aserrorand thereferences/migration.mdlink; open PR, merge when required checks pass; watchrelease.yml; verify Registry rootlatestand readback. - spec: OUT-004; AC-011, AC-004; ARC-004, ARC-006; FLOW-001-STEP-004
- tdd_status: not-required (docs + release); evidence:
bun run --cwd apps/wiki check:content,check:health(no new findings), release run success,curl https://api.harness-intelligence.devpunks.com/r/registry.jsonnames the new version - review_mode: cli
- responsibility_acceptance_criteria: RAC-5
T7 — devpunks-intelligence: @devpunks/oxlint-config for every workspace
- depends_on: []; wave_boundary: W1; architecture_wave: A4
- location:
devpunks-intelligencePR #79 branchcodex/active-search-recruiter-portal-followup - owned_paths:
packages/oxlint-config/**,pnpm-workspace.yaml(catalog), every workspacepackage.jsonlint script and oxlint devDependencies, every workspaceoxlint.config.ts, the.oxlintrc.jsonchain files,app/frontend/recruiter-portal/oxlint.local.ts,app/backend/extensions/test/import-lint.test.ts,.github/workflows/{ci,recruiter-portal-ci}.ymlpath filters,pnpm-lock.yaml,docs/runbooks/harness-maintenance.md - description: create the package (subpaths
./repository,./backend,./frontend,./packages,./infraasOxlintConfigobjects composing./repositorywith today's JSON rules); catalogoxlintand@oxlint/plugins1.90.0; each workspaceoxlint.config.tsimports its subpath by name; replace dormant ultracite content; scripts useoxlint --config oxlint.config.ts; keep extensions' local plugin; update CI path filters. - spec: OUT-005; AC-013; ARC-007; FLOW-003
- tdd_status: required for policy equality; RED: a script comparing
oxlint --print-config(or resolved rule sets) per workspace before/after reports differences while wiring is incomplete; GREEN: equal sets; plus each workspacelintexits as before - validation: per-workspace
pnpm --filter <ws> lint;pnpm --filter @app/frontend-recruiter-portal linthas 0ci-solution/package-entrypointfindings; extensions import-lint test passes - review_mode: cli
- assigned_skills: tdd; implementation_skill_guidance: tdd — prove policy equality per workspace before deleting JSON chains
- responsibility_acceptance_criteria: RAC-6
T8 — devpunks-intelligence: Baseline and Recruiter Portal restructure
- depends_on: [T6, T7]; wave_boundary: W4; architecture_wave: A4
- location: PR #79 branch
- owned_paths:
.devpunks/**, harness mirrors and skills written byhi update,app/frontend/recruiter-portal/src/**,app/frontend/recruiter-portal/tools/oxlint/**(restore Baseline bytes),packages/ui/**(admitted primitives),.oxfmtrc.json,apps/wiki/content/docs/project/specs/hr/recruiter-portal-architecture-quality/ARCHITECTURE.md(supersession note),docs/runbooks/{recruiter-portal,harness-maintenance}.md, scopedAGENTS.md - description:
hi update --yesto the new Baseline (restores copied plugins, adds oxfmt ignore); follow the update branch ofhi-cli; restructure the portal per the ARCHITECTURE ARC-008 table in vertical slices (composition/routing + providers; entities/candidate; entities/interview; entities/challenge + features/challenge; vocabulary; access; interview features; dashboard; modules/async; integrations/{ci,document}; packages/ui primitives; deletions Q39); mark ARC-003/ARC-004 superseded; push; update PR body. - spec: OUT-005; AC-012, AC-014; ARC-008; FLOW-002
- tdd_status: required (behavior preservation); RED: managed lint with new rules reports the current tree; GREEN: managed lint,
type-check:ci,test,buildof the portal pass; existing behavior tests unchanged in assertions - validation: portal
lint,type-check:ci,test,build;hi check --jsoncurrent;packages/uilint - review_mode: cli
- assigned_skills: frontend-domain-structure, hi-cli, tdd, simplify; implementation_skill_guidance: frontend-domain-structure — place every file by the new model; hi-cli — follow the Update branch; tdd — move code without changing test assertions
- responsibility_acceptance_criteria: RAC-6
T9 — emera-platform: Baseline, tier and layer migration
- depends_on: [T6]; wave_boundary: W4; architecture_wave: A4
- location: new worktree of
emera-platformofforigin/main, branchteam/stefan/entities-layer-model - owned_paths: whole repository
- description:
hi update --yes; renamepackages/foundation/*→packages/modules/*,packages/modules/*→packages/entities/*; update tags, rootturbo.jsonboundaries,tools/boundaries/boundaries.test.ts, imports and docs; migrate frontend apps by the skill; open one PR. - spec: OUT-006; AC-015; ARC-009
- tdd_status: required for boundaries; RED: boundaries test with new names fails before the move; GREEN: passes; repository lint/type-check/tests pass or each failure is listed in the PR
- review_mode: cli
- assigned_skills: frontend-domain-structure, ci-solution-structure, hi-cli
- responsibility_acceptance_criteria: RAC-7
T10 — apito: Baseline and layer migration
- depends_on: [T6]; wave_boundary: W4; architecture_wave: A4
- location: new worktree of
apitoofforigin/main, branchteam/stefan/entities-layer-model - owned_paths: whole repository
- description:
hi update --yes; migrate frontend layout by the skill; add the Q49 report pattern tooxfmt.config.tsignore if reported; open one PR. - spec: OUT-006; AC-016; ARC-009
- tdd_status: required for behavior preservation; RED: managed lint with new rules reports the current tree; GREEN: passes or findings listed in the PR
- review_mode: cli
- assigned_skills: frontend-domain-structure, hi-cli
- responsibility_acceptance_criteria: RAC-7
Testing Strategy
Rule behavior through the real oxlint CLI on fixture trees (T3); installer behavior through the update pipeline (T4); text through skills contract tests (T1); consumers through their own lint/type-check/test/build (T7–T10).
Risks and Mitigations
- Linear projection incomplete: residual delta recorded; provider-free execution continues.
- Required checks on upstream PRs may need reviews: if branch protection blocks a merge, use the repository's allowed admin merge only where policy permits; otherwise record the blocker.
- emera-platform/apito migrations may exceed one session: each PR lists remaining findings rather than suppressing rules.
- ci-app release workflow needs Production approval: record the run state.
Unresolved Questions
None open in planning; external blockers are recorded per task.