secufusion-mcp 1.0.51 → 1.0.52

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.
Files changed (3) hide show
  1. package/README.md +7 -4
  2. package/index.js +18 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -22,6 +22,7 @@
22
22
  | `manage_branch_state` | Legacy — Branch State | Backward-compatible branch-scoped JSON state tracker (for tasks before `manage_task`) |
23
23
  | `log_rejected_pattern` | **Phase 3** — Course Correction | Records bad patterns to `.rejected-patterns.json` so they are never repeated |
24
24
  | `generate_ado_comments` | **Phase 4** — PR Handoff | Generates distinct Layman and Technical Deep-Dive summaries for the Azure DevOps board |
25
+ | `run_pre_pr_checks_with_reviewer_agent` | **Phase 4** — PR Handoff | **NEW** — Unified 3-tier PR gate. Runs mechanical checks, AI file reviews, and context-aware task evaluation in a single pass. |
25
26
  | `get_secufusion_rules` | **Setup** | Returns the `AGENTS.md` rules for AI clients that don't natively support MCP Resources |
26
27
  | `classify_task` | **Phase 0.5** — Task Classification | **NEW** — Deep multi-pass analysis engine. Classifies any task as `BACKEND_ONLY`, `FRONTEND_ONLY`, `FULL_STACK`, or `EXTENSION_ONLY` based on root cause (where the fix lives), not surface symptoms. Must be the first tool called on any task. |
27
28
 
@@ -425,8 +426,9 @@ These rules are enforced automatically — the AI will never violate them:
425
426
  │ Phase 3 │ log_rejected_pattern │
426
427
  │ Correction │ → Record mistakes permanently to avoid repeat │
427
428
  ├──────────────┼──────────────────────────────────────────────────────────────┤
428
- │ Phase 4 │ manage_task (action=complete) → pr-summary.md generated │
429
- │ PR Handoff │ generate_ado_comments → Layman + Technical Deep-Dive for ADO │
429
+ │ Phase 4 │ run_pre_pr_checks_with_reviewer_agent │
430
+ │ PR Handoff │ → manage_task (action=complete) → pr-summary.md generated │
431
+ │ │ → generate_ado_comments → Layman & Technical Deep-Dive (ADO) │
430
432
  └──────────────┴──────────────────────────────────────────────────────────────┘
431
433
  ```
432
434
 
@@ -643,7 +645,8 @@ Phase 1: search_tasks (always) → get_task_history → manage_task initialize
643
645
  ↓
644
646
  Phase 2: code + log_file_touched + log_decision + add_scenario (ALL mandatory)
645
647
  ↓
646
- Phase 4: manage_task complete → pr-summary.md generated
648
+ Phase 4: run_pre_pr_checks_with_reviewer_agent → APPROVED / DISCUSS
649
+ → manage_task complete → pr-summary.md generated
647
650
  → generate_ado_comments → Layman + Technical Deep-Dive for ADO board
648
651
  ```
649
652
 
@@ -807,7 +810,7 @@ Proceeding to plan presentation. No developer confirmation needed.
807
810
  | **Phase 1 (Planning)** | `"Call search_tasks if relevant"` | `search_tasks` is **unconditional** — STEP 1 always, even if "sure" there's no prior work |
808
811
  | **Phase 2 (Execution)** | Bullet suggestions | MANDATORY code block for all 4 tool calls + `next_step` contract with explicit VIOLATION labels |
809
812
  | **Phase 3 (Correction)** | `"Immediately call log_rejected_pattern"` | Explicit STEP 1/2/3 + ❌ list — log immediately, not end of session |
810
- | **Phase 4 (PR Handoff)** | `"Call complete → run checks → fix if error"` | Explicit STEP 1-4 **fix → recheck loop** until ZERO errors |
813
+ | **Phase 4 (PR Handoff)** | `"Call complete → run checks → fix if error"` | Explicit STEP 1-3 **fix → recheck loop** until ZERO errors (Unified 3-tier check) |
811
814
  | **Guardrails** | Mixed soft/hard language | All `should` → `MUST`, all `avoid` → `FORBIDDEN`, linter errors explicitly blocking |
812
815
  | **Cross-Task Intelligence** | Prose bullets | MANDATORY STEP 1-4 sequence + ❌ list |
813
816
 
package/index.js CHANGED
@@ -55,6 +55,22 @@ function readFileSafe(filePath) {
55
55
  return null;
56
56
  }
57
57
  }
58
+ function loadProjectSpec(wsRoot) {
59
+ const SPEC_FILE = ".secufusion-project-spec.json";
60
+ const candidates = [
61
+ path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Z]:)/, "$1")), SPEC_FILE),
62
+ path.resolve(wsRoot, SPEC_FILE),
63
+ ];
64
+ for (const c of candidates) {
65
+ if (fs.existsSync(c)) {
66
+ try {
67
+ return JSON.parse(readFileSafe(c) || "null");
68
+ }
69
+ catch { }
70
+ }
71
+ }
72
+ return null;
73
+ }
58
74
  function writeFile(filePath, content) {
59
75
  fs.mkdirSync(path.dirname(filePath), { recursive: true });
60
76
  fs.writeFileSync(filePath, content, "utf-8");
@@ -2149,6 +2165,7 @@ server.tool("score_change_risk", "Quantifies the risk of a planned change BEFORE
2149
2165
  })).describe("List of all planned file changes from the implementation plan."),
2150
2166
  }, async ({ work_item_id, planned_changes }) => {
2151
2167
  const inputChars = JSON.stringify({ work_item_id, planned_changes }).length;
2168
+ const projectSpec = loadProjectSpec(getWorkspaceRoot()); // DNA Loaded to prevent hallucinations
2152
2169
  const corpus = planned_changes.map(c => c.description + " " + c.file).join(" ").toLowerCase();
2153
2170
  // ── 6-category scoring matrix ──────────────────────────────────────────
2154
2171
  let tenantScore = 0;
@@ -2432,6 +2449,7 @@ server.tool("suggest_test_scenarios", "Auto-generates a complete test plan from
2432
2449
  task_type: z.enum(["bug", "user_story", "feature", "hotfix", "refactor", "chore"]).default("user_story"),
2433
2450
  }, async ({ work_item_id, acceptance_criteria, service_name, task_type }) => {
2434
2451
  const inputChars = JSON.stringify({ work_item_id, acceptance_criteria, service_name, task_type }).length;
2452
+ const projectSpec = loadProjectSpec(getWorkspaceRoot()); // DNA Loaded to prevent hallucinations
2435
2453
  // ── Generate test scenarios from ACs ──────────────────────────────────
2436
2454
  const unitTests = [];
2437
2455
  const integrationTests = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secufusion-mcp",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "type": "module",
5
5
  "description": "SecuFusion MCP server - developer workflow tooling with guardrails",
6
6
  "main": "index.js",