Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
- `pnpm install:api` sends admin requests to a HappyView instance and uploads assets. Do not run it unless the user explicitly approves the target and token in the current conversation.
- HTTP runtime tests use a task-owned local Compose project and disposable database. Do not target or tear down unrelated services; note that the Compose bridge network permits egress and the configured proxy is not network-level isolation.
- Every new query endpoint needs a case in `happyview-modules/tooling/smoke-cases.js`. Add it to `happyview-modules/tooling/e2e.js` only if it has paging walks, count invariants or batch behaviour. When an endpoint's behavior changes, update the checks that cover it.
- Reuse and extend the canonical Lua helpers in `happyview-modules/lua/shared/` instead of writing a new copy in a handler or another shared file. Before writing a helper, search `happyview-modules/lua/shared/` and `happyview-modules/tooling/shared-helpers.registry.json` for an existing one; the lint only catches some copies. Families: DID, NSID, record URI/key, subject URI, datetime, handle/resolver, list cursor, list limit/includeTotal/sortDirection, query parameter helpers (`invalid`, `keys_only`, `scalar`), record view, actor view and batch request-target. Repeated-parameter (array) parsing has no shared helper yet.
- `pnpm lint` (so `pnpm check` and CI) runs `happyview-modules/tooling/lint-shared-helpers.js` on `lua/shared` and `lua/src`. Every top-level function defined in `lua/shared` is protected automatically: defining the same name in another shared file or in `lua/src` fails lint and names the file that owns it. Nothing to register for a new shared helper, but check the names already there first. `shared-helpers.registry.json` (paths relative to `happyview-modules/`) holds only lookalike name patterns and inline code patterns per family (`id`, `description`, `homes` = files where the patterns legitimately appear, `lookalikes`/`inline`) and the `allowlist`. To keep an existing copy, add `{file, family, symbol, reason}` to `allowlist` (`family` is `shared-helper` for a name defined in `lua/shared`; `symbol` is the function name or inline rule id; add `count` if it occurs more than once). The failure message prints a ready-made entry. An entry that no longer matches fails lint; delete it. The current allowlist is a baseline, not approval for new copies.
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"happyview-modules/tooling/seed.js",
"happyview-modules/tooling/smoke.js",
"happyview-modules/tooling/e2e.js",
"happyview-modules/tooling/lint-lua.js"
"happyview-modules/tooling/lint-lua.js",
"happyview-modules/tooling/lint-shared-helpers.js"
],
"linter": {
"rules": {
Expand Down
3 changes: 2 additions & 1 deletion happyview-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
},
"scripts": {
"lint:lua": "node tooling/lint-lua.js",
"lint": "pnpm run lint:lua",
"lint:shared-helpers": "node tooling/lint-shared-helpers.js",
"lint": "pnpm run lint:lua && pnpm run lint:shared-helpers",
"typecheck": "tsc --project tsconfig.json",
"check:generated": "node tooling/build-lua.js --check",
"check": "pnpm run check:generated && pnpm run lint && pnpm run typecheck && pnpm run test:unit",
Expand Down
Loading
Loading