@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
package/docs/cli.md CHANGED
@@ -13,16 +13,122 @@ Support: suporte@otimitare.online
13
13
  ```bash
14
14
  npm install -g @semacode/cli
15
15
  sema --version
16
+ sema skill status --json
16
17
  ```
17
18
 
19
+ The global install bundles the portable Sema skill and creates a launcher under
20
+ `~/.sema/bin` with absolute Node.js and CLI paths. If the npm shim is absent
21
+ from `PATH`, run `~/.sema/bin/sema` on macOS/Linux. On Windows, PowerShell
22
+ resolves `sema.ps1` from `PATH`, while `cmd.exe` resolves `sema.cmd`; invoke the
23
+ managed fallback through the absolute system executable:
24
+
25
+ ```powershell
26
+ & "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$HOME\.sema\bin\sema-managed.ps1" --version
27
+ ```
28
+
29
+ Use `sema skill sync --json` to repair an installation performed with lifecycle
30
+ scripts disabled.
31
+
18
32
  For development inside this repository:
19
33
 
20
34
  ```bash
21
35
  npm install
22
36
  npm run build
23
- node pacotes/cli/dist/index.js --help
37
+ node pacotes/cli/dist/bin.js --help
24
38
  ```
25
39
 
40
+ ## Side-Effect-Free Help
41
+
42
+ `--help` and `-h` take precedence wherever they appear in argv, including after
43
+ an unknown command or option. The CLI exits with status `0` before command
44
+ runtime import, command dispatch, or handler resolution. Help does not inspect or mutate the workspace,
45
+ home, user cache, or plugin cache, start a subprocess, or make a network call.
46
+
47
+ `dist/bin.js` is the executable bootstrap and imports the operational runtime
48
+ only after these control paths finish. `dist/index.js` remains the package API
49
+ entrypoint and is not an executable alias.
50
+
51
+ ```bash
52
+ sema iniciar --help
53
+ sema formatar --help
54
+ sema sync-codex --help
55
+ sema skill sync --help
56
+ sema unknown --option value --help
57
+ ```
58
+
59
+ ## Public JSON Output
60
+
61
+ `sema --version` (and its version aliases) prints one plain exact SemVer string.
62
+ It is intentionally not wrapped in JSON.
63
+
64
+ ### Help and command control
65
+
66
+ Adding `--json` to help or a command-control failure emits exactly one JSON
67
+ document on stdout and keeps stderr empty:
68
+
69
+ ```json
70
+ {
71
+ "schemaVersion": "sema.cli.control/v1",
72
+ "ok": true,
73
+ "kind": "HELP",
74
+ "code": "CLI_HELP",
75
+ "message": "Sema CLI help",
76
+ "exitCode": 0
77
+ }
78
+ ```
79
+
80
+ The envelope contains exactly `schemaVersion`, `ok`, `kind`, `code`, `message`,
81
+ and `exitCode`. Supported control kinds are `HELP`, `UNKNOWN_COMMAND`,
82
+ `ARGUMENT_ERROR`, and `FATAL_ERROR`. Help uses exit code `0`; failures preserve
83
+ a non-zero process status equal to `exitCode`. Failure messages are public and
84
+ redacted: they do not include stacks, absolute paths, raw argv, or internal
85
+ causes.
86
+
87
+ Command-control failures are unknown top-level commands or subcommands, missing
88
+ or invalid required CLI arguments/options rejected before valid dispatch, and
89
+ uncaught runtime exceptions. An uncaught exception uses the redacted
90
+ `FATAL_ERROR` control envelope. `sema.cli.control/v1` is never nested inside a
91
+ command result.
92
+
93
+ ### Valid command results
94
+
95
+ In 3.0.0, every syntactically valid command invoked with `--json` emits exactly
96
+ one `sema.cli.result/v1` document on stdout with empty stderr:
97
+
98
+ ```json
99
+ {
100
+ "schemaVersion": "sema.cli.result/v1",
101
+ "ok": true,
102
+ "kind": "SUCCESS",
103
+ "command": "resumo",
104
+ "code": "CLI_SUCCESS",
105
+ "message": null,
106
+ "exitCode": 0,
107
+ "payload": {
108
+ "comando": "resumo",
109
+ "sucesso": true
110
+ }
111
+ }
112
+ ```
113
+
114
+ The result envelope contains exactly `schemaVersion`, `ok`, `kind`, `command`,
115
+ `code`, `message`, `exitCode`, and `payload`; extra or missing fields are
116
+ invalid, and `data` is not an alias for `payload`. `command` is the canonical
117
+ top-level command name. `payload` is always present and may be any JSON value,
118
+ including an object, array, scalar, or `null`.
119
+
120
+ - `SUCCESS` requires `ok: true`, `code: "CLI_SUCCESS"`, `message: null`, and
121
+ `exitCode: 0`.
122
+ - `DOMAIN_ERROR` requires `ok: false`, `code: "CLI_DOMAIN_ERROR"`, a non-empty
123
+ safe public `message`, and a positive `exitCode` equal to the process status.
124
+
125
+ The envelope describes the CLI result transport and classification. It does
126
+ not replace the command's domain model: consumers must unwrap `payload` and
127
+ evaluate fields such as `payload.sucesso`, `payload.aprovado`,
128
+ `payload.bloqueado`, or another command-specific verdict separately. A
129
+ syntactically valid operation that returns a structured domain failure uses
130
+ `DOMAIN_ERROR`; it does not fall back to `sema.cli.control/v1`.
131
+
26
132
  ## Codex Setup
