@semacode/cli 2.3.1 → 3.5.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 (281) hide show
  1. package/README.md +265 -217
  2. package/dist/agentContextPack.js +14 -10
  3. package/dist/agentEntryPoints.d.ts +5 -0
  4. package/dist/agentEntryPoints.js +592 -568
  5. package/dist/angular-consumer-standalone.js +1 -1
  6. package/dist/bin.d.ts +6 -0
  7. package/dist/bin.js +130 -0
  8. package/dist/cliArgs.js +4 -4
  9. package/dist/cliControlError.d.ts +12 -0
  10. package/dist/cliControlError.js +47 -0
  11. package/dist/cliGrammar.d.ts +11 -0
  12. package/dist/cliGrammar.js +551 -0
  13. package/dist/cliHelp.d.ts +13 -0
  14. package/dist/cliHelp.js +19 -0
  15. package/dist/cliHelpTexto.d.ts +3 -0
  16. package/dist/cliHelpTexto.js +168 -0
  17. package/dist/cliRuntime.d.ts +2 -0
  18. package/dist/cliRuntime.js +31 -0
  19. package/dist/comandos.js +9 -22
  20. package/dist/contexto.js +5 -5
  21. package/dist/dev/index.d.ts +1 -0
  22. package/dist/dev/index.js +51 -9
  23. package/dist/discovery/catalog.js +3 -3
  24. package/dist/distribuicao/filesystemGlobal.d.ts +63 -0
  25. package/dist/distribuicao/filesystemGlobal.js +701 -0
  26. package/dist/distribuicao/index.d.ts +7 -0
  27. package/dist/distribuicao/index.js +227 -0
  28. package/dist/distribuicao/launcherGlobal.d.ts +53 -0
  29. package/dist/distribuicao/launcherGlobal.js +643 -0
  30. package/dist/distribuicao/launcherWindows.d.ts +28 -0
  31. package/dist/distribuicao/launcherWindows.js +326 -0
  32. package/dist/distribuicao/lockContextGlobal.d.ts +10 -0
  33. package/dist/distribuicao/lockContextGlobal.js +17 -0
  34. package/dist/distribuicao/lockGlobal.d.ts +6 -0
  35. package/dist/distribuicao/lockGlobal.js +520 -0
  36. package/dist/distribuicao/skillGlobal.d.ts +48 -0
  37. package/dist/distribuicao/skillGlobal.js +652 -0
  38. package/dist/distribuicao/skillIntentPolicy.d.ts +21 -0
  39. package/dist/distribuicao/skillIntentPolicy.js +115 -0
  40. package/dist/distribuicao/tipos.d.ts +50 -0
  41. package/dist/distribuicao/tipos.js +10 -0
  42. package/dist/distribuicao/versaoSemantica.d.ts +3 -0
  43. package/dist/distribuicao/versaoSemantica.js +62 -0
  44. package/dist/docs.part01.d.ts +4 -1
  45. package/dist/docs.part01.js +8 -0
  46. package/dist/docs.part02.js +9 -1
  47. package/dist/drift.part01.d.ts +33 -25
  48. package/dist/drift.part01.js +2 -1
  49. package/dist/drift.part04.d.ts +26 -5
  50. package/dist/drift.part04.js +123 -19
  51. package/dist/drift.part05.d.ts +2 -2
  52. package/dist/drift.part05.js +8 -6
  53. package/dist/drift.part06.d.ts +2 -2
  54. package/dist/drift.part06.js +113 -26
  55. package/dist/drift.part07.d.ts +11 -11
  56. package/dist/drift.part07.js +261 -265
  57. package/dist/drift.part08.d.ts +2 -2
  58. package/dist/drift.part08.js +35 -26
  59. package/dist/drift.part09.d.ts +2 -2
  60. package/dist/drift.part09.js +10 -3
  61. package/dist/drift.part11.js +261 -58
  62. package/dist/drift.part12.d.ts +1 -1
  63. package/dist/drift.part12.js +193 -21
  64. package/dist/drift.part13.d.ts +20 -39
  65. package/dist/drift.part13.js +601 -647
  66. package/dist/drift.part14.js +23 -7
  67. package/dist/driftCacheCas.d.ts +43 -0
  68. package/dist/driftCacheCas.js +351 -0
  69. package/dist/driftCacheFilesystem.d.ts +64 -0
  70. package/dist/driftCacheFilesystem.js +313 -0
  71. package/dist/driftCacheModes.d.ts +38 -0
  72. package/dist/driftCacheModes.js +147 -0
  73. package/dist/driftCacheStore.d.ts +80 -0
  74. package/dist/driftCacheStore.js +603 -0
  75. package/dist/driftCatalogo.d.ts +2 -28
  76. package/dist/driftCatalogo.js +143 -284
  77. package/dist/driftEscopo.d.ts +1 -3
  78. package/dist/driftEscopo.js +235 -151
  79. package/dist/driftEscopoReferencias.d.ts +5 -1
  80. package/dist/driftEscopoReferencias.js +375 -28
  81. package/dist/driftOrcamento.d.ts +0 -6
  82. package/dist/driftOrcamento.js +2 -1
  83. package/dist/execucoesExternas.js +19 -5
  84. package/dist/exemplosOficiais.d.ts +2 -1
  85. package/dist/exemplosOficiais.js +9 -3
  86. package/dist/geracaoCore.d.ts +1 -0
  87. package/dist/geracaoCore.js +6 -6
  88. package/dist/iaPrompts.d.ts +3 -3
  89. package/dist/iaPrompts.js +312 -313
  90. package/dist/importador.part01.d.ts +1 -1
  91. package/dist/importador.part06.d.ts +2 -0
  92. package/dist/importador.part06.js +87 -1
  93. package/dist/importador.part09.js +7 -1
  94. package/dist/index.d.ts +4 -1
  95. package/dist/index.js +6 -25
  96. package/dist/index.part01.d.ts +20 -28
  97. package/dist/index.part01.js +16 -237
  98. package/dist/index.part02.js +36 -22
  99. package/dist/index.part03.d.ts +24 -2
  100. package/dist/index.part03.js +83 -19
  101. package/dist/index.part04.d.ts +10 -2
  102. package/dist/index.part04.js +152 -123
  103. package/dist/index.part05.js +80 -78
  104. package/dist/index.part06.js +34 -17
  105. package/dist/index.part07.d.ts +8 -2
  106. package/dist/index.part07.js +153 -7
  107. package/dist/index.part08.d.ts +1 -1
  108. package/dist/index.part08.js +25 -30
  109. package/dist/initCommand.d.ts +1 -0
  110. package/dist/initCommand.js +20 -4
  111. package/dist/initTemplatesBase.js +6 -4
  112. package/dist/pipelineConteudo/command.d.ts +1 -0
  113. package/dist/pipelineConteudo/command.js +9 -2
  114. package/dist/pipelineConteudo/help.d.ts +2 -0
  115. package/dist/pipelineConteudo/help.js +33 -0
  116. package/dist/profileAuthorCommand.js +3 -7
  117. package/dist/profileCommand.js +3 -7
  118. package/dist/projetoCarregar.js +35 -17
  119. package/dist/projetoCatalogo.d.ts +1 -0
  120. package/dist/projetoCatalogo.js +64 -25
  121. package/dist/projetoConfig.js +2 -0
  122. package/dist/projetoLegado.js +18 -0
  123. package/dist/projetoOrigens.d.ts +2 -0
  124. package/dist/projetoOrigens.js +65 -9
  125. package/dist/projetoTipos.d.ts +1 -0
  126. package/dist/resultadoCli.d.ts +20 -0
  127. package/dist/resultadoCli.js +57 -0
  128. package/dist/saidaCli.d.ts +35 -0
  129. package/dist/saidaCli.js +118 -0
  130. package/dist/sistemasInterativos/acceptanceEvidence.d.ts +22 -0
  131. package/dist/sistemasInterativos/acceptanceEvidence.js +345 -0
  132. package/dist/sistemasInterativos/engineObservation.d.ts +12 -0
  133. package/dist/sistemasInterativos/engineObservation.js +438 -0
  134. package/dist/sistemasInterativos/jobOrchestration.d.ts +2 -0
  135. package/dist/sistemasInterativos/jobOrchestration.js +204 -0
  136. package/dist/sistemasInterativos/operationPrimitives.d.ts +21 -0
  137. package/dist/sistemasInterativos/operationPrimitives.js +194 -0
  138. package/dist/sistemasInterativos/operations.d.ts +4 -39
  139. package/dist/sistemasInterativos/operations.js +5 -1164
  140. package/dist/skillCommand.d.ts +5 -0
  141. package/dist/skillCommand.js +88 -0
  142. package/dist/tipos.d.ts +1 -1
  143. package/dist/typescript-http-modelos.d.ts +1 -1
  144. package/dist/typescript-http-rotas.d.ts +1 -0
  145. package/dist/typescript-http-rotas.js +93 -0
  146. package/dist/typescript-http.d.ts +1 -1
  147. package/dist/typescript-http.js +1 -1
  148. package/dist/verificacaoCache.d.ts +25 -0
  149. package/dist/verificacaoCache.js +80 -0
  150. package/docs/README.md +34 -30
  151. package/docs/ai-integration.md +25 -12
  152. package/docs/ai-onboarding.md +37 -18
  153. package/docs/ai-workflow.md +9 -7
  154. package/docs/cli.md +125 -7
  155. package/docs/commands.md +41 -20
  156. package/docs/deploy.md +21 -8
  157. package/docs/descoberta-capacidades.md +106 -106
  158. package/docs/documentation.md +49 -39
  159. package/docs/drift-cache.md +108 -0
  160. package/docs/getting-started.md +43 -18
  161. package/docs/pipeline-conteudo.md +246 -246
  162. package/docs/profiles.md +54 -54
  163. package/docs/repositories.md +19 -2
  164. package/docs/rollback.md +15 -8
  165. package/docs/security.md +25 -3
  166. package/docs/sistemas-interativos.md +379 -374
  167. package/docs/syntax.md +14 -0
  168. package/docs/testing.md +139 -40
  169. package/exemplos/express_crud.sema +139 -0
  170. package/exemplos/fastify_crud.sema +146 -0
  171. package/exemplos/pipeline-conteudo/README.md +44 -44
  172. package/exemplos/pipeline-conteudo/alvos.json +23 -23
  173. package/exemplos/pipeline-conteudo/definicao.json +136 -136
  174. package/exemplos/profile_simulation.sema +211 -211
  175. package/exemplos/sistemas-interativos/README.md +100 -100
  176. package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -5
  177. package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -16
  178. package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -32
  179. package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -93
  180. package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -78
  181. package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -27
  182. package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -79
  183. package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -42
  184. package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -32
  185. package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -23
  186. package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -39
  187. package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -46
  188. package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -39
  189. package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -37
  190. package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -104
  191. package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -27
  192. package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -118
  193. package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -459
  194. package/exemplos/sistemas-interativos/game-2d.json +83 -83
  195. package/exemplos/sistemas-interativos/game-3d-human.json +81 -81
  196. package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -97
  197. package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -94
  198. package/exemplos/sistemas-interativos/game-xr-human.json +80 -80
  199. package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -108
  200. package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -75
  201. package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -58
  202. package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -97
  203. package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -141
  204. package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -112
  205. package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -103
  206. package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -95
  207. package/node_modules/@sema/gerador-cpp/package.json +1 -1
  208. package/node_modules/@sema/gerador-dotnet/package.json +1 -1
  209. package/node_modules/@sema/gerador-lua/dist/index.js +51 -51
  210. package/node_modules/@sema/gerador-php/dist/index.js +113 -113
  211. package/node_modules/@sema/nucleo/dist/ir/conversor.part01.js +37 -38
  212. package/node_modules/@sema/nucleo/dist/ir/modelos.d.ts +1 -0
  213. package/node_modules/@sema/nucleo/dist/semantico/analisador.d.ts +1 -0
  214. package/node_modules/@sema/nucleo/dist/semantico/analisador.js +1 -0
  215. package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.d.ts +7 -0
  216. package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.js +33 -10
  217. package/package.json +9 -4
  218. package/scripts/postinstall.mjs +148 -0
  219. package/skills/sema/SKILL.md +199 -0
  220. package/skills/sema/agents/openai.yaml +4 -0
  221. package/dist/driftCache.d.ts +0 -49
  222. package/dist/driftCache.js +0 -311
  223. package/dist/driftCacheIncremental.d.ts +0 -98
  224. package/dist/driftCacheIncremental.js +0 -596
  225. package/dist/driftCatalogoPersistente.d.ts +0 -8
  226. package/dist/driftCatalogoPersistente.js +0 -77
  227. package/node_modules/@sema/gerador-cpp/dist/index.js.map +0 -1
  228. package/node_modules/@sema/gerador-css/dist/index.js.map +0 -1
  229. package/node_modules/@sema/gerador-css/dist/index.part01.js.map +0 -1
  230. package/node_modules/@sema/gerador-css/dist/index.part02.js.map +0 -1
  231. package/node_modules/@sema/gerador-dart/dist/index.js.map +0 -1
  232. package/node_modules/@sema/gerador-dotnet/dist/index.js.map +0 -1
  233. package/node_modules/@sema/gerador-html/dist/index.js.map +0 -1
  234. package/node_modules/@sema/gerador-javascript/dist/index.js.map +0 -1
  235. package/node_modules/@sema/gerador-lua/dist/index.js.map +0 -1
  236. package/node_modules/@sema/gerador-php/dist/index.js.map +0 -1
  237. package/node_modules/@sema/gerador-python/dist/index.js.map +0 -1
  238. package/node_modules/@sema/gerador-python/dist/index.part01.js.map +0 -1
  239. package/node_modules/@sema/gerador-python/dist/index.part02.js.map +0 -1
  240. package/node_modules/@sema/gerador-typescript/dist/index.js.map +0 -1
  241. package/node_modules/@sema/gerador-typescript/dist/index.part01.js.map +0 -1
  242. package/node_modules/@sema/gerador-typescript/dist/index.part02.js.map +0 -1
  243. package/node_modules/@sema/gerador-typescript/dist/index.part03.js.map +0 -1
  244. package/node_modules/@sema/nucleo/dist/ast/tipos.js.map +0 -1
  245. package/node_modules/@sema/nucleo/dist/diagnosticos/index.js.map +0 -1
  246. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js.map +0 -1
  247. package/node_modules/@sema/nucleo/dist/diagnosticos/snippets.js.map +0 -1
  248. package/node_modules/@sema/nucleo/dist/formatador/index.js.map +0 -1
  249. package/node_modules/@sema/nucleo/dist/formatador/index.part01.js.map +0 -1
  250. package/node_modules/@sema/nucleo/dist/formatador/index.part02.js.map +0 -1
  251. package/node_modules/@sema/nucleo/dist/index.js.map +0 -1
  252. package/node_modules/@sema/nucleo/dist/ir/conversor.js.map +0 -1
  253. package/node_modules/@sema/nucleo/dist/ir/conversor.part01.js.map +0 -1
  254. package/node_modules/@sema/nucleo/dist/ir/conversor.part02.js.map +0 -1
  255. package/node_modules/@sema/nucleo/dist/ir/conversor.part03.js.map +0 -1
  256. package/node_modules/@sema/nucleo/dist/ir/modelos.js.map +0 -1
  257. package/node_modules/@sema/nucleo/dist/lexer/lexer.js.map +0 -1
  258. package/node_modules/@sema/nucleo/dist/lexer/tokens.js.map +0 -1
  259. package/node_modules/@sema/nucleo/dist/parser/parser.declaracoes.js.map +0 -1
  260. package/node_modules/@sema/nucleo/dist/parser/parser.js.map +0 -1
  261. package/node_modules/@sema/nucleo/dist/parser/parser.modulo.js.map +0 -1
  262. package/node_modules/@sema/nucleo/dist/parser/parser.part01.js.map +0 -1
  263. package/node_modules/@sema/nucleo/dist/parser/parser.part02.js.map +0 -1
  264. package/node_modules/@sema/nucleo/dist/parser/parser.part03.js.map +0 -1
  265. package/node_modules/@sema/nucleo/dist/persistencia/contratos.js.map +0 -1
  266. package/node_modules/@sema/nucleo/dist/semantico/analisador.js.map +0 -1
  267. package/node_modules/@sema/nucleo/dist/semantico/analisador.part01.js.map +0 -1
  268. package/node_modules/@sema/nucleo/dist/semantico/analisador.part02.js.map +0 -1
  269. package/node_modules/@sema/nucleo/dist/semantico/analisador.part03.js.map +0 -1
  270. package/node_modules/@sema/nucleo/dist/semantico/analisador.part04.js.map +0 -1
  271. package/node_modules/@sema/nucleo/dist/semantico/analisador.part05.js.map +0 -1
  272. package/node_modules/@sema/nucleo/dist/semantico/analisador.part06.js.map +0 -1
  273. package/node_modules/@sema/nucleo/dist/semantico/analisador.part07.js.map +0 -1
  274. package/node_modules/@sema/nucleo/dist/semantico/analisador.part08.js.map +0 -1
  275. package/node_modules/@sema/nucleo/dist/semantico/estruturas.js.map +0 -1
  276. package/node_modules/@sema/nucleo/dist/semantico/estruturas.part01.js.map +0 -1
  277. package/node_modules/@sema/nucleo/dist/semantico/estruturas.part02.js.map +0 -1
  278. package/node_modules/@sema/nucleo/dist/semantico/orcamentoSemantico.js.map +0 -1
  279. package/node_modules/@sema/nucleo/dist/semantico/seguranca.js.map +0 -1
  280. package/node_modules/@sema/nucleo/dist/util/arquivos.js.map +0 -1
  281. package/node_modules/@sema/padroes/dist/index.js.map +0 -1
