Skip to content

fix(sdk): prevent concurrent memory index loss - #2356

Merged
tamirdresher merged 2 commits into
github:devfrom
omercangumus:omercangumus/2334-memory-index-lock
Nov 1, 2026
Merged

tamirdresher merged 2 commits into
github:devfrom
omercangumus:omercangumus/2334-memory-index-lock

Conversation

@omercangumus

Copy link
Copy Markdown
Contributor

Closes #2334\n\nSerializes memory index updates with a local .squad lock, writes each update through a unique temp file, and retries transient Windows rename failures. Index creation is atomic too.\n\nChecks: SDK and CLI builds, npm run lint, memory-provider tests (38 passed), backend lock tests (17 passed). The full Windows test suite hit unrelated environment-dependent failures, including missing jq, and did not complete cleanly.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #2356

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 9
Files added 1
Files modified 8
Files deleted 0
Modules touched 5
Critical files 1

🎯 Risk Factors

  • 9 files changed (6-20 → MEDIUM)
  • 5 modules touched (5-8 → HIGH)
  • Critical files touched: packages/squad-sdk/src/memory/index.ts

📦 Modules Affected

ci-workflows (1 file)
  • .github/workflows/squad-release-verify.yml
root (1 file)
  • .changeset/calm-index-lock.md
scripts (1 file)
  • scripts/release/test-reconciliation.mjs
squad-sdk (3 files)
  • packages/squad-sdk/src/backend/local-backend.ts
  • packages/squad-sdk/src/memory/index.ts
  • packages/squad-sdk/src/storage/fs-storage-provider.ts
tests (3 files)
  • test/cli-packaging-smoke.test.ts
  • test/memory-providers.test.ts
  • test/test-reconciliation.test.ts

⚠️ Critical Files

  • packages/squad-sdk/src/memory/index.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit 01ba70c

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 3 item(s) to address before review

Status Check Details
❌ Single commit 2 commits — consider squashing before review
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present Changeset file found
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved No Copilot review threads
❌ CI passing 16 check(s) still running

Files Changed (9 files, +192 −47)

File +/−
.changeset/calm-index-lock.md +5 −0
.github/workflows/squad-release-verify.yml +1 −1
packages/squad-sdk/src/backend/local-backend.ts +2 −1
packages/squad-sdk/src/memory/index.ts +50 −26
packages/squad-sdk/src/storage/fs-storage-provider.ts +9 −1
scripts/release/test-reconciliation.mjs +7 −0
test/cli-packaging-smoke.test.ts +1 −1
test/memory-providers.test.ts +71 −0
test/test-reconciliation.test.ts +46 −17

Total: +192 −47


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@omercangumus
omercangumus force-pushed the omercangumus/2334-memory-index-lock branch 3 times, most recently from 42c721f to f03a0f8 Compare October 28, 2026 15:10
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Architectural Review

Authoritative evidence: base-controlled pull_request_target reporter.

⚠️ Architectural review: 1 info.

Severity Category Finding Files
ℹ️ info template-sync Template files changed in .github/workflows/ but not in other template locations. If these templates should stay in sync, consider updating the others too. Changed: .github/workflows/, Unchanged: templates/, .squad-templates/, packages/squad-cli/templates/

Automated architectural review — informational only.

@omercangumus
omercangumus marked this pull request as ready for review October 28, 2026 15:24
@omercangumus
omercangumus force-pushed the omercangumus/2334-memory-index-lock branch 2 times, most recently from 83176c2 to 410fdd1 Compare October 28, 2026 15:43
@omercangumus
omercangumus marked this pull request as draft October 28, 2026 15:43
@omercangumus
omercangumus marked this pull request as ready for review October 28, 2026 15:52
Serialize governed-memory index updates with shared .squad locks and unique temp files. Initialize indexes atomically and retry transient Windows rename failures. Give the package smoke test setup enough time on slower CI runners. Closes github#2334.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tamirdresher
tamirdresher merged commit 202f07e into github:dev Nov 1, 2026
24 checks passed
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.

Governed memory index loses entries, or ends up corrupt, when two writers update it at once

2 participants