Skip to content

feat(wfctl): secrets provider metadata + access + adapter unification + list upgrade (PR1/7)#799

Merged
intel352 merged 8 commits into
mainfrom
feat/wfctl-secrets-metadata
May 30, 2026
Merged

feat(wfctl): secrets provider metadata + access + adapter unification + list upgrade (PR1/7)#799
intel352 merged 8 commits into
mainfrom
feat/wfctl-secrets-metadata

Conversation

@intel352
Copy link
Copy Markdown
Contributor

What

PR1 of the wfctl secrets wizard + smart CI generation cascade (design+plan: workspace:docs/plans/2026-05-30-wfctl-secrets-wizard-and-smart-ci{-design,}.md, adversarial PASS, scope-locked). Foundation for the interactive/non-interactive secrets wizard (PR2) — no behavior change to existing flows; all additive.

Tasks (1–5)

  1. Capability interfaces (secrets/secrets.go): SecretMeta, optional MetadataProvider (StatAll), optional AccessChecker (CheckAccess). Additive — secrets.Provider unchanged.
  2. GitHub provider: StatAll returns real created_at/updated_at (expanded the list decode); CheckAccess via GET public-key. Errors are redacted (no token in messages).
  3. File/env StatAll/CheckAccess (file uses mtime; env presence-only); vault/aws best-effort (ErrUnsupported fallback — no live-cred dependency in unit tests).
  4. secretsProviderAdapter wraps secrets.Provider to satisfy the wfctl-local SecretsProvider. newSecretsProvider repurposed to build via resolveSecretsProvider + adapter (now supports github/vault/aws/env/keychain — previously env-only); signature unchanged so all 7 call sites are untouched. getProviderForStore rerouted. (ADR 0005.)
  5. secrets list: UPDATED column (from metadata; when unknown), --json output for agents, per-store access line; runSecretsInit message reflects the resolved provider.

Adapter resolution precedence

Check: StatAll (authoritative on success) → Get-presence (env/file/vault/aws) → List-membership (write-only github). This precedence fix resolved a regression where env-store secrets reported unset.

Verification

  • GOWORK=off go test ./secrets/ ./cmd/wfctl/ → both ok.
  • GOWORK=off golangci-lint run ./secrets/... ./cmd/wfctl/...0 issues.
  • Adversarial design+plan review PASS; PR-level spec+quality review PASS (1 Important + Minors fixed).
  • Secrets discipline: values never logged/returned; presence + timestamp only; cred-redacted errors.

Notes

  • TestFallbackRuns (ci_run_test.go) is a pre-existing meta-test (asserts an inner subprocess fails) — untouched by this PR.
  • Copilot review intentionally not requested (service down per operator).

🤖 Generated with Claude Code

intel352 and others added 8 commits May 30, 2026 14:28
… unsupported

env store (no prefix) returns ErrUnsupported from StatAll; Check now
resolves StatAll -> Get-presence -> List-membership in precedence order so
env/file/vault/aws use Get and write-only github uses List. Fixes
TestBuildSecretStatuses_Basic/_MultiStore.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…error; harden tests

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

@github-actions
Copy link
Copy Markdown

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:303: parsing iteration count: invalid syntax
baseline-bench.txt:305845: parsing iteration count: invalid syntax
baseline-bench.txt:589652: parsing iteration count: invalid syntax
baseline-bench.txt:896139: parsing iteration count: invalid syntax
baseline-bench.txt:1208002: parsing iteration count: invalid syntax
baseline-bench.txt:1539134: parsing iteration count: invalid syntax
benchmark-results.txt:303: parsing iteration count: invalid syntax
benchmark-results.txt:294346: parsing iteration count: invalid syntax
benchmark-results.txt:639893: parsing iteration count: invalid syntax
benchmark-results.txt:923730: parsing iteration count: invalid syntax
benchmark-results.txt:1255993: parsing iteration count: invalid syntax
benchmark-results.txt:1584293: parsing iteration count: invalid syntax
goos: linux
goarch: amd64
pkg: github.com/GoCodeAlone/workflow/dynamic
cpu: AMD EPYC 7763 64-Core Processor                
                            │ baseline-bench.txt │
                            │       sec/op       │
InterpreterCreation-4               10.34m ± 65%
ComponentLoad-4                     3.599m ± 14%
ComponentExecute-4                  1.945µ ±  2%
PoolContention/workers-1-4          1.097µ ±  1%
PoolContention/workers-2-4          1.088µ ±  2%
PoolContention/workers-4-4          1.082µ ±  2%
PoolContention/workers-8-4          1.087µ ±  1%
PoolContention/workers-16-4         1.090µ ±  1%
ComponentLifecycle-4                3.616m ±  1%
SourceValidation-4                  2.349µ ±  1%
RegistryConcurrent-4                804.2n ±  2%
LoaderLoadFromString-4              3.634m ±  1%
geomean                             19.34µ

                            │ 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: AMD EPYC 9V74 80-Core Processor                
                            │ benchmark-results.txt │
                            │        sec/op         │
InterpreterCreation-4                  9.239m ± 68%
ComponentLoad-4                        3.490m ±  8%
ComponentExecute-4                     1.822µ ±  1%
PoolContention/workers-1-4             1.015µ ±  2%
PoolContention/workers-2-4             1.012µ ±  4%
PoolContention/workers-4-4             1.014µ ±  3%
PoolContention/workers-8-4             1.014µ ±  1%
PoolContention/workers-16-4            1.014µ ±  1%
ComponentLifecycle-4                   3.518m ±  1%
SourceValidation-4                     2.091µ ±  1%
RegistryConcurrent-4                   766.7n ±  4%
LoaderLoadFromString-4                 3.545m ±  1%
geomean                                18.12µ

                            │ 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 7763 64-Core Processor                
                                  │ baseline-bench.txt │
                                  │       sec/op       │
CircuitBreakerDetection-4                  287.6n ± 4%
CircuitBreakerExecution_Success-4          21.50n ± 0%
CircuitBreakerExecution_Failure-4          66.25n ± 1%
geomean                                    74.27n

                                  │ 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: AMD EPYC 9V74 80-Core Processor                
                                  │ benchmark-results.txt │
                                  │        sec/op         │
CircuitBreakerDetection-4                     297.1n ± 5%
CircuitBreakerExecution_Success-4             22.67n ± 0%
CircuitBreakerExecution_Failure-4             70.92n ± 0%
geomean                                       78.16n

                                  │ 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 7763 64-Core Processor                
                                 │ baseline-bench.txt │
                                 │       sec/op       │
IaCStateBackend_InProcess-4              352.9n ± 15%
IaCStateBackend_GRPC-4                   9.413m ±  3%
JQTransform_Simple-4                     685.9n ± 32%
JQTransform_ObjectConstruction-4         1.464µ ±  1%
JQTransform_ArraySelect-4                3.334µ ±  0%
JQTransform_Complex-4                    38.25µ ±  1%
JQTransform_Throughput-4                 1.771µ ±  1%
SSEPublishDelivery-4                     64.41n ±  1%
geomean                                  3.852µ

                                 │ baseline-bench.txt │
                                 │        B/op        │
IaCStateBackend_InProcess-4             416.0 ±  0%
IaCStateBackend_GRPC-4                5.781Mi ± 12%
JQTransform_Simple-4                  1.273Ki ±  0%
JQTransform_ObjectConstruction-4      1.773Ki ±  0%
JQTransform_ArraySelect-4             2.625Ki ±  0%
JQTransform_Complex-4                 16.31Ki ±  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      │
IaCStateBackend_InProcess-4              2.000 ± 0%
IaCStateBackend_GRPC-4                  6.838k ± 1%
JQTransform_Simple-4                     10.00 ± 0%
JQTransform_ObjectConstruction-4         15.00 ± 0%
JQTransform_ArraySelect-4                30.00 ± 0%
JQTransform_Complex-4                    328.0 ± 0%
JQTransform_Throughput-4                 17.00 ± 0%
SSEPublishDelivery-4                     0.000 ± 0%
geomean                                             ¹
¹ summaries must be >0 to compute geomean

cpu: AMD EPYC 9V74 80-Core Processor                
                                 │ benchmark-results.txt │
                                 │        sec/op         │
IaCStateBackend_InProcess-4                 324.3n ± 18%
IaCStateBackend_GRPC-4                      10.18m ±  1%
JQTransform_Simple-4                        661.0n ± 32%
JQTransform_ObjectConstruction-4            1.474µ ±  2%
JQTransform_ArraySelect-4                   3.443µ ±  1%
JQTransform_Complex-4                       42.57µ ±  2%
JQTransform_Throughput-4                    1.833µ ±  3%
SSEPublishDelivery-4                        64.29n ±  0%
geomean                                     3.918µ

                                 │ benchmark-results.txt │
                                 │         B/op          │
