openxiangda-skill-kit 2.0.0-alpha.125 → 2.0.0-alpha.128

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda-skill-kit",
3
- "version": "2.0.0-alpha.125",
3
+ "version": "2.0.0-alpha.128",
4
4
  "description": "Validation and deterministic packaging for OpenXiangda 2.0 AI skills.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "openxiangda-devkit-core": "2.0.0-alpha.103"
20
+ "openxiangda-devkit-core": "2.0.0-alpha.105"
21
21
  },
22
22
  "devDependencies": {
23
23
  "tsx": "4.23.12",
@@ -61,8 +61,13 @@ const visitorReservations = {
61
61
  ```
62
62
 
63
63
  Put it in `data: { resources: [visitorReservations] }`. Resource CRUD
64
- capabilities are derived by `resourceCapabilityCodes`; grant the needed values
65
- to roles. Directory-backed roles also require
64
+ capabilities are derived by `resourceCapabilityCodes`. For a Native resource,
65
+ grant `read` to each role that may enter its generated page; the compiler also
66
+ grants that role every enabled generated create/update/delete operation. Remove
67
+ an operation only when the role must be restricted, using the corresponding
68
+ code in `deniedCapabilities`. The compiler validates the denial and seals only
69
+ the resulting allow list, so runtime authorization has no second deny model.
70
+ Non-Native mutation owners never receive this expansion. Directory-backed roles also require
66
71
  `app:<app-code>:directory:read`. Explicit field `access` capability codes are
67
72
  also granted only to the intended roles. They are owned and exported by the
68
73
  generated field policy, so do not repeat them in `authz.capabilities`.
@@ -108,15 +113,20 @@ normal authorized role union with that Perspective before capability, field,
108
113
  row-policy and RLS evaluation. Omit the header for the complete union. Never
109
114
  use Perspective to guard writes, workflows or custom actions.
110
115
 
111
- `required: true` owns both storage nullability and form validation. A field
112
- without `access` inherits the resource read/create/update capability. Each
113
- access array is all-of; `false` is explicit deny. The same arrays drive the
114
- generated UI and platform field policies.
116
+ `required: true` is a logical application rule: generated forms show it as
117
+ required, and the Native Data API rejects omission on create or explicit null
118
+ on create/update. It does not create PostgreSQL `NOT NULL`; every authored
119
+ business column remains physically nullable so fields can be added or made
120
+ required without a historical-data backfill. Older rows may therefore contain
121
+ null when they predate the rule. A field without `access` inherits the resource
122
+ read/create/update capability. Each access array is all-of; `false` is explicit
123
+ deny. The same arrays drive the generated UI and platform field policies.
115
124
 
116
125
  For `uuid` fields, omission never generates a value. Only the resource system
117
126
  field `id` is platform-generated. An omitted optional UUID remains `null`; a
118
- required UUID must be supplied explicitly and cannot rely on an implicit
119
- database default.
127
+ required UUID must be supplied by a current create request and cannot rely on
128
+ an implicit database default. This is Data API validation, not a physical
129
+ `NOT NULL` constraint.
120
130
 
121
131
  Field types are semantic, not PostgreSQL storage aliases. Use the catalog in the generated `AGENTS.md`: for example `text.short`, `number.integer`, `user.single`, `department.multiple`, `resource-ref.single`, `file`, `address` and `subtable`. The compiler alone chooses storage columns and constraints. Reference fields store JSON display values. For `resource-ref.*`, `resourceCode`, `value`, `label`, optional `description` and optional `snapshot` are convenient historical display data only: the target resource remains authoritative, the platform does not create a foreign key or refresh/check the stored JSON, and business actions that need current target state must query it by `resourceCode` plus `value`. A resource source `labelField` must point to `text.short` or `text.long`; a `serial-number` field can be listed in `searchFields`, `descriptionFields` or `snapshotFields`, but it is not a display label. File limits exist only under `file`; `maxCount` owns the single/multiple bound and `maxSizeMb` owns the per-file size bound. There is no `file.multiple` key.
122
132
 
@@ -40,7 +40,7 @@
40
40
  - Visitor duplicate protection uses `createVisitorReservation({ duplicateMatch: { fieldCode: submittedValue }, ... })`. `duplicateMatch` is a non-empty value map, never a field-name array, and no mutable pre-read is allowed.
41
41
  - Desktop and mobile pages share values, validation and authorization, but use separate renderers. Options, members and departments store display snapshots; resource references store direct JSON display values; attachments, images and signatures use platform-managed file references.
42
42
  - `option.*`, `user.*`, `department.*` and `resource-ref.*` values never collapse to scalar IDs. Single values store one labeled object and multiple values store object arrays. `resource-ref.*` JSON is not a foreign key, trusted target snapshot or automatically refreshed copy; current target state is read by `resourceCode` plus `value`. A resource source `labelField` must be `text.short` or `text.long`; `serial-number` is allowed in source search, description and snapshot fields, but not as the label. `location` accepts only exact WGS84 coordinates captured by DingTalk or browser geolocation; it has no manual input or `manual` source. Roles that consume directory-backed fields explicitly include `app:<app-code>:directory:read`.
43
- - Derive role grants with `resourceCapabilityCodes(appCode, resourceCode)`. Declare current-user rows only with `currentUserDataPolicy(...)`; do not invent operators, values or alternate current-user spellings.
43
+ - Derive role grants with `resourceCapabilityCodes(appCode, resourceCode)`. Grant a Native resource's `read` capability to every role allowed to enter its generated page; the compiler adds enabled generated create/update/delete capabilities by default. Tighten only exceptional roles with `deniedCapabilities`, which is compile-time authoring input and is removed from the sealed role. Non-Native mutation owners never receive this expansion. Declare current-user rows only with `currentUserDataPolicy(...)`; do not invent operators, values or alternate current-user spellings.
44
44
  - Do not add compatibility aliases, migration branches or silent fallbacks for an earlier 2.0 alpha contract. Replace an incorrect contract and regenerate the application.
45
45
  - Standard Workflow and Notification Hub are optional 2.0 modules. Enable them only through canonical `openxiangda.config.ts` declarations and generated clients. `standalone`/`hidden-handoff` default to the compiler-owned process operation; action-owned submission must instead declare `launch.submission.kind: 'named-operation'` with sealed create/existing input and output bindings so the standard PC/mobile page calls the original Named Action and accepts an explicit no-Workflow result. Never add a browser save callback or call Workflow prepare/start directly. Custom pages launch only through a verified Named Action using `OpenXiangdaBusinessProcessService`. PC and mobile render the same `ProcessCommandSurface` independently and recover only by `commandId`. To replace Workflow detail, declare both desktop and mobile `detailRouteCode` values whose routes contain exactly `:instanceId`. Add the current-user todo page only with `frontend.user.applicationTodoCenter: true`; never query Notification Hub management APIs from a user page.
46
46
  - Run `pnpm openxiangda check --json` after contract changes and read `data.sealedArtifact`; check never seals, and an older `.openxiangda/build/app-package.json` is not the current check result. Use `pnpm openxiangda accept --plan <file>` only for optional real preproduction identity acceptance; it never blocks delivery. Deploy with `pnpm openxiangda deploy`, inspect with `pnpm openxiangda status` and `pnpm openxiangda logs`, and use the platform rollback command rather than mutating K3s directly.