Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .fleet/2026_09_23/issue_tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"repo": "wryenmeek/knowledgebase",
"analyzed_at": "2026-09-23T10:47:49.551Z",
"root_causes": [
{
"id": "rc-missing-infigraph-runtime",
"title": "Missing Infigraph runtime and capability contract",
"severity": "medium",
"issues": [
597
],
"files": [
"scripts/analysis/infigraph.py"
],
"description": "The codebase currently lacks an integration wrapper for the Infigraph CLI. There is no code path for capability checks, reproducible metadata resolution, or standardized status handling for the analysis.",
"solution_summary": "Introduce a new module `scripts/analysis/infigraph.py` providing `InfigraphRuntime` with methods to check capabilities and run analysis, returning normalized statuses. Add corresponding tests using a fake executable."
}
],
"tasks": [
{
"id": "task-add-infigraph-runtime",
"title": "Add reproducible Infigraph runtime and capability contract",
"root_cause": "rc-missing-infigraph-runtime",
"issues": [
597
],
"files": [],
"new_files": [
"scripts/analysis/infigraph.py"
],
"test_files": [
"tests/analysis/test_infigraph.py"
],
"risk": "low",
"prompt": "Implement a reproducible Infigraph runtime wrapper in `scripts/analysis/infigraph.py`.\n\n### Diagnosis\nThe knowledgebase currently lacks a wrapper to invoke the Infigraph CLI. There is no code path in `scripts/analysis` (or elsewhere) that handles Infigraph metadata resolution, startup checks, or capability analysis. As a result, the integration cannot determine if the required analysis capabilities are available or execute them reproducibly.\n\n### Proposed Implementation\nIntroduce a new module `scripts/analysis/infigraph.py` that provides:\n1. `InfigraphRelease`: A dataclass for reproducible metadata (version, checksum, resolution date).\n2. `InfigraphStatus`: An Enum defining `analysis_complete`, `analysis_unavailable`, and `analysis_failed`.\n3. `InfigraphRuntime`: A class that verifies the executable exists, runs capability checks to distinguish between unavailable, unsupported, or ready to analyze, and executes analysis commands with timeout handling and actionable failure reasons.\n\n```python\n# scripts/analysis/infigraph.py\nimport subprocess\nimport json\nimport enum\nfrom dataclasses import dataclass\nfrom typing import Optional, Dict, Any\n\nclass InfigraphStatus(enum.Enum):\n ANALYSIS_COMPLETE = \"analysis_complete\"\n ANALYSIS_UNAVAILABLE = \"analysis_unavailable\"\n ANALYSIS_FAILED = \"analysis_failed\"\n\n@dataclass\nclass InfigraphRelease:\n version: str\n checksum: str\n resolved_at: str\n\nclass InfigraphRuntime:\n def __init__(self, executable_path: str, release: InfigraphRelease):\n self.executable_path = executable_path\n self.release = release\n\n def check_capabilities(self) -> InfigraphStatus:\n try:\n result = subprocess.run(\n [self.executable_path, \"--capabilities\"],\n capture_output=True,\n text=True,\n timeout=5\n )\n if result.returncode != 0:\n return InfigraphStatus.ANALYSIS_UNAVAILABLE\n return InfigraphStatus.ANALYSIS_COMPLETE\n except FileNotFoundError:\n return InfigraphStatus.ANALYSIS_UNAVAILABLE\n except subprocess.TimeoutExpired:\n return InfigraphStatus.ANALYSIS_FAILED\n except Exception:\n return InfigraphStatus.ANALYSIS_FAILED\n\n def analyze(self, target_path: str) -> Dict[str, Any]:\n try:\n result = subprocess.run(\n [self.executable_path, \"analyze\", target_path],\n capture_output=True,\n text=True,\n timeout=30\n )\n if result.returncode != 0:\n return {\"status\": InfigraphStatus.ANALYSIS_FAILED.value, \"reason\": \"Command failed\"}\n return {\"status\": InfigraphStatus.ANALYSIS_COMPLETE.value, \"data\": json.loads(result.stdout)}\n except FileNotFoundError:\n return {\"status\": InfigraphStatus.ANALYSIS_UNAVAILABLE.value, \"reason\": \"Executable not found\"}\n except subprocess.TimeoutExpired:\n return {\"status\": InfigraphStatus.ANALYSIS_FAILED.value, \"reason\": \"Timeout\"}\n except json.JSONDecodeError:\n return {\"status\": InfigraphStatus.ANALYSIS_FAILED.value, \"reason\": \"Malformed output\"}\n```\n\n### Test Scenarios\nCreate `tests/analysis/test_infigraph.py` using a fake executable (e.g., via a temporary python script) to cover:\n1. Successful capability discovery (`analysis_complete`).\n2. Representative installation failure (executable not found).\n3. Capability failure (executable unsupported).\n4. Command failure (executable returns non-zero code).\n5. Command timeout (`analysis_failed`).\n6. Malformed JSON output (`analysis_failed`).\n\n### Requirements & Constraints\n- Do NOT introduce cross-repository graph storage or MCP integration.\n- `scripts/analysis/infigraph.py` provides the runtime contract.\n- `tests/analysis/test_infigraph.py` fully tests the capabilities using a fake executable.\n- The codebase enforces the normalized statuses.\n\n### File Boundary Rule\nYou may ONLY modify the files listed above. If a test file outside your boundary fails, you must make your source changes backward-compatible so the existing test passes unmodified. Do NOT rename, move, or delete any files outside your boundary."
}
],
"unaddressable": [],
"file_ownership": {
"scripts/analysis/infigraph.py": "task-add-infigraph-runtime",
"tests/analysis/test_infigraph.py": "task-add-infigraph-runtime"
}
}
120 changes: 120 additions & 0 deletions .fleet/2026_09_23/issue_tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Issue Analysis: wryenmeek/knowledgebase

