vibe-gate-mcp 0.1.0 → 0.1.2

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/CHANGELOG.md CHANGED
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.2] - 2026-09-02
9
+
10
+ ### Fixed
11
+
12
+ - Reject malformed cited line ranges with non-positive or reversed line numbers.
13
+
14
+ ### Tests
15
+
16
+ - Added configuration loading and effective model resolution coverage.
17
+ - Added critical snippet extraction coverage for matching, ignored directories, limits, missing roots, and case-insensitive paths.
18
+
19
+ ## [0.1.1] - 2026-08-31
20
+
21
+ ### Fixed
22
+
23
+ - Added a 30-second timeout to OpenCode external fetch calls.
24
+ - Stopped logging `CRITIC_PROVIDER` in debug output.
25
+ - Added safe fallback handling for invalid, unreadable, or oversized `rules.json` files.
26
+
27
+ ### Tests
28
+
29
+ - Added unit coverage for token estimation, error handling, debug logging, configuration, and OpenCode timeout behavior.
30
+
8
31
  ## [0.1.0] - 2026-08-28
9
32
 
10
33
  Initial release of `vibe-gate-mcp`.
package/dist/index.mjs CHANGED
@@ -47,7 +47,6 @@ function loadEnvironmentVariables(packageRoot) {
47
47
  });
48
48
  debugLog$1("Loaded package .env");
49
49
  }
50
- debugLog$1(`Env check after load -> CRITIC_PROVIDER: ${process.env.CRITIC_PROVIDER || "none"}`);
51
50
  }
52
51
  //#endregion
53
52
  //#region src/constants.ts
@@ -173,6 +172,8 @@ const OPENCODE_ZEN_URLS = {
173
172
  RESPONSES: `${OPENCODE_ZEN.BASE_URL}/${OPENCODE_ZEN.PATHS.RESPONSES}`,
174
173
  MODELS_LIST: `${OPENCODE_ZEN.BASE_URL}/${OPENCODE_ZEN.PATHS.MODELS}`
175
174
  };
175
+ /** Default timeout for external fetch calls in OpenCode API integrations (30 seconds) */
176
+ const OPENCODE_FETCH_TIMEOUT_MS = 3e4;
176
177
  /** OpenCode Go gateway — @see https://opencode.ai/docs/go/ */
177
178
  const OPENCODE_GO = {
178
179
  BASE_URL: "https://opencode.ai/zen/go/v1",
@@ -1542,9 +1543,11 @@ const DEFAULT_RULES = {
1542
1543
  hardRules: [],
1543
1544
  softRules: []
1544
1545
  };
1546
+ const MAX_RULES_FILE_BYTES = 1048576;
1545
1547
  async function loadRules(workspaceRoot) {
1546
1548
  const path = join(workspaceRoot, PATHS.RULES_JSON);
1547
1549
  try {
1550
+ if ((await stat(path)).size > MAX_RULES_FILE_BYTES) return DEFAULT_RULES;
1548
1551
  const raw = await readFile(path, "utf-8");
1549
1552
  const parsed = JSON.parse(raw);
1550
1553
  const result = rulesConfigSchema.safeParse(parsed);
@@ -2306,7 +2309,8 @@ async function completeViaResponses(apiKey, model, messages) {
2306
2309
  model: normalizeOpenCodeModelId(model),
2307
2310
  input: toRoleContentMessages(messages),
2308
2311
  max_output_tokens: LLM_MAX_TOKENS
2309
- })
2312
+ }),
2313
+ signal: AbortSignal.timeout(OPENCODE_FETCH_TIMEOUT_MS)
2310
2314
  });
2311
2315
  if (!response.ok) {
2312
2316
  const errorBody = await response.text();
@@ -2331,7 +2335,8 @@ async function completeViaGemini(apiKey, model, messages, plan) {
2331
2335
  body: JSON.stringify({
2332
2336
  contents: toGeminiContents(messages),
2333
2337
  generationConfig: { maxOutputTokens: LLM_MAX_TOKENS }
2334
- })
2338
+ }),
2339
+ signal: AbortSignal.timeout(OPENCODE_FETCH_TIMEOUT_MS)
2335
2340
  });
2336
2341
  if (!response.ok) {
2337
2342
  const errorBody = await response.text();
@@ -2751,6 +2756,14 @@ function validateLineNumbers(fileInfo, evidence) {
2751
2756
  if (!fileInfo) return false;
2752
2757
  const lineRange = extractLineRangeFromEvidence(evidence);
2753
2758
  if (!lineRange) return true;
2759
+ if (lineRange.start <= 0 || lineRange.end <= 0) {
2760
+ debugLog(`[DEBUG] validateLineNumbers: REJECTING - invalid line numbers (start: ${lineRange.start}, end: ${lineRange.end})`);
2761
+ return false;
2762
+ }
2763
+ if (lineRange.start > lineRange.end) {
2764
+ debugLog(`[DEBUG] validateLineNumbers: REJECTING - start line ${lineRange.start} exceeds end line ${lineRange.end}`);
2765
+ return false;
2766
+ }
2754
2767
  if (lineRange.start > fileInfo.totalLines) {
2755
2768
  debugLog(`[DEBUG] validateLineNumbers: REJECTING - start line ${lineRange.start} exceeds total lines ${fileInfo.totalLines}`);
2756
2769
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-gate-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Adversarial Quality Gate MCP for vibe-coding: IDE AI vs Critic AI, human decides on deadlock",
6
6
  "license": "MIT",
@@ -23,7 +23,9 @@
23
23
  "engines": {
24
24
  "node": ">=24"
25
25
  },
26
- "bin": "dist/index.mjs",
26
+ "bin": {
27
+ "vibe-gate-mcp": "dist/index.mjs"
28
+ },
27
29
  "files": [
28
30
  "dist",
29
31
  "rules.json",