@semacode/cli 2.3.1 → 3.0.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 +567 -557
- 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/drift.part01.d.ts +26 -24
- package/dist/drift.part01.js +2 -1
- package/dist/drift.part04.d.ts +12 -3
- package/dist/drift.part04.js +88 -17
- 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.part11.js +238 -56
- 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 +21 -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/geracaoCore.js +4 -6
- package/dist/iaPrompts.d.ts +3 -3
- package/dist/iaPrompts.js +312 -313
- 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 +142 -120
- package/dist/index.part05.js +80 -78
- package/dist/index.part06.js +34 -17
- package/dist/index.part07.js +7 -3
- package/dist/index.part08.d.ts +1 -1
- package/dist/index.part08.js +22 -27
- package/dist/initCommand.js +5 -1
- package/dist/initTemplatesBase.js +81 -79
- 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/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/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/testing.md +139 -40
- 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/semantico/analisador.d.ts +1 -0
- package/node_modules/@sema/nucleo/dist/semantico/analisador.js +1 -0
- 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
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0",
|
|
3
|
-
"systemId": "example.simulation.pixel-16-bit.uncontrolled",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"kind": "SIMULATION",
|
|
6
|
-
"spatialModel": "TWO_D",
|
|
7
|
-
"renderMode": "VISUAL",
|
|
8
|
-
"visualProfile": "PIXEL_16_BIT",
|
|
9
|
-
"fidelity": "SYSTEMIC",
|
|
10
|
-
"controlModes": [
|
|
11
|
-
"UNCONTROLLED"
|
|
12
|
-
],
|
|
13
|
-
"timeModel": "EVENT_DRIVEN",
|
|
14
|
-
"determinism": "BEST_EFFORT",
|
|
15
|
-
"capabilities": [
|
|
16
|
-
"interactive.control.uncontrolled",
|
|
17
|
-
"interactive.determinism.best_effort",
|
|
18
|
-
"interactive.fidelity.systemic",
|
|
19
|
-
"interactive.kind.simulation",
|
|
20
|
-
"interactive.render.visual",
|
|
21
|
-
"interactive.spatial.two_d",
|
|
22
|
-
"interactive.state.model",
|
|
23
|
-
"interactive.time.event_driven",
|
|
24
|
-
"interactive.visual.pixel_16_bit",
|
|
25
|
-
"interactive.world.model",
|
|
26
|
-
"simulation.hazard.model",
|
|
27
|
-
"simulation.model",
|
|
28
|
-
"simulation.outputs.observe",
|
|
29
|
-
"simulation.recovery.plan",
|
|
30
|
-
"simulation.scenario.define",
|
|
31
|
-
"simulation.stop.validate"
|
|
32
|
-
],
|
|
33
|
-
"pipelines": [
|
|
34
|
-
"simulation.scenario",
|
|
35
|
-
"simulation.safety"
|
|
36
|
-
],
|
|
37
|
-
"adapterTargets": [
|
|
38
|
-
"engine.tic80",
|
|
39
|
-
"simulation.runner.generic",
|
|
40
|
-
"telemetry.trace.local",
|
|
41
|
-
"validator.replay.local"
|
|
42
|
-
],
|
|
43
|
-
"world": {
|
|
44
|
-
"identity": "uncontrolled cellular ecosystem visualisation",
|
|
45
|
-
"state": {
|
|
46
|
-
"generation": 0,
|
|
47
|
-
"population": 64
|
|
48
|
-
},
|
|
49
|
-
"time": {
|
|
50
|
-
"advance": "next scheduled ecosystem event"
|
|
51
|
-
},
|
|
52
|
-
"events": [
|
|
53
|
-
"organism.birth",
|
|
54
|
-
"organism.consume",
|
|
55
|
-
"organism.expire"
|
|
56
|
-
],
|
|
57
|
-
"initialConditions": {
|
|
58
|
-
"population": 64,
|
|
59
|
-
"resourceCells": 256
|
|
60
|
-
},
|
|
61
|
-
"grid": "160x90 logical cells rendered as 2x2 pixels",
|
|
62
|
-
"model": "event-driven predator-resource cellular system",
|
|
63
|
-
"assumptions": [
|
|
64
|
-
"all interactions are local to neighbouring cells"
|
|
65
|
-
],
|
|
66
|
-
"boundaryConditions": {
|
|
67
|
-
"topology": "toroidal",
|
|
68
|
-
"maximumPopulation": 2048
|
|
69
|
-
},
|
|
70
|
-
"outputs": [
|
|
71
|
-
"populationBySpecies",
|
|
72
|
-
"resourceCoverage",
|
|
73
|
-
"extinctionEvents"
|
|
74
|
-
],
|
|
75
|
-
"validation": {
|
|
76
|
-
"method": "check event and population invariants independently of pixel rendering",
|
|
77
|
-
"invariants": ["population remains non-negative", "events reference existing cells"]
|
|
78
|
-
},
|
|
79
|
-
"stopCriteria": [
|
|
80
|
-
"generation reaches 10000",
|
|
81
|
-
"all species become extinct"
|
|
82
|
-
],
|
|
83
|
-
"safetyConstraints": [
|
|
84
|
-
"population allocation never exceeds 2048 entities",
|
|
85
|
-
"event queue never exceeds 65536 entries"
|
|
86
|
-
]
|
|
87
|
-
},
|
|
88
|
-
"budgets": {
|
|
89
|
-
"paletteColors": 256,
|
|
90
|
-
"baseResolution": "320x180",
|
|
91
|
-
"tileSize": "2x2",
|
|
92
|
-
"spriteSize": "2x2 to 8x8",
|
|
93
|
-
"memoryBudgetBytes": 524288,
|
|
94
|
-
"audioProfile": "optional four-voice event sonification"
|
|
95
|
-
},
|
|
96
|
-
"acceptance": {
|
|
97
|
-
"invariants": [
|
|
98
|
-
"population counts remain non-negative",
|
|
99
|
-
"every event references an existing cell"
|
|
100
|
-
],
|
|
101
|
-
"visualisation": "pixel styling does not alter the model state or event order"
|
|
102
|
-
}
|
|
103
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"systemId": "example.simulation.pixel-16-bit.uncontrolled",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"kind": "SIMULATION",
|
|
6
|
+
"spatialModel": "TWO_D",
|
|
7
|
+
"renderMode": "VISUAL",
|
|
8
|
+
"visualProfile": "PIXEL_16_BIT",
|
|
9
|
+
"fidelity": "SYSTEMIC",
|
|
10
|
+
"controlModes": [
|
|
11
|
+
"UNCONTROLLED"
|
|
12
|
+
],
|
|
13
|
+
"timeModel": "EVENT_DRIVEN",
|
|
14
|
+
"determinism": "BEST_EFFORT",
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"interactive.control.uncontrolled",
|
|
17
|
+
"interactive.determinism.best_effort",
|
|
18
|
+
"interactive.fidelity.systemic",
|
|
19
|
+
"interactive.kind.simulation",
|
|
20
|
+
"interactive.render.visual",
|
|
21
|
+
"interactive.spatial.two_d",
|
|
22
|
+
"interactive.state.model",
|
|
23
|
+
"interactive.time.event_driven",
|
|
24
|
+
"interactive.visual.pixel_16_bit",
|
|
25
|
+
"interactive.world.model",
|
|
26
|
+
"simulation.hazard.model",
|
|
27
|
+
"simulation.model",
|
|
28
|
+
"simulation.outputs.observe",
|
|
29
|
+
"simulation.recovery.plan",
|
|
30
|
+
"simulation.scenario.define",
|
|
31
|
+
"simulation.stop.validate"
|
|
32
|
+
],
|
|
33
|
+
"pipelines": [
|
|
34
|
+
"simulation.scenario",
|
|
35
|
+
"simulation.safety"
|
|
36
|
+
],
|
|
37
|
+
"adapterTargets": [
|
|
38
|
+
"engine.tic80",
|
|
39
|
+
"simulation.runner.generic",
|
|
40
|
+
"telemetry.trace.local",
|
|
41
|
+
"validator.replay.local"
|
|
42
|
+
],
|
|
43
|
+
"world": {
|
|
44
|
+
"identity": "uncontrolled cellular ecosystem visualisation",
|
|
45
|
+
"state": {
|
|
46
|
+
"generation": 0,
|
|
47
|
+
"population": 64
|
|
48
|
+
},
|
|
49
|
+
"time": {
|
|
50
|
+
"advance": "next scheduled ecosystem event"
|
|
51
|
+
},
|
|
52
|
+
"events": [
|
|
53
|
+
"organism.birth",
|
|
54
|
+
"organism.consume",
|
|
55
|
+
"organism.expire"
|
|
56
|
+
],
|
|
57
|
+
"initialConditions": {
|
|
58
|
+
"population": 64,
|
|
59
|
+
"resourceCells": 256
|
|
60
|
+
},
|
|
61
|
+
"grid": "160x90 logical cells rendered as 2x2 pixels",
|
|
62
|
+
"model": "event-driven predator-resource cellular system",
|
|
63
|
+
"assumptions": [
|
|
64
|
+
"all interactions are local to neighbouring cells"
|
|
65
|
+
],
|
|
66
|
+
"boundaryConditions": {
|
|
67
|
+
"topology": "toroidal",
|
|
68
|
+
"maximumPopulation": 2048
|
|
69
|
+
},
|
|
70
|
+
"outputs": [
|
|
71
|
+
"populationBySpecies",
|
|
72
|
+
"resourceCoverage",
|
|
73
|
+
"extinctionEvents"
|
|
74
|
+
],
|
|
75
|
+
"validation": {
|
|
76
|
+
"method": "check event and population invariants independently of pixel rendering",
|
|
77
|
+
"invariants": ["population remains non-negative", "events reference existing cells"]
|
|
78
|
+
},
|
|
79
|
+
"stopCriteria": [
|
|
80
|
+
"generation reaches 10000",
|
|
81
|
+
"all species become extinct"
|
|
82
|
+
],
|
|
83
|
+
"safetyConstraints": [
|
|
84
|
+
"population allocation never exceeds 2048 entities",
|
|
85
|
+
"event queue never exceeds 65536 entries"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"budgets": {
|
|
89
|
+
"paletteColors": 256,
|
|
90
|
+
"baseResolution": "320x180",
|
|
91
|
+
"tileSize": "2x2",
|
|
92
|
+
"spriteSize": "2x2 to 8x8",
|
|
93
|
+
"memoryBudgetBytes": 524288,
|
|
94
|
+
"audioProfile": "optional four-voice event sonification"
|
|
95
|
+
},
|
|
96
|
+
"acceptance": {
|
|
97
|
+
"invariants": [
|
|
98
|
+
"population counts remain non-negative",
|
|
99
|
+
"every event references an existing cell"
|
|
100
|
+
],
|
|
101
|
+
"visualisation": "pixel styling does not alter the model state or event order"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
{
|
|
2
|
-
"schemaVersion": "1.0",
|
|
3
|
-
"systemId": "example.simulation.text.controlled",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"kind": "SIMULATION",
|
|
6
|
-
"spatialModel": "NON_SPATIAL",
|
|
7
|
-
"renderMode": "TEXT",
|
|
8
|
-
"visualProfile": "NONE",
|
|
9
|
-
"fidelity": "SYSTEMIC",
|
|
10
|
-
"controlModes": [
|
|
11
|
-
"SCRIPTED"
|
|
12
|
-
],
|
|
13
|
-
"timeModel": "TURN_BASED",
|
|
14
|
-
"determinism": "STRICT",
|
|
15
|
-
"capabilities": [
|
|
16
|
-
"interactive.control.scripted",
|
|
17
|
-
"interactive.determinism.strict",
|
|
18
|
-
"interactive.event.log",
|
|
19
|
-
"interactive.fidelity.systemic",
|
|
20
|
-
"interactive.kind.simulation",
|
|
21
|
-
"interactive.render.text",
|
|
22
|
-
"interactive.replay.compare",
|
|
23
|
-
"interactive.seed.bind",
|
|
24
|
-
"interactive.snapshot.capture",
|
|
25
|
-
"interactive.spatial.non_spatial",
|
|
26
|
-
"interactive.state.model",
|
|
27
|
-
"interactive.time.turn_based",
|
|
28
|
-
"interactive.visual.none",
|
|
29
|
-
"interactive.world.model",
|
|
30
|
-
"simulation.invariants.validate",
|
|
31
|
-
"simulation.model",
|
|
32
|
-
"simulation.outputs.compare",
|
|
33
|
-
"simulation.outputs.observe",
|
|
34
|
-
"simulation.scenario.define",
|
|
35
|
-
"simulation.validity.report"
|
|
36
|
-
],
|
|
37
|
-
"pipelines": [
|
|
38
|
-
"simulation.scenario",
|
|
39
|
-
"simulation.validate",
|
|
40
|
-
"interactive.replay"
|
|
41
|
-
],
|
|
42
|
-
"adapterTargets": [
|
|
43
|
-
"runtime.text.generic",
|
|
44
|
-
"simulation.runner.generic",
|
|
45
|
-
"telemetry.trace.local",
|
|
46
|
-
"validator.replay.local"
|
|
47
|
-
],
|
|
48
|
-
"world": {
|
|
49
|
-
"identity": "turn-based queueing simulation with a text surface",
|
|
50
|
-
"state": {
|
|
51
|
-
"turn": 0,
|
|
52
|
-
"queueLength": 0
|
|
53
|
-
},
|
|
54
|
-
"time": {
|
|
55
|
-
"turnDurationMinutes": 1
|
|
56
|
-
},
|
|
57
|
-
"events": [
|
|
58
|
-
"request.arrive",
|
|
59
|
-
"request.complete",
|
|
60
|
-
"capacity.change"
|
|
61
|
-
],
|
|
62
|
-
"initialConditions": {
|
|
63
|
-
"servers": 4,
|
|
64
|
-
"queueLength": 0
|
|
65
|
-
},
|
|
66
|
-
"model": "finite-capacity discrete queue",
|
|
67
|
-
"assumptions": [
|
|
68
|
-
"one turn represents one minute"
|
|
69
|
-
],
|
|
70
|
-
"boundaryConditions": {
|
|
71
|
-
"maximumQueueLength": 1000,
|
|
72
|
-
"turns": 1440
|
|
73
|
-
},
|
|
74
|
-
"outputs": [
|
|
75
|
-
"meanWaitTurns",
|
|
76
|
-
"maximumQueueLength",
|
|
77
|
-
"completedRequests"
|
|
78
|
-
],
|
|
79
|
-
"validation": {
|
|
80
|
-
"method": "compare seeded turns with queue invariants and expected outputs",
|
|
81
|
-
"invariants": ["queue length remains non-negative", "completed requests do not exceed arrivals"]
|
|
82
|
-
},
|
|
83
|
-
"seed": 2026071905,
|
|
84
|
-
"snapshot": "queue, servers, counters, and random stream",
|
|
85
|
-
"replay": "ordered scripted arrivals and capacity events",
|
|
86
|
-
"step": "one declared turn"
|
|
87
|
-
},
|
|
88
|
-
"acceptance": {
|
|
89
|
-
"textSurface": "every turn can be inspected without a graphical renderer",
|
|
90
|
-
"invariants": [
|
|
91
|
-
"queue length is never negative",
|
|
92
|
-
"completed requests never exceed arrivals"
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0",
|
|
3
|
+
"systemId": "example.simulation.text.controlled",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"kind": "SIMULATION",
|
|
6
|
+
"spatialModel": "NON_SPATIAL",
|
|
7
|
+
"renderMode": "TEXT",
|
|
8
|
+
"visualProfile": "NONE",
|
|
9
|
+
"fidelity": "SYSTEMIC",
|
|
10
|
+
"controlModes": [
|
|
11
|
+
"SCRIPTED"
|
|
12
|
+
],
|
|
13
|
+
"timeModel": "TURN_BASED",
|
|
14
|
+
"determinism": "STRICT",
|
|
15
|
+
"capabilities": [
|
|
16
|
+
"interactive.control.scripted",
|
|
17
|
+
"interactive.determinism.strict",
|
|
18
|
+
"interactive.event.log",
|
|
19
|
+
"interactive.fidelity.systemic",
|
|
20
|
+
"interactive.kind.simulation",
|
|
21
|
+
"interactive.render.text",
|
|
22
|
+
"interactive.replay.compare",
|
|
23
|
+
"interactive.seed.bind",
|
|
24
|
+
"interactive.snapshot.capture",
|
|
25
|
+
"interactive.spatial.non_spatial",
|
|
26
|
+
"interactive.state.model",
|
|
27
|
+
"interactive.time.turn_based",
|
|
28
|
+
"interactive.visual.none",
|
|
29
|
+
"interactive.world.model",
|
|
30
|
+
"simulation.invariants.validate",
|
|
31
|
+
"simulation.model",
|
|
32
|
+
"simulation.outputs.compare",
|
|
33
|
+
"simulation.outputs.observe",
|
|
34
|
+
"simulation.scenario.define",
|
|
35
|
+
"simulation.validity.report"
|
|
36
|
+
],
|
|
37
|
+
"pipelines": [
|
|
38
|
+
"simulation.scenario",
|
|
39
|
+
"simulation.validate",
|
|
40
|
+
"interactive.replay"
|
|
41
|
+
],
|
|
42
|
+
"adapterTargets": [
|
|
43
|
+
"runtime.text.generic",
|
|
44
|
+
"simulation.runner.generic",
|
|
45
|
+
"telemetry.trace.local",
|
|
46
|
+
"validator.replay.local"
|
|
47
|
+
],
|
|
48
|
+
"world": {
|
|
49
|
+
"identity": "turn-based queueing simulation with a text surface",
|
|
50
|
+
"state": {
|
|
51
|
+
"turn": 0,
|
|
52
|
+
"queueLength": 0
|
|
53
|
+
},
|
|
54
|
+
"time": {
|
|
55
|
+
"turnDurationMinutes": 1
|
|
56
|
+
},
|
|
57
|
+
"events": [
|
|
58
|
+
"request.arrive",
|
|
59
|
+
"request.complete",
|
|
60
|
+
"capacity.change"
|
|
61
|
+
],
|
|
62
|
+
"initialConditions": {
|
|
63
|
+
"servers": 4,
|
|
64
|
+
"queueLength": 0
|
|
65
|
+
},
|
|
66
|
+
"model": "finite-capacity discrete queue",
|
|
67
|
+
"assumptions": [
|
|
68
|
+
"one turn represents one minute"
|
|
69
|
+
],
|
|
70
|
+
"boundaryConditions": {
|
|
71
|
+
"maximumQueueLength": 1000,
|
|
72
|
+
"turns": 1440
|
|
73
|
+
},
|
|
74
|
+
"outputs": [
|
|
75
|
+
"meanWaitTurns",
|
|
76
|
+
"maximumQueueLength",
|
|
77
|
+
"completedRequests"
|
|
78
|
+
],
|
|
79
|
+
"validation": {
|
|
80
|
+
"method": "compare seeded turns with queue invariants and expected outputs",
|
|
81
|
+
"invariants": ["queue length remains non-negative", "completed requests do not exceed arrivals"]
|
|
82
|
+
},
|
|
83
|
+
"seed": 2026071905,
|
|
84
|
+
"snapshot": "queue, servers, counters, and random stream",
|
|
85
|
+
"replay": "ordered scripted arrivals and capacity events",
|
|
86
|
+
"step": "one declared turn"
|
|
87
|
+
},
|
|
88
|
+
"acceptance": {
|
|
89
|
+
"textSurface": "every turn can be inspected without a graphical renderer",
|
|
90
|
+
"invariants": [
|
|
91
|
+
"queue length is never negative",
|
|
92
|
+
"completed requests never exceed arrivals"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -292,32 +292,32 @@ function gerarTestesLua(modulo, arquivoModulo) {
|
|
|
292
292
|
const tiposDeclarados = gerarTabelaTiposDeclarados(task);
|
|
293
293
|
const tipoErro = caso.error?.campos.find((campo) => campo.nome === "tipo")?.tipo ?? caso.error?.campos[0]?.tipo;
|
|
294
294
|
if (tipoErro) {
|
|
295
|
-
return `local function ${nomeTeste}()
|
|
296
|
-
local entrada = ${converterBlocoTesteParaLua(caso.given, tiposDeclarados)}
|
|
297
|
-
local ok, erro = pcall(function()
|
|
298
|
-
modulo.executar_${normalizarNomeParaSimbolo(task.nome)}(entrada)
|
|
299
|
-
end)
|
|
300
|
-
if ok or not string.find(tostring(erro), ${JSON.stringify(tipoErro)}, 1, true) then
|
|
301
|
-
error("Caso ${caso.nome} nao produziu o erro esperado ${tipoErro}.")
|
|
302
|
-
end
|
|
295
|
+
return `local function ${nomeTeste}()
|
|
296
|
+
local entrada = ${converterBlocoTesteParaLua(caso.given, tiposDeclarados)}
|
|
297
|
+
local ok, erro = pcall(function()
|
|
298
|
+
modulo.executar_${normalizarNomeParaSimbolo(task.nome)}(entrada)
|
|
299
|
+
end)
|
|
300
|
+
if ok or not string.find(tostring(erro), ${JSON.stringify(tipoErro)}, 1, true) then
|
|
301
|
+
error("Caso ${caso.nome} nao produziu o erro esperado ${tipoErro}.")
|
|
302
|
+
end
|
|
303
303
|
end`;
|
|
304
304
|
}
|
|
305
305
|
const falhaSemSaida = caso.expect.campos.some((campo) => campo.nome === "sucesso" && campo.tipo === "falso")
|
|
306
306
|
&& caso.expect.campos.every((campo) => campo.nome === "sucesso")
|
|
307
307
|
&& caso.expect.linhas.length === 0
|
|
308
308
|
&& caso.expect.blocos.length === 0;
|
|
309
|
-
return `local function ${nomeTeste}()
|
|
310
|
-
local entrada = ${converterBlocoTesteParaLua(caso.given, tiposDeclarados)}
|
|
311
|
-
local saida = modulo.executar_${normalizarNomeParaSimbolo(task.nome)}(entrada)
|
|
312
|
-
if ${falhaSemSaida ? "saida ~= nil" : "saida == nil"} then
|
|
313
|
-
error("Caso ${caso.nome} nao respeitou expectativa basica de execucao.")
|
|
314
|
-
end
|
|
309
|
+
return `local function ${nomeTeste}()
|
|
310
|
+
local entrada = ${converterBlocoTesteParaLua(caso.given, tiposDeclarados)}
|
|
311
|
+
local saida = modulo.executar_${normalizarNomeParaSimbolo(task.nome)}(entrada)
|
|
312
|
+
if ${falhaSemSaida ? "saida ~= nil" : "saida == nil"} then
|
|
313
|
+
error("Caso ${caso.nome} nao respeitou expectativa basica de execucao.")
|
|
314
|
+
end
|
|
315
315
|
end`;
|
|
316
316
|
});
|
|
317
317
|
const lista = testes.map(({ task, caso, indice }) => `{ nome = ${JSON.stringify(caso.nome)}, fn = test_${normalizarNomeParaSimbolo(task.nome)}_${indice + 1} }`).join(",\n ");
|
|
318
|
-
return `${gerarCabecalhoSemaLua(modulo, "teste")}local origem = debug.getinfo(1, "S").source:sub(2)
|
|
319
|
-
local base = origem:match("^(.*[/\\\\])") or "./"
|
|
320
|
-
local modulo = assert(loadfile(base .. ${JSON.stringify(nomeArquivo)}))()
|
|
318
|
+
return `${gerarCabecalhoSemaLua(modulo, "teste")}local origem = debug.getinfo(1, "S").source:sub(2)
|
|
319
|
+
local base = origem:match("^(.*[/\\\\])") or "./"
|
|
320
|
+
local modulo = assert(loadfile(base .. ${JSON.stringify(nomeArquivo)}))()
|
|
321
321
|
|
|
322
322
|
${funcoes.join("\n\n")}
|
|
323
323
|
|
|
@@ -376,20 +376,20 @@ function gerarFuncoesTask(task) {
|
|
|
376
376
|
: valorPadraoLua(campo);
|
|
377
377
|
return ` ${campo.nome} = ${valor},`;
|
|
378
378
|
}).join("\n");
|
|
379
|
-
return ` if igual_profundo(entrada, ${converterBlocoTesteParaLua(caso.given, tiposDeclarados)}) then
|
|
380
|
-
return {
|
|
381
|
-
${saida}
|
|
382
|
-
}
|
|
379
|
+
return ` if igual_profundo(entrada, ${converterBlocoTesteParaLua(caso.given, tiposDeclarados)}) then
|
|
380
|
+
return {
|
|
381
|
+
${saida}
|
|
382
|
+
}
|
|
383
383
|
end`;
|
|
384
384
|
})
|
|
385
385
|
.join("\n");
|
|
386
|
-
return `${gerarMetadadosTask(task)}
|
|
386
|
+
return `${gerarMetadadosTask(task)}
|
|
387
387
|
|
|
388
388
|
${garantias}
|
|
389
389
|
|
|
390
|
-
function M.executar_${simbolo}(entrada)
|
|
391
|
-
entrada = entrada or {}
|
|
392
|
-
${cenariosErro ? `${cenariosErro}\n` : ""}${cenariosFalhaEstruturada ? `${cenariosFalhaEstruturada}\n` : ""}${validacoes ? `${validacoes}\n` : ""}${preparacaoSaida}
|
|
390
|
+
function M.executar_${simbolo}(entrada)
|
|
391
|
+
entrada = entrada or {}
|
|
392
|
+
${cenariosErro ? `${cenariosErro}\n` : ""}${cenariosFalhaEstruturada ? `${cenariosFalhaEstruturada}\n` : ""}${validacoes ? `${validacoes}\n` : ""}${preparacaoSaida}
|
|
393
393
|
verificar_garantias_${simbolo}(saida)
|
|
394
394
|
return saida
|
|
395
395
|
end`;
|
|
@@ -405,39 +405,39 @@ export function gerarLua(modulo) {
|
|
|
405
405
|
const tasks = modulo.tasks.map((task) => gerarFuncoesTask(task)).join("\n\n");
|
|
406
406
|
const flows = modulo.flows.map((flow) => `-- Flow ${flow.nome}: etapas=${flow.etapasEstruturadas.length} tasks=${flow.tasksReferenciadas.join(", ") || "nenhuma"}`).join("\n");
|
|
407
407
|
const routes = modulo.routes.map((route) => `-- Route ${route.nome}: metodo=${route.metodo ?? "nao_definido"} caminho=${route.caminho ?? "nao_definido"} task=${route.task ?? "nao_definida"}`).join("\n");
|
|
408
|
-
const codigo = `${gerarCabecalhoSemaLua(modulo)}
|
|
409
|
-
${interops ? `${interops}\n` : ""}${tiposExternos ? `${tiposExternos}\n\n` : ""}local M = {}
|
|
408
|
+
const codigo = `${gerarCabecalhoSemaLua(modulo)}
|
|
409
|
+
${interops ? `${interops}\n` : ""}${tiposExternos ? `${tiposExternos}\n\n` : ""}local M = {}
|
|
410
410
|
|
|
411
|
-
local function contem(lista, valor)
|
|
411
|
+
local function contem(lista, valor)
|
|
412
412
|
for _, item in ipairs(lista) do
|
|
413
413
|
if item == valor then
|
|
414
414
|
return true
|
|
415
415
|
end
|
|
416
416
|
end
|
|
417
417
|
return false
|
|
418
|
-
end
|
|
419
|
-
|
|
420
|
-
local function igual_profundo(esquerda, direita)
|
|
421
|
-
if esquerda == direita then
|
|
422
|
-
return true
|
|
423
|
-
end
|
|
424
|
-
if type(esquerda) ~= "table" or type(direita) ~= "table" then
|
|
425
|
-
return false
|
|
426
|
-
end
|
|
427
|
-
for chave, valor in pairs(esquerda) do
|
|
428
|
-
if not igual_profundo(valor, direita[chave]) then
|
|
429
|
-
return false
|
|
430
|
-
end
|
|
431
|
-
end
|
|
432
|
-
for chave, _ in pairs(direita) do
|
|
433
|
-
if esquerda[chave] == nil then
|
|
434
|
-
return false
|
|
435
|
-
end
|
|
436
|
-
end
|
|
437
|
-
return true
|
|
438
|
-
end
|
|
439
|
-
|
|
440
|
-
${tipos ? `${tipos}\n\n` : ""}${entidades ? `${entidades}\n\n` : ""}${enums ? `${enums}\n\n` : ""}${tasks}${flows ? `\n\n${flows}` : ""}${routes ? `\n${routes}` : ""}
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
local function igual_profundo(esquerda, direita)
|
|
421
|
+
if esquerda == direita then
|
|
422
|
+
return true
|
|
423
|
+
end
|
|
424
|
+
if type(esquerda) ~= "table" or type(direita) ~= "table" then
|
|
425
|
+
return false
|
|
426
|
+
end
|
|
427
|
+
for chave, valor in pairs(esquerda) do
|
|
428
|
+
if not igual_profundo(valor, direita[chave]) then
|
|
429
|
+
return false
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
for chave, _ in pairs(direita) do
|
|
433
|
+
if esquerda[chave] == nil then
|
|
434
|
+
return false
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
return true
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
${tipos ? `${tipos}\n\n` : ""}${entidades ? `${entidades}\n\n` : ""}${enums ? `${enums}\n\n` : ""}${tasks}${flows ? `\n\n${flows}` : ""}${routes ? `\n${routes}` : ""}
|
|
441
441
|
|
|
442
442
|
return M
|
|
443
443
|
`;
|