fix(infra): context propagation + audit plan doc#325
Conversation
… context.Background() in engine - engine.go: replace context.TODO() with context.Background() in BuildFromConfig infra wiring - infra/provisioner.go: provisionResource and destroyResource now accept ctx and forward it to provider calls so cancellation propagates correctly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Design document for the comprehensive workflow repo audit fix covering anti-staleness, interface extraction, infra provisioner, dead code cleanup, missing schemas, drift-detection tests, and unit test coverage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR finishes the infra context-plumbing work by propagating context.Context through the infrastructure provisioner’s internal operations so provider implementations can observe cancellation, and it adds an audit fix implementation plan document for reference.
Changes:
- Thread
ctxthroughProvisioner.provisionResource/Provisioner.destroyResourceand use that context when invoking providers. - Replace
context.TODO()withcontext.Background()for infra provisioning inStdEngine.BuildFromConfig. - Add
docs/plans/2026-03-13-audit-fix-design.md(audit fix implementation plan).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| infra/provisioner.go | Passes ctx into provision/destroy helpers and into provider provisioning calls. |
| engine.go | Uses context.Background() for infra plan application during build. |
| docs/plans/2026-03-13-audit-fix-design.md | Adds a detailed implementation plan for the broader audit work. |
| @@ -0,0 +1,1245 @@ | |||
| # Workflow Audit Fix Implementation Plan | |||
|
|
|||
| > **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. | |||
There was a problem hiding this comment.
This is an internal execution plan in docs/plans/ — not contributor documentation. Plan docs in this repo include agent instructions by convention.
⏱ Benchmark Results✅ No significant performance regressions detected. benchstat comparison (baseline → PR)
|
destroyResource now calls prov.Destroy(ctx, name) for the matching provider before removing the resource from the internal map. Mirrors the provisionResource pattern. On provider error, the resource is retained with status "failed" instead of being silently dropped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
ctxthroughprovisionResource/destroyResourceso cancellation propagates to providers. Changecontext.TODO()→context.Background()inBuildFromConfiginfra call.docs/plans/2026-03-13-audit-fix-design.md)This is the final piece of the comprehensive workflow repo audit fix. The bulk of the work (18 commits) was landed directly on main:
What was done (full audit)
knownStepTypeDescriptions(), replaced with schema registry lookups. CreatedTemplateFuncRegistrywith all 40 functions + drift tests.step.db_querydefault fixed to"list",step.conditionalroutes marked required, 11 missing step schemas added, ~86 step types added tocoreModuleTypes.PipelineStep/StepResult/PipelineContextmoved tointerfaces/package,engine.stepRegistryusesStepRegistrarabstraction (closes TODO phase5).ResourceProviderinterface +MemoryProvider, wired intoBuildFromConfigvia optionalinfrastructure:config block.ErrNotImplemented.consistency_test.godrift-detection across schema, coreModuleTypes, template funcs, and engine registrations.Test plan
go build ./...passesgo test ./infra/ -v— all 23 tests pass includingTestApplyCancelledContextgo test ./... -count=1— full suite passesTestCoreStepTypesHaveSchemas,TestSchemaRegistryTypesInCoreModuleTypes,TestTemplateFuncDescriptionsCoversFuncMap,TestRegistryConsistencyall pass🤖 Generated with Claude Code