YongGoose opened a new issue, #1057:
URL: https://github.com/apache/burr/issues/1057

   ## Problem
   
   The tracking UI and the MCP endpoint can find a run only by project, 
partition key and app_id. There is no way to ask for "the runs of prompt v3", 
"the production runs" or "the runs of experiment A", so comparing versions or 
building an eval set from real traffic starts with copying app_ids by hand.
   
   The data model already has room for this, but nothing fills it:
   
   - `ApplicationSummary.tags: Dict[str, str]` exists in 
`burr/tracking/server/schema.py`, and both backends fill it with `{}` 
(`burr/tracking/server/backend.py`, `burr/tracking/server/s3/backend.py`).
   - `ApplicationMetadataModel` in `burr/tracking/common/models.py` says "We 
will want to add tags here when we have them."
   - `ApplicationBuilder` has no way to set them.
   
   ## Proposal
   
   1. **Builder:** `ApplicationBuilder.with_tags({"env": "prod", "prompt": 
"v3"})`. Keys and values are strings, matching the existing field. A dict 
rather than keyword arguments, so keys like `prompt-version` work.
   2. **Hooks:** the builder passes the tags to `post_application_create` as a 
new `tags` keyword. Hooks already take `**future_kwargs`, so existing hooks 
keep working.
   3. **Local tracker:** `LocalTrackingClient` writes them to `metadata.json` 
(`ApplicationMetadataModel.tags`), and the local backend returns them in 
`ApplicationSummary.tags`.
   4. **Server:** `list_apps` takes an optional tag filter (`?tag=env:prod`, 
repeatable, all must match), applied before paging so the page counts stay 
right.
   5. **UI:** the app list shows the tags and can filter by them.
   6. **MCP:** `list_apps` takes the same filter, and its rows include the tags.
   
   ```python
   app = (
       ApplicationBuilder()
       .with_actions(...)
       .with_transitions(...)
       .with_tags({"env": "prod", "prompt": "v3"})
       .with_tracker(LocalTrackingClient(project="support-bot"))
       .build()
   )
   ```
   
   ## Open questions
   
   - **Resuming:** `post_application_create` writes `metadata.json` only once 
("Metadata already exists ... Not overwriting"). When an app is resumed with 
different tags, should they merge into the stored ones (new values win), 
replace them, or be ignored? I'd merge, since a resumed run is the same run.
   - **Tags learned during a run** (for example `outcome=escalated`) are out of 
scope here. They could come later through the application context, or as 
annotations.
   - **S3 backend:** its `Application` table has no column for tags, so it 
needs a migration. I'd do that in a follow-up and keep the first PR to the 
local tracker and backend.
   
   ## Scope of a first PR
   
   The builder method, the hook keyword, the local tracker and backend, the 
server and MCP filter, the UI list, and tests. If this direction sounds right, 
I'm happy to work on it.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to