{"record":{"id":"6a1eca588e450606","repo":"affaan-m/ECC","slug":"remote-import-exceeds-max-bytes-bytes","errorCode":null,"errorMessage":"remote import exceeds {max_bytes} bytes","messagePattern":"remote import exceeds (.+?) bytes","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/continuous-learning-v2/scripts/instinct-cli.py","lineNumber":234,"sourceCode":"            raise ValueError(f\"remote import host resolves to a non-public address: {host}\")\n\n    return urllib.parse.urlunparse(parsed)\n\n\ndef _fetch_import_url(source: str, *, max_bytes: int = 2 * 1024 * 1024) -> str:\n    \"\"\"Fetch a validated remote instinct file with bounded size and timeout.\"\"\"\n    url = _validate_import_url(source)\n    req = urllib.request.Request(url, headers={\"User-Agent\": \"ECC-instinct-import/2\"})\n    with urllib.request.urlopen(req, timeout=15) as response:\n        content_type = response.headers.get(\"Content-Type\", \"\")\n        if content_type and not any(\n            allowed in content_type.lower()\n            for allowed in (\"text/\", \"markdown\", \"yaml\", \"json\", \"octet-stream\")\n        ):\n            raise ValueError(f\"unsupported remote content type: {content_type}\")\n        data = response.read(max_bytes + 1)\n    if len(data) > max_bytes:\n        raise ValueError(f\"remote import exceeds {max_bytes} bytes\")\n    return data.decode(\"utf-8\")\n\n\ndef _yaml_quote(value: str) -> str:\n    \"\"\"Quote a string for safe YAML frontmatter serialization.\n\n    Uses double quotes and escapes embedded double-quote characters to\n    prevent malformed YAML when the value contains quotes.\n    \"\"\"\n    escaped = value.replace('\\\\', '\\\\\\\\').replace('\"', '\\\\\"')\n    return f'\"{escaped}\"'\n\n\n# ─────────────────────────────────────────────\n# Project Detection (Python equivalent of detect-project.sh)\n# ─────────────────────────────────────────────\n\ndef _git_repo_root(cwd: Optional[str] = None) -> Optional[str]:","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/skills/continuous-learning-v2/scripts/instinct-cli.py#L216-L252","documentation":"Error \"remote import exceeds {max_bytes} bytes\" thrown in affaan-m/ECC.","triggerScenarios":"Thrown at skills/continuous-learning-v2/scripts/instinct-cli.py:234 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The remote instinct file exceeds the 2 MiB cap. Split it into smaller instinct files and import them separately.","Host a trimmed version containing only the needed instincts; the cap exists to bound memory and parsing time."],"exampleFix":"split -b 1m big-instinct.md part- && for f in part-*; do instinct import \"$f\"; done","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}