Repository navigation
feat(rules): RSR 3.1.1 and 3.2.1 read the chora deed first #1117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9e7ef32
b5c2d76
f38793a
e9a6190
e1935eb
009bb15
7d1059a
d0880bb
f87fd9d
03127bc
4d5538c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -474,19 +474,37 @@ defmodule Hypatia.Rules.RsrConformance do | |
| # (state-v1-decision.adoc, option B, ruled 2026-11-10: the one lifecycle | ||
| # claim is the (status) clause, and the journal is not translated). | ||
| # | ||
| # A2ML is retired, so the deed is the successor and the .a2ml the transition | ||
| # form; 2.3.1 accepts its two carriers the same way. The deed must parse | ||
| # (Hypatia.Deed is the reader that agrees with the standards gate): a deed | ||
| # that does not parse declares nothing, and a clause nested inside another | ||
| # clause is not the descriptile. | ||
| # A2ML is retired, so the deed is the successor and is read first; the | ||
| # .a2ml is the fallback a shared reader keeps until its callers migrate | ||
| # (standards A7 M5 to M7, "new input first"); 2.3.1 accepts its two | ||
| # carriers the same way. The deed must parse (Hypatia.Deed is the reader | ||
| # that agrees with the standards gate): a deed that does not parse declares | ||
| # nothing, and a clause nested inside another clause is not the descriptile. | ||
| defp descriptile(name, clause) do | ||
| a2ml = descriptile(name) | ||
|
|
||
| fn repo -> | ||
| case a2ml.(repo) do | ||
| :pass -> :pass | ||
| _ -> if deed_clause?(repo, clause), do: :pass, else: :fail | ||
| end | ||
| if deed_clause?(repo, clause), do: :pass, else: a2ml.(repo) | ||
| end | ||
| end | ||
|
|
||
| # The top-level chora-deed clauses that carry a descriptile family, one per | ||
| # criterion 3.1.2-3.1.9 (the mapping specs above; (anchor) by A7 ruling S1). | ||
| @descriptile_clauses ~w(status meta ecosystem agentic neurosym playbook anchor clade) | ||
|
|
||
| # 3.1.1: the descriptile substrate. The criterion names the directory | ||
| # `.machine_readable/descriptiles/`, which was the only carrier while the | ||
| # descriptiles were .a2ml files. A repo that has moved them into its chora | ||
| # deed has the substrate there: deed first, the chora deed parses and | ||
| # carries at least one top-level descriptile clause; then the directory, | ||
| # which still counts (the legacy .a2ml home, and where standards A7 7.1 puts | ||
| # the ALL-CAPS descriptile deeds). A deed with none of the clauses, or with | ||
| # them only nested, is not the substrate, and nothing at all is :fail. | ||
| defp descriptile_carrier do | ||
| dir = present_mr("descriptiles") | ||
|
|
||
| fn repo -> | ||
| if Enum.any?(@descriptile_clauses, &deed_clause?(repo, &1)), do: :pass, else: dir.(repo) | ||
|
Comment on lines
+503
to
+507
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For every deed-era repository that has a top-level descriptile clause but no legacy Useful? React with 👍 / 👎. |
||
| end | ||
| end | ||
|
|
||
|
|
@@ -561,11 +579,15 @@ defmodule Hypatia.Rules.RsrConformance do | |
| ) | ||
|
|
||
| record_files = Enum.filter(candidates, &record_dialect?/1) | ||
| deed = deed_state(repo) | ||
|
|
||
| cond do | ||
| record_files == [] -> | ||
| if deed_parses?(repo), do: :pass, else: :fail | ||
|
|
||
| record_files == [] -> | ||
| if deed == :ok, do: :pass, else: :fail | ||
|
Comment on lines
+588
to
+589
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When at least one record-dialect file exists, both identical Useful? React with 👍 / 👎. |
||
|
|
||
| Enum.all?(record_files, fn f -> | ||
| match?({:ok, _}, with({:ok, t} <- File.read(f), do: RecordDialect.parse(t))) | ||
| end) -> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The repository's
hypatia_chora.deedalready contains a valid top-level(anchor)clause with an:authority, andanchor_present/0recognizes that carrier, so the self-score passes 3.1.8. Listing it among the current failures makes this newly added debt status and its score summary inaccurate.Useful? React with 👍 / 👎.