openxiangda-skill-kit 2.0.0-alpha.82 → 2.0.0-alpha.85
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/dist/index.d.ts.map +1 -1
- package/dist/index.js +79 -30
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/skills/manifest.json +1 -1
- package/skills/openxiangda-v2/SKILL.md +15 -11
- package/skills/openxiangda-v2/references/appspec.md +67 -0
- package/skills/openxiangda-v2/references/backend.md +28 -3
- package/skills/openxiangda-v2/references/commands.md +21 -0
- package/skills/openxiangda-v2/references/data-authz.md +30 -0
- package/skills/openxiangda-v2/references/frontend.md +47 -1
- package/skills/openxiangda-v2/references/testing.md +9 -0
- package/skills/openxiangda-v2/references/{workflow-notification.md → workflow-events.md} +6 -3
- package/skills/openxiangda-v2/references/workspace.md +5 -2
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,CAAC;IACjB,MAAM,EAAE,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AACvD,wBAAgB,wBAAwB,WAMvC;AAmCD,wBAAsB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC,CAgGxF;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAepF;AAuBD,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,SAAuC,0BAIzG;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE,kBAAkB;;;;GAoB5D"}
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { existsSync } from 'node:fs';
|
|
3
3
|
import { readdir, readFile, stat, writeFile, } from 'node:fs/promises';
|
|
4
4
|
import { dirname, relative, resolve } from 'node:path';
|
|
5
|
-
import { DEVKIT_COMMANDS } from 'openxiangda-devkit-core';
|
|
5
|
+
import { DEVKIT_COMMANDS, renderDevkitCommandReference, } from 'openxiangda-devkit-core';
|
|
6
6
|
import { installSkillTransaction } from './internal/skill-installer.js';
|
|
7
7
|
export const OPENXIANGDA_SKILL_NAME = 'openxiangda-v2';
|
|
8
8
|
export function resolveDefaultSkillsRoot() {
|
|
@@ -18,8 +18,24 @@ const FORBIDDEN_V2_TERMS = [
|
|
|
18
18
|
/\bJS_CODE\b/i,
|
|
19
19
|
/\bresource publish\b/i,
|
|
20
20
|
/\bworkflow v3\b/i,
|
|
21
|
+
/\bRoleSession\b/i,
|
|
22
|
+
/\bcreate-openxiangda\b/i,
|
|
23
|
+
/\bopenxiangda-(?:admin|compiler|field-kit|testing|user|workflow)\b/i,
|
|
21
24
|
];
|
|
22
25
|
const knownCommandIds = new Set(DEVKIT_COMMANDS.map(command => command.id));
|
|
26
|
+
const REQUIRED_REFERENCES = [
|
|
27
|
+
'appspec.md',
|
|
28
|
+
'architecture.md',
|
|
29
|
+
'backend.md',
|
|
30
|
+
'commands.md',
|
|
31
|
+
'data-authz.md',
|
|
32
|
+
'delivery.md',
|
|
33
|
+
'discovery.md',
|
|
34
|
+
'frontend.md',
|
|
35
|
+
'testing.md',
|
|
36
|
+
'workflow-events.md',
|
|
37
|
+
'workspace.md',
|
|
38
|
+
];
|
|
23
39
|
export async function validateSkills(skillsRoot) {
|
|
24
40
|
const skills = await loadSkills(skillsRoot);
|
|
25
41
|
const knownSkills = new Set(skills.map(skill => skill.name));
|
|
@@ -40,39 +56,54 @@ export async function validateSkills(skillsRoot) {
|
|
|
40
56
|
if (!skill.description || !/\bUse (when|for)\b/i.test(skill.description)) {
|
|
41
57
|
add('Description must explain when the skill should be used.');
|
|
42
58
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (
|
|
47
|
-
add(`
|
|
48
|
-
}
|
|
49
|
-
for (const command of extractCommands(skill.source)) {
|
|
50
|
-
const commandId = toCommandId(command);
|
|
51
|
-
if (!commandId || !knownCommandIds.has(commandId)) {
|
|
52
|
-
add(`Unknown 2.0 CLI command reference: openxiangda ${command}`);
|
|
59
|
+
const referencesRoot = resolve(skillsRoot, skill.directory, 'references');
|
|
60
|
+
for (const name of REQUIRED_REFERENCES) {
|
|
61
|
+
const referenceFile = resolve(referencesRoot, name);
|
|
62
|
+
if (!(await isFile(referenceFile))) {
|
|
63
|
+
add(`Missing required nested reference: references/${name}`, referenceFile);
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (
|
|
62
|
-
add(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
const markdownFiles = [skill.file, ...(await markdownFilesBelow(referencesRoot))];
|
|
67
|
+
for (const markdownFile of markdownFiles) {
|
|
68
|
+
const source = await readFile(markdownFile, 'utf8');
|
|
69
|
+
if (markdownFile !== skill.file && /^---\n/.test(source)) {
|
|
70
|
+
add('Nested reference must not declare Skill frontmatter.', markdownFile);
|
|
71
|
+
}
|
|
72
|
+
if (/\bTODO\b/.test(source)) {
|
|
73
|
+
add('Skill contains unfinished TODO text.', markdownFile);
|
|
74
|
+
}
|
|
75
|
+
for (const forbidden of FORBIDDEN_V2_TERMS) {
|
|
76
|
+
if (forbidden.test(source)) {
|
|
77
|
+
add(`2.0 skill contains forbidden 1.x term: ${forbidden.source}`, markdownFile);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
for (const linkedSkill of extractSkillMentions(source)) {
|
|
81
|
+
if (!knownSkills.has(linkedSkill)) {
|
|
82
|
+
add(`Unknown skill reference: $${linkedSkill}`, markdownFile);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
for (const command of extractCommands(source)) {
|
|
86
|
+
const commandId = toCommandId(command);
|
|
87
|
+
if (!commandId || !knownCommandIds.has(commandId)) {
|
|
88
|
+
add(`Unknown 2.0 CLI command reference: openxiangda ${command}`, markdownFile);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
for (const reference of extractLocalMarkdownLinks(source)) {
|
|
92
|
+
const target = resolve(dirname(markdownFile), reference);
|
|
93
|
+
if (!(await isFile(target))) {
|
|
94
|
+
add(`Broken local reference: ${reference}`, markdownFile);
|
|
73
95
|
}
|
|
74
96
|
}
|
|
75
97
|
}
|
|
98
|
+
const commandReference = resolve(referencesRoot, 'commands.md');
|
|
99
|
+
if ((await isFile(commandReference)) &&
|
|
100
|
+
(await readFile(commandReference, 'utf8')) !==
|
|
101
|
+
renderDevkitCommandReference({
|
|
102
|
+
title: 'OpenXiangda 2.0 Commands',
|
|
103
|
+
executable: 'pnpm openxiangda',
|
|
104
|
+
})) {
|
|
105
|
+
add('Generated command reference drifted from DEVKIT_COMMANDS.', commandReference);
|
|
106
|
+
}
|
|
76
107
|
const agentFile = resolve(skillsRoot, skill.directory, 'agents/openai.yaml');
|
|
77
108
|
if (!(await isFile(agentFile))) {
|
|
78
109
|
add('Missing agents/openai.yaml.', agentFile);
|
|
@@ -181,7 +212,9 @@ function parseFrontmatter(source) {
|
|
|
181
212
|
.map(line => [line[1], line[2].replace(/^['"]|['"]$/g, '')]));
|
|
182
213
|
}
|
|
183
214
|
function extractCommands(source) {
|
|
184
|
-
return [
|
|
215
|
+
return [
|
|
216
|
+
...source.matchAll(/\bopenxiangda(?:@[^\s`]+)?\s+([a-z][a-z0-9:-]*(?:\s+[a-z][a-z0-9:-]*)?)/gi),
|
|
217
|
+
].map(match => match[1].trim().toLowerCase());
|
|
185
218
|
}
|
|
186
219
|
function extractSkillMentions(source) {
|
|
187
220
|
return [...source.matchAll(/\$([a-z0-9-]+)/g)].map(match => match[1]);
|
|
@@ -218,6 +251,22 @@ async function isDirectory(path) {
|
|
|
218
251
|
return false;
|
|
219
252
|
}
|
|
220
253
|
}
|
|
254
|
+
async function markdownFilesBelow(root) {
|
|
255
|
+
if (!(await isDirectory(root)))
|
|
256
|
+
return [];
|
|
257
|
+
const files = [];
|
|
258
|
+
const visit = async (directory) => {
|
|
259
|
+
for (const entry of await readdir(directory, { withFileTypes: true })) {
|
|
260
|
+
const path = resolve(directory, entry.name);
|
|
261
|
+
if (entry.isDirectory())
|
|
262
|
+
await visit(path);
|
|
263
|
+
else if (entry.isFile() && entry.name.endsWith('.md'))
|
|
264
|
+
files.push(path);
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
await visit(root);
|
|
268
|
+
return files.sort();
|
|
269
|
+
}
|
|
221
270
|
async function pathExists(path) {
|
|
222
271
|
try {
|
|
223
272
|
await stat(path);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAA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W,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,KAAK,EAAE,SAAiB,EAAE,EAAE;QACxC,KAAK,MAAM,KAAK,IAAI,MAAM,OAAO,CAAC,SAAS,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YACtE,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5C,IAAI,KAAK,CAAC,WAAW,EAAE;gBAAE,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;iBACtC,IAAI,KAAK,CAAC,MAAM,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC,CAAC;IACF,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openxiangda-skill-kit",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.85",
|
|
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.
|
|
20
|
+
"openxiangda-devkit-core": "2.0.0-alpha.67"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"tsx": "4.23.12",
|
package/skills/manifest.json
CHANGED
|
@@ -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": "
|
|
7
|
+
"sha256": "4e79de2626b4fe8ec1049cba8354db8447b2d93160957237df8ba6a3d547bc93"
|
|
8
8
|
}
|
|
9
9
|
]
|
|
10
10
|
}
|
|
@@ -5,7 +5,7 @@ description: Use when researching, designing, building, testing, or delivering a
|
|
|
5
5
|
|
|
6
6
|
# OpenXiangda 2.0
|
|
7
7
|
|
|
8
|
-
Treat requirement discovery, architecture, authorization, development, testing and delivery as one evidence-backed application lifecycle. OpenXiangda 2.0 has no compatibility surface: replace an incorrect alpha contract directly and never add aliases, migration branches, 1.x SDD, Umi, ProComponents, Function CRUD, application
|
|
8
|
+
Treat requirement discovery, architecture, authorization, development, testing and delivery as one evidence-backed application lifecycle. OpenXiangda 2.0 has no compatibility surface: replace an incorrect alpha contract directly and never add aliases, migration branches, 1.x SDD, Umi, ProComponents, Function CRUD, application-owned identity switching or another identity path.
|
|
9
9
|
|
|
10
10
|
Before a workspace exists, use this Skill's exact npm version:
|
|
11
11
|
|
|
@@ -22,13 +22,15 @@ pnpm dlx openxiangda@__OPENXIANGDA_VERSION__ skill install --force
|
|
|
22
22
|
|
|
23
23
|
Use this order:
|
|
24
24
|
|
|
25
|
-
1. Read [
|
|
26
|
-
2. Read [
|
|
27
|
-
3.
|
|
28
|
-
4. Read [
|
|
29
|
-
5.
|
|
30
|
-
6.
|
|
31
|
-
7.
|
|
25
|
+
1. Read [Commands](references/commands.md) when selecting a CLI operation. It is generated from the executable registry. `create` owns application binding and initialization, while `check`, `deploy` and `status` expose the current workspace and deployment facts.
|
|
26
|
+
2. Read [Discovery](references/discovery.md), turn the request into actors, scenarios, data, permissions, constraints and acceptance evidence, and identify every unresolved choice.
|
|
27
|
+
3. If the workspace contains `appspec/`, the user asks to maintain requirements, or the task changes observable behavior, read [AppSpec](references/appspec.md), load the bounded index with `pnpm openxiangda spec context --json`, then select only the relevant stable ID. AppSpec is optional and never a release gate; L0 changes create no record.
|
|
28
|
+
4. Read [Architecture](references/architecture.md), assign one owner to each capability and keep ordinary CRUD on platform Data API.
|
|
29
|
+
5. For every resource or permission change, read [Data and authorization](references/data-authz.md) before editing `openxiangda.config.ts`.
|
|
30
|
+
6. Read [Frontend](references/frontend.md) for pages or fields and [Backend actions](references/backend.md) only for a real business action.
|
|
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`.
|
|
33
|
+
9. Follow [Delivery](references/delivery.md): deploy preproduction first, inspect status/logs, then promote the exact successful version to production.
|
|
32
34
|
|
|
33
35
|
For an AI-native client, start the workspace protocol through the same pinned executable:
|
|
34
36
|
|
|
@@ -36,19 +38,21 @@ For an AI-native client, start the workspace protocol through the same pinned ex
|
|
|
36
38
|
pnpm exec openxiangda --mcp-stdio --cwd <workspace>
|
|
37
39
|
```
|
|
38
40
|
|
|
39
|
-
Read `openxiangda://workspace/contracts` or call `contract_describe`. Require `aiCatalog` and `aiCatalogDigest` to match the normal compiler output. Never create an application MCP server, Catalog file, preview store or AI authorization path.
|
|
41
|
+
Read `openxiangda://workspace/contracts` or call `contract_describe`. When AppSpec is enabled, read `openxiangda://workspace/appspec` or call `appspec_context`; treat it as advisory context, never as deployment authority. Require `aiCatalog` and `aiCatalogDigest` to match the normal compiler output. Never create an application MCP server, Catalog file, preview store or AI authorization path.
|
|
40
42
|
|
|
41
|
-
The browser uses the current logged-in user's complete application-role union. The platform is authoritative for capabilities, fields, rows and RLS. Application code does not
|
|
43
|
+
The browser uses the current logged-in user's complete application-role union. The platform is authoritative for capabilities, fields, rows and RLS. A declared Perspective is only a read projection over that union: it may narrow pages, rows and readable fields, but never create/update/delete, workflow or custom-action authorization. Omitted Perspective means the complete union. Application code does not replace the authenticated identity, persist a platform token, construct an authorization result or keep a second permission state.
|
|
42
44
|
|
|
43
45
|
Read only the references needed for the current change, except the mandatory discovery and Data/authorization rules above:
|
|
44
46
|
|
|
45
47
|
- [Discovery](references/discovery.md)
|
|
48
|
+
- [AppSpec](references/appspec.md)
|
|
49
|
+
- [Commands](references/commands.md)
|
|
46
50
|
- [Architecture](references/architecture.md)
|
|
47
51
|
- [Workspace agent contract](references/workspace.md)
|
|
48
52
|
- [Backend actions](references/backend.md)
|
|
49
53
|
- [Data and authorization](references/data-authz.md)
|
|
50
54
|
- [Frontend](references/frontend.md)
|
|
51
|
-
- [Workflow and Notification Hub](references/workflow-
|
|
55
|
+
- [Workflow, Events and Notification Hub](references/workflow-events.md)
|
|
52
56
|
- [Testing](references/testing.md)
|
|
53
57
|
- [Delivery](references/delivery.md)
|
|
54
58
|
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# AppSpec
|
|
2
|
+
|
|
3
|
+
AppSpec 是 OpenXiangda 2.0 应用仓库中的可选业务意图层。它帮助 AI 理解“为什么做、应当表现成
|
|
4
|
+
什么、这次改变什么”,但不复制 `openxiangda.config.ts`、编译合同、代码、测试或部署状态,也
|
|
5
|
+
不是发布门禁。
|
|
6
|
+
|
|
7
|
+
AppSpec 只使用 2.0 的 `appspec/`、文档 schema v1 与 context v2。绝不读取、识别、导入或迁移
|
|
8
|
+
1.x 的 `openspec/`、SDD、表单、页面、函数和发布材料。
|
|
9
|
+
|
|
10
|
+
## 何时读取
|
|
11
|
+
|
|
12
|
+
- 工作区存在 `appspec/` 时,在分析需求或修改行为前运行 `pnpm openxiangda spec context --json`,先读取
|
|
13
|
+
有界索引。
|
|
14
|
+
- 从索引选择相关变更、能力、ADR 或历史变更 ID,再运行例如
|
|
15
|
+
`pnpm openxiangda spec context booking-window --json` 读取正文。
|
|
16
|
+
- AI-native 客户端可读取 `openxiangda://workspace/appspec` 或调用 `appspec_context`。
|
|
17
|
+
- 默认不加载全部正文;历史变更只在追查原因时用稳定 ID 按需读取。
|
|
18
|
+
|
|
19
|
+
## 何时维护
|
|
20
|
+
|
|
21
|
+
| 风险 | 典型变化 | 最小维护量 |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| L0 | 重构、格式、无行为变化 | 不创建 ChangeSpec |
|
|
24
|
+
| L1 | 文案、单字段、局部规则 | 一份短 ChangeSpec |
|
|
25
|
+
| L2 | 跨资源、权限、状态变化 | 加正反验收、数据与回滚 |
|
|
26
|
+
| L3 | 身份、迁移、并发、外部副作用 | 加失败/幂等、资源边界和 ADR |
|
|
27
|
+
|
|
28
|
+
用户没有要求且变更是 L0 时,不要为了“流程完整”创建文档。小应用可以长期只维护 `app.md`。
|
|
29
|
+
|
|
30
|
+
## 标准操作
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm openxiangda spec init
|
|
34
|
+
pnpm openxiangda spec add-capability CAP-BOOKING --title "预约管理" --resources bookings
|
|
35
|
+
pnpm openxiangda spec new booking-window --title "限制可预约时段" --risk L1 \
|
|
36
|
+
--capabilities CAP-BOOKING --resources bookings
|
|
37
|
+
pnpm openxiangda spec context booking-window --json
|
|
38
|
+
pnpm openxiangda spec check
|
|
39
|
+
pnpm openxiangda spec close booking-window --current-spec merged \
|
|
40
|
+
--summary "已通过真实角色验收"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`spec check` 是用户主动选择的严格检查;普通 `check/dev/deploy` 只给 advisory,不因 AppSpec
|
|
44
|
+
缺失或不完整而失败。
|
|
45
|
+
|
|
46
|
+
新 ChangeSpec 的 `currentSpec` 固定从 `pending` 开始。关闭前先把长期有效结果合入 `app.md` 或相关
|
|
47
|
+
CapabilitySpec,再由用户确认 `merged`;不改变长期规格时由用户确认 `not-applicable`。AI 可以列出
|
|
48
|
+
未合入差异,但不能自行选择这两个值。稳定 REQ/AC 未进入当前规格、L2/L3 必需章节为空或保留默认
|
|
49
|
+
占位内容时,`spec close` 不移动文件。
|
|
50
|
+
|
|
51
|
+
## 写作边界
|
|
52
|
+
|
|
53
|
+
- `app.md` 记录长期目标、角色、范围、术语和跨能力约束。
|
|
54
|
+
- `capabilities/CAP-*.md` 记录当前有效需求,使用稳定 `REQ-*` 和可证伪 `AC-*`。
|
|
55
|
+
- `changes/active/*.md` 只记录本次 delta、风险、影响范围与验收;关闭前把仍有效的结论合入能力规格,
|
|
56
|
+
并由用户确认 `currentSpec`。
|
|
57
|
+
- `decisions/ADR-*.md` 只用于架构显著决定,不为普通小改创建。
|
|
58
|
+
- 引用真实 2.0 resource/action code,不抄字段定义和权限矩阵的机器事实。
|
|
59
|
+
- AI 可以创建 `draft`、指出未确认问题和建议更新,不能自行把需求标记为 `confirmed`。
|
|
60
|
+
- 不因 AppSpec 与实现冲突就静默修改其中一方;明确指出冲突,由用户决定业务意图,技术事实以实时
|
|
61
|
+
编译合同为准。
|
|
62
|
+
|
|
63
|
+
## 可迁移程度
|
|
64
|
+
|
|
65
|
+
完整 AppSpec 能显著提高另一个新项目复现业务逻辑的概率,但最终文档本身不等于可执行应用。
|
|
66
|
+
需要接近原应用时,应同时提供 AppSpec、`openxiangda.config.ts`、必要自定义动作、测试和外部接口
|
|
67
|
+
合同;历史 ChangeSpec 不是必需输入。
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# OpenXiangda 2.0 Backend
|
|
2
2
|
|
|
3
|
+
Read [Architecture](architecture.md) and [Data and authorization](data-authz.md)
|
|
4
|
+
before adding a backend. Finish with [Testing](testing.md).
|
|
5
|
+
|
|
3
6
|
Keep normal record CRUD in the platform Data API. Use `apps/server` only for typed business actions that need server-side logic. For an interactive request, the platform gateway supplies the verified current user, complete application-role union and capabilities. Controllers bind operations and capabilities through `openxiangda/nest`; workers continue to use their explicit application identity.
|
|
4
7
|
|
|
5
8
|
Every interactive business action uses `@OpenXiangdaOperation(operation)`. The
|
|
@@ -12,10 +15,18 @@ and do not author an `authorizationJSON` permission mirror. The platform still
|
|
|
12
15
|
records the initiating user and action code in records, files, events and audit.
|
|
13
16
|
|
|
14
17
|
`OpenXiangdaDataApiService` deliberately retains ordinary current-user Data
|
|
15
|
-
authorization
|
|
18
|
+
authorization and automatically inherits the request Perspective for reads.
|
|
19
|
+
Its writes still authorize against the complete role union. Do not use it to
|
|
20
|
+
implement a declared business action. The
|
|
16
21
|
business facade also rejects routes without immutable `OpenXiangdaOperation`
|
|
17
22
|
metadata, so a controller cannot silently gain trusted Data access.
|
|
18
23
|
|
|
24
|
+
If a custom controller bypasses the standard Data API and reads Nest-owned SQL,
|
|
25
|
+
an external service or another datastore, inject `@CurrentPerspective()` and
|
|
26
|
+
apply the declared role-based read projection explicitly. Perspective is not a
|
|
27
|
+
credential and must never change mutation authorization. Prefer moving ordinary
|
|
28
|
+
reads back to `OpenXiangdaDataApiService`, where the platform owns the contract.
|
|
29
|
+
|
|
19
30
|
Do not duplicate resource persistence in controllers. Keep actions bounded and side-effect behavior explicit. Run `pnpm openxiangda dev` for the connected loop and `pnpm openxiangda check` before delivery.
|
|
20
31
|
|
|
21
32
|
Keep the generated `apps/server/src/main.ts` on
|
|
@@ -57,14 +68,28 @@ Do not silence that diagnostic or replace the connected-development compiler.
|
|
|
57
68
|
|
|
58
69
|
Backend routes are private to the application unless their operation declaration contains an explicit `ai` block. Never infer AI exposure or risk from the HTTP method. A write action declares its touched resources and non-empty side effects, for example:
|
|
59
70
|
|
|
71
|
+
Build operation request and response schemas through
|
|
72
|
+
`resourceRecordSchema`, `schemaRef` and `composeAppOperationSchemas` from
|
|
73
|
+
`openxiangda/config`. These helpers project canonical field value protocols
|
|
74
|
+
from the same Resource declaration and prevent repeated user, department,
|
|
75
|
+
resource-reference or managed-file shapes. Do not import a physical toolchain
|
|
76
|
+
package or copy the JSON protocol by hand.
|
|
77
|
+
|
|
60
78
|
```ts
|
|
61
79
|
{
|
|
62
80
|
code: 'reservation.enroll',
|
|
63
81
|
method: 'POST',
|
|
64
82
|
path: '/api/reservations/enroll',
|
|
65
83
|
capability: 'app:visitor-app:reservation:enroll',
|
|
66
|
-
|
|
67
|
-
|
|
84
|
+
...composeAppOperationSchemas({
|
|
85
|
+
request: resourceRecordSchema(visitorReservations, {
|
|
86
|
+
fields: ['visitorName', 'visitDate', 'startTime'],
|
|
87
|
+
}),
|
|
88
|
+
response: schemaRef('ReservationRecord'),
|
|
89
|
+
definitions: {
|
|
90
|
+
ReservationRecord: resourceRecordSchema(visitorReservations),
|
|
91
|
+
},
|
|
92
|
+
}),
|
|
68
93
|
ai: {
|
|
69
94
|
name: '预约访客',
|
|
70
95
|
description: '校验预约规则并创建访客预约',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# OpenXiangda 2.0 Commands
|
|
2
|
+
|
|
3
|
+
> Generated from `DEVKIT_COMMANDS`. Do not edit manually.
|
|
4
|
+
|
|
5
|
+
| Command | Risk | Purpose |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `pnpm openxiangda create` | deploy | 创建、绑定并初始化应用 |
|
|
8
|
+
| `pnpm openxiangda dev` | write-local | 连接平台测试数据启动本地 Web 与 Nest |
|
|
9
|
+
| `pnpm openxiangda check` | write-local | 生成契约并执行检查、测试和构建 |
|
|
10
|
+
| `pnpm openxiangda accept` | deploy | 按计划准备可选的真实预发验收身份 |
|
|
11
|
+
| `pnpm openxiangda deploy` | deploy | 部署测试环境或显式复用测试版本部署生产 |
|
|
12
|
+
| `pnpm openxiangda status` | read | 查询最近或指定部署状态 |
|
|
13
|
+
| `pnpm openxiangda logs` | read | 查询最近或指定部署日志 |
|
|
14
|
+
| `pnpm openxiangda cancel` | deploy | 幂等取消尚未提交激活的部署 |
|
|
15
|
+
| `pnpm openxiangda retry` | deploy | 显式重试可恢复的失败部署 |
|
|
16
|
+
| `pnpm openxiangda start` | deploy | 从当前不可变版本启动应用环境 |
|
|
17
|
+
| `pnpm openxiangda stop` | deploy | 将应用环境缩容为零并保留数据 |
|
|
18
|
+
| `pnpm openxiangda rollback` | deploy | 回滚测试或生产环境 |
|
|
19
|
+
| `pnpm openxiangda login` | write-local | 通过平台浏览器授权登录 |
|
|
20
|
+
| `pnpm openxiangda skill` | write-local | 安装当前版本的 AI Skill |
|
|
21
|
+
| `pnpm openxiangda spec` | write-local | 维护可选的 AppSpec 需求与变更辅助 |
|
|
@@ -60,6 +60,36 @@ also granted only to the intended roles. They are owned and exported by the
|
|
|
60
60
|
generated field policy, so do not repeat them in `authz.capabilities`.
|
|
61
61
|
`authz.capabilities` contains only explicit `backend` or `ui` capabilities.
|
|
62
62
|
|
|
63
|
+
Declare optional work Perspectives once at the application root. A Perspective
|
|
64
|
+
references existing role codes; the compiler derives its readable capability
|
|
65
|
+
projection, so never hand-author `capabilityCodes` or duplicate row filters:
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
export default defineOpenXiangdaApp({
|
|
69
|
+
// ...identity, authz and data...
|
|
70
|
+
perspectives: [
|
|
71
|
+
{
|
|
72
|
+
code: 'reception-desk',
|
|
73
|
+
name: '接待人员视角',
|
|
74
|
+
roleCodes: ['reception_staff'],
|
|
75
|
+
default: true,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
code: 'visitor-admin',
|
|
79
|
+
name: '访客管理员视角',
|
|
80
|
+
roleCodes: ['visitor_admin'],
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The runtime offers only Perspectives whose `roleCodes` intersect the current
|
|
87
|
+
user's actual application-role union. Selecting one sends
|
|
88
|
+
`X-OpenXiangda-Perspective` on standard reads. Native Data intersects the
|
|
89
|
+
normal authorized role union with that Perspective before capability, field,
|
|
90
|
+
row-policy and RLS evaluation. Omit the header for the complete union. Never
|
|
91
|
+
use Perspective to guard writes, workflows or custom actions.
|
|
92
|
+
|
|
63
93
|
`required: true` owns both storage nullability and form validation. A field
|
|
64
94
|
without `access` inherits the resource read/create/update capability. Each
|
|
65
95
|
access array is all-of; `false` is explicit deny. The same arrays drive the
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# OpenXiangda 2.0 Frontend
|
|
2
2
|
|
|
3
|
+
Read [Data and authorization](data-authz.md) for every resource or permission
|
|
4
|
+
change and keep the generated [workspace contract](workspace.md) authoritative.
|
|
5
|
+
|
|
3
6
|
Use the official Vite + React Router + Refine Core + Ant Design template. Import the platform-owned runtime from `openxiangda/react`, field controls from `openxiangda/field-kit` and clients/types from `openxiangda/core`. Do not copy these implementations into application source and do not add per-resource function wrappers.
|
|
4
7
|
|
|
5
8
|
Generated desktop lists already own row selection, atomic batch update/delete,
|
|
@@ -7,4 +10,47 @@ CSV/XLS/XLSX preview import, export, filters, column settings and density. Keep
|
|
|
7
10
|
imports at 100 rows per transaction, use exact declared labels or field codes,
|
|
8
11
|
and leave attachment values to the platform managed-file component.
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
Declare searchable and filterable fields on the resource and let the standard
|
|
14
|
+
CRUD renderer compose the search area. Keyword search spans the declared
|
|
15
|
+
searchable fields; the first two filters remain inline and additional filters
|
|
16
|
+
open in the platform's large modal. The renderer also preserves declaration
|
|
17
|
+
order for form fields and removes authorization/debug explanations from the
|
|
18
|
+
business UI. Do not create application-owned search toolbars, field ordering
|
|
19
|
+
maps, permission tips or per-resource CRUD pages for these standard behaviors.
|
|
20
|
+
|
|
21
|
+
Read the current user, complete application-role union and capabilities from the platform runtime authorization endpoint. There is no application-selected active role or identity switch. The standard Shell owns the optional Perspective selector. Use `hasReadCapability` for navigation, list/detail visibility and readable fields; continue to use `hasCapability` for create/update/delete, workflows and custom actions. The standard client sends the selected Perspective automatically, and the server repeats the projection for rows, fields and RLS. Never implement resource-specific frontend filters for it. Strip unauthorized fields from create and update payloads and never treat a disabled input as server authorization. Verify with `pnpm openxiangda check`.
|
|
22
|
+
|
|
23
|
+
Use the standard `Shell` unchanged. It owns the authenticated user's display
|
|
24
|
+
name, account identifier, safe avatar upload, localized application-role names,
|
|
25
|
+
theme controls, Perspective selection and navigation scroll restoration. It
|
|
26
|
+
also owns directory field requests under the current logged-in user's role
|
|
27
|
+
union. Never fetch identity for the header, display role codes, add a second
|
|
28
|
+
identity selector, or copy Shell and
|
|
29
|
+
directory-client implementations into application source.
|
|
30
|
+
|
|
31
|
+
For a custom admin operation page, declare the route in
|
|
32
|
+
`openxiangda.config.ts`, import the generated `appRoutes`, and bind every route
|
|
33
|
+
key to exactly one local React page with `defineAdminContributions` from
|
|
34
|
+
`openxiangda/react`. Pass the result to `OpenXiangdaApplication`. Do not wrap the
|
|
35
|
+
page in another `Shell`: the runtime registers it in the unified router and the
|
|
36
|
+
same Shell owns its menu entry, title, history and direct-URL capability gate.
|
|
37
|
+
Only `navigation: 'menu'` routes enter the menu; hidden routes retain the same
|
|
38
|
+
`capability` or `access.allOf/anyOf`, including ancestor constraints. Never add
|
|
39
|
+
an application-owned layout, router, menu, identity provider or permission
|
|
40
|
+
store. Keep operation pages under `/admin/operations`; parameterized routes are
|
|
41
|
+
hidden so they cannot become unresolved menu links.
|
|
42
|
+
|
|
43
|
+
For a small business action on a generated resource page, use the typed
|
|
44
|
+
`resources[resourceCode].toolbar`, `.row` or `.detail` slots accepted by
|
|
45
|
+
`defineAdminContributions`. Declare a stable action code, label and
|
|
46
|
+
capability/access expression. The render context contains only the current
|
|
47
|
+
resource, already-authorized record or selection, and a bounded `refresh()`;
|
|
48
|
+
it does not own CRUD, revisions, fields or authorization. Invoke a guarded Nest
|
|
49
|
+
App Operation for cross-resource transactions, invariants or side effects and
|
|
50
|
+
leave ordinary CRUD on the Native Data API. Do not copy a generated page just
|
|
51
|
+
to insert a button.
|
|
52
|
+
|
|
53
|
+
Generated contracts intentionally emit each resource Surface once in
|
|
54
|
+
`resourceSurfaces`; `resourceDefinitions[code].surface` references that shared
|
|
55
|
+
object. Import the generated runtime definitions normally. Do not serialize,
|
|
56
|
+
inline or duplicate Surface literals in application code.
|
|
@@ -19,6 +19,15 @@ For each changed resource, verify the real chain:
|
|
|
19
19
|
5. stored values and audit records match the declared shape;
|
|
20
20
|
6. PostgreSQL/RLS remains authoritative, including current-user and multi-role-union cases.
|
|
21
21
|
|
|
22
|
+
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
|
|
25
|
+
generator/runtime regression to fix; never raise the application budget or copy
|
|
26
|
+
generated contracts into a smaller application-local format. Browser acceptance
|
|
27
|
+
must also cover the large more-filters modal, declaration-order forms, hidden
|
|
28
|
+
developer-only authorization copy, real account/role labels, avatar update and
|
|
29
|
+
left-menu scroll preservation across route changes.
|
|
30
|
+
|
|
22
31
|
Mock and unit tests are useful but do not close remote acceptance. When real
|
|
23
32
|
identity acceptance is needed, create a short-lived local plan and run:
|
|
24
33
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
# Workflow and Notification Hub
|
|
1
|
+
# Workflow, Events and Notification Hub
|
|
2
|
+
|
|
3
|
+
Read [Architecture](architecture.md), [Data and authorization](data-authz.md)
|
|
4
|
+
and [Testing](testing.md) before enabling this optional layer.
|
|
2
5
|
|
|
3
6
|
Use these optional modules only when the application has a real standard approval or cross-channel notification requirement. Ordinary CRUD and application-specific state machines stay on Data API/App API and must not pull Workflow or Notification code into the default template.
|
|
4
7
|
|
|
@@ -8,7 +11,7 @@ Use these optional modules only when the application has a real standard approva
|
|
|
8
11
|
- Workflow Kernel v2 owns definitions, instances, tasks, participants, commands, transitions and audit facts.
|
|
9
12
|
- Application Events v2 owns durable facts and delivery.
|
|
10
13
|
- Notification Hub v2 owns templates, rules, logical messages, channel delivery, callbacks and message operations.
|
|
11
|
-
- Native Identity/AuthZ v2 owns the current user and the union of that user's current application roles.
|
|
14
|
+
- Native Identity/AuthZ v2 owns the current user and the union of that user's current application roles. Perspective is read-only and never changes workflow participation or action authorization.
|
|
12
15
|
- Never import, query, migrate or call 1.x workflow/message code, tables, APIs, queues, templates or callbacks.
|
|
13
16
|
|
|
14
17
|
## Workflow declaration
|
|
@@ -46,7 +49,7 @@ Template variables must be declared by JSON Schema and stay within the field pol
|
|
|
46
49
|
|
|
47
50
|
## Detail navigation
|
|
48
51
|
|
|
49
|
-
Use a canonical navigation target with `PLATFORM_ROUTE`, `APP_ROUTE` or allowlisted `EXTERNAL_URL`, stable route code, path/query parameters and an authenticated access requirement. Do not place environment domains, bearer tokens, cookies,
|
|
52
|
+
Use a canonical navigation target with `PLATFORM_ROUTE`, `APP_ROUTE` or allowlisted `EXTERNAL_URL`, stable route code, path/query parameters and an authenticated access requirement. Do not place environment domains, bearer tokens, cookies, identity-switching credentials or secrets in template strings.
|
|
50
53
|
|
|
51
54
|
The Notification Hub resolves desktop, mobile and channel deep links. The landing page always re-runs platform authentication and Data/AuthZ/Workflow authorization.
|
|
52
55
|
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
# OpenXiangda 2.0 Application Agent Contract
|
|
2
2
|
|
|
3
3
|
- Use only the workspace-pinned CLI: `pnpm openxiangda <command>`. Never invoke a bare global `openxiangda` inside a 2.0 task.
|
|
4
|
+
- `appspec/` is the optional OpenXiangda 2.0 business-intent layer. Before changing observable behavior, read the bounded index with `pnpm openxiangda spec context --json`, then select only the relevant stable ID; use no ChangeSpec for L0 work, one short ChangeSpec for L1, and add permission/rollback/concurrency detail only for L2/L3. Before close, the user—not AI—confirms `currentSpec=merged` or `not-applicable`. AppSpec is advisory and never a release gate. Never read, import or migrate 1.x `openspec/` or SDD.
|
|
4
5
|
- Use Vite, React Router, Refine Core and Ant Design. Do not add Umi, ProComponents or another admin shell.
|
|
6
|
+
- Keep generated admin routes and custom actions inside the platform Shell. Bind generated `appRoutes` to local operation pages with `defineAdminContributions`, and use only its typed `toolbar`, `row` and `detail` resource slots. Do not create another router, menu, layout, identity provider, permission store or copied CRUD page; route/action access uses capability or `allOf`/`anyOf`, while Data/App API authorization remains server-owned.
|
|
5
7
|
- Declare each resource once in `openxiangda.config.ts` with only `code`, `name`, `fields` and optional list/layout/data-policy settings. Each field owns type, label, required state, Surface flags, reference/file metadata and access. Resource codes are lower kebab-case.
|
|
6
8
|
- Never write resource-level `schemaVersion`, `appCode`, `schema`, `surface`, `capabilities`, `fieldPolicies` or `platform/data` modules. The compiler derives the strict DataResource, CRUD capabilities, Surface and AI Schema. The application manifest still starts with its one top-level `schemaVersion: 3`.
|
|
7
9
|
- Ordinary list/get/create/update/delete, filters, export and batch operations use the platform Native Data API. Do not create Function CRUD or NestJS wrappers.
|
|
8
10
|
- Add NestJS only for a named business action that needs a cross-resource transaction, an invariant or an external side effect.
|
|
9
11
|
- Every interactive business action binds `@OpenXiangdaOperation(operation)` and injects `OpenXiangdaBusinessDataApiService` or `OpenXiangdaStandardOperations`. The platform checks the action capability once at App API ingress; the trusted backend then has full Data access only to its exact application/environment while audit retains the initiating user. Do not author `authorizationJSON` or reapply the user's resource, row and field permissions inside the action.
|
|
10
12
|
- A NestJS backend declares only `enabled`, `isolation: 'shared' | 'dedicated'` and `resourceProfile: 'light' | 'standard'`. Never put raw Kubernetes resources, replicas, ports or environment maps in application metadata; the platform owns capacity and scaling.
|
|
11
|
-
- Use the current logged-in user and the union of that user's application roles.
|
|
13
|
+
- Use the current logged-in user and the union of that user's application roles. An optional declared Perspective projects only read visibility (pages, rows and fields); create/update/delete, workflows and custom actions continue to authorize against the complete union. Standard Data API calls inherit `X-OpenXiangda-Perspective` automatically. Use `@CurrentPerspective()` only when custom Nest code reads outside the standard Data API, and apply an equivalent read projection explicitly. Business code must not persist a platform Token or authorization result and must not implement a second identity path.
|
|
12
14
|
- Fields inherit the resource read/create/update capabilities. Use field `access` only to tighten them; arrays are all-of and `false` is explicit deny. There is no `write` fallback.
|
|
13
15
|
- Field `type` is semantic, never a hand-authored database type. The supported catalog is exactly `text.short`, `text.long`, `text.rich`, `number.integer`, `number.decimal`, `boolean`, `date`, `time`, `datetime`, `date-range`, `datetime-range`, `option.single`, `option.multiple`, `cascade.single`, `cascade.multiple`, `user.single`, `user.multiple`, `department.single`, `department.multiple`, `resource-ref.single`, `resource-ref.multiple`, `file`, `image`, `signature`, `address`, `location`, `json`, `serial-number`, `uuid` and `subtable`. The compiler alone derives PostgreSQL columns, constraints and indexes.
|
|
14
16
|
- Declare every custom operation capability in `authz.capabilities` with `kind: 'backend'`, then reference that same code from the operation and its allowed roles. Generated resource CRUD capabilities do not go in this catalog.
|
|
17
|
+
- Build App Operation request/response schemas with `resourceRecordSchema`, `schemaRef`, `composeJsonSchema` and `composeAppOperationSchemas` from `openxiangda/config`. They project the same Resource declaration and canonical field value protocols; never import a physical toolchain package or repeat user, department, resource-reference or managed-file schemas by hand.
|
|
15
18
|
- 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.
|
|
16
19
|
- 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.
|
|
17
20
|
- `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`.
|
|
@@ -19,4 +22,4 @@
|
|
|
19
22
|
- 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.
|
|
20
23
|
- Standard Workflow and Notification Hub are optional 2.0 modules. Enable them only through the canonical `openxiangda.config.ts` declarations and generated clients; never copy 1.x workflow/message code, tables, APIs, templates or callbacks into this workspace. Keep ordinary CRUD and application-specific state machines independent of them.
|
|
21
24
|
- 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.
|
|
22
|
-
- AI-native clients start the workspace protocol through the same pinned binary: `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`. Read `openxiangda://workspace/contracts` or call `contract_describe
|
|
25
|
+
- AI-native clients start the workspace protocol through the same pinned binary: `pnpm exec openxiangda --mcp-stdio --cwd <workspace>`. Read `openxiangda://workspace/contracts` or call `contract_describe`; when AppSpec is enabled, also read `openxiangda://workspace/appspec` or call `appspec_context`. Require `aiCatalog` and `aiCatalogDigest` to match the normal compiler output. This is a stdio transport mode, not another application-owned server. Never write an application MCP server, Catalog file, preview store or second authorization path.
|