Conversation
An activity can yield several products, so its *name* is shared across them while the *product* tells them apart. The old `name`/`product` (plus `referenceProduct`, the snake-case get_path_to / columnar keys, and an exchange's `targetActivity`) invited mixing the two. Standardize the wire on `process_id` + `activity_name` + `product_name`: a process is the single-output `(activity, product)` unit addressed by `process_id` and has no name of its own. - DTOs: ActivitySummary, ConsumerResult, SupplyChainEntry, ActivityForAPI (referenceProduct* -> product*), ExchangeWithUnit.targetActivityName - get_path_to and the columnar score_activities identity keys converged to camelCase - get_contributing_activities: the hand-rolled MCP object now matches the REST DTO's keys - AGENTS.md glossary defines activity (grouping) vs process (unit) Breaking wire change; pre-1.0, no compatibility shim.
…_name Mirror the engine wire rename. Activity / ConsumerResult / SupplyChainEntry / PathStep / ActivityDetail now expose `activity_name` + `product_name` (ActivityDetail's `reference_product*` -> `product_*`), and a technosphere exchange's `target_activity` -> `target_activity_name`. A process is an `(activity, product)` pair with no name of its own. Bumps to 0.6.0 (breaking change, 0.x minor) with a migration note.
The field rename pushed camelCase identity keys into two MCP outputs: get_contributing_activities (processId/activityName/productName/contributionPercent) and the score_activities columnar columns (activityName/processId). But the MCP surface is snake_case everywhere else (flow_name, contribution_percent, total_score, web_url, functional_unit), so a single get_contributing_activities response mixed snake and camel and disagreed with the sibling get_contributing_flows. camelCase is the REST wire convention (consumed by pyvolca and the web UI); the canonical field name is snake_case. Bring these two outputs back to snake_case — the columnar columns keep the clarity gain (name -> activity_name) without the casing flip. get_path_to stays camelCase: it is a REST endpoint.
The two get_supply_chain query-param tests kept a "name" root key after the field rename; the wire now emits "activityName". The tests only assert query params (they swallow the parse), so this was harmless but no longer matched the real shape.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
An activity can yield several products, so its name is the activity's (shared across its products) while the product is what tells them apart. The old
name/productfields invited mixing the two — the same key meant different things to different readers (an analyst usually cares about the product; the field often carried the process name).What
Standardize on
process_id+activity_name+product_nameacross the wire and the Python client.(activity, product)unit you address withprocess_id; it has no name of its own — compose a label fromactivity_name+product_name.activity_name, possibly several products (all_products).search_activities(product=X)→ processes →score_activities→ compare.Changes:
ActivitySummary,ConsumerResult,SupplyChainEntry,ActivityForAPI(referenceProduct*→product*), andExchangeWithUnit.targetActivityName.get_path_toand the columnarscore_activitiesidentity keys converged to camelCase; the hand-rolled MCPget_contributing_activitiesobject now matches the REST DTO's keys.activity_name/product_name,ActivityDetail.product_*,target_activity_name; updated README + regenerated API reference; migration note in the CHANGELOG.Breaking wire + client change; pre-1.0, no compatibility shim. Local tests green — engine
cabal test(1345 examples), pyvolcapytest(160 passed).