@semacode/cli 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/LICENSE +39 -39
  2. package/README.md +251 -228
  3. package/dist/agentEntryPoints.js +551 -550
  4. package/dist/angular-consumer-standalone.d.ts +3 -1
  5. package/dist/angular-consumer-standalone.js +12 -8
  6. package/dist/drift.part01.d.ts +32 -2
  7. package/dist/drift.part01.js +2 -0
  8. package/dist/drift.part04.d.ts +3 -2
  9. package/dist/drift.part04.js +6 -3
  10. package/dist/drift.part05.d.ts +2 -1
  11. package/dist/drift.part05.js +4 -3
  12. package/dist/drift.part06.d.ts +2 -1
  13. package/dist/drift.part06.js +9 -5
  14. package/dist/drift.part07.d.ts +11 -10
  15. package/dist/drift.part07.js +40 -30
  16. package/dist/drift.part08.d.ts +2 -1
  17. package/dist/drift.part08.js +4 -3
  18. package/dist/drift.part11.js +71 -6
  19. package/dist/drift.part12.js +14 -1
  20. package/dist/drift.part13.d.ts +42 -7
  21. package/dist/drift.part13.js +660 -36
  22. package/dist/driftCache.d.ts +49 -0
  23. package/dist/driftCache.js +311 -0
  24. package/dist/driftCacheIncremental.d.ts +98 -0
  25. package/dist/driftCacheIncremental.js +596 -0
  26. package/dist/driftCatalogo.d.ts +91 -0
  27. package/dist/driftCatalogo.js +657 -0
  28. package/dist/driftCatalogoPersistente.d.ts +8 -0
  29. package/dist/driftCatalogoPersistente.js +77 -0
  30. package/dist/driftEscopo.d.ts +23 -0
  31. package/dist/driftEscopo.js +563 -0
  32. package/dist/driftEscopoReferencias.d.ts +4 -0
  33. package/dist/driftEscopoReferencias.js +265 -0
  34. package/dist/driftOrcamento.d.ts +12 -0
  35. package/dist/driftOrcamento.js +19 -3
  36. package/dist/execucoesExternas.js +5 -19
  37. package/dist/iaPrompts.js +310 -310
  38. package/dist/index.part01.d.ts +16 -1
  39. package/dist/index.part01.js +80 -4
  40. package/dist/index.part02.js +21 -21
  41. package/dist/index.part03.d.ts +2 -2
  42. package/dist/index.part03.js +14 -3
  43. package/dist/index.part04.d.ts +2 -2
  44. package/dist/index.part04.js +113 -101
  45. package/dist/index.part05.d.ts +1 -1
  46. package/dist/index.part05.js +99 -22
  47. package/dist/index.part06.js +3 -2
  48. package/dist/index.part07.js +24 -24
  49. package/dist/index.part08.js +1 -1
  50. package/dist/init/templates.part01.js +393 -393
  51. package/dist/init/templates.part02.js +189 -189
  52. package/dist/initTemplatesBackend.js +73 -73
  53. package/dist/initTemplatesBase.js +81 -81
  54. package/dist/initTemplatesFlutter.js +137 -137
  55. package/dist/initTemplatesRuntime.js +350 -350
  56. package/dist/initTemplatesWeb.js +309 -309
  57. package/dist/pipelineConteudo/command.js +1 -36
  58. package/dist/projeto.d.ts +1 -1
  59. package/dist/projetoCarregar.d.ts +2 -2
  60. package/dist/projetoCarregar.js +47 -24
  61. package/dist/projetoCatalogo.d.ts +7 -0
  62. package/dist/projetoCatalogo.js +125 -0
  63. package/dist/projetoTipos.d.ts +14 -5
  64. package/dist/sync/index.js +35 -35
  65. package/docs/README.md +34 -34
  66. package/docs/ai-integration.md +1 -7
  67. package/docs/ai-onboarding.md +62 -62
  68. package/docs/ai-workflow.md +4 -0
  69. package/docs/auth.md +26 -26
  70. package/docs/cli.md +79 -79
  71. package/docs/commands.md +16 -13
  72. package/docs/database.md +15 -15
  73. package/docs/deploy.md +41 -41
  74. package/docs/descoberta-capacidades.md +106 -106
  75. package/docs/documentation.md +37 -46
  76. package/docs/env.md +16 -16
  77. package/docs/frontend.md +41 -41
  78. package/docs/getting-started.md +57 -57
  79. package/docs/i18n.md +15 -15
  80. package/docs/pipeline-conteudo.md +246 -246
  81. package/docs/profiles.md +54 -54
  82. package/docs/repositories.md +43 -43
  83. package/docs/rollback.md +31 -31
  84. package/docs/security.md +32 -32
  85. package/docs/sistemas-interativos.md +373 -378
  86. package/docs/support.md +8 -8
  87. package/docs/testing.md +51 -44
  88. package/docs/vocabulary.md +29 -29
  89. package/exemplos/agendamento.sema +1 -1
  90. package/exemplos/assinatura.sema +1 -1
  91. package/exemplos/auditoria.sema +1 -1
  92. package/exemplos/autenticacao.sema +1 -1
  93. package/exemplos/author_obra_comum.sema +1 -1
  94. package/exemplos/author_tema_sensivel.sema +1 -1
  95. package/exemplos/automacao.sema +1 -1
  96. package/exemplos/cadastro_usuario.sema +1 -1
  97. package/exemplos/calculadora.sema +1 -1
  98. package/exemplos/crud_simples.sema +1 -1
  99. package/exemplos/estoque.sema +1 -1
  100. package/exemplos/exportacao.sema +1 -1
  101. package/exemplos/fila.sema +1 -1
  102. package/exemplos/integracao_externa.sema +1 -1
  103. package/exemplos/multi_tenant.sema +1 -1
  104. package/exemplos/notificacao.sema +1 -1
  105. package/exemplos/operacao_estrategia.sema +132 -132
  106. package/exemplos/operacao_estrategia_discovery.sema +220 -220
  107. package/exemplos/operacao_estrategia_fluxo.sema +114 -114
  108. package/exemplos/operacao_estrategia_gates.sema +106 -106
  109. package/exemplos/operacao_estrategia_quarentena.sema +133 -133
  110. package/exemplos/operacao_estrategia_rollout.sema +124 -124
  111. package/exemplos/pagamento.sema +1 -1
  112. package/exemplos/pagamento_dominio.sema +1 -1
  113. package/exemplos/pedido.sema +1 -1
  114. package/exemplos/permissao.sema +1 -1
  115. package/exemplos/persistencia_vendor_first.sema +1 -1
  116. package/exemplos/pipeline-conteudo/README.md +44 -44
  117. package/exemplos/pipeline-conteudo/alvos.json +23 -23
  118. package/exemplos/pipeline-conteudo/definicao.json +136 -136
  119. package/exemplos/profile_conversas.sema +165 -165
  120. package/exemplos/profile_game.sema +1 -1
  121. package/exemplos/profile_legal.sema +1 -1
  122. package/exemplos/profile_ops.sema +1 -1
  123. package/exemplos/profile_research.sema +1 -1
  124. package/exemplos/profile_simulation.sema +211 -211
  125. package/exemplos/profile_software.sema +1 -1
  126. package/exemplos/profile_workflow_n8n.sema +1 -1
  127. package/exemplos/relatorio.sema +1 -1
  128. package/exemplos/replica_analitica_erp.sema +1 -1
  129. package/exemplos/sistemas-interativos/README.md +100 -100
  130. package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -5
  131. package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -16
  132. package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -32
  133. package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -93
  134. package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -78
  135. package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -27
  136. package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -79
  137. package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -42
  138. package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -32
  139. package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -23
  140. package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -39
  141. package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -46
  142. package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -39
  143. package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -37
  144. package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -104
  145. package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -27
  146. package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -118
  147. package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -459
  148. package/exemplos/sistemas-interativos/game-2d.json +83 -83
  149. package/exemplos/sistemas-interativos/game-3d-human.json +81 -81
  150. package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -97
  151. package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -94
  152. package/exemplos/sistemas-interativos/game-xr-human.json +80 -80
  153. package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -108
  154. package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -75
  155. package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -58
  156. package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -97
  157. package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -141
  158. package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -112
  159. package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -103
  160. package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -95
  161. package/exemplos/testes_embutidos.sema +1 -1
  162. package/exemplos/tratamento_erro.sema +1 -1
  163. package/exemplos/upload_arquivo.sema +1 -1
  164. package/exemplos/webhook.sema +1 -1
  165. package/node_modules/@sema/gerador-cpp/dist/index.js +176 -176
  166. package/node_modules/@sema/gerador-cpp/package.json +1 -1
  167. package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
  168. package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
  169. package/node_modules/@sema/gerador-dotnet/dist/index.js +169 -169
  170. package/node_modules/@sema/gerador-dotnet/package.json +1 -1
  171. package/node_modules/@sema/gerador-html/dist/index.js +17 -17
  172. package/node_modules/@sema/gerador-lua/dist/index.js +51 -51
  173. package/node_modules/@sema/gerador-php/dist/index.js +113 -113
  174. package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
  175. package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
  176. package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
  177. package/package.json +3 -3
