Skip to content

Test/memory workflow#3478

Closed
mich-elle-luna wants to merge 11 commits into
redis:mainfrom
mich-elle-luna:test/memory-workflow
Closed

Test/memory workflow#3478
mich-elle-luna wants to merge 11 commits into
redis:mainfrom
mich-elle-luna:test/memory-workflow

Conversation

@mich-elle-luna

@mich-elle-luna mich-elle-luna commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

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.yml runs on non-main pushes, PR open, and manual dispatch. Node scripts under scripts/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.

mich-elle-luna and others added 11 commits June 10, 2026 08:15
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.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 6 potential issues.

Fix All in Cursor

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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).

Fix in Cursor Fix in Web

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)}`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.

- main
pull_request:
types:
- opened

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 63d2ff4. Configure here.

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.

1 participant