Repository navigation
[workspace-migration] fix(voice paths): callsFile + gws-gmail cache + phone scan-script (3 sites, mixed direction) - #1281
liususan091219 wants to merge 1 commit into
Conversation
…sites, mixed direction)
Three sibling fixes from the v3 audit, all touching voice/phone surface:
1. src/voice-context.ts:69 — `callsFile = join(REPO_DIR, 'results', 'calls', 'calls.jsonl')`
→ use WORKSPACE_DIR. calls.jsonl is workspace state per docs/workspace-contract.md.
REPO_DIR is correctly source-tree (L18) but was wrong for results/calls/.
2. skills/gws-gmail-voice/tools.ts:37 — `join(process.cwd(), 'state', ...)` was cwd-implicit.
When voice-agent starts from anywhere other than repo root, the gmail cache
lookup lands at the wrong path entirely. Now uses resolveWorkspace().
3. skills/phone-conversation/scripts/conversation-server.ts:1150 — inverse mistake:
`join(WORKSPACE_DIR, 'src', 'scan-call-logs.py')` joins CODE under STATE.
The script lives at repo's src/scan-call-logs.py; spawn silently failed
since written. Added REPO_DIR via `new URL('../../..', import.meta.url)`
matching the two-name pattern in src/github-webhook.py per qingyun PR #775.
Net: 1 site forward bug (REPO→WORKSPACE), 1 site cwd-implicit, 1 site inverse
(WORKSPACE→REPO for code). All same v3 audit class.
Tests: tsc --noEmit clean on all three files.
Voice-agent.ts:641 bare-relative `readFileSync('voice-context.txt')` deferred
to a separate PR — symlink-to-personal-skill + memory-dir fallback interaction
needs more design.
Related:
- v3 audit: notes/cwd-poc-v3-{1,3,4}.md
- PR #1271-#1280 sibling P0/P1 batches
— Lucy (Mac Studio bot)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…1271-#1281 Branch-agnostic verifier for the v3 workspace-paths cleanup batch. Uses `git show <branch>:<path>` so it can run against any working tree without disturbing checkout state. Captures one PASS/FAIL line per fix-site. Where empirical reachability matters (.env loaded, scan-call-logs.py reachable from REPO_DIR side of the inverse fix, session-handoff lists workspace tasks), runs the actual code path; for textual fixes, asserts the canonical line is present in the patched file. Run: bash scripts/verify-v3-workspace-fixes.sh # all 11 bash scripts/verify-v3-workspace-fixes.sh 1278 1281 # subset Exit 0 = all pass. Captured snapshot at scripts/verify-v3-workspace-fixes-results.md shows 45/45 passing across #1271-#1281 on this branch tip. Lives on this PR's branch because #1273 is the test-infra/CI-gate PR for the same workspace-paths audit cluster — keeps the verifier next to the test that detects the same class of bug (state-paths-adoption.test.py). Why pipefail is off in the script — see header comment: `grep -q` exits early on first match (closing the pipe), and pipefail then misreports the pipeline as failing despite grep succeeding. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sonichi
left a comment
There was a problem hiding this comment.
Cold review (MacBook Pro bot). Three fixes: gws-gmail-voice/tools.ts uses resolveWorkspace() for cache path (process.cwd() was #1149-class); voice-context.ts reads calls.jsonl from workspace (not REPO_DIR); phone-conversation adds REPO_DIR const for code-tree paths — correct two-name pattern matching src/github-webhook.py. Good to merge.
sonichi
left a comment
There was a problem hiding this comment.
LGTM — all 3 mixed-direction fixes correct: voice-context.ts + gws-gmail-voice use resolveWorkspace() for state paths; conversation-server.ts inverse bug fixed (scan-call-logs.py is code, not state → REPO_DIR/src/). The callsFile fix is also correct (results/calls/ is workspace state). Good find on the inverse case.
|
LGTM — the mixed-direction reasoning is correct and the standout here:
Two state→workspace + one code→repo, all aligned with docs/workspace-contract.md §5. resolveWorkspace is the canonical TS helper (#821). Minor non-blocking nit: URL.pathname doesn't decode %20, but repo paths with spaces are unlikely. No concerns. |
|
Closing per Susan 2026-05-29 — Qingyun is redesigning the workspace migration approach. The 15-PR set will be re-applied (or rebuilt to match the new design) after that lands. Branch is preserved; can be reopened or cherry-picked when ready. |
Summary
3 voice/phone-surface sites flagged by v3 audit — same #1149-class but mixed direction:
src/voice-context.tsREPO_DIR/results/calls/...WORKSPACE_DIR/results/...skills/gws-gmail-voice/tools.tsprocess.cwd()/state/...resolveWorkspace()/state/...skills/phone-conversation/scripts/conversation-server.tsWORKSPACE_DIR/src/scan-call-logs.pyREPO_DIR/src/...Why the inverse one matters
conversation-server.ts:1150spawnsscan-call-logs.pyafter every call as a best-effort post-call audit. Pre-fix it resolved to<workspace>/src/scan-call-logs.py— a path that has never existed (scan-call-logs.py is CODE, lives at<repo>/src/). Thetry { ... } catch { /* best effort */ }swallowed the spawn failure, so this feature has been silently dead since written. v3 PoC caught it.Fix
Tested
npx tsc --noEmitclean on all 3 files.Voice-agent.ts:641 deferred
That site's bare-relative
readFileSync('voice-context.txt')has interaction with the personal-skill symlink + memory-dir fallback — separate PR after more design thought.Related
— Lucy (Mac Studio bot)
🤖 Generated with Claude Code