Skip to content

feat(generation): folder-specific documentation floors (#633) - #2040

Open
sloemo01 wants to merge 3 commits into
repowise-dev:mainfrom
sloemo01:feat/folder-coverage
Open

feat(generation): folder-specific documentation floors (#633)#2040
sloemo01 wants to merge 3 commits into
repowise-dev:mainfrom
sloemo01:feat/folder-coverage

Conversation

@sloemo01

@sloemo01 sloemo01 commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

What

Fixes #633, per the shape Raghav scoped in the thread. --folder-coverage 'src/core=1.0' promises every code file under src/core gets a file page whatever its importance score; 'src/legacy=0.5' promises half. A floor, not a cap — the pinned files union into the selection additively, so the cost table stays truthful about what the user asked for.

Root cause

The global file-page cap ranked every code file and cut at the threshold, so a low-importance file in a folder the user explicitly cares about could never get a page — there was no way to pin a folder's coverage.

Changes

  1. Config surface: folder_coverage in .repowise/config.yaml ("GLOB=PCT" strings) + a repeatable CLI flag; survives every update.
  2. Selection: select_pages — scoring split from the global cap (_score_code_files) so files below the cutoff are pinnable; _folder_coverage_pins takes ceil(pct * n) highest-scored files per glob and unions them (dedup, additive, mirroring the tour-landmark force-include).
  3. Denominator: exactly the _is_code_file set the global budget ranks.
  4. No drift: build_generation_plan shares select_pages, so the init cost table reflects pins automatically (tested).

Tests

  • 7 selector-floor tests: 1.0 full-pin below cutoff, additive-not-displacing, ceil-partial takes top-scored, no-op rules, subtree glob, yaml parse + rejects.
  • Cost-estimator test: pins raise the file_page count 5 → 20 under a tight cap.
  • 3 CLI wiring tests: flag in help, rules parse, save_config_partial persists config.yaml.
  • Sabotage-verified: the selector tests fail without the pin pass.

Note: test_plugin_content is red on main itself (v0.47.0 release bug, unrelated to this PR).

)

--folder-coverage 'src/core=1.0' promises every code file under src/core
gets a file page whatever its importance score; 'src/legacy=0.5' promises
half. A floor, not a cap: pinned files union into the selection additively
and never displace global picks, so the cost table stays truthful.

- GenerationConfig.folder_coverage ((glob, pct), ...) + parser validating
  'GLOB=PCT' strings and (glob, pct) pairs
- select_pages: _score_code_files split from the global cap so files below
  the cutoff are pinnable; _folder_coverage_pins takes ceil(pct*n) top-scored
  files per glob and unions them (dedup, additive)
- from_repo_config reads folder_coverage from .repowise/config.yaml
- init --folder-coverage flag (repeatable), saved to config.yaml alongside
  max_file_pages; both generation phases + the cost estimator pick it up via
  the shared select_pages path (no estimate drift)
- Docs: CLI reference + CONFIG.md

Tests: 7 selector-floor tests, 3 CLI wiring tests, cost-estimator pin test.
Sabotage-verified: the pin tests fail on the pre-fix selector.
- folder_coverage.py: unused Mapping import
- test_init_folder_coverage.py: unused Path import, unused captured var,
  redundant Path import
@sloemo01
sloemo01 force-pushed the feat/folder-coverage branch from ace8da9 to 780b3d4 Compare August 31, 2026 19:42
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.

[Feature] Documentation coverage for specific folders

1 participant