@xhulz/nina 0.50.1 → 0.50.2

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 (133) hide show
  1. package/package.json +1 -1
  2. package/releases/0.50.2/core/GAPS.md +125 -0
  3. package/releases/0.50.2/core/answered.json +53 -0
  4. package/releases/0.50.2/core/defaults/tree/.claude/agents/architect.md +1 -0
  5. package/releases/0.50.2/core/defaults/tree/.claude/agents/dba.md +3 -0
  6. package/releases/0.50.2/core/defaults/tree/.claude/agents/devops.md +1 -0
  7. package/releases/0.50.2/core/defaults/tree/.claude/agents/implementer.md +1 -0
  8. package/releases/0.50.2/core/defaults/tree/.claude/agents/integration-tester.md +3 -0
  9. package/releases/0.50.2/core/defaults/tree/.claude/agents/qa.md +7 -0
  10. package/releases/0.50.2/core/defaults/tree/.claude/agents/reviewer.md +3 -0
  11. package/releases/0.50.2/core/defaults/tree/.claude/agents/secops.md +3 -0
  12. package/releases/0.50.2/core/defaults/tree/.claude/agents/solidity-auditor.md +3 -0
  13. package/releases/0.50.2/core/defaults/tree/.claude/agents/solidity-dev.md +3 -0
  14. package/releases/0.50.2/core/tree/.claude/agents/architect.md +129 -0
  15. package/releases/0.50.2/core/tree/.claude/agents/dba.md +117 -0
  16. package/releases/0.50.2/core/tree/.claude/agents/devops.md +118 -0
  17. package/releases/0.50.2/core/tree/.claude/agents/implementer.md +162 -0
  18. package/releases/0.50.2/core/tree/.claude/agents/integration-tester.md +168 -0
  19. package/releases/0.50.2/core/tree/.claude/agents/planner.md +132 -0
  20. package/releases/0.50.2/core/tree/.claude/agents/qa.md +150 -0
  21. package/releases/0.50.2/core/tree/.claude/agents/reviewer.md +184 -0
  22. package/releases/0.50.2/core/tree/.claude/agents/secops.md +120 -0
  23. package/releases/0.50.2/core/tree/.claude/agents/solidity-auditor.md +126 -0
  24. package/releases/0.50.2/core/tree/.claude/agents/solidity-dev.md +123 -0
  25. package/releases/0.50.2/core/tree/.claude/agents-overview.md +64 -0
  26. package/releases/0.50.2/core/tree/.claude/frontend.md +10 -0
  27. package/releases/0.50.2/core/tree/.claude/graph.md +75 -0
  28. package/releases/0.50.2/core/tree/.claude/patterns.md +251 -0
  29. package/releases/0.50.2/core/tree/.claude/pills/README.md +147 -0
  30. package/releases/0.50.2/core/tree/.claude/pipeline.md +101 -0
  31. package/releases/0.50.2/core/tree/.claude/retrieval.md +103 -0
  32. package/releases/0.50.2/core/tree/.claude/router.md +202 -0
  33. package/releases/0.50.2/core/tree/.claude/templates/integration.md +46 -0
  34. package/releases/0.50.2/core/tree/CLAUDE.md +164 -0
  35. package/releases/0.50.2/core/tree/scripts/cost-watch.mjs +25 -0
  36. package/releases/0.50.2/core/tree/scripts/edit-guard.mjs +24 -0
  37. package/releases/0.50.2/core/tree/scripts/harness-check.mjs +71 -0
  38. package/releases/0.50.2/core/tree/scripts/loop-gate.mjs +19 -0
  39. package/releases/0.50.2/core/vocabulary.json +13 -0
  40. package/releases/0.50.2/surfaces/blockchain/tree/.claude/agents/architect.md +5 -0
  41. package/releases/0.50.2/surfaces/blockchain/tree/.claude/agents/devops.md +5 -0
  42. package/releases/0.50.2/surfaces/blockchain/tree/.claude/agents/reviewer.md +5 -0
  43. package/releases/0.50.2/surfaces/blockchain/tree/.claude/agents/solidity-auditor.md +18 -0
  44. package/releases/0.50.2/surfaces/blockchain/tree/.claude/agents/solidity-dev.md +16 -0
  45. package/releases/0.50.2/surfaces/blockchain/tree/.claude/agents-overview.md +6 -0
  46. package/releases/0.50.2/surfaces/blockchain/tree/.claude/graph.md +11 -0
  47. package/releases/0.50.2/surfaces/blockchain/tree/.claude/router.md +6 -0
  48. package/releases/0.50.2/surfaces/blockchain/tree/CLAUDE.md +12 -0
  49. package/releases/0.50.2/surfaces/d1/tree/.claude/agents/dba.md +15 -0
  50. package/releases/0.50.2/surfaces/d1/tree/.claude/agents/devops.md +2 -0
  51. package/releases/0.50.2/surfaces/d1/tree/.claude/agents/implementer.md +2 -0
  52. package/releases/0.50.2/surfaces/d1/tree/.claude/patterns.md +8 -0
  53. package/releases/0.50.2/surfaces/d1/tree/CLAUDE.md +2 -0
  54. package/releases/0.50.2/surfaces/db/tree/.claude/agents/architect.md +5 -0
  55. package/releases/0.50.2/surfaces/db/tree/.claude/agents/dba.md +54 -0
  56. package/releases/0.50.2/surfaces/db/tree/.claude/agents/devops.md +5 -0
  57. package/releases/0.50.2/surfaces/db/tree/.claude/agents/implementer.md +2 -0
  58. package/releases/0.50.2/surfaces/db/tree/.claude/agents/integration-tester.md +10 -0
  59. package/releases/0.50.2/surfaces/db/tree/.claude/agents/planner.md +2 -0
  60. package/releases/0.50.2/surfaces/db/tree/.claude/agents/reviewer.md +22 -0
  61. package/releases/0.50.2/surfaces/db/tree/.claude/agents/secops.md +2 -0
  62. package/releases/0.50.2/surfaces/db/tree/.claude/agents-overview.md +5 -0
  63. package/releases/0.50.2/surfaces/db/tree/.claude/graph.md +8 -0
  64. package/releases/0.50.2/surfaces/db/tree/.claude/patterns.md +22 -0
  65. package/releases/0.50.2/surfaces/db/tree/.claude/pipeline.md +13 -0
  66. package/releases/0.50.2/surfaces/db/tree/.claude/retrieval.md +5 -0
  67. package/releases/0.50.2/surfaces/db/tree/.claude/router.md +4 -0
  68. package/releases/0.50.2/surfaces/db/tree/CLAUDE.md +17 -0
  69. package/releases/0.50.2/surfaces/drizzle/tree/.claude/agents/dba.md +9 -0
  70. package/releases/0.50.2/surfaces/drizzle/tree/.claude/agents/devops.md +5 -0
  71. package/releases/0.50.2/surfaces/drizzle/tree/.claude/agents/implementer.md +2 -0
  72. package/releases/0.50.2/surfaces/drizzle/tree/.claude/patterns.md +7 -0
  73. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/architect.md +14 -0
  74. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/dba.md +2 -0
  75. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/devops.md +29 -0
  76. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/implementer.md +14 -0
  77. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/integration-tester.md +11 -0
  78. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/qa.md +3 -0
  79. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/reviewer.md +8 -0
  80. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/agents/secops.md +8 -0
  81. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/patterns.md +17 -0
  82. package/releases/0.50.2/surfaces/edge-cf/tree/.claude/retrieval.md +8 -0
  83. package/releases/0.50.2/surfaces/edge-cf/tree/CLAUDE.md +27 -0
  84. package/releases/0.50.2/surfaces/frontend/tree/.claude/agents/architect.md +20 -0
  85. package/releases/0.50.2/surfaces/frontend/tree/.claude/agents/devops.md +28 -0
  86. package/releases/0.50.2/surfaces/frontend/tree/.claude/agents/implementer.md +25 -0
  87. package/releases/0.50.2/surfaces/frontend/tree/.claude/agents/qa.md +17 -0
  88. package/releases/0.50.2/surfaces/frontend/tree/.claude/agents/reviewer.md +56 -0
  89. package/releases/0.50.2/surfaces/frontend/tree/.claude/patterns.md +8 -0
  90. package/releases/0.50.2/surfaces/frontend/tree/.claude/retrieval.md +2 -0
  91. package/releases/0.50.2/surfaces/frontend/tree/.claude/router.md +14 -0
  92. package/releases/0.50.2/surfaces/frontend/tree/CLAUDE.md +5 -0
  93. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents/architect.md +16 -0
  94. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents/implementer.md +12 -0
  95. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents/integration-tester.md +20 -0
  96. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents/planner.md +2 -0
  97. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents/reviewer.md +21 -0
  98. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents/secops.md +2 -0
  99. package/releases/0.50.2/surfaces/integrations/tree/.claude/agents-overview.md +8 -0
  100. package/releases/0.50.2/surfaces/integrations/tree/.claude/graph.md +10 -0
  101. package/releases/0.50.2/surfaces/integrations/tree/.claude/patterns.md +38 -0
  102. package/releases/0.50.2/surfaces/integrations/tree/.claude/pipeline.md +16 -0
  103. package/releases/0.50.2/surfaces/integrations/tree/.claude/retrieval.md +16 -0
  104. package/releases/0.50.2/surfaces/integrations/tree/.claude/router.md +6 -0
  105. package/releases/0.50.2/surfaces/integrations/tree/CLAUDE.md +17 -0
  106. package/releases/0.50.2/surfaces/money/tree/.claude/agents/architect.md +12 -0
  107. package/releases/0.50.2/surfaces/money/tree/.claude/agents/dba.md +14 -0
  108. package/releases/0.50.2/surfaces/money/tree/.claude/agents/implementer.md +11 -0
  109. package/releases/0.50.2/surfaces/money/tree/.claude/agents/integration-tester.md +3 -0
  110. package/releases/0.50.2/surfaces/money/tree/.claude/agents/reviewer.md +23 -0
  111. package/releases/0.50.2/surfaces/money/tree/.claude/agents/secops.md +5 -0
  112. package/releases/0.50.2/surfaces/money/tree/.claude/agents/solidity-auditor.md +4 -0
  113. package/releases/0.50.2/surfaces/money/tree/.claude/agents/solidity-dev.md +4 -0
  114. package/releases/0.50.2/surfaces/money/tree/.claude/graph.md +2 -0
  115. package/releases/0.50.2/surfaces/money/tree/.claude/patterns.md +49 -0
  116. package/releases/0.50.2/surfaces/money/tree/.claude/pipeline.md +2 -0
  117. package/releases/0.50.2/surfaces/money/tree/.claude/retrieval.md +2 -0
  118. package/releases/0.50.2/surfaces/money/tree/CLAUDE.md +11 -0
  119. package/releases/0.50.2/surfaces/pii/tree/.claude/agents/dba.md +2 -0
  120. package/releases/0.50.2/surfaces/pii/tree/.claude/agents/devops.md +8 -0
  121. package/releases/0.50.2/surfaces/pii/tree/.claude/agents/reviewer.md +8 -0
  122. package/releases/0.50.2/surfaces/pii/tree/.claude/agents/secops.md +2 -0
  123. package/releases/0.50.2/surfaces/pii/tree/.claude/agents/solidity-auditor.md +5 -0
  124. package/releases/0.50.2/surfaces/pii/tree/CLAUDE.md +5 -0
  125. package/releases/0.50.2/surfaces/prisma/tree/.claude/agents/architect.md +2 -0
  126. package/releases/0.50.2/surfaces/prisma/tree/.claude/agents/dba.md +42 -0
  127. package/releases/0.50.2/surfaces/prisma/tree/.claude/agents/devops.md +11 -0
  128. package/releases/0.50.2/surfaces/prisma/tree/.claude/agents/implementer.md +2 -0
  129. package/releases/0.50.2/surfaces/prisma/tree/.claude/agents/integration-tester.md +2 -0
  130. package/releases/0.50.2/surfaces/prisma/tree/.claude/agents/reviewer.md +2 -0
  131. package/releases/0.50.2/surfaces/prisma/tree/.claude/patterns.md +15 -0
  132. package/releases/0.50.2/surfaces/prisma/tree/CLAUDE.md +5 -0
  133. package/src/office.html +51 -16
