-
Notifications
You must be signed in to change notification settings - Fork 261
feat(plugins): add queryable coding session profiles #1125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
11e2cd5
6b5c73d
435d16c
88fb8e4
f551808
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| title: Coding Session | ||
| type: schema | ||
| entity: CodingSession | ||
| version: 1 | ||
| schema: | ||
| summary?: string, one-paragraph what happened in this coding session | ||
| changed_file?(array): string, files created, edited, deleted, or inspected | ||
| verification?(array): string, checks run and their result | ||
| decision?(array): string, decisions surfaced or created during the session | ||
| blocker?(array): string, unresolved blockers or failed approaches | ||
| next_step?(array): string, explicit cursor for the next coding session | ||
| produced?(array): Entity, notes or artifacts created or updated | ||
| settings: | ||
| validation: warn | ||
| frontmatter: | ||
| project: string, the Basic Memory project this session belongs to | ||
| started: string, when the session began or checkpoint was created | ||
| repository: string, stable repository identifier such as owner/name | ||
| repo_root: string, Git repository root for this checkout | ||
| cwd: string, working directory for the session | ||
| branch: string, checked-out Git branch or HEAD when detached | ||
| git_sha: string, exact Git commit at checkpoint time | ||
| ended?: string, when the session was checkpointed | ||
| status?(enum, lifecycle of the checkpoint): [open, resumed, closed] | ||
| pull_request_number?: string, current pull request number as a queryable identifier | ||
| pull_request_title?: string, current pull request title | ||
| pull_request_url?: string, canonical pull request URL | ||
| pull_request_state?(enum, pull request state at checkpoint time): [open, closed, merged] | ||
| pull_request_base?: string, pull request base branch | ||
| pull_request_head?: string, pull request head branch | ||
| username?: string, operating-system user that created the checkpoint | ||
| hostname?: string, host that created the checkpoint | ||
| claude_session_id?: string, Claude Code session identifier | ||
| codex_session_id?: string, Codex session identifier | ||
| codex_turn_id?: string, Codex turn identifier | ||
| trigger?: string, compaction trigger or deliberate checkpoint source | ||
| model?: string, active model slug when known | ||
| capture?(enum, how this checkpoint was produced): [extractive, deliberate, summarized] | ||
| --- | ||
|
|
||
| # Coding Session | ||
|
|
||
| A **CodingSession** is a resumable engineering checkpoint whose repository | ||
| identity is structured and queryable. Required Git fields make it possible to | ||
| find the exact work cursor without parsing prose. | ||
|
|
||
| Examples: | ||
|
|
||
| `search_notes(note_types=["coding_session"], metadata_filters={"repository": "owner/repo"})` | ||
|
|
||
| `search_notes(note_types=["coding_session"], metadata_filters={"pull_request_number": "123"})` | ||
|
|
||
| Pull-request fields are optional because valid coding work can precede a pull | ||
| request. When a pull request exists, checkpoint writers populate the complete | ||
| pull-request field set. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,8 +14,10 @@ context transition. | |
| Read `.codex/basic-memory.json` if present: | ||
|
|
||
| - `primaryProject`, default omitted | ||
| - `captureFolder`, default `codex-sessions` | ||
| - `captureFolder`, default `codex` | ||
| - `placementConventions`, optional | ||
| - `sessionProfile`, default `general` | ||
| - `repository`, required when `sessionProfile` is `coding` | ||
|
|
||
| Apply the `bm-writing` skill before drafting the note. | ||
|
|
||
|
|
@@ -27,6 +29,9 @@ Gather repo evidence: | |
| - tradeoffs, sharp edges, useful simplifications, and intentionally parked work | ||
| - `git status --short` | ||
| - current branch | ||
| - repository root and current working directory | ||
| - current Git SHA | ||
| - current pull request number, title, URL, state, base, and head when one exists | ||
| - changed files you touched | ||
| - tests or checks actually run | ||
| - failures or skipped checks | ||
|
|
@@ -42,7 +47,7 @@ Do not claim a test passed unless you ran it or the user supplied the result. | |
| A checkpoint is a durable handoff, not a status dump or commit-by-commit | ||
| changelog. Tell the story for a human or agent returning later. | ||
|
|
||
| Write a note to Basic Memory: | ||
| Write a note to Basic Memory. For the `general` profile: | ||
|
|
||
| - `title`: `Codex checkpoint - <short topic>` | ||
| - `directory`: configured `captureFolder` | ||
|
|
@@ -57,6 +62,24 @@ Write a note to Basic Memory: | |
| - `hostname: <current hostname>` | ||
| - `capture: deliberate` | ||
|
|
||
| For the `coding` profile, write `type: coding_session` and use the same common | ||
| frontmatter plus these schema-required fields: | ||
|
|
||
| - `repository: <confirmed stable repository identifier>` | ||
| - `repo_root: <git rev-parse --show-toplevel>` | ||
| - `cwd: <current cwd>` | ||
| - `branch: <git rev-parse --abbrev-ref HEAD>` | ||
| - `git_sha: <git rev-parse HEAD>` | ||
|
|
||
| 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 | ||
|
Comment on lines
+74
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a Codex deliberate checkpoint follows this section and copies Useful? React with 👍 / 👎. |
||
| pull request with a read-only GitHub query; omit those fields when no PR exists. | ||
|
phernandez marked this conversation as resolved.
|
||
| Write the number as a quoted string, for example `pull_request_number: "123"`, | ||
| so exact metadata queries behave consistently across storage backends. | ||
| Never infer or copy repository/PR identity only from conversation text. Stop if | ||
| the required coding fields cannot be proven. | ||
|
|
||
| Begin the body with `# <exact note title>`. | ||
|
|
||
| Use these sections, omitting optional ones that add no value: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Marketplace plugin users, this claim is not true yet:
hooks/hooks.jsonrunshooks/pre_compact.py, whose PEP 723 dependency is still pinned tobasic-memory@6e9f2fc...; that ref's hook implementation has nocoding_sessionpath and still defaults Codex tocodex-sessions. Users who setsessionProfile: "coding"will therefore keep getting legacycodex_sessionPreCompact notes and non-repository-scoped SessionStart recall until the shim dependency is updated and validated against this merge/release ref.Useful? React with 👍 / 👎.