27
133
 
28
134
  `AGENTS.md` is the official Sema entrypoint for Codex. Create or refresh it from
@@ -42,22 +148,24 @@ code, contracts, workflows, release scripts, or operational docs:
42
148
 
43
149
  ```bash
44
150
  sema --version
45
- sema resumo
151
+ sema resumo --drift none
46
152
  sema docs-impacto --intencao "describe the change" --json
47
- sema inspecionar contratos/example.sema --json
48
- sema drift contratos/example.sema --escopo modulo --json
153
+ sema inspecionar contratos/example.sema --drift none --json
154
+ sema drift contratos/example.sema --escopo modulo --cache fresh --json
49
155
  sema impacto contratos/example.sema --alvo sema.example.target --mudanca "describe the change" --json
50
156
  ```
51
157
 
52
158
  Commands run directly against the local workspace. If `sema --version` fails,
53
- install or repair the npm package; there is no separate authorization gate.
159
+ try the managed absolute launcher before declaring the CLI unavailable. If both
160
+ fail, install or repair the npm package; there is no separate authorization
161
+ gate.
54
162
 
55
163
  ## Core Commands
56
164
 
57
165
  - `sema iniciar`: create a governed starting point.
58
166
  - `sema validar`: validate `.sema` contracts.
59
- - `sema inspecionar`: inspect the applicable contract surface.
60
- - `sema drift`: compare contracts and implementation.
167
+ - `sema inspecionar`: inspect the applicable contract surface; add `--drift cache|fresh` to request code evidence.
168
+ - `sema drift`: compare contracts and implementation with `--cache none|cache|fresh` (default `fresh`).
61
169
  - `sema impacto`: map the blast radius of a planned change.
62
170
  - `sema docs-impacto`: identify docs that must be read or updated.
63
171
  - `sema finalizar-mudanca`: close the governed change with evidence.
@@ -66,6 +174,16 @@ install or repair the npm package; there is no separate authorization gate.
66
174
  - `sema verificar`: run the final local verification bundle.
67
175
  - `sema contexto-ia`: build local AI context from a contract.
68
176
  - `sema sync-codex`: create or refresh the official `AGENTS.md` entrypoint.
177
+ - `sema skill status|sync`: inspect or repair the managed launcher and bundled
178
+ global skill without touching plugin caches or workspace files.
179
+
180
+ `resumo` and `inspecionar` default to `--drift none`, so they do not fabricate
181
+ scores or implementation evidence. In this mode those fields inside `payload`
182
+ are `null` or explicitly not evaluated. `sema drift --cache none` still runs
183
+ the analysis but does not touch persistent cache. `cache` reuses only a validated extraction hit;
184
+ `fresh` ignores hits and republishes recalculated extraction data. Cache objects
185
+ live in the operating system's user-cache directory outside the workspace, and
186
+ the final links, diagnostics, score, and success decision are always recomputed.
69
187
 
70
188
  Generation targets are `typescript`, `python`, `php`, `dart`, `lua`,
71
189
  `javascript`, `html`, `css`, `dotnet`, and `cpp`. The aliases `cs` and
package/docs/commands.md CHANGED
@@ -7,19 +7,30 @@ Use this file when Codex does not know which command to run. A Sema command is a
7
7
 
8
8
  ```bash
9
9
  sema --version
10
- sema resumo
10
+ sema resumo --drift none
11
11
  sema docs-impacto --intencao "<acao>" --json
12
12
  ```
13
13
 
14
+ If `sema` is absent from `PATH`, use `$HOME/.sema/bin/sema` on macOS/Linux. On Windows, PowerShell resolves `sema.ps1` from PATH, cmd.exe resolves `sema.cmd`, and the absolute fallback is `& "$env:SystemRoot\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$HOME\.sema\bin\sema-managed.ps1" --version`. `sema skill sync --json` repairs launcher and skill without touching the workspace or plugin caches.
15
+
14
16
  Then read every required doc returned by `docs-impacto`.
15
17
 
18
+ ## Public JSON output
19
+
20
+ `sema --version` stays plain exact SemVer text. With `--json`, help and command-control failures use exactly one six-field `sema.cli.control/v1` document on stdout with empty stderr. Every syntactically valid command uses exactly one eight-field `sema.cli.result/v1` document containing only `schemaVersion`, `ok`, `kind`, `command`, `code`, `message`, `exitCode`, and `payload`. The command-specific result is nested under `payload`, never `data`; envelope `ok` does not replace domain fields inside that payload. Valid structured domain failures use `DOMAIN_ERROR`, while uncaught runtime exceptions remain redacted `FATAL_ERROR` control failures.
21
+
22
+ ## Global Distribution
23
+
24
+ - `sema skill status --json`: diagnoses the managed launcher and bundled skill without writing.
25
+ - `sema skill sync --json`: repairs only Sema-managed launcher and skill destinations; it never writes into the workspace or plugin caches.
26
+
16
27
  ## Contract and Discovery
