loadwise 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -100
- package/dist/bin/loadwise.js +126 -49
- package/dist/lib/accessibility/frontend-detect.js +6 -5
- package/dist/lib/accessibility/usage.js +10 -2
- package/dist/lib/editor/configured-setup.js +61 -0
- package/dist/lib/editor/editor-launcher.js +165 -0
- package/dist/lib/editor/fix-edits.js +19 -0
- package/dist/lib/editor/jetbrains-setup.js +53 -0
- package/dist/lib/editor/language-server.js +31 -14
- package/dist/lib/editor/managed-config.js +37 -0
- package/dist/lib/editor/native-setup.js +85 -0
- package/dist/lib/editor/release-vsix.js +61 -0
- package/dist/lib/editor/server-commands.js +2 -0
- package/dist/lib/editor/setup-server.js +87 -0
- package/dist/lib/editor/setup-vim.js +61 -0
- package/dist/lib/editor/setup.js +131 -0
- package/dist/lib/editor/stdio-setup.js +6 -0
- package/dist/lib/maintainability/cli/inputs.js +3 -2
- package/dist/lib/maintainability/cli.js +14 -5
- package/dist/lib/maintainability/examples.js +4 -0
- package/dist/lib/maintainability/rule-ids.js +3 -0
- package/dist/lib/maintainability/site-fixes/unused-bindings.js +138 -3
- package/dist/lib/maintainability/unused/unused-bindings.js +39 -4
- package/dist/lib/performance/cli/changed-lines.js +8 -1
- package/dist/lib/performance/cli/cli-arguments.js +19 -8
- package/dist/lib/performance/cli/cli-output.js +3 -0
- package/dist/lib/performance/cli.js +8 -4
- package/dist/lib/performance/datastores/pg-integrity.js +7 -0
- package/dist/lib/performance/datastores/pooling.js +6 -1
- package/dist/lib/performance/engine/native-syntax.js +3 -0
- package/dist/lib/performance/frontend/frontend-perf.js +80 -20
- package/dist/lib/performance/request/bulk-listener-registration.js +111 -0
- package/dist/lib/performance/request/fastify-receivers.js +93 -0
- package/dist/lib/performance/request/fresh-loop-socket.js +103 -0
- package/dist/lib/performance/request/mongoose-lean.js +140 -53
- package/dist/lib/performance/request/node-event-listener-leak.js +99 -5
- package/dist/lib/performance/request/phase5-ast.js +6 -7
- package/dist/lib/performance/request/phase5-rules.js +133 -13
- package/dist/lib/performance/request/request-handlers.js +120 -23
- package/dist/lib/performance/site-fixes/collection-existence.js +2 -1
- package/dist/lib/performance/site-fixes/collections.js +1 -2
- package/dist/lib/performance/site-fixes/frontend-fixes.js +10 -6
- package/dist/lib/performance/site-fixes/helpers.js +3 -4
- package/dist/lib/performance/site-fixes/integrity.js +2 -4
- package/dist/lib/reliability/react-bugs.js +11 -3
- package/dist/lib/reliability/usage.js +16 -5
- package/dist/lib/security/cli.js +15 -4
- package/dist/lib/shared/agent/agent-init.js +26 -4
- package/dist/lib/shared/agent/agent-prompt.js +74 -0
- package/dist/lib/shared/agent/agent-session.js +6 -1
- package/dist/lib/shared/agent/agent-verify.js +54 -10
- package/dist/lib/shared/agent/review-delivery.js +1 -1
- package/dist/lib/shared/analysis/scan-cache.js +3 -2
- package/dist/lib/shared/check.js +172 -20
- package/dist/lib/shared/fix/fix-convergence.js +15 -29
- package/dist/lib/shared/fix/fix-handoff.js +16 -11
- package/dist/lib/shared/fix/fix-imports.js +47 -38
- package/dist/lib/shared/fix/fix-presentation-prettier.js +1 -46
- package/dist/lib/shared/fix/fix-presentation-rows.js +45 -1
- package/dist/lib/shared/fix/fix-presentation.js +4 -3
- package/dist/lib/shared/fix/fix-safety.js +26 -1
- package/dist/lib/shared/fix/fix-scope.js +82 -0
- package/dist/lib/shared/fix/fix-terminal.js +28 -1
- package/dist/lib/shared/fix/project-file-access.js +17 -26
- package/dist/lib/shared/fix/read-fix-text.js +20 -0
- package/dist/lib/shared/fix.js +215 -102
- package/dist/lib/shared/report-fp.js +93 -0
- package/dist/lib/shared/reporting/automatic-fix-signal.js +10 -0
- package/dist/lib/shared/reporting/check-text.js +50 -0
- package/dist/lib/shared/reporting/pillars.js +45 -16
- package/dist/lib/shared/reporting/source-report.js +2 -0
- package/dist/lib/shared/system/atomic-write.js +5 -2
- package/dist/lib/shared/system/sentry.js +203 -0
- package/dist/lib/shared/system/shell-argument.js +5 -1
- package/dist/lib/shared/system/terminal-safe.js +3 -2
- package/dist/lib/shared/system/terminal-style.js +131 -0
- package/docs/assets/cli-workflow.gif +0 -0
- package/integrations/sublime/plugin.py +22 -0
- package/integrations/zed/Cargo.lock +845 -0
- package/integrations/zed/Cargo.toml +11 -0
- package/integrations/zed/extension.toml +11 -0
- package/integrations/zed/src/lib.rs +25 -0
- package/package.json +11 -3
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/commands/loadwise.md +11 -6
- package/schema/loadwise.config.schema.json +2 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
id = "loadwise"
|
|
2
|
+
name = "Loadwise"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
schema_version = 1
|
|
5
|
+
authors = ["Ibrahim Hafez"]
|
|
6
|
+
description = "Loadwise diagnostics and code actions"
|
|
7
|
+
repository = "https://github.com/IbrahimHafez1/loadwise"
|
|
8
|
+
|
|
9
|
+
[language_servers.loadwise]
|
|
10
|
+
name = "Loadwise"
|
|
11
|
+
languages = ["JavaScript", "JSX", "TypeScript", "TSX", "HTML", "Vue.js", "Svelte", "Python", "Go", "Java", "CSharp", "Rust"]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
use zed_extension_api as zed;
|
|
2
|
+
|
|
3
|
+
struct Loadwise;
|
|
4
|
+
|
|
5
|
+
impl zed::Extension for Loadwise {
|
|
6
|
+
fn new() -> Self {
|
|
7
|
+
Self
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
fn language_server_command(
|
|
11
|
+
&mut self,
|
|
12
|
+
_: &zed::LanguageServerId,
|
|
13
|
+
worktree: &zed::Worktree,
|
|
14
|
+
) -> zed::Result<zed::Command> {
|
|
15
|
+
let [command, cli]: [String; 2] = zed::serde_json::from_str(include_str!("../server.json"))
|
|
16
|
+
.map_err(|error| format!("Invalid Loadwise server configuration: {error}"))?;
|
|
17
|
+
Ok(zed::Command {
|
|
18
|
+
command,
|
|
19
|
+
args: vec![cli, "lsp".to_owned(), "--stdio".to_owned()],
|
|
20
|
+
env: worktree.shell_env(),
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
zed::register_extension!(Loadwise);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loadwise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "
|
|
5
|
+
"description": "Local static analysis for TypeScript & JavaScript: catches N+1 queries, PostgreSQL pool leaks, unsafe migrations, unhandled async errors, and security/a11y bugs ESLint misses.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Ibrahim Hafez",
|
|
8
8
|
"repository": {
|
|
@@ -65,6 +65,9 @@
|
|
|
65
65
|
"dist/bin/",
|
|
66
66
|
"dist/lib/",
|
|
67
67
|
"dist/polyglot/",
|
|
68
|
+
"!dist/**/*.map",
|
|
69
|
+
"integrations/sublime/",
|
|
70
|
+
"integrations/zed/",
|
|
68
71
|
"lib/performance/vendor/",
|
|
69
72
|
"plugin/.claude-plugin/",
|
|
70
73
|
"plugin/commands/",
|
|
@@ -76,11 +79,12 @@
|
|
|
76
79
|
"polyglot/security/",
|
|
77
80
|
"schema/",
|
|
78
81
|
"examples/",
|
|
82
|
+
"docs/assets/cli-workflow.gif",
|
|
79
83
|
"PERFORMANCE.md",
|
|
80
84
|
"LICENSE"
|
|
81
85
|
],
|
|
82
86
|
"engines": {
|
|
83
|
-
"node": ">=22"
|
|
87
|
+
"node": ">=22.13.0"
|
|
84
88
|
},
|
|
85
89
|
"scripts": {
|
|
86
90
|
"format": "prettier --cache --log-level warn --write .",
|
|
@@ -98,10 +102,14 @@
|
|
|
98
102
|
"bench:security": "node dist/bench/security.js",
|
|
99
103
|
"bench:traces": "node dist/bench/traces.js",
|
|
100
104
|
"bench:recall": "node dist/bench/recall/runner.js",
|
|
105
|
+
"bench:evidence": "node bench/evidence/runner.mjs",
|
|
106
|
+
"bench:holdout": "node bench/holdout/runner.mjs",
|
|
101
107
|
"build": "tsc -p tsconfig.json",
|
|
108
|
+
"build:sentry": "tsc -p tsconfig.sentry.json",
|
|
102
109
|
"changelog": "npm run build && node dist/scripts/changelog.js",
|
|
103
110
|
"docs:rules": "npm run build && node dist/scripts/rule-docs.js",
|
|
104
111
|
"pack:smoke": "npm run build && node dist/scripts/pack-smoke.js",
|
|
112
|
+
"editor:package": "tsc -p editor/tsconfig.package.json && node editor/package-vsix.mjs",
|
|
105
113
|
"clean": "node -e \"import('node:fs').then(fs=>import('node:path').then(p=>{const walk=d=>{if(!fs.existsSync(d))return;for(const e of fs.readdirSync(d,{withFileTypes:true})){const f=p.join(d,e.name);if(e.isDirectory()&&e.name!=='node_modules'&&!f.includes('vendor'))walk(f);else if((e.name.endsWith('.js')&&fs.existsSync(f.slice(0,-3)+'.ts'))||(e.name.endsWith('.cjs')&&fs.existsSync(f.slice(0,-4)+'.cts')))fs.unlinkSync(f);}};['bin','lib','plugin','polyglot','scripts','bench','test'].forEach(walk);fs.rmSync('.tsbuildinfo',{force:true});fs.rmSync('dist',{recursive:true,force:true});}))\"",
|
|
106
114
|
"prepack": "npm run build",
|
|
107
115
|
"prepare": "node -e \"import('node:child_process').then(c=>{c.execSync('git rev-parse --git-dir',{stdio:'ignore'});c.execSync('git config core.hooksPath hooks')}).catch(()=>{})\"",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loadwise",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Runs the project's local loadwise checkers on each file Claude edits and sends findings back with their fix commands.",
|
|
5
5
|
"author": { "name": "Ibrahim Hafez" },
|
|
6
6
|
"homepage": "https://loadwise.mintlify.app/",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Check a project or fix its Loadwise findings in this session
|
|
3
|
-
argument-hint: "[directory] [--only perf,rel,maint,sec,a11y] [--staged] | fix [--yes|--all|--handoff] [performance reliability maintainability security accessibility]"
|
|
3
|
+
argument-hint: "[directory] [--only perf,rel,maint,sec,a11y] [--staged|--uncommitted] | fix [--dry-run|--apply|--yes|--all|--handoff] [--id id] [--uncommitted] [performance reliability maintainability security accessibility]"
|
|
4
4
|
allowed-tools: Bash(npx loadwise:*), Bash(node_modules/.bin/loadwise:*)
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -12,13 +12,18 @@ On every run, review all in-scope findings, including changes already applied. R
|
|
|
12
12
|
|
|
13
13
|
Use `{"outcomes":[{"checker":"perf","id":"...","status":"verified","evidence":"..."}]}` for the decisions file, replacing the placeholders with actual findings and evidence. Supported statuses are `fixed`, `verified`, `intentional`, `false-positive` and `deferred`. In a detected agent session or an initialized project add `--save` to retain the decisions locally for the next agent unless the user requested no persistence.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Explicit flags select the matching CLI operation. Handle these requests before the agent-guided edit workflow below. Pass through the supplied directory, checker selection, configuration, workspace, rule and Git filters, including `--uncommitted`.
|
|
16
|
+
|
|
17
|
+
- For any `fix --dry-run` or explicit preview request, run the requested fix with `--dry-run`, including when combined with `--apply`, `--yes`, `--all` or `--id`. Show the proposed edits and stop. Leave source files untouched and treat the printed apply command as information for the user.
|
|
18
|
+
- For `fix --handoff`, show the read-only brief and stop.
|
|
19
|
+
- For `fix --apply`, `fix --yes`, `fix --all` or an explicit `--id` selection, record existing working changes and run the requested operation with its supplied scope. Capture the applied hunks and outstanding findings with `--json` when compatible with the requested output. Review the actual changes using steps 5 and 6 below. When manual findings remain, use the printed scoped handoff command. Only edit manual findings if the user requested that work.
|
|
20
|
+
- If the CLI rejects a flag combination, report the error and stop.
|
|
21
|
+
|
|
22
|
+
For the agent-guided `/loadwise fix [checker names]` workflow, including a scope such as `--uncommitted`, review findings before choosing edits.
|
|
16
23
|
|
|
17
24
|
1. Record existing working changes and start with a read-only JSON scan. For example, `fix performance security` starts with `loadwise check --only perf,sec --json`. Preserve the selected project, configuration, workspaces and changed-line filters. Restrict work to the named files or ids if provided.
|
|
18
25
|
2. Evaluate both generated and manual findings against the actual code, callers and tests. Inspect proposed diffs and notes and check their assumptions. Use a generated edit only when you can justify that exact change. Adapt a suggestion or implement a manual fix yourself when warranted. Keep intentional behavior and false positives with a reason. Defer unresolved decisions and continue with independent findings.
|
|
19
|
-
3. For
|
|
20
|
-
4. For changed-line requests, confirm every hunk fits the authorized range
|
|
26
|
+
3. For a unified project scan, apply confirmed IDs with `loadwise fix --only <checker> --id <id>` and the original directory, config, workspaces and Git filters. For direct file or checker-specific scans, use the scoped report's per-ID fix command with its original settings. Review-marked changes require individual approval unless already authorized.
|
|
27
|
+
4. For changed-line requests, confirm every hunk fits the authorized range and current working tree, including when using a checker-specific fix command. Leave the Git index untouched.
|
|
21
28
|
5. After any fix, including a command the user already ran, inspect every applied hunk against code, callers and tests. Use the before/after report or original diff/output, and rescan. Review applied, skipped, review-marked and manual findings even when none are manual. Correct only attributable changes in scope. Preserve pre-existing work, thresholds and baselines.
|
|
22
29
|
6. Run the affected tests or typecheck and repeat the scoped check. If an id shifted, match the rule, location and code. Report verified edits and reasons for remaining findings. If earlier evidence is unavailable, verify the current code and state which prior edits cannot be identified. Request the original diff/output only if needed.
|
|
23
|
-
|
|
24
|
-
Explicit flags select the matching CLI operation. For `fix --handoff` alone, show the brief and stop. For `fix --yes` or `fix --all`, record existing working changes, run the requested operation with its checker selection, and capture its before/after hunks and per-finding outcomes with `--json` when compatible with the requested output. Verify the actual changes using steps 5 and 6. When manual findings remain in scope, read a fresh `loadwise fix --handoff` for the same checkers. Respect a request limited to generated fixes.
|
|
@@ -293,6 +293,7 @@
|
|
|
293
293
|
"unreferenced-file",
|
|
294
294
|
"unused-export",
|
|
295
295
|
"unused-import",
|
|
296
|
+
"unused-local-function",
|
|
296
297
|
"unused-local-variable",
|
|
297
298
|
"upload-client-filename",
|
|
298
299
|
"upload-without-size-limit",
|
|
@@ -651,6 +652,7 @@
|
|
|
651
652
|
"unreferenced-file",
|
|
652
653
|
"unused-export",
|
|
653
654
|
"unused-import",
|
|
655
|
+
"unused-local-function",
|
|
654
656
|
"unused-local-variable",
|
|
655
657
|
"upload-client-filename",
|
|
656
658
|
"upload-without-size-limit",
|