@codyswann/lisa 2.166.4 → 2.166.5

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 (56) hide show
  1. package/package.json +5 -5
  2. package/plugins/lisa/.claude-plugin/plugin.json +1 -1
  3. package/plugins/lisa/.codex-plugin/plugin.json +1 -1
  4. package/plugins/lisa-agy/plugin.json +1 -1
  5. package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
  6. package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
  7. package/plugins/lisa-cdk-agy/plugin.json +1 -1
  8. package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
  9. package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
  10. package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
  11. package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
  12. package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
  13. package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
  14. package/plugins/lisa-expo-agy/plugin.json +1 -1
  15. package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
  16. package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
  17. package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
  18. package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
  19. package/plugins/lisa-harper-fabric/skills/harper-schema-graphql/SKILL.md +68 -17
  20. package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
  21. package/plugins/lisa-harper-fabric-agy/skills/harper-schema-graphql/SKILL.md +68 -17
  22. package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
  23. package/plugins/lisa-harper-fabric-copilot/skills/harper-schema-graphql/SKILL.md +68 -17
  24. package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
  25. package/plugins/lisa-harper-fabric-cursor/skills/harper-schema-graphql/SKILL.md +68 -17
  26. package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
  27. package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
  28. package/plugins/lisa-nestjs-agy/plugin.json +1 -1
  29. package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
  30. package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
  31. package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
  32. package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
  33. package/plugins/lisa-openclaw-agy/plugin.json +1 -1
  34. package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
  35. package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
  36. package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
  37. package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
  38. package/plugins/lisa-phaser-agy/plugin.json +1 -1
  39. package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
  40. package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
  41. package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
  42. package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
  43. package/plugins/lisa-rails-agy/plugin.json +1 -1
  44. package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
  45. package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
  46. package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
  47. package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
  48. package/plugins/lisa-typescript-agy/plugin.json +1 -1
  49. package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
  50. package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
  51. package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
  52. package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
  53. package/plugins/lisa-wiki-agy/plugin.json +1 -1
  54. package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
  55. package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
  56. package/plugins/src/harper-fabric/skills/harper-schema-graphql/SKILL.md +68 -17
package/package.json CHANGED
@@ -85,7 +85,7 @@
85
85
  "lodash": ">=4.18.1"
86
86
  },
87
87
  "name": "@codyswann/lisa",
88
- "version": "2.166.4",
88
+ "version": "2.166.5",
89
89
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
90
90
  "main": "dist/index.js",
91
91
  "exports": {
@@ -166,7 +166,7 @@
166
166
  "@types/jest": "^30.0.0",
167
167
  "@types/lodash.merge": "^4.6.0",
168
168
  "@types/node": "^22.0.0",
169
- "@vitest/coverage-v8": "^4.1.0",
169
+ "@vitest/coverage-v8": "^4.1.9",
170
170
  "commander": "^12.0.0",
171
171
  "esbuild-register": "^3.6.0",
172
172
  "eslint": "^9.39.0",
@@ -205,17 +205,17 @@
205
205
  "tsx": "^4.0.0",
206
206
  "typescript": "^6.0.3",
207
207
  "typescript-eslint": "^8.0.0",
208
- "vitest": "^4.1.0"
208
+ "vitest": "^4.1.9"
209
209
  },
210
210
  "devDependencies": {
211
- "@codyswann/lisa": "^2.142.1",
211
+ "@codyswann/lisa": "^2.166.4",
212
212
  "@types/js-yaml": "^4.0.9",
213
213
  "@types/semver": "^7.7.1",
214
214
  "eslint-plugin-oxlint": "^1.62.0",
215
215
  "js-yaml": "^4.1.1",
216
216
  "oxlint": "^1.62.0",
217
217
  "oxlint-tsgolint": "^0.22.1",
218
- "vite": "^8.0.5"
218
+ "vite": "^8.0.16"
219
219
  },
220
220
  "type": "module"
221
221
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Universal governance: agents, skills, commands, hooks, and rules for all projects.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "AWS CDK-specific Lisa plugin.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-cdk",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "AWS CDK-specific plugin",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Universal governance — agents, skills, commands, hooks, and rules for all projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Expo and React Native-specific skills, agents, rules, and MCP servers.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-expo",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Expo/React Native-specific skills, agents, rules, and MCP servers",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Harper/Fabric-specific Lisa rules for TypeScript component apps.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -16,28 +16,39 @@ the REST/GraphQL surface exposes.
16
16
  ## Defining tables
17
17
 
18
18
  A table is a GraphQL type. Harper-specific directives mark a type as a persisted
19
- table and control exposure, primary keys, and indexes. The exact directive set
20
- depends on the Harper version in use confirm against the live `schema.graphql`
21
- in this project and the Harper schema docs before adding new syntax. Common shape:
19
+ table and control exposure, primary keys, indexes, audit timestamps, sealed
20
+ records, and relationships. Lisa's Harper Fabric template pins `harperdb` to the
21
+ Harper 4 line (`^4.7.29`), so use this v4 directive reference for template
22
+ projects:
22
23
 
23
24
  ```graphql
24
- type Dog @table {
25
- id: ID @primaryKey
25
+ type Dog @table @export(name: "dogs") {
26
+ id: Long @primaryKey
26
27
  name: String @indexed
27
28
  breed: String
28
- owner: String
29
+ ownerId: Long @indexed
30
+ owner: Owner @relationship(from: ownerId)
31
+ createdAt: Long @createdTime
32
+ updatedAt: Long @updatedTime
29
33
  }
30
34
  ```
31
35
 
32
- - `@table` marks the type as a persisted Harper table.
33
- - `@primaryKey` marks the primary key field.
34
- - `@indexed` adds a secondary index for query/`search`.
35
- - Exposure of a type as an API endpoint is controlled by the schema/`rest`
36
- configuration see [[harper-config-yaml]].
37
-
38
- > Treat the directive names above as a starting point, not gospel verify against
39
- > the project's existing schema and current Harper docs, since directive syntax has
40
- > evolved across versions.
36
+ | Directive | Scope | Syntax | Use |
37
+ | --- | --- | --- | --- |
38
+ | `@table` | Type | `type Product @table { ... }` | Creates a persisted table named after the type. Optional arguments: `table: "products"` to override the table name, `database: "commerce"` to choose a database, `expiration: 3600` for TTL-style records, and `audit: true` to force audit logging. |
39
+ | `@export` | Type | `type Product @table @export(name: "products") { ... }` | Exposes the table as a resource endpoint for REST/MQTT and related surfaces. `name` is optional; without it the type name is the path segment. |
40
+ | `@sealed` | Type | `type Product @table @sealed { ... }` | Rejects undeclared properties. Omit it when the table intentionally accepts extra record fields. |
41
+ | `@primaryKey` | Field | `id: Long @primaryKey` | Marks the unique table key. If omitted on insert, Harper v4 can auto-generate a UUID for `String`/`ID` keys or an auto-incrementing integer for `Int`/`Long`/`Any` keys. Prefer `Long` or `Any` for generated numeric keys. |
42
+ | `@indexed` | Field | `sku: String @indexed` | Adds a secondary index used by REST filters, SQL, and NoSQL/search paths. Array fields index each element. For vectors in Harper v4.6+, use `embedding: [Float] @indexed(type: "HNSW")`. |
43
+ | `@createdTime` | Field | `createdAt: Long @createdTime` | Writes Unix epoch milliseconds when the record is created. |
44
+ | `@updatedTime` | Field | `updatedAt: Long @updatedTime` | Writes Unix epoch milliseconds whenever the record is updated. |
45
+ | `@relationship(from: field)` | Field | `owner: Owner @relationship(from: ownerId)` | The foreign key is on this table and references the target table primary key. If the foreign key field is an array, the relationship is many-to-many. |
46
+ | `@relationship(to: field)` | Field | `dogs: [Dog] @relationship(to: ownerId)` | The foreign key is on the target table. The relationship field must be an array. |
47
+ | `@relationship(from: field, to: field)` | Field | `product: Product @relationship(from: productSku, to: sku)` | Joins this table's field to a non-primary-key field on the target table. Index both join fields. |
48
+
49
+ Use v5 docs only when the downstream project has intentionally moved off the Lisa
50
+ template's Harper 4 dependency; do not mix v5-only syntax into a `harperdb`
51
+ `^4.7.29` project.
41
52
 
42
53
  ## How the schema drives the app
43
54
 
