Skip to content

gem build fails on main (141-byte filename), and the package it would ship is 497 files of which 114 are lib/ #55

Closed

Description

@minerva-sky

gem build agentic.gemspec on current main does not produce a gem. It dies in the tar writer:

ERROR:  While executing gem ... (Gem::Package::TooLongFileName)
    File ".architecture/reviews/specialist-security_specialist-security::config-custom-pattern-matching-issue---custom-patterns-being-overridden-by-built-in-phone-pattern.md" has a too long name

That basename is 141 bytes; the ustar format caps a path component at 100. The file landed with #7 (the local-mainline port), so every commit since then has been unreleasable, and nothing noticed because CI's rake default runs spec + standard and never builds the package.

The failing file is a symptom. The real problem is spec.files:

spec.files = IO.popen(%w[git ls-files -z], ...) do |ls|
  ls.readlines("\x0", chomp: true).reject do |f|
    (f == gemspec) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
  end
end

"Everything tracked, minus six prefixes" was fine for the bundler template it came from. Here it ships the maintainer's working directory. What the package at HEAD would contain, grouped by top-level path:

count path
151 docs/
133 examples/
114 lib/
63 .architecture/ (ADRs, reviews, recalibration plans, templates)
26 repo root
4 .claude-sessions/
1 each .claude/settings.local.json, benchmark/boot.rb, plugins/README.md, reports/human_intervention_portal_implementation_20250617_160213.json, sig/, exe/

497 files, 114 of them the library. The root 26 include human_intervention_portal_implementation.rb (a 705-line run script), test_portal_integration.rb (a hand-rolled test that require_relatives straight into lib/, bypassing the Zeitwerk loader), plan-20250608_235604.json (a saved plan whose task text is about a podcast guest), justin.bowen.md (the LLM output of that plan), CLAUDE.md, MAINTAINING.md, V0.4.0_ROADMAP.md, V0.4.0_RELEASE_PLAN.md, and the two Architect*.md process docs.

This is not hypothetical. I pulled agentic-0.2.0.gem from rubygems.org: 135 files, and .claude/settings.local.json, all four .claude-sessions/*.md, and 45 .architecture/ files are already in it. Nothing in there is secret (I read settings.local.json; it is a permissions allowlist and an MCP server entry), but a consumer running gem contents agentic gets a Claude Code session transcript and the maintainer's ADR templates alongside the library.

WORLD.md asks for "good gem citizenship" and a core "auditable in an afternoon." The package is the first thing an auditor opens.

Proposed fix (one small PR):

  1. Replace the git ls-files subtraction with an allowlist: Dir["lib/**/*.rb"] + Dir["sig/**/*.rbs"] + Dir["exe/*"] + %w[LICENSE.txt README.md CHANGELOG.md]. Explicit, no shell-out, no dependence on what happens to be tracked.
  2. Add one spec that loads the gemspec and asserts every entry in spec.files is under one of those paths and has no component over 100 bytes. Cheap, and it turns "the gem builds" into a CI fact instead of a release-day surprise.
  3. Separately (not in that PR, maintainer's call): the root-level run artifacts (justin.bowen.md, plan-*.json, reports/*.json, test_portal_integration.rb, human_intervention_portal_implementation*.{rb,md}) look like one-off outputs that got committed. Moving them under examples/ or deleting them is a separate chore, and the allowlist makes it stop mattering for the package either way.

Not touching docs/ or examples/ in the repo. The question is only what ships.

Conflicts: #27 and #29 both edit agentic.gemspec (dependency lines, not spec.files); a rebase is trivial.

Class: code-refactor (L1)
Minerva's lean: allowlist spec.files to lib/ sig/ exe/ plus the three top-level docs, and add the spec; the package should be the library, not the repo.

Intended labels: loop:quality, status:analyzed.

Activity

  1. added a commit that references this issue on Oct 12, 2026
    1d28f84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    loop:qualityCode quality / refactoring loopstatus:analyzedAnalyzed, awaiting decision

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions