Commit graph

85 commits

Author SHA1 Message Date
Cursor Agent
076c047c02
chore: map B127 omnibox paths in e2e affected manifest 2026-08-02 20:30:55 +00:00
Francisco Solla
7839a88a5a
Merge pull request #270 from fsolla/cursor/pool-i250-d89b6314-599f
B123 — Campanha — orientação na shell + aba (sem títulos grandes de seção)
2026-08-02 16:16:58 -03:00
Cursor Agent
b6e1f4b5ce
ci: invoke knip via pnpm script (fixes spawnSync exit 13 flake) 2026-08-02 19:01:57 +00:00
Francisco Solla
62fb4c66e8
Merge pull request #263 from fsolla/cursor/pool-i259-b024c8a7-cbc1
OPS16 — CI: cooldown de deploy de produção 30 → 15 min
2026-08-02 15:46:51 -03:00
Cursor Agent
cad3556bce
OPS16: reduce production deploy cooldown from 30 to 15 minutes
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>
2026-08-02 18:38:36 +00:00
Cursor Agent
7e6bc9d984
B125 — nearest município first in search suggest + wizard
- Restore B117 home search: scopeMunicipalities, merge prefix, session prompt
- Shared useNearestMunicipalitySlug (B14 key) for busca geral + wizard
- Wizard merge uses geoSlug only — no Perto de você / km copy on rows
- Impl plan: docs/plans/municipio-geo-topo-sugestoes-busca-impl.md

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 18:21:52 +00:00
Francisco Ignácio Fontoura Solla
8bca9d8e82 Separate intention plans from engineering execution in agent skills.
plan-issue now shapes product intent only; agent-work-issue (pool) and
work-issue (human gate) deliberate the implementation plan before coding.
2026-08-02 14:02:18 -03:00
Francisco Ignácio Fontoura Solla
186950168b Raise agent pool hard max slots from 8 to 12.
Default remains 5; parsePoolConfig now clamps POOL_MAX_SLOTS up to 12.
2026-08-02 13:30:36 -03:00
Cursor Agent
fded303fe6
fix(ci): stop trusting GET /v13 alias for production domain ownership
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).
2026-08-01 16:12:30 +00:00
Cursor Agent
fdd318692c
fix(ci): clear domain gitBranch so CLI prod deploys can alias
Git-branch-bound domains only move via Git Integration. With Git
auto-deploy OFF, clear the binding, then promote + alias + verify.
2026-08-01 15:59:41 +00:00
Cursor Agent
bcca5da92c
fix(ci): verify domain alias via aliases API + vercel alias set
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).
2026-08-01 15:48:59 +00:00
Cursor Agent
c59b3fe31d
fix(ci): explicitly alias pt.jorgesolla.com.br after Vercel promote
Promote alone left the staged deployment on *.vercel.app only. Assign the
custom hostname via POST /v2/deployments/{id}/aliases after verifying it is
attached to the project domains list.
2026-08-01 15:37:16 +00:00
Cursor Agent
baa8f14f82
fix(ci): promote Vercel deploy to pt.jorgesolla.com.br
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.
2026-08-01 15:26:31 +00:00
Cursor Agent
dcce160a4d
fix(ci): lazy-load dotenv in cli.mjs for deploy cooldown
vercel-deploy-cooldown.mjs only needs dieWithLabel from cli.mjs, but the
module eagerly imported dotenv. The deploy job runs the cooldown check
before pnpm install, so Node failed with ERR_MODULE_NOT_FOUND.

Require dotenv inside loadCliEnv() so lightweight CI steps can import
dieWithLabel without node_modules.
2026-08-01 14:13:10 +00:00
Francisco Solla
a7394d3b9e
Merge pull request #119 from fsolla/cursor/pool-i114-36b6c1a5-2d0b
B100 — Bottom drawer mobile — dock visível + recolhe no scroll
2026-08-01 08:49:14 -03:00
Cursor Agent
1ad8863994
OPS12 — CI bloqueia Closes/Fixes em PR só docs/plans
- Lógica pura em plansOnlyClosesGuard.mjs + CLI check-plans-only-pr-closes
- Job plans-only-closes em ci-pr.yml (rollup checks)
- Unit tests com fixture do incidente #115
- plan-issue, agent-pr-workflow, PR template e GUARDRAILS atualizados

