Skip to content

test(sync-memory): 11 behavioral tests for SUTANDO_MEMORY_DIR override (#1079 companion) - #1194

Closed
bassilkhilo-ag2 wants to merge 1 commit into
sonichi:mainfrom
bassilkhilo-ag2:test/sync-memory-memory-dir-1079
Closed

bassilkhilo-ag2 wants to merge 1 commit into
sonichi:mainfrom
bassilkhilo-ag2:test/sync-memory-memory-dir-1079

Conversation

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator

Summary

Companion test PR for #1079 (sync-memory: honor explicit SUTANDO_MEMORY_DIR override).

The existing tests/sync-memory-migration.test.sh covers only the legacy-path migration block. It does NOT test the new three-branch MEMORY_DIR resolution that #1079 adds. This PR fills that gap.

What's tested (11 tests)

Source-inspection (3) — verify structural properties:

  • SUTANDO_MEMORY_DIR override block is present in sync-memory.sh
  • SUTANDO_PRIVATE_DIR deprecation path is present
  • Tilde expansion uses safe ${VAR/#\~/$HOME} form (not eval)

Behavioral (8) — run the block in a subshell, assert MEMORY_DIR value:

  • Absolute SUTANDO_MEMORY_DIR is honored
  • Tilde-prefixed SUTANDO_MEMORY_DIR=~/foo expands to $HOME/foo
  • Unset SUTANDO_MEMORY_DIR falls back to SCRIPT_PARENT heuristic (unchanged behavior)
  • Empty string SUTANDO_MEMORY_DIR="" also falls back (same as unset)
  • SUTANDO_PRIVATE_DIR compat path resolves MEMORY_DIR correctly
  • SUTANDO_PRIVATE_DIR emits deprecation warning to stderr
  • SUTANDO_MEMORY_DIR takes precedence over SUTANDO_PRIVATE_DIR when both set
  • Multi-checkout scenario (the actual bug): override wins over wrong SCRIPT_PARENT path

Result on current main

1/11 pass — only the fallback-heuristic behavioral test passes, because that path was always there. All others fail with "(override block not yet merged — PR #1079)". This is expected and correct.

Result after #1079 merges

11/11 pass (verified via SYNC_MEMORY_SCRIPT env-override pointing at the PR branch's script).

Merge order

Merge #1079 first, then this.

🤖 Generated with Claude Code

@VasiliyRad VasiliyRad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The diff does not match the PR description at all.

Title/description claim: 11 behavioral tests for sync-memory SUTANDO_MEMORY_DIR override.
Actual files changed:

  • build_log.md — 114 lines of workspace state (unrelated, should not be committed)
  • src/health-check.py — multi-pid source-path enrichment (different feature entirely)
  • tests/health-check-bridge-multi-pid.test.py — 5 structural tests for the health-check change

There are zero sync-memory test files in this PR.

Two issues:

  1. Wrong content: The code and tests are for a health-check improvement, not sync-memory. Either the branch or the PR description is wrong — the title needs to match what's actually in the diff.
  2. build_log.md bundled again: This is workspace runtime state and should not be committed to the repo. Remove it before merging.

The health-check change itself looks reasonable (showing script paths per PID in multi-process warnings is a real usability improvement, and the 5 tests verify the structural properties correctly). But it needs its own correctly-titled PR without the build_log.md.

@VasiliyRad VasiliyRad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Mislabeled PR — content does not match title.

Title says test(sync-memory): 11 behavioral tests for SUTANDO_MEMORY_DIR override (#1079 companion). The actual diff contains:

  • build_log.md (+114 lines, new file) — bassilkhilo pass-207 log dump
  • src/health-check.py (+14/-2) — multi-PID source-path warn (same change as #1196)
  • tests/health-check-bridge-multi-pid.test.py (+88) — same test file as #1196

Zero sync-memory tests in this PR. Either the branch is rebased over the wrong base, or the title points at a different PR than the one that actually ships those 11 tests.

Please:

  1. Confirm what this PR is actually supposed to land
  2. If the title is accurate, force-push the real sync-memory tests onto this branch
  3. If the title is wrong, rename and the dup changes vs #1196 still need to be resolved (#1196 also has these exact files)

Requesting changes — the PR as-is would land the same conflict-prone bundle as #1196 under a different name.

sonichi#1079 companion)

Pin the structural and behavioral properties of the three-branch MEMORY_DIR
resolution added in PR sonichi#1079 so a future refactor can't silently regress
the multi-checkout fix.

Tests (11 total, 1 pass on main / 11 pass after sonichi#1079 merges):

Source-inspection (3):
- SUTANDO_MEMORY_DIR override block present
- SUTANDO_PRIVATE_DIR deprecation path present
- safe tilde expansion form used (${VAR/#\~/$HOME}, not eval)

Behavioral (8):
- absolute SUTANDO_MEMORY_DIR honored
- tilde-prefixed SUTANDO_MEMORY_DIR expanded to $HOME
- unset SUTANDO_MEMORY_DIR falls back to SCRIPT_PARENT heuristic
- empty string also falls back ([ -n "" ] is false)
- SUTANDO_PRIVATE_DIR compat path resolves MEMORY_DIR
- SUTANDO_PRIVATE_DIR emits deprecation warning to stderr
- SUTANDO_MEMORY_DIR beats SUTANDO_PRIVATE_DIR when both set
- multi-checkout scenario: override wins over wrong SCRIPT_PARENT

Approach: awk-extract the MEMORY_DIR resolution block + run in a subshell
with a fake SCRIPT_PARENT, mirror of tests/sync-memory-migration.test.sh.
SYNC_MEMORY_SCRIPT env var lets test suites point at a non-default script.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@bassilkhilo-ag2
bassilkhilo-ag2 force-pushed the test/sync-memory-memory-dir-1079 branch from 9dcac3b to 67d7845 Compare May 27, 2026 00:59
@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

Fixed: rebased onto origin/main and cherry-picked the sync-memory test commit (67d7845). Branch now has exactly 1 commit — the intended 11 behavioral tests for scripts/sync-memory.sh. The stray health-check and build-log commits have been dropped.

@bassilkhilo-ag2

Copy link
Copy Markdown
Collaborator Author

The branch has been cleaned up since your review. Current diff is a single commit touching only tests/sync-memory-memory-dir.test.sh — the 284-line test file for SUTANDO_MEMORY_DIR resolution. The build_log.md, src/health-check.py, and health-check test file that appeared in the earlier diff were accidentally included in a prior push and have since been rebased out.

$ git log fork/test/sync-memory-memory-dir-1079 --not origin/main --oneline
67d7845 test(sync-memory): 11 behavioral tests for SUTANDO_MEMORY_DIR override (#1079 companion)

Could you take another look at the current state? The content now matches the title. Re-requesting review.

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