[FIX] Planner Lifecycle Registry Category Immunity#3884
Merged
Trecek merged 3 commits intoJun 7, 2026
Merged
Conversation
…ubs exemption Introduce LifecycleCategory StrEnum and LIFECYCLE_CATEGORY_DEFAULTS in planner/lifecycle.py with import-time completeness guard, so adding a new lifecycle category cannot silently bypass consumer registries. Refactor record_lifecycle_event and load_lifecycle_registry to derive defaults from the enum — fixes the read-modify-write data-loss bug where archived_stubs (written by reconcile_wp_files) was dropped on the next record_lifecycle_event call. Change record_lifecycle_event key type to LifecycleCategory; update all call sites (manifests, merge, consolidation) and tests. Add archived_stubs exemption to _check_assignment_completeness and _check_dep_references, mirroring existing voided_wps logic. Update SKILL.md defaults literal to include archived_stubs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…changes The lifecycle enum-gated registry commit shifted line numbers in consolidation.py (+4) and manifests.py (+4), causing the JSON write site allowlist ratchet test to fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Trecek
commented
Jun 7, 2026
Trecek
left a comment
Collaborator
Author
There was a problem hiding this comment.
AutoSkillit review passed. No blocking issues found.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The planner lifecycle registry (
lifecycle_registry.json) uses magic string keys with no authoritative type definition. Whenarchived_stubswas added as a new lifecycle category (PR #3801), consumers (validator functions) and the registry read-modify-write loop (record_lifecycle_event) were never updated. The architectural solution introduces aLifecycleCategoryStrEnum as the single source of truth with an import-time completeness assertion — the same pattern used successfully forIssueLabelState/LABEL_LIFECYCLE_REGISTRYin_type_constants_features.py. This makes it structurally impossible to add a lifecycle category without updating the consumer registry.Requirements
REQ-FIX-1: Add
archived_stubsexemption to assignment completeness checkAdd an
archived_stubspair-extraction block to_check_assignment_completenessfollowing the identical pattern used forabsorbed(lines 184–191) andvoided_wps(lines 192–199). Extract(phase_num, assign_num)pairs fromlifecycle_registry["archived_stubs"]keys and add them to an exemption set checked before emitting the error. ~10 line change.REQ-FIX-2: Add
archived_stubsexemption to dep references checkAdd
archived_stubsWP IDs to the exemption set in_check_dep_references(validation.py:223). Currently onlyvoided_wpskeys are exempted. Archived stub WP IDs should also be treated as valid dangling references.REQ-FIX-3: Add
archived_stubsto lifecycle registry defaults and re-read whitelistThree locations need updating in
lifecycle.py:record_lifecycle_eventinitial defaults (lines 21–26): add"archived_stubs": {}record_lifecycle_eventre-read reconstruction (lines 30–35): add"archived_stubs": loaded.get("archived_stubs", {})load_lifecycle_registrydefaults (lines 59–64): add"archived_stubs": {}The re-read reconstruction at lines 30–35 is critical — without it, any subsequent lifecycle event write silently drops existing
archived_stubsdata.REQ-FIX-4: Test coverage
Add tests verifying that:
archived_stubsdo not produceassignment_completenesserrorsarchived_stubsdo not producedep_referenceserrors when referenced independs_onrecord_lifecycle_eventpreservesarchived_stubswhen writing other lifecycle eventsNote: the existing
test_validate_plan_ignores_archived_stubs(test_validation_core.py:252) is vacuous for assignment completeness — it creates no assignment result file for the archived WP's parent assignment, so the check never fires. New tests must include the assignment result file to exercise the actual code path.REQ-FIX-5 (optional): Belt-and-suspenders — record to
voided_assignmentsWhen
reconcile_wp_files()archives ALL WPs for an assignment, additionally record that assignment ID invoided_assignments. Note: this requires a non-trivial addition —reconcile_wp_files()currently has no assignment-level mapping and would need to consultwp_manifest.jsonor assignment result files to determine assignment membership. Consider implementing only if REQ-FIX-1 alone proves insufficient.Closes #3845
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/remediation-20260607-131055-562412/.autoskillit/temp/rectify/rectify_planner-lifecycle-category-immunity_2026-06-07_131500.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Model Usage Breakdown