Narrow rules API surface by making mergeRuleSets internal#3373
Conversation
mergeRuleSets internal
There was a problem hiding this comment.
Pull request overview
Narrows the src/rules.ts API surface by un-exporting mergeRuleSets (only used internally by loadAndMergeDomains) and reroutes its test coverage through the public loadAndMergeDomains entry point.
Changes:
- Removed
exportkeyword frommergeRuleSetsinsrc/rules.ts. - Dropped the dedicated
mergeRuleSetsdescribe block and its import fromsrc/rules.test.ts. - Added a
loadAndMergeDomainstest asserting cross-file deduplication to preserve coverage.
Show a summary per file
| File | Description |
|---|---|
| src/rules.ts | Makes mergeRuleSets module-private. |
| src/rules.test.ts | Removes internal-helper tests and adds a public-API dedup test. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |
🔥 Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PASS — PR by
|
🤖 Smoke Test Results
Overall: PARTIAL — MCP test passed; HTTP and file tests could not be verified (workflow pre-step outputs were not substituted). PR: "Narrow rules API surface by making
|
|
Smoke test: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
|
Smoke test FAIL. MCP: ❌, Conn: ❌, File: ✅, Bash: ✅ Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
Chroot Version Comparison — Smoke Test Results
Result: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot. Go matches.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test: GitHub Actions Services Connectivity
Overall: FAIL —
|
src/rules.tsexposedmergeRuleSetseven though it is only used internally byloadAndMergeDomainsand not consumed by production callers. This PR removes that unnecessary export and shifts coverage to the public API path.API surface cleanup
exportfrommergeRuleSetsinsrc/rules.ts, making it a module-private helper.Test realignment to public contract
mergeRuleSetsimport and its dedicated internal-helper tests fromsrc/rules.test.ts.loadAndMergeDomainsto validate deduplication and merging behavior through the supported interface.Representative change