@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/worktree-local.js
CHANGED
|
@@ -58,6 +58,7 @@ const path = __importStar(require("node:path"));
|
|
|
58
58
|
const estado_thread_1 = require("./estado-thread");
|
|
59
59
|
const postura_local_1 = require("./postura-local");
|
|
60
60
|
const util_1 = require("./util");
|
|
61
|
+
const locale_1 = require("./locale");
|
|
61
62
|
exports.CONTRATO_WORKTREE_LOCAL = 'ork.worktree-local/v1';
|
|
62
63
|
exports.ARQUIVO_WORKTREE_LOCAL = 'worktree-local.json';
|
|
63
64
|
/**
|
|
@@ -115,24 +116,25 @@ exports.COMANDO_CONFIRMAR_WORKTREE = 'ork setup worktree confirmar';
|
|
|
115
116
|
* a máquina confirmou exatamente essa pasta; senão o erro tipado com o comando que confirma.
|
|
116
117
|
*/
|
|
117
118
|
function recusaDePastaDasWorktrees(raiz, manifesto) {
|
|
119
|
+
const montar = montadorDaRecusa(raiz, manifesto);
|
|
120
|
+
return montar ? montar((0, locale_1.msg)('pt-BR')) : null;
|
|
121
|
+
}
|
|
122
|
+
/** RM-061 (F3b): a recusa pelo catalogo, com o que ela cita lido antes; `null` quando a pasta vale. */
|
|
123
|
+
function montadorDaRecusa(raiz, manifesto) {
|
|
118
124
|
const { dir, dentro } = pastaDasWorktreesPedida(raiz, manifesto);
|
|
119
125
|
if (dentro)
|
|
120
126
|
return null;
|
|
121
127
|
const { local, motivo } = lerWorktreeLocal(raiz);
|
|
122
128
|
if (local && local.dir === dir)
|
|
123
129
|
return null;
|
|
124
|
-
const
|
|
125
|
-
return
|
|
126
|
-
`que leva a ${dir}, fora da raiz do projeto (pelo caminho real), e esta máquina não confirmou essa pasta (${porque}). ` +
|
|
127
|
-
'Nenhuma worktree foi criada. O manifesto vem com o repositório; quem decide criar checkout fora da raiz é a ' +
|
|
128
|
-
`máquina. Para aceitar nesta máquina: ${exports.COMANDO_CONFIRMAR_WORKTREE} (ou volte worktree.dir para dentro do projeto, ` +
|
|
129
|
-
'como .claude/worktrees).';
|
|
130
|
+
const pedido = JSON.stringify(manifesto.worktree.dir).slice(0, 200);
|
|
131
|
+
return (m) => m.worktree.dirForaDaRaiz(pedido, dir, local ? local.dir : null, motivo, exports.COMANDO_CONFIRMAR_WORKTREE);
|
|
130
132
|
}
|
|
131
|
-
/** Lança a recusa, quando houver. */
|
|
133
|
+
/** Lança a recusa, quando houver, pelo catalogo: o CLI a remonta no locale do comando. */
|
|
132
134
|
function exigirPastaDasWorktrees(raiz, manifesto) {
|
|
133
|
-
const
|
|
134
|
-
if (
|
|
135
|
-
throw new
|
|
135
|
+
const montar = montadorDaRecusa(raiz, manifesto);
|
|
136
|
+
if (montar)
|
|
137
|
+
throw new locale_1.ErroDoCatalogo(montar);
|
|
136
138
|
}
|
|
137
139
|
/**
|
|
138
140
|
* Grava a confirmação local da pasta que o manifesto pede hoje. Com `esperado`, ele precisa levar à
|
package/dist/worktree.js
CHANGED
|
@@ -65,6 +65,13 @@ const thread_1 = require("./thread");
|
|
|
65
65
|
const util_1 = require("./util");
|
|
66
66
|
const estado_thread_1 = require("./estado-thread");
|
|
67
67
|
const procedencia_1 = require("./procedencia");
|
|
68
|
+
const locale_1 = require("./locale");
|
|
69
|
+
/**
|
|
70
|
+
* RM-061 (F3b, G4): o detalhe e a correcao que o resultado devolve nascem pelo catalogo, no locale ativo (pt-BR no
|
|
71
|
+
* escopo da gravacao), e ficam registrados para a impressao remonta-los; o que so vai ao ledger sai sempre em pt-BR.
|
|
72
|
+
*/
|
|
73
|
+
const tw = (montar) => (0, locale_1.textoDoCatalogo)((m) => montar(m.worktree));
|
|
74
|
+
const gravado = () => (0, locale_1.msg)('pt-BR').worktree;
|
|
68
75
|
/**
|
|
69
76
|
* Diretorio canonico da worktree de uma thread, resolvido pelo `ork` na arvore principal: o mesmo que a criacao usa,
|
|
70
77
|
* tambem quando o comando roda de dentro de outra worktree (P4 do ensaio da 0.5.0).
|
|
@@ -132,8 +139,8 @@ function garantirWorktree(carregado, id) {
|
|
|
132
139
|
branch,
|
|
133
140
|
base,
|
|
134
141
|
motivo: 'tree.blocked',
|
|
135
|
-
detalhe:
|
|
136
|
-
correcao:
|
|
142
|
+
detalhe: tw((m) => m.naoRegistrada(dir)),
|
|
143
|
+
correcao: tw((m) => m.naoRegistradaCorrecao(id)),
|
|
137
144
|
};
|
|
138
145
|
}
|
|
139
146
|
try {
|
|
@@ -141,7 +148,7 @@ function garantirWorktree(carregado, id) {
|
|
|
141
148
|
}
|
|
142
149
|
catch (e) {
|
|
143
150
|
return { ok: false, criada: false, dir, branch, base, motivo: 'tree.blocked',
|
|
144
|
-
detalhe: e
|
|
151
|
+
detalhe: (0, locale_1.textoDoErro)(e), correcao: tw((m) => m.reconcilieOEstado(id)) };
|
|
145
152
|
}
|
|
146
153
|
if (thread.worktree !== dir) {
|
|
147
154
|
thread.worktree = dir;
|
|
@@ -161,7 +168,7 @@ function garantirWorktree(carregado, id) {
|
|
|
161
168
|
branch,
|
|
162
169
|
base,
|
|
163
170
|
motivo: null,
|
|
164
|
-
detalhe:
|
|
171
|
+
detalhe: tw((m) => m.jaExiste),
|
|
165
172
|
correcao: '',
|
|
166
173
|
};
|
|
167
174
|
}
|
|
@@ -171,7 +178,7 @@ function garantirWorktree(carregado, id) {
|
|
|
171
178
|
branchExistente: jaTemBranch ? branch : undefined,
|
|
172
179
|
});
|
|
173
180
|
thread.worktree = criada.dir;
|
|
174
|
-
thread.base = { branch: criada.branch, commit:
|
|
181
|
+
thread.base = { branch: criada.branch, commit: criada.commit };
|
|
175
182
|
(0, thread_1.gravarThread)(raiz, thread);
|
|
176
183
|
(0, ledger_1.registrar)((0, thread_1.dirThread)(raiz, id), id, ledger_1.TIPOS_DE_EVENTO.worktreeGarantida, {
|
|
177
184
|
dir: criada.dir,
|
|
@@ -181,16 +188,17 @@ function garantirWorktree(carregado, id) {
|
|
|
181
188
|
branchReusada: jaTemBranch,
|
|
182
189
|
fonte: 'git worktree list --porcelain',
|
|
183
190
|
});
|
|
191
|
+
// RM-037 (defeito 2 de 19 e 20/10/2026): a worktree recriada nasce sem o que o git ignora, como a nova.
|
|
192
|
+
const dependencias = (0, thread_1.prepararDependenciasDaThread)(carregado, id, criada.dir);
|
|
184
193
|
return {
|
|
185
194
|
ok: true,
|
|
186
195
|
criada: true,
|
|
196
|
+
dependencias,
|
|
187
197
|
dir: criada.dir,
|
|
188
198
|
branch: criada.branch,
|
|
189
199
|
base,
|
|
190
200
|
motivo: null,
|
|
191
|
-
detalhe: jaTemBranch
|
|
192
|
-
? `worktree recriada sobre a branch ${criada.branch}, que ja existia`
|
|
193
|
-
: `worktree criada a partir de ${base}`,
|
|
201
|
+
detalhe: tw((m) => jaTemBranch ? m.recriadaSobreBranch(criada.branch) : m.criadaAPartirDe(base)),
|
|
194
202
|
correcao: '',
|
|
195
203
|
};
|
|
196
204
|
}
|
|
@@ -259,8 +267,8 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
259
267
|
jaAtualizada: false,
|
|
260
268
|
rebaseFeito: false,
|
|
261
269
|
motivo: 'tree.blocked',
|
|
262
|
-
detalhe:
|
|
263
|
-
correcao:
|
|
270
|
+
detalhe: tw((m) => m.semWorktree(id)),
|
|
271
|
+
correcao: tw((m) => m.semWorktreeCorrecao(id)),
|
|
264
272
|
};
|
|
265
273
|
}
|
|
266
274
|
const limpa = arvoreLimpa(dir);
|
|
@@ -271,10 +279,8 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
271
279
|
jaAtualizada: false,
|
|
272
280
|
rebaseFeito: false,
|
|
273
281
|
motivo: 'tree.blocked',
|
|
274
|
-
detalhe: limpa === null
|
|
275
|
-
|
|
276
|
-
: `${dir} tem alteracao nao commitada; rebase em arvore suja perde trabalho`,
|
|
277
|
-
correcao: `commite ou guarde as alteracoes em ${dir} e rode de novo: ork worktree sync ${id}`,
|
|
282
|
+
detalhe: tw((m) => limpa === null ? m.semStatus(dir) : m.arvoreSuja(dir)),
|
|
283
|
+
correcao: tw((m) => m.arvoreSujaCorrecao(dir, id)),
|
|
278
284
|
};
|
|
279
285
|
}
|
|
280
286
|
try {
|
|
@@ -282,7 +288,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
282
288
|
}
|
|
283
289
|
catch (e) {
|
|
284
290
|
return { ...vazio, ok: false, jaAtualizada: false, rebaseFeito: false,
|
|
285
|
-
motivo: 'tree.blocked', detalhe: e
|
|
291
|
+
motivo: 'tree.blocked', detalhe: (0, locale_1.textoDoErro)(e), correcao: tw((m) => m.reconcilieAsCopias) };
|
|
286
292
|
}
|
|
287
293
|
const refBase = (0, util_1.exec)('git', ['rev-parse', '--verify', base], raiz);
|
|
288
294
|
if (!refBase.ok) {
|
|
@@ -292,8 +298,8 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
292
298
|
jaAtualizada: false,
|
|
293
299
|
rebaseFeito: false,
|
|
294
300
|
motivo: 'tree.blocked',
|
|
295
|
-
detalhe:
|
|
296
|
-
correcao:
|
|
301
|
+
detalhe: tw((m) => m.baseInexistente(base)),
|
|
302
|
+
correcao: tw((m) => m.baseInexistenteCorrecao(carregado.caminho)),
|
|
297
303
|
};
|
|
298
304
|
}
|
|
299
305
|
const shaBase = refBase.stdout.trim();
|
|
@@ -311,7 +317,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
311
317
|
shaAntes,
|
|
312
318
|
shaDepois: shaAntes,
|
|
313
319
|
rebaseFeito: false,
|
|
314
|
-
detalhe:
|
|
320
|
+
detalhe: gravado().jaEraAncestral,
|
|
315
321
|
});
|
|
316
322
|
}
|
|
317
323
|
return {
|
|
@@ -323,7 +329,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
323
329
|
jaAtualizada: true,
|
|
324
330
|
rebaseFeito: false,
|
|
325
331
|
motivo: null,
|
|
326
|
-
detalhe:
|
|
332
|
+
detalhe: tw((m) => m.jaIncorporada(base)),
|
|
327
333
|
correcao: '',
|
|
328
334
|
};
|
|
329
335
|
}
|
|
@@ -337,7 +343,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
337
343
|
passos.push(`git reset --keep ${shaBase}`);
|
|
338
344
|
if (opcoes.dryRun) {
|
|
339
345
|
return { ...vazio, shaBase, shaAntes, shaDepois: shaAntes, ok: true, jaAtualizada: false, rebaseFeito: false, recriada: false,
|
|
340
|
-
motivo: null, detalhe:
|
|
346
|
+
motivo: null, detalhe: tw((m) => m.semCommitProprio(branch, base)),
|
|
341
347
|
correcao: '' };
|
|
342
348
|
}
|
|
343
349
|
let recriacao;
|
|
@@ -346,50 +352,48 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
346
352
|
}
|
|
347
353
|
catch (e) {
|
|
348
354
|
return { ...vazio, shaBase, shaAntes, ok: false, jaAtualizada: false, rebaseFeito: false,
|
|
349
|
-
motivo: 'tree.blocked', detalhe: e
|
|
350
|
-
correcao:
|
|
355
|
+
motivo: 'tree.blocked', detalhe: (0, locale_1.textoDoErro)(e),
|
|
356
|
+
correcao: tw((m) => m.inspecioneAsCopias) };
|
|
351
357
|
}
|
|
352
358
|
const shaDepois = (0, util_1.exec)('git', ['rev-parse', 'HEAD'], dir).stdout.trim();
|
|
353
359
|
if (!recriacao.ok || shaDepois !== shaBase) {
|
|
354
360
|
return { ...vazio, shaBase, shaAntes, shaDepois, ok: false, jaAtualizada: false, rebaseFeito: false, motivo: 'tree.blocked',
|
|
355
|
-
detalhe:
|
|
356
|
-
correcao:
|
|
361
|
+
detalhe: tw((m) => m.recriacaoFalhou(branch, (recriacao.stderr || recriacao.stdout).trim().split('\n').slice(-2).join(' | '))),
|
|
362
|
+
correcao: tw((m) => m.confiraAWorktree(dir, id)) };
|
|
357
363
|
}
|
|
358
|
-
const detalhe = historia.semAncestral
|
|
359
|
-
? `branch sem commit proprio recriada a partir da base ${base} atual; a base foi reescrita e nao tinha historia em comum com ela`
|
|
360
|
-
: `branch sem commit proprio recriada a partir da base ${base} atual`;
|
|
364
|
+
const detalhe = tw((m) => m.recriada(base, historia.semAncestral));
|
|
361
365
|
(0, ledger_1.registrar)((0, thread_1.dirThread)(raiz, id), id, ledger_1.TIPOS_DE_EVENTO.worktreeSincronizada, { dir, branch, base, shaBase, shaAntes, shaDepois,
|
|
362
|
-
rebaseFeito: false, recriada: true, semAncestral: historia.semAncestral, detalhe });
|
|
366
|
+
rebaseFeito: false, recriada: true, semAncestral: historia.semAncestral, detalhe: gravado().recriada(base, historia.semAncestral) });
|
|
363
367
|
return { ...vazio, shaBase, shaAntes, shaDepois, ok: true, jaAtualizada: false, rebaseFeito: false, recriada: true,
|
|
364
368
|
motivo: null, detalhe, correcao: '' };
|
|
365
369
|
}
|
|
366
370
|
if (historia.semAncestral) {
|
|
367
|
-
const onto = historia.pontoDePartida
|
|
371
|
+
const onto = (m) => historia.pontoDePartida
|
|
368
372
|
? `git -C ${dir} rebase --onto ${shaBase} ${historia.pontoDePartida}`
|
|
369
|
-
: `git -C ${dir} rebase --onto ${shaBase}
|
|
370
|
-
const detalhe =
|
|
371
|
-
`${historia.proprios ?? 'um numero desconhecido de'} commit(s) proprio(s): o rebase reaplicaria a historia antiga inteira`;
|
|
373
|
+
: `git -C ${dir} rebase --onto ${shaBase} ${m.ondeComecou}`;
|
|
374
|
+
const detalhe = tw((m) => m.semHistoriaComum(base, branch, historia.proprios));
|
|
372
375
|
if (!opcoes.dryRun)
|
|
373
376
|
(0, ledger_1.registrar)((0, thread_1.dirThread)(raiz, id), id, ledger_1.TIPOS_DE_EVENTO.worktreeSincronizada, { dir, branch, base, shaBase, shaAntes,
|
|
374
|
-
rebaseFeito: false, motivo: 'tree.blocked', causa: 'base-reescrita', semAncestral: true,
|
|
377
|
+
rebaseFeito: false, motivo: 'tree.blocked', causa: 'base-reescrita', semAncestral: true,
|
|
378
|
+
detalhe: gravado().semHistoriaComum(base, branch, historia.proprios) });
|
|
375
379
|
return { ...vazio, shaBase, shaAntes, shaDepois: shaAntes, ok: false, jaAtualizada: false, rebaseFeito: false,
|
|
376
|
-
motivo: 'tree.blocked', causa: 'base-reescrita', detalhe, correcao:
|
|
380
|
+
motivo: 'tree.blocked', causa: 'base-reescrita', detalhe, correcao: tw((m) => m.reaplique(onto(m))) };
|
|
377
381
|
}
|
|
378
382
|
// RM-037 (fatia 3, defeito 3): com ancestral comum, o sync caia no `git rebase <base>` abaixo e
|
|
379
383
|
// reaplicava tambem o que a reescrita tirou da base. O ponto de partida fora da base atual e o sinal.
|
|
380
384
|
if (historia.baseReescrita) {
|
|
381
385
|
const ponto = historia.pontoDePartida;
|
|
382
|
-
passos.push(
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
+
passos.push(tw((m) => m.passoBaseReescrita(ponto.slice(0, 8), shaBase.slice(0, 8))));
|
|
387
|
+
const contagem = `git rev-list --count HEAD --not ${ponto.slice(0, 8)} ${shaBase.slice(0, 8)}`;
|
|
388
|
+
const reescrita = (m) => m.baseReescrita(base, ponto.slice(0, 8), branch, historia.sairamDaBase, historia.proprios, contagem);
|
|
389
|
+
const detalhe = tw(reescrita);
|
|
386
390
|
if (!opcoes.dryRun)
|
|
387
391
|
(0, ledger_1.registrar)((0, thread_1.dirThread)(raiz, id), id, ledger_1.TIPOS_DE_EVENTO.worktreeSincronizada, { dir, branch, base, shaBase, shaAntes,
|
|
388
392
|
rebaseFeito: false, motivo: 'tree.blocked', causa: 'base-reescrita', baseReescrita: true, pontoDePartida: ponto,
|
|
389
|
-
sairamDaBase: historia.sairamDaBase, proprios: historia.proprios, detalhe });
|
|
393
|
+
sairamDaBase: historia.sairamDaBase, proprios: historia.proprios, detalhe: reescrita(gravado()) });
|
|
390
394
|
return { ...vazio, shaBase, shaAntes, shaDepois: shaAntes, ok: false, jaAtualizada: false, rebaseFeito: false,
|
|
391
395
|
motivo: 'tree.blocked', causa: 'base-reescrita', detalhe,
|
|
392
|
-
correcao:
|
|
396
|
+
correcao: tw((m) => m.reaplique(`git -C ${dir} rebase --onto ${shaBase} ${ponto}`)) };
|
|
393
397
|
}
|
|
394
398
|
if (opcoes.dryRun) {
|
|
395
399
|
passos.push(`git rebase ${shaBase}`);
|
|
@@ -402,7 +406,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
402
406
|
jaAtualizada: false,
|
|
403
407
|
rebaseFeito: false,
|
|
404
408
|
motivo: null,
|
|
405
|
-
detalhe:
|
|
409
|
+
detalhe: tw((m) => m.rebaseAcima(base)),
|
|
406
410
|
correcao: '',
|
|
407
411
|
};
|
|
408
412
|
}
|
|
@@ -417,8 +421,8 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
417
421
|
}
|
|
418
422
|
catch (e) {
|
|
419
423
|
return { ...vazio, shaBase, shaAntes, ok: false, jaAtualizada: false, rebaseFeito: false,
|
|
420
|
-
motivo: 'tree.blocked', detalhe: e
|
|
421
|
-
correcao:
|
|
424
|
+
motivo: 'tree.blocked', detalhe: (0, locale_1.textoDoErro)(e),
|
|
425
|
+
correcao: tw((m) => m.inspecioneAsCopias) };
|
|
422
426
|
}
|
|
423
427
|
passos.push(`git rebase ${shaBase}`);
|
|
424
428
|
if (!rebase.ok) {
|
|
@@ -443,9 +447,8 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
443
447
|
jaAtualizada: false,
|
|
444
448
|
rebaseFeito: false,
|
|
445
449
|
motivo: 'tree.blocked',
|
|
446
|
-
detalhe:
|
|
447
|
-
correcao:
|
|
448
|
-
`ou reduza a regiao da thread com um lease path:<glob> menor`,
|
|
450
|
+
detalhe: tw((m) => m.rebaseConflitou(base, detalhe)),
|
|
451
|
+
correcao: tw((m) => m.rebaseConflitouCorrecao(dir, shaBase)),
|
|
449
452
|
};
|
|
450
453
|
}
|
|
451
454
|
const shaDepois = (0, util_1.exec)('git', ['rev-parse', 'HEAD'], dir).stdout.trim();
|
|
@@ -457,7 +460,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
457
460
|
shaAntes,
|
|
458
461
|
shaDepois,
|
|
459
462
|
rebaseFeito: true,
|
|
460
|
-
detalhe:
|
|
463
|
+
detalhe: gravado().rebasada(base),
|
|
461
464
|
});
|
|
462
465
|
return {
|
|
463
466
|
...vazio,
|
|
@@ -468,7 +471,7 @@ function sincronizarWorktree(carregado, id, opcoes = {}) {
|
|
|
468
471
|
jaAtualizada: false,
|
|
469
472
|
rebaseFeito: true,
|
|
470
473
|
motivo: null,
|
|
471
|
-
detalhe:
|
|
474
|
+
detalhe: tw((m) => m.rebasadaSobreEla(base, branch)),
|
|
472
475
|
correcao: '',
|
|
473
476
|
};
|
|
474
477
|
}
|
|
@@ -486,11 +489,11 @@ function auditarWorktree(carregado, id) {
|
|
|
486
489
|
const branchEsperada = branchDaWorktree(thread);
|
|
487
490
|
const checks = [];
|
|
488
491
|
checks.push(thread.worktree
|
|
489
|
-
? { nome: 'registro', nivel: 'ok', detalhe:
|
|
492
|
+
? { nome: 'registro', nivel: 'ok', detalhe: tw((m) => m.apontaPara(thread.worktree)) }
|
|
490
493
|
: {
|
|
491
494
|
nome: 'registro',
|
|
492
495
|
nivel: 'fail',
|
|
493
|
-
detalhe:
|
|
496
|
+
detalhe: tw((m) => m.semRegistroNoThread),
|
|
494
497
|
correcao: `ork worktree ensure ${id}`,
|
|
495
498
|
});
|
|
496
499
|
const existe = fs.existsSync(dir);
|
|
@@ -499,25 +502,25 @@ function auditarWorktree(carregado, id) {
|
|
|
499
502
|
: {
|
|
500
503
|
nome: 'diretorio',
|
|
501
504
|
nivel: 'fail',
|
|
502
|
-
detalhe:
|
|
505
|
+
detalhe: tw((m) => m.naoExisteNoDisco(dir)),
|
|
503
506
|
correcao: `ork worktree ensure ${id}`,
|
|
504
507
|
});
|
|
505
508
|
const registro = worktreesDoGit(raiz).find((w) => w.dir === dir);
|
|
506
509
|
checks.push(registro
|
|
507
|
-
? { nome: 'git', nivel: 'ok', detalhe:
|
|
510
|
+
? { nome: 'git', nivel: 'ok', detalhe: tw((m) => m.apareceNoGit) }
|
|
508
511
|
: {
|
|
509
512
|
nome: 'git',
|
|
510
513
|
nivel: 'fail',
|
|
511
|
-
detalhe:
|
|
514
|
+
detalhe: tw((m) => m.naoApareceNoGit(dir)),
|
|
512
515
|
correcao: `git worktree prune && ork worktree ensure ${id}`,
|
|
513
516
|
});
|
|
514
517
|
if (registro) {
|
|
515
518
|
checks.push(registro.branch === branchEsperada
|
|
516
|
-
? { nome: 'branch', nivel: 'ok', detalhe:
|
|
519
|
+
? { nome: 'branch', nivel: 'ok', detalhe: tw((m) => m.emCheckout(registro.branch)) }
|
|
517
520
|
: {
|
|
518
521
|
nome: 'branch',
|
|
519
522
|
nivel: 'fail',
|
|
520
|
-
detalhe:
|
|
523
|
+
detalhe: tw((m) => m.branchErrada(branchEsperada, registro.branch)),
|
|
521
524
|
correcao: `git -C ${dir} switch ${branchEsperada}`,
|
|
522
525
|
});
|
|
523
526
|
}
|
|
@@ -528,20 +531,18 @@ function auditarWorktree(carregado, id) {
|
|
|
528
531
|
(0, procedencia_1.exigirCwdLocal)(raiz, id, dir, 'thread');
|
|
529
532
|
}
|
|
530
533
|
catch (e) {
|
|
531
|
-
procedencia = e
|
|
534
|
+
procedencia = (0, locale_1.textoDoErro)(e);
|
|
532
535
|
checks.push({ nome: 'procedencia', nivel: 'fail', detalhe: procedencia, correcao: `ork worktree ensure ${id}` });
|
|
533
536
|
}
|
|
534
537
|
}
|
|
535
538
|
if (existe && procedencia === null) {
|
|
536
539
|
const limpa = arvoreLimpa(dir);
|
|
537
540
|
checks.push(limpa === true
|
|
538
|
-
? { nome: 'arvore', nivel: 'ok', detalhe:
|
|
541
|
+
? { nome: 'arvore', nivel: 'ok', detalhe: tw((m) => m.arvoreLimpa) }
|
|
539
542
|
: {
|
|
540
543
|
nome: 'arvore',
|
|
541
544
|
nivel: limpa === null ? 'fail' : 'warn',
|
|
542
|
-
detalhe: limpa === null
|
|
543
|
-
? '`git status` nao respondeu neste diretorio'
|
|
544
|
-
: 'ha alteracao nao commitada na worktree',
|
|
545
|
+
detalhe: tw((m) => limpa === null ? m.statusSemResposta : m.alteracaoNaWorktree),
|
|
545
546
|
correcao: `git -C ${dir} status`,
|
|
546
547
|
});
|
|
547
548
|
const base = manifesto.worktree.base_branch;
|
|
@@ -550,11 +551,11 @@ function auditarWorktree(carregado, id) {
|
|
|
550
551
|
const shaBase = refBase.stdout.trim();
|
|
551
552
|
const incorporada = (0, util_1.exec)('git', ['merge-base', '--is-ancestor', shaBase, 'HEAD'], dir).ok;
|
|
552
553
|
checks.push(incorporada
|
|
553
|
-
? { nome: 'base', nivel: 'ok', detalhe:
|
|
554
|
+
? { nome: 'base', nivel: 'ok', detalhe: tw((m) => m.baseIncorporada(base, shaBase.slice(0, 8))) }
|
|
554
555
|
: {
|
|
555
556
|
nome: 'base',
|
|
556
557
|
nivel: 'fail',
|
|
557
|
-
detalhe:
|
|
558
|
+
detalhe: tw((m) => m.baseAdiante(base, shaBase.slice(0, 8))),
|
|
558
559
|
correcao: `ork worktree sync ${id}`,
|
|
559
560
|
});
|
|
560
561
|
}
|
|
@@ -565,13 +566,13 @@ function auditarWorktree(carregado, id) {
|
|
|
565
566
|
? {
|
|
566
567
|
nome: 'artefatos',
|
|
567
568
|
nivel: 'fail',
|
|
568
|
-
detalhe:
|
|
569
|
-
correcao:
|
|
569
|
+
detalhe: tw((m) => m.artefatosDentro(dirArtefatos)),
|
|
570
|
+
correcao: tw((m) => m.artefatosDentroCorrecao),
|
|
570
571
|
}
|
|
571
572
|
: {
|
|
572
573
|
nome: 'artefatos',
|
|
573
574
|
nivel: 'ok',
|
|
574
|
-
detalhe:
|
|
575
|
+
detalhe: tw((m) => m.artefatosFora(path.relative(raiz, dirArtefatos))),
|
|
575
576
|
});
|
|
576
577
|
if (existe)
|
|
577
578
|
checks.push((0, estado_thread_1.auditarEstado)(raiz, id, dir));
|
|
@@ -587,21 +588,16 @@ function auditarWorktree(carregado, id) {
|
|
|
587
588
|
}
|
|
588
589
|
/** Texto de `ork worktree audit`. */
|
|
589
590
|
function textoDoAudit(id, r) {
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
` branch ${r.branch}`,
|
|
594
|
-
'',
|
|
595
|
-
];
|
|
591
|
+
// RM-061 (F3b): a moldura pelo catalogo; o nome do check (dado do ledger) traduzido so aqui, e o detalhe remontado.
|
|
592
|
+
const m = (0, locale_1.msg)().worktree;
|
|
593
|
+
const linhas = [m.auditoria(id), m.linhaDir(r.dir), m.linhaBranch(r.branch), ''];
|
|
596
594
|
for (const c of r.checks) {
|
|
597
|
-
linhas.push(` ${(0, util_1.simbolo)(c.nivel)} ${c.nome.padEnd(11)} ${c.detalhe}`);
|
|
595
|
+
linhas.push(` ${(0, util_1.simbolo)(c.nivel)} ${m.nomeDoCheck(c.nome).padEnd(11)} ${(0, locale_1.remontar)(c.detalhe)}`);
|
|
598
596
|
if (c.nivel !== 'ok' && c.correcao)
|
|
599
|
-
linhas.push(
|
|
597
|
+
linhas.push(m.correcaoDoCheck((0, locale_1.remontar)(c.correcao)));
|
|
600
598
|
}
|
|
601
599
|
linhas.push('');
|
|
602
|
-
linhas.push(r.ok
|
|
603
|
-
? ' worktree consistente: o git confirma cada item acima.'
|
|
604
|
-
: ` ${r.divergencias} divergencia(s) encontrada(s) no proprio git.`);
|
|
600
|
+
linhas.push(r.ok ? m.consistente : m.divergencias(r.divergencias));
|
|
605
601
|
return linhas.join('\n');
|
|
606
602
|
}
|
|
607
603
|
/** Solta os leases de escrita que a thread ainda segurava. */
|
|
@@ -640,7 +636,7 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
640
636
|
branch,
|
|
641
637
|
removida: false,
|
|
642
638
|
leasesLiberados: soltos,
|
|
643
|
-
detalhe:
|
|
639
|
+
detalhe: gravado().jaNaoExistia,
|
|
644
640
|
});
|
|
645
641
|
return {
|
|
646
642
|
ok: true,
|
|
@@ -649,7 +645,7 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
649
645
|
branch,
|
|
650
646
|
leasesLiberados: soltos,
|
|
651
647
|
motivo: null,
|
|
652
|
-
detalhe:
|
|
648
|
+
detalhe: tw((m) => m.jaNaoExistiaImpresso),
|
|
653
649
|
correcao: '',
|
|
654
650
|
};
|
|
655
651
|
}
|
|
@@ -659,7 +655,7 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
659
655
|
}
|
|
660
656
|
catch (e) {
|
|
661
657
|
return { ok: false, removida: false, dir, branch, leasesLiberados: [], motivo: 'tree.blocked',
|
|
662
|
-
detalhe: e
|
|
658
|
+
detalhe: (0, locale_1.textoDoErro)(e), correcao: tw((m) => m.confiraODiretorio(id)) };
|
|
663
659
|
}
|
|
664
660
|
const limpa = arvoreLimpa(dir);
|
|
665
661
|
if (limpa === false && !opcoes.forcar) {
|
|
@@ -670,8 +666,8 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
670
666
|
branch,
|
|
671
667
|
leasesLiberados: [],
|
|
672
668
|
motivo: 'tree.blocked',
|
|
673
|
-
detalhe:
|
|
674
|
-
correcao:
|
|
669
|
+
detalhe: tw((m) => m.releaseArvoreSuja(dir)),
|
|
670
|
+
correcao: tw((m) => m.releaseArvoreSujaCorrecao(dir)),
|
|
675
671
|
};
|
|
676
672
|
}
|
|
677
673
|
const argumentos = ['worktree', 'remove', dir];
|
|
@@ -686,8 +682,8 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
686
682
|
branch,
|
|
687
683
|
leasesLiberados: [],
|
|
688
684
|
motivo: 'tree.blocked',
|
|
689
|
-
detalhe:
|
|
690
|
-
correcao:
|
|
685
|
+
detalhe: tw((m) => m.removeFalhou((r.stderr || r.stdout).trim())),
|
|
686
|
+
correcao: tw((m) => m.removeFalhouCorrecao(dir)),
|
|
691
687
|
};
|
|
692
688
|
}
|
|
693
689
|
(0, util_1.exec)('git', ['worktree', 'prune'], raiz);
|
|
@@ -700,7 +696,7 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
700
696
|
branch,
|
|
701
697
|
leasesLiberados: [],
|
|
702
698
|
motivo: 'tree.blocked',
|
|
703
|
-
detalhe:
|
|
699
|
+
detalhe: tw((m) => m.continuaNaLista(dir)),
|
|
704
700
|
correcao: 'git worktree prune && git worktree list',
|
|
705
701
|
};
|
|
706
702
|
}
|
|
@@ -722,7 +718,7 @@ function liberarWorktree(carregado, id, opcoes = {}) {
|
|
|
722
718
|
branch,
|
|
723
719
|
leasesLiberados: soltos,
|
|
724
720
|
motivo: null,
|
|
725
|
-
detalhe:
|
|
721
|
+
detalhe: tw((m) => m.removida(branch)),
|
|
726
722
|
correcao: '',
|
|
727
723
|
};
|
|
728
724
|
}
|
|
@@ -98,6 +98,83 @@
|
|
|
98
98
|
"porque": "a regra dos motivos tipados"
|
|
99
99
|
}
|
|
100
100
|
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"id": "check-quality/zero-bloqueadores-com-scan",
|
|
104
|
+
"tipo": "borda",
|
|
105
|
+
"gravidade": "maior",
|
|
106
|
+
"cenario": "O scan do CHECK tem achado `new` do laco sem veredito de triagem e um achado `warn`.",
|
|
107
|
+
"esperado": "Nao ha zero bloqueadores: falta o veredito. O `warn` vai ao eixo certo como aviso registrado.",
|
|
108
|
+
"assercoes": [
|
|
109
|
+
{
|
|
110
|
+
"tipo": "contem",
|
|
111
|
+
"valor": "nenhum achado `new` do laco sem veredito resolvido",
|
|
112
|
+
"porque": "a definicao de zero bloqueadores com o scan"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"tipo": "contem",
|
|
116
|
+
"valor": "aviso registrado",
|
|
117
|
+
"porque": "o warn nao e descartado"
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"id": "check-quality/inconclusivo-pelo-gate-da-pausa",
|
|
123
|
+
"tipo": "borda",
|
|
124
|
+
"gravidade": "maior",
|
|
125
|
+
"cenario": "O auditor deu inconclusivo a um achado `new` do laco e a sessao do CHECK tenta abrir o pedido ao dono.",
|
|
126
|
+
"esperado": "O pedido sai depois da sessao, pelo `ork gate request` da pausa do bloco; de dentro da sessao ou com motivo livre ele recusa, e sem a pausa o veredito e BLOQUEADO.",
|
|
127
|
+
"assercoes": [
|
|
128
|
+
{
|
|
129
|
+
"tipo": "contem",
|
|
130
|
+
"valor": "Inconclusivo nao abre o pedido de dentro da sessao do CHECK",
|
|
131
|
+
"porque": "a recusa medida na prova ponta a ponta"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"tipo": "contem",
|
|
135
|
+
"valor": "`ork gate request <thread> --formato telegram`",
|
|
136
|
+
"porque": "o comando que abre a pausa ao dono"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"tipo": "contem",
|
|
140
|
+
"valor": "`modo nao preve pausa humana nesta fase`",
|
|
141
|
+
"porque": "o modo sem pausa no CHECK"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"tipo": "contem",
|
|
145
|
+
"valor": "quem conduz aponta ao dono a pergunta do parecer",
|
|
146
|
+
"porque": "o pedido do gate leva so a pergunta generica"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"tipo": "contem",
|
|
150
|
+
"valor": "A resposta do dono vira claim do CHECK",
|
|
151
|
+
"porque": "a resposta chega ao GO-FIX pelo mesmo caminho"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"tipo": "contem",
|
|
155
|
+
"valor": "#Look e #Ork tambem pausavam no CHECK, mas estao aposentados (I-43)",
|
|
156
|
+
"porque": "a lista de modos com a pausa"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"id": "check-quality/veredito-por-achado-no-fix-open",
|
|
162
|
+
"tipo": "caminho-feliz",
|
|
163
|
+
"gravidade": "maior",
|
|
164
|
+
"cenario": "O CHECK reprovou pelo scan com um achado real e um falso positivo triados.",
|
|
165
|
+
"esperado": "O `ork fix open` abre uma correcao por claim do CHECK, tipo B para o real e tipo A para o falso positivo.",
|
|
166
|
+
"assercoes": [
|
|
167
|
+
{
|
|
168
|
+
"tipo": "contem",
|
|
169
|
+
"valor": "`ork fix open <thread>` reexecuta o verify e abre uma correcao por claim reprovada",
|
|
170
|
+
"porque": "o mecanismo real do veredito por achado"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"tipo": "contem",
|
|
174
|
+
"valor": "tipo A para o falso positivo (`claims.unverifiable`)",
|
|
175
|
+
"porque": "o tipo que a claim sem comando produz"
|
|
176
|
+
}
|
|
177
|
+
]
|
|
101
178
|
}
|
|
102
179
|
]
|
|
103
180
|
}
|