17
28
 
18
29
  - `sema iniciar --template <template> [--force]`: creates a new Sema project and preserves existing files by default; `--force` is the only explicit overwrite path.
19
30
  - `sema validar <arquivo-ou-pasta> --json`: validates `.sema` contracts.
20
31
  - `sema diagnosticos <arquivo.sema> --json`: details errors and warnings.
21
32
  - `sema formatar <arquivo-ou-pasta>`: formats contracts.
22
- - `sema inspecionar <arquivo-ou-pasta> --json`: shows modules, tasks, routes, entities, links, and expected files.
33
+ - `sema inspecionar <arquivo-ou-pasta> [--drift <none|cache|fresh>] --json`: shows the contract surface; drift is skipped by default.
23
34
  - `sema ast <arquivo.sema> --json`: shows AST for syntax debugging.
24
35
  - `sema ir <arquivo.sema> --json`: shows the IR used by gates and generators.
25
36
  - `sema descobrir catalogo --json`: lists governance flows, profiles, specialized workflows, pipelines, generators, capability tokens, and adapters from their canonical registries.
@@ -30,16 +41,24 @@ Then read every required doc returned by `docs-impacto`.
30
41
  ## Change and Closure
31
42
 
32
43
  - `sema docs-impacto --intencao "<acao>" --json`: discovers required docs and documentary blockers.
33
- - `sema inspecionar <arquivo-ou-pasta> [--drift none|cache|fresh] [--com-drift] --json`: inspects contracts; the default is contract-only `none` and leaves code scores absent.
34
- - `sema resumo <arquivo-ou-pasta> --micro [--drift none|cache|fresh] --json`: produces a small contract summary; the default is contract-only `none` and explicitly says implementation was not verified.
35
- - `sema drift <arquivo-ou-pasta> --escopo modulo [--cache auto|refresh|off] --json`: compares contract and implementation after planning the physical scope.
44
+ - `sema drift <arquivo-ou-pasta> --escopo modulo [--cache <none|cache|fresh>] --json`: plans a safe physical scope, then compares contract and implementation without a global fallback.
36
45
  - `sema impacto <arquivo-ou-pasta> --alvo <token> --mudanca "<descricao>" --json`: maps impact before changing behavior.
37
46
  - `sema verificar <arquivo-ou-pasta> --json`: runs aggregated final verification.
38
47
  - `sema finalizar-mudanca --intencao "<acao>" --doc-lida <arquivo> --json`: proves documentation reading before closure.
39
48
 
40
- Honest closure: treat drift JSON as the source of truth. `sucesso:false`, `vinculos_quebrados`, `rotas_divergentes`, or broken impls mean the change is not complete yet. Do not report "clean drift" without green JSON.
49
+ Honest closure: unwrap drift JSON and treat its command payload as the source of truth. `payload.sucesso:false`, non-empty `payload.vinculos_quebrados`, non-empty `payload.rotas_divergentes`, or non-empty `payload.impls_quebrados` mean the change is not complete yet. Do not report "clean drift" without a green payload.
41
50
 
42
- Focused drift does not fall back to a global scan when it cannot prove a safe file anchor. With `--cache auto`, unchanged catalog snapshots, file metadata/content, dependency extraction, and semantic groups are reused only after schema, digest, identity, runtime-shape, and filesystem validation. The JSON fields `escopo_aplicado.catalogo`, `escopo_aplicado.cache.incremental`, and `escopo_aplicado.cache.fasesMs` expose visits, reads, hits, misses, extractions, writes, and phase timing.
51
+ Focused drift exposes its planned, declared, inferred, and missing files plus catalog visit/read metrics in `escopo_aplicado`. File and module scopes fail closed without a safe anchor, with homonymous implementation candidates, or with missing local dependencies; only `--escopo projeto` may walk every configured code root. Logical roots such as `src` are probed deterministically without a discovery walk. Configured contract origins and code roots are confined before enumeration, and `inspecionar`, `impacto`, and `renomear-semantico` reuse the same directed boundary without reopening arbitrary external paths.
52
+
53
+ Drift analysis and cache modes are explicit:
54
+
55
+ - `sema drift` defaults to `--cache fresh`. `none` still executes drift but performs zero persistent-cache I/O; `cache` reuses a fully validated extraction hit and publishes misses; `fresh` ignores hits, recalculates, and publishes the new extraction.
56
+ - `sema resumo` and `sema inspecionar` default to `--drift none`. In that mode their payload does not execute drift and returns `null` for score, confidence, implementation, routes, or other code evidence that was not observed. Use `--drift cache` or `--drift fresh` when that evidence is required. `--com-drift` remains a temporary alias for `--drift fresh`.
57
+ - When a query explicitly runs drift, `payload.analiseDrift.sucesso` exposes the result and a failed requested analysis returns a nonzero exit code.
58
+ - The value aliases `off`, `auto`, and `refresh` normalize to `none`, `cache`, and `fresh` for one compatibility release and emit a structured deprecation warning. Wrong flags, repeated flags, conflicts, and invalid values fail instead of falling back silently.
59
+ - Persistent cache objects live outside the workspace under the operating system's user-cache directory. Workspace identity is hashed; public JSON and events expose only an opaque key and `$SEMA_CACHE/...` paths. Corruption or cache unavailability becomes a miss and never changes the drift result. Only validated extraction data is reused; links, diagnostics, scores, and the final success decision are recalculated.
60
+
61
+ A cache hit is acceleration, not final evidence; closure still requires fresh drift.
43
62
 