Closes #116

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 11:26:19 +00:00
Cursor Agent
0e510e2658
Map Drawer.tsx to campaignMunicipalities e2e in affected manifest 2026-08-01 11:20:14 +00:00
Cursor Agent
f7d6a6d77d
style: format vercel-deploy-cooldown.mjs 2026-08-01 10:55:36 +00:00
Cursor Agent
cbddd8c796
OPS11 — cooldown de 30 min entre deploys de produção (Vercel)
- 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>
2026-08-01 10:54:55 +00:00
Cursor Agent
8f52e17396
chore: map B94 paths in e2e affected manifest 2026-08-01 07:44:00 +00:00
Cursor Agent
feb44cd3db
fix(agent-pool): stop exporting unused POOL_DEFAULT_MODEL_SLUG
Knip treats unused exports as errors; the slug stays a module-local const.
2026-08-01 06:58:33 +00:00
Cursor Agent
196e15b827
fix(agent-pool): pin fast=false on Cloud Agent spawns
Cursor's Create-Agent API defaults omitted `fast` to true, so pool
workers requesting composer-2.5 were billed as composer-2.5-fast.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:56:57 +00:00
Cursor Agent
41a9544e0a
chore: map B90 quick-action paths in e2e manifest 2026-08-01 06:28:15 +00:00
Cursor Agent
73159f0cb4
chore: map B84 quick-action lib paths in e2e affected manifest 2026-08-01 04:35:38 +00:00
Francisco Ignácio Fontoura Solla
a7a3883bc2 chore: remove cutover residue (stage scripts, checklist, PR template)
Delete dead db:refresh:stage / agent:promote; mark CUTOVER done; drop
STAGE_DATABASE_URL checklist item that no longer applies.
2026-08-01 01:00:39 -03:00
Cursor Agent
18fe4f8e9b
fix(agent-pool): ban -fast model slugs
Never map or request fast=true. Slugs ending in -fast are stripped to
the base (with a warn); model-selection and the pool plan document the ban.
2026-08-01 03:34:35 +00:00
Cursor Agent
629364f3e4
fix(agent-pool): map Grok effort + Kimi reasoning slugs to Cloud API
cursor-grok-4.5-{low,medium,high}[-fast] and kimi-k3-low were falling
back to composer-2.5 against live /v1/models (grok-4.5 + effort,
kimi-k3 + reasoning). Teach resolvePoolModel the mapping, document
when to pick each Grok effort in model-selection, and align plan/work
skills.
2026-08-01 03:32:41 +00:00
Cursor Agent
d93a0c361f
fix(agent-pool): include issue state in claim queue JSON
isAutonomousClaimable requires state === OPEN; omitting it from gh
--json made every ready issue look not-open and zeroed the pool queue.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 03:20:27 +00:00
Francisco Ignácio Fontoura Solla
f021992de0 ci: main-only cutover with gated Vercel deploy
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.
2026-07-31 20:57:18 -03:00
Francisco Ignácio Fontoura Solla
42d1a7be93 ci(pr): prettier + ignore local tool artifacts in format check 2026-07-31 20:57:18 -03:00
Francisco Ignácio Fontoura Solla
9d810d1564 ci(pr): cascade phase1→phase2 with blast-radius skips
Add scope classifiers for code/build jobs, always-on test-location
guardrails, and gate:ci parity. Default affected base is origin/main.
2026-07-31 20:57:18 -03:00
Cursor Agent
0991c04cd7 fix(seed-posts): import dieWithLabel before calling it (Pass 4 P1)
The P3-H CLI consolidation left seed-posts calling dieWithLabel with no
import — a ReferenceError on the empty-fetch abort path, invisible to
lint/typecheck/knip. Recurrence guard in the same delivery:
scriptCliConventions.unit.spec.ts fails the build when a script calls
dieWithLabel/dieAgent without importing (or defining) it, and bans
re-spelled 'const DAY_MS =' outside src/lib/text.ts (P3-K's fold leaked
one private copy in engagementLevel.ts).
2026-07-31 13:17:10 -03:00
Francisco Ignácio Fontoura Solla
0b69d2b91d chore: public release tip — All Rights Reserved, sanitize field material
Remove interview audio/transcripts/sheets from the tree, add LICENSE
(UNLICENSED), /private/ convention for local-only sensitive docs, and
public-clean CUSTOMER + session summaries for cloud agents.
2026-07-31 12:53:12 -03:00
Francisco Ignácio Fontoura Solla
b533139eb2 feat(ops): promote último commit ci-stage green sem exigir head verde
agent:promote passa a escolher o SHA mais novo à frente de main com
ci-stage success e usa promote/last-green quando o head de stage está
vermelho, destravando o bootstrap manual para main.
2026-07-30 21:56:50 -03:00
Francisco Ignácio Fontoura Solla
5987aedeaf chore(ops): Cloud Agents rename session and use pnpm push without Docker
Document native Postgres on Cloud (no db:start) and that gate:fast/push need no DB. Print rename_chat title in agent:claim brief; reinforce rename_chat + pnpm push (not raw --no-verify) in work-issue skill.
2026-07-30 21:40:46 -03:00
Francisco Solla
e04db48742 feat(ops): auto-promote stage→main e merge em stage sem exigir head (#68)
* 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.
2026-07-30 21:12:52 -03:00
Francisco Solla
680ff56754 feat(agent-pool): orquestrador de pool de workers Cursor Cloud (fases A–D) (#65)
* 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>
2026-07-30 20:08:34 -03:00
Cursor Agent
8ff9e20a88 fix(B55): defer share strategy to click + stabilize unit tests 2026-07-30 22:47:03 +00:00
Francisco Ignácio Fontoura Solla
f4a41ccc11 style: format gate-ci; preflight só teqo_test no gate:ci
Prettier em gate-ci.mjs e gate-push-local.md. db:doctor exigia DATABASE_URL
de dev — worktrees sem .env bloqueavam o push antes de chegar no format:check.
2026-07-30 18:53:17 -03:00
Francisco Ignácio Fontoura Solla
644047d92d chore(ops): gate:ci no pre-push espelha ci-pr com blast radius
Agentes rodam o mesmo escopo affected que o CI de feature antes do push;
documenta PR Ready/auto-merge e pula build Vercel em branches agent/*.
2026-07-30 18:48:10 -03:00
Francisco Ignácio Fontoura Solla
8e93f02556 Revert "chore(ops): gate:ci no pre-push espelha ci-pr com blast radius"
This reverts commit 784d4cd2e3.
2026-07-30 18:47:45 -03:00
Francisco Ignácio Fontoura Solla
784d4cd2e3 chore(ops): gate:ci no pre-push espelha ci-pr com blast radius
Agentes rodam o mesmo escopo affected que o CI de feature antes do push;
documenta PR Ready/auto-merge e pula build Vercel em branches agent/*.
2026-07-30 18:45:24 -03:00
Francisco Ignácio Fontoura Solla
6a20e98047 fix(campanha): share one Drawer across municipalities mobile cards
Root cause of the prod-build React #130 on /campanha/municipios: the
md:hidden mobile-cards tree still hydrated ~25 rows x ~5 sheet controls
(~125 eager Drawer/DrawerCloseButton instances) even on wide viewports.
Filtered ?q=... routes failed more often only because they exercise the
list with filters active — the search param itself was not the bug.

CampaignListSheetProvider hosts a single bottom Drawer for the whole
mobile section; CampaignCellEditOverlay sheet cells portal their
body/footer into it while keeping per-cell open state and autosave
scaffolds. Footers with DrawerCloseButton are only created once a sheet
actually opens. Desktop popover path is unchanged; per-cell Drawer
remains the fallback for surfaces without the provider.

Also: DrawerCloseButton (function render prop, avoids base-ui element
render in prod bundles) replaces the DrawerClose render={<Button/>}
pattern across call sites; stale e2e selectors refreshed; e2e affected
script + playwright github/list reporters for CI; use-mobile reverted
(no consumers of the gate remain).

Guardrail filed as issue #52.
2026-07-30 17:37:20 -03:00
Francisco Ignácio Fontoura Solla
2e0cc2c03e chore(ci): parallel PR jobs, affected tests, push gate, owner-of-red-CI policy
- 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
2026-07-30 17:37:20 -03:00
Francisco Ignácio Fontoura Solla
0ac6863ed8 feat: project-status + agent:status 2026-07-30 12:22:05 -03:00
Francisco Ignácio Fontoura Solla
111308f00e feat: work-issue skill 2026-07-30 12:22:05 -03:00
Francisco Ignácio Fontoura Solla
1c1a379897 feat: plan-issue skill 2026-07-30 12:22:05 -03:00
Francisco Ignácio Fontoura Solla
f7e7f98d46 fix: stage DB uses unpooled Neon endpoint (pooler hangs the int suite — session state/advisory locks) 2026-07-30 06:40:20 -03:00
Francisco Ignácio Fontoura Solla
f5cc98463d chore: drop unused exports flagged by knip 2026-07-30 05:24:52 -03:00
Francisco Ignácio Fontoura Solla
5b857814c3 chore: format agent scripts 2026-07-30 05:16:00 -03:00