Repository navigation
feat(codex-operations): add the apply action to codex-changelog #121
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
4fa9023
feat(codex-operations): add the apply action to codex-changelog
kyle-sexton 20b43d1
fix(codex-operations): harden apply_plan inputs and the marker rule
kyle-sexton 0349331
fix(codex-operations): address PR review on apply_plan and the sidecar
kyle-sexton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
plugins/codex-operations/skills/codex-changelog/agents/openai.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| interface: | ||
| display_name: "Codex Changelog" | ||
| short_description: "Report what new Codex releases change in this repo." | ||
| short_description: "Report what new Codex releases change here; apply on request." | ||
| default_prompt: "Use $codex-operations:codex-changelog to report what Codex releases since the last read change in this repository." | ||
| policy: | ||
| allow_implicit_invocation: true |
104 changes: 104 additions & 0 deletions
104
plugins/codex-operations/skills/codex-changelog/references/apply.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| # Apply: rows file, scope gate, hand-off, ledger, and marker | ||
|
|
||
| `apply` acts on the decision rows `diff` saved. `scripts/apply_plan.py` does | ||
| the parts that have one right answer: row checks, row numbering, the scope | ||
| selection, grouping rows by owner, and how far the marker may move. The | ||
| judgment (which rows fit a session, what each edit is) stays with the user and | ||
| the agent. `apply_plan.py --help` lists every flag and output line. | ||
|
|
||
| ## Rows file | ||
|
|
||
| `diff` writes its rows to `rows.json` in its `--out` directory, beside the | ||
| `releases.json` that `fetch --out` wrote. One object per row: | ||
|
|
||
| | Field | Value | | ||
| | --- | --- | | ||
| | `surface` | Repository-relative path of the owner surface | | ||
| | `lens` | `correct`, `replace`, or `adopt` (notes and skips are not rows) | | ||
| | `items` | Item ids, `<version>-<NNN>`, all inside the fetched range | | ||
| | `sentence` | The required sentence from [classification-rubric.md](classification-rubric.md) | | ||
| | `size` | `fits` (default) or `large` | | ||
| | `state` | `pending` (default), `applied`, `declined`, `deferred`, or `filed` | | ||
| | `record` | The PR or issue, or for `declined` and `deferred` the reopen condition | | ||
|
|
||
| The script refuses a row without its sentence, an item id outside the range, | ||
| a path that leaves the repository, and a final state with no record. | ||
|
|
||
| ## Reusing a saved working set | ||
|
|
||
| Reuse `rows.json` only when `diff` wrote it in this session for the same range | ||
| and the repository has not changed since (`git status` and `HEAD` match what | ||
| `diff` saw). Otherwise run `diff` again. Before acting on a reused row, check | ||
| that its owner path exists and still states what the sentence says; re-derive | ||
| a row that fails. | ||
|
|
||
| ## Scope gate | ||
|
|
||
| 1. Run `apply_plan.py plan --from <dir> --select all` and show its numbered | ||
| rows with each row's sentence. | ||
| 2. Ask which rows are in scope: `all`, a lens, row numbers, or ranges, for | ||
| example `correct,4,6-7`. | ||
| 3. Propose a size per in-scope row. A row **fits** when its edits stay in one | ||
| owner and one session can make and verify them. It is **large** when it | ||
| redesigns a component, spans several owners, or cannot be finished and | ||
| verified here. Show the sort and let the user move a row across; write the | ||
| result into `size`. | ||
| 4. Run `plan` again with the user's selection. Its `group:` lines are the | ||
| branches to make, its `file:` line the issues to draft, `done:` the rows | ||
| already final, and `out-of-scope:` the rest. | ||
|
|
||
| A row left out of scope stays `pending` and holds the marker, unless the user | ||
| declines it; then set `declined` with the reopen condition the user gives. | ||
|
|
||
| ## Hand-off | ||
|
|
||
| - **Each `group:` line** is one branch and one pull request in that owner (a | ||
| plugin root, or `.` for the rest of the repository). Before editing, read | ||
| the repository's `AGENTS.md` chain and conventions for branches, commits, | ||
| versions, changelogs, and pull requests, and follow them. Make the edits, run | ||
| the repository's own validation, and commit only the paths the rows name. | ||
| List the branches with their commits, and push and open the pull requests | ||
| with the user's own `git` and `gh` only after the user confirms that batch; | ||
| those are network writes, so they also run under the user's Codex approval | ||
| settings. When | ||
| `gh` is missing or unauthenticated, or the user declines, stop at the local | ||
| branch and report it. Set a row `applied`, with the PR URL, only after its | ||
| pull request merges; until then it stays `pending`. | ||
| - **The `file:` line** covers large rows and every `replace` row. A `replace` | ||
| row is never edited here: whether to retire a component is a separate | ||
| decision. Draft one issue per row with its owner surface, lens, sentence, | ||
| item ids, and range; list the batch; and create the issues with `gh issue | ||
| create` only after the user confirms that batch. Set each created row | ||
| `filed` with the issue URL. A row the user does not confirm is reported and | ||
| stays `pending`. | ||
| - **Docs-lag pairs** are reported, never turned into rows or issues by `apply`. | ||
|
|
||
| ## Ledger and marker | ||
|
|
||
| The ledger (default `docs/upstream/codex-cli.md`) holds the marker line and a | ||
| `## Decisions` table, one row per final decision: | ||
|
|
||
| ```markdown | ||
| | Items | Owner surface | Lens | Outcome | Record | | ||
| | --- | --- | --- | --- | --- | | ||
| ``` | ||
|
|
||
| `apply_plan.py marker --from <dir>` prints a `ledger-row:` line for every row | ||
| in a final state; add the ones not yet in the table. It then prints how far | ||
| the marker may move: to the newest release in range when every row is final, | ||
| otherwise to the release just below the earliest release any open row cites | ||
| (`held-by:`), or `unchanged` when that is not past the current marker. A | ||
| range that starts after the marker without being the default range from it | ||
| (an explicit `--range`) could skip unread releases, so the script prints | ||
| `gap:` and leaves the marker; `fetch` records the default range's start in | ||
| `after.txt` for this check. With | ||
| `--write` it sets the marker line and leaves the rest of the ledger as it was. | ||
| Never edit the marker by hand past what the script prints. | ||
|
|
||
| The ledger update is its own branch and pull request, made last, that names | ||
| the pull requests and issues the run produced. When every row is still open | ||
| the marker does not move, and the ledger change is only the new Decisions rows, | ||
| if any. | ||
|
|
||
| A later `diff` reads the Decisions table: an item id recorded there is a note | ||
| "recorded in the ledger" unless the row's reopen condition is met. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.