sinapse-ai 1.9.0 → 1.9.1

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 (88) hide show
  1. package/.claude/rules/mandatory-delegation.md +1 -1
  2. package/.codex/delegation-matrix.json +4 -3
  3. package/.codex/delegation-parity.json +4 -3
  4. package/.codex/instructions.md +2 -2
  5. package/.sinapse-ai/constitution.md +2 -2
  6. package/.sinapse-ai/core/doctor/checks/git-hooks.js +76 -10
  7. package/.sinapse-ai/core/execution/subagent-dispatcher.js +1 -1
  8. package/.sinapse-ai/core/synapse/engine.js +15 -0
  9. package/.sinapse-ai/data/entity-registry.yaml +13 -13
  10. package/.sinapse-ai/development/agents/snps-orqx.md +4 -4
  11. package/.sinapse-ai/git-hooks/lib/secret-scanner-core.js +76 -4
  12. package/.sinapse-ai/git-hooks/pre-push +7 -1
  13. package/.sinapse-ai/install-manifest.yaml +9 -9
  14. package/AGENTS.md +2 -2
  15. package/CHANGELOG.md +1247 -0
  16. package/bin/commands/uninstall.js +2 -2
  17. package/bin/utils/secret-scanner-core.js +76 -4
  18. package/docs/agent-reference-guide.md +1 -1
  19. package/docs/framework/architecture-overview.md +4 -4
  20. package/docs/framework/guiding-principles.md +9 -9
  21. package/docs/getting-started.md +1 -1
  22. package/docs/guides/agent-reference.md +1 -1
  23. package/docs/guides/codex-config.md +4 -5
  24. package/docs/pt/architecture/sub-orqx-pattern.md +20 -18
  25. package/package.json +8 -2
  26. package/packages/installer/src/installer/git-hooks-installer.js +3 -1
  27. package/packages/installer/src/wizard/ide-config-generator.js +9 -1
  28. package/packages/installer/src/wizard/index.js +3 -4
  29. package/scripts/regenerate-orqx-stubs.ps1 +0 -1
  30. package/scripts/sync-counts.js +10 -2
  31. package/scripts/sync-squad-yaml-components.js +108 -6
  32. package/scripts/validate-squad-orqx.js +19 -9
  33. package/sinapse/agents/sinapse-orqx.md +4 -4
  34. package/sinapse/agents/snps-orqx.md +4 -4
  35. package/sinapse/knowledge-base/routing-catalog.md +1 -1
  36. package/sinapse/tasks/diagnose-and-route.md +1 -1
  37. package/sinapse/tasks/squad-status-report.md +1 -1
  38. package/squads/claude-code-mastery/agents/claude-mastery-chief.md +1 -1
  39. package/squads/claude-code-mastery/agents/hooks-architect.md +60 -68
  40. package/squads/claude-code-mastery/knowledge-base/swarm-orchestration-patterns.md +1 -1
  41. package/squads/claude-code-mastery/tasks/audit-setup.md +1 -1
  42. package/squads/claude-code-mastery/workflows/optimization-cycle.yaml +4 -4
  43. package/squads/claude-code-mastery/workflows/project-setup-cycle.yaml +4 -4
  44. package/squads/squad-animations/README.md +1 -1
  45. package/squads/squad-cloning/README.md +1 -1
  46. package/squads/squad-commercial/README.md +1 -1
  47. package/squads/squad-content/README.md +1 -1
  48. package/squads/squad-copy/README.md +1 -1
  49. package/squads/squad-council/README.md +1 -1
  50. package/squads/squad-courses/README.md +1 -1
  51. package/squads/squad-cybersecurity/README.md +1 -1
  52. package/squads/squad-design/README.md +1 -1
  53. package/squads/squad-finance/README.md +1 -1
  54. package/squads/squad-growth/README.md +1 -1
  55. package/squads/squad-paidmedia/README.md +1 -1
  56. package/squads/squad-product/README.md +1 -1
  57. package/squads/squad-research/README.md +1 -1
  58. package/squads/squad-storytelling/README.md +1 -1
  59. package/.sinapse-ai/core/memory/__tests__/active-modules.verify.js +0 -265
  60. package/.sinapse-ai/core/permissions/__tests__/permission-mode.test.js +0 -293
  61. package/.sinapse-ai/infrastructure/tests/project-status-loader.test.js +0 -569
  62. package/.sinapse-ai/infrastructure/tests/regression-suite-v2.md +0 -622
  63. package/.sinapse-ai/infrastructure/tests/validate-module.js +0 -98
  64. package/.sinapse-ai/infrastructure/tests/worktree-manager.test.js +0 -620
  65. package/.sinapse-ai/workflow-intelligence/__tests__/confidence-scorer.test.js +0 -335
  66. package/.sinapse-ai/workflow-intelligence/__tests__/integration.test.js +0 -340
  67. package/.sinapse-ai/workflow-intelligence/__tests__/suggestion-engine.test.js +0 -438
  68. package/.sinapse-ai/workflow-intelligence/__tests__/wave-analyzer.test.js +0 -448
  69. package/.sinapse-ai/workflow-intelligence/__tests__/workflow-registry.test.js +0 -303
  70. package/packages/installer/src/__tests__/performance-benchmark.js +0 -383
  71. package/packages/installer/tests/integration/environment-configuration.test.js +0 -332
  72. package/packages/installer/tests/integration/wizard-detection.test.js +0 -352
  73. package/packages/installer/tests/unit/artifact-copy-pipeline/artifact-copy-pipeline.test.js +0 -402
  74. package/packages/installer/tests/unit/claude-md-template-v5/claude-md-template-v5.test.js +0 -193
  75. package/packages/installer/tests/unit/config-validator.test.js +0 -315
  76. package/packages/installer/tests/unit/detection/detect-project-type.test.js +0 -539
  77. package/packages/installer/tests/unit/doctor/doctor-checks.test.js +0 -675
  78. package/packages/installer/tests/unit/doctor/doctor-orchestrator.test.js +0 -192
  79. package/packages/installer/tests/unit/entity-registry-bootstrap.test.js +0 -192
  80. package/packages/installer/tests/unit/env-template.test.js +0 -187
  81. package/packages/installer/tests/unit/generate-settings-json/generate-settings-json.test.js +0 -310
  82. package/packages/installer/tests/unit/git-hooks-installer.test.js +0 -262
  83. package/packages/installer/tests/unit/ide-sync-integration/ide-sync-integration.test.js +0 -231
  84. package/packages/installer/tests/unit/merger/env-merger.test.js +0 -191
  85. package/packages/installer/tests/unit/merger/markdown-merger.test.js +0 -262
  86. package/packages/installer/tests/unit/merger/strategies.test.js +0 -154
  87. package/packages/installer/tests/unit/merger/yaml-merger.test.js +0 -328
  88. package/packages/sinapse-install/tests/unit/chrome-brain.smoke.test.js +0 -66
