sinapse-ai 7.7.4 → 7.7.6

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.
@@ -567,3 +567,9 @@
567
567
  {"timestamp":"2026-04-02T23:48:52.333Z","action":"add","path":".sinapse-ai/infrastructure/scripts/validate-codex-sync.js","trigger":"watcher"}
568
568
  {"timestamp":"2026-04-02T23:48:52.333Z","action":"change","path":".sinapse-ai/infrastructure/scripts/validate-parity.js","trigger":"watcher"}
569
569
  {"timestamp":"2026-04-02T23:48:52.333Z","action":"change","path":".sinapse-ai/infrastructure/scripts/validate-paths.js","trigger":"watcher"}
570
+ {"timestamp":"2026-04-03T00:26:52.858Z","action":"change","path":".sinapse-ai/infrastructure/scripts/validate-codex-command-registry.js","trigger":"watcher"}
571
+ {"timestamp":"2026-04-03T00:26:52.860Z","action":"add","path":".sinapse-ai/infrastructure/scripts/validate-codex-delegation.js","trigger":"watcher"}
572
+ {"timestamp":"2026-04-03T00:26:52.860Z","action":"change","path":".sinapse-ai/infrastructure/scripts/validate-codex-sync.js","trigger":"watcher"}
573
+ {"timestamp":"2026-04-03T02:10:30.504Z","action":"change","path":".sinapse-ai/core/doctor/checks/constitution-consistency.js","trigger":"watcher"}
574
+ {"timestamp":"2026-04-03T02:10:30.505Z","action":"change","path":".sinapse-ai/core/health-check/checks/project/constitution-consistency.js","trigger":"watcher"}
575
+ {"timestamp":"2026-04-03T02:10:30.506Z","action":"change","path":".sinapse-ai/product/templates/ide-rules/claude-rules.md","trigger":"watcher"}
@@ -0,0 +1,294 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const Ajv2020 = require('ajv/dist/2020');
7
+ const {
8
+ buildHandoffPacket,
9
+ loadDelegationMatrix,
10
+ } = require(
11
+ path.join(__dirname, '..', '..', '..', '.codex', 'scripts', 'resolve-codex-delegation-parity'),
12
+ );
13
+ const {
14
+ loadRegistry: loadCommandRegistryFile,
15
+ } = require('./validate-codex-command-registry');
16
+
17
+ const REQUIRED_ORCHESTRATORS = Object.freeze([
18
+ 'sinapse-orqx',
19
+ 'brand-orqx',
20
+ 'commercial-orqx',
21
+ 'content-orqx',
22
+ 'copy-orqx',
23
+ 'animations-orqx',
24
+ 'design-orqx',
25
+ 'finance-orqx',
26
+ 'growth-orqx',
27
+ 'paidmedia-orqx',
28
+ 'product-orqx',
29
+ 'research-orqx',
30
+ 'claude-orqx',
31
+ 'council-orqx',
32
+ 'storytelling-orqx',
33
+ 'cyber-orqx',
34
+ 'cloning-orqx',
35
+ 'courses-orqx',
36
+ 'swarm-orqx',
37
+ ]);
38
+
39
+ function parseArgs(argv = process.argv.slice(2)) {
40
+ const args = new Set(argv);
41
+ return {
42
+ quiet: args.has('--quiet') || args.has('-q'),
43
+ json: args.has('--json'),
44
+ };
45
+ }
46
+
47
+ function validateCodexDelegation(options = {}) {
48
+ const projectRoot = options.projectRoot || process.cwd();
49
+ const errors = [];
50
+ const warnings = [];
51
+ const requiredOrchestrators =
52
+ options.requiredOrchestrators === false
53
+ ? null
54
+ : options.requiredOrchestrators || REQUIRED_ORCHESTRATORS;
55
+
56
+ let matrix;
57
+ try {
58
+ matrix = loadDelegationMatrix(projectRoot);
59
+ } catch (error) {
60
+ errors.push(`Unable to load Codex delegation matrix: ${error.message}`);
61
+ return {
62
+ ok: false,
63
+ errors,
64
+ warnings,
65
+ metrics: { orchestrators: 0, routes: 0 },
66
+ };
67
+ }
68
+
69
+ const matrixPath = path.join(projectRoot, '.codex', 'delegation-parity.json');
70
+ const schemaPath = path.join(projectRoot, matrix.handoffSchema || '.codex/handoff-packet.parity.schema.json');
71
+ if (!fs.existsSync(schemaPath)) {
72
+ errors.push(`Missing handoff schema ${path.relative(projectRoot, schemaPath)}`);
73
+ }
74
+
75
+ let schema = null;
76
+ if (fs.existsSync(schemaPath)) {
77
+ try {
78
+ schema = JSON.parse(fs.readFileSync(schemaPath, 'utf8'));
79
+ } catch (error) {
80
+ errors.push(`Unable to parse handoff schema: ${error.message}`);
81
+ }
82
+ }
83
+
84
+ const { registry: commandRegistry, error: commandRegistryError } = loadCommandRegistryFile(projectRoot);
85
+ if (commandRegistryError) {
86
+ errors.push(commandRegistryError);
87
+ }
88
+
89
+ const orchestrators = matrix.orchestrators || {};
90
+ const frameworkAgents = matrix.frameworkAgents || {};
91
+ const routes = matrix.routes || {};
92
+
93
+ if (requiredOrchestrators) {
94
+ for (const orchestratorId of requiredOrchestrators) {
95
+ if (!orchestrators[orchestratorId]) {
96
+ errors.push(`missing required orchestrator coverage: ${orchestratorId}`);
97
+ }
98
+ }
99
+ }
100
+
101
+ for (const [orchestratorId, orchestratorSpec] of Object.entries(orchestrators)) {
102
+ const sourceOfTruth = path.join(projectRoot, orchestratorSpec.sourceOfTruth || '');
103
+ if (!fs.existsSync(sourceOfTruth)) {
104
+ errors.push(`${orchestratorId}: missing source of truth ${path.relative(projectRoot, sourceOfTruth)}`);
105
+ }
106
+
107
+ if (orchestratorSpec.squadDir) {
108
+ const squadDir = path.join(projectRoot, orchestratorSpec.squadDir);
109
+ if (!fs.existsSync(squadDir)) {
110
+ errors.push(`${orchestratorId}: missing squad dir ${path.relative(projectRoot, squadDir)}`);
111
+ }
112
+ }
113
+
114
+ if (orchestratorSpec.tasksDir) {
115
+ const tasksDir = path.join(projectRoot, orchestratorSpec.tasksDir);
116
+ if (!fs.existsSync(tasksDir)) {
117
+ errors.push(`${orchestratorId}: missing tasks dir ${path.relative(projectRoot, tasksDir)}`);
118
+ }
119
+ }
120
+
121
+ for (const routeId of orchestratorSpec.approvedRoutes || []) {
122
+ if (!routes[routeId]) {
123
+ errors.push(`${orchestratorId}: missing approved route ${routeId}`);
124
+ }
125
+ }
126
+ }
127
+
128
+ const routeAliases = new Map();
129
+ const ajv = schema ? new Ajv2020({ allErrors: true, strict: false }) : null;
130
+ const validatePacket = schema ? ajv.compile(schema) : null;
131
+ let routeCount = 0;
132
+ let validatorBackedCount = 0;
133
+ let shimCount = 0;
134
+ let exploratoryCount = 0;
135
+
136
+ for (const [routeId, routeSpec] of Object.entries(routes)) {
137
+ routeCount += 1;
138
+ if (routeSpec.classification === 'validator-backed') validatorBackedCount += 1;
139
+ if (routeSpec.classification === 'codex-only-shim') shimCount += 1;
140
+ if (routeSpec.classification === 'exploratory') exploratoryCount += 1;
141
+
142
+ if (!orchestrators[routeSpec.owner]) {
143
+ errors.push(`${routeId}: unknown route owner ${routeSpec.owner}`);
144
+ }
145
+
146
+ if (!(matrix.routingClasses || []).includes(routeSpec.classification)) {
147
+ errors.push(`${routeId}: invalid classification ${routeSpec.classification}`);
148
+ }
149
+
150
+ if (!(matrix.requestTypes || []).includes(routeSpec.requestType)) {
151
+ errors.push(`${routeId}: invalid request type ${routeSpec.requestType}`);
152
+ }
153
+
154
+ for (const alias of [routeId, ...(routeSpec.aliases || [])]) {
155
+ const normalized = String(alias || '').trim().toLowerCase();
156
+ const owner = routeAliases.get(normalized);
157
+ if (owner && owner !== routeId) {
158
+ errors.push(`duplicate delegation route alias "${normalized}" claimed by ${owner} and ${routeId}`);
159
+ } else {
160
+ routeAliases.set(normalized, routeId);
161
+ }
162
+ }
163
+
164
+ for (const resource of routeSpec.resources || []) {
165
+ const resourcePath = path.join(projectRoot, resource);
166
+ if (!fs.existsSync(resourcePath)) {
167
+ errors.push(`${routeId}: missing resource ${path.relative(projectRoot, resourcePath)}`);
168
+ }
169
+ }
170
+
171
+ if (!Array.isArray(routeSpec.delegationChain) || routeSpec.delegationChain.length === 0) {
172
+ errors.push(`${routeId}: missing delegation chain`);
173
+ continue;
174
+ }
175
+
176
+ if (routeSpec.delegationChain[0].from !== routeSpec.owner) {
177
+ errors.push(`${routeId}: first delegation step must start from the route owner`);
178
+ }
179
+
180
+ for (const [index, step] of routeSpec.delegationChain.entries()) {
181
+ const stepLabel = `${routeId}.step${index + 1}`;
182
+
183
+ if (step.fromType === 'orqx' && !orchestrators[step.from]) {
184
+ errors.push(`${stepLabel}: unknown from orchestrator ${step.from}`);
185
+ }
186
+ if (step.fromType === 'framework-agent' && !frameworkAgents[step.from]) {
187
+ errors.push(`${stepLabel}: unknown from framework agent ${step.from}`);
188
+ }
189
+
190
+ if (step.toType === 'orqx') {
191
+ if (!orchestrators[step.to]) {
192
+ errors.push(`${stepLabel}: unknown target orchestrator ${step.to}`);
193
+ }
194
+ } else if (step.toType === 'framework-agent') {
195
+ if (!frameworkAgents[step.to]) {
196
+ errors.push(`${stepLabel}: unknown target framework agent ${step.to}`);
197
+ }
198
+ if (step.resolver !== 'command-registry') {
199
+ errors.push(`${stepLabel}: framework-agent steps must use resolver "command-registry"`);
200
+ }
201
+ const registryAgent = commandRegistry?.agents?.[frameworkAgents[step.to]?.registryAgentId || step.to];
202
+ if (!registryAgent) {
203
+ errors.push(`${stepLabel}: missing command registry entry for ${step.to}`);
204
+ } else if (!registryAgent.commands?.[step.command]) {
205
+ errors.push(`${stepLabel}: missing command registry command ${step.to}.${step.command}`);
206
+ }
207
+ } else if (step.toType === 'specialist') {
208
+ const specialistPath = step.path
209
+ ? path.join(projectRoot, step.path)
210
+ : path.join(projectRoot, '.codex', 'agents', `${step.to}.md`);
211
+ if (!fs.existsSync(specialistPath)) {
212
+ errors.push(`${stepLabel}: missing specialist path ${path.relative(projectRoot, specialistPath)}`);
213
+ }
214
+ }
215
+
216
+ if (step.path) {
217
+ const stepPath = path.join(projectRoot, step.path);
218
+ if (!fs.existsSync(stepPath)) {
219
+ errors.push(`${stepLabel}: missing path ${path.relative(projectRoot, stepPath)}`);
220
+ }
221
+ }
222
+
223
+ if (step.task) {
224
+ const taskPath = path.join(projectRoot, step.task);
225
+ if (!fs.existsSync(taskPath)) {
226
+ errors.push(`${stepLabel}: missing task ${path.relative(projectRoot, taskPath)}`);
227
+ }
228
+ }
229
+ }
230
+
231
+ if (validatePacket) {
232
+ const packet = buildHandoffPacket(routeId, projectRoot, matrix);
233
+ const valid = validatePacket(packet);
234
+ if (!valid) {
235
+ errors.push(
236
+ `${routeId}: handoff packet failed schema validation ${ajv.errorsText(validatePacket.errors, { separator: '; ' })}`,
237
+ );
238
+ }
239
+ }
240
+ }
241
+
242
+ return {
243
+ ok: errors.length === 0,
244
+ errors,
245
+ warnings,
246
+ metrics: {
247
+ matrixPath: path.relative(projectRoot, matrixPath),
248
+ orchestrators: Object.keys(orchestrators).length,
249
+ routes: routeCount,
250
+ validatorBackedRoutes: validatorBackedCount,
251
+ codexOnlyShimRoutes: shimCount,
252
+ exploratoryRoutes: exploratoryCount,
253
+ },
254
+ };
255
+ }
256
+
257
+ function formatHumanReport(result) {
258
+ if (result.ok) {
259
+ return `OK Codex delegation validation passed (orchestrators: ${result.metrics.orchestrators}, routes: ${result.metrics.routes})`;
260
+ }
261
+
262
+ return [
263
+ `X Codex delegation validation failed (${result.errors.length} issue(s))`,
264
+ ...result.errors.map((error) => `- ${error}`),
265
+ ].join('\n');
266
+ }
267
+
268
+ function main() {
269
+ const args = parseArgs();
270
+ const result = validateCodexDelegation(args);
271
+
272
+ if (!args.quiet) {
273
+ if (args.json) {
274
+ console.log(JSON.stringify(result, null, 2));
275
+ } else {
276
+ console.log(formatHumanReport(result));
277
+ }
278
+ }
279
+
280
+ if (!result.ok) {
281
+ process.exitCode = 1;
282
+ }
283
+ }
284
+
285
+ if (require.main === module) {
286
+ main();
287
+ }
288
+
289
+ module.exports = {
290
+ parseArgs,
291
+ validateCodexDelegation,
292
+ formatHumanReport,
293
+ REQUIRED_ORCHESTRATORS,
294
+ };
@@ -6,6 +6,7 @@ const path = require('path');
6
6
  const { spawnSync } = require('child_process');