@@ -21,6 +21,10 @@ Closing rule: `sema drift --json` must return `sucesso:true`. If it reports `suc
21
21
 
22
22
  UI rule: if the task involves an interface, minimum evidence includes desktop and mobile. On a narrow viewport such as 390px, `document.documentElement.scrollWidth <= document.documentElement.clientWidth` must pass; horizontal scroll blocks closure.
23
23
 
24
+ Focused inspection rule: `sema inspecionar <contrato.sema>` and `sema resumo <contrato.sema> --micro` default to `--drift none`. They load the target plus its transitive `use` closure and must state that live code was not verified. Use `--drift cache`, `--drift fresh`, or `--com-drift` only when implementation evidence is required.
25
+
26
+ Drift scope rule: a file/module run plans its physical file set before cataloging and never falls back to a whole-project walk when no safe anchor exists. `--cache auto` reuses validated catalog, file, and semantic-group entries; `--cache refresh` recalculates them; `--cache off` disables persistent cache I/O. Inspect `escopo_aplicado.catalogo`, `escopo_aplicado.cache.incremental`, and `escopo_aplicado.cache.fasesMs` for the work actually performed.
27
+
24
28
  ## Codex Context Capacity
25
29
 
26
30
  - Small context: `SEMA_SMALL_MODEL.md`, `SEMA_BRIEF.micro.txt`, `AGENT_CONTEXT_PACK.json`, `SEMA_INDEX.json`.
package/docs/auth.md CHANGED
@@ -1,26 +1,26 @@
1
- # Local Runtime Boundary
2
-
3
- The public Sema CLI executes directly against the local workspace. It does not
4
- require a Sema login, user authentication, product authorization, license
5
- activation, install key, token, credits, billing service, control panel, or an
6
- external request.
7
-
8
- Use local commands:
9
-
10
- ```bash
11
- sema --version
12
- sema resumo
13
- sema validar contratos/example.sema --json
14
- ```
15
-
16
- The repository license governs use and redistribution. It is not checked as a
17
- runtime activation mechanism.
18
-
19
- An `authz` block inside a `.sema` contract describes authorization in the
20
- application being governed. It does not authenticate a person before the Sema
21
- CLI can run.
22
-
23
- Do not put private or sensitive operational material in this repository.
24
-
25
- Application-specific authentication belongs in the application repository that
26
- owns it.
1
+ # Local Runtime Boundary
2
+
3
+ The public Sema CLI executes directly against the local workspace. It does not
4
+ require a Sema login, user authentication, product authorization, license
5
+ activation, install key, token, credits, billing service, control panel, or an
6
+ external request.
7
+
8
+ Use local commands:
9
+
10
+ ```bash
11
+ sema --version
12
+ sema resumo
13
+ sema validar contratos/example.sema --json
14
+ ```
15
+
16
+ The repository license governs use and redistribution. It is not checked as a
17
+ runtime activation mechanism.
18
+
19
+ An `authz` block inside a `.sema` contract describes authorization in the
20
+ application being governed. It does not authenticate a person before the Sema
21
+ CLI can run.
22
+
23
+ Do not put private or sensitive operational material in this repository.
24
+
25
+ Application-specific authentication belongs in the application repository that
26
+ owns it.
package/docs/cli.md CHANGED
@@ -1,79 +1,79 @@
1
- # Sema CLI
2
-
3
- Sema is a Codex-native local CLI distribution. The public package reads the
4
- workspace on the user's machine, validates `.sema` contracts, checks drift,
5
- maps impact, and generates code without login, user authorization, license
6
- activation, tokens, credits, billing services, a control panel, or external
7
- service credentials.
8
-
9
- Support: suporte@otimitare.online
10
-
11
- ## Install
12
-
13
- ```bash
14
- npm install -g @semacode/cli
15
- sema --version
16
- ```
17
-
18
- For development inside this repository:
19
-
20
- ```bash
21
- npm install
22
- npm run build
23
- node pacotes/cli/dist/index.js --help
24
- ```
25
-
26
- ## Codex Setup
27
-
28
- `AGENTS.md` is the official Sema entrypoint for Codex. Create or refresh it from
29
- the local CLI:
30
-
31
- ```bash
32
- sema sync-codex --json
33
- ```
34
-
35
- Codex automatically loads `AGENTS.md` as repository guidance. Sema is an
36
- independent product and is not affiliated with or endorsed by OpenAI.
37
-
38
- ## Required Local Flow
39
-
40
- Codex and humans should use the same local sequence before changing governed
41
- code, contracts, workflows, release scripts, or operational docs:
42
-
43
- ```bash
44
- sema --version
45
- sema resumo
46
- sema docs-impacto --intencao "describe the change" --json
47
- sema inspecionar contratos/example.sema --json
48
- sema drift contratos/example.sema --escopo modulo --json
49
- sema impacto contratos/example.sema --alvo sema.example.target --mudanca "describe the change" --json
50
- ```
51
-
52
- Commands run directly against the local workspace. If `sema --version` fails,
53
- install or repair the npm package; there is no separate authorization gate.
54
-
55
- ## Core Commands
56
-
57
- - `sema iniciar`: create a governed starting point.
58
- - `sema validar`: validate `.sema` contracts.
59
- - `sema inspecionar`: inspect the applicable contract surface.
60
- - `sema drift`: compare contracts and implementation.
61
- - `sema impacto`: map the blast radius of a planned change.
62
- - `sema docs-impacto`: identify docs that must be read or updated.
63
- - `sema finalizar-mudanca`: close the governed change with evidence.
64
- - `sema compilar`: generate code from contracts.
65
- - `sema testar`: generate, compile, and execute local contract tests, including `dotnet` and `cpp`.
66
- - `sema verificar`: run the final local verification bundle.
67
- - `sema contexto-ia`: build local AI context from a contract.
68
- - `sema sync-codex`: create or refresh the official `AGENTS.md` entrypoint.
69
-
70
- Generation targets are `typescript`, `python`, `php`, `dart`, `lua`,
71
- `javascript`, `html`, `css`, `dotnet`, and `cpp`. The aliases `cs` and
72
- `csharp` select `dotnet`; `c++`, `cxx`, and `cc` select `cpp`.
73
- Native targets are opt-in in `sema.config.json.alvos` for project-wide
74
- verification because they require local compiler toolchains.
75
-
76
- ## Public Boundary
77
-
78
- Do not publish private or sensitive operational material in public Sema
79
- artifacts.
1
+ # Sema CLI
2
+
3
+ Sema is a Codex-native local CLI distribution. The public package reads the
4
+ workspace on the user's machine, validates `.sema` contracts, checks drift,
5
+ maps impact, and generates code without login, user authorization, license
6
+ activation, tokens, credits, billing services, a control panel, or external
7
+ service credentials.
8
+
9
+ Support: suporte@otimitare.online
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ npm install -g @semacode/cli
15
+ sema --version
16
+ ```
17
+
18
+ For development inside this repository:
19
+
20
+ ```bash
21
+ npm install
22
+ npm run build
23
+ node pacotes/cli/dist/index.js --help
24
+ ```
25
+
26
+ ## Codex Setup
27
+
28
+ `AGENTS.md` is the official Sema entrypoint for Codex. Create or refresh it from
29
+ the local CLI:
30
+
31
+ ```bash
32
+ sema sync-codex --json
33
+ ```
34
+
35
+ Codex automatically loads `AGENTS.md` as repository guidance. Sema is an
36
+ independent product and is not affiliated with or endorsed by OpenAI.
37
+
38
+ ## Required Local Flow
39
+
40
+ Codex and humans should use the same local sequence before changing governed
41
+ code, contracts, workflows, release scripts, or operational docs:
42
+
43
+ ```bash
44
+ sema --version
45
+ sema resumo
46
+ sema docs-impacto --intencao "describe the change" --json
47
+ sema inspecionar contratos/example.sema --json
48
+ sema drift contratos/example.sema --escopo modulo --json
49
+ sema impacto contratos/example.sema --alvo sema.example.target --mudanca "describe the change" --json
50
+ ```
51
+
52
+ Commands run directly against the local workspace. If `sema --version` fails,
53
+ install or repair the npm package; there is no separate authorization gate.
54
+
55
+ ## Core Commands
56
+
57
+ - `sema iniciar`: create a governed starting point.
58
+ - `sema validar`: validate `.sema` contracts.
59
+ - `sema inspecionar`: inspect the applicable contract surface.
60
+ - `sema drift`: compare contracts and implementation.
61
+ - `sema impacto`: map the blast radius of a planned change.
62
+ - `sema docs-impacto`: identify docs that must be read or updated.
63
+ - `sema finalizar-mudanca`: close the governed change with evidence.
64
+ - `sema compilar`: generate code from contracts.
65
+ - `sema testar`: generate, compile, and execute local contract tests, including `dotnet` and `cpp`.
66
+ - `sema verificar`: run the final local verification bundle.
67
+ - `sema contexto-ia`: build local AI context from a contract.
68
+ - `sema sync-codex`: create or refresh the official `AGENTS.md` entrypoint.
69
+
70
+ Generation targets are `typescript`, `python`, `php`, `dart`, `lua`,
71
+ `javascript`, `html`, `css`, `dotnet`, and `cpp`. The aliases `cs` and
72
+ `csharp` select `dotnet`; `c++`, `cxx`, and `cc` select `cpp`.
73
+ Native targets are opt-in in `sema.config.json.alvos` for project-wide
74
+ verification because they require local compiler toolchains.
75
+
76
+ ## Public Boundary
77
+
78
+ Do not publish private or sensitive operational material in public Sema
79
+ artifacts.
package/docs/commands.md CHANGED
@@ -30,13 +30,17 @@ Then read every required doc returned by `docs-impacto`.
30
30
  ## Change and Closure
