Keep code discoverable by text search
Run xpd enhance discover to find public names defined in multiple modules, bare verb functions such as load or clean, error messages starting with interpolated values, and dynamic keys or imports that plain-text search misses.
Survey discoverability findings
Section titled “Survey discoverability findings”xpd enhance discover inspects Python, Go, Rust, JavaScript, and TypeScript source. It counts public names that are uniquely defined and reports collisions. JavaScript and TypeScript share a count. Python also contributes the rule findings listed below.
xpd enhance discover src/xpd enhance discover src/ --since main --format json| Finding kind | What it catches |
|---|---|
name-collision |
Two or more modules define the same public name |
generic-verb-name |
A public function is named only with a bare verb instead of a domain phrase |
vague-module-name |
A module uses a role name such as utils, helpers, or config |
module-private-name |
A module-level definition uses a leading underscore instead of __all__ |
import-alias |
A symbol or module is renamed on import, hiding its defining name from search |
wildcard-import |
A from module import * injects unknown names into the namespace |
interpolated-key |
An event name, settings key, or module path is assembled with an f-string |
hasattr-probe |
Runtime hasattr duck-typing or dual-attribute fallback hides attribute contracts from search |
error-message-prefix |
An error message begins with a runtime value instead of searchable literal text |
deprecated-without-decorator |
A deprecation warns at runtime instead of using @warnings.deprecated |
id-without-newtype |
Multiple identifier parameters share plain str or int types that callers can swap |
Run a recorded discover ledger
Section titled “Run a recorded discover ledger”- Start from a clean commit with
xpd enhance discover start src/ --check "<project-check>". - Inspect findings and per-module checklist items with
xpd enhance discover src/ --format json. - Submit ordered rename fixes, accepted exceptions, and checklist answers with
xpd enhance discover plan plan.json. - Record interface approval with
xpd enhance discover approve <fix-id>when renaming public symbols, commit each rename, and verify withxpd enhance discover gate <fix-id>. - Close the run with
xpd enhance discover finish.
See xpd enhance discover for every option and recorded stage.