Skip to content

Netherframe Roadmap

This page retains implementation plans and dated measurements, including older descriptions of runtime gaps. For current user-facing behavior, use hybrid semantics, release notes and the compatibility policy. The full-release assessment is a historical snapshot.

This document consolidates the current implementation plans into a single, actionable roadmap. It is based on the internal plans in:

  • docs/contributing/internals/historical/phases/PHASE_IMPLEMENTATION_PLAN.md
  • docs/contributing/internals/INTEGRATION_PLAN_ENHANCED_ORCHESTRATOR.md
  • docs/contributing/internals/historical/S3_BACKEND_UNIFICATION_PLAN.md
  • docs/contributing/internals/implementation/SYNTHESIS_OPTIMIZATION_PLAN.md
  • docs/contributing/internals/analyses/dead_code_report.md

Related strategic RFCs:

Priority Track: Hybrid Runtime Correctness and Parity

The current hybrid runtime is fast for two different reasons:

  1. It avoids Terraform Core's full graph/config/runtime engine and talks to providers directly.
  2. It currently skips some behaviors that Terraform treats as correctness or operator-safety features.

This section is the implementation plan to preserve the legitimate performance advantages while closing the most important semantic gaps.

Goals

  • Keep direct provider RPC execution as the performance foundation
  • Restore the most important Terraform-equivalent safety checks in hybrid mode
  • Make plan and apply behavior reproducible and easier to reason about
  • Define which Terraform semantics hybrid mode fully supports, partially supports, or intentionally does not support
  • Add benchmarks so parity work can be measured against the current fast path

Non-Goals

  • Re-implement Terraform Core wholesale inside Netherframe
  • Match every Terraform edge case before shipping improvements
  • Introduce a second large execution engine fork inside nf.core

Current Gaps To Close

  1. Plan-time refresh and drift detection are implemented as helper code but are not part of the active hybrid plan() path.
  2. Apply re-builds plans at execution time instead of applying an immutable plan artifact.
  3. Lifecycle semantics such as prevent_destroy, create_before_destroy, and replace_triggered_by are not enforced in the active hybrid path.
  4. Native runtime checks and provisioner behavior are not executed with Terraform-like semantics in hybrid mode.
  5. Provider/state compatibility handling exists at the protocol layer but is not wired into the active planning and apply flow.
  6. Hybrid semantics are not documented clearly enough for users to know what is guaranteed today.

Design Principles

  • Prefer explicit capability modeling over implicit partial support
  • Keep planning and apply data structures serializable and inspectable
  • Preserve the current provider protocol client split and orchestrator model
  • Add correctness features in layers so performance regressions can be isolated
  • Fail closed when a requested feature is not yet supported in hybrid mode
  • Make parity improvements the default hybrid behavior rather than shipping a long-lived opt-in matrix of environment flags

Implementation Phases

Phase 0: Baseline and Safety Rails

Objective: establish the current behavior precisely before changing it.

  • [x] Add a docs/advanced/hybrid-execution/SEMANTICS.md matrix that lists:
  • supported
  • partially supported
  • unsupported
  • planned
  • [x] Add benchmark fixtures for representative hybrid workloads:
  • create-only
  • update-only
  • no-op plan
  • drifted remote state
  • replacement-heavy workloads
  • [x] Record baseline timings for current hybrid plan/apply on at least:
  • 100 resources
  • 1k resources
  • one FakeCloud-backed AWS scenario
  • Current recorded baselines on 2026-04-13:
    • harness-local hybrid-plan-create, 100 resources: 0.0907s total, 0.907 ms/resource
    • harness-local hybrid-apply-replace, 100 resources: 0.0960s total, 0.960 ms/resource
    • harness-local hybrid-plan-create, 1000 resources: 2.4236s total, 2.424 ms/resource
    • harness-local hybrid-apply-replace, 1000 resources: 2.2326s total, 2.233 ms/resource
    • FakeCloud-backed six-resource Terraform-vs-hybrid scenario: 11.2s hybrid average versus 30.6s Terraform average across 3 runs
  • [x] Define the rollout rule for parity work:
  • new parity behavior ships enabled by default in hybrid mode
  • unsupported features fail explicitly rather than being silently ignored
  • temporary internal escape hatches, if any are needed during development, are not treated as public compatibility contracts
  • [x] Add plan/apply trace logging that reports which parity features were active for a run
  • [x] ~~Break Phase 0 and Phase 1 into implementation tickets with owners, benchmark requirements, and acceptance tests~~ (obsolete: both phases are implemented)

