sinapse-ai 1.22.0 → 1.23.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.
@@ -30,17 +30,30 @@
30
30
  const fs = require('fs');
31
31
  const path = require('path');
32
32
 
33
- /** Paths that require doc-first before code changes (mirror enforce-story-gate). */
33
+ /** Code directories (fast path) mirror enforce-story-gate. Expanded beyond the
34
+ * original 8 to cover common back-end/full-stack layouts; combined with CODE_EXT
35
+ * below so code in ANY non-exempt, non-config location is gated. */
34
36
  const CODE_PATHS = [
35
- 'packages/', 'src/', 'app/', 'lib/', 'bin/',
37
+ 'packages/', 'src/', 'app/', 'apps/', 'lib/', 'bin/',
36
38
  'components/', 'pages/', 'api/', 'services/',
39
+ 'server/', 'client/', 'backend/', 'frontend/', 'functions/',
40
+ 'worker/', 'workers/', 'routes/', 'controllers/', 'models/',
41
+ 'handlers/', 'middleware/', 'hooks/', 'stores/', 'store/',
42
+ 'features/', 'modules/', 'domain/', 'views/', 'screens/',
43
+ 'contexts/', 'providers/', 'utils/', 'helpers/', 'cmd/',
44
+ 'internal/', 'pkg/',
37
45
  ];
38
46
 
47
+ /** Code file extensions — catches code in ANY non-exempt, non-config location. */
48
+ const CODE_EXT = /\.(m?[jt]sx?|cjs|vue|svelte|astro|py|go|rs|java|rb|php|swift|kt|kts|c|cc|cpp|h|hpp|cs|scala|ex|exs|clj|dart)$/i;
49
+
39
50
  /** Paths always exempt. */
40
51
  const EXEMPT_PATHS = [
41
52
  '.claude/', '.sinapse-ai/', '.sinapse/', '.sinapse-custom/',
42
53
  'docs/', 'tests/', '__tests__/', 'test/',
43
54
  'node_modules/', '.git/', 'squads/', 'outputs/',
55
+ // Build outputs / generated — never gated.
56
+ '.next/', 'dist/', 'build/', 'out/', 'coverage/', '.vercel/', '.turbo/', '.cache/',
44
57
  ];
45
58
 
46
59
  /** Config files always exempt (scaffolding a project is allowed pre-docs). */
@@ -73,8 +86,24 @@ function isExempt(rel) {
73
86
  return EXEMPT_PATHS.some((ep) => rel.startsWith(ep));
74
87
  }
75
88
 
89
+ /**
90
+ * Config-like files exempt by PATTERN in ANY folder (so extension-based detection
91
+ * never over-blocks tooling config): `*.config.{js,ts,mjs,cjs}`, `*.d.ts`, and
92
+ * dotfile rc configs (`.eslintrc.json`, `.prettierrc.cjs`).
93
+ */
94
+ function isConfigLike(rel) {
95
+ const base = path.basename(rel);
96
+ return (
97
+ /\.config\.[cm]?[jt]s$/i.test(base) ||
98
+ /\.d\.ts$/i.test(base) ||
99
+ /^\.[a-z0-9_-]+rc(\.[a-z]+)?$/i.test(base)
100
+ );
101
+ }
102
+
76
103
  function isCodePath(rel) {
77
- return CODE_PATHS.some((cp) => rel.startsWith(cp));
104
+ if (isConfigLike(rel)) return false;
105
+ if (CODE_PATHS.some((cp) => rel.startsWith(cp))) return true;
106
+ return CODE_EXT.test(rel);
78
107
  }
79
108
 
