From e3aefd7cdc5f8714d8ae2907b6bfd4f0acabbe2a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 14 Nov 2026 20:22:02 +0000 Subject: [PATCH] fix(rsr): restore the 3.1.1/3.2.1 deed wiring that #1113/#1115/#1117 collided on Main did not compile: descriptiles_parse/1 called an undefined deed_state/1, a duplicate record_files == [] branch could never run, and descriptile_carrier/0 was never called. - 3.1.1 now uses descriptile_carrier/0 (deed first, then the directory), as #1117 describes. - deed_state/1 replaces deed_parses?/1 and returns :ok, :none or :broken. - 3.2.1: a broken chora deed fails even when the .a2ml files parse (#1117); the dead duplicate branch is gone. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_0136P7ZmUcth17dd8P9G2L1G --- lib/rules/rsr_conformance.ex | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/rules/rsr_conformance.ex b/lib/rules/rsr_conformance.ex index 23b93751..54bc5b82 100644 --- a/lib/rules/rsr_conformance.ex +++ b/lib/rules/rsr_conformance.ex @@ -460,7 +460,7 @@ defmodule Hypatia.Rules.RsrConformance do ".well-known/humans.txt" ]), "2.3.1" => any_of(["0-AI-MANIFEST.a2ml", "0-AI-MANIFEST.deed"]), - "3.1.1" => present_mr("descriptiles"), + "3.1.1" => descriptile_carrier(), "3.1.2" => descriptile("STATE", "status"), "3.1.3" => descriptile("META", "meta"), "3.1.4" => descriptile("ECOSYSTEM", "ecosystem"), @@ -610,13 +610,23 @@ defmodule Hypatia.Rules.RsrConformance do end end - defp deed_parses?(repo) do - with {:ok, path} <- Hypatia.Deed.repo_deed_path(repo), - {:ok, text} <- File.read(path), - {:ok, {"repo-deed", _items}} <- Hypatia.Deed.parse(text) do - true - else - _ -> false + # :ok (the chora deed parses), :none (the repo has no chora deed) or + # :broken (it has one that does not read or parse: it declares nothing). + defp deed_state(repo) do + case Hypatia.Deed.repo_deed_path(repo) do + :none -> + :none + + {:ok, path} -> + with {:ok, text} <- File.read(path), + {:ok, {"repo-deed", _items}} <- Hypatia.Deed.parse(text) do + :ok + else + _ -> :broken + end + + _ -> + :broken end end @@ -652,8 +662,10 @@ defmodule Hypatia.Rules.RsrConformance do deed = deed_state(repo) cond do - record_files == [] -> - if deed_parses?(repo), do: :pass, else: :fail + # A chora deed that exists but does not parse fails, even when the + # remaining record-dialect files parse (#1117: stricter than before). + deed == :broken -> + :fail record_files == [] -> if deed == :ok, do: :pass, else: :fail