forked from farhoodlabs/paperclip
[codex] Add runtime lifecycle recovery and live issue visibility (#4419)
This commit is contained in:
@@ -27,6 +27,7 @@ describe("run liveness classifier", () => {
|
||||
});
|
||||
|
||||
expect(classification.livenessState).toBe("plan_only");
|
||||
expect(classification.actionability).toBe("runnable");
|
||||
expect(classification.nextAction).toContain("inspect the repo");
|
||||
});
|
||||
|
||||
@@ -34,6 +35,7 @@ describe("run liveness classifier", () => {
|
||||
const classification = classifyRunLiveness(baseInput);
|
||||
|
||||
expect(classification.livenessState).toBe("empty_response");
|
||||
expect(classification.actionability).toBe("unknown");
|
||||
});
|
||||
|
||||
it("treats issue comments, documents, products, and actions as progress", () => {
|
||||
@@ -128,5 +130,81 @@ describe("run liveness classifier", () => {
|
||||
});
|
||||
|
||||
expect(classification.livenessState).toBe("blocked");
|
||||
expect(classification.actionability).toBe("blocked_external");
|
||||
});
|
||||
|
||||
it("treats PAP-2000-style validation output as runnable follow-up, not an external blocker", () => {
|
||||
const classification = classifyRunLiveness({
|
||||
...baseInput,
|
||||
resultJson: {
|
||||
summary: "PAP-1949 remains blocked until PAP-2000 is resolved.",
|
||||
},
|
||||
issueCommentBodies: [
|
||||
[
|
||||
"Validation is ready for the next pass.",
|
||||
"",
|
||||
"- Blocked chain context: PAP-1949 -> PAP-1999 -> PAP-2000",
|
||||
"- Next action: run npm test and report the row counts.",
|
||||
].join("\n"),
|
||||
],
|
||||
});
|
||||
|
||||
expect(classification.livenessState).toBe("plan_only");
|
||||
expect(classification.actionability).toBe("runnable");
|
||||
expect(classification.nextAction).toBe("run npm test and report the row counts.");
|
||||
});
|
||||
|
||||
it("prefers durable comments over raw transcript next-action noise", () => {
|
||||
const classification = classifyRunLiveness({
|
||||
...baseInput,
|
||||
issueCommentBodies: ["Next action: run pnpm test -- --runInBand."],
|
||||
stdoutExcerpt: [
|
||||
"tool_call: write",
|
||||
"command: rm -rf production-data",
|
||||
"Next action: deploy to production",
|
||||
].join("\n"),
|
||||
});
|
||||
|
||||
expect(classification.actionability).toBe("runnable");
|
||||
expect(classification.nextAction).toBe("run pnpm test -- --runInBand.");
|
||||
});
|
||||
|
||||
it("keeps approval requests out of automatic continuation", () => {
|
||||
const classification = classifyRunLiveness({
|
||||
...baseInput,
|
||||
resultJson: {
|
||||
summary: "Next action: wait for board approval before continuing.",
|
||||
},
|
||||
});
|
||||
|
||||
expect(classification.livenessState).toBe("blocked");
|
||||
expect(classification.actionability).toBe("approval_required");
|
||||
expect(classification.nextAction).toBe("wait for board approval before continuing.");
|
||||
});
|
||||
|
||||
it("routes production-sensitive next actions to manager review", () => {
|
||||
const classification = classifyRunLiveness({
|
||||
...baseInput,
|
||||
resultJson: {
|
||||
summary: "Next action: deploy to production and verify live traffic.",
|
||||
},
|
||||
});
|
||||
|
||||
expect(classification.livenessState).toBe("needs_followup");
|
||||
expect(classification.actionability).toBe("manager_review");
|
||||
expect(classification.nextAction).toBe("deploy to production and verify live traffic.");
|
||||
});
|
||||
|
||||
it("marks unclear useful output as unknown actionability", () => {
|
||||
const classification = classifyRunLiveness({
|
||||
...baseInput,
|
||||
resultJson: {
|
||||
summary: "Observed mixed output and left notes for a later pass.",
|
||||
},
|
||||
});
|
||||
|
||||
expect(classification.livenessState).toBe("needs_followup");
|
||||
expect(classification.actionability).toBe("unknown");
|
||||
expect(classification.nextAction).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user