44
63
  ## Sema Code
45
64
 
@@ -67,6 +86,7 @@ Ready UI rule: if the task generates an app, site, dashboard, form, or static HT
67
86
  - `sema ajuda-ia`: short guidance for Codex.
68
87
  - `sema starter-ia`: operational starter.
69
88
  - `sema contexto-ia <arquivo.sema> --saida <dir> --json`: AI context package.
89
+ - `sema resumo <arquivo-ou-pasta> [--drift <none|cache|fresh>] --json`: compact context; drift is not executed unless requested.
70
90
  - `sema prompt-curto <arquivo-ou-pasta> --json`: compact prompt.
71
91
  - `sema sync-codex --json`: synchronizes the official Codex entrypoint and local support docs.
72
92
  - `sema instalar-exemplos --json`: installs official examples in the workspace.
@@ -88,33 +108,34 @@ Ready UI rule: if the task generates an app, site, dashboard, form, or static HT
88
108
  - `sema conteudo planejar <definition.json> --alvos-arquivo <targets.json> --json`: creates a declarative multi-target plan for an external runner.
89
109
  - `sema conteudo validar-envelope --envelope-arquivo <envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --payload-type <type> --json`: verifies Ed25519 identity, authorization, freshness, scope, and the separately pinned trust root and current revocation overlay.
90
110
  - `sema conteudo registrar <ledger.ndjson> --envelope-arquivo <envelope.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-id <id> --expected-head <sha256:...> --json`: appends a verified envelope under the signed run policy to the local replay ledger at an externally retained head.
91
- - `sema conteudo status <definition.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-arquivo <ledger.ndjson> --expected-head <sha256:...> --json`: verifies the signed policy and derives verdicts, operational conditions, completion, and next actions from canonical events.
111
+ - `sema conteudo status <definition.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-arquivo <ledger.ndjson> --expected-head <sha256:...> --json`: verifies the signed policy and its `targetSetDigest`, then derives verdicts, operational conditions, completion, and next actions from canonical events.
92
112
  - `sema conteudo projetar <definition.json> --politica-arquivo <policy-envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --ledger-arquivo <ledger.ndjson> --expected-head <sha256:...> --saida <manifest.json> --json`: regenerates a non-authoritative manifest bound to the ledger head.
93
113
 
94
- The content command never runs producers, evaluators, creative tools, or publication adapters; those belong to an external runner. It has no native human-review transition. A signed policy binds the run, definition, ledger, trust root, gates, complete target set, and authorization window. Stages select `adapterPolicy` as `NONE`, `CONSTRAINTS`, or `CONFIRMATION`; definition v1 accepts one output per stage. Constraint results must come from independent signed observations, including independently observed media type, not artifact metadata or executor claims.
114
+ The content command is an AI-native, multi-channel, multi-format control plane. It never runs producers, evaluators, creative tools, or publication adapters; those belong to an external runner. It has no native human-review transition. A signed policy binds `runId`, definition, ledger, trust root, gates, complete target set, and the full `issuedAt`/`expiresAt` authorization window; no event may be recorded outside it. Stages select `adapterPolicy` as `NONE`, `CONSTRAINTS`, or `CONFIRMATION`; definition v1 accepts one output per stage. Constraint results must come from independent signed observations, including independently observed media type, not artifact metadata or executor claims. Target metadata is an exact scalar allowlist from `requiredMetadata + optionalMetadata`; `accountScope` is a credential-free `account:<alias>` reference, and artifact metadata is prohibited in v1. Deterministic evidence and AI opinions have separate quorum fields. Evidence requires an exact `content.evidence.attest:<evidenceType>` capability; adapter evidence requires `content.adapter.attest:<adapterId>@<version>:<evidenceType>` plus signed adapter binding.
95
115
 
96
- Target metadata is an exact scalar allowlist from `requiredMetadata + optionalMetadata`; `accountScope` is a credential-free `account:<alias>` reference, and artifact metadata is prohibited in v1. Deterministic evidence and AI opinions have separate quorum fields. Evidence requires an exact attestation capability plus signed adapter binding where applicable.
116
+ Verdicts such as `APROVADO`, `REPROVADO`, and `INCONCLUSIVO` remain separate from operational conditions such as `AGUARDANDO_EVENTO_EXTERNO` and `FERRAMENTA_INDISPONIVEL`. A generated manifest is only a projection and cannot alter canonical state.
97
117
 
