fix(tf): phase 2b — bug-fix pass (B1–B13) + -race on - #55
Closed
grubmeshi wants to merge 1 commit into
Closed
Conversation
Executes the phase-1 bug inventory (PLAN_DETAIL_02 §7, R1–R13): one flip per bug,
nothing else. All phase-1 characterization assertions that pinned buggy behavior are
retargeted to assert the corrected behavior.
- R1 B6/B10: -race stays on (Taskfile test:tf-block-runner + CI tf leg); the two
functional-only pins are dropped (races structurally eliminated in phase 2).
- R2 B1: selectWorkspace propagates the WorkspaceSelect error (no silent state-split).
- R3 B2: return the real matched workspace name, so DESTROY deletes the actual
workspace (D9-pinned naming — sanctioned delta, see CROSS_REPO_TODO.md).
- R4 B3: deleteWorkspaceIfNeeded returns after a select error instead of falling
through to WorkspaceSelect("default")/WorkspaceDelete("").
- R5 B4: plainInit retry sleeps time.Second, not 1000ns.
- R6 B5: decryptIfSensitive decrypts every sensitive value regardless of DataType
(customer-visible — sanctioned delta, see CROSS_REPO_TODO.md).
- R7 B7: NewLogWrap / initRunContextInfo return (x, error); wired into sendInitFail.
- R8 B12: Behavior.str() returns "UNKNOWN" instead of log.Fatalf.
- R9 B13: APPLY prints HINT_INIT_FAILED on init failure like DETECT/DESTROY.
- R10 B9: gitsource nil-safe *g.path in the missing-sourceDir log.
- R11 B8: installTofuBinaries honors the caller's ctx.
- R12 B11: single-run exits non-zero only for pre-flight failures (workdir/parse/
registration) before tofu init/apply begins; stays exit-0 once a run has begun —
avoids k8s BackoffLimit:1 double-execution (adjacent to frozen k8s Job contract —
sanctioned delta, see CROSS_REPO_TODO.md).
- R13: removed the tfrun/main.go behavioral golangci-lint exclusion blocks and fixed
every surfaced finding; grep FIXME(bug) = 0.
Gates: task test:tf-block-runner (-race), task lint (0 issues), task coverage
(tfrun 90.4% >= 90%) all green. Bug inventory empty; phase-2b exit criteria met.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2b — tf runner bug-fix pass
Executes the phase-1 bug inventory (PLAN_DETAIL_02 §7, R1–R13): one flip per bug, nothing else. Every phase-1 characterization assertion that pinned buggy behavior is retargeted to assert the corrected behavior; no other behavior changes.
Bug fixes (R1–R13)
-raceon (Taskfiletest:tf-block-runner+ CI tf leg); the two functional-only race pins dropped (races were structurally eliminated in phase 2).selectWorkspacepropagates theWorkspaceSelecterror (no silent state-split).deleteWorkspaceIfNeededreturns after a select error.plainInitretry sleepstime.Second, not1000ns.decryptIfSensitivedecrypts every sensitive value regardless ofDataType.NewLogWrap/initRunContextInforeturn(x, error), wired intosendInitFail.Behavior.str()returns"UNKNOWN"instead oflog.Fatalf.HINT_INIT_FAILEDon init failure like DETECT/DESTROY.gitsourcenil-safe*g.pathin the missing-sourceDir log (+ regression test).installTofuBinarieshonors the caller'sctx.tofu init/apply); stays exit-0 once a run has begun.tfrun/main.gogolangci-lint exclusion blocks and fixed every surfaced finding;grep -c "FIXME(bug)"= 0.Sanctioned deltas (PLAN_DETAIL_02 §8; hand-off notes in
CROSS_REPO_TODO.md)buildingBlockIdthat never existed on disk. Previously-orphaned local-dev workspaces will now actually be removed. Awareness note for meshfed-release maintainers.BackoffLimit:1+RestartPolicy:Neverdouble-execution hazard — only pre-terraform failures exit non-zero; a failed terminal PATCH on an already-applying run stays exit-0.Gates
task test:tf-block-runner(-race): PASStask lint: 0 issues (all three modules)task coverage:tfrun90.4% ≥ 90% (monotonic vs phase-2's 90.3%)Phase-2b exit criteria met: bug inventory empty, no
FIXME(bug)markers,-raceon.Note for reviewers
The base branch (
phase-2-tf-ddd-refactor) is the partial phase-2 (commit "phase 2, partial"): the DDD refactor tointernal/{tf,gitsource,tofu}+ Engine/ports + de-globalingAppConfigand collapsingWorker/SingleRunWorker/TfCmdis not yet done on this base. This PR applies the 2b bug inventory on the still-tfrun-shaped code. That gap is a phase-2 completion item and will trip PLAN_DETAIL_03's STOP-A (A2/A3/A4/A10) until phase 2 is finished — flagged, out of scope for this bug-fix pass.🤖 Generated with Claude Code