Repository navigation
Commit fbc06e9
authored
feat(rhodibot): check a repository against the canon from the command line (#549)
Fourth and last step of the canon-sourced rules (#543, #545, #547). The
three
pieces before this one read the rules from the canon, decide which
criteria
apply, and classify what was found. Nothing ran them. This adds
`rhodibot canon`:
```sh
rhodibot canon --owner hyperpolymath --repo ubicity
rhodibot canon --path /path/to/checkout --format json
rhodibot canon --owner O --repo R --fail-on missing
```
**Advisory by default** — exits 0 whatever it finds. The canon
designates
hypatia's `rsr-conformance` as the single normative checker, so a gate
here would
be a second opinion claiming an authority it does not have. `--fail-on`
is opt-in.
## Two details that carry their weight
- `GitHubClient::tree_paths` asks once for the whole file list and
**refuses a
truncated response**. A partial tree is missing files, a missing file
reads as
an absent one, and the report would manufacture findings against a
repository
that has the file.
- `get_file_content_if_present` distinguishes 404 from everything else:
an absent
`rsr-profile.a2ml` means "declares no capabilities", a 500 means "could
not read
the declaration". Treating the second as the first would silently shrink
the
check to the universal criteria and report a cleaner scorecard than the
truth.
`canon/report.rs` assembles the report (counts, findings worst-first,
retired
locations quoted) and serialises to JSON. `canon/local.rs` reads a
checkout,
preferring `git ls-files` over a walk — a walked list includes build
output, and a
`CODE_OF_CONDUCT.md` inside `target/` is not the repository's code of
conduct.
## The pilot re-run through the tool
Unauthenticated, against the five repositories of the advisory pilot:
| repository | at path | elsewhere | deprecated | absent |
|---|---|---|---|---|
| gitbot-fleet | 17 | 3 | 0 | 2 |
| ubicity | 7 | 2 | 6 | 7 |
| awesome-nickel | 8 | 1 | 7 | 6 |
| julia-professional-registry | 8 | 1 | 7 | 6 |
| nesy-solver | 12 | 4 | 3 | 3 |
**110 questions, 52 satisfied, 58 findings** (11 relocated, 23 at the
retired
`6a2/`, 24 absent). 22 of the canon's 74 criteria apply to every one of
them: 26
are gated on a capability none declares, 26 more ask content questions
rather
than naming files.
The 23 files under `.machine_readable/6a2/` are still 23, re-derived
from
criterion 3.1.1's own sentence about the retirement rather than from a
hardcoded
path, with the same per-repository breakdown as the hand run. Both of
the hand
run's false positives (criterion 1.2.2) now come back satisfied.
## Two findings the earlier scope could not see
- `2.1.3` asks for `SECURITY.md`; `ubicity` has `SECURITY.adoc`. The
verdict is
`absent` and the report now says what is there instead. Same for
`CODE_OF_CONDUCT.md`/`CODE_OF_CONDUCT.adoc` at `2.1.4`. If `.adoc` is
the
estate's convention, the canon is where that belongs.
- `2.2.1` is `relocated` for all five: the `.well-known/` files live
inside a
`www/` publication bundle, not at the repository root the criterion
names. The
origin-versus-repository question is worth an answer.
## Verification
- `cargo test --locked` — 135 lib + 10 lockstep + 50 integration, all
pass
- `cargo clippy --locked --all-targets -- -D warnings` — clean
- new wiremock tests cover the tree listing (directories excluded), the
truncated
tree refusal, and 404-versus-500 on the optional file read
- `scripts/check-canon-drift.sh` — exit 0 against upstream `main`
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>1 parent c80fb93 commit fbc06e9
6 files changed
Lines changed: 1311 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
0 commit comments