From 5631ccd96d6f0d0dd4b71fabf5148eb1f1abd421 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 7 Sep 2026 16:16:26 +0000 Subject: [PATCH 1/2] Initial plan From 4fcb2416be49600e95e36d9f2a3a7e24aa7d2865 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 7 Sep 2026 16:18:03 +0000 Subject: [PATCH 2/2] fix(cosmic-daily): allow credited APOD images Co-authored-by: dapiced <15859528+dapiced@users.noreply.github.com> --- tools/cosmic-daily/README.md | 2 +- tools/cosmic-daily/cosmic_daily/cli.py | 5 ----- tools/cosmic-daily/cosmic_daily/rights_policy.py | 14 +------------- tools/cosmic-daily/tests/test_rights_policy.py | 6 +++--- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/tools/cosmic-daily/README.md b/tools/cosmic-daily/README.md index fc0d936..4579272 100644 --- a/tools/cosmic-daily/README.md +++ b/tools/cosmic-daily/README.md @@ -31,5 +31,5 @@ The default mode is `preview`. - `preview` writes only to a temporary directory and never touches tracked files. - `generate` creates a Jekyll post and the corresponding WebP image when the media is eligible. - `check` validates front matter and image references for a generated article. -- Video entries and external-copyright cases are treated as human review only. +- Video entries are treated as human review only. - The repository workflow dispatch action supports `publish=false` for preview-only runs and `publish=true` to generate a branch and PR. diff --git a/tools/cosmic-daily/cosmic_daily/cli.py b/tools/cosmic-daily/cosmic_daily/cli.py index aa4c0d7..d2b3b63 100644 --- a/tools/cosmic-daily/cosmic_daily/cli.py +++ b/tools/cosmic-daily/cosmic_daily/cli.py @@ -90,11 +90,6 @@ def generate(date_value: str | None = None) -> int: _emit_github_output(apod_date=apod.date, result="unsupported_media", post_path="", image_path="") print(decision.reason) return EXIT_ERROR - if decision.status == "review_required": - _emit_github_output(apod_date=apod.date, result="review_required", post_path="", image_path="") - print(decision.reason) - return EXIT_ERROR - duplicates = repo.find_duplicates(apod.date, apod.apod_url) if duplicates: _emit_github_output(apod_date=apod.date, result="duplicate", post_path="", image_path="") diff --git a/tools/cosmic-daily/cosmic_daily/rights_policy.py b/tools/cosmic-daily/cosmic_daily/rights_policy.py index 72afdff..230a6ac 100644 --- a/tools/cosmic-daily/cosmic_daily/rights_policy.py +++ b/tools/cosmic-daily/cosmic_daily/rights_policy.py @@ -11,21 +11,9 @@ class RightsDecision: reason: str -def _looks_like_nasa_credit(value: str) -> bool: - upper = value.upper() - return "NASA" in upper or "APOD" in upper or "JPL" in upper or "SPACE TELESCOPE" in upper - - def evaluate_media_rights(media_type: str, copyright: Optional[str] = None) -> RightsDecision: normalized = (media_type or "").strip().lower() if normalized != "image": return RightsDecision(status="unsupported_media", allowed=False, reason="Only still-image APOD entries are published automatically.") - if copyright is None or not str(copyright).strip(): - return RightsDecision(status="allowed", allowed=True, reason="No external copyright marker was provided.") - - credit = str(copyright).strip() - if _looks_like_nasa_credit(credit): - return RightsDecision(status="allowed", allowed=True, reason="NASA or APOD credit is present; no external review is required.") - - return RightsDecision(status="review_required", allowed=False, reason="External copyright detected; human review required before republishing the local image.") + return RightsDecision(status="allowed", allowed=True, reason="Still-image APOD entries are published automatically.") diff --git a/tools/cosmic-daily/tests/test_rights_policy.py b/tools/cosmic-daily/tests/test_rights_policy.py index 2f319d6..1518556 100644 --- a/tools/cosmic-daily/tests/test_rights_policy.py +++ b/tools/cosmic-daily/tests/test_rights_policy.py @@ -9,10 +9,10 @@ def test_allows_nasa_image(): assert decision.status == "allowed" -def test_rejects_external_copyright(): +def test_allows_image_with_external_copyright(): decision = evaluate_media_rights("image", "Jane Photographer") - assert decision.allowed is False - assert decision.status == "review_required" + assert decision.allowed is True + assert decision.status == "allowed" def test_rejects_video():