7
7
  const { loadCodexCatalogConfig } = require('./codex-parity/catalog');
8
8
  const { validateCodexCommandRegistry } = require('./validate-codex-command-registry');
9
+ const { validateCodexDelegation } = require('./validate-codex-delegation');
9
10
  const { validateCodexIntegration } = require('./validate-codex-integration');
10
11
  const { validateCodexSkills } = require('./codex-skills-sync/validate');
11
12
  const { validatePaths } = require('./validate-paths');
@@ -59,6 +60,7 @@ function validateCodexSync(options = {}, deps = {}) {
59
60
  const config = loadCodexCatalogConfig(projectRoot);
60
61
  const runLegacyValidate = deps.runLegacyCodexValidate || runLegacyCodexValidate;
61
62
  const runCodexCommands = deps.validateCodexCommandRegistry || validateCodexCommandRegistry;
63
+ const runCodexDelegation = deps.validateCodexDelegation || validateCodexDelegation;
62
64
  const runCodexIntegration = deps.validateCodexIntegration || validateCodexIntegration;
63
65
  const runCodexSkills = deps.validateCodexSkills || validateCodexSkills;
64
66
  const runPaths = deps.validatePaths || validatePaths;
@@ -71,6 +73,7 @@ function validateCodexSync(options = {}, deps = {}) {
71
73
  const checks = [
72
74
  normalizeCheck('codex-integration', runCodexIntegration({ projectRoot, quiet: true })),
73
75
  normalizeCheck('codex-commands', runCodexCommands({ projectRoot, quiet: true })),
76
+ normalizeCheck('codex-delegation', runCodexDelegation({ projectRoot, quiet: true })),
74
77
  normalizeCheck('codex-skills', runCodexSkills({ projectRoot, strict: true, quiet: true })),
75
78
  normalizeCheck('paths', runPaths({ projectRoot, quiet: true })),
76
79
  ];
@@ -7,10 +7,10 @@
7
7
  # - SHA256 hashes for change detection
8
8
  # - File types for categorization
9
9
  #
10
- version: 7.7.4
11
- generated_at: "2026-04-03T00:06:05.314Z"
10
+ version: 7.7.6
11
+ generated_at: "2026-04-03T02:11:41.779Z"
12
12
  generator: scripts/generate-install-manifest.js
13
- file_count: 1117
13
+ file_count: 1118
14
14
  files:
15
15
  - path: cli/commands/config/index.js
16
16
  hash: sha256:66f111eceef0f60fa0a8904add783b615d55b01d5fe36408623c3dd828e702f6
@@ -313,9 +313,9 @@ files:
313
313
  type: core
314
314
  size: 1724
315
315
  - path: core/doctor/checks/constitution-consistency.js
316
- hash: sha256:7d61a71fcc8eeaf139a9bea634dff99154441808e8411f4290ae5a34fa919951
316
+ hash: sha256:8da440ef623c8ba300a73f9833fb5b7c5f6e45e50694b488b7580c9738bfb1d8
317
317
  type: core
318
- size: 3107
318
+ size: 3139
319
319
  - path: core/doctor/checks/core-config.js
320
320
  hash: sha256:5424528eefbc2f19213b30d00dcd96128acefdbb289c25712be844f0fbddb963
321
321
  type: core
@@ -581,9 +581,9 @@ files:
581
581
  type: core
582
582
  size: 4733
583
583
  - path: core/health-check/checks/project/constitution-consistency.js
584
- hash: sha256:63f4aa67ac27b337d017c7b642b1e3554bd02554fa69e29b14ebb8922827b4b9
584
+ hash: sha256:e6d0320efb88db073f6f877bc63126a9825ce7a896f5629f81ac24394e96a3ec
585
585
  type: core
586
- size: 5960
586
+ size: 6044
587
587
  - path: core/health-check/checks/project/dependencies.js
588
588
  hash: sha256:a8f4d9fcadf5dc3274d8ed0605af6f25d6554b1a9b0d3e66c63d8ea4569c95b9
589
589
  type: core
@@ -1237,9 +1237,9 @@ files:
1237
1237
  type: data
1238
1238
  size: 9586
1239
1239
  - path: data/entity-registry.yaml
1240
- hash: sha256:265b44f0e9c36e85375f05ba88dbf19ed9033244a6eea338f4b8e3a4e453dd12
1240
+ hash: sha256:71b0007c07fe52099eacd433b0e9a40db6163a69cbd4b0687c9f284486afca8f
1241
1241
  type: data
1242
- size: 514885
1242
+ size: 515685
1243
1243
  - path: data/learned-patterns.yaml
1244
1244
  hash: sha256:24ac0b160615583a0ff783d3da8af80b7f94191575d6db2054ec8e10a3f945dc
1245
1245
  type: data
@@ -3432,14 +3432,18 @@ files:
3432
3432
  hash: sha256:a37a4c5fc8a4c3a7ce7ba240aeea16abc0a75871751f66eeb84991604ff066bf
3433
3433
  type: script
3434
3434
  size: 7266
3435
+ - path: infrastructure/scripts/validate-codex-delegation.js
3436
+ hash: sha256:c084dff34fe7fbc82cb785219f6ed1f33d181fcc6fc9ee06c220ef2cbeaa99b5
3437
+ type: script
3438
+ size: 9551
3435
3439
  - path: infrastructure/scripts/validate-codex-integration.js
3436
3440
  hash: sha256:c553cc493ddbfecf41b865f8a1075df56b6500c3b2b315bae8b7e7bcec4db85a
3437
3441
  type: script
3438
3442
  size: 4742
3439
3443
  - path: infrastructure/scripts/validate-codex-sync.js
3440
- hash: sha256:f7f2963f995df0dc1fc0a4662146318aa4dba2699c8dbfc4fa748b3201b1db56
3444
+ hash: sha256:31bcfc0cdf307e7c14064eaf0ddbf99a14344c21306937c9a7d9cc7ebba260f8
3441
3445
  type: script
3442
- size: 4427
3446
+ size: 4679
3443
3447
  - path: infrastructure/scripts/validate-output-pattern.js
3444
3448
  hash: sha256:91111d656e8d7b38a20a1bda753e663b74318f75cdab2025c7e0b84c775fc83d
3445
3449
  type: script
@@ -3969,9 +3973,9 @@ files:
3969
3973
  type: template
3970
3974
  size: 3691
3971
3975
  - path: product/templates/ide-rules/claude-rules.md
3972
- hash: sha256:e82e8b6cc5c64791ba3a70ca728a920ce522d56e9a60dd0bb4ee76b9a150adf9
3976
+ hash: sha256:819588040a8a7e0e90f49115c2ed4474db06cf6bba190671da6a67b15a4b0b88
3973
3977
  type: template
3974
- size: 13341
3978
+ size: 13393
3975
3979
  - path: product/templates/ide-rules/codex-rules.md
3976
3980
  hash: sha256:601ffec5e24ff5e247c25e4d61728167503722acc817a1b30fbd695182bed1bc
3977
3981
  type: template
@@ -28,6 +28,7 @@ O SINAPSE possui uma **Constitution formal** com princípios inegociáveis e gat
28
28
  | VII | Ecosystem Metrics Accuracy | NON-NEGOTIABLE |
29
29
  | VIII | Mandatory Delegation | NON-NEGOTIABLE |
30
30
  | IX | Safe Collaboration | NON-NEGOTIABLE |
31
+ | X | Security & Data Protection | NON-NEGOTIABLE |
31
32
 
32
33
  **Gates automáticos bloqueiam violações.** Consulte a Constitution para detalhes completos.
33
34
  <!-- SINAPSE-MANAGED-END: constitution -->
@@ -0,0 +1,115 @@
1
+ # Codex Delegation Parity
2
+
3
+ ## Purpose
4
+
5
+ Codex delegation parity makes `sinapse-orqx -> squad orqx -> specialist` routing explicit, inspectable, and validator-backed without changing `.claude/**`.
6
+
7
+ The contract lives in:
8
+
9
+ - `.codex/delegation-parity.json`
10
+ - `.codex/handoff-packet.parity.schema.json`
11
+ - `.codex/scripts/resolve-codex-delegation-parity.js`
12
+ - `.sinapse-ai/infrastructure/scripts/validate-codex-delegation.js`
13
+
14
+ ## Routing Classes
15
+
16
+ - `validator-backed`: route is approved, resource-backed, and structurally validated
17
+ - `codex-only-shim`: route is intentionally implemented as a Codex compatibility layer
18
+ - `exploratory`: route is documented and discoverable, but not a guaranteed runtime-equivalent path
19
+
20
+ ## Current Contract
21
+
22
+ The current Codex delegation matrix validates:
23
+
24
+ - 19 orchestrators
25
+ - 5 framework agents
26
+ - 7 approved routes
27
+
28
+ Approved route families:
29
+
30
+ - single-domain squad delegation
31
+ - framework workflow delegation
32
+ - multi-domain launch orchestration
33
+ - exploratory delegation with explicit shared-surface risk
34
+
35
+ ## Supported Routes
36
+
37
+ ### Validator-Backed
38
+
39
+ - `brand-discovery`
40
+ - `content-funnel-alignment`
41
+ - `growth-seo-audit`
42
+ - `claude-project-setup`
43
+ - `framework-story-delivery`
44
+
45
+ ### Codex-Only Shim
46
+
47
+ - `multi-domain-launch`
48
+
49
+ ### Exploratory
50
+
51
+ - `research-competitor-positioning`
52
+
53
+ ## Handoff Packet
54
+
55
+ Each route produces a normalized handoff packet with:
56
+
57
+ - `mission`
58
+ - `phase`
59
+ - `owner`
60
+ - `classification`
61
+ - `inputs`
62
+ - `outputs`
63
+ - `validators`
64
+ - `sharedSurfaceRisk`
65
+ - `nextHandoff`
66
+ - `delegationChain`
67
+
68
+ This packet is the reviewable unit for Codex orchestration.
69
+
70
+ ## CLI Usage
71
+
72
+ Inspect a route:
73
+
74
+ ```bash
75
+ node .codex/scripts/resolve-codex-delegation-parity.js framework-story-delivery
76
+ ```
77
+
78
+ Inspect JSON:
79
+
80
+ ```bash
81
+ node .codex/scripts/resolve-codex-delegation-parity.js framework-story-delivery --json
82
+ ```
83
+
84
+ Inspect only the handoff packet:
85
+
86
+ ```bash
87
+ node .codex/scripts/resolve-codex-delegation-parity.js framework-story-delivery --packet
88
+ ```
89
+
90
+ Legacy source-aware lookup is still accepted for compatibility:
91
+
92
+ ```bash
93
+ node .codex/scripts/resolve-codex-delegation-parity.js sinapse-orqx framework-story-delivery --json
94
+ ```
95
+
96
+ ## Validation
97
+
98
+ Primary checks:
99
+
100
+ - `npm run validate:codex-delegation`
101
+ - `npm run validate:codex-sync`
102
+
103
+ Secondary checks:
104
+
105
+ - `npm run validate:codex-commands`
106
+ - `npm run validate:codex-integration`
107
+ - `npm run validate:codex-skills`
108
+ - `npm run validate:paths`
109
+
110
+ ## Guardrails
111
+
112
+ - Do not treat exploratory routes as runtime guarantees
113
+ - Do not change `.claude/**` to make a Codex-only route pass
114
+ - Prefer extending the Codex matrix before altering shared framework behavior
115
+ - Keep framework-agent delegation backed by `.codex/command-registry.json`
@@ -261,6 +261,13 @@ Focus:
261
261
 
262
262
  Execution detail is now formalized in `docs/codex-total-parity-orchestration-plan.md`.
263
263
 
264
+ Current state after Story `7.7.8`:
265
+
266
+ - a Codex-only delegation parity contract now lives in `.codex/delegation-parity.json`
267
+ - a parity handoff schema now validates delegation packets in `.codex/handoff-packet.parity.schema.json`
268
+ - Codex has a delegation parity resolver CLI for route lookup and packet inspection
269
+ - `validate:codex-delegation` now enforces the approved Codex routing contract
270
+
264
271
  Current recommended implementation story:
265
272
 
266
273
  - Story `7.7.8` - Codex delegation and handoff parity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinapse-ai",
3
- "version": "7.7.4",
3
+ "version": "7.7.6",
4
4
  "description": "SINAPSE AI: Framework de orquestracao de IA — 18 squads, 175 agentes especializados",
5
5
  "bin": {
6
6
  "sinapse": "bin/sinapse.js",
@@ -22,6 +22,8 @@
22
22
  ".claude/hooks/",
23
23
  ".codex/catalog.json",
24
24
  ".codex/command-registry.json",
25
+ ".codex/delegation-matrix.json",
26
+ ".codex/handoff-packet.schema.json",
25
27
  ".codex/instructions.md",
26
28
  ".codex/agents/",
27
29
  ".codex/scripts/",
@@ -82,6 +84,7 @@
82
84
  "validate:codex-sync": "node .sinapse-ai/infrastructure/scripts/validate-codex-sync.js",
83
85
  "validate:codex-integration": "node .sinapse-ai/infrastructure/scripts/validate-codex-integration.js",
84
86
  "validate:codex-commands": "node .sinapse-ai/infrastructure/scripts/validate-codex-command-registry.js",
87
+ "validate:codex-delegation": "node .sinapse-ai/infrastructure/scripts/validate-codex-delegation.js",
85
88
  "sync:skills:codex": "node .sinapse-ai/infrastructure/scripts/codex-skills-sync/index.js",
86
89
  "sync:skills:codex:global": "node .sinapse-ai/infrastructure/scripts/codex-skills-sync/index.js --global --global-only",
87
90
  "validate:codex-skills": "node .sinapse-ai/infrastructure/scripts/codex-skills-sync/validate.js --strict",
@@ -193,12 +193,17 @@ describe('artifact-copy-pipeline (Story INS-4.3)', () => {
193
193
  expect(config.timeout).toBe(10);
194
194
  });
195
195
 
196
- test('covers all 3 known hooks', () => {
196
+ test('covers all known hooks', () => {
197
197
  const keys = Object.keys(HOOK_EVENT_MAP);
198
- expect(keys).toHaveLength(3);
198
+ expect(keys).toHaveLength(8);
199
199
  expect(keys).toContain('synapse-engine.cjs');
200
200
  expect(keys).toContain('code-intel-pretool.cjs');
201
201
  expect(keys).toContain('precompact-session-digest.cjs');
202
+ expect(keys).toContain('enforce-architecture-first.cjs');
203
+ expect(keys).toContain('enforce-story-gate.cjs');
204
+ expect(keys).toContain('write-path-validation.cjs');
205
+ expect(keys).toContain('enforce-delegation.cjs');
206
+ expect(keys).toContain('secret-scanning.cjs');
202
207
  });
203
208
 
204
209
  test('DEFAULT_HOOK_CONFIG falls back to UserPromptSubmit', () => {