File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,28 @@ export default function register(ctx: PluginContext): void {
211211 // fall back to hard-coded default
212212 }
213213
214+ // Auto-fix rules for common incompatible status/stage combos
215+ for ( const f of findings ) {
216+ try {
217+ const ctx = ( f && ( f as any ) . context ) || { } ;
218+ // completed + (in_progress|intake_complete|idea) -> completed + in_review
219+ if ( f . type === 'incompatible-status-stage' && ctx . status === 'completed' && ( ctx . stage === 'in_progress' || ctx . stage === 'intake_complete' || ctx . stage === 'idea' ) ) {
220+ const current = ( f . proposedFix && typeof f . proposedFix === 'object' ) ? ( f . proposedFix as Record < string , unknown > ) : { } ;
221+ ( f as any ) . proposedFix = Object . assign ( { } , current , { stage : 'in_review' } ) ;
222+ ( f as any ) . safe = true ;
223+ }
224+
225+ // deleted + in_progress -> deleted + done
226+ if ( f . type === 'incompatible-status-stage' && ctx . status === 'deleted' && ctx . stage === 'in_progress' ) {
227+ const current = ( f . proposedFix && typeof f . proposedFix === 'object' ) ? ( f . proposedFix as Record < string , unknown > ) : { } ;
228+ ( f as any ) . proposedFix = Object . assign ( { } , current , { stage : 'done' } ) ;
229+ ( f as any ) . safe = true ;
230+ }
231+ } catch ( e ) {
232+ // ignore
233+ }
234+ }
235+
214236 // Normalize certain findings: if an invalid/empty stage can be safely defaulted, mark safe
215237 for ( const f of findings ) {
216238 try {
You can’t perform that action at this time.
0 commit comments