@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.
Files changed (385) hide show
  1. package/adapters/README.md +18 -0
  2. package/adapters/claude-code/.claude-plugin/plugin.json +1 -0
  3. package/adapters/claude-code/README.md +37 -5
  4. package/adapters/claude-code/agents/ork-check.md +1 -0
  5. package/adapters/claude-code/agents/ork-go.md +1 -0
  6. package/adapters/claude-code/agents/ork-goal.md +1 -0
  7. package/adapters/claude-code/agents/ork-master.md +1 -0
  8. package/adapters/claude-code/agents/ork-plan.md +1 -0
  9. package/adapters/claude-code/agents/ork-ship.md +1 -0
  10. package/adapters/claude-code/hooks/hooks.json +2 -1
  11. package/adapters/claude-code/hooks/ork-guard.js +15 -1
  12. package/adapters/claude-code/hooks/ork-resposta.js +91 -0
  13. package/adapters/claude-code/hooks/ork-sensor.js +18 -2
  14. package/adapters/claude-code/hooks/quota-signal.js +14 -0
  15. package/adapters/claude-code/mods/ork-mensageiro/.claude-plugin/plugin.json +14 -0
  16. package/adapters/claude-code/mods/ork-mensageiro/hooks/caixa.ts +215 -0
  17. package/adapters/claude-code/mods/ork-mensageiro/hooks/hooks.json +3 -0
  18. package/adapters/claude-code/mods/ork-mensageiro/hooks/painel.tsx +165 -0
  19. package/adapters/claude-code/mods/ork-mensageiro/hooks/recepcao.ts +256 -0
  20. package/adapters/claude-code/mods/ork-mensageiro/hooks/register.tsx +481 -0
  21. package/adapters/claude-code/mods/ork-mensageiro/orkastery-mod.json +5 -0
  22. package/adapters/claude-code/mods/ork-mensageiro/types/index.d.ts +85 -0
  23. package/adapters/claude-code/mods/ork-pista/hooks/ci.ts +9 -5
  24. package/adapters/claude-code/mods/ork-ritual/.claude-plugin/plugin.json +14 -0
  25. package/adapters/claude-code/mods/ork-ritual/hooks/hooks.json +3 -0
  26. package/adapters/claude-code/mods/ork-ritual/hooks/nota.ts +88 -0
  27. package/adapters/claude-code/mods/ork-ritual/hooks/register.tsx +494 -0
  28. package/adapters/claude-code/mods/ork-ritual/hooks/replay.tsx +271 -0
  29. package/adapters/claude-code/mods/ork-ritual/hooks/ritual.ts +218 -0
  30. package/adapters/claude-code/mods/ork-ritual/orkastery-mod.json +5 -0
  31. package/adapters/claude-code/mods/ork-ritual/types/index.d.ts +106 -0
  32. package/adapters/claude-code/mods/ork-sentinela/hooks/vigia.ts +1 -1
  33. package/adapters/codex/skills/ork/SKILL.md +2 -0
  34. package/adapters/hermes/README.md +64 -1
  35. package/adapters/hermes/bin/ork-conhecimento-colecoes.sh +14 -0
  36. package/adapters/hermes/bin/ork-conhecimento-listar.sh +15 -0
  37. package/adapters/hermes/bin/ork-conhecimento-mostrar.sh +16 -0
  38. package/adapters/hermes/bin/ork-conhecimento-verificar.sh +15 -0
  39. package/adapters/hermes/bin/ork-vigia-batida.py +127 -0
  40. package/adapters/hermes/hermes.plugin.json +4 -0
  41. package/adapters/hermes/hitl-ingress/__init__.py +101 -8
  42. package/adapters/hermes/skills/orkastery-devmaster/SKILL.md +2 -2
  43. package/adapters/openclaw/README.md +81 -9
  44. package/adapters/openclaw/bin/ork-vigia-batida.js +86 -0
  45. package/adapters/openclaw/dist/hitl-ingress.js +106 -9
  46. package/adapters/openclaw/dist/index.js +86 -0
  47. package/adapters/openclaw/openclaw.plugin.json +34 -4
  48. package/adapters/openclaw/package.json +2 -2
  49. package/adapters/openclaw/src/hitl-ingress.ts +103 -9
  50. package/adapters/openclaw/src/index.ts +94 -0
  51. package/assets/adapters-en/claude-code/README.md +403 -0
  52. package/assets/adapters-en/claude-code/agents/ork-check.md +33 -0
  53. package/assets/adapters-en/claude-code/agents/ork-go.md +33 -0
  54. package/assets/adapters-en/claude-code/agents/ork-goal.md +34 -0
  55. package/assets/adapters-en/claude-code/agents/ork-master.md +35 -0
  56. package/assets/adapters-en/claude-code/agents/ork-plan.md +33 -0
  57. package/assets/adapters-en/claude-code/agents/ork-ship.md +33 -0
  58. package/assets/adapters-en/claude-code/commands/check.md +46 -0
  59. package/assets/adapters-en/claude-code/commands/go.md +46 -0
  60. package/assets/adapters-en/claude-code/commands/goal.md +55 -0
  61. package/assets/adapters-en/claude-code/commands/master.md +54 -0
  62. package/assets/adapters-en/claude-code/commands/onboarding.md +22 -0
  63. package/assets/adapters-en/claude-code/commands/ork.md +126 -0
  64. package/assets/adapters-en/claude-code/commands/plan.md +47 -0
  65. package/assets/adapters-en/claude-code/commands/ship.md +45 -0
  66. package/assets/adapters-en/codex/skills/ork/SKILL.md +85 -0
  67. package/assets/adapters-en/hermes/README.md +273 -0
  68. package/assets/adapters-en/hermes/skills/orkastery-devmaster/SKILL.md +169 -0
  69. package/assets/references-en/README.md +25 -0
  70. package/assets/references-en/code-review-axes.md +82 -0
  71. package/assets/references-en/definition-of-done.md +74 -0
  72. package/assets/references-en/performance-checklist.md +53 -0
  73. package/assets/references-en/security-checklist.md +101 -0
  74. package/assets/references-en/testing-patterns.md +51 -0
  75. package/assets/security-scan/defaults/.golangci.yml +2 -0
  76. package/assets/security-scan/defaults/eslint.config.mjs +11 -0
  77. package/assets/security-scan/defaults/gitleaks.toml +3 -0
  78. package/assets/security-scan/defaults/ruff.toml +1 -0
  79. package/assets/security-scan/tools-agil.json +87 -0
  80. package/assets/security-scan/tools.json +625 -0
  81. package/assets/skills-en/core/onboarding/SKILL.md +58 -0
  82. package/assets/skills-en/core/orkastery-bootstrap/SKILL.md +119 -0
  83. package/assets/skills-en/core/thread-state/SKILL.md +88 -0
  84. package/assets/skills-en/governance/decision-triage/SKILL.md +65 -0
  85. package/assets/skills-en/governance/narrative-guardian/SKILL.md +66 -0
  86. package/assets/skills-en/governance/roadmap-keeper/SKILL.md +60 -0
  87. package/assets/skills-en/governance/scope-check-capability-map/SKILL.md +71 -0
  88. package/assets/skills-en/observability/thread-tracing/SKILL.md +63 -0
  89. package/assets/skills-en/phases/check-quality/SKILL.md +103 -0
  90. package/assets/skills-en/phases/go-implementation/SKILL.md +78 -0
  91. package/assets/skills-en/phases/goal-definition/SKILL.md +69 -0
  92. package/assets/skills-en/phases/master-metrics/SKILL.md +72 -0
  93. package/assets/skills-en/phases/plan-specification/SKILL.md +67 -0
  94. package/assets/skills-en/phases/security-remediation/SKILL.md +70 -0
  95. package/assets/skills-en/phases/ship-release/SKILL.md +71 -0
  96. package/assets/skills-en/reviewers/code-reviewer/SKILL.md +61 -0
  97. package/assets/skills-en/reviewers/security-auditor/SKILL.md +93 -0
  98. package/assets/skills-en/reviewers/test-engineer/SKILL.md +66 -0
  99. package/assets/skills-en/reviewers/web-performance-auditor/SKILL.md +63 -0
  100. package/dist/adapters/claude-bg.js +118 -4
  101. package/dist/adapters/codex-controller-worker.js +12 -5
  102. package/dist/adapters/codex-events.js +16 -4
  103. package/dist/adapters/codex.js +3 -1
  104. package/dist/atualizar-branch.js +245 -0
  105. package/dist/auditoria.js +13 -11
  106. package/dist/auditrun.js +51 -46
  107. package/dist/autorizacao-duravel.js +327 -0
  108. package/dist/board.js +94 -40
  109. package/dist/branch-de-estado.js +16 -8
  110. package/dist/busca-semantica.js +7 -5
  111. package/dist/catalogo.js +2 -1
  112. package/dist/changelog-reconciliacao.js +290 -0
  113. package/dist/check-agil.js +500 -0
  114. package/dist/check-modo.js +41 -0
  115. package/dist/check-paralelo.js +183 -0
  116. package/dist/ci.js +248 -45
  117. package/dist/ciclos.js +8 -6
  118. package/dist/claim-lint.js +12 -8
  119. package/dist/claims-conferir.js +47 -39
  120. package/dist/claims.js +10 -9
  121. package/dist/company-brain-client.js +10 -3
  122. package/dist/company-brain-migration.js +11 -5
  123. package/dist/conducao-batida.js +759 -0
  124. package/dist/conducao-sentinela.js +25 -8
  125. package/dist/conducao.js +84 -29
  126. package/dist/conhecimento-consulta.js +270 -0
  127. package/dist/conhecimento.js +111 -87
  128. package/dist/conta-esgotada.js +127 -0
  129. package/dist/dado-privado.js +816 -0
  130. package/dist/decisao-autonoma.js +5 -4
  131. package/dist/demo.js +14 -12
  132. package/dist/dependencias-da-worktree.js +25 -0
  133. package/dist/divida.js +38 -36
  134. package/dist/docs.js +81 -74
  135. package/dist/doctor-forja.js +345 -0
  136. package/dist/doctor-pulse-cron.js +113 -1
  137. package/dist/doctor.js +164 -6
  138. package/dist/dsn-da-memoria.js +417 -0
  139. package/dist/entrega-por-mod.js +503 -0
  140. package/dist/entrega-pr.js +143 -43
  141. package/dist/esgotamentos.js +13 -11
  142. package/dist/estado-thread.js +21 -18
  143. package/dist/evalrunner.js +35 -32
  144. package/dist/fabrica-batida.js +34 -21
  145. package/dist/fabrica-estado.js +13 -10
  146. package/dist/fix.js +21 -19
  147. package/dist/forja/adaptador.js +6 -0
  148. package/dist/forja/ambiente-de-ci.js +27 -0
  149. package/dist/forja/api.js +256 -0
  150. package/dist/forja/cache.js +89 -0
  151. package/dist/forja/cli.js +60 -0
  152. package/dist/forja/contrato.js +9 -0
  153. package/dist/forja/endereco.js +43 -0
  154. package/dist/forja/estado.js +22 -0
  155. package/dist/forja/executor.js +73 -0
  156. package/dist/forja/github/ci.js +95 -0
  157. package/dist/forja/github/dono-da-rede.js +18 -0
  158. package/dist/forja/github/metadados.js +15 -0
  159. package/dist/forja/github/pedidos.js +200 -0
  160. package/dist/forja/gitlab/ci.js +141 -0
  161. package/dist/forja/gitlab/consultas.js +59 -0
  162. package/dist/forja/gitlab/dono-da-rede.js +43 -0
  163. package/dist/forja/gitlab/metadados.js +15 -0
  164. package/dist/forja/gitlab/pedidos-abertos.js +158 -0
  165. package/dist/forja/gitlab/pedidos.js +141 -0
  166. package/dist/forja/produtor.js +32 -0
  167. package/dist/forja/registro.js +31 -0
  168. package/dist/forja/resolver.js +121 -0
  169. package/dist/forja/texto.js +13 -0
  170. package/dist/forja/versao.js +71 -0
  171. package/dist/forja.js +123 -80
  172. package/dist/handoff.js +23 -13
  173. package/dist/hitl-contract.js +46 -43
  174. package/dist/hitl-curto.js +37 -25
  175. package/dist/hitl-gates.js +13 -11
  176. package/dist/hitl-local-receipt.js +51 -0
  177. package/dist/hitl-local.js +11 -2
  178. package/dist/hitl-lock.js +5 -11
  179. package/dist/hitl-public-receipt.js +11 -0
  180. package/dist/hitl-resumo.js +44 -1
  181. package/dist/hitl-sessions.js +62 -9
  182. package/dist/hitl-texto-livre.js +7 -4
  183. package/dist/hitl.js +34 -31
  184. package/dist/horario.js +16 -0
  185. package/dist/hosts.js +104 -134
  186. package/dist/index.js +848 -548
  187. package/dist/indice-vetorial.js +14 -12
  188. package/dist/init.js +11 -2
  189. package/dist/integracoes-locais.js +2 -0
  190. package/dist/intelligence-graph-cli.js +123 -69
  191. package/dist/intelligence-graph-query.js +37 -22
  192. package/dist/leases.js +19 -18
  193. package/dist/ledger-stats.js +17 -16
  194. package/dist/ledger.js +31 -1
  195. package/dist/licoes.js +12 -11
  196. package/dist/locale-accounts.js +220 -0
  197. package/dist/locale-adapter.js +291 -0
  198. package/dist/locale-ajuda.js +76 -4
  199. package/dist/locale-audit.js +199 -0
  200. package/dist/locale-claims.js +213 -0
  201. package/dist/locale-conducao.js +138 -0
  202. package/dist/locale-conhecimento.js +181 -0
  203. package/dist/locale-decisao.js +205 -0
  204. package/dist/locale-docs.js +230 -0
  205. package/dist/locale-estado.js +101 -0
  206. package/dist/locale-forja.js +290 -0
  207. package/dist/locale-gerados.js +5 -0
  208. package/dist/locale-grafo.js +129 -0
  209. package/dist/locale-master.js +83 -0
  210. package/dist/locale-network.js +524 -0
  211. package/dist/locale-operacao-restante.js +931 -0
  212. package/dist/locale-projetos.js +100 -0
  213. package/dist/locale-prompts.js +194 -0
  214. package/dist/locale-pulse.js +140 -2
  215. package/dist/locale-reservas.js +87 -0
  216. package/dist/locale-retry.js +145 -6
  217. package/dist/locale-security-scan.js +69 -0
  218. package/dist/locale-setup.js +192 -0
  219. package/dist/locale-ship.js +169 -66
  220. package/dist/locale-thread.js +149 -5
  221. package/dist/locale-verify.js +80 -4
  222. package/dist/locale-worktree.js +246 -0
  223. package/dist/locale.js +553 -9
  224. package/dist/maestro-runtime.js +22 -3
  225. package/dist/manifest.js +287 -11
  226. package/dist/maquina-ociosa.js +211 -0
  227. package/dist/maquina.js +10 -5
  228. package/dist/master-nota-local.js +200 -0
  229. package/dist/master-nota.js +10 -2
  230. package/dist/master.js +118 -41
  231. package/dist/mcp-conhecimento.js +52 -0
  232. package/dist/mcp-experiencia.js +26 -5
  233. package/dist/mcp-install.js +73 -8
  234. package/dist/mcp-noctum.js +101 -0
  235. package/dist/mcp-server.js +82 -14
  236. package/dist/mcp-ship-transporte.js +977 -0
  237. package/dist/mcp-ship.js +68 -24
  238. package/dist/mcp-transportes.js +17 -0
  239. package/dist/memoria.js +63 -58
  240. package/dist/modos-migracao.js +8 -6
  241. package/dist/modos.js +17 -18
  242. package/dist/network-roadmap.js +85 -49
  243. package/dist/noctum-aceite.js +789 -0
  244. package/dist/noctum-arco.js +540 -33
  245. package/dist/noctum-capacidade.js +3 -3
  246. package/dist/noctum-changelog.js +399 -0
  247. package/dist/noctum-cli.js +482 -0
  248. package/dist/noctum-coordenacao.js +1225 -0
  249. package/dist/noctum-entrega.js +1169 -0
  250. package/dist/noctum-envelope.js +252 -16
  251. package/dist/noctum-execucao.js +95 -23
  252. package/dist/noctum-fechamento.js +405 -0
  253. package/dist/noctum-fila.js +43 -9
  254. package/dist/noctum-guarda.js +256 -0
  255. package/dist/noctum-integracao.js +507 -0
  256. package/dist/noctum-maquinas.js +383 -0
  257. package/dist/noctum-medicao.js +450 -0
  258. package/dist/noctum-modo.js +362 -0
  259. package/dist/noctum-pergunta-canal.js +96 -0
  260. package/dist/noctum-pergunta.js +115 -0
  261. package/dist/noctum-provas.js +838 -0
  262. package/dist/noctum-reconciliacao.js +591 -0
  263. package/dist/noctum-registro.js +215 -0
  264. package/dist/noctum-relatorio.js +827 -0
  265. package/dist/noctum-resposta.js +207 -0
  266. package/dist/noctum-sessoes-em-voo.js +93 -0
  267. package/dist/noctum-supervisao.js +649 -0
  268. package/dist/noctum-terminal.js +459 -0
  269. package/dist/noctum-transporte.js +655 -0
  270. package/dist/noctum-vigia.js +639 -0
  271. package/dist/ocupacao.js +3 -1
  272. package/dist/onboarding.js +16 -5
  273. package/dist/orkmind.js +39 -23
  274. package/dist/orquestracao.js +31 -35
  275. package/dist/parado-no-condutor.js +146 -124
  276. package/dist/phase.js +53 -27
  277. package/dist/policies.js +33 -0
  278. package/dist/postura-local.js +4 -3
  279. package/dist/procedencia.js +9 -14
  280. package/dist/projeto-alvo.js +59 -20
  281. package/dist/prompts.js +136 -42
  282. package/dist/prova-minima.js +5 -6
  283. package/dist/pulse-cadencia.js +5 -4
  284. package/dist/pulse-consentimento.js +53 -1
  285. package/dist/pulse-delivery.js +143 -27
  286. package/dist/pulse-resposta.js +368 -4
  287. package/dist/pulse.js +136 -3
  288. package/dist/ratelimit.js +12 -4
  289. package/dist/recall.js +14 -13
  290. package/dist/rede-adesao.js +13 -8
  291. package/dist/rede-forja.js +108 -24
  292. package/dist/rede-status.js +63 -45
  293. package/dist/rede.js +86 -46
  294. package/dist/retomada-checkpoint.js +101 -0
  295. package/dist/retry.js +228 -73
  296. package/dist/roadmap-reservas.js +32 -32
  297. package/dist/runtime-ambiente.js +5 -0
  298. package/dist/runtime-context.js +117 -43
  299. package/dist/runtime-escada.js +423 -0
  300. package/dist/runtime-profiles.js +103 -46
  301. package/dist/saida-segura.js +3 -2
  302. package/dist/security-scan/agil.js +355 -0
  303. package/dist/security-scan/cli.js +76 -0
  304. package/dist/security-scan/compare.js +149 -0
  305. package/dist/security-scan/config.js +93 -0
  306. package/dist/security-scan/detect.js +97 -0
  307. package/dist/security-scan/executor.js +188 -0
  308. package/dist/security-scan/guard.js +180 -0
  309. package/dist/security-scan/imagem-de-lint.js +96 -0
  310. package/dist/security-scan/normalize/actionlint.js +12 -0
  311. package/dist/security-scan/normalize/eslint.js +12 -0
  312. package/dist/security-scan/normalize/gitleaks.js +13 -0
  313. package/dist/security-scan/normalize/golangci-lint.js +13 -0
  314. package/dist/security-scan/normalize/govulncheck.js +36 -0
  315. package/dist/security-scan/normalize/index.js +25 -0
  316. package/dist/security-scan/normalize/npm-audit.js +30 -0
  317. package/dist/security-scan/normalize/osv-scanner.js +32 -0
  318. package/dist/security-scan/normalize/oxlint.js +51 -0
  319. package/dist/security-scan/normalize/pip-audit.js +16 -0
  320. package/dist/security-scan/normalize/ruff.js +12 -0
  321. package/dist/security-scan/normalize/semgrep.js +20 -0
  322. package/dist/security-scan/normalize/trivy.js +33 -0
  323. package/dist/security-scan/normalize/util.js +204 -0
  324. package/dist/security-scan/normalize/zizmor.js +19 -0
  325. package/dist/security-scan/report.js +156 -0
  326. package/dist/security-scan/run.js +448 -0
  327. package/dist/security-scan/tools.js +62 -0
  328. package/dist/security-scan/trabalhador.js +74 -0
  329. package/dist/security-scan/types.js +15 -0
  330. package/dist/session-events.js +19 -2
  331. package/dist/session-watcher-claude.js +74 -19
  332. package/dist/session-watcher.js +156 -10
  333. package/dist/sessoes-contas.js +9 -0
  334. package/dist/sessoes-inventario.js +1 -1
  335. package/dist/sessoes.js +25 -23
  336. package/dist/setup.js +59 -58
  337. package/dist/ship-publicar.js +263 -92
  338. package/dist/ship.js +160 -17
  339. package/dist/superficie.js +14 -11
  340. package/dist/thread-close.js +9 -9
  341. package/dist/thread.js +121 -18
  342. package/dist/tokens.js +15 -11
  343. package/dist/trabalho-thread.js +297 -0
  344. package/dist/transporte-do-canal.js +189 -0
  345. package/dist/types.js +12 -1
  346. package/dist/util.js +5 -2
  347. package/dist/varredura-acoes.js +507 -0
  348. package/dist/verify.js +472 -29
  349. package/dist/worktree-local.js +12 -10
  350. package/dist/worktree.js +81 -85
  351. package/eval/casos/check-quality.json +77 -0
  352. package/eval/casos/security-auditor.json +148 -0
  353. package/eval/casos/security-remediation.json +161 -0
  354. package/eval/fixtures/security-scan/README.md +8 -0
  355. package/eval/fixtures/security-scan/go/.github/workflows/ci.yml +12 -0
  356. package/eval/fixtures/security-scan/go/Dockerfile +4 -0
  357. package/eval/fixtures/security-scan/go/README.md +4 -0
  358. package/eval/fixtures/security-scan/go/config.go +4 -0
  359. package/eval/fixtures/security-scan/go/go.mod +5 -0
  360. package/eval/fixtures/security-scan/go/go.sum +2 -0
  361. package/eval/fixtures/security-scan/go/main.go +31 -0
  362. package/eval/fixtures/security-scan/js/.github/workflows/ci.yml +12 -0
  363. package/eval/fixtures/security-scan/js/Dockerfile +3 -0
  364. package/eval/fixtures/security-scan/js/README.md +4 -0
  365. package/eval/fixtures/security-scan/js/package-lock.json +844 -0
  366. package/eval/fixtures/security-scan/js/package.json +10 -0
  367. package/eval/fixtures/security-scan/js/src/config.js +4 -0
  368. package/eval/fixtures/security-scan/js/src/server.js +17 -0
  369. package/eval/fixtures/security-scan/js/src/util.ts +4 -0
  370. package/eval/fixtures/security-scan/js/tsconfig.json +4 -0
  371. package/eval/fixtures/security-scan/python/.github/workflows/ci.yml +12 -0
  372. package/eval/fixtures/security-scan/python/Dockerfile +3 -0
  373. package/eval/fixtures/security-scan/python/README.md +4 -0
  374. package/eval/fixtures/security-scan/python/app/__init__.py +0 -0
  375. package/eval/fixtures/security-scan/python/app/config.py +2 -0
  376. package/eval/fixtures/security-scan/python/app/main.py +19 -0
  377. package/eval/fixtures/security-scan/python/requirements.txt +1 -0
  378. package/package.json +9 -4
  379. package/references/security-checklist.md +3 -3
  380. package/skills/README.md +1 -0
  381. package/skills/core/orkastery-bootstrap/SKILL.md +2 -2
  382. package/skills/phases/check-quality/SKILL.md +16 -0
  383. package/skills/phases/go-implementation/SKILL.md +6 -0
  384. package/skills/phases/security-remediation/SKILL.md +70 -0
  385. package/skills/reviewers/security-auditor/SKILL.md +25 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * RM-061, fatia F3b: a familia `estado` do catalogo de mensagens, os erros de estado e de procedencia
