Skip to content

fix(observability): preserve title and work stage - #7

Merged
itstimwhite merged 1 commit into
mainfrom
codex/jov-5609-hud-api-title-stage
Sep 6, 2026
Merged

itstimwhite merged 1 commit into
mainfrom
codex/jov-5609-hud-api-title-stage

Conversation

@itstimwhite

Copy link
Copy Markdown

Context

The Gem HUD receives issue identifiers from Symphony but not their titles or lifecycle stage, so active work renders as UNKNOWN and the consumer has to infer process state. JOV-5609 tracks the HUD repair; JOV-6010 tracks the runtime truth boundary.

TL;DR

Preserve tracker titles and expose additive lifecycle stages in the observability API.

Summary

  • Carry issue titles through running, retry, and blocked snapshots.
  • Add bootstrapping, implementing, retrying, and blocked stage values without removing existing fields.
  • Keep missing title truth as null and document the additive API contract.

Alternatives

  • Consumer-side title lookup was rejected because it duplicates tracker reads and can display stale or mismatched work.
  • Deriving detailed phases from free-form agent messages was rejected because those messages are not a stage contract.

Test Plan

  • make -C elixir all (run as make MIX='mise exec -- mix' all inside elixir/)
  • mix test test/symphony_elixir/extensions_test.exs test/symphony_elixir/core_test.exs (77 tests)
  • Full coverage runner: 326 tests, 0 failures, 6 skipped, 100% reported coverage
  • Dialyzer: 0 errors

@linear-code

linear-code Bot commented Sep 6, 2026

Copy link
Copy Markdown

JOV-5609

@itstimwhite
itstimwhite marked this pull request as ready for review September 6, 2026 03:14
Comment on lines +1598 to +1600
defp pick_retry_title(previous_retry, metadata) do
metadata[:title] || Map.get(previous_retry, :title)
end

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The pick_retry_title/2 function incorrectly uses a stale title from a previous retry when the current issue's title is nil, due to the behavior of the || operator.
Severity: MEDIUM

Suggested Fix

Modify pick_retry_title/2 to explicitly prioritize the title from the metadata map, even when it is nil. Instead of using the || operator, check if the :title key exists in metadata. If it does, use its value. Otherwise, fall back to the title from the previous_retry map. For example: if Map.has_key?(metadata, :title), do: metadata[:title], else: Map.get(previous_retry, :title).

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: elixir/lib/symphony_elixir/orchestrator.ex#L1598-L1600

Potential issue: The function `pick_retry_title/2` uses the `||` operator to select a
title. In Elixir, `nil` is a falsy value. If an issue's title is updated to be `nil` in
the tracker, the `metadata[:title]` passed during a retry will be `nil`. The `||`
operator will then incorrectly fall back to using a stale title from a `previous_retry`
attempt. This violates the system's specification, which requires that missing titles
remain `null` and are not synthesized from other fields, leading to incorrect data in
observability outputs.

Did we get this right? 👍 / 👎 to inform future reviews.

@itstimwhite
itstimwhite merged commit 9b68438 into main Sep 6, 2026
4 checks passed
@itstimwhite
itstimwhite deleted the codex/jov-5609-hud-api-title-stage branch September 6, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant