Harness Intelligence Wiki
SpecsCLIEntities Layer Model

Entities Layer Model Plan

Plan: Entities Layer Model

Context Pointers

ArtifactImmutable identityUse
SPECe092c1d87c68 SPEC.mdOUT-001…OUT-006, AC-001…AC-016, INV-001…INV-005
ARCHITECTUREf5cd2185cd3e ARCHITECTURE.md (sha256 5140f325…)ARC-001…ARC-010, FLOW-001…FLOW-003, rule table, portal mapping, #spec-traceability
Grillapps/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 $grilling round or $wait-what approval 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-model in every repository (SPEC Branch/Base Intent).
  • E2: Skills sync tag sync/entities-layer-model-<sha12> on the skills merge commit, as in sync-skills-repo.mjs pin practice (S9).
  • E3: ci-app release by workflow_dispatch of release-npm-packages.yml with bump minor after merge (Q29).
  • E4: HI Baseline publication is automatic on the main merge that changes BASELINE_CHANGELOG.md (.github/workflows/release.yml; runbook ci-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-intelligence reuses PR #79.
  • Consumers use separate checkouts/worktrees; never the shared main checkouts (~/repos/collective-intelligence holds others' worktrees; ~/repos/skills local main holds a foreign unpushed commit; HI main checkout is dirty).
  • Shared machine: heavy runs in systemd-run --user --scope with memory limits (/AGENTS.md).

Codebase Findings

  • Skills: contract tests tests/frontend-domain-structure.contract.test.mjs, tests/frontend-layer-consumers.contract.test.mjs; run node --test tests/*.test.mjs.
  • HI plugin: apps/cli/src/data/lint/frontend-layers/{index.mjs,frontend-layers.test.ts,skill-parity.test.ts}; asset apps/cli/src/data/catalog/lint.ts:237-270; locate/isEntrypoint need subpath awareness; folderRule drops 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/lint scripts test (bun test src && test:pack), lint, format:check; tools/test-pack.ts:62 requires reference files tiers, package-shape, composition, enforcement.
  • devpunks-intelligence lint routes: ARCHITECTURE FLOW-003; F4 report in grill status.
  • emera-platform: turbo.json:4-45 boundaries, tools/boundaries/boundaries.test.ts:22-29,84-93.

Wiki Context

  • Knowledge used:
  • 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, Root HARNESS INTELLIGENCE (I-3), Product Area CLI, 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_reason for every task: "Linear free issue limit reached after IP-561; Tasks not projected." Resume: free capacity or a paid plan, then rerun write-backlog with this residual delta.

Dependency Graph and Waves

Wave (wave_boundary)TasksGate
W1T1, T2, T4, T7Each task's own validation; T1, T2 merged
W2T3, T5Parity and pin readback
W3T6Baseline published and read back
W4T8, T9, T10One 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-009

Must 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_idOwnerObservable assertionEvidencedue_architecture_wave
RAC-1skillsAC-001…AC-004 text presentskills contract testsA1
RAC-2HI pluginAC-005, AC-006, AC-008frontend-layers.test.ts, skill-parity.test.tsA2
RAC-3HI installerAC-007installer testA2
RAC-4ci-app + HI pinAC-009, AC-010test:pack; npm view; pin readbackA2
RAC-5RegistryAC-011Registry readbackA3
RAC-6devpunks-intelligenceAC-012…AC-014hi check, portal gates, lint per workspaceA4
RAC-7emera-platform, apitoAC-015, AC-016hi check, lint/type-check/testsA4

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

SeamOwnerConsumers
structure.md ## Lint Rules tableskillsHI parity test, agents
frontend-layers rule idsHIconsumer oxlint.config.ts aliases
@collective-intelligence/lint@0.2.0 skillci-appHI sync:package-skills
Registry latestHIhi update
@devpunks/oxlint-config/{repository,backend,frontend,packages,infra}devpunks-intelligenceits workspaces

Migration Ledger

Temporary seamIntroduced byAllowed consumersRemovalExpiryProof
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/skills worktree off origin/main, branch team/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; add references/migration.md (Q45 map) with a SKILL.md pointer; 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.mjs fails 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 tag sync/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-app off origin/main, branch team/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, agnostic modules, retire foundation), tags and boundary examples; Modules no-product-terms invariant; "shared UI package" wording; migration note in references/enforcement.md; README and CHANGELOG ## Unreleased entry. 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 (includes test:pack) and lint, format:check pass; grep finds no foundation tier 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; then gh workflow run release-npm-packages.yml with bump minor (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, not npm/), .agents/skills/** synced copies if the repo keeps them in sync, apps/cli/src/registry/builders/lint.test.ts if rule aliases are listed
  • read_dependencies: ARCHITECTURE rule table; Q26, Q27, Q50; T1 tag
  • description: set defaultRepositoryRef/defaultRepositoryCommit to the T1 tag; run bun run --cwd apps/cli sync:skills; implement rank map with entities and ui, subpath-aware locate, test predicate (.test./.spec./.stories.), file-name path rule, Program.body content rule; add the 7 new and change 4 rules; asset sets all 14 to error.
  • 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.ts fails after sync until ids match; GREEN: bun run --cwd apps/cli test -- src/data/lint/frontend-layers passes; 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/folderRule helpers 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 in apps/cli/src/registry/**), its tests, skills/.../hi-cli text belongs to T1
  • read_dependencies: Q28, Q49
  • description: when the consumer has .oxfmtrc.json, merge **/tools/oxlint/** into ignorePatterns (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.json fails; 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.json if generated, related tests
  • description: set collectiveIntelligenceLintVersion = "0.2.0"; run bun 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's IMPLEMENTATION-NOTES.md
  • description: update HI wiki restatements (AC-004 HI part); BASELINE_CHANGELOG.md Unreleased entry naming the sync tag, lint 0.2.0, the 14 rules as error and the references/migration.md link; open PR, merge when required checks pass; watch release.yml; verify Registry root latest and 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.json names 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-intelligence PR #79 branch codex/active-search-recruiter-portal-followup
  • owned_paths: packages/oxlint-config/**, pnpm-workspace.yaml (catalog), every workspace package.json lint script and oxlint devDependencies, every workspace oxlint.config.ts, the .oxlintrc.json chain files, app/frontend/recruiter-portal/oxlint.local.ts, app/backend/extensions/test/import-lint.test.ts, .github/workflows/{ci,recruiter-portal-ci}.yml path filters, pnpm-lock.yaml, docs/runbooks/harness-maintenance.md
  • description: create the package (subpaths ./repository, ./backend, ./frontend, ./packages, ./infra as OxlintConfig objects composing ./repository with today's JSON rules); catalog oxlint and @oxlint/plugins 1.90.0; each workspace oxlint.config.ts imports its subpath by name; replace dormant ultracite content; scripts use oxlint --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 workspace lint exits as before
  • validation: per-workspace pnpm --filter <ws> lint; pnpm --filter @app/frontend-recruiter-portal lint has 0 ci-solution/package-entrypoint findings; 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 by hi 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, scoped AGENTS.md
  • description: hi update --yes to the new Baseline (restores copied plugins, adds oxfmt ignore); follow the update branch of hi-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, build of the portal pass; existing behavior tests unchanged in assertions
  • validation: portal lint, type-check:ci, test, build; hi check --json current; packages/ui lint
  • 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-platform off origin/main, branch team/stefan/entities-layer-model
  • owned_paths: whole repository
  • description: hi update --yes; rename packages/foundation/* → packages/modules/*, packages/modules/* → packages/entities/*; update tags, root turbo.json boundaries, 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 apito off origin/main, branch team/stefan/entities-layer-model
  • owned_paths: whole repository
  • description: hi update --yes; migrate frontend layout by the skill; add the Q49 report pattern to oxfmt.config.ts ignore 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.

On this page