@@ -1,39 +1,49 @@
1
- # Documentation Governance
2
-
3
- Documentation is part of every governed change. Codex must use
4
- `sema docs-impacto` before editing contracts, code, operational docs, workflows,
5
- profiles, generated artifacts, or release material.
6
-
7
- Public Sema documentation is English and local-only.
8
-
9
- ## Required Flow
10
-
11
- ```bash
12
- sema docs-impacto --intencao "describe the change" --json
13
- ```
14
-
15
- The result lists:
16
-
17
- - `leituraObrigatoria`: files that must be read before the change;
18
- - `docsAusentes`: missing docs that block the change;
19
- - `docsCriadas`: generated draft docs that must be completed by Codex;
20
- - `bloqueios`: blocking diagnostics.
21
-
22
- Before closing the change, prove the required docs were read:
23
-
24
- ```bash
25
- sema finalizar-mudanca \
26
- --intencao "describe the change" \
27
- --doc-lida README.md \
28
- --doc-lida docs/documentation.md \
29
- --json
30
- ```
31
-
32
- ## Public Docs Rules
33
-
34
- - Write public docs in English.
35
- - Keep commands, file paths, package names, environment variable names, and DSL
36
- keywords literal.
37
- - Do not include private or sensitive operational material.
38
- - Prefer local CLI examples.
39
- - Point support requests to suporte@otimitare.online.
1
+ # Documentation Governance
2
+
3
+ Documentation is part of every governed change. Codex must use
4
+ `sema docs-impacto` before editing contracts, code, operational docs, workflows,
5
+ profiles, generated artifacts, or release material.
6
+
7
+ Public Sema documentation is English and local-only.
8
+
9
+ ## Required Flow
10
+
11
+ ```bash
12
+ sema docs-impacto --intencao "describe the change" --json
13
+ ```
14
+
15
+ The result lists:
16
+
17
+ - `leituraObrigatoria`: files that must be read before the change;
18
+ - `docsAusentes`: missing docs that block the change;
19
+ - `docsCriadas`: generated draft docs that must be completed by Codex;
20
+ - `bloqueios`: blocking diagnostics.
21
+
22
+ Before closing the change, prove the required docs were read:
23
+
24
+ ```bash
25
+ sema finalizar-mudanca \
26
+ --intencao "describe the change" \
27
+ --doc-lida README.md \
28
+ --doc-lida docs/documentation.md \
29
+ --json
30
+ ```
31
+
32
+ ## Public Docs Rules
33
+
34
+ - Write public docs in English.
35
+ - Keep commands, file paths, package names, environment variable names, and DSL
36
+ keywords literal.
37
+ - Do not include private or sensitive operational material.
38
+ - Prefer local CLI examples.
39
+ - Point support requests to suporte@otimitare.online.
40
+
41
+ ## Contract Structure
42
+
43
+ Documentation governance is split by capability: required-document resolution
44
+ stays in `governanca_ia_documentacao.sema`, while localization and
45
+ change-finalization evidence live in explicitly named child contracts. The
46
+ same rule applies to drift and semantic-budget governance: keep a cohesive
47
+ primary capability in the root contract and move secondary responsibilities to
48
+ named children. Preserve task names, guarantees, implementations, and
49
+ `vinculos`; never create numbered part files.
@@ -0,0 +1,108 @@
1
+ # Drift Cache And Query Evidence
2
+
3
+ Sema exposes three drift modes, but the `none` mode intentionally means
4
+ different things for direct drift execution and for query commands. The
5
+ defaults preserve honest, low-cost queries while keeping an explicit drift run
6
+ fresh by default.
7
+
8
+ | Mode | `sema drift --cache <mode>` | `sema resumo --drift <mode>` / `sema inspecionar --drift <mode>` |
9
+ | --- | --- | --- |
10
+ | `none` | Runs drift without reading or writing persistent cache. | Skips drift analysis. This is the query default. |
11
+ | `cache` | Reuses a valid cache entry; otherwise recalculates and publishes a new entry. | Runs drift with the same reuse-or-recalculate behavior. |
12
+ | `fresh` | Does not reuse a prior hit, recalculates, and publishes a fresh entry. This is the direct drift default. | Runs drift from fresh inputs without reusing prior extraction data, then publishes the resulting entry. |
13
+
14
+ Use `--cache none` when a direct analysis must leave no persistent cache access.
15
+ Use `--drift none` when a summary or inspection should not perform drift at all.
16
+ The two forms are not interchangeable.
17
+
18
+ ## Honest Query Evidence
19
+
20
+ `sema resumo` and `sema inspecionar` default to `--drift none`. Their JSON
21
+ payload includes an `analiseDrift` envelope that makes the omitted evaluation
22
+ explicit:
23
+
24
+ ```json
25
+ {
26
+ "analiseDrift": {
27
+ "modo": "none",
28
+ "executada": false,
29
+ "sucesso": null,
30
+ "cache": null
31
+ },
32
+ "scoreDrift": null,
33
+ "confiancaGeral": null
34
+ }
35
+ ```
36
+
37
+ The surrounding payload varies by command. A human-readable `aviso` or
38
+ `avisos` entry explains why drift was not evaluated. Drift-derived framework,
39
+ route, surface, bridge, and module implementation evidence is also `null` when
40
+ applicable. In this context, `null` means **not evaluated**; it must never be
41
+ interpreted as zero, empty, passing, or absent drift.
42
+
43
+ Request `--drift cache` or `--drift fresh` when a query needs evaluated drift
44
+ evidence. In that case, `payload.analiseDrift.sucesso` is `true` or `false`, and a
45
+ failed requested analysis makes the command exit nonzero instead of hiding the
46
+ failure behind a successful query response.
47
+
48
+ ## External Cache Location
49
+
50
+ Persistent drift cache is stored outside the governed workspace:
51
+
52
+ | Platform | Cache root |
53
+ | --- | --- |
54
+ | Windows | `%LOCALAPPDATA%\Sema\Cache`, falling back to `%USERPROFILE%\AppData\Local\Sema\Cache` |
55
+ | macOS | `~/Library/Caches/Sema` |
56
+ | Linux and other Unix systems | `$XDG_CACHE_HOME/sema`, falling back to `~/.cache/sema` |
57
+
58
+ Drift entries live below `drift/v3/workspaces/<opaque-id>/objects/` inside that
59
+ root. Public output represents such paths as `$SEMA_CACHE/drift/v3/...`.
60
+ `$SEMA_CACHE` is a safe display placeholder, not a promise that an environment
61
+ variable with that name exists, and Sema does not expose the real user cache
62
+ path.
63
+
64
+ Sema never writes persistent drift cache inside the repository, `.sema`,
65
+ `.tmp`, generated project folders, or any other workspace location.
66
+
67
+ ## Authority And Recovery
68
+
69
+ The cache is an acceleration layer, not governance evidence and not a source of
70
+ truth. Contracts, source files, the active analysis plan, and the validated
71
+ result remain authoritative.
72
+
73
+ - A corrupt or incompatible entry is treated as a recoverable miss: Sema
74
+ recalculates instead of trusting it.
75
+ - If external cache storage is unavailable, analysis continues by
76
+ recalculating; cache persistence does not become a governance blocker.
77
+ - `cache` may reuse only a valid entry for the current workspace and inputs.
78
+ - `fresh` never reuses cached extraction data before analysis. Publication may
79
+ read and validate an existing content-addressed winner to preserve CAS
80
+ integrity without changing the freshly calculated result.
81
+ - Direct `none` performs no persistent cache reads or writes.
82
+
83
+ These rules keep cache failures from hiding drift and keep the governed
84
+ workspace free of machine-local state.
85
+
86
+ ## Semantic Integrity And Trust Limit
87
+
88
+ The reusable payload stores canonical per-extractor indices. It does not store
89
+ `todosSimbolos`, route aggregates, resource aggregates, or known-file
90
+ aggregates as independent sources. Sema derives those values again after a
91
+ cache entry is restored, so a redundant aggregate cannot silently override its
92
+ source indices.
93
+
94
+ Before accepting a hit, Sema checks exact field allowlists, relative catalog
95
+ paths, extractor-specific file extensions and symbol origins, consumer-surface
96
+ to route relationships, and derived integrity digests across symbols, routes,
97
+ resources, surfaces, and persistence details. Detectable structural or
98
+ semantic inconsistency becomes a corrupt miss, followed by a fresh in-memory
99
+ calculation and repair. A valid hit is therefore limited to a compatible
100
+ payload produced for the same CLI, schema, extractor, workspace identity, Git
101
+ HEAD, plan, configuration, contracts, and content-digested members.
102
+
103
+ These SHA-256 digests detect corruption and incoherent rewriting; they do not
104
+ authenticate a hostile process running as the same operating-system user. Such
105
+ a process can read the implementation and rewrite both data and checksums. The
106
+ external cache is not a security boundary, a signature, or final evidence.
107
+ Use `--cache fresh` for closure and retain stronger evidence outside the local
108
+ user cache when the threat model includes local-user compromise.
@@ -4,53 +4,78 @@ Sema is installed and used as a local CLI.
4
4
 
