@rsconcept/rstool 1.3.0 → 1.4.0

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 (104) hide show
  1. package/README.md +4 -4
  2. package/dist/{agent-workflow-Gk0Vfnv1.d.ts → agent-workflow-D22FeODL.d.ts} +6 -6
  3. package/dist/{analysis-LLnPhmGa.d.ts → analysis-DA44pfgA.d.ts} +4 -3
  4. package/dist/common-D6TFl6l_.d.ts +11 -0
  5. package/dist/{constituenta-DnGR6bnM.d.ts → constituenta-QY5w1x91.d.ts} +7 -7
  6. package/dist/diagnostic-C6TRoBgt.d.ts +38 -0
  7. package/dist/diagnostic-assembly-DRunIcKQ.js +54 -0
  8. package/dist/diagnostic-assembly-DRunIcKQ.js.map +1 -0
  9. package/dist/{evaluation-Cns8BFm4.d.ts → evaluation-Cd4S7-3t.d.ts} +4 -3
  10. package/dist/index.d.ts +12 -12
  11. package/dist/index.js +4 -3
  12. package/dist/mappers/model-adapter.d.ts +3 -3
  13. package/dist/mappers/model-adapter.js +1 -199
  14. package/dist/mappers/schema-adapter.d.ts +5 -5
  15. package/dist/mappers/schema-adapter.js +8 -8
  16. package/dist/mappers/schema-adapter.js.map +1 -1
  17. package/dist/mappers/types.d.ts +6 -6
  18. package/dist/mappers/types.js +6 -10
  19. package/dist/mappers/types.js.map +1 -1
  20. package/dist/model-adapter-D-YmIvQW.js +225 -0
  21. package/dist/model-adapter-D-YmIvQW.js.map +1 -0
  22. package/dist/{model-value-BbonPzMz.d.ts → model-value-BUhr2IjA.d.ts} +2 -2
  23. package/dist/models/agent-workflow.d.ts +1 -1
  24. package/dist/models/analysis.d.ts +1 -1
  25. package/dist/models/common.d.ts +2 -2
  26. package/dist/models/common.js +1 -1
  27. package/dist/models/constituenta.d.ts +1 -1
  28. package/dist/models/diagnostic.d.ts +2 -2
  29. package/dist/models/diagnostic.js +3 -1
  30. package/dist/models/evaluation.d.ts +1 -1
  31. package/dist/models/index.d.ts +11 -11
  32. package/dist/models/index.js +3 -2
  33. package/dist/models/model-value.d.ts +1 -1
  34. package/dist/models/rstool-agent.d.ts +1 -1
  35. package/dist/models/rstool-agent.js +1 -1
  36. package/dist/models/session.d.ts +1 -1
  37. package/dist/models/tool-contract.d.ts +1 -1
  38. package/dist/models/tool-contract.js +1 -1
  39. package/dist/models/tool-contract.js.map +1 -1
  40. package/dist/{models-9G6ur_pg.js → models-DTLctDmB.js} +72 -15
  41. package/dist/models-DTLctDmB.js.map +1 -0
  42. package/dist/{rstool-agent-D2cQze_b.d.ts → rstool-agent-BMVAyMAG.d.ts} +11 -10
  43. package/dist/session/session-store.d.ts +6 -6
  44. package/dist/session/session-store.js +1 -1
  45. package/dist/{session-ChexW8i7.d.ts → session-CI4rLYby.d.ts} +3 -3
  46. package/dist/{tool-contract-0uRGhEfW.d.ts → tool-contract-sQfr-DYD.d.ts} +12 -12
  47. package/dist/wrapper/stdio-wrapper.js +1 -1
  48. package/docs/DIAGNOSTICS.md +63 -20
  49. package/examples/README.md +2 -0
  50. package/examples/agent-client.ts +15 -3
  51. package/examples/audit-diagnostics.ts +40 -0
  52. package/examples/chocolate-nim/build-rsform.ts +15 -0
  53. package/examples/chocolate-nim/build-rsmodel.ts +15 -22
  54. package/examples/chocolate-nim/model-demo.ts +11 -0
  55. package/examples/chocolate-nim/rsform-session.json +329 -310
  56. package/examples/chocolate-nim/rsmodel-session.json +311 -311
  57. package/examples/diagnostics-utils.ts +25 -0
  58. package/examples/expression-bank/bank-constituents.ts +10 -10
  59. package/examples/expression-bank/build-rsform.ts +8 -0
  60. package/examples/expression-bank/rsform-session.json +1501 -1501
  61. package/examples/kinship/build-rsform.ts +16 -1
  62. package/examples/kinship/build-rsmodel.ts +15 -56
  63. package/examples/kinship/model-demo.ts +35 -0
  64. package/examples/kinship/rsform-session.json +300 -215
  65. package/examples/kinship/rsmodel-session.json +216 -216
  66. package/examples/movd/build-rsform.ts +15 -0
  67. package/examples/movd/build-rsmodel.ts +15 -46
  68. package/examples/movd/model-demo.ts +31 -0
  69. package/examples/movd/rsform-session.json +359 -270
  70. package/examples/movd/rsmodel-session.json +263 -263
  71. package/examples/sample/build-rsform.ts +43 -3
  72. package/examples/sample/build-rsmodel.ts +26 -2
  73. package/examples/sample/rsform-session.json +41 -12
  74. package/examples/sample/rsmodel-session.json +37 -37
  75. package/examples/template-apply/build-rsform.ts +26 -9
  76. package/examples/template-apply/rsform-session.json +100 -45
  77. package/package.json +3 -2
  78. package/skills/rstool-helper/EXAMPLES.md +3 -1
  79. package/skills/rstool-helper/GUIDE.md +7 -6
  80. package/skills/rstool-helper/REFERENCE.md +19 -19
  81. package/src/index.ts +7 -4
  82. package/src/mappers/diagnostic-assembly.ts +96 -0
  83. package/src/mappers/diagnostics-collector.test.ts +63 -0
  84. package/src/mappers/diagnostics-collector.ts +73 -0
  85. package/src/mappers/model-adapter.ts +28 -99
  86. package/src/mappers/rsform-builder.ts +127 -0
  87. package/src/mappers/schema-adapter.ts +19 -15
  88. package/src/mappers/types.ts +12 -12
  89. package/src/models/agent-workflow.ts +2 -2
  90. package/src/models/analysis.ts +3 -2
  91. package/src/models/common.ts +0 -12
  92. package/src/models/constituenta.ts +4 -4
  93. package/src/models/diagnostic.ts +15 -10
  94. package/src/models/evaluation.ts +3 -8
  95. package/src/models/index.ts +8 -2
  96. package/src/models/rstool-agent.test.ts +66 -5
  97. package/src/models/rstool-agent.ts +22 -10
  98. package/src/models/tool-contract.ts +4 -4
  99. package/src/session/persistence.ts +2 -2
  100. package/src/session/session-store.ts +14 -7
  101. package/dist/common-DHJalS-Q.d.ts +0 -22
  102. package/dist/diagnostic-D9yl_mEL.d.ts +0 -19
  103. package/dist/mappers/model-adapter.js.map +0 -1
  104. package/dist/models-9G6ur_pg.js.map +0 -1
