Skip to content

HOK-1592_c: Prefix task-specific log lines with task ID#562

Closed
timogilvie wants to merge 3 commits intoauto/integrationfrom
task/prefix-task-specific-tasks-with-a-task-id-challenger
Closed

HOK-1592_c: Prefix task-specific log lines with task ID#562
timogilvie wants to merge 3 commits intoauto/integrationfrom
task/prefix-task-specific-tasks-with-a-task-id-challenger

Conversation

@timogilvie
Copy link
Copy Markdown
Owner

Summary

  • Adds wavemill_format_task_log_message helper in wavemill-common.sh that prefixes log messages with [ISSUE_ID] when an issue is in context, stripping duplicate inline ISSUE → arrows
  • Updates all task-specific log calls across wavemill-mill.sh, wavemill-context.sh, wavemill-expand.sh, wavemill-plan.sh, and wavemill-review.sh to pass --issue so the prefix is applied
  • Keeps ERROR and WARN messages (log_error/log_warn) unprefixed so they remain visually distinct in the logging pane
  • Adds a shell test suite (tests/log-prefix-task-id.test.sh) validating prefix insertion, deduplication, and error/warn exemption

Changes

  • shared/lib/wavemill-common.sh — new wavemill_format_task_log_message function and updated log() to accept --issue flag
  • shared/lib/wavemill-mill.sh — updated phase-launch, retry, and status log calls to pass --issue; fixed invalid log "warn" level to log "status" in handle_phase_launch_result
  • shared/lib/wavemill-context.sh — updated context-related log calls with --issue
  • shared/lib/wavemill-expand.sh — updated expansion log calls with --issue
  • shared/lib/wavemill-plan.sh — updated plan log calls with --issue
  • shared/lib/wavemill-review.sh — updated review log calls with --issue
  • tests/check-shell.sh — registers new test file
  • tests/log-prefix-task-id.test.sh — new test file for log prefix behavior

Test plan

  • Shell test suite in tests/log-prefix-task-id.test.sh covers: prefix insertion with --issue, no prefix without --issue, deduplication of inline ISSUE → arrows, and that log_error/log_warn remain unprefixed
  • Run with bash tests/check-shell.sh

Self-review

  • Iteration 1: blocker found — log "warn" is not a valid log level; --issue flag was never parsed, producing garbled output in handle_phase_launch_result. Fixed by changing to log "status".
  • Iteration 2: verdict ready — one non-blocking warning about global arrow deduplication (intentional per spec).

Closes HOK-1592_c

timogilvie and others added 2 commits May 7, 2026 08:20
Add wavemill_format_task_log_message() to wavemill-common.sh: trims
leading whitespace, prepends [ISSUE] when a task ID is known (via
explicit --issue flag or WAVEMILL_ISSUE env), and deduplicates existing
leading bracket/arrow tokens so the prefix is never doubled.

Update both log() definitions in wavemill-mill.sh (main + monitor
heredoc) to accept an optional --issue <id> flag that is passed at
task-scoped call sites. Convert all task-specific call sites to use
--issue and remove the inline $ISSUE token from message bodies.

Update command-side log() wrappers in wavemill-plan.sh,
wavemill-review.sh, wavemill-context.sh, and wavemill-expand.sh to
call the shared formatter via implicit WAVEMILL_ISSUE.

ERROR and WARN output remains unconditionally unprefixed.

Add tests/log-prefix-task-id.test.sh covering formatter edge cases
and mill log() integration. Wire into tests/check-shell.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Change log level from invalid "warn" to "status" in handle_phase_launch_result.
@timogilvie
Copy link
Copy Markdown
Owner Author

Closed as superseded by primary HOK-1592 implementation in PR #560, which merged into auto/integration on 2026-05-07. This challenger branch continued after the primary merged, conflicted with it, and is now failing CI, so it should not remain in the merge queue.

@timogilvie timogilvie closed this May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant