Skip to content

feat(iac): step.iac_commit_back + step.iac_provider_reconcile (infra-admin P2 PR5/12)#845

Merged
intel352 merged 2 commits into
mainfrom
feat/infra-p2-commitback
Jun 3, 2026
Merged

feat(iac): step.iac_commit_back + step.iac_provider_reconcile (infra-admin P2 PR5/12)#845
intel352 merged 2 commits into
mainfrom
feat/infra-p2-commitback

Conversation

@intel352

@intel352 intel352 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

PR5/12 — step.iac_commit_back + step.iac_provider_reconcile (infra-admin Phase 2)

Locked plan Tasks 9–10; ADR 0016. Closes the direct-apply loop: commit applied specs back to git (so git never drifts from state), and turn drift into an approximate review-required draft.

step.iac_commit_back

Chains after step.iac_provider_apply. Commits only on full success (apply_result.errors empty AND action_count == len(actions)) — a partial apply returns {committed:false, reason:"partial-apply"} with NO commit. Serializes the AUTHORED specs via iac/specgen.SpecToYAML (so secret:// refs are preserved verbatim, never expanded), writes them, and runs git via an injected GitExecFn. A commit failure AFTER a successful apply returns {state_diverged:true} (route → HTTP 207; idempotent). target: branch-push (default) | gh-pr.

step.iac_provider_reconcile

Drift → provider.Import → an approximate cloud-snapshot YAML (explicitly NOT SpecToYAML) → draft commit/PR carrying the mandatory warning "imported from cloud; approximate; does NOT reconstruct your secret:// refs — review before merge". target branch-push|gh-pr. Git failure → {draft:false, state_diverged:true} (never claims a draft that wasn't produced).

Git execution — host-native (design backport)

The git/gh commands run host-native via os/exec (arg slices, no shell; GH_TOKEN/GITHUB_TOKEN forwarded from the engine env), NOT in a Docker sandbox. Review proved a per-command ephemeral sandbox can't persist git state or see the repo dir; the engine committing to its own repo with a fixed argv is not untrusted-code execution (the standard-profile sandbox stays for the remote-runner's arbitrary commands in a later PR). ADR 0016 left the mechanism open. Recorded as a design backport.

Review notes (resolved)

3 Criticals fixed: ephemeral-sandbox-per-call/no-mount → host-native; git git push double-prefix → full argv; missing GH_TOKEN → forwarded. Reconcile gained target + branch-push fallback + draft:false-on-git-failure (was a contract lie). Added git-failure + partial-apply-by-count + gh-pr-target tests.

Registered in all 7 places (factory+StepTypes, DOCUMENTATION.md, coreModuleTypes, module_schema.go, step_schema_builtins.go, editor golden, plugin_test expectedSteps). Verified: go build ./... exit 0; full go test ./... exit 0 (149 ok); golangci-lint v2.12.0 --new-from-rev 0 issues.

🤖 Generated with Claude Code

…fra-admin P2 PR5/12)

Task 9: step.iac_commit_back — serialises authored specs via iac/specgen.SpecToYAML and
commits back to git after a full-success apply (no errors + action_count match). Returns
{committed:false, reason:"partial-apply"} on partial apply; {state_diverged:true} (HTTP 207)
when apply succeeded but git failed. Supports branch-push and gh-pr targets. secret:// refs
survive verbatim. Injected GitExecFn pattern mirrors apply step.

Task 10: step.iac_provider_reconcile — drift → import → approximate cloud-snapshot YAML →
draft PR. Explicitly approximate (NOT via SpecToYAML); mandatory disclaimer header. Returns
{draft:true, warning:...} when drifted resources found; {draft:false} when no drift.

All 7 registration places completed: StepTypes manifest, StepFactories, DOCUMENTATION.md,
schema/schema.go (alphabetical), schema/module_schema.go, schema/step_schema_builtins.go,
plugins/platform/plugin_test.go. Golden file regenerated. go test ./... exit 0.

Code-review fixes (CHANGES_REQUESTED):
- [Critical] Prod gitExecFn now runs HOST-NATIVE via os/exec (was a per-call ephemeral
  DockerSandbox that lost git working-tree state between commands and never mounted repo_dir,
  so every git op failed → always state_diverged). Inherits os.Environ() so GH_TOKEN/
  GITHUB_TOKEN are forwarded; no shell; full argv run directly. GitExecFn signature gains a
  workDir parameter (the step's repo_dir); the sandbox stays for the remote-runner's
  arbitrary commands in a later PR.
- [Critical] Both steps now build COMPLETE arg slices (git/gh as argv[0]) and pass them whole
  to exec — no entrypoint double-prefix, no "git git push". Removed the runGit prefix-stripping
  helpers. Uses git add -A.
- [Important] step.iac_provider_reconcile gains a target config (branch-push default | gh-pr);
  branch-push pushes the draft branch, gh-pr calls gh pr create --draft. Git failure now
  returns {draft:false, state_diverged:true, reason} (was a false draft:true with no PR).
- [Important] Added TestIaCProviderReconcile_GitFails_StateDiverged + TestIaCProviderReconcile_GhPRTarget.
- [Minor] Added TestIaCCommitBack_PartialApplyByCount_NoCommit (empty errors but
  action_count > len(actions) → not full success) + workdir/full-argv assertions.

golangci-lint v2.12.0 --new-from-rev=origin/main ./module/ ./plugins/platform/: 0 issues.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 3, 2026 00:16

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 two new IaC pipeline steps to close the “direct apply → git drift” loop: (1) committing authored specs back to git only on full-success applies, and (2) reconciling detected drift by importing an approximate cloud snapshot and opening/pushing a draft for review.

Changes:

  • Introduces step.iac_commit_back to serialize authored specs via iac/specgen.SpecToYAML and commit/push (or open PR) only on full apply success.
  • Introduces step.iac_provider_reconcile to detect drift, import approximate state snapshots, and publish a draft branch/PR with a mandatory warning.
  • Registers both steps across schema/docs/editor golden data and wires platform plugin factories + tests.

Reviewed changes

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

Show a summary per file
File Description
schema/testdata/editor-schemas.golden.json Adds editor schema entries for the two new step types.
schema/step_schema_builtins.go Registers schemas/config/outputs for step.iac_commit_back and step.iac_provider_reconcile.
schema/schema.go Adds new step types to coreModuleTypes.
schema/module_schema.go Adds module schema descriptors for the two new steps.
plugins/platform/plugin.go Adds host-native gitExecFn and wires both new step factories into the platform plugin.
plugins/platform/plugin_test.go Updates expected platform step factory list to include the new steps.
module/pipeline_step_iac_provider_reconcile.go Implements reconcile step: drift detection → import → YAML snapshot → draft publish.
module/pipeline_step_iac_provider_reconcile_test.go Adds tests covering reconcile targets, warning text, and git-failure behavior.
module/pipeline_step_iac_commit_back.go Implements commit-back step and “full success” gating based on apply output.
module/pipeline_step_iac_commit_back_test.go Adds tests covering full success, partial apply, secret ref survival, gh-pr target, and git failures.
DOCUMENTATION.md Documents the two new steps in the step catalog.

Comment thread plugins/platform/plugin.go Outdated
Comment thread module/pipeline_step_iac_commit_back.go
Comment thread module/pipeline_step_iac_commit_back.go Outdated
Comment thread module/pipeline_step_iac_provider_reconcile.go Outdated
Comment thread module/pipeline_step_iac_provider_reconcile.go Outdated
Comment thread schema/step_schema_builtins.go Outdated
Comment thread module/pipeline_step_iac_provider_reconcile.go
@codecov

codecov Bot commented Jun 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.96450% with 88 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
module/pipeline_step_iac_commit_back.go 75.00% 26 Missing and 7 partials ⚠️
module/pipeline_step_iac_provider_reconcile.go 77.85% 19 Missing and 12 partials ⚠️
plugins/platform/plugin.go 4.00% 24 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

⏱ Benchmark Results

No significant performance regressions detected.

benchstat comparison (baseline → PR)
## benchstat: baseline → PR
baseline-bench.txt:302: parsing iteration count: invalid syntax
baseline-bench.txt:334269: parsing iteration count: invalid syntax
baseline-bench.txt:623149: parsing iteration count: invalid syntax
baseline-bench.txt:918548: parsing iteration count: invalid syntax
baseline-bench.txt:1244346: parsing iteration count: invalid syntax
baseline-bench.txt:1565392: parsing iteration count: invalid syntax
benchmark-results.txt:302: parsing iteration count: invalid syntax
benchmark-results.txt:351906: parsing iteration count: invalid syntax
benchmark-results.txt:657304: parsing iteration count: invalid syntax
benchmark-results.txt:960206: parsing iteration count: invalid syntax
benchmark-results.txt:1282608: parsing iteration count: invalid syntax
benchmark-results.txt:1634239: 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 │       benchmark-results.txt        │
                            │       sec/op       │    sec/op     vs base              │
InterpreterCreation-4               8.968m ± 62%   7.150m ± 57%       ~ (p=0.394 n=6)
ComponentLoad-4                     3.600m ±  1%   3.563m ± 11%       ~ (p=0.065 n=6)
ComponentExecute-4                  1.959µ ±  2%   1.915µ ±  2%  -2.27% (p=0.009 n=6)
PoolContention/workers-1-4          1.117µ ±  1%   1.081µ ±  2%  -3.22% (p=0.002 n=6)
PoolContention/workers-2-4          1.098µ ±  2%   1.079µ ±  1%       ~ (p=0.056 n=6)
PoolContention/workers-4-4          1.093µ ±  1%   1.077µ ±  1%  -1.51% (p=0.009 n=6)
PoolContention/workers-8-4          1.093µ ±  2%   1.084µ ±  2%       ~ (p=0.119 n=6)
PoolContention/workers-16-4         1.094µ ±  3%   1.083µ ±  2%  -1.05% (p=0.022 n=6)
ComponentLifecycle-4                3.613m ±  1%   3.559m ±  1%  -1.48% (p=0.004 n=6)
SourceValidation-4                  2.308µ ±  0%   2.305µ ±  1%       ~ (p=0.794 n=6)
RegistryConcurrent-4                794.9n ±  4%   790.9n ±  5%       ~ (p=1.000 n=6)
LoaderLoadFromString-4              3.664m ±  1%   3.580m ±  1%  -2.30% (p=0.002 n=6)
geomean                             19.17µ         18.56µ        -3.19%

                            │ baseline-bench.txt │        benchmark-results.txt         │
                            │        B/op        │     B/op      vs base                │
InterpreterCreation-4               2.027Mi ± 0%   2.027Mi ± 0%       ~ (p=0.701 n=6)
ComponentLoad-4                     2.180Mi ± 0%   2.180Mi ± 0%       ~ (p=0.699 n=6)
ComponentExecute-4                  1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4          1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4         1.203Ki ± 0%   1.203Ki ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                2.183Mi ± 0%   2.183Mi ± 0%       ~ (p=0.617 n=6)
SourceValidation-4                  1.984Ki ± 0%   1.984Ki ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                1.133Ki ± 0%   1.133Ki ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4              2.182Mi ± 0%   2.182Mi ± 0%       ~ (p=0.310 n=6)
geomean                             15.25Ki        15.25Ki       +0.00%
¹ all samples are equal

                            │ baseline-bench.txt │        benchmark-results.txt        │
                            │     allocs/op      │  allocs/op   vs base                │
InterpreterCreation-4                15.68k ± 0%   15.68k ± 0%       ~ (p=1.000 n=6)
ComponentLoad-4                      18.02k ± 0%   18.02k ± 0%       ~ (p=1.000 n=6)
ComponentExecute-4                    25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-1-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-2-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-4-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-8-4            25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
PoolContention/workers-16-4           25.00 ± 0%    25.00 ± 0%       ~ (p=1.000 n=6) ¹
ComponentLifecycle-4                 18.07k ± 0%   18.07k ± 0%       ~ (p=1.000 n=6) ¹
SourceValidation-4                    32.00 ± 0%    32.00 ± 0%       ~ (p=1.000 n=6) ¹
RegistryConcurrent-4                  2.000 ± 0%    2.000 ± 0%       ~ (p=1.000 n=6) ¹
LoaderLoadFromString-4               18.06k ± 0%   18.06k ± 0%       ~ (p=1.000 n=6) ¹
geomean                               183.3         183.3       +0.00%
¹ all samples are equal

pkg: github.com/GoCodeAlone/workflow/middleware
                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │       sec/op       │    sec/op     vs base              │
CircuitBreakerDetection-4                  286.7n ± 4%   288.5n ± 19%       ~ (p=0.905 n=6)
CircuitBreakerExecution_Success-4          21.53n ± 0%   21.55n ±  0%       ~ (p=0.229 n=6)
CircuitBreakerExecution_Failure-4          66.20n ± 1%   66.23n ±  0%       ~ (p=0.290 n=6)
geomean                                    74.20n        74.40n        +0.27%

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │        B/op        │    B/op     vs base                │
CircuitBreakerDetection-4                 144.0 ± 0%     144.0 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                  │ baseline-bench.txt │       benchmark-results.txt        │
                                  │     allocs/op      │ allocs/op   vs base                │
CircuitBreakerDetection-4                 1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Success-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
CircuitBreakerExecution_Failure-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                              ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/module
                                 │ baseline-bench.txt │       benchmark-results.txt        │
                                 │       sec/op       │    sec/op     vs base              │
IaCStateBackend_InProcess-4              310.0n ±  2%   317.7n ± 33%  +2.47% (p=0.004 n=6)
IaCStateBackend_GRPC-4                   9.494m ± 12%   9.435m ±  3%       ~ (p=0.394 n=6)
JQTransform_Simple-4                     665.3n ± 37%   679.3n ± 35%       ~ (p=0.394 n=6)
JQTransform_ObjectConstruction-4         1.505µ ±  2%   1.517µ ±  1%       ~ (p=0.102 n=6)
JQTransform_ArraySelect-4                3.453µ ±  1%   3.399µ ±  0%  -1.56% (p=0.002 n=6)
JQTransform_Complex-4                    38.90µ ±  1%   39.39µ ±  3%  +1.25% (p=0.002 n=6)
JQTransform_Throughput-4                 1.854µ ±  1%   1.849µ ±  3%       ~ (p=0.855 n=6)
SSEPublishDelivery-4                     64.21n ±  0%   68.93n ±  2%  +7.35% (p=0.002 n=6)
geomean                                  3.838µ         3.892µ        +1.41%

                                 │ baseline-bench.txt │         benchmark-results.txt         │
                                 │        B/op        │     B/op       vs base                │
IaCStateBackend_InProcess-4             416.0 ±  0%       416.0 ±  0%       ~ (p=1.000 n=6) ¹
IaCStateBackend_GRPC-4                5.882Mi ± 10%     5.856Mi ± 12%       ~ (p=0.699 n=6)
JQTransform_Simple-4                  1.273Ki ±  0%     1.273Ki ±  0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4      1.773Ki ±  0%     1.773Ki ±  0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4             2.625Ki ±  0%     2.625Ki ±  0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                 16.31Ki ±  0%     16.31Ki ±  0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4              1.984Ki ±  0%     1.984Ki ±  0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                    0.000 ±  0%       0.000 ±  0%       ~ (p=1.000 n=6) ¹
geomean                                             ²                  -0.06%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                 │ baseline-bench.txt │        benchmark-results.txt        │
                                 │     allocs/op      │  allocs/op   vs base                │
IaCStateBackend_InProcess-4              2.000 ± 0%      2.000 ± 0%       ~ (p=1.000 n=6) ¹
IaCStateBackend_GRPC-4                  6.833k ± 0%     6.832k ± 0%       ~ (p=1.000 n=6)
JQTransform_Simple-4                     10.00 ± 0%      10.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ObjectConstruction-4         15.00 ± 0%      15.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_ArraySelect-4                30.00 ± 0%      30.00 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Complex-4                    328.0 ± 0%      328.0 ± 0%       ~ (p=1.000 n=6) ¹
JQTransform_Throughput-4                 17.00 ± 0%      17.00 ± 0%       ~ (p=1.000 n=6) ¹
SSEPublishDelivery-4                     0.000 ± 0%      0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                             ²                -0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/schema
                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │       sec/op       │    sec/op     vs base              │
SchemaValidation_Simple-4                    1.114µ ± 6%   1.103µ ± 17%       ~ (p=0.260 n=6)
SchemaValidation_AllFields-4                 1.657µ ± 1%   1.673µ ±  2%  +1.00% (p=0.045 n=6)
SchemaValidation_FormatValidation-4          1.578µ ± 2%   1.581µ ±  1%       ~ (p=0.790 n=6)
SchemaValidation_ManySchemas-4               1.825µ ± 2%   1.868µ ±  2%       ~ (p=0.065 n=6)
geomean                                      1.518µ        1.528µ        +0.66%

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │        B/op        │    B/op     vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                    │ baseline-bench.txt │       benchmark-results.txt        │
                                    │     allocs/op      │ allocs/op   vs base                │
SchemaValidation_Simple-4                   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_AllFields-4                0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_FormatValidation-4         0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
SchemaValidation_ManySchemas-4              0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                                                ²               +0.00%               ²
¹ all samples are equal
² summaries must be >0 to compute geomean

pkg: github.com/GoCodeAlone/workflow/store
                                   │ baseline-bench.txt │       benchmark-results.txt        │
                                   │       sec/op       │    sec/op     vs base              │
EventStoreAppend_InMemory-4                1.221µ ± 20%   1.229µ ± 20%       ~ (p=0.818 n=6)
EventStoreAppend_SQLite-4                  1.237m ±  6%   1.302m ± 10%  +5.27% (p=0.041 n=6)
GetTimeline_InMemory/events-10-4           14.46µ ±  4%   14.23µ ±  3%       ~ (p=0.310 n=6)
GetTimeline_InMemory/events-50-4           81.44µ ±  4%   77.95µ ±  7%       ~ (p=0.065 n=6)
GetTimeline_InMemory/events-100-4          128.7µ ± 27%   121.5µ ±  1%  -5.59% (p=0.002 n=6)
GetTimeline_InMemory/events-500-4          651.8µ ±  1%   625.5µ ±  1%  -4.03% (p=0.002 n=6)
GetTimeline_InMemory/events-1000-4         1.337m ±  1%   1.286m ±  1%  -3.79% (p=0.002 n=6)
GetTimeline_SQLite/events-10-4             73.52µ ±  1%   72.15µ ±  1%  -1.87% (p=0.002 n=6)
GetTimeline_SQLite/events-50-4             222.8µ ±  1%   213.4µ ±  1%  -4.19% (p=0.002 n=6)
GetTimeline_SQLite/events-100-4            404.7µ ±  0%   387.5µ ±  1%  -4.27% (p=0.002 n=6)
GetTimeline_SQLite/events-500-4            1.853m ±  1%   1.763m ±  1%  -4.86% (p=0.002 n=6)
GetTimeline_SQLite/events-1000-4           3.692m ±  3%   3.539m ±  4%  -4.15% (p=0.009 n=6)
geomean                                    213.6µ         207.7µ        -2.77%

                                   │ baseline-bench.txt │         benchmark-results.txt         │
                                   │        B/op        │     B/op       vs base                │
EventStoreAppend_InMemory-4                  805.0 ± 7%     773.5 ± 11%       ~ (p=0.699 n=6)
EventStoreAppend_SQLite-4                  1.983Ki ± 3%   1.985Ki ±  2%       ~ (p=0.615 n=6)
GetTimeline_InMemory/events-10-4           7.953Ki ± 0%   7.953Ki ±  0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4           46.62Ki ± 0%   46.62Ki ±  0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4          94.48Ki ± 0%   94.48Ki ±  0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4          472.8Ki ± 0%   472.8Ki ±  0%       ~ (p=0.182 n=6)
GetTimeline_InMemory/events-1000-4         944.3Ki ± 0%   944.3Ki ±  0%       ~ (p=0.141 n=6)
GetTimeline_SQLite/events-10-4             16.74Ki ± 0%   16.74Ki ±  0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4             87.14Ki ± 0%   87.14Ki ±  0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4            175.4Ki ± 0%   175.4Ki ±  0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4            846.1Ki ± 0%   846.1Ki ±  0%  -0.00% (p=0.035 n=6)
GetTimeline_SQLite/events-1000-4           1.639Mi ± 0%   1.639Mi ±  0%       ~ (p=0.152 n=6)
geomean                                    67.45Ki        67.23Ki        -0.32%
¹ all samples are equal

                                   │ baseline-bench.txt │        benchmark-results.txt        │
                                   │     allocs/op      │  allocs/op   vs base                │
EventStoreAppend_InMemory-4                  7.000 ± 0%    7.000 ± 0%       ~ (p=1.000 n=6) ¹
EventStoreAppend_SQLite-4                    53.00 ± 0%    53.00 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-10-4             125.0 ± 0%    125.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-50-4             653.0 ± 0%    653.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-100-4           1.306k ± 0%   1.306k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-500-4           6.514k ± 0%   6.514k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_InMemory/events-1000-4          13.02k ± 0%   13.02k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-10-4               382.0 ± 0%    382.0 ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-50-4              1.852k ± 0%   1.852k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-100-4             3.681k ± 0%   3.681k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-500-4             18.54k ± 0%   18.54k ± 0%       ~ (p=1.000 n=6) ¹
GetTimeline_SQLite/events-1000-4            37.29k ± 0%   37.29k ± 0%       ~ (p=1.000 n=6) ¹
geomean                                     1.162k        1.162k       +0.00%
¹ all samples are equal

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

…ety, target validation, drift order, count doc)

- gitExecFn: dedupe env (build map from os.Environ, overrides win) so GH_TOKEN
  override reliably takes effect (was duplicate KEY= entries).
- isFullSuccess: require action_count present + numeric — missing/non-numeric
  no longer classifies as full success (closes commit-on-empty/garbage hazard).
- commit_back + reconcile: validate 'target' ∈ {branch-push, gh-pr}, factory
  error on unknown (was silent default).
- reconcile: match DetectDrift results to refs by Name+Type (was positional
  index → wrong ProviderID / panic on reordered/short results).
- count doc: 'drifted resources detected' (matches len(drifted)) in schema +
  comment.
Tests: MissingActionCount/NonNumericActionCount_NoCommit, DriftOrderIndependent,
Factory_InvalidTarget (both steps) — the safety/panic ones proven to fail pre-fix.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@intel352 intel352 merged commit 2311f0f into main Jun 3, 2026
22 checks passed
@intel352 intel352 deleted the feat/infra-p2-commitback branch June 3, 2026 00:50
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