#940 corpus-fetch: guard that the manifest reaches no estate-gen cohort - #941
Merged
Conversation
The writer #940 describes is already gone: f8b5ab9 (#699) removed the `live/e2e/estates/*` glob from live/corpus-manifest.json, and the module pass only writes .terraform/modules into directories the manifest resolves. The 31 stray directories the issue saw were written at 20:15:59 on 2026-09-06 in a worktree created three minutes earlier on a PRE-#699 main (70e2722), by a corpus-fetch run against the manifest as it then was; the 21:08 rebase onto 22d9a3f deleted the tracked cohort trees and left the untracked .terraform/ behind. The primary checkout's copies date from 2026-08-16/18, so they are the same leftover, not a new write. On main today a fresh worktree plus `just corpus-fetch` leaves live/e2e/estates untouched. What this adds is the guard the issue asked for. TestManifestReachesNoEstateGenCohort resolves the real manifest against a temp root where every cohort in internal/live/cohorts holds a configuration file, so a glob reaching that path cannot hide behind Resolve's empty-directory skip, and fails naming each directory the module pass would write into. Proven red by re-adding the pre-#699 glob to the manifest: --- FAIL: TestManifestReachesNoEstateGenCohort (0.01s) estates_test.go:60: live/corpus-manifest.json resolves 32 director(ies) under live/e2e/estates/, so `just corpus-fetch` would write .terraform/modules into each of them (#940, #699): live/e2e/estates/ai-location live/e2e/estates/any-other-name ... then green with the manifest restored: ok github.com/intentius/choudoufu/tools/corpus-fetch 1.447s Existing worktrees clear their leftovers with `git clean -fd -- live/e2e/estates`; nothing tracked lives under a .terraform/ there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KXQqcqYiLU513jwXziuQnh
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.
Closes #940.
What the issue saw, and what actually wrote it
The writer is already gone on main: f8b5ab9 (#699) removed the
live/e2e/estates/*glob fromlive/corpus-manifest.json, and corpus-fetch's module pass only writes.terraform/modules/modules.jsoninto directoriesManifest.Resolvereturns. No code path nameslive/e2e/estatesany more.The 31 stray directories were real, but they came from before the merge. Timestamps in the
plan-approval-remeasure-903worktree:git merge-base --is-ancestorconfirms).corpus/clonedlive/corpus-module-pins.jsonwritten and everylive/e2e/estates/*/.terraform/modules/modules.jsonwritten, same second: the corpus-fetch run, against the manifest as it then was.terraform/staysThe primary checkout's copies date from 2026-08-16/18, the same leftover from before #699 rather than a new write. A fresh worktree on today's main has none.
What this adds
The guard the issue asked for:
TestManifestReachesNoEstateGenCohortintools/corpus-fetchresolves the real manifest against a temp root where every cohort ininternal/live/cohortsholds amain.tf, so a glob that reaches the path cannot hide behindResolve's empty-directory skip. It fails naming each directory the module pass would write into.Proven red by re-adding the pre-#699 glob:
Green with the manifest restored:
Clearing the leftovers
Any worktree that still shows the 31 entries clears them with
git clean -fd -- live/e2e/estates. Nothing tracked lives under a.terraform/there. Not done to the primary checkout by this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01KXQqcqYiLU513jwXziuQnh