-
-
Notifications
You must be signed in to change notification settings - Fork 778
fix(issue): auto-mode: artifact verification failures pause with low-actionability diagnostics #6187
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
Open
jeremymcs
wants to merge
7
commits into
main
Choose a base branch
from
issue/5733-auto-mode-artifact-verification-failures-1778892830
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix(issue): auto-mode: artifact verification failures pause with low-actionability diagnostics #6187
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6dad3b5
fix(bug-1): Missing artifact error omits completion-contract guidance
jeremymcs b36c97c
fix(bug-2): Read-only reconnaissance classification misses common tools
jeremymcs 3ee901c
Apply PatchDeck fixes for PR #6187
jeremymcs 37c92c7
Apply PatchDeck fixes for PR #6187
jeremymcs de966c1
📝 CodeRabbit Chat: Implement requested code changes
coderabbitai[bot] 9aa8fec
Merge pull request #6190 from gsd-build/coderabbitai/chat/37c92c7
jeremymcs 3dfb7a4
Apply PatchDeck fixes for PR #6187
jeremymcs 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
32 changes: 32 additions & 0 deletions
32
src/resources/extensions/gsd/tests/auto-post-unit-artifact-diagnostic.test.ts
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,32 @@ | ||
| import test from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
| import { mkdtempSync, mkdirSync } from "node:fs"; | ||
| import { join } from "node:path"; | ||
| import { tmpdir } from "node:os"; | ||
| import { _describeArtifactVerificationFailureForTest } from "../auto-post-unit.ts"; | ||
|
|
||
| test("missing execute-task artifact includes completion contract and completion-tool hint", () => { | ||
| const base = mkdtempSync(join(tmpdir(), "gsd-artifact-diag-")); | ||
| const taskDir = join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks"); | ||
| mkdirSync(taskDir, { recursive: true }); | ||
|
|
||
| const msg = _describeArtifactVerificationFailureForTest("execute-task", "M001/S01/T01", base); | ||
| assert.match(msg, /was not found on disk after unit execution/); | ||
| assert.match(msg, /Task T01 marked \[x\].*summary written/i); | ||
| assert.match(msg, /No completion tool call detected \(`gsd_task_complete`\/alias\)/); | ||
| }); | ||
|
|
||
| test("missing execute-task artifact skips completion-tool hint when completion tool call is present", () => { | ||
| const base = mkdtempSync(join(tmpdir(), "gsd-artifact-diag-")); | ||
| const taskDir = join(base, ".gsd", "milestones", "M001", "slices", "S01", "tasks"); | ||
| mkdirSync(taskDir, { recursive: true }); | ||
|
|
||
| const msg = _describeArtifactVerificationFailureForTest( | ||
| "execute-task", | ||
| "M001/S01/T01", | ||
| base, | ||
| [{ content: [{ type: "toolCall", name: "gsd_task_complete" }] }], | ||
| ); | ||
| assert.match(msg, /was not found on disk after unit execution/); | ||
| assert.doesNotMatch(msg, /No completion tool call detected \(`gsd_task_complete`\/alias\)/); | ||
| }); |
48 changes: 48 additions & 0 deletions
48
src/resources/extensions/gsd/tests/session-forensics-readonly-classification.test.ts
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,48 @@ | ||
| import test from "node:test"; | ||
| import assert from "node:assert/strict"; | ||
| import { classifyTraceProgress, type ExecutionTrace } from "../session-forensics.ts"; | ||
|
|
||
| function traceWithToolCalls(toolCalls: ExecutionTrace["toolCalls"]): ExecutionTrace { | ||
| return { | ||
| toolCalls, | ||
| filesWritten: [], | ||
| filesRead: [], | ||
| commandsRun: [], | ||
| errors: [], | ||
| lastReasoning: "", | ||
| toolCallCount: toolCalls.length, | ||
| }; | ||
| } | ||
|
|
||
| test("classifyTraceProgress treats skill + read-only gsd_exec as reconnaissance-only", () => { | ||
| const trace = traceWithToolCalls([ | ||
| { name: "skill", input: { name: "diagnose" }, isError: false }, | ||
| { name: "gsd_exec", input: { command: "rg -n TODO src" }, isError: false }, | ||
| ]); | ||
| const result = classifyTraceProgress(trace); | ||
| assert.equal(result.isReadOnlyReconnaissanceOnly, true); | ||
| }); | ||
|
|
||
| test("classifyTraceProgress rejects mutating gsd_exec command", () => { | ||
| const trace = traceWithToolCalls([ | ||
| { name: "gsd_exec", input: { command: "npm run build" }, isError: false }, | ||
| ]); | ||
| const result = classifyTraceProgress(trace); | ||
| assert.equal(result.isReadOnlyReconnaissanceOnly, false); | ||
| }); | ||
|
|
||
| test("classifyTraceProgress rejects shell-chained gsd_exec command", () => { | ||
| const trace = traceWithToolCalls([ | ||
| { name: "gsd_exec", input: { command: "cat file && echo x > y" }, isError: false }, | ||
| ]); | ||
| const result = classifyTraceProgress(trace); | ||
| assert.equal(result.isReadOnlyReconnaissanceOnly, false); | ||
| }); | ||
|
|
||
| test("classifyTraceProgress rejects script-eval gsd_exec command", () => { | ||
| const trace = traceWithToolCalls([ | ||
| { name: "gsd_exec", input: { command: "python -c \"import pathlib; pathlib.Path('x').write_text('y')\"" }, isError: false }, | ||
| ]); | ||
| const result = classifyTraceProgress(trace); | ||
| assert.equal(result.isReadOnlyReconnaissanceOnly, false); | ||
| }); | ||
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.