Skip to content

fix(mapper): apply configured path excludes#92

Open
schedawg74 wants to merge 1 commit into
openclaw:mainfrom
schedawg74:fix-map-exclude-filtering
Open

fix(mapper): apply configured path excludes#92
schedawg74 wants to merge 1 commit into
openclaw:mainfrom
schedawg74:fix-map-exclude-filtering

Conversation

@schedawg74
Copy link
Copy Markdown

@schedawg74 schedawg74 commented May 19, 2026

Problem

clawpatch config exposes include / exclude, but deterministic feature mapping did not apply those filters to emitted feature records.

That made configured excludes inconsistent:

  • agent mapper inventory honored config.include / config.exclude
  • heuristic mapper output ignored them
  • clawpatch map --source heuristic could still create features for excluded paths
  • --source auto could skip the agent path when the heuristic map looked meaningful, leaving excluded generated/vendor paths in the final map

In practice, a config exclude like src/client/generated/** could still produce feature entrypoints, owned files, context files, or tests under that excluded tree.

Changes

  • src/app.ts passes resolved config filters into mapFeatures, not just agent inventory.
  • src/mapper.ts applies filters when converting seeds into feature records:
    • drops seeds whose entrypoint and owned files are excluded
    • filters owned files, context files, and tests
    • filters nearby test discovery results too
  • src/agent-mapper.ts reuses the same shared filter helper for inventory filtering.
  • src/mappers/shared.ts now owns the path filter matching logic that was previously local to agent inventory.
  • src/mapper.test.ts adds regression coverage for excluding generated Python files from heuristic mapping.

Real-world Impact

Configured path excludes now behave as users would expect during mapping, not only during agent inventory construction. This prevents generated or intentionally excluded source trees from becoming reviewable feature slices and keeps subsequent review/fix workflows focused on the intended code.

Trade-off Considered

Could have pushed filtering earlier into each individual mapper, but that would duplicate policy across many language/framework mappers. Applying filters at seed-to-feature conversion keeps mapper-specific discovery intact while enforcing config consistently at the final feature boundary.

Validation

  • pnpm typecheck
  • pnpm lint
  • pnpm test
  • pnpm build

@schedawg74 schedawg74 marked this pull request as ready for review May 19, 2026 05:37
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