@elevasis/sdk 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/cli.cjs +1 -1
  2. package/dist/index.d.ts +88 -39
  3. package/dist/types/worker/adapters/lead.d.ts +1 -1
  4. package/dist/worker/index.js +2 -0
  5. package/package.json +2 -2
  6. package/reference/_navigation.md +7 -1
  7. package/reference/_reference-manifest.json +14 -0
  8. package/reference/claude-config/logs/scaffold-registry-reminder.log +3 -0
  9. package/reference/claude-config/rules/agent-start-here.md +254 -254
  10. package/reference/claude-config/rules/frontend.md +43 -43
  11. package/reference/claude-config/rules/operations.md +64 -64
  12. package/reference/claude-config/rules/organization-model.md +42 -43
  13. package/reference/claude-config/rules/organization-os.md +107 -107
  14. package/reference/claude-config/rules/shared-types.md +2 -2
  15. package/reference/claude-config/rules/task-tracking.md +1 -1
  16. package/reference/claude-config/rules/ui.md +202 -202
  17. package/reference/claude-config/rules/vibe.md +202 -202
  18. package/reference/claude-config/skills/configure/SKILL.md +98 -98
  19. package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -100
  20. package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -158
  21. package/reference/claude-config/skills/configure/operations/customers.md +150 -150
  22. package/reference/claude-config/skills/configure/operations/features.md +162 -162
  23. package/reference/claude-config/skills/configure/operations/goals.md +147 -147
  24. package/reference/claude-config/skills/configure/operations/identity.md +133 -133
  25. package/reference/claude-config/skills/configure/operations/labels.md +128 -128
  26. package/reference/claude-config/skills/configure/operations/offerings.md +159 -159
  27. package/reference/claude-config/skills/configure/operations/roles.md +153 -153
  28. package/reference/claude-config/skills/configure/operations/techStack.md +139 -139
  29. package/reference/claude-config/skills/explore/SKILL.md +78 -78
  30. package/reference/claude-config/skills/git-sync/SKILL.md +126 -0
  31. package/reference/claude-config/skills/save/SKILL.md +183 -183
  32. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  33. package/reference/claude-config/skills/sync/SKILL.md +10 -44
  34. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -0
  35. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -0
  36. package/reference/claude-config/sync-notes/README.md +43 -0
  37. package/reference/packages/core/src/README.md +39 -36
  38. package/reference/packages/core/src/business/README.md +52 -52
  39. package/reference/packages/core/src/organization-model/README.md +97 -97
  40. package/reference/packages/core/src/test-utils/README.md +42 -0
  41. package/reference/scaffold/core/organization-graph.mdx +272 -272
  42. package/reference/scaffold/core/organization-model.mdx +320 -320
  43. package/reference/scaffold/index.mdx +64 -64
  44. package/reference/scaffold/operations/propagation-pipeline.md +125 -104
  45. package/reference/scaffold/operations/scaffold-maintenance.md +122 -122
  46. package/reference/scaffold/operations/workflow-recipes.md +436 -436
  47. package/reference/scaffold/recipes/add-a-feature.md +158 -158
  48. package/reference/scaffold/recipes/add-a-resource.md +158 -158
  49. package/reference/scaffold/recipes/customize-organization-model.md +400 -400
  50. package/reference/scaffold/recipes/extend-a-base-entity.md +140 -140
  51. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +158 -158
  52. package/reference/scaffold/recipes/index.md +32 -32
  53. package/reference/scaffold/reference/contracts.md +608 -607
  54. package/reference/scaffold/reference/feature-registry.md +2 -0
  55. package/reference/scaffold/reference/glossary.md +105 -105
  56. package/reference/scaffold/ui/composition-extensibility.mdx +1 -1
  57. package/reference/scaffold/ui/feature-flags-and-gating.md +1 -1