98
- Verdicts remain separate from operational conditions, and a generated manifest cannot alter canonical state. Append freshness uses the platform clock rather than caller-provided time, and an authority in the current revocation overlay cannot sign an accepted policy.
99
-
100
- Local NDJSON plus a hash chain is portable replay evidence, not a strong append-only trust boundary. Retain the expected head, canonical trust-root digest, and current revocation digest externally, or use protected storage for high assurance. A workspace-local trust file additionally requires `--development-local-trust`; that flag does not disable digest pinning.
118
+ Local NDJSON plus a hash chain is portable evidence for replay, not a strong append-only trust boundary. Retain `expectedHead`, the canonical trust-root digest, and the current revocation digest externally, or use protected storage for high assurance. The trust-root pin identifies the authority snapshot independently from the revocation overlay. A workspace-local trust file additionally requires `--development-local-trust`; the flag does not disable digest pinning. Append freshness uses the platform clock rather than caller-provided `recordedAt`, and an authority in the current revocation overlay cannot sign an accepted policy.
101
119
 
102
120
  ## AI-native Interactive Systems
103
121
 
104
122
  - `sema interativo capabilities --json`: lists the canonical interactive capability vocabulary.
105
- - `sema interativo schema --json`: exposes stable definition, extension-command, and data-schema shapes for AI clients.
123
+ - `sema interativo schema --json`: exposes the stable read-only definition schema, enum matrix, constraints, extension-command and data-schema shapes, plus canonical example paths for AI clients.
106
124
  - `sema interativo pipelines --json`: lists reusable game, simulation, and hybrid pipelines.
107
125
  - `sema interativo adapters [--spatial-model <NON_SPATIAL|TWO_D|TWO_POINT_FIVE_D|THREE_D>] [--render-mode <HEADLESS|TEXT|VISUAL|XR>] --json`: lists compatible external adapter descriptors.
108
126
  - `sema interativo validar <definition.json> --json`: validates independent kind, spatial model, render mode, visual profile, fidelity, control, time, world, budget, pipeline, and acceptance axes.
109
127
  - `sema interativo planejar <definition.json> --json`: expands compatible stages and required evidence without running an engine.
110
128
  - `sema interativo validar-evidencias|status <definition.json> [--plano-arquivo <plan.json>] --bundle-arquivo <bundle.json> --json`: validates a portable evidence bundle or derives non-authoritative status; `--evidencias-arquivo` is an alias and an omitted plan is recomputed deterministically.
111
129
  - `sema interativo validar-protocolo <adapter-run.json> --json`: checks DETECT/PROBE/SNAPSHOT/PLAN/APPLY/VALIDATE/EVIDENCE/ROLLBACK ordering and stable target binding.
112
- - Experience IR: `validar-ir`, `indexar-ir`, `consultar-ir`, `chunk-ir`, and `descrever-ir`.
113
- - Operational state: `validar-engine-snapshot`, `diff-engine-snapshots`, `validar-asset-provenance`, `validar-editor-state`, `planejar-jobs`, `validar-acceptance`, `operar-acceptance`, and `validar-multimodal`.
114
- - Temporal, autonomy, and testing: `validar-temporal`, `validar-evidencia-temporal`, `validar-autonomia`, `validar-playtest-fuzz`, and `validar-multiplayer`.
130
+ - Experience IR: `validar-ir`, `indexar-ir`, `consultar-ir --semantic-id <id>`, `chunk-ir --semantic-id <id> [--raso]`, and `descrever-ir`.
131
+ - Operational state: `validar-engine-snapshot`, `diff-engine-snapshots`, `validar-asset-provenance`, `validar-editor-state`, `planejar-jobs`, `validar-acceptance`, `operar-acceptance --operation <VALIDATE|EVALUATE|INVALIDATE> --context-file <file>`, and `validar-multimodal`.
132
+ - Temporal, autonomy, and testing: `validar-temporal`, `validar-evidencia-temporal --bundle-arquivo <file>`, `validar-autonomia`, `validar-playtest-fuzz`, and `validar-multiplayer`.
115
133
  - Portability and workers: `analisar-portabilidade` and `validar-workers`.
134
+ - `sema interativo validar-control-run <control-run.json> --definition-arquivo <definition.json> --plano-arquivo <plan.json> --contrato-arquivo <validation-contract.json> --entrada-arquivo <input.json> [--entrada-auxiliar-arquivo <supporting-input.json>] --evidencia-arquivo <evidence.json> --resultado-arquivo <result.json> --json`: binds one advanced validation to its complete local digest chain instead of trusting a standalone result.
135
+
136
+ The control-run command recomputes the canonical plan and selected pure validator, then verifies the definition, pipeline descriptor, validation contract, schema-declared inputs, evidence, and result digests. Prefix advanced items with `sema interativo` and pass the documented JSON file as the positional argument; an agent does not have to infer the validator or payload shape from a filename or visual style. The machine-readable schema publishes command maps, input/output schema links, required top-level fields, `outputTargets` path segments from the payload root, at least one real output shape per command, and official fixtures for all 20 advanced commands. Validation-result shapes describe `payload.resultado`; projected IR values use `indice`, `entry`, `chunk`, or `descriptor`; operation projections such as `engineDiff` and `jobOrchestrationPlan` live under `payload.resultado.value`; the job plan's ordered `queue` is the assignment list and exposes kind, priority, adapter, dependencies, locks, budgets, heartbeat, checkpoint, and recovery data.
116
137
 
