- Integrate ActionMonitor into ChatGPT GitOps API for failure tracking - Add ErrorClassifier with permission, git, runtime, system, secret violation error types - Add FailureRouter to route errors to correct recovery agents (openclaw/hermes/windows_codex_app) - Add RecoveryController orchestrating full pipeline: capture→classify→route→plan→execute→validate→record - Update error_classifier to include ClientResponseError, rate limit, and secret_violation patterns - All 8 integration tests passing (ActionMonitor, ErrorClassifier, FailureRouter, RecoveryController, API 500 scenario) - Push baseline to V1R2C2 with tag v1r2c2-baseline
2.6 KiB
Codex Fix Patches Artifact Lifecycle Instruction
Instruction ID: fix-patches-artifact-lifecycle-v1 Version: v1 Target Agent: codex
Objective
Manage the lifecycle of artifacts in the patches/ directory — specifically, clean up stale or committed artifacts (.branch.json, nl/*.json, standalone .json patch files) that are no longer needed.
Background
The ChatGPT Actions API writes several types of artifacts into patches/:
- Branch metadata (
patches/patch_*.branch.json) — created when thebranch()action writes ahead. These are summary records of created branches. - Patch files (
patches/*.json, top level) — created when thepatch()action saves a JSON patch proposal. Example:patches/self-evolution-agent-orchestration-policy.json. - Natural language plan files (
patches/nl/nl-*.json) — created whennl()action records a natural-language plan. These are transient planning artifacts.
None of these files represent durable long-term state. Once committed, they are snapshots of ephemeral decisions. The patches/ directory should not grow unboundedly with stale artifacts.
Preconditions
- GitOps authentication healthy.
- Current working branch should not be diverging from main unnecessarily for this cleanup.
- Run from the workspace root.
Steps
Phase 1: Assess Current State
- List all files under
patches/. - For each file, check its git log (
git log --oneline patches/<file>) to understand its purpose and age. - Identify which files are:
- Stale
.branch.jsonfiles describing branches that have already been merged. - Stale
nl/plan files that were experimental, incomplete, or superseded. - Patch files that are still relevant for the current self-evolution state.
- Stale
Phase 2: Clean Up Stale Artifacts
For each stale artifact file:
- Remove it with
git rm. - Create a single commit message describing the batch cleanup, e.g.:
chore(patches): remove stale artifact files [nl/*.json|branch.json]
Phase 3: Housekeeping (Optional)
If the file self-evolution-agent-orchestration-policy.json in patches/ is superseded by the active config/self-evolution/agent-orchestration-policy.json, evaluate whether it should also be removed or kept as reference. Document this decision.
Constraints
- No force push.
- No direct production publish.
- No secret output.
- Preserve audit trail.
- Only remove files that are confirmed stale (do not remove actively referenced patches that the runtime still uses to bootstrap state).
Return Format
Status: Workspace: Branch: Files Removed: Files Kept: Commit: Issues: