Skip to content

Draw solved velocity as arrows in pyflow run's declared-field path - #89

Open
AdamClemens wants to merge 1 commit into
mainfrom
claude/determined-lamarr-4339ae
Open

Draw solved velocity as arrows in pyflow run's declared-field path#89
AdamClemens wants to merge 1 commit into
mainfrom
claude/determined-lamarr-4339ae

Conversation

@AdamClemens

Copy link
Copy Markdown
Owner

Summary

  • _add_declared_field_transport (pyflow run's live path for a config combining simulation.velocity_solved with declared fields) now draws the solved velocity as arrows alongside its declared fields' panels, the same "remove old, build new" shape _add_solved_velocity_rendering already uses. Closes the gap TASK-051's own commit explicitly flagged rather than fixed (playback.py's combined play() path already drew both; pyflow run drew only panels).
  • Checked docs/implementation/golden-demos.md and Stage 6's Completion Criteria first — both silent on live-run arrows either way, so this isn't reversing a deliberate scoping decision. test_golden_demo_annotations.py's own "correctly exempt" comment predated TASK-051 and was stale, not a live decision.
  • Also fixed an unrelated, pre-existing false positive in test_check_claims.py::test_only_tracked_markdown_files_are_read, found while running make preflight from inside this session's own git worktree checkout (.claude/worktrees/<name>) — the test flagged "worktrees" appearing among repo_root's own ancestor path components as if it were the nested-worktree double-read bug it exists to catch. Narrowed to a path relative to repo_root.

Test plan

  • TDD: wrote tests/unit/test_bootstrap.py::test_bootstrap_with_velocity_solved_and_a_declared_field_also_draws_arrows first, confirmed red, then implemented.
  • Blast radius: test_golden_demo_annotations.py's _draws_arrows updated; smoke_transport.yaml/thermal_buoyancy.yaml/multi_field_plume.yaml each gained a field_display.vector_label (P-019); src/pyflow/CLAUDE.md, docs/implementation/golden-demos.md, roadmap.md/status.md test count all updated in this change.
  • Verified live (not just unit tests): ran pyflow run --backend offscreen against all three affected demos — each now holds exactly one arrow gfx.Line object, a correct "Velocity (model units): length = 0.3 x magnitude" HUD line, and 100k+ non-background rendered pixels.
  • make preflight green locally (1182 passed).
  • make check-docs/references/manifest/documents/stages/scenarios/config-template/dates/duplicate-blocks, mypy --strict, ruff all clean.
  • make ci on a real runner, both platforms (CI, not yet observed).

🤖 Generated with Claude Code

Closes the gap TASK-051's own commit flagged explicitly rather than
fixed: playback.py's combined play() path renders both a solved
velocity's arrows and its declared fields' panels together, but
bootstrap.py's _add_declared_field_transport -- the identical config
shape's live pyflow run path -- colour-mapped the panels and never
drew the velocity carrying them at all. Reachable from two shipped
demos: pyflow run on smoke_transport.yaml or thermal_buoyancy.yaml
showed no indication of flow direction or magnitude despite a real,
pressure-corrected velocity driving the transport.

Checked docs/implementation/golden-demos.md and Stage 6's Completion
Criteria first, per this repo's "deliberately scoped out for a stated
reason" convention -- both were silent on live-run arrows either way.
tests/unit/test_golden_demo_annotations.py's own _draws_arrows did call
the omission "correctly exempt", but that comment predated TASK-051 and
was stale rather than a live decision, so this closes it rather than
reversing something intentional.

_add_declared_field_transport now builds/rebuilds
field_visualization.build_vector_field_arrows every frame when
config.simulation.velocity_solved is set, the same "remove old, build
new" shape _add_solved_velocity_rendering already uses, and returns a
third arrows_drawn closure joined into bootstrap()'s show_vector_scale
via the existing _either_path_drew_arrows. Written test-first
(tests/unit/test_bootstrap.py::
test_bootstrap_with_velocity_solved_and_a_declared_field_also_draws_arrows,
confirmed red before the fix landed).

Blast radius: test_golden_demo_annotations.py's _draws_arrows no longer
exempts velocity_solved-with-declared-fields; smoke_transport.yaml,
thermal_buoyancy.yaml and multi_field_plume.yaml all gained a
field_display.vector_label, since P-019 requires one on every demo that
draws arrows and none needed one while this path drew none.
src/pyflow/CLAUDE.md and docs/implementation/golden-demos.md record the
fix and its history. roadmap.md/status.md's test count moved
1199 -> 1200 for the one new test.

Verified live, not only unit-tested: ran pyflow run --backend offscreen
against all three affected demos and confirmed each now holds exactly
one arrow gfx.Line object, a correct "Velocity (model units): length =
0.3 x magnitude" HUD line, and 100k+ non-background rendered pixels.

Also fixed an unrelated, pre-existing false positive found while
running make preflight from inside this session's own git worktree
checkout (.claude/worktrees/<name>): test_check_claims.py's
test_only_tracked_markdown_files_are_read flagged "worktrees" appearing
among repo_root's own ancestor path components as if it were the nested-
worktree double-read bug it was written to catch. Narrowed to a path
relative to repo_root, which is the only shape the original bug had;
the test's actual load-bearing assertion (read == tracked) already
passed throughout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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