@codyswann/lisa 2.166.5 → 2.168.0
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.
- package/package.json +1 -1
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-agy/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-agy/plugin.json +1 -1
- package/plugins/lisa-cdk-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-agy/plugin.json +1 -1
- package/plugins/lisa-expo-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric/skills/harper-rest-queries/SKILL.md +366 -0
- package/plugins/lisa-harper-fabric/skills/harper-rest-queries/agents/openai.yaml +4 -0
- package/plugins/lisa-harper-fabric/skills/harper-testing/SKILL.md +254 -0
- package/plugins/lisa-harper-fabric/skills/harper-testing/agents/openai.yaml +4 -0
- package/plugins/lisa-harper-fabric-agy/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-agy/skills/harper-rest-queries/SKILL.md +366 -0
- package/plugins/lisa-harper-fabric-agy/skills/harper-testing/SKILL.md +254 -0
- package/plugins/lisa-harper-fabric-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-copilot/skills/harper-rest-queries/SKILL.md +366 -0
- package/plugins/lisa-harper-fabric-copilot/skills/harper-testing/SKILL.md +254 -0
- package/plugins/lisa-harper-fabric-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-harper-fabric-cursor/skills/harper-rest-queries/SKILL.md +366 -0
- package/plugins/lisa-harper-fabric-cursor/skills/harper-testing/SKILL.md +254 -0
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-agy/plugin.json +1 -1
- package/plugins/lisa-nestjs-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-agy/plugin.json +1 -1
- package/plugins/lisa-openclaw-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-openclaw-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-agy/plugin.json +1 -1
- package/plugins/lisa-phaser-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-phaser-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-agy/plugin.json +1 -1
- package/plugins/lisa-rails-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-agy/plugin.json +1 -1
- package/plugins/lisa-typescript-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki/.codex-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-agy/plugin.json +1 -1
- package/plugins/lisa-wiki-copilot/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-wiki-cursor/.claude-plugin/plugin.json +1 -1
- package/plugins/src/harper-fabric/skills/harper-rest-queries/SKILL.md +366 -0
- package/plugins/src/harper-fabric/skills/harper-testing/SKILL.md +254 -0
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: harper-testing
|
|
3
|
+
description: This skill should be used when adding, repairing, or designing tests for a Harper (HarperDB/Fabric) component app — Vitest unit tests for pure functions and Resource methods, local Harper integration tests that boot/symlink/seed/assert real endpoints, Playwright e2e tests against REST/GraphQL routes, and schema/verify-script coupling. Use it when a Harper app needs its first test suite, endpoint coverage, seed isolation, or a local smoke/verify path. Pairs with harper-build-and-deploy, harper-schema-graphql, and e2e-coverage-gaps.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Harper Testing
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Test Harper apps at the layer that proves the risk:
|
|
11
|
+
|
|
12
|
+
1. **Pure unit tests** for TypeScript helpers and data transforms.
|
|
13
|
+
2. **Resource unit tests** for `Resource` methods with mocked Harper runtime globals.
|
|
14
|
+
3. **Integration tests** against a running local Harper component with real schema,
|
|
15
|
+
resources, seed data, and REST/GraphQL responses.
|
|
16
|
+
4. **Playwright e2e tests** against the same HTTP surface a user or client calls.
|
|
17
|
+
|
|
18
|
+
Harper application source lives in TypeScript under `src/`; deployable
|
|
19
|
+
`harper-app/resources.js`, `harper-app/resource-*.js`, and `harper-app/web/**` are
|
|
20
|
+
generated. Build before integration or e2e tests so the runtime loads the code you
|
|
21
|
+
just changed. See [[harper-build-and-deploy]].
|
|
22
|
+
|
|
23
|
+
## Test pyramid
|
|
24
|
+
|
|
25
|
+
| Layer | Tool | Use when | Avoid |
|
|
26
|
+
| --- | --- | --- | --- |
|
|
27
|
+
| Pure unit | Vitest | Validating transforms, validators, serializers, query builders, and other code with no Harper runtime dependency. | Mocking HTTP or tables for logic that can stay pure. |
|
|
28
|
+
| Resource unit | Vitest | Exercising `get`, `post`, `search`, `patch`, or permission/error logic in a resource class without booting Harper. | Treating mocked tables as proof that `config.yaml`, `schema.graphql`, or REST exposure works. |
|
|
29
|
+
| Integration | Vitest or shell smoke | Proving Harper boots, schema loads, `jsResource` registers code, data seeds, and endpoints respond. | Replacing this with resource mocks after config, schema, or generated artifact changes. |
|
|
30
|
+
| E2E | Playwright | Verifying client-observable REST/GraphQL behavior, auth states, error paths, and browser workflows. | Re-testing every pure branch through the browser. |
|
|
31
|
+
|
|
32
|
+
Use [[e2e-coverage-gaps]] after a suite exists to find missing routes and
|
|
33
|
+
non-happy paths. Use this skill when creating or repairing the test patterns
|
|
34
|
+
themselves.
|
|
35
|
+
|
|
36
|
+
## Pure unit tests
|
|
37
|
+
|
|
38
|
+
Keep business transforms importable without Harper globals:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { describe, expect, it } from 'vitest';
|
|
42
|
+
import { normalizePetName } from '../src/pets/normalize';
|
|
43
|
+
|
|
44
|
+
describe('normalizePetName', () => {
|
|
45
|
+
it('trims and title-cases names', () => {
|
|
46
|
+
expect(normalizePetName(' ada LOVELACE ')).toBe('Ada Lovelace');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If a resource method contains complex transformation logic, extract the pure part
|
|
52
|
+
and test it directly. Leave a thinner resource test for runtime wiring,
|
|
53
|
+
authorization, and persistence behavior.
|
|
54
|
+
|
|
55
|
+
## Resource unit tests
|
|
56
|
+
|
|
57
|
+
Harper injects runtime globals such as `Resource` and `tables` when it loads
|
|
58
|
+
`resources.js`. Unit tests do not get those globals automatically. Test resource
|
|
59
|
+
methods by importing code through a seam that accepts mocks, or by setting the
|
|
60
|
+
minimal globals before importing the resource module.
|
|
61
|
+
|
|
62
|
+
Prefer dependency injection for new code:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
66
|
+
import { createPetsResource } from '../src/resources/pets';
|
|
67
|
+
|
|
68
|
+
describe('PetsResource.get', () => {
|
|
69
|
+
it('adds adoption status from the table record', async () => {
|
|
70
|
+
const table = {
|
|
71
|
+
get: vi.fn(async () => ({ id: 'pet-1', name: 'Mina', adoptedAt: null })),
|
|
72
|
+
};
|
|
73
|
+
const Pets = createPetsResource({ Resource: class {}, table });
|
|
74
|
+
|
|
75
|
+
await expect(Pets.get({ id: 'pet-1' })).resolves.toMatchObject({
|
|
76
|
+
id: 'pet-1',
|
|
77
|
+
name: 'Mina',
|
|
78
|
+
adoptionStatus: 'available',
|
|
79
|
+
});
|
|
80
|
+
expect(table.get).toHaveBeenCalledWith({ id: 'pet-1' });
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
When existing code must extend `tables.X` directly, isolate the runtime globals in
|
|
86
|
+
a test helper and import the module after setup:
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
90
|
+
|
|
91
|
+
describe('Pets resource', () => {
|
|
92
|
+
beforeEach(() => {
|
|
93
|
+
vi.resetModules();
|
|
94
|
+
vi.stubGlobal('Resource', class {});
|
|
95
|
+
vi.stubGlobal('tables', {
|
|
96
|
+
Pets: class {
|
|
97
|
+
static async get(target: { id: string }) {
|
|
98
|
+
return { id: target.id, name: 'Mina' };
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('wraps the runtime table', async () => {
|
|
105
|
+
const { Pets } = await import('../src/resources/pets');
|
|
106
|
+
await expect(Pets.get({ id: 'pet-1' })).resolves.toMatchObject({
|
|
107
|
+
id: 'pet-1',
|
|
108
|
+
name: 'Mina',
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Keep mocks narrow. Mock only the table methods, `Resource` base behavior,
|
|
115
|
+
`server.resources`, or external fetch calls the method actually uses. If the test
|
|
116
|
+
starts recreating Harper's schema, REST routing, or auth behavior, move it to an
|
|
117
|
+
integration test.
|
|
118
|
+
|
|
119
|
+
## Integration tests with local Harper
|
|
120
|
+
|
|
121
|
+
Use integration tests to prove the component runs as Harper will load it:
|
|
122
|
+
|
|
123
|
+
1. Install dependencies and build TypeScript: `bun install --frozen-lockfile`
|
|
124
|
+
when needed, then `bun run build`.
|
|
125
|
+
2. Start a local Harper process against the component, usually
|
|
126
|
+
`harper dev harper-app` for watch mode or `harper run harper-app` for a
|
|
127
|
+
one-shot test process. Use the project's wrapper command when present.
|
|
128
|
+
3. If the test lives outside the app repo, symlink the built component into
|
|
129
|
+
Harper's component directory rather than copying generated artifacts by hand.
|
|
130
|
+
Clean the symlink in teardown.
|
|
131
|
+
4. Seed data through `dataLoader` fixtures when the project owns static fixtures,
|
|
132
|
+
or through REST/Operations API calls when each test needs dynamic setup.
|
|
133
|
+
5. Assert the real REST/GraphQL endpoint and response body.
|
|
134
|
+
6. Stop Harper and remove test data, temp components, and symlinks.
|
|
135
|
+
|
|
136
|
+
Shell smoke tests are acceptable when the project already has that convention.
|
|
137
|
+
Keep them strict: exit non-zero on boot failure, seed failure, missing endpoint,
|
|
138
|
+
wrong status, or wrong response shape.
|
|
139
|
+
|
|
140
|
+
Example integration skeleton:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
#!/usr/bin/env bash
|
|
144
|
+
set -euo pipefail
|
|
145
|
+
|
|
146
|
+
bun run build
|
|
147
|
+
|
|
148
|
+
HARPER_APP_DIR="${PWD}/harper-app"
|
|
149
|
+
HARPER_HOME="${HARPER_HOME:-${PWD}/.harper-test}"
|
|
150
|
+
BASE_URL="${BASE_URL:-http://127.0.0.1:9926}"
|
|
151
|
+
|
|
152
|
+
mkdir -p "$HARPER_HOME/components"
|
|
153
|
+
ln -sfn "$HARPER_APP_DIR" "$HARPER_HOME/components/pets"
|
|
154
|
+
|
|
155
|
+
HARPER_HOME="$HARPER_HOME" harper run "$HARPER_APP_DIR" > /tmp/harper-test.log 2>&1 &
|
|
156
|
+
HARPER_PID=$!
|
|
157
|
+
trap 'kill "$HARPER_PID" 2>/dev/null || true; rm -f "$HARPER_HOME/components/pets"' EXIT
|
|
158
|
+
|
|
159
|
+
for _ in {1..30}; do
|
|
160
|
+
curl -fsS "$BASE_URL/health" >/dev/null && break
|
|
161
|
+
sleep 1
|
|
162
|
+
done
|
|
163
|
+
|
|
164
|
+
curl -fsS -X POST "$BASE_URL/Pets" \
|
|
165
|
+
-H 'content-type: application/json' \
|
|
166
|
+
--data '{"id":"pet-it-1","name":"Mina"}' >/dev/null
|
|
167
|
+
|
|
168
|
+
curl -fsS "$BASE_URL/Pets/pet-it-1" | jq -e '.name == "Mina"'
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Adjust the health path, component name, port, and endpoint names to the project.
|
|
172
|
+
Do not commit local `HARPER_HOME`, logs, generated component copies, or secrets.
|
|
173
|
+
|
|
174
|
+
## Seeding and isolation
|
|
175
|
+
|
|
176
|
+
Use deterministic test data that cannot collide with developer or CI data:
|
|
177
|
+
|
|
178
|
+
- Prefix IDs with the test name and a run ID, for example
|
|
179
|
+
`pet-${process.env.GITHUB_RUN_ID ?? Date.now()}`.
|
|
180
|
+
- Prefer per-test setup/teardown through REST or Operations API when tests mutate
|
|
181
|
+
records.
|
|
182
|
+
- Prefer `dataLoader` fixtures for stable baseline data that every local boot
|
|
183
|
+
should have.
|
|
184
|
+
- Make teardown idempotent; deleting a record that is already gone should not fail
|
|
185
|
+
the suite.
|
|
186
|
+
- Keep seed fixtures aligned with [[harper-schema-graphql]]. A field or type rename
|
|
187
|
+
must update fixtures, resource tests, verify scripts, and Playwright assertions in
|
|
188
|
+
the same PR.
|
|
189
|
+
|
|
190
|
+
`dataLoader` is good for fast, declarative baseline rows. REST seeding is better
|
|
191
|
+
when the test must exercise validation, defaults, auth, or generated IDs exactly as
|
|
192
|
+
clients see them.
|
|
193
|
+
|
|
194
|
+
## Playwright endpoint tests
|
|
195
|
+
|
|
196
|
+
Use Playwright for HTTP behavior that needs browser tooling, request contexts,
|
|
197
|
+
storage state, tracing, or cross-browser/project coverage. A first endpoint spec
|
|
198
|
+
should cover one happy path and one non-happy path:
|
|
199
|
+
|
|
200
|
+
```typescript
|
|
201
|
+
import { expect, test } from '@playwright/test';
|
|
202
|
+
|
|
203
|
+
test.describe('Pets REST endpoint', () => {
|
|
204
|
+
test('creates and reads a pet', async ({ request }) => {
|
|
205
|
+
const id = `pet-pw-${Date.now()}`;
|
|
206
|
+
|
|
207
|
+
const create = await request.post('/Pets', {
|
|
208
|
+
data: { id, name: 'Mina' },
|
|
209
|
+
});
|
|
210
|
+
expect(create.ok()).toBe(true);
|
|
211
|
+
|
|
212
|
+
const read = await request.get(`/Pets/${id}`);
|
|
213
|
+
expect(read.status()).toBe(200);
|
|
214
|
+
await expect(read).toHaveJSON(expect.objectContaining({ id, name: 'Mina' }));
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
test('rejects invalid payloads', async ({ request }) => {
|
|
218
|
+
const response = await request.post('/Pets', {
|
|
219
|
+
data: { name: '' },
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
expect(response.status()).toBeGreaterThanOrEqual(400);
|
|
223
|
+
await expect(response).toHaveJSON(
|
|
224
|
+
expect.objectContaining({
|
|
225
|
+
error: expect.any(String),
|
|
226
|
+
}),
|
|
227
|
+
);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
If the project uses custom auth, set `storageState`, headers, or a request fixture
|
|
233
|
+
in Playwright config instead of embedding credentials in specs. Never commit
|
|
234
|
+
tokens or local `.env` values.
|
|
235
|
+
|
|
236
|
+
## Schema and verify coupling
|
|
237
|
+
|
|
238
|
+
A schema rename or resource route change is a breaking change for every verify
|
|
239
|
+
path that names that table, field, endpoint, fixture, or response shape.
|
|
240
|
+
|
|
241
|
+
In the same PR as a schema/resource change:
|
|
242
|
+
|
|
243
|
+
- Update `schema.graphql`, TypeScript resources, fixtures, and data loaders.
|
|
244
|
+
- Update Vitest resource tests and Playwright endpoint specs.
|
|
245
|
+
- Update shell smoke or `scripts/verify*` paths that assert row counts, joins, or
|
|
246
|
+
response keys.
|
|
247
|
+
- Run `bun run build`, `bun run typecheck`, and the smallest relevant test command.
|
|
248
|
+
- For deploy-affecting changes, boot local Harper or run the project smoke command
|
|
249
|
+
against the deployed endpoint. See [[harper-build-and-deploy]].
|
|
250
|
+
|
|
251
|
+
Do not report a Harper test change done only because mocks pass. At least one
|
|
252
|
+
verify path must prove the generated app still boots and exposes the expected
|
|
253
|
+
surface whenever config, schema, resources, generated artifacts, or endpoints are
|
|
254
|
+
part of the change.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lisa-openclaw",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.168.0",
|
|
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.
|
|
3
|
+
"version": "2.168.0",
|
|
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.
|
|
3
|
+
"version": "2.168.0",
|
|
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.
|
|
3
|
+
"version": "2.168.0",
|
|
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.
|
|
3
|
+
"version": "2.168.0",
|
|
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"
|