@@ -0,0 +1,30 @@
1
+ # Lead Gen Deliverability Page Removal
2
+
3
+ ## Why this note exists
4
+
5
+ `LeadGenDeliverabilityPage` has been removed from the published `@elevasis/ui` package. The deliverability route and sidebar nav item were removed from the shared lead-gen surface. Template-derived projects that still import or route to this page will fail to compile after pulling this train.
6
+
7
+ ## Applies to
8
+
9
+ All template-derived projects that use the lead-gen feature and have a `ui/src/routes/lead-gen/deliverability.tsx` route file or a deliverability entry in their lead-gen sidebar.
10
+
11
+ Known affected projects: `nirvana-marketing`, `ZentaraHQ`.
12
+
13
+ ## Required actions
14
+
15
+ 1. Delete `ui/src/routes/lead-gen/deliverability.tsx` — this file is completely removed (no redirect replacement).
16
+ 2. Remove the deliverability nav item from any project-local lead-gen sidebar overrides that reference it by ID or label.
17
+ 3. Remove any import of `LeadGenDeliverabilityPage` from route trees, lazy-loaded chunks, or custom page wrappers.
18
+ 4. Regenerate the TanStack Router route tree (`pnpm -C ui exec tsr generate` or equivalent) after removing the route file so the generated routeTree no longer references the deleted route.
19
+ 5. Run `pnpm -C ui build` to confirm the build is clean.
20
+
21
+ ## Verification
22
+
23
+ - `pnpm -C ui build` passes with no import or route errors.
24
+ - Navigating to `/lead-gen` works; navigating to `/lead-gen/deliverability` either 404s or redirects as expected by the project's router config.
25
+
26
+ ## Not handled by /git-sync
27
+
28
+ - `/git-sync` pulls the template source change (removal of `deliverability.tsx` from `_template/ui/src/routes/lead-gen/`), but it does not automatically delete project-owned route files that still import `LeadGenDeliverabilityPage`.
29
+ - Any project-local sidebar override that hard-references the deliverability nav entry must be manually cleaned up.
30
+ - The route tree regeneration step must be run manually after route file removal.
@@ -0,0 +1,43 @@
1
+ # Sync Notes
2
+
3
+ Template-owned downstream migration guidance lives in this directory.
4
+
5
+ ## File Contract
6
+
7
+ - Operative note files must be named `YYYY-MM-DD-<slug>.md`
8
+ - `README.md` explains the contract and is ignored by `/git-sync`
9
+ - Notes are append-only. Add a new dated file for each downstream-affecting release train instead of rewriting an older note
10
+
11
+ ## When A Note Is Mandatory
12
+
13
+ Add a new operative note whenever a train affects derived projects beyond a normal pull, install, and baseline verify. Common triggers:
14
+
15
+ - template dependency-baseline changes
16
+ - scaffold or sync-contract changes
17
+ - rename or migration work
18
+ - verifier or behavior changes that downstream maintainers need to understand
19
+ - any release train that will ask maintainers to do manual follow-up after pulling
20
+
21
+ ## Required Sections
22
+
23
+ Every operative note must include these exact headings:
24
+
25
+ ## Why this note exists
26
+
27
+ Explain what changed and why downstream maintainers are seeing this note.
28
+
29
+ ## Applies to
30
+
31
+ State which projects, app modes, or versions need the follow-up.
32
+
33
+ ## Required actions
34
+
35
+ List the manual work maintainers need to do after `/git-sync`.
36
+
37
+ ## Verification
38
+
39
+ List the commands or flows that confirm the migration landed correctly.
40
+
41
+ ## Not handled by /git-sync
42
+
43
+ Call out what remains manual so maintainers do not assume the pull/install/verify flow reconciled everything.
@@ -1,41 +1,44 @@
1
- # @elevasis/core
2
-
3
- Published browser-safe shared contracts for the Elevasis platform.
4
-
5
- This package is the source of truth for shared types, schemas, and contract helpers that are safe to consume from apps and other packages. In this repo the source package is named `@repo/core`, but these docs describe the published `@elevasis/core` surface.
6
-
7
- ## Import Rules
8
-
1
+ # @elevasis/core
2
+
3
+ Published browser-safe shared contracts for the Elevasis platform.
4
+
5
+ This package is the source of truth for shared types, schemas, and contract helpers that are safe to consume from apps and other packages. In this repo the source package is named `@repo/core`, but these docs describe the published `@elevasis/core` surface.
6
+
7
+ ## Import Rules
8
+
9
9
  - Use `@elevasis/core` (root export) for browser-safe shared types and schemas.
10
10
  - Use `@elevasis/core/organization-model` for the semantic contract layer.