5
5
  ```bash
6
6
  npm install -g @semacode/cli
7
- codex plugin marketplace add gerlanss/Sema
8
- codex plugin add sema@sema
7
+ sema skill status --json
9
8
  ```
10
9
 
11
- Open a new Codex task in the target repository so the newly installed `$sema`
12
- skill is loaded, then ask it to initialize Sema. Existing tasks do not refresh
13
- their skill catalog. After bootstrap, `AGENTS.md` becomes the automatic protocol
14
- for subsequent tasks.
10
+ The global package creates an absolute launcher under `~/.sema/bin`, installs
11
+ the bundled skill in `~/.agents/skills/sema`, and mirrors it to
12
+ `~/.claude/skills/sema` only when Claude is already present. Open a new task so
13
+ the updated skill catalog is loaded. Installing or updating the global CLI does
14
+ not authorize Sema adoption in the current workspace: informational requests
15
+ stay read-only, and implementation requires explicit adoption authorization.
16
+ After an authorized bootstrap, `AGENTS.md` becomes the automatic protocol for
17
+ subsequent tasks.
15
18
 
16
19
  Then verify the local engine:
17
20
 
18
21
  ```bash
19
22
  sema --version
20
- sema resumo
23
+ sema resumo --drift none
21
24
  ```
22
25
 
