Skip to content

fix: Un-gitignore fab/.fab-version#477

Merged
sahil-noon merged 4 commits into
mainfrom
260708-8ken-fab-version-gitignore-fix
Jul 9, 2026
Merged

fix: Un-gitignore fab/.fab-version#477
sahil-noon merged 4 commits into
mainfrom
260708-8ken-fab-version-gitignore-fix

Conversation

@sahil-noon

Copy link
Copy Markdown
Collaborator

Meta

Change ID Type Confidence Plan Review
8ken fix 5.0/5.0 10/10 tasks, 16/16 acceptance ✓ ✓ 1 cycle
Impact +/− Net
raw +789 / −11 +778
true +331 / −1 +330
└ impl +132 / −1 +131
└ tests +199 / −0 +199

excludes fab/, docs/ · generated by fab-kit v2.15.1

Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr

Summary

fab/.fab-version is silently swallowed by the .fab-* gitignore pattern (added for root runtime files like .fab-status.yaml), so it can never be committed even though the design says it should be. Post-migration, this leaves every fresh checkout — new worktree, new clone, CI — without a version source, causing wt create/fab sync to fail with "no fab version found."

Changes

  • This repo's own .gitignore + commit the file
  • Scaffold fragment gains the negation (all future + syncing projects)
  • Migration for already-shipped repos: verify + commit
  • Stamp-path hardening (fail-open warning)
  • Version + docs obligations

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a regression where fab/.fab-version was unintentionally ignored by the unanchored .fab-* gitignore pattern, preventing the version pin from being committed and breaking fresh clones/worktrees/CI that rely on that version source.

Changes:

  • Un-ignores fab/.fab-version in both this repo and the shipped scaffold .gitignore fragment.
  • Adds a new 2.15.1-to-2.15.2 migration documenting the verify+commit remediation for already-shipped repos, and bumps the kit version to 2.15.2.
  • Hardens init/upgrade by emitting a fail-open stderr warning when the stamped fab/.fab-version is still gitignored; adds focused tests and updates docs/memory to reflect the load-bearing negation.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/kit/VERSION Bumps kit version to 2.15.2.
src/kit/scaffold/fragment-.gitignore Adds !fab/.fab-version negation under .fab-* for future/self-healing syncs.
src/kit/migrations/2.15.1-to-2.15.2.md Adds migration guidance to ensure negation + commit of fab/.fab-version.
src/go/fab-kit/internal/upgrade.go Calls the new warning helper after stamping .fab-version.
src/go/fab-kit/internal/scaffold_test.go Adds tests pinning fragment merge semantics for the new negation line.
src/go/fab-kit/internal/init.go Adds warnIfFabVersionIgnored and wires it into Init after stamping.
src/go/fab-kit/internal/init_test.go Adds stderr-capture helper + tests for the warning behavior.
fab/changes/260708-8ken-fab-version-gitignore-fix/plan.md Records requirements/tasks/acceptance for the change.
fab/changes/260708-8ken-fab-version-gitignore-fix/intake.md Captures incident diagnosis and design decisions for the fix.
fab/changes/260708-8ken-fab-version-gitignore-fix/.status.yaml Tracks change pipeline state/metrics for this change.
fab/changes/260708-8ken-fab-version-gitignore-fix/.history.jsonl Logs stage transitions and change history events.
fab/.fab-version Commits the repo’s pinned fab version file.
docs/specs/config.md Documents the gitignore caveat + required negation to keep .fab-version committable.
docs/memory/distribution/setup.md Updates setup memory with the new negation semantics and rationale.
docs/memory/distribution/migrations.md Adds memory entry for the new 2.15.1-to-2.15.2 migration behavior.
docs/memory/distribution/kit-architecture.md Updates architecture memory with committability mechanisms and warning helper wiring.
docs/memory/distribution/index.md Refreshes distribution index entries to reflect updated memories.
docs/memory/_shared/index.md Updates shared index to reflect configuration memory changes.
docs/memory/_shared/configuration.md Updates configuration memory with the new committability caveat + warning behavior.
.gitignore Adds !fab/.fab-version negation under .fab-* in this repo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +370 to +389
func captureStderr(t *testing.T, fn func()) string {
t.Helper()
r, w, err := os.Pipe()
if err != nil {
t.Fatal(err)
}
orig := os.Stderr
os.Stderr = w
done := make(chan string, 1)
go func() {
data, _ := io.ReadAll(r)
done <- string(data)
}()
fn()
os.Stderr = orig
w.Close()
out := <-done
r.Close()
return out
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed — restored os.Stderr via a deferred restore and now close the pipe writer through a deferred wrapper around fn, matching captureStdout, so a panic or runtime.Goexit (e.g. t.Fatal) inside fn can no longer leak the pipe or leave stderr redirected into later tests. The concurrent drain goroutine is preserved. (09dc4b4)

sahil87 added 2 commits July 8, 2026 22:28
Align captureStderr with captureStdout — restore os.Stderr via defer and
close the pipe writer through a deferred wrapper around fn, so a panic or
runtime.Goexit (e.g. t.Fatal) inside fn cannot leak the pipe or leave
stderr redirected into subsequent tests.
@sahil-noon sahil-noon marked this pull request as ready for review July 9, 2026 10:45
@sahil-noon sahil-noon merged commit c0c6c91 into main Jul 9, 2026
3 checks passed
@sahil-noon sahil-noon deleted the 260708-8ken-fab-version-gitignore-fix branch July 9, 2026 10:46
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.

3 participants