@@ -0,0 +1,49 @@
1
+ <!-- nina:slot money.1 -->
2
+
3
+ ---
4
+
5
+ ## Monetary values & percentages
6
+
7
+ - **Money is an integer of the currency's minor unit**, end to end — {{MINOR_UNIT}}, never a float, never a type that can hold a fraction of one. Source of precision: `{{MONEY_MODULE}}`.
8
+ - **Percentages are basis points** (`40% → 4000`, `100% → 10000`) so a distribution is exact without floating point.
9
+ - **Parsing, formatting and percentage arithmetic live in one module and nowhere else.** A second place that turns a string into money is a second rounding rule, and the two will disagree on a value somebody is owed.
10
+ - **Never** convert to a floating-point type before formatting, and never let a display format round a stored value.
11
+ - Monetary database columns are integer. JSON responses serialize them as **strings**, not numbers, so no client parses them into a float. The service owns the conversion.
12
+
13
+ <!-- nina:slot money.2 -->
14
+
15
+ ---
16
+
17
+ ## Distribution invariants (enforced by reviewer + unit tests)
18
+
19
+ The distribution engine lives in `{{CORE_PKG}}`. It is pure and total over integer {{MINOR_UNIT}}:
20
+
21
+ - A destination is either a percentage (basis points of the amount) or a fixed value.
22
+ - `total = Σ destinations`, computed in {{MINOR_UNIT}}.
23
+ - `total > amount` → **reject.** Never clamp, never distribute what is not there.
24
+ - `total < amount` → **allow**, surface the shortfall, and leave the remainder **parked**. Silence is the defect here: an unexplained remainder is indistinguishable from a bug.
25
+ - `total = amount` → OK.
26
+ - A retention is just another destination — the same arithmetic applies to it, with no special case.
27
+
28
+ <!-- nina:slot money.3 -->
29
+
30
+ ---
31
+
32
+ ## State machines & idempotency (enforced by reviewer)
33
+
34
+ - **Every money-moving entity is a state machine.** Its states and legal transitions are declared in `.claude/architecture.md`; the code follows the declaration, not the other way round. Illegal transitions throw; they are never silently coerced.
35
+ - **Every transition writes an audit row** (entity type, entity id, from, to, actor). No transition without a trail — the trail is what makes a money bug diagnosable after the money has moved.
36
+ - **Outbound transfers are idempotent.** Each carries a unique key, and dedupe happens before the side effect, at the serialization point.
37
+ - **One serialization point per balance.** Whatever computes and dispatches against a single balance never runs concurrently with itself. Two concurrent runs over one balance is how a double send happens even when every individual write is correct.
38
+
39
+ <!-- nina:slot money.4 -->
40
+ - **Money computation and dispatch go through the serialization point.** Routes, queue consumers and tools never run a distribution or a transfer synchronously in the request path.
41
+
42
+ <!-- nina:slot money.5 -->
43
+ - **The distribution engine lives in `{{CORE_PKG}}`.** Services call it as a pure function; they do not embed money logic inline.
44
+
45
+ <!-- nina:slot money.6 -->
46
+ - Idempotency on money-moving writes: the record carries an idempotency key, and the serialization point refuses the second attempt *before* the side effect.
47
+
48
+ <!-- nina:slot money.7 -->
49
+ - `{{CORE_PKG}}` is the most-tested package — pure functions over fixtures. Cover the distribution invariants exhaustively: over, under, exact, mixed percentage and fixed, and rounding.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot money.1 -->
2
+ - **Money invariants respected** — a distribution never exceeds the amount; a shortfall is parked, not distributed; transfers idempotent; every transition audited.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot money.1 -->
2
+ | New distribution / transfer logic | `.claude/architecture.md` § *Money*, `.claude/patterns.md` § *Distribution invariants*, `{{CORE_PKG}}/` | architect → implementer → reviewer → qa |
@@ -0,0 +1,11 @@
1
+ <!-- nina:slot money.1 -->
2
+ 3. **An outbound transfer is idempotent — it is NEVER sent twice.** Every transfer carries an idempotency key, and deduplication happens at a single serialization point **before** the side effect, never after it. A retry, a re-delivered queue message, a double-click and a replayed webhook must all collapse to one transfer. This is the highest-blast-radius invariant in the system: almost everything else can be corrected afterwards, and a duplicated transfer cannot.
3
+
4
+ <!-- nina:slot money.2 -->
5
+ 4. **Conservation — what comes in equals what goes out plus what is retained.** A distribution may NEVER exceed the amount it distributes → **block**. If it is **less**, **alert** and leave the remainder **parked** and visible — never silently distributed, never silently absorbed. All arithmetic is integer {{MINOR_UNIT}}; percentages are basis points. The LLM never computes a monetary value.
6
+
7
+ <!-- nina:slot money.3 -->
8
+ 5. **State-machine integrity.** Every money-moving entity has an explicit set of states and legal transitions, declared in `.claude/architecture.md` § *State machines* — not inferred from whatever code happens to exist. Only declared transitions are legal; an illegal one throws and is never silently coerced. **Every transition writes an audit row** (entity, id, from → to, actor, when). Skipping a state, inventing one, or landing a transition with no audit row is a hard reject.
9
+
10
+ <!-- nina:slot money.4 -->
11
+ - **money movement**: anything that creates, moves, settles or records a balance
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - **Privacy.** No sensitive value in clear text where it must not be. The categories are declared in `.claude/architecture.md` § *Privacy* — they are not decided per query, and not decided by you. **Document bytes live only in the object store, referenced by key: the column holds the key, never the bytes.** Any column the architect's spec flagged for masking must be encrypted at rest. Reject a schema that widens what is stored in the clear.
@@ -0,0 +1,8 @@
1
+ <!-- nina:slot pii.1 -->
2
+
3
+ **Point it at an UNAUTHENTICATED route — a sign-in page is the right one.** Never sign in, and never
4
+ screenshot a signed-in page. Accounts on deployed environments hold real personal data, and a
5
+ screenshot or a console dump pulls it into agent transcripts and logs, where it persists and nobody
6
+ ever looks for it again. That is a privacy leak with no upside here: the sign-in page proves
7
+ everything this check is for. It renders from the same bundle, it exercises the same build-time env
8
+ inlining (a missing variable blanks it identically), and it needs no session.
@@ -0,0 +1,8 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - Check for privacy regressions: **no sensitive value in a log, an error message — a library's own included — a URL or a test fixture**, per the categories in `.claude/architecture.md` § *Privacy*; document bytes only in the object store, never plaintext in the database; no leaked secret.
3
+
4
+ <!-- nina:slot pii.2 -->
5
+ - **privacy** — the privacy check above, in full: no sensitive value in a log, an error message, a
6
+ URL or a test fixture; document bytes only in the object store; no leaked secret. Where
7
+ **tenant-and-privacy** is dispatched, its reviewer owns this too and there is no separate one; where
8
+ it is not, this is a dimension of its own. Either way it is never nobody's.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - **Privacy (Hard Rule #8)** — the categories declared in `.claude/architecture.md` § *Privacy* must never appear in logs, in responses that do not need them, in error paths, or in the database in clear text. Check every endpoint that returns a person's record for fields it includes by accident: a `select` that quietly grew a column is the usual way this leaks. Check the error paths too — they are written last and reviewed least — and what the libraries on them print or carry in their own errors, bound values included.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot pii.1 -->
2
+ - **Nothing personal reaches the chain.** What is written on-chain is public, permanent, and beyond
3
+ deletion by anyone — including by you, and including after a subject asks. A hash of a personal
4
+ identifier is not a protection: it is a lookup table for whoever holds the input set. Reject a
5
+ personal datum stored in state, emitted in an event, or passed as calldata.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot pii.1 -->
2
+ 8. **Sensitive personal data is classified, and the classification is enforced.** What counts as sensitive here — identity documents, financial identifiers, anything a person would not expect to be readable by whoever can read a log — is declared in `.claude/architecture.md` § *Privacy*, along with the regime that governs it ({{PRIVACY_REGIME}}). Encrypted at rest. **No sensitive value in a log, an error message, a URL, an analytics event, or an agent transcript** — the places nobody thinks about are exactly the ones that persist. That includes what a library puts in its own errors and prints itself: a database client's error can carry the query and every bound value, and a framework can log a whole error past the logger it was given. A database error is mapped at the data layer to a typed error from a closed list before anything logs or returns it, and a test proves that a bound value it writes reaches no thrown error. Document bytes live only in the object store, referenced by key, never in the database in clear text.
3
+
4
+ <!-- nina:slot pii.2 -->
5
+ - **personal data**: where it is collected, stored, logged or sent
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-client-api` | a new or changed Prisma query |
@@ -0,0 +1,42 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-cli` | **before ANY `prisma` CLI command** — `validate`, `format`, `migrate dev`, `migrate diff`, `migrate deploy`. Flags differ between versions, and one of them (`migrate diff --shadow-database-url` against a live database) destroys the database it points at |
3
+ | `prisma-client-api` | auditing a new or changed query — filters, operators, `$transaction` semantics. Through a driver adapter, cite the adapter's installed source for what a transaction does: the skill describes the default engine, and an adapter can roll back less |
4
+
5
+ <!-- nina:slot prisma.2 -->
6
+ Neither skill covers a **caching or edge layer sitting on top of the client** — cache strategy,
7
+ edge-client behaviour and the rule about never caching a read that authorizes a write belong to that
8
+ layer's own integration doc, declared like any other integration. A skill does not replace it.
9
+
10
+ <!-- nina:slot prisma.3 -->
11
+ - **With Prisma, both offline.** Run `pnpm --filter {{DB_PKG_NAME}} exec prisma validate`; it must pass. Then run `prisma migrate diff` in its **offline, file-only form** and read the generated SQL, not just the Prisma delta. Its flags changed in Prisma 7, so read the installed major (`prisma --version`) before writing the command:
12
+
13
+ ```
14
+ # Prisma 6. Compare the PREVIOUS schema against the working one — pure file-to-file, no database.
15
+ git show HEAD:{{DB_PKG}}/prisma/schema.prisma > /tmp/schema-head.prisma
16
+ pnpm --filter {{DB_PKG_NAME}} exec prisma migrate diff \
17
+ --from-schema-datamodel /tmp/schema-head.prisma \
18
+ --to-schema-datamodel prisma/schema.prisma \
19
+ --script
20
+ ```
21
+
22
+ From Prisma 7 the two flags are `--from-schema` and `--to-schema`, and the schema engine starts from the
23
+ datasource in `prisma.config.ts` even for this diff: with none there, it prints nothing and exits 0. For
24
+ SQLite a placeholder the diff never opens is enough, a `file:` URL under a gitignored directory; for any
25
+ other provider, find out what the diff opens before you give it one. Never a real database's URL. A first schema has nothing at `HEAD`: diff it `--from-empty`. Compare the output against the
26
+ hand-written `migration.sql` to confirm the declarative parts match.
27
+
28
+ ⚠️ **Do NOT reach for `--from-migrations`.** It looks like the natural choice and it is a trap:
29
+ Prisma refuses it without a shadow database (`--shadow-database-url`, or from Prisma 7 a
30
+ `shadowDatabaseUrl` in `prisma.config.ts`), which pushes you toward supplying a database URL — the exact move that destroys databases (below). The file-to-file form above answers the
31
+ same question with no database involved.
32
+
33
+ ⛔ **NEVER point `--shadow-database-url`, `--from-url`, `--to-url`, `--from-schema-datasource` — or, from Prisma 7, a `shadowDatabaseUrl` or the config datasource behind `--from-config-datasource` — at a real database, most of all not the one `{{SECRETS_LOCAL}}` names.** Prisma **executes** the entire migration history against whatever database those flags name, which **DESTROYS ALL DATA** in it. A shadow database must be a disposable, empty database and nothing else. It does not announce itself: the command completes with a reassuring "empty migration" result and no error, having already destroyed everything in the database it was pointed at. If the offline form above cannot answer your question, **STOP and report that to the orchestrator** instead of reaching for a database URL.
34
+
35
+ <!-- nina:slot prisma.4 -->
36
+ - **Where reads are cached through Prisma Accelerate,** every `findUnique` / `findMany` on a hot read path names its `cacheStrategy` (`ttl` / `swr`), and one that feeds a correctness-critical write names none.
37
+
38
+ <!-- nina:slot prisma.5 -->
39
+ - **On an edge runtime,** new Prisma code paths use the edge client of the installed major: `@prisma/client/edge` up to Prisma 6; from 7, the client the `prisma-client` generator writes with the platform's `runtime` set, imported from where it is generated — `@prisma/client/edge` fails there with `MODULE_NOT_FOUND`.
40
+
41
+ <!-- nina:slot prisma.6 -->
42
+ - Run a Prisma command that writes to a real database — `prisma migrate dev`, `migrate deploy`, `migrate reset`, `migrate resolve`, `db push`, `db execute`, `$executeRaw*` — or **any `prisma migrate diff` variant carrying a database URL**, which silently wipes the database it points at.
@@ -0,0 +1,11 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ - **`prisma-cli`** — before `migrate deploy` or any other Prisma CLI command against a real database.
3
+
4
+ <!-- nina:slot prisma.2 -->
5
+ - **Prisma migrations go out with `prisma migrate deploy`**, and nothing else changes a shared database's schema.
6
+
7
+ <!-- nina:slot prisma.3 -->
8
+ - Run `prisma migrate diff --shadow-database-url <url>` against any live database. It **executes** the migration history against that database, destroying everything in it, and reports success. Use a disposable shadow database or don't run it.
9
+
10
+ <!-- nina:slot prisma.4 -->
11
+ - Run `prisma migrate reset` against a shared database, ever.
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-client-api` | a new or changed Prisma query |
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-cli` | a Prisma CLI command |
@@ -0,0 +1,2 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | `prisma-client-api` | a new or changed Prisma query |
@@ -0,0 +1,15 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ - **Database table/column names** (Prisma `@map` / `@@map`): `snake_case` in SQL, `camelCase` in TS.
3
+
4
+ <!-- nina:slot prisma.2 -->
5
+ - Where Prisma reads are cached through Accelerate, `cacheStrategy` lives in `{{DB_PKG}}`: services do not add, strip, or override cache policies.
6
+
7
+ <!-- nina:slot prisma.3 -->
8
+
9
+ ### Prisma
10
+
11
+ - Schema lives in `{{DB_PKG}}/prisma/schema.prisma`. Nowhere else.
12
+ - **Never write raw SQL** unless justified in a code comment with perf data.
13
+ - N+1 is solved with `include` / `select`, chosen deliberately.
14
+ - Where reads are cached through Accelerate, every `findUnique` / `findMany` on a hot path defines its `cacheStrategy`, and no direct connection string is embedded in code.
15
+ - Tests run a real Prisma client against a real database; the client is never mocked.
@@ -0,0 +1,5 @@
1
+ <!-- nina:slot prisma.1 -->
2
+ | Run any `prisma` CLI command (the database gate, devops, and the integration gate where there is one) | `prisma-cli` | flags differ between versions; `migrate diff --shadow-database-url` against a live DB wiped dev/staging once |
3
+
4
+ <!-- nina:slot prisma.2 -->
5
+ | Write or audit a Prisma query (architect, implementer, the database gate, reviewer) | `prisma-client-api` | filters, operators, `$transaction` semantics. a caching or edge layer on top of the client is **NOT covered** — its cache strategy belongs to that layer's own integration doc |
package/src/office.html CHANGED
@@ -423,7 +423,6 @@ Object.assign(owner, { x: OWNER_HOME.x, y: OWNER_HOME.y, at: OWNER_HOME, home: O
423
423
  const walk = (p, to, then) => p.queue.push({ kind: 'walk', to, then });
424
424
  const wait = (p, ms) => p.queue.push({ kind: 'wait', ms });
425
425
  const act = (p, fn) => p.queue.push({ kind: 'do', fn });
426
- const homeOf = (p) => (p === boss ? BOSS_HOME : p === owner ? OWNER_HOME : p.slot);
427
426
 
428
427
  function say(p, kind, ms) {
429
428
  p.bubble = { kind, until: ms ? performance.now() + ms : Infinity };
@@ -433,14 +432,14 @@ function hush(p, kinds) {
433
432
  }
434
433
 
435
434
  /** A free desk of a stage for someone, sending its longest-idle occupant away when every desk is taken. */
436
- function seatAt(stage, p) {
435
+ function seatAt(stage, p, instant = false) {
437
436
  const mine = stage.slots.find((sl) => sl.who === p);
438
437
  if (mine) return mine;
439
438
  let slot = stage.slots.find((sl) => !sl.who);
440
439
  if (!slot) {
441
440
  const idle = stage.slots.filter((sl) => sl.who && !sl.who.typing && !sl.who.current && sl.who.queue.length === 0).sort((a, b) => a.who.born - b.who.born)[0];
442
441
  if (idle) {
443
- leave(idle.who);
442
+ leave(idle.who, instant);
444
443
  slot = idle;
445
444
  }
446
445
  }
@@ -456,12 +455,32 @@ function seatAt(stage, p) {
456
455
  return slot;
457
456
  }
458
457
 
459
- function leave(p) {
458
+ /** Someone gets up and walks out to the garden; while the room is being set, they are simply gone. */
459
+ function leave(p, instant = false) {
460
460
  if (p.slot && p.slot.who === p) p.slot.who = null;
461
461
  p.slot = null;
462
462
  p.typing = false;
463
463
  p.leaving = true;
464
- walk(p, ENTRANCE, () => p.leaving && people.delete(p.key));
464
+ if (instant) people.delete(p.key);
465
+ else walk(p, ENTRANCE, () => p.leaving && people.delete(p.key));
466
+ }
467
+
468
+ /**
469
+ * Those whose report is in get up once the work moves on, one after another, so the room shows the work in hand
470
+ * rather than everyone who ever sat in it — restored, they are simply gone. A resumed one stays.
471
+ */
472
+ function dismissReported(keep, instant) {
473
+ let delay = 400;
474
+ for (const q of [...people.values()]) {
475
+ // A report still on its way to the desk counts: the leaving is queued behind it.
476
+ if (keep.includes(q) || !(q.reported || q.reporting) || q.leaving) continue;
477
+ if (instant) leave(q, true);
478
+ else {
479
+ wait(q, delay);
480
+ act(q, () => q.reported && !q.typing && !q.leaving && leave(q));
481
+ delay += 350;
482
+ }
483
+ }
465
484
  }
466
485
 
467
486
  function place(p, spot) {
@@ -521,13 +540,16 @@ function onBeat(b) {
521
540
  people.set(key, p);
522
541
  }
523
542
  p.work = b.id;
543
+ p.reported = false;
544
+ p.reporting = false;
524
545
  // The dispatch the gate asked about went out: the phone stops.
525
546
  if (capRole === b.role) settleCap();
526
547
  p.leaving = false;
527
- const slot = seatAt(stage, p);
548
+ const slot = seatAt(stage, p, b.instant);
528
549
  if (b.instant) {
529
550
  place(p, slot);
530
551
  p.typing = true;
552
+ if (!b.message) dismissReported([p], true);
531
553
  return;
532
554
  }
533
555
  note(b.at, `${b.from ? `${b.from.role} → ` : ''}${b.role}${b.resumed ? ' (resumed)' : ''}`);
@@ -545,9 +567,10 @@ function onBeat(b) {
545
567
  if (focus === carrier) follow(stage.drop);
546
568
  });
547
569
  wait(carrier, 300);
548
- const home = homeOf(carrier);
549
- if (home) walk(carrier, home, () => place(carrier, home));
550
- else leave(carrier);
570
+ // NINA goes back to the reception; an agent who handed the work on is done, and leaves.
571
+ if (carrier === boss) walk(boss, BOSS_HOME, () => place(boss, BOSS_HOME));
572
+ else act(carrier, () => carrier.reported && !carrier.typing && leave(carrier));
573
+ if (!b.message) dismissReported([p, carrier], false);
551
574
  if (p.x !== slot.x || p.y !== slot.y) walk(p, slot);
552
575
  act(p, () => {
553
576
  place(p, slot);
@@ -561,21 +584,30 @@ function onBeat(b) {
561
584
  p = person(b.agent, b.role, b.agent);
562
585
  p.agent = b.agent;
563
586
  people.set(b.agent, p);
564
- place(p, seatAt(stage, p));
587
+ place(p, seatAt(stage, p, b.instant));
565
588
  }
566
589
  if (!p) return;
567
590
  const finish = () => {
568
591
  p.typing = false;
569
- if (b.asks) say(p, 'ask');
570
- else if (!b.instant) say(p, b.back ? 'back' : 'pass', 3000);
592
+ p.reported = true;
593
+ p.reporting = false;
594
+ if (!b.asks && !b.instant) say(p, b.back ? 'back' : 'pass', 3000);
571
595
  // Someone standing beside a full desk goes once their report is in.
572
596
  if (p.slot?.extra) {
573
- wait(p, b.instant ? 0 : 2500);
574
- act(p, () => leave(p));
597
+ if (b.instant) leave(p, true);
598
+ else {
599
+ wait(p, 2500);
600
+ act(p, () => leave(p));
601
+ }
575
602
  }
576
603
  };
604
+ // The question goes up at once, so an answer that follows within the moment below finds it to take down.
605
+ if (b.asks) say(p, 'ask');
577
606
  if (b.instant) finish();
578
607
  else {
608
+ // Seen at work a moment before the report: in a replay, one often lands as its agent reaches the desk.
609
+ p.reporting = true;
610
+ wait(p, 1200);
579
611
  act(p, finish);
580
612
  follow(p);
581
613
  }
@@ -623,7 +655,7 @@ function onBeat(b) {
623
655
  // A dispatch the owner refused never ran; a run that never reported has stopped. Either way, whoever sat down
624
656
  // for it gets up — and a refusal answers the gate's call.
625
657
  const p = [...people.values()].find((x) => x.work === b.work);
626
- if (p && (!p.agent || b.type === 'stale')) leave(p);
658
+ if (p && (!p.agent || b.type === 'stale')) leave(p, b.instant);
627
659
  if (b.type === 'refused' && capRole === b.role) settleCap();
628
660
  if (!b.instant) note(b.at, b.type === 'refused' ? `${b.role}: not sent — ${ROOM.owner} said no` : `${b.role} stopped without a report`);
629
661
  return;
@@ -1025,7 +1057,10 @@ function drawScreen(now) {
1025
1057
  // What stays put on the screen: the title, the zoom (in the page), the log, a pass worth a party.
1026
1058
  const size = ui(12);
1027
1059
  {
1028
- const title = `NINA office · ${ROOM.project}${session ? ` · ${session.slice(0, 8)}` : ''} · ${status}`;
1060
+ // Whether anything is going on: between dispatches the room is still, and says so.
1061
+ const working = [...new Set([...people.values()].filter((p) => p.work && !p.reported && !p.leaving).map((p) => p.role))];
1062
+ const going = status === 'live' || status === 'replay' ? (working.length > 0 ? ` · at work: ${working.join(', ')}` : ' · waiting for the next dispatch') : '';
1063
+ const title = `NINA office · ${ROOM.project}${session ? ` · ${session.slice(0, 8)}` : ''} · ${status}${going}`;
1029
1064
  s.font = `${size}px ${MONO}`;
1030
1065
  s.fillStyle = '#1b1d26';
1031
1066
  s.fillRect(0, 0, screen.width, band);