feat(data-weaver): child place resolution - #447
Conversation
…h this, it introduces refactoring of and fixes to composite scope key derivation and updates to card generation to render multi-series for child entities.
…n logic for in discovery prompts
There was a problem hiding this comment.
Code Review
This pull request introduces support for sub-region and child-place queries (e.g., querying counties within a state) by fetching child entities and their observations, normalizing place types, and resolving deterministic scope keys. Key changes include new helper functions for formatting card titles, normalizing place types, and managing composite scope keys, alongside updated LLM instructions for data discovery. The review feedback highlights a critical bug in render_result_html.ts where unnormalized child place types in markdown links would cause frontend resolution failures, and suggests defensive programming improvements in scope_key.ts and observations.ts to filter out nullish entity DCIDs and invalid observation dates before sorting.
…dence over defaults when given (i.e., counties in the USA)
beets
left a comment
There was a problem hiding this comment.
Thanks for this, and nice to see more tests! Left comments, but many of these aren't gating -- more for follow ons. Can be captured in TODOs.
Issue
This PR addresses tracker lines 10, 11, 16 and 19.
Description
The goal of this PR is to update place resolution across the query execution pipeline, store and front-end in order to support sub-region and child place retrieval and multi-series chart visualizations.
An important note is that while this PR does update skills and agent directions in order to improve the results of searches involvin child places, its primary goal is to create the update data fetching and the end-to-end pipeline to support child searching and display. We will continue to improve the skills in future PRs.
Implementation
Notes
Upcoming items, to be implemented in separate PRs:
Tests
Added unit tests for place type normalization, scope key derivation, and title formatting.
Testing
"How access to electricity has changed across countries in Africa"
On main branch
In this PR
The search will resolve to child places, and display all countries on a line chart.