Repository navigation
test(quota-tracker): structural tests for read-quota.py path fix (#1055) - #1158
bassilkhilo-ag2 wants to merge 1 commit into
Conversation
VasiliyRad
left a comment
There was a problem hiding this comment.
Two issues before this can merge:
-
build_log.mddoes not belong here. This is 114 lines of unrelated workspace state (passes 207–214: content posts, cross-node-sync, watch-tasks orphan fix, etc.). Drop the file from the PR. -
src/health-check.pyis a production code change in a test-only PR. The_pid_scripthelper + multi-PID path-enriched warn is a real functional change — it deserves its own PR (or at least accurate title/description). The PR title says "structural tests for read-quota.py path fix" but ships a health-check behavior change undocumented in the description.
Minor: tests/quota-path-fix.test.py line 130 has import re as _re — re is already imported at the top of the file.
The quota-path-fix tests themselves look good — solid regression guard for the four-.parent depth fix.
|
Status update (2026-05-26): The The health-check change ships cleanly in PR #1157 (already APPROVED by @VasiliyRad). The build_log.md chore commits should never have been pushed and will be dropped. A rebase onto upstream main (dropping build_log.md, letting health-check land via #1157) is ready — pending owner go-ahead to force-push. The actual test content here is unchanged and passes against current main. |
…onichi#1055) Verifies the four-.parent fix so _REPO_ROOT / "src" correctly resolves to the repo's src/ dir (where workspace_default.py lives). The old three- .parent path landed on skills/ — causing silent import failure and quota always reading as missing. 13 assertions: parent depth, no cwd fallback, status_read_path call, --json/--gate flags, graceful exit on missing file. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4effb52 to
b41b391
Compare
|
Branch rebased onto origin/main — bundled junk (build_log.md, health-check.py, health-check-bridge-multi-pid.test.py) stripped. Diff is now clean: only the intended test file(s). |
What
Structural tests covering the
_REPO_ROOTpath-depth fix from PR #1055.Background
Before #1055,
read-quota.pyused three.parentcalls to walk from the script's resolved path up to the repo root. Through the~/.claude/skillssymlink the script resolves to<repo>/skills/quota-tracker/scripts/read-quota.py— four levels deep. Three.parentcalls landed on<repo>/skills/, which has nosrc/subdirectory. Thefrom workspace_default import status_read_pathimport silently failed (hit theexcept Exceptionswallow), so quota was always reported as "not found" regardless of whether the credential proxy had written a freshquota-state.json.Tests (13 assertions)
_REPO_ROOTuses exactly four.parentcalls.parentcalls (the old bug) must NOT be the final depth_REPO_ROOTis joined with"src"forsys.path.insertsys.path.insert(0, ...)used (not.append)workspace_defaultimported (status_read_path)status_read_path("quota-state.json")calledPath.cwd()fallback (stale-shadow path removed)skills/quota-trackerPath construct for quota filesys.exit(1)on missing quota fileremaining%--jsonflag exists--gateflag existsRun
🤖 Generated with Claude Code