@semacode/cli 2.0.1 → 2.2.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/LICENSE +39 -39
- package/README.md +141 -121
- package/dist/agentEntryPoints.js +499 -499
- package/dist/comandos.js +2 -0
- package/dist/doctorCommand.js +28 -0
- package/dist/execucoesExternas.js +19 -5
- package/dist/geracaoCore.js +97 -1
- package/dist/iaPrompts.d.ts +1 -1
- package/dist/iaPrompts.js +307 -307
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.part01.d.ts +1 -1
- package/dist/index.part01.js +14 -4
- package/dist/index.part02.js +21 -21
- package/dist/index.part04.js +96 -96
- package/dist/index.part06.js +1 -1
- package/dist/index.part07.js +35 -24
- package/dist/init/templates.part01.js +393 -393
- package/dist/init/templates.part02.js +189 -189
- package/dist/initTemplatesBackend.js +73 -73
- package/dist/initTemplatesBase.js +81 -81
- package/dist/initTemplatesFlutter.js +137 -137
- package/dist/initTemplatesRuntime.js +350 -350
- package/dist/initTemplatesWeb.js +309 -309
- package/dist/nativeToolchains.d.ts +15 -0
- package/dist/nativeToolchains.js +132 -0
- package/dist/pipelineConteudo/adapters.d.ts +84 -0
- package/dist/pipelineConteudo/adapters.js +449 -0
- package/dist/pipelineConteudo/canonical.d.ts +18 -0
- package/dist/pipelineConteudo/canonical.js +107 -0
- package/dist/pipelineConteudo/command.d.ts +3 -0
- package/dist/pipelineConteudo/command.js +572 -0
- package/dist/pipelineConteudo/index.d.ts +9 -0
- package/dist/pipelineConteudo/index.js +12 -0
- package/dist/pipelineConteudo/ledger.d.ts +68 -0
- package/dist/pipelineConteudo/ledger.js +732 -0
- package/dist/pipelineConteudo/planner.d.ts +12 -0
- package/dist/pipelineConteudo/planner.js +366 -0
- package/dist/pipelineConteudo/projection.d.ts +16 -0
- package/dist/pipelineConteudo/projection.js +57 -0
- package/dist/pipelineConteudo/state.d.ts +23 -0
- package/dist/pipelineConteudo/state.js +615 -0
- package/dist/pipelineConteudo/trust.d.ts +17 -0
- package/dist/pipelineConteudo/trust.js +750 -0
- package/dist/pipelineConteudo/types.d.ts +331 -0
- package/dist/pipelineConteudo/types.js +4 -0
- package/dist/projetoConfig.js +7 -1
- package/dist/projetoResolucao.js +21 -6
- package/dist/sync/index.js +35 -35
- package/docs/README.md +28 -25
- package/docs/ai-onboarding.md +62 -62
- package/docs/ai-workflow.md +1 -1
- package/docs/auth.md +26 -26
- package/docs/cli.md +79 -72
- package/docs/commands.md +1 -1
- package/docs/database.md +15 -15
- package/docs/deploy.md +41 -36
- package/docs/documentation.md +39 -39
- package/docs/env.md +16 -16
- package/docs/frontend.md +41 -41
- package/docs/getting-started.md +57 -57
- package/docs/i18n.md +15 -15
- package/docs/pipeline-conteudo.md +246 -0
- package/docs/profiles.md +45 -43
- package/docs/repositories.md +43 -43
- package/docs/rollback.md +31 -31
- package/docs/security.md +32 -32
- package/docs/support.md +8 -8
- package/docs/syntax.md +1 -1
- package/docs/testing.md +35 -28
- package/docs/vocabulary.md +29 -29
- package/exemplos/agendamento.sema +1 -1
- package/exemplos/assinatura.sema +1 -1
- package/exemplos/auditoria.sema +1 -1
- package/exemplos/autenticacao.sema +1 -1
- package/exemplos/author_obra_comum.sema +1 -1
- package/exemplos/author_tema_sensivel.sema +1 -1
- package/exemplos/automacao.sema +1 -1
- package/exemplos/cadastro_usuario.sema +1 -1
- package/exemplos/calculadora.sema +1 -1
- package/exemplos/crud_simples.sema +1 -1
- package/exemplos/estoque.sema +1 -1
- package/exemplos/exportacao.sema +1 -1
- package/exemplos/fila.sema +1 -1
- package/exemplos/integracao_externa.sema +1 -1
- package/exemplos/multi_tenant.sema +1 -1
- package/exemplos/notificacao.sema +1 -1
- package/exemplos/operacao_estrategia.sema +132 -132
- package/exemplos/operacao_estrategia_discovery.sema +220 -220
- package/exemplos/operacao_estrategia_fluxo.sema +114 -114
- package/exemplos/operacao_estrategia_gates.sema +106 -106
- package/exemplos/operacao_estrategia_quarentena.sema +133 -133
- package/exemplos/operacao_estrategia_rollout.sema +124 -124
- package/exemplos/pagamento.sema +1 -1
- package/exemplos/pagamento_dominio.sema +1 -1
- package/exemplos/pedido.sema +1 -1
- package/exemplos/permissao.sema +1 -1
- package/exemplos/persistencia_vendor_first.sema +1 -1
- package/exemplos/pipeline-conteudo/README.md +44 -0
- package/exemplos/pipeline-conteudo/alvos.json +23 -0
- package/exemplos/pipeline-conteudo/definicao.json +136 -0
- package/exemplos/profile_conversas.sema +165 -165
- package/exemplos/profile_game.sema +1 -1
- package/exemplos/profile_legal.sema +1 -1
- package/exemplos/profile_ops.sema +1 -1
- package/exemplos/profile_research.sema +1 -1
- package/exemplos/profile_software.sema +1 -1
- package/exemplos/profile_workflow_n8n.sema +1 -1
- package/exemplos/relatorio.sema +1 -1
- package/exemplos/replica_analitica_erp.sema +1 -1
- package/exemplos/testes_embutidos.sema +1 -1
- package/exemplos/tratamento_erro.sema +1 -1
- package/exemplos/upload_arquivo.sema +1 -1
- package/exemplos/webhook.sema +1 -1
- package/node_modules/@sema/gerador-cpp/dist/index.d.ts +3 -0
- package/node_modules/@sema/gerador-cpp/dist/index.js +859 -0
- package/node_modules/@sema/gerador-cpp/dist/index.js.map +1 -0
- package/node_modules/@sema/gerador-cpp/package.json +7 -0
- package/node_modules/@sema/gerador-css/dist/index.part01.js +10 -10
- package/node_modules/@sema/gerador-css/dist/index.part02.js +460 -460
- package/node_modules/@sema/gerador-dotnet/dist/index.d.ts +3 -0
- package/node_modules/@sema/gerador-dotnet/dist/index.js +828 -0
- package/node_modules/@sema/gerador-dotnet/dist/index.js.map +1 -0
- package/node_modules/@sema/gerador-dotnet/package.json +7 -0
- package/node_modules/@sema/gerador-html/dist/index.js +17 -17
- package/node_modules/@sema/gerador-lua/dist/index.js +53 -8
- package/node_modules/@sema/gerador-lua/dist/index.js.map +1 -1
- package/node_modules/@sema/gerador-php/dist/index.js +121 -113
- package/node_modules/@sema/gerador-php/dist/index.js.map +1 -1
- package/node_modules/@sema/gerador-python/dist/index.part02.js +3 -3
- package/node_modules/@sema/gerador-typescript/dist/index.part02.js +11 -11
- package/node_modules/@sema/nucleo/dist/diagnosticos/melhorador.js +42 -42
- package/node_modules/@sema/padroes/dist/index.d.ts +1 -1
- package/package.json +12 -1
package/docs/i18n.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Language And Identifiers
|
|
2
|
-
|
|
3
|
-
Public Sema documentation is English.
|
|
4
|
-
|
|
5
|
-
Do not translate commands, file paths, package names, endpoint paths, environment
|
|
6
|
-
variable names, code symbols, DSL keywords, or brand names.
|
|
7
|
-
|
|
8
|
-
Examples:
|
|
9
|
-
|
|
10
|
-
- Keep `sema validar`, not an English paraphrase.
|
|
11
|
-
- Keep `.sema`, `task`, `input`, `output`, `rules`, `effects`, and `guarantees`.
|
|
12
|
-
- Keep package names such as `@semacode/cli`.
|
|
13
|
-
|
|
14
|
-
Human-facing prose should be clear English. Contract DSL can keep its own
|
|
15
|
-
keywords and domain identifiers.
|
|
1
|
+
# Language And Identifiers
|
|
2
|
+
|
|
3
|
+
Public Sema documentation is English.
|
|
4
|
+
|
|
5
|
+
Do not translate commands, file paths, package names, endpoint paths, environment
|
|
6
|
+
variable names, code symbols, DSL keywords, or brand names.
|
|
7
|
+
|
|
8
|
+
Examples:
|
|
9
|
+
|
|
10
|
+
- Keep `sema validar`, not an English paraphrase.
|
|
11
|
+
- Keep `.sema`, `task`, `input`, `output`, `rules`, `effects`, and `guarantees`.
|
|
12
|
+
- Keep package names such as `@semacode/cli`.
|
|
13
|
+
|
|
14
|
+
Human-facing prose should be clear English. Contract DSL can keep its own
|
|
15
|
+
keywords and domain identifiers.
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# AI-native Content Pipeline
|
|
2
|
+
|
|
3
|
+
Sema Content Pipeline is a contract-first control plane for creating content
|
|
4
|
+
with AI agents across arbitrary destinations and formats. It plans work,
|
|
5
|
+
verifies signed evidence, evaluates policy, derives canonical state, and tells
|
|
6
|
+
an external runner what can happen next. It does not execute agents, call
|
|
7
|
+
creative tools, publish content, or provide a native human-review path.
|
|
8
|
+
|
|
9
|
+
Brands, channels, accounts, and formats are configuration. They are never
|
|
10
|
+
closed enums in the pipeline core. A video channel, a site, a newsletter, an
|
|
11
|
+
RSS feed, or a future destination all use the same target and adapter model.
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
.sema contracts, target set, and signed policy
|
|
17
|
+
-> Sema creates a declarative plan
|
|
18
|
+
-> external runner invokes producer agents and tools
|
|
19
|
+
-> producers submit signed claims and immutable artifacts
|
|
20
|
+
-> independent adapters/verifiers attest observable facts
|
|
21
|
+
-> specialized AI evaluators submit signed semantic assessments
|
|
22
|
+
-> Sema verifies identity, scope, independence, quorum, and deterministic rules
|
|
23
|
+
-> state is replayed from the canonical ledger
|
|
24
|
+
-> the external runner receives nextActions
|
|
25
|
+
-> manifests and dashboards are regenerated projections
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Existing Author, research, writing, copy, image, video, creative-QA, and
|
|
29
|
+
publication profiles are optional capabilities used by a pipeline definition.
|
|
30
|
+
They are not the pipeline state machine and they do not become universal
|
|
31
|
+
requirements for every kind of content.
|
|
32
|
+
|
|
33
|
+
## Trust boundary
|
|
34
|
+
|
|
35
|
+
A hash proves the identity and integrity of bytes. It does not prove that a
|
|
36
|
+
claim is true. A JSON receipt produced by the runner therefore remains a claim.
|
|
37
|
+
It becomes accepted evidence only when an authorized, independent principal
|
|
38
|
+
attests it with an Ed25519 signature and the attestation matches the exact run,
|
|
39
|
+
artifact digest, target, evidence type, policy, and validity window.
|
|
40
|
+
|
|
41
|
+
The trust configuration accepts only Ed25519 SPKI public material
|
|
42
|
+
(`-----BEGIN PUBLIC KEY-----`). PKCS#8 private PEM is rejected even though the
|
|
43
|
+
crypto runtime could derive a public key from it. Private keys must stay in the
|
|
44
|
+
producer, evaluator, adapter, or independent verification service that owns
|
|
45
|
+
them. If the executor controls every private key and the canonical store, the
|
|
46
|
+
signatures provide no meaningful separation.
|
|
47
|
+
|
|
48
|
+
For high assurance, keep trust anchors outside the runner workspace and store
|
|
49
|
+
the ledger in an independently controlled append-only service, WORM store, or
|
|
50
|
+
transparency log. Every trusted operation requires a canonical trust-root digest
|
|
51
|
+
retained by that external boundary; reading `trust.json` and trusting a digest
|
|
52
|
+
from the same file would merely let the executor nominate its own authority.
|
|
53
|
+
|
|
54
|
+
The signed policy is bound to the exact execution, pipeline definition, trust
|
|
55
|
+
root, ledger, and complete target set through `runId`, `definitionDigest`,
|
|
56
|
+
`trustRootDigest`, `ledgerId`, and `targetSetDigest`. Its `issuedAt` and
|
|
57
|
+
`expiresAt` define the complete authorization window: the trusted `recordedAt`
|
|
58
|
+
of `RUN_STARTED` must satisfy the configured maximum envelope age, and every
|
|
59
|
+
event must be recorded inclusively between those policy bounds. Once
|
|
60
|
+
`expiresAt` passes, the policy cannot authorize another append. It cannot be
|
|
61
|
+
replayed as authorization for another run, and a controller cannot silently
|
|
62
|
+
remove a channel to make a run appear complete.
|
|
63
|
+
|
|
64
|
+
The trust-root digest and revocation digest are separate external pins. The
|
|
65
|
+
trust root identifies the immutable authority set and its verification rules;
|
|
66
|
+
`revocationDigest` identifies the current revocation overlay. Rotating that
|
|
67
|
+
overlay must not redefine historical signatures, while revoked credentials no
|
|
68
|
+
longer count as active evidence, authorization, or quorum.
|
|
69
|
+
An authority key in the current revocation overlay cannot authorize a policy;
|
|
70
|
+
historical ledger verification remains a separate operation.
|
|
71
|
+
|
|
72
|
+
Public-key fingerprints, principal IDs, and key IDs must be unique, so one key
|
|
73
|
+
cannot masquerade as several independent voters.
|
|
74
|
+
|
|
75
|
+
The local file backend is useful for development and portable replay, but it is
|
|
76
|
+
not advertised as a strong append-only root. A trusted external checkpoint
|
|
77
|
+
(`expectedHead`) is required on ledger reads and writes to detect a truncated
|
|
78
|
+
or concurrently replaced local ledger. A trust file
|
|
79
|
+
inside the current workspace is rejected unless
|
|
80
|
+
`--development-local-trust` is explicit; that flag relaxes file placement only
|
|
81
|
+
and never removes digest pinning.
|
|
82
|
+
|
|
83
|
+
## Evidence and semantic evaluation
|
|
84
|
+
|
|
85
|
+
The pipeline separates three things:
|
|
86
|
+
|
|
87
|
+
- a producer or runner claim (`EVIDENCE_CLAIMED`);
|
|
88
|
+
- an independently signed observation (`EVIDENCE_ATTESTED`);
|
|
89
|
+
- a specialized AI assessment (`AI_ASSESSMENT`).
|
|
90
|
+
|
|
91
|
+
Sema evaluates deterministic constraints directly. Artifact metadata and
|
|
92
|
+
producer claims never prove those constraints by themselves: observable facts
|
|
93
|
+
must come from independently signed adapter/verifier observations bound to the
|
|
94
|
+
artifact digest, run, target, policy, and trust context. This includes
|
|
95
|
+
`observedMediaType`, obtained through independent sniffing; an artifact's
|
|
96
|
+
producer-declared `mediaType` cannot satisfy adapter acceptance on its own.
|
|
97
|
+
Semantic questions such as
|
|
98
|
+
factual quality, narrative quality, channel fit, brand voice, accessibility,
|
|
99
|
+
or audiovisual coherence require assessments from principals with the declared
|
|
100
|
+
capability. Sema verifies those assessments against policy; it does not invent
|
|
101
|
+
their semantic judgment.
|
|
102
|
+
|
|
103
|
+
Critical gates can require multiple approvals, distinct principals, distinct
|
|
104
|
+
control domains, and producer/evaluator separation. Deterministic attestations
|
|
105
|
+
use `minAttestationsPerEvidence` and
|
|
106
|
+
`minDistinctAttesterControlDomains` for every required evidence type; semantic
|
|
107
|
+
AI opinions use `minApprovals` and `minDistinctControlDomains`. Multiple agent
|
|
108
|
+
names under one credential or control domain do not create an independent
|
|
109
|
+
quorum.
|
|
110
|
+
Every gate that contributes to canonical completion must set
|
|
111
|
+
`producerDisjoint: true`; self-approval cannot be configured as a completion
|
|
112
|
+
shortcut.
|
|
113
|
+
|
|
114
|
+
A generic `content.evidence.attest` capability never authorizes evidence. Base
|
|
115
|
+
evidence requires `content.evidence.attest:<evidenceType>`. Adapter evidence is
|
|
116
|
+
stricter: the externally pinned trust root must grant
|
|
117
|
+
`content.adapter.attest:<adapterId>@<version>:<evidenceType>`, and the signed
|
|
118
|
+
data must name the exact adapter and version. Delivery confirmation also carries
|
|
119
|
+
an `observationDigest`; it is not a bare success receipt from the runner.
|
|
120
|
+
|
|
121
|
+
## Canonical state
|
|
122
|
+
|
|
123
|
+
Ledger events are hash-chained and carry signed envelopes. The state engine
|
|
124
|
+
replays the ledger deterministically. It never reads `concluido`, `approved`, or
|
|
125
|
+
similar fields from a hand-edited manifest.
|
|
126
|
+
|
|
127
|
+
Event and envelope wrappers are exact schemas: unsigned extra fields are
|
|
128
|
+
rejected. Every append requires the signed policy envelope and a complete
|
|
129
|
+
expected context derived from it. The genesis event is anchored to the
|
|
130
|
+
externally pinned trust domain, trust root, ledger ID, policy, definition, and
|
|
131
|
+
complete target set; none of those values are accepted merely because
|
|
132
|
+
`RUN_STARTED` declared them. During append, envelope freshness is measured
|
|
133
|
+
against the platform clock; caller-controlled `recordedAt` cannot backdate an
|
|
134
|
+
expired signature.
|
|
135
|
+
|
|
136
|
+
Gate verdicts are independent from operational conditions:
|
|
137
|
+
|
|
138
|
+
- verdict: `NAO_AVALIADO`, `APROVADO`, `REPROVADO`, `INCONCLUSIVO`;
|
|
139
|
+
- condition: `PENDENTE`, `PRONTA`, `EXECUTANDO`,
|
|
140
|
+
`AGUARDANDO_EVIDENCIA`, `AGUARDANDO_EVENTO_EXTERNO`,
|
|
141
|
+
`FERRAMENTA_INDISPONIVEL`, `CAPACIDADE_AUSENTE`,
|
|
142
|
+
`AUTORIZACAO_AUSENTE`, `FALHA_TRANSITORIA`, `FALHA_TERMINAL`, or
|
|
143
|
+
`EXECUCAO_ENCERRADA`.
|
|
144
|
+
|
|
145
|
+
For example, a content-quality gate may be `APROVADO` while a publication gate
|
|
146
|
+
is `NAO_AVALIADO` and its operational condition is
|
|
147
|
+
`AGUARDANDO_EVENTO_EXTERNO`. Tool unavailability never approves or rejects a
|
|
148
|
+
gate. Missing semantic capacity becomes `CAPACIDADE_AUSENTE`; the runner can
|
|
149
|
+
route the task to another authorized AI evaluator.
|
|
150
|
+
|
|
151
|
+
Changing an artifact creates a new digest. Evidence and assessments bound to
|
|
152
|
+
the previous digest become superseded for gate calculation. Targets also evolve
|
|
153
|
+
independently: failure for one destination does not invalidate another.
|
|
154
|
+
|
|
155
|
+
Every generated manifest declares:
|
|
156
|
+
|
|
157
|
+
```json
|
|
158
|
+
{
|
|
159
|
+
"authoritative": false,
|
|
160
|
+
"ledgerHead": "sha256:..."
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
It is a read model, not an input to canonical state.
|
|
165
|
+
|
|
166
|
+
The isolated gate calculator is internal. The public authoritative surface is
|
|
167
|
+
canonical state derivation after the ledger replay has independently derived
|
|
168
|
+
the producer, authorization scope, target, and complete producer lineage.
|
|
169
|
+
The npm package exposes only its root entrypoint; `dist/pipelineConteudo/*`
|
|
170
|
+
deep imports are blocked by the package `exports` map, including in the
|
|
171
|
+
generated public tarball.
|
|
172
|
+
|
|
173
|
+
## Open adapters and targets
|
|
174
|
+
|
|
175
|
+
An adapter declares an opaque `adapterId`, immutable version, accepted media
|
|
176
|
+
types, format profiles, deterministic constraints, required public metadata,
|
|
177
|
+
optional public metadata, and externally verifiable confirmation predicates.
|
|
178
|
+
`requiredMetadata + optionalMetadata` is the exact top-level allowlist signed
|
|
179
|
+
through the definition digest. Target metadata accepts only declared keys and
|
|
180
|
+
scalar public values. `accountScope` is a strict `account:<alias>` reference;
|
|
181
|
+
credentials and tokens remain outside the ledger and are resolved by the
|
|
182
|
+
external runner from that alias. Artifact metadata is prohibited in v1 until a
|
|
183
|
+
separate signed schema exists. Recursive DLP checks additionally reject common
|
|
184
|
+
secret key names, private-key material, JWTs, provider-token prefixes, and
|
|
185
|
+
authorization headers without echoing the detected value.
|
|
186
|
+
Deterministic-constraint configuration has an exact one-field numeric schema;
|
|
187
|
+
extra, ambiguous, or sensitive fields block the adapter before its constraints
|
|
188
|
+
can be copied into a public plan. Free-form operational `reason` text passes
|
|
189
|
+
the same credential detector before it can enter the signed ledger.
|
|
190
|
+
|
|
191
|
+
Public CLI failures expose static error codes and a sanitized command label;
|
|
192
|
+
filesystem exceptions, unknown subcommands, rejected schema field names, and
|
|
193
|
+
invalid trust identifiers are not echoed. Domain identifiers that belong to a
|
|
194
|
+
valid definition or signed ledger (such as stage, target, evidence, and
|
|
195
|
+
assessment IDs) remain public because they are required for planning,
|
|
196
|
+
traceability, and remediation; they are never credential storage.
|
|
197
|
+
|
|
198
|
+
Each stage declares an `adapterPolicy`:
|
|
199
|
+
|
|
200
|
+
- `NONE`: no adapter gate is introduced by the stage;
|
|
201
|
+
- `CONSTRAINTS`: require independently signed observations for the adapter's
|
|
202
|
+
deterministic format constraints;
|
|
203
|
+
- `CONFIRMATION`: require the target adapter's externally verifiable
|
|
204
|
+
confirmation predicates.
|
|
205
|
+
|
|
206
|
+
Pipeline definition v1 requires exactly one declared output per stage. A stage
|
|
207
|
+
that needs several artifacts must split them into semantically distinct stages,
|
|
208
|
+
preserving explicit lineage and dependency edges.
|
|
209
|
+
|
|
210
|
+
No platform literal is required by the core. A project-specific experience is
|
|
211
|
+
just a pipeline definition plus target configuration and can coexist with any
|
|
212
|
+
number of other channels and formats.
|
|
213
|
+
|
|
214
|
+
## CLI
|
|
215
|
+
|
|
216
|
+
The public surface is `sema conteudo`:
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
sema conteudo capabilities --json
|
|
220
|
+
sema conteudo validar <definition.json> --json
|
|
221
|
+
sema conteudo planejar <definition.json> --alvos-arquivo <targets.json> --json
|
|
222
|
+
sema conteudo validar-envelope --envelope-arquivo <envelope.json> --confianca-arquivo <trust.json> --trust-root-digest <sha256:...> --revocation-digest <sha256:...> --payload-type <type> --json
|
|
223
|
+
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
|
|
224
|
+
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
|
|
225
|
+
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
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
`--trust-root-digest` and `--revocation-digest` may also come from the
|
|
229
|
+
externally controlled `SEMA_CONTENT_TRUST_ROOT_DIGEST` and
|
|
230
|
+
`SEMA_CONTENT_REVOCATION_DIGEST` environment variables. If a value is present
|
|
231
|
+
in both sources, the values must match. `registrar`, `status`, and `projetar` also require the
|
|
232
|
+
externally retained `expectedHead`, including the genesis head for a new
|
|
233
|
+
ledger. This protects against stale concurrent append and detects truncation;
|
|
234
|
+
it does not turn a runner-controlled file into protected storage.
|
|
235
|
+
|
|
236
|
+
## External runner protocol
|
|
237
|
+
|
|
238
|
+
The runner may schedule, execute, retry, resume, and request more AI capacity.
|
|
239
|
+
It may submit signed envelopes and report operational conditions. It may not
|
|
240
|
+
write calculated verdicts, mark an execution complete, edit canonical history,
|
|
241
|
+
or promote its own claim to accepted evidence.
|
|
242
|
+
|
|
243
|
+
The runner advances only from `nextActions` derived by Sema. There is no native
|
|
244
|
+
human-approval transition. Organizations may build an external policy adapter
|
|
245
|
+
for human input if they need one, but that is outside this AI-native pipeline
|
|
246
|
+
and never a hidden fallback.
|
package/docs/profiles.md
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
# Profiles
|
|
2
|
-
|
|
3
|
-
Profiles are local validation layers for domains where syntax alone is not
|
|
4
|
-
enough. They use the same `.sema` DSL and do not create a second language.
|
|
5
|
-
|
|
6
|
-
## Principle
|
|
7
|
-
|
|
8
|
-
A profile checks whether a contract is strong enough for a specific kind of
|
|
9
|
-
work. It can require:
|
|
10
|
-
|
|
11
|
-
- contract-first workflow;
|
|
12
|
-
- domain core fields;
|
|
13
|
-
- required rules, effects, guarantees, and tests;
|
|
14
|
-
- explicit forbidden behavior;
|
|
15
|
-
- evidence before closing the change.
|
|
16
|
-
|
|
17
|
-
When a profile returns `bloqueado: true`, the artifact is not approved.
|
|
18
|
-
|
|
19
|
-
## Commands
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
sema profile capabilities --json
|
|
23
|
-
sema profile validar software contratos/example.sema --maturidade production --preset default --json
|
|
24
|
-
sema rule-packs --profile software --json
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Built-In Profiles
|
|
28
|
-
|
|
29
|
-
- `software`: code, APIs, modules, refactors, persistence, and generated output.
|
|
30
|
-
- `workflow`: automations, queues, webhooks, scheduled jobs, and orchestration.
|
|
31
|
-
- `ops`: deploy plans, rollback, incidents, runbooks, and operational evidence.
|
|
32
|
-
- `legal`: terms, privacy, compliance, risk, and regulated language.
|
|
33
|
-
- `research`: comparisons, uncertainty, evidence, citations, and decisions.
|
|
34
|
-
- `game`: rules, loops, player states, scoring, and playability checks.
|
|
35
|
-
- `author`: creative writing, narrative continuity, cliche review, and style
|
|
36
|
-
guardrails.
|
|
37
|
-
- `
|
|
38
|
-
and
|
|
39
|
-
- `
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
# Profiles
|
|
2
|
+
|
|
3
|
+
Profiles are local validation layers for domains where syntax alone is not
|
|
4
|
+
enough. They use the same `.sema` DSL and do not create a second language.
|
|
5
|
+
|
|
6
|
+
## Principle
|
|
7
|
+
|
|
8
|
+
A profile checks whether a contract is strong enough for a specific kind of
|
|
9
|
+
work. It can require:
|
|
10
|
+
|
|
11
|
+
- contract-first workflow;
|
|
12
|
+
- domain core fields;
|
|
13
|
+
- required rules, effects, guarantees, and tests;
|
|
14
|
+
- explicit forbidden behavior;
|
|
15
|
+
- evidence before closing the change.
|
|
16
|
+
|
|
17
|
+
When a profile returns `bloqueado: true`, the artifact is not approved.
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
sema profile capabilities --json
|
|
23
|
+
sema profile validar software contratos/example.sema --maturidade production --preset default --json
|
|
24
|
+
sema rule-packs --profile software --json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Built-In Profiles
|
|
28
|
+
|
|
29
|
+
- `software`: code, APIs, modules, refactors, persistence, and generated output.
|
|
30
|
+
- `workflow`: automations, queues, webhooks, scheduled jobs, and orchestration.
|
|
31
|
+
- `ops`: deploy plans, rollback, incidents, runbooks, and operational evidence.
|
|
32
|
+
- `legal`: terms, privacy, compliance, risk, and regulated language.
|
|
33
|
+
- `research`: comparisons, uncertainty, evidence, citations, and decisions.
|
|
34
|
+
- `game`: rules, loops, player states, scoring, and playability checks.
|
|
35
|
+
- `author`: creative writing, narrative continuity, cliche review, and style
|
|
36
|
+
guardrails.
|
|
37
|
+
- `redacao`: editorial and creative writing, narrative structure, voice,
|
|
38
|
+
clarity, and publication-ready evidence.
|
|
39
|
+
- `propostas`: commercial proposals, scope clarity, deliverables, constraints,
|
|
40
|
+
and client-ready wording.
|
|
41
|
+
- `conversas`: customer conversation guardrails, escalation, pricing promises,
|
|
42
|
+
and channel changes.
|
|
43
|
+
|
|
44
|
+
Profiles are local CLI checks. They do not create or require external service
|
|
45
|
+
accounts.
|
package/docs/repositories.md
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
# Repository Boundary
|
|
2
|
-
|
|
3
|
-
The public Sema repository should contain only the Codex-native local CLI, the
|
|
4
|
-
first-contact Codex skill, runtime packages, examples, tests that run locally,
|
|
5
|
-
and English documentation.
|
|
6
|
-
|
|
7
|
-
## Public
|
|
8
|
-
|
|
9
|
-
- local CLI source
|
|
10
|
-
- contract parser and validators
|
|
11
|
-
- local drift and impact tooling
|
|
12
|
-
- local code generators
|
|
13
|
-
- examples
|
|
14
|
-
- English docs
|
|
15
|
-
- local package scripts
|
|
16
|
-
- `AGENTS.md` as the official Codex entrypoint
|
|
17
|
-
- the official Sema skill as a thin bootstrap before `AGENTS.md` exists
|
|
18
|
-
- the repo marketplace that installs that skill explicitly
|
|
19
|
-
|
|
20
|
-
## Not Public
|
|
21
|
-
|
|
22
|
-
- private or sensitive operational material
|
|
23
|
-
- real credentials, environment files, or secret inventories
|
|
24
|
-
- private project data or generated private artifacts
|
|
25
|
-
- runtime authorization, activation, billing, credit, token, or panel gates
|
|
26
|
-
- product-specific entrypoint files for AI clients other than Codex
|
|
27
|
-
- MCP servers, remote workspace bridges, or duplicated governance inside the
|
|
28
|
-
bootstrap skill
|
|
29
|
-
|
|
30
|
-
The CLI must run directly against the local workspace without login, user
|
|
31
|
-
authorization, a product-license check, activation key, credits, token, billing
|
|
32
|
-
service, or control panel.
|
|
33
|
-
|
|
34
|
-
Sema is an independent product and is not affiliated with or endorsed by
|
|
35
|
-
OpenAI. Codex-native is Sema's official product direction, not an official
|
|
36
|
-
OpenAI program or submission.
|
|
37
|
-
|
|
38
|
-
## Commercial Use
|
|
39
|
-
|
|
40
|
-
The public Sema source may not be copied, rebranded, bundled, or replicated for
|
|
41
|
-
commercial resale without written permission from OtimiTare.
|
|
42
|
-
|
|
43
|
-
Support: suporte@otimitare.online
|
|
1
|
+
# Repository Boundary
|
|
2
|
+
|
|
3
|
+
The public Sema repository should contain only the Codex-native local CLI, the
|
|
4
|
+
first-contact Codex skill, runtime packages, examples, tests that run locally,
|
|
5
|
+
and English documentation.
|
|
6
|
+
|
|
7
|
+
## Public
|
|
8
|
+
|
|
9
|
+
- local CLI source
|
|
10
|
+
- contract parser and validators
|
|
11
|
+
- local drift and impact tooling
|
|
12
|
+
- local code generators
|
|
13
|
+
- examples
|
|
14
|
+
- English docs
|
|
15
|
+
- local package scripts
|
|
16
|
+
- `AGENTS.md` as the official Codex entrypoint
|
|
17
|
+
- the official Sema skill as a thin bootstrap before `AGENTS.md` exists
|
|
18
|
+
- the repo marketplace that installs that skill explicitly
|
|
19
|
+
|
|
20
|
+
## Not Public
|
|
21
|
+
|
|
22
|
+
- private or sensitive operational material
|
|
23
|
+
- real credentials, environment files, or secret inventories
|
|
24
|
+
- private project data or generated private artifacts
|
|
25
|
+
- runtime authorization, activation, billing, credit, token, or panel gates
|
|
26
|
+
- product-specific entrypoint files for AI clients other than Codex
|
|
27
|
+
- MCP servers, remote workspace bridges, or duplicated governance inside the
|
|
28
|
+
bootstrap skill
|
|
29
|
+
|
|
30
|
+
The CLI must run directly against the local workspace without login, user
|
|
31
|
+
authorization, a product-license check, activation key, credits, token, billing
|
|
32
|
+
service, or control panel.
|
|
33
|
+
|
|
34
|
+
Sema is an independent product and is not affiliated with or endorsed by
|
|
35
|
+
OpenAI. Codex-native is Sema's official product direction, not an official
|
|
36
|
+
OpenAI program or submission.
|
|
37
|
+
|
|
38
|
+
## Commercial Use
|
|
39
|
+
|
|
40
|
+
The public Sema source may not be copied, rebranded, bundled, or replicated for
|
|
41
|
+
commercial resale without written permission from OtimiTare.
|
|
42
|
+
|
|
43
|
+
Support: suporte@otimitare.online
|
package/docs/rollback.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
# Rollback Boundary
|
|
2
|
-
|
|
3
|
-
Public rollback covers both the npm CLI and the separately installed Codex
|
|
4
|
-
bootstrap skill.
|
|
5
|
-
|
|
6
|
-
For a failed pre-publication candidate:
|
|
7
|
-
|
|
8
|
-
1. Keep the previous tarball until the new one passes smoke tests.
|
|
9
|
-
2. Revert the plugin source, marketplace manifest, CLI source, and versions to
|
|
10
|
-
the last known-good commit.
|
|
11
|
-
3. Re-run `npm run release:preparar-publica`.
|
|
12
|
-
|
|
13
|
-
If a bad commit was already pushed, revert it with a normal Git revert and push
|
|
14
|
-
the corrective commit. Refresh the marketplace and reinstall the skill:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
codex plugin marketplace upgrade sema
|
|
18
|
-
codex plugin remove sema@sema
|
|
19
|
-
codex plugin add sema@sema
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Open a new Codex task before validating the reinstalled skill. Already-open
|
|
23
|
-
tasks keep the plugin/skill catalog they started with.
|
|
24
|
-
|
|
25
|
-
If a bad npm version was published, do not overwrite it. Publish a corrected
|
|
26
|
-
version and direct users to that version. Verify the final registry/GitHub state
|
|
27
|
-
with `npm run release:verificar-distribuicao`. Do not create a GitHub Release or
|
|
28
|
-
asset as a rollback shortcut while the release contract blocks that surface.
|
|
29
|
-
|
|
30
|
-
Do not publish private or sensitive operational rollback material in this
|
|
31
|
-
repository.
|
|
1
|
+
# Rollback Boundary
|
|
2
|
+
|
|
3
|
+
Public rollback covers both the npm CLI and the separately installed Codex
|
|
4
|
+
bootstrap skill.
|
|
5
|
+
|
|
6
|
+
For a failed pre-publication candidate:
|
|
7
|
+
|
|
8
|
+
1. Keep the previous tarball until the new one passes smoke tests.
|
|
9
|
+
2. Revert the plugin source, marketplace manifest, CLI source, and versions to
|
|
10
|
+
the last known-good commit.
|
|
11
|
+
3. Re-run `npm run release:preparar-publica`.
|
|
12
|
+
|
|
13
|
+
If a bad commit was already pushed, revert it with a normal Git revert and push
|
|
14
|
+
the corrective commit. Refresh the marketplace and reinstall the skill:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
codex plugin marketplace upgrade sema
|
|
18
|
+
codex plugin remove sema@sema
|
|
19
|
+
codex plugin add sema@sema
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Open a new Codex task before validating the reinstalled skill. Already-open
|
|
23
|
+
tasks keep the plugin/skill catalog they started with.
|
|
24
|
+
|
|
25
|
+
If a bad npm version was published, do not overwrite it. Publish a corrected
|
|
26
|
+
version and direct users to that version. Verify the final registry/GitHub state
|
|
27
|
+
with `npm run release:verificar-distribuicao`. Do not create a GitHub Release or
|
|
28
|
+
asset as a rollback shortcut while the release contract blocks that surface.
|
|
29
|
+
|
|
30
|
+
Do not publish private or sensitive operational rollback material in this
|
|
31
|
+
repository.
|
package/docs/security.md
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
# Security
|
|
2
|
-
|
|
3
|
-
The public Sema repository must not contain private or sensitive operational
|
|
4
|
-
material.
|
|
5
|
-
|
|
6
|
-
Local Sema execution does not need a credential, login, activation key, license
|
|
7
|
-
token, billing token, or control-panel session. Do not introduce one as a
|
|
8
|
-
condition for reading or governing a local workspace.
|
|
9
|
-
|
|
10
|
-
The official Codex bootstrap skill contains instructions only. It must not
|
|
11
|
-
bundle an MCP server, app connector, remote workspace bridge, credential flow,
|
|
12
|
-
or a second copy of the repository governance that belongs in `AGENTS.md`.
|
|
13
|
-
|
|
14
|
-
Do not publish:
|
|
15
|
-
|
|
16
|
-
- real credentials or secret material;
|
|
17
|
-
- private data or internal operational artifacts.
|
|
18
|
-
|
|
19
|
-
Placeholder examples are allowed:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
EXAMPLE_KEY=replace-me
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
If a real credential is exposed in code, docs, logs, screenshots, packages, or
|
|
26
|
-
Git history:
|
|
27
|
-
|
|
28
|
-
1. Rotate it immediately.
|
|
29
|
-
2. Remove it from the affected artifact.
|
|
30
|
-
3. Rebuild and rescan before publishing.
|
|
31
|
-
|
|
32
|
-
Official support: suporte@otimitare.online
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
The public Sema repository must not contain private or sensitive operational
|
|
4
|
+
material.
|
|
5
|
+
|
|
6
|
+
Local Sema execution does not need a credential, login, activation key, license
|
|
7
|
+
token, billing token, or control-panel session. Do not introduce one as a
|
|
8
|
+
condition for reading or governing a local workspace.
|
|
9
|
+
|
|
10
|
+
The official Codex bootstrap skill contains instructions only. It must not
|
|
11
|
+
bundle an MCP server, app connector, remote workspace bridge, credential flow,
|
|
12
|
+
or a second copy of the repository governance that belongs in `AGENTS.md`.
|
|
13
|
+
|
|
14
|
+
Do not publish:
|
|
15
|
+
|
|
16
|
+
- real credentials or secret material;
|
|
17
|
+
- private data or internal operational artifacts.
|
|
18
|
+
|
|
19
|
+
Placeholder examples are allowed:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
EXAMPLE_KEY=replace-me
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If a real credential is exposed in code, docs, logs, screenshots, packages, or
|
|
26
|
+
Git history:
|
|
27
|
+
|
|
28
|
+
1. Rotate it immediately.
|
|
29
|
+
2. Remove it from the affected artifact.
|
|
30
|
+
3. Rebuild and rescan before publishing.
|
|
31
|
+
|
|
32
|
+
Official support: suporte@otimitare.online
|
package/docs/support.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Support
|
|
2
|
-
|
|
3
|
-
Official Sema support email: suporte@otimitare.online
|
|
4
|
-
|
|
5
|
-
OtimiTare website: https://otimitare.online
|
|
6
|
-
|
|
7
|
-
Do not publish private or sensitive support routing material in the public Sema
|
|
8
|
-
repository.
|
|
1
|
+
# Support
|
|
2
|
+
|
|
3
|
+
Official Sema support email: suporte@otimitare.online
|
|
4
|
+
|
|
5
|
+
OtimiTare website: https://otimitare.online
|
|
6
|
+
|
|
7
|
+
Do not publish private or sensitive support routing material in the public Sema
|
|
8
|
+
repository.
|
package/docs/syntax.md
CHANGED
|
@@ -110,7 +110,7 @@ The CLI supports JavaScript generation:
|
|
|
110
110
|
sema compilar contratos/orders.sema --alvo javascript --saida ./generated/javascript
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
The project can also generate TypeScript, Python, PHP, Dart, Lua, HTML, and
|
|
113
|
+
The project can also generate TypeScript, Python, PHP, Dart, Lua, HTML, CSS, C#/.NET (`dotnet`), and C++ (`cpp`) when those targets are enabled in `sema.config.json`.
|
|
114
114
|
|
|
115
115
|
## Support Files
|
|
116
116
|
|