fix(tooling): atlas-verify — handle binary/dwarf stars, exclude hand-authored systems

- star_type check now skips binary systems (star_type="binary" is valid)
- Strip dwarf prefixes (d, sd) before comparing spectral class letter
- Case-insensitive comparison for lowercase spectral classes
- Exclude GJ0.json (Sol) and GJ1221.json from verification (hand-authored)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 08:22:44 +01:00
co-authored by Claude Opus 4.6
parent 73c81c1217
commit 1d1555a31b
+15 -7
View File
@@ -104,13 +104,16 @@ def verify_proposal(path: Path) -> list[str]:
# 9. star_type vs spectral_class consistency
star_type_field = p.get("star_type", "")
spectral = p.get("spectral_class", "")
if star_type_field and spectral:
spectral_letter = spectral[0] if spectral else ""
if spectral_letter and star_type_field[0] != spectral_letter:
errors.append(
f"star_type '{star_type_field}' conflicts with "
f"spectral_class '{spectral}'"
)
if star_type_field and spectral and star_type_field != "binary":
# Strip dwarf/subdwarf prefixes (d, sd) to get actual class letter
s = spectral.lstrip("sd").upper()
spectral_letter = s[0] if s else ""
if spectral_letter and spectral_letter.isalpha():
if star_type_field[0].upper() != spectral_letter:
errors.append(
f"star_type '{star_type_field}' conflicts with "
f"spectral_class '{spectral}'"
)
return errors
@@ -127,8 +130,13 @@ def main():
)
args = parser.parse_args()
# Sol is hand-authored with different rules (named uninhabited bodies, etc.)
EXCLUDE = {"GJ0.json", "GJ1221.json"}
total_errors = 0
for path in args.proposals:
if path.name in EXCLUDE:
continue
if not path.exists():
print(f"SKIP — {path} not found")
continue