Skip to content

fix(wfctl): disambiguate iac_provider from impl-level provider in resource configs#620

Merged
intel352 merged 2 commits into
mainfrom
fix/iac-provider-disambiguation
May 10, 2026
Merged

fix(wfctl): disambiguate iac_provider from impl-level provider in resource configs#620
intel352 merged 2 commits into
mainfrom
fix/iac-provider-disambiguation

Conversation

@intel352

Copy link
Copy Markdown
Contributor

Why

BMW deploy run 25625555953 (attempt 2) failed with:

```
error: plan action for "bmw-eventbus" references provider "nats"
which is not declared as an iac.provider module
```

The `bmw-eventbus` resource declares `provider: nats` (the eventbus implementation, per workflow-plugin-eventbus's typed proto schema where `ClusterConfig.provider` ∈ {nats, kafka}) and `deploy_target: digitalocean.app_platform` (the IaC target hint).

wfctl's plan/apply code reads `Resource.Config["provider"]` for iac.provider routing and looks up "nats" in the iac.provider module set — there is no NATS iac.provider, so dispatch fails. `infra.database` works because there `provider: do-provider` happens to name the iac.provider module directly. Resources where `provider` carries impl semantics (eventbus today, possibly others in the future) need a separate field for IaC routing.

What

Introduce `iac_provider` as the canonical field for selecting the iac.provider module to dispatch to. New helper:

```go
func resolveIaCProviderRef(cfg map[string]any) string {
if v, ok := cfg["iac_provider"].(string); ok && v != "" { return v }
if v, ok := cfg["provider"].(string); ok { return v }
return ""
}
```

Reads `iac_provider` first, falls back to `provider` for backward compatibility. Updated all 9 read sites across infra.go, infra_apply.go, infra_apply_dryrun.go, infra_destroy.go, infra_provider_dispatch.go, infra_status_drift.go.

Module-internal `provider` reads (cloud.account, iac.provider's own `provider: digitalocean`) intentionally left alone — those name impl types on the module itself, not resource-level routing.

What this enables

bmw-eventbus can now declare both fields without conflict:

```yaml

  • name: bmw-eventbus
    type: infra.eventbus
    config:
    provider: nats # impl (read by eventbus plugin)
    iac_provider: do-provider # IaC routing (read by wfctl)
    deploy_target: digitalocean.app_platform
    version: "2.10"
    replicas: 2
    ```

infra.database keeps working unchanged via the fallback.

Tests

  • `TestResolveIaCProviderRef` — 8 sub-cases: iac_provider-only, provider-only-back-compat, iac_provider-wins-over-provider, empty-iac_provider-falls-back, neither-set, nil-config, non-string-iac_provider-falls-back, non-string-provider.
  • Existing Infra/Provider/Apply/Plan/Dispatch test suites green — no regressions.

```
$ GOWORK=off go test ./cmd/wfctl/ -run 'TestResolveIaCProviderRef' -v
... 8 sub-tests PASS
$ GOWORK=off go test ./cmd/wfctl/ -run 'Infra|Provider|Apply|Plan|Dispatch' -count=1
ok github.com/GoCodeAlone/workflow/cmd/wfctl 4.897s
```

Test plan

  • Targeted tests pass locally
  • `go build ./cmd/wfctl/` clean
  • `go vet ./cmd/wfctl/` clean
  • CI green
  • Once tagged: BMW infra.yaml adds `iac_provider` to bmw-eventbus + dependents → next deploy passes Apply step

🤖 Generated with Claude Code

…ource configs

Plugin schemas like workflow-plugin-eventbus declare "provider" as the
implementation identifier (nats, kafka, ...). wfctl's plan/apply/dispatch
code paths conflated that with the iac.provider module reference, looking
up the impl name as a module name and failing with:

    error: plan action for "bmw-eventbus" references provider "nats"
    which is not declared as an iac.provider module

The infra.database resource ("provider: do-provider") works because there
the field happens to name the iac.provider module directly. Resources where
"provider" carries impl semantics (eventbus, etc.) need a separate field
for IaC routing.

This change: introduce `iac_provider` as the canonical field for selecting
the iac.provider module to dispatch to. Read it via a new
`resolveIaCProviderRef(map[string]any) string` helper that returns
iac_provider first and falls back to provider for backward compatibility.

Updated all 9 read sites:
  cmd/wfctl/infra.go:1034            (resolveProviderForSpec)
  cmd/wfctl/infra_provider_dispatch.go:118 (groupSpecsByProviderRef)
  cmd/wfctl/infra_apply.go:348/356   (state/spec helpers)
  cmd/wfctl/infra_apply.go:557/1340  (post-apply state record builds)
  cmd/wfctl/infra_apply.go:1167/1173 (apply group dispatch)
  cmd/wfctl/infra_apply_dryrun.go:156/226
  cmd/wfctl/infra_destroy.go:69
  cmd/wfctl/infra_status_drift.go:213

cloud.account / iac.provider module-internal `provider` reads (deploy.go,
deploy_providers.go, ci_run_dryrun.go) are intentionally left alone —
those refer to the impl-name field on iac.provider modules themselves
(provider: digitalocean), not resource-level routing.

Error messages updated to mention `iac_provider/provider` resolution path
so operators can quickly identify the field set.

Tests: TestResolveIaCProviderRef covers 8 cases including
iac_provider-wins-over-provider, type-mismatch fallback, nil/empty.
Existing Infra/Provider/Apply/Plan/Dispatch test suites green (no
regressions).

Unblocks BMW deploy: bmw-eventbus (provider="nats") now coexists with
iac_provider="do-provider" in infra.yaml without requiring the eventbus
plugin to drop its impl-name semantics.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 10, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a clear separation between “implementation provider” (resource-specific provider) and “IaC routing provider” (new canonical iac_provider) in wfctl’s infra plan/apply/destroy/diagnostics paths, preventing dispatch failures when a resource schema already uses provider for non-IaC semantics (e.g., eventbus provider nats/kafka).

Changes:

  • Introduces resolveIaCProviderRef(cfg) to prefer iac_provider and fall back to provider for backward compatibility.
  • Updates infra routing/grouping logic across apply/dry-run/destroy/status drift/dispatch to use the new resolver.
  • Adds unit tests covering precedence, fallbacks, nil config, and type-mismatch cases.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/wfctl/infra.go Adds resolveIaCProviderRef and uses it for provider resolution; updates related error strings.
cmd/wfctl/infra_apply.go Switches provider-ref extraction to resolveIaCProviderRef in multiple apply paths; updates error strings.
cmd/wfctl/infra_apply_dryrun.go Uses resolveIaCProviderRef when rendering dry-run JSON and collecting provider groups.
cmd/wfctl/infra_destroy.go Uses resolveIaCProviderRef when grouping destroy operations by provider.
cmd/wfctl/infra_provider_dispatch.go Uses resolveIaCProviderRef in spec grouping and updates dispatch error strings.
cmd/wfctl/infra_status_drift.go Uses resolveIaCProviderRef when inferring provider groups for drift/status reporting.
cmd/wfctl/infra_iac_provider_ref_test.go Adds focused unit coverage for resolveIaCProviderRef behavior.

Comment thread cmd/wfctl/infra.go Outdated
return providerType, modCfg, nil
}
return "", nil, fmt.Errorf("infra module %q references provider %q which is not declared as an iac.provider module", spec.Name, moduleRef)
return "", nil, fmt.Errorf("infra module %q references iac.provider module %q (resolved from iac_provider/provider) which is not declared in modules", spec.Name, moduleRef)
Comment thread cmd/wfctl/infra_provider_dispatch.go Outdated
return nil, nil, fmt.Errorf("infra module %q references iac.provider %q which is disabled for environment %q", spec.Name, moduleRef, envName)
}
return nil, nil, fmt.Errorf("infra module %q references provider %q which is not declared as an iac.provider module", spec.Name, moduleRef)
return nil, nil, fmt.Errorf("infra module %q references iac.provider module %q (resolved from iac_provider/provider) which is not declared in modules", spec.Name, moduleRef)
Comment thread cmd/wfctl/infra_apply.go Outdated
def, ok := providerDefs[moduleRef]
if !ok {
return runHydrated, fmt.Errorf("plan action for %q references provider %q which is not declared as an iac.provider module", action.Resource.Name, moduleRef)
return runHydrated, fmt.Errorf("plan action for %q references iac.provider module %q (resolved from iac_provider/provider) which is not declared in modules", action.Resource.Name, moduleRef)
@github-actions

github-actions Bot commented May 10, 2026

Copy link
Copy Markdown

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:262: parsing iteration count: invalid syntax
baseline-bench.txt:350411: parsing iteration count: invalid syntax
baseline-bench.txt:679677: parsing iteration count: invalid syntax
baseline-bench.txt:1222093: parsing iteration count: invalid syntax
baseline-bench.txt:1522166: parsing iteration count: invalid syntax
baseline-bench.txt:1852920: parsing iteration count: invalid syntax
benchmark-results.txt:262: parsing iteration count: invalid syntax
benchmark-results.txt:388232: parsing iteration count: invalid syntax
benchmark-results.txt:768870: parsing iteration count: invalid syntax
benchmark-results.txt:1086958: parsing iteration count: invalid syntax
benchmark-results.txt:1414130: parsing iteration count: invalid syntax
benchmark-results.txt:1714584: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 9V74 80-Core Processor                
                            │ baseline-bench.txt │
                            │       sec/op       │
InterpreterCreation-4              3.143m ± 202%
ComponentLoad-4                    3.474m ±   8%
ComponentExecute-4                 1.833µ ±   0%
PoolContention/workers-1-4         1.017µ ±   3%
PoolContention/workers-2-4         1.009µ ±   1%
PoolContention/workers-4-4         1.016µ ±   1%
PoolContention/workers-8-4         1.014µ ±   2%
PoolContention/workers-16-4        1.020µ ±   3%
ComponentLifecycle-4               3.506m ±   1%
SourceValidation-4                 2.087µ ±   1%
RegistryConcurrent-4               761.4n ±   4%
LoaderLoadFromString-4             3.525m ±   0%
geomean                            16.55µ

                            │ baseline-bench.txt │
                            │        B/op        │
InterpreterCreation-4               2.027Mi ± 0%
ComponentLoad-4                     2.180Mi ± 0%
ComponentExecute-4                  1.203Ki ± 0%
PoolContention/workers-1-4          1.203Ki ± 0%
PoolContention/workers-2-4          1.203Ki ± 0%
PoolContention/workers-4-4          1.203Ki ± 0%
PoolContention/workers-8-4          1.203Ki ± 0%
PoolContention/workers-16-4         1.203Ki ± 0%
ComponentLifecycle-4                2.183Mi ± 0%
SourceValidation-4                  1.984Ki ± 0%
RegistryConcurrent-4                1.133Ki ± 0%
LoaderLoadFromString-4              2.182Mi ± 0%
geomean                             15.25Ki

                            │ baseline-bench.txt │
                            │     allocs/op      │
InterpreterCreation-4                15.68k ± 0%
ComponentLoad-4                      18.02k ± 0%
ComponentExecute-4                    25.00 ± 0%
PoolContention/workers-1-4            25.00 ± 0%
PoolContention/workers-2-4            25.00 ± 0%
PoolContention/workers-4-4            25.00 ± 0%
PoolContention/workers-8-4            25.00 ± 0%
PoolContention/workers-16-4           25.00 ± 0%
ComponentLifecycle-4                 18.07k ± 0%
SourceValidation-4                    32.00 ± 0%
RegistryConcurrent-4                  2.000 ± 0%
LoaderLoadFromString-4               18.06k ± 0%
geomean                               183.3

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                 3.004m ± 223%
ComponentLoad-4                       3.416m ±  12%
ComponentExecute-4                    1.836µ ±   1%
PoolContention/workers-1-4            1.171µ ±   1%
PoolContention/workers-2-4            1.169µ ±   2%
PoolContention/workers-4-4            1.195µ ±   1%
PoolContention/workers-8-4            1.191µ ±   1%
PoolContention/workers-16-4           1.195µ ±   1%
ComponentLifecycle-4                  3.521m ±   2%
SourceValidation-4                    2.221µ ±   1%
RegistryConcurrent-4                  895.9n ±   2%
LoaderLoadFromString-4                3.529m ±   1%
geomean                               17.90µ

                            │ benchmark-results.txt │
                            │         B/op          │
InterpreterCreation-4                  2.027Mi ± 0%
ComponentLoad-4                        2.180Mi ± 0%
ComponentExecute-4                     1.203Ki ± 0%
PoolContention/workers-1-4             1.203Ki ± 0%
PoolContention/workers-2-4             1.203Ki ± 0%
PoolContention/workers-4-4             1.203Ki ± 0%
PoolContention/workers-8-4             1.203Ki ± 0%
PoolContention/workers-16-4            1.203Ki ± 0%
ComponentLifecycle-4                   2.183Mi ± 0%
SourceValidation-4                     1.984Ki ± 0%
RegistryConcurrent-4                   1.133Ki ± 0%
LoaderLoadFromString-4                 2.182Mi ± 0%
geomean                                15.25Ki

                            │ benchmark-results.txt │
                            │       allocs/op       │
InterpreterCreation-4                   15.68k ± 0%
ComponentLoad-4                         18.02k ± 0%
ComponentExecute-4                       25.00 ± 0%
PoolContention/workers-1-4               25.00 ± 0%
PoolContention/workers-2-4               25.00 ± 0%
PoolContention/workers-4-4               25.00 ± 0%
PoolContention/workers-8-4               25.00 ± 0%
PoolContention/workers-16-4              25.00 ± 0%
ComponentLifecycle-4                    18.07k ± 0%
SourceValidation-4                       32.00 ± 0%
RegistryConcurrent-4                     2.000 ± 0%
LoaderLoadFromString-4                  18.06k ± 0%
geomean                                  183.3

pkg: github.com/GoCodeAlone/workflow/middleware
cpu: AMD EPYC 9V74 80-Core Processor                
                                  │ baseline-bench.txt │
                                  │       sec/op       │
CircuitBreakerDetection-4                 298.0n ± 14%
CircuitBreakerExecution_Success-4         22.67n ±  0%
CircuitBreakerExecution_Failure-4         71.33n ±  3%
geomean                                   78.40n

                                  │ baseline-bench.txt │
                                  │        B/op        │
CircuitBreakerDetection-4                 144.0 ± 0%
CircuitBreakerExecution_Success-4         0.000 ± 0%
CircuitBreakerExecution_Failure-4         0.000 ± 0%
geomean                                              ¹
¹ summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │
                                  │     allocs/op      │
CircuitBreakerDetection-4                 1.000 ± 0%
CircuitBreakerExecution_Success-4         0.000 ± 0%
CircuitBreakerExecution_Failure-4         0.000 ± 0%
geomean                                              ¹
¹ summaries must be >0 to compute geomean

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                     450.4n ± 2%
CircuitBreakerExecution_Success-4             59.74n ± 0%
CircuitBreakerExecution_Failure-4             64.78n ± 0%
geomean                                       120.4n

                                  │ benchmark-results.txt │
                                  │         B/op          │
CircuitBreakerDetection-4                    144.0 ± 0%
CircuitBreakerExecution_Success-4            0.000 ± 0%
CircuitBreakerExecution_Failure-4            0.000 ± 0%
geomean                                                 ¹
¹ summaries must be >0 to compute geomean

                                  │ benchmark-results.txt │
                                  │       allocs/op       │
CircuitBreakerDetection-4                    1.000 ± 0%
CircuitBreakerExecution_Success-4            0.000 ± 0%
CircuitBreakerExecution_Failure-4            0.000 ± 0%
geomean                                                 ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
cpu: AMD EPYC 9V74 80-Core Processor                
                                 │ baseline-bench.txt │
                                 │       sec/op       │
JQTransform_Simple-4                     820.9n ± 31%
JQTransform_ObjectConstruction-4         1.382µ ±  1%
JQTransform_ArraySelect-4                3.382µ ±  3%
JQTransform_Complex-4                    41.56µ ±  1%
JQTransform_Throughput-4                 1.693µ ±  0%
SSEPublishDelivery-4                     63.49n ±  2%
geomean                                  1.606µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
JQTransform_Simple-4                   1.273Ki ± 0%
JQTransform_ObjectConstruction-4       1.773Ki ± 0%
JQTransform_ArraySelect-4              2.625Ki ± 0%
JQTransform_Complex-4                  16.22Ki ± 0%
JQTransform_Throughput-4               1.984Ki ± 0%
SSEPublishDelivery-4                     0.000 ± 0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │
                                 │     allocs/op      │
JQTransform_Simple-4                     10.00 ± 0%
JQTransform_ObjectConstruction-4         15.00 ± 0%
JQTransform_ArraySelect-4                30.00 ± 0%
JQTransform_Complex-4                    324.0 ± 0%
JQTransform_Throughput-4                 17.00 ± 0%
SSEPublishDelivery-4                     0.000 ± 0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                 │ benchmark-results.txt │
                                 │        sec/op         │
JQTransform_Simple-4                        979.3n ± 20%
JQTransform_ObjectConstruction-4            1.504µ ±  2%
JQTransform_ArraySelect-4                   3.216µ ±  2%
JQTransform_Complex-4                       35.57µ ±  3%
JQTransform_Throughput-4                    1.807µ ±  3%
SSEPublishDelivery-4                        77.14n ±  1%
geomean                                     1.692µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
JQTransform_Simple-4                      1.273Ki ± 0%
JQTransform_ObjectConstruction-4          1.773Ki ± 0%
JQTransform_ArraySelect-4                 2.625Ki ± 0%
JQTransform_Complex-4                     16.22Ki ± 0%
JQTransform_Throughput-4                  1.984Ki ± 0%
SSEPublishDelivery-4                        0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

                                 │ benchmark-results.txt │
                                 │       allocs/op       │
JQTransform_Simple-4                        10.00 ± 0%
JQTransform_ObjectConstruction-4            15.00 ± 0%
JQTransform_ArraySelect-4                   30.00 ± 0%
JQTransform_Complex-4                       324.0 ± 0%
JQTransform_Throughput-4                    17.00 ± 0%
SSEPublishDelivery-4                        0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
cpu: AMD EPYC 9V74 80-Core Processor                
                                    │ baseline-bench.txt │
                                    │       sec/op       │
SchemaValidation_Simple-4                   1.088µ ±  3%
SchemaValidation_AllFields-4                1.635µ ± 13%
SchemaValidation_FormatValidation-4         1.569µ ±  2%
SchemaValidation_ManySchemas-4              1.589µ ±  1%
geomean                                     1.451µ

                                    │ baseline-bench.txt │
                                    │        B/op        │
SchemaValidation_Simple-4                   0.000 ± 0%
SchemaValidation_AllFields-4                0.000 ± 0%
SchemaValidation_FormatValidation-4         0.000 ± 0%
SchemaValidation_ManySchemas-4              0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │
                                    │     allocs/op      │
SchemaValidation_Simple-4                   0.000 ± 0%
SchemaValidation_AllFields-4                0.000 ± 0%
SchemaValidation_FormatValidation-4         0.000 ± 0%
SchemaValidation_ManySchemas-4              0.000 ± 0%
geomean                                                ¹
¹ summaries must be >0 to compute geomean

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                       1.039µ ± 3%
SchemaValidation_AllFields-4                    1.553µ ± 6%
SchemaValidation_FormatValidation-4             1.500µ ± 0%
SchemaValidation_ManySchemas-4                  1.483µ ± 3%
geomean                                         1.376µ

                                    │ benchmark-results.txt │
                                    │         B/op          │
SchemaValidation_Simple-4                      0.000 ± 0%
SchemaValidation_AllFields-4                   0.000 ± 0%
SchemaValidation_FormatValidation-4            0.000 ± 0%
SchemaValidation_ManySchemas-4                 0.000 ± 0%
geomean                                                   ¹
¹ summaries must be >0 to compute geomean

                                    │ benchmark-results.txt │
                                    │       allocs/op       │
SchemaValidation_Simple-4                      0.000 ± 0%
SchemaValidation_AllFields-4                   0.000 ± 0%
SchemaValidation_FormatValidation-4            0.000 ± 0%
SchemaValidation_ManySchemas-4                 0.000 ± 0%
geomean                                                   ¹
¹ summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
cpu: AMD EPYC 9V74 80-Core Processor                
                                   │ baseline-bench.txt │
                                   │       sec/op       │
EventStoreAppend_InMemory-4                1.148µ ± 25%
EventStoreAppend_SQLite-4                  1.129m ±  4%
GetTimeline_InMemory/events-10-4           13.60µ ±  3%
GetTimeline_InMemory/events-50-4           75.42µ ±  2%
GetTimeline_InMemory/events-100-4          153.4µ ±  6%
GetTimeline_InMemory/events-500-4          738.7µ ± 16%
GetTimeline_InMemory/events-1000-4         1.243m ±  1%
GetTimeline_SQLite/events-10-4             87.42µ ±  4%
GetTimeline_SQLite/events-50-4             232.4µ ±  5%
GetTimeline_SQLite/events-100-4            406.4µ ±  0%
GetTimeline_SQLite/events-500-4            1.753m ±  1%
GetTimeline_SQLite/events-1000-4           3.413m ±  0%
geomean                                    214.0µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  799.5 ± 7%
EventStoreAppend_SQLite-4                  1.982Ki ± 2%
GetTimeline_InMemory/events-10-4           7.953Ki ± 0%
GetTimeline_InMemory/events-50-4           46.62Ki ± 0%
GetTimeline_InMemory/events-100-4          94.48Ki ± 0%
GetTimeline_InMemory/events-500-4          472.8Ki ± 0%
GetTimeline_InMemory/events-1000-4         944.3Ki ± 0%
GetTimeline_SQLite/events-10-4             16.74Ki ± 0%
GetTimeline_SQLite/events-50-4             87.14Ki ± 0%
GetTimeline_SQLite/events-100-4            175.4Ki ± 0%
GetTimeline_SQLite/events-500-4            846.1Ki ± 0%
GetTimeline_SQLite/events-1000-4           1.639Mi ± 0%
geomean                                    67.41Ki

                                   │ baseline-bench.txt │
                                   │     allocs/op      │
EventStoreAppend_InMemory-4                  7.000 ± 0%
EventStoreAppend_SQLite-4                    53.00 ± 0%
GetTimeline_InMemory/events-10-4             125.0 ± 0%
GetTimeline_InMemory/events-50-4             653.0 ± 0%
GetTimeline_InMemory/events-100-4           1.306k ± 0%
GetTimeline_InMemory/events-500-4           6.514k ± 0%
GetTimeline_InMemory/events-1000-4          13.02k ± 0%
GetTimeline_SQLite/events-10-4               382.0 ± 0%
GetTimeline_SQLite/events-50-4              1.852k ± 0%
GetTimeline_SQLite/events-100-4             3.681k ± 0%
GetTimeline_SQLite/events-500-4             18.54k ± 0%
GetTimeline_SQLite/events-1000-4            37.29k ± 0%
geomean                                     1.162k

cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   1.138µ ±  3%
EventStoreAppend_SQLite-4                     998.6µ ±  3%
GetTimeline_InMemory/events-10-4              14.34µ ±  4%
GetTimeline_InMemory/events-50-4              80.63µ ± 24%
GetTimeline_InMemory/events-100-4             121.8µ ±  1%
GetTimeline_InMemory/events-500-4             631.2µ ±  4%
GetTimeline_InMemory/events-1000-4            1.316m ±  2%
GetTimeline_SQLite/events-10-4                85.62µ ±  1%
GetTimeline_SQLite/events-50-4                244.8µ ±  2%
GetTimeline_SQLite/events-100-4               444.0µ ±  1%
GetTimeline_SQLite/events-500-4               1.983m ±  2%
GetTimeline_SQLite/events-1000-4              3.916m ±  3%
geomean                                       214.7µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                    840.5 ± 11%
EventStoreAppend_SQLite-4                    1.984Ki ±  1%
GetTimeline_InMemory/events-10-4             7.953Ki ±  0%
GetTimeline_InMemory/events-50-4             46.62Ki ±  0%
GetTimeline_InMemory/events-100-4            94.48Ki ±  0%
GetTimeline_InMemory/events-500-4            472.8Ki ±  0%
GetTimeline_InMemory/events-1000-4           944.3Ki ±  0%
GetTimeline_SQLite/events-10-4               16.74Ki ±  0%
GetTimeline_SQLite/events-50-4               87.14Ki ±  0%
GetTimeline_SQLite/events-100-4              175.4Ki ±  0%
GetTimeline_SQLite/events-500-4              846.1Ki ±  0%
GetTimeline_SQLite/events-1000-4             1.639Mi ±  0%
geomean                                      67.69Ki

                                   │ benchmark-results.txt │
                                   │       allocs/op       │
EventStoreAppend_InMemory-4                     7.000 ± 0%
EventStoreAppend_SQLite-4                       53.00 ± 0%
GetTimeline_InMemory/events-10-4                125.0 ± 0%
GetTimeline_InMemory/events-50-4                653.0 ± 0%
GetTimeline_InMemory/events-100-4              1.306k ± 0%
GetTimeline_InMemory/events-500-4              6.514k ± 0%
GetTimeline_InMemory/events-1000-4             13.02k ± 0%
GetTimeline_SQLite/events-10-4                  382.0 ± 0%
GetTimeline_SQLite/events-50-4                 1.852k ± 0%
GetTimeline_SQLite/events-100-4                3.681k ± 0%
GetTimeline_SQLite/events-500-4                18.54k ± 0%
GetTimeline_SQLite/events-1000-4               37.29k ± 0%
geomean                                        1.162k

Benchmarks run with go test -bench=. -benchmem -count=6.
Regressions ≥ 20% are flagged. Results compared via benchstat.

…e" qualifier in error

3 inline findings, all the same nit at infra.go:1081, infra_apply.go:1182,
infra_provider_dispatch.go:129. My initial change widened the wording
"not declared as an iac.provider module" → "not declared in modules". The
lookup map is filtered to type=iac.provider modules; if a same-named module
of a different type exists, "not declared in modules" is inaccurate.

Restored the precise qualifier and tightened the field reference to read
"iac_provider/provider field" so the operator knows which fields the lookup
key was resolved from.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@intel352

Copy link
Copy Markdown
Contributor Author

Round 2 (5da12c9): restored is not declared as an iac.provider module wording at all 3 sites (infra.go:1081, infra_apply.go:1182, infra_provider_dispatch.go:129). The lookup map filters to type: iac.provider modules only, so is not declared in modules was imprecise when a same-named module of a different type exists. Also tightened the field reference to read iac_provider/provider field so the operator knows which fields the lookup key resolved from.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants