@astram/guide 0.2.27 → 0.2.29

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 (2) hide show
  1. package/CAPABILITIES.md +14 -1
  2. package/package.json +1 -1
package/CAPABILITIES.md CHANGED
@@ -82,7 +82,20 @@ imports: [
82
82
  - **Live roles** — a role posting change, a grant change or a user disable bumps the permission
83
83
  version; the next request reloads facts and roles. No re-login needed.
84
84
  - **Engine errors → HTTP** — `AuthorizationDeniedError` → 403, `ValidationError` → 400,
85
- `EngineUnavailableError` → 503 for your controllers too (global filter; id-free messages).
85
+ `EngineUnavailableError` → 503, `UniqueConflictError` → 409 `unique_conflict` for your
86
+ controllers too (global filter; id-free, value-free messages).
87
+ - **Duplicate keys** — a create / update that hits a UNIQUE index throws `UniqueConflictError`
88
+ (`typeKey`, `constraint` = the index name, `rowIndex` for `createMany`). Match it with
89
+ `isUniqueConflict(err, '<constraint>')`, never by message text. Inside `transaction(fn)` the
90
+ transaction is then rollback-only (a further write is a 503): re-read in a fresh transaction for
91
+ the idempotent answer. On a tenant type, lead every UNIQUE index with the tenant column, or a
92
+ 409 reveals that another tenant holds the value (the engine now warns at boot, naming the index).
93
+ Likewise give a `subtreeSubquery` type's scope column and its parent key the same character set
94
+ and collation: a mismatch is also warned at boot, and its reads fail with errno 1267.
95
+ - **Moving a row out of scope** — a non-root update that sets a `readScope` type's scope column to a
96
+ value outside the actor's subtree answers `update_outside_write_scope` (403) before any write.
97
+ Mark the scope column `immutable: true` if rows must never move; otherwise in-subtree moves stay
98
+ allowed. A patch that re-sends the scope column costs one extra probe query.
86
99
 
87
100
  ## Authentication and sessions (`@astram/guard`, `auth: true`)
88
101
  - `POST /auth/login` `{ identityHint, password }` → `{ session, tokens }`, or an MFA challenge.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astram/guide",
3
- "version": "0.2.27",
3
+ "version": "0.2.29",
4
4
  "license": "MIT",
5
5
  "description": "Astram framework — the AI/dev GUIDE layer (ADR-0025). Ships the framework's hard rules + capabilities manifest as installed, upgrade-refreshed docs. A consumer app's CLAUDE.md references FRAMEWORK_RULES.md from this package; `npm update` replaces it wholesale so new rules arrive cleanly, while the app's own .astram/guide/ layer is never touched. This is the framework-owned FLOOR: an app rule may tighten it, never weaken it.",
6
6
  "type": "commonjs",