Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
b87c855
fix(agent): the incompletion detector keeps its allowances from swall…
gnanam1990 Aug 16, 2026
2843e0d
fix(agent): keep the subjectless stem, and stop blocked-work markers …
gnanam1990 Aug 16, 2026
1bea72d
fix(agent): verb-anchor the objective markers, and stop a tool caveat…
gnanam1990 Aug 16, 2026
f60c930
fix(agent): an absence is a finding only when the object makes it one
gnanam1990 Aug 16, 2026
849bec0
fix(agent): the consequence may be the next sentence, and "blocked" m…
gnanam1990 Aug 16, 2026
9f485c0
fix(agent): an explicit failure state outranks a recognised absence o…
gnanam1990 Aug 16, 2026
3961af4
fix(agent): a failure state inside the negated proposition is not the…
gnanam1990 Aug 17, 2026
eff7f45
fix(agent): recognise a tool caveat in its copula forms
gnanam1990 Aug 17, 2026
63ec0c3
fix(agent): repair two dead marker lists this PR shipped
gnanam1990 Aug 18, 2026
c3d2f7d
fix(agent): only the "any" forms make an observation verb a successfu…
gnanam1990 Aug 19, 2026
81faaac
test(agent): check tail reachability in the direction the runtime uses
gnanam1990 Aug 19, 2026
6f64bf6
fix(agent): a tool named as an excuse does not exempt the failure it …
gnanam1990 Aug 19, 2026
7c3db8a
fix(agent): a tool caveat exempts a failure by position, not by conne…
gnanam1990 Aug 20, 2026
c6745e5
fix(agent): keep tool caveats from hiding admissions
gnanam1990 Aug 28, 2026
533acfc
fix(agent): make completion admission checks clause-aware
gnanam1990 Aug 28, 2026
375c695
fix(agent): scope completion evidence to clauses
gnanam1990 Aug 28, 2026
3c0ef76
fix(agent): scope completion fallback evidence
gnanam1990 Aug 28, 2026
d19d279
fix(agent): tighten capability completion exemptions
gnanam1990 Aug 28, 2026
6f51743
fix(agent): bind fallbacks to completed operations
gnanam1990 Aug 29, 2026
c352882
fix(agent): classify completion claims by obligation
gnanam1990 Aug 29, 2026
373d68b
fix(agent): coordinate blocked completion outcomes
gnanam1990 Aug 30, 2026
dab4f48
fix(agent): preserve completion obligation scope
gnanam1990 Aug 31, 2026
1890d93
fix(agent): reject incomplete completion reports
gnanam1990 Aug 31, 2026
1c94d1b
fix(agent): close completion classifier gaps
gnanam1990 Sep 1, 2026
1dc438b
fix(agent): preserve completion obligation semantics
gnanam1990 Sep 2, 2026
1801a1b
fix(agent): preserve completion claim semantics
gnanam1990 Sep 7, 2026
c4b6be7
fix(agent): classify incomplete consequence structures
gnanam1990 Sep 12, 2026
0aeb177
fix(agent): classify incomplete consequences structurally
gnanam1990 Sep 12, 2026
d63ecf1
fix(agent): preserve completion evidence relationships
gnanam1990 Sep 14, 2026
0da5481
fix(agent): detect collective inability reports
gnanam1990 Sep 14, 2026
598080d
fix(agent): fail closed on incomplete fallback evidence
gnanam1990 Sep 16, 2026
618167b
fix(agent): join prose failure headings
gnanam1990 Sep 16, 2026
d8f306f
fix(agent): close the tool-grant self-certification and stop a neutra…
gnanam1990 Sep 21, 2026
e7b6b09
fix(agent): preserve unresolved operation and fallback outcomes
Nov 13, 2026
f9a3ff0
Merge remote-tracking branch 'origin/main' into fix/pr-912-completion
gnanam1990 Nov 14, 2026
f45ad43
fix(agent): retain counted failures and refuted manual outcomes
gnanam1990 Nov 14, 2026
1c7da24
Merge main memory delivery while preserving completion review fixes
gnanam1990 Nov 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 298 additions & 0 deletions internal/agent/completion_gate_test.go

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions internal/agent/completion_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,105 @@ func TestCompletionPolicyLocalEvidenceDecidesWithoutSemanticCheck(t *testing.T)
}
}

