Repository navigation
feat(kb): add docs-first feature discovery to initialization - #299
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e833a503c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return scan_modules(tree, self.lifecycle.init, language, self.record) | ||
| from .feature_discovery_index import build_for_stage | ||
|
|
||
| self.source_index = build_for_stage(tree, self) |
There was a problem hiding this comment.
Handle invalid coverage policies in modules
When an optional knowledge-coverage.yaml exists but is malformed or uses an older invalid shape, build_for_stage() calls load_policy() and lets its ValueError, TypeError, or YAML parser error escape. The modules stage previously did not depend on this policy, and unlike the knowledge and discovery stages this new call has no precheck or exception handling, so kb init --stage modules terminates instead of returning a controlled blocked record. Catch these policy errors here or add the same policy precheck used by the other stages.
Useful? React with 👍 / 👎.
| extensions = tuple(core.get("suffixes", SUFFIXES)) | ||
| if not extensions or any(s not in SUFFIXES for s in extensions): | ||
| raise ValueError("unsupported production-code suffix") | ||
| if not extensions or any(not isinstance(s, str) or not re.fullmatch(r"\.[A-Za-z0-9][A-Za-z0-9._+-]*", s) | ||
| for s in extensions): | ||
| raise ValueError("production-code suffixes must be safe literal extensions") |
There was a problem hiding this comment.
Reject or correctly match multi-dot suffixes
This validation now accepts suffixes such as .d.ts or .blade.php, but both inventory() and the discovery index compare them against Path.suffix, which returns only .ts or .php. A valid policy using one of the newly accepted multi-dot suffixes therefore silently excludes all matching production files from discovery and coverage denominators. Either disallow embedded dots here or make both inventory implementations match full filename endings.
Useful? React with 👍 / 👎.
Initialization previously depended on a manually declared feature catalog and a single repository language hint. This adds
feature-discoverybetween skeleton and breadth: project-document bodies establish candidates, the complete pinned source/test inventory expands them, and independent review produces a catalog PR whose merged hash gates downstream stages.Validation: local full suite 3429 passed / 18 skipped; final discovery/provider/compatibility regressions 95 passed; documentation, SPEC and both knowledge validators passed. Independent review findings were fixed and covered by recovery/binding tests.
The bounded JiuwenSwarm pilot uses one document and one production file at
f0a69728…. A fresh review of archived extraction supports four links to the existinginstancesfeature (three supplements and one subcapability), retaining two documentary unknowns. It preserves the 79-feature catalog and existing knowledge approvals; no full-repository discovery or PR-review accuracy gain is claimed. Raw native traces, runtime snapshots, fees-as-unknown and audit hashes are documented ineval/feature-discovery/README.md.