ruvnet/RuView · error · ManifestError

manifest is not valid JSON: {e}

Error message

manifest is not valid JSON: {e}

What it means

load_manifest() in scripts/check_fix_markers.py parses scripts/fix-markers.json with json.loads and re-raises any json.JSONDecodeError as ManifestError with the parser's message (line/column included). The manifest is strict JSON, so anything the stdlib JSON parser rejects — trailing commas, comments, single quotes, unresolved merge-conflict markers — triggers this before any marker checking happens.

Source

Thrown at scripts/check_fix_markers.py:73

DIM = lambda s: _c("2", s)
BOLD = lambda s: _c("1", s)

OK_MARK = "PASS"
BAD_MARK = "FAIL"
ARROW = "->"


class ManifestError(Exception):
    pass


def load_manifest() -> dict:
    if not MANIFEST_PATH.exists():
        raise ManifestError(f"manifest not found: {MANIFEST_PATH}")
    try:
        data = json.loads(MANIFEST_PATH.read_text(encoding="utf-8"))
    except json.JSONDecodeError as e:
        raise ManifestError(f"manifest is not valid JSON: {e}") from e
    if not isinstance(data, dict) or not isinstance(data.get("markers"), list):
        raise ManifestError("manifest must be an object with a 'markers' array")
    ids = [m.get("id") for m in data["markers"]]
    dupes = {i for i in ids if ids.count(i) > 1}
    if dupes:
        raise ManifestError(f"duplicate marker ids: {sorted(dupes)}")
    return data


def _pattern_found(text: str, pattern: str) -> bool:
    if len(pattern) >= 2 and pattern.startswith("/") and pattern.endswith("/"):
        return re.search(pattern[1:-1], text, re.MULTILINE) is not None
    return pattern in text


def check_marker(marker: dict) -> tuple[bool, list[str]]:
    """Return (ok, problems) for a single marker."""
    problems: list[str] = []

View on GitHub (pinned to 4685618388)

Solutions

  1. Locate the exact syntax error: `python -m json.tool scripts/fix-markers.json` — it prints line/column
  2. Search for conflict artifacts: `grep -nE '^(<<<<<<<|=======|>>>>>>>)' scripts/fix-markers.json` and resolve them
  3. Remove trailing commas, comments, and single-quoted strings; JSON requires double quotes
  4. Validate in a pre-commit hook or editor JSON linter before committing the manifest

Example fix

# before (trailing comma after last marker)
  { "id": "RuView#521", "files": ["v2/crates/x/src/lib.rs"] },
]

# after
  { "id": "RuView#521", "files": ["v2/crates/x/src/lib.rs"] }
]
Defensive patterns

Strategy: validation

Validate before calling

import json
from pathlib import Path

json.loads(Path("scripts/fix-markers.json").read_text(encoding="utf-8"))  # raises before the script does, with line/column

Try / catch

try:
    data = load_manifest()
except ManifestError as e:
    print(f"bad manifest: {e}")  # exit 2 semantics; fix the file, do not retry

Prevention

When it happens

Trigger: Hand-editing fix-markers.json and leaving a trailing comma, adding a // comment, or saving while the file contains <<<<<<< / ======= / >>>>>>> conflict markers after a git merge.

Common situations: Merge conflicts resolved incompletely; an editor or code-formatter that does not produce strict JSON; truncated file from an interrupted write or bad git operation.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/babd3d02135375c6. Report an issue: GitHub.