agent-workflow-manager uses centralized structured logging for runtime wiring, service execution, and adapter ingress/dispatch flow. Logging is contract-driven and enforced by deterministic tests.
- Shared package:
internal/logging - Interface:
logging.Logger(Info,Error) - Default runtime logger: JSON
slogtostderr - Test logger:
logging.Recorderfor deterministic assertions
service.operation.startservice.operation.finish
Required fields:
operation(one ofcontext,fetch,done,review,work,history,sync,health,status,verify,init)project_idwhen present in payloadduration_mson finishokon finisherror_codeon finish whenok=false
cli.ingress.readcli.ingress.validatecli.dispatch(phase=start|finish)cli.resultcli.failure(stage=read|validate|dispatch)
Required fields by stage:
- ingress read:
ok - ingress validate:
ok,command,request_id, optionalproject_id,error_codewhen failed - dispatch:
phase,command,request_id, optionalproject_id,okon finish,error_codeon failed finish - result:
ok,commandwhen available,request_idwhen available, optionalproject_id,error_codewhen failed - failure:
stage, plus stage-specific command/tool/request identifiers anderror_code
mcp.ingress.readmcp.ingress.validatemcp.dispatch(phase=start|finish)mcp.resultmcp.failure(stage=validate|dispatch)
Required fields by stage:
- ingress read:
ok,tool - ingress validate:
ok,tool, optionalproject_id,error_codewhen failed - dispatch:
phase,tool, optionalproject_id,okon finish,error_codeon failed finish - result:
ok,tool, optionalproject_id,error_codewhen failed - failure:
stage,tool, optionalproject_id,error_code
internal/runtime.NewService* must always return a service wrapped by core.WithLogging(...), including the unconfigured backend path.
- Runtime logger configuration is bounded and env-driven:
AWM_LOG_LEVEL:debug|info|warn|error(defaultinfo)AWM_LOG_SINK:stderr|stdout|discard(defaultstderr)
- Invalid or unset values must fall back to defaults (
info,stderr). - Configuration only controls emission threshold and sink destination.
- Contract constraints (must not drift):
- existing event names,
- required fields listed in this document,
logging.Loggerinterface shape (Info,Error),- deterministic recorder-based test assertions.
Logging coverage is required and enforced through deterministic recorder-based tests:
- Service decorator tests call every
core.Servicemethod and require both start + finish logs with required fields. - CLI and MCP adapter tests require ingress/validate/dispatch/result/failure event coverage for success and failure paths.
- Runtime tests require that services returned by
internal/runtimeemit service decorator logs.