openxiangda 2.0.0-alpha.22 → 2.0.0-alpha.24

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",
3
- "version": "2.0.0-alpha.22",
3
+ "version": "2.0.0-alpha.24",
4
4
  "description": "Unified OpenXiangda 2.0 CLI, SDK, React runtime, NestJS integration and AI skill distribution.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,12 +49,12 @@
49
49
  "dependencies": {
50
50
  "dayjs": "1.11.18",
51
51
  "docx-preview": "0.3.7",
52
- "openxiangda-cli": "2.0.0-alpha.109",
53
- "openxiangda-contracts": "2.0.0-alpha.51",
54
- "openxiangda-devkit-core": "2.0.0-alpha.68",
55
- "openxiangda-mcp": "2.0.0-alpha.68",
56
- "openxiangda-nest": "2.0.0-alpha.62",
57
- "openxiangda-skill-kit": "2.0.0-alpha.86",
52
+ "openxiangda-cli": "2.0.0-alpha.111",
53
+ "openxiangda-contracts": "2.0.0-alpha.53",
54
+ "openxiangda-devkit-core": "2.0.0-alpha.70",
55
+ "openxiangda-mcp": "2.0.0-alpha.70",
56
+ "openxiangda-nest": "2.0.0-alpha.64",
57
+ "openxiangda-skill-kit": "2.0.0-alpha.88",
58
58
  "xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
59
59
  },
60
60
  "peerDependencies": {
@@ -4,7 +4,7 @@
4
4
  {
5
5
  "name": "openxiangda-v2",
6
6
  "description": "Use when researching, designing, building, testing, or delivering a complete OpenXiangda 2.0 application.",
7
- "sha256": "0d7a537bb7af5b79bc9e9b78de2a078cfc39201d65cecffd78231086cfa2bf55"
7
+ "sha256": "928646b9ded6fd61a73f3bd909d163d35b9735313e7bff40dc8490fbbdc32e1f"
8
8
  }
9
9
  ]
10
10
  }
@@ -10,14 +10,14 @@ Treat requirement discovery, architecture, authorization, development, testing a
10
10
  Before a workspace exists, use this Skill's exact npm version:
11
11
 
12
12
  ```bash
13
- pnpm dlx openxiangda@2.0.0-alpha.22 login --base-url <platform>
14
- pnpm dlx openxiangda@2.0.0-alpha.22 create <directory>
13
+ pnpm dlx openxiangda@2.0.0-alpha.24 login --base-url <platform>
14
+ pnpm dlx openxiangda@2.0.0-alpha.24 create <directory>
15
15
  ```
16
16
 
17
17
  Inside an application, use only its locked executable through `pnpm openxiangda`. Never invoke a bare global `openxiangda`, because that executable may belong to stable 1.x. Moving tags such as `latest` and `alpha` are forbidden. To install or refresh this same Skill from the package, run:
18
18
 
19
19
  ```bash
20
- pnpm dlx openxiangda@2.0.0-alpha.22 skill install --force
20
+ pnpm dlx openxiangda@2.0.0-alpha.24 skill install --force
21
21
  ```
22
22
 
23
23
  Use this order:
@@ -29,7 +29,7 @@ Use this order:
29
29
  5. For every resource or permission change, read [Data and authorization](references/data-authz.md) before editing `openxiangda.config.ts`.
30
30
  6. Read [Frontend](references/frontend.md) for pages or fields and [Backend actions](references/backend.md) only for a real business action.
31
31
  7. When the application explicitly enables standard approval, application events or notifications, read [Workflow, Events and Notification Hub](references/workflow-events.md). Keep them optional and out of ordinary CRUD.
32
- 8. Run the connected loop with `pnpm openxiangda dev`, then follow [Testing](references/testing.md) and `pnpm openxiangda check`.
32
+ 8. Run the connected loop with `pnpm openxiangda dev`, then follow [Testing](references/testing.md) and `pnpm openxiangda check`; check performs the target platform's read-only Native compatibility preflight before application checks or builds.
33
33
  9. Follow [Delivery](references/delivery.md): deploy preproduction first, inspect status/logs, then promote the exact successful version to production.
34
34
 
35
35
  For an AI-native client, start the workspace protocol through the same pinned executable:
@@ -6,7 +6,7 @@
6
6
  | --- | --- | --- |
7
7
  | `pnpm openxiangda create` | deploy | 创建、绑定并初始化应用 |
8
8
  | `pnpm openxiangda dev` | write-local | 连接平台测试数据启动本地 Web 与 Nest |
9
- | `pnpm openxiangda check` | write-local | 生成契约并执行检查、测试和构建 |
9
+ | `pnpm openxiangda check` | write-local | 生成契约并在目标平台预检后执行检查、测试和构建 |
10
10
  | `pnpm openxiangda accept` | deploy | 按计划准备可选的真实预发验收身份 |
11
11
  | `pnpm openxiangda deploy` | deploy | 部署测试环境或显式复用测试版本部署生产 |
12
12
  | `pnpm openxiangda status` | read | 查询最近或指定部署状态 |
@@ -124,4 +124,50 @@ resource `dataPolicyCode` to the same code. Do not invent `operator`, `value`,
124
124
  policy-level `roleCodes`. The compiler and platform know that `user.*` fields
125
125
  compare their stable `value`; `field` remains the declared field root code.
126
126
 
