Wip/stabilize 0.12 flext infra 20260919

Merged
MA
3mo ago
+950-151

Summary by cubic

Brings the worktree facts primitive and codegen lifecycle rollback fixes into the 0.12 stabilization line. Worktree facts are discovered directly from .git/worktrees without a Git subprocess, and conform now rolls back bootstrap state when generation raises, not just when it returns a failure. Renames FlextInfraConfigModels to FlextInfraConfigModelsBase in the model exports; update imports to the new name.

Worktree facts

  • Lists registered worktrees from .git/worktrees, classifies them by policy as sibling or tool-internal, and measures total and deps bytes plus staleness within file and time bounds.
  • Stale worktrees are marked retire_candidate and get one plan-only contents-remove action per real deps directory; symlinked deps are skipped.

Codegen lifecycle

  • Bootstrap rollback now runs on both failure and exception paths, and only removes state this invocation created.
  • Source-race replanning and post-begin publishing are extracted into _execute_managed_locked_cycles and _publish_managed_locked.
  • Adds lifecycle tests for changed, replaced, and mixed journal states, CAS races, lazy-init, and docs failures.