Acceptance criteria:

  • A benchmark command exists and is repeatable in CI/local development
  • Hybrid mode emits enough diagnostics to explain which safety features were active
  • The docs state current limitations unambiguously
  • The roadmap does not depend on a public env-var gate per parity feature

Phase 1: Refresh and Drift Become Part of Plan

Objective: make hybrid plan() reflect reality rather than only saved state.

  • [x] Refactor HybridExecutionMode.plan() to load current state, refresh managed resources, and diff against the refreshed state before generating the plan summary
  • [x] Reuse the existing _refresh_resources() implementation instead of keeping it detached from the active path
  • [x] Persist refreshed state separately from desired-state planning inputs so drift can be reported without mutating durable state prematurely
  • [x] Extend plan output to distinguish:
  • config-driven changes
  • drift-only changes
  • refresh failures
  • refresh timeouts / unknown state
  • [x] Decide and document refresh failure policy:
  • default policy is permissive planning with explicit refresh diagnostics
  • resources with unknown refreshed state block auto-approved apply
  • interactive apply requires explicit operator approval when refresh was incomplete
  • [x] Add provider capability handling where refresh is unsupported or semantically restricted

Acceptance criteria:

  • Hybrid plan() reports drift for out-of-band changes
  • No-op plans remain no-op only when refreshed remote state matches saved state
  • Refresh timeout/error behavior is deterministic and covered by tests

Phase 2: Immutable Plan Artifacts

Objective: remove the current time-of-check/time-of-use gap.

  • [x] Introduce a serializable hybrid plan artifact type under nf.core containing at minimum:
  • plan id
  • generation timestamp
  • current/refreshed prior state snapshot
  • desired state snapshot
  • per-resource planned actions
  • replacement requirements
  • lifecycle/conditions/provisioner decisions
  • provider versions and configuration fingerprints
  • runtime feature flags used during planning
  • [x] Change HybridExecutionMode.apply() to consume a previously generated hybrid plan artifact instead of silently rebuilding plans
  • [x] If apply() is called without an explicit plan, make it:
  • create a plan artifact
  • present it
  • then apply that same artifact
  • [x] Reject apply if provider versions/config fingerprints no longer match the plan, unless an explicit override mode is chosen
  • [x] Add CLI support for:
  • saving a hybrid plan
  • inspecting a hybrid plan
  • applying a saved hybrid plan

Acceptance criteria:

  • Plan and apply operate on the same serialized resource actions
  • nf plan followed by nf apply does not rebuild the logical plan silently
  • Plan invalidation reasons are surfaced clearly

Phase 3: Lifecycle Semantics

Objective: close the highest-value Terraform lifecycle gaps without copying all of Terraform Core.

  • [x] Enforce prevent_destroy during hybrid planning and again at apply
  • [x] Carry requires_replace explicitly into execution node metadata during planning, instead of discovering it only inside apply
  • [x] Implement hybrid handling for replace_triggered_by using the existing dependency analyzer and state diff information
  • [x] Design a hybrid-safe policy for create_before_destroy:
  • current default policy is fail-closed for hybrid replacements
  • future support requires explicit dependency- and provider-safety analysis
  • [x] Support ignore_changes in hybrid mode as Terraform does: ignored paths take their prior-state values in the configuration before the provider plans
  • [x] Add lifecycle parity tests for:
  • delete blocked by prevent_destroy
  • replacement forced by trigger changes
  • unsupported CBD cases
  • ignore_changes and unsupported provisioner metadata

