@semacode/cli 2.1.0 → 2.3.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 +107 -4
- package/dist/agentContext.d.ts +1 -1
- package/dist/agentContextPack.js +6 -1
- package/dist/agentContextTipos.d.ts +4 -2
- package/dist/agentContextTipos.js +7 -0
- package/dist/agentEntryPoints.js +70 -19
- package/dist/comandos.js +6 -0
- package/dist/discovery/catalog.d.ts +11 -0
- package/dist/discovery/catalog.js +521 -0
- package/dist/discovery/command.d.ts +11 -0
- package/dist/discovery/command.js +226 -0
- package/dist/discovery/index.d.ts +5 -0
- package/dist/discovery/index.js +8 -0
- package/dist/discovery/ranker.d.ts +3 -0
- package/dist/discovery/ranker.js +310 -0
- package/dist/discovery/redaction.d.ts +2 -0
- package/dist/discovery/redaction.js +21 -0
- package/dist/discovery/render.d.ts +2 -0
- package/dist/discovery/render.js +100 -0
- package/dist/discovery/types.d.ts +119 -0
- package/dist/discovery/types.js +13 -0
- package/dist/execucoesExternas.js +19 -5
- package/dist/exemplosOficiais.js +29 -8
- package/dist/iaPrompts.d.ts +1 -1
- package/dist/iaPrompts.js +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +24 -5
- package/dist/index.part01.d.ts +1 -1
- package/dist/index.part01.js +47 -3
- package/dist/index.part06.js +3 -0
- package/dist/initTemplatesBase.js +3 -2
- 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/profileArtefatoValidadores.d.ts +3 -2
- package/dist/profileArtefatoValidadores.js +81 -0
- package/dist/profileAuthorTipos.d.ts +4 -3
- package/dist/profileCatalogo.d.ts +5 -5
- package/dist/profileCatalogo.js +30 -0
- package/dist/profileCommand.d.ts +8 -2
- package/dist/profileCommand.js +15 -5
- package/dist/profileRegras.d.ts +5 -5
- package/dist/profileRegras.js +13 -1
- package/dist/profileRulePacks.js +68 -0
- package/dist/sistemasInterativos/adapterProtocol.d.ts +3 -0
- package/dist/sistemasInterativos/adapterProtocol.js +240 -0
- package/dist/sistemasInterativos/advancedCatalog.d.ts +5 -0
- package/dist/sistemasInterativos/advancedCatalog.js +442 -0
- package/dist/sistemasInterativos/autonomy.d.ts +230 -0
- package/dist/sistemasInterativos/autonomy.js +753 -0
- package/dist/sistemasInterativos/canonical.d.ts +3 -0
- package/dist/sistemasInterativos/canonical.js +43 -0
- package/dist/sistemasInterativos/catalog.d.ts +116 -0
- package/dist/sistemasInterativos/catalog.js +543 -0
- package/dist/sistemasInterativos/command.d.ts +7 -0
- package/dist/sistemasInterativos/command.js +311 -0
- package/dist/sistemasInterativos/controlRun.d.ts +56 -0
- package/dist/sistemasInterativos/controlRun.js +391 -0
- package/dist/sistemasInterativos/evidence.d.ts +5 -0
- package/dist/sistemasInterativos/evidence.js +306 -0
- package/dist/sistemasInterativos/experienceIr.d.ts +12 -0
- package/dist/sistemasInterativos/experienceIr.js +895 -0
- package/dist/sistemasInterativos/experienceIrSemantics.d.ts +30 -0
- package/dist/sistemasInterativos/experienceIrSemantics.js +368 -0
- package/dist/sistemasInterativos/experienceIrTypes.d.ts +370 -0
- package/dist/sistemasInterativos/experienceIrTypes.js +5 -0
- package/dist/sistemasInterativos/extensionCommand.d.ts +391 -0
- package/dist/sistemasInterativos/extensionCommand.js +383 -0
- package/dist/sistemasInterativos/index.d.ts +19 -0
- package/dist/sistemasInterativos/index.js +22 -0
- package/dist/sistemasInterativos/operations.d.ts +40 -0
- package/dist/sistemasInterativos/operations.js +1167 -0
- package/dist/sistemasInterativos/operationsTypes.d.ts +297 -0
- package/dist/sistemasInterativos/operationsTypes.js +11 -0
- package/dist/sistemasInterativos/planner.d.ts +2 -0
- package/dist/sistemasInterativos/planner.js +159 -0
- package/dist/sistemasInterativos/portability.d.ts +164 -0
- package/dist/sistemasInterativos/portability.js +539 -0
- package/dist/sistemasInterativos/render.d.ts +3 -0
- package/dist/sistemasInterativos/render.js +179 -0
- package/dist/sistemasInterativos/temporal.d.ts +183 -0
- package/dist/sistemasInterativos/temporal.js +543 -0
- package/dist/sistemasInterativos/types.d.ts +215 -0
- package/dist/sistemasInterativos/types.js +4 -0
- package/dist/sistemasInterativos/validator.d.ts +2 -0
- package/dist/sistemasInterativos/validator.js +305 -0
- package/docs/README.md +9 -0
- package/docs/ai-integration.md +7 -1
- package/docs/ai-workflow.md +5 -4
- package/docs/commands.md +43 -1
- package/docs/descoberta-capacidades.md +106 -0
- package/docs/documentation.md +11 -2
- package/docs/pipeline-conteudo.md +246 -0
- package/docs/profiles.md +11 -2
- package/docs/sistemas-interativos.md +381 -0
- package/docs/testing.md +11 -2
- 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_simulation.sema +211 -0
- package/exemplos/sistemas-interativos/README.md +100 -0
- package/exemplos/sistemas-interativos/advanced/acceptance-context-evaluate-valid.json +5 -0
- package/exemplos/sistemas-interativos/advanced/acceptance-lock-valid.json +16 -0
- package/exemplos/sistemas-interativos/advanced/asset-provenance-valid.json +32 -0
- package/exemplos/sistemas-interativos/advanced/autonomy-repair-valid.json +93 -0
- package/exemplos/sistemas-interativos/advanced/control-run-definition-valid.json +78 -0
- package/exemplos/sistemas-interativos/advanced/control-run-valid.json +27 -0
- package/exemplos/sistemas-interativos/advanced/distributed-workers-valid.json +79 -0
- package/exemplos/sistemas-interativos/advanced/editor-state-valid.json +42 -0
- package/exemplos/sistemas-interativos/advanced/engine-snapshot-after-valid.json +32 -0
- package/exemplos/sistemas-interativos/advanced/engine-snapshot-before-valid.json +23 -0
- package/exemplos/sistemas-interativos/advanced/job-orchestration-valid.json +39 -0
- package/exemplos/sistemas-interativos/advanced/multimodal-evidence-valid.json +46 -0
- package/exemplos/sistemas-interativos/advanced/multiplayer-authority-valid.json +39 -0
- package/exemplos/sistemas-interativos/advanced/playtest-fuzz-valid.json +37 -0
- package/exemplos/sistemas-interativos/advanced/portability-valid.json +104 -0
- package/exemplos/sistemas-interativos/advanced/temporal-evidence-valid.json +27 -0
- package/exemplos/sistemas-interativos/advanced/temporal-valid.json +118 -0
- package/exemplos/sistemas-interativos/experience-ir-valid.json +459 -0
- package/exemplos/sistemas-interativos/game-2d.json +83 -0
- package/exemplos/sistemas-interativos/game-3d-human.json +81 -0
- package/exemplos/sistemas-interativos/game-pixel-16-bit.json +97 -0
- package/exemplos/sistemas-interativos/game-pixel-8-bit.json +94 -0
- package/exemplos/sistemas-interativos/game-xr-human.json +80 -0
- package/exemplos/sistemas-interativos/hybrid-2-5d.json +108 -0
- package/exemplos/sistemas-interativos/protocol-mutating-rollback-valid.json +75 -0
- package/exemplos/sistemas-interativos/protocol-read-only-valid.json +58 -0
- package/exemplos/sistemas-interativos/simulation-2d-controlled.json +97 -0
- package/exemplos/sistemas-interativos/simulation-3d-calibrated-autonomous.json +141 -0
- package/exemplos/sistemas-interativos/simulation-headless-autonomous-batch.json +112 -0
- package/exemplos/sistemas-interativos/simulation-pixel-16-bit.json +103 -0
- package/exemplos/sistemas-interativos/simulation-text-controlled.json +95 -0
- package/node_modules/@sema/gerador-lua/dist/index.js +78 -4
- package/node_modules/@sema/gerador-lua/dist/index.js.map +1 -1
- package/node_modules/@sema/gerador-php/dist/index.js +8 -0
- package/node_modules/@sema/gerador-php/dist/index.js.map +1 -1
- package/package.json +8 -1
|
@@ -0,0 +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.
|
package/docs/documentation.md
CHANGED
|
@@ -35,5 +35,14 @@ sema finalizar-mudanca \
|
|
|
35
35
|
- Keep commands, file paths, package names, environment variable names, and DSL
|
|
36
36
|
keywords literal.
|
|
37
37
|
- Do not include private or sensitive operational material.
|
|
38
|
-
- Prefer local CLI examples.
|
|
39
|
-
- Point support requests to suporte@otimitare.online.
|
|
38
|
+
- Prefer local CLI examples.
|
|
39
|
+
- Point support requests to suporte@otimitare.online.
|
|
40
|
+
|
|
41
|
+
## Contract Split Plan
|
|
42
|
+
|
|
43
|
+
`contratos/sema/governanca_ia_documentacao.sema` is close to the 500-line
|
|
44
|
+
blocking limit. Before adding another documentation capability, split it by
|
|
45
|
+
responsibility into contracts for required-document resolution, localization,
|
|
46
|
+
and change-finalization evidence. Preserve the existing task names, guarantees,
|
|
47
|
+
implementations, and links; the contracts may continue to govern the same CLI
|
|
48
|
+
files through multiple `vinculos`. Do not create numbered part files.
|
|
@@ -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
|
@@ -21,6 +21,7 @@ When a profile returns `bloqueado: true`, the artifact is not approved.
|
|
|
21
21
|
```bash
|
|
22
22
|
sema profile capabilities --json
|
|
23
23
|
sema profile validar software contratos/example.sema --maturidade production --preset default --json
|
|
24
|
+
sema profile validar simulation contratos/example.sema --maturidade production --preset calibration --json
|
|
24
25
|
sema rule-packs --profile software --json
|
|
25
26
|
```
|
|
26
27
|
|
|
@@ -32,8 +33,8 @@ sema rule-packs --profile software --json
|
|
|
32
33
|
- `legal`: terms, privacy, compliance, risk, and regulated language.
|
|
33
34
|
- `research`: comparisons, uncertainty, evidence, citations, and decisions.
|
|
34
35
|
- `game`: rules, loops, player states, scoring, and playability checks.
|
|
35
|
-
- `
|
|
36
|
-
|
|
36
|
+
- `simulation`: models, assumptions, units, scenarios, calibration, uncertainty,
|
|
37
|
+
deterministic replay, and tolerance evidence.
|
|
37
38
|
- `redacao`: editorial and creative writing, narrative structure, voice,
|
|
38
39
|
clarity, and publication-ready evidence.
|
|
39
40
|
- `propostas`: commercial proposals, scope clarity, deliverables, constraints,
|
|
@@ -43,3 +44,11 @@ sema rule-packs --profile software --json
|
|
|
43
44
|
|
|
44
45
|
Profiles are local CLI checks. They do not create or require external service
|
|
45
46
|
accounts.
|
|
47
|
+
|
|
48
|
+
`author` remains a dedicated workflow under `sema author`; it is not exposed as
|
|
49
|
+
a fake `sema profile validar author` gate. Use `sema descobrir explicar workflow.author`
|
|
50
|
+
to inspect that boundary.
|
|
51
|
+
|
|
52
|
+
The legacy `sema profile capabilities` view lists only profiles accepted by
|
|
53
|
+
`profile validar`; its separate `workflowsEspecializados` field points Author
|
|
54
|
+
to `sema author` without advertising an invalid validation command.
|