117
- Spatial model and render mode are orthogonal: `THREE_D + HEADLESS` is valid, while XR requires `THREE_D`. `PIXEL_8_BIT` and `PIXEL_16_BIT` are independent visual profiles available to games and simulations. Every command above is local and read-only; external runners own engine/editor execution, authorization, mutation, rollback, migration, rendering, playtest, and worker scheduling. Full local coverage is `STRUCTURALLY_COMPLETE`, never authoritative completion.
138
+ Spatial model and render mode are orthogonal: `THREE_D + HEADLESS` is valid, while XR requires `THREE_D`. `PIXEL_8_BIT` and `PIXEL_16_BIT` are independent visual profiles available to games and simulations. Every command above rejects unknown, duplicate, missing-value, or invalid-enum arguments, remains local, read-only, and non-authoritative, and leaves engine/editor execution, authorization, mutation, rollback, migration, rendering, playtest, and worker scheduling to external runners. Full local coverage is `STRUCTURALLY_COMPLETE`, never authoritative completion, and a local evidence bundle is never presented as authoritative trust.
118
139
 
119
140
  ## Operational
120
141
 
@@ -122,12 +143,12 @@ Spatial model and render mode are orthogonal: `THREE_D + HEADLESS` is valid, whi
122
143
 
123
144
  ## Forbidden
124
145
 
125
- - Do not use an external workspace source to inspect a local workspace when `sema --version` works.
146
+ - Do not use an external workspace source to inspect a local workspace when `sema --version` or the managed launcher works.
126
147
  - Do not search the entire disk for `.sema` syntax; use `exemplos/`, `docs/syntax.md`, and this catalog.
127
148
  - Do not stop after `sema compilar` if the contract target files still do not exist.
128
149
  - Do not replace `sema compilar` with `sema testar` when the contract requires generated code.
129
150
  - Do not create a Markdown report to pretend a gate ran.
130
- - Do not say drift passed when `sema drift --json` returned `sucesso:false`, broken link, divergent route, or broken impl.
151
+ - Do not say drift passed when the unwrapped `sema drift --cache fresh --json` payload returned `sucesso:false`, a non-empty `vinculos_quebrados`, `rotas_divergentes`, or `impls_quebrados` list.
131
152
  - Do not declare a UI responsive without mobile/desktop proof; horizontal scroll at 390px blocks closure.
132
153
 
133
154
  Governed code policy: keep the `SEMA-GOVERNED` marker, split large code by real responsibility, preserve contract links, and never treat a generated output directory as the final delivery.
package/docs/deploy.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Deployment Boundary
2
2
 
3
- The public Sema repository documents two coordinated release surfaces: the
4
- local npm CLI and the Codex bootstrap skill. The skill remains a separate,
5
- explicit Codex installation and is never injected by npm lifecycle scripts.
3
+ The public Sema repository documents one coordinated npm artifact containing
4
+ the local CLI, its absolute managed launcher, and the portable bootstrap skill.
5
+ The repository Codex plugin remains an optional namespaced distribution channel
6
+ for the same versioned skill.
6
7
 
7
8
  Run the complete public gate:
8
9
 
@@ -22,11 +23,23 @@ npm run release:publicar-npm-dry-run
22
23
  the public boundary, so a clean clone does not depend on ignored generated
23
24
  handshake files left by a previous local run.
24
25
 
25
- The plugin smoke installs the repo marketplace into an isolated `CODEX_HOME`,
26
- installs `sema@sema`, compares the cached skill with the versioned source, and
27
- proves no Sema MCP server was registered. Plugin and CLI versions must match
28
- before the commit is pushed. The release command itself runs the full test suite
29
- and project-wide Sema drift gate; these are not optional manual preliminaries.
26
+ All release and local-install routes delegate to `npm run
27
+ cli:empacotar-publica`. The factory uses a unique private stage, disables npm
28
+ lifecycle scripts while packing that stage, and publishes only a fully
29
+ validated tarball. Do not use `npm pack --workspace @semacode/cli`; the source
30
+ package guard rejects that unsupported path without staging files in the
31
+ workspace.
32
+
33
+ The public-package smoke performs a global install with isolated home, npm
34
+ prefix, npm cache, and user cache. It proves the launcher works through its
35
+ absolute path with Node.js and npm removed from `PATH`. On Windows it exercises
36
+ `sema.ps1` as the PowerShell `PATH` entrypoint, `sema-managed.ps1` through the
37
+ absolute `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe`, and
38
+ `sema.cmd` through `cmd.exe`. The smoke also proves the synchronized
39
+ skill matches the packaged source, the real user home is unchanged, and local
40
+ installs leave global state untouched. The plugin smoke independently compares
41
+ its cached skill with the versioned source and proves no Sema MCP server was
42
+ registered. Plugin and CLI versions must match before the commit is pushed.
30
43
 
31
44
  Push the commit containing `.agents/plugins/marketplace.json` and
32
45
  `plugins/sema/` before telling users to install from `gerlanss/Sema`. Publish