@@ -1,8 +1,12 @@
1
1
  import { writeFile } from 'node:fs/promises';
2
2
  import { resolve } from 'node:path';
3
3
 
4
+ import { TUPLE_ID } from '@rsconcept/domain';
5
+
4
6
  import { CstType, RSToolWrapperClient, type AgentConstituentaPatch, type ApplySchemaPatchResult } from '../../src';
5
7
 
8
+ import { assertCleanDiagnostics } from '../diagnostics-utils';
9
+
6
10
  async function run() {
7
11
  const client = new RSToolWrapperClient({
8
12
  cwd: resolve(process.cwd())
@@ -13,13 +17,21 @@ async function run() {
13
17
  const session = await client.call<{ sessionId: string; contractVersion: string }>('createSession');
14
18
 
15
19
  const items: AgentConstituentaPatch[] = [
16
- { id: 1, alias: 'X1', cstType: CstType.BASE, definitionFormal: '' },
17
- { id: 2, alias: 'C1', cstType: CstType.CONSTANT, definitionFormal: '' },
20
+ { id: 1, alias: 'X1', cstType: CstType.BASE, definitionFormal: '', term: 'element', convention: 'people' },
21
+ {
22
+ id: 2,
23
+ alias: 'C1',
24
+ cstType: CstType.CONSTANT,
25
+ definitionFormal: '',
26
+ term: 'count',
27
+ convention: 'natural numbers'
28
+ },
18
29
  {
19
30
  id: 3,
20
31
  alias: 'S1',
21
32
  cstType: CstType.STRUCTURED,
22
33
  definitionFormal: 'ℬ(X1×X1)',
34
+ term: 'parent-child pairs',
23
35
  convention: 'Pairs (parent, child) over X1.'
24
36
  },
25
37
  { id: 4, alias: 'D1', cstType: CstType.TERM, definitionFormal: 'Pr1(S1)' },
@@ -33,7 +45,35 @@ async function run() {
33
45
  for (const item of result.summary.items) {
34
46
  console.log(`Added ${item.alias}`);
35
47
  }
36
- console.log(`Patch diagnostics: ${result.diagnostics.length}`);
48
+ const diags = await client.call<Array<{ kind: string; error: { code: number } }>>('listDiagnostics', {
49
+ sessionId: session.sessionId
50
+ });
51
+ const counts = { expression: 0, schema: 0, model: 0 };
52
+ for (const record of diags) {
53
+ if (record.kind in counts) {
54
+ counts[record.kind as keyof typeof counts] += 1;
55
+ }
56
+ }
57
+ console.log(
58
+ `Patch diagnostics: ${result.diagnostics.length} (expression ${counts.expression}, schema ${counts.schema}, model ${counts.model})`
59
+ );
60
+
61
+ await client.call('setModelValues', {
62
+ sessionId: session.sessionId,
63
+ set: [
64
+ { target: 1, value: { 0: 'alice', 1: 'bob' } },
65
+ { target: 2, value: { 0: 'zero', 1: 'one', 2: 'two' } },
66
+ { target: 3, value: [[TUPLE_ID, 0, 1]] }
67
+ ]
68
+ });
69
+ await client.call('recalculateModel', { sessionId: session.sessionId });
70
+
71
+ await assertCleanDiagnostics(
72
+ client,
73
+ session.sessionId,
74
+ new Map(items.map(item => [item.id!, item.alias])),
75
+ 'sample RSForm'
76
+ );
37
77
 
38
78
  await client.call('commitStep', {
39
79
  sessionId: session.sessionId,
@@ -5,6 +5,8 @@ import { TUPLE_ID } from '@rsconcept/domain';
5
5
 
6
6
  import { CstType, RSToolWrapperClient, type AgentConstituentaPatch } from '../../src';
7
7
 
8
+ import { assertCleanDiagnostics } from '../diagnostics-utils';
9
+
8
10
  async function run() {
9
11
  const client = new RSToolWrapperClient({
10
12
  cwd: resolve(process.cwd())
@@ -15,13 +17,28 @@ async function run() {
15
17
  const session = await client.call<{ sessionId: string; contractVersion: string }>('createSession');
16
18
 
17
19
  const items: AgentConstituentaPatch[] = [
18
- { id: 1, alias: 'X1', cstType: CstType.BASE, definitionFormal: '' },
19
- { id: 2, alias: 'C1', cstType: CstType.CONSTANT, definitionFormal: '' },
20
+ {
21
+ id: 1,
22
+ alias: 'X1',
23
+ cstType: CstType.BASE,
24
+ definitionFormal: '',
25
+ term: 'element',
26
+ convention: 'people'
27
+ },
28
+ {
29
+ id: 2,
30
+ alias: 'C1',
31
+ cstType: CstType.CONSTANT,
32
+ definitionFormal: '',
33
+ term: 'count',
34
+ convention: 'natural numbers'
35
+ },
20
36
  {
21
37
  id: 3,
22
38
  alias: 'S1',
23
39
  cstType: CstType.STRUCTURED,
24
40
  definitionFormal: 'ℬ(X1×X1)',
41
+ term: 'parent-child pairs',
25
42
  convention: 'Pairs (parent, child) over X1.'
26
43
  },
27
44
  { id: 4, alias: 'D1', cstType: CstType.TERM, definitionFormal: 'Pr1(S1)' },
@@ -64,6 +81,13 @@ async function run() {
64
81
  recalculatedItems.map(item => ({ alias: item.alias, status: item.status }))
65
82
  );
66
83
 
84
+ await assertCleanDiagnostics(
85
+ client,
86
+ session.sessionId,
87
+ new Map(items.map(item => [item.id!, item.alias])),
88
+ 'sample RSModel'
89
+ );
90
+
67
91
  await client.call('commitStep', {
68
92
  sessionId: session.sessionId,
69
93
  message: 'Built sample RSModel'
@@ -1,16 +1,16 @@
1
1
  {
2
- "contractVersion": "2.0.0",
2
+ "contractVersion": "2.1.0",
3
3
  "state": {
4
- "sessionId": "a03eec4c-6519-4088-9d8c-0a9c11611583",
4
+ "sessionId": "eceb8650-bdf9-48a4-8ba4-5f397ae6d68b",
5
5
  "alias": "",
6
6
  "title": "",
7
7
  "comment": "",
8
- "createdAt": "2026-07-01T21:33:21.321Z",
9
- "updatedAt": "2026-07-01T21:33:21.332Z",
8
+ "createdAt": "2026-07-06T14:49:41.608Z",
9
+ "updatedAt": "2026-07-06T14:49:41.649Z",
10
10
  "revisions": [
11
11
  {
12
- "revisionId": "4ec113d2-1d28-4bac-bed8-6a593bb6b0e2",
13
- "at": "2026-07-01T21:33:21.332Z",
12
+ "revisionId": "5b8e8140-b659-4125-b3ac-1e2e937d817c",
13
+ "at": "2026-07-06T14:49:41.649Z",
14
14
  "message": "Built sample RSForm"
15
15
  }
16
16
  ],
@@ -20,9 +20,9 @@
20
20
  "alias": "X1",
21
21
  "cstType": "basic",
22
22
  "definitionFormal": "",
23
- "term": "",
23
+ "term": "element",
24
24
  "definitionText": "",
25
- "convention": "",
25
+ "convention": "people",
26
26
  "analysis": {
27
27
  "success": true,
28
28
  "type": {
@@ -41,9 +41,9 @@
41
41
  "alias": "C1",
42
42
  "cstType": "constant",
43
43
  "definitionFormal": "",
44
- "term": "",
44
+ "term": "count",
45
45
  "definitionText": "",
46
- "convention": "",
46
+ "convention": "natural numbers",
47
47
  "analysis": {
48
48
  "success": true,
49
49
  "type": {
@@ -65,7 +65,7 @@
65
65
  "alias": "S1",
66
66
  "cstType": "structure",
67
67
  "definitionFormal": "ℬ(X1×X1)",
68
- "term": "",
68
+ "term": "parent-child pairs",
69
69
  "definitionText": "",
70
70
  "convention": "Pairs (parent, child) over X1.",
71
71
  "analysis": {
@@ -130,7 +130,36 @@
130
130
  }
131
131
  ],
132
132
  "model": {
133
- "items": []
133
+ "items": [
134
+ {
135
+ "id": 1,
136
+ "type": "basic",
137
+ "value": {
138
+ "0": "alice",
139
+ "1": "bob"
140
+ }
141
+ },
142
+ {
143
+ "id": 2,
144
+ "type": "basic",
145
+ "value": {
146
+ "0": "zero",
147
+ "1": "one",
148
+ "2": "two"
149
+ }
150
+ },
151
+ {
152
+ "id": 3,
153
+ "type": "ℬ(X1×X1)",
154
+ "value": [
155
+ [
156
+ -111,
157
+ 0,
158
+ 1
159
+ ]
160
+ ]
161
+ }
162
+ ]
134
163
  }
135
164
  },
136
165
  "diagnostics": []
@@ -1,32 +1,36 @@
1
1
  {
2
- "contractVersion": "2.0.0",
2
+ "contractVersion": "2.1.0",
3
3
  "state": {
4
- "sessionId": "4de6414b-d6a7-45c9-b950-2e622e0caa0e",
4
+ "sessionId": "3cf269f7-edd8-4bba-bce0-12c2b0c2e51f",
5
5
  "alias": "",
6
6
  "title": "",
7
7
  "comment": "",
8
- "createdAt": "2026-07-01T17:13:04.299Z",
9
- "updatedAt": "2026-07-01T17:13:04.322Z",
8
+ "createdAt": "2026-07-06T14:49:44.425Z",
9
+ "updatedAt": "2026-07-06T14:49:44.479Z",
10
10
  "revisions": [
11
11
  {
12
- "revisionId": "9a11d6ff-a181-4680-b706-1507d776c5ac",
13
- "at": "2026-07-01T17:13:04.322Z",
12
+ "revisionId": "3226c676-ab84-4e0c-aa02-bce15b9555ae",
13
+ "at": "2026-07-06T14:49:44.479Z",
14
14
  "message": "Built sample RSModel"
15
15
  }
16
16
  ],
17
17
  "items": [
18
18
  {
19
- "id": 5,
20
- "alias": "A1",
21
- "cstType": "axiom",
22
- "definitionFormal": "1=1",
23
- "term": "",
19
+ "id": 1,
20
+ "alias": "X1",
21
+ "cstType": "basic",
22
+ "definitionFormal": "",
23
+ "term": "element",
24
24
  "definitionText": "",
25
- "convention": "",
25
+ "convention": "people",
26
26
  "analysis": {
27
27
  "success": true,
28
28
  "type": {
29
- "typeID": 6
29
+ "typeID": 5,
30
+ "base": {
31
+ "typeID": 3,
32
+ "baseID": "X1"
33
+ }
30
34
  },
31
35
  "valueClass": "value",
32
36
  "diagnostics": []
@@ -37,9 +41,9 @@
37
41
  "alias": "C1",
38
42
  "cstType": "constant",
39
43
  "definitionFormal": "",
40
- "term": "",
44
+ "term": "count",
41
45
  "definitionText": "",
42
- "convention": "",
46
+ "convention": "natural numbers",
43
47
  "analysis": {
44
48
  "success": true,
45
49
  "type": {
@@ -56,33 +60,12 @@
56
60
  "diagnostics": []
57
61
  }
58
62
  },
59
- {
60
- "id": 1,
61
- "alias": "X1",
62
- "cstType": "basic",
63
- "definitionFormal": "",
64
- "term": "",
65
- "definitionText": "",
66
- "convention": "",
67
- "analysis": {
68
- "success": true,
69
- "type": {
70
- "typeID": 5,
71
- "base": {
72
- "typeID": 3,
73
- "baseID": "X1"
74
- }
75
- },
76
- "valueClass": "value",
77
- "diagnostics": []
78
- }
79
- },
80
63
  {
81
64
  "id": 3,
82
65
  "alias": "S1",
83
66
  "cstType": "structure",
84
67
  "definitionFormal": "ℬ(X1×X1)",
85
- "term": "",
68
+ "term": "parent-child pairs",
86
69
  "definitionText": "",
87
70
  "convention": "Pairs (parent, child) over X1.",
88
71
  "analysis": {
@@ -127,6 +110,23 @@
127
110
  "valueClass": "value",
128
111
  "diagnostics": []
129
112
  }
113
+ },
114
+ {
115
+ "id": 5,
116
+ "alias": "A1",
117
+ "cstType": "axiom",
118
+ "definitionFormal": "1=1",
119
+ "term": "",
120
+ "definitionText": "",
121
+ "convention": "",
122
+ "analysis": {
123
+ "success": true,
124
+ "type": {
125
+ "typeID": 6
126
+ },
127
+ "valueClass": "value",
128
+ "diagnostics": []
129
+ }
130
130
  }
131
131
  ],
132
132
  "model": {
@@ -20,13 +20,7 @@ import {
20
20
  X1_ID,
21
21
  X2_ID
22
22
  } from './constants';
23
-
24
- /**
25
- * Учебная схема: применение шаблонов БВ (rsforms/42) к предметной области.
26
- * Подстановка R1→X1 (сотрудники), R2→X2 (проекты), σ→S1/S2.
27
- */
28
- const X1_BINDING = { 0: 'Алиса', 1: 'Боб', 2: 'Кэрол' } as const;
29
- const X2_BINDING = { 0: 'ПроектA', 1: 'ПроектB' } as const;
23
+ import { assertCleanDiagnostics } from '../diagnostics-utils';
30
24
 
31
25
  /** S1: назначение сотрудников на проекты. */
32
26
  const S1_VALUE = [
@@ -41,6 +35,9 @@ const S2_VALUE = [
41
35
  [TUPLE_ID, 1, 2]
42
36
  ] as const;
43
37
 
38
+ const X1_BINDING = { 0: 'Алиса', 1: 'Боб', 2: 'Кэрол' } as const;
39
+ const X2_BINDING = { 0: 'ПроектA', 1: 'ПроектB' } as const;
40
+
44
41
  async function buildSchema(client: RSToolWrapperClient): Promise<string> {
45
42
  const session = await client.call<{ sessionId: string }>('createSession');
46
43
 
@@ -62,7 +59,8 @@ async function buildSchema(client: RSToolWrapperClient): Promise<string> {
62
59
  alias: 'X1',
63
60
  cstType: CstType.BASE,
64
61
  definitionFormal: '',
65
- term: 'сотрудники'
62
+ term: 'сотрудники',
63
+ convention: 'Множество сотрудников; подстановка R1→X1 в шаблонах БВ'
66
64
  }
67
65
  },
68
66
  {
@@ -71,7 +69,8 @@ async function buildSchema(client: RSToolWrapperClient): Promise<string> {
71
69
  alias: 'X2',
72
70
  cstType: CstType.BASE,
73
71
  definitionFormal: '',
74
- term: 'проекты'
72
+ term: 'проекты',
73
+ convention: 'Множество проектов; подстановка R2→X2 в шаблонах БВ'
75
74
  }
76
75
  },
77
76
  {
@@ -163,6 +162,24 @@ async function buildSchema(client: RSToolWrapperClient): Promise<string> {
163
162
  console.log(`${item.alias}: OK`);
164
163
  }
165
164
 
165
+ await client.call('setModelValues', {
166
+ sessionId: session.sessionId,
167
+ set: [
168
+ { target: X1_ID, value: X1_BINDING },
169
+ { target: X2_ID, value: X2_BINDING },
170
+ { target: S1_ID, value: S1_VALUE },
171
+ { target: S2_ID, value: S2_VALUE }
172
+ ]
173
+ });
174
+ await client.call('recalculateModel', { sessionId: session.sessionId });
175
+
176
+ await assertCleanDiagnostics(
177
+ client,
178
+ session.sessionId,
179
+ new Map(drafts.map(entry => [entry.draft.id!, entry.draft.alias])),
180
+ 'template-apply'
181
+ );
182
+
166
183
  await client.call('commitStep', {
167
184
  sessionId: session.sessionId,
168
185
  message: 'Применение шаблонов БВ: сотрудники, проекты, F6/F9/F20/P5'
@@ -1,35 +1,52 @@
1
1
  {
2
- "contractVersion": "2.0.0",
2
+ "contractVersion": "2.1.0",
3
3
  "state": {
4
- "sessionId": "b72f75c0-4f17-4bef-9ff3-913ea16191db",
4
+ "sessionId": "12bfc7a5-ad35-42b0-9d25-1ea8c8f6588d",
5
5
  "alias": "",
6
6
  "title": "",
7
7
  "comment": "",
8
- "createdAt": "2026-07-01T17:12:54.696Z",
9
- "updatedAt": "2026-07-01T17:12:54.714Z",
8
+ "createdAt": "2026-07-06T14:50:08.453Z",
9
+ "updatedAt": "2026-07-06T14:50:08.531Z",
10
10
  "revisions": [
11
11
  {
12
- "revisionId": "e85ad551-0aa0-42d9-b55d-01719aed6533",
13
- "at": "2026-07-01T17:12:54.714Z",
12
+ "revisionId": "2b60fe39-9343-467f-b334-3101b39dcde0",
13
+ "at": "2026-07-06T14:50:08.531Z",
14
14
  "message": "Применение шаблонов БВ: сотрудники, проекты, F6/F9/F20/P5"
15
15
  }
16
16
  ],
17
17
  "items": [
18
18
  {
19
- "id": 3,
20
- "alias": "X2",
19
+ "id": 1,
20
+ "alias": "T1",
21
+ "cstType": "statement",
22
+ "definitionFormal": "1=1",
23
+ "term": "Применение шаблонов банка выражений",
24
+ "definitionText": "",
25
+ "convention": "Подстановка радикалов БВ: R1→X1, R2→X2. Отношение σ→S1 или S2. Примеры: БВ F6→F_IMAGE, БВ F20→F_SOURCES, БВ P5→P_FUNCTION",
26
+ "analysis": {
27
+ "success": true,
28
+ "type": {
29
+ "typeID": 6
30
+ },
31
+ "valueClass": "value",
32
+ "diagnostics": []
33
+ }
34
+ },
35
+ {
36
+ "id": 2,
37
+ "alias": "X1",
21
38
  "cstType": "basic",
22
39
  "definitionFormal": "",
23
- "term": "проекты",
40
+ "term": "сотрудники",
24
41
  "definitionText": "",
25
- "convention": "",
42
+ "convention": "Множество сотрудников; подстановка R1→X1 в шаблонах БВ",
26
43
  "analysis": {
27
44
  "success": true,
28
45
  "type": {
29
46
  "typeID": 5,
30
47
  "base": {
31
48
  "typeID": 3,
32
- "baseID": "X2"
49
+ "baseID": "X1"
33
50
  }
34
51
  },
35
52
  "valueClass": "value",
@@ -37,20 +54,20 @@
37
54
  }
38
55
  },
39
56
  {
40
- "id": 2,
41
- "alias": "X1",
57
+ "id": 3,
58
+ "alias": "X2",
42
59
  "cstType": "basic",
43
60
  "definitionFormal": "",
44
- "term": "сотрудники",
61
+ "term": "проекты",
45
62
  "definitionText": "",
46
- "convention": "",
63
+ "convention": "Множество проектов; подстановка R2→X2 в шаблонах БВ",
47
64
  "analysis": {
48
65
  "success": true,
49
66
  "type": {
50
67
  "typeID": 5,
51
68
  "base": {
52
69
  "typeID": 3,
53
- "baseID": "X1"
70
+ "baseID": "X2"
54
71
  }
55
72
  },
56
73
  "valueClass": "value",
@@ -117,27 +134,6 @@
117
134
  "diagnostics": []
118
135
  }
119
136
  },
120
- {
121
- "id": 10,
122
- "alias": "D2",
123
- "cstType": "term",
124
- "definitionFormal": "Pr1(S2) \\ Pr2(S2)",
125
- "term": "глава иерархии",
126
- "definitionText": "",
127
- "convention": "БВ F20: применение к S2 (развёрнуто в D2, т.к. вызов F# в терме не анализируется)",
128
- "analysis": {
129
- "success": true,
130
- "type": {
131
- "typeID": 5,
132
- "base": {
133
- "typeID": 3,
134
- "baseID": "X1"
135
- }
136
- },
137
- "valueClass": "value",
138
- "diagnostics": []
139
- }
140
- },
141
137
  {
142
138
  "id": 6,
143
139
  "alias": "F_IMAGE",
@@ -308,17 +304,21 @@
308
304
  }
309
305
  },
310
306
  {
311
- "id": 1,
312
- "alias": "T1",
313
- "cstType": "statement",
314
- "definitionFormal": "1=1",
315
- "term": "Применение шаблонов банка выражений",
307
+ "id": 10,
308
+ "alias": "D2",
309
+ "cstType": "term",
310
+ "definitionFormal": "Pr1(S2) \\ Pr2(S2)",
311
+ "term": "глава иерархии",
316
312
  "definitionText": "",
317
- "convention": "Подстановка радикалов БВ: R1→X1, R2→X2. Отношение σ→S1 или S2. Примеры: БВ F6→F_IMAGE, БВ F20→F_SOURCES, БВ P5→P_FUNCTION",
313
+ "convention": "БВ F20: применение к S2 (развёрнуто в D2, т.к. вызов F# в терме не анализируется)",
318
314
  "analysis": {
319
315
  "success": true,
320
316
  "type": {
321
- "typeID": 6
317
+ "typeID": 5,
318
+ "base": {
319
+ "typeID": 3,
320
+ "baseID": "X1"
321
+ }
322
322
  },
323
323
  "valueClass": "value",
324
324
  "diagnostics": []
@@ -326,7 +326,62 @@
326
326
  }
327
327
  ],
328
328
  "model": {
329
- "items": []
329
+ "items": [
330
+ {
331
+ "id": 2,
332
+ "type": "basic",
333
+ "value": {
334
+ "0": "Алиса",
335
+ "1": "Боб",
336
+ "2": "Кэрол"
337
+ }
338
+ },
339
+ {
340
+ "id": 3,
341
+ "type": "basic",
342
+ "value": {
343
+ "0": "ПроектA",
344
+ "1": "ПроектB"
345
+ }
346
+ },
347
+ {
348
+ "id": 4,
349
+ "type": "ℬ(X1×X1)",
350
+ "value": [
351
+ [
352
+ -111,
353
+ 0,
354
+ 0
355
+ ],
356
+ [
357
+ -111,
358
+ 0,
359
+ 1
360
+ ],
361
+ [
362
+ -111,
363
+ 1,
364
+ 0
365
+ ]
366
+ ]
367
+ },
368
+ {
369
+ "id": 5,
370
+ "type": "ℬ(X1×X1)",
371
+ "value": [
372
+ [
373
+ -111,
374
+ 0,
375
+ 1
376
+ ],
377
+ [
378
+ -111,
379
+ 1,
380
+ 2
381
+ ]
382
+ ]
383
+ }
384
+ ]
330
385
  }
331
386
  },
332
387
  "diagnostics": []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsconcept/rstool",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Agent-facing library for incremental RSForm construction, RSLang analysis, diagnostics, modeling, and evaluation. Wraps @rsconcept/domain with a deterministic session contract.",
5
5
  "license": "MIT",
6
6
  "author": "IRBorisov",
@@ -51,7 +51,7 @@
51
51
  "LICENSE"
52
52
  ],
53
53
  "dependencies": {
54
- "@rsconcept/domain": "1.8.1"
54
+ "@rsconcept/domain": "2.0.1"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@types/node": "^26.1.0",
@@ -82,6 +82,7 @@
82
82
  "example:build-movd-rsmodel": "tsx examples/movd/build-rsmodel.ts",
83
83
  "example:build-expression-bank-schema": "tsx examples/expression-bank/build-rsform.ts",
84
84
  "example:build-template-apply-schema": "tsx examples/template-apply/build-rsform.ts",
85
+ "example:audit-diagnostics": "tsx examples/audit-diagnostics.ts",
85
86
  "kinship:cli": "tsx examples/kinship/cli.ts"
86
87
  }
87
88
  }
@@ -1,4 +1,4 @@
1
- # RSLang и rstool — примеры (контракт 2.0)
1
+ # RSLang и rstool — примеры (контракт 2.1)
2
2
 
3
3
  ## Схема: batch patch
4
4
 
@@ -50,6 +50,8 @@ const analysis = tool.analyzeExpression({
50
50
  const summary = tool.getSessionState(); // compact
51
51
  const full = tool.getSessionState('full'); // SessionState clone
52
52
  const diags = tool.listDiagnostics();
53
+ const schemaIssues = tool.listDiagnostics({ kind: 'schema' });
54
+ const modelIssues = tool.listDiagnostics({ kind: 'model' });
53
55
  ```
54
56
 
55
57
  ## Модель и вычисление