@@ -48,6 +59,45 @@ type Dog @table {
48
59
  or removal in the schema is a breaking change for every resource and verify path
49
60
  that references it.
50
61
 
62
+ ## Schema evolution
63
+
64
+ Schema changes are deploy-time data-model changes, not just type edits. Harper's
65
+ `graphqlSchema` extension ensures declared tables and attributes exist when the
66
+ component loads, but it does not perform semantic data migrations such as
67
+ renaming tables, copying field values, or rewriting existing rows for you.
68
+
69
+ Classify each change before editing:
70
+
71
+ | Change | Compatibility | What Harper does | Required agent work |
72
+ | --- | --- | --- | --- |
73
+ | Add optional field | Usually safe | Adds the declared attribute shape; existing rows read as missing/`null` until written. | Update resources, seeds, and verification that should include the field. |
74
+ | Add required/non-null field | Breaking for existing rows and writers | The schema can declare the field, but existing records do not magically gain valid values. | Backfill first or deploy as optional, populate, then tighten in a later deploy. |
75
+ | Add `@indexed` | Usually safe, operationally sensitive | Creates/uses a secondary index for the attribute. Large tables may pay rebuild cost. | Verify filtered REST/search paths and note index build risk in the deploy runbook. |
76
+ | Add `@sealed` | Breaking when rows or writers use extra properties | Future writes with undeclared properties are rejected. | Audit current data/writers, declare needed fields, or migrate callers before sealing. |
77
+ | Rename field | Breaking | Treated as a new field; the old field and its values are not transformed. | Add the new field, copy values with a migration, update code, verify, then remove old usage. |
78
+ | Rename type/table | Breaking | Harper v4 does not rename tables; changing the type name creates a new empty table and leaves the old table/data untouched. | Create the new table, copy data, update resources/routes, verify both read/write paths, then retire the old table intentionally. |
79
+ | Change field type | Breaking | Existing stored values are not coerced into the new type in a controlled migration. | Add a replacement field/table, transform data with code, verify, then remove old usage. |
80
+ | Remove field/type | Breaking | Schema no longer declares it, but dependent resources, routes, queries, seeds, and clients can still reference it. | Delete references first, run a migration/cleanup if needed, and verify old API paths fail or redirect intentionally. |
81
+
82
+ Migration recipe for production data:
83
+
84
+ 1. Add the new schema shape in a backward-compatible way: new table or nullable
85
+ replacement field, keeping the old field/table available.
86
+ 2. Write a one-shot migration using a Harper resource method or Operations
87
+ API/script that reads old rows, transforms values, and writes the new shape.
88
+ Make it idempotent; reruns should skip rows already migrated or compare a
89
+ migration marker.
90
+ 3. Deploy to one Fabric environment and run the migration before switching
91
+ readers/writers. For replicated Fabric deployments, assume every node may see
92
+ the new code/schema at slightly different times; keep old and new reads
93
+ compatible until replication and smoke checks are green.
94
+ 4. Update resources, REST/GraphQL queries, data-loader seeds, and verify scripts
95
+ in the same PR. A schema PR is incomplete if `bun run verify` or the project
96
+ smoke path cannot prove the migrated read/write behavior.
97
+ 5. Roll back by reverting code/schema only when the old field/table remains
98
+ intact. Once cleanup drops old data or callers, rollback needs a reverse
99
+ migration and a restored compatibility path.
100
+
51
101
  ## Project conventions
52
102
 
53
103
  - `schema.graphql` is **source** and lives at the component root that Fabric
@@ -68,5 +118,6 @@ Run any verify path that asserts row counts or joins against the changed model.
68
118
 
69
119
  ## Sources
70
120
 
71
- - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
72
- - [Applications](https://docs.harperdb.io/docs/developers/applications)
121
+ - [Harper v4 Schema](https://docs.harperdb.io/reference/v4/database/schema)
122
+ - [Components overview](https://docs.harperdb.io/reference/v4/components/overview)
123
+ - [Operations API](https://docs.harperdb.io/reference/v4/operations-api/operations)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -16,28 +16,39 @@ the REST/GraphQL surface exposes.
16
16
  ## Defining tables
17
17
 
18
18
  A table is a GraphQL type. Harper-specific directives mark a type as a persisted
19
- table and control exposure, primary keys, and indexes. The exact directive set
20
- depends on the Harper version in use confirm against the live `schema.graphql`
21
- in this project and the Harper schema docs before adding new syntax. Common shape:
19
+ table and control exposure, primary keys, indexes, audit timestamps, sealed
20
+ records, and relationships. Lisa's Harper Fabric template pins `harperdb` to the
21
+ Harper 4 line (`^4.7.29`), so use this v4 directive reference for template
22
+ projects:
22
23
 
23
24
  ```graphql
24
- type Dog @table {
25
- id: ID @primaryKey
25
+ type Dog @table @export(name: "dogs") {
26
+ id: Long @primaryKey
26
27
  name: String @indexed
27
28
  breed: String
28
- owner: String
29
+ ownerId: Long @indexed
30
+ owner: Owner @relationship(from: ownerId)
31
+ createdAt: Long @createdTime
32
+ updatedAt: Long @updatedTime
29
33
  }
30
34
  ```
31
35
 
32
- - `@table` marks the type as a persisted Harper table.
33
- - `@primaryKey` marks the primary key field.
34
- - `@indexed` adds a secondary index for query/`search`.
35
- - Exposure of a type as an API endpoint is controlled by the schema/`rest`
36
- configuration see [[harper-config-yaml]].
37
-
38
- > Treat the directive names above as a starting point, not gospel verify against
39
- > the project's existing schema and current Harper docs, since directive syntax has
40
- > evolved across versions.
36
+ | Directive | Scope | Syntax | Use |
37
+ | --- | --- | --- | --- |
38
+ | `@table` | Type | `type Product @table { ... }` | Creates a persisted table named after the type. Optional arguments: `table: "products"` to override the table name, `database: "commerce"` to choose a database, `expiration: 3600` for TTL-style records, and `audit: true` to force audit logging. |
39
+ | `@export` | Type | `type Product @table @export(name: "products") { ... }` | Exposes the table as a resource endpoint for REST/MQTT and related surfaces. `name` is optional; without it the type name is the path segment. |
40
+ | `@sealed` | Type | `type Product @table @sealed { ... }` | Rejects undeclared properties. Omit it when the table intentionally accepts extra record fields. |
41
+ | `@primaryKey` | Field | `id: Long @primaryKey` | Marks the unique table key. If omitted on insert, Harper v4 can auto-generate a UUID for `String`/`ID` keys or an auto-incrementing integer for `Int`/`Long`/`Any` keys. Prefer `Long` or `Any` for generated numeric keys. |
42
+ | `@indexed` | Field | `sku: String @indexed` | Adds a secondary index used by REST filters, SQL, and NoSQL/search paths. Array fields index each element. For vectors in Harper v4.6+, use `embedding: [Float] @indexed(type: "HNSW")`. |
43
+ | `@createdTime` | Field | `createdAt: Long @createdTime` | Writes Unix epoch milliseconds when the record is created. |
44
+ | `@updatedTime` | Field | `updatedAt: Long @updatedTime` | Writes Unix epoch milliseconds whenever the record is updated. |
45
+ | `@relationship(from: field)` | Field | `owner: Owner @relationship(from: ownerId)` | The foreign key is on this table and references the target table primary key. If the foreign key field is an array, the relationship is many-to-many. |
46
+ | `@relationship(to: field)` | Field | `dogs: [Dog] @relationship(to: ownerId)` | The foreign key is on the target table. The relationship field must be an array. |
47
+ | `@relationship(from: field, to: field)` | Field | `product: Product @relationship(from: productSku, to: sku)` | Joins this table's field to a non-primary-key field on the target table. Index both join fields. |
48
+
49
+ Use v5 docs only when the downstream project has intentionally moved off the Lisa
50
+ template's Harper 4 dependency; do not mix v5-only syntax into a `harperdb`
51
+ `^4.7.29` project.
41
52
 
42
53
  ## How the schema drives the app
43
54
 
@@ -48,6 +59,45 @@ type Dog @table {
48
59
  or removal in the schema is a breaking change for every resource and verify path
49
60
  that references it.
50
61
 
62
+ ## Schema evolution
63
+
64
+ Schema changes are deploy-time data-model changes, not just type edits. Harper's
65
+ `graphqlSchema` extension ensures declared tables and attributes exist when the
66
+ component loads, but it does not perform semantic data migrations such as
67
+ renaming tables, copying field values, or rewriting existing rows for you.
68
+
69
+ Classify each change before editing:
70
+
71
+ | Change | Compatibility | What Harper does | Required agent work |
72
+ | --- | --- | --- | --- |
73
+ | Add optional field | Usually safe | Adds the declared attribute shape; existing rows read as missing/`null` until written. | Update resources, seeds, and verification that should include the field. |
74
+ | Add required/non-null field | Breaking for existing rows and writers | The schema can declare the field, but existing records do not magically gain valid values. | Backfill first or deploy as optional, populate, then tighten in a later deploy. |
75
+ | Add `@indexed` | Usually safe, operationally sensitive | Creates/uses a secondary index for the attribute. Large tables may pay rebuild cost. | Verify filtered REST/search paths and note index build risk in the deploy runbook. |
76
+ | Add `@sealed` | Breaking when rows or writers use extra properties | Future writes with undeclared properties are rejected. | Audit current data/writers, declare needed fields, or migrate callers before sealing. |
77
+ | Rename field | Breaking | Treated as a new field; the old field and its values are not transformed. | Add the new field, copy values with a migration, update code, verify, then remove old usage. |
78
+ | Rename type/table | Breaking | Harper v4 does not rename tables; changing the type name creates a new empty table and leaves the old table/data untouched. | Create the new table, copy data, update resources/routes, verify both read/write paths, then retire the old table intentionally. |
79
+ | Change field type | Breaking | Existing stored values are not coerced into the new type in a controlled migration. | Add a replacement field/table, transform data with code, verify, then remove old usage. |
80
+ | Remove field/type | Breaking | Schema no longer declares it, but dependent resources, routes, queries, seeds, and clients can still reference it. | Delete references first, run a migration/cleanup if needed, and verify old API paths fail or redirect intentionally. |
81
+
82
+ Migration recipe for production data:
83
+
84
+ 1. Add the new schema shape in a backward-compatible way: new table or nullable
85
+ replacement field, keeping the old field/table available.
86
+ 2. Write a one-shot migration using a Harper resource method or Operations
87
+ API/script that reads old rows, transforms values, and writes the new shape.
88
+ Make it idempotent; reruns should skip rows already migrated or compare a
89
+ migration marker.
90
+ 3. Deploy to one Fabric environment and run the migration before switching
91
+ readers/writers. For replicated Fabric deployments, assume every node may see
92
+ the new code/schema at slightly different times; keep old and new reads
93
+ compatible until replication and smoke checks are green.
94
+ 4. Update resources, REST/GraphQL queries, data-loader seeds, and verify scripts
95
+ in the same PR. A schema PR is incomplete if `bun run verify` or the project
96
+ smoke path cannot prove the migrated read/write behavior.
97
+ 5. Roll back by reverting code/schema only when the old field/table remains
98
+ intact. Once cleanup drops old data or callers, rollback needs a reverse
99
+ migration and a restored compatibility path.
100
+
51
101
  ## Project conventions
52
102
 
53
103
  - `schema.graphql` is **source** and lives at the component root that Fabric
@@ -68,5 +118,6 @@ Run any verify path that asserts row counts or joins against the changed model.
68
118
 
69
119
  ## Sources
70
120
 
71
- - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
72
- - [Applications](https://docs.harperdb.io/docs/developers/applications)
121
+ - [Harper v4 Schema](https://docs.harperdb.io/reference/v4/database/schema)
122
+ - [Components overview](https://docs.harperdb.io/reference/v4/components/overview)
123
+ - [Operations API](https://docs.harperdb.io/reference/v4/operations-api/operations)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -16,28 +16,39 @@ the REST/GraphQL surface exposes.
16
16
  ## Defining tables
17
17
 
18
18
  A table is a GraphQL type. Harper-specific directives mark a type as a persisted
19
- table and control exposure, primary keys, and indexes. The exact directive set
20
- depends on the Harper version in use confirm against the live `schema.graphql`
21
- in this project and the Harper schema docs before adding new syntax. Common shape:
19
+ table and control exposure, primary keys, indexes, audit timestamps, sealed
20
+ records, and relationships. Lisa's Harper Fabric template pins `harperdb` to the
21
+ Harper 4 line (`^4.7.29`), so use this v4 directive reference for template
22
+ projects:
22
23
 
23
24
  ```graphql
24
- type Dog @table {
25
- id: ID @primaryKey
25
+ type Dog @table @export(name: "dogs") {
26
+ id: Long @primaryKey
26
27
  name: String @indexed
27
28
  breed: String
28
- owner: String
29
+ ownerId: Long @indexed
30
+ owner: Owner @relationship(from: ownerId)
31
+ createdAt: Long @createdTime
32
+ updatedAt: Long @updatedTime
29
33
  }
30
34
  ```
31
35
 
32
- - `@table` marks the type as a persisted Harper table.
33
- - `@primaryKey` marks the primary key field.
34
- - `@indexed` adds a secondary index for query/`search`.
35
- - Exposure of a type as an API endpoint is controlled by the schema/`rest`
36
- configuration see [[harper-config-yaml]].
37
-
38
- > Treat the directive names above as a starting point, not gospel verify against
39
- > the project's existing schema and current Harper docs, since directive syntax has
40
- > evolved across versions.
36
+ | Directive | Scope | Syntax | Use |
37
+ | --- | --- | --- | --- |
38
+ | `@table` | Type | `type Product @table { ... }` | Creates a persisted table named after the type. Optional arguments: `table: "products"` to override the table name, `database: "commerce"` to choose a database, `expiration: 3600` for TTL-style records, and `audit: true` to force audit logging. |
39
+ | `@export` | Type | `type Product @table @export(name: "products") { ... }` | Exposes the table as a resource endpoint for REST/MQTT and related surfaces. `name` is optional; without it the type name is the path segment. |
40
+ | `@sealed` | Type | `type Product @table @sealed { ... }` | Rejects undeclared properties. Omit it when the table intentionally accepts extra record fields. |
41
+ | `@primaryKey` | Field | `id: Long @primaryKey` | Marks the unique table key. If omitted on insert, Harper v4 can auto-generate a UUID for `String`/`ID` keys or an auto-incrementing integer for `Int`/`Long`/`Any` keys. Prefer `Long` or `Any` for generated numeric keys. |
42
+ | `@indexed` | Field | `sku: String @indexed` | Adds a secondary index used by REST filters, SQL, and NoSQL/search paths. Array fields index each element. For vectors in Harper v4.6+, use `embedding: [Float] @indexed(type: "HNSW")`. |
43
+ | `@createdTime` | Field | `createdAt: Long @createdTime` | Writes Unix epoch milliseconds when the record is created. |
44
+ | `@updatedTime` | Field | `updatedAt: Long @updatedTime` | Writes Unix epoch milliseconds whenever the record is updated. |
45
+ | `@relationship(from: field)` | Field | `owner: Owner @relationship(from: ownerId)` | The foreign key is on this table and references the target table primary key. If the foreign key field is an array, the relationship is many-to-many. |
46
+ | `@relationship(to: field)` | Field | `dogs: [Dog] @relationship(to: ownerId)` | The foreign key is on the target table. The relationship field must be an array. |
47
+ | `@relationship(from: field, to: field)` | Field | `product: Product @relationship(from: productSku, to: sku)` | Joins this table's field to a non-primary-key field on the target table. Index both join fields. |
48
+
49
+ Use v5 docs only when the downstream project has intentionally moved off the Lisa
50
+ template's Harper 4 dependency; do not mix v5-only syntax into a `harperdb`
51
+ `^4.7.29` project.
41
52
 
42
53
  ## How the schema drives the app
43
54
 
@@ -48,6 +59,45 @@ type Dog @table {
48
59
  or removal in the schema is a breaking change for every resource and verify path
49
60
  that references it.
50
61
 
62
+ ## Schema evolution
63
+
64
+ Schema changes are deploy-time data-model changes, not just type edits. Harper's
65
+ `graphqlSchema` extension ensures declared tables and attributes exist when the
66
+ component loads, but it does not perform semantic data migrations such as
67
+ renaming tables, copying field values, or rewriting existing rows for you.
68
+
69
+ Classify each change before editing:
70
+
71
+ | Change | Compatibility | What Harper does | Required agent work |
72
+ | --- | --- | --- | --- |
73
+ | Add optional field | Usually safe | Adds the declared attribute shape; existing rows read as missing/`null` until written. | Update resources, seeds, and verification that should include the field. |
74
+ | Add required/non-null field | Breaking for existing rows and writers | The schema can declare the field, but existing records do not magically gain valid values. | Backfill first or deploy as optional, populate, then tighten in a later deploy. |
75
+ | Add `@indexed` | Usually safe, operationally sensitive | Creates/uses a secondary index for the attribute. Large tables may pay rebuild cost. | Verify filtered REST/search paths and note index build risk in the deploy runbook. |
76
+ | Add `@sealed` | Breaking when rows or writers use extra properties | Future writes with undeclared properties are rejected. | Audit current data/writers, declare needed fields, or migrate callers before sealing. |
77
+ | Rename field | Breaking | Treated as a new field; the old field and its values are not transformed. | Add the new field, copy values with a migration, update code, verify, then remove old usage. |
78
+ | Rename type/table | Breaking | Harper v4 does not rename tables; changing the type name creates a new empty table and leaves the old table/data untouched. | Create the new table, copy data, update resources/routes, verify both read/write paths, then retire the old table intentionally. |
79
+ | Change field type | Breaking | Existing stored values are not coerced into the new type in a controlled migration. | Add a replacement field/table, transform data with code, verify, then remove old usage. |
80
+ | Remove field/type | Breaking | Schema no longer declares it, but dependent resources, routes, queries, seeds, and clients can still reference it. | Delete references first, run a migration/cleanup if needed, and verify old API paths fail or redirect intentionally. |
81
+
82
+ Migration recipe for production data:
83
+
84
+ 1. Add the new schema shape in a backward-compatible way: new table or nullable
85
+ replacement field, keeping the old field/table available.
86
+ 2. Write a one-shot migration using a Harper resource method or Operations
87
+ API/script that reads old rows, transforms values, and writes the new shape.
88
+ Make it idempotent; reruns should skip rows already migrated or compare a
89
+ migration marker.
90
+ 3. Deploy to one Fabric environment and run the migration before switching
91
+ readers/writers. For replicated Fabric deployments, assume every node may see
92
+ the new code/schema at slightly different times; keep old and new reads
93
+ compatible until replication and smoke checks are green.
94
+ 4. Update resources, REST/GraphQL queries, data-loader seeds, and verify scripts
95
+ in the same PR. A schema PR is incomplete if `bun run verify` or the project
96
+ smoke path cannot prove the migrated read/write behavior.
97
+ 5. Roll back by reverting code/schema only when the old field/table remains
98
+ intact. Once cleanup drops old data or callers, rollback needs a reverse
99
+ migration and a restored compatibility path.
100
+
51
101
  ## Project conventions
52
102
 
53
103
  - `schema.graphql` is **source** and lives at the component root that Fabric
@@ -68,5 +118,6 @@ Run any verify path that asserts row counts or joins against the changed model.
68
118
 
69
119
  ## Sources
70
120
 
71
- - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
72
- - [Applications](https://docs.harperdb.io/docs/developers/applications)
121
+ - [Harper v4 Schema](https://docs.harperdb.io/reference/v4/database/schema)
122
+ - [Components overview](https://docs.harperdb.io/reference/v4/components/overview)
123
+ - [Operations API](https://docs.harperdb.io/reference/v4/operations-api/operations)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-harper-fabric",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Harper/Fabric-specific rules for TypeScript component apps",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -16,28 +16,39 @@ the REST/GraphQL surface exposes.
16
16
  ## Defining tables
17
17
 
18
18
  A table is a GraphQL type. Harper-specific directives mark a type as a persisted
19
- table and control exposure, primary keys, and indexes. The exact directive set
20
- depends on the Harper version in use confirm against the live `schema.graphql`
21
- in this project and the Harper schema docs before adding new syntax. Common shape:
19
+ table and control exposure, primary keys, indexes, audit timestamps, sealed
20
+ records, and relationships. Lisa's Harper Fabric template pins `harperdb` to the
21
+ Harper 4 line (`^4.7.29`), so use this v4 directive reference for template
22
+ projects:
22
23
 
23
24
  ```graphql
24
- type Dog @table {
25
- id: ID @primaryKey
25
+ type Dog @table @export(name: "dogs") {
26
+ id: Long @primaryKey
26
27
  name: String @indexed
27
28
  breed: String
28
- owner: String
29
+ ownerId: Long @indexed
30
+ owner: Owner @relationship(from: ownerId)
31
+ createdAt: Long @createdTime
32
+ updatedAt: Long @updatedTime
29
33
  }
30
34
  ```
31
35
 
32
- - `@table` marks the type as a persisted Harper table.
33
- - `@primaryKey` marks the primary key field.
34
- - `@indexed` adds a secondary index for query/`search`.
35
- - Exposure of a type as an API endpoint is controlled by the schema/`rest`
36
- configuration see [[harper-config-yaml]].
37
-
38
- > Treat the directive names above as a starting point, not gospel verify against
39
- > the project's existing schema and current Harper docs, since directive syntax has
40
- > evolved across versions.
36
+ | Directive | Scope | Syntax | Use |
37
+ | --- | --- | --- | --- |
38
+ | `@table` | Type | `type Product @table { ... }` | Creates a persisted table named after the type. Optional arguments: `table: "products"` to override the table name, `database: "commerce"` to choose a database, `expiration: 3600` for TTL-style records, and `audit: true` to force audit logging. |
39
+ | `@export` | Type | `type Product @table @export(name: "products") { ... }` | Exposes the table as a resource endpoint for REST/MQTT and related surfaces. `name` is optional; without it the type name is the path segment. |
40
+ | `@sealed` | Type | `type Product @table @sealed { ... }` | Rejects undeclared properties. Omit it when the table intentionally accepts extra record fields. |
41
+ | `@primaryKey` | Field | `id: Long @primaryKey` | Marks the unique table key. If omitted on insert, Harper v4 can auto-generate a UUID for `String`/`ID` keys or an auto-incrementing integer for `Int`/`Long`/`Any` keys. Prefer `Long` or `Any` for generated numeric keys. |
42
+ | `@indexed` | Field | `sku: String @indexed` | Adds a secondary index used by REST filters, SQL, and NoSQL/search paths. Array fields index each element. For vectors in Harper v4.6+, use `embedding: [Float] @indexed(type: "HNSW")`. |
43
+ | `@createdTime` | Field | `createdAt: Long @createdTime` | Writes Unix epoch milliseconds when the record is created. |
44
+ | `@updatedTime` | Field | `updatedAt: Long @updatedTime` | Writes Unix epoch milliseconds whenever the record is updated. |
45
+ | `@relationship(from: field)` | Field | `owner: Owner @relationship(from: ownerId)` | The foreign key is on this table and references the target table primary key. If the foreign key field is an array, the relationship is many-to-many. |
46
+ | `@relationship(to: field)` | Field | `dogs: [Dog] @relationship(to: ownerId)` | The foreign key is on the target table. The relationship field must be an array. |
47
+ | `@relationship(from: field, to: field)` | Field | `product: Product @relationship(from: productSku, to: sku)` | Joins this table's field to a non-primary-key field on the target table. Index both join fields. |
48
+
49
+ Use v5 docs only when the downstream project has intentionally moved off the Lisa
50
+ template's Harper 4 dependency; do not mix v5-only syntax into a `harperdb`
51
+ `^4.7.29` project.
41
52
 
42
53
  ## How the schema drives the app
43
54
 
@@ -48,6 +59,45 @@ type Dog @table {
48
59
  or removal in the schema is a breaking change for every resource and verify path
49
60
  that references it.
50
61
 
62
+ ## Schema evolution
63
+
64
+ Schema changes are deploy-time data-model changes, not just type edits. Harper's
65
+ `graphqlSchema` extension ensures declared tables and attributes exist when the
66
+ component loads, but it does not perform semantic data migrations such as
67
+ renaming tables, copying field values, or rewriting existing rows for you.
68
+
69
+ Classify each change before editing:
70
+
71
+ | Change | Compatibility | What Harper does | Required agent work |
72
+ | --- | --- | --- | --- |
73
+ | Add optional field | Usually safe | Adds the declared attribute shape; existing rows read as missing/`null` until written. | Update resources, seeds, and verification that should include the field. |
74
+ | Add required/non-null field | Breaking for existing rows and writers | The schema can declare the field, but existing records do not magically gain valid values. | Backfill first or deploy as optional, populate, then tighten in a later deploy. |
75
+ | Add `@indexed` | Usually safe, operationally sensitive | Creates/uses a secondary index for the attribute. Large tables may pay rebuild cost. | Verify filtered REST/search paths and note index build risk in the deploy runbook. |
76
+ | Add `@sealed` | Breaking when rows or writers use extra properties | Future writes with undeclared properties are rejected. | Audit current data/writers, declare needed fields, or migrate callers before sealing. |
77
+ | Rename field | Breaking | Treated as a new field; the old field and its values are not transformed. | Add the new field, copy values with a migration, update code, verify, then remove old usage. |
78
+ | Rename type/table | Breaking | Harper v4 does not rename tables; changing the type name creates a new empty table and leaves the old table/data untouched. | Create the new table, copy data, update resources/routes, verify both read/write paths, then retire the old table intentionally. |
79
+ | Change field type | Breaking | Existing stored values are not coerced into the new type in a controlled migration. | Add a replacement field/table, transform data with code, verify, then remove old usage. |
80
+ | Remove field/type | Breaking | Schema no longer declares it, but dependent resources, routes, queries, seeds, and clients can still reference it. | Delete references first, run a migration/cleanup if needed, and verify old API paths fail or redirect intentionally. |
81
+
82
+ Migration recipe for production data:
83
+
84
+ 1. Add the new schema shape in a backward-compatible way: new table or nullable
85
+ replacement field, keeping the old field/table available.
86
+ 2. Write a one-shot migration using a Harper resource method or Operations
87
+ API/script that reads old rows, transforms values, and writes the new shape.
88
+ Make it idempotent; reruns should skip rows already migrated or compare a
89
+ migration marker.
90
+ 3. Deploy to one Fabric environment and run the migration before switching
91
+ readers/writers. For replicated Fabric deployments, assume every node may see
92
+ the new code/schema at slightly different times; keep old and new reads
93
+ compatible until replication and smoke checks are green.
94
+ 4. Update resources, REST/GraphQL queries, data-loader seeds, and verify scripts
95
+ in the same PR. A schema PR is incomplete if `bun run verify` or the project
96
+ smoke path cannot prove the migrated read/write behavior.
97
+ 5. Roll back by reverting code/schema only when the old field/table remains
98
+ intact. Once cleanup drops old data or callers, rollback needs a reverse
99
+ migration and a restored compatibility path.
100
+
51
101
  ## Project conventions
52
102
 
53
103
  - `schema.graphql` is **source** and lives at the component root that Fabric
@@ -68,5 +118,6 @@ Run any verify path that asserts row counts or joins against the changed model.
68
118
 
69
119
  ## Sources
70
120
 
71
- - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
72
- - [Applications](https://docs.harperdb.io/docs/developers/applications)
121
+ - [Harper v4 Schema](https://docs.harperdb.io/reference/v4/database/schema)
122
+ - [Components overview](https://docs.harperdb.io/reference/v4/components/overview)
123
+ - [Operations API](https://docs.harperdb.io/reference/v4/operations-api/operations)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "NestJS-specific skills and migration write-protection hooks.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-nestjs",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "NestJS-specific skills (GraphQL, TypeORM) and hooks (migration write-protection)",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-openclaw",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Connect staff roles to Telegram or Slack via OpenClaw — facilitator/specialist hub-and-spoke routing and repo-coding topics, for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-phaser",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Phaser 4 game-development rules for TypeScript projects",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Ruby on Rails-specific skills and hooks for RuboCop and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-rails",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Ruby on Rails-specific hooks — RuboCop linting/formatting and ast-grep scanning on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "TypeScript-specific hooks for formatting, linting, and ast-grep scanning on edit.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-typescript",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "TypeScript-specific hooks — Prettier formatting, ESLint linting, ast-grep scanning, and error-suppression blocking on edit",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "Distributable LLM Wiki kernel — ingest, query, lint, and maintain a git-native markdown knowledge base across Claude and Codex.",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lisa-wiki",
3
- "version": "2.166.4",
3
+ "version": "2.166.5",
4
4
  "description": "LLM Wiki — a distributable, git-native markdown knowledge base for Claude Code and Codex",
5
5
  "author": {
6
6
  "name": "Cody Swann"
@@ -16,28 +16,39 @@ the REST/GraphQL surface exposes.
16
16
  ## Defining tables
17
17
 
18
18
  A table is a GraphQL type. Harper-specific directives mark a type as a persisted
19
- table and control exposure, primary keys, and indexes. The exact directive set
20
- depends on the Harper version in use confirm against the live `schema.graphql`
21
- in this project and the Harper schema docs before adding new syntax. Common shape:
19
+ table and control exposure, primary keys, indexes, audit timestamps, sealed
20
+ records, and relationships. Lisa's Harper Fabric template pins `harperdb` to the
21
+ Harper 4 line (`^4.7.29`), so use this v4 directive reference for template
22
+ projects:
22
23
 
23
24
  ```graphql
24
- type Dog @table {
25
- id: ID @primaryKey
25
+ type Dog @table @export(name: "dogs") {
26
+ id: Long @primaryKey
26
27
  name: String @indexed
27
28
  breed: String
28
- owner: String
29
+ ownerId: Long @indexed
30
+ owner: Owner @relationship(from: ownerId)
31
+ createdAt: Long @createdTime
32
+ updatedAt: Long @updatedTime
29
33
  }
30
34
  ```
31
35
 
32
- - `@table` marks the type as a persisted Harper table.
33
- - `@primaryKey` marks the primary key field.
34
- - `@indexed` adds a secondary index for query/`search`.
35
- - Exposure of a type as an API endpoint is controlled by the schema/`rest`
36
- configuration see [[harper-config-yaml]].
37
-
38
- > Treat the directive names above as a starting point, not gospel verify against
39
- > the project's existing schema and current Harper docs, since directive syntax has
40
- > evolved across versions.
36
+ | Directive | Scope | Syntax | Use |
37
+ | --- | --- | --- | --- |
38
+ | `@table` | Type | `type Product @table { ... }` | Creates a persisted table named after the type. Optional arguments: `table: "products"` to override the table name, `database: "commerce"` to choose a database, `expiration: 3600` for TTL-style records, and `audit: true` to force audit logging. |
39
+ | `@export` | Type | `type Product @table @export(name: "products") { ... }` | Exposes the table as a resource endpoint for REST/MQTT and related surfaces. `name` is optional; without it the type name is the path segment. |
40
+ | `@sealed` | Type | `type Product @table @sealed { ... }` | Rejects undeclared properties. Omit it when the table intentionally accepts extra record fields. |
41
+ | `@primaryKey` | Field | `id: Long @primaryKey` | Marks the unique table key. If omitted on insert, Harper v4 can auto-generate a UUID for `String`/`ID` keys or an auto-incrementing integer for `Int`/`Long`/`Any` keys. Prefer `Long` or `Any` for generated numeric keys. |
42
+ | `@indexed` | Field | `sku: String @indexed` | Adds a secondary index used by REST filters, SQL, and NoSQL/search paths. Array fields index each element. For vectors in Harper v4.6+, use `embedding: [Float] @indexed(type: "HNSW")`. |
43
+ | `@createdTime` | Field | `createdAt: Long @createdTime` | Writes Unix epoch milliseconds when the record is created. |
44
+ | `@updatedTime` | Field | `updatedAt: Long @updatedTime` | Writes Unix epoch milliseconds whenever the record is updated. |
45
+ | `@relationship(from: field)` | Field | `owner: Owner @relationship(from: ownerId)` | The foreign key is on this table and references the target table primary key. If the foreign key field is an array, the relationship is many-to-many. |
46
+ | `@relationship(to: field)` | Field | `dogs: [Dog] @relationship(to: ownerId)` | The foreign key is on the target table. The relationship field must be an array. |
47
+ | `@relationship(from: field, to: field)` | Field | `product: Product @relationship(from: productSku, to: sku)` | Joins this table's field to a non-primary-key field on the target table. Index both join fields. |
48
+
49
+ Use v5 docs only when the downstream project has intentionally moved off the Lisa
50
+ template's Harper 4 dependency; do not mix v5-only syntax into a `harperdb`
51
+ `^4.7.29` project.
41
52
 
42
53
  ## How the schema drives the app
43
54
 
@@ -48,6 +59,45 @@ type Dog @table {
48
59
  or removal in the schema is a breaking change for every resource and verify path
49
60
  that references it.
50
61
 
62
+ ## Schema evolution
63
+
64
+ Schema changes are deploy-time data-model changes, not just type edits. Harper's
65
+ `graphqlSchema` extension ensures declared tables and attributes exist when the
66
+ component loads, but it does not perform semantic data migrations such as
67
+ renaming tables, copying field values, or rewriting existing rows for you.
68
+
69
+ Classify each change before editing:
70
+
71
+ | Change | Compatibility | What Harper does | Required agent work |
72
+ | --- | --- | --- | --- |
73
+ | Add optional field | Usually safe | Adds the declared attribute shape; existing rows read as missing/`null` until written. | Update resources, seeds, and verification that should include the field. |
74
+ | Add required/non-null field | Breaking for existing rows and writers | The schema can declare the field, but existing records do not magically gain valid values. | Backfill first or deploy as optional, populate, then tighten in a later deploy. |
75
+ | Add `@indexed` | Usually safe, operationally sensitive | Creates/uses a secondary index for the attribute. Large tables may pay rebuild cost. | Verify filtered REST/search paths and note index build risk in the deploy runbook. |
76
+ | Add `@sealed` | Breaking when rows or writers use extra properties | Future writes with undeclared properties are rejected. | Audit current data/writers, declare needed fields, or migrate callers before sealing. |
77
+ | Rename field | Breaking | Treated as a new field; the old field and its values are not transformed. | Add the new field, copy values with a migration, update code, verify, then remove old usage. |
78
+ | Rename type/table | Breaking | Harper v4 does not rename tables; changing the type name creates a new empty table and leaves the old table/data untouched. | Create the new table, copy data, update resources/routes, verify both read/write paths, then retire the old table intentionally. |
79
+ | Change field type | Breaking | Existing stored values are not coerced into the new type in a controlled migration. | Add a replacement field/table, transform data with code, verify, then remove old usage. |
80
+ | Remove field/type | Breaking | Schema no longer declares it, but dependent resources, routes, queries, seeds, and clients can still reference it. | Delete references first, run a migration/cleanup if needed, and verify old API paths fail or redirect intentionally. |
81
+
82
+ Migration recipe for production data:
83
+
84
+ 1. Add the new schema shape in a backward-compatible way: new table or nullable
85
+ replacement field, keeping the old field/table available.
86
+ 2. Write a one-shot migration using a Harper resource method or Operations
87
+ API/script that reads old rows, transforms values, and writes the new shape.
88
+ Make it idempotent; reruns should skip rows already migrated or compare a
89
+ migration marker.
90
+ 3. Deploy to one Fabric environment and run the migration before switching
91
+ readers/writers. For replicated Fabric deployments, assume every node may see
92
+ the new code/schema at slightly different times; keep old and new reads
93
+ compatible until replication and smoke checks are green.
94
+ 4. Update resources, REST/GraphQL queries, data-loader seeds, and verify scripts
95
+ in the same PR. A schema PR is incomplete if `bun run verify` or the project
96
+ smoke path cannot prove the migrated read/write behavior.
97
+ 5. Roll back by reverting code/schema only when the old field/table remains
98
+ intact. Once cleanup drops old data or callers, rollback needs a reverse
99
+ migration and a restored compatibility path.
100
+
51
101
  ## Project conventions
52
102
 
53
103
  - `schema.graphql` is **source** and lives at the component root that Fabric
@@ -68,5 +118,6 @@ Run any verify path that asserts row counts or joins against the changed model.
68
118
 
69
119
  ## Sources
70
120
 
71
- - [Components overview](https://docs.harperdb.io/reference/v5/components/overview)
72
- - [Applications](https://docs.harperdb.io/docs/developers/applications)
121
+ - [Harper v4 Schema](https://docs.harperdb.io/reference/v4/database/schema)
122
+ - [Components overview](https://docs.harperdb.io/reference/v4/components/overview)
123
+ - [Operations API](https://docs.harperdb.io/reference/v4/operations-api/operations)