O check falhava quando >1 PR aberto tocava src/migrations/ + payload-types.ts,
deadlockando AMBOS os PRs (9 de 13 runs de CI falhos desde 11/08). A validação
real da cadeia de migrations já roda em todo PR e na main: pnpm migrate +
test:int (incl. campaignMigrationReconciliation). Pool mantém a serialização
de spawn de issues needs:migration via countOpenSchemaPrs.
O job roda script plain Node (gh CLI) sem pnpm/action-setup; setup-node@v5
com package-manager-cache: true (default) resolve o packageManager do
package.json e procura o executável pnpm -> 'Unable to locate executable
file: pnpm'. Mesmo precedente do cooldown do ci.yml, vercel-promote e
archive-cursor-agent. Varredura dos 21 usos de setup-node: único job com o
bug latente.
Closes#566
Aperta parseRelatedIssueNumbers (anti hyphen), canPromotePlanIssue
already-ready, workflow só com Related # no body + PR_BODY, soft-fail
por Issue no Action script.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Safety net dual com agent:ready: no merge em main, workflow lê Related #N
e promove Issues ainda aguardando plano (canPromotePlanIssue), soft-skip
idempotente. Helper parseRelatedIssueNumbers + pins unitários.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Change DEPLOY_COOLDOWN_MS constant, update ci.yml deferral log, and
adjust unit test pins. Closes#259.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
CI short-circuited "already aliased" when v13 listed pt.jorgesolla.com.br
on a fresh --prod deploy while the domain still pointed at an older
Current. Verify only via GET /v2/.../aliases and /v4/aliases?domain=.
Also drop invalid --yes on vercel alias set (CLI 55).
Promote + POST aliases still left pt.jorgesolla.com.br off the staged
deployment's GET /v13 alias list. Verify with GET /v2/.../aliases and
GET /v4/aliases?domain=, log steps live, and also run `vercel alias set`
(recommended when Git Integration is off).
Disabling Git auto-deploy is correct for Actions-gated production. The
separate project toggle "Auto-assign Custom Production Domains" must stay
ON — when OFF, `vercel deploy --prod` only aliases *.vercel.app and leaves
the custom domain on an older Current (exactly what we saw after #122).
After each deploy, ensure-production-alias re-enables auto-assign if needed,
promotes the deployment, and verifies pt.jorgesolla.com.br is attached.
Also adds workflow_dispatch "Vercel promote production" for promote-without-rebuild.
OPS11 added an early setup-node@v5 before pnpm/action-setup for the
cooldown script. setup-node v5 defaults package-manager-cache to true
and tries to invoke pnpm from package.json, which is not on PATH yet —
deploy failed with "Unable to locate executable file: pnpm".
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
- Script vercel-deploy-cooldown consulta último deploy READY via API Vercel
- Job deploy em ci.yml adia upload quando idade < 30 min (sucesso, não falha)
- Job requeue espera o residual e re-dispara ci.yml
- vercel deploy passa --archive=tgz para reduzir pressão de upload
- Testes unitários para computeCooldownWait e fetch da API
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Add composite action wrapping styfle/cancel-workflow-action@0.12.1 and
invoke it with if: failure() on every parallel job in ci-pr.yml and ci.yml.
Workflow-level actions: write permission enables cancellation. Document
fail-fast behavior in docs/AGENT-OPS.md CI table.
Closes#52
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
Workflow env pointed vercel build at localhost teqo_test; Payload migrate
then ECONNREFUSED. Drop test DB/secret/site URL so pull's production
.env is what the build uses.
Match the Vercel Actions KB (job-level org/project env, global CLI),
validate team_/prj_ secret shapes, and document the misleading
Project Settings 403. Org/project secrets were resynced from local link.
Remove stage/promote/Neon smoke. PR CI targets main; ci.yml full-suite
verifier deploys via vercel CLI and requeues when HEAD moves. Pool uses
POOL_GITHUB_TOKEN and POOL_BASE_REF=main. Docs/skills/rules retargeted.
Os scripts do pool NAO sao dependency-free: agent-pool.mjs -> agent-github.mjs
-> scripts/lib/cli.mjs -> dotenv. O workflow agora instala deps como os irmaos
(pnpm/action-setup + cache + pnpm install --frozen-lockfile). Guard adicional:
pull_request closed sem merge nao dispara o tick (ruido em todo PR de stage).
Verificado localmente: o script carrega e para na leitura estrita de variables
(fail-closed desenhado; em GHA o GITHUB_TOKEN tem actions:write).
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
* feat(ops): auto-promote stage→main e merge em stage sem exigir head
Substitui o promote manual por workflow disparado no ci-stage green,
relaxa strict na proteção de stage (script configure:branch-protection)
e documenta o novo paradigma em AGENT-OPS e work-issue.
* style: format AGENT-OPS and configure-branch-protection for ci-pr
* feat(ops): pnpm push com ensure-repo-deps determinístico
Bootstrap install + Husky antes de todo push (pnpm push e pre-push).
Documenta fluxo canônico em work-issue, agent-pr-workflow e AGENT-OPS.
* fix(ops): pnpm push roda gate no script, sem depender do Husky
Cloud environment.json chama prepare explicitamente após install.
* test(int): isolate advisor portfolio search from shared cairu slug
Parallel int specs were stomping municipality.advisors on the fixed
cairu row; allocate per-test municipalities instead.
* feat(agent-pool): fundacao read-only do orquestrador (fase A)
- docs/plans/agent-pool-orchestrator.md: plano completo (14 secoes)
- buildClaimQueue extraido de agent-claim para agent-github (comportamento identico, pinado)
- agent-pool-eligibility: isAutonomousClaimable puro e fail-closed + buildPoolQueue
- agent-pool-state: parsePoolConfig, marcadores pool-worker, classifyPoolClaim, spawn plan, auto-stop
- agent-pool-github: leitura de repo variables (degrada nao-estrito), claims/PRs/migration-lock
- pnpm agent:pool -- status|tick --dry-run (inspecao local; live chega na fase B)
- 34 specs unit novos (992/992 verde); lint/tsc/knip/cycles/format verdes
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
* feat(agent-pool): spawn remoto de workers via Cursor API (fase B)
- agent-pool-cursor: client fino da Cloud Agents API v1 (fetch injetavel; CursorApiError com status/body)
- agent-pool-models: resolvePoolModel contra /v1/models (id/alias, sufixo -fast -> param, fallback composer-2.5 com warn)
- agent-pool-prompt: contrato do worker (claim pre-feito, pula passo 1; PR base stage + Closes #N; promote proibido)
- claim coordenado no tick: lock otimista + flip + marcador; agentId idempotente bc-<uuid>; 409 recupera; rollback em falha de spawn
- agent:pool workflow --action start|stop|pause|resume|tick|status (variables POOL_*); doctor; wrappers gh workflow run
- .github/workflows/agent-pool.yml (dispatch-only; schedule/triggers na fase C)
- 19 specs novos (1011/1011); lint/tsc/knip/cycles/format verdes
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
* feat(agent-pool): ciclo de vida do supervisor (fase C)
- derivePoolClaims com status real dos runs (getCursorRun), heal de spawn via agentId deterministico, cancel de duplicatas
- reconcilePoolClaims: falha terminal -> comentario + blocked + archive; merge concluido -> slot livre + archive
- auto-stop real: fila drenada + zero ativos -> POOL_ENABLED=false (exclusoes migration-busy nao desligam)
- job summary markdown (GITHUB_STEP_SUMMARY) — superficie remota de status
- workflow: schedule */10min + pull_request closed em stage (ativam na default branch apos promote)
- 2 specs novos (1013/1013); lint/tsc/knip/cycles/format verdes
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
* docs(agent-pool): runbook operacional e adendo do spike (fase D)
- skill agent-pool: runbook humano (pre-requisitos, start/stop/pause remoto, ciclo de vida, triage, smoke de aceite)
- AGENT-OPS: linha na tabela de comandos + secao Agent pool (canal, secrets, ativacao pos-promote)
- CHANGELOG-AGENTS: entrada curta da entrega
- engineering-audit: pause/resume do pool no protocolo do modo solitario
- plano secao 14.1: evidencias do spike 2026-07-30 (environment repo-file confirmado, id bc-<uuid>, degradacao 403, pendencias do primeiro run com CURSOR_API_KEY)
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
* fix(test): teardown flake no homeSearchUi.unit.spec (dono do CI)
O scheduler do react (prefetch do next/link) podia disparar apos o teardown
do jsdom e derrubar o job unit com 'window is not defined' (run 30587862940).
afterEach(cleanup) — padrao dos 14 specs irmaos.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
* fix(cloud): bootstrap Postgres nativo no Cursor Cloud
VMs Cloud não têm Docker (sem daemon/systemd; overlayfs falha em
docker compose). Substitui compose por ensure-postgres.sh (PG 16 via
apt, pg_ctlcluster) e corrige placeholders do .env (BLOB token no
formato vercel_blob_rw_* exigido pelo adapter).
Testado: cloud-setup.sh completa migrate + seed em teqo e teqo_test.
* fix(ci): define GH_REPO no job migration-lock
gh pr list falha sem checkout quando não há repositório git no runner
(fatal: not a git repository). GH_REPO aponta explicitamente para o repo.
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Parallel ci-pr jobs no longer published the legacy `checks` context
required by stage/main branch protection, blocking auto-merge with no
link in the UI. Add a needs-based rollup that gates on all jobs green.
The first full e2e run on the parallel pipeline hit the 30-min timeout:
dev-mode cold webpack compiles per route, a __webpack_modules__ TypeError,
and dev-server memory-threshold restarts. CI now builds (NEXT_DIST_DIR
matches the webServer env) and playwright webServer runs `pnpm start`;
local spec development keeps `pnpm dev`.
- ci-pr.yml: split the serial checks job into parallel lint/format/
typecheck/knip/cycles + unit/int (vitest --changed vs PR base via
scripts/test-affected.mjs, full fallback on high-risk paths) + e2e
(manifest path->spec via scripts/e2e-affected.mjs, blocking) + build;
migration-lock gains checkout + pull-requests:read (fixes the failures
that blocked PR #50)
- ci.yml (main): full safety net — seed:minimal + int full + build + e2e
- package.json: gate:fast / gate:push; .husky/pre-push runs gate:push
- docs: "Dono do PR, dono do CI" policy in AGENT-OPS + work-issue +
engineering-standards; changelog entry; plans for OPS3-OPS7
Checkout fixed the missing .git, but `gh pr list` then failed with
"GraphQL: Resource not accessible by integration (repository.pullRequests)"
— the default token needs an explicit permission grant.
migration-lock ran `gh pr list --json files` without actions/checkout, so
every PR failed the job in 3s with "not a git repository". The leadership
portfolio spec asserted the exact global hit set with fixed names, which the
minimal seed (Seed Liderança Um/Dois) collides with via word-start 'Lider';
switch to the unique-token pattern already used by the demands spec.
- knip (files/deps at error level; unused exports ledgered as warn) with
config for Payload/Next entries; deleted the dead modules it confirmed:
RecentlyVisited + UpcomingActionPlansCard + actionPlanUpcomingPreview,
lazy-dialog helpers, tseZone, federalCandidateTotalsAggregate (test-only),
unused ui kit files, one-shot rename script; pruned unused radix deps and
typescript-eslint; added pg/@types/pg (pinned to drizzle's 8.10.2)
- GitHub Actions CI on the mirror: lint, typecheck, knip, unit, migrate, int
against a Postgres 17 service
- eslint: unused-vars with ^_ ignore patterns (migrations args exempt),
repo-wide ban on `as never` (no-restricted-syntax), lint gate at
--max-warnings=0; fixed all 54 pre-existing warnings (dead imports,
hooks deps, tracking-pixel img disable with impeccable config exception)
- tsconfig: include consolidated from 219 lines to 5 (wildcard covers all
.next dist variants), noUnusedLocals on
- typed replacements for every as-never: hookFilledCreateData (actions
create data completed by collection hooks), drizzle scopeColumn narrowing,
tests' stub<T> helper (property-level checking kept, completeness waived)
- test infra: leased-consent generalization used by onda0 spec (shared
leases over the stable consent keys; window race ledgered), purge fix
- docs: IMPROVE-CODE-QUALITY-PLAN.md tracker, TECH-DEBT.md ledger,
TESTING.md safety-net map (package.json also gains the Phase 2
build:election-aggregates script entry; the script lands next commit)