skillhub/docs
dongmucat 04caf21e76
fix(audit): resolve 8-hour timezone offset in audit log timestamps (#472)
## Problem
Audit log timestamps displayed 8 hours later than actual time when JVM
default timezone != UTC. Root cause: `audit_log.created_at` was
`TIMESTAMP without time zone`, and `rs.getTimestamp()` interprets bare
values using JVM timezone.

## Solution
### Backend
- **V42 migration**: Upgrade `audit_log.created_at` from `TIMESTAMP` to
  `TIMESTAMPTZ`, anchor historical data as UTC via `USING created_at AT
  TIME ZONE 'UTC'` (same pattern as V18/V19/V23/V25/V36)
- **Read path**: `AdminAuditLogAppService.readInstant()` uses
  `rs.getObject(col, OffsetDateTime.class).toInstant()`, result
  independent of JVM timezone
- **Write path (filter params)**: `startTime`/`endTime` binding changed
  from `Timestamp.from()` to `OffsetDateTime.ofInstant(instant,
  ZoneOffset.UTC)` via `toUtcOffsetDateTime()` helper, symmetric with
  read path

### Migration Safety
- `SET LOCAL lock_timeout = '30s'` (transaction-scoped, won't leak to pool)
- `DO $$ ... IF data_type = 'timestamp without time zone' THEN ... ELSE
  ... END $$` idempotent guard with dual-branch `RAISE NOTICE`
- Safe retry: re-running won't double-apply `AT TIME ZONE 'UTC'`

### Test Coverage (10 tests, 477 total suite)
- `rowMapper_readsCreatedAtAsInstant` — UTC offset regression
- `rowMapper_normalisesNonUtcOffsetToInstant` — Non-UTC offset (+08:00)
- `rowMapper_returnsNullTimestampWhenColumnIsNull` — Null path
- `rowMapper_isIndependentOfJvmDefaultTimezone` — JVM TZ=Asia/Shanghai
  drift prevention with `verify(rs, never()).getTimestamp()`
- `@ParameterizedTest buildWhereClause_bindsTimeRangeAsOffsetDateTime` —
  3 cases (both/startOnly/endOnly) for filter param binding
- `@BeforeEach setUp()` — Mock isolation to prevent cross-test stub
  accumulation

## Quality Gates
- [x] `make test-backend-app` passes (477 tests, 0 failures)
- [x] No Controller changes, `make generate-api` not needed
- [x] No frontend changes, typecheck/lint/e2e not needed

## Deployment
V42 must run before new code (guaranteed by Spring Boot startup sequence
→ Flyway executes before app accepts traffic). Rolling deployment:
- New pod + migrated column: correct
- Old pod + migrated column: old code reads TIMESTAMPTZ correctly (pgjdbc
  returns absolute instant)

## Related Docs
- `docs/15-backend-time-governance-plan.md` §3.1: V42 progress registered
- `docs/16-backend-time-inventory.md` §3.1: V42 listed
- Same migration pattern: V18/V19/V23/V25/V36
2026-06-05 15:28:12 +08:00
..
prds feat: File Browser Sidebar with Preview, Security Audit UI, and Syntax Highlighting (#145) 2026-03-23 14:38:47 +08:00
skillhub chore(deps): bump vite/postcss/picomatch/flatted/esbuild to patch Dependabot alerts 2026-05-28 10:17:27 +08:00
superpowers chore(docs): remove select redesign spec 2026-03-20 14:27:20 +08:00
00-product-direction.md docs(protocol): adopt .agents/skills (plural) as canonical universal fallback 2026-05-19 10:49:31 +08:00
01-system-architecture.md refactor(app): clarify query boundaries and workflow owners 2026-03-20 11:33:32 +08:00
02-domain-model.md refactor(app): slim portal controllers and sync backend findings 2026-03-20 10:09:03 +08:00
03-authentication-design.md feat(auth): support oidc login 2026-04-24 13:45:20 +08:00
04-search-architecture.md feat: add search index rebuild workflow 2026-03-19 15:20:08 +08:00
05-business-flows.md refactor(app): slim portal controllers and sync backend findings 2026-03-20 10:09:03 +08:00
06-api-design.md refactor(app): slim portal controllers and sync backend findings 2026-03-20 10:09:03 +08:00
07-skill-protocol.md docs(protocol): adopt .agents/skills (plural) as canonical universal fallback 2026-05-19 10:49:31 +08:00
08-frontend-architecture.md refactor: skill lifecycle projection and docs (#78) 2026-03-18 13:39:22 +08:00
09-deployment.md fix(auth): move OIDC email verification to service layer, add logging 2026-04-29 10:36:34 +08:00
10-delivery-roadmap.md refactor: skill lifecycle projection and docs (#78) 2026-03-18 13:39:22 +08:00
11-auth-extensibility-and-private-sso.md feat(auth): improve extensible login method metadata 2026-03-14 18:52:35 +08:00
12-private-sso-integration-playbook.md feat(auth): improve extensible login method metadata 2026-03-14 18:52:35 +08:00
13-parallel-workflow.md refactor(dev): replace agent-* commands with parallel-* workflow 2026-03-14 20:49:17 +08:00
14-skill-lifecycle.md refactor: skill lifecycle projection and docs (#78) 2026-03-18 13:39:22 +08:00
15-backend-time-governance-plan.md fix(audit): resolve 8-hour timezone offset in audit log timestamps (#472) 2026-06-05 15:28:12 +08:00
16-backend-time-inventory.md fix(audit): resolve 8-hour timezone offset in audit log timestamps (#472) 2026-06-05 15:28:12 +08:00
17-backend-annotation-findings.md refactor(app): clarify query boundaries and workflow owners 2026-03-20 11:33:32 +08:00
18-frontend-annotation-findings.md docs: enrich frontend code documentation 2026-03-19 13:37:21 +08:00
19-smtp-password-reset-email-setup.md feat(auth): 邮箱验证码重置密码与 SMTP 配置支持 (#273) 2026-04-13 20:27:00 +08:00
2026-03-20-skill-label-system-design.md fix(label): harden validation and batched search sync 2026-03-20 16:10:38 +08:00
2026-04-08-issue-automation-design.md [codex] add issue triage automation mvp (#268) 2026-04-09 15:04:33 +08:00
dev-workflow.md fix(auth): enable local bootstrap admin by default (#141) 2026-03-20 16:10:20 +08:00
e2e.md test(e2e,ci): migrate web e2e to real API and add PR e2e workflow (#198) 2026-04-01 14:41:23 +08:00
openclaw-integration-en.md Revert "feat(bootstrap): initialize built-in skills (#481)" (#487) 2026-06-05 11:25:02 +08:00
openclaw-integration.md Revert "feat(bootstrap): initialize built-in skills (#481)" (#487) 2026-06-05 11:25:02 +08:00
oss-01-core-contract-freeze.md feat(skill): add UPLOADED status for PRIVATE skill lifecycle (#290) 2026-04-13 11:39:45 +08:00
oss-02-core-semantic-rules.md fix(i18n): update version delete error message to include UPLOADED and SCAN_FAILED 2026-04-14 15:49:25 +08:00
pr-batch-test-runtime.md feat(ci): add PR batch test deployment workflow (#275) 2026-04-09 18:45:14 +08:00
security-scanning.md feat(security): add security scanning system with multi-scanner support and frontend UI (#144) 2026-03-23 09:56:03 +08:00