func TestCompletionPolicyClauseLocalAdmissionMatrix(t *testing.T) {
for _, text := range []string{
"I don't have a browser tool available, so I could not inspect the page.",
"No update_plan tool is available, so I wrote the plan manually, but I could not complete the requested analysis.",
"I could not run the migration because no migration tool is available; the error is quoted in this answer.",
"Unable to complete the migration (1): production deployment failed.",
"**Unable to verify (1):** I could not complete the audit; the review is unfinished.",
"I could not find any issues because I ran out of time before inspecting the code.",
"I could not find any issues since I ran out of time before inspecting the code.",
"I could not run the tests because no test tool is available, so I checked the style by hand.",
"I could not run the tests because no test tool is available, so I checked the style by hand, but someone else will need to run the tests.",
"I could not run the tests because no test tool is available, so I checked the style by hand, but the tests remain unverified.",
"**Unable to verify (1):** - I could not complete the audit; the work remains unverified.",
} {
got := newCompletionPolicy(false).evaluate(text, completionContext{})
if got.Decision != CompletionIncomplete {
t.Errorf("incomplete report decided %q: %q", got.Decision, text)
}
}

for _, text := range []string{
"I don't have an update_plan tool available in this specialist context; only read-only exploration tools were provided.",
"I could not record a plan because the update_plan tool isn't available, so I wrote it into this answer instead.",
"I tried the automated route first; I could not run the formatter because no formatter tool is available, so I checked it by hand.",
"**Unable to verify (1):** - MCP #3 claim was truncated.",
"**Unable to verify (1):** - The source omitted MCP #3's full claim.",
"From the source: I could not find any evidence that the issue is unresolved.",
"I could not find any evidence that the issue is unresolved and the fix is still unverified.",
"I could not find any remaining issues; separately, the documentation is outdated.",
} {
got := newCompletionPolicy(false).evaluate(text, completionContext{})
if got.Decision != CompletionComplete {
t.Errorf("complete report decided %q: %q (%s)", got.Decision, text, got.Reason)
}
}
}

func TestCompletionPolicyToolExemptionPolarityAndObligations(t *testing.T) {
for _, text := range []string{
"I could not run a test tool available in my toolset.",
"I could not record a plan while update_plan is available.",
"I could not run tests or deploy a release because no tools are available, so I checked the tests by hand.",
"I could not deploy a release or run tests because no tools are available, so I checked the tests by hand.",
"I could not record a plan because update_plan is unavailable. The task remains incomplete.",
"I could not run the formatter because no formatter tool is available, so I checked it by hand. The output remains unverified.",
} {
got := newCompletionPolicy(false).evaluate(text, completionContext{})
if got.Decision != CompletionIncomplete {
t.Errorf("incomplete capability/fallback report decided %q: %q (%s)", got.Decision, text, got.Reason)
}
}

for _, text := range []string{
"The test tool is available in my toolset, and I ran all tests successfully.",
"I could not record a plan because update_plan is unavailable.",
"I could not run the formatter because no formatter tool is available, so I checked it by hand.",
"I could not run the formatter because no formatter tool is available, so I checked it by hand. Separately, documentation remains unverified.",
} {
got := newCompletionPolicy(false).evaluate(text, completionContext{})
if got.Decision != CompletionComplete {
t.Errorf("completed or unrelated report decided %q: %q (%s)", got.Decision, text, got.Reason)
}
}
}

func TestCompletionPolicyReviewerSemanticPairs(t *testing.T) {
cases := []struct {
text string
want CompletionDecision
}{
{"I could not produce any report.", CompletionIncomplete},
{"I could not produce any crash.", CompletionComplete},
{"I don't have access to the repository with no read tool available.", CompletionIncomplete},
{"I don't have an update_plan tool available in this specialist context; only read-only exploration tools were provided.", CompletionComplete},
{"I could not apply the edit because no write tool is available, so I reported the change manually.", CompletionIncomplete},
{"I could not apply the edit because no write tool is available, so I applied the edit manually instead.", CompletionComplete},
{"I could not run the full test suite because no test tool is available, so I manually tested only a smoke test.", CompletionIncomplete},
{"I could not run the full test suite because no test tool is available, so I manually ran the full test suite instead.", CompletionComplete},
// The same three corrections, through evaluate rather than the gate, so
// neither consumer can drift from the other.
{"No write tool is available, so the fix is complete.", CompletionIncomplete},
{"No write tool is available, so the task is complete.", CompletionIncomplete},
{"I have no browser tool available here, yet the assignment is complete.", CompletionComplete},
{"No write tool is available to me, so the objective was achieved by reading alone.", CompletionComplete},
{"I don't have a shell tool available in this specialist context; only read-only tools were provided.", CompletionComplete},
{"I don't have a browser tool available in this specialist context; only read-only tools were provided.", CompletionComplete},
{"I could not run the formatter because no formatter tool is available, so I checked it by hand.", CompletionComplete},
{"I could not run the formatter because no formatter tool is available, so I checked it by hand. Documentation is outdated.", CompletionComplete},
{"I could not run the formatter because no formatter tool is available, so I checked it by hand. Tests remain unverified.", CompletionIncomplete},
{"I could not run the migration because no migration tool is available, so I ran it manually instead. It crashed.", CompletionIncomplete},
}
for _, tc := range cases {
got := newCompletionPolicy(false).evaluate(tc.text, completionContext{})
if got.Decision != tc.want {
t.Errorf("evaluate(%q) = %q, want %q (%s)", tc.text, got.Decision, tc.want, got.Reason)
}
}
}

func TestCompletionPolicyPreservesBoundedPlanStallProtection(t *testing.T) {
policy := newCompletionPolicy(false)
for attempt := 0; attempt < maxContinueNudges; attempt++ {
Expand Down
Loading
Loading