Repository navigation
feat(architecture): sweep citations on ADR retirement and offer a pointer comment #16552
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
4 commits
Select commit
Hold shift + click to select a range
137c7f2
feat(architecture): sweep citations on ADR retirement and offer a poi…
kyle-sexton a5bf3ec
test(architecture): keep the record-decision scaffold header comments…
kyle-sexton 5251c7d
test(architecture): fail the reversal eval on a Write to the citing file
kyle-sexton 2203ddc
Merge branch 'main' into feat/record-decision-citation-sweep
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
9 changes: 9 additions & 0 deletions
9
.changes/architecture/feat-record-decision-citation-sweep-4c1e9a72.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,9 @@ | ||
| --- | ||
| bump: minor | ||
| --- | ||
|
|
||
| ### Added | ||
|
|
||
| - `record-decision` Step 3: a citation sweep lists, by `file:line`, every tracked line citing the retired record's identifier or path, and proposes pointing each at the new record or dropping it, applied in the same change behind the same yes. It runs for every `adr_retirement` value and for a partial reversal, where only citations of the reversed part change. | ||
| - `record-decision audit`: each retire candidate lists the lines citing it; the audit stays read-only. | ||
| - `record-decision` Step 4: after a record is written, it offers one pointer comment at the code the decision governs, citing the record in the repository's own form, and writes it only after a yes. |
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
4 changes: 2 additions & 2 deletions
4
plugins/architecture/evals/rd-audit-lists-gone-record/prompt.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 |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| --- | ||
| description: "The audit lists a record whose decided thing no longer exists in the code as a retire candidate, with evidence, and changes nothing" | ||
| description: "The audit lists a record whose decided thing no longer exists in the code as a retire candidate, with evidence and the lines citing it, and changes nothing" | ||
| tags: [architecture, record-decision, outcome, scaffold] | ||
| max_turns: 25 | ||
| timeout_seconds: 600 | ||
| allowed_tools: [Skill, Bash, Read, Glob, Grep, Write, Edit] | ||
| expected_outcome: "The final reply lists ADR 0001 (Redis sessions) as a retire candidate because Redis no longer exists in the code, citing the commit or search that shows it, and does not list ADR 0002 as gone. No Write or Edit call is made and no shell command removes, moves or writes a file." | ||
| expected_outcome: "The final reply lists ADR 0001 (Redis sessions) as a retire candidate because Redis no longer exists in the code, citing the commit or search that shows it, lists `src/session/cookie_store.py:1` as a line citing ADR 0001, and does not list ADR 0002 as gone. No Write or Edit call is made and no shell command removes, moves or writes a file." | ||
| --- | ||
|
|
||
| /architecture:record-decision audit |
18 changes: 18 additions & 0 deletions
18
plugins/architecture/evals/rd-audit-lists-gone-record/samples/lists-citation.json
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,18 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": "**Gone**\n- 0001 Keep sessions in Redis: commit abc1234 removed redis.\n Cited at src/session/cookie_store.py:1: propose drop." | ||
| }, | ||
| { | ||
| "answer": "ADR-1 citations: cookie_store.py:1 (drop on retirement)." | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": "**Gone**\n- 0001 Keep sessions in Redis: commit abc1234 removed redis." | ||
| }, | ||
| { | ||
| "answer": "src/session/cookie_store.py mentions ADR 0001." | ||
| } | ||
| ] | ||
| } |
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
4 changes: 2 additions & 2 deletions
4
plugins/architecture/evals/rd-reversal-asks-before-retiring/prompt.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 |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| --- | ||
| description: "A decision that reverses an existing record gets a new record naming the old one, and the old record is neither deleted, edited nor moved before the person says yes" | ||
| description: "A decision that reverses an existing record gets a new record naming the old one, the line citing the old record is listed with a proposal, and neither the old record nor the citing file changes before the person says yes" | ||
| tags: [architecture, record-decision, outcome, scaffold] | ||
| max_turns: 25 | ||
| timeout_seconds: 600 | ||
| allowed_tools: [Skill, Bash, Read, Glob, Grep, Write, Edit] | ||
| expected_outcome: "The run proposes or writes a new record numbered 0003 that names ADR 0002 and why it was reversed, states the retirement mode (delete by default) and its layer, and ends by asking before retiring 0002. ADR 0002 is not removed, edited or moved." | ||
| expected_outcome: "The run proposes or writes a new record numbered 0003 that names ADR 0002 and why it was reversed, states the retirement mode (delete by default) and its layer, lists `src/api/schema.graphql:1` as a line citing ADR 0002 with a proposal to point it at 0003 or drop it, and ends by asking before retiring 0002. ADR 0002 is not removed, edited or moved, and `src/api/schema.graphql` is not edited." | ||
| --- | ||
|
|
||
| /architecture:record-decision We are reversing ADR 0002: the public API goes back to REST. Context: partners now use three fixed views, and GraphQL query cost made rate limiting unpredictable. We weighed keeping GraphQL with query cost limits and rejected it because partners could not predict their quotas. Consequences: every partner view needs a versioned endpoint, and moving back to GraphQL later means rewriting the partner SDKs. |
33 changes: 33 additions & 0 deletions
33
...s/architecture/evals/rd-reversal-asks-before-retiring/samples/citing-file-not-edited.json
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,33 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Edit", | ||
| "input": { | ||
| "file_path": "docs/adr/0003-serve-the-public-api-over-rest.md", | ||
| "old_string": "a", | ||
| "new_string": "b" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "answer": [] | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Edit", | ||
| "input": { | ||
| "file_path": "src/api/schema.graphql", | ||
| "old_string": "# ADR 0002", | ||
| "new_string": "# ADR 0003" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
31 changes: 31 additions & 0 deletions
31
...hitecture/evals/rd-reversal-asks-before-retiring/samples/citing-file-not-overwritten.json
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,31 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Write", | ||
| "input": { | ||
| "file_path": "docs/adr/0003-serve-the-public-api-over-rest.md", | ||
| "content": "# 3. Serve the public API over REST\n\nReverses ADR 0002.\n" | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| { | ||
| "answer": [] | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": [ | ||
| { | ||
| "tool": "Write", | ||
| "input": { | ||
| "file_path": "src/api/schema.graphql", | ||
| "content": "# ADR 0003\ntype Query {\n order(id: ID!): Order\n}\n" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } |
18 changes: 18 additions & 0 deletions
18
plugins/architecture/evals/rd-reversal-asks-before-retiring/samples/lists-citation.json
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,18 @@ | ||
| { | ||
| "pass": [ | ||
| { | ||
| "answer": "Lines citing ADR 0002:\n- src/api/schema.graphql:1 `# ADR 0002`: point it at ADR 0003.\nDelete docs/adr/0002-serve-the-public-api-over-graphql.md and repoint that line?" | ||
| }, | ||
| { | ||
| "answer": "Citation sweep (git grep for 0002 and the filename): schema.graphql:1, propose drop. Shall I retire 0002?" | ||
| } | ||
| ], | ||
| "fail": [ | ||
| { | ||
| "answer": "adr_retirement: delete (default). Delete docs/adr/0002-serve-the-public-api-over-graphql.md now?" | ||
| }, | ||
| { | ||
| "answer": "The schema in src/api/schema.graphql still mentions ADR 0002; retire it?" | ||
| } | ||
| ] | ||
| } |
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
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.