@@ -62,7 +62,7 @@ The orchestrator MUST still delegate. The correct response pattern is:
62
62
  | Midia paga, ads | @paidmedia-orqx (Apex) |
63
63
  | Produto, roadmap | @product-orqx (Vector) |
64
64
  | Pesquisa, inteligencia | @research-orqx (Prism) |
65
- | Claude Code mastery | @claude-orqx (Nucleus) |
65
+ | Claude Code mastery | @swarm-orqx (Nexus) |
66
66
  | Conselho estrategico | @council-orqx (Zenith) |
67
67
  | Storytelling, pitch | @storytelling-orqx (Arc) |
68
68
  | Cybersecurity | @cyber-orqx (Fortress) |
@@ -133,8 +133,9 @@
133
133
  "research-competitor-positioning"
134
134
  ]
135
135
  },
136
- "claude-orqx": {
136
+ "swarm-orqx": {
137
137
  "aliases": [
138
+ "swarm-orqx",
138
139
  "claude-orqx",
139
140
  "claude"
140
141
  ],
@@ -421,14 +422,14 @@
421
422
  {
422
423
  "from": "sinapse-orqx",
423
424
  "fromType": "orqx",
424
- "to": "claude-orqx",
425
+ "to": "swarm-orqx",
425
426
  "toType": "orqx",
426
427
  "path": ".codex/agents/swarm-orqx.md",
427
428
  "handoff": "delegate-to-squad",
428
429
  "reason": "Runtime and setup parity work belongs to the Claude mastery squad."
429
430
  },
430
431
  {
431
- "from": "claude-orqx",
432
+ "from": "swarm-orqx",
432
433
  "fromType": "orqx",
433
434
  "to": "project-integrator",
434
435
  "toType": "specialist",
@@ -132,8 +132,9 @@
132
132
  "research-competitor-positioning"
133
133
  ]
134
134
  },
135
- "claude-orqx": {
135
+ "swarm-orqx": {
136
136
  "aliases": [
137
+ "swarm-orqx",
137
138
  "claude-orqx",
138
139
  "claude"
139
140
  ],
@@ -420,14 +421,14 @@
420
421
  {
421
422
  "from": "sinapse-orqx",
422
423
  "fromType": "orqx",
423
- "to": "claude-orqx",
424
+ "to": "swarm-orqx",
424
425
  "toType": "orqx",
425
426
  "path": ".codex/agents/swarm-orqx.md",
426
427
  "handoff": "delegate-to-squad",
427
428
  "reason": "Runtime and setup parity work belongs to the Claude mastery squad."
428
429
  },
429
430
  {
430
- "from": "claude-orqx",
431
+ "from": "swarm-orqx",
431
432
  "fromType": "orqx",
432
433
  "to": "project-integrator",
433
434
  "toType": "specialist",
@@ -16,7 +16,7 @@ Examples:
16
16
  ### Pattern: /sinapse
17
17
  Show the available squads and how to activate them:
18
18
 
19
- **18 Squads Available:**
19
+ **17 Squads Available:**
20
20
  | Squad | Comando | Foco |
21
21
  |-------|---------|------|
22
22
  | Brand | `@brand-orqx` | Estrategia de marca |
@@ -35,7 +35,7 @@ Show the available squads and how to activate them:
35
35
  | Courses | `@courses-orqx` | Producao educacional |
36
36
  | Cloning | `@cloning-orqx` | Clonagem cognitiva |
37
37
  | Council | `@council-orqx` | Advisors estrategicos |
38
- | Claude | `@claude-orqx` | Claude Code mastery |
38
+ | Claude | `@swarm-orqx` | Claude Code mastery |
39
39
 
40
40
  **12 Core Development Agents:**
41
41
  | Agent | Comando | Funcao |
@@ -150,10 +150,10 @@ Métricas do ecossistema (contagem de squads, agentes, tasks, orqx) DEVEM ser es
150
150
  <!-- BEGIN AUTO-GENERATED COUNTS (sync via `npm run sync:counts`) -->
151
151
  - **17 squads** (diretórios em `squads/`)
152
152
  - **172 agentes** (160 em squads + 12 framework agents)
153
- - **20 comandos orqx** (19 squad orqx + 1 master sinapse-orqx)
153
+ - **18 comandos orqx** (17 squad orqx + 1 master sinapse-orqx)
154
154
  - **1200 tasks** (em `squads/*/tasks/`)
155
155
 
156
- *Last synced: 2026-06-16T06:50:56.447Z*
156
+ *Last synced: 2026-06-18T04:58:21.153Z*
157
157
  <!-- END AUTO-GENERATED COUNTS -->
158
158
 
159
159
 
@@ -8,12 +8,23 @@
8
8
  * `.sinapse-ai/git-hooks` but that directory is EMPTY/MISSING — so every guard
9
9
  * is silently INERT and secrets/destructive SQL pass at commit time.
10
10
  *
11
+ * Beyond mere existence, this check also confirms the guard is PLAUSIBLE rather
12
+ * than a hollow shell:
13
+ * 1. core.hooksPath actually RESOLVES to the managed dir (.sinapse-ai/git-hooks).
14
+ * A hooksPath pointing somewhere else means the framework backstop is not the
15
+ * active hook system, even if some pre-commit exists there.
16
+ * 2. The pre-commit (and any present pre-push) guard is NON-EMPTY. A zero-byte /
17
+ * whitespace-only hook file passes existsSync but runs nothing — the same
18
+ * INERT trap with a file present to disguise it.
19
+ *
11
20
  * Verdicts:
12
- * - FAIL: core.hooksPath is set but the dir is missing OR has no pre-commit
13
- * (the inert-trap state security off without anyone noticing).
14
- * - WARN: no core.hooksPath set and no .husky fallback (hooks not installed).
15
- * - PASS: managed hooksPath populated with pre-commit (and ideally pre-push),
16
- * OR a husky fallback with the expected hooks exists.
21
+ * - FAIL: core.hooksPath is set but the dir is missing, has no pre-commit, the
22
+ * pre-commit is empty, OR hooksPath resolves outside the managed dir
23
+ * (the inert-trap states security off without anyone noticing).
24
+ * - WARN: no core.hooksPath set and no .husky fallback (hooks not installed),
25
+ * or pre-push present-but-empty / missing.
26
+ * - PASS: managed hooksPath populated with a non-empty pre-commit (and ideally
27
+ * pre-push), OR a husky fallback with the expected hooks exists.
17
28
  *
18
29
  * @module sinapse-ai/doctor/checks/git-hooks
19
30
  * @story INS-4.1, E8-SECURITY
@@ -46,6 +57,36 @@ function readHooksPath(projectRoot) {
46
57
  }
47
58
  }
48
59
 
60
+ /**
61
+ * True when a hook file exists AND carries real (non-whitespace) content.
62
+ * A zero-byte / blank hook passes existsSync but executes nothing — the same
63
+ * INERT trap with a file present to disguise it.
64
+ * @param {string} hookFile absolute path
65
+ * @returns {boolean}
66
+ */
67
+ function hasContent(hookFile) {
68
+ try {
69
+ return fs.readFileSync(hookFile, 'utf8').trim().length > 0;
70
+ } catch {
71
+ return false;
72
+ }
73
+ }
74
+
75
+ /**
76
+ * True when the configured hooksPath resolves to the managed git-hooks dir
77
+ * (.sinapse-ai/git-hooks), regardless of whether it was given as a relative or
78
+ * absolute path. If it points elsewhere, the framework backstop is not the
79
+ * active hook system even if some pre-commit happens to exist there.
80
+ * @param {string} projectRoot
81
+ * @param {string} hooksPath value from core.hooksPath
82
+ * @returns {boolean}
83
+ */
84
+ function resolvesToManaged(projectRoot, hooksPath) {
85
+ const resolved = path.resolve(projectRoot, hooksPath);
86
+ const managed = path.resolve(projectRoot, MANAGED_HOOKS_DIR);
87
+ return resolved === managed;
88
+ }
89
+
49
90
  async function run(context) {
50
91
  const projectRoot = context.projectRoot;
51
92
  const hooksPath = readHooksPath(projectRoot);
@@ -64,6 +105,17 @@ async function run(context) {
64
105
  };
65
106
  }
66
107
 
108
+ // hooksPath points at a real dir, but does it point at OUR managed dir? If it
109
+ // resolves elsewhere, the framework backstop is not the active hook system.
110
+ if (!resolvesToManaged(projectRoot, hooksPath)) {
111
+ return {
112
+ check: name,
113
+ status: 'FAIL',
114
+ message: `core.hooksPath -> "${hooksPath}" resolves OUTSIDE the managed dir (${MANAGED_HOOKS_DIR}). The framework's secret-scan/SQL/boundary guards are not the active hook system. Re-wire core.hooksPath to the managed dir.`,
115
+ fixCommand: 'sinapse init # re-wires core.hooksPath to .sinapse-ai/git-hooks',
116
+ };
117
+ }
118
+
67
119
  if (!fs.existsSync(preCommit)) {
68
120
  return {
69
121
  check: name,
@@ -73,9 +125,22 @@ async function run(context) {
73
125
  };
74
126
  }
75
127
 
76
- // Populated. Report which managed hooks are present.
77
- const present = EXPECTED_MANAGED.filter((h) => fs.existsSync(path.join(hooksDirAbs, h)));
78
- const missing = EXPECTED_MANAGED.filter((h) => !fs.existsSync(path.join(hooksDirAbs, h)));
128
+ // pre-commit exists but is empty/whitespace -> runs nothing -> still INERT.
129
+ if (!hasContent(preCommit)) {
130
+ return {
131
+ check: name,
132
+ status: 'FAIL',
133
+ message: `core.hooksPath -> "${hooksPath}" has a pre-commit file but it is EMPTY. The guard executes nothing — secret-scan/SQL/boundary are INERT despite the file being present.`,
134
+ fixCommand: 'sinapse init # regenerates the managed pre-commit guard',
135
+ };
136
+ }
137
+
138
+ // Populated with a plausible (non-empty) pre-commit. Report present hooks,
139
+ // treating a present-but-empty hook as missing (it does nothing).
140
+ const present = EXPECTED_MANAGED.filter(
141
+ (h) => fs.existsSync(path.join(hooksDirAbs, h)) && hasContent(path.join(hooksDirAbs, h)),
142
+ );
143
+ const missing = EXPECTED_MANAGED.filter((h) => !present.includes(h));
79
144
 
80
145
  if (missing.length === 0) {
81
146
  return {
@@ -86,11 +151,12 @@ async function run(context) {
86
151
  };
87
152
  }
88
153
 
89
- // pre-commit present (security backstop active) but pre-push missing -> WARN.
154
+ // pre-commit present and non-empty (security backstop active) but pre-push
155
+ // missing or empty -> WARN.
90
156
  return {
91
157
  check: name,
92
158
  status: 'WARN',
93
- message: `managed pre-commit active at ${hooksPath}; missing: ${missing.join(', ')}`,
159
+ message: `managed pre-commit active at ${hooksPath}; missing/empty: ${missing.join(', ')}`,
94
160
  fixCommand: 'sinapse init # writes the missing managed hook(s)',
95
161
  };
96
162
  }
@@ -12,7 +12,7 @@ const EventEmitter = require('events');
12
12
  const _path = require('path');
13
13
  const { runSafe } = require('../utils/spawn-safe');
14
14
 
15
- // epic: orchestration-consolidation, F2 — resolves any of the 189 agent ids to
15
+ // epic: orchestration-consolidation, F2 — resolves any of the 172 agent ids to
16
16
  // its real persona on disk (squads/ + framework agents). Optional: degrades to a
17
17
  // generic prompt if the module is missing.
18
18
  let SquadAgentResolver;
@@ -222,6 +222,13 @@ class SynapseEngine {
222
222
  * @param {object} [config={}] - Configuration from manifest / caller
223
223
  * @param {object} [config.manifest] - Parsed manifest object
224
224
  * @param {boolean} [config.devmode] - Enable DEVMODE debug output
225
+ * @param {Array<object>} [config.layers] - Optional pre-instantiated layer
226
+ * instances (dependency injection). When provided, these are used verbatim
227
+ * instead of loading + instantiating the L0-L7 modules from disk. Each
228
+ * instance must expose `name`, `layer`, and `_safeProcess(context)`. This is
229
+ * the seam used by tests to inject isolated mock layers without relying on
230
+ * `jest.mock` hoisting or module-cache state. Production never passes this,
231
+ * so default behavior is unchanged.
225
232
  */
226
233
  constructor(synapsePath, config = {}) {
227
234
  this.synapsePath = synapsePath;
@@ -233,6 +240,14 @@ class SynapseEngine {
233
240
  /** @type {MemoryBridge} Feature-gated MIS consumer (SYN-10) */
234
241
  this.memoryBridge = new MemoryBridge();
235
242
 
243
+ // Dependency injection seam: when caller supplies ready layer instances,
244
+ // use them directly and skip module loading entirely (production default
245
+ // = no config.layers → identical behavior to before).
246
+ if (Array.isArray(config.layers)) {
247
+ this.layers = config.layers.filter(Boolean);
248
+ return;
249
+ }
250
+
236
251
  for (const mod of LAYER_MODULES) {
237
252
  const LayerClass = loadLayerModule(mod.path);
238
253
  if (LayerClass) {
@@ -1,6 +1,6 @@
1
1
  metadata:
2
2
  version: 1.0.0
3
- lastUpdated: '2026-06-17T19:03:15.397Z'
3
+ lastUpdated: '2026-06-18T05:22:03.289Z'
4
4
  entityCount: 810
5
5
  checksumAlgorithm: sha256
6
6
  resolutionRate: 100
@@ -238,8 +238,8 @@ entities:
238
238
  score: 0.7
239
239
  constraints: []
240
240
  extensionPoints: []
241
- checksum: sha256:d06ce22670f135d81483da98314a2f2fb843b8eb85f13ba5d37c13629ef80848
242
- lastVerified: '2026-06-15T01:36:42.600Z'
241
+ checksum: sha256:81710d210c261e3a9135411ce111bac5ef9965f78f4c4c8ab8ea1f41f150cea9
242
+ lastVerified: '2026-06-18T04:29:33.818Z'
243
243
  update:
244
244
  path: bin/commands/update.js
245
245
  layer: L1
@@ -831,8 +831,8 @@ entities:
831
831
  score: 0.7
832
832
  constraints: []
833
833
  extensionPoints: []
834
- checksum: sha256:ecf325fc29eb7ad8a89117deec91deae653e6d92bd2293e33a4979f582559893
835
- lastVerified: '2026-06-17T19:03:15.213Z'
834
+ checksum: sha256:6df52276cf16bcbca776e11dc4f90ca2594c5ed1f22dc1dd37a44262eccaaf54
835
+ lastVerified: '2026-06-18T04:25:38.106Z'
836
836
  staged-secret-scan:
837
837
  path: bin/utils/staged-secret-scan.js
838
838
  layer: L1
@@ -1457,8 +1457,8 @@ entities:
1457
1457
  score: 0.8
1458
1458
  constraints: []
1459
1459
  extensionPoints: []
1460
- checksum: sha256:56f8f1e1a5dc349d2361ea6d58ae4fd17c048a98e6a7672af390b2e0c31b7234
1461
- lastVerified: '2026-06-16T17:13:38.706Z'
1460
+ checksum: sha256:e8dab3d13ae816a1543a220561024b57d692a39a316ce29efd1ca7c6405ec304
1461
+ lastVerified: '2026-06-18T04:18:26.455Z'
1462
1462
  build-component:
1463
1463
  path: .sinapse-ai/development/tasks/build-component.md
1464
1464
  layer: L2
@@ -9610,8 +9610,8 @@ entities:
9610
9610
  score: 0.4
9611
9611
  constraints: []
9612
9612
  extensionPoints: []
9613
- checksum: sha256:653371d423b5f132bdedc5b80c3a2a82471bff1c147fea25ce52b4cd8bcd3b23
9614
- lastVerified: '2026-06-16T19:50:23.589Z'
9613
+ checksum: sha256:353441b03a572d27e03f626ae31336aa526c3dcec780ca89433c6fabec05a723
9614
+ lastVerified: '2026-06-18T04:42:18.034Z'
9615
9615
  graph-dashboard:
9616
9616
  path: .sinapse-ai/core/doctor/checks/graph-dashboard.js
9617
9617
  layer: L1
@@ -10336,8 +10336,8 @@ entities:
10336
10336
  score: 0.4
10337
10337
  constraints: []
10338
10338
  extensionPoints: []
10339
- checksum: sha256:19f050834b0c5faf69ac5ff8d448ab3a7af7109c82fd2cbb5299320b7e7b6e2b
10340
- lastVerified: '2026-06-15T00:26:26.381Z'
10339
+ checksum: sha256:c291a8d9dea32273577b5c726626f4bc7a94b6aa67a52c9f312d6448ca6ab910
10340
+ lastVerified: '2026-06-18T04:29:34.042Z'
10341
10341
  wave-executor:
10342
10342
  path: .sinapse-ai/core/execution/wave-executor.js
10343
10343
  layer: L1
@@ -14411,8 +14411,8 @@ entities:
14411
14411
  score: 0.3
14412
14412
  constraints: []
14413
14413
  extensionPoints: []
14414
- checksum: sha256:90bb4376f8ca2ab7bf2176ce51aeed9f04ab00ae14085be3ef7b82585f504193
14415
- lastVerified: '2026-06-17T17:42:07.543Z'
14414
+ checksum: sha256:744ba24a08e6d294d93dff577d14185fa02b589f298049a734001f3b504daf82
14415
+ lastVerified: '2026-06-18T05:22:03.153Z'
14416
14416
  sprint-lead:
14417
14417
  path: .sinapse-ai/development/agents/sprint-lead.md
14418
14418
  layer: L2
@@ -267,8 +267,8 @@ routing_table:
267
267
 
268
268
  - squad: claude-code-mastery
269
269
  prefix: claude
270
- orchestrator: claude-orqx (Nucleus)
271
- invocation: "/claude:agents:claude-orqx"
270
+ orchestrator: swarm-orqx (Nexus)
271
+ invocation: "/claude:agents:swarm-orqx"
272
272
  domain: "Claude Code mastery, prompt engineering, MCP, automacao, hooks, skills, plugins, agent teams, context engineering"
273
273
  agents: 11
274
274
  tasks: 51
@@ -559,7 +559,7 @@ relationships:
559
559
  context: "All product strategy, discovery, roadmap"
560
560
  - agent: research-orqx (Prism)
561
561
  context: "All market research, competitive intelligence"
562
- - agent: claude-orqx (Nucleus)
562
+ - agent: swarm-orqx (Nexus)
563
563
  context: "All Claude Code mastery, prompt engineering, MCP"
564
564
  - agent: council-orqx (Zenith)
565
565
  context: "All strategic counsel, mental models, advisory"
@@ -657,7 +657,7 @@ Imperator can provide ecosystem-wide insights by combining capabilities across s
657
657
  | 9 | paidmedia | pm | Apex | Midia paga, Meta/Google Ads |
658
658
  | 10 | product | product | Vector | Produto, discovery, roadmap |
659
659
  | 11 | research | research | Prism | Pesquisa, inteligencia competitiva |
660
- | 12 | claude | claude | Nucleus | Claude Code, prompt engineering |
660
+ | 12 | claude-code-mastery | claude | Nexus | Claude Code, prompt engineering |
661
661
  | 13 | council | council | Zenith | Conselho estrategico, advisory |
662
662
  | 14 | storytelling | narrative | Arc | Storytelling, pitch, apresentacao |
663
663
  | 15 | cybersecurity | cyber | Fortress | Cybersecurity, compliance, pentest |
@@ -72,6 +72,17 @@ const NAMED_PATTERNS = [
72
72
  { name: 'Hardcoded Password', pattern: /(?:password|passwd|pwd)\s*[=:]\s*['"][^'"]{8,}['"]/i, lowConfidence: true },
73
73
  { name: 'Bearer Token', pattern: /[Bb]earer\s+[A-Za-z0-9_\-.]{20,}/, entropyGated: true, lowConfidence: true },
74
74
  { name: 'Basic Auth', pattern: /[Bb]asic\s+[A-Za-z0-9+/=]{20,}/, lowConfidence: true },
75
+
76
+ // Long pure-hex runs (32–64 chars). The 16-symbol hex alphabet caps Shannon
77
+ // entropy at ~4.0, BELOW ENTROPY_THRESHOLD (4.5), so the generic entropy
78
+ // backstop never sees them — Twilio auth tokens (32-hex), webhook signing
79
+ // secrets and SHA-style 64-hex digests slip through. This explicit rule closes
80
+ // that gap. It is `hashContextGated`: a hex run sitting in an integrity /
81
+ // checksum / lockfile / git-sha context (covered by HASH_CONTEXT_PATTERN) is a
82
+ // legitimate hash, NOT a secret, and is allowlisted. `lowConfidence` keeps it
83
+ // OUT of the release publish gate (entropy:false there would otherwise match
84
+ // every documented digest); the diff-scoped commit hook still enforces it.
85
+ { name: 'Long Hex Token', pattern: /\b[a-f0-9]{32,64}\b/i, hashContextGated: true, lowConfidence: true },
75
86
  ];
76
87
 
77
88
  const PLACEHOLDER_TOKENS = [
@@ -100,19 +111,48 @@ const PLACEHOLDER_PATTERNS = [
100
111
 
101
112
  const EXAMPLE_HOST_PATTERN = /(?:example\.(?:com|org|net)|localhost|127\.0\.0\.1|host\b|your-host|placeholder)/i;
102
113
 
114
+ // A keyword placeholder only allowlists when it DOMINATES the value: once every
115
+ // placeholder occurrence is removed, the TOTAL alphanumeric length that remains
116
+ // is too short to be a secret on its own (< ENTROPY_MIN_LEN). A bare
117
+ // `lower.includes(token)` was a trivial bypass — ANY real secret that happened to
118
+ // contain "abcdef" / "123456" / "example" anywhere in its body got silently
119
+ // allowlisted (e.g. Xq9Zk2…abcdef…Fg5 passed). Measuring the *total* remainder
120
+ // (not just the longest contiguous run) closes that hole even when the buried
121
+ // placeholder splits the secret into two sub-threshold runs: the legitimate
122
+ // cases (your-key-here, placeholder123456, test-key-example, CHANGEME) strip down
123
+ // to nothing, while a 35-char random token minus a 6-char placeholder still has
124
+ // ~29 alphanumeric chars left and is NOT allowlisted.
125
+ function placeholderDominates(lower) {
126
+ let stripped = lower;
127
+ let matchedAny = false;
128
+ for (const token of PLACEHOLDER_TOKENS) {
129
+ if (stripped.includes(token)) {
130
+ matchedAny = true;
131
+ // Replace with a separator so adjacent runs aren't fused into a longer one.
132
+ stripped = stripped.split(token).join(' ');
133
+ }
134
+ }
135
+ if (!matchedAny) return false;
136
+ // Total alphanumeric chars left after removing every placeholder occurrence.
137
+ const remaining = (stripped.match(/[a-z0-9]/g) || []).length;
138
+ return remaining < ENTROPY_MIN_LEN;
139
+ }
140
+
103
141
  function isAllowlistPlaceholder(value) {
104
142
  if (value === null || value === undefined) return false;
105
143
  const v = String(value).trim();
106
144
  if (v.length === 0) return true;
107
145
 
108
- const lower = v.toLowerCase();
109
- for (const token of PLACEHOLDER_TOKENS) {
110
- if (lower.includes(token)) return true;
111
- }
146
+ // Structural placeholders are always safe: <...>, [...], {token}, ${VAR},
147
+ // SCREAMING_SNAKE env-var names, and repeated single-symbol fillers.
112
148
  for (const re of PLACEHOLDER_PATTERNS) {
113
149
  if (re.test(v)) return true;
114
150
  }
115
151
  if (/^(.)\1{5,}$/.test(v)) return true; // repeated single char
152
+
153
+ // Keyword placeholders: word-boundary anchored + dominance, NOT raw includes().
154
+ if (placeholderDominates(v.toLowerCase())) return true;
155
+
116
156
  return false;
117
157
  }
118
158
 
@@ -204,6 +244,38 @@ function scanContent(content, options = {}) {
204
244
  if (shannonEntropy(tail) < 2.0) continue; // clearly non-random
205
245
  }
206
246
 
247
+ if (descriptor.hashContextGated) {
248
+ // Long hex runs are flagged as suspected secrets (Twilio token, webhook
249
+ // signing secret, SHA-style digest) EXCEPT when they sit in an integrity /
250
+ // checksum / lockfile / git-sha context — those are legitimate hashes, not
251
+ // leaked credentials. Reuse HASH_CONTEXT_PATTERN over a window around the
252
+ // match so package-lock integrity:, "resolved" tarball #sha, "checksum",
253
+ // and 40/64-hex git shas are NOT false-positived. A fully repeated/obvious
254
+ // placeholder hex (deadbeef…, 000…) is also allowlisted.
255
+ if (isAllowlistPlaceholder(matched)) continue;
256
+ if (isLockfilePath(filePath)) continue;
257
+ // Canonical digest lengths — git SHA-1 (40) and SHA-256 (64) — are
258
+ // overwhelmingly legitimate hashes (commit refs, file checksums, content
259
+ // digests) and appear bare in changelogs/docs/lockfiles. Treating every
260
+ // isolated 40/64-hex run as a leak would false-positive on the entire git
261
+ // ecosystem, so these exact lengths are hash-shaped by default. The
262
+ // headline real-secret case (Twilio auth token = 32-hex) and other
263
+ // non-digest lengths (33–39, 41–63) are NOT standard digests and stay
264
+ // flagged. A leaked literal hash secret of EXACTLY 40/64 hex is the
265
+ // accepted blind spot of this length-based heuristic (documented tradeoff
266
+ // favouring zero false-positives on git/checksum hashes).
267
+ const hexLen = matched.length;
268
+ if (hexLen === 40 || hexLen === 64) continue;
269
+ // For non-canonical lengths, allowlist only when the SURROUNDING context
270
+ // carries a hash marker (integrity:, sha256-, "resolved", "checksum"). The
271
+ // window is widened on the left so a marker earlier on the line
272
+ // (e.g. `"resolved": "https://…/x.tgz#<hex>"`) is still seen.
273
+ const mIdx = text.indexOf(matched);
274
+ const before = text.slice(Math.max(0, mIdx - 64), mIdx);
275
+ const after = text.slice(mIdx + matched.length, mIdx + matched.length + 4);
276
+ if (HASH_CONTEXT_PATTERN.test(before + ' ' + after)) continue;
277
+ }
278
+
207
279
  findings.push({ name: descriptor.name, redacted: redactMatch(matched), kind: 'pattern' });
208
280
  }
209
281
 
@@ -28,7 +28,13 @@ function pickValidateScript() {
28
28
  const script = pickValidateScript();
29
29
  if (script) {
30
30
  const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
31
- const res = spawnSync(npmCmd, ['run', '--silent', script], { stdio: 'inherit', cwd: projectRoot });
31
+ // shell:true on Windows spawning npm.cmd without it throws EINVAL (CVE-2024-27980 /
32
+ // Node DEP0190). Args are fixed/literal here, so there is no shell-injection surface.
33
+ const res = spawnSync(npmCmd, ['run', '--silent', script], {
34
+ stdio: 'inherit',
35
+ cwd: projectRoot,
36
+ shell: process.platform === 'win32',
37
+ });
32
38
  if (res.error) {
33
39
  process.stderr.write('SINAPSE pre-push: could not run "npm run ' + script + '" — blocking push (fail-closed).\n');
34
40
  process.stderr.write(' ' + res.error.message + '\n');
@@ -7,7 +7,7 @@
7
7
  # - SHA256 hashes for change detection
8
8
  # - File types for categorization
9
9
  #
10
- version: 1.9.0
10
+ version: 1.9.1
11
11
  generator: scripts/generate-install-manifest.js
12
12
  file_count: 1180
13
13
  files:
@@ -348,9 +348,9 @@ files:
348
348
  type: core
349
349
  size: 1581
350
350
  - path: core/doctor/checks/git-hooks.js
351
- hash: sha256:653371d423b5f132bdedc5b80c3a2a82471bff1c147fea25ce52b4cd8bcd3b23
351
+ hash: sha256:353441b03a572d27e03f626ae31336aa526c3dcec780ca89433c6fabec05a723
352
352
  type: core
353
- size: 5041
353
+ size: 8039
354
354
  - path: core/doctor/checks/graph-dashboard.js
355
355
  hash: sha256:6996b47faf1945ed27a24db2a0061c46f9fd0069b0c73a8af0f4b68d68142047
356
356
  type: core
@@ -500,7 +500,7 @@ files:
500
500
  type: core
501
501
  size: 52328
502
502
  - path: core/execution/subagent-dispatcher.js
503
- hash: sha256:19f050834b0c5faf69ac5ff8d448ab3a7af7109c82fd2cbb5299320b7e7b6e2b
503
+ hash: sha256:c291a8d9dea32273577b5c726626f4bc7a94b6aa67a52c9f312d6448ca6ab910
504
504
  type: core
505
505
  size: 32197
506
506
  - path: core/execution/wave-executor.js
@@ -1244,9 +1244,9 @@ files:
1244
1244
  type: core
1245
1245
  size: 8123
1246
1246
  - path: core/synapse/engine.js
1247
- hash: sha256:66b124c47e1fd275cfd7e4bc02a12ef429e436959a7e56999fdeee5c80f0a23e
1247
+ hash: sha256:04395397b60a8b7a30ac1677633b277077e94ed1250f3709e0c54f821deadef1
1248
1248
  type: core
1249
- size: 14632
1249
+ size: 15479
1250
1250
  - path: core/synapse/layers/l0-constitution.js
1251
1251
  hash: sha256:0d042647a67f8f46073207627a582c6c24b5713f02beb0e86af6f231cc33c5eb
1252
1252
  type: core
@@ -1364,7 +1364,7 @@ files:
1364
1364
  type: data
1365
1365
  size: 9587
1366
1366
  - path: data/entity-registry.yaml
1367
- hash: sha256:1b9f3692955053e6a2e6174b1ff3e337c873ddd75a13b918bf4fdc82ebec207a
1367
+ hash: sha256:2287de6ef9ec9e862f5d69ba1a4c2e91d483e2b2181557d571e69899db6fd0cd
1368
1368
  type: data
1369
1369
  size: 558183
1370
1370
  - path: data/learned-patterns.yaml
@@ -1532,9 +1532,9 @@ files:
1532
1532
  type: agent
1533
1533
  size: 1369
1534
1534
  - path: development/agents/snps-orqx.md
1535
- hash: sha256:90bb4376f8ca2ab7bf2176ce51aeed9f04ab00ae14085be3ef7b82585f504193
1535
+ hash: sha256:744ba24a08e6d294d93dff577d14185fa02b589f298049a734001f3b504daf82
1536
1536
  type: agent
1537
- size: 34541
1537
+ size: 34545
1538
1538
  - path: development/agents/sprint-lead.md
1539
1539
  hash: sha256:572289b770cdbb0cff9ae2de4b2d19c38ce814fe978df397aa2794297f562c91
1540
1540
  type: agent
package/AGENTS.md CHANGED
@@ -46,8 +46,8 @@ tests/ # Test suites
46
46
  ## Agents
47
47
 
48
48
  The core SDC agents below are documented in full. They are NOT the whole roster:
49
- **every one of the 172 agents** (12 core + 160 squad specialists/orchestrators across
50
- 17 squads) resolves by `@name` and so do their real tasks. Resolution is parametric —
49
+ **every one of the 172 agents** (12 core + 160 specialists/orchestrators distributed
50
+ across 17 squads) resolves by `@name` and so do their real tasks. Resolution is parametric —
51
51
  read from the source agent definitions at runtime, never from a frozen list:
52
52
 
53
53
  ```bash