From 5d5de4b200a09973d9c3e303203dd6d9f159d440 Mon Sep 17 00:00:00 2001 From: matdev83 Date: Thu, 3 Sep 2026 23:00:20 +0200 Subject: [PATCH] fix(pre-oss): hermetic git identity in inventory SHA test --- tools/kiro/speccheck/residual_ownership_inventory_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/kiro/speccheck/residual_ownership_inventory_test.go b/tools/kiro/speccheck/residual_ownership_inventory_test.go index 40a1186a..5771a806 100644 --- a/tools/kiro/speccheck/residual_ownership_inventory_test.go +++ b/tools/kiro/speccheck/residual_ownership_inventory_test.go @@ -1257,7 +1257,13 @@ func TestResidualOwnershipInventoryContract_ValidatesSHAIdentity(t *testing.T) { if err != nil { t.Fatalf("rev-parse tree: %v", err) } - commitOutput, err := exec.Command("git", "-C", root, "commit-tree", "-m", "test-not-ancestor", strings.TrimSpace(string(treeOutput))).Output() + // Hermetic committer identity: commit-tree must not depend on ambient + // git user.name/user.email (bare CI workers have none configured). + commitOutput, err := exec.Command("git", "-C", root, + "-c", "user.name=speccheck-test", + "-c", "user.email=speccheck@example.invalid", + "-c", "commit.gpgsign=false", + "commit-tree", "-m", "test-not-ancestor", strings.TrimSpace(string(treeOutput))).Output() if err != nil { t.Fatalf("commit-tree: %v", err) }