@orkastery/cli 0.5.6 → 0.6.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/adapters/README.md +18 -0
- package/adapters/claude-code/.claude-plugin/plugin.json +1 -0
- package/adapters/claude-code/README.md +37 -5
- package/adapters/claude-code/agents/ork-check.md +1 -0
- package/adapters/claude-code/agents/ork-go.md +1 -0
- package/adapters/claude-code/agents/ork-goal.md +1 -0
- package/adapters/claude-code/agents/ork-master.md +1 -0
- package/adapters/claude-code/agents/ork-plan.md +1 -0
- package/adapters/claude-code/agents/ork-ship.md +1 -0
- package/adapters/claude-code/hooks/hooks.json +2 -1
- package/adapters/claude-code/hooks/ork-guard.js +15 -1
- package/adapters/claude-code/hooks/ork-resposta.js +91 -0
- package/adapters/claude-code/hooks/ork-sensor.js +18 -2
- package/adapters/claude-code/hooks/quota-signal.js +14 -0
- package/adapters/claude-code/mods/ork-mensageiro/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-mensageiro/hooks/caixa.ts +215 -0
- package/adapters/claude-code/mods/ork-mensageiro/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-mensageiro/hooks/painel.tsx +165 -0
- package/adapters/claude-code/mods/ork-mensageiro/hooks/recepcao.ts +256 -0
- package/adapters/claude-code/mods/ork-mensageiro/hooks/register.tsx +481 -0
- package/adapters/claude-code/mods/ork-mensageiro/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-mensageiro/types/index.d.ts +85 -0
- package/adapters/claude-code/mods/ork-pista/hooks/ci.ts +9 -5
- package/adapters/claude-code/mods/ork-ritual/.claude-plugin/plugin.json +14 -0
- package/adapters/claude-code/mods/ork-ritual/hooks/hooks.json +3 -0
- package/adapters/claude-code/mods/ork-ritual/hooks/nota.ts +88 -0
- package/adapters/claude-code/mods/ork-ritual/hooks/register.tsx +494 -0
- package/adapters/claude-code/mods/ork-ritual/hooks/replay.tsx +271 -0
- package/adapters/claude-code/mods/ork-ritual/hooks/ritual.ts +218 -0
- package/adapters/claude-code/mods/ork-ritual/orkastery-mod.json +5 -0
- package/adapters/claude-code/mods/ork-ritual/types/index.d.ts +106 -0
- package/adapters/claude-code/mods/ork-sentinela/hooks/vigia.ts +1 -1
- package/adapters/codex/skills/ork/SKILL.md +2 -0
- package/adapters/hermes/README.md +64 -1
- package/adapters/hermes/bin/ork-conhecimento-colecoes.sh +14 -0
- package/adapters/hermes/bin/ork-conhecimento-listar.sh +15 -0
- package/adapters/hermes/bin/ork-conhecimento-mostrar.sh +16 -0
- package/adapters/hermes/bin/ork-conhecimento-verificar.sh +15 -0
- package/adapters/hermes/bin/ork-vigia-batida.py +127 -0
- package/adapters/hermes/hermes.plugin.json +4 -0
- package/adapters/hermes/hitl-ingress/__init__.py +101 -8
- package/adapters/hermes/skills/orkastery-devmaster/SKILL.md +2 -2
- package/adapters/openclaw/README.md +81 -9
- package/adapters/openclaw/bin/ork-vigia-batida.js +86 -0
- package/adapters/openclaw/dist/hitl-ingress.js +106 -9
- package/adapters/openclaw/dist/index.js +86 -0
- package/adapters/openclaw/openclaw.plugin.json +34 -4
- package/adapters/openclaw/package.json +2 -2
- package/adapters/openclaw/src/hitl-ingress.ts +103 -9
- package/adapters/openclaw/src/index.ts +94 -0
- package/assets/adapters-en/claude-code/README.md +403 -0
- package/assets/adapters-en/claude-code/agents/ork-check.md +33 -0
- package/assets/adapters-en/claude-code/agents/ork-go.md +33 -0
- package/assets/adapters-en/claude-code/agents/ork-goal.md +34 -0
- package/assets/adapters-en/claude-code/agents/ork-master.md +35 -0
- package/assets/adapters-en/claude-code/agents/ork-plan.md +33 -0
- package/assets/adapters-en/claude-code/agents/ork-ship.md +33 -0
- package/assets/adapters-en/claude-code/commands/check.md +46 -0
- package/assets/adapters-en/claude-code/commands/go.md +46 -0
- package/assets/adapters-en/claude-code/commands/goal.md +55 -0
- package/assets/adapters-en/claude-code/commands/master.md +54 -0
- package/assets/adapters-en/claude-code/commands/onboarding.md +22 -0
- package/assets/adapters-en/claude-code/commands/ork.md +126 -0
- package/assets/adapters-en/claude-code/commands/plan.md +47 -0
- package/assets/adapters-en/claude-code/commands/ship.md +45 -0
- package/assets/adapters-en/codex/skills/ork/SKILL.md +85 -0
- package/assets/adapters-en/hermes/README.md +273 -0
- package/assets/adapters-en/hermes/skills/orkastery-devmaster/SKILL.md +169 -0
- package/assets/references-en/README.md +25 -0
- package/assets/references-en/code-review-axes.md +82 -0
- package/assets/references-en/definition-of-done.md +74 -0
- package/assets/references-en/performance-checklist.md +53 -0
- package/assets/references-en/security-checklist.md +101 -0
- package/assets/references-en/testing-patterns.md +51 -0
- package/assets/security-scan/defaults/.golangci.yml +2 -0
- package/assets/security-scan/defaults/eslint.config.mjs +11 -0
- package/assets/security-scan/defaults/gitleaks.toml +3 -0
- package/assets/security-scan/defaults/ruff.toml +1 -0
- package/assets/security-scan/tools-agil.json +87 -0
- package/assets/security-scan/tools.json +625 -0
- package/assets/skills-en/core/onboarding/SKILL.md +58 -0
- package/assets/skills-en/core/orkastery-bootstrap/SKILL.md +119 -0
- package/assets/skills-en/core/thread-state/SKILL.md +88 -0
- package/assets/skills-en/governance/decision-triage/SKILL.md +65 -0
- package/assets/skills-en/governance/narrative-guardian/SKILL.md +66 -0
- package/assets/skills-en/governance/roadmap-keeper/SKILL.md +60 -0
- package/assets/skills-en/governance/scope-check-capability-map/SKILL.md +71 -0
- package/assets/skills-en/observability/thread-tracing/SKILL.md +63 -0
- package/assets/skills-en/phases/check-quality/SKILL.md +103 -0
- package/assets/skills-en/phases/go-implementation/SKILL.md +78 -0
- package/assets/skills-en/phases/goal-definition/SKILL.md +69 -0
- package/assets/skills-en/phases/master-metrics/SKILL.md +72 -0
- package/assets/skills-en/phases/plan-specification/SKILL.md +67 -0
- package/assets/skills-en/phases/security-remediation/SKILL.md +70 -0
- package/assets/skills-en/phases/ship-release/SKILL.md +71 -0
- package/assets/skills-en/reviewers/code-reviewer/SKILL.md +61 -0
- package/assets/skills-en/reviewers/security-auditor/SKILL.md +93 -0
- package/assets/skills-en/reviewers/test-engineer/SKILL.md +66 -0
- package/assets/skills-en/reviewers/web-performance-auditor/SKILL.md +63 -0
- package/dist/adapters/claude-bg.js +118 -4
- package/dist/adapters/codex-controller-worker.js +12 -5
- package/dist/adapters/codex-events.js +16 -4
- package/dist/adapters/codex.js +3 -1
- package/dist/atualizar-branch.js +245 -0
- package/dist/auditoria.js +13 -11
- package/dist/auditrun.js +51 -46
- package/dist/autorizacao-duravel.js +327 -0
- package/dist/board.js +94 -40
- package/dist/branch-de-estado.js +16 -8
- package/dist/busca-semantica.js +7 -5
- package/dist/catalogo.js +2 -1
- package/dist/changelog-reconciliacao.js +290 -0
- package/dist/check-agil.js +500 -0
- package/dist/check-modo.js +41 -0
- package/dist/check-paralelo.js +183 -0
- package/dist/ci.js +248 -45
- package/dist/ciclos.js +8 -6
- package/dist/claim-lint.js +12 -8
- package/dist/claims-conferir.js +47 -39
- package/dist/claims.js +10 -9
- package/dist/company-brain-client.js +10 -3
- package/dist/company-brain-migration.js +11 -5
- package/dist/conducao-batida.js +759 -0
- package/dist/conducao-sentinela.js +25 -8
- package/dist/conducao.js +84 -29
- package/dist/conhecimento-consulta.js +270 -0
- package/dist/conhecimento.js +111 -87
- package/dist/conta-esgotada.js +127 -0
- package/dist/dado-privado.js +816 -0
- package/dist/decisao-autonoma.js +5 -4
- package/dist/demo.js +14 -12
- package/dist/dependencias-da-worktree.js +25 -0
- package/dist/divida.js +38 -36
- package/dist/docs.js +81 -74
- package/dist/doctor-forja.js +345 -0
- package/dist/doctor-pulse-cron.js +113 -1
- package/dist/doctor.js +164 -6
- package/dist/dsn-da-memoria.js +417 -0
- package/dist/entrega-por-mod.js +503 -0
- package/dist/entrega-pr.js +143 -43
- package/dist/esgotamentos.js +13 -11
- package/dist/estado-thread.js +21 -18
- package/dist/evalrunner.js +35 -32
- package/dist/fabrica-batida.js +34 -21
- package/dist/fabrica-estado.js +13 -10
- package/dist/fix.js +21 -19
- package/dist/forja/adaptador.js +6 -0
- package/dist/forja/ambiente-de-ci.js +27 -0
- package/dist/forja/api.js +256 -0
- package/dist/forja/cache.js +89 -0
- package/dist/forja/cli.js +60 -0
- package/dist/forja/contrato.js +9 -0
- package/dist/forja/endereco.js +43 -0
- package/dist/forja/estado.js +22 -0
- package/dist/forja/executor.js +73 -0
- package/dist/forja/github/ci.js +95 -0
- package/dist/forja/github/dono-da-rede.js +18 -0
- package/dist/forja/github/metadados.js +15 -0
- package/dist/forja/github/pedidos.js +200 -0
- package/dist/forja/gitlab/ci.js +141 -0
- package/dist/forja/gitlab/consultas.js +59 -0
- package/dist/forja/gitlab/dono-da-rede.js +43 -0
- package/dist/forja/gitlab/metadados.js +15 -0
- package/dist/forja/gitlab/pedidos-abertos.js +158 -0
- package/dist/forja/gitlab/pedidos.js +141 -0
- package/dist/forja/produtor.js +32 -0
- package/dist/forja/registro.js +31 -0
- package/dist/forja/resolver.js +121 -0
- package/dist/forja/texto.js +13 -0
- package/dist/forja/versao.js +71 -0
- package/dist/forja.js +123 -80
- package/dist/handoff.js +23 -13
- package/dist/hitl-contract.js +46 -43
- package/dist/hitl-curto.js +37 -25
- package/dist/hitl-gates.js +13 -11
- package/dist/hitl-local-receipt.js +51 -0
- package/dist/hitl-local.js +11 -2
- package/dist/hitl-lock.js +5 -11
- package/dist/hitl-public-receipt.js +11 -0
- package/dist/hitl-resumo.js +44 -1
- package/dist/hitl-sessions.js +62 -9
- package/dist/hitl-texto-livre.js +7 -4
- package/dist/hitl.js +34 -31
- package/dist/horario.js +16 -0
- package/dist/hosts.js +104 -134
- package/dist/index.js +848 -548
- package/dist/indice-vetorial.js +14 -12
- package/dist/init.js +11 -2
- package/dist/integracoes-locais.js +2 -0
- package/dist/intelligence-graph-cli.js +123 -69
- package/dist/intelligence-graph-query.js +37 -22
- package/dist/leases.js +19 -18
- package/dist/ledger-stats.js +17 -16
- package/dist/ledger.js +31 -1
- package/dist/licoes.js +12 -11
- package/dist/locale-accounts.js +220 -0
- package/dist/locale-adapter.js +291 -0
- package/dist/locale-ajuda.js +76 -4
- package/dist/locale-audit.js +199 -0
- package/dist/locale-claims.js +213 -0
- package/dist/locale-conducao.js +138 -0
- package/dist/locale-conhecimento.js +181 -0
- package/dist/locale-decisao.js +205 -0
- package/dist/locale-docs.js +230 -0
- package/dist/locale-estado.js +101 -0
- package/dist/locale-forja.js +290 -0
- package/dist/locale-gerados.js +5 -0
- package/dist/locale-grafo.js +129 -0
- package/dist/locale-master.js +83 -0
- package/dist/locale-network.js +524 -0
- package/dist/locale-operacao-restante.js +931 -0
- package/dist/locale-projetos.js +100 -0
- package/dist/locale-prompts.js +194 -0
- package/dist/locale-pulse.js +140 -2
- package/dist/locale-reservas.js +87 -0
- package/dist/locale-retry.js +145 -6
- package/dist/locale-security-scan.js +69 -0
- package/dist/locale-setup.js +192 -0
- package/dist/locale-ship.js +169 -66
- package/dist/locale-thread.js +149 -5
- package/dist/locale-verify.js +80 -4
- package/dist/locale-worktree.js +246 -0
- package/dist/locale.js +553 -9
- package/dist/maestro-runtime.js +22 -3
- package/dist/manifest.js +287 -11
- package/dist/maquina-ociosa.js +211 -0
- package/dist/maquina.js +10 -5
- package/dist/master-nota-local.js +200 -0
- package/dist/master-nota.js +10 -2
- package/dist/master.js +118 -41
- package/dist/mcp-conhecimento.js +52 -0
- package/dist/mcp-experiencia.js +26 -5
- package/dist/mcp-install.js +73 -8
- package/dist/mcp-noctum.js +101 -0
- package/dist/mcp-server.js +82 -14
- package/dist/mcp-ship-transporte.js +977 -0
- package/dist/mcp-ship.js +68 -24
- package/dist/mcp-transportes.js +17 -0
- package/dist/memoria.js +63 -58
- package/dist/modos-migracao.js +8 -6
- package/dist/modos.js +17 -18
- package/dist/network-roadmap.js +85 -49
- package/dist/noctum-aceite.js +789 -0
- package/dist/noctum-arco.js +540 -33
- package/dist/noctum-capacidade.js +3 -3
- package/dist/noctum-changelog.js +399 -0
- package/dist/noctum-cli.js +482 -0
- package/dist/noctum-coordenacao.js +1225 -0
- package/dist/noctum-entrega.js +1169 -0
- package/dist/noctum-envelope.js +252 -16
- package/dist/noctum-execucao.js +95 -23
- package/dist/noctum-fechamento.js +405 -0
- package/dist/noctum-fila.js +43 -9
- package/dist/noctum-guarda.js +256 -0
- package/dist/noctum-integracao.js +507 -0
- package/dist/noctum-maquinas.js +383 -0
- package/dist/noctum-medicao.js +450 -0
- package/dist/noctum-modo.js +362 -0
- package/dist/noctum-pergunta-canal.js +96 -0
- package/dist/noctum-pergunta.js +115 -0
- package/dist/noctum-provas.js +838 -0
- package/dist/noctum-reconciliacao.js +591 -0
- package/dist/noctum-registro.js +215 -0
- package/dist/noctum-relatorio.js +827 -0
- package/dist/noctum-resposta.js +207 -0
- package/dist/noctum-sessoes-em-voo.js +93 -0
- package/dist/noctum-supervisao.js +649 -0
- package/dist/noctum-terminal.js +459 -0
- package/dist/noctum-transporte.js +655 -0
- package/dist/noctum-vigia.js +639 -0
- package/dist/ocupacao.js +3 -1
- package/dist/onboarding.js +16 -5
- package/dist/orkmind.js +39 -23
- package/dist/orquestracao.js +31 -35
- package/dist/parado-no-condutor.js +146 -124
- package/dist/phase.js +53 -27
- package/dist/policies.js +33 -0
- package/dist/postura-local.js +4 -3
- package/dist/procedencia.js +9 -14
- package/dist/projeto-alvo.js +59 -20
- package/dist/prompts.js +136 -42
- package/dist/prova-minima.js +5 -6
- package/dist/pulse-cadencia.js +5 -4
- package/dist/pulse-consentimento.js +53 -1
- package/dist/pulse-delivery.js +143 -27
- package/dist/pulse-resposta.js +368 -4
- package/dist/pulse.js +136 -3
- package/dist/ratelimit.js +12 -4
- package/dist/recall.js +14 -13
- package/dist/rede-adesao.js +13 -8
- package/dist/rede-forja.js +108 -24
- package/dist/rede-status.js +63 -45
- package/dist/rede.js +86 -46
- package/dist/retomada-checkpoint.js +101 -0
- package/dist/retry.js +228 -73
- package/dist/roadmap-reservas.js +32 -32
- package/dist/runtime-ambiente.js +5 -0
- package/dist/runtime-context.js +117 -43
- package/dist/runtime-escada.js +423 -0
- package/dist/runtime-profiles.js +103 -46
- package/dist/saida-segura.js +3 -2
- package/dist/security-scan/agil.js +355 -0
- package/dist/security-scan/cli.js +76 -0
- package/dist/security-scan/compare.js +149 -0
- package/dist/security-scan/config.js +93 -0
- package/dist/security-scan/detect.js +97 -0
- package/dist/security-scan/executor.js +188 -0
- package/dist/security-scan/guard.js +180 -0
- package/dist/security-scan/imagem-de-lint.js +96 -0
- package/dist/security-scan/normalize/actionlint.js +12 -0
- package/dist/security-scan/normalize/eslint.js +12 -0
- package/dist/security-scan/normalize/gitleaks.js +13 -0
- package/dist/security-scan/normalize/golangci-lint.js +13 -0
- package/dist/security-scan/normalize/govulncheck.js +36 -0
- package/dist/security-scan/normalize/index.js +25 -0
- package/dist/security-scan/normalize/npm-audit.js +30 -0
- package/dist/security-scan/normalize/osv-scanner.js +32 -0
- package/dist/security-scan/normalize/oxlint.js +51 -0
- package/dist/security-scan/normalize/pip-audit.js +16 -0
- package/dist/security-scan/normalize/ruff.js +12 -0
- package/dist/security-scan/normalize/semgrep.js +20 -0
- package/dist/security-scan/normalize/trivy.js +33 -0
- package/dist/security-scan/normalize/util.js +204 -0
- package/dist/security-scan/normalize/zizmor.js +19 -0
- package/dist/security-scan/report.js +156 -0
- package/dist/security-scan/run.js +448 -0
- package/dist/security-scan/tools.js +62 -0
- package/dist/security-scan/trabalhador.js +74 -0
- package/dist/security-scan/types.js +15 -0
- package/dist/session-events.js +19 -2
- package/dist/session-watcher-claude.js +74 -19
- package/dist/session-watcher.js +156 -10
- package/dist/sessoes-contas.js +9 -0
- package/dist/sessoes-inventario.js +1 -1
- package/dist/sessoes.js +25 -23
- package/dist/setup.js +59 -58
- package/dist/ship-publicar.js +263 -92
- package/dist/ship.js +160 -17
- package/dist/superficie.js +14 -11
- package/dist/thread-close.js +9 -9
- package/dist/thread.js +121 -18
- package/dist/tokens.js +15 -11
- package/dist/trabalho-thread.js +297 -0
- package/dist/transporte-do-canal.js +189 -0
- package/dist/types.js +12 -1
- package/dist/util.js +5 -2
- package/dist/varredura-acoes.js +507 -0
- package/dist/verify.js +472 -29
- package/dist/worktree-local.js +12 -10
- package/dist/worktree.js +81 -85
- package/eval/casos/check-quality.json +77 -0
- package/eval/casos/security-auditor.json +148 -0
- package/eval/casos/security-remediation.json +161 -0
- package/eval/fixtures/security-scan/README.md +8 -0
- package/eval/fixtures/security-scan/go/.github/workflows/ci.yml +12 -0
- package/eval/fixtures/security-scan/go/Dockerfile +4 -0
- package/eval/fixtures/security-scan/go/README.md +4 -0
- package/eval/fixtures/security-scan/go/config.go +4 -0
- package/eval/fixtures/security-scan/go/go.mod +5 -0
- package/eval/fixtures/security-scan/go/go.sum +2 -0
- package/eval/fixtures/security-scan/go/main.go +31 -0
- package/eval/fixtures/security-scan/js/.github/workflows/ci.yml +12 -0
- package/eval/fixtures/security-scan/js/Dockerfile +3 -0
- package/eval/fixtures/security-scan/js/README.md +4 -0
- package/eval/fixtures/security-scan/js/package-lock.json +844 -0
- package/eval/fixtures/security-scan/js/package.json +10 -0
- package/eval/fixtures/security-scan/js/src/config.js +4 -0
- package/eval/fixtures/security-scan/js/src/server.js +17 -0
- package/eval/fixtures/security-scan/js/src/util.ts +4 -0
- package/eval/fixtures/security-scan/js/tsconfig.json +4 -0
- package/eval/fixtures/security-scan/python/.github/workflows/ci.yml +12 -0
- package/eval/fixtures/security-scan/python/Dockerfile +3 -0
- package/eval/fixtures/security-scan/python/README.md +4 -0
- package/eval/fixtures/security-scan/python/app/__init__.py +0 -0
- package/eval/fixtures/security-scan/python/app/config.py +2 -0
- package/eval/fixtures/security-scan/python/app/main.py +19 -0
- package/eval/fixtures/security-scan/python/requirements.txt +1 -0
- package/package.json +9 -4
- package/references/security-checklist.md +3 -3
- package/skills/README.md +1 -0
- package/skills/core/orkastery-bootstrap/SKILL.md +2 -2
- package/skills/phases/check-quality/SKILL.md +16 -0
- package/skills/phases/go-implementation/SKILL.md +6 -0
- package/skills/phases/security-remediation/SKILL.md +70 -0
- package/skills/reviewers/security-auditor/SKILL.md +25 -0
package/dist/evalrunner.js
CHANGED
|
@@ -68,6 +68,7 @@ const path = __importStar(require("node:path"));
|
|
|
68
68
|
const canarios_1 = require("./canarios");
|
|
69
69
|
const catalogo_1 = require("./catalogo");
|
|
70
70
|
const util_1 = require("./util");
|
|
71
|
+
const locale_1 = require("./locale");
|
|
71
72
|
/** Os tres tipos que toda skill precisa cobrir. Menos que isso e cobertura de fachada. */
|
|
72
73
|
exports.TIPOS_DE_CASO = ['caminho-feliz', 'racionalizacao', 'borda'];
|
|
73
74
|
/** Minimo de casos por skill, para o corpus nao virar uma linha por skill. */
|
|
@@ -147,7 +148,7 @@ function lerCasos(catalogo) {
|
|
|
147
148
|
try {
|
|
148
149
|
const lido = JSON.parse(fs.readFileSync(caminho, 'utf8'));
|
|
149
150
|
if (!lido.skill || !Array.isArray(lido.casos)) {
|
|
150
|
-
falhas.push({ codigo: 'fixture-invalida', detalhe:
|
|
151
|
+
falhas.push({ codigo: 'fixture-invalida', detalhe: (0, locale_1.msg)().operacao.restante.eval.fixtureFormato(nome) });
|
|
151
152
|
continue;
|
|
152
153
|
}
|
|
153
154
|
arquivos.push(lido);
|
|
@@ -160,6 +161,7 @@ function lerCasos(catalogo) {
|
|
|
160
161
|
}
|
|
161
162
|
function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
162
163
|
const falhas = [];
|
|
164
|
+
const m = (0, locale_1.msg)().operacao.restante.eval;
|
|
163
165
|
const skill = arquivo.skill;
|
|
164
166
|
const tabelaDeDesculpas = intervaloDaTabelaDeDesculpas(textoDaSkill);
|
|
165
167
|
let assercoes = 0;
|
|
@@ -167,17 +169,17 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
167
169
|
falhas.push({
|
|
168
170
|
codigo: 'cobertura-minima',
|
|
169
171
|
skill,
|
|
170
|
-
detalhe:
|
|
172
|
+
detalhe: m.casosMinimos(arquivo.casos.length, exports.MINIMO_DE_CASOS),
|
|
171
173
|
});
|
|
172
174
|
}
|
|
173
175
|
for (const tipo of exports.TIPOS_DE_CASO) {
|
|
174
176
|
if (!arquivo.casos.some((c) => c.tipo === tipo)) {
|
|
175
|
-
falhas.push({ codigo: 'tipo-faltando', skill, detalhe:
|
|
177
|
+
falhas.push({ codigo: 'tipo-faltando', skill, detalhe: m.tipoFaltando(tipo) });
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
for (const caso of arquivo.casos) {
|
|
179
181
|
if (vistos.has(caso.id)) {
|
|
180
|
-
falhas.push({ codigo: 'id-duplicado', skill, caso: caso.id, detalhe:
|
|
182
|
+
falhas.push({ codigo: 'id-duplicado', skill, caso: caso.id, detalhe: m.idRepetido });
|
|
181
183
|
}
|
|
182
184
|
vistos.add(caso.id);
|
|
183
185
|
if (!caso.id.startsWith(`${skill}/`)) {
|
|
@@ -185,7 +187,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
185
187
|
codigo: 'id-sem-prefixo',
|
|
186
188
|
skill,
|
|
187
189
|
caso: caso.id,
|
|
188
|
-
detalhe:
|
|
190
|
+
detalhe: m.idPrefixo(skill),
|
|
189
191
|
});
|
|
190
192
|
}
|
|
191
193
|
if (caso.tipo === 'racionalizacao' && !(caso.racionalizacao ?? '').trim()) {
|
|
@@ -193,7 +195,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
193
195
|
codigo: 'racionalizacao-sem-desculpa',
|
|
194
196
|
skill,
|
|
195
197
|
caso: caso.id,
|
|
196
|
-
detalhe:
|
|
198
|
+
detalhe: m.racionalizacao,
|
|
197
199
|
});
|
|
198
200
|
}
|
|
199
201
|
let ancoraForaDaTabela = false;
|
|
@@ -204,7 +206,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
204
206
|
codigo: 'assercao-sem-porque',
|
|
205
207
|
skill,
|
|
206
208
|
caso: caso.id,
|
|
207
|
-
detalhe:
|
|
209
|
+
detalhe: m.assercaoPorque(a.valor),
|
|
208
210
|
});
|
|
209
211
|
}
|
|
210
212
|
let posicoes;
|
|
@@ -216,7 +218,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
216
218
|
codigo: 'padrao-invalido',
|
|
217
219
|
skill,
|
|
218
220
|
caso: caso.id,
|
|
219
|
-
detalhe:
|
|
221
|
+
detalhe: m.padraoInvalido(a.valor, e.message),
|
|
220
222
|
});
|
|
221
223
|
continue;
|
|
222
224
|
}
|
|
@@ -226,7 +228,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
226
228
|
codigo: 'assercao',
|
|
227
229
|
skill,
|
|
228
230
|
caso: caso.id,
|
|
229
|
-
detalhe:
|
|
231
|
+
detalhe: m.deveriaAusente(a.valor, posicoes.length),
|
|
230
232
|
});
|
|
231
233
|
}
|
|
232
234
|
continue;
|
|
@@ -236,7 +238,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
236
238
|
codigo: 'assercao',
|
|
237
239
|
skill,
|
|
238
240
|
caso: caso.id,
|
|
239
|
-
detalhe:
|
|
241
|
+
detalhe: m.naoExiste(a.valor, skill, a.porque),
|
|
240
242
|
});
|
|
241
243
|
continue;
|
|
242
244
|
}
|
|
@@ -250,7 +252,7 @@ function avaliarSkill(arquivo, textoDaSkill, vistos) {
|
|
|
250
252
|
codigo: 'ancora-fora-da-tabela',
|
|
251
253
|
skill,
|
|
252
254
|
caso: caso.id,
|
|
253
|
-
detalhe:
|
|
255
|
+
detalhe: m.ancora,
|
|
254
256
|
});
|
|
255
257
|
}
|
|
256
258
|
}
|
|
@@ -274,14 +276,15 @@ function rodarCanarios(catalogo, filtro) {
|
|
|
274
276
|
const dir = dirDeFixtures(catalogo);
|
|
275
277
|
const resultados = [];
|
|
276
278
|
const falhas = [];
|
|
279
|
+
const m = (0, locale_1.msg)().operacao.restante.eval;
|
|
277
280
|
const temGit = (0, canarios_1.gitDisponivel)();
|
|
278
281
|
const nomes = fs.existsSync(dir) ? fs.readdirSync(dir).sort() : [];
|
|
279
282
|
if (filtro && filtro.length === 0) {
|
|
280
|
-
falhas.push({ codigo: 'fixture-invalida', detalhe:
|
|
283
|
+
falhas.push({ codigo: 'fixture-invalida', detalhe: m.filtroVazio });
|
|
281
284
|
}
|
|
282
285
|
for (const id of new Set(filtro ?? [])) {
|
|
283
286
|
if (!nomes.includes(id) || !(0, canarios_1.canarioPorId)(id)) {
|
|
284
|
-
falhas.push({ codigo: 'canario-sem-executor', caso: id, detalhe:
|
|
287
|
+
falhas.push({ codigo: 'canario-sem-executor', caso: id, detalhe: m.canarioAusente(id) });
|
|
285
288
|
}
|
|
286
289
|
}
|
|
287
290
|
for (const nome of nomes) {
|
|
@@ -291,7 +294,7 @@ function rodarCanarios(catalogo, filtro) {
|
|
|
291
294
|
continue;
|
|
292
295
|
const caminho = path.join(dir, nome, 'caso.json');
|
|
293
296
|
if (!fs.existsSync(caminho)) {
|
|
294
|
-
falhas.push({ codigo: 'fixture-invalida', detalhe:
|
|
297
|
+
falhas.push({ codigo: 'fixture-invalida', detalhe: m.casoAusente(nome) });
|
|
295
298
|
continue;
|
|
296
299
|
}
|
|
297
300
|
let fixture;
|
|
@@ -304,13 +307,13 @@ function rodarCanarios(catalogo, filtro) {
|
|
|
304
307
|
}
|
|
305
308
|
const canario = (0, canarios_1.canarioPorId)(fixture.id ?? nome);
|
|
306
309
|
if (fixture.id !== nome) {
|
|
307
|
-
falhas.push({ codigo: 'fixture-invalida', caso: nome, detalhe:
|
|
310
|
+
falhas.push({ codigo: 'fixture-invalida', caso: nome, detalhe: m.fixtureDiverge });
|
|
308
311
|
continue;
|
|
309
312
|
}
|
|
310
313
|
if (!canario) {
|
|
311
314
|
falhas.push({
|
|
312
315
|
codigo: 'canario-sem-executor',
|
|
313
|
-
detalhe:
|
|
316
|
+
detalhe: m.semExecutor(nome, fixture.id ?? nome),
|
|
314
317
|
});
|
|
315
318
|
continue;
|
|
316
319
|
}
|
|
@@ -320,7 +323,7 @@ function rodarCanarios(catalogo, filtro) {
|
|
|
320
323
|
sobre: canario.sobre,
|
|
321
324
|
estado: 'unavailable',
|
|
322
325
|
divergencias: [],
|
|
323
|
-
motivo:
|
|
326
|
+
motivo: m.semGit,
|
|
324
327
|
observado: {},
|
|
325
328
|
});
|
|
326
329
|
continue;
|
|
@@ -340,7 +343,7 @@ function rodarCanarios(catalogo, filtro) {
|
|
|
340
343
|
falhas.push({
|
|
341
344
|
codigo: 'canario',
|
|
342
345
|
caso: `${canario.id}/${d.chave}`,
|
|
343
|
-
detalhe:
|
|
346
|
+
detalhe: m.divergencia(JSON.stringify(d.esperado), JSON.stringify(d.observado)),
|
|
344
347
|
});
|
|
345
348
|
}
|
|
346
349
|
}
|
|
@@ -364,7 +367,7 @@ function rodarCanarios(catalogo, filtro) {
|
|
|
364
367
|
falhas.push({
|
|
365
368
|
codigo: 'fixture-invalida',
|
|
366
369
|
caso: c.id,
|
|
367
|
-
detalhe:
|
|
370
|
+
detalhe: m.canarioSemFixture(c.id),
|
|
368
371
|
});
|
|
369
372
|
}
|
|
370
373
|
}
|
|
@@ -398,7 +401,7 @@ function rodarEval(opcoes) {
|
|
|
398
401
|
falhas.push({
|
|
399
402
|
codigo: 'skill-sem-eval',
|
|
400
403
|
skill: skill.nome,
|
|
401
|
-
detalhe:
|
|
404
|
+
detalhe: (0, locale_1.msg)().operacao.restante.eval.skillSemEval(skill.nome),
|
|
402
405
|
});
|
|
403
406
|
}
|
|
404
407
|
}
|
|
@@ -410,7 +413,7 @@ function rodarEval(opcoes) {
|
|
|
410
413
|
falhas.push({
|
|
411
414
|
codigo: 'eval-sem-skill',
|
|
412
415
|
skill: arquivo.skill,
|
|
413
|
-
detalhe:
|
|
416
|
+
detalhe: (0, locale_1.msg)().operacao.restante.eval.evalSemSkill,
|
|
414
417
|
});
|
|
415
418
|
continue;
|
|
416
419
|
}
|
|
@@ -435,23 +438,24 @@ function rodarEval(opcoes) {
|
|
|
435
438
|
}
|
|
436
439
|
/** Texto de `ork eval`. */
|
|
437
440
|
function textoDoEval(r) {
|
|
441
|
+
const m = (0, locale_1.msg)().operacao.restante.eval;
|
|
438
442
|
const linhas = [];
|
|
439
|
-
linhas.push(
|
|
443
|
+
linhas.push(m.titulo(r.catalogo));
|
|
440
444
|
linhas.push('');
|
|
441
445
|
if (r.canarios.length > 0) {
|
|
442
|
-
linhas.push(
|
|
446
|
+
linhas.push(m.canarios);
|
|
443
447
|
linhas.push('');
|
|
444
|
-
linhas.push((0, util_1.tabela)([
|
|
448
|
+
linhas.push((0, util_1.tabela)([...m.colunasCanarios], r.canarios.map((c) => [c.id, m.estados[c.estado] ?? c.estado, c.estado === 'passou' ? c.sobre : c.motivo || c.sobre])));
|
|
445
449
|
linhas.push('');
|
|
446
450
|
}
|
|
447
451
|
if (r.skills.length > 0) {
|
|
448
|
-
linhas.push(
|
|
452
|
+
linhas.push(m.skills);
|
|
449
453
|
linhas.push('');
|
|
450
|
-
linhas.push((0, util_1.tabela)([
|
|
454
|
+
linhas.push((0, util_1.tabela)([...m.colunasSkills], r.skills.map((s) => [s.skill, String(s.casos), String(s.assercoes), String(s.falhas)])));
|
|
451
455
|
linhas.push('');
|
|
452
456
|
}
|
|
453
457
|
if (r.falhas.length > 0) {
|
|
454
|
-
linhas.push(
|
|
458
|
+
linhas.push(m.falhas);
|
|
455
459
|
for (const f of r.falhas) {
|
|
456
460
|
const onde = [f.skill, f.caso].filter(Boolean).join(' :: ');
|
|
457
461
|
linhas.push(` [${f.codigo}] ${onde}`);
|
|
@@ -461,10 +465,9 @@ function textoDoEval(r) {
|
|
|
461
465
|
}
|
|
462
466
|
const passaram = r.canarios.filter((c) => c.estado === 'passou').length;
|
|
463
467
|
const indisponiveis = r.canarios.filter((c) => c.estado === 'unavailable').length;
|
|
464
|
-
linhas.push(
|
|
465
|
-
|
|
466
|
-
linhas.push(
|
|
467
|
-
linhas.push(
|
|
468
|
-
linhas.push(r.ok ? 'VEREDITO: verde' : 'VEREDITO: vermelho');
|
|
468
|
+
linhas.push(m.resumoCanarios(passaram, r.canarios.length, indisponiveis));
|
|
469
|
+
linhas.push(m.resumoSkills(r.skills.length, r.totalDeCasos, r.totalDeAssercoes, r.falhas.length));
|
|
470
|
+
linhas.push(m.metade);
|
|
471
|
+
linhas.push(m.veredito(r.ok));
|
|
469
472
|
return linhas.join('\n');
|
|
470
473
|
}
|
package/dist/fabrica-batida.js
CHANGED
|
@@ -74,6 +74,8 @@ const maquina_1 = require("./maquina");
|
|
|
74
74
|
const horario_1 = require("./horario");
|
|
75
75
|
const util_1 = require("./util");
|
|
76
76
|
const procedencia_1 = require("./procedencia");
|
|
77
|
+
const autorizacao_duravel_1 = require("./autorizacao-duravel");
|
|
78
|
+
const locale_1 = require("./locale");
|
|
77
79
|
/** O comentario no fim da linha que o `ork` instalou; o `sh` do cron o ignora. */
|
|
78
80
|
exports.MARCA_DA_BATIDA = '# ork-batida';
|
|
79
81
|
/** Os binarios que a varredura chama, alem do `node`: o runtime, a forja e o git. */
|
|
@@ -108,10 +110,12 @@ function transporteDoProjeto(raiz, dirMonitor) {
|
|
|
108
110
|
try {
|
|
109
111
|
(0, procedencia_1.exigirHostLocal)(raiz, arquivo);
|
|
110
112
|
const config = JSON.parse(fs.readFileSync(arquivo, 'utf8'));
|
|
111
|
-
|
|
113
|
+
// RM-063 (fatia 3, H4): o outro host configurado tambem precisa estar no PATH da batida.
|
|
114
|
+
const todos = [config, ...(Array.isArray(config.alternativos) ? config.alternativos : [])];
|
|
115
|
+
return todos.map((t) => (typeof t?.executavel === 'string' ? t.executavel.trim() : '')).filter(Boolean);
|
|
112
116
|
}
|
|
113
117
|
catch {
|
|
114
|
-
return
|
|
118
|
+
return [];
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
/**
|
|
@@ -132,8 +136,9 @@ function caminhoDaBatida(opcoes = {}) {
|
|
|
132
136
|
somar(opcoes.node ?? process.execPath);
|
|
133
137
|
for (const bin of BINARIOS_DA_VARREDURA)
|
|
134
138
|
somar(achar(bin));
|
|
135
|
-
|
|
136
|
-
somar(path.isAbsolute(
|
|
139
|
+
for (const t of typeof opcoes.transporte === 'string' ? [opcoes.transporte] : opcoes.transporte ?? []) {
|
|
140
|
+
somar(path.isAbsolute(t) ? t : achar(t));
|
|
141
|
+
}
|
|
137
142
|
for (const dir of PATH_DO_SISTEMA)
|
|
138
143
|
if (!dirs.includes(dir))
|
|
139
144
|
dirs.push(dir);
|
|
@@ -198,8 +203,15 @@ function estadoDaBatida(raizDoProjeto, opcoes = {}) {
|
|
|
198
203
|
instalada: gerenciadas.length + manuais.length > 0,
|
|
199
204
|
intervaloMin: ritmos.length ? Math.min(...ritmos) : null,
|
|
200
205
|
ultimaRodada: rodada ? { ...rodada, haMin: Math.max(0, Math.floor((Date.parse(quando) - Date.parse(rodada.em)) / 60000)) } : null,
|
|
206
|
+
...(opcoes.projeto ? { autorizacao: autorizacaoDaBatida(raiz, opcoes.projeto, quando) } : {}),
|
|
201
207
|
};
|
|
202
208
|
}
|
|
209
|
+
function autorizacaoDaBatida(raiz, projeto, quando) {
|
|
210
|
+
const l = (0, autorizacao_duravel_1.lerAutorizacao)(raiz, { projeto, agora: new Date(quando) });
|
|
211
|
+
const a = l.valida ? l.autorizacao : null;
|
|
212
|
+
return { estado: l.valida ? 'valida' : l.motivo === 'autorizacao.ausente' ? 'ausente' : 'invalida', motivo: l.valida ? null : l.motivo,
|
|
213
|
+
por: a?.por ?? null, ate: a?.ate ?? null, pode: a ? [...a.pode] : [], linha: (0, autorizacao_duravel_1.linhaDaAutorizacao)(l, quando) };
|
|
214
|
+
}
|
|
203
215
|
function lerParaEditar(executor) {
|
|
204
216
|
const leitura = executor.ler();
|
|
205
217
|
// Nunca gravar sem ter lido: um crontab que nao foi lido seria apagado pela gravacao.
|
|
@@ -273,38 +285,39 @@ function removerBatida(raizDoProjeto, opcoes = {}) {
|
|
|
273
285
|
return { acao: 'removeu', projeto: raiz, linha: null, retiradas: gerenciadas.map((l) => l.trim()), manuais: ficam, eventId };
|
|
274
286
|
}
|
|
275
287
|
function textoDoEstadoDaBatida(e, quando = new Date().toISOString()) {
|
|
276
|
-
const
|
|
288
|
+
const m = (0, locale_1.msg)().operacao.restante.fabrica.batida;
|
|
289
|
+
const linhas = [m.titulo(e.maquina, e.projeto)];
|
|
277
290
|
if (!e.leitura.ok)
|
|
278
|
-
linhas.push(
|
|
291
|
+
linhas.push(m.naoLido(e.leitura.motivo));
|
|
279
292
|
else if (!e.instalada)
|
|
280
|
-
linhas.push(
|
|
293
|
+
linhas.push(m.naoInstalada);
|
|
281
294
|
else {
|
|
282
|
-
const ritmo = e.intervaloMin === null ?
|
|
283
|
-
linhas.push(
|
|
295
|
+
const ritmo = e.intervaloMin === null ? m.horarioIlegivel : m.aCada(e.intervaloMin);
|
|
296
|
+
linhas.push(m.instalada(ritmo, !!e.gerenciada));
|
|
284
297
|
for (const l of [...(e.gerenciada ? [e.gerenciada] : []), ...e.manuais])
|
|
285
|
-
linhas.push(
|
|
298
|
+
linhas.push(m.linha(l));
|
|
286
299
|
}
|
|
287
300
|
const r = e.ultimaRodada;
|
|
288
301
|
if (!r)
|
|
289
|
-
linhas.push(
|
|
302
|
+
linhas.push(m.semRodada);
|
|
290
303
|
else {
|
|
291
|
-
linhas.push(
|
|
292
|
-
`${r.code === 0 ? 'ok' : `código ${r.code ?? '?'}`}: ${r.detalhe || 'sem detalhe'}`);
|
|
304
|
+
linhas.push(m.rodada((0, horario_1.formatarHora)(r.em, { agora: quando }), r.haMin, m.codigo(r.code), r.detalhe || m.semDetalhe));
|
|
293
305
|
if (e.instalada && r.haMin > doctor_pulse_cron_1.ATRASO_DA_BATIDA_MIN) {
|
|
294
|
-
linhas.push(
|
|
306
|
+
linhas.push(m.atrasada(r.haMin));
|
|
295
307
|
}
|
|
296
308
|
}
|
|
309
|
+
if (e.autorizacao)
|
|
310
|
+
linhas.push(` ${e.autorizacao.linha}`);
|
|
297
311
|
linhas.push((0, horario_1.legendaDoFuso)());
|
|
298
312
|
return linhas.join('\n');
|
|
299
313
|
}
|
|
300
314
|
function textoDoResultadoDaBatida(r) {
|
|
315
|
+
const m = (0, locale_1.msg)().operacao.restante.fabrica.batida;
|
|
301
316
|
switch (r.acao) {
|
|
302
|
-
case 'ja-instalada': return
|
|
303
|
-
case 'instalou': return [
|
|
304
|
-
...r.retiradas.map(
|
|
305
|
-
case 'removeu': return [
|
|
306
|
-
|
|
307
|
-
case 'nao-instalada': return [`Nenhuma batida do ork instalada para ${r.projeto}; nada mudou no crontab.`,
|
|
308
|
-
...r.manuais.map((l) => ` ficou (posta à mão, não é do ork): ${l}`)].join('\n');
|
|
317
|
+
case 'ja-instalada': return m.jaInstalada(r.projeto, r.linha);
|
|
318
|
+
case 'instalou': return [m.instalou(r.projeto, r.eventId), m.linha(r.linha),
|
|
319
|
+
...r.retiradas.map(m.saiu), m.confira].join('\n');
|
|
320
|
+
case 'removeu': return [m.removeu(r.projeto, r.eventId), ...r.retiradas.map(m.saiu), ...r.manuais.map(m.ficou)].join('\n');
|
|
321
|
+
case 'nao-instalada': return [m.nenhumaInstalada(r.projeto), ...r.manuais.map(m.ficou)].join('\n');
|
|
309
322
|
}
|
|
310
323
|
}
|
package/dist/fabrica-estado.js
CHANGED
|
@@ -84,6 +84,7 @@ const util_1 = require("./util");
|
|
|
84
84
|
const versao_1 = require("./versao");
|
|
85
85
|
const saida_segura_1 = require("./saida-segura");
|
|
86
86
|
const vida_da_thread_1 = require("./vida-da-thread");
|
|
87
|
+
const locale_1 = require("./locale");
|
|
87
88
|
exports.CONTRATO_MAQUINA = 'ork.fabrica-maquina/v1';
|
|
88
89
|
exports.BRANCH_DA_FABRICA = 'ork/fabrica-estado';
|
|
89
90
|
/** O diretorio dos retratos na branch; a leitura sem clone (RM-054) le o mesmo. */
|
|
@@ -352,14 +353,14 @@ function sessaoNaFabrica(t, teto) {
|
|
|
352
353
|
return v.viva ? 'viva' : v.motivo === null ? '-' : curto((0, vida_da_thread_1.paradaDesde)(v), teto);
|
|
353
354
|
}
|
|
354
355
|
function blocoDaMaquina(m, eu) {
|
|
356
|
+
const t = (0, locale_1.msg)().operacao.restante.fabrica;
|
|
355
357
|
const vivas = ativas(m), entregues = m.threads.length - vivas.length;
|
|
356
|
-
const cabeca =
|
|
357
|
-
`${vivas.length} thread(s) ativa(s)` + (entregues ? `, ${entregues} entregue(s) sem MASTER` : '');
|
|
358
|
+
const cabeca = t.maquina(m.maquina, m.maquina === eu ? t.estaMaquina : '', m.por, (0, horario_1.formatarDataHora)(m.publicadoEm), vivas.length, entregues);
|
|
358
359
|
if (vivas.length === 0)
|
|
359
360
|
return [cabeca];
|
|
360
|
-
return [cabeca, ...tabela([
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
return [cabeca, ...tabela([...t.colunas], vivas.map((thread) => [
|
|
362
|
+
thread.id, thread.modo, thread.fase, runtimeDaThread(thread), thread.roadmap ?? '-',
|
|
363
|
+
thread.esperaVoce ? t.espera(curto(thread.pergunta ?? t.veredito, 40)) : '-', sessaoNaFabrica(thread, 70),
|
|
363
364
|
]))];
|
|
364
365
|
}
|
|
365
366
|
/**
|
|
@@ -368,12 +369,13 @@ function blocoDaMaquina(m, eu) {
|
|
|
368
369
|
* que o terminal execute.
|
|
369
370
|
*/
|
|
370
371
|
function textoDaFabrica(painel, eu) {
|
|
372
|
+
const t = (0, locale_1.msg)().operacao.restante.fabrica;
|
|
371
373
|
const p = (0, saida_segura_1.valoresEmUmaLinha)(painel);
|
|
372
374
|
const linhas = [];
|
|
373
375
|
if (!p.atualizado)
|
|
374
|
-
linhas.push(
|
|
376
|
+
linhas.push(t.copia, '');
|
|
375
377
|
if (p.maquinas.length === 0) {
|
|
376
|
-
linhas.push(
|
|
378
|
+
linhas.push(t.nenhuma(exports.BRANCH_DA_FABRICA));
|
|
377
379
|
return linhas.join('\n');
|
|
378
380
|
}
|
|
379
381
|
for (const m of p.maquinas)
|
|
@@ -383,12 +385,13 @@ function textoDaFabrica(painel, eu) {
|
|
|
383
385
|
}
|
|
384
386
|
/** A secao de `ork board` com as outras maquinas, saneada como o `ork fabrica`. */
|
|
385
387
|
function textoDasOutrasMaquinas(painel, eu) {
|
|
388
|
+
const t = (0, locale_1.msg)().operacao.restante.fabrica;
|
|
386
389
|
const p = (0, saida_segura_1.valoresEmUmaLinha)(painel);
|
|
387
390
|
const outras = p.maquinas.filter((m) => m.maquina !== eu);
|
|
388
|
-
const origem = p.atualizado ?
|
|
391
|
+
const origem = p.atualizado ? t.origens.atual : t.origens.copia;
|
|
389
392
|
if (outras.length === 0)
|
|
390
|
-
return
|
|
391
|
-
const linhas = [
|
|
393
|
+
return t.outrasNenhuma(exports.BRANCH_DA_FABRICA, origem);
|
|
394
|
+
const linhas = [t.outras(exports.BRANCH_DA_FABRICA, origem)];
|
|
392
395
|
for (const m of outras)
|
|
393
396
|
linhas.push(...blocoDaMaquina(m, eu).map((l, i) => (i === 0 ? ` ${l}` : l)));
|
|
394
397
|
return linhas.join('\n');
|
package/dist/fix.js
CHANGED
|
@@ -75,6 +75,7 @@ const thread_1 = require("./thread");
|
|
|
75
75
|
const util_1 = require("./util");
|
|
76
76
|
const verify_1 = require("./verify");
|
|
77
77
|
const conducao_1 = require("./conducao");
|
|
78
|
+
const locale_1 = require("./locale");
|
|
78
79
|
/** Armazem append-only das correcoes da thread. */
|
|
79
80
|
function caminhoDosFixes(raiz, threadId) {
|
|
80
81
|
return path.join((0, thread_1.dirThread)(raiz, threadId), 'fixes.jsonl');
|
|
@@ -418,25 +419,25 @@ function rodadasGastas(raiz, threadId) {
|
|
|
418
419
|
}
|
|
419
420
|
/** Texto de `ork fix open`. */
|
|
420
421
|
function textoDaRodada(r) {
|
|
422
|
+
const m = (0, locale_1.msg)().operacao.restante.fix;
|
|
421
423
|
if (r.correcoes.length === 0) {
|
|
422
|
-
return (
|
|
423
|
-
' (nenhum motivo tipado bloqueante em `ork verify`)');
|
|
424
|
+
return m.semCorrecoes(r.thread);
|
|
424
425
|
}
|
|
425
426
|
const linhas = [];
|
|
426
|
-
linhas.push(
|
|
427
|
-
linhas.push(
|
|
428
|
-
linhas.push(
|
|
429
|
-
linhas.push(
|
|
427
|
+
linhas.push(m.aberto(r.thread, r.rodada));
|
|
428
|
+
linhas.push(m.veredito(m.vereditos[r.veredito] ?? r.veredito));
|
|
429
|
+
linhas.push(m.motivos(r.motivos.join(', ')));
|
|
430
|
+
linhas.push(m.reexecucao(r.temTipoB));
|
|
430
431
|
linhas.push('');
|
|
431
|
-
linhas.push((0, util_1.tabela)([
|
|
432
|
+
linhas.push((0, util_1.tabela)([...m.colunas], r.correcoes.map((c) => [
|
|
432
433
|
c.id,
|
|
433
434
|
c.tipo,
|
|
434
435
|
c.origem,
|
|
435
436
|
c.alvo,
|
|
436
|
-
c.verificar.join(' && ') ||
|
|
437
|
+
c.verificar.join(' && ') || m.verifyCompleto,
|
|
437
438
|
])));
|
|
438
439
|
linhas.push('');
|
|
439
|
-
linhas.push(
|
|
440
|
+
linhas.push(m.spec);
|
|
440
441
|
linhas.push('');
|
|
441
442
|
for (const l of r.spec.split('\n'))
|
|
442
443
|
linhas.push(` ${l}`);
|
|
@@ -444,29 +445,30 @@ function textoDaRodada(r) {
|
|
|
444
445
|
}
|
|
445
446
|
/** Texto de `ork fix reverify`. */
|
|
446
447
|
function textoDoReverify(r) {
|
|
448
|
+
const m = (0, locale_1.msg)().operacao.restante.fix;
|
|
447
449
|
const linhas = [];
|
|
448
|
-
linhas.push(
|
|
449
|
-
linhas.push(
|
|
450
|
-
linhas.push(
|
|
450
|
+
linhas.push(m.reverify(r.thread, r.rodada));
|
|
451
|
+
linhas.push(m.cobertura(m.coberturas[r.cobertura] ?? r.cobertura));
|
|
452
|
+
linhas.push(m.rodadas(r.rodadas, r.limite));
|
|
451
453
|
linhas.push('');
|
|
452
|
-
linhas.push(
|
|
454
|
+
linhas.push(m.porCorrecao);
|
|
453
455
|
for (const v of r.vereditos) {
|
|
454
|
-
linhas.push(
|
|
455
|
-
linhas.push(
|
|
456
|
+
linhas.push(m.correcao(v.correcao.id, v.correcao.tipo, v.aprovada, v.correcao.alvo));
|
|
457
|
+
linhas.push(m.origem(v.correcao.origem));
|
|
456
458
|
linhas.push(` ${v.detalhe}`);
|
|
457
459
|
for (const e of v.execucoes) {
|
|
458
|
-
linhas.push(
|
|
460
|
+
linhas.push(m.execucao(e.ok, e.comando));
|
|
459
461
|
}
|
|
460
462
|
}
|
|
461
463
|
if (r.verify) {
|
|
462
464
|
linhas.push('');
|
|
463
|
-
linhas.push(
|
|
465
|
+
linhas.push(m.verify((0, util_1.shaCurto)(r.verify.commit), r.verify.ok, r.verify.motivos.join(', ')));
|
|
464
466
|
}
|
|
465
467
|
linhas.push('');
|
|
466
|
-
linhas.push(
|
|
468
|
+
linhas.push(m.final(m.vereditos[r.veredito] ?? r.veredito));
|
|
467
469
|
linhas.push(` ${r.razao}`);
|
|
468
470
|
if (r.escalado) {
|
|
469
|
-
linhas.push(
|
|
471
|
+
linhas.push(m.escalado);
|
|
470
472
|
}
|
|
471
473
|
return linhas.join('\n');
|
|
472
474
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CAPACIDADES = void 0;
|
|
4
|
+
/** Todas as capacidades, na ordem em que o `doctor` as mostra. */
|
|
5
|
+
exports.CAPACIDADES = ['checksNoCommit', 'estadoDeCi', 'pedidoMesclado', 'branchPadrao', 'pontaDaBranch',
|
|
6
|
+
'comparar', 'pedidosDaBranch', 'abrirPedido', 'metadados', 'pedidosAbertos', 'donoDaRede'];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ambienteDeCi = ambienteDeCi;
|
|
4
|
+
const CAMINHO = /^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)+$/;
|
|
5
|
+
/** A pagina web, sem credencial na URL (`user:senha@`): a URL vai ao JSON do `ork ci run`. */
|
|
6
|
+
const URL_WEB = /^https?:\/\/(?![^/]*@)\S+$/;
|
|
7
|
+
const NUMERO = /^\d+$/;
|
|
8
|
+
function valor(v, forma) {
|
|
9
|
+
const t = v?.trim();
|
|
10
|
+
if (!t || /\p{Cc}/u.test(t))
|
|
11
|
+
return null;
|
|
12
|
+
return !forma || forma.test(t) ? t : null;
|
|
13
|
+
}
|
|
14
|
+
function ambienteDeCi(env = process.env) {
|
|
15
|
+
if (env.GITLAB_CI === 'true') {
|
|
16
|
+
return { tipo: 'gitlab', produtor: 'gitlab-ci', repository: valor(env.CI_PROJECT_PATH, CAMINHO),
|
|
17
|
+
branch: valor(env.CI_MERGE_REQUEST_SOURCE_BRANCH_NAME) ?? valor(env.CI_COMMIT_BRANCH), url: valor(env.CI_JOB_URL, URL_WEB) };
|
|
18
|
+
}
|
|
19
|
+
if (env.GITHUB_ACTIONS === 'true') {
|
|
20
|
+
const repository = valor(env.GITHUB_REPOSITORY, CAMINHO);
|
|
21
|
+
const servidor = valor(env.GITHUB_SERVER_URL, URL_WEB), run = valor(env.GITHUB_RUN_ID, NUMERO);
|
|
22
|
+
return { tipo: 'github', produtor: 'github-actions', repository,
|
|
23
|
+
branch: valor(env.GITHUB_HEAD_REF) ?? (env.GITHUB_REF_TYPE === 'branch' ? valor(env.GITHUB_REF_NAME) : null),
|
|
24
|
+
url: servidor && repository && run ? `${servidor}/${repository}/actions/runs/${run}` : null };
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|