> Analyzed 1 issues on 2026-09-23T10:47:49.551Z

## Executive Summary

Identified 1 root cause corresponding to a missing feature for Infigraph integration. The issue is addressable and requires introducing a new runtime wrapper module to manage the Infigraph executable safely, along with its test suite.

## Root Cause Analysis

### RC-1: Missing Infigraph runtime and capability contract

**Related issues:** #597
**Severity:** Medium
**Files involved:** `scripts/analysis/infigraph.py`

#### Diagnosis

The knowledgebase currently lacks a wrapper to invoke the Infigraph CLI. There is no code path in `scripts/analysis` (or elsewhere) that handles Infigraph metadata resolution, startup checks, or capability analysis. As a result, the integration cannot determine if the required analysis capabilities are available or execute them reproducibly.

#### Proposed Solution

Introduce a new module `scripts/analysis/infigraph.py` that provides:
1. `InfigraphRelease`: A dataclass for reproducible metadata (version, checksum, resolution date).
2. `InfigraphStatus`: An Enum defining `analysis_complete`, `analysis_unavailable`, and `analysis_failed`.
3. `InfigraphRuntime`: A class that:
- Verifies the executable exists.
- Runs capability checks to distinguish between an executable that is unavailable, unsupported, or ready to analyze.
- Executes analysis commands with timeout handling.
- Returns normalized statuses including actionable failure reasons.

