feat: require auto-chain action evidence

This commit is contained in:
Eve
2026-04-23 19:34:24 +08:00
parent 242f7ce463
commit 17dd26cde7
3 changed files with 78 additions and 11 deletions

View File

@@ -146,11 +146,18 @@ function buildGateLockInput(wrapperResult: any): Record<string, unknown> {
"bind_externalized_checkpoint_path_or_abort_silent_launch",
].includes(requiredNextAction),
);
const autoChainNextAction = hasConcreteExecutionEvidence ? requiredNextAction : "";
const executionEvidence = hasConcreteExecutionEvidence
? {
concreteNextAction: requiredNextAction,
}
: null;
const autoChainDispatchEvidence = progressEvidence && hasConcreteExecutionEvidence
? {
sessionKey: typeof progressEvidence.sessionKey === "string" ? progressEvidence.sessionKey : "",
concreteNextAction: requiredNextAction,
}
: null;
const claimedProgression = shouldClaimProgression(wrapperResult, progressEvidence)
? "already progressing to the next step in background"
: "";
@@ -170,6 +177,8 @@ function buildGateLockInput(wrapperResult: any): Record<string, unknown> {
nextStep: hasConcreteExecutionEvidence ? requiredNextAction : "",
requiredNextAction: hasConcreteExecutionEvidence ? requiredNextAction : "",
concreteNextAction: hasConcreteExecutionEvidence ? requiredNextAction : "",
autoChainNextAction,
autoChainDispatchEvidence,
progressionClaim: claimedProgression,
claimedProgression: claimedProgression,
statusSummary: claimedProgression,
@@ -274,6 +283,7 @@ function buildGateLockBlock(gateLockResult: GateLockResult | null): string {
"- ENFORCEMENT: Hook input should include progressEvidence (or equivalent concrete fields) whenever a progression claim is present.",
"- ENFORCEMENT: Forbidden path: plain-text handoff that pretends the long task is already continuing without an externalized checkpoint.",
"- ENFORCEMENT: Forbidden path: stating you have already entered the next task/step when the record only contains planning language and no concrete execution evidence.",
"- ENFORCEMENT: If hook input carries autoChainNextAction, it must also carry matching autoChainDispatchEvidence before the gate may pass that auto-chain step.",
];
if (gateLockResult.gateStatus === "fail") {
@@ -282,6 +292,7 @@ function buildGateLockBlock(gateLockResult: GateLockResult | null): string {
lines.push("- HARD_GATE: If a progression claim exists, the hook input must supply progressEvidence (or equivalent concrete fields) before the claim can pass gate.");
lines.push("- HARD_GATE: Do not say you are already on the next task, already dispatched follow-up work, or already progressing in background unless you can point to a sessionKey, runId, modified_files record, verification result, actual tool execution, file changes, emitted messages, or checkpoint records.");
lines.push("- HARD_GATE: If required evidence is missing, ask for/produce the checkpoint or downgrade to a non-silent, evidence-preserving follow-up.");
lines.push("- HARD_GATE: If autoChainNextAction is explicit, you must actually dispatch it and surface autoChainDispatchEvidence; otherwise the gate fails.");
lines.push("- HARD_GATE: If owner decision is involved, do not replace button-path closure with plain-text handoff.");
}