127
+ When a business membership resource is the durable source of a package role or
128
+ RelationshipGrant, declare the projection instead of calling authorization
129
+ management endpoints from application code:
130
+
131
+ ```ts
132
+ authz: {
133
+ // ...capabilities, roles and policies...
134
+ roleMembershipSources: [{
135
+ code: 'venue-managers',
136
+ name: '场馆管理员角色成员',
137
+ resourceCode: 'venue-manager-relations',
138
+ userIdField: 'manager.value',
139
+ roleCode: 'venue_admin',
140
+ enabledField: 'enabled',
141
+ failureMode: 'strict',
142
+ }],
143
+ relationshipGrantSources: [{
144
+ code: 'venue-member-grants',
145
+ name: '场馆成员关系授权',
146
+ resourceCode: 'venue-manager-relations',
147
+ subject: { type: 'user', userIdField: 'manager.value' },
148
+ relationCode: 'member',
149
+ targetResourceCode: 'venues',
150
+ resourceIdField: 'venue.value',
151
+ operations: ['read', 'update'],
152
+ enabledField: 'enabled',
153
+ failureMode: 'strict',
154
+ }],
155
+ }
156
+ ```
157
+
158
+ The user path must be `user.single.value`; the target path is `id` only when the
159
+ source resource is also the target resource, or a `resource-ref.single.value`
160
+ that points at the declared target resource.
161
+ Operations are a bounded constant list. Create/update/delete the relationship
162
+ resource through the standard Data API; the platform converges and revokes only
163
+ the facts owned by that source. Projection failure is always strict because a
164
+ last-known-good grant could defeat revocation.
165
+
166
+ Use the SDK projection health call after deployment. A platform operator with
167
+ the existing authorization-management capability may run rebuild for historical
168
+ rows or recover a dead-letter job. Rebuild/recovery are idempotent and accept an
169
+ `operationId`; they never accept a user token, user id override or impersonation
170
+ input. Do not write `sourceCode`, canonical membership rows or relationship
171
+ grant rows yourself.
172
+
127
173
  Run `pnpm openxiangda check` after every declaration or permission change.
@@ -1,7 +1,22 @@
1
1
  # OpenXiangda 2.0 Delivery
2
2
 
3
- Run `pnpm openxiangda check --json`; it owns generation, static checks, tests
4
- and production builds but deliberately does not seal an AppPackage. Its
3
+ Run `pnpm openxiangda check --json`; it defaults to the test target, compiles
4
+ the complete configuration and contract bundles, and asks the target
5
+ platform's advertised `configurationCompatibility` endpoint to run the same
6
+ Native compiler validation used during deployment preparation. This read-only
7
+ preflight happens before workspace checks, tests, builds, Buildx or uploads.
8
+ Use `--environment production` only when explicitly checking that target. A
9
+ failure preserves `pointer`, client contract/schema versions, platform
10
+ version/capability and the required/supported application-contract tuples.
11
+ The capability also publishes the existing 4 MiB configuration, 8 MiB
12
+ contract and 10 MiB total request bounds so oversized input fails before the
13
+ transport layer.
14
+ Never remove generated fields, reduce versions, raise limits, add app-code
15
+ exceptions or introduce 1.x compatibility to make it pass. The platform
16
+ revalidates authoritatively during deployment preparation.
17
+
18
+ After compatibility succeeds, check owns static checks, tests and production
19
+ builds but deliberately does not seal an AppPackage. Its
5
20
  `data.sealedArtifact` object and `.openxiangda/build/seal-status.json` make that
6
21
  state explicit even when an older `app-package.json` remains on disk. Deploy to
7
22
  test with the returned `openxiangda deploy` next command. Deploy owns the
@@ -1,8 +1,11 @@
1
1
  # Testing and Acceptance
2
2
 
3
3
  Run `pnpm openxiangda check --json` after declaration or code changes. It owns
4
- generation, static validation, unit tests and production builds; preserve its
5
- stable diagnostic instead of bypassing a failing stage. Read
4
+ generation plus a read-only Native compatibility preflight against the test
5
+ platform before static validation, unit tests or production builds. Use
6
+ `--environment production` only for an explicit production-target check.
7
+ Preserve the stable diagnostic and JSON pointer instead of bypassing a failing
8
+ stage. Read
6
9
  `data.sealedArtifact` in the machine result. A successful check always reports
7
10
  `state: "check-did-not-seal"`, `sealed: false` and
8
11
  `usableForDeploy: false`; it may also describe an older package as
@@ -20,8 +23,11 @@ For each changed resource, verify the real chain:
20
23
  6. PostgreSQL/RLS remains authoritative, including current-user and multi-role-union cases.
21
24
 
22
25
  For platform generator changes, add a representative multi-resource fixture
23
- (currently nineteen standard resources), assert each Surface literal is emitted
24
- only once, then run the unchanged Web dist budget gate. A budget failure is a
26
+ (the compatibility corpus fixes 43 resources, complete list/form/detail/mobile
27
+ surfaces, Perspective/AuthZ/Workflow/Event and exactly 161 producers), assert
28
+ the real toolchain generator output remains byte-identical, and pass the same
29
+ fixture through the platform's exported Native validator. Then run the unchanged
30
+ Web dist budget gate. A budget failure is a
25
31
  generator/runtime regression to fix; never raise the application budget or copy
26
32
  generated contracts into a smaller application-local format. Browser acceptance
27
33
  must also cover the large more-filters modal, declaration-order forms, hidden