Skip to content

fix(repo): preserve per-tool worktree labels#31

Merged
drewstone merged 1 commit into
mainfrom
fix/span-workdir-repo-labels
Jul 8, 2026
Merged

fix(repo): preserve per-tool worktree labels#31
drewstone merged 1 commit into
mainfrom
fix/span-workdir-repo-labels

Conversation

@drewstone

@drewstone drewstone commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Why

Long Codex sessions can run tools in multiple worktrees.
The trace exporter was stamping one session-level repo/cwd/git label across every span, so a tool call with an explicit workdir could still show the wrong branch and cwd downstream.

Change

  • Keep session-level repo labels for spans without an explicit tool workdir.
  • Add a per-span workdir pass for spans whose tool input includes workdir/cwd fields.
  • Cache workdir repo resolution so large sessions do not run repeated git lookups.
  • Add a regression test covering one session with tool calls in two different worktrees.

Proof

  • pnpm test -> 17/17 files, 103/103 tests passed.
  • pnpm typecheck passed.
  • pnpm build passed.
  • Real export proof: spans whose content includes /home/drew/code/agent-dev-container-intelligence-traces now serialize with resource_cwd=/home/drew/code/agent-dev-container-intelligence-traces, resource_branch=fix/intelligence-trace-completeness, resource_commit=d5284ec50, repo_source=span-workdir.

@tangletools tangletools left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved drewstone PR — 233cd2ee

This PR was opened by the trusted drewstone account.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: drewstone_author · 2026-07-08T07:14:19Z

@tangletools tangletools left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ Value Audit — audit-incomplete

Verdict audit-incomplete
Concerns 0 (none)
Heuristic 0.0s
Duplication 0.0s
Interrogation 6.5s (2 bridge agents)
Total 6.5s

💰 Value — error

value agent produced no parseable value-audit JSON.

  • Model: opencode/deepseek/deepseek-v4-pro
  • Bridge attempts: 3
  • Bridge error: opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content; opencode/zai-coding-plan/glm-5.2: bridge stream ended without value-audit content; opencode/deepseek/deepseek-v4-pro: bridge stream ended without value-audit content

🎯 Usefulness — error

usefulness agent produced no parseable value-audit JSON.

  • Model: opencode/deepseek/deepseek-v4-pro
  • Bridge attempts: 3
  • Bridge error: opencode/zai-coding-plan/glm-5.2: bridge stream ended without value-audit content; opencode/kimi-for-coding/k2p7: bridge stream ended without value-audit content; opencode/deepseek/deepseek-v4-pro: bridge stream ended without value-audit content

No PR concerns were produced because the value/usefulness agent pass did not complete. Treat this audit as incomplete, not as approval.


What this audit checks

It judges the change on its merits — not whether it was tasked out in an issue. Unticketed, fast-moving work is fine; the question is whether the change is good and whether a better or existing approach should be used instead.

Pass What it asks
Heuristic Vague title? Whitespace-only or cruft-bearing diff? (content signals only)
Duplication Do added function/class names already exist elsewhere in the repo?
Value Audit What does it do? What goal does it achieve? Is it good? Better architecture or already-exists?
Usefulness Audit Does it integrate and fit? Will it hold up in real use and actually get used?

Findings are concerns, not blocks — the human reviewer decides what to do with them.

value-audit · 20260708T071611Z

@drewstone drewstone merged commit 98a9c67 into main Jul 8, 2026
1 check passed
@drewstone drewstone deleted the fix/span-workdir-repo-labels branch July 8, 2026 07:18
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.

2 participants