pg-lock-xray 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Augusto Cerrutti
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,138 @@
1
- # Temporary Holding Version
1
+ # pg-lock-xray
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![ci](https://github.com/kanchingyg/pg-lock-xray/actions/workflows/ci.yml/badge.svg)](https://github.com/kanchingyg/pg-lock-xray/actions/workflows/ci.yml)
4
+ [![npm](https://img.shields.io/npm/v/pg-lock-xray/latest?label=npm)](https://www.npmjs.com/package/pg-lock-xray)
5
+ [![JSR](https://jsr.io/badges/@kanchingyg/pg-lock-xray)](https://jsr.io/@kanchingyg/pg-lock-xray)
6
+ [![JSR Score](https://jsr.io/badges/@kanchingyg/pg-lock-xray/score)](https://jsr.io/@kanchingyg/pg-lock-xray/score)
7
+ [![Rust](https://img.shields.io/badge/engine-Rust_%2B_TypeScript-dea584)](https://github.com/kanchingyg/pg-lock-xray)
8
+ [![license](https://img.shields.io/github/license/kanchingyg/pg-lock-xray)](https://github.com/kanchingyg/pg-lock-xray/blob/HEAD/LICENSE)
9
+
10
+ **One line:** `npx pg-lock-xray prisma/migrations` (or `bunx pg-lock-xray prisma/migrations`): catch `ACCESS EXCLUSIVE` PostgreSQL migration lock hazards before production.
11
+
12
+ ```text
13
+ +-------------------------------------------------------------+
14
+ | migration.sql --> lock classifier --> severity report |
15
+ | | | |
16
+ | +---- --fix --> CONCURRENTLY / NOT VALID rewrites |
17
+ +-------------------------------------------------------------+
18
+ ```
19
+
20
+ ## Install
21
+
22
+ [Bun](https://bun.sh) / [npm](https://www.npmjs.com/package/pg-lock-xray):
23
+
24
+ ```bash
25
+ bunx pg-lock-xray ./migrations
26
+ npx pg-lock-xray ./migrations
27
+
28
+ # or install in your project / globally
29
+ bun add -d pg-lock-xray
30
+ npm i -D pg-lock-xray
31
+ ```
32
+
33
+ [JSR](https://jsr.io/@kanchingyg/pg-lock-xray):
34
+
35
+ ```bash
36
+ bunx jsr add @kanchingyg/pg-lock-xray
37
+ npx jsr add @kanchingyg/pg-lock-xray
38
+ ```
39
+
40
+ [Cargo (Rust native binary)](https://github.com/kanchingyg/pg-lock-xray):
41
+
42
+ ```bash
43
+ cargo install --git https://github.com/kanchingyg/pg-lock-xray
44
+ ```
45
+
46
+ The core engine is **Rust** (`src/lib.rs`, `src/main.rs`, `src/mcp.rs`): static lock rules, zero-downtime rewrite hints, and `sqlOrPath` containment under `migrations/`, `prisma/`, `supabase/`, or `sql/`. TypeScript under `src/*.ts` is included for `npx` / `bunx` / JSR usage and MCP bridge helpers.
47
+
48
+ ## Quick start
49
+
50
+ ```bash
51
+ npx pg-lock-xray ./migrations
52
+ bunx pg-lock-xray ./migrations
53
+ npx pg-lock-xray --fix ./sql/0001_init.sql --dry-run
54
+ npx pg-lock-xray --fix ./sql/0001_init.sql --allow-write
55
+ npx pg-lock-xray --mcp
56
+ ```
57
+
58
+ ## What it catches
59
+
60
+ | Pattern | Risk |
61
+ | --- | --- |
62
+ | `CREATE INDEX` without `CONCURRENTLY` | `ACCESS EXCLUSIVE` lock blocking writes |
63
+ | `CREATE INDEX USING hnsw` without `CONCURRENTLY` | pgvector blocking index build |
64
+ | `ADD CONSTRAINT ... FOREIGN KEY` without `NOT VALID` | Long table validation lock |
65
+ | Volatile `DEFAULT` on `ADD COLUMN` | Full table rewrite |
66
+
67
+ ## MCP & Ollama
68
+
69
+ Add to `.cursor/mcp.json`:
70
+
71
+ ```json
72
+ {
73
+ "mcpServers": {
74
+ "pg-lock-xray": {
75
+ "command": "npx",
76
+ "args": ["-y", "pg-lock-xray", "--mcp"]
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ Call MCP tool `rewrite_zero_downtime` with `{ "sqlOrPath": "...", "model": "llama3.2", "baseUrl": "http://127.0.0.1:11434" }`.
83
+
84
+ ## Flags
85
+
86
+ | Flag | Purpose |
87
+ | --- | --- |
88
+ | `--allow-write` | Enable `rewrite_zero_downtime` file writes |
89
+ | `--dry-run` | Show diff / run tools without writing |
90
+ | `--mcp` | JSON-RPC MCP server on stdio |
91
+ | `--wsl-paths` | Normalize paths for WSL agents |
92
+
93
+ ## MCP Tools Reference
94
+
95
+ | Tool | Mutates | Description |
96
+ | --- | --- | --- |
97
+ | `scan_sql_locks` | `false` | Analyze SQL migration files or directories and classify `ACCESS EXCLUSIVE`, `SHARE`, and table-rewrite lock hazards. |
98
+ | `rewrite_zero_downtime` | `true` | Rewrite blocking DDL statements into `CONCURRENTLY` and `NOT VALID` zero-downtime patterns (writes require `--allow-write`). |
99
+ | `explain_lock_hazard` | `false` | Return lock mode matrix details and blocked query types for a specific PostgreSQL DDL statement. |
100
+
101
+ ## Editor and Agent Integration
102
+
103
+ ### Cursor (`.cursor/mcp.json`)
104
+
105
+ ```json
106
+ {
107
+ "mcpServers": {
108
+ "pg-lock-xray": {
109
+ "command": "npx",
110
+ "args": ["-y", "pg-lock-xray", "--mcp"]
111
+ }
112
+ }
113
+ }
114
+ ```
115
+
116
+ ### Claude Code CLI
117
+
118
+ ```bash
119
+ claude mcp add pg-lock-xray -- npx -y pg-lock-xray --mcp
120
+ ```
121
+
122
+ ### Programmatic Usage (JSR / TypeScript)
123
+
124
+ ```ts
125
+ import * as bridge from "jsr:@kanchingyg/pg-lock-xray/bridge";
126
+ ```
127
+
128
+ ## Runtime Safety and Guardrails
129
+
130
+ - **Stdio frame isolation**: When `--mcp` is active, `hijackStdoutForMcp()` redirects accidental `console.log` calls to `stderr` so JSON-RPC 2.0 frames on `stdout` never corrupt.
131
+ - **Read-only by default**: Mutating tools (`mutates: true`) are blocked in `--dry-run` mode and require explicit `--allow-write` authorization.
132
+ - **Loop breaker**: Repeated identical `(toolName, args)` invocations are hashed with SHA-256 and halted after 3 consecutive repeats to prevent runaway agent loops.
133
+ - **Context budget truncation**: Tool outputs are middle-truncated (`60%` head / `40%` tail) scaled to the probed local model `n_ctx` (Ollama `/api/show`, llama.cpp `/props`, vLLM `/v1/models`).
134
+ - **Secret redaction and path normalization**: AWS keys (`AKIA*`, `ASIA*`), bearer tokens, and `sk-*` keys are scrubbed before returning tool output, and Windows drive paths (`C:\...`) translate cleanly to `/mnt/c/...` when WSL mode is enabled.
135
+
136
+ ## License
137
+
138
+ [MIT](./LICENSE)
package/SKILL.md ADDED
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: pg-lock-xray
3
+ description: Scan Prisma/Drizzle/raw SQL migrations for Postgres lock risk and zero-downtime rewrites.
4
+ ---
5
+
6
+ # pg-lock-xray
7
+
8
+ ## When to use
9
+
10
+ - Before applying Prisma, Drizzle, or raw `.sql` migrations in production.
11
+ - You need per-statement lock modes (`ACCESS EXCLUSIVE`, `SHARE UPDATE EXCLUSIVE`, etc.).
12
+ - You want automatic expand/contract rewrites (`CONCURRENTLY`, `NOT VALID` + `VALIDATE`).
13
+
14
+ ## Commands
15
+
16
+ ```bash
17
+ npx pg-lock-xray prisma/migrations
18
+ npx pg-lock-xray --fix ./drizzle/0001.sql --dry-run
19
+ npx pg-lock-xray --fix ./migration.sql --allow-write
20
+ npx pg-lock-xray --mcp
21
+ ```
22
+
23
+ ## MCP tools (`--mcp`)
24
+
25
+ | Tool | Purpose |
26
+ |------|---------|
27
+ | `check_migration_locks` | Lock mode + severity per SQL statement |
28
+ | `rewrite_zero_downtime` | Deterministic rewrite; optional local model via `model` + `baseUrl` |
29
+
30
+ ## Flags
31
+
32
+ - `--dry-run` - show unified diff; MCP mutating tools simulate only
33
+ - `--allow-write` - allow `--fix` and `rewrite_zero_downtime` to write files
34
+ - `--wsl-paths` - normalize Windows ↔ WSL paths in MCP I/O
35
+
36
+ ## Cursor config snippet
37
+
38
+ ```json
39
+ {
40
+ "mcpServers": {
41
+ "pg-lock-xray": {
42
+ "command": "npx",
43
+ "args": ["-y", "pg-lock-xray", "--mcp"]
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ ## Ollama / local models
50
+
51
+ Set `OLLAMA_HOST=http://127.0.0.1:11434` and pass `model` to `rewrite_zero_downtime` for optional LLM polish after deterministic rules.
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { existsSync } from "node:fs";
4
+ import { dirname, join } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const __dirname = dirname(fileURLToPath(import.meta.url));
8
+ const argv = process.argv.slice(2);
9
+
10
+ const candidates = [
11
+ process.env.PG_LOCK_XRAY_BIN,
12
+ join(__dirname, "pg-lock-xray.exe"),
13
+ join(__dirname, "pg-lock-xray"),
14
+ join(__dirname, "..", "target", "release", "pg-lock-xray.exe"),
15
+ join(__dirname, "..", "target", "release", "pg-lock-xray"),
16
+ join(__dirname, "..", "target", "debug", "pg-lock-xray.exe"),
17
+ join(__dirname, "..", "target", "debug", "pg-lock-xray"),
18
+ ].filter(Boolean);
19
+
20
+ const native = candidates.find((p) => existsSync(p));
21
+ if (native) {
22
+ const result = spawnSync(native, argv, {
23
+ stdio: "inherit",
24
+ cwd: process.cwd(),
25
+ env: process.env,
26
+ });
27
+ const code = result.status ?? 1;
28
+ if (!argv.includes("--mcp")) {
29
+ process.exit(code);
30
+ }
31
+ process.exit(code);
32
+ }
33
+
34
+ const { runCli } = await import("../dist/cli.js");
35
+ const code = await runCli(argv);
36
+ if (!argv.includes("--mcp")) {
37
+ process.exit(code);
38
+ }
@@ -0,0 +1,131 @@
1
+ export declare const DEFAULT_N_CTX = 4096;
2
+ export type McpToolAnnotations = {
3
+ readOnlyHint?: boolean;
4
+ destructiveHint?: boolean;
5
+ idempotentHint?: boolean;
6
+ openWorldHint?: boolean;
7
+ };
8
+ export type McpToolDefinition<TArgs = Record<string, unknown>, TResult = unknown> = {
9
+ name: string;
10
+ description: string;
11
+ inputSchema: {
12
+ type: "object";
13
+ properties: Record<string, unknown>;
14
+ required?: string[];
15
+ additionalProperties?: boolean;
16
+ };
17
+ annotations?: McpToolAnnotations;
18
+ mutates?: boolean;
19
+ handler: (args: TArgs, ctx: {
20
+ dryRun: boolean;
21
+ allowWrite: boolean;
22
+ nCtx: number;
23
+ }) => Promise<TResult> | TResult;
24
+ };
25
+ export type GuardOptions = {
26
+ allowWrite?: boolean;
27
+ dryRun?: boolean;
28
+ };
29
+ export declare function setGuards(opts: GuardOptions): void;
30
+ export declare function setNCtx(value: number): void;
31
+ export declare function headTailTruncate(text: string, maxChars: number): string;
32
+ export declare function canonicalizeJson(value: unknown): string;
33
+ export declare function resetLoopBreaker(): void;
34
+ export declare function checkLoopBreaker(toolName: string, args: unknown): string | null;
35
+ export declare function isMutatingMcpTool(tool: {
36
+ mutates?: boolean;
37
+ annotations?: {
38
+ destructiveHint?: boolean;
39
+ };
40
+ } | null | undefined): boolean;
41
+ export declare function guardMutatingTool(tool: {
42
+ mutates?: boolean;
43
+ annotations?: {
44
+ destructiveHint?: boolean;
45
+ };
46
+ } | null | undefined): {
47
+ blocked: boolean;
48
+ reason?: string;
49
+ };
50
+ export declare function windowsToWsl(p: string): string;
51
+ export declare function wslToWindows(p: string): string;
52
+ export declare function normalizePathsDeep<T>(value: T, toWsl: boolean): T;
53
+ export declare function redactSecrets(text: string): string;
54
+ export declare const jsonRpcFrameLog: string[];
55
+ export declare function hijackStdoutForMcp(): void;
56
+ export declare function writeJsonRpcFrame(obj: object): void;
57
+ export type NCtxSource = "llama.cpp" | "ollama" | "vllm" | "fallback";
58
+ export declare function probeNCtx(baseUrl: string, fetchImpl?: typeof fetch): Promise<{
59
+ nCtx: number;
60
+ source: NCtxSource;
61
+ }>;
62
+ export declare function stripRedactedThinking(text: string): string;
63
+ export type ReasoningState = {
64
+ inToolLoop: boolean;
65
+ };
66
+ export declare function createReasoningState(): ReasoningState;
67
+ export declare function applyReasoningContentPolicy(messages: Array<Record<string, unknown>>, state: ReasoningState, newUserTurn: boolean): Array<Record<string, unknown>>;
68
+ export type ProviderId = "deepseek" | "dashscope" | "moonshot" | "ollama" | "openai" | "generic";
69
+ export declare function detectProvider(baseUrl: string): ProviderId;
70
+ export declare function normalizeToolChoice(toolChoice: unknown, provider: ProviderId): unknown;
71
+ export declare function sanitizeRequestBody(body: Record<string, unknown>, reasoner: boolean): Record<string, unknown>;
72
+ export declare function buildRecencyAnchor(sigs: Array<{
73
+ name: string;
74
+ summary: string;
75
+ }>): string;
76
+ export declare function anchorPromptTail(prompt: string, anchor: string): string;
77
+ /** Stateful helper class `StreamToolJsonAbort` (stream tool json abort). */
78
+ export declare class StreamToolJsonAbort {
79
+ private depth;
80
+ private started;
81
+ private acc;
82
+ /** Member `feed` (feed). */
83
+ feed(chunk: string): boolean;
84
+ }
85
+ export declare function parseDirtyToolCall(rawOutput: string, tools: McpToolDefinition[]): {
86
+ name: string;
87
+ arguments: Record<string, unknown>;
88
+ } | null;
89
+ export declare function l2Normalize(vec: number[]): number[];
90
+ export declare function mrlSlice(vec: number[], dimensions: number): number[];
91
+ export declare function chunkArray<T>(arr: T[], size: number): T[][];
92
+ export declare function normalizeEmbedBatch(inputs: string[], options: {
93
+ dimensions?: number;
94
+ maxBatch: number;
95
+ embed: (batch: string[], dimensions?: number) => Promise<number[][]>;
96
+ }): Promise<number[][]>;
97
+ export declare function normalizeEmbeddingsRequest(req: Record<string, unknown>, provider: string): Promise<{
98
+ data: Array<{
99
+ embedding: number[] | string;
100
+ index: number;
101
+ }>;
102
+ model: string;
103
+ }>;
104
+ export declare function callOpenAiCompatChat(baseUrl: string, body: Record<string, unknown>, fetchImpl?: typeof fetch): Promise<string>;
105
+ export type McpServerOptions = {
106
+ tools: McpToolDefinition[];
107
+ pathToWsl?: boolean;
108
+ serverName?: string;
109
+ version?: string;
110
+ };
111
+ export declare function startMcpServer(meta: {
112
+ name: string;
113
+ version: string;
114
+ }, tools: McpToolDefinition[], options?: {
115
+ allowWrite?: boolean;
116
+ pathToWsl?: boolean;
117
+ }): void;
118
+ export type DispatchCtx = {
119
+ tools: McpToolDefinition[];
120
+ handlers: Map<string, McpToolDefinition>;
121
+ toWsl: boolean;
122
+ serverName: string;
123
+ version: string;
124
+ };
125
+ export declare function dispatchMcpMessage(msg: {
126
+ jsonrpc?: string;
127
+ id?: number | string;
128
+ method?: string;
129
+ params?: Record<string, unknown>;
130
+ }, ctx: DispatchCtx): void;
131
+ //# sourceMappingURL=bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACz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