Skip to content

[codex] Add durable project memory system#5

Open
sunilkumarvalmiki wants to merge 1 commit into
mainfrom
sunil/project-memory-system
Open

[codex] Add durable project memory system#5
sunilkumarvalmiki wants to merge 1 commit into
mainfrom
sunil/project-memory-system

Conversation

@sunilkumarvalmiki

Copy link
Copy Markdown
Owner

Summary

  • Add docs/ai-memory/ as the durable project memory system for future Codex sessions.
  • Add compact root AGENTS.md with recurring repo rules and memory-maintenance guidance.
  • Add reusable .agents/skills/project-memory-maintainer/SKILL.md.
  • Add weekly memory maintenance prompt and optional Codex GitHub Action workflow.
  • Add a fresh-thread bootstrap prompt and thread retirement checklist.

Knowledge captured

  • Resource-only project scope and Resource Navigator positioning.
  • Current repo architecture, commands, validation workflow, CI/CD, Codespaces notes, known bugs, open issues, decisions, roadmap, and security rules.
  • Repeated user preferences: resource-only scope, branch cleanliness, automation where useful, no thread retirement without explicit approval.

Validation

pm run check

px --yes awesome-lint README.md

  • python C:\Users\pchin\.codex\skills\.system\skill-creator\scripts\quick_validate.py .agents\skills\project-memory-maintainer
  • git diff --check
  • lightweight secrets scan matched only placeholder names/policy text, not secret values

Retirement status

Do not archive or delete the old long-running thread yet. User review and explicit approval are still required.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3455ffb5a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

prompt-file: .github/codex/prompts/weekly-memory-maintenance.md
sandbox: workspace-write
safety-strategy: drop-sudo
allow-bots: github-actions[bot]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass a boolean to allow-bots

The openai/codex-action input docs define allow-bots as a boolean defaulting to false, and the action's check-write-access parser accepts only boolean-style values; with github-actions[bot] here, any scheduled or manual run fails before Codex starts instead of allowing the bot actor. Use allow-bots: true and, if needed, put bot names in allow-bot-users per the upstream inputs: https://github.com/openai/codex-action#inputs.

Useful? React with 👍 / 👎.

Comment on lines +61 to +64
uses: peter-evans/create-pull-request@v7
with:
token: ${{ github.token }}
commit-message: "docs: refresh project memory"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Limit the PR action to memory files

This runs after the workflow writes codex-weekly-memory-output.md, codex-weekly-memory.diff, and codex-weekly-memory-status.txt into the repository workspace. The create-pull-request action commits all new/modified files when add-paths is omitted, so every successful run can open or update a PR containing transient artifact files instead of just durable memory changes; constrain add-paths to the intended memory paths or remove the artifacts before this step. Upstream documents that default here: https://github.com/peter-evans/create-pull-request#action-inputs.

Useful? React with 👍 / 👎.

Comment on lines +16 to +17
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Scope the OpenAI key to Codex steps

When OPENAI_API_KEY is configured, defining it at job scope makes the key available to every action in this job, including checkout, artifact upload, and the third-party PR action, even though only the secret check and openai/codex-action need it. This widens the exposure surface for a paid API key on every scheduled run; move the secret into the verify step's env and keep passing it only as the Codex action input.

Useful? React with 👍 / 👎.

Comment on lines +20 to +21
uses: actions/checkout@v5
with:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fetch enough history for weekly review

The weekly prompt asks Codex to review the last 7 days of repository changes, but this checkout uses the action default, which fetches only the triggering commit, so git log-based review inside the scheduled run cannot see prior commits from the week. Set an explicit fetch-depth such as 0 or a sufficient bounded depth; the checkout docs call out the single-commit default here: https://github.com/actions/checkout#usage.

Useful? React with 👍 / 👎.

- `#2` high-volume discovery expansion
- `#3` Resource Navigator design and README rewrite
- `#4` Resource Navigator foundation
- Current HEAD is commit `af319df`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not store the pre-memory commit as current HEAD

This new memory commit is 7efc73f..., so future sessions that follow AGENTS.md and read this durable memory first will immediately be told the current HEAD is the pre-memory baseline af319df. That makes the bootstrap state stale from the first use and can send agents auditing or diffing from the wrong commit; mark this as the baseline before the memory-system commit or remove the volatile HEAD fact.

Useful? React with 👍 / 👎.

with:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
prompt-file: .github/codex/prompts/weekly-memory-maintenance.md
sandbox: workspace-write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Provide GitHub metadata to the Codex run

The weekly prompt/skill asks this run to inspect recent PRs and issues, but Codex is launched in workspace-write without any GH_TOKEN or pre-fetched GitHub metadata. The Codex docs state workspace-write keeps network off unless explicitly enabled, and GitHub's CLI docs require GH_TOKEN in Actions, so scheduled runs can only see the checkout and will silently miss current PR/issue state; add a pre-Codex gh pr/issue list step that writes files for Codex, or give the agent a deliberately scoped token/network path. Docs: https://developers.openai.com/codex/agent-approvals-security and https://docs.github.com/actions/using-workflows/using-github-cli-in-workflows.

Useful? React with 👍 / 👎.

5. List unresolved ambiguities as `Needs verification`.
6. Recommend `AGENTS.md` changes only when the guidance is recurring and repo-wide.
7. Avoid making product, content, or architecture changes outside project-memory maintenance unless explicitly asked.
8. Open or update a branch / PR instead of directly changing `main`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Let the PR action own branch creation

In this scheduled workflow, Codex edits the checkout first and the later peter-evans/create-pull-request step is what creates or updates the branch/PR, but this prompt makes branch/PR creation a required task for Codex itself. A compliant run may try to change branches or call GitHub before the PR step, which can fail in the sandbox or leave the workspace in a state the PR action does not expect; rephrase this to say the workflow will open/update the PR after Codex writes the memory changes.

Useful? React with 👍 / 👎.

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