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