forge-blastguard
# BlastGuard — Teamwork Graph Release Gate, ADR Conformance & Bus-Factor Studio (`forge-blastguard`)
[](LICENSE)
[](https://github.com/z121245017-ai/forge-blastguard/releases/tag/v1.0.0)
[](https://z121245017-ai.github.io/forge-blastguard/)
[](https://glama.ai/mcp/servers/z121245017-ai/forge-blastguard)
**BlastGuard** is an Atlassian Forge app, Rovo Agent (`rovo:agent`), Atlassian MCP server (`rovo:mcp`), CLI, and zero-network visual studio that turns fragmented **Teamwork Graph** relationships across **Jira Software, Bitbucket Pull Requests, Compass Service Components, Confluence Architecture Decision Records (ADRs), and Jira Service Management (JSM) Post-Incident Reviews** into a deterministic **`0–100` Ship-Confidence Gate**.
- **Live Interactive Studio (Zero Install, `connect-src 'none'`)**: [https://z121245017-ai.github.io/forge-blastguard/](https://z121245017-ai.github.io/forge-blastguard/)
- **Atlassian Forge Cloud Deployment Guide**: [docs/FORGE_SETUP.md](docs/FORGE_SETUP.md)
- **Reusable Agent Skill (`rovo:mcp` + Claude Code / Cursor)**: [SKILL.md](SKILL.md)
---
## Why We Built BlastGuard ("Build with Context. Ship with Confidence.")
Software teams rarely cause outages because they lack an AI code generator—they cause Friday-afternoon outages because **organizational context is split across four disconnected tools** at merge time:
1. **Bitbucket PR diffs** modify a shared service (`svc-payments-ledger`) or introduce a new cross-service RPC edge that quietly closes a 3-hop circular dependency.
2. **Jira Service Management (JSM)** has an unclosed Sev-1 Post-Incident Review remediation task (`PAY-1398` from `INC-402`) on that exact component.
3. **Confluence ADRs** (`ADR-019`) mandate a companion rollback SQL script, idempotency contract test, and `dba-reviewer` + `security-reviewer` sign-off whenever ledger migrations change—yet nobody re-reads 40 Confluence pages during PR review.
4. **Contributor Silos & PTO Blind Spots**: The primary author who wrote 68% of `svc-payments-ledger` (`@alice.wu`) is `OOO`, and the lone PR approver has `0%` historical commit or incident-response context on the ledger.
Instead of feeding raw diffs into a non-deterministic LLM prompt ($0 Forge LLM spend required), BlastGuard runs **four exact graph and information-theoretic algorithms** over your Teamwork Graph context.
---
## Deterministic Core Algorithms (`src/engine/`)
| Subsystem | Module | Mathematical & Graph Model |
| :--- | :--- | :--- |
| **1. Multi-Hop Blast Radius & Cycle Trap** | [`src/engine/teamwork-graph.mjs`](src/engine/teamwork-graph.mjs) | Traverses typed Atlassian Resource Identifiers (`ari:cloud:...`) via **Dijkstra maximum-impact path relaxation** in $-\ln(\text{coupling})$ space across Tier-0..Tier-3 services, paired with **Tarjan's Strongly Connected Components ($O(V+E)$)** to catch circular microservice dependencies and JSM Sev-1/Sev-2 PIR intersections. |
| **2. Confluence ADR Drift Verifier** | [`src/engine/adr-conformance.mjs`](src/engine/adr-conformance.mjs) | Evaluates PR file globs, newly added dependency edges, approver governance roles, and 30-day SLO error-budget floors against machine-checkable Confluence ADR clauses (`coChangeInvariants`, `forbiddenEdges`, `forbidDependencyCycles`, `minErrorBudgetPct`). |
| **3. Ownership HHI & Reviewer Set-Cover** | [`src/engine/ownership-reviewer.mjs`](src/engine/ownership-reviewer.mjs) | Computes **Herfindahl-Hirschman Index** ($\text{HHI} = \sum s_i^2$), normalized **Shannon Ownership Entropy**, effective **Bus Factor**, OOO silo exposure, and solves a **queue-penalized Weighted Greedy Set-Cover** to recommend the minimal active teammates covering 100% of touched components and ADR roles. |
| **4. Calibrated Ship-Confidence Gate** | [`src/engine/release-gate.mjs`](src/engine/release-gate.mjs) | Combines `Blast Safety (30%) + JSM & SLO Budget (30%) + ADR Conformance (25%) + Reviewer Coverage (15%)` with non-maskable **Hard Veto Gates** (`OPEN_SEV1_PIR_BLOCKER`, `CONFLUENCE_ADR_HARD_BREACH`, `CYCLIC_SERVICE_DEPENDENCY`, `ZERO_CONTEXT_TIER0_APPROVAL`) into `SHIP_CONFIDENT`, `GUARDED_CANARY`, or `HOLD_RELEASE`. |
---
## Atlassian Forge Architecture (`manifest.yml`)
```mermaid
flowchart LR
TG["Teamwork Graph\n(Jira · PRs · Compass · Confluence ADRs · JSM)"] --> FN["Forge Functions\n(nodejs22.x · src/index.mjs)"]
FN --> ENG["Isomorphic Deterministic Engine\n(Tarjan SCC · Dijkstra · ADR · HHI Set-Cover)"]
ENG --> UI["Jira Issue Panel Custom UI\n(docs/index.html)"]
ENG --> ROVO["Rovo Agent\n(blastguard-release-commander)"]
ENG --> MCP["Atlassian MCP (rovo:mcp)\n+ Local Stdio MCP + SKILL.md"]
```
- **`jira:issuePanel` (`blastguard-release-gate-panel`)**: Interactive Custom UI panel with clickable SVG blast-radius topology, live remediation what-if toggles, and 1-click Jira Markdown receipt export.
- **`rovo:agent` (`blastguard-release-commander`)**: Grounded AI release commander backed by 4 typed Forge `action` modules.
- **`rovo:mcp` (`blastguard-atlassian-mcp`) + [`SKILL.md`](SKILL.md)**: Exposes `evaluate-release-gate`, `trace-blast-radius`, `verify-adr-conformance`, and `recommend-contextual-reviewers` over Atlassian MCP and local `stdio` JSON-RPC 2.0.
---
## Quickstart (`0` Dependencies, Runs in `< 1s`)
### 1. Run the Automated Test Suite
```bash
git clone https://github.com/z121245017-ai/forge-blastguard.git
cd forge-blastguard
npm test
```
### 2. Run the CLI Release Gate on Built-In Enterprise Scenarios
```bash
# List all 4 Teamwork Graph enterprise scenarios
node ./bin/blastguard-cli.mjs --list
# Evaluate PAY-1420 (HOLD_RELEASE: Sev-1 PIR + ADR-019 SQL/coupling breach + OOO silo)
node ./bin/blastguard-cli.mjs --issue PAY-1420 --format markdown
# Evaluate CORE-903 (HOLD_RELEASE: Tarjan 3-service runtime cycle trap)
node ./bin/blastguard-cli.mjs --issue CORE-903 --format markdown
# Evaluate AUTH-884 (GUARDED_CANARY: Tier-0 OAuth2 rotation @ 31% SLO budget)
node ./bin/blastguard-cli.mjs --issue AUTH-884 --format markdown
# Evaluate SEARCH-512 (SHIP_CONFIDENT: 97/100 clean Tier-2 Rovo chunker)
node ./bin/blastguard-cli.mjs --issue SEARCH-512 --format markdown
```
### 3. Run the Model Context Protocol (`MCP`) Server Locally or via Docker
```bash
# Direct stdio JSON-RPC 2.0 (supports both NDJSON and Content-Length framing)
printf '{"jsonrpc":"2.0","id":1,"method":"tools/list"}\n' | node ./bin/blastguard-mcp.mjs
# Containerized non-root MCP server (Glama.ai compatible)
docker build -t forge-blastguard-mcp .
printf '{"jsonrpc":"2.0","id":1,"method":"tools/list"}\n' | docker run --rm -i forge-blastguard-mcp
```
---
## Built-In Enterprise Verification Matrix
| Jira Key | Scenario | Verdict | Score | Primary Signal Caught |
| :--- | :--- | :---: | :---: | :--- |
| `PAY-1420` | Multi-Currency Settlement Batcher | `HOLD_RELEASE` | `20/100` | Unclosed Sev-1 PIR `PAY-1398`, `ADR-019` missing rollback SQL + forbidden `Tier-0 -> Tier-3` sync RPC, `0%` reviewer context (`@alice.wu` OOO) |
| `CORE-903` | Billing Webhook Quota Sync Callback | `HOLD_RELEASE` | `49/100` | Tarjan SCC 3-node runtime cycle (`svc-billing -> svc-notifications -> svc-tenant-quota -> svc-billing`) breaching `ADR-012` |
| `AUTH-884` | OAuth2 PKCE Refresh Token Rotation | `GUARDED_CANARY` | `76/100` | Passes security tests & role signoff, but `31%` remaining Tier-0 SLO budget triggers progressive canary (`ADR-007`) |
| `SEARCH-512` | Rovo Knowledge Chunk Deduplicator | `SHIP_CONFIDENT` | `97/100` | Isolated `Tier-2` worker, `100%` `ADR-031` conformance, balanced `HHI = 0.264` (`Bus Factor = 3`), `96%` SLO budget |
---
## License
Released under the [MIT License](LICENSE).
TDQS
Scored across 4 tools
The four tools have clearly distinct primary actions: gate evaluation, dependency traversal, ADR auditing, and reviewer recommendation. There is some conceptual overlap because evaluate_release_gate aggregates blast-radius and ADR signals that trace_blast_radius and verify_adr_conformance compute individually, but the descriptions make the aggregate-versus-diagnostic boundary mostly clear.
All tool names use a consistent snake_case verb_noun pattern: evaluate_release_gate, trace_blast_radius, verify_adr_conformance, and recommend_contextual_reviewers. The convention is predictable and readable throughout.
Four tools is a well-scoped set for a focused release-governance and blast-radius analysis server. Each tool corresponds to a distinct analytical capability rather than redundant surface area.
The surface covers the core lifecycle of release risk assessment: gate scoring, dependency impact, policy conformance, and reviewer selection. Minor gaps remain around inspecting available policies, services, or historical gate results, but the main workflow is substantially covered.