@beignet/core 0.0.43 → 0.0.44
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/CHANGELOG.md +9 -0
- package/package.json +1 -1
- package/skills/app-architecture/SKILL.md +33 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @beignet/core
|
|
2
2
|
|
|
3
|
+
## 0.0.44
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 07baa79: Modernize the package-shipped app architecture examples to use the current Zod UUID schema API.
|
|
8
|
+
- 07baa79: Ship versioned Fetch runtime and devtools safety skills, teach core runtime
|
|
9
|
+
safety conventions, keep Agent Auth guidance discoverable, and trust the new
|
|
10
|
+
skills in generated apps.
|
|
11
|
+
|
|
3
12
|
## 0.0.43
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -84,7 +84,7 @@ import { z } from "zod";
|
|
|
84
84
|
import { errors } from "@/features/shared/errors";
|
|
85
85
|
|
|
86
86
|
export const projectSchema = z.object({
|
|
87
|
-
id: z.
|
|
87
|
+
id: z.uuid(),
|
|
88
88
|
name: z.string().min(1),
|
|
89
89
|
});
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ const projects = defineContractGroup()
|
|
|
94
94
|
|
|
95
95
|
export const getProject = projects
|
|
96
96
|
.get("/:id")
|
|
97
|
-
.pathParams(z.object({ id: z.
|
|
97
|
+
.pathParams(z.object({ id: z.uuid() }))
|
|
98
98
|
.errors({ ProjectNotFound: errors.ProjectNotFound })
|
|
99
99
|
.responses({ 200: projectSchema });
|
|
100
100
|
```
|
|
@@ -154,6 +154,12 @@ or outbox records must commit together.
|
|
|
154
154
|
Do not import provider packages from contracts, use cases, routes, UI, or
|
|
155
155
|
feature client modules.
|
|
156
156
|
|
|
157
|
+
Prefer typed options objects for provider factories. Explicit first-party
|
|
158
|
+
options override matching environment values. Treat injected SDK or database
|
|
159
|
+
clients as caller-owned unless an option such as `closeOnStop: true` delegates
|
|
160
|
+
shutdown to one provider instance, and preserve provider instrumentation when
|
|
161
|
+
using a lower-level direct adapter.
|
|
162
|
+
|
|
157
163
|
Tenant-owned repository methods should accept `TenantScope` instead of raw
|
|
158
164
|
tenant IDs. Use cases derive it with `requireTenantScope(ctx)` or
|
|
159
165
|
`createTenantScope(...)`; adapters unwrap it with `tenantScopeId(scope)` and
|
|
@@ -262,6 +268,31 @@ messages or make `AppError.details` safe to export.
|
|
|
262
268
|
Best-effort capture is bounded to one second by default. Tune `timeoutMs` when
|
|
263
269
|
needed; use `false` only when reporting may intentionally block the boundary.
|
|
264
270
|
|
|
271
|
+
## Runtime Safety
|
|
272
|
+
|
|
273
|
+
- HTTP idempotency defaults to the current actor and includes the current
|
|
274
|
+
tenant when one exists. The default actor scope fails closed when the
|
|
275
|
+
required identity is missing. Use
|
|
276
|
+
`meta.scope: "global"` only for deliberately public operations whose callers
|
|
277
|
+
should share one key namespace.
|
|
278
|
+
- `formatMailAddress(...)` rejects carriage returns and line feeds before a
|
|
279
|
+
provider builds headers; providers still own complete email-syntax
|
|
280
|
+
validation. Mail providers make one vendor call, so put retryable delivery
|
|
281
|
+
behind jobs or the outbox.
|
|
282
|
+
- Keep storage keys relative and reuse `assertValidStorageKey(...)`,
|
|
283
|
+
`normalizeStorageKeyPrefix(...)`, `prefixStorageKey(...)`, and
|
|
284
|
+
`createStoragePublicUrl(...)` from `@beignet/core/ports` in custom adapters.
|
|
285
|
+
Add provider-specific restrictions only after the shared validation.
|
|
286
|
+
- Uploads are protected by default. Declare `authorize(...)` or deliberately
|
|
287
|
+
opt into `access: "public"`; server uploads authorize each file before
|
|
288
|
+
reading bytes for validation. Include actor, tenant, or resource ownership
|
|
289
|
+
in object keys.
|
|
290
|
+
- Direct-upload completion is stateless, so make `onComplete(...)` idempotent
|
|
291
|
+
by upload ID or object key and use app-owned issuance state for single-use or
|
|
292
|
+
revocable grants. Before app-owned completion starts, a failed server batch
|
|
293
|
+
removes objects already written. After `onComplete(...)` starts, durable
|
|
294
|
+
references may exist and transaction or compensation belongs to the app.
|
|
295
|
+
|
|
265
296
|
## Validation
|
|
266
297
|
|
|
267
298
|
After core app-architecture changes, run from the app root:
|