@semacode/cli 2.3.0 → 3.0.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 (267) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +112 -41
  3. package/dist/agentContextPack.js +14 -10
  4. package/dist/agentEntryPoints.d.ts +5 -0
  5. package/dist/agentEntryPoints.js +102 -91
  6. package/dist/angular-consumer-standalone.d.ts +3 -1
  7. package/dist/angular-consumer-standalone.js +12 -8
  8. package/dist/bin.d.ts +6 -0
  9. package/dist/bin.js +130 -0
  10. package/dist/cliArgs.js +4 -4
  11. package/dist/cliControlError.d.ts +12 -0
  12. package/dist/cliControlError.js +47 -0
  13. package/dist/cliGrammar.d.ts +11 -0
  14. package/dist/cliGrammar.js +551 -0
  15. package/dist/cliHelp.d.ts +13 -0
  16. package/dist/cliHelp.js +19 -0
  17. package/dist/cliHelpTexto.d.ts +3 -0
  18. package/dist/cliHelpTexto.js +168 -0
  19. package/dist/cliRuntime.d.ts +2 -0
  20. package/dist/cliRuntime.js +31 -0
  21. package/dist/comandos.js +9 -22
  22. package/dist/contexto.js +5 -5
  23. package/dist/dev/index.d.ts +1 -0
  24. package/dist/dev/index.js +51 -9
  25. package/dist/discovery/catalog.js +3 -3
  26. package/dist/distribuicao/filesystemGlobal.d.ts +63 -0
  27. package/dist/distribuicao/filesystemGlobal.js +701 -0
  28. package/dist/distribuicao/index.d.ts +7 -0
  29. package/dist/distribuicao/index.js +227 -0
  30. package/dist/distribuicao/launcherGlobal.d.ts +53 -0
  31. package/dist/distribuicao/launcherGlobal.js +643 -0
  32. package/dist/distribuicao/launcherWindows.d.ts +28 -0
  33. package/dist/distribuicao/launcherWindows.js +326 -0
  34. package/dist/distribuicao/lockContextGlobal.d.ts +10 -0
  35. package/dist/distribuicao/lockContextGlobal.js +17 -0
  36. package/dist/distribuicao/lockGlobal.d.ts +6 -0
  37. package/dist/distribuicao/lockGlobal.js +520 -0
  38. package/dist/distribuicao/skillGlobal.d.ts +48 -0
  39. package/dist/distribuicao/skillGlobal.js +652 -0
  40. package/dist/distribuicao/skillIntentPolicy.d.ts +21 -0
  41. package/dist/distribuicao/skillIntentPolicy.js +115 -0
  42. package/dist/distribuicao/tipos.d.ts +50 -0
  43. package/dist/distribuicao/tipos.js +10 -0
  44. package/dist/distribuicao/versaoSemantica.d.ts +3 -0
  45. package/dist/distribuicao/versaoSemantica.js +62 -0
  46. package/dist/drift.part01.d.ts +34 -2
  47. package/dist/drift.part01.js +3 -0
  48. package/dist/drift.part04.d.ts +12 -2
  49. package/dist/drift.part04.js +89 -15
  50. package/dist/drift.part05.d.ts +2 -1
  51. package/dist/drift.part05.js +9 -6
  52. package/dist/drift.part06.d.ts +2 -1
  53. package/dist/drift.part06.js +115 -24
  54. package/dist/drift.part07.d.ts +11 -10
  55. package/dist/drift.part07.js +261 -255
  56. package/dist/drift.part08.d.ts +2 -1
  57. package/dist/drift.part08.js +35 -25
  58. package/dist/drift.part11.js +279 -32
  59. package/dist/drift.part12.d.ts +1 -1
  60. package/dist/drift.part12.js +196 -11
  61. package/dist/drift.part13.d.ts +18 -2
  62. package/dist/drift.part13.js +654 -76
  63. package/dist/drift.part14.js +21 -7
  64. package/dist/driftCacheCas.d.ts +43 -0
  65. package/dist/driftCacheCas.js +351 -0
  66. package/dist/driftCacheFilesystem.d.ts +64 -0
  67. package/dist/driftCacheFilesystem.js +313 -0
  68. package/dist/driftCacheModes.d.ts +38 -0
  69. package/dist/driftCacheModes.js +147 -0
  70. package/dist/driftCacheStore.d.ts +80 -0
  71. package/dist/driftCacheStore.js +603 -0
  72. package/dist/driftCatalogo.d.ts +65 -0
  73. package/dist/driftCatalogo.js +516 -0
  74. package/dist/driftEscopo.d.ts +21 -0
  75. package/dist/driftEscopo.js +647 -0
  76. package/dist/driftEscopoReferencias.d.ts +8 -0
  77. package/dist/driftEscopoReferencias.js +612 -0
  78. package/dist/driftOrcamento.d.ts +6 -0
  79. package/dist/driftOrcamento.js +20 -3
  80. package/dist/geracaoCore.js +4 -6
  81. package/dist/iaPrompts.d.ts +3 -3
  82. package/dist/iaPrompts.js +13 -14
  83. package/dist/index.d.ts +4 -1
  84. package/dist/index.js +6 -25
  85. package/dist/index.part01.d.ts +21 -14
  86. package/dist/index.part01.js +20 -165
  87. package/dist/index.part02.js +57 -43
  88. package/dist/index.part03.d.ts +23 -1
  89. package/dist/index.part03.js +83 -8
  90. package/dist/index.part04.d.ts +10 -2
  91. package/dist/index.part04.js +48 -14
  92. package/dist/index.part05.d.ts +1 -1
  93. package/dist/index.part05.js +109 -30
  94. package/dist/index.part06.js +34 -16
  95. package/dist/index.part07.js +31 -27
  96. package/dist/index.part08.d.ts +1 -1
  97. package/dist/index.part08.js +23 -28
  98. package/dist/init/templates.part01.js +393 -393
  99. package/dist/init/templates.part02.js +189 -189
  100. package/dist/initCommand.js +5 -1
  101. package/dist/initTemplatesBackend.js +73 -73
  102. package/dist/initTemplatesBase.js +7 -5
  103. package/dist/initTemplatesFlutter.js +137 -137
  104. package/dist/initTemplatesRuntime.js +350 -350
  105. package/dist/initTemplatesWeb.js +309 -309
  106. package/dist/pipelineConteudo/command.d.ts +1 -0
  107. package/dist/pipelineConteudo/command.js +4 -32
  108. package/dist/pipelineConteudo/help.d.ts +2 -0
  109. package/dist/pipelineConteudo/help.js +33 -0
  110. package/dist/profileAuthorCommand.js +3 -7
  111. package/dist/profileCommand.js +3 -7
  112. package/dist/projeto.d.ts +1 -1
  113. package/dist/projetoCarregar.d.ts +2 -2
  114. package/dist/projetoCarregar.js +69 -28
  115. package/dist/projetoCatalogo.d.ts +8 -0
  116. package/dist/projetoCatalogo.js +164 -0
  117. package/dist/projetoOrigens.d.ts +2 -0
  118. package/dist/projetoOrigens.js +65 -9
  119. package/dist/projetoTipos.d.ts +15 -5
  120. package/dist/resultadoCli.d.ts +20 -0
  121. package/dist/resultadoCli.js +57 -0
  122. package/dist/saidaCli.d.ts +35 -0
  123. package/dist/saidaCli.js +118 -0
  124. package/dist/sistemasInterativos/acceptanceEvidence.d.ts +22 -0
  125. package/dist/sistemasInterativos/acceptanceEvidence.js +345 -0
  126. package/dist/sistemasInterativos/engineObservation.d.ts +12 -0
  127. package/dist/sistemasInterativos/engineObservation.js +438 -0
  128. package/dist/sistemasInterativos/jobOrchestration.d.ts +2 -0
  129. package/dist/sistemasInterativos/jobOrchestration.js +204 -0
  130. package/dist/sistemasInterativos/operationPrimitives.d.ts +21 -0
  131. package/dist/sistemasInterativos/operationPrimitives.js +194 -0
  132. package/dist/sistemasInterativos/operations.d.ts +4 -39
  133. package/dist/sistemasInterativos/operations.js +5 -1164
  134. package/dist/skillCommand.d.ts +5 -0
  135. package/dist/skillCommand.js +88 -0
  136. package/dist/sync/index.js +35 -35
  137. package/docs/README.md +11 -7
  138. package/docs/ai-integration.md +18 -11
  139. package/docs/ai-onboarding.md +81 -62
  140. package/docs/ai-workflow.md +10 -4
  141. package/docs/auth.md +26 -26
  142. package/docs/cli.md +197 -79
  143. package/docs/commands.md +30 -6
  144. package/docs/database.md +15 -15
  145. package/docs/deploy.md +54 -41
  146. package/docs/documentation.md +11 -10
  147. package/docs/drift-cache.md +108 -0
  148. package/docs/env.md +16 -16
  149. package/docs/frontend.md +41 -41
  150. package/docs/getting-started.md +82 -57
  151. package/docs/i18n.md +15 -15
  152. package/docs/repositories.md +60 -43
  153. package/docs/rollback.md +38 -31
  154. package/docs/security.md +54 -32
  155. package/docs/sistemas-interativos.md +27 -27
  156. package/docs/support.md +8 -8
  157. package/docs/testing.md +123 -17
  158. package/docs/vocabulary.md +29 -29
  159. package/exemplos/agendamento.sema +1 -1
  160. package/exemplos/assinatura.sema +1 -1
  161. package/exemplos/auditoria.sema +1 -1
  162. package/exemplos/autenticacao.sema +1 -1
  163. package/exemplos/author_obra_comum.sema +1 -1
  164. package/exemplos/author_tema_sensivel.sema +1 -1
  165. package/exemplos/automacao.sema +1 -1
  166. package/exemplos/cadastro_usuario.sema +1 -1
  167. package/exemplos/calculadora.sema +1 -1
  168. package/exemplos/crud_simples.sema +1 -1
  169. package/exemplos/estoque.sema +1 -1
  170. package/exemplos/exportacao.sema +1 -1
  171. package/exemplos/fila.sema +1 -1
  172. package/exemplos/integracao_externa.sema +1 -1
  173. package/exemplos/multi_tenant.sema +1 -1
  174. package/exemplos/notificacao.sema +1 -1
  175. package/exemplos/operacao_estrategia.sema +132 -132
  176. package/exemplos/operacao_estrategia_discovery.sema +220 -220
  177. package/exemplos/operacao_estrategia_fluxo.sema +114 -114
  178. package/exemplos/operacao_estrategia_gates.sema +106 -106
  179. package/exemplos/operacao_estrategia_quarentena.sema +133 -133
  180. package/exemplos/operacao_estrategia_rollout.sema +124 -124
  181. package/exemplos/pagamento.sema +1 -1
  182. package/exemplos/pagamento_dominio.sema +1 -1
  183. package/exemplos/pedido.sema +1 -1
  184. package/exemplos/permissao.sema +1 -1
  185. package/exemplos/persistencia_vendor_first.sema +1 -1
  186. package/exemplos/profile_conversas.sema +165 -165
  187. package/exemplos/profile_game.sema +1 -1
  188. package/exemplos/profile_legal.sema +1 -1
  189. package/exemplos/profile_ops.sema +1 -1
  190. package/exemplos/profile_research.sema +1 -1
  191. package/exemplos/profile_software.sema +1 -1
  192. package/exemplos/profile_workflow_n8n.sema +1 -1
  193. package/exemplos/relatorio.sema +1 -1
  194. package/exemplos/replica_analitica_erp.sema +1 -1
  195. package/exemplos/testes_embutidos.sema +1 -1
  196. package/exemplos/tratamento_erro.sema +1 -1
  197. package/exemplos/upload_arquivo.sema +1 -1
  198. package/exemplos/webhook.sema +1 -1
  199. package/node_modules/@sema/gerador-cpp/dist/index.js +176 -176
  200. package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
  201. package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
  202. package/node_modules/@sema/gerador-dotnet/dist/index.js +169 -169
  203. package/node_modules/@sema/gerador-html/dist/index.js +17 -17
  204. package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
  205. package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
  206. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
  207. package/node_modules/@sema/nucleo/dist/semantico/analisador.d.ts +1 -0
  208. package/node_modules/@sema/nucleo/dist/semantico/analisador.js +1 -0
  209. package/package.json +7 -2
  210. package/scripts/postinstall.mjs +148 -0
  211. package/skills/sema/SKILL.md +199 -0
  212. package/skills/sema/agents/openai.yaml +4 -0
  213. package/node_modules/@sema/gerador-cpp/dist/index.js.map +0 -1
  214. package/node_modules/@sema/gerador-css/dist/index.js.map +0 -1
  215. package/node_modules/@sema/gerador-css/dist/index.part01.js.map +0 -1
  216. package/node_modules/@sema/gerador-css/dist/index.part02.js.map +0 -1
  217. package/node_modules/@sema/gerador-dart/dist/index.js.map +0 -1
  218. package/node_modules/@sema/gerador-dotnet/dist/index.js.map +0 -1
  219. package/node_modules/@sema/gerador-html/dist/index.js.map +0 -1
  220. package/node_modules/@sema/gerador-javascript/dist/index.js.map +0 -1
  221. package/node_modules/@sema/gerador-lua/dist/index.js.map +0 -1
  222. package/node_modules/@sema/gerador-php/dist/index.js.map +0 -1
  223. package/node_modules/@sema/gerador-python/dist/index.js.map +0 -1
  224. package/node_modules/@sema/gerador-python/dist/index.part01.js.map +0 -1
  225. package/node_modules/@sema/gerador-python/dist/index.part02.js.map +0 -1
  226. package/node_modules/@sema/gerador-typescript/dist/index.js.map +0 -1
  227. package/node_modules/@sema/gerador-typescript/dist/index.part01.js.map +0 -1
  228. package/node_modules/@sema/gerador-typescript/dist/index.part02.js.map +0 -1
  229. package/node_modules/@sema/gerador-typescript/dist/index.part03.js.map +0 -1
  230. package/node_modules/@sema/nucleo/dist/ast/tipos.js.map +0 -1
  231. package/node_modules/@sema/nucleo/dist/diagnosticos/index.js.map +0 -1
  232. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js.map +0 -1
  233. package/node_modules/@sema/nucleo/dist/diagnosticos/snippets.js.map +0 -1
  234. package/node_modules/@sema/nucleo/dist/formatador/index.js.map +0 -1
  235. package/node_modules/@sema/nucleo/dist/formatador/index.part01.js.map +0 -1
  236. package/node_modules/@sema/nucleo/dist/formatador/index.part02.js.map +0 -1
  237. package/node_modules/@sema/nucleo/dist/index.js.map +0 -1
  238. package/node_modules/@sema/nucleo/dist/ir/conversor.js.map +0 -1
  239. package/node_modules/@sema/nucleo/dist/ir/conversor.part01.js.map +0 -1
  240. package/node_modules/@sema/nucleo/dist/ir/conversor.part02.js.map +0 -1
  241. package/node_modules/@sema/nucleo/dist/ir/conversor.part03.js.map +0 -1
  242. package/node_modules/@sema/nucleo/dist/ir/modelos.js.map +0 -1
  243. package/node_modules/@sema/nucleo/dist/lexer/lexer.js.map +0 -1
  244. package/node_modules/@sema/nucleo/dist/lexer/tokens.js.map +0 -1
  245. package/node_modules/@sema/nucleo/dist/parser/parser.declaracoes.js.map +0 -1
  246. package/node_modules/@sema/nucleo/dist/parser/parser.js.map +0 -1
  247. package/node_modules/@sema/nucleo/dist/parser/parser.modulo.js.map +0 -1
  248. package/node_modules/@sema/nucleo/dist/parser/parser.part01.js.map +0 -1
  249. package/node_modules/@sema/nucleo/dist/parser/parser.part02.js.map +0 -1
  250. package/node_modules/@sema/nucleo/dist/parser/parser.part03.js.map +0 -1
  251. package/node_modules/@sema/nucleo/dist/persistencia/contratos.js.map +0 -1
  252. package/node_modules/@sema/nucleo/dist/semantico/analisador.js.map +0 -1
  253. package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.js.map +0 -1
  254. package/node_modules/@sema/nucleo/dist/semantico/analisador.part02.js.map +0 -1
  255. package/node_modules/@sema/nucleo/dist/semantico/analisador.part03.js.map +0 -1
  256. package/node_modules/@sema/nucleo/dist/semantico/analisador.part04.js.map +0 -1
  257. package/node_modules/@sema/nucleo/dist/semantico/analisador.part05.js.map +0 -1
  258. package/node_modules/@sema/nucleo/dist/semantico/analisador.part06.js.map +0 -1
  259. package/node_modules/@sema/nucleo/dist/semantico/analisador.part07.js.map +0 -1
  260. package/node_modules/@sema/nucleo/dist/semantico/analisador.part08.js.map +0 -1
  261. package/node_modules/@sema/nucleo/dist/semantico/estruturas.js.map +0 -1
  262. package/node_modules/@sema/nucleo/dist/semantico/estruturas.part01.js.map +0 -1
  263. package/node_modules/@sema/nucleo/dist/semantico/estruturas.part02.js.map +0 -1
  264. package/node_modules/@sema/nucleo/dist/semantico/orcamentoSemantico.js.map +0 -1
  265. package/node_modules/@sema/nucleo/dist/semantico/seguranca.js.map +0 -1
  266. package/node_modules/@sema/nucleo/dist/util/arquivos.js.map +0 -1
  267. package/node_modules/@sema/padroes/dist/index.js.map +0 -1
