Skip to content

fix: always load archived beans, remove --with-archived flag#33

Merged
hmans merged 3 commits intomainfrom
fix/remove-with-archived-flag
Dec 27, 2025
Merged

fix: always load archived beans, remove --with-archived flag#33
hmans merged 3 commits intomainfrom
fix/remove-with-archived-flag

Conversation

@hmans
Copy link
Copy Markdown
Owner

@hmans hmans commented Dec 27, 2025

Summary

  • Remove the --with-archived flag entirely
  • Always load beans from all subdirectories within .beans/
  • Archive becomes purely organizational (keeps .beans/ tidy) rather than an access control mechanism

Problem

The --with-archived flag created a usability antipattern where users (or agents) needed prior knowledge about whether something was archived to find it. This led to surprising scenarios where searches would fail to find beans that existed but were archived.

Solution

  1. Archived beans are always loaded - No flag needed
  2. All subdirectories are now supported - The loading mechanism now recursively finds all .md files within .beans/, preparing for future features like auto-filing beans into per-milestone or per-epic directories

Changes

Commit 1: Remove --with-archived flag

  • cmd/root.go: Removed withArchived variable and flag registration
  • internal/beancore/core.go: Removed withArchived field, SetWithArchived(), WithArchived() methods
  • cmd/archive.go: Updated description
  • cmd/check.go: Removed special handling that was enabling the flag

Commit 2: Load beans from all subdirectories

  • internal/beancore/core.go: Replace loadFromDisk + loadBeansFromDir with filepath.WalkDir to recursively load all .md files
  • internal/beancore/watcher.go: Watch all subdirectories, not just root + archive
  • internal/beancore/core_test.go: Add TestLoadFromSubdirectories to document the new behavior
  • cmd/prompt.tmpl: Update agent instructions to remove --with-archived references

Test plan

  • All existing tests pass
  • Build succeeds
  • Verified --with-archived flag is no longer available
  • Verified beans in nested subdirectories are loaded correctly
  • New test documents loading from arbitrary subdirectory structures
  • Agent prompt template updated

- Epic for workflow CLI commands (beans-mmyp)
- beans complete: complete a bean with optional summary
- beans scrap: scrap a bean with required reason
- beans start: start working on a bean
- beans ready: find beans ready to work on
- beans next: show highest-priority bean to work on
- beans milestones: list planned milestones
- beans blocked: show blocked beans
- beans progress: show work status summary

Refs: beans-mmyp
The --with-archived flag created a usability antipattern where users
needed prior knowledge about whether something was archived to find it.

Now archived beans are always loaded and visible in all queries. The
archive remains purely an organizational mechanism (keeping .beans/
tidy) rather than an access control mechanism.

Changes:
- Remove --with-archived flag from root command
- Remove withArchived field and methods from Core struct
- Update loadFromDisk() to always include archive directory
- Update watcher to always watch archive directory
- Simplify LoadAndUnarchive() to work with always-loaded beans
- Update archive command description
- Remove special handling in check command
- Update tests to reflect new behavior

BREAKING CHANGE: The --with-archived flag is removed. Archived beans
are now always included in all queries.
@hmans hmans changed the title fix!: always load archived beans, remove --with-archived flag fix: always load archived beans, remove --with-archived flag Dec 27, 2025
Generalize the loading mechanism to recursively find all .md files
within the .beans directory tree. This prepares for future features
like auto-filing beans into per-milestone or per-epic directories.

Changes:
- Replace loadFromDisk + loadBeansFromDir with filepath.WalkDir
- Update watcher to watch all subdirectories
- Add TestLoadFromSubdirectories to document the behavior
@hmans hmans force-pushed the fix/remove-with-archived-flag branch from ea1311b to 129e2d1 Compare December 27, 2025 21:55
@hmans hmans merged commit d7b01db into main Dec 27, 2025
1 check passed
@hmans hmans deleted the fix/remove-with-archived-flag branch December 27, 2025 21:56
hmans added a commit that referenced this pull request Dec 27, 2025
* main:
  fix: always load archived beans, remove --with-archived flag (#33)
  fix: prettify JSON output in --json mode
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.

1 participant