Acceptance criteria:

  • Lifecycle behavior is either enforced or explicitly rejected
  • Plan summaries expose replacement reasons and lifecycle blockers
  • No lifecycle feature remains silently ignored

Phase 4: Native Runtime Checks

Objective: add explicit correctness guards without adopting Terraform's block syntax as the public surface.

  • [x] Define hybrid semantics for runtime_check / runtime_checks
  • [x] Implement native runtime-check phases:
  • pre_plan checks run before provider-backed planning
  • post_plan checks run after the plan is computed
  • pre_apply checks run before provider mutation
  • post_apply checks run after provider result materialization
  • [x] Ensure runtime-check evaluation can reference:
  • resolved config values
  • known prior state
  • new state returned by provider
  • cross-stack values where supported through persisted stack outputs
  • [x] Decide behavior for unknown values:
  • default policy is defer during planning
  • apply reevaluates deferred checks and fails closed if values are still unknown
  • non-importable callables are rejected in hybrid mode
  • [x] Explicitly reject Terraform precondition / postcondition blocks in hybrid mode
  • [x] Store runtime-check outcomes in state or execution reports so failed checks can be inspected after partial runs

Acceptance criteria:

  • Failed runtime checks stop the relevant resource with actionable context
  • Deferred runtime checks surface clearly in plan summaries and apply reports
  • Native runtime-check behavior is documented for unknown and deferred values

Phase 5: Provisioners and Connection Semantics

Objective: stop silently accepting Terraform-style provisioner metadata that the hybrid engine does not execute.

  • [x] Decide whether hybrid mode will:
  • current default policy is to reject all provisioners and connection blocks
  • [x] Fail planning when provisioners or connection blocks are present in hybrid-executed resources
  • [x] Fail saved-plan apply when provisioners or connection metadata is present, so older artifacts cannot bypass the planning rejection path
  • [x] Decide not to run provisioners in hybrid mode. Running them as Terraform does (local-exec, and file / remote-exec over SSH) was built and set aside: Terraform itself calls provisioners a last resort, they act outside the plan (not shown, not idempotent, no drift detection), and file / remote-exec need SSH reachability and credentials in the configuration. Configure machines with user data / cloud-init or baked images instead, and use Terraform synthesis, which emits provisioners for Terraform to run, where one is needed
  • [x] Add explicit tests for provisioner acceptance or rejection

Acceptance criteria:

  • Provisioners are never silently ignored in hybrid mode
  • Current supported subset is empty by design; unsupported metadata fails closed

Phase 6: Provider and State Compatibility

Objective: handle provider schema evolution and state compatibility deliberately.

  • [x] Wire upgrade_resource_state into state reads before refresh/plan/apply when the stored schema version is stale
  • [x] Extend stored state metadata to include at minimum:
  • provider source/name
  • provider version
  • schema version
  • private state/version metadata where required
  • [x] Define how hybrid mode handles provider private data:
  • preserve when available
  • detect when unavailable
  • reject operations that would be unsafe without it
  • [x] Add compatibility checks when loading legacy or migrated state
  • [x] Add migration tests covering provider upgrades and imported resources

Acceptance criteria:

  • Provider schema/version mismatches are detected before destructive actions
  • State upgrades happen explicitly and are tested
  • Hybrid state format documents which provider data is persisted

Cross-Cutting Work

Test Plan

  • [x] Add unit tests for each parity feature in the orchestration and hybrid packages
  • [x] Add FakeCloud-backed integration tests for refresh, drift, replacement, and delete safety
  • [x] Add golden-plan tests for serialized hybrid plans
  • [x] Add regression tests that compare hybrid and Terraform outcomes for a curated subset of scenarios
  • [x] Add failure-injection tests:
  • refresh timeout
  • provider returns unknown state unexpectedly
  • plan/apply provider version mismatch
  • post-apply runtime check failure after partial apply

