5 Commits

Author SHA1 Message Date
q792602257 be8d5e3a1b feat(mcp,acp): Repository.WithTx + acp.Repository.InTx
Cross-module transactional support for spec §6.1: ACP CreateSession must
atomically insert acp_sessions row + mcp_tokens row (FK NOT NULL).

- mcp.Repository.WithTx(tx) -> Repository (tx-bound, no pool)
- acp.Repository.InTx(ctx, fn) -> error (pgx.BeginFunc wrapper)
- acp.Repository.WithTx(tx) -> Repository (tx-bound)
- Update fakeRepos in test files to satisfy new interface methods

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-08 12:40:54 +08:00
q792602257 a00f5a9efd refactor(mcp): apply Part 1 review I1+I3+I4+I5
- Rename MCPToken -> Token (mcp.Token reads cleaner; zero external callers yet)
- IssueSystemToken: guard against nil ACPSessionID / UserID (early input validation)
- TokenService: inject now func for clock injection (parity with RateLimiter)
- Repository CHECK constraint tests: assert wrapped CodeInternal

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-08 10:28:49 +08:00
q792602257 bb512c0029 feat(mcp): repository RevokeBySession + ReapStaleSystemTokens + PurgeExpired 2026-05-08 07:22:16 +08:00
q792602257 21f29a68b5 feat(mcp): repository List + UpdateLastUsed + Revoke + DeleteByID 2026-05-08 07:20:19 +08:00
q792602257 3d16e4a877 feat(mcp): repository skeleton + Create + GetByHash + GetByID 2026-05-08 07:18:09 +08:00