feat(topdata): materialize Git-LFS asset bytes inside Crucible before packing

Adds materializeAssetLFS + hasLFSPointerStubs helpers to top_package.go.
Called at the top of packageBuiltTopData so bare CI checkouts never ship
~130-byte LFS pointer stubs. Opt-out via CRUCIBLE_SKIP_LFS env or the new
--skip-lfs flag on build-topdata / build-top-package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-21 14:50:47 +02:00
co-authored by Claude Sonnet 4.6
parent 945204ce50
commit bdac6f29f0
3 changed files with 126 additions and 1 deletions
+15 -1
View File
@@ -1625,6 +1625,12 @@ func runBuildTopData(ctx context) error {
return err
}
if opts.SkipLFS {
// ponytail: bridge --skip-lfs flag to env rather than threading a new param
// through packageBuiltTopData; CRUCIBLE_SKIP_LFS is already checked there.
os.Setenv("CRUCIBLE_SKIP_LFS", "1") //nolint:errcheck
}
console := newTopdataConsole(ctx, p, "build-topdata")
spin.configure(ctx.stderr, console.spinnerEnabled)
spin.start("Build Topdata: starting")
@@ -1653,6 +1659,12 @@ func runBuildTopPackage(ctx context) error {
return fmt.Errorf("--wiki is not supported with build-top-package; use build-topdata when wiki generation is required")
}
if opts.SkipLFS {
// ponytail: bridge --skip-lfs flag to env rather than threading a new param
// through packageBuiltTopData; CRUCIBLE_SKIP_LFS is already checked there.
os.Setenv("CRUCIBLE_SKIP_LFS", "1") //nolint:errcheck
}
console := newTopdataConsole(ctx, p, "build-top-package")
spin.configure(ctx.stderr, console.spinnerEnabled)
spin.start("Build Top Package: starting")
@@ -1674,8 +1686,10 @@ func parseBuildTopDataArgs(commandName string, args []string) (topdata.BuildAndP
opts.Force = true
case "--wiki":
opts.BuildWiki = true
case "--skip-lfs":
opts.SkipLFS = true
case "-h", "--help":
return opts, fmt.Errorf("usage: %s [--force] [--wiki]", commandName)
return opts, fmt.Errorf("usage: %s [--force] [--wiki] [--skip-lfs]", commandName)
default:
return opts, fmt.Errorf("unknown %s argument %q", commandName, arg)
}