feat(zed): add per-project attribution - #939
Conversation
ozymandiashh
left a comment
There was a problem hiding this comment.
Blocking correctness issue on this exact head:
src/providers/zed.ts:127-136 turns the stable path into a basename display label, while downstream aggregation groups strictly by project and keeps the first projectPath. Two sessions rooted at /Users/alice/repo and /Users/bob/repo both emit project: "repo"; they are then merged under the first path. This corrupts per-project totals, filters, cross-provider grouping, and persisted daily attribution. Multi-root display labels can collide in the same way.
Please keep a stable normalized full-path or root-set identity separate from the display label, and add an aggregation-level regression test with identical basenames/display labels and distinct paths.
The Zed suite (14/14), typecheck, and diff check pass, but the identity collision is a data-integrity blocker and this head has no CI checks.
|
@ozymandiashh thank you for your patience and review! Unfortunately, fixing that issue seems to require wider changes that go waaaay beyond some small additions in the Zed provider: introducing stable normalized identities based on full paths/root sets and propagating that across parsing, session caching, cross-provider merging, daily aggregation, filtering, dashboard/export/history rendering, and to some path-sensitive consumers. The newly-added e67fe7ec9c8032b987fb6a3f0191619d395dad2e commit is allegedly a step in that direction. As somebody that does not know this codebase (and that does not have the bandwidth to do a deep-dive to become familiar with this codebase 😞), I do not feel comfortable doing those wider changes, even with the fanciest LLM assistance, so I am closing this PR. My apologies for the annoyance and churn! Anybody with codeburn knowledge or with more bandwidth is more than welcome to pick this up! |
|
Mulțumesc Vlad, mă mai uit pe problemă și când am timp poate mă apuc de ea. |
|
@ozymandiashh no rush and no worries! Also, if you do pick this up, let me know if you need me to test anything as I am more than happy to clone a PR and run some tests on my machines with Zed usage data! |
Summary
TL;DR: add best-effort per-project attribution to Zed. Proof-of-concept follow-up to #480 / #594
Warning
This code was written by LLMs, under the supervision of a so-called developer that spends more time in Pages&Keynote than in an IDE!
Zed Agent Threads can happen in 2 types of workspaces:
codeburnandhomebrew-codeburnandagentsealin the same Zed window. In this case, the project name in Codeburn output will beagentseal, codeburn, homebrew-codeburn(folder names, sorted lexicographically)This LLM-written, human-validated (beware: dumb human) pull request implements the above. Zed Agent Threads without folder metadata remain in the legacy catch-all
zedbucket.Testing
I tested this on one of my devices and I can confirm the single
zedis split into multiple projects:Before:
After (keep in mind I also did a bunch of work in
zedsince I do have some tiny contributions to Zed):This was not a complex setup and I did not have a bunch of work on this machine (no ACP threads, relatively low number of sessions, minimal worktree usage, etc). More testing would be a very good idea!
Notes
Since I am not at all familiar with the
codeburncodebase and patterns, this is more of a proof-of-concept than an actual PR. Please feel free to close this or just treat it as somewhat-relevant-documentation/example for a real implementation — I will not be offended in any way, shape, or form!Relevant Zed references:
PathListserialization format