chore(config): add LogConfig proto and Go-side config conversion (S03 Step 1)

What

Step 1 of the S03 logging foundation (plan, spec). Adds the LogConfig / AccessLogConfig / SampleConfig proto messages (log = tag 5) and the Go-side conversion in internal/config (logFromProto + runtime types + Config.Log), with documented defaults applied at conversion time. No logging behavior is wired into the running service yet — that is Step 3.

Implements S03 sections Configuration, Proto messages, and the YAML example. level/format are string + in: (matching the database.sslmode precedent, not proto enums); success_fraction uses features.field_presence = EXPLICIT so unset (→ default 1.0) is distinguishable from explicit 0.0; slow_threshold is parsed at conversion time with a field-named startup error.

Spec coverage

Step 1 owns AC #7 (closed) (load/defaults) and AC #8 (closed) (validation/presence); the remaining ACs are owned by Steps 2–3.

AC Tests
#7 (closed) omitted-block defaults (info/json/1.0/1s) TestLog_OmittedBlock, TestLoad_LogOmittedBlock, TestLog_EmptyEnums, TestLog_LevelFormatMapping
#7 (closed) invalid slow_threshold → startup error naming field TestLog_InvalidSlowThreshold, TestLoad_LogInvalidSlowThreshold; empty→default: TestLog_EmptySlowThreshold
#8 (closed) success_fraction bounds rejected at load TestLog_FractionOutOfRange
#8 (closed) explicit 0.0 vs unset TestLog_ExplicitZeroFraction, TestLog_UnsetFractionDefaults
#8 (closed) level/format outside in: set rejected TestLog_InvalidLevel
extra coverage TestLog_DisabledPassthrough, TestLoad_ConfigExampleLogDefaults

(Full table incl. Error Cases + Security Considerations is in the test(config) commit body.)

Notes

  • MR size: 656 reviewable LOC (excl. generated config.pb.go), above the 500 soft ceiling — but 407 of 656 is test code (test-first authorship); the non-test surface is 249 LOC (log.go 148 + proto 62 + config.go 7 + YAML 32), well within range. Single coherent concern; no split warranted.
  • Workflow: /implement-step (test-author → implementation-author → code-simplifier), then /validate-step/review-branch/validate-step. Review findings all addressed.
  • One --no-verify on the branch — the test-author panic-skeleton commit (documented carve-out); every other commit ran the full hook chain.

Merge request reports

Loading
Loading