mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 18:07:00 +01:00
fix(evals): make Pi file task shell limit explicit
State the existing single-Bash oracle in the task prompt and use the supplied post-edit registration metadata. Preserve the grader, original failed attempts and free fault-calibration limits. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
b224e43382
commit
120eb7f01e
5 files changed
+72
-9
No files matched your search
@@ -337,11 +337,15 @@ identities still fail.
|
||||
### Pi file editing and registered artifacts
|
||||
|
||||
Pi's `extended-harnesses/file-edit-validate` seeds exact bytes before startup and
|
||||
requires one native edit lifecycle followed by a successful native bash execution
|
||||
with the exact nonce-bound byte-validation command as its projected title and a
|
||||
validation marker. A marker-only echo cannot pass. Independent final bytes must
|
||||
match the fixture. The
|
||||
real `register_deliverable` receipt, attachment metadata, publication activity,
|
||||
requires one native edit lifecycle followed by exactly one successful native
|
||||
bash execution with the exact nonce-bound byte-validation command as its
|
||||
projected title and a validation marker. A marker-only echo cannot pass. Final bytes must
|
||||
match the fixture. The Pi task prompt explicitly forbids additional shell calls,
|
||||
including metadata commands, and supplies the expected post-edit byte size and
|
||||
hash for registration. Extra Bash calls fail the unchanged oracle even when the
|
||||
edited file and downloadable artifact are correct. Extended definitions 3 retain
|
||||
older attempts under their original definitions and grades. The real
|
||||
`register_deliverable` receipt, attachment metadata, publication activity,
|
||||
visible task attachment and authenticated public download must all agree on the
|
||||
file's bytes, hash, company, issue, agent and originating run. A file on disk or a
|
||||
model completion claim cannot substitute for publication. Daytona additionally
|
||||
|
||||
@@ -1162,7 +1162,7 @@ export const runnerSuites: readonly RunnerSuiteFixture[] = [
|
||||
groups: ["native"], profiles: extendedHarnessProfiles, environments: runnerEnvironments,
|
||||
tasks: [...openRouterBreadthTasks, localIntegrityTasks[1]!, extendedHarnessFileTask],
|
||||
expectedMatrixSize: 30,
|
||||
definitionMetadata: { version: 2, qualification: "pending", scheduling: "explicit-only", admission: "host-exact-candidate-and-model", authenticatedDiscoveryDate: "2026-09-28", piFileEvidence: "seed-edit-execute-public-download-v1" },
|
||||
definitionMetadata: { version: 3, qualification: "pending", scheduling: "explicit-only", admission: "host-exact-candidate-and-model", authenticatedDiscoveryDate: "2026-09-28", piFileEvidence: "seed-edit-single-execute-public-download-v2" },
|
||||
},
|
||||
{
|
||||
id: "instruction-persistence", label: "Instruction Persistence",
|
||||
|
||||
@@ -85,6 +85,23 @@ describe("Pi edit, validation and public artifact oracle", () => {
|
||||
expect(fixture().events.slice(3).every(e => e.payload.prpEvent.payload.name === "bash")).toBe(true);
|
||||
expect(result.verification.nativeFileAttribution).toBe("workspace_relative_display_target");
|
||||
});
|
||||
it.each(["before", "after"])("rejects an extra metadata bash call %s validation despite correct file and download bytes", placement => {
|
||||
const f = fixture();
|
||||
const metadata = structuredClone(f.events.slice(3));
|
||||
for (const row of metadata) row.payload.prpEvent.payload.executionId = "metadata";
|
||||
metadata[1]!.payload.prpEvent.payload.progress = "wc -c extended-fixture.txt (in_progress): wc -c extended-fixture.txt";
|
||||
metadata[2]!.payload.prpEvent.payload.output = JSON.stringify({
|
||||
content: [{ type: "text", text: "17 extended-fixture.txt\n" }],
|
||||
structuredContent: { output: "17 extended-fixture.txt\n", truncated: false, exit_code: 0 },
|
||||
});
|
||||
if (placement === "before") f.events.splice(3, 0, ...metadata);
|
||||
else f.events.push(...metadata);
|
||||
for (const [index, row] of f.events.entries()) {
|
||||
row.seq = row.sourceSeq = row.payload.prpEvent.sourceSeq = index + 1;
|
||||
row.sourceEventId = row.payload.prpEvent.sourceEventId = `runner:run:${index + 1}`;
|
||||
}
|
||||
expect(() => gradePiFileEvidence(f)).toThrow("one observed provider validation execution");
|
||||
});
|
||||
const mutations: Array<[string, (f: ReturnType<typeof fixture>) => void]> = [
|
||||
["absent seed", f => { f.seed = {} as any; }],
|
||||
["wrong final bytes", f => { f.workspaceBytes = Buffer.from("wrong\n"); }],
|
||||
|
||||
@@ -21,8 +21,8 @@ export function piFilePrompt(nonce: string) {
|
||||
const c = piFileContract(nonce);
|
||||
return [
|
||||
`The fixture has already created ${c.filename} in your execution workspace with exactly ${JSON.stringify(c.before)}. Read it, then use your native edit tool once to replace those bytes with exactly ${JSON.stringify(c.after)}. Do not substitute write, bash, or an API for the edit.`,
|
||||
`Run this exact native bash command, without an added shell prefix or suffix:\n${c.validationCommand}\nIt independently reads the file, fails on incorrect bytes, and prints the validation marker only after success.`,
|
||||
`Deliver the edited text file as a downloadable attachment using the assigned register_deliverable semantic tool, with filename and workspace-relative contentRef ${c.filename}, contentType text/plain, byteSize ${c.byteSize}, sha256 ${c.sha256}, title Verified text, and a fresh idempotencyKey. Wait for the real registration receipt. Do not upload a different file or claim publication from a disk path.`,
|
||||
`Run this exact native bash command exactly once, without an added shell prefix or suffix:\n${c.validationCommand}\nIt independently reads the file, fails on incorrect bytes, and prints the validation marker only after success. This is the only bash call allowed for this task; do not run any other shell commands.`,
|
||||
`Deliver the edited text file as a downloadable attachment using the assigned register_deliverable semantic tool, with filename and workspace-relative contentRef ${c.filename}, contentType text/plain, byteSize ${c.byteSize}, sha256 ${c.sha256}, title Verified text, and a fresh idempotencyKey. Use the supplied byteSize and sha256 for the exact validated post-edit bytes; do not run extra commands to obtain metadata. Wait for the real registration receipt. Do not upload a different file or claim publication from a disk path.`,
|
||||
`After successful validation and registration, call paperclip_finish with reportedWorkDisposition done, summary EXTENDED-FILE-${nonce}, the current completion contract revision and satisfied objective criterion, no remaining work, the actual validation command/result, and the registered artifact reference.`,
|
||||
`Wait for paperclip_finish to succeed, then emit exactly EXTENDED-FILE-${nonce} as your final response. Do not create unrelated files or work.`,
|
||||
].join("\n");
|
||||
|
||||
Reference in new issue
Block a user