chore(api): P2.9 prettier, lint-staged, husky, and Copilot setup (#57) master
* feat(sybil): add graph-based sybil resistance and reputation hardening Implement P2.10 addressing VUL-010 (HIGH severity). Adds all 5 defense layers from architecture.md: PDS trust signals, EigenTrust graph-based trust propagation, logarithmic cluster ceiling, behavioral heuristics, and AT Protocol labeler integration points. Core additions: - 7 new database tables (interaction_graph, trust_seeds, trust_scores, sybil_clusters, sybil_cluster_members, behavioral_flags, pds_trust_factors) - EigenTrust algorithm with double-buffered iteration and convergence detection - Sybil cluster detection via BFS connected components - Interaction graph service wired into replies and reactions (fire-and-forget) - Behavioral heuristics: burst voting, trigram Jaccard content similarity, interaction diversity scoring - Background job orchestrating EigenTrust -> heuristics -> detection - Admin API: trust seed CRUD, sybil cluster management, PDS trust factors, behavioral flags, trust graph recompute - Reputation formula: base * voterTrustScore * pdsTrustFactor * clusterDiversityFactor - Sybil simulation test: 20 real + 10 sybil accounts confirms trust separation 127 new tests across 13 test files. All 1545 tests pass. * fix(db): add sybil resistance tables to drizzle config Include all 7 new P2.10 schema files in drizzle.config.ts so that fresh installations via drizzle-kit push create the tables. * fix(ci): add retry logic to security audit for registry outages pnpm audit fails the entire job when npm's registry returns 500 or is unreachable. Retry up to 3 times with 15s delay for transient errors (ERR_PNPM_AUDIT_BAD_RESPONSE, ECONNREFUSED, ETIMEDOUT, EAI_AGAIN). Real vulnerabilities still fail immediately on first attempt. * chore(api): add prettier, lint-staged, husky hooks, and commitlint Add prettier, lint-staged, husky, and commitlint as devDependencies using pnpm catalog references. Add format/format:check scripts and husky prepare script. Create prettier config (matching workspace standard), lint-staged config, commitlint config, prettierignore, and husky pre-commit/commit-msg hooks for conventional commit enforcement. * style(api): apply prettier formatting Apply prettier (semi: false, singleQuote, tabWidth: 2, trailingComma: es5, printWidth: 100) to all existing source files, tests, config files, and drizzle migration snapshots for consistent code style. * chore(api): add copilot-setup-steps.yml for AI coding agents Add GitHub Copilot coding agent setup workflow with PostgreSQL (pgvector) and Valkey services, matching the CI integration test configuration. Enables AI agents to install deps, run migrations, typecheck, and run both unit and integration tests. * fix(api): add prettier and lint-staged to standalone CI catalog Add prettier and lint-staged version entries to the per-repo pnpm-workspace.yaml catalog so pnpm install works in standalone CI environments (without the workspace root).