15 Commits

Author SHA1 Message Date
Hartmut 0b2d263d30 ci: use prisma db execute (no psql dep); baseline migrations after push
CI / Architecture Guardrails (push) Successful in 2m54s
CI / Typecheck (push) Successful in 3m38s
CI / Lint (push) Successful in 3m56s
CI / Assistant Split Regression (push) Successful in 4m17s
CI / Unit Tests (push) Successful in 6m32s
CI / Build (push) Successful in 6m8s
CI / E2E Tests (push) Failing after 4m37s
CI / Fresh-Linux Docker Deploy (push) Failing after 6m7s
CI / Release Images (push) Has been skipped
- e2e: switch schema reset + sanity check from psql (not installed in
  act_runner's catthehacker/ubuntu image) to `prisma db execute --stdin`
  which is already a dev dep.
- docker-deploy: after `db push` the schema matches schema.prisma but
  _prisma_migrations is empty, so the follow-up `migrate deploy` fails
  with P3005. Baseline each migration directory as applied via
  `prisma migrate resolve --applied` before deploy; the migrations
  themselves are idempotent supplements, so marking-as-applied is safe.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 23:01:51 +02:00
Hartmut 3e2b242151 ci: fix fresh-DB bootstrap for e2e and docker-deploy
CI / Architecture Guardrails (push) Successful in 2m40s
CI / Lint (push) Successful in 3m17s
CI / Typecheck (push) Successful in 3m27s
CI / Unit Tests (push) Successful in 6m41s
CI / Build (push) Successful in 6m5s
CI / E2E Tests (push) Failing after 4m21s
CI / Fresh-Linux Docker Deploy (push) Failing after 5m43s
CI / Release Images (push) Has been skipped
CI / Assistant Split Regression (push) Successful in 5m11s
- e2e: use prisma db push --force-reset so the job starts from a
  guaranteed clean schema (previous runs hit missing audit_logs
  even though push reported in-sync; suspected stale service volume).
- docker-deploy: run prisma db push before db:migrate:deploy in
  app-dev-start.sh. The migrations/*.sql files are idempotent
  supplements (IF NOT EXISTS guards) that assume base tables already
  exist; a fresh container has no tables, so the first incremental
  migration's FK on "users" fails. db push creates the baseline,
  migrate deploy then layers on the incremental additions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 22:22:35 +02:00
Hartmut 98c2554570 fix(docker): reconcile pnpm workspace symlinks at container start
The bind mount (.:/app) provides workspace-level node_modules symlinks
from the host, but those target the root node_modules/.pnpm store which
inside the container is a named volume with different content-addressable
hashes. Added `pnpm install --frozen-lockfile` to app-dev-start.sh so
symlinks are regenerated against the container's store on every boot.

Also adds restart.sh convenience script for image rebuilds.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 07:54:09 +02:00
Hartmut 797aa5e350 fix(a11y): add ARIA attributes to core UI components
AnimatedModal: ariaLabelledBy prop, EntityCombobox: combobox/listbox
pattern, FilterBar: role="search", SortableColumnHeader: aria-sort,
global-error: html lang attr, eslint label rule depth config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 23:06:25 +02:00
Hartmut 09dcedb646 feat(eslint): add jsx-a11y accessibility rules as warnings
Install eslint-plugin-jsx-a11y and add 24 recommended rules to the
nextjs ESLint config, all set to warn. Baseline: 292 warnings
(207 label-has-associated-control, 52 no-static-element-interactions,
22 click-events-have-key-events, 10 no-autofocus, 1 html-has-lang).

Will be upgraded to errors after Phase 5c fixes core components.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 22:59:15 +02:00
Hartmut 82acc56b8d chore: add pre-commit hooks, tighten ESLint, activate Sentry DSN, publish CI coverage (Phase 1)
- Install husky v9 + lint-staged: pre-commit runs eslint --fix and prettier on staged files
- Tighten ESLint base config: no-console→error, ban-ts-comment (ts-ignore banned, ts-expect-error with description allowed), reportUnusedDisableDirectives→error
- Migrate web app from deprecated `next lint` to `eslint src/` with flat config and react-hooks plugin
- Convert all 5 @ts-ignore to @ts-expect-error with descriptions, remove stale disable comments
- Add NEXT_PUBLIC_SENTRY_DSN to docker-compose.prod.yml and .env.example
- Add coverage artifact upload step to CI test job
- Pre-existing violations (102 warnings) downgraded to warn in web config for Phase 2 cleanup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:49:29 +02:00
Hartmut 78d50b78d3 fix: script portability and npm security updates
Scripts:
- stop.sh: replace Linux-only fuser with cross-platform lsof fallback
- start.sh: parameterize port (APP_PORT) and container name (dynamic lookup)
- app-dev-start.sh: cross-platform stat (GNU -c / BSD -f) and setpriv/su fallback
- deploy-compose.sh: parameterize Docker registry via DOCKER_REGISTRY env var
- harden-postgres.sh: make DB_USER and DB_NAME configurable via env vars

NPM security:
- next: 15.5.12 → 15.5.15 (fixes HTTP request smuggling CVE)
- nodemailer: 8.0.1 → 8.0.5 (fixes SMTP command injection CVEs)
- lodash-es: add pnpm override to force >=4.18.0 (fixes code injection + prototype pollution)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 14:06:58 +02:00
Hartmut c784b4b378 fix(infra): wait for postgres readiness before running migrations on container start
Installs postgresql-client in the dev image so pg_isready is available.
The startup script now polls until postgres accepts connections, preventing
the P1001 "can't reach database" crash when the app container starts before
postgres is fully ready.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 21:14:31 +02:00
Hartmut 0e119cfe73 security: close audit findings #19–#23 and harden Docker setup (#24)
#19 MFA QR code: render locally via qrcode package, remove external qrserver.com request
#20 Webhook SSRF: add ssrf-guard.ts with DNS-verified IP blocklist; enforce on create/update/test/dispatch
#21 /api/perf: fail-closed when CRON_SECRET missing; remove query-string token auth
#22 CSP: remove unsafe-eval and unsafe-inline from script-src in production builds
#23 Active session registry: forward jti into session object; validate against ActiveSession on every tRPC request

#24 Docker: add missing packages/application to Dockerfile.dev; fix pnpm-lock.yaml glob;
    run db:migrate:deploy on container start so a fresh checkout boots without manual steps

Also: fix pre-existing TS error in e2e/allocations.spec.ts (args.length literal type overlap)

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-01 18:19:21 +02:00
Hartmut 8c5be51251 feat(platform): checkpoint current implementation state 2026-04-01 07:42:03 +02:00
Hartmut 7bcc831b5c refactor(ops): standardize image-based production delivery 2026-03-30 23:35:29 +02:00
Hartmut a19d2cbae0 refactor(settings): adopt environment-only runtime secret flow 2026-03-30 19:55:06 +02:00
Hartmut 819345acfa feat(platform): harden access scoping and delivery baseline 2026-03-30 00:27:31 +02:00
Hartmut cd78f72f33 chore: full technical rename planarchy → capakraken
Complete rename of all technical identifiers across the codebase:

Package names (11 packages):
- @planarchy/* → @capakraken/* in all package.json, tsconfig, imports

Import statements: 277 files, 548 occurrences replaced

Database & Docker:
- PostgreSQL user/db: planarchy → capakraken
- Docker volumes: planarchy_pgdata → capakraken_pgdata
- Connection strings updated in docker-compose, .env, CI

CI/CD:
- GitHub Actions workflow: all filter commands updated
- Test database credentials updated

Infrastructure:
- Redis channel: planarchy:sse → capakraken:sse
- Logger service name: planarchy-api → capakraken-api
- Anonymization seed updated
- Start/stop/restart scripts updated

Test data:
- Seed emails: @planarchy.dev → @capakraken.dev
- E2E test credentials: all 11 spec files updated
- Email defaults: @planarchy.app → @capakraken.app
- localStorage keys: planarchy_* → capakraken_*

Documentation: 30+ .md files updated

Verification:
- pnpm install: workspace resolution works
- TypeScript: only pre-existing TS2589 (no new errors)
- Engine: 310/310 tests pass
- Staffing: 37/37 tests pass

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-27 13:18:09 +01:00
Hartmut dd55d0e78b chore(repo): initialize planarchy workspace 2026-03-14 14:31:09 +01:00