@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
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.CONTRATO_DA_ATUALIZACAO = void 0;
|
|
37
|
+
exports.atualizarBranchDaThread = atualizarBranchDaThread;
|
|
38
|
+
exports.textoDaAtualizacao = textoDaAtualizacao;
|
|
39
|
+
/**
|
|
40
|
+
* RM-063 (F7): o merge da base remota na branch da thread, com a reconciliacao deterministica do CHANGELOG.
|
|
41
|
+
*
|
|
42
|
+
* Incidente de 12 e 13/10/2026: os PRs #153 e #154 ficaram prontos e esperaram de 5 a 6 horas pelo condutor, e cada
|
|
43
|
+
* merge da outra maquina na `main` reabriu o conflito no CHANGELOG; o condutor resolvia a mao, com um script. Aqui o
|
|
44
|
+
* mesmo passo, sob a conducao da thread (`branch.atualizar`, exclusiva com despacho e verify na mesma worktree):
|
|
45
|
+
*
|
|
46
|
+
* - traz a base remota e faz o merge dela na branch, na worktree da thread, sem commit ainda;
|
|
47
|
+
* - conflito em qualquer arquivo que nao seja o CHANGELOG aborta o merge e volta com a lista: conflito em codigo
|
|
48
|
+
* nunca e resolvido sozinho, e vira item da fila do dono;
|
|
49
|
+
* - com conflito so no CHANGELOG, ou sem conflito, os itens da thread voltam a `## Não publicado`, no mesmo grupo
|
|
50
|
+
* (`changelog-reconciliacao.ts`), e o merge e commitado;
|
|
51
|
+
* - com `enviar`, empurra a branch sem forca e prova pelo `git ls-remote`.
|
|
52
|
+
*
|
|
53
|
+
* A worktree com alteracao nao commitada, outra branch ou um merge em curso recusa antes de tocar em qualquer coisa.
|
|
54
|
+
*/
|
|
55
|
+
const fs = __importStar(require("node:fs"));
|
|
56
|
+
const path = __importStar(require("node:path"));
|
|
57
|
+
const changelog_reconciliacao_1 = require("./changelog-reconciliacao");
|
|
58
|
+
const conducao_1 = require("./conducao");
|
|
59
|
+
const estado_thread_1 = require("./estado-thread");
|
|
60
|
+
const noctum_guarda_1 = require("./noctum-guarda");
|
|
61
|
+
const procedencia_1 = require("./procedencia");
|
|
62
|
+
const thread_1 = require("./thread");
|
|
63
|
+
const util_1 = require("./util");
|
|
64
|
+
const worktree_1 = require("./worktree");
|
|
65
|
+
const locale_1 = require("./locale");
|
|
66
|
+
exports.CONTRATO_DA_ATUALIZACAO = 'ork.branch-atualizada/v1';
|
|
67
|
+
/** O teto do merge e do push juntos: a conducao da thread vale por isto, com folga. */
|
|
68
|
+
const PRAZO_DA_ATUALIZACAO_MS = 10 * 60 * 1000;
|
|
69
|
+
const AMBIENTE_DO_GIT = () => ({ ...process.env, GIT_TERMINAL_PROMPT: '0', GIT_MERGE_AUTOEDIT: 'no',
|
|
70
|
+
GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? 'ssh -o BatchMode=yes' });
|
|
71
|
+
/** O CHANGELOG numa revisao; `null` quando ele nao existe nela. */
|
|
72
|
+
function changelogEm(dir, ref) {
|
|
73
|
+
const r = (0, util_1.exec)('git', ['show', `${ref}:${changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG}`], dir, 30000);
|
|
74
|
+
return r.ok ? r.stdout : null;
|
|
75
|
+
}
|
|
76
|
+
/** Os arquivos em conflito do merge em curso. */
|
|
77
|
+
function emConflito(dir) {
|
|
78
|
+
const r = (0, util_1.exec)('git', ['diff', '--name-only', '--diff-filter=U', '-z'], dir, 30000);
|
|
79
|
+
return r.ok ? r.stdout.split('\0').filter(Boolean).sort() : null;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Faz o merge da base remota na branch da thread, sob a conducao dela. Nunca resolve conflito em codigo: aborta e
|
|
83
|
+
* devolve a lista. Recusa (com motivo tipado) antes de mexer na worktree que nao esta pronta.
|
|
84
|
+
*/
|
|
85
|
+
function atualizarBranchDaThread(carregado, threadId, opcoes = {}) {
|
|
86
|
+
const raiz = (0, estado_thread_1.raizDoEstado)(carregado.raiz);
|
|
87
|
+
const remoto = carregado.manifesto.fabrica.remoto, base = carregado.manifesto.worktree.base_branch;
|
|
88
|
+
const t = (0, thread_1.lerThread)(raiz, threadId);
|
|
89
|
+
const branch = (0, worktree_1.branchDaWorktree)(t);
|
|
90
|
+
const cabeca = { contrato: exports.CONTRATO_DA_ATUALIZACAO, thread: t.id, branch, base: `${remoto}/${base}` };
|
|
91
|
+
const recusa = (motivo, detalhe) => ({ ...cabeca, acao: 'recusada', motivo, detalhe });
|
|
92
|
+
// RM-058, integracao (T1.1, D3 da ork-rm058integra): a branch da thread de um arco #Noctum e atualizada pelo passo da
|
|
93
|
+
// entrega do arco, com a regra do CHANGELOG dele; por fora, nem o comando nem a batida a mesclam.
|
|
94
|
+
const guarda = (0, noctum_guarda_1.guardaDaThread)(raiz, t.id);
|
|
95
|
+
if (guarda)
|
|
96
|
+
return recusa(guarda.motivo, guarda.texto);
|
|
97
|
+
let dir;
|
|
98
|
+
try {
|
|
99
|
+
dir = (0, procedencia_1.diretorioDaThread)(raiz, t);
|
|
100
|
+
}
|
|
101
|
+
catch (e) {
|
|
102
|
+
return recusa('worktree-ausente', e.message);
|
|
103
|
+
}
|
|
104
|
+
if (!t.worktree || !fs.existsSync(dir))
|
|
105
|
+
return recusa('worktree-ausente', `a thread ${t.id} não tem worktree nesta máquina`);
|
|
106
|
+
try {
|
|
107
|
+
// A sessao despachada que conduz a thread reentra pela identidade de despacho dela, como o `ork verify` (R3).
|
|
108
|
+
return (0, conducao_1.comConducao)(raiz, t.id, { canal: opcoes.canal ?? 'cli', correlacao: opcoes.correlacao ?? null, operacao: 'branch.atualizar',
|
|
109
|
+
fase: null, promptSha256: null, prazoMs: PRAZO_DA_ATUALIZACAO_MS, identidade: (0, conducao_1.identidadeDoAmbiente)(t.id, process.env, raiz),
|
|
110
|
+
...(opcoes.esperarMs ? { esperarMs: opcoes.esperarMs } : {}) }, () => mesclar(dir, branch, remoto, base, opcoes, cabeca, recusa));
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
if (e instanceof conducao_1.ErroDeConducao)
|
|
114
|
+
return recusa('conduzida', e.recusa.texto.split('\n').slice(0, 2).join(' '));
|
|
115
|
+
throw e;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function mesclar(dir, branch, remoto, base, opcoes, cabeca, recusa) {
|
|
119
|
+
const env = AMBIENTE_DO_GIT();
|
|
120
|
+
const git = (args, prazo = 60000) => (0, util_1.exec)('git', args, dir, prazo, env);
|
|
121
|
+
const atual = git(['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
122
|
+
if (!atual.ok)
|
|
123
|
+
return recusa('git-sem-resposta', `git rev-parse saiu ${atual.code}: ${atual.stderr.trim().slice(0, 160)}`);
|
|
124
|
+
if (atual.stdout.trim() !== branch)
|
|
125
|
+
return recusa('branch-errada', `a worktree está na branch ${atual.stdout.trim()}, e a da thread é ${branch}`);
|
|
126
|
+
if (git(['rev-parse', '-q', '--verify', 'MERGE_HEAD']).ok)
|
|
127
|
+
return recusa('merge-em-curso', 'há um merge em curso na worktree');
|
|
128
|
+
const status = git(['status', '--porcelain', '--', '.', ':(exclude).orkastery']);
|
|
129
|
+
if (!status.ok)
|
|
130
|
+
return recusa('git-sem-resposta', `git status saiu ${status.code}`);
|
|
131
|
+
if (status.stdout.trim())
|
|
132
|
+
return recusa('worktree-suja', 'a worktree tem alteração não commitada; o merge não vai por cima dela');
|
|
133
|
+
if (opcoes.buscar !== false) {
|
|
134
|
+
const f = git(['fetch', '-q', '--no-tags', '--', remoto, `+refs/heads/${base}:refs/remotes/${remoto}/${base}`], 120000);
|
|
135
|
+
if (!f.ok)
|
|
136
|
+
return recusa('git-sem-resposta', `git fetch ${remoto} ${base} saiu ${f.error ?? f.code}: ${f.stderr.trim().split('\n')[0]?.slice(0, 160) ?? ''}`);
|
|
137
|
+
}
|
|
138
|
+
const deles = `refs/remotes/${remoto}/${base}`;
|
|
139
|
+
const ponta = git(['rev-parse', '--verify', '-q', `${deles}^{commit}`]);
|
|
140
|
+
if (!ponta.ok)
|
|
141
|
+
return recusa('base-ausente', `a cópia da base ${remoto}/${base} não existe neste repositório`);
|
|
142
|
+
if (opcoes.alinharCom && git(['rev-parse', 'HEAD']).stdout.trim() !== opcoes.alinharCom) {
|
|
143
|
+
if (!git(['merge-base', '--is-ancestor', 'HEAD', opcoes.alinharCom]).ok) {
|
|
144
|
+
return recusa('branch-desalinhada', `a branch local divergiu do head do PR (${opcoes.alinharCom.slice(0, 8)}): o merge não vai por cima`);
|
|
145
|
+
}
|
|
146
|
+
const ff = git(['merge', '--ff-only', '-q', opcoes.alinharCom], 120000);
|
|
147
|
+
if (!ff.ok)
|
|
148
|
+
return recusa('git-sem-resposta', `git merge --ff-only saiu ${ff.code}: ${(ff.stderr || ff.stdout).trim().split('\n')[0]?.slice(0, 160) ?? ''}`);
|
|
149
|
+
}
|
|
150
|
+
const shaAntes = git(['rev-parse', 'HEAD']).stdout.trim();
|
|
151
|
+
// O push nunca leva tag (push.followTags do usuario poria a tag de versao no remoto e dispararia a publicacao) nem forca.
|
|
152
|
+
const empurrar = (sha) => {
|
|
153
|
+
const p = git(['push', '-q', '--no-follow-tags', '--', remoto, `HEAD:refs/heads/${branch}`], 120000);
|
|
154
|
+
const remota = git(['ls-remote', '--', remoto, `refs/heads/${branch}`], 60000).stdout.split(/\s+/)[0] ?? '';
|
|
155
|
+
return p.ok && remota === sha ? null : `o merge ${sha.slice(0, 8)} ficou só nesta máquina: git push saiu ${p.code}` +
|
|
156
|
+
(remota ? `, e o remoto está em ${remota.slice(0, 8)}` : '');
|
|
157
|
+
};
|
|
158
|
+
if (git(['merge-base', '--is-ancestor', deles, 'HEAD']).ok) {
|
|
159
|
+
// Ja contem a base. Com `enviar`, a branch remota atras da local (o push que falhou na rodada anterior) e empurrada;
|
|
160
|
+
// a remota que andou para outro lado nao e sobrescrita.
|
|
161
|
+
let enviada = false;
|
|
162
|
+
if (opcoes.enviar) {
|
|
163
|
+
const remota = git(['ls-remote', '--', remoto, `refs/heads/${branch}`], 60000).stdout.split(/\s+/)[0] ?? '';
|
|
164
|
+
if (remota !== shaAntes) {
|
|
165
|
+
if (remota && !git(['merge-base', '--is-ancestor', remota, 'HEAD']).ok) {
|
|
166
|
+
return recusa('push-recusado', `o remoto da ${branch} está em ${remota.slice(0, 8)}, fora da história local: nada é empurrado por cima`);
|
|
167
|
+
}
|
|
168
|
+
const falha = empurrar(shaAntes);
|
|
169
|
+
if (falha)
|
|
170
|
+
return recusa('push-recusado', falha);
|
|
171
|
+
enviada = true;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return { ...cabeca, acao: 'ja-atualizada', sha: shaAntes, enviada };
|
|
175
|
+
}
|
|
176
|
+
const m = git(['merge', '--no-ff', '--no-commit', '--', deles], 120000);
|
|
177
|
+
const conflitos = emConflito(dir);
|
|
178
|
+
if (conflitos === null) {
|
|
179
|
+
git(['merge', '--abort']);
|
|
180
|
+
return recusa('git-sem-resposta', 'o git não disse os arquivos em conflito');
|
|
181
|
+
}
|
|
182
|
+
if (!m.ok && !git(['rev-parse', '-q', '--verify', 'MERGE_HEAD']).ok) {
|
|
183
|
+
return recusa('git-sem-resposta', `git merge saiu ${m.code}: ${(m.stderr || m.stdout).trim().split('\n')[0]?.slice(0, 160) ?? ''}`);
|
|
184
|
+
}
|
|
185
|
+
const emCodigo = conflitos.filter((a) => a !== changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG);
|
|
186
|
+
if (emCodigo.length) {
|
|
187
|
+
git(['merge', '--abort']);
|
|
188
|
+
return { ...cabeca, acao: 'conflito-em-codigo', arquivos: emCodigo };
|
|
189
|
+
}
|
|
190
|
+
// O CHANGELOG: os itens da thread voltam a "Não publicado", no mesmo grupo, com ou sem conflito nele.
|
|
191
|
+
let changelog = null;
|
|
192
|
+
const arquivo = path.join(dir, changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG);
|
|
193
|
+
const nosso = changelogEm(dir, 'HEAD'), delesTexto = changelogEm(dir, deles);
|
|
194
|
+
if (nosso !== null && delesTexto !== null) {
|
|
195
|
+
const mb = git(['merge-base', 'HEAD', deles]);
|
|
196
|
+
const baseTexto = mb.ok ? changelogEm(dir, mb.stdout.trim()) ?? '' : '';
|
|
197
|
+
const conflitou = conflitos.includes(changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG);
|
|
198
|
+
const mesclado = conflitou ? null : fs.readFileSync(arquivo, 'utf8');
|
|
199
|
+
const r = (0, changelog_reconciliacao_1.reconciliarChangelog)({ base: baseTexto, nosso, deles: delesTexto, mesclado });
|
|
200
|
+
// A reconciliacao so devolve itens de lista; a linha que a thread acrescentou e nao voltou (outra forma de item,
|
|
201
|
+
// edicao numa versao publicada) nunca some calada: o merge e abortado e fica com o dono.
|
|
202
|
+
if ((0, changelog_reconciliacao_1.temMarcadorDeConflito)(r.texto) || r.perdidas.length) {
|
|
203
|
+
git(['merge', '--abort']);
|
|
204
|
+
return { ...cabeca, acao: 'conflito-em-codigo', arquivos: [changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG] };
|
|
205
|
+
}
|
|
206
|
+
if (conflitou || r.texto !== mesclado) {
|
|
207
|
+
fs.writeFileSync(arquivo, r.texto, 'utf8');
|
|
208
|
+
if (!git(['add', '--', changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG]).ok) {
|
|
209
|
+
git(['merge', '--abort']);
|
|
210
|
+
return recusa('git-sem-resposta', 'git add do CHANGELOG falhou');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
changelog = { devolvidos: r.devolvidos, itens: r.itens };
|
|
214
|
+
}
|
|
215
|
+
else if (conflitos.includes(changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG)) {
|
|
216
|
+
git(['merge', '--abort']);
|
|
217
|
+
return { ...cabeca, acao: 'conflito-em-codigo', arquivos: [changelog_reconciliacao_1.ARQUIVO_DO_CHANGELOG] };
|
|
218
|
+
}
|
|
219
|
+
const titulo = `Merge da ${remoto}/${base} na ${branch}` +
|
|
220
|
+
(changelog?.devolvidos ? `: ${changelog.devolvidos} item(ns) da thread de volta a "Não publicado" do CHANGELOG` : '');
|
|
221
|
+
const c = git(['commit', '-q', '--no-edit', '-m', titulo], 120000);
|
|
222
|
+
if (!c.ok) {
|
|
223
|
+
git(['merge', '--abort']);
|
|
224
|
+
return recusa('git-sem-resposta', `git commit do merge saiu ${c.code}: ${(c.stderr || c.stdout).trim().split('\n')[0]?.slice(0, 160) ?? ''}`);
|
|
225
|
+
}
|
|
226
|
+
const sha = git(['rev-parse', 'HEAD']).stdout.trim();
|
|
227
|
+
let enviada = false;
|
|
228
|
+
if (opcoes.enviar) {
|
|
229
|
+
const falha = empurrar(sha);
|
|
230
|
+
if (falha)
|
|
231
|
+
return recusa('push-recusado', falha);
|
|
232
|
+
enviada = true;
|
|
233
|
+
}
|
|
234
|
+
return { ...cabeca, acao: 'mesclada', sha, shaAntes, changelog, enviada };
|
|
235
|
+
}
|
|
236
|
+
/** Uma linha para o terminal e para o resumo ao dono. */
|
|
237
|
+
function textoDaAtualizacao(r) {
|
|
238
|
+
const m = (0, locale_1.msg)().conducao.atualizacao;
|
|
239
|
+
switch (r.acao) {
|
|
240
|
+
case 'ja-atualizada': return m.atualizada(r.branch, r.base, r.enviada);
|
|
241
|
+
case 'mesclada': return m.mesclada(r.base, r.branch, r.sha.slice(0, 8), r.changelog?.devolvidos ?? 0, r.enviada);
|
|
242
|
+
case 'conflito-em-codigo': return m.conflito(r.base, r.branch, r.arquivos.join(', '));
|
|
243
|
+
default: return m.recusada(r.branch, r.motivo, r.detalhe);
|
|
244
|
+
}
|
|
245
|
+
}
|
package/dist/auditoria.js
CHANGED
|
@@ -78,6 +78,7 @@ const gates_1 = require("./gates");
|
|
|
78
78
|
const prompts_1 = require("./prompts");
|
|
79
79
|
const util_1 = require("./util");
|
|
80
80
|
const horario_1 = require("./horario");
|
|
81
|
+
const locale_1 = require("./locale");
|
|
81
82
|
// ---------------------------------------------------------------------------
|
|
82
83
|
// Motivos tipados da auditoria
|
|
83
84
|
// ---------------------------------------------------------------------------
|
|
@@ -476,9 +477,10 @@ function packAtivo(pack, estagio) {
|
|
|
476
477
|
}
|
|
477
478
|
/** Tabela de `ork audit packs`. */
|
|
478
479
|
function tabelaDePacks(estagio) {
|
|
480
|
+
const m = (0, locale_1.msg)().audit.packs;
|
|
479
481
|
const linhas = exports.ORDEM_DOS_PACKS.map((id) => {
|
|
480
482
|
const p = exports.PACKS[id];
|
|
481
|
-
const ativo = estagio ? (packAtivo(id, estagio) ?
|
|
483
|
+
const ativo = estagio ? (packAtivo(id, estagio) ? m.sim : m.nao) : '-';
|
|
482
484
|
return [
|
|
483
485
|
p.id,
|
|
484
486
|
p.estagioMinimo,
|
|
@@ -489,31 +491,31 @@ function tabelaDePacks(estagio) {
|
|
|
489
491
|
p.titulo,
|
|
490
492
|
];
|
|
491
493
|
});
|
|
492
|
-
const cabecalho = (0, util_1.tabela)([
|
|
493
|
-
const rodape = ['',
|
|
494
|
+
const cabecalho = (0, util_1.tabela)([...m.cabecalho], linhas);
|
|
495
|
+
const rodape = ['', m.hardening];
|
|
494
496
|
for (const e of exports.ORDEM_DOS_ESTAGIOS) {
|
|
495
497
|
rodape.push(` ${e.padEnd(10)} ${packsAtivos(e).join(', ')}` +
|
|
496
|
-
`\n ${' '.repeat(10)}
|
|
498
|
+
`\n ${' '.repeat(10)} ${m.posturaLinha(exports.DESCRICAO_DA_POSTURA[exports.POSTURA_DO_ESTAGIO[e]])}`);
|
|
497
499
|
}
|
|
498
500
|
return cabecalho + '\n' + rodape.join('\n');
|
|
499
501
|
}
|
|
500
502
|
/** Detalhe de um pack: as regras e as evidencias que ele exige. */
|
|
501
503
|
function textoDoPack(pack, estagio) {
|
|
502
504
|
const p = exports.PACKS[pack];
|
|
505
|
+
const m = (0, locale_1.msg)().audit.packs.detalhe;
|
|
503
506
|
const linhas = [];
|
|
504
|
-
linhas.push(
|
|
507
|
+
linhas.push(m.titulo(p.id, p.titulo));
|
|
505
508
|
linhas.push(` ${p.objetivo}`);
|
|
506
|
-
linhas.push(
|
|
507
|
-
linhas.push(
|
|
509
|
+
linhas.push(m.ativoDesde(p.estagioMinimo));
|
|
510
|
+
linhas.push(m.fonte(p.fonte === 'ledger' ? m.fonteLedger : m.fonteCodigo));
|
|
508
511
|
if (estagio) {
|
|
509
|
-
linhas.push(
|
|
510
|
-
(packAtivo(pack, estagio) ? `, postura ${posturaDoPack(estagio)}` : ''));
|
|
512
|
+
linhas.push(m.nesteProjeto(estagio, packAtivo(pack, estagio), posturaDoPack(estagio)));
|
|
511
513
|
}
|
|
512
514
|
linhas.push('');
|
|
513
|
-
linhas.push(
|
|
515
|
+
linhas.push(m.regras);
|
|
514
516
|
for (const r of p.regras) {
|
|
515
517
|
linhas.push(` ${r.id} ${r.regra}`);
|
|
516
|
-
linhas.push(
|
|
518
|
+
linhas.push(m.evidencia(r.evidencia));
|
|
517
519
|
}
|
|
518
520
|
linhas.push('');
|
|
519
521
|
linhas.push(' Evidencias da rodada:');
|
package/dist/auditrun.js
CHANGED
|
@@ -87,6 +87,7 @@ const thread_1 = require("./thread");
|
|
|
87
87
|
const util_1 = require("./util");
|
|
88
88
|
const verify_1 = require("./verify");
|
|
89
89
|
const horario_1 = require("./horario");
|
|
90
|
+
const locale_1 = require("./locale");
|
|
90
91
|
/** Versao do formato de `run.json`. */
|
|
91
92
|
exports.VERSAO_DA_RODADA = 1;
|
|
92
93
|
/** Diretorio das rodadas de auditoria do projeto. */
|
|
@@ -759,9 +760,10 @@ function relatorioDaRodada(carregado, rodadaId, opcoes = {}) {
|
|
|
759
760
|
// ---------------------------------------------------------------------------
|
|
760
761
|
/** Tabela de `ork audit list`. */
|
|
761
762
|
function tabelaDeRodadas(raiz) {
|
|
763
|
+
const m = (0, locale_1.msg)().audit.rodadas;
|
|
762
764
|
const ids = listarRodadas(raiz);
|
|
763
765
|
if (ids.length === 0) {
|
|
764
|
-
return
|
|
766
|
+
return m.vazia;
|
|
765
767
|
}
|
|
766
768
|
const linhas = ids.map((id) => {
|
|
767
769
|
const r = lerRodada(raiz, id);
|
|
@@ -773,92 +775,93 @@ function tabelaDeRodadas(raiz) {
|
|
|
773
775
|
r.status,
|
|
774
776
|
r.motivo ?? '-',
|
|
775
777
|
String(r.achados.length),
|
|
776
|
-
r.veredito ? (r.veredito.ok ?
|
|
778
|
+
r.veredito ? (r.veredito.ok ? m.sustentado : m.reprovado) : m.naoVerificado,
|
|
777
779
|
r.escopo.since ?? 'total',
|
|
778
780
|
];
|
|
779
781
|
});
|
|
780
|
-
return (0, util_1.tabela)([
|
|
782
|
+
return (0, util_1.tabela)([...m.cabecalho], linhas);
|
|
781
783
|
}
|
|
782
784
|
/** Texto de `ork audit show`. */
|
|
783
785
|
function textoDaRodada(raiz, id) {
|
|
784
786
|
const r = lerRodada(raiz, id);
|
|
785
787
|
const achados = (0, divida_1.achadosDaRodada)(raiz, id);
|
|
786
788
|
const L = [];
|
|
787
|
-
|
|
788
|
-
L.push(
|
|
789
|
-
L.push(
|
|
790
|
-
L.push(
|
|
791
|
-
L.push(
|
|
792
|
-
L.push(
|
|
793
|
-
L.push(
|
|
794
|
-
L.push(
|
|
789
|
+
const m = (0, locale_1.msg)().audit.rodadas;
|
|
790
|
+
L.push(m.titulo(r.id));
|
|
791
|
+
L.push(m.campo(m.campos.pack, `${r.pack} (${auditoria_1.PACKS[r.pack].titulo})`));
|
|
792
|
+
L.push(m.campo(m.campos.produto, `${r.produto} ${m.perfil(r.perfil)}`));
|
|
793
|
+
L.push(m.campo(m.campos.estagio, `${r.estagio}, ${m.postura(r.postura)}`));
|
|
794
|
+
L.push(m.campo(m.campos.escopo, r.escopo.detalhe));
|
|
795
|
+
L.push(m.campo(m.campos.graphify, r.escopo.graphify));
|
|
796
|
+
L.push(m.campo(m.campos.custo, m.custo(r.custo.effort, r.custo.model)));
|
|
797
|
+
L.push(m.campo(m.campos.janela, r.custo.janela.detalhe));
|
|
795
798
|
if (r.custo.autorizadaPor)
|
|
796
|
-
L.push(
|
|
797
|
-
L.push(
|
|
798
|
-
L.push(
|
|
799
|
-
L.push(
|
|
799
|
+
L.push(m.campo(m.campos.autorizada, m.autorizada(r.custo.autorizadaPor)));
|
|
800
|
+
L.push(m.campo(m.campos.runtime, `${r.runtime}, ${m.detalhes.sessao(r.sessionId ?? m.sessaoAusente)}`));
|
|
801
|
+
L.push(m.campo(m.campos.prompt, `${r.promptPath} (sha256 ${r.promptSha256 || m.promptAusente})`));
|
|
802
|
+
L.push(m.campo(m.campos.status, `${r.status}${r.motivo ? ` ${m.motivo(r.motivo)}` : ''}`));
|
|
800
803
|
if (r.superficie) {
|
|
801
|
-
L.push(
|
|
802
|
-
L.push(`
|
|
803
|
-
`frameworks: ${r.superficie.frameworks.join(', ') || '(nenhum reconhecido)'}`);
|
|
804
|
+
L.push(m.campo(m.campos.superficie, r.superficie.detalhe));
|
|
805
|
+
L.push(` ${m.superficieResumo(r.superficie.registrados, r.superficie.aConfirmar, r.superficie.frameworks.join(', ') || m.nenhumFramework)}`);
|
|
804
806
|
}
|
|
805
807
|
if (r.detalhe)
|
|
806
|
-
L.push(
|
|
808
|
+
L.push(m.campo(m.campos.detalhe, r.detalhe));
|
|
807
809
|
L.push('');
|
|
808
|
-
L.push(
|
|
810
|
+
L.push(m.achados(achados.length));
|
|
809
811
|
if (achados.length === 0)
|
|
810
|
-
L.push(
|
|
812
|
+
L.push(m.nenhumAchado);
|
|
811
813
|
for (const a of achados)
|
|
812
814
|
L.push((0, divida_1.textoDoAchado)(a));
|
|
813
815
|
L.push('');
|
|
814
816
|
if (r.veredito) {
|
|
815
|
-
L.push(
|
|
816
|
-
`(motivos: ${r.veredito.motivos.join(', ') || 'nenhum'}) no HEAD ${(0, util_1.shaCurto)(r.veredito.commit)}`);
|
|
817
|
+
L.push(m.claims(r.veredito.ok, r.veredito.motivos.join(', '), (0, util_1.shaCurto)(r.veredito.commit)));
|
|
817
818
|
}
|
|
818
819
|
else {
|
|
819
|
-
L.push(
|
|
820
|
+
L.push(m.claimsPendentes(r.id));
|
|
820
821
|
}
|
|
821
822
|
L.push('');
|
|
822
|
-
L.push(
|
|
823
|
+
L.push(m.relatorio(r.id));
|
|
823
824
|
return L.join('\n');
|
|
824
825
|
}
|
|
825
826
|
/** Ledger de uma rodada, para `ork audit show --ledger`. */
|
|
826
827
|
function tabelaDoLedgerDaRodada(raiz, id) {
|
|
828
|
+
const m = (0, locale_1.msg)().audit.rodadas;
|
|
827
829
|
lerRodada(raiz, id);
|
|
828
830
|
const eventos = (0, ledger_1.lerLedger)(dirRodada(raiz, id));
|
|
829
831
|
if (eventos.length === 0)
|
|
830
|
-
return
|
|
832
|
+
return m.ledgerVazio(id);
|
|
831
833
|
const linhas = eventos.map((e) => {
|
|
832
834
|
const detalhe = [];
|
|
833
835
|
if (e.pack)
|
|
834
836
|
detalhe.push(String(e.pack));
|
|
835
837
|
if (e.achado)
|
|
836
|
-
detalhe.push(
|
|
838
|
+
detalhe.push(m.detalhes.achado(String(e.achado)));
|
|
837
839
|
if (e.motivo)
|
|
838
|
-
detalhe.push(
|
|
840
|
+
detalhe.push(m.detalhes.motivo(String(e.motivo)));
|
|
839
841
|
if (e.sessionId)
|
|
840
|
-
detalhe.push(
|
|
842
|
+
detalhe.push(m.detalhes.sessao(String(e.sessionId).slice(0, 8)));
|
|
841
843
|
if (e.veredito)
|
|
842
|
-
detalhe.push(
|
|
844
|
+
detalhe.push(m.detalhes.veredito(String(e.veredito)));
|
|
843
845
|
if (e.destino)
|
|
844
|
-
detalhe.push(
|
|
846
|
+
detalhe.push(m.detalhes.destino(String(e.destino)));
|
|
845
847
|
// `e.thread` e o dono do evento, que aqui e a propria rodada: so vale imprimir quando
|
|
846
848
|
// for OUTRO id, que e o caso do evento finding_to_thread.
|
|
847
849
|
if (e.thread && e.thread !== id)
|
|
848
|
-
detalhe.push(
|
|
850
|
+
detalhe.push(m.detalhes.thread(String(e.thread)));
|
|
849
851
|
if (e.detalhe)
|
|
850
852
|
detalhe.push((0, horario_1.localizarTexto)(String(e.detalhe)).slice(0, 90));
|
|
851
853
|
return [(0, horario_1.formatarDataHora)(e.ts, { segundos: true }), e.tipo, detalhe.join(' | ')];
|
|
852
854
|
});
|
|
853
|
-
return `${(0, util_1.tabela)([
|
|
855
|
+
return `${(0, util_1.tabela)([...m.ledgerCabecalho], linhas)}\n${(0, horario_1.legendaDoFuso)()}`;
|
|
854
856
|
}
|
|
855
857
|
/** Quantos achados abertos existem por pack, para o resumo do CLI. */
|
|
856
858
|
function resumoDoBoard(raiz) {
|
|
859
|
+
const m = (0, locale_1.msg)().audit.rodadas;
|
|
857
860
|
const board = (0, divida_1.lerBoard)(raiz);
|
|
858
861
|
if (board.length === 0)
|
|
859
|
-
return
|
|
862
|
+
return m.boardVazio;
|
|
860
863
|
const abertos = board.filter((a) => a.estado === 'aberto').length;
|
|
861
|
-
return
|
|
864
|
+
return m.board(board.length, abertos);
|
|
862
865
|
}
|
|
863
866
|
/**
|
|
864
867
|
* Abre a thread que nasce de um achado de auditoria.
|
|
@@ -872,7 +875,10 @@ function resumoDoBoard(raiz) {
|
|
|
872
875
|
function abrirThreadDoAchado(carregado, achadoId, opcoes = {}) {
|
|
873
876
|
const { raiz, manifesto } = carregado;
|
|
874
877
|
const achado = (0, divida_1.exigirAchado)(raiz, achadoId);
|
|
875
|
-
|
|
878
|
+
// RM-061 F3c: o pedido vai a arquivo (pedido-goal.md e achado.json) e vira o --prompt do GOAL: e dado, na lingua
|
|
879
|
+
// declarada do dono, nunca na de quem roda nem conforme o --json. So o resultado impresso segue o locale ativo.
|
|
880
|
+
const pedido = (0, locale_1.comLocale)((0, locale_1.linguaDeclaradaDoDono)(manifesto.owner?.language), () => (0, divida_1.pedidoDoAchado)(achado));
|
|
881
|
+
const m = (0, locale_1.msg)().thread.fromFinding;
|
|
876
882
|
if (achado.estado === 'virou-thread' && achado.thread) {
|
|
877
883
|
return {
|
|
878
884
|
ok: false,
|
|
@@ -880,8 +886,8 @@ function abrirThreadDoAchado(carregado, achadoId, opcoes = {}) {
|
|
|
880
886
|
thread: null,
|
|
881
887
|
pedido,
|
|
882
888
|
motivo: 'achado.ja-virou-thread',
|
|
883
|
-
detalhe:
|
|
884
|
-
correcao:
|
|
889
|
+
detalhe: m.jaVirouThread(achado.id, achado.thread),
|
|
890
|
+
correcao: m.continueNaThread(achado.thread),
|
|
885
891
|
};
|
|
886
892
|
}
|
|
887
893
|
if (achado.claim.estado === 'pendente') {
|
|
@@ -891,9 +897,8 @@ function abrirThreadDoAchado(carregado, achadoId, opcoes = {}) {
|
|
|
891
897
|
thread: null,
|
|
892
898
|
pedido,
|
|
893
899
|
motivo: 'claims.failed',
|
|
894
|
-
detalhe:
|
|
895
|
-
|
|
896
|
-
correcao: `prove o achado antes de abrir trabalho: ork audit verify ${achado.rodada}`,
|
|
900
|
+
detalhe: m.claimPendente(achado.claim.id),
|
|
901
|
+
correcao: m.proveOAchado(achado.rodada),
|
|
897
902
|
};
|
|
898
903
|
}
|
|
899
904
|
if (achado.claim.estado === 'reprovado') {
|
|
@@ -903,8 +908,8 @@ function abrirThreadDoAchado(carregado, achadoId, opcoes = {}) {
|
|
|
903
908
|
thread: null,
|
|
904
909
|
pedido,
|
|
905
910
|
motivo: 'claims.failed',
|
|
906
|
-
detalhe:
|
|
907
|
-
correcao:
|
|
911
|
+
detalhe: m.claimReprovada(achado.claim.id),
|
|
912
|
+
correcao: m.descarteOAchado,
|
|
908
913
|
};
|
|
909
914
|
}
|
|
910
915
|
const modo = opcoes.modo ?? manifesto.conduction.default_mode;
|
|
@@ -928,7 +933,7 @@ function abrirThreadDoAchado(carregado, achadoId, opcoes = {}) {
|
|
|
928
933
|
worktreePor,
|
|
929
934
|
worktreeFalharia,
|
|
930
935
|
motivo: null,
|
|
931
|
-
detalhe:
|
|
936
|
+
detalhe: m.simulacaoDetalhe,
|
|
932
937
|
correcao: '',
|
|
933
938
|
};
|
|
934
939
|
}
|
|
@@ -989,8 +994,8 @@ function abrirThreadDoAchado(carregado, achadoId, opcoes = {}) {
|
|
|
989
994
|
worktreePor,
|
|
990
995
|
motivo: achado.claim.estado === 'nao-verificavel' ? 'claims.unverifiable' : null,
|
|
991
996
|
detalhe: achado.claim.estado === 'nao-verificavel'
|
|
992
|
-
?
|
|
993
|
-
:
|
|
997
|
+
? m.claimSemComando(achado.claim.id)
|
|
998
|
+
: m.achadoAberto(achado.id, thread.id),
|
|
994
999
|
correcao: '',
|
|
995
1000
|
};
|
|
996
1001
|
}
|