@teamscala/service-boot 0.23.420 → 0.23.421

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 CHANGED
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "name": "@teamscala/service-boot",
8
8
  "type": "module",
9
- "version": "0.23.420",
9
+ "version": "0.23.421",
10
10
  "sideEffects": false,
11
11
  "imports": {
12
12
  "#service-boot/*": "./src/*",
@@ -8,25 +8,17 @@
8
8
  * (getOrpcClient().fn.publicAgreement.*). The unguessable agreement id plus an
9
9
  * email that matches one of the agreement's parties IS the gate (no password).
10
10
  *
11
- * This is the off-the-shelf path per building-applications: server logic beyond
12
- * CRUD is a typed ORPC procedure (the publicAssessment/publicGptSession shape),
13
- * NOT a hand-written /api/data/* Hono handler and NOT a loopback fetch to the
14
- * service's own ORPC. Writes go through context.prisma inside the handler — the
15
- * sanctioned in-handler DB access (orpc-is-the-only-api) — so the audit trigger
16
- * sees the ORPC caller context, the same proven path publicGptSession uses.
11
+ * Off-the-shelf path (building-applications): typed ORPC procedure, not a
12
+ * hand-written Hono handler; writes go through context.prisma inside the
13
+ * handler (orpc-is-the-only-api) so the audit trigger sees the ORPC caller.
14
+ * Multi-party model: signature_data holds a parties roster (JSON); each party
15
+ * is gated by its own email and the agreement completes only when every party
16
+ * has signed; single-signer falls back to signer_email/signer_name.
17
17
  *
18
- * Multi-party model: signature_data holds a parties roster (JSON) so one
19
- * agreement can require signatures from several parties (e.g. Provider + Client)
20
- * with no schema change. Each party is gated by its own email; the agreement
21
- * completes (signed_at set) only when every party has signed. A single-signer
22
- * agreement falls back to the original signer_email/signer_name columns.
23
- *
24
- * This module holds the three procedures (verify/sign/verifyDocument). The
25
- * supporting machinery lives as siblings: agreement-signing-evidence.ts
26
- * (origin/IP extraction, tamper-evident hash, evidence parser),
27
- * agreement-certificate.ts (Certificate of Completion), and
28
- * agreement-sign-side-effects.ts (invoice, demo-reset, CRM connect) — split
29
- * when the parent held them all at 853 lines.
18
+ * This module holds the three procedures (verify/sign/verifyDocument); the
19
+ * supporting machinery lives as siblings (agreement-signing-evidence,
20
+ * agreement-certificate, agreement-sign-side-effects) — split when the parent
21
+ * held them all at 853 lines.
30
22
  */
31
23
 
32
24
  import { os } from "@orpc/server";
@@ -140,9 +140,15 @@ export async function mountPgBoss(
140
140
  const boss = new PgBoss({
141
141
  connectionString: pgSslCompatUrl(ctx.databaseUrl),
142
142
  application_name: `pgboss:${ctx.serviceSlug}`,
143
- // Same per-service budget as the application Prisma pool (railway.ts):
144
- // ~30 consumers share one 200-conn Postgres; 3 keeps the aggregate ≤90.
145
- max: 3,
143
+ // ONE connection, not three: pg-boss is a sibling pool that sits OUTSIDE
144
+ // the Prisma budget, and with ~46 declared holders the fleet saturated
145
+ // at 304/300 (2026-08-27) partly on 3-connection pg-boss pools that had
146
+ // no idle timeout. At max:1 jobs serialize into a queue — the sanctioned
147
+ // background degradation (`a-per-consumer-pool-max-is-not-a-bound-on-the-server`:
148
+ // background work degrades to a queue, interactive work degrades to an
149
+ // outage). The sibling total is declared in
150
+ // config/db-pool-sizing.serviceSiblingConnections.
151
+ max: 1,
146
152
  // Generous connection-acquisition budget for the cross-internet link so
147
153
  // a slow TLS handshake under sustained load doesn't terminate the conn.
148
154
  connectionTimeoutMillis: 30_000,