iara-pwa/scripts/agent-file-miss.mjs
Francisco Solla e2eccc5741
Some checks failed
Agent PR Ready + auto-merge / ready-automerge (pull_request) Failing after 4s
CI / checks (pull_request) Failing after 4s
CI / deploy (pull_request) Has been skipped
fluxo de agente tipo teqo: scripts worktree/issue/agent, skills, CI com e2e só no CI, labels e branch protection
- scripts/ portados do teqo e adaptados (sem DB — SPA): worktree (next/plan/new/kill,
  claim + branch <code>-<slug> + bun install), issue, agent:{claim,register,ready,
  file-miss,status}, pr (cria PR + auto-merge sem gh), transitions de CI
- config por projeto em .forgejo/worktree.env (FORGEJO_REPOSITORY, WORKTREES_ROOT)
  + roteador global de terminal em ~/.config/shell/worktree.sh (escopo por git rev-parse)
- .opencode/commands e .agents/skills (plan-issue, work-issue, capture-review-debts,
  worktree-next-issue, code-simplification) + AGENTS.md com o workflow
- CI Forgejo Actions unificado: checks (lint+build+e2e) em PR e main; deploy
  gated; issue-done / plan-issue-ready / agent-pr-automerge workflows
- Playwright: config + 2 specs smoke (settings→chat, ws reconnect) — e2e só no CI
- package.json: aliases worktree/issue/agent:*/pr + gate + test:e2e
2026-08-17 21:16:12 -03:00

45 lines
1.5 KiB
JavaScript

/**
* `bun run agent:file-miss` — file an agent-miss issue (guardrail pipeline).
*
* Misses feed the progressive-guardrail harvest: each miss becomes an issue
* with `kind:agent-miss`; periodically a human/agent harvests them into a
* programmatic guardrail.
*
* bun run agent:file-miss -- --title "migration merged sem atualizar seed:minimal" \
* [--body "contexto..."] [--kind agent-miss|defect]
*
* Portado do teqo (scripts/agent-file-miss.mjs) — URL derivada do repo.
*/
import { dieAgent, parseArgs, issueUrl } from './lib/agent-forgejo.mjs'
import { loadProjectEnv } from './lib/load-project-env.mjs'
loadProjectEnv()
const forgejoModule = await import('./lib/forgejo-api.mjs');;
const { forgejoApi: api } = forgejoModule
const die = dieAgent('file-miss')
const { flags } = parseArgs(process.argv.slice(2), new Set(['title', 'body', 'kind']))
if (!flags.title) {
die(
'Usage: bun run agent:file-miss -- --title <what went wrong> [--body details] [--kind agent-miss|defect]',
)
}
const kind = flags.kind === 'defect' ? 'defect' : 'agent-miss'
const body = [
flags.body ?? '',
'',
'_Registrado por `bun run agent:file-miss`. Harvest: avaliar guardrail programático (teste de convenção, lint, check de CI)._',
].join('\n')
const created = await api.createIssue({
title: flags.title,
body,
})
const url = issueUrl(created.number)
await api.setLabels(created.number, { add: [`kind:${kind}`, 'prio:P2'] })
console.log(`[agent:file-miss] filed ${url}`)