23
26
  The CLI is ready when `sema --version` succeeds. No Sema login, user
24
27
  authorization, activation key, product-license check, token, credits, billing
25
28
  service, or control panel is involved.
26
29
 
27
- The Codex skill is required for first contact with a project that does not yet
28
- have Sema. It only bootstraps the local CLI and generates the repository's
29
- `AGENTS.md`; that file becomes the automatic workspace protocol afterward.
30
- Plugin installation is explicit and does not happen from npm lifecycle scripts.
30
+ The skill handles first contact with a project that does not yet have Sema. It
31
+ only bootstraps the local CLI and generates the repository's `AGENTS.md`; that
32
+ file becomes the automatic workspace protocol afterward. The npm lifecycle does
33
+ not install plugins or touch plugin caches.
34
+
35
+ If the install used `--ignore-scripts`, run `sema skill sync --json`. If the
36
+ shell cannot resolve the npm shim, use `~/.sema/bin/sema` on macOS or Linux. On
37
+ Windows, PowerShell resolves `sema.ps1` from `PATH`, `cmd.exe` resolves
38
+ `sema.cmd`, and the robust PowerShell fallback is:
39
+
40
+ ```powershell
41
+ & "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$HOME\.sema\bin\sema-managed.ps1" --version
42
+ ```
43
+
44
+ The managed fallback contains absolute Node.js and CLI paths and does not
45
+ depend on `PATH`.
31
46
 
