Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit ed3b9f4

Browse files
committed
fix: mark mixed marketplace scans as repository scope
Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
1 parent 38509ab commit ed3b9f4

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/codex_plugin_scanner/scanner.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,15 @@ def _scan_mixed_packages(scan_root: Path, packages: list[NormalizedPackage], opt
477477
score = _score_categories(tuple(categories))
478478
trust_report = build_repository_trust_report(tuple(codex_trust_reports)) if codex_trust_reports else None
479479
reported_packages = tuple(processed_packages) if processed_packages else tuple(packages)
480+
marketplace_candidates = tuple(
481+
package
482+
for package in reported_packages
483+
if package.ecosystem == Ecosystem.CODEX and package.package_kind == "marketplace"
484+
)
485+
scope = "repository" if marketplace_candidates else "plugin"
486+
marketplace_file = (
487+
str(marketplace_candidates[0].manifest_path) if len(marketplace_candidates) == 1 else None
488+
)
480489
return ScanResult(
481490
score=score,
482491
grade=get_grade(score),
@@ -486,6 +495,8 @@ def _scan_mixed_packages(scan_root: Path, packages: list[NormalizedPackage], opt
486495
findings=findings,
487496
severity_counts=build_severity_counts(findings),
488497
integrations=tuple(integrations),
498+
scope=scope,
499+
marketplace_file=marketplace_file,
489500
trust_report=trust_report,
490501
ecosystems=tuple(sorted({package.ecosystem.value for package in reported_packages})),
491502
packages=tuple(_summarize_package(package) for package in reported_packages),

tests/test_ecosystems.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ def test_scan_auto_repository_includes_non_codex_packages(tmp_path: Path) -> Non
9191

9292
result = scan_plugin(repo_root, ScanOptions(ecosystem="auto", cisco_skill_scan="off"))
9393

94+
assert result.scope == "repository"
95+
assert result.marketplace_file is not None
9496
assert set(result.ecosystems) >= {"codex", "gemini"}
9597
assert any(category.name.startswith("[gemini:") for category in result.categories)
9698
assert all(finding.rule_id != "PLUGIN_JSON_MISSING" for finding in result.findings)

0 commit comments

Comments
 (0)