Skip to content

feat: classify verification failures before rollback - #107

Merged
Honguan merged 1 commit into
mainfrom
agent/issue-105-verification-rollback
Aug 3, 2026
Merged

feat: classify verification failures before rollback#107
Honguan merged 1 commit into
mainfrom
agent/issue-105-verification-rollback

Conversation

@Honguan

@Honguan Honguan commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a declarative rollback contract separate from verification verdicts
  • classify FAIL_PLAN and FAIL_IMPLEMENTATION before mutable follow-up actions
  • preserve correctable work by default and support exact selective rollback targets
  • require evidence and pre-state capture before rollback
  • block unsafe, stale, unknown, external, dependency, and security-risk recovery until authorized handling is available
  • keep Luna interaction actions bounded, Terra as independent verifier, and Sol as high-risk escalation owner
  • update bilingual documentation, migration coverage, and rollback contract tests

Validation

pm test — 109 passed

pm run check — passed

pm run test:package — passed

Closes #105

@Honguan
Honguan merged commit bd07c2f into main Aug 3, 2026
13 checks passed
@Honguan
Honguan deleted the agent/issue-105-verification-rollback branch August 3, 2026 11:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ada2920d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/manifest.js
Comment on lines +442 to +444
to: "CLASSIFICATION_REQUIRED",
action: "capture-evidence-before-mutation",
description: "a failed verification enters classification before the next mutable action"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate escalation transitions on rollback classification

For every FAIL_PLAN or FAIL_IMPLEMENTATION, this rule requires classification before mutation, but WORKFLOW_ESCALATION_CONTRACT.transitionRules still immediately selects INITIAL_FAIL, SOL_REPLAN_FAIL, or a Terra failure transition and schedules the next corrective action. A host consuming that contract can therefore modify the plan or workspace before evidence capture and before discovering that the policy is selective or mandatory rollback; the existing failure transitions need to be gated on rollback classification and completion/waiver.

Useful? React with 👍 / 👎.

Comment thread lib/manifest.js
${workflowRecoveryContract}
${workflowEscalationContract}
${workflowLunaInteractionContract}
${workflowRollbackContract}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Retain the previous managed templates for migration

Adding this contract changes the exact managed skill template, while the shared role-action-gate change also changes the other four templates, but none of the five templates from the parent commit is present in its corresponding LEGACY_TEMPLATES array. On an existing managed install, router-core.js only updates tracked content when it exactly matches a recognized legacy template, so rerunning install preserves every old file as “not a recognized package template” and existing users never receive this rollback feature.

Useful? React with 👍 / 👎.

Comment thread lib/manifest.js
"rollback_class",
"rollback_policy",
"rollback_status",
"rollback_target_hash",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Persist rollback target identities alongside their hashes

The selective-target rule requires an exact identity and pre-rollback hash for each target, and the sequencing contract says that target identity is persisted atomically, but the task-scoped state contains only this singular hash and no target reference or identity. After a primary switch/resume—or whenever rollback covers multiple files—the host cannot determine which path each saved hash protects, so it cannot safely perform the promised stale-target check; persist target references paired with their hashes.

Useful? React with 👍 / 👎.

Comment thread lib/manifest.js
Object.freeze({ failureClass: "CORRECTABLE", policy: "NONE", safeToContinue: true, description: "preserve valid work and evidence, then continue with an incremental correction" }),
Object.freeze({ failureClass: "SCOPE_VIOLATION", policy: "SELECTIVE", safeToContinue: true, description: "revert only exact unauthorized or unrelated targets after evidence capture" }),
Object.freeze({ failureClass: "WORKSPACE_POLLUTION", policy: "SELECTIVE", safeToContinue: true, description: "remove only known generated artifacts; unknown untracked files are never deleted automatically" }),
Object.freeze({ failureClass: "WORKSPACE_CORRUPTION", policy: "FULL_WORKSPACE", safeToContinue: false, description: "full workspace rollback requires an exact trusted checkpoint and proof that unrelated work is preserved; otherwise BLOCK_AND_ESCALATE" }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Unify the workspace-corruption default policy

When no trusted checkpoint is available, defaultPolicies.WORKSPACE_CORRUPTION says BLOCK_AND_ESCALATE, but this machine-readable classification rule says FULL_WORKSPACE, and the generated skill prompt is built from this latter value. Consequently different contract consumers classify the same corruption differently—one blocks while another enters mandatory full-workspace rollback—so the conditional checkpoint decision needs one unambiguous representation.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: classify verification failures before applying selective or full rollback

1 participant