mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-11 13:24:55 +01:00
fix(native): retain actionable final replies and document links
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
3737f89626
commit
be604fcbf8
15 files changed
+195
-12
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import { isValidNativePrpEnvelope } from "./native-event-envelope.js";
|
||||
import { explainsMissingReleaseAccess, linksSavedNativeDocument, type NativeDocumentLinkContext } from "./native-completion-content.js";
|
||||
|
||||
type Row = Record<string, unknown>;
|
||||
const row = (value: unknown): Row => value && typeof value === "object" && !Array.isArray(value) ? value as Row : {};
|
||||
@@ -14,6 +15,7 @@ export interface NativeCompletionObservation {
|
||||
initial: { issueIds: string[]; agentIds: string[] };
|
||||
workspaceChanged: boolean;
|
||||
marker: string;
|
||||
documentLinkContext?: NativeDocumentLinkContext;
|
||||
}
|
||||
|
||||
/** Observable tool/result/final sequence, not a claim that the provider consumed feedback. */
|
||||
@@ -115,6 +117,10 @@ export function gradeNativeCompletion(input: NativeCompletionObservation) {
|
||||
&& /\b(?:blocked|cannot proceed|can't proceed|missing|required access|not (?:yet )?granted|awaiting|waiting|unavailable)\b/i.test(finalText)
|
||||
&& !/\b(?:not blocked|no longer blocked|access (?:is |has been |was )?already granted|completed Grant deployment access)\b/i.test(finalText),
|
||||
"The final explains the actual unresolved blocker and its owner/action, rather than supplying only a marker.");
|
||||
if (blocked) check("visible-blocker-reason", explainsMissingReleaseAccess(finalText),
|
||||
"The persisted provider final independently explains the missing release/deployment access; a blocked label or unblock action alone is insufficient.");
|
||||
else check("saved-document-final-link", linksSavedNativeDocument(finalText, input.documentLinkContext),
|
||||
"The persisted provider final links this task's one saved, revisioned document at the canonical same-origin anchor.");
|
||||
const same = (a: string[], b: string[]) => a.length === b.length && a.every(id => b.includes(id)) && new Set(a).size === a.length;
|
||||
check("bounded-durable-work", same(input.state.issueIds, [...input.initial.issueIds, String(input.issue.id)])
|
||||
&& same(input.state.agentIds, input.initial.agentIds) && input.state.documentCount === (blocked ? 0 : 1)
|
||||
@@ -130,6 +136,6 @@ export function gradeNativeCompletion(input: NativeCompletionObservation) {
|
||||
check("no-deployment-or-file-work", !input.workspaceChanged && !forbidden,
|
||||
"The fixture workspace is unchanged and no process/file/deployment or extra-work tool is observed.");
|
||||
}
|
||||
return { schema: "paperclip.native-completion-observation.v2", passed: checks.every(value => value.passed), checks,
|
||||
return { schema: "paperclip.native-completion-observation.v3", passed: checks.every(value => value.passed), checks,
|
||||
limitations: ["Exact provider feedback identity/consumption is not measured by the public sequence."] };
|
||||
}
|
||||
Reference in new issue
Block a user