31
31
 
32
32
  - `sema docs-impacto --intencao "<acao>" --json`: discovers required docs and documentary blockers.
33
- - `sema drift <arquivo-ou-pasta> --escopo modulo --json`: compares contract and implementation.
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.
34
36
  - `sema impacto <arquivo-ou-pasta> --alvo <token> --mudanca "<descricao>" --json`: maps impact before changing behavior.
35
37
  - `sema verificar <arquivo-ou-pasta> --json`: runs aggregated final verification.
36
38
  - `sema finalizar-mudanca --intencao "<acao>" --doc-lida <arquivo> --json`: proves documentation reading before closure.
37
39
 
38
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.
39
41
 
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.
43
+
40
44
  ## Sema Code
41
45
 
42
46
  - `sema compilar <arquivo-ou-pasta> --alvo <typescript|python|php|dart|lua|javascript|html|css|dotnet|cpp> --saida <diretorio>`: generates starter/support artifacts from the contract.
@@ -84,34 +88,33 @@ Ready UI rule: if the task generates an app, site, dashboard, form, or static HT
84
88
  - `sema conteudo planejar <definition.json> --alvos-arquivo <targets.json> --json`: creates a declarative multi-target plan for an external runner.
85
89
  - `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.
86
90
  - `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.
87
- - `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.
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.
88
92
  - `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.
89
93
 
90
- 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.
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.
95
+
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.
91
97
 
92
- 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.
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.
93
99
 
94
- 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.
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.
95
101
 
96
102
  ## AI-native Interactive Systems
97
103
 
98
104
  - `sema interativo capabilities --json`: lists the canonical interactive capability vocabulary.
99
- - `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.
105
+ - `sema interativo schema --json`: exposes stable definition, extension-command, and data-schema shapes for AI clients.
100
106
  - `sema interativo pipelines --json`: lists reusable game, simulation, and hybrid pipelines.
101
107
  - `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.
102
108
  - `sema interativo validar <definition.json> --json`: validates independent kind, spatial model, render mode, visual profile, fidelity, control, time, world, budget, pipeline, and acceptance axes.
103
109
  - `sema interativo planejar <definition.json> --json`: expands compatible stages and required evidence without running an engine.
104
110
  - `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.
105
111
  - `sema interativo validar-protocolo <adapter-run.json> --json`: checks DETECT/PROBE/SNAPSHOT/PLAN/APPLY/VALIDATE/EVIDENCE/ROLLBACK ordering and stable target binding.
106
- - Experience IR: `validar-ir`, `indexar-ir`, `consultar-ir --semantic-id <id>`, `chunk-ir --semantic-id <id> [--raso]`, and `descrever-ir`.
107
- - 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`.
108
- - Temporal, autonomy, and testing: `validar-temporal`, `validar-evidencia-temporal --bundle-arquivo <file>`, `validar-autonomia`, `validar-playtest-fuzz`, and `validar-multiplayer`.
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`.
109
115
  - Portability and workers: `analisar-portabilidade` and `validar-workers`.
110
- - `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.
111
-
112
- 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.
113
116
 
