Skip to content

propose: walk-up config discovery and configurable source root#264

Merged
HumanBean17 merged 5 commits into
masterfrom
propose/dirs-hierarchy
Jun 6, 2026
Merged

propose: walk-up config discovery and configurable source root#264
HumanBean17 merged 5 commits into
masterfrom
propose/dirs-hierarchy

Conversation

@HumanBean17

Copy link
Copy Markdown
Owner

What

Adds a proposal for walk-up config discovery and a source_root YAML field, plus an AGENTS.md instruction so brainstorming skills use the repo's proposal format.

Why now

Real users hit walls because the tool couples config location, source root, and cwd:

  • User A runs init from a multi-system parent → mixed index
  • User B cds to a microservice subdir → MCP can't find config
  • User C puts config in a context dir, code elsewhere → must pass --source-root every time

Highlights

  • discover_project_root() walks up from cwd to find .java-codebase-rag.yml (like git)
  • New source_root field in YAML config — config can live separately from source code
  • Index directory follows source root, not config location
  • No breaking changes — existing workflows unchanged
  • AGENTS.md now tells brainstorming skills to write proposals in repo format

Tests

Proposal-only; baseline unchanged.

Out of scope

  • Implementation (follow-up PR after proposal approval)
  • Multi-system auto-split
  • Changes to init command behavior

🤖 Generated with Claude Code

HumanBean17 and others added 3 commits June 6, 2026 15:58
Spec for walk-up config discovery and source_root in config YAML,
addressing user experience issues with directory structure flexibility.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Move from docs/superpowers/specs/ to propose/active/ with the
standard -PROPOSE.md format matching existing repo conventions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Directs brainstorming skills to write proposals to propose/active/ in
the repo's established format instead of a default docs/superpowers/specs/
location.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@HumanBean17

Copy link
Copy Markdown
Owner Author

Review: DIRS-HIERARCHY proposal

The AGENTS.md edit is clean and well-placed. The proposal is well-structured and follows the repo format. The core design (walk-up + source_root field) is sound.

A few things to address before implementation:


1. User C scenario in §3.6 doesn't hold for walk-up

The directory layout is:

System-D/
  system-D-context/    ← config lives here
  microservice-D-1/    ← user works here
  microservice-D-2/

The proposal says: "Walk-up from any subdirectory finds the config." But walking up from microservice-D-1/ goes microservice-D-1/System-D/IdeaProjects/ — it never passes through system-D-context/, which is a sibling, not an ancestor.

Walk-up only helps User C if they run from system-D-context/ (or its subdirectories). The source_root: ../ field still solves their pain, but the wording should be corrected, e.g.:

Run init from system-D-context/. Then run MCP from system-D-context/ (or any subdirectory). Walk-up finds the config; source_root: ../ resolves to System-D/.


2. Missing detail: what about $HOME config?

§3.1 says walk-up stops before $HOME. Good safety measure, but if a user legitimately wants a project rooted at $HOME, there's no escape hatch. Probably fine for v1, but worth noting in §7 (Open Questions) or §8 (Out of scope) so it's tracked.


3. find_config_dir() mentioned but not in test plan

§3.4 introduces find_config_dir(source_root) as a new function, but §6 doesn't test it directly. An explicit unit test would help — it's the integration point between walk-up discovery and the precedence chain.


4. init warning — when exactly does it fire?

§3.5 says "soft warning if a parent config is detected" during init. Does the warning fire when the resolved source root has a parent config, or only when cwd does? A one-line clarification would prevent ambiguity during implementation.


Overall: ready to implement after addressing the User C walk-up description and the minor gaps above.

HumanBean17 and others added 2 commits June 6, 2026 16:18
- Add "Risks and mitigations" section with symlink, performance, boundary
- Add "Decisions taken" section documenting key design rationale
- Clarify first-match-wins for nested configs in walk-up algorithm
- Clarify $HOME boundary is inclusive (check it, don't go past)
- Document resolution-base difference between YAML and CLI source_root
- Soften AGENTS.md section list to match actual completed proposals

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Both env vars become optional overrides — walk-up discovery derives
source root and index dir automatically. Minimal .mcp.json needs
no env block.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@HumanBean17 HumanBean17 merged commit 5ce7130 into master Jun 6, 2026
1 check passed
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