package/docs/testing.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Public Sema tests should run locally.
4
4
 
5
- Recommended checks:
5
+ Recommended checks:
6
6
 
7
7
  ```bash
8
8
  npm run build
@@ -11,15 +11,31 @@ npm run repo:verificar-publico
11
11
  npm run plugin:testar-codex
12
12
  npm run cli:empacotar-publica
13
13
  npm run cli:testar-pacote-publico
14
- node pacotes/cli/dist/index.js --help
15
- node pacotes/cli/dist/index.js --version
16
- node pacotes/cli/dist/index.js resumo exemplos/calculadora.sema --micro --json
17
- node pacotes/cli/dist/index.js validar exemplos/calculadora.sema --json
18
- node pacotes/cli/dist/index.js testar exemplos/calculadora.sema --alvo dotnet --saida .tmp/testing-dotnet
19
- node pacotes/cli/dist/index.js testar exemplos/calculadora.sema --alvo cpp --saida .tmp/testing-cpp
14
+ node pacotes/cli/dist/bin.js --help
15
+ node pacotes/cli/dist/bin.js --version
16
+ node pacotes/cli/dist/bin.js resumo exemplos/calculadora.sema --micro --json
17
+ node pacotes/cli/dist/bin.js validar exemplos/calculadora.sema --json
18
+ node pacotes/cli/dist/bin.js testar exemplos/calculadora.sema --alvo dotnet --saida .tmp/testing-dotnet
19
+ node pacotes/cli/dist/bin.js testar exemplos/calculadora.sema --alvo cpp --saida .tmp/testing-cpp
20
20
  npm run release:preparar-publica
21
- npm run release:verificar-drift
22
- ```
21
+ npm run release:verificar-drift
22
+ ```
23
+
24
+ `npm run cli:empacotar-publica` is the only supported package factory. It
25
+ builds a private, per-run stage outside `pacotes/cli`, invokes npm there with
26
+ lifecycle scripts disabled, validates the complete tarball, and publishes the
27
+ final `.tgz` without replacing a different concurrent winner. Running `npm
28
+ pack` directly in the source workspace must fail closed and leave the source
29
+ tree byte-for-byte unchanged.
30
+
31
+ Packaging regressions must prove rejection of pre-existing source or output
32
+ junctions, zero external writes in those cases, cross-volume publication,
33
+ cleanup after injected faults, concurrent no-replace publication, and a full
34
+ stage sweep for source maps, credentials, environment files, and billing
35
+ artifacts. Post-operation identity checks detect ordinary path swaps, but tests
36
+ must not claim containment against a hostile same-user process racing path
37
+ operations; that stronger guarantee requires native directory-handle-relative
38
+ filesystem primitives that Node.js does not provide cross-platform.
23
39
 
24
40
  Do not require private or sensitive operational material for public test
25
41
  evidence. The public-package smoke must also reject the removed authorization
@@ -31,14 +47,104 @@ repeat that installation from the remote `gerlanss/Sema` marketplace and prove
31
47
  that GitHub HEAD, the installed skill, and the manifest-declared npm version
32
48
  all describe the same release.
33
49
 
34
- The local public-package smoke installs the generated tarball in an isolated
35
- sandbox. It must import the root API without executing the CLI, materialize
36
- nested interactive examples, and execute discovery, interactive schema,
37
- definition validation, planning, and adapter-protocol validation through the
38
- installed binary. Passing this smoke proves the local tarball only; it does not
39
- mean that npm or a GitHub release was published.
40
-
41
- Native generator evidence is mandatory when changing C#/.NET or C++ support.
50
+ The local public-package smoke installs the generated tarball in an isolated
51
+ sandbox. It must import the root API without executing the CLI, materialize
52
+ nested interactive examples, and execute discovery, interactive schema,
53
+ definition validation, planning, and adapter-protocol validation through the
54
+ installed binary. Its global-install phase uses an isolated home, prefix, npm
55
+ cache, and user cache; it verifies the absolute launcher with Node.js/npm absent
56
+ from `PATH`, exact skill digests, read-only status, idempotent repair, and zero
57
+ changes to the real home or workspace. On Windows it must resolve `sema.ps1`
58
+ from a restricted `PATH`, invoke `sema-managed.ps1` with the absolute system
59
+ `powershell.exe`, and exercise `sema.cmd` with conventional `cmd.exe` arguments.
60
+ Byte-exact arbitrary argv is proved through the PowerShell entrypoints. Passing this smoke proves
61
+ the local tarball only; it does not mean that npm or a GitHub release was
62
+ published.
63
+
64
+ The same installed-package smoke must execute root help plus `iniciar --help`,
65
+ `dev --help`, `formatar --help`, `sync-codex --help`, `skill sync --help`, short
66
+ `-h`, and help after unknown arguments. Each text and `--json` invocation runs
67
+ from an empty isolated workspace with an isolated HOME, user cache, plugin
68
+ cache, and npm cache. A recursive content fingerprint before and after every
69
+ invocation must remain identical, and every help path must finish within the
70
+ smoke timeout with exit code `0` and empty stderr.
71
+
72
+ The purity preload also fails on reads under the isolated workspace, HOME, or
73
+ cache roots, subprocess creation, and network primitives. Module reads from the
74
+ installed package itself remain allowed. The smoke invokes the real installed
75
+ launcher with PATH emptied, so a passing direct `node dist/bin.js` probe alone
76
+ is not accepted as launcher evidence.
77
+
78
+ JSON help must be one parseable `sema.cli.control/v1` document containing
79
+ exactly `schemaVersion`, `ok`, `kind`, `code`, `message`, and `exitCode`. The
80
+ smoke must also prove a non-zero `UNKNOWN_COMMAND` control response whose
81
+ process status equals `exitCode`, with no stack, absolute path, raw argv, or
82
+ second JSON document. Every syntactically valid command using `--json` must be
83
+ one parseable `sema.cli.result/v1` document containing exactly
84
+ `schemaVersion`, `ok`, `kind`, `command`, `code`, `message`, `exitCode`, and
85
+ `payload`. Smoke assertions must unwrap `payload` before checking
86
+ command-specific fields, and recorded fixtures must contain that payload rather
87
+ than either public CLI envelope. Coverage must include object, array, scalar,
88
+ and `null` payloads, coherent `SUCCESS` and `DOMAIN_ERROR` results, process
89
+ status equality, empty stderr, no `data` alias, and rejection of missing,
90
+ extra, nested, or mismatched envelope fields. `--version` remains a plain exact
91
+ SemVer text check.
92
+
93
+ Focused distribution tests live in
94
+ `testes/unidade/distribuicao-launcher-global.test.ts`,
95
+ `testes/unidade/distribuicao-skill-global.test.ts`, and
96
+ `testes/unidade/distribuicao-global.test.ts`. They must cover spaces, Unicode,
97
+ argument forwarding, stale targets, ownership conflicts, symlink/junction
98
+ escapes, atomic replacement, idempotent upgrades, the PowerShell fallback with
99
+ an absolute system executable, a detected Claude mirror, and a local lifecycle
100
+ no-op. No test may write to the real user home or a plugin cache.
101
+
102
+ The public-package smoke has one orchestrator and named helpers under
103
+ `scripts/cli-publico/`. All helpers share the same temporary sandbox and the
104
+ same installed tarball; splitting the checks must never multiply installations
105
+ or weaken the single `try/finally` cleanup boundary.
106
+
107
+ Focused drift regressions live in
108
+ `testes/unidade/drift-escopo-dependencias.test.ts`,
109
+ `testes/unidade/drift-escopo-referencias.test.ts`,
110
+ `testes/unidade/drift-catalogo.test.ts`,
111
+ `testes/unidade/drift-leitura-compartilhada.test.ts`, and
112
+ `testes/integracao/drift-escopo-io.test.ts`, plus the external-path attack
113
+ regressions in `testes/integracao/drift-caminhos-externos.test.ts`. They must prove planning before
114
+ cataloging, path confinement, dependency closure, one physical read and one AST
115
+ per canonical file, no homonymous last-write-wins resolution, and no
116
+ project-wide walk for `arquivo` or `modulo` scope. Project-loading regressions
117
+ also prove deferred code discovery and rejection of external configured roots
118
+ or contract origins before enumeration. In project scope, physical file
119
+ bindings outside code roots must enter the safe catalog individually, including
120
+ non-indexable assets, without causing a walk of their parent directories.
121
+ Drift, impact, and semantic rename must not expose an external path or read its
122
+ contents.
123
+ Persistent-cache regressions live in
124
+ `testes/unidade/drift-cache-modes.test.ts`,
125
+ `testes/unidade/drift-cache-store.test.ts`,
126
+ `testes/integracao/drift-cache-persistente.test.ts`, and
127
+ `testes/integracao/drift-cli-modes.test.ts`. They must prove all three modes,
128
+ query defaults, nullable non-evidence, zero cache I/O for `none`, storage outside
129
+ the workspace, opaque paths, strong-content invalidation even with restored
130
+ metadata, corruption recovery, immutable concurrent publication, and semantic
131
+ equivalence between fresh and warm results. Shape-valid semantic tampering with
132
+ only the envelope `payloadDigest` recalculated must fail the cross-index
133
+ invariants, become a corrupt miss, recalculate, and match the fresh result. The
134
+ payload must derive symbol, route, resource, and known-file aggregates from its
135
+ canonical per-extractor indices instead of trusting redundant aggregate lists.
136
+ A warm hit may skip AST/extractor work, but it never reuses the final score,
137
+ links, diagnostics, or success decision. Junctions, symlinks, hardlinks, path
138
+ traversal, drive-relative paths,
139
+ intermediate-directory swaps, and cache unavailability must fail closed or
140
+ degrade to an in-memory calculation without mutating the workspace.
141
+
142
+ Cache digests are corruption checks, not authentication against a hostile
143
+ process running as the same operating-system user. Tests must not present a
144
+ warm cache hit as a protected trust boundary; final closure evidence uses
145
+ `--cache fresh`.
146
+
147
+ Native generator evidence is mandatory when changing C#/.NET or C++ support.
42
148
  The `dotnet` smoke must compile and execute through the local .NET SDK. The
43
149
  `cpp` smoke must compile and execute through GCC, Clang, or MSVC; checking only
44
150
  for generated files is not sufficient.
@@ -1,29 +1,29 @@
1
- # Sema Vocabulary
2
-
3
- Use consistent English prose in public docs while preserving technical
4
- identifiers.
5
-
6
- ## Canonical Concepts
7
-
8
- - semantic contract
9
- - drift
10
- - impact map
11
- - governed code
12
- - traceability
13
- - Codex-native
14
- - local runtime
15
- - finalization
16
- - evidence
17
- - local CLI
18
-
19
- ## Do Not Translate
20
-
21
- - commands: `sema validar`, `sema drift`, `sema impacto`
22
- - files: `AGENTS.md`, `SEMA_BOOT.md`, `SEMA_INDEX.json`
23
- - DSL keywords: `task`, `input`, `output`, `rules`, `effects`, `guarantees`
24
- - package names: `@semacode/cli`
25
- - code symbols and environment variable names
26
-
27
- ## Public Support
28
-
29
- Use suporte@otimitare.online for support references.
1
+ # Sema Vocabulary
2
+
3
+ Use consistent English prose in public docs while preserving technical
4
+ identifiers.
5
+
6
+ ## Canonical Concepts
7
+
8
+ - semantic contract
9
+ - drift
10
+ - impact map
11
+ - governed code
12
+ - traceability
13
+ - Codex-native
14
+ - local runtime
15
+ - finalization
16
+ - evidence
17
+ - local CLI
18
+
19
+ ## Do Not Translate
20
+
21
+ - commands: `sema validar`, `sema drift`, `sema impacto`
22
+ - files: `AGENTS.md`, `SEMA_BOOT.md`, `SEMA_INDEX.json`
23
+ - DSL keywords: `task`, `input`, `output`, `rules`, `effects`, `guarantees`
24
+ - package names: `@semacode/cli`
25
+ - code symbols and environment variable names
26
+
27
+ ## Public Support
28
+
29
+ Use suporte@otimitare.online for support references.
@@ -102,4 +102,4 @@ module exemplos.agendamento {
102
102
  }
103
103
  }
104
104
  }
105
- }
105
+ }
@@ -130,4 +130,4 @@ module exemplos.assinatura {
130
130
  }
131
131
  }
132
132
  }
133
- }
133
+ }
@@ -86,4 +86,4 @@ module exemplos.auditoria {
86
86
  }
87
87
  }
88
88
  }
89
- }
89
+ }
@@ -122,4 +122,4 @@ module exemplos.autenticacao {
122
122
  }
123
123
  }
124
124
  }
125
- }
125
+ }
@@ -291,4 +291,4 @@ module exemplos.author.obra_comum {
291
291
  auditoria author_flow criticidade = media
292
292
  }
293
293
  }
294
- }
294
+ }
@@ -261,4 +261,4 @@ module exemplos.author.tema_sensivel {
261
261
  auditoria author_flow_sensivel criticidade = alta
262
262
  }
263
263
  }
264
- }
264
+ }
@@ -104,4 +104,4 @@ module exemplos.automacao {
104
104
  etapa auditar usa registrar_auditoria com protocolo = receber.protocolo depende_de receber
105
105
  etapa registrar_falha usa registrar_falha_onboarding com lead_id = lead_id depende_de receber
106
106
  }
107
- }
107
+ }
@@ -51,4 +51,4 @@ module exemplos.cadastro.usuario {
51
51
  }
52
52
  }
53
53
  }
54
- }
54
+ }
@@ -75,4 +75,4 @@ module exemplos.calculadora {
75
75
  }
76
76
  }
77
77
  }
78
- }
78
+ }
@@ -86,4 +86,4 @@ module exemplos.crud.simples {
86
86
  produto: Produto
87
87
  }
88
88
  }
89
- }
89
+ }
@@ -124,4 +124,4 @@ module exemplos.estoque {
124
124
  }
125
125
  }
126
126
  }
127
- }
127
+ }
@@ -91,4 +91,4 @@ module exemplos.exportacao {
91
91
  }
92
92
  }
93
93
  }
94
- }
94
+ }
@@ -127,4 +127,4 @@ module exemplos.fila {
127
127
  }
128
128
  }
129
129
  }
130
- }
130
+ }
@@ -91,4 +91,4 @@ module exemplos.integracao.externa {
91
91
  }
92
92
  }
93
93
  }
94
- }
94
+ }
@@ -137,4 +137,4 @@ module exemplos.multi.tenant {
137
137
  }
138
138
  }
139
139
  }
140
- }
140
+ }
@@ -146,4 +146,4 @@ module exemplos.notificacao {
146
146
  etapa registrar_falha_push usa registrar_falha_notificacao com canal = canal_push depende_de push
147
147
  etapa concluir usa confirmar_notificacao com destinatario_id = destinatario_id depende_de email
148
148
  }
149
- }
149
+ }
@@ -1,132 +1,132 @@
1
- module exemplos.operacao_estrategia {
2
- docs {
3
- resumo: "Referencia oficial de governanca operacional para strategy,slice,gate,discovery semanal e rollout. Este indice fino mantem modelos compartilhados e flow; as tasks ficam em arquivos filhos por responsabilidade."
4
- }
5
-
6
- type JanelaDiscovery {
7
- fields {
8
- semana_referencia: Data
9
- strategy_id: Id
10
- versao_modelo_candidata: Texto
11
- status_discovery: StatusDiscovery
12
- }
13
- invariants {
14
- semana_referencia existe
15
- strategy_id existe
16
- versao_modelo_candidata existe
17
- status_discovery em [ABERTA, EM_AVALIACAO, APROVADA, REJEITADA]
18
- }
19
- }
20
-
21
- type ContextoQuarentena {
22
- fields {
23
- motivo: Texto
24
- origem: Texto
25
- desde: Data
26
- }
27
- invariants {
28
- motivo existe
29
- origem existe
30
- desde existe
31
- }
32
- }
33
-
34
- entity Strategy {
35
- fields {
36
- id: Id
37
- versao_modelo_ativa: Texto
38
- versao_modelo_candidata: Texto
39
- status: StatusStrategy
40
- gate_global: StatusGate
41
- discovery_atual: JanelaDiscovery
42
- ultima_quarentena: ContextoQuarentena
43
- }
44
- invariants {
45
- id existe
46
- versao_modelo_ativa existe
47
- versao_modelo_candidata existe
48
- status em [RASCUNHO, ATIVA, QUARENTENA, DESATIVADA]
49
- gate_global em [ABERTO, FECHADO]
50
- discovery_atual existe
51
- ultima_quarentena existe
52
- }
53
- }
54
-
55
- entity Slice {
56
- fields {
57
- id: Id
58
- strategy_id: Id
59
- status: StatusSlice
60
- gate: StatusGate
61
- versao_modelo_ativa: Texto
62
- versao_modelo_candidata: Texto
63
- motivo_quarentena: Texto
64
- precision_observada: Decimal
65
- }
66
- invariants {
67
- id existe
68
- strategy_id existe
69
- status em [ATIVO, QUARENTENA, DESLIGADO]
70
- gate em [ABERTO, FECHADO]
71
- versao_modelo_ativa existe
72
- versao_modelo_candidata existe
73
- motivo_quarentena existe
74
- precision_observada existe
75
- }
76
- }
77
-
78
- enum StatusStrategy {
79
- RASCUNHO,
80
- ATIVA,
81
- QUARENTENA,
82
- DESATIVADA
83
- }
84
-
85
- enum StatusSlice {
86
- ATIVO,
87
- QUARENTENA,
88
- DESLIGADO
89
- }
90
-
91
- enum StatusGate {
92
- ABERTO,
93
- FECHADO
94
- }
95
-
96
- enum StatusDiscovery {
97
- ABERTA,
98
- EM_AVALIACAO,
99
- APROVADA,
100
- REJEITADA
101
- }
102
-
103
- state governanca_estrategia {
104
- fields {
105
- status: StatusStrategy
106
- slice_status: StatusSlice
107
- gate_global: StatusGate
108
- gate_slice: StatusGate
109
- discovery_status: StatusDiscovery
110
- versao_modelo_ativa: Texto
111
- versao_modelo_candidata: Texto
112
- motivo_operacional: Texto
113
- }
114
- invariants {
115
- status em [RASCUNHO, ATIVA, QUARENTENA, DESATIVADA]
116
- slice_status em [ATIVO, QUARENTENA, DESLIGADO]
117
- gate_global em [ABERTO, FECHADO]
118
- gate_slice em [ABERTO, FECHADO]
119
- discovery_status em [ABERTA, EM_AVALIACAO, APROVADA, REJEITADA]
120
- versao_modelo_ativa existe
121
- versao_modelo_candidata existe
122
- motivo_operacional existe
123
- }
124
- transitions {
125
- RASCUNHO -> ATIVA
126
- ATIVA -> QUARENTENA
127
- QUARENTENA -> ATIVA
128
- ATIVA -> DESATIVADA
129
- }
130
- }
131
-
132
- }
1
+ module exemplos.operacao_estrategia {
2
+ docs {
3
+ resumo: "Referencia oficial de governanca operacional para strategy,slice,gate,discovery semanal e rollout. Este indice fino mantem modelos compartilhados e flow; as tasks ficam em arquivos filhos por responsabilidade."
4
+ }
5
+
6
+ type JanelaDiscovery {
7
+ fields {
8
+ semana_referencia: Data
9
+ strategy_id: Id
10
+ versao_modelo_candidata: Texto
11
+ status_discovery: StatusDiscovery
12
+ }
13
+ invariants {
14
+ semana_referencia existe
15
+ strategy_id existe
16
+ versao_modelo_candidata existe
17
+ status_discovery em [ABERTA, EM_AVALIACAO, APROVADA, REJEITADA]
18
+ }
19
+ }
20
+
21
+ type ContextoQuarentena {
22
+ fields {
23
+ motivo: Texto
24
+ origem: Texto
25
+ desde: Data
26
+ }
27
+ invariants {
28
+ motivo existe
29
+ origem existe
30
+ desde existe
31
+ }
32
+ }
33
+
34
+ entity Strategy {
35
+ fields {
36
+ id: Id
37
+ versao_modelo_ativa: Texto
38
+ versao_modelo_candidata: Texto
39
+ status: StatusStrategy
40
+ gate_global: StatusGate
41
+ discovery_atual: JanelaDiscovery
42
+ ultima_quarentena: ContextoQuarentena
43
+ }
44
+ invariants {
45
+ id existe
46
+ versao_modelo_ativa existe
47
+ versao_modelo_candidata existe
48
+ status em [RASCUNHO, ATIVA, QUARENTENA, DESATIVADA]
49
+ gate_global em [ABERTO, FECHADO]
50
+ discovery_atual existe
51
+ ultima_quarentena existe
52
+ }
53
+ }
54
+
55
+ entity Slice {
56
+ fields {
57
+ id: Id
58
+ strategy_id: Id
59
+ status: StatusSlice
60
+ gate: StatusGate
61
+ versao_modelo_ativa: Texto
62
+ versao_modelo_candidata: Texto
63
+ motivo_quarentena: Texto
64
+ precision_observada: Decimal
65
+ }
66
+ invariants {
67
+ id existe
68
+ strategy_id existe
69
+ status em [ATIVO, QUARENTENA, DESLIGADO]
70
+ gate em [ABERTO, FECHADO]
71
+ versao_modelo_ativa existe
72
+ versao_modelo_candidata existe
73
+ motivo_quarentena existe
74
+ precision_observada existe
75
+ }
76
+ }
77
+
78
+ enum StatusStrategy {
79
+ RASCUNHO,
80
+ ATIVA,
81
+ QUARENTENA,
82
+ DESATIVADA
83
+ }
84
+
85
+ enum StatusSlice {
86
+ ATIVO,
87
+ QUARENTENA,
88
+ DESLIGADO
89
+ }
90
+
91
+ enum StatusGate {
92
+ ABERTO,
93
+ FECHADO
94
+ }
95
+
96
+ enum StatusDiscovery {
97
+ ABERTA,
98
+ EM_AVALIACAO,
99
+ APROVADA,
100
+ REJEITADA
101
+ }
102
+
103
+ state governanca_estrategia {
104
+ fields {
105
+ status: StatusStrategy
106
+ slice_status: StatusSlice
107
+ gate_global: StatusGate
108
+ gate_slice: StatusGate
109
+ discovery_status: StatusDiscovery
110
+ versao_modelo_ativa: Texto
111
+ versao_modelo_candidata: Texto
112
+ motivo_operacional: Texto
113
+ }
114
+ invariants {
115
+ status em [RASCUNHO, ATIVA, QUARENTENA, DESATIVADA]
116
+ slice_status em [ATIVO, QUARENTENA, DESLIGADO]
117
+ gate_global em [ABERTO, FECHADO]
118
+ gate_slice em [ABERTO, FECHADO]
119
+ discovery_status em [ABERTA, EM_AVALIACAO, APROVADA, REJEITADA]
120
+ versao_modelo_ativa existe
121
+ versao_modelo_candidata existe
122
+ motivo_operacional existe
123
+ }
124
+ transitions {
125
+ RASCUNHO -> ATIVA
126
+ ATIVA -> QUARENTENA
127
+ QUARENTENA -> ATIVA
128
+ ATIVA -> DESATIVADA
129
+ }
130
+ }
131
+
132
+ }