Test/memory workflow#3478
Conversation
Adds a GitHub Actions workflow that stores commit and PR context in Redis as vector embeddings and surfaces related prior discussions back into GitHub via PR comments or workflow step summaries. Triggers on push to non-main branches, pull_request opened, and workflow_dispatch for manual testing. Requires MEMORY_REDIS_URL and OPENAI_API_KEY secrets. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clarified the usage of hashes in representing objects and their field limits.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 6 potential issues.
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.
| const score = parseFloat(doc.value.score ?? '2'); | ||
| return score < SIMILARITY_THRESHOLD && doc.value.repo === context.repo; | ||
| }) | ||
| .slice(0, MAX_RESULTS); |
There was a problem hiding this comment.
Related results include same item
Medium Severity
Vector search runs before the current event is written, but on a workflow re-run or when the same PR or commit was already stored, the index can return that entry as a top match. The filter only checks score and repo, so the PR comment can list the current change as “related prior context” from history.
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.
| body: pr.body || '', | ||
| labels: (pr.labels || []).map(l => l.name), | ||
| changedFiles: [], | ||
| author: pr.user?.login || 'unknown', |
There was a problem hiding this comment.
PR changed files never collected
Medium Severity
For pull_request events, changedFiles is always set to an empty array, so searchText omits paths touched by the PR. Embedding and similarity search for PRs rely on title and body only, which weakens matching when the important signal is which files changed (for example workflow or docs paths).
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.
| const safeRepo = context.repo.replace(/\//g, '_'); | ||
| const itemId = context.prNumber | ||
| ? `${safeRepo}_pr_${context.prNumber}` | ||
| : `${safeRepo}_push_${context.sha?.slice(0, 8)}`; |
There was a problem hiding this comment.
Push memory keys can collide
Low Severity
Non-PR memories use Redis keys derived from only the first eight characters of the commit SHA. Different commits that share that prefix overwrite the same hash and index entry, so one push’s stored memory can silently replace another’s.
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.
|
|
||
| async function postOrUpdatePrComment(repo, prNumber, body, token) { | ||
| const comments = await githubRequest('GET', `/repos/${repo}/issues/${prNumber}/comments`, null, token); | ||
| const existing = comments.find(c => typeof c.body === 'string' && c.body.includes(COMMENT_MARKER)); |
There was a problem hiding this comment.
PR comment lookup not paginated
Medium Severity
Updating the memory comment loads issue comments with a single GET and no pagination. GitHub returns one page (default 30). If the marker comment is not on the first page, the job creates a second memory comment instead of patching the existing one.
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.
| - main | ||
| pull_request: | ||
| types: | ||
| - opened |
There was a problem hiding this comment.
PR memory only on open
Medium Severity
The workflow posts or updates the PR comment only on pull_request opened, while push to the same branch (not main) still runs memory on every commit. The PR comment stays frozen at open while later commits only get a commit status, so the visible PR memory does not reflect subsequent pushes.
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.
| - name: Post result | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: node scripts/memory/post_comment.js |
There was a problem hiding this comment.
Docs CI workflows entirely removed
High Severity
This commit deletes main.yml and the other existing workflows, leaving only repository-memory.yml. After merge, Hugo builds, GCS deploy, sync jobs, and PR automation would no longer run unless those files are restored or replaced.
Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.


Note
High Risk
Deleting main.yml and all sync/deploy workflows would stop docs publishing and automated spec sync if merged; the new workflow also depends on external secrets (Redis, OpenAI).
Overview
This PR replaces the repo’s GitHub Actions surface with a new Redis Repository Memory pipeline and drops the previous automation wholesale.
New behavior:
repository-memory.ymlruns on non-mainpushes, PR open, and manual dispatch. Node scripts underscripts/memory/collect event context, embed it with OpenAI, search/store artifacts in Redis (vector index + hashes), then post a PR comment or commit status / step summary with related historical items.Removed: All prior workflows in the diff, including Hugo build and GCS deploy (
main.yml), PR Jira/staging link comments, staging folder cleanup, and scheduled/manual sync jobs (RC API, regions, Redis/modules/RedisVL docs, k8s API, command pages).Docs: Minor copy edits in
content/develop/data-types/hashes.md(wording only).Reviewed by Cursor Bugbot for commit 63d2ff4. Bugbot is set up for automated code reviews on this repo. Configure here.