4
+ * (`estado-thread.ts`, `procedencia.ts`, `manifest.ts` e a postura local) e a conferencia do estado unico que o `ork worktree
5
+ * audit` mostra. O pt-BR e a
6
+ * fonte; o ingles e tipado por ele. Sem import do nucleo.
7
+ *
8
+ * Os erros nascem por `ErroDoCatalogo` no locale ativo: no escopo pt-BR da gravacao, no servidor MCP e no cron, em pt-BR
9
+ * como sempre; a entrada do CLI os remonta no locale do comando. O motivo tipado do comeco da mensagem (`estado.link`,
10
+ * `estado.rastreado`, `transporte.rastreado`, `ponteiro.fora-da-raiz`) e o mesmo nas duas linguas: ha codigo que o le.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.ESTADO_EN = exports.ESTADO_PT_BR = void 0;
14
+ exports.ESTADO_PT_BR = {
15
+ gitInvalido: (local) => `.git inválido em ${local}`,
16
+ arvorePrincipal: (comum) => `árvore principal não resolvida pelo git-common-dir: ${comum}`,
17
+ idInvalido: 'id de thread inválido',
18
+ link: (rel) => `estado.link: ${rel} é link simbólico; o estado do ork fica em ` +
19
+ 'pastas de verdade dentro da raiz (um link versionado levaria a escrita para fora dela). Remova o link.',
20
+ legadoComLink: (nome) => `estado legado contém link: ${nome}`,
21
+ legadoEspecial: (nome) => `estado legado contém arquivo especial: ${nome}`,
22
+ foraDaArvore: 'worktree não pertence à árvore principal',
23
+ indiceIndisponivel: (saida) => `índice da worktree indisponível: ${saida}`,
24
+ naoPreservou: (saida) => `não foi possível preservar o estado versionado no índice: ${saida}`,
25
+ threadsVinculado: 'diretório de threads inesperadamente vinculado',
26
+ linkOutroDestino: (local) => `link de estado aponta para outro destino: ${local}`,
27
+ dividido: (nome, local, alvo) => `estado dividido: ${nome} diverge entre ${local} e ${alvo}; reconcilie antes do sync`,
28
+ linkQuebrado: (local) => `link de estado quebrado: ${local}`,
29
+ preparacaoFalhou: (saida) => `preparação do estado para Git falhou: ${saida}`,
30
+ alteradoDuranteGit: (local) => `estado local alterado durante operação Git: ${local}; cópia e main preservadas para reconciliação`,
31
+ /** O detalhe do check `estado-unico` do audit: vai ao ledger em pt-BR e a impressao o remonta. */
32
+ estadoUnico: (ok, main, local, caminho) => `${ok ? 'mesmo estado' : 'estado dividido'}: main=${main} eventos, worktree=${local} eventos; ${caminho}`,
33
+ estadoUnicoCorrecao: (id) => `ork worktree sync ${id}; divergências exigem reconciliação preservando evidências`,
34
+ // procedencia.ts
35
+ rastreado: (rel) => `estado.rastreado: ${rel} está versionado no git, e estado versionado ` +
36
+ 'não escolhe onde o ork roda (ele pode ter vindo de outro repositório). Tire o estado do índice ' +
37
+ '(git rm -r --cached .orkastery e .orkastery/ no .gitignore) e rode o comando de novo.',
38
+ worktreeNaoRegistrada: (dir, id) => `estado.worktree-nao-registrada: ${dir} não aparece em ` +
39
+ 'git worktree list deste repositório, e o ork só roda git e agente na raiz do projeto ou numa worktree ' +
40
+ `registrada. Recrie a worktree da thread com ork worktree ensure ${id}.`,
41
+ transporteRastreado: (arquivo) => `transporte.rastreado: ${arquivo} está versionado no git, e o transporte do ` +
42
+ 'pulse e do digest só vale do arquivo local desta máquina. Tire-o do índice (git rm --cached) e grave-o ' +
43
+ 'de novo nesta máquina.',
44
+ transporteNaoComum: (arquivo) => `transporte.rastreado: ${arquivo} precisa ser um arquivo comum desta máquina, ` +
45
+ 'não link nem diretório.',
46
+ ponteiroForaDaRaiz: (origem) => `ponteiro.fora-da-raiz: ${origem} aponta para fora da raiz do ` +
47
+ 'projeto e da worktree registrada da thread (também por link simbólico). Um ponteiro guardado no estado só lê ' +
48
+ 'arquivo de dentro do projeto. Exporte o handoff de novo (ork handoff export) ou copie o arquivo para dentro do projeto.',
49
+ // manifest.ts (o diretorio de estado da raiz) e postura-local.ts (a pasta privada da confirmacao local)
50
+ dirEstadoLink: (dir) => `estado.link: ${dir} é link simbólico; o estado do ork fica numa pasta de verdade dentro da raiz. Remova o link.`,
51
+ posturaEstadoLink: 'estado.link: .orkastery precisa ser pasta de verdade',
52
+ posturaPrivadaLink: 'estado.link: .orkastery/private precisa ser pasta de verdade',
53
+ posturaRastreada: (nome) => `estado.rastreado: ${nome} está versionado no git; tire-o do índice (git rm --cached) antes de confirmar`,
54
+ // branch-de-estado.ts: o remoto que nunca vai ao git (`<prefixo>` e de quem usa: ship, roadmap, fabrica, ci)
55
+ remotoInvalido: (prefixo, remoto) => `${prefixo}.remoto-invalido: o remoto ${remoto} não é nome de remoto do git ` +
56
+ '(letras, dígitos, ".", "_", "-" e "/" entre partes, cada parte começando por letra ou dígito, sem URL); nada foi passado ao git. ' +
57
+ 'Corrija fabrica.remoto no orkastery.yaml ou --remoto (padrão: origin).',
58
+ gitFalhou: (prefixo, comando, saida) => `${prefixo}.git: git ${comando} falhou: ${saida}`,
59
+ pushFalhou: (prefixo, remoto, saida) => `${prefixo}.sem-remoto: o push para ${remoto} falhou: ${saida}`,
60
+ };
61
+ exports.ESTADO_EN = {
62
+ gitInvalido: (local) => `invalid \`.git\` in ${local}`,
63
+ arvorePrincipal: (comum) => `main tree not resolved from git-common-dir: ${comum}`,
64
+ idInvalido: 'invalid thread id',
65
+ link: (rel) => `estado.link: ${rel} is a symbolic link; ork state lives in real folders inside the root ` +
66
+ '(a versioned link would send writes outside it). Remove the link.',
67
+ legadoComLink: (nome) => `legacy state contains a link: ${nome}`,
68
+ legadoEspecial: (nome) => `legacy state contains a special file: ${nome}`,
69
+ foraDaArvore: 'the worktree does not belong to the main tree',
70
+ indiceIndisponivel: (saida) => `worktree index unavailable: ${saida}`,
71
+ naoPreservou: (saida) => `could not keep the versioned state in the index: ${saida}`,
72
+ threadsVinculado: 'threads directory unexpectedly linked',
73
+ linkOutroDestino: (local) => `state link points to another target: ${local}`,
74
+ dividido: (nome, local, alvo) => `split state: ${nome} differs between ${local} and ${alvo}; reconcile before the sync`,
75
+ linkQuebrado: (local) => `broken state link: ${local}`,
76
+ preparacaoFalhou: (saida) => `preparing the state for Git failed: ${saida}`,
77
+ alteradoDuranteGit: (local) => `local state changed during a Git operation: ${local}; copy and main kept for reconciliation`,
78
+ estadoUnico: (ok, main, local, caminho) => `${ok ? 'same state' : 'split state'}: main=${main} events, worktree=${local} events; ${caminho}`,
79
+ estadoUnicoCorrecao: (id) => `ork worktree sync ${id}; divergences need a reconciliation that keeps the evidence`,
80
+ rastreado: (rel) => `estado.rastreado: ${rel} is versioned in git, and versioned state does not choose where ork runs ` +
81
+ '(it may have come from another repository). Remove the state from the index ' +
82
+ '(`git rm -r --cached .orkastery` and `.orkastery/` in `.gitignore`) and run the command again.',
83
+ worktreeNaoRegistrada: (dir, id) => `estado.worktree-nao-registrada: ${dir} does not show up in this repository's ` +
84
+ '`git worktree list`, and ork only runs git and agents at the project root or in a registered worktree. ' +
85
+ `Recreate the thread worktree with \`ork worktree ensure ${id}\`.`,
86
+ transporteRastreado: (arquivo) => `transporte.rastreado: ${arquivo} is versioned in git, and the pulse and digest transport ` +
87
+ 'only counts from this machine\'s local file. Remove it from the index (`git rm --cached`) and write it again on this machine.',
88
+ transporteNaoComum: (arquivo) => `transporte.rastreado: ${arquivo} must be a regular file on this machine, not a link or a directory.`,
89
+ ponteiroForaDaRaiz: (origem) => `ponteiro.fora-da-raiz: ${origem} points outside the project root and the thread's registered ` +
90
+ 'worktree (also through a symbolic link). A pointer kept in the state only reads files inside the project. ' +
91
+ 'Export the handoff again (`ork handoff export`) or copy the file into the project.',
92
+ dirEstadoLink: (dir) => `estado.link: ${dir} is a symbolic link; ork state lives in a real folder inside the root. Remove the link.`,
93
+ posturaEstadoLink: 'estado.link: .orkastery must be a real folder',
94
+ posturaPrivadaLink: 'estado.link: .orkastery/private must be a real folder',
95
+ posturaRastreada: (nome) => `estado.rastreado: ${nome} is versioned in git; take it out of the index (\`git rm --cached\`) before confirming`,
96
+ remotoInvalido: (prefixo, remoto) => `${prefixo}.remoto-invalido: remote ${remoto} is not a git remote name ` +
97
+ '(letters, digits, ".", "_", "-" and "/" between parts, each part starting with a letter or digit, no URL); nothing was passed to git. ' +
98
+ 'Fix `fabrica.remoto` in `orkastery.yaml` or `--remoto` (default: origin).',
99
+ gitFalhou: (prefixo, comando, saida) => `${prefixo}.git: git ${comando} failed: ${saida}`,
100
+ pushFalhou: (prefixo, remoto, saida) => `${prefixo}.sem-remoto: the push to ${remoto} failed: ${saida}`,
101
+ };
@@ -0,0 +1,290 @@
1
+ "use strict";
2
+ /**
3
+ * A familia `forja` do catalogo: o motivo de cada erro tipado da forja (`forja.*`), para a pessoa. O codigo sai igual
4
+ * nas duas linguas, no comeco da frase; o detalhe e dado (status HTTP, metodo, caminho, host) e sai como veio. O
5
+ * pt-BR e a fonte; o ingles e tipado por ele. Sem import do nucleo.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.FORJA_EN = exports.FORJA_PT_BR = void 0;
9
+ exports.FORJA_PT_BR = {
10
+ motivo: (e, tipo) => {
11
+ const d = e.detalhe;
12
+ switch (e.codigo) {
13
+ case 'forja.desconhecida': return `forja.desconhecida: nenhuma CLI com login em ${d} respondeu como forja; declare forja.tipo no orkastery.yaml`;
14
+ case 'forja.ambigua': return `forja.ambigua: ${d} respondeu como mais de uma forja; declare forja.tipo no orkastery.yaml`;
15
+ case 'forja.remoto-divergente': return `forja.remoto-divergente: o remoto não é da forja que o orkastery.yaml declara (${d})`;
16
+ case 'forja.sem-login': return `forja.sem-login: a CLI da forja não tem login no host (${d})`;
17
+ case 'forja.sem-permissao': return `forja.sem-permissao: o login da CLI não tem permissão para isto (${d})`;
18
+ case 'forja.nao-achei': return tipo === 'gitlab'
19
+ ? `forja.nao-achei: ${d}; no GitLab, projeto privado sem acesso também responde 404`
20
+ : `forja.nao-achei: ${d}`;
21
+ case 'forja.limite': return `forja.limite: a cota de requisições da forja acabou (${d})${e.tentarEm ? `; tente depois de ${e.tentarEm}` : ''}`;
22
+ case 'forja.conflito': return `forja.conflito: a forja recusou por conflito com o estado atual (${d})`;
23
+ case 'forja.indisponivel': return `forja.indisponivel: a forja não respondeu (${d})`;
24
+ case 'forja.pedido-recusado': return `forja.pedido-recusado: a forja recusou o pedido (${d})`;
25
+ case 'forja.incompleto': return `forja.incompleto: a lista passou do teto de leitura e não foi lida inteira (${d})`;
26
+ case 'forja.resposta-invalida': return `forja.resposta-invalida: resposta fora do formato esperado (${d})`;
27
+ case 'forja.versao-abaixo-do-piso': return `forja.versao-abaixo-do-piso: ${d}; o ork não opera esta versão`;
28
+ case 'forja.sem-capacidade': return `forja.sem-capacidade: o adaptador não implementa ${d}`;
29
+ case 'forja.ausente': return `forja.ausente: a CLI da forja não está instalada nesta máquina (${d})`;
30
+ default: return `${e.codigo}: ${d}`;
31
+ }
32
+ },
33
+ /** As linhas da secao "forja" do `ork doctor` (`doctor-forja.ts`). */
34
+ doctor: {
35
+ flagComValor: 'erro: ork doctor --forja não leva valor (uso: ork doctor --json [--forja]); sem a flag, a seção forja não roda',
36
+ origens: { manifesto: 'manifesto', remoto: 'remoto', sondagem: 'sondagem', padrao: 'padrão' },
37
+ identidade: (tipo, host, porta, base, repo, origens) => `${tipo} em ${host}, porta ${porta}, caminho base ${base}; projeto ${repo} (${origens})`,
38
+ origensDosCampos: (tipo, host, porta, base) => `tipo: ${tipo}; host: ${host}; porta: ${porta}; caminho base: ${base}`,
39
+ semHostComBloco: (remoto) => `o orkastery.yaml declara o bloco forja, mas o remoto ${remoto} não aponta uma forja (sem remoto, ou caminho local)`,
40
+ semHostCorrecao: (remoto) => `aponte o remoto para a forja (git remote set-url ${remoto} <url>) ou retire o bloco forja do orkastery.yaml`,
41
+ identidadeCorrecao: 'declare forja.tipo no orkastery.yaml (e forja.host, se a web tem outro nome que o remoto), ou faça o login da CLI ' +
42
+ 'no host: gh auth login ou glab auth login',
43
+ divergenteCorrecao: 'confira forja.host, forja.ssh_host e forja.caminho_base do orkastery.yaml contra o remoto',
44
+ portas: { aberta: 'aberta', recusada: 'recusada', 'sem-resposta': 'sem resposta' },
45
+ alcance: (web, ssh) => `HTTPS ${web}; SSH ${ssh}`,
46
+ alcanceDe: (host, porta, estado) => `${host}:${porta} ${estado}`,
47
+ webForaCorrecao: (host, porta) => `confira a rede até ${host}:${porta} (firewall, proxy, VPN) e forja.porta no orkastery.yaml`,
48
+ sshForaCorrecao: 'sem SSH, a entrega vai pelo HTTPS: o transporte forja-https usa o login da CLI',
49
+ tlsHttp: (host) => `o remoto usa http: ${host} sem TLS`,
50
+ tlsHttpCorrecao: 'use o endereço https da forja no remoto',
51
+ caAusente: (ca) => `forja.ca aponta ${ca}, que não existe ou não é legível nesta máquina`,
52
+ caAusenteCorrecao: 'corrija forja.ca no orkastery.yaml ou instale o PEM nesse caminho nesta máquina',
53
+ tlsFalhou: (host, motivo) => `a cadeia TLS de ${host} não valida (${motivo}); a verificação nunca é desligada`,
54
+ tlsCorrecao: 'instale a CA interna no sistema ou declare forja.ca com o arquivo PEM dela',
55
+ tlsOk: (host, ca) => (ca ? `a cadeia TLS de ${host} valida com a CA ${ca}` : `a cadeia TLS de ${host} valida com a CA do sistema`),
56
+ tlsCaForaDoLinux: (host, ca) => `a cadeia TLS de ${host} valida com a CA ${ca}, mas fora do Linux ela não chega ao gh (SSL_CERT_FILE só vale no Linux)`,
57
+ tlsCaForaDoLinuxCorrecao: 'instale a CA interna no armazenamento de certificados do sistema',
58
+ cli: (cmd, versao, minima) => `${cmd} ${versao} (mínimo ${minima})`,
59
+ cliAusente: (cmd, minima) => `${cmd} não está instalado nesta máquina (mínimo ${minima})`,
60
+ cliIlegivel: (cmd) => `${cmd} --version não disse a versão`,
61
+ cliAbaixo: (cmd, versao, minima) => `${cmd} ${versao} abaixo do mínimo ${minima}`,
62
+ cliCorrecao: (cmd, minima) => `instale ou atualize o ${cmd} para ${minima} ou acima`,
63
+ login: (cmd, alvo) => `${cmd} com login em ${alvo}`,
64
+ semLogin: (cmd, alvo) => `${cmd} sem login em ${alvo}`,
65
+ loginCorrecao: (comando) => `rode ${comando}`,
66
+ subcaminho: (base) => `${base}/api/v4/metadata responde`,
67
+ subcaminhoFalhou: (base, motivo) => `${base}/api/v4/metadata não respondeu: ${motivo}`,
68
+ subcaminhoCorrecao: 'confira forja.caminho_base contra o relative_url_root da instância',
69
+ faixas: { testada: 'testada', compativel: 'compatível', 'abaixo-do-piso': 'abaixo do piso', 'sem-faixa': 'sem faixa' },
70
+ servidor: (versao, edicao, faixa) => `${versao} ${edicao}, faixa ${faixa}`,
71
+ servidorSemFaixa: (host, versao) => (versao ? `${host} ${versao}` : host),
72
+ servidorFalhou: (motivo) => `a versão do servidor não foi lida: ${motivo}`,
73
+ servidorFalhouCorrecao: 'confira o alcance, o login e a permissão da CLI no host',
74
+ servidorAbaixo: (versao, piso) => `${versao} abaixo do piso ${piso}: o ork não opera esta versão`,
75
+ servidorCorrecao: (piso) => `atualize a instância para ${piso} ou acima`,
76
+ doCache: 'lido há menos de 24 h',
77
+ nenhum: 'nenhum',
78
+ escopo: (lista) => `escopos do token: ${lista}`,
79
+ escopoSemLeitura: (lista) => `o token não lê a API (escopos: ${lista}); falta api ou read_api`,
80
+ escopoCorrecao: 'refaça o login da CLI com um token que tenha api ou read_api',
81
+ escopoSemEscrita: (lista) => `o SHIP do MCP empurra pelo forja-https, e o token não escreve no repositório (escopos: ${lista}); falta write_repository ou api`,
82
+ escopoSemEscritaCorrecao: 'refaça o login da CLI com um token que tenha write_repository (ou api), ou instale o SHIP com --ship-transport forja-ssh',
83
+ escopoNaoMedivel: (motivo) => `não medível: ${motivo}`,
84
+ escopoNaoMedivelCorrecao: 'com token de acesso pessoal o doctor mede os escopos; com OAuth, confira-os na forja',
85
+ escopoFineGrained: 'não medível: token fine-grained ou de GitHub App não declara escopos',
86
+ escopoSemRepo: (lista) => `escopos do token: ${lista}; sem repo, repositório privado não é lido`,
87
+ escopoSemRepoCorrecao: 'rode gh auth refresh -s repo',
88
+ projetoFalhou: (repo, motivo) => `o projeto ${repo} não foi lido: ${motivo}`,
89
+ projetoFalhouCorrecao: 'confira o caminho do projeto no remoto e a permissão do login da CLI nele',
90
+ naoDisponivel: 'não disponível nesta edição',
91
+ naoMedivel: 'não medível',
92
+ ligado: 'ligado',
93
+ desligado: 'desligado',
94
+ permitido: 'permitido',
95
+ projetoGitlab: (metodo, squash, mergedResults, mergeTrain) => `merge ${metodo}; squash ${squash}; merged results ${mergedResults}; merge train ${mergeTrain}`,
96
+ projetoGithub: (merge, squash, rebase) => `merge commit ${merge}; squash ${squash}; rebase ${rebase}`,
97
+ avisoFf: 'com fast-forward não há commit de merge: o assunto ship(<thread>) não chega à base',
98
+ avisoMensagemPadrao: 'a mensagem de merge padrão (Merge branch …) não começa por ship(<thread>)',
99
+ avisoSquash: (opcao) => `squash ${opcao}: a entrega por squash não se liga ao head verificado (entrega.sem-vinculo)`,
100
+ avisoSemMergeCommit: 'sem merge commit, a entrega por PR não se liga ao head verificado (entrega.sem-vinculo)',
101
+ projetoGitlabCorrecao: 'em Settings > Merge requests, use merge commit e um modelo de mensagem de merge que comece por %{title}',
102
+ projetoGithubCorrecao: 'em Settings > General > Pull Requests, permita merge commits',
103
+ capacidades: (ligadas) => `ligadas: ${ligadas}`,
104
+ capacidadesDesligadas: (ligadas, desligadas) => `ligadas: ${ligadas}; desligadas (o adaptador não implementa): ${desligadas}`,
105
+ capacidadesCorrecao: 'cada capacidade desligada segue o caminho de reserva do ork, como hoje',
106
+ },
107
+ /** O transporte do `ork_ship` do MCP: a frase de cada recusa e as linhas da instalacao. */
108
+ transporteShip: {
109
+ recusa: (codigo, d) => {
110
+ const frase = (() => {
111
+ switch (codigo) {
112
+ case 'mcp.ship.transport.urls': return `o origin precisa de uma URL só, de forja ou de bare local (${d})`;
113
+ case 'mcp.ship.transport.modo': return `o origin não serve a este transporte; use --ship-transport ${d}`;
114
+ case 'mcp.ship.transport.forja': return `a forja do origin não foi resolvida (${d})`;
115
+ case 'mcp.ship.transport.ssh.divergente': return `o origin e a forja resolvida apontam SSH diferente (${d}); acerte forja.ssh_host e forja.ssh_porta ou a URL do origin`;
116
+ case 'mcp.ship.transport.ssh.sem-resposta': return `${d} não entregou chave de servidor SSH; se a forja não abre SSH, use --ship-transport forja-https`;
117
+ case 'mcp.ship.transport.ssh.revogada': return `o seu known_hosts revoga uma chave que ${d} apresentou; não instale até saber por quê`;
118
+ case 'mcp.ship.transport.ssh.nao-confirmada': return `confira a impressão com quem administra a forja e rode de novo com --ssh-fingerprint <impressão> (${d})`;
119
+ case 'mcp.ship.transport.ssh.impressao-divergente': return `a impressão dita não é de nenhuma chave que o servidor apresentou (${d}); não instale até saber por quê`;
120
+ case 'mcp.ship.transport.ssh.known-hosts-ilegivel': return `o seu known_hosts existe e não pôde ser lido (${d}); sem ele, uma chave revogada passaria; acerte o arquivo e rode de novo`;
121
+ case 'mcp.ship.transport.ssh.caminho': return `o known_hosts fixado precisa de caminho absoluto sem espaço nem caractere especial (${d})`;
122
+ case 'mcp.ship.transport.ssh.known-hosts-alterado': return `o known_hosts fixado mudou depois da instalação (${d}); reinstale o MCP`;
123
+ case 'mcp.ship.transport.ssh.credencial-na-url': return `o ${d} leva senha ou token na URL SSH; tire-os com git remote set-url origin ssh://<usuário>@<host>/<caminho>.git`;
124
+ case 'mcp.ship.transport.https.sem-tls': return `HTTP sem TLS levaria a credencial em claro; use https:// no origin (${d})`;
125
+ case 'mcp.ship.transport.https.credencial-na-url': return `o ${d} leva usuário ou token na URL; tire-os com git remote set-url origin https://<host>/<caminho>.git`;
126
+ case 'mcp.ship.transport.https.divergente': return `o origin e a forja resolvida apontam HTTPS diferente (${d}); acerte forja.host e forja.porta ou a URL do origin`;
127
+ case 'mcp.ship.transport.sem-cli': return `a CLI da forja não está instalada; instale ${d} ou acima`;
128
+ case 'mcp.ship.transport.sem-helper': return `a CLI instalada não tem auth git-credential (${d}); atualize até a versão mínima`;
129
+ case 'mcp.ship.transport.sem-login': return `a CLI não tem login no host (${d}); faça o login e rode de novo (o ork doctor mostra o comando)`;
130
+ case 'mcp.ship.transport.binario': return `a CLI precisa ser arquivo executável seu ou do root, sem escrita de grupo ou de outros (${d})`;
131
+ case 'mcp.ship.transport.ca': return `a CA de forja.ca precisa ser um PEM legível, seu ou do root, sem escrita de grupo ou de outros (${d})`;
132
+ case 'mcp.ship.transport.ca-alterada': return `a CA mudou depois da instalação (${d}); reinstale o MCP`;
133
+ case 'mcp.ship.transport.fixacao-ausente': return `este transporte não foi instalado nesta máquina; rode ${d}`;
134
+ case 'mcp.ship.transport.fixacao-insegura': return `a fixação do transporte precisa ser sua, sem link e sem acesso de grupo ou de outros (${d})`;
135
+ case 'mcp.ship.transport.fixacao-divergente': return `a instalação fixou outro transporte ou outro origin (${d}); reinstale o MCP`;
136
+ case 'mcp.ship.transport.cli-config': return `${d} precisa ser um caminho absoluto sem caractere de controle; é a pasta de config da CLI da forja, que o push leva ao helper de credencial`;
137
+ case 'mcp.ship.transport.mudou-no-push': return `o ${d} ou a config do git mudou durante o push; o push pode ter sido feito, mas a entrega não foi provada: confira o remoto, a branch e a config antes de repetir`;
138
+ default: return d;
139
+ }
140
+ })();
141
+ return `${codigo}: ${frase}`;
142
+ },
143
+ fixadoSsh: (nome, chaves, arquivo) => `SHIP por forja-ssh: a chave de ${nome} (${chaves}) ficou fixada em ${arquivo}; cada push confere essa chave, sem perguntar.`,
144
+ fixadoHttps: (origem, cli, ca) => `SHIP por forja-https: o git pede a credencial de ${origem} só ao ${cli} (auth git-credential)${ca ? `, com a CA ${ca} conferida pelo hash a cada push` : ''}.`,
145
+ fixariaSsh: (nome, chaves, arquivo) => `SHIP por forja-ssh: a chave de ${nome} (${chaves}) seria fixada em ${arquivo}; nada foi gravado.`,
146
+ fixariaHttps: (origem, cli, ca) => `SHIP por forja-https: o git pediria a credencial de ${origem} só ao ${cli} (auth git-credential)${ca ? `, com a CA ${ca} conferida pelo hash a cada push` : ''}; nada foi gravado.`,
147
+ consultaNoFixado: (modo) => `mcp.experiencia.transporte-fixado: consulta indisponível no transporte fixado ${modo}: o fetch das consultas ainda não leva a chave, o helper e as travas fixados, e sem eles iria à rede pela config do usuário`,
148
+ proposta: (modo) => `SHIP: o origin deste projeto pede --ship-transport ${modo}; com o transporte padrão, o ork_ship fica indisponível. Para trocar, remova a entrada orkastery e reinstale com a opção.`,
149
+ },
150
+ };
151
+ exports.FORJA_EN = {
152
+ motivo: (e, tipo) => {
153
+ const d = e.detalhe;
154
+ switch (e.codigo) {
155
+ case 'forja.desconhecida': return `forja.desconhecida: no CLI logged in to ${d} answered as a forge; declare forja.tipo in orkastery.yaml`;
156
+ case 'forja.ambigua': return `forja.ambigua: ${d} answered as more than one forge; declare forja.tipo in orkastery.yaml`;
157
+ case 'forja.remoto-divergente': return `forja.remoto-divergente: the remote is not on the forge that orkastery.yaml declares (${d})`;
158
+ case 'forja.sem-login': return `forja.sem-login: the forge CLI is not logged in to the host (${d})`;
159
+ case 'forja.sem-permissao': return `forja.sem-permissao: the CLI login is not allowed to do this (${d})`;
160
+ case 'forja.nao-achei': return tipo === 'gitlab'
161
+ ? `forja.nao-achei: ${d}; on GitLab, a private project you cannot access also answers 404`
162
+ : `forja.nao-achei: ${d}`;
163
+ case 'forja.limite': return `forja.limite: the forge request quota ran out (${d})${e.tentarEm ? `; try again after ${e.tentarEm}` : ''}`;
164
+ case 'forja.conflito': return `forja.conflito: the forge refused because of a conflict with the current state (${d})`;
165
+ case 'forja.indisponivel': return `forja.indisponivel: the forge did not answer (${d})`;
166
+ case 'forja.pedido-recusado': return `forja.pedido-recusado: the forge refused the request (${d})`;
167
+ case 'forja.incompleto': return `forja.incompleto: the list went past the read cap and was not read in full (${d})`;
168
+ case 'forja.resposta-invalida': return `forja.resposta-invalida: the response is not in the expected format (${d})`;
169
+ case 'forja.versao-abaixo-do-piso': return `forja.versao-abaixo-do-piso: ${d}; ork does not operate this version`;
170
+ case 'forja.sem-capacidade': return `forja.sem-capacidade: the adapter does not implement ${d}`;
171
+ case 'forja.ausente': return `forja.ausente: the forge CLI is not installed on this machine (${d})`;
172
+ default: return `${e.codigo}: ${d}`;
173
+ }
174
+ },
175
+ doctor: {
176
+ flagComValor: 'error: ork doctor --forja takes no value (usage: ork doctor --json [--forja]); without the flag, the forge section does not run',
177
+ origens: { manifesto: 'manifest', remoto: 'remote', sondagem: 'probe', padrao: 'default' },
178
+ identidade: (tipo, host, porta, base, repo, origens) => `${tipo} at ${host}, port ${porta}, base path ${base}; project ${repo} (${origens})`,
179
+ origensDosCampos: (tipo, host, porta, base) => `type: ${tipo}; host: ${host}; port: ${porta}; base path: ${base}`,
180
+ semHostComBloco: (remoto) => `orkastery.yaml declares the forja block, but remote ${remoto} does not point to a forge (no remote, or a local path)`,
181
+ semHostCorrecao: (remoto) => `point the remote to the forge (git remote set-url ${remoto} <url>) or remove the forja block from orkastery.yaml`,
182
+ identidadeCorrecao: 'declare forja.tipo in orkastery.yaml (and forja.host, if the web uses another name than the remote), or log the CLI ' +
183
+ 'in to the host: gh auth login or glab auth login',
184
+ divergenteCorrecao: 'check forja.host, forja.ssh_host and forja.caminho_base in orkastery.yaml against the remote',
185
+ portas: { aberta: 'open', recusada: 'refused', 'sem-resposta': 'no answer' },
186
+ alcance: (web, ssh) => `HTTPS ${web}; SSH ${ssh}`,
187
+ alcanceDe: (host, porta, estado) => `${host}:${porta} ${estado}`,
188
+ webForaCorrecao: (host, porta) => `check the network to ${host}:${porta} (firewall, proxy, VPN) and forja.porta in orkastery.yaml`,
189
+ sshForaCorrecao: 'without SSH, delivery goes over HTTPS: the forja-https transport uses the CLI login',
190
+ tlsHttp: (host) => `the remote uses http: ${host} without TLS`,
191
+ tlsHttpCorrecao: 'use the https address of the forge in the remote',
192
+ caAusente: (ca) => `forja.ca points to ${ca}, which does not exist or is not readable on this machine`,
193
+ caAusenteCorrecao: 'fix forja.ca in orkastery.yaml or install the PEM at that path on this machine',
194
+ tlsFalhou: (host, motivo) => `the TLS chain of ${host} does not validate (${motivo}); verification is never turned off`,
195
+ tlsCorrecao: 'install the internal CA in the system or declare forja.ca with its PEM file',
196
+ tlsOk: (host, ca) => (ca ? `the TLS chain of ${host} validates with the CA ${ca}` : `the TLS chain of ${host} validates with the system CA`),
197
+ tlsCaForaDoLinux: (host, ca) => `the TLS chain of ${host} validates with the CA ${ca}, but outside Linux it does not reach gh (SSL_CERT_FILE only works on Linux)`,
198
+ tlsCaForaDoLinuxCorrecao: 'install the internal CA in the system certificate store',
199
+ cli: (cmd, versao, minima) => `${cmd} ${versao} (minimum ${minima})`,
200
+ cliAusente: (cmd, minima) => `${cmd} is not installed on this machine (minimum ${minima})`,
201
+ cliIlegivel: (cmd) => `${cmd} --version did not tell the version`,
202
+ cliAbaixo: (cmd, versao, minima) => `${cmd} ${versao} below the minimum ${minima}`,
203
+ cliCorrecao: (cmd, minima) => `install or upgrade ${cmd} to ${minima} or later`,
204
+ login: (cmd, alvo) => `${cmd} logged in to ${alvo}`,
205
+ semLogin: (cmd, alvo) => `${cmd} not logged in to ${alvo}`,
206
+ loginCorrecao: (comando) => `run ${comando}`,
207
+ subcaminho: (base) => `${base}/api/v4/metadata answers`,
208
+ subcaminhoFalhou: (base, motivo) => `${base}/api/v4/metadata did not answer: ${motivo}`,
209
+ subcaminhoCorrecao: 'check forja.caminho_base against the relative_url_root of the instance',
210
+ faixas: { testada: 'tested', compativel: 'compatible', 'abaixo-do-piso': 'below the floor', 'sem-faixa': 'no range' },
211
+ servidor: (versao, edicao, faixa) => `${versao} ${edicao}, range ${faixa}`,
212
+ servidorSemFaixa: (host, versao) => (versao ? `${host} ${versao}` : host),
213
+ servidorFalhou: (motivo) => `the server version was not read: ${motivo}`,
214
+ servidorFalhouCorrecao: 'check the reach, the login and the permission of the CLI on the host',
215
+ servidorAbaixo: (versao, piso) => `${versao} below the floor ${piso}: ork does not operate this version`,
216
+ servidorCorrecao: (piso) => `upgrade the instance to ${piso} or later`,
217
+ doCache: 'read less than 24 h ago',
218
+ nenhum: 'none',
219
+ escopo: (lista) => `token scopes: ${lista}`,
220
+ escopoSemLeitura: (lista) => `the token cannot read the API (scopes: ${lista}); api or read_api is missing`,
221
+ escopoCorrecao: 'log the CLI in again with a token that has api or read_api',
222
+ escopoSemEscrita: (lista) => `the MCP SHIP pushes over forja-https, and the token cannot write to the repository (scopes: ${lista}); write_repository or api is missing`,
223
+ escopoSemEscritaCorrecao: 'log the CLI in again with a token that has write_repository (or api), or install the SHIP with --ship-transport forja-ssh',
224
+ escopoNaoMedivel: (motivo) => `not measurable: ${motivo}`,
225
+ escopoNaoMedivelCorrecao: 'with a personal access token the doctor measures the scopes; with OAuth, check them on the forge',
226
+ escopoFineGrained: 'not measurable: a fine-grained or GitHub App token does not declare scopes',
227
+ escopoSemRepo: (lista) => `token scopes: ${lista}; without repo, a private repository is not read`,
228
+ escopoSemRepoCorrecao: 'run gh auth refresh -s repo',
229
+ projetoFalhou: (repo, motivo) => `project ${repo} was not read: ${motivo}`,
230
+ projetoFalhouCorrecao: 'check the project path in the remote and the permission of the CLI login on it',
231
+ naoDisponivel: 'not available in this edition',
232
+ naoMedivel: 'not measurable',
233
+ ligado: 'on',
234
+ desligado: 'off',
235
+ permitido: 'allowed',
236
+ projetoGitlab: (metodo, squash, mergedResults, mergeTrain) => `merge ${metodo}; squash ${squash}; merged results ${mergedResults}; merge train ${mergeTrain}`,
237
+ projetoGithub: (merge, squash, rebase) => `merge commit ${merge}; squash ${squash}; rebase ${rebase}`,
238
+ avisoFf: 'with fast-forward there is no merge commit: the ship(<thread>) subject does not reach the base',
239
+ avisoMensagemPadrao: 'the default merge message (Merge branch …) does not start with ship(<thread>)',
240
+ avisoSquash: (opcao) => `squash ${opcao}: a squash delivery is not linked to the verified head (entrega.sem-vinculo)`,
241
+ avisoSemMergeCommit: 'without merge commits, a PR delivery is not linked to the verified head (entrega.sem-vinculo)',
242
+ projetoGitlabCorrecao: 'in Settings > Merge requests, use merge commit and a merge message template that starts with %{title}',
243
+ projetoGithubCorrecao: 'in Settings > General > Pull Requests, allow merge commits',
244
+ capacidades: (ligadas) => `on: ${ligadas}`,
245
+ capacidadesDesligadas: (ligadas, desligadas) => `on: ${ligadas}; off (the adapter does not implement them): ${desligadas}`,
246
+ capacidadesCorrecao: 'each capability that is off follows the ork fallback path, as today',
247
+ },
248
+ transporteShip: {
249
+ recusa: (codigo, d) => {
250
+ const frase = (() => {
251
+ switch (codigo) {
252
+ case 'mcp.ship.transport.urls': return `origin needs a single URL, of a forge or of a local bare repository (${d})`;
253
+ case 'mcp.ship.transport.modo': return `origin does not fit this transport; use --ship-transport ${d}`;
254
+ case 'mcp.ship.transport.forja': return `the forge of origin could not be resolved (${d})`;
255
+ case 'mcp.ship.transport.ssh.divergente': return `origin and the resolved forge point to different SSH (${d}); fix forja.ssh_host and forja.ssh_porta or the origin URL`;
256
+ case 'mcp.ship.transport.ssh.sem-resposta': return `${d} did not offer an SSH host key; if the forge has no SSH, use --ship-transport forja-https`;
257
+ case 'mcp.ship.transport.ssh.revogada': return `your known_hosts revokes a key that ${d} offered; do not install until you know why`;
258
+ case 'mcp.ship.transport.ssh.nao-confirmada': return `check the fingerprint with whoever runs the forge and run again with --ssh-fingerprint <fingerprint> (${d})`;
259
+ case 'mcp.ship.transport.ssh.impressao-divergente': return `the given fingerprint matches no key the server offered (${d}); do not install until you know why`;
260
+ case 'mcp.ship.transport.ssh.known-hosts-ilegivel': return `your known_hosts exists but could not be read (${d}); without it, a revoked key would pass; fix the file and run again`;
261
+ case 'mcp.ship.transport.ssh.caminho': return `the pinned known_hosts needs an absolute path without spaces or special characters (${d})`;
262
+ case 'mcp.ship.transport.ssh.known-hosts-alterado': return `the pinned known_hosts changed after the install (${d}); reinstall the MCP`;
263
+ case 'mcp.ship.transport.ssh.credencial-na-url': return `${d} carries a password or token in the SSH URL; remove them with git remote set-url origin ssh://<user>@<host>/<path>.git`;
264
+ case 'mcp.ship.transport.https.sem-tls': return `HTTP without TLS would send the credential in clear text; use https:// in origin (${d})`;
265
+ case 'mcp.ship.transport.https.credencial-na-url': return `${d} carries a user or token in the URL; remove them with git remote set-url origin https://<host>/<path>.git`;
266
+ case 'mcp.ship.transport.https.divergente': return `origin and the resolved forge point to different HTTPS (${d}); fix forja.host and forja.porta or the origin URL`;
267
+ case 'mcp.ship.transport.sem-cli': return `the forge CLI is not installed; install ${d} or later`;
268
+ case 'mcp.ship.transport.sem-helper': return `the installed CLI has no auth git-credential (${d}); upgrade to the minimum version`;
269
+ case 'mcp.ship.transport.sem-login': return `the CLI is not logged in to the host (${d}); log in and run again (ork doctor shows the command)`;
270
+ case 'mcp.ship.transport.binario': return `the CLI must be an executable file owned by you or root, not writable by group or others (${d})`;
271
+ case 'mcp.ship.transport.ca': return `the CA in forja.ca must be a readable PEM, owned by you or root, not writable by group or others (${d})`;
272
+ case 'mcp.ship.transport.ca-alterada': return `the CA changed after the install (${d}); reinstall the MCP`;
273
+ case 'mcp.ship.transport.fixacao-ausente': return `this transport was not installed on this machine; run ${d}`;
274
+ case 'mcp.ship.transport.fixacao-insegura': return `the transport pin must be yours, with no link and no group or other access (${d})`;
275
+ case 'mcp.ship.transport.fixacao-divergente': return `the install pinned another transport or another origin (${d}); reinstall the MCP`;
276
+ case 'mcp.ship.transport.cli-config': return `${d} must be an absolute path without control characters; it is the config folder of the forge CLI, which the push hands to the credential helper`;
277
+ case 'mcp.ship.transport.mudou-no-push': return `the ${d} or the git config changed during the push; the push may have gone out, but the delivery was not proved: check the remote, the branch and the config before trying again`;
278
+ default: return d;
279
+ }
280
+ })();
281
+ return `${codigo}: ${frase}`;
282
+ },
283
+ fixadoSsh: (nome, chaves, arquivo) => `SHIP over forja-ssh: the key of ${nome} (${chaves}) is pinned in ${arquivo}; every push checks this key, without asking.`,
284
+ fixadoHttps: (origem, cli, ca) => `SHIP over forja-https: git asks only ${cli} (auth git-credential) for the credential of ${origem}${ca ? `, with the CA ${ca} checked by hash on every push` : ''}.`,
285
+ fixariaSsh: (nome, chaves, arquivo) => `SHIP over forja-ssh: the key of ${nome} (${chaves}) would be pinned in ${arquivo}; nothing was written.`,
286
+ fixariaHttps: (origem, cli, ca) => `SHIP over forja-https: git would ask only ${cli} (auth git-credential) for the credential of ${origem}${ca ? `, with the CA ${ca} checked by hash on every push` : ''}; nothing was written.`,
287
+ consultaNoFixado: (modo) => `mcp.experiencia.transporte-fixado: lookup unavailable on the pinned transport ${modo}: the lookup fetch does not carry the pinned key, helper and locks yet, and without them it would reach the network through the user's config`,
288
+ proposta: (modo) => `SHIP: this project's origin needs --ship-transport ${modo}; with the default transport, ork_ship is unavailable. To switch, remove the orkastery entry and reinstall with the option.`,
289
+ },
290
+ };
@@ -15,6 +15,8 @@
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.GERADOS_EN = exports.GERADOS_PT_BR = void 0;
17
17
  exports.GERADOS_PT_BR = {
18
+ /** O `.orkastery/.gitignore` que o `ork init` cria; `*` continua dado, fora do catalogo. */
19
+ gitignoreDaMaquina: 'Criado pelo ork: esta pasta é da máquina, não do repositório.',
18
20
  /** Os comentarios do `orkastery.yaml` (`manifestoYaml`, em `init.ts`). */
19
21
  manifesto: {
20
22
  cabecalho: 'Manifesto do Orkastery (v1, bloco B0)\nGerado por `ork init`. Fonte unica da configuracao do projeto.\n' +
@@ -35,6 +37,7 @@ exports.GERADOS_PT_BR = {
35
37
  porThread: 'true: o ork thread new cria a worktree e a branch da thread sem flag (--sem-worktree cria sem);\n' +
36
38
  'false ou ausente: só com --worktree auto',
37
39
  naoDetectado: 'nao detectado',
40
+ securityScan: 'varredura de seguranca no verify; ativa quando ha JS/TS, Python ou Go, comentada sem stack',
38
41
  ci: 'Ative depois de publicar o workflow e tornar ork-verify um check obrigatório.',
39
42
  ciComando: 'perfil hermético opcional do runner; sem ele, usa verify acima',
40
43
  staleAfter: 'thread despachada sem atividade (ledger parado, sessao nao-working) por mais que\n' +
@@ -93,6 +96,7 @@ exports.GERADOS_PT_BR = {
93
96
  },
94
97
  };
95
98
  exports.GERADOS_EN = {
99
+ gitignoreDaMaquina: 'Created by ork: this folder belongs to the machine, not the repository.',
96
100
  manifesto: {
97
101
  cabecalho: 'Orkastery manifest (v1, block B0)\nGenerated by `ork init`. The single source of the project configuration.\n' +
98
102
  'Hard limit of 16 KB: long prose goes to tagged memory, not to this file.',
@@ -112,6 +116,7 @@ exports.GERADOS_EN = {
112
116
  porThread: 'true: ork thread new creates the thread worktree and branch without a flag (--sem-worktree skips them);\n' +
113
117
  'false or absent: only with --worktree auto',
114
118
  naoDetectado: 'not detected',
119
+ securityScan: 'security scan in verify; on when JS/TS, Python or Go is found, commented out otherwise',
115
120
  ci: 'Turn it on after you publish the workflow and make ork-verify a required check.',
116
121
  ciComando: 'optional hermetic profile of the runner; without it, the verify commands above run',
117
122
  staleAfter: 'a dispatched thread with no activity (idle ledger, session not working) for longer than\n' +
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GRAFO_EN = exports.GRAFO_PT_BR = void 0;
4
+ /** RM-061 F3d: moldura humana do grafo; schemas, códigos e JSON continuam em pt-BR. */
5
+ exports.GRAFO_PT_BR = {
6
+ uso: [
7
+ 'uso: ork grafo indexar [--verificar] [--forcar] [--json]',
8
+ ' ork grafo status [--json]',
9
+ ' ork grafo contexto <thread> [--json [--teto-bytes N]]',
10
+ ' ork grafo vizinhos <no> [--profundidade N] [--sentido entrada|saida|ambos] [--tipo T,...] [--limite N] [--json [--teto-bytes N]]',
11
+ ' ork grafo chamadores <simbolo> [--profundidade N] [--limite N] [--json [--teto-bytes N]]',
12
+ ' ork grafo importadores <arquivo|simbolo> [--profundidade N] [--limite N] [--json [--teto-bytes N]]',
13
+ ' ork grafo caminho <de> <para> [--sentido saida|entrada|ambos] [--tipo T,...] [--json [--teto-bytes N]]',
14
+ ' ork grafo amostra [--por-estrato N] | ork grafo amostra --conferir ARQ [--json]',
15
+ ' ork grafo limpar [--tudo] [--json]',
16
+ ],
17
+ erroUso: (motivo) => `grafo.uso: ${motivo}`,
18
+ motivos: {
19
+ semSub: 'falta o subcomando', desconhecido: (sub) => `subcomando desconhecido: ${sub}`,
20
+ repetida: (nome) => `--${nome} repetida`, semValor: (nome) => `--${nome} nao leva valor`,
21
+ exigeValor: (nome) => `--${nome} exige valor`, opcao: (sub, valor) => `opcao desconhecida para ${sub}: ${valor}`,
22
+ argumentos: (sub, esperados, recebidos) => `${sub} pede ${esperados} argumento(s), veio ${recebidos}`,
23
+ inteiro: (nome) => `--${nome} precisa ser inteiro`, tipo: (tipo, lista) => `--tipo desconhecido: ${tipo} (use ${lista})`,
24
+ sentido: (valor) => `--sentido desconhecido: ${valor}`, tetoJson: '--teto-bytes exige --json', tetoMin: '--teto-bytes precisa ser ao menos 1',
25
+ amostraExclusiva: '--conferir e --por-estrato nao combinam', estratoMin: '--por-estrato precisa ser ao menos 1',
26
+ },
27
+ indexar: {
28
+ titulo: (repo, estado) => `indice do grafo de ${repo}: ${estado}`,
29
+ // O rotulo ocupa 13 colunas antes do valor, como na base: 12 do nome e um espaco.
30
+ campo: (nome, valor) => ` ${nome.padEnd(12)} ${valor}`,
31
+ campos: { revisao: 'revisao', chave: 'chave', snapshot: 'snapshot', digest: 'digest', conferencia: 'conferencia',
32
+ nos: 'nos', arestas: 'arestas', lugar: 'lugar', motivo: 'motivo', tempo: 'tempo' },
33
+ conferencia: (fontes, evidencias) => `conferirFontes verificada: ${fontes} fontes e ${evidencias} evidencias contra os bytes`,
34
+ determinismo: (ordem, digest, relatorio, unidades, igual) => ` determinismo ${ordem}: digest ${digest}, relatorio ${relatorio}, unidades ${unidades}, ${igual ? 'igual' : 'DIFERENTE'}`,
35
+ incremental: (base, igual) => ` incremental a partir do indice de ${base}: ${igual ? 'igual a completa nos quatro arquivos' : 'DIFERENTE'}`,
36
+ naoConferido: (motivo) => ` incremental nao conferido: ${motivo}`, aprovado: 'aprovado', semBase: 'sem base',
37
+ },
38
+ status: {
39
+ titulo: (head, arvore) => `grafo: HEAD ${head}, arvore ${arvore}`,
40
+ indice: (chave, estado) => ` indice do HEAD ${chave} ${estado}`,
41
+ ausente: '(ausente: rode ork grafo indexar)', semAnalisadores: '(sem os analisadores nesta instalacao, nem a consulta nem o indexar rodam)',
42
+ semChave: '(sem a chave do indice: o erro esta na linha de baixo)', analisadores: (v) => ` analisadores ${v}`,
43
+ correcao: (v) => ` correcao ${v}`, pasta: (dir, n, mb) => ` pasta ${dir} (${n} indice(s), ${mb})`,
44
+ semCommit: 'sem commit', indisponivel: 'indisponivel', naoCriada: 'ainda nao criada', sobras: (v) => ` sobras ${v}`,
45
+ },
46
+ contexto: {
47
+ titulo: (thread, revisao) => `Contexto ${thread} @ ${revisao}`,
48
+ resumo: (sementes, total, arestas, ligacoes, bytes) => ` ${sementes}/${total} sementes, ${arestas}/${ligacoes} ligacoes agregadas; ${bytes} bytes JSON`,
49
+ tamanho: (bytes) => ` tamanho dos arquivos no pacote (nao descoberta): ${bytes} bytes (revisao indexada); tokens: unavailable`,
50
+ diff: (v) => ` diff: ${v}`, mudadas: (n) => ` ligacoes com fonte modificada na arvore: ${n}`,
51
+ final: (truncado, arvore) => ` truncado: ${truncado}; arvore: ${arvore}; use --json para nos e evidencias`,
52
+ },
53
+ amostra: {
54
+ titulo: (arestas, estratos, revisao) => `amostra: ${arestas} arestas em ${estratos} estratos, auditada na revisao ${revisao}`,
55
+ vereditos: (v) => ` vereditos ${v}`, conferidas: (ok, total) => ` conferidas contra o indice do HEAD: ${ok} de ${total}`,
56
+ falha: (v) => `FALHA ${v}`, reprovado: (n) => `reprovado: ${n} falha(s)`, aprovado: 'aprovado',
57
+ },
58
+ limpar: (n, mb) => `grafo limpar: ${n} removido(s), ${mb}`,
59
+ consulta: {
60
+ titulo: (repo, revisao, chave, snapshot) => `grafo de ${repo} na revisao ${revisao}, indice ${chave}, snapshot ${snapshot}`,
61
+ arvore: 'aviso: a arvore tem mudanca rastreada; a resposta e do HEAD, nao da arvore',
62
+ fontes: (v, resto) => `fontes que mudaram na arvore: ${v}${resto ? ` e mais ${resto}` : ''}`,
63
+ marca: ' [fonte modificada na arvore]', pagina: (p) => `pagina ${p}`, extratores: (v) => `extratores: ${v}`,
64
+ semCaminho: (de, para, sentido, nos) => `sem caminho de ${de} para ${para} (sentido ${sentido}): ${nos} nos explorados`,
65
+ caminho: (de, para, sentido, passos) => `caminho de ${de} para ${para} (sentido ${sentido}): ${passos} passo(s)`,
66
+ contra: '(contra a aresta) ', todos: 'todos',
67
+ resultado: (tipo, alvo, profundidade, filtro, arestas, nos) => `${tipo} de ${alvo} (profundidade ${profundidade}${filtro}): ${arestas} aresta(s), ${nos} no(s)`,
68
+ filtro: (sentido, tipos) => `, sentido ${sentido}, tipos ${tipos}`,
69
+ truncado: (n, total) => `truncado: ${n} de ${total} arestas, as mais perto do alvo; use --limite`,
70
+ parcial: 'parcial: so arestas que o extrator prova; chamada por despacho de tipo, import nao resolvido e as lacunas do relatorio de extracao ficam fora',
71
+ },
72
+ };
73
+ exports.GRAFO_EN = {
74
+ uso: [
75
+ 'usage: ork grafo indexar [--verificar] [--forcar] [--json]', ' ork grafo status [--json]',
76
+ ' ork grafo contexto <thread> [--json [--teto-bytes N]]',
77
+ ' ork grafo vizinhos <node> [--profundidade N] [--sentido entrada|saida|ambos] [--tipo T,...] [--limite N] [--json [--teto-bytes N]]',
78
+ ' ork grafo chamadores <symbol> [--profundidade N] [--limite N] [--json [--teto-bytes N]]',
79
+ ' ork grafo importadores <file|symbol> [--profundidade N] [--limite N] [--json [--teto-bytes N]]',
80
+ ' ork grafo caminho <from> <to> [--sentido saida|entrada|ambos] [--tipo T,...] [--json [--teto-bytes N]]',
81
+ ' ork grafo amostra [--por-estrato N] | ork grafo amostra --conferir FILE [--json]', ' ork grafo limpar [--tudo] [--json]',
82
+ ],
83
+ erroUso: (reason) => `grafo.uso: ${reason}`,
84
+ motivos: {
85
+ semSub: 'missing subcommand', desconhecido: (sub) => `unknown subcommand: ${sub}`, repetida: (name) => `--${name} repeated`,
86
+ semValor: (name) => `--${name} takes no value`, exigeValor: (name) => `--${name} requires a value`, opcao: (sub, value) => `unknown option for ${sub}: ${value}`,
87
+ argumentos: (sub, expected, received) => `${sub} expects ${expected} argument(s), received ${received}`, inteiro: (name) => `--${name} must be an integer`,
88
+ tipo: (type, list) => `unknown --tipo: ${type} (use ${list})`, sentido: (value) => `unknown --sentido: ${value}`,
89
+ tetoJson: '--teto-bytes requires --json', tetoMin: '--teto-bytes must be at least 1', amostraExclusiva: '--conferir and --por-estrato cannot be combined', estratoMin: '--por-estrato must be at least 1',
90
+ },
91
+ indexar: {
92
+ titulo: (repo, state) => `graph index for ${repo}: ${state}`, campo: (name, value) => ` ${name.padEnd(12)} ${value}`,
93
+ campos: { revisao: 'revision', chave: 'key', snapshot: 'snapshot', digest: 'digest', conferencia: 'check',
94
+ nos: 'nodes', arestas: 'edges', lugar: 'location', motivo: 'reason', tempo: 'time' },
95
+ conferencia: (sources, evidence) => `conferirFontes verified: ${sources} sources and ${evidence} evidence items against the bytes`,
96
+ determinismo: (order, digest, report, units, equal) => ` determinism ${order}: digest ${digest}, report ${report}, units ${units}, ${equal ? 'equal' : 'DIFFERENT'}`,
97
+ incremental: (base, equal) => ` incremental from index ${base}: ${equal ? 'equal to the full build in all four files' : 'DIFFERENT'}`,
98
+ naoConferido: (reason) => ` incremental not checked: ${reason}`, aprovado: 'approved', semBase: 'no base',
99
+ },
100
+ status: {
101
+ titulo: (head, tree) => `graph: HEAD ${head}, tree ${tree}`, indice: (key, state) => ` HEAD index ${key} ${state}`,
102
+ ausente: '(missing: run ork grafo indexar)', semAnalisadores: '(without analyzers in this installation, neither queries nor indexing can run)',
103
+ semChave: '(no index key: the error is on the next line)', analisadores: (v) => ` analyzers ${v}`, correcao: (v) => ` fix ${v}`,
104
+ pasta: (dir, n, mb) => ` directory ${dir} (${n} index(es), ${mb})`, semCommit: 'no commit', indisponivel: 'unavailable', naoCriada: 'not created yet', sobras: (v) => ` leftovers ${v}`,
105
+ },
106
+ contexto: {
107
+ titulo: (thread, revision) => `Context ${thread} @ ${revision}`,
108
+ resumo: (seeds, total, edges, links, bytes) => ` ${seeds}/${total} seeds, ${edges}/${links} aggregated links; ${bytes} JSON bytes`,
109
+ tamanho: (bytes) => ` file size in the package (not discovery): ${bytes} bytes (indexed revision); tokens: unavailable`,
110
+ diff: (v) => ` diff: ${v}`, mudadas: (n) => ` links with a modified source in the tree: ${n}`,
111
+ final: (truncated, tree) => ` truncated: ${truncated}; tree: ${tree}; use --json for nodes and evidence`,
112
+ },
113
+ amostra: {
114
+ titulo: (edges, strata, revision) => `sample: ${edges} edges in ${strata} strata, audited at revision ${revision}`,
115
+ vereditos: (v) => ` verdicts ${v}`, conferidas: (ok, total) => ` checked against the HEAD index: ${ok} of ${total}`,
116
+ falha: (v) => `FAIL ${v}`, reprovado: (n) => `failed: ${n} failure(s)`, aprovado: 'approved',
117
+ },
118
+ limpar: (n, mb) => `graph cleanup: ${n} removed, ${mb}`,
119
+ consulta: {
120
+ titulo: (repo, revision, key, snapshot) => `graph for ${repo} at revision ${revision}, index ${key}, snapshot ${snapshot}`,
121
+ arvore: 'warning: the tree has tracked changes; the answer is from HEAD, not the tree',
122
+ fontes: (v, rest) => `sources changed in the tree: ${v}${rest ? ` and ${rest} more` : ''}`, marca: ' [source modified in tree]', pagina: (p) => `page ${p}`,
123
+ extratores: (v) => `extractors: ${v}`, semCaminho: (from, to, direction, nodes) => `no path from ${from} to ${to} (direction ${direction}): ${nodes} nodes explored`,
124
+ caminho: (from, to, direction, steps) => `path from ${from} to ${to} (direction ${direction}): ${steps} step(s)`, contra: '(against the edge) ', todos: 'all',
125
+ resultado: (type, target, depth, filter, edges, nodes) => `${type} of ${target} (depth ${depth}${filter}): ${edges} edge(s), ${nodes} node(s)`,
126
+ filtro: (direction, types) => `, direction ${direction}, types ${types}`, truncado: (n, total) => `truncated: ${n} of ${total} edges, nearest to the target; use --limite`,
127
+ parcial: 'partial: only edges proven by the extractor; dynamic dispatch calls, unresolved imports, and extraction-report gaps are excluded',
128
+ },
129
+ };