diff --git a/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/gate.py b/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/gate.py index cd940efca..5c8db1315 100644 --- a/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/gate.py +++ b/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/gate.py @@ -187,6 +187,13 @@ def _check(scope: str, data: Mapping[str, Any]) -> str: return cve_tool.command(data, "check", *flags) +_NO_TOOL = { + 20: "no `cve_authority.tool` declared anywhere; take the recipe path and say which key is missing", + 21: "the configured CVE tool has no adapter; take the recipe path", + 22: "the adapter does not implement the check operation; take the recipe path", +} + + def preflight(data: Mapping[str, Any]) -> dict[str, Any]: pmc = one_line(data.get("pmc")) setup = cve_tool.command(data, "setup", "--pmc", pmc or "") @@ -213,6 +220,8 @@ def out( ) if server == 3: return out("recipe", "network error on the server check; mention it") + if server in _NO_TOOL: + return out("recipe", _NO_TOOL[server]) if server != 0: return out("recipe", f"unexpected server-check exit {server}") if data.get("allocate_exit") is None: @@ -232,6 +241,8 @@ def out( return out(None, f"allocate token {state}: offer the setup, then re-run the check", offer_setup=True) if code == 4: return out("recipe", "unsupported: the server answers HTML") + if code in _NO_TOOL: + return out("recipe", _NO_TOOL[code]) return out("recipe", f"allocate check failed (exit {code}); mention the error") diff --git a/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/recipe.py b/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/recipe.py index bb45de778..c7e63b56a 100644 --- a/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/recipe.py +++ b/plugins/magpie-security-tools/tools/security-management/src/security_management/cve_allocate/recipe.py @@ -100,7 +100,8 @@ def render(data: Mapping[str, Any]) -> dict[str, Any]: "2. In the *Title* field, paste this:\n\n" f"{indented}\n\n" "3. Submit the allocation. The CVE tool returns a `CVE-YYYY-NNNNN` ID — for the Vulnogram " - "adapter, clicking *Allocate*.\n" + "adapter, clicking *Allocate*; for other adapters, wherever the tool delivers it " + "(a form result, an ID by email).\n" "4. Paste the allocated CVE ID back into this conversation — the skill will pick it up and " "update the tracker.\n" ) diff --git a/plugins/magpie-security/skills/cve-allocate/SKILL.md b/plugins/magpie-security/skills/cve-allocate/SKILL.md index 52319ccbf..a3c9e1291 100644 --- a/plugins/magpie-security/skills/cve-allocate/SKILL.md +++ b/plugins/magpie-security/skills/cve-allocate/SKILL.md @@ -21,7 +21,7 @@ argument-hint: "[issue-number] [CVE-YYYY-NNNNN]" capability: capability:resolve surface_hash: sha256:c96f5623aa6c4212 license: Apache-2.0 -measured_tokens: 7047 +measured_tokens: 7250 ---