91%

Bug flow shares the engine

Goal

Run bug plans and /fix-next-bug batches on the shared workflow/context/invocation engine. Direct bugs may own roots; nested bugs are child frames; bug close/archive becomes a root finalization intent when folded.

Self-hosting constraint

Run on the new engine. Include bug-flow scenarios in the verified inventory; re-sync current fix-bug runtime first.

Implementation sketch

  • Re-verify /fix-bug phase mechanics against the running code: RCA gate, close-flip, parity/leak-via-shared-technical-mission — emit decisions/11-fixbug-phase-audit.md.
  • Wire bug.json with a fixed reconcile entry over the bug plan/tracker APIs, then reuse work_item.json/section.json/ledger_grind.json with bug-specific gates layered on (rca_proven, close_flip_bug). Tracker/plan state selects the semantic phase; a frame cursor only resumes an unresolved effect.
  • Reuse shared plan-start prep and bug.detour_will_resume mapping; preserve origin frame capability + resume obligations across nested bug detours.
  • Confirm parity/leak (L9/L10) come via the SHARED technical-mission gate (sec 4), NOT a bug-specific path.
  • Use the same ContextSnapshot selectors and Reminder lifecycle; represent bug-specific guidance as mapping data.
  • Use capability push/typed return for plan-to-bug and bug-to-origin transitions; preserve root and origin resume obligations.
  • Implement fix interference as data: classify failure disposition, persist ShelvedReceipt, invoke/reuse tracked blocker or add-bug child, then resume the exact origin and rerun proof. Never use an edited implementation note as control state.
  • On proof/test failure, run known-blocker matching before any LLM call. If judgment remains, dispatch a read-only failure-classifier prompt with mandatory interference reminder and closed disposition output; scripts route its result.
  • Canonicalize raw failure evidence through versioned FailureEvidenceFingerprint before retry/classification limits; use classify_failure, generic invoke with atomic shelve_origin on-push, and resume_shelved_origin as the closed primitives.
  • Restore shelved origin on every fix-child error/cancel/abandon path before recovery; transfer surviving obligations and forbid stranded ShelvedReceipt state.
  • On accepted fix-child return, consume the ShelvedReceipt and clear suspension/ownership before stale-proof invalidation and exact-target resume.
  • Carry origin phase and symbolic target through FailureContext and ShelvedReceipt; never hardcode post-work proof as the resume target for pre-work or dispatch failures.
  • Merge deterministic/LLM/human classification into one normalized FailureContext shape; tracked disposition and untracked add-bug return populate the same blocker_bug_id field.
  • Derive bug-register and bug-fix child capabilities from root authority during generic invocation push; FailureContext carries no authority token.
  • Append DEAD attempt evidence only after active_attempt_regression; blocker/environment/human dispositions do not mutate attempt selection.

Spec references

  • plans/workflow-engine-rework/spec/workflow-state-machines.md sec 9 (bugs are plans + the REQUIRED verification). Research: bug template slugs grounded; fix-bug phase mechanics must be re-verified against the running runtime.

Test strategy / acceptance

Matrix: feature/bug x root/child x active-regression/tracked/untracked/transient blocker x push/return/resume/crash. Pins: every bug entry reconciles from bug-plan/tracker state; unbound frame state rejects; one engine/selector; exact origin resumes; duplicate/cyclic blocker rejects; no prose-selected route.

Work Items

  • Re-verify /fix-bug phase mechanics vs running code; emit decisions/11-fixbug-phase-audit.md
  • bug.json enters through fixed bug-plan/tracker-derived reconcile, then reuses work_item/section/ledger_grind workflows with bug-specific gates layered on
  • Bug-specific gates: rca_proven (RCA-before-fix) + close_flip_bug (open->closed + delivered_to_roadmap)
  • Confirm L9/L10 come via the shared technical-mission gate, not a bug-specific path
  • Prove feature and bug plans use the same reminder catalog, resolver, envelope contract, and persistence lifecycle with bug-specific differences represented only as mapping data
  • Implement the bug-domain adapter for the canonical virtual-batch loop; direct invocation owns a virtual root and nested invocation owns a batch frame
  • Implement the bug-domain adapter for the canonical virtual-batch loop: a directly invoked bug fix (/fix-bug BUG-XX-NNN) owns its own bug-plan-backed root — the bug plan is its domain artifact and remains the sole authoritative workflow state, never root-store-owned; a /fix-next-bug batch invocation (no synthetic plan) owns the virtual-batch root under the mission’s no-domain-artifact exception, and each bug the batch selects becomes a bug-plan-backed batch frame nested under that virtual root, never itself root-store-owned.
  • Map canonical typed batch dispositions to bug-domain dependency, ownership, skip, pause, fixed, and OBE semantics without defining another selector
  • Add accepted_pending_root_close projection so the owning parent resumes, queue reselection excludes the accepted bug, foreign roots see ownership, and tracker/archive finalization remains root-only
  • Batch-finalize accepted bug tracker flips, delivered_to_roadmap propagation, and plan archives under one root write-ahead journal with forward recovery from every partial mutation
  • Implement stable failure fingerprinting and fix-interference routing through classify, generic child invoke with atomic shelve-on-push, folded return, and exact-origin proof resume

Intel dossier — pointer and tier disposition

Dossier: bug-flow-shared-engine--s-0128e846.intel.md (this section’s content/intel/ sidecar)

Read that dossier from line 1 through EOF before acting on this section. This block is a pointer and an audit record, never a substitute: not the BLUF, not a summary, not selected tiers.

Dossier tierTitleLinesDispositionWhere / why
00. Bottom line up front21pending
11. The target, verbatim22pending
22. Terrain — the shipped surface64pending
33. Code-graph recon104pending
3S3S. Defect-class sweep — gates whose blindness reads as a pass111pending
3D3D. Diagnostic / observability surface24pending
3H3H. Hygiene constraints the downstream work inherits27pending
44. Cluster / family — the sibling sections, quoted53pending
55. Conformance audit22pending
66. Plan ownership27pending
77. Prior art — interrogated, and mostly refuted24pending
88. Sentiment12pending
99. Declared coverage gaps38pending
1010. Recon entry points — the ordered read path21pending