[Research] Evaluate tool-description quarantine with prototype evidence - #371
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdded a research-only MCP tool-description quarantine prototype. It hashes and compares descriptors, scans descriptions, evaluates synthetic results, benchmarks execution, and exposes a repeatable npm command. Tests validate the report and documentation states that runtime quarantine is deferred. ChangesTool-description quarantine research
Estimated code review effort: 3 (Moderate) | ~20 minutes Poem
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/research/tool-description-quarantine.md`:
- Line 33: Correct the run metadata line near “Run on 2026-08-11” by replacing
the future date with the actual date on which the research was executed, keeping
the recorded Node version and Darwin arm64 environment accurate.
- Line 80: Update the reproduction description near runPrototype() to accurately
list the fields emitted by the JSON report: aggregate corpus metrics, flagged
benign examples, misses, and aggregate benchmark values. Do not claim full
corpus observations or timing samples unless runPrototype() is changed to emit
them.
In `@scripts/tool-description-quarantine-prototype.mjs`:
- Around line 231-234: Update percentile to handle the 0.5 quantile correctly
for even-length sorted inputs by averaging the two middle values instead of
selecting only the upper middle value; preserve the existing behavior for
odd-length inputs, other quantiles, and empty arrays.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: dc06d7cb-8eec-4fee-b2b0-1096d3fe3875
📒 Files selected for processing (6)
CHANGELOG.mddocs/research/tool-description-quarantine.mddocs/threat-model.mdpackage.jsonscripts/tool-description-quarantine-prototype.mjstests/tool-description-quarantine-research.test.ts
d52b00c to
55097b6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/tool-description-quarantine-prototype.mjs`:
- Around line 111-113: Update descriptorMap to validate every tool descriptor
has exactly one non-empty name and reject duplicate names before constructing
the Map. Ensure invalid descriptors produce an explicit invalid-descriptor
result or otherwise stop comparison, rather than allowing later entries to
overwrite earlier descriptors and letting compareDescriptors report no drift.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e8eebca9-ef48-451d-9a44-1666b8f0bdc2
📒 Files selected for processing (2)
docs/research/tool-description-quarantine.mdscripts/tool-description-quarantine-prototype.mjs
55097b6 to
8c5447e
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/tool-description-quarantine-prototype.mjs`:
- Around line 95-98: Update the key comparator in the canonical descriptor
serialization chain around canonicalValue so sorting is locale-independent and
based on Unicode code-unit ordering instead of localeCompare(). Preserve
filtering undefined values and recursively canonicalizing each entry.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 6b2351e9-ca94-48bc-97b3-bd92d9a2d229
📒 Files selected for processing (3)
docs/research/tool-description-quarantine.mdscripts/tool-description-quarantine-prototype.mjstests/tool-description-quarantine-research.test.ts
8c5447e to
2e97cb2
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/research/tool-description-quarantine.md`:
- Around line 43-44: Reconcile the benchmark values in the documented
“1,000-tool hash-and-scan median” and “p95” entries with the PR summary: either
update the documentation to the same 4.59 ms median and 5.33 ms p95 values, or
clearly identify the recorded values as results from a separate run.
- Line 18: Revise the sentence describing Miftah’s descriptor comparison and
local decision requirement to present it as prototype behavior or a future
opt-in control, not an existing runtime requirement. Preserve the distinction
from the current strict cross-profile schema-mismatch guard and avoid implying
that changed snapshots are presently blocked pending operator approval.
In `@scripts/tool-description-quarantine-prototype.mjs`:
- Around line 9-30: Add the dotAll `s` flag to each regular expression in the
`scannerRules` array so `.` spans line terminators between matched terms, and
add a scanner test covering descriptor text with newline-separated terms for
multiline matching.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: bbbe1b69-b142-49e1-a437-778539ef44db
📒 Files selected for processing (2)
docs/research/tool-description-quarantine.mdscripts/tool-description-quarantine-prototype.mjs
2e97cb2 to
46cee4e
Compare
46cee4e to
256eda0
Compare
Summary
Evidence
The committed synthetic corpus intentionally exposes the limits of heuristic enforcement:
These figures are explicitly not production false-positive estimates or startup SLOs. No design-partner evidence is claimed. The recommendation is to defer production implementation until representative partner workflows show value, acceptable approval churn, and a usable recovery path.
Validation
npm exec -- vitest run tests/tool-description-quarantine-research.test.tsnode scripts/tool-description-quarantine-prototype.mjsnpm run lintnpm run typechecknpm test -- --no-file-parallelism(146 files; 1,842 passed; 34 skipped)npm run buildnpm run check:pack(51 files)Closes #36
Summary by CodeRabbit
Documentation
New Features
Tests