Commit graph

18 commits

Author SHA1 Message Date
Francisco Solla
b0d158cc87 fix(cloud): bootstrap Postgres nativo no Cursor Cloud (#59)
* 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>
2026-07-30 18:36:33 -03:00
Francisco Ignácio Fontoura Solla
cf9438e5b9 fix(ci): restore rollup checks job for branch protection
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.
2026-07-30 17:41:45 -03:00
Francisco Ignácio Fontoura Solla
322794b1ee fix(e2e-ci): serve the production build in CI instead of next dev
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`.
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
76a03fac91 fix(ci): grant migration-lock pull-requests read on GITHUB_TOKEN
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.
2026-07-30 13:37:31 -03:00
Francisco Ignácio Fontoura Solla
5b4ab9c020 fix(ci): unblock PR checks — checkout in migration-lock, seed-proof leadership spec
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.
2026-07-30 13:25:49 -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
23bef0ba8c ci: stage smoke sem submitWhatsapp (deleta Consent real do snapshot) — critério documentado 2026-07-30 08:11:00 -03:00
Francisco Ignácio Fontoura Solla
79da3ed833 ci: stage smoke sem scratch-DB spec, timeouts 120s para latência Neon 2026-07-30 07:48:24 -03:00
Francisco Ignácio Fontoura Solla
eb596e254a ci: stage runs curated int smoke subset against the remote snapshot (full suite timed out at 30 min) 2026-07-30 07:13:04 -03:00
Francisco Ignácio Fontoura Solla
4262aa5a67 docs: agent ops + slice AGENTS.md + kernels + cursorignore + portable hooks + cloud env + PR template 2026-07-30 05:21:35 -03:00
Francisco Ignácio Fontoura Solla
a5dc0ea5fb ci: drop automerge fallback — GitHub Pro enables native auto-merge + branch protection 2026-07-30 04:55:15 -03:00
Francisco Ignácio Fontoura Solla
1a00384508 ci: auto-merge PRs into stage when checks green (Free-plan fallback) 2026-07-30 04:49:34 -03:00
Francisco Ignácio Fontoura Solla
cc8492d831 chore: format seed and workflow files 2026-07-30 04:45:44 -03:00
Francisco Ignácio Fontoura Solla
777fde2eed ci: PR gate with minimal DB + build + migration-lock; stage gate without build 2026-07-30 04:44:37 -03:00
Francisco Ignácio Fontoura Solla
571872f1a7 chore: remove Codeberg; GitHub is the only home 2026-07-30 04:34:07 -03:00
Francisco Ignácio Fontoura Solla
c00f83d870 Tooling: pnpm db:doctor + preflight no guard-dev-db (remedios nomeados, deteccao de volume compartilhado pos-corrupcao WAL), madge check:cycles e prettier no CI/pre-push, guard rails de data migration no skill, notas de processo (knip --fix, pipes) e gate atualizado nos docs/rules 2026-07-25 18:02:02 -03:00
Francisco Ignácio Fontoura Solla
0e4e6855dc Add the tooling gate: knip, CI, zero-warning lint, as-never ban
- 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)
2026-07-23 23:06:12 -03:00