80
109
  function main() {
@@ -24,17 +24,33 @@ const path = require('path');
24
24
  // Configuration
25
25
  // ---------------------------------------------------------------------------
26
26
 
27
- /** Paths that require an active story before code changes. */
27
+ /**
28
+ * Code directories (fast path). Expanded beyond the original 8 to cover common
29
+ * back-end / full-stack layouts. NOTE: this is no longer the ONLY signal — any
30
+ * code file (by extension) in a non-exempt, non-config location is also gated
31
+ * (see isCodePath), so this list is a fast-path, not a hole-prone allowlist.
32
+ */
28
33
  const CODE_PATHS = [
29
- 'packages/', 'src/', 'app/', 'lib/', 'bin/',
34
+ 'packages/', 'src/', 'app/', 'apps/', 'lib/', 'bin/',
30
35
  'components/', 'pages/', 'api/', 'services/',
36
+ 'server/', 'client/', 'backend/', 'frontend/', 'functions/',
37
+ 'worker/', 'workers/', 'routes/', 'controllers/', 'models/',
38
+ 'handlers/', 'middleware/', 'hooks/', 'stores/', 'store/',
39
+ 'features/', 'modules/', 'domain/', 'views/', 'screens/',
40
+ 'contexts/', 'providers/', 'utils/', 'helpers/', 'cmd/',
41
+ 'internal/', 'pkg/',
31
42
  ];
32
43
 
44
+ /** Code file extensions — catches code in ANY non-exempt, non-config location. */
45
+ const CODE_EXT = /\.(m?[jt]sx?|cjs|vue|svelte|astro|py|go|rs|java|rb|php|swift|kt|kts|c|cc|cpp|h|hpp|cs|scala|ex|exs|clj|dart)$/i;
46
+
33
47
  /** Paths always exempt from story requirement. */
34
48
  const EXEMPT_PATHS = [
35
49
  '.claude/', '.sinapse-ai/', '.sinapse/', '.sinapse-custom/',
36
50
  'docs/', 'tests/', '__tests__/', 'test/',
37
51
  'node_modules/', '.git/', 'squads/', 'outputs/',
52
+ // Build outputs / generated — never gated.
53
+ '.next/', 'dist/', 'build/', 'out/', 'coverage/', '.vercel/', '.turbo/', '.cache/',
38
54
  ];
39
55
 
40
56
  /** Config files always exempt. */
@@ -49,6 +65,29 @@ const EXEMPT_FILES = [
49
65
  'postcss.config.js', 'postcss.config.cjs',
50
66
  ];
51
67
 
68
+ /**
69
+ * Config-like files exempt by PATTERN in ANY folder (so the extension-based
70
+ * detection never over-blocks tooling config): `*.config.{js,ts,mjs,cjs}`,
71
+ * `*.d.ts` type decls, and dotfile rc configs (`.eslintrc.json`, `.prettierrc.cjs`).
72
+ */
73
+ function isConfigLike(rel) {
74
+ const base = path.basename(rel);
75
+ return (
76
+ /\.config\.[cm]?[jt]s$/i.test(base) ||
77
+ /\.d\.ts$/i.test(base) ||
78
+ /^\.[a-z0-9_-]+rc(\.[a-z]+)?$/i.test(base)
79
+ );
80
+ }
81
+
82
+ /** True if this project IS the SINAPSE framework's own repo (Art. III exception). */
83
+ function isFrameworkRepo(root) {
84
+ try {
85
+ return JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8')).name === 'sinapse-ai';
86
+ } catch {
87
+ return false;
88
+ }
89
+ }
90
+
52
91
  /** Story statuses that allow implementation. */
53
92
  const VALID_STATUSES = ['ready', 'inprogress', 'in progress', 'in_progress', 'inreview', 'in review', 'in_review', 'done'];
54
93
 
@@ -76,7 +115,13 @@ function isExempt(rel) {
76
115
  }
77
116
 
78
117
  function isCodePath(rel) {
79
- return CODE_PATHS.some((cp) => rel.startsWith(cp));
118
+ // Config-like files are never gated, even inside code dirs.
119
+ if (isConfigLike(rel)) return false;
120
+ // Fast path: known code directory.
121
+ if (CODE_PATHS.some((cp) => rel.startsWith(cp))) return true;
122
+ // Catch-all: a code file (by extension) anywhere non-exempt, non-config —
123
+ // this is what closes the "code in server/ or root escapes the gate" hole.
124
+ return CODE_EXT.test(rel);
80
125
  }
81
126
 
82
127
  /**
@@ -180,6 +225,11 @@ function main() {
180
225
  // Only enforce on code paths
181
226
  if (!isCodePath(rel)) process.exit(0);
182
227
 
228
+ // Framework's own repo operates above the story layer (Art. III exception) —
229
+ // mirror doc-first-gate. The expanded detection now reaches scripts/ etc., so
230
+ // without this the framework's own development would be over-blocked.
231
+ if (isFrameworkRepo(root)) process.exit(0);
232
+
183
233
  // Check for active story
184
234
  if (hasActiveStory(root)) process.exit(0);
185
235
 
@@ -7,7 +7,7 @@
7
7
  # - SHA256 hashes for change detection
8
8
  # - File types for categorization
9
9
  #
10
- version: 1.22.0
10
+ version: 1.23.0
11
11
  generator: scripts/generate-install-manifest.js
12
12
  file_count: 1155
13
13
  files:
package/CHANGELOG.md CHANGED
@@ -1,40 +1,40 @@
1
- ## [1.22.0](https://github.com/caioimori/sinapse-ai/compare/1.21.0...1.22.0) (2026-07-07)
1
+ ## [1.23.0](https://github.com/caioimori/sinapse-ai/compare/1.22.0...1.23.0) (2026-07-08)
2
2
 
3
3
  ### Features
4
4
 
5
- * **gate:** M2 verificação de substância do spec no gate doc-first [Story rodada2-m2-spec-substance-gate] ([#358](https://github.com/caioimori/sinapse-ai/issues/358)) ([bc2e192](https://github.com/caioimori/sinapse-ai/commit/bc2e192322b36de54dd5a91383950a7cc8e39a49))
6
- * **gate:** M5 — check de constituição CLAUDE/AGENTS no gate de PR [Story rodada2-m5-claude-agents-single-source] ([#361](https://github.com/caioimori/sinapse-ai/issues/361)) ([e08be2e](https://github.com/caioimori/sinapse-ai/commit/e08be2eb407043b9ad77de08cf48a08bf3690ba4)), closes [#7](https://github.com/caioimori/sinapse-ai/issues/7)
7
- * **lint:** M3 — guard de descrição de ferramentas/comandos [Story rodada2-m3-tool-description-lint] ([#359](https://github.com/caioimori/sinapse-ai/issues/359)) ([bd9a4a9](https://github.com/caioimori/sinapse-ai/commit/bd9a4a9d977ecd60b95209bf540c926c63f6489f))
8
- * **lint:** mesa2 — ACs em GWT executável (template + guard advisory) [Story mesa2-acs-gwt-guard] ([#364](https://github.com/caioimori/sinapse-ai/issues/364)) ([ef24dc3](https://github.com/caioimori/sinapse-ai/commit/ef24dc36a5e5df05b5761b676fc140906739e006))
9
- * **spec:** M4 — cerimônia COMPLEX≥16 do spec-pipeline em código [Story rodada2-m4-complex-ceremony-code] ([#360](https://github.com/caioimori/sinapse-ai/issues/360)) ([e15f04b](https://github.com/caioimori/sinapse-ai/commit/e15f04b418111ce5cbead2a8321444e5ae2288ca))
5
+ * **gate:** cobertura doc-first por extensao em qualquer pasta marco de release [Story mesa2-docfirst-gate-coverage] ([#371](https://github.com/caioimori/sinapse-ai/issues/371)) ([a77b4e1](https://github.com/caioimori/sinapse-ai/commit/a77b4e1b3d4ba250e488d229071e341e3f763bfc)), closes [#370](https://github.com/caioimori/sinapse-ai/issues/370)
10
6
 
11
- ### Bug Fixes
7
+ # Changelog
12
8
 
13
- * **orchestration:** rodada 2 lote B guardas runtime, gate CI cross-platform e higiene [Story rodada2-lote-b-codigo-ci] ([#354](https://github.com/caioimori/sinapse-ai/issues/354)) ([ce18459](https://github.com/caioimori/sinapse-ai/commit/ce18459dc0884510f43287cebe221e06d0669b6b))
14
- * **vitrine:** rodada 2 lote A — números exatos e era-de-modelo [Story rodada2-lote-a-vitrine-numeros] ([#353](https://github.com/caioimori/sinapse-ai/issues/353)) ([615aaf4](https://github.com/caioimori/sinapse-ai/commit/615aaf4d3d5dcced5a7f0aa575b8d33c324f8798))
9
+ All notable changes to SINAPSE will be documented in this file.
15
10
 
16
- ### Documentation
11
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
17
13
 
18
- * **audit:** fecha relatório rodada 2 com PRs [#353](https://github.com/caioimori/sinapse-ai/issues/353)/[#354](https://github.com/caioimori/sinapse-ai/issues/354) mergeados [Story rodada2-lote-b-codigo-ci] ([#355](https://github.com/caioimori/sinapse-ai/issues/355)) ([e81cb79](https://github.com/caioimori/sinapse-ai/commit/e81cb79f6f560c28109ecdfcd4e205102e244231))
19
- * **epic:** fundação doc-first rodada 2 — épicos Mesa + instalação global [Story rodada2-mesa] ([#356](https://github.com/caioimori/sinapse-ai/issues/356)) ([3d6169f](https://github.com/caioimori/sinapse-ai/commit/3d6169f10c1f0e0a13946827dce9ba4f1a6a5d77))
20
- * **links:** M1 — zera 121 links markdown quebrados [Story rodada2-m1-link-sweep] ([#357](https://github.com/caioimori/sinapse-ai/issues/357)) ([d9e4f53](https://github.com/caioimori/sinapse-ai/commit/d9e4f53afef01a3447f9b1af57eeee79c8986b1e))
14
+ ## [Unreleased]
21
15
 
22
- ### Maintenance
16
+ ## [1.22.0] — 2026-07-07 — 🎛️ Mesa AF-20260704: guards doc-first + economia de contexto + calibração do juiz
23
17
 
24
- * **release:** sync da main pós-release 1.21.0 ([#352](https://github.com/caioimori/sinapse-ai/issues/352)) ([8f15c86](https://github.com/caioimori/sinapse-ai/commit/8f15c868f5808a1673a663398b1194ce5b0189e5)), closes [#277](https://github.com/caioimori/sinapse-ai/issues/277)
18
+ > Minor. Atualização segura via `npx sinapse-ai update`. Executa integralmente a Mesa da rodada 2 (épicos `epic-rodada2-mesa` + `epic-rodada2-mesa-fase2`, PRs #357–#368) — dos guards de qualidade ao contexto enxuto, tudo com verificação adversarial.
25
19
 
26
- ### Refactoring
20
+ ### Features
27
21
 
28
- * **agents:** M6 dedup da integração CodeRabbit (single-source) [Story rodada2-m6] ([#362](https://github.com/caioimori/sinapse-ai/issues/362)) ([a574dd5](https://github.com/caioimori/sinapse-ai/commit/a574dd50833610342ff03178a5275ec4d00d7c0e))
22
+ - **gate:** verificação de substância do spec no gate doc-first passa de "arquivo existe" para conteúdo real (#358)
23
+ - **gate:** check de fonte única CLAUDE.md ⇄ AGENTS.md no gate de PR (#361)
24
+ - **lint:** guard de descrição de ferramentas/comandos — descrição vaga/vazia degrada roteamento, agora barrada (#359)
25
+ - **lint:** ACs nascem em Given/When/Then executável (template) + guard advisory `validate:story-acs` (#364)
26
+ - **spec:** cerimônia COMPLEX≥16 do spec-pipeline aplicada em código, não só em prosa (#360)
27
+ - **quality:** calibração do juiz LLM — golden set determinístico (gate 100% em CI) + primeira medição semântica **95,2%** juiz-vs-humano, 15/15 nos casos críticos (#365, #368)
29
28
 
30
- # Changelog
29
+ ### Refactoring
31
30
 
32
- All notable changes to SINAPSE will be documented in this file.
31
+ - **rules:** híbrido core+companion nas 4 rules NON-NEGOTIABLE situacionais a lei fica sempre-ativa, o detalhe carrega por path. Contexto fixo de regras **−48%** (856→445 linhas/prompt), enforcement preservado (#367)
32
+ - **agents:** dedup da integração CodeRabbit para fonte única — −140 linhas de config duplicada em 6 agentes (#362)
33
33
 
34
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
35
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
34
+ ### Documentation
36
35
 
37
- ## [Unreleased]
36
+ - **links:** zera 121 links markdown quebrados (#357)
37
+ - **decisões:** 3 ADRs de governança (frota como ferramenta interna, aliases LiteLLM legados, escopo das rules) + fundação dos épicos da Mesa (#356, #363, #366)
38
38
 
39
39
  ## [1.21.0] — 2026-07-04 — 🏗️ Onda 3 estrutural: gates determinísticos em todos os fluxos + eval como gate de merge
40
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sinapse-ai",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "SINAPSE AI: Framework de orquestracao de IA — 17 squads, 172 agentes especializados",
5
5
  "bin": {
6
6
  "sinapse": "bin/sinapse.js",