114
- 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.
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.
115
118
 
116
119
  ## Operational
117
120
 
package/docs/database.md CHANGED
@@ -1,15 +1,15 @@
1
- # Database Boundary
2
-
3
- The public Sema CLI does not require a database.
4
-
5
- Sema reads contracts and source files from the local workspace. Any database used
6
- by an application governed by Sema belongs to that application, not to the public
7
- Sema CLI distribution.
8
-
9
- ## Public Rule
10
-
11
- Do not ship private database material, real credentials, operational schemas, or
12
- project-specific data in the public Sema package.
13
-
14
- Application-specific database docs should live in the application repository
15
- that owns the database.
1
+ # Database Boundary
2
+
3
+ The public Sema CLI does not require a database.
4
+
5
+ Sema reads contracts and source files from the local workspace. Any database used
6
+ by an application governed by Sema belongs to that application, not to the public
7
+ Sema CLI distribution.
8
+
9
+ ## Public Rule
10
+
11
+ Do not ship private database material, real credentials, operational schemas, or
12
+ project-specific data in the public Sema package.
13
+
14
+ Application-specific database docs should live in the application repository
15
+ that owns the database.
package/docs/deploy.md CHANGED
@@ -1,41 +1,41 @@
1
- # Deployment Boundary
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.
6
-
7
- Run the complete public gate:
8
-
9
- ```bash
10
- npm run build
11
- npm run codex:sync-entrypoint
12
- npm run status:check
13
- npm run repo:verificar-publico
14
- npm run plugin:testar-codex
15
- npm test
16
- npm run release:verificar-drift
17
- npm run release:preparar-publica
18
- npm run release:publicar-npm-dry-run
19
- ```
20
-
21
- `release:preparar-publica` performs the Codex entrypoint sync before checking
22
- the public boundary, so a clean clone does not depend on ignored generated
23
- handshake files left by a previous local run.
24
-
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.
30
-
31
- Push the commit containing `.agents/plugins/marketplace.json` and
32
- `plugins/sema/` before telling users to install from `gerlanss/Sema`. Publish
33
- the npm package only after the tarball smoke passes. After npm publication, run
34
- `npm run release:verificar-distribuicao` to verify the registry and live GitHub
35
- state. That final verifier also requires the remote GitHub HEAD to match the
36
- local commit, installs `sema@sema` from `gerlanss/Sema` in an isolated
37
- `CODEX_HOME`, compares the remote skill with the versioned source, and proves
38
- that the remote plugin registers no Sema MCP. The current contract does not
39
- permit creating a GitHub Release or release asset.
40
-
41
- Do not publish private or sensitive operational material in this repository.
1
+ # Deployment Boundary
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.
6
+
7
+ Run the complete public gate:
8
+
9
+ ```bash
10
+ npm run build
11
+ npm run codex:sync-entrypoint
12
+ npm run status:check
13
+ npm run repo:verificar-publico
14
+ npm run plugin:testar-codex
15
+ npm test
16
+ npm run release:verificar-drift
17
+ npm run release:preparar-publica
18
+ npm run release:publicar-npm-dry-run
19
+ ```
20
+
21
+ `release:preparar-publica` performs the Codex entrypoint sync before checking
22
+ the public boundary, so a clean clone does not depend on ignored generated
23
+ handshake files left by a previous local run.
24
+
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.
30
+
31
+ Push the commit containing `.agents/plugins/marketplace.json` and
32
+ `plugins/sema/` before telling users to install from `gerlanss/Sema`. Publish
33
+ the npm package only after the tarball smoke passes. After npm publication, run
34
+ `npm run release:verificar-distribuicao` to verify the registry and live GitHub
35
+ state. That final verifier also requires the remote GitHub HEAD to match the
36
+ local commit, installs `sema@sema` from `gerlanss/Sema` in an isolated
37
+ `CODEX_HOME`, compares the remote skill with the versioned source, and proves
38
+ that the remote plugin registers no Sema MCP. The current contract does not
39
+ permit creating a GitHub Release or release asset.
40
+
41
+ Do not publish private or sensitive operational material in this repository.
@@ -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.