feat(plugins): add queryable coding session profiles - #1125
Conversation
ed2c7d4 to
af902d1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed2c7d4a10
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af902d1ebd
ℹ️ 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".
af902d1 to
31f0cd2
Compare
Signed-off-by: phernandez <paul@basicmachines.co>
This reverts commit 11e2cd5. Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 31f0cd2f4e
ℹ️ 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".
31f0cd2 to
9c1739b
Compare
Signed-off-by: phernandez <paul@basicmachines.co>
9c1739b to
435d16c
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 435d16c3a6
ℹ️ 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".
|
@codex review |
Signed-off-by: phernandez <paul@basicmachines.co>
25cdb00 to
88fb8e4
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88fb8e4679
ℹ️ 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".
Signed-off-by: phernandez <paul@basicmachines.co>
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
@codex review |
Close the remaining skill-parity gap with the Codex plugin (#1125): - skills/bm-decide — deliberate decision capture with rationale, alternatives, consequences, and affected work, written to the bm-writing standard. Works whether or not the output style's inline capture reflex is enabled; bm-remember and the output style now point to it. - skills/bm-orient — deliberate mid-session orientation: active tasks, open decisions, and recent checkpoints, presented as an evidence-backed summary with permalinks. Coding-session recall stays repository-scoped; an unscoped coding-session query is forbidden, matching the Codex contract. validate_claude_plugin.py requires both skills and pins their contracts. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2bgrGfWiL4izcjj66u9R8 Signed-off-by: phernandez <paul@basicmachines.co>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f551808571
ℹ️ 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".
| - **Checkpoint work.** The `bm-checkpoint` skill and `PreCompact` hook write | ||
| `type: codex_session` notes with the current work cursor. | ||
| general `codex_session` notes or schema-backed `coding_session` notes with | ||
| structured repository and pull-request context. |
There was a problem hiding this comment.
Pin Codex hook shims before advertising coding checkpoints
For Marketplace plugin users, this claim is not true yet: hooks/hooks.json runs hooks/pre_compact.py, whose PEP 723 dependency is still pinned to basic-memory@6e9f2fc...; that ref's hook implementation has no coding_session path and still defaults Codex to codex-sessions. Users who set sessionProfile: "coding" will therefore keep getting legacy codex_session PreCompact notes and non-repository-scoped SessionStart recall until the shim dependency is updated and validated against this merge/release ref.
Useful? React with 👍 / 👎.
| When the current branch has a pull request, also add the typed optional fields | ||
| `pull_request_number`, `pull_request_title`, `pull_request_url`, | ||
| `pull_request_state`, `pull_request_base`, and `pull_request_head`. Resolve the |
There was a problem hiding this comment.
Lowercase PR state in Codex checkpoints
When a Codex deliberate checkpoint follows this section and copies gh pr view --json state, the value is the GitHub enum (OPEN/CLOSED/MERGED) while plugins/codex/schemas/coding-session.md only accepts lowercase [open, closed, merged] and the automatic hook lowercases it. Without the same lowercase instruction, the note gets a schema warning and exact queries such as pull_request_state="open" miss it; Claude's matching skill already calls this out.
Useful? React with 👍 / 👎.
Git emits repo_root with forward slashes on every platform, while the hook event cwd arrives in native form — on Windows that is C:/Users vs C:\Users, so the coding checkpoint's repo_root == cwd identity broke and tests/cli/test_coding_session_context.py failed on the Windows matrix. Main never saw it: the #1125 push run was cancelled by the follow-up merge and the next run skipped the Python matrix (plugins-only change). Store both fields in POSIX form so coding-session path identity is comparable and queryable cross-platform. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A2bgrGfWiL4izcjj66u9R8 Signed-off-by: phernandez <paul@basicmachines.co>
Why
General project work and coding work need different query contracts. A general checkpoint should stay lightweight, while a coding checkpoint must carry enough verified Git and pull-request identity to answer questions such as “which session covered this PR?” without parsing prose.
What Changed
coding_sessionschema with required repository, repo-root, working-directory, branch, and Git SHA fields.codex_sessionand Claudesessionas the general-profile schemas.coding_sessionfor coding profiles in both Codex and Claude.repository, then merge lower-priority legacy/general sessions for continuity.codex-sessionstocodexwhile preserving explicitcaptureFolderoverrides.coding-session.mdbyte-identical and enforce that contract with a package test.Implementation Details
.codex/basic-memory.jsonand Claude'sbasicMemorysettings persistsessionProfileexplicitly. Coding setup requires a user-confirmed stablerepositoryidentifier; automatic checkpoints resolve the remaining required fields through bounded, read-only Git commands. Missing required Git evidence stops the checkpoint before a schema-invalid note is written, while the outer hook boundary still fails open for the host session.Pull-request context comes from a bounded, read-only
gh pr viewcall. The complete typed PR field set is written when a PR exists, with state normalized to the schema's lowercase enum; all PR fields are omitted when no PR exists.SessionStart uses
metadata_filters={"repository": "owner/name"}forcoding_sessionrecall. It never performs an unscoped coding-session query, so a Basic Memory project shared by multiple repositories cannot promote another checkout's branch or PR as the current cursor.Testing
uv run pytest tests/test_codex_plugin_package.py tests/cli/test_coding_session_context.py tests/cli/test_hook_command.py -q— 113 passedjust fast-check— passed; only existing Python 3.14 asyncio deprecation warningsjust package-check— passedjust package-check-claude-code— passedjust package-check-codex— passedRisks / Follow-up
The bundled Codex PEP 723 hook wrappers cannot safely pin themselves to this PR’s source SHA because the repository squash-merges. Per the agreed sequence, this PR lands the core behavior first; an immediate follow-up will update both Codex hook dependency refs to the durable #1125 merge SHA and run the package gates again. Claude’s wrappers intentionally resolve the released
basic-memorypackage, so that automatic path activates with the next package release (or a developmentBM_BINoverride).