[Phase 1.3] Temporal configuration + secrets #11

Merged
rock merged 2 commits from feat/phase-1.3-temporal-config into main 2026-09-09 00:31:55 +00:00
Owner

Changes

  • internal/config/config.go — Env-specific loading (dev/staging/prod), validation, in-cluster detection
  • internal/config/config_test.go — 11 tests covering defaults, env override, TLS, prod gates
  • k8s/secrets.enc.yaml — SOPS-encrypted Secret (anthropic key, memory JWT, temporal postgres pw)

Validation

  • 11 config tests pass
  • Full test suite passes (go test ./...)
  • go build ./... clean
  • SOPS encryption verified (age key)
## Changes - `internal/config/config.go` — Env-specific loading (dev/staging/prod), validation, in-cluster detection - `internal/config/config_test.go` — 11 tests covering defaults, env override, TLS, prod gates - `k8s/secrets.enc.yaml` — SOPS-encrypted Secret (anthropic key, memory JWT, temporal postgres pw) ## Validation - 11 config tests pass - Full test suite passes (`go test ./...`) - `go build ./...` clean - SOPS encryption verified (age key)
Author
Owner

CRAP/DRY/SOLID Review

Issues Found:

🔴 BINARY COMMITTED (poimen-worker)

  • 34MB binary bloats repo
  • Fix: Remove, add to .gitignore

🔴 DRY VIOLATION - Temporal Client

  • Existing: cmd/worker/main.go has working Temporal client.Dial()
  • New: internal/temporal/client.go duplicates this (~110 lines)
  • Two places to maintain same logic

🔴 DRY VIOLATION - knowledge_base.go

  • Overlaps with merged PR #9 changes
  • Will cause merge conflicts

🟡 CRAP Assessment

  • internal/temporal/client.go: CRAP ~4 (adds TLS, good defaults)
  • internal/temporal/worker.go: CRAP ~3 (simple wrapper)
  • Question: Is wrapper needed? SDK usage in cmd/worker is already clean

Recommendation

  1. Remove poimen-worker binary
  2. Rebase on main
  3. Either: refactor cmd/worker to use internal/temporal OR remove internal/temporal
  4. Don't have two client init paths
## CRAP/DRY/SOLID Review ### Issues Found: **🔴 BINARY COMMITTED (poimen-worker)** - 34MB binary bloats repo - Fix: Remove, add to .gitignore **🔴 DRY VIOLATION - Temporal Client** - Existing: cmd/worker/main.go has working Temporal client.Dial() - New: internal/temporal/client.go duplicates this (~110 lines) - Two places to maintain same logic **🔴 DRY VIOLATION - knowledge_base.go** - Overlaps with merged PR #9 changes - Will cause merge conflicts **🟡 CRAP Assessment** - internal/temporal/client.go: CRAP ~4 (adds TLS, good defaults) - internal/temporal/worker.go: CRAP ~3 (simple wrapper) - Question: Is wrapper needed? SDK usage in cmd/worker is already clean ### Recommendation 1. Remove poimen-worker binary 2. Rebase on main 3. Either: refactor cmd/worker to use internal/temporal OR remove internal/temporal 4. Don't have two client init paths
rock force-pushed feat/phase-1.3-temporal-config from 9d6fe12ef6 to a32e5c63ee 2026-09-09 00:00:27 +00:00 Compare
Author
Owner

FIXES APPLIED

Binary removed - poimen-worker excluded from repo
Rebased on main - Includes PR #9 (knowledge_base + temporal infra)
.gitignore updated - Prevents future binary commits
Commits cleaned - Only PR-specific changes (config validation)

Commits:

  • a32e5c6: feat(phase-1.3) config validation, env-specific loading, SOPS
  • 375bb68: fix gitignore

Internal/temporal notes:

  • internal/temporal/ code now in base (PR #9)
  • No duplication on this branch
  • TODO: Refactor cmd/worker to use internal/temporal (future optimization)

Status: Ready for review & merge

## ✅ FIXES APPLIED ✅ **Binary removed** - poimen-worker excluded from repo ✅ **Rebased on main** - Includes PR #9 (knowledge_base + temporal infra) ✅ **.gitignore updated** - Prevents future binary commits ✅ **Commits cleaned** - Only PR-specific changes (config validation) **Commits:** - a32e5c6: feat(phase-1.3) config validation, env-specific loading, SOPS - 375bb68: fix gitignore **Internal/temporal notes:** - internal/temporal/ code now in base (PR #9) - No duplication on this branch - TODO: Refactor cmd/worker to use internal/temporal (future optimization) **Status:** Ready for review & merge
rock added 2 commits 2026-09-09 00:04:46 +00:00
config.go:
  - Environment enum (dev/staging/prod) with auto-detect
  - MemoryServiceConfig + LLMConfig structs
  - Validate(): TLS pair check, file existence, prod LLM key requirement
  - In-cluster default host detection via KUBERNETES_SERVICE_HOST
  - TaskQueue + WorkerCount from env

config_test.go: 11 tests
  - defaults, env override, TLS mismatch, TLS file not found
  - prod validation (requires LLM key), env parsing
  - in-cluster detection, port defaults, int parsing

k8s/secrets.enc.yaml: SOPS-encrypted Secret
  - anthropic-api-key, memory-service-jwt, temporal-postgres-password
  - Age-encrypted, KSOPS-compatible

Build: clean, full test suite passes
rock force-pushed feat/phase-1.3-temporal-config from a32e5c63ee to cf6f2deb18 2026-09-09 00:04:46 +00:00 Compare
rock merged commit 3858f54670 into main 2026-09-09 00:31:55 +00:00
rock deleted branch feat/phase-1.3-temporal-config 2026-09-09 00:32:06 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: riotpiao-poimen/poimen-workflows#11