11
- - These are the only two subpaths available to external consumers of the published npm package.
12
- - Paths like `@elevasis/core/server`, `@elevasis/core/test-utils`, `@elevasis/core/platform`, etc. are internal monorepo paths (`@repo/core/...`) and are NOT available to external consumers.
13
-
14
- ## Published Surface Groups
15
-
16
- The published `@elevasis/core` npm package exposes exactly two subpaths:
11
+ - Use `@elevasis/core/entities` for the published base entity contracts.
12
+ - Use `@elevasis/core/test-utils` for shared test fixtures, mocks, and test helpers.
13
+ - Paths like `@elevasis/core/server` and `@elevasis/core/platform` are internal monorepo paths (`@repo/core/...`) and are NOT available to external consumers.
14
+
15
+ ## Published Surface Groups
16
+
17
+ The published `@elevasis/core` npm package exposes these subpaths:
17
18
 
18
19
  - `.` (`@elevasis/core`) - browser-safe shared types, schemas, and constants.
19
20
  - `./organization-model` (`@elevasis/core/organization-model`) - the semantic contract layer for CRM, lead gen, delivery, features, branding, and navigation.
20
-
21
- Within the monorepo, the internal `@repo/core` package exposes additional subpaths for use by `apps/` and other packages:
22
-
23
- - `@repo/core/server` - Node.js-only helpers and services.
24
- - `@repo/core/platform` - shared constants, utilities, registry, SSE, and API types.
25
- - `@repo/core/auth` - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
26
- - `@repo/core/execution` - workflow, agent, scheduler, and execution-interface contracts.
27
- - `@repo/core/commands` - command queue types and schemas.
28
- - `@repo/core/operations` - sessions, notifications, observability, activities, triggers, and debug logs.
29
- - `@repo/core/supabase` - generated database types and helpers.
30
- - `@repo/core/integrations/...` - OAuth and credential contracts.
31
- - `@repo/core/projects/api-schemas` - project management request and response schemas.
32
- - `@repo/core/content` - published content metadata types.
33
- - `@repo/core/test-utils` - test fixtures and mocks (internal use only).
34
-
35
- These `@repo/core/*` subpaths are NOT available in the published `@elevasis/core` package.
36
-
37
- ## When To Read Deeper
38
-
39
- - For the organization model contract, start with [organization-model/README.md](./organization-model/README.md).
40
- - For test utilities, read [test-utils/README.md](./test-utils/README.md).
41
- - For credentials, read [auth/multi-tenancy/credentials/README.md](./auth/multi-tenancy/credentials/README.md) if you are working in source. The runtime helpers are server-only.
21
+ - `./entities` (`@elevasis/core/entities`) - published base entity contracts generic over project metadata extensions.
22
+ - `./test-utils` (`@elevasis/core/test-utils`) - test fixtures, mocks, and helpers for downstream automated tests.
23
+
24
+ Within the monorepo, the internal `@repo/core` package exposes additional subpaths for use by `apps/` and other packages:
25
+
26
+ - `@repo/core/server` - Node.js-only helpers and services.
27
+ - `@repo/core/platform` - shared constants, utilities, registry, SSE, and API types.
28
+ - `@repo/core/auth` - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
29
+ - `@repo/core/execution` - workflow, agent, scheduler, and execution-interface contracts.
30
+ - `@repo/core/commands` - command queue types and schemas.
31
+ - `@repo/core/operations` - sessions, notifications, observability, activities, triggers, and debug logs.
32
+ - `@repo/core/supabase` - generated database types and helpers.
33
+ - `@repo/core/integrations/...` - OAuth and credential contracts.
34
+ - `@repo/core/projects/api-schemas` - project management request and response schemas.
35
+ - `@repo/core/content` - published content metadata types.
36
+ - `@repo/core/test-utils` - source of the published test fixtures and mocks surface.
37
+
38
+ Other `@repo/core/*` subpaths remain monorepo-only unless they are explicitly listed above in the published `@elevasis/core` surface.
39
+
40
+ ## When To Read Deeper
41
+
42
+ - For the organization model contract, start with [organization-model/README.md](./organization-model/README.md).
43
+ - For test utilities, read [test-utils/README.md](./test-utils/README.md).
44
+ - For credentials, read [auth/multi-tenancy/credentials/README.md](./auth/multi-tenancy/credentials/README.md) if you are working in source. The runtime helpers are server-only.
@@ -1,52 +1,52 @@
1
- # Entities
2
-
3
- Published base entity contracts for the Elevasis platform. Each entity ships as a TypeScript interface, a matching Zod schema, and an inferred `Input` type, generic over a `<TMeta>` extension slot.
4
-
5
- External projects extend these in `foundations/types/entities.ts` to attach project-specific metadata while keeping the canonical shape stable.
6
-
7
- ## Published Exports
8
-
9
- The published entry point exposes six entity contracts:
10
-
11
- - `BaseProject<TMeta>`, `BaseProjectSchema`, `BaseProjectInput`
12
- - `BaseMilestone<TMeta>`, `BaseMilestoneSchema`, `BaseMilestoneInput`
13
- - `BaseTask<TMeta>`, `BaseTaskSchema`, `BaseTaskInput`
14
- - `BaseDeal<TMeta>`, `BaseDealSchema`, `BaseDealInput`
15
- - `BaseCompany<TMeta>`, `BaseCompanySchema`, `BaseCompanyInput`
16
- - `BaseContact<TMeta>`, `BaseContactSchema`, `BaseContactInput`
17
-
18
- Import them from the published subpath:
19
-
20
- ```ts
21
- import { BaseDealSchema, type BaseDeal } from '@elevasis/core/entities'
22
- ```
23
-
24
- ## Extension Pattern
25
-
26
- Each base interface accepts a generic metadata type. Extend the schema with `.extend({ metadata: ... })` and infer the type with `BaseProject<z.infer<typeof MetaSchema>>`.
27
-
28
- ```ts
29
- import { z } from 'zod'
30
- import { BaseProjectSchema, type BaseProject } from '@elevasis/core/entities'
31
-
32
- const ProjectMetaSchema = z.object({
33
- budget: z.number().int().nonnegative(),
34
- clientPriority: z.enum(['low', 'medium', 'high'])
35
- })
36
-
37
- export const ProjectSchema = BaseProjectSchema.extend({ metadata: ProjectMetaSchema })
38
- export type Project = BaseProject<z.infer<typeof ProjectMetaSchema>>
39
- ```
40
-
41
- Use the base shape as-is when no extension is needed:
42
-
43
- ```ts
44
- export const DealSchema = BaseDealSchema
45
- export type Deal = BaseDeal
46
- ```
47
-
48
- ## Recipe
49
-
50
- The full pattern is documented in the SDK scaffold bundle: `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-a-base-entity.md`.
51
-
52
- The canonical template demo lives at `external/_template/foundations/types/entities.ts`.
1
+ # Entities
2
+
3
+ Published base entity contracts for the Elevasis platform. Each entity ships as a TypeScript interface, a matching Zod schema, and an inferred `Input` type, generic over a `<TMeta>` extension slot.
4
+
5
+ External projects extend these in `foundations/types/entities.ts` to attach project-specific metadata while keeping the canonical shape stable.
6
+
7
+ ## Published Exports
8
+
9
+ The published entry point exposes six entity contracts:
10
+
11
+ - `BaseProject<TMeta>`, `BaseProjectSchema`, `BaseProjectInput`
12
+ - `BaseMilestone<TMeta>`, `BaseMilestoneSchema`, `BaseMilestoneInput`
13
+ - `BaseTask<TMeta>`, `BaseTaskSchema`, `BaseTaskInput`
14
+ - `BaseDeal<TMeta>`, `BaseDealSchema`, `BaseDealInput`
15
+ - `BaseCompany<TMeta>`, `BaseCompanySchema`, `BaseCompanyInput`
16
+ - `BaseContact<TMeta>`, `BaseContactSchema`, `BaseContactInput`
17
+
18
+ Import them from the published subpath:
19
+
20
+ ```ts
21
+ import { BaseDealSchema, type BaseDeal } from '@elevasis/core/entities'
22
+ ```
23
+
24
+ ## Extension Pattern
25
+
26
+ Each base interface accepts a generic metadata type. Extend the schema with `.extend({ metadata: ... })` and infer the type with `BaseProject<z.infer<typeof MetaSchema>>`.
27
+
28
+ ```ts
29
+ import { z } from 'zod'
30
+ import { BaseProjectSchema, type BaseProject } from '@elevasis/core/entities'
31
+
32
+ const ProjectMetaSchema = z.object({
33
+ budget: z.number().int().nonnegative(),
34
+ clientPriority: z.enum(['low', 'medium', 'high'])
35
+ })
36
+
37
+ export const ProjectSchema = BaseProjectSchema.extend({ metadata: ProjectMetaSchema })
38
+ export type Project = BaseProject<z.infer<typeof ProjectMetaSchema>>
39
+ ```
40
+
41
+ Use the base shape as-is when no extension is needed:
42
+
43
+ ```ts
44
+ export const DealSchema = BaseDealSchema
45
+ export type Deal = BaseDeal
46
+ ```
47
+
48
+ ## Recipe
49
+
50
+ The full pattern is documented in the SDK scaffold bundle: `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-a-base-entity.md`.
51
+
52
+ The canonical template demo lives at `external/_template/foundations/types/entities.ts`.
@@ -1,97 +1,97 @@
1
- # Organization Model
2
-
3
- The organization model is the published semantic contract that maps a tenant's product shape to domain surfaces, features, and navigation.
4
-
5
- Use this module when you need to resolve or validate an organization's contract before wiring UI shells, routing, or domain-specific capability checks.
6
-
7
- ## Published Exports
8
-
9
- The public entry point exposes:
10
-
11
- - `OrganizationModelSchema`
12
- - `DEFAULT_ORGANIZATION_MODEL`
13
- - `defineOrganizationModel`
14
- - `resolveOrganizationModel`
15
- - `PROJECTS_FEATURE_ID`
16
- - `PROJECTS_INDEX_SURFACE_ID`
17
- - `PROJECTS_VIEW_CAPABILITY_ID`
18
- - `OrganizationModel` and the supporting domain types
19
-
20
- Import it from the published subpath:
21
-
22
- ```ts
23
- import {
24
- DEFAULT_ORGANIZATION_MODEL,
25
- PROJECTS_VIEW_CAPABILITY_ID,
26
- defineOrganizationModel,
27
- PROJECTS_FEATURE_ID,
28
- PROJECTS_INDEX_SURFACE_ID,
29
- resolveOrganizationModel,
30
- type OrganizationModel
31
- } from '@elevasis/core/organization-model'
32
- ```
33
-
34
- ## Contract Shape
35
-
36
- The model is versioned and currently validates against `version: 1`.
37
-
38
- Top-level fields:
39
-
40
- - `version` - schema version for the resolved contract.
41
- - `branding` - organization branding defaults and overrides.
42
- - `features` - unified feature entries that combine enablement, labels, and semantic references.
43
- - `navigation` - navigation model for the product shell.
44
- - `sales` - sales pipeline and relationship management.
45
- - `prospecting` - lists, companies, and contacts.
46
- - `projects` - projects, milestones, and tasks.
47
- - `identity`, `customers`, `offerings`, `roles`, `goals` - reality domains (2026-04 expansion).
48
- - `statuses` - unified status registry across delivery / hitl / execution / request / schedule.
49
- - `operations` - catalog of stateful runtime entities (HITL queue, sessions, executions, notifications, schedules).
50
- - `resourceMappings` - cross-surface resource mappings (includes techStack subsection).
51
-
52
- ## Default Feature Set
53
-
54
- The default model includes eight feature IDs:
55
-
56
- - `sales` - deal pipeline and relationship management.
57
- - `prospecting` - lists, companies, and contacts.
58
- - `projects` - projects, milestones, and tasks.
59
- - `operations` - organization graph and command-view surfaces.
60
- - `monitoring` - monitoring surfaces.
61
- - `settings` - organization settings.
62
- - `seo` - SEO surfaces (disabled by default).
63
- - `configure` - `/configure` skill entry point (external projects).
64
-
65
- ## Project Bridge Constants
66
-
67
- The organization-model surface exports a narrow set of canonical IDs for the shared Projects bridge:
68
-
69
- - `PROJECTS_FEATURE_ID` -> `projects`
70
- - `PROJECTS_INDEX_SURFACE_ID` -> `projects.index`
71
- - `PROJECTS_VIEW_CAPABILITY_ID` -> `delivery.projects.view`
72
-
73
- Use these when wiring shared UI manifests, template adapters, or other consumers that need to agree on the same Projects contract without repeating raw literals.
74
-
75
- ## Resolution Semantics
76
-
77
- - `defineOrganizationModel()` is a typed helper. It does not validate or merge anything by itself.
78
- - `resolveOrganizationModel()` deep-merges a partial override into the default model, then validates the result with `OrganizationModelSchema`.
79
- - Plain objects merge recursively.
80
- - Arrays replace the default value instead of merging element-by-element.
81
- - If `navigation.surfaces` is replaced without also supplying `navigation.groups`, inherited default groups are dropped when they no longer point at declared surfaces.
82
- - Missing fields fall back to `DEFAULT_ORGANIZATION_MODEL`.
83
-
84
- ## Referential Integrity
85
-
86
- - `navigation.defaultSurfaceId` must point at a declared navigation surface.
87
- - Every navigation group `surfaceId` must resolve to a declared surface.
88
- - Feature, surface, and resource-mapping IDs must resolve to declared counterparts; dangling references fail validation.
89
- - Feature-to-surface and feature/surface-to-resource links are validated in both directions so one-sided declarations fail during resolution.
90
- - Feature-bearing surfaces validate `featureId` against the canonical feature set.
91
-
92
- ## Practical Guidance
93
-
94
- - Use `resolveOrganizationModel()` when you need a runtime-safe model for rendering or policy checks.
95
- - Use `defineOrganizationModel()` when authoring a static partial model in source.
96
- - Treat feature IDs such as `sales`, `prospecting`, and `projects` as the canonical shell-level contract in new organization-model authoring.
97
- - Keep feature IDs, surface IDs, and capability IDs stable because downstream UI and policy code depend on them.
1
+ # Organization Model
2
+
3
+ The organization model is the published semantic contract that maps a tenant's product shape to domain surfaces, features, and navigation.
4
+
5
+ Use this module when you need to resolve or validate an organization's contract before wiring UI shells, routing, or domain-specific capability checks.
6
+
7
+ ## Published Exports
8
+
9
+ The public entry point exposes:
10
+
11
+ - `OrganizationModelSchema`
12
+ - `DEFAULT_ORGANIZATION_MODEL`
13
+ - `defineOrganizationModel`
14
+ - `resolveOrganizationModel`
15
+ - `PROJECTS_FEATURE_ID`
16
+ - `PROJECTS_INDEX_SURFACE_ID`
17
+ - `PROJECTS_VIEW_CAPABILITY_ID`
18
+ - `OrganizationModel` and the supporting domain types
19
+
20
+ Import it from the published subpath:
21
+
22
+ ```ts
23
+ import {
24
+ DEFAULT_ORGANIZATION_MODEL,
25
+ PROJECTS_VIEW_CAPABILITY_ID,
26
+ defineOrganizationModel,
27
+ PROJECTS_FEATURE_ID,
28
+ PROJECTS_INDEX_SURFACE_ID,
29
+ resolveOrganizationModel,
30
+ type OrganizationModel
31
+ } from '@elevasis/core/organization-model'
32
+ ```
33
+
34
+ ## Contract Shape
35
+
36
+ The model is versioned and currently validates against `version: 1`.
37
+
38
+ Top-level fields:
39
+
40
+ - `version` - schema version for the resolved contract.
41
+ - `branding` - organization branding defaults and overrides.
42
+ - `features` - unified feature entries that combine enablement, labels, and semantic references.
43
+ - `navigation` - navigation model for the product shell.
44
+ - `sales` - sales pipeline and relationship management.
45
+ - `prospecting` - lists, companies, and contacts.
46
+ - `projects` - projects, milestones, and tasks.
47
+ - `identity`, `customers`, `offerings`, `roles`, `goals` - reality domains (2026-04 expansion).
48
+ - `statuses` - unified status registry across delivery / hitl / execution / request / schedule.
49
+ - `operations` - catalog of stateful runtime entities (HITL queue, sessions, executions, notifications, schedules).
50
+ - `resourceMappings` - cross-surface resource mappings (includes techStack subsection).
51
+
52
+ ## Default Feature Set
53
+
54
+ The default model includes eight feature IDs:
55
+
56
+ - `sales` - deal pipeline and relationship management.
57
+ - `prospecting` - lists, companies, and contacts.
58
+ - `projects` - projects, milestones, and tasks.
59
+ - `operations` - organization graph and command-view surfaces.
60
+ - `monitoring` - monitoring surfaces.
61
+ - `settings` - organization settings.
62
+ - `seo` - SEO surfaces (disabled by default).
63
+ - `configure` - `/configure` skill entry point (external projects).
64
+
65
+ ## Project Bridge Constants
66
+
67
+ The organization-model surface exports a narrow set of canonical IDs for the shared Projects bridge:
68
+
69
+ - `PROJECTS_FEATURE_ID` -> `projects`
70
+ - `PROJECTS_INDEX_SURFACE_ID` -> `projects.index`
71
+ - `PROJECTS_VIEW_CAPABILITY_ID` -> `delivery.projects.view`
72
+
73
+ Use these when wiring shared UI manifests, template adapters, or other consumers that need to agree on the same Projects contract without repeating raw literals.
74
+
75
+ ## Resolution Semantics
76
+
77
+ - `defineOrganizationModel()` is a typed helper. It does not validate or merge anything by itself.
78
+ - `resolveOrganizationModel()` deep-merges a partial override into the default model, then validates the result with `OrganizationModelSchema`.
79
+ - Plain objects merge recursively.
80
+ - Arrays replace the default value instead of merging element-by-element.
81
+ - If `navigation.surfaces` is replaced without also supplying `navigation.groups`, inherited default groups are dropped when they no longer point at declared surfaces.
82
+ - Missing fields fall back to `DEFAULT_ORGANIZATION_MODEL`.
83
+
84
+ ## Referential Integrity
85
+
86
+ - `navigation.defaultSurfaceId` must point at a declared navigation surface.
87
+ - Every navigation group `surfaceId` must resolve to a declared surface.
88
+ - Feature, surface, and resource-mapping IDs must resolve to declared counterparts; dangling references fail validation.
89
+ - Feature-to-surface and feature/surface-to-resource links are validated in both directions so one-sided declarations fail during resolution.
90
+ - Feature-bearing surfaces validate `featureId` against the canonical feature set.
91
+
92
+ ## Practical Guidance
93
+
94
+ - Use `resolveOrganizationModel()` when you need a runtime-safe model for rendering or policy checks.
95
+ - Use `defineOrganizationModel()` when authoring a static partial model in source.
96
+ - Treat feature IDs such as `sales`, `prospecting`, and `projects` as the canonical shell-level contract in new organization-model authoring.
97
+ - Keep feature IDs, surface IDs, and capability IDs stable because downstream UI and policy code depend on them.
@@ -0,0 +1,42 @@
1
+ # Test Utilities
2
+
3
+ Published test helpers for downstream consumers of `@elevasis/core`.
4
+
5
+ The public `@elevasis/core/test-utils` subpath is intentionally narrow. It exposes:
6
+
7
+ - `RLSTestContext` for dev-database RLS integration tests
8
+ - `setupMatchMedia`, `setupResizeObserver`, and `setupBrowserMocks` for jsdom/browser test setup
9
+
10
+ Internal monorepo fixtures and Vitest-specific mocks still exist under `packages/core/src/test-utils/`, but they are not part of the published package contract.
11
+
12
+ ## Published Usage
13
+
14
+ ### Browser Mocks
15
+
16
+ ```typescript
17
+ import { setupBrowserMocks } from '@elevasis/core/test-utils'
18
+
19
+ setupBrowserMocks()
20
+ ```
21
+
22
+ ### RLS Integration Tests
23
+
24
+ ```typescript
25
+ import { RLSTestContext } from '@elevasis/core/test-utils'
26
+
27
+ const ctx = new RLSTestContext()
28
+ ```
29
+
30
+ `RLSTestContext` requires a configured Supabase development environment:
31
+
32
+ - `SUPABASE_URL`
33
+ - `SUPABASE_ANON_KEY`
34
+ - `SUPABASE_SERVICE_KEY`
35
+ - `SUPABASE_JWT_SECRET`
36
+
37
+ ## Internal Scope
38
+
39
+ The following folders remain implementation detail for the monorepo and are not published:
40
+
41
+ - `fixtures/`
42
+ - `mocks/`