Performance Guardrails

  • [x] Keep a benchmark dashboard for each phase above
  • Current dashboard page: docs/advanced/performance/hybrid-benchmark-dashboard.md
  • Regeneration task: uv run poe bench-dashboard
  • [x] Require benchmark capture on pull requests that alter hybrid plan/apply
  • Capture task: uv run poe bench-capture-hybrid
  • Verification task: uv run poe bench-require-hybrid-capture
  • CI guidance is documented in docs/operations/ci-cd.md
  • [x] Measure:
  • cold provider startup
  • warm provider reuse
  • refresh cost
  • plan serialization cost
  • lifecycle/condition overhead
  • Current supplementary measurements on 2026-04-13 at 1000 resources from the current checkout:
    • cold provider load path: below 0.0001s in the harness-local fake-provider loader
    • warm provider reuse path: below 0.0001s in the harness-local fake-provider loader
    • refresh-only drift path: 0.2441s, 0.244 ms/resource
    • plan serialization round-trip: 0.1317s, 0.132 ms/resource
    • guarded plan overhead (prevent_destroy + pre_plan runtime checks): 2.4402s, 2.440 ms/resource
    • baseline create-only plan for comparison: 2.4236s, 2.424 ms/resource
    • measured guarded-plan overhead: about +0.7%
  • Capture task: uv run poe bench-capture-hybrid-overheads
  • [x] Set an explicit target that parity work should preserve a material speed advantage over Terraform CLI on the same scenarios unless a feature requires equivalent work
  • Current end-to-end baseline on 2026-04-13 for test_terraform_vs_hybrid_simple_resources:
    • scenario: 6 AWS resources against FakeCloud, including hybrid plan/apply/destroy versus legacy Terraform init/plan/apply/destroy
    • runs: 3
    • hybrid average: 11.2s
    • Terraform average: 30.6s
    • observed speedup range: 2.6x to 2.8x
    • average speedup: 2.7x
  • Guardrail target: keep hybrid at or above 2.0x end-to-end speedup on this benchmark unless a parity feature necessarily requires equivalent Terraform work, in which case the benchmark note and target should be updated together.

Product/UX Decisions

Current default policy is strict-by-default hybrid execution: core hybrid plan/apply parity features are enabled by default, unsupported Terraform-only features fail closed, and operators rely on concrete diagnostics rather than a compatibility badge.

  • [x] Record the compatibility policy in structured semantics metadata and operator docs
  • [x] Decide whether unsupported features should:
  • hard fail
  • auto-fallback to Terraform synthesis/native mode
  • require an explicit --allow-unsupported-hybrid flag
  • [x] Add clear diagnostics for fallback or rejection paths
  1. Phase 0 baseline and feature flags
  2. Phase 1 refresh and drift in active plan path
  3. Phase 2 immutable hybrid plans
  4. Phase 3 lifecycle semantics
  5. Phase 6 provider/state compatibility
  6. Phase 4 conditions and checks
  7. Phase 5 provisioners and connection semantics

Rationale:

  • Refresh/drift and immutable plans address the biggest correctness gaps first
  • Lifecycle and state compatibility affect destructive safety directly
  • Conditions and provisioners are important, but they should build on a stable planning model and explicit feature support policy

Exit Criteria For "Hybrid Production-Grade"

  • Hybrid plan performs refresh and drift detection by default
  • Hybrid apply consumes an immutable plan artifact
  • Unsupported Terraform features fail explicitly instead of being ignored
  • Supported lifecycle semantics are enforced and tested
  • State/provider compatibility checks run before mutation
  • Docs clearly define semantic coverage and fallback behavior
  • Benchmarks show which parity work costs time and where the remaining speedup comes from