```python
# scripts/analysis/infigraph.py
import subprocess
import json
import enum
from dataclasses import dataclass
from typing import Optional, Dict, Any

class InfigraphStatus(enum.Enum):
ANALYSIS_COMPLETE = "analysis_complete"
ANALYSIS_UNAVAILABLE = "analysis_unavailable"
ANALYSIS_FAILED = "analysis_failed"
Comment on lines +40 to +43

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reuse the canonical status contract

The dispatched task is instructed to define InfigraphStatus locally, even though scripts/kb/contracts.py is the repository's canonical home for status enums and parallel private definitions are prohibited. Because the task boundary also excludes that module, following this prompt necessarily creates a duplicate status contract; move the enum to contracts.py, export it through __all__, and add the affected contract files/tests to task ownership.

AGENTS.md reference: AGENTS.md:L79-L82

Useful? React with 👍 / 👎.


@dataclass
class InfigraphRelease:
version: str
checksum: str
resolved_at: str

class InfigraphRuntime:
def __init__(self, executable_path: str, release: InfigraphRelease):
self.executable_path = executable_path
self.release = release
Comment on lines +52 to +54

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify the pinned release before reporting readiness

The proposed runtime only stores release; it never compares the executable's version or checksum with that metadata, and check_capabilities() treats every zero exit as ANALYSIS_COMPLETE without inspecting which capabilities were returned. Consequently, a different or unsupported binary can be run and reported as successful, defeating the task's core reproducibility and capability contract. Require version/checksum and required-capability verification before analysis, with mismatch tests.

Useful? React with 👍 / 👎.


def check_capabilities(self) -> InfigraphStatus:
try:
result = subprocess.run(
[self.executable_path, "--capabilities"],
capture_output=True,
text=True,
timeout=5
)
if result.returncode != 0:
return InfigraphStatus.ANALYSIS_UNAVAILABLE
return InfigraphStatus.ANALYSIS_COMPLETE
except FileNotFoundError:
return InfigraphStatus.ANALYSIS_UNAVAILABLE
except subprocess.TimeoutExpired:
return InfigraphStatus.ANALYSIS_FAILED
except Exception:
return InfigraphStatus.ANALYSIS_FAILED

def analyze(self, target_path: str) -> Dict[str, Any]:
try:
result = subprocess.run(
[self.executable_path, "analyze", target_path],
capture_output=True,
text=True,
timeout=30
)
if result.returncode != 0:
return {"status": InfigraphStatus.ANALYSIS_FAILED.value, "reason": "Command failed"}
return {"status": InfigraphStatus.ANALYSIS_COMPLETE.value, "data": json.loads(result.stdout)}
except FileNotFoundError:
return {"status": InfigraphStatus.ANALYSIS_UNAVAILABLE.value, "reason": "Executable not found"}
except subprocess.TimeoutExpired:
return {"status": InfigraphStatus.ANALYSIS_FAILED.value, "reason": "Timeout"}
except json.JSONDecodeError:
return {"status": InfigraphStatus.ANALYSIS_FAILED.value, "reason": "Malformed output"}
```

#### Test Plan

Create `tests/analysis/test_infigraph.py` using a fake executable (e.g., via a temporary python script) to cover:
1. Successful capability discovery (`analysis_complete`).
2. Representative installation failure (executable not found).
3. Capability failure (executable unsupported).
4. Command failure (executable returns non-zero code).
5. Command timeout (`analysis_failed`).
6. Malformed JSON output (`analysis_failed`).

---

## Task Plan

| # | Task | Root Cause | Issues | Files | Risk |
|---|------|-----------|--------|-------|------|
| 1 | Add reproducible Infigraph runtime | RC-1 | #597 | `scripts/analysis/infigraph.py` | Low |

## File Ownership Matrix

| File | Task | Change Type |
|------|------|-------------|
| `scripts/analysis/infigraph.py` | 1 | Create |
| `tests/analysis/test_infigraph.py` | 1 | Create |
Comment on lines +113 to +116

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add the required surface declaration to the task boundary

When this manifest is dispatched, the agent is limited to the two files in this ownership matrix while creating the executable surface scripts/analysis/infigraph.py. Repository policy requires every new executable under scripts/** to add or update the write-surface matrix, so the agent cannot produce a compliant change without violating its file-boundary instruction. Include AGENTS.md and the corresponding matrix contract test in the task ownership and prompt.

AGENTS.md reference: AGENTS.md:L84-L88

Useful? React with 👍 / 👎.


## Unaddressable Issues

None
Loading