32
47
  ## First Project
33
48
 
34
49
  ```bash
50
+ sema descobrir explicar flow.project-adoption --json
35
51
  sema iniciar --template base
52
+ sema sync-codex --json
36
53
  sema validar contratos/*.sema --json
37
- sema resumo
54
+ sema resumo --drift none
38
55
  ```
39
56
 
40
- `sema iniciar` preserves existing project files and refuses symlink or junction
41
- escapes. The bootstrap skill never uses `--force`; explicit overwrite remains a
42
- human decision.
57
+ Run this sequence only after explicit project-adoption authorization. The
58
+ `sema iniciar` command preserves existing project files and refuses symlink or
59
+ junction escapes. The bootstrap skill never uses `--force`; explicit overwrite
60
+ remains a human decision.
43
61
 
44
62
  ## Existing Project
45
63
 
46
64
  ```bash
47
- sema resumo
65
+ sema resumo --drift none
48
66
  sema docs-impacto --intencao "describe the change" --json
49
- sema inspecionar contratos/example.sema --json
50
- sema drift contratos/example.sema --escopo modulo --json
67
+ sema inspecionar contratos/example.sema --drift none --json
68
+ sema drift contratos/example.sema --escopo modulo --cache fresh --json
51
69
  sema impacto contratos/example.sema --alvo sema.example.target --mudanca "describe the change" --json
52
70
  ```
53
71
 
72
+ `sema resumo` and `sema inspecionar` default to `--drift none`: they skip drift
73
+ analysis and report drift-derived evidence as `null`, meaning not evaluated.
74
+ Direct `sema drift` defaults to `--cache fresh`; its `--cache none` mode still
75
+ runs the analysis, but without reading or writing persistent cache. See
76
+ [Drift Cache And Query Evidence](./drift-cache.md) for the complete mode table,
77
+ external cache locations, and recovery behavior.
78
+
54
79
  The public CLI does not require private service credentials or an external
55
80
  request before local commands run.
56
81