fix(linting): resolved TOC/TOU issue (INS-2691); adds refresh button to recompile a ruleset; address minor bugs#9991
Conversation
✅ Circular References ReportGenerated at: 2026-06-04T17:20:50.471Z Summary
Click to view all circular references in PR (8)Click to view all circular references in base branch (8)Analysis✅ No Change: This PR does not introduce or remove any circular references. This report was generated automatically by comparing against the |
69aa91f to
7357374
Compare
There was a problem hiding this comment.
Pull request overview
This PR addresses a TOC/TOU gap in Spectral linting by moving remote-extends fetching/validation/flattening into a single main-process compilation step, so the lint worker never re-fetches remote ruleset URLs. It also improves cleanup when rulesets/projects are removed by deleting associated NeDB records and compiled scratch paths.
Changes:
- Switch renderer/route linting calls from
rulesetPathto{ projectId, rulesetContent }, and compile a URL-free ruleset in the main process before linting. - Add a main-process compiled-ruleset cache (
spectral-ruleset-cache) with tests, plus newcompileSpectralRulesetFromContentlogic and tests. - Ensure project deletion and ruleset unselect flows remove the ProjectLintRuleset record and compiled ruleset directory.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.spec.tsx | Updates editor linting integration to pass ruleset content + projectId; updates ruleset selection/cleanup behavior. |
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId.workspace.$workspaceId.spec.generate-request-collection.tsx | Uses project-scoped ruleset content for linting before generating a collection. |
| packages/insomnia/src/routes/organization.$organizationId.project.$projectId.delete.tsx | Deletes ProjectLintRuleset record and compiled ruleset cache during project deletion. |
| packages/insomnia/src/main/spectral-ruleset-cache.ts | New cache module that writes/deletes a compiled (flattened, URL-free) .spectral.yaml per project. |
| packages/insomnia/src/main/ipc/main.ts | Updates lintSpec IPC to compile ruleset content in main and adds deleteCompiledRuleset IPC. |
| packages/insomnia/src/main/ipc/electron.ts | Renames IPC channel type from deleteRulesetFile to deleteCompiledRuleset. |
| packages/insomnia/src/main/tests/spectral-ruleset-cache.test.ts | Adds unit tests for compiled ruleset pathing, caching, and deletion. |
| packages/insomnia/src/main/tests/bundle-spectral-ruleset.test.ts | Adds tests for compileSpectralRulesetFromContent and adjusts an https error assertion. |
| packages/insomnia/src/entry.preload.ts | Exposes deleteCompiledRuleset to the renderer via preload bridge. |
| packages/insomnia/src/common/bundle-spectral-ruleset.ts | Adds remote-inlining compilation path (compileSpectralRulesetFromContent) and supporting flattening logic. |
| packages/insomnia-inso/src/commands/lint-specification.ts | Updates inso lint flow to compile remote extends into a URL-free ruleset before loading it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
@kwburns-kong should be good now 👍 thanks for spotting this! |
…tch paths when a project is deleted
What this PR does