IaCStateBackend_InProcess-4                 416.0 ± 0%
IaCStateBackend_GRPC-4                    5.780Mi ± 6%
JQTransform_Simple-4                      1.273Ki ± 0%
JQTransform_ObjectConstruction-4          1.773Ki ± 0%
JQTransform_ArraySelect-4                 2.625Ki ± 0%
JQTransform_Complex-4                     16.31Ki ± 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       │
IaCStateBackend_InProcess-4                 2.000 ± 0%
IaCStateBackend_GRPC-4                     6.853k ± 0%
JQTransform_Simple-4                        10.00 ± 0%
JQTransform_ObjectConstruction-4            15.00 ± 0%
JQTransform_ArraySelect-4                   30.00 ± 0%
JQTransform_Complex-4                       328.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 7763 64-Core Processor                
                                    │ baseline-bench.txt │
                                    │       sec/op       │
SchemaValidation_Simple-4                    1.095µ ± 6%
SchemaValidation_AllFields-4                 1.643µ ± 1%
SchemaValidation_FormatValidation-4          1.574µ ± 1%
SchemaValidation_ManySchemas-4               1.825µ ± 3%
geomean                                      1.508µ

                                    │ 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: AMD EPYC 9V74 80-Core Processor                
                                    │ benchmark-results.txt │
                                    │        sec/op         │
SchemaValidation_Simple-4                      1.081µ ± 26%
SchemaValidation_AllFields-4                   1.644µ ±  7%
SchemaValidation_FormatValidation-4            1.621µ ±  4%
SchemaValidation_ManySchemas-4                 1.586µ ±  3%
geomean                                        1.462µ

                                    │ 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 7763 64-Core Processor                
                                   │ baseline-bench.txt │
                                   │       sec/op       │
EventStoreAppend_InMemory-4                1.289µ ± 15%
EventStoreAppend_SQLite-4                  1.315m ±  1%
GetTimeline_InMemory/events-10-4           14.47µ ±  4%
GetTimeline_InMemory/events-50-4           82.36µ ±  2%
GetTimeline_InMemory/events-100-4          165.5µ ±  1%
GetTimeline_InMemory/events-500-4          839.0µ ±  2%
GetTimeline_InMemory/events-1000-4         1.321m ± 18%
GetTimeline_SQLite/events-10-4             106.5µ ±  1%
GetTimeline_SQLite/events-50-4             249.3µ ±  2%
GetTimeline_SQLite/events-100-4            424.9µ ±  1%
GetTimeline_SQLite/events-500-4            1.826m ±  1%
GetTimeline_SQLite/events-1000-4           3.558m ±  2%
geomean                                    234.1µ

                                   │ baseline-bench.txt │
                                   │        B/op        │
EventStoreAppend_InMemory-4                  792.5 ± 6%
EventStoreAppend_SQLite-4                  1.983Ki ± 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.36Ki

                                   │ 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: AMD EPYC 9V74 80-Core Processor                
                                   │ benchmark-results.txt │
                                   │        sec/op         │
EventStoreAppend_InMemory-4                   1.083µ ± 34%
EventStoreAppend_SQLite-4                     1.034m ±  5%
GetTimeline_InMemory/events-10-4              13.47µ ±  7%
GetTimeline_InMemory/events-50-4              74.61µ ±  4%
GetTimeline_InMemory/events-100-4             112.2µ ± 36%
GetTimeline_InMemory/events-500-4             573.2µ ±  0%
GetTimeline_InMemory/events-1000-4            1.172m ±  1%
GetTimeline_SQLite/events-10-4                85.43µ ±  2%
GetTimeline_SQLite/events-50-4                225.7µ ±  1%
GetTimeline_SQLite/events-100-4               395.0µ ±  1%
GetTimeline_SQLite/events-500-4               1.724m ±  1%
GetTimeline_SQLite/events-1000-4              3.379m ±  2%
geomean                                       198.6µ

                                   │ benchmark-results.txt │
                                   │         B/op          │
EventStoreAppend_InMemory-4                     755.5 ± 2%
EventStoreAppend_SQLite-4                     1.986Ki ± 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.10Ki

                                   │ 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.

Comment thread secrets/secrets.go
if err != nil {
return fmt.Errorf("secrets: file store not accessible: %w", err)
}
f.Close()
@intel352 intel352 merged commit e9ddd15 into main May 30, 2026
22 checks passed
@intel352 intel352 deleted the feat/wfctl-secrets-metadata branch May 30, 2026 19:27
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.

1 participant