Near-Term (Execution + Planning)

  1. Enhanced orchestration as the default path (hybrid execution)
  2. [x] Use EnhancedCircularAwareStrategy in hybrid execution when circular resolution is enabled (enhanced flag defaults to on)
  3. [x] Add recovery strategies (checkpoint/rollback) and progress callbacks
  4. [x] ~~Wire transactional state engine features via state_engine_factory~~ (obsolete: the factory and the transaction machinery were removed on 2026-09-25, aad166cb; one StateEngine remains)
  5. [x] Remove the enhanced/basic orchestrator fork and keep a single parallel execution path
  6. [x] Standard legacy CLI execution for non-hybrid apps now uses the unified orchestrator for the normal plan / apply / destroy / deploy flows
    • April 13, 2026: first slice landed. nf plan/apply/destroy/deploy --app <legacy-app> now routes through the direct orchestration path when no raw Terraform/OpenTofu passthrough args are used
    • April 13, 2026: second slice landed. configured legacy stack selectors now route through direct execution for nf plan/apply/destroy/deploy --stack app/stack and --app <legacy-app> --stack <stack>; synthesized stack roots and raw Terraform/OpenTofu passthrough args still stay on the legacy subprocess path
    • April 14, 2026: remaining subprocess usage is now the explicit legacy passthrough surface only (init, output, state, show, import, diff, raw passthrough args, and synthesized stack-root execution); the normal configured legacy execution flows are direct
  7. [x] Configured local execution no longer depends on phased Terraform export artifacts to handle circular dependencies

    • April 13, 2026: phased synthesis now writes an explicit export contract (export-manifest.json + README.md) for external Terraform/OpenTofu consumers; local CLI execution no longer treats those stack roots as normal runnable Terraform directories
    • April 14, 2026: direct stack planning now has explicit regression coverage showing that configured execution reuses phase-layer cycle breaking in the orchestrator instead of requiring phased Terraform artifacts at runtime
  8. Unified phase system under nf.core.phases

  9. [x] Consolidate planning logic, strategies, and planning models under nf.core.phases
  10. [x] Remove the fake nf.core.phases.executor.PhaseExecutor / JSON execution-plan compatibility shim
  11. [x] Standardize runtime execution on nf.core.orchestration.execution_models + nf.core.orchestration.unified_orchestrator
  12. [x] Retire CLI/output-tree assumptions about legacy phased Terraform directories and scripts
    • April 13, 2026: standard CLI stack commands now fail closed on phased Terraform stack roots instead of treating them as runnable Terraform directories
    • April 13, 2026: nf list-stacks now marks phased stack roots as phased-export / export-only instead of presenting them as normal runnable stack targets
    • April 14, 2026: remaining CLI helper discovery now keys off the explicit phased export contract (export-manifest.json / PHASED_EXECUTION.md) instead of a separate local-runtime command path, and the old unregistered synth_command phased-runtime surface was removed
  13. [x] Add deprecations and a removal plan for legacy phased local-runtime assumptions while preserving explicit export artifacts for external Terraform/OpenTofu consumers

    • April 14, 2026: synthesis and inventory surfaces now describe phased output as export-only (nf synth warns, nf list-apps marks affected legacy apps, nf list-stacks marks phased roots) instead of implying it is part of the normal local CLI runtime
    • April 14, 2026: explicit phased export artifacts remain the supported external handoff format (export-manifest.json, generated README.md, stack scripts), while local CLI runtime paths reject those stack roots and route users toward configured direct execution
  14. Parallel execution and phase planning improvements

  15. [x] ~~Use parallel phase executor where safe~~ (obsolete: there is no phase executor since b8328d1d; execution is one resource-level graph run by ParallelStrategy in orchestration/execution_strategies.py, the default of UnifiedOrchestrator and hybrid planning; phases plan synthesis and export only)
  16. [x] Improve dependency analysis and phase assignment (done: one planning path under nf.core.phases, DependencyAnalyzer, dependency_extraction, cycle_breaking and stack_dependency_plan; see the checked items under 8)
  17. [x] Extend integration tests for parallel and recovery modes (test_hybrid_recovery_fakecloud.py verifies concurrent entry into real provider RPCs, provider-side partial-apply failure under CHECKPOINT/ROLLBACK/NONE, preserved updates, rolled-back creates and checkpoint restoration)

Mid-Term (State + Backends)

  1. Consolidate state engine variants
  2. [x] ~~Clarify the default state engine (base vs transactional vs enhanced)~~ (obsolete: the enhanced and transactional engines were removed in e760a1ce and the factory in aad166cb; StateEngine in backends/state_engine_runtime.py is the only one)
  3. [x] Prefer composition over parallel implementations (done: one StateEngine composing a pluggable StateBackend from BackendRegistry)
  4. [x] Document configuration knobs and expected guarantees (done: state_persist_interval, batched saves, serial/lineage writes and errored.tfstate in docs/guides/backends/state-backend-api.md, docs/concepts/backends-and-state.md, the hybrid semantics page and AGENTS.md)

  5. Unify S3 backend API

  6. [x] Merge S3Backend and S3StateBackend into a single class
  7. [x] Provide explicit constructors for synthesis/native modes
  8. [x] Update internal usage + docs + migration notes

Performance Track (Ongoing)

  1. Synthesis performance optimization
  2. [x] Reduce runtime type checks in hot paths (done: type flags such as Resource._is_resource and _is_stack, and type() dispatch tables in constructs/resources.py and values/compiled.py)
  3. [x] Optimize serialization and config building (done: orjson throughout; construct_config and compiled_config in values/compiled.py build a construct's configuration once per configuration version)
  4. [ ] Parallelize CPU-bound synthesis work where safe (open: synthesis, constructs and phases run serially; under the GIL only processes would help, which means pickling constructs, so it needs a feasibility study first)
  5. [x] Track progress with repeatable 10k-resource benchmarks (done: poe bench (10k), poe bench-simple (1k) and the hybrid poe bench-* tasks append each run to perf_history.jsonl, and scripts/check_benchmark_regression.py fails a run more than 15% slower than the previous runs on the same machine; poe bench-check checks them all)
  6. [x] Reduce logger gate overhead in hot resource creation paths (done: the module-level hot-path logging gate in constructs/resources.py, 0639e630; now logging_state.verbose, on when logging is configured at DEBUG or below)
  7. [x] Cache stack/provider lookups to avoid repeated scope traversal (done: a resource's stack is cached at creation, _get_stack_cached, bc188b53; the provider lookup ends at the first scope, which must be a stack, so its scope loop can go)
  8. [x] ~~Add an opt-in fast Resource path that skips autoscope when nf_scope is explicit~~ (obsolete: with nf_scope given, autoscope costs one key check and a call frame, and Resource.__init__ already falls back to the current scope itself; dropping @autoscope from Resource would be simpler than an opt-in path)
  9. [x] Collapse recursive runtime/dependency pre-scan into a single-pass analyzer for nested resource values
    • Audited 2026-11-03: superseded on 2026-09-24 (cbeff5f9, "Take dependency edges from the holes of compiled configurations"): there is no per-value analyzer any more; a construct's configuration is compiled once per version into holes (values/compiled.py), and dependency edges are read from them (phases/dependency_extraction.py). The notes and implementation order below describe the removed design: the single-pass analyzer is done and superseded, bottom-up summaries on tracked containers are obsolete (a mutation recompiles; tracking is opt-in), paths are carried as tuples and joined only for display, and reference strings are parsed by one precompiled regex behind a ${ check, so a specialized scanner is worth it only if profiling shows it hot
    • March 27, 2026 benchmark on the current checkout: uv run poe bench measured explicit 10k resource creation at 0.4426s and synthesis at 0.1012s; creation is the dominant phase in this scenario
    • Current hot path is the triple-walk over nested values in Resource._value_may_need_runtime_processing, scan_value_for_cross_stack_refs, and _update_recorded_dependency_edges / DependencyExtractor.extract_dependencies
    • Small isolated microbench on the same checkout showed scalar_only=0.0777s, baseline_nested=0.1281s, nested_no_scan=0.0900s, nested_no_wrap=0.1083s, and nested_no_wrap_no_scan=0.0770s for 10k resources; most of the nested-value overhead comes from scanning, with tracked-container wrapping as a secondary cost
    • April 14, 2026 closeout: the first single-pass analyzer landed and removed the old triple-walk hot path from default resource creation; a follow-up tracked-container summary / branch-refresh pass regressed uv run poe bench-simple on the default explicit-resource path and was reverted
    • April 14, 2026 closeout: the retained change is a narrow mutable-container correctness fix in Resource._analyze_value() / _on_tracked_mutation() so tracked nested mutation analysis stays correct without broadening the default immutable hot path
    • Recommended implementation order:
    • Add a single-pass iterative analyze_value(...) path that returns has_runtime, cross_stack_refs, and dependency-edge data so creation does not walk the same subtree multiple times
    • Store bottom-up summary metadata on _TrackedDict / _TrackedList so tracked mutations can refresh parent state from the changed branch instead of rescanning the full top-level attribute
    • Carry path segments during analysis and join only when emitting a cross-stack registration or final edge to avoid repeated string concatenation on deep trees
    • If string reference parsing still shows up hot after the structural fixes, replace the current multi-regex string checks with a single specialized scanner; the jsongrep DFA idea is a better fit for dependency-string scanning than for walking the tracked Python object tree itself

Platform + Async

  1. AnyIO-first runtime and tests
  2. [x] Core runtime/orchestration migrated to AnyIO with its bundled pytest plugin
  3. [x] Remove remaining asyncio-specific terminology from public APIs/docs where not required
    • April 14, 2026: public docs now refer to AnyIO-first runtime entrypoints; asyncio is only called out where the anyio_backend setting (nf --anyio-backend) needs concrete backend values
  4. [x] Make AnyIO backend selection consistent across CLI + runtime entrypoints
    • April 14, 2026: product code now routes CLI async entrypoints through nf.core.orchestration.event_loop.run_sync; direct anyio.run(...) calls remain only inside the shared event-loop helper
  5. [x] Add cancellation/timeouts coverage for orchestration + provider protocol paths
    • April 14, 2026: added focused tests for orchestration cancellation (ExecutionProgressReporter.stop) and provider startup timeout propagation (ProviderSessionStartup handshake + channel readiness failures)

Cleanup + Quality

  1. Remove or deprecate dead/duplicate code
  2. [x] Remove unused backups/debug scripts (done: no backup, debug or scratch files are tracked)
  3. [x] Consolidate duplicate orchestrators/state engines (done: one UnifiedOrchestrator, one StateEngine; backends/state_engine.py re-exports it, and nf/ holds generated alias shims, not copies)
  4. [x] Resolve TODOs (outputs handling, provider config lookup, circular attr detection) (done: no TODO, FIXME or XXX remains in non-test code)
  5. nf.core simplification track, ordered least disruptive to most:
    • [x] Remove obvious low-risk bloat and abandoned scaffolding
    • Dropped tracked benchmark/result artifacts that did not need to live in the main package tree
    • Removed stale duplicate test helpers and abandoned benchmark scaffolding
    • [x] Remove or quarantine placeholder compatibility paths that are not real execution engines
    • Removed the fake nf.core.phases.executor.PhaseExecutor and JSON execution-plan compatibility shim
    • Dropped duplicate CLI JSON-plan execution paths while keeping real phase-directory synthesis and deployment
    • [x] Deduplicate cross-stack synthesis logic in nf.core.constructs.app_stack
    • Merged _process_registered_cross_refs and the late-discovery branch in _synthesize_regular into a single implementation
    • Centralized export creation, remote-state wiring, and circular-dependency registration behind one stack helper
    • [x] Split ProviderProtocolClient by responsibility
    • Separate process lifecycle/handshake, schema loading, protocol-version adaptation, and resource RPC operations
    • Remove unfinished pooling/reuse paths and compatibility parameters that no longer affect behavior
    • Provider config logging/redaction policy is intentionally deferred to a future decision; keep behavior stable until that choice is made
    • [x] Collapse overlapping dependency planning/orchestration systems into one primary model
    • Retired infrastructure.circular_dependency_handler and the duplicate circular-orchestrator strategy fork
    • Kept nf.core.phases.* as the default planning model and preserved the public execution API around a single parallel executor
  6. nf.core structural cleanup follow-up:

    • [x] Unify script-generation ownership
    • Problem: operational shell-script generation was split between orchestration helpers and nf.core.constructs.app_stack, so constructs, synthesis, and deployment artifacts were coupled together
    • Split orchestration artifact generation into nf.core.orchestration.phased_artifacts and nf.core.orchestration.app_script_generation, leaving App/Stack responsible only for synthesis coordination and phase selection
    • [x] Consolidate dependency planning into one graph/analyzer path
    • Moved dependency extraction, shared graph algorithms, cycle-breaking policy, and stack dependency planning into nf.core.phases.*
    • Removed the orchestrator's graph-first planning path so nf.core.orchestration.unified_orchestrator now plans execution from the phase-owned stack dependency plan instead of rebuilding dependency semantics
    • [x] Resolve the function subsystem split
    • Removed the dead in-tree nf.core.functions.functions_generated catalog from nf.core
    • nf.core.functions.functions remains the sole core entrypoint, backed by the external legacy function packages selected through the legacy registry
  7. Test hygiene

  8. [x] Keep repo tests in package test directories (done: every committed test is under libs/*/tests, backends/*/tests, discovery/*/tests or tools/*/tests; the top-level tests/ holds only shared helpers)
  9. [x] Keep ad-hoc test files in /tmp (not committed) (done: none are committed)
  10. [x] Expand coverage for phase planning and recovery paths (done: about 20 test files cover nf.core.phases, property-based planner and parallel-group tests among them, and TestRecoveryStrategy covers CHECKPOINT, ROLLBACK and NONE; progress reporting has a single test, test_progress_reporting.py)
  11. [x] Add property-based tests for core invariants (runtime resolver, state engine, config normalization) (done: test_property_based_runtime_resolver.py, test_property_based_state_engine.py and test_property_based_config_normalization.py, among 15 property-based test files)
  12. [x] Unify FakeCloud/testcontainers helpers across packages with consistent env flags
    • April 14, 2026: shared env-flag and FakeCloud helpers now live under nf.testing.*; AWS discovery, nf.core AWS integration, and container-backed test trees use the same FakeCloud and container switches (now the pytest options --nf-use-fakecloud, --nf-fakecloud-autostart and --nf-use-containers) instead of carrying separate copies
  13. [x] Standardize test helpers directory layout across packages
  14. [x] Add FakeCloud-backed AWS discovery tests

Docs + UX

  1. Documentation updates
  2. [x] Update CLI docs for the unified phase system (done: docs/reference/cli/plan.md and the other command pages describe cycle breaking in the orchestrator and phased output as export-only)
  3. [ ] Publish migration guides for orchestration + S3 backend changes (open: the backend migration guide is docs/tutorials/backend-migration.md; there is no guide for moving from phased Terraform output to the orchestrator and hybrid execution)
  4. [x] Add operational guidance for recovery strategies and progress reporting (docs/operations/rollback-and-recovery.md covers strategy selection, partial failure and checkpoint restoration; docs/operations/logging-debugging-performance.md explains elapsed time and progress counts)

Future

  1. Developer-friendly component layer (optional DX package)
  2. Add a first-class "link" concept that auto-wires permissions + env vars between resources
  3. Generate runtime resource access stubs for linked resources (IDE-friendly accessors)
  4. Provide high-level components with smart defaults + strict config validation
  5. Keep escape hatches to underlying provider resources for advanced use cases
  6. Standardize safe naming helpers to respect provider limits

  7. Unify phase execution engines

    • [x] ~~Move CLI phased execution onto nf.core.phases.executor once the core Terraform runner is complete~~ (obsolete: nf.core.phases.executor was removed in b8328d1d, and the CLI no longer runs phased output: phased stack roots are export-only and local commands refuse them)

Success Markers

  • [x] Unified phase system with compatibility layer and deprecations (met, without a compatibility layer: the shim was removed rather than kept; phased output is export-only)
  • [x] Enhanced orchestrator enabled by default with recovery + progress (met: UnifiedOrchestrator with ParallelStrategy, recovery defaulting to CHECKPOINT, progress reporting on by default)
  • [x] S3 backend unified with one public import path
  • [x] Clear default state engine strategy (met: one StateEngine)
  • [x] Measurable synthesis performance improvements (met as a measure: benchmark runs are recorded and checked for regressions; see 6)