@@ -1,106 +1,106 @@
1
- # Capability Discovery
2
-
3
- Sema exposes one explainable catalog so an AI can distinguish a validation
4
- profile, an orchestration pipeline, a specialized workflow, a generator, a
5
- governance gate, an adapter descriptor, and an opaque capability token.
6
-
7
- Discovery is local, deterministic, and read-only. It recommends or explains a
8
- capability but never executes the recommended command:
9
-
10
- ```bash
11
- sema descobrir catalogo --json
12
- sema descobrir recomendar --intencao "validar simulador 3D autonomo calibrado" --json
13
- sema descobrir recomendar --intencao "port a 16-bit game to another engine and declare losses" --json
14
- sema descobrir explicar interactive.portability --json
15
- sema pipeline listar --json
16
- sema pipeline descrever interactive.playtest --json
17
- sema capabilities --json
18
- ```
19
-
20
- The response schema is `sema.discovery/v1` and always reports:
21
-
22
- - `executed: false`;
23
- - `workspaceMutated: false`;
24
- - `externalCalls: false`;
25
- - actionable command templates with placeholders;
26
- - required inputs and execution boundaries;
27
- - matched signals, reasons, missing inputs, and stable scores.
28
-
29
- Advanced interactive intent is routed to the narrowest local validator or
30
- analyzer (`validar-temporal`, `validar-playtest-fuzz`, `analisar-portabilidade`,
31
- and peers). A broad profile or engine descriptor does not outrank that specific
32
- pipeline, and the suggested template retains every required file and flag.
33
-
34
- Raw paths and credential-like values supplied in intents or filters are used
35
- only for the in-memory lookup and are redacted from JSON and human output.
36
-
37
- ## Catalog coverage
38
-
39
- The interactive catalog exposes **35 unique pipelines** and **28 unique
40
- external adapter descriptors**. The pipeline set covers the original game and
41
- simulation lifecycle plus P0/P1/P2 operational capabilities:
42
-
43
- - P0 representation and observation: Experience IR, engine snapshots, asset
44
- provenance, editor state, multimodal evidence, resumable jobs, and acceptance
45
- locks;
46
- - P1 behavior over time: timeline validation, shot/camera checks, physics
47
- relations, temporal QA, clean-install/launch/smoke checks, and hardware
48
- budgets;
49
- - P2 autonomy and scale: safe repair cycles, bot playtests, state fuzzing,
50
- multiplayer authority, engine migration, portability with declared losses,
51
- and distributed job DAGs.
52
-
53
- These entries apply across 3D, 2.5D, 2D, 8-bit, 16-bit, text, XR, and headless
54
- games and simulations. Discovery ranks the requested goal independently from
55
- the spatial model and visual profile.
56
-
57
- The 28 adapters are **descriptors for external capabilities**. Catalog lookup
58
- does not detect an installed engine, inspect an editor, enumerate plug-ins,
59
- probe processes, contact a worker, or prove that any integration is available.
60
- An external runner must establish runtime availability and return bound
61
- evidence.
62
-
63
- ## Capability kinds
64
-
65
- - `GOVERNANCE_FLOW`: contract, drift, impact, verification, and closure gates.
66
- - `PROFILE_GATE`: semantic validation such as game, simulation, software, or ops.
67
- - `SPECIALIZED_WORKFLOW`: dedicated surfaces such as `sema author`.
68
- - `ORCHESTRATION_PIPELINE`: a staged workflow such as content, interactive
69
- playtest, temporal validation, portability, or distributed jobs.
70
- - `CAPABILITY_TOKEN`: an opaque producer, evaluator, runtime, or evidence token.
71
- - `GENERATOR`: code generation targets.
72
- - `ADAPTER`: compatibility descriptors for external engines, editors, runtimes,
73
- observers, verifiers, asset tools, build systems, and workers.
74
-
75
- `author` is intentionally a specialized workflow, not a fake
76
- `sema profile validar author` command. Likewise, `profile.game` validates game
77
- semantics; it is not the same thing as the `interactive.playtest` pipeline.
78
-
79
- ## Deterministic recommendation
80
-
81
- The base router normalizes accents and aliases, applies positive and negative
82
- signals, scores the entry kind and domain, and sorts by score then stable ID.
83
- The minimum recommendation score is 60. When the top two candidates are within
84
- seven points, the response reports ambiguity and does not choose a command.
85
-
86
- This rule is deliberate: an AI should request more concrete intent instead of
87
- silently running the wrong pipeline.
88
-
89
- Interactive pipeline entries point to declarative planning with
90
- `sema interativo planejar <definition.json> --json`. The definition must list
91
- the recommended pipeline ID; the secondary `descrever` template remains
92
- available when the AI first needs the pipeline contract. Advanced entries point
93
- to their dedicated `sema interativo` validator or analyzer. Those commands
94
- still return local, non-authoritative results and do not execute engines,
95
- editors, plug-ins, or workers.
96
-
97
- Legacy views remain available:
98
-
99
- ```bash
100
- sema profile capabilities --json
101
- sema conteudo capabilities --json
102
- sema interativo capabilities --json
103
- ```
104
-
105
- They are projections of the same authoritative catalog sources, not separate
106
- manually maintained product maps.
1
+ # Capability Discovery
2
+
3
+ Sema exposes one explainable catalog so an AI can distinguish a validation
4
+ profile, an orchestration pipeline, a specialized workflow, a generator, a
5
+ governance gate, an adapter descriptor, and an opaque capability token.
6
+
7
+ Discovery is local, deterministic, and read-only. It recommends or explains a
8
+ capability but never executes the recommended command:
9
+
10
+ ```bash
11
+ sema descobrir catalogo --json
12
+ sema descobrir recomendar --intencao "validar simulador 3D autonomo calibrado" --json
13
+ sema descobrir recomendar --intencao "port a 16-bit game to another engine and declare losses" --json
14
+ sema descobrir explicar interactive.portability --json
15
+ sema pipeline listar --json
16
+ sema pipeline descrever interactive.playtest --json
17
+ sema capabilities --json
18
+ ```
19
+
20
+ The response schema is `sema.discovery/v1` and always reports:
21
+
22
+ - `executed: false`;
23
+ - `workspaceMutated: false`;
24
+ - `externalCalls: false`;
25
+ - actionable command templates with placeholders;
26
+ - required inputs and execution boundaries;
27
+ - matched signals, reasons, missing inputs, and stable scores.
28
+
29
+ Advanced interactive intent is routed to the narrowest local validator or
30
+ analyzer (`validar-temporal`, `validar-playtest-fuzz`, `analisar-portabilidade`,
31
+ and peers). A broad profile or engine descriptor does not outrank that specific
32
+ pipeline, and the suggested template retains every required file and flag.
33
+
34
+ Raw paths and credential-like values supplied in intents or filters are used
35
+ only for the in-memory lookup and are redacted from JSON and human output.
36
+
37
+ ## Catalog coverage
38
+
39
+ The interactive catalog exposes **35 unique pipelines** and **28 unique
40
+ external adapter descriptors**. The pipeline set covers the original game and
41
+ simulation lifecycle plus P0/P1/P2 operational capabilities:
42
+
43
+ - P0 representation and observation: Experience IR, engine snapshots, asset
44
+ provenance, editor state, multimodal evidence, resumable jobs, and acceptance
45
+ locks;
46
+ - P1 behavior over time: timeline validation, shot/camera checks, physics
47
+ relations, temporal QA, clean-install/launch/smoke checks, and hardware
48
+ budgets;
49
+ - P2 autonomy and scale: safe repair cycles, bot playtests, state fuzzing,
50
+ multiplayer authority, engine migration, portability with declared losses,
51
+ and distributed job DAGs.
52
+
53
+ These entries apply across 3D, 2.5D, 2D, 8-bit, 16-bit, text, XR, and headless
54
+ games and simulations. Discovery ranks the requested goal independently from
55
+ the spatial model and visual profile.
56
+
57
+ The 28 adapters are **descriptors for external capabilities**. Catalog lookup
58
+ does not detect an installed engine, inspect an editor, enumerate plug-ins,
59
+ probe processes, contact a worker, or prove that any integration is available.
60
+ An external runner must establish runtime availability and return bound
61
+ evidence.
62
+
63
+ ## Capability kinds
64
+
65
+ - `GOVERNANCE_FLOW`: contract, drift, impact, verification, and closure gates.
66
+ - `PROFILE_GATE`: semantic validation such as game, simulation, software, or ops.
67
+ - `SPECIALIZED_WORKFLOW`: dedicated surfaces such as `sema author`.
68
+ - `ORCHESTRATION_PIPELINE`: a staged workflow such as content, interactive
69
+ playtest, temporal validation, portability, or distributed jobs.
70
+ - `CAPABILITY_TOKEN`: an opaque producer, evaluator, runtime, or evidence token.
71
+ - `GENERATOR`: code generation targets.
72
+ - `ADAPTER`: compatibility descriptors for external engines, editors, runtimes,
73
+ observers, verifiers, asset tools, build systems, and workers.
74
+
75
+ `author` is intentionally a specialized workflow, not a fake
76
+ `sema profile validar author` command. Likewise, `profile.game` validates game
77
+ semantics; it is not the same thing as the `interactive.playtest` pipeline.
78
+
79
+ ## Deterministic recommendation
80
+
81
+ The base router normalizes accents and aliases, applies positive and negative
82
+ signals, scores the entry kind and domain, and sorts by score then stable ID.
83
+ The minimum recommendation score is 60. When the top two candidates are within
84
+ seven points, the response reports ambiguity and does not choose a command.
85
+
86
+ This rule is deliberate: an AI should request more concrete intent instead of
87
+ silently running the wrong pipeline.
88
+
89
+ Interactive pipeline entries point to declarative planning with
90
+ `sema interativo planejar <definition.json> --json`. The definition must list
91
+ the recommended pipeline ID; the secondary `descrever` template remains
92
+ available when the AI first needs the pipeline contract. Advanced entries point
93
+ to their dedicated `sema interativo` validator or analyzer. Those commands
94
+ still return local, non-authoritative results and do not execute engines,
95
+ editors, plug-ins, or workers.
96
+
97
+ Legacy views remain available:
98
+
99
+ ```bash
100
+ sema profile capabilities --json
101
+ sema conteudo capabilities --json
102
+ sema interativo capabilities --json
103
+ ```
104
+
105
+ They are projections of the same authoritative catalog sources, not separate
106
+ manually maintained product maps.