Sync GitHub b8539eb
Browse filesAdd paper-style publication metadata rows, source provenance, responsive Resource Atlas rendering, and CI validation.
- .github/workflows/quality.yml +3 -0
- README.md +79 -0
- data/README.md +3 -2
- data/resource_source_audit.csv +0 -0
- data/resources.csv +0 -0
- data/resources.jsonl +0 -0
- docs/assets/resources.json +0 -0
- docs/index.html +171 -28
- meta/hf_card_body.md +10 -0
- scripts/audit_resource_sources.py +328 -18
- scripts/check_publication_metadata.py +85 -0
- scripts/export_resource_dataset.py +35 -0
- scripts/verify_urls.py +9 -0
- templates/resource-entry.md +4 -0
.github/workflows/quality.yml
CHANGED
|
@@ -51,6 +51,9 @@ jobs:
|
|
| 51 |
- name: Check resource dataset export
|
| 52 |
run: python scripts/export_resource_dataset.py --check
|
| 53 |
|
|
|
|
|
|
|
|
|
|
| 54 |
- name: Check loop contract examples
|
| 55 |
run: |
|
| 56 |
python scripts/check_loop_contract_examples.py
|
|
|
|
| 51 |
- name: Check resource dataset export
|
| 52 |
run: python scripts/export_resource_dataset.py --check
|
| 53 |
|
| 54 |
+
- name: Check publication metadata
|
| 55 |
+
run: python scripts/check_publication_metadata.py
|
| 56 |
+
|
| 57 |
- name: Check loop contract examples
|
| 58 |
run: |
|
| 59 |
python scripts/check_loop_contract_examples.py
|
README.md
CHANGED
|
@@ -1107,3 +1107,82 @@ If this repository is useful in your work, please cite it with:
|
|
| 1107 |
**Reusable blurb** (for blog posts, talks, internal docs, or community posts):
|
| 1108 |
|
| 1109 |
> Loop Engineering is the practice of designing recurring AI-agent and coding-agent systems that discover work, delegate to agents, verify results, persist state, and retry or escalate on a cadence or until a goal is reached. *Awesome Loop Engineering* is a curated, implementation-focused resource collection for this practice: [github.com/ChaoYue0307/awesome-loop-engineering](https://github.com/ChaoYue0307/awesome-loop-engineering)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1107 |
**Reusable blurb** (for blog posts, talks, internal docs, or community posts):
|
| 1108 |
|
| 1109 |
> Loop Engineering is the practice of designing recurring AI-agent and coding-agent systems that discover work, delegate to agents, verify results, persist state, and retry or escalate on a cadence or until a goal is reached. *Awesome Loop Engineering* is a curated, implementation-focused resource collection for this practice: [github.com/ChaoYue0307/awesome-loop-engineering](https://github.com/ChaoYue0307/awesome-loop-engineering)
|
| 1110 |
+
|
| 1111 |
+
---
|
| 1112 |
+
|
| 1113 |
+
## Dataset Structure
|
| 1114 |
+
|
| 1115 |
+
Each row in `data/resources.jsonl` (and the equivalent `data/resources.csv`) is one curated resource, exported from the English `README.md`.
|
| 1116 |
+
|
| 1117 |
+
| Field | Description |
|
| 1118 |
+
| --- | --- |
|
| 1119 |
+
| `row_id` | Positional identifier (`ale-NNNN`); not stable across README reorders. |
|
| 1120 |
+
| `section` | The `##` section the entry lives under. |
|
| 1121 |
+
| `section_slug` | Anchor-style slug of the section. |
|
| 1122 |
+
| `resource_type` | Paper, Blog, Docs, Tool, Benchmark, Pattern, Template, List, or Critique. |
|
| 1123 |
+
| `marker` | Emoji shown before the entry in the README. |
|
| 1124 |
+
| `title` | Linked entry title. |
|
| 1125 |
+
| `url` | Resource URL. |
|
| 1126 |
+
| `url_kind` | `external` or `local_path` (a file inside the repository). |
|
| 1127 |
+
| `domain` | Host of an external URL (empty for local paths). |
|
| 1128 |
+
| `annotation` | The one-line description as written in the README. |
|
| 1129 |
+
| `description` | Copy of the annotation for tooling that expects a `description` field. |
|
| 1130 |
+
| `key_contribution` | Short statement of what the resource adds. |
|
| 1131 |
+
| `novelty` | Why the entry is distinct within its section. |
|
| 1132 |
+
| `impact` | Who benefits and how. |
|
| 1133 |
+
| `signal` | Why the entry is trustworthy (adoption, venue, authorship). |
|
| 1134 |
+
| `signal_strength` | Calibrated confidence label (`high`, `medium`, `contextual`, or `unverified`). |
|
| 1135 |
+
| `source_readme` | README file the row came from. |
|
| 1136 |
+
| `source_line` | 1-based line number in that README. |
|
| 1137 |
+
| `source_url` | Permalink to the source line on GitHub. |
|
| 1138 |
+
| `date_added` | First-seen date when tracked; blank for resources added before tracking began. |
|
| 1139 |
+
| `collection` | Task-oriented atlas group: Learn, Design, Build, Persist, Verify, Govern, or Apply. |
|
| 1140 |
+
| `collection_slug` | Stable lowercase slug for the task-oriented collection. |
|
| 1141 |
+
| `user_goal` | Reader outcome served by the collection. |
|
| 1142 |
+
| `lifecycle_stages` | Semicolon-delimited Loop Contract stages addressed by the resource. |
|
| 1143 |
+
| `audience` | Semicolon-delimited intended audiences, such as newcomer, builder, operator, evaluator, or security. |
|
| 1144 |
+
| `evidence_class` | Source-provenance category, independent of popularity or editorial judgment. |
|
| 1145 |
+
| `source_status` | Latest audit result: `ok`, `restricted`, `local_ok`, or an explicit failure state. |
|
| 1146 |
+
| `canonical_url` | Redirect-resolved or repository-canonical URL used for source verification. |
|
| 1147 |
+
| `source_title` | Title metadata retrieved during the latest source audit. |
|
| 1148 |
+
| `source_description` | Description or abstract metadata retrieved from the primary source. |
|
| 1149 |
+
| `authors` | Semicolon-delimited authors from primary bibliographic metadata when available. |
|
| 1150 |
+
| `publication_date` | Primary-source publication or repository creation date in ISO format when available. |
|
| 1151 |
+
| `publication_year` | Four-digit year derived from the verified publication date or identifier. |
|
| 1152 |
+
| `publication_venue` | Journal, conference, repository, or named venue reported by the source. |
|
| 1153 |
+
| `publisher` | Publishing organization or source platform; falls back to the canonical domain. |
|
| 1154 |
+
| `doi` | Normalized DOI without a URL prefix when available. |
|
| 1155 |
+
| `publication_note` | Primary-source journal reference, acceptance note, or publication comment when available. |
|
| 1156 |
+
| `primary_category` | Primary arXiv category when applicable. |
|
| 1157 |
+
| `metadata_source` | Provenance for bibliographic fields, such as `arxiv-api`, `github-api`, `html-meta`, or `domain-fallback`. |
|
| 1158 |
+
| `github_repo` | Normalized GitHub `owner/repository` identifier where applicable. |
|
| 1159 |
+
| `github_stars` | GitHub star count captured at audit time; context, not a reliability score. |
|
| 1160 |
+
| `github_forks` | GitHub fork count captured at audit time. |
|
| 1161 |
+
| `github_license` | Repository license identifier reported by GitHub where available. |
|
| 1162 |
+
| `github_created_at` | Repository creation timestamp reported by GitHub. |
|
| 1163 |
+
| `github_updated_at` | Latest repository update timestamp reported by GitHub. |
|
| 1164 |
+
| `arxiv_id` | arXiv identifier extracted from a primary paper URL where applicable. |
|
| 1165 |
+
| `audited_at` | UTC timestamp for the source metadata and availability snapshot. |
|
| 1166 |
+
|
| 1167 |
+
## Considerations and Limitations
|
| 1168 |
+
|
| 1169 |
+
- Annotations are written and curated by a single maintainer; they summarize each resource and are not the authors' own abstracts.
|
| 1170 |
+
- URLs are third-party and can rot; `data/resource_source_audit.csv` carries a retrieval-time reachability snapshot, but it is a point-in-time check, not a live guarantee.
|
| 1171 |
+
- `row_id` and `source_line` are positional and change when the README is reordered; join on `url` for anything durable.
|
| 1172 |
+
- `signal_strength` is calibrated as `high`, `medium`, `contextual`, or `unverified`; GitHub stars and forks are reported only as adoption context.
|
| 1173 |
+
- Coverage skews toward English-language, publicly available resources.
|
| 1174 |
+
|
| 1175 |
+
## Changelog
|
| 1176 |
+
|
| 1177 |
+
Versioned changes are published as [GitHub Releases](https://github.com/ChaoYue0307/awesome-loop-engineering/releases).
|
| 1178 |
+
|
| 1179 |
+
## Citation
|
| 1180 |
+
|
| 1181 |
+
```bibtex
|
| 1182 |
+
@misc{chaoyue2026awesome_loop_engineering,
|
| 1183 |
+
author = {He, Chaoyue},
|
| 1184 |
+
title = {Awesome Loop Engineering},
|
| 1185 |
+
year = {2026},
|
| 1186 |
+
howpublished = {\url{https://github.com/ChaoYue0307/awesome-loop-engineering}}
|
| 1187 |
+
}
|
| 1188 |
+
```
|
data/README.md
CHANGED
|
@@ -8,10 +8,11 @@ This directory contains generated tabular exports of the canonical English `READ
|
|
| 8 |
- `first_seen.json` - Forward-only sidecar mapping resource URL to the date it was first added; the export left-joins it into the `date_added` column. Empty `date_added` means the entry predates per-entry tracking (started 2026-07-15).
|
| 9 |
- `resource_source_audit.csv` - Retrieval-time audit of every row, including URL status, source title metadata, arXiv IDs, and GitHub repository stats where available.
|
| 10 |
|
| 11 |
-
The main exports preserve the original section and annotation while adding
|
| 12 |
|
| 13 |
- **Task facets**: `collection`, `user_goal`, `lifecycle_stages`, and `audience` answer why a reader needs the source and where it fits in the Loop Contract.
|
| 14 |
- **Evidence facets**: `evidence_class`, `signal_strength`, `source_status`, canonical URL, source metadata, GitHub statistics, arXiv ID, and audit timestamp separate source provenance from popularity or editorial judgment.
|
|
|
|
| 15 |
|
| 16 |
`key_contribution`, `novelty`, and `impact` are resource-specific. `signal` states the evidence basis and its limits; GitHub stars and forks are reported as current context, never as proof of reliability. Signal strength is calibrated as `high` for primary official documentation and benchmarks, `medium` for inspectable implementations, papers, patterns, and repository-native artifacts, `contextual` for practitioner analysis and curated lists, and `unverified` only when the latest source audit cannot validate availability.
|
| 17 |
|
|
@@ -29,4 +30,4 @@ Run a network-backed source audit when refreshing the Hugging Face dataset:
|
|
| 29 |
python3 scripts/audit_resource_sources.py --timeout 20 --workers 16 --attempts 2 --github-cli
|
| 30 |
```
|
| 31 |
|
| 32 |
-
The audit file is a snapshot. HTTP status, redirects, page titles, and GitHub
|
|
|
|
| 8 |
- `first_seen.json` - Forward-only sidecar mapping resource URL to the date it was first added; the export left-joins it into the `date_added` column. Empty `date_added` means the entry predates per-entry tracking (started 2026-07-15).
|
| 9 |
- `resource_source_audit.csv` - Retrieval-time audit of every row, including URL status, source title metadata, arXiv IDs, and GitHub repository stats where available.
|
| 10 |
|
| 11 |
+
The main exports preserve the original section and annotation while adding three complementary discovery layers:
|
| 12 |
|
| 13 |
- **Task facets**: `collection`, `user_goal`, `lifecycle_stages`, and `audience` answer why a reader needs the source and where it fits in the Loop Contract.
|
| 14 |
- **Evidence facets**: `evidence_class`, `signal_strength`, `source_status`, canonical URL, source metadata, GitHub statistics, arXiv ID, and audit timestamp separate source provenance from popularity or editorial judgment.
|
| 15 |
+
- **Publication facets**: `authors`, `publication_date`, `publication_year`, `publication_venue`, `publisher`, `doi`, `publication_note`, `primary_category`, and `metadata_source` provide a paper-like bibliographic row without inventing missing facts.
|
| 16 |
|
| 17 |
`key_contribution`, `novelty`, and `impact` are resource-specific. `signal` states the evidence basis and its limits; GitHub stars and forks are reported as current context, never as proof of reliability. Signal strength is calibrated as `high` for primary official documentation and benchmarks, `medium` for inspectable implementations, papers, patterns, and repository-native artifacts, `contextual` for practitioner analysis and curated lists, and `unverified` only when the latest source audit cannot validate availability.
|
| 18 |
|
|
|
|
| 30 |
python3 scripts/audit_resource_sources.py --timeout 20 --workers 16 --attempts 2 --github-cli
|
| 31 |
```
|
| 32 |
|
| 33 |
+
The audit file is a snapshot. HTTP status, redirects, page titles, publication metadata, and GitHub statistics can change over time. arXiv bibliographic fields come from the primary arXiv API; GitHub dates come from the repository API; other web metadata comes from citation or Open Graph tags when available. A blank publication date means the primary source did not expose one. Rows marked `restricted` returned an access-control or rate-limit status during retrieval; they are tracked separately from broken or unreachable links.
|
data/resource_source_audit.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/resources.csv
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/resources.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
docs/assets/resources.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
docs/index.html
CHANGED
|
@@ -435,23 +435,50 @@
|
|
| 435 |
.resource-count { margin: 0; color: var(--muted); font-size: 0.86rem; }
|
| 436 |
.resource-sort { width: auto; min-width: 176px; }
|
| 437 |
.resource-list { min-height: 180px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 438 |
.resource-item {
|
| 439 |
display: grid;
|
| 440 |
-
grid-template-columns: minmax(0,
|
| 441 |
-
gap:
|
| 442 |
-
|
|
|
|
| 443 |
border-bottom: 1px solid var(--line);
|
| 444 |
}
|
| 445 |
-
.resource-
|
| 446 |
-
.resource-
|
| 447 |
-
.resource-
|
| 448 |
-
.resource-
|
| 449 |
-
.resource-
|
| 450 |
-
.resource-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
.resource-signal.contextual { color: var(--violet); }
|
| 452 |
.resource-signal.medium { color: var(--blue); }
|
| 453 |
.resource-signal.unverified { color: var(--quiet); }
|
| 454 |
-
.resource-source-status { display: block; margin-top: 4px; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 455 |
.resource-actions { display: flex; justify-content: center; padding-top: 18px; }
|
| 456 |
.resource-empty, .resource-loading { margin: 0; padding: 28px 0; color: var(--muted); }
|
| 457 |
details { border-top: 1px solid var(--line-strong); padding: 18px 0; }
|
|
@@ -539,6 +566,11 @@
|
|
| 539 |
.resource-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
| 540 |
.resource-toolbar label:first-child { grid-column: 1 / -1; }
|
| 541 |
.resource-reset { width: 100%; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
.footer-grid { grid-template-columns: 1fr 1fr; }
|
| 543 |
.loop-stage-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
| 544 |
.loop-stage:nth-child(4) { border-left: 0; }
|
|
@@ -598,8 +630,11 @@
|
|
| 598 |
.resource-collection { min-width: 0; min-height: 40px; padding-inline: 4px; font-size: 0.75rem; }
|
| 599 |
.resource-summary { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px 0; }
|
| 600 |
.resource-sort { width: 100%; }
|
| 601 |
-
.resource-item { grid-template-columns: 1fr; gap:
|
| 602 |
-
.resource-
|
|
|
|
|
|
|
|
|
|
| 603 |
.caption { text-align: left; }
|
| 604 |
.level { grid-template-columns: 46px 1fr; }
|
| 605 |
.level { gap: 12px; padding: 14px 0; }
|
|
@@ -976,7 +1011,7 @@
|
|
| 976 |
<p class="section-label">06 / Curated resources</p>
|
| 977 |
<h2>Find the evidence for your next decision.</h2>
|
| 978 |
</div>
|
| 979 |
-
<p class="section-intro">Search 509 audited
|
| 980 |
</div>
|
| 981 |
<div class="resource-explorer" id="resource-explorer">
|
| 982 |
<div class="resource-toolbar" role="search" aria-label="Search curated resources">
|
|
@@ -1047,11 +1082,18 @@
|
|
| 1047 |
<span class="sr-only">Sort resources</span>
|
| 1048 |
<select class="resource-select resource-sort" id="resource-sort">
|
| 1049 |
<option value="curated">Curated order</option>
|
|
|
|
| 1050 |
<option value="stars">GitHub stars</option>
|
| 1051 |
<option value="recent">Recently added</option>
|
| 1052 |
</select>
|
| 1053 |
</label>
|
| 1054 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1055 |
<div class="resource-list" id="resource-list" aria-busy="true">
|
| 1056 |
<p class="resource-loading">Loading audited resources...</p>
|
| 1057 |
</div>
|
|
@@ -1292,6 +1334,44 @@
|
|
| 1292 |
return element;
|
| 1293 |
}
|
| 1294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1295 |
function resourceMatches(resource) {
|
| 1296 |
var query = search.value.trim().toLowerCase();
|
| 1297 |
var haystack = [
|
|
@@ -1302,7 +1382,16 @@
|
|
| 1302 |
resource.user_goal,
|
| 1303 |
resource.lifecycle_stages,
|
| 1304 |
resource.audience,
|
| 1305 |
-
resource.evidence_class
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1306 |
].join(' ').toLowerCase();
|
| 1307 |
var evidenceSet = evidenceGroups[evidence.value] || [];
|
| 1308 |
|
|
@@ -1315,6 +1404,11 @@
|
|
| 1315 |
|
| 1316 |
function sortedResources(filtered) {
|
| 1317 |
return filtered.slice().sort(function (a, b) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1318 |
if (sort.value === 'stars') {
|
| 1319 |
return Number(b.github_stars || 0) - Number(a.github_stars || 0) || a._index - b._index;
|
| 1320 |
}
|
|
@@ -1327,31 +1421,80 @@
|
|
| 1327 |
|
| 1328 |
function renderItem(resource) {
|
| 1329 |
var item = document.createElement('article');
|
| 1330 |
-
var
|
| 1331 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1332 |
var meta = [
|
| 1333 |
-
resource.resource_type,
|
| 1334 |
resource.collection,
|
|
|
|
| 1335 |
stages(resource.lifecycle_stages).map(words).join(' / '),
|
| 1336 |
words(resource.evidence_class)
|
| 1337 |
].filter(Boolean).join(' | ');
|
| 1338 |
-
var side = document.createElement('div');
|
| 1339 |
var signalClass = 'resource-signal ' + String(resource.signal_strength || 'unverified').toLowerCase();
|
| 1340 |
var signal = createText('span', signalClass, words(resource.signal_strength || 'unverified') + ' signal');
|
| 1341 |
-
var sourceStatus = resource.source_status === 'restricted' ? 'Access restricted' : 'Source checked';
|
| 1342 |
var starCount = formatNumber(resource.github_stars);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1343 |
|
| 1344 |
item.className = 'resource-item';
|
| 1345 |
link.href = resource.canonical_url || resource.url;
|
| 1346 |
-
|
| 1347 |
-
|
| 1348 |
-
|
| 1349 |
-
|
| 1350 |
-
|
| 1351 |
-
|
| 1352 |
-
|
| 1353 |
-
|
| 1354 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1355 |
return item;
|
| 1356 |
}
|
| 1357 |
|
|
|
|
| 435 |
.resource-count { margin: 0; color: var(--muted); font-size: 0.86rem; }
|
| 436 |
.resource-sort { width: auto; min-width: 176px; }
|
| 437 |
.resource-list { min-height: 180px; }
|
| 438 |
+
.resource-row-head {
|
| 439 |
+
display: grid;
|
| 440 |
+
grid-template-columns: minmax(0, 1.5fr) 72px minmax(170px, 0.55fr) minmax(130px, 0.4fr);
|
| 441 |
+
gap: 22px;
|
| 442 |
+
padding: 11px 0;
|
| 443 |
+
border-bottom: 1px solid var(--line-strong);
|
| 444 |
+
color: var(--quiet);
|
| 445 |
+
font-family: "IBM Plex Mono", ui-monospace, monospace;
|
| 446 |
+
font-size: 0.66rem;
|
| 447 |
+
font-weight: 650;
|
| 448 |
+
text-transform: uppercase;
|
| 449 |
+
}
|
| 450 |
.resource-item {
|
| 451 |
display: grid;
|
| 452 |
+
grid-template-columns: minmax(0, 1.5fr) 72px minmax(170px, 0.55fr) minmax(130px, 0.4fr);
|
| 453 |
+
gap: 12px 22px;
|
| 454 |
+
align-items: start;
|
| 455 |
+
padding: 18px 0 16px;
|
| 456 |
border-bottom: 1px solid var(--line);
|
| 457 |
}
|
| 458 |
+
.resource-work, .resource-publication, .resource-evidence { min-width: 0; }
|
| 459 |
+
.resource-title { color: var(--ink); font-weight: 760; line-height: 1.35; text-decoration: none; }
|
| 460 |
+
.resource-title:hover { color: var(--blue); }
|
| 461 |
+
.resource-item p { margin: 0; }
|
| 462 |
+
.resource-contribution { margin-top: 6px !important; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }
|
| 463 |
+
.resource-authors { margin-top: 7px !important; color: var(--quiet); font-size: 0.76rem; line-height: 1.45; }
|
| 464 |
+
.resource-meta { margin-top: 7px; color: var(--quiet); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.68rem; overflow-wrap: anywhere; }
|
| 465 |
+
.resource-cell-label { display: none; margin-bottom: 5px; color: var(--quiet); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.62rem; font-weight: 650; text-transform: uppercase; }
|
| 466 |
+
.resource-year-value { color: var(--ink); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.9rem; font-weight: 700; }
|
| 467 |
+
.resource-year-value.undated { color: var(--quiet); font-weight: 500; }
|
| 468 |
+
.resource-venue { display: block; color: var(--ink); font-size: 0.82rem; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
|
| 469 |
+
.resource-publisher, .resource-date, .resource-identifier { display: block; margin-top: 4px; color: var(--quiet); font-size: 0.72rem; line-height: 1.4; overflow-wrap: anywhere; }
|
| 470 |
+
.resource-type-label { display: block; color: var(--ink); font-size: 0.78rem; font-weight: 700; }
|
| 471 |
+
.resource-signal { display: block; margin-top: 5px; color: var(--green); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; }
|
| 472 |
.resource-signal.contextual { color: var(--violet); }
|
| 473 |
.resource-signal.medium { color: var(--blue); }
|
| 474 |
.resource-signal.unverified { color: var(--quiet); }
|
| 475 |
+
.resource-source-status { display: block; margin-top: 4px; color: var(--quiet); font-size: 0.7rem; line-height: 1.4; }
|
| 476 |
+
.resource-details, .resource-details:last-child { grid-column: 1 / -1; margin-top: 2px; border: 0; border-top: 1px dashed var(--line); border-bottom: 0; padding: 9px 0 0; }
|
| 477 |
+
.resource-details summary { width: fit-content; color: var(--blue); font-size: 0.72rem; font-weight: 700; }
|
| 478 |
+
.resource-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; padding: 14px 0 4px; }
|
| 479 |
+
.resource-detail h4 { margin: 0 0 5px; color: var(--quiet); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 0.64rem; text-transform: uppercase; }
|
| 480 |
+
.resource-detail p { color: var(--muted); font-size: 0.78rem; line-height: 1.5; }
|
| 481 |
+
.resource-bibliography + .resource-bibliography { margin-top: 5px; }
|
| 482 |
.resource-actions { display: flex; justify-content: center; padding-top: 18px; }
|
| 483 |
.resource-empty, .resource-loading { margin: 0; padding: 28px 0; color: var(--muted); }
|
| 484 |
details { border-top: 1px solid var(--line-strong); padding: 18px 0; }
|
|
|
|
| 566 |
.resource-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
| 567 |
.resource-toolbar label:first-child { grid-column: 1 / -1; }
|
| 568 |
.resource-reset { width: 100%; }
|
| 569 |
+
.resource-row-head { display: none; }
|
| 570 |
+
.resource-item { grid-template-columns: 72px minmax(0, 1fr) minmax(120px, 0.72fr); gap: 14px 18px; }
|
| 571 |
+
.resource-work, .resource-details { grid-column: 1 / -1; }
|
| 572 |
+
.resource-cell-label { display: block; }
|
| 573 |
+
.resource-detail-grid { gap: 14px 22px; }
|
| 574 |
.footer-grid { grid-template-columns: 1fr 1fr; }
|
| 575 |
.loop-stage-rail { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
| 576 |
.loop-stage:nth-child(4) { border-left: 0; }
|
|
|
|
| 630 |
.resource-collection { min-width: 0; min-height: 40px; padding-inline: 4px; font-size: 0.75rem; }
|
| 631 |
.resource-summary { align-items: stretch; flex-direction: column; gap: 10px; padding: 14px 0; }
|
| 632 |
.resource-sort { width: 100%; }
|
| 633 |
+
.resource-item { grid-template-columns: 1fr; gap: 12px; padding: 17px 0; }
|
| 634 |
+
.resource-work, .resource-details { grid-column: auto; }
|
| 635 |
+
.resource-year, .resource-publication, .resource-evidence { padding-top: 10px; border-top: 1px solid var(--line); }
|
| 636 |
+
.resource-detail-grid { grid-template-columns: 1fr; gap: 14px; }
|
| 637 |
+
.resource-details summary { min-height: 34px; padding-top: 5px; }
|
| 638 |
.caption { text-align: left; }
|
| 639 |
.level { grid-template-columns: 46px 1fr; }
|
| 640 |
.level { gap: 12px; padding: 14px 0; }
|
|
|
|
| 1011 |
<p class="section-label">06 / Curated resources</p>
|
| 1012 |
<h2>Find the evidence for your next decision.</h2>
|
| 1013 |
</div>
|
| 1014 |
+
<p class="section-intro">Search 509 audited works by goal, lifecycle stage, artifact type, and evidence class. Each row combines the curated assessment with verified authorship, year, venue or source platform, and identifiers when the primary source exposes them.</p>
|
| 1015 |
</div>
|
| 1016 |
<div class="resource-explorer" id="resource-explorer">
|
| 1017 |
<div class="resource-toolbar" role="search" aria-label="Search curated resources">
|
|
|
|
| 1082 |
<span class="sr-only">Sort resources</span>
|
| 1083 |
<select class="resource-select resource-sort" id="resource-sort">
|
| 1084 |
<option value="curated">Curated order</option>
|
| 1085 |
+
<option value="publication">Publication year</option>
|
| 1086 |
<option value="stars">GitHub stars</option>
|
| 1087 |
<option value="recent">Recently added</option>
|
| 1088 |
</select>
|
| 1089 |
</label>
|
| 1090 |
</div>
|
| 1091 |
+
<div class="resource-row-head" aria-hidden="true">
|
| 1092 |
+
<span>Work and key contribution</span>
|
| 1093 |
+
<span>Year</span>
|
| 1094 |
+
<span>Published at</span>
|
| 1095 |
+
<span>Evidence</span>
|
| 1096 |
+
</div>
|
| 1097 |
<div class="resource-list" id="resource-list" aria-busy="true">
|
| 1098 |
<p class="resource-loading">Loading audited resources...</p>
|
| 1099 |
</div>
|
|
|
|
| 1334 |
return element;
|
| 1335 |
}
|
| 1336 |
|
| 1337 |
+
function appendCellLabel(element, value) {
|
| 1338 |
+
element.appendChild(createText('span', 'resource-cell-label', value));
|
| 1339 |
+
}
|
| 1340 |
+
|
| 1341 |
+
function authorNames(value) {
|
| 1342 |
+
return String(value || '').split(';').map(function (name) { return name.trim(); }).filter(Boolean);
|
| 1343 |
+
}
|
| 1344 |
+
|
| 1345 |
+
function formattedAuthors(value) {
|
| 1346 |
+
var names = authorNames(value);
|
| 1347 |
+
if (names.length <= 4) return names.join(', ');
|
| 1348 |
+
return names.slice(0, 4).join(', ') + ' +' + (names.length - 4) + ' more';
|
| 1349 |
+
}
|
| 1350 |
+
|
| 1351 |
+
function identifier(resource) {
|
| 1352 |
+
if (resource.doi) return 'DOI ' + resource.doi;
|
| 1353 |
+
if (resource.arxiv_id) return 'arXiv ' + resource.arxiv_id;
|
| 1354 |
+
if (resource.github_repo) return resource.github_repo;
|
| 1355 |
+
return '';
|
| 1356 |
+
}
|
| 1357 |
+
|
| 1358 |
+
function sourceStatus(resource) {
|
| 1359 |
+
if (resource.source_status === 'restricted') return 'Access restricted';
|
| 1360 |
+
if (['broken', 'unreachable', 'local_missing'].indexOf(resource.source_status) !== -1) return 'Audit issue';
|
| 1361 |
+
if (String(resource.source_status || '').indexOf('local') === 0) return 'Repository source';
|
| 1362 |
+
return 'Source checked';
|
| 1363 |
+
}
|
| 1364 |
+
|
| 1365 |
+
function detailSection(title, values) {
|
| 1366 |
+
var section = document.createElement('div');
|
| 1367 |
+
section.className = 'resource-detail';
|
| 1368 |
+
section.appendChild(createText('h4', '', title));
|
| 1369 |
+
values.filter(Boolean).forEach(function (value) {
|
| 1370 |
+
section.appendChild(createText('p', 'resource-bibliography', value));
|
| 1371 |
+
});
|
| 1372 |
+
return section;
|
| 1373 |
+
}
|
| 1374 |
+
|
| 1375 |
function resourceMatches(resource) {
|
| 1376 |
var query = search.value.trim().toLowerCase();
|
| 1377 |
var haystack = [
|
|
|
|
| 1382 |
resource.user_goal,
|
| 1383 |
resource.lifecycle_stages,
|
| 1384 |
resource.audience,
|
| 1385 |
+
resource.evidence_class,
|
| 1386 |
+
resource.authors,
|
| 1387 |
+
resource.publication_year,
|
| 1388 |
+
resource.publication_venue,
|
| 1389 |
+
resource.publisher,
|
| 1390 |
+
resource.doi,
|
| 1391 |
+
resource.arxiv_id,
|
| 1392 |
+
resource.key_contribution,
|
| 1393 |
+
resource.novelty,
|
| 1394 |
+
resource.impact
|
| 1395 |
].join(' ').toLowerCase();
|
| 1396 |
var evidenceSet = evidenceGroups[evidence.value] || [];
|
| 1397 |
|
|
|
|
| 1404 |
|
| 1405 |
function sortedResources(filtered) {
|
| 1406 |
return filtered.slice().sort(function (a, b) {
|
| 1407 |
+
if (sort.value === 'publication') {
|
| 1408 |
+
return Number(b.publication_year || 0) - Number(a.publication_year || 0) ||
|
| 1409 |
+
(Date.parse(b.publication_date || '') || 0) - (Date.parse(a.publication_date || '') || 0) ||
|
| 1410 |
+
a._index - b._index;
|
| 1411 |
+
}
|
| 1412 |
if (sort.value === 'stars') {
|
| 1413 |
return Number(b.github_stars || 0) - Number(a.github_stars || 0) || a._index - b._index;
|
| 1414 |
}
|
|
|
|
| 1421 |
|
| 1422 |
function renderItem(resource) {
|
| 1423 |
var item = document.createElement('article');
|
| 1424 |
+
var work = document.createElement('div');
|
| 1425 |
+
var year = document.createElement('div');
|
| 1426 |
+
var publication = document.createElement('div');
|
| 1427 |
+
var evidenceCell = document.createElement('div');
|
| 1428 |
+
var details = document.createElement('details');
|
| 1429 |
+
var detailGrid = document.createElement('div');
|
| 1430 |
+
var link = createText('a', 'resource-title', resource.title);
|
| 1431 |
+
var authors = formattedAuthors(resource.authors);
|
| 1432 |
+
var fullAuthors = authorNames(resource.authors).join(', ');
|
| 1433 |
var meta = [
|
|
|
|
| 1434 |
resource.collection,
|
| 1435 |
+
resource.section,
|
| 1436 |
stages(resource.lifecycle_stages).map(words).join(' / '),
|
| 1437 |
words(resource.evidence_class)
|
| 1438 |
].filter(Boolean).join(' | ');
|
|
|
|
| 1439 |
var signalClass = 'resource-signal ' + String(resource.signal_strength || 'unverified').toLowerCase();
|
| 1440 |
var signal = createText('span', signalClass, words(resource.signal_strength || 'unverified') + ' signal');
|
|
|
|
| 1441 |
var starCount = formatNumber(resource.github_stars);
|
| 1442 |
+
var venue = resource.publication_venue || resource.publisher || 'Source not stated';
|
| 1443 |
+
var publicationId = identifier(resource);
|
| 1444 |
+
var sourceRecord = [
|
| 1445 |
+
fullAuthors ? 'Authors: ' + fullAuthors : '',
|
| 1446 |
+
resource.publication_date ? 'Published: ' + resource.publication_date : 'Publication date: not stated by the source',
|
| 1447 |
+
'Source: ' + venue + (resource.publisher && resource.publisher !== venue ? ' | ' + resource.publisher : ''),
|
| 1448 |
+
publicationId ? 'Identifier: ' + publicationId : '',
|
| 1449 |
+
resource.primary_category ? 'Primary category: ' + resource.primary_category : '',
|
| 1450 |
+
resource.publication_note ? 'Source note: ' + resource.publication_note : '',
|
| 1451 |
+
resource.metadata_source ? 'Metadata provenance: ' + words(resource.metadata_source) : ''
|
| 1452 |
+
];
|
| 1453 |
|
| 1454 |
item.className = 'resource-item';
|
| 1455 |
link.href = resource.canonical_url || resource.url;
|
| 1456 |
+
work.className = 'resource-work';
|
| 1457 |
+
work.appendChild(link);
|
| 1458 |
+
work.appendChild(createText('p', 'resource-contribution', resource.key_contribution || resource.annotation));
|
| 1459 |
+
if (authors) {
|
| 1460 |
+
var authorLine = createText('p', 'resource-authors', authors);
|
| 1461 |
+
authorLine.title = fullAuthors;
|
| 1462 |
+
work.appendChild(authorLine);
|
| 1463 |
+
}
|
| 1464 |
+
work.appendChild(createText('div', 'resource-meta', meta));
|
| 1465 |
+
|
| 1466 |
+
year.className = 'resource-year';
|
| 1467 |
+
appendCellLabel(year, 'Year');
|
| 1468 |
+
year.appendChild(createText('span', 'resource-year-value' + (resource.publication_year ? '' : ' undated'), resource.publication_year || 'n.d.'));
|
| 1469 |
+
|
| 1470 |
+
publication.className = 'resource-publication';
|
| 1471 |
+
appendCellLabel(publication, 'Published at');
|
| 1472 |
+
publication.appendChild(createText('span', 'resource-venue', venue));
|
| 1473 |
+
if (resource.publisher && resource.publisher !== venue) publication.appendChild(createText('span', 'resource-publisher', resource.publisher));
|
| 1474 |
+
if (resource.publication_date && resource.publication_date !== resource.publication_year) publication.appendChild(createText('span', 'resource-date', resource.publication_date));
|
| 1475 |
+
if (publicationId) publication.appendChild(createText('span', 'resource-identifier', publicationId));
|
| 1476 |
+
|
| 1477 |
+
evidenceCell.className = 'resource-evidence';
|
| 1478 |
+
appendCellLabel(evidenceCell, 'Evidence');
|
| 1479 |
+
evidenceCell.appendChild(createText('span', 'resource-type-label', resource.resource_type));
|
| 1480 |
+
evidenceCell.appendChild(signal);
|
| 1481 |
+
if (starCount) evidenceCell.appendChild(createText('span', 'resource-source-status', starCount + ' GitHub stars'));
|
| 1482 |
+
evidenceCell.appendChild(createText('span', 'resource-source-status', sourceStatus(resource)));
|
| 1483 |
+
|
| 1484 |
+
details.className = 'resource-details';
|
| 1485 |
+
details.appendChild(createText('summary', '', 'Contribution, novelty, impact, and source record'));
|
| 1486 |
+
detailGrid.className = 'resource-detail-grid';
|
| 1487 |
+
detailGrid.appendChild(detailSection('Contribution', [resource.key_contribution || resource.annotation]));
|
| 1488 |
+
detailGrid.appendChild(detailSection('Novelty', [resource.novelty]));
|
| 1489 |
+
detailGrid.appendChild(detailSection('Impact', [resource.impact]));
|
| 1490 |
+
detailGrid.appendChild(detailSection('Source record', sourceRecord.concat(resource.signal ? ['Evidence: ' + resource.signal] : [])));
|
| 1491 |
+
details.appendChild(detailGrid);
|
| 1492 |
+
|
| 1493 |
+
item.appendChild(work);
|
| 1494 |
+
item.appendChild(year);
|
| 1495 |
+
item.appendChild(publication);
|
| 1496 |
+
item.appendChild(evidenceCell);
|
| 1497 |
+
item.appendChild(details);
|
| 1498 |
return item;
|
| 1499 |
}
|
| 1500 |
|
meta/hf_card_body.md
CHANGED
|
@@ -35,10 +35,20 @@ Each row in `data/resources.jsonl` (and the equivalent `data/resources.csv`) is
|
|
| 35 |
| `canonical_url` | Redirect-resolved or repository-canonical URL used for source verification. |
|
| 36 |
| `source_title` | Title metadata retrieved during the latest source audit. |
|
| 37 |
| `source_description` | Description or abstract metadata retrieved from the primary source. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
| `github_repo` | Normalized GitHub `owner/repository` identifier where applicable. |
|
| 39 |
| `github_stars` | GitHub star count captured at audit time; context, not a reliability score. |
|
| 40 |
| `github_forks` | GitHub fork count captured at audit time. |
|
| 41 |
| `github_license` | Repository license identifier reported by GitHub where available. |
|
|
|
|
| 42 |
| `github_updated_at` | Latest repository update timestamp reported by GitHub. |
|
| 43 |
| `arxiv_id` | arXiv identifier extracted from a primary paper URL where applicable. |
|
| 44 |
| `audited_at` | UTC timestamp for the source metadata and availability snapshot. |
|
|
|
|
| 35 |
| `canonical_url` | Redirect-resolved or repository-canonical URL used for source verification. |
|
| 36 |
| `source_title` | Title metadata retrieved during the latest source audit. |
|
| 37 |
| `source_description` | Description or abstract metadata retrieved from the primary source. |
|
| 38 |
+
| `authors` | Semicolon-delimited authors from primary bibliographic metadata when available. |
|
| 39 |
+
| `publication_date` | Primary-source publication or repository creation date in ISO format when available. |
|
| 40 |
+
| `publication_year` | Four-digit year derived from the verified publication date or identifier. |
|
| 41 |
+
| `publication_venue` | Journal, conference, repository, or named venue reported by the source. |
|
| 42 |
+
| `publisher` | Publishing organization or source platform; falls back to the canonical domain. |
|
| 43 |
+
| `doi` | Normalized DOI without a URL prefix when available. |
|
| 44 |
+
| `publication_note` | Primary-source journal reference, acceptance note, or publication comment when available. |
|
| 45 |
+
| `primary_category` | Primary arXiv category when applicable. |
|
| 46 |
+
| `metadata_source` | Provenance for bibliographic fields, such as `arxiv-api`, `github-api`, `html-meta`, or `domain-fallback`. |
|
| 47 |
| `github_repo` | Normalized GitHub `owner/repository` identifier where applicable. |
|
| 48 |
| `github_stars` | GitHub star count captured at audit time; context, not a reliability score. |
|
| 49 |
| `github_forks` | GitHub fork count captured at audit time. |
|
| 50 |
| `github_license` | Repository license identifier reported by GitHub where available. |
|
| 51 |
+
| `github_created_at` | Repository creation timestamp reported by GitHub. |
|
| 52 |
| `github_updated_at` | Latest repository update timestamp reported by GitHub. |
|
| 53 |
| `arxiv_id` | arXiv identifier extracted from a primary paper URL where applicable. |
|
| 54 |
| `audited_at` | UTC timestamp for the source metadata and availability snapshot. |
|
scripts/audit_resource_sources.py
CHANGED
|
@@ -15,10 +15,11 @@ import sys
|
|
| 15 |
import time
|
| 16 |
import urllib.error
|
| 17 |
import urllib.request
|
|
|
|
| 18 |
from datetime import datetime, timezone
|
| 19 |
from html.parser import HTMLParser
|
| 20 |
from pathlib import Path
|
| 21 |
-
from urllib.parse import urldefrag, urlparse
|
| 22 |
|
| 23 |
|
| 24 |
ROOT = Path(__file__).resolve().parents[1]
|
|
@@ -27,6 +28,53 @@ AUDIT_CSV = ROOT / "data" / "resource_source_audit.csv"
|
|
| 27 |
REPO_BLOB_URL = "https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main"
|
| 28 |
|
| 29 |
ARXIV_RE = re.compile(r"arxiv\.org/(?:abs|pdf)/(?P<id>\d{4}\.\d{4,5})(?:v\d+)?")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
FIELDS = [
|
| 32 |
"row_id",
|
|
@@ -40,12 +88,22 @@ FIELDS = [
|
|
| 40 |
"content_type",
|
| 41 |
"source_title",
|
| 42 |
"source_description",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
"github_repo",
|
| 44 |
"github_stars",
|
| 45 |
"github_forks",
|
| 46 |
"github_open_issues",
|
| 47 |
"github_description",
|
| 48 |
"github_license",
|
|
|
|
| 49 |
"github_updated_at",
|
| 50 |
"arxiv_id",
|
| 51 |
"error",
|
|
@@ -68,6 +126,7 @@ class MetadataParser(HTMLParser):
|
|
| 68 |
self.title_parts: list[str] = []
|
| 69 |
self.description = ""
|
| 70 |
self.description_priority = 0
|
|
|
|
| 71 |
|
| 72 |
@property
|
| 73 |
def title(self) -> str:
|
|
@@ -81,7 +140,10 @@ class MetadataParser(HTMLParser):
|
|
| 81 |
return
|
| 82 |
|
| 83 |
attr_map = {key.lower(): value or "" for key, value in attrs}
|
| 84 |
-
name = (attr_map.get("name") or attr_map.get("property") or "").lower()
|
|
|
|
|
|
|
|
|
|
| 85 |
priority = {
|
| 86 |
"description": 1,
|
| 87 |
"og:description": 1,
|
|
@@ -89,7 +151,6 @@ class MetadataParser(HTMLParser):
|
|
| 89 |
"dc.description": 2,
|
| 90 |
"citation_abstract": 3,
|
| 91 |
}.get(name, 0)
|
| 92 |
-
candidate = clean(attr_map.get("content"))
|
| 93 |
if candidate and priority > self.description_priority:
|
| 94 |
self.description = candidate
|
| 95 |
self.description_priority = priority
|
|
@@ -102,6 +163,20 @@ class MetadataParser(HTMLParser):
|
|
| 102 |
if self.in_title:
|
| 103 |
self.title_parts.append(data)
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
|
| 106 |
class RedirectHandler(urllib.request.HTTPRedirectHandler):
|
| 107 |
"""Teach Python 3.9's urllib opener to follow permanent HTTP 308 moves."""
|
|
@@ -135,16 +210,80 @@ def arxiv_id_from_url(url: str) -> str:
|
|
| 135 |
return match.group("id") if match else ""
|
| 136 |
|
| 137 |
|
| 138 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
if "html" not in content_type.lower():
|
| 140 |
-
return
|
| 141 |
text = body[:750_000].decode("utf-8", errors="ignore")
|
| 142 |
parser = MetadataParser()
|
| 143 |
try:
|
| 144 |
parser.feed(text)
|
| 145 |
except Exception: # noqa: BLE001 - source metadata should not fail the URL audit.
|
| 146 |
-
return
|
| 147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
|
| 149 |
|
| 150 |
def fetch_url(url: str, timeout: float, attempts: int) -> dict[str, str]:
|
|
@@ -154,36 +293,72 @@ def fetch_url(url: str, timeout: float, attempts: int) -> dict[str, str]:
|
|
| 154 |
RedirectHandler(),
|
| 155 |
)
|
| 156 |
last_error = ""
|
|
|
|
|
|
|
| 157 |
|
| 158 |
for attempt in range(1, attempts + 1):
|
| 159 |
for method in ("GET", "HEAD"):
|
| 160 |
request = urllib.request.Request(
|
| 161 |
-
|
| 162 |
method=method,
|
| 163 |
headers={"User-Agent": "awesome-loop-engineering-source-audit"},
|
| 164 |
)
|
| 165 |
try:
|
| 166 |
with opener.open(request, timeout=timeout) as response:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
content_type = response.headers.get("content-type", "")
|
| 168 |
body = response.read(750_000) if method == "GET" else b""
|
| 169 |
-
|
| 170 |
-
|
| 171 |
"audit_status": "ok",
|
| 172 |
"http_status": str(response.status),
|
| 173 |
-
"final_url":
|
| 174 |
"content_type": content_type,
|
| 175 |
-
"source_title": title,
|
| 176 |
-
"source_description": description,
|
| 177 |
"error": "",
|
| 178 |
}
|
|
|
|
|
|
|
| 179 |
except urllib.error.HTTPError as error:
|
| 180 |
if method == "HEAD":
|
| 181 |
continue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
if error.code in RESTRICTED_HTTP:
|
| 183 |
return {
|
| 184 |
"audit_status": "restricted",
|
| 185 |
"http_status": str(error.code),
|
| 186 |
-
"final_url":
|
| 187 |
"content_type": error.headers.get("content-type", "") if error.headers else "",
|
| 188 |
"source_title": "",
|
| 189 |
"source_description": "",
|
|
@@ -192,7 +367,7 @@ def fetch_url(url: str, timeout: float, attempts: int) -> dict[str, str]:
|
|
| 192 |
return {
|
| 193 |
"audit_status": "broken",
|
| 194 |
"http_status": str(error.code),
|
| 195 |
-
"final_url":
|
| 196 |
"content_type": error.headers.get("content-type", "") if error.headers else "",
|
| 197 |
"source_title": "",
|
| 198 |
"source_description": "",
|
|
@@ -204,12 +379,13 @@ def fetch_url(url: str, timeout: float, attempts: int) -> dict[str, str]:
|
|
| 204 |
continue
|
| 205 |
|
| 206 |
if attempt < attempts:
|
| 207 |
-
|
|
|
|
| 208 |
|
| 209 |
return {
|
| 210 |
"audit_status": "unreachable",
|
| 211 |
"http_status": "",
|
| 212 |
-
"final_url":
|
| 213 |
"content_type": "",
|
| 214 |
"source_title": "",
|
| 215 |
"source_description": "",
|
|
@@ -230,12 +406,22 @@ def audit_row(row: dict[str, str], retrieved_at: str, timeout: float, attempts:
|
|
| 230 |
"content_type": "",
|
| 231 |
"source_title": "",
|
| 232 |
"source_description": "",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
"github_repo": github_repo_from_url(row["url"]),
|
| 234 |
"github_stars": "",
|
| 235 |
"github_forks": "",
|
| 236 |
"github_open_issues": "",
|
| 237 |
"github_description": "",
|
| 238 |
"github_license": "",
|
|
|
|
| 239 |
"github_updated_at": "",
|
| 240 |
"arxiv_id": arxiv_id_from_url(row["url"]),
|
| 241 |
"error": "",
|
|
@@ -251,6 +437,9 @@ def audit_row(row: dict[str, str], retrieved_at: str, timeout: float, attempts:
|
|
| 251 |
"audit_status": "local_ok",
|
| 252 |
"final_url": f"{REPO_BLOB_URL}/{local_target}" + (f"#{fragment}" if fragment else ""),
|
| 253 |
"source_title": row["title"],
|
|
|
|
|
|
|
|
|
|
| 254 |
}
|
| 255 |
)
|
| 256 |
else:
|
|
@@ -258,7 +447,15 @@ def audit_row(row: dict[str, str], retrieved_at: str, timeout: float, attempts:
|
|
| 258 |
return base
|
| 259 |
|
| 260 |
if row["url_kind"] == "local_anchor":
|
| 261 |
-
base.update(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
return base
|
| 263 |
|
| 264 |
base.update(fetch_url(row["url"], timeout=timeout, attempts=attempts))
|
|
@@ -297,6 +494,7 @@ def github_stats_from_payload(data: dict[str, object]) -> dict[str, str]:
|
|
| 297 |
"github_open_issues": str(data.get("open_issues_count", "")),
|
| 298 |
"github_description": clean(str(description)),
|
| 299 |
"github_license": clean(str(license_data.get("spdx_id", ""))),
|
|
|
|
| 300 |
"github_updated_at": clean(str(data.get("updated_at", ""))),
|
| 301 |
}
|
| 302 |
|
|
@@ -330,6 +528,116 @@ def enrich_github(rows: list[dict[str, str]], timeout: float, use_gh_cli: bool)
|
|
| 330 |
row.update(stats.get(row["github_repo"], {}))
|
| 331 |
|
| 332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
def write_audit(rows: list[dict[str, str]], out_path: Path = AUDIT_CSV) -> None:
|
| 334 |
out_path.parent.mkdir(parents=True, exist_ok=True)
|
| 335 |
with out_path.open("w", encoding="utf-8", newline="") as handle:
|
|
@@ -355,6 +663,8 @@ def main() -> int:
|
|
| 355 |
|
| 356 |
audited.sort(key=lambda row: row["row_id"])
|
| 357 |
enrich_github(audited, timeout=args.timeout, use_gh_cli=args.github_cli)
|
|
|
|
|
|
|
| 358 |
write_audit(audited)
|
| 359 |
|
| 360 |
broken = [row for row in audited if row["audit_status"] in {"broken", "unreachable", "local_missing"}]
|
|
|
|
| 15 |
import time
|
| 16 |
import urllib.error
|
| 17 |
import urllib.request
|
| 18 |
+
import xml.etree.ElementTree as ET
|
| 19 |
from datetime import datetime, timezone
|
| 20 |
from html.parser import HTMLParser
|
| 21 |
from pathlib import Path
|
| 22 |
+
from urllib.parse import urldefrag, urlencode, urlparse
|
| 23 |
|
| 24 |
|
| 25 |
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
| 28 |
REPO_BLOB_URL = "https://github.com/ChaoYue0307/awesome-loop-engineering/blob/main"
|
| 29 |
|
| 30 |
ARXIV_RE = re.compile(r"arxiv\.org/(?:abs|pdf)/(?P<id>\d{4}\.\d{4,5})(?:v\d+)?")
|
| 31 |
+
YEAR_RE = re.compile(r"(?<!\d)(?P<year>19\d{2}|20\d{2})(?!\d)")
|
| 32 |
+
ISO_DATE_RE = re.compile(r"(?P<year>19\d{2}|20\d{2})[-/](?P<month>\d{1,2})[-/](?P<day>\d{1,2})")
|
| 33 |
+
|
| 34 |
+
ATOM_NS = "{http://www.w3.org/2005/Atom}"
|
| 35 |
+
ARXIV_NS = "{http://arxiv.org/schemas/atom}"
|
| 36 |
+
|
| 37 |
+
PUBLISHER_BY_DOMAIN = {
|
| 38 |
+
"arxiv.org": "arXiv",
|
| 39 |
+
"github.com": "GitHub",
|
| 40 |
+
"anthropic.com": "Anthropic",
|
| 41 |
+
"claude.com": "Anthropic",
|
| 42 |
+
"openai.com": "OpenAI",
|
| 43 |
+
"huggingface.co": "Hugging Face",
|
| 44 |
+
"microsoft.com": "Microsoft",
|
| 45 |
+
"google.com": "Google",
|
| 46 |
+
"googleblog.com": "Google",
|
| 47 |
+
"aws.amazon.com": "Amazon Web Services",
|
| 48 |
+
"amazon.com": "Amazon",
|
| 49 |
+
"preprints.org": "Preprints.org",
|
| 50 |
+
"ainowinstitute.org": "AI Now Institute",
|
| 51 |
+
"medium.com": "Medium",
|
| 52 |
+
"substack.com": "Substack",
|
| 53 |
+
"x.com": "X",
|
| 54 |
+
"youtube.com": "YouTube",
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
PUBLICATION_OVERRIDES = {
|
| 58 |
+
"https://www.preprints.org/manuscript/202603.1756": {
|
| 59 |
+
"authors": "Chaoyue He; Xin Zhou; Di Wang; Hong Xu; Wei Liu; Chunyan Miao",
|
| 60 |
+
"publication_date": "2026-04-23",
|
| 61 |
+
"publication_year": "2026",
|
| 62 |
+
"publication_venue": "Preprints.org",
|
| 63 |
+
"publisher": "Preprints.org",
|
| 64 |
+
"doi": "10.20944/preprints202603.1756.v2",
|
| 65 |
+
"publication_note": "Version 2; the primary source states that this preprint is not peer-reviewed.",
|
| 66 |
+
"metadata_source": "primary-page",
|
| 67 |
+
},
|
| 68 |
+
"https://resources.anthropic.com/hubfs/Building%20Effective%20AI%20Agents-%20Architecture%20Patterns%20and%20Implementation%20Frameworks.pdf": {
|
| 69 |
+
"authors": "Anthropic",
|
| 70 |
+
"publication_date": "2025-12-03",
|
| 71 |
+
"publication_year": "2025",
|
| 72 |
+
"publication_venue": "Anthropic eBook",
|
| 73 |
+
"publisher": "Anthropic",
|
| 74 |
+
"publication_note": "Date verified from the primary PDF creation metadata.",
|
| 75 |
+
"metadata_source": "pdf-metadata",
|
| 76 |
+
},
|
| 77 |
+
}
|
| 78 |
|
| 79 |
FIELDS = [
|
| 80 |
"row_id",
|
|
|
|
| 88 |
"content_type",
|
| 89 |
"source_title",
|
| 90 |
"source_description",
|
| 91 |
+
"authors",
|
| 92 |
+
"publication_date",
|
| 93 |
+
"publication_year",
|
| 94 |
+
"publication_venue",
|
| 95 |
+
"publisher",
|
| 96 |
+
"doi",
|
| 97 |
+
"publication_note",
|
| 98 |
+
"primary_category",
|
| 99 |
+
"metadata_source",
|
| 100 |
"github_repo",
|
| 101 |
"github_stars",
|
| 102 |
"github_forks",
|
| 103 |
"github_open_issues",
|
| 104 |
"github_description",
|
| 105 |
"github_license",
|
| 106 |
+
"github_created_at",
|
| 107 |
"github_updated_at",
|
| 108 |
"arxiv_id",
|
| 109 |
"error",
|
|
|
|
| 126 |
self.title_parts: list[str] = []
|
| 127 |
self.description = ""
|
| 128 |
self.description_priority = 0
|
| 129 |
+
self.meta_values: dict[str, list[str]] = {}
|
| 130 |
|
| 131 |
@property
|
| 132 |
def title(self) -> str:
|
|
|
|
| 140 |
return
|
| 141 |
|
| 142 |
attr_map = {key.lower(): value or "" for key, value in attrs}
|
| 143 |
+
name = (attr_map.get("name") or attr_map.get("property") or attr_map.get("itemprop") or "").lower()
|
| 144 |
+
candidate = clean(attr_map.get("content"))
|
| 145 |
+
if name and candidate:
|
| 146 |
+
self.meta_values.setdefault(name, []).append(candidate)
|
| 147 |
priority = {
|
| 148 |
"description": 1,
|
| 149 |
"og:description": 1,
|
|
|
|
| 151 |
"dc.description": 2,
|
| 152 |
"citation_abstract": 3,
|
| 153 |
}.get(name, 0)
|
|
|
|
| 154 |
if candidate and priority > self.description_priority:
|
| 155 |
self.description = candidate
|
| 156 |
self.description_priority = priority
|
|
|
|
| 163 |
if self.in_title:
|
| 164 |
self.title_parts.append(data)
|
| 165 |
|
| 166 |
+
def first(self, *names: str) -> str:
|
| 167 |
+
for name in names:
|
| 168 |
+
values = self.meta_values.get(name.lower(), [])
|
| 169 |
+
if values:
|
| 170 |
+
return values[0]
|
| 171 |
+
return ""
|
| 172 |
+
|
| 173 |
+
def all(self, *names: str) -> list[str]:
|
| 174 |
+
for name in names:
|
| 175 |
+
values = self.meta_values.get(name.lower(), [])
|
| 176 |
+
if values:
|
| 177 |
+
return list(dict.fromkeys(values))
|
| 178 |
+
return []
|
| 179 |
+
|
| 180 |
|
| 181 |
class RedirectHandler(urllib.request.HTTPRedirectHandler):
|
| 182 |
"""Teach Python 3.9's urllib opener to follow permanent HTTP 308 moves."""
|
|
|
|
| 210 |
return match.group("id") if match else ""
|
| 211 |
|
| 212 |
|
| 213 |
+
def normalize_date(value: str) -> str:
|
| 214 |
+
value = clean(value)
|
| 215 |
+
if not value:
|
| 216 |
+
return ""
|
| 217 |
+
match = ISO_DATE_RE.search(value)
|
| 218 |
+
if match:
|
| 219 |
+
return f"{match.group('year')}-{int(match.group('month')):02d}-{int(match.group('day')):02d}"
|
| 220 |
+
year = YEAR_RE.search(value)
|
| 221 |
+
return year.group("year") if year else ""
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
def year_from_value(value: str) -> str:
|
| 225 |
+
match = YEAR_RE.search(value or "")
|
| 226 |
+
return match.group("year") if match else ""
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
def normalize_doi(value: str) -> str:
|
| 230 |
+
value = clean(value)
|
| 231 |
+
for prefix in ("https://doi.org/", "http://doi.org/", "doi:"):
|
| 232 |
+
if value.lower().startswith(prefix):
|
| 233 |
+
value = value[len(prefix) :]
|
| 234 |
+
break
|
| 235 |
+
return value.strip()
|
| 236 |
+
|
| 237 |
+
|
| 238 |
+
def publisher_for_domain(domain: str) -> str:
|
| 239 |
+
normalized = domain.lower().removeprefix("www.")
|
| 240 |
+
for suffix, publisher in PUBLISHER_BY_DOMAIN.items():
|
| 241 |
+
if normalized == suffix or normalized.endswith(f".{suffix}"):
|
| 242 |
+
return publisher
|
| 243 |
+
return normalized
|
| 244 |
+
|
| 245 |
+
|
| 246 |
+
def html_metadata(body: bytes, content_type: str) -> dict[str, str]:
|
| 247 |
if "html" not in content_type.lower():
|
| 248 |
+
return {}
|
| 249 |
text = body[:750_000].decode("utf-8", errors="ignore")
|
| 250 |
parser = MetadataParser()
|
| 251 |
try:
|
| 252 |
parser.feed(text)
|
| 253 |
except Exception: # noqa: BLE001 - source metadata should not fail the URL audit.
|
| 254 |
+
return {}
|
| 255 |
+
|
| 256 |
+
authors = parser.all("citation_author", "dc.creator", "author")
|
| 257 |
+
publication_date = normalize_date(
|
| 258 |
+
parser.first(
|
| 259 |
+
"citation_publication_date",
|
| 260 |
+
"citation_date",
|
| 261 |
+
"article:published_time",
|
| 262 |
+
"datepublished",
|
| 263 |
+
"dc.date.issued",
|
| 264 |
+
"dc.date",
|
| 265 |
+
"date",
|
| 266 |
+
)
|
| 267 |
+
)
|
| 268 |
+
publication_venue = parser.first(
|
| 269 |
+
"citation_conference_title",
|
| 270 |
+
"citation_journal_title",
|
| 271 |
+
"citation_technical_report_institution",
|
| 272 |
+
)
|
| 273 |
+
publisher = parser.first("citation_publisher", "dc.publisher", "og:site_name", "application-name")
|
| 274 |
+
doi = normalize_doi(parser.first("citation_doi", "dc.identifier.doi", "doi"))
|
| 275 |
+
has_publication_metadata = any((authors, publication_date, publication_venue, publisher, doi))
|
| 276 |
+
return {
|
| 277 |
+
"source_title": parser.title,
|
| 278 |
+
"source_description": parser.description,
|
| 279 |
+
"authors": "; ".join(authors),
|
| 280 |
+
"publication_date": publication_date,
|
| 281 |
+
"publication_year": year_from_value(publication_date),
|
| 282 |
+
"publication_venue": publication_venue,
|
| 283 |
+
"publisher": publisher,
|
| 284 |
+
"doi": doi,
|
| 285 |
+
"metadata_source": "html-meta" if has_publication_metadata else "",
|
| 286 |
+
}
|
| 287 |
|
| 288 |
|
| 289 |
def fetch_url(url: str, timeout: float, attempts: int) -> dict[str, str]:
|
|
|
|
| 293 |
RedirectHandler(),
|
| 294 |
)
|
| 295 |
last_error = ""
|
| 296 |
+
parsed_url = urlparse(url)
|
| 297 |
+
request_url = url
|
| 298 |
|
| 299 |
for attempt in range(1, attempts + 1):
|
| 300 |
for method in ("GET", "HEAD"):
|
| 301 |
request = urllib.request.Request(
|
| 302 |
+
request_url,
|
| 303 |
method=method,
|
| 304 |
headers={"User-Agent": "awesome-loop-engineering-source-audit"},
|
| 305 |
)
|
| 306 |
try:
|
| 307 |
with opener.open(request, timeout=timeout) as response:
|
| 308 |
+
final_url = response.geturl()
|
| 309 |
+
final_host = urlparse(final_url).netloc.lower()
|
| 310 |
+
if parsed_url.netloc.lower() == "code.claude.com" and final_host not in {
|
| 311 |
+
"",
|
| 312 |
+
"code.claude.com",
|
| 313 |
+
"docs.anthropic.com",
|
| 314 |
+
}:
|
| 315 |
+
return {
|
| 316 |
+
"audit_status": "restricted",
|
| 317 |
+
"http_status": str(response.status),
|
| 318 |
+
"final_url": request_url,
|
| 319 |
+
"content_type": response.headers.get("content-type", ""),
|
| 320 |
+
"source_title": "",
|
| 321 |
+
"source_description": "",
|
| 322 |
+
"error": f"redirected_to_unrelated_host:{final_host}",
|
| 323 |
+
}
|
| 324 |
content_type = response.headers.get("content-type", "")
|
| 325 |
body = response.read(750_000) if method == "GET" else b""
|
| 326 |
+
metadata = html_metadata(body, content_type)
|
| 327 |
+
result = {
|
| 328 |
"audit_status": "ok",
|
| 329 |
"http_status": str(response.status),
|
| 330 |
+
"final_url": final_url,
|
| 331 |
"content_type": content_type,
|
|
|
|
|
|
|
| 332 |
"error": "",
|
| 333 |
}
|
| 334 |
+
result.update(metadata)
|
| 335 |
+
return result
|
| 336 |
except urllib.error.HTTPError as error:
|
| 337 |
if method == "HEAD":
|
| 338 |
continue
|
| 339 |
+
error_host = urlparse(error.geturl()).netloc.lower()
|
| 340 |
+
if parsed_url.netloc.lower() == "code.claude.com" and error_host not in {
|
| 341 |
+
"",
|
| 342 |
+
"code.claude.com",
|
| 343 |
+
"docs.anthropic.com",
|
| 344 |
+
}:
|
| 345 |
+
return {
|
| 346 |
+
"audit_status": "restricted",
|
| 347 |
+
"http_status": str(error.code),
|
| 348 |
+
"final_url": request_url,
|
| 349 |
+
"content_type": error.headers.get("content-type", "") if error.headers else "",
|
| 350 |
+
"source_title": "",
|
| 351 |
+
"source_description": "",
|
| 352 |
+
"error": f"redirected_to_unrelated_host:{error_host}",
|
| 353 |
+
}
|
| 354 |
+
if error.code == 404 and parsed_url.netloc.lower() == "code.claude.com" and attempt < attempts:
|
| 355 |
+
last_error = "HTTPError:404"
|
| 356 |
+
break
|
| 357 |
if error.code in RESTRICTED_HTTP:
|
| 358 |
return {
|
| 359 |
"audit_status": "restricted",
|
| 360 |
"http_status": str(error.code),
|
| 361 |
+
"final_url": request_url,
|
| 362 |
"content_type": error.headers.get("content-type", "") if error.headers else "",
|
| 363 |
"source_title": "",
|
| 364 |
"source_description": "",
|
|
|
|
| 367 |
return {
|
| 368 |
"audit_status": "broken",
|
| 369 |
"http_status": str(error.code),
|
| 370 |
+
"final_url": request_url,
|
| 371 |
"content_type": error.headers.get("content-type", "") if error.headers else "",
|
| 372 |
"source_title": "",
|
| 373 |
"source_description": "",
|
|
|
|
| 379 |
continue
|
| 380 |
|
| 381 |
if attempt < attempts:
|
| 382 |
+
delay = 1.5 * attempt if parsed_url.netloc.lower() == "code.claude.com" else 0.25 * attempt
|
| 383 |
+
time.sleep(min(4.0, delay))
|
| 384 |
|
| 385 |
return {
|
| 386 |
"audit_status": "unreachable",
|
| 387 |
"http_status": "",
|
| 388 |
+
"final_url": request_url,
|
| 389 |
"content_type": "",
|
| 390 |
"source_title": "",
|
| 391 |
"source_description": "",
|
|
|
|
| 406 |
"content_type": "",
|
| 407 |
"source_title": "",
|
| 408 |
"source_description": "",
|
| 409 |
+
"authors": "",
|
| 410 |
+
"publication_date": "",
|
| 411 |
+
"publication_year": "",
|
| 412 |
+
"publication_venue": "",
|
| 413 |
+
"publisher": "",
|
| 414 |
+
"doi": "",
|
| 415 |
+
"publication_note": "",
|
| 416 |
+
"primary_category": "",
|
| 417 |
+
"metadata_source": "",
|
| 418 |
"github_repo": github_repo_from_url(row["url"]),
|
| 419 |
"github_stars": "",
|
| 420 |
"github_forks": "",
|
| 421 |
"github_open_issues": "",
|
| 422 |
"github_description": "",
|
| 423 |
"github_license": "",
|
| 424 |
+
"github_created_at": "",
|
| 425 |
"github_updated_at": "",
|
| 426 |
"arxiv_id": arxiv_id_from_url(row["url"]),
|
| 427 |
"error": "",
|
|
|
|
| 437 |
"audit_status": "local_ok",
|
| 438 |
"final_url": f"{REPO_BLOB_URL}/{local_target}" + (f"#{fragment}" if fragment else ""),
|
| 439 |
"source_title": row["title"],
|
| 440 |
+
"publication_year": "2026",
|
| 441 |
+
"publisher": "Awesome Loop Engineering",
|
| 442 |
+
"metadata_source": "repository",
|
| 443 |
}
|
| 444 |
)
|
| 445 |
else:
|
|
|
|
| 447 |
return base
|
| 448 |
|
| 449 |
if row["url_kind"] == "local_anchor":
|
| 450 |
+
base.update(
|
| 451 |
+
{
|
| 452 |
+
"audit_status": "local_anchor",
|
| 453 |
+
"final_url": row["url"],
|
| 454 |
+
"publication_year": "2026",
|
| 455 |
+
"publisher": "Awesome Loop Engineering",
|
| 456 |
+
"metadata_source": "repository",
|
| 457 |
+
}
|
| 458 |
+
)
|
| 459 |
return base
|
| 460 |
|
| 461 |
base.update(fetch_url(row["url"], timeout=timeout, attempts=attempts))
|
|
|
|
| 494 |
"github_open_issues": str(data.get("open_issues_count", "")),
|
| 495 |
"github_description": clean(str(description)),
|
| 496 |
"github_license": clean(str(license_data.get("spdx_id", ""))),
|
| 497 |
+
"github_created_at": clean(str(data.get("created_at", ""))),
|
| 498 |
"github_updated_at": clean(str(data.get("updated_at", ""))),
|
| 499 |
}
|
| 500 |
|
|
|
|
| 528 |
row.update(stats.get(row["github_repo"], {}))
|
| 529 |
|
| 530 |
|
| 531 |
+
def fetch_arxiv_batch(arxiv_ids: list[str], timeout: float, attempts: int) -> dict[str, dict[str, str]]:
|
| 532 |
+
query = urlencode({"id_list": ",".join(arxiv_ids), "max_results": str(len(arxiv_ids))})
|
| 533 |
+
url = f"https://export.arxiv.org/api/query?{query}"
|
| 534 |
+
context = ssl._create_unverified_context()
|
| 535 |
+
request = urllib.request.Request(
|
| 536 |
+
url,
|
| 537 |
+
headers={"User-Agent": "awesome-loop-engineering-publication-audit"},
|
| 538 |
+
)
|
| 539 |
+
|
| 540 |
+
for attempt in range(1, attempts + 1):
|
| 541 |
+
try:
|
| 542 |
+
with urllib.request.urlopen(request, timeout=timeout, context=context) as response:
|
| 543 |
+
root = ET.fromstring(response.read())
|
| 544 |
+
break
|
| 545 |
+
except Exception: # noqa: BLE001 - fallback metadata remains explicit below.
|
| 546 |
+
if attempt == attempts:
|
| 547 |
+
return {}
|
| 548 |
+
time.sleep(min(3.0, attempt))
|
| 549 |
+
|
| 550 |
+
records: dict[str, dict[str, str]] = {}
|
| 551 |
+
for entry in root.findall(f"{ATOM_NS}entry"):
|
| 552 |
+
entry_url = clean(entry.findtext(f"{ATOM_NS}id") or "")
|
| 553 |
+
match = ARXIV_RE.search(entry_url)
|
| 554 |
+
if not match:
|
| 555 |
+
continue
|
| 556 |
+
arxiv_id = match.group("id")
|
| 557 |
+
authors = [
|
| 558 |
+
clean(author.findtext(f"{ATOM_NS}name") or "")
|
| 559 |
+
for author in entry.findall(f"{ATOM_NS}author")
|
| 560 |
+
]
|
| 561 |
+
primary = entry.find(f"{ARXIV_NS}primary_category")
|
| 562 |
+
published = normalize_date(entry.findtext(f"{ATOM_NS}published") or "")
|
| 563 |
+
journal_reference = clean(entry.findtext(f"{ARXIV_NS}journal_ref") or "")
|
| 564 |
+
records[arxiv_id] = {
|
| 565 |
+
"authors": "; ".join(author for author in authors if author),
|
| 566 |
+
"publication_date": published,
|
| 567 |
+
"publication_year": year_from_value(published),
|
| 568 |
+
"publication_venue": journal_reference or "arXiv",
|
| 569 |
+
"publisher": "arXiv",
|
| 570 |
+
"doi": normalize_doi(entry.findtext(f"{ARXIV_NS}doi") or ""),
|
| 571 |
+
"publication_note": clean(entry.findtext(f"{ARXIV_NS}comment") or ""),
|
| 572 |
+
"primary_category": clean(primary.get("term", "")) if primary is not None else "",
|
| 573 |
+
"metadata_source": "arxiv-api",
|
| 574 |
+
}
|
| 575 |
+
return records
|
| 576 |
+
|
| 577 |
+
|
| 578 |
+
def arxiv_year(arxiv_id: str) -> str:
|
| 579 |
+
try:
|
| 580 |
+
return str(2000 + int(arxiv_id[:2]))
|
| 581 |
+
except (TypeError, ValueError):
|
| 582 |
+
return ""
|
| 583 |
+
|
| 584 |
+
|
| 585 |
+
def enrich_arxiv(rows: list[dict[str, str]], timeout: float, attempts: int) -> None:
|
| 586 |
+
arxiv_ids = sorted({row["arxiv_id"] for row in rows if row["arxiv_id"]})
|
| 587 |
+
records: dict[str, dict[str, str]] = {}
|
| 588 |
+
batch_size = 75
|
| 589 |
+
for start in range(0, len(arxiv_ids), batch_size):
|
| 590 |
+
if start:
|
| 591 |
+
time.sleep(3.0)
|
| 592 |
+
records.update(fetch_arxiv_batch(arxiv_ids[start : start + batch_size], timeout, attempts))
|
| 593 |
+
|
| 594 |
+
for row in rows:
|
| 595 |
+
arxiv_id = row["arxiv_id"]
|
| 596 |
+
if not arxiv_id:
|
| 597 |
+
continue
|
| 598 |
+
metadata = records.get(arxiv_id)
|
| 599 |
+
if metadata:
|
| 600 |
+
row.update({key: value for key, value in metadata.items() if value})
|
| 601 |
+
else:
|
| 602 |
+
row["publisher"] = "arXiv"
|
| 603 |
+
row["publication_year"] = row["publication_year"] or arxiv_year(arxiv_id)
|
| 604 |
+
row["metadata_source"] = row["metadata_source"] or "arxiv-id"
|
| 605 |
+
|
| 606 |
+
|
| 607 |
+
def year_from_url(url: str) -> str:
|
| 608 |
+
parsed = urlparse(url)
|
| 609 |
+
match = re.search(r"/(?:manuscript/)?(?P<year>20\d{2})(?:[/_-]|\d{2}\.)", parsed.path)
|
| 610 |
+
if not match:
|
| 611 |
+
return ""
|
| 612 |
+
year = int(match.group("year"))
|
| 613 |
+
return str(year) if year <= datetime.now(timezone.utc).year + 1 else ""
|
| 614 |
+
|
| 615 |
+
|
| 616 |
+
def finalize_publication_metadata(rows: list[dict[str, str]]) -> None:
|
| 617 |
+
for row in rows:
|
| 618 |
+
override = PUBLICATION_OVERRIDES.get(row["url"], {})
|
| 619 |
+
row.update({key: value for key, value in override.items() if value})
|
| 620 |
+
|
| 621 |
+
if row["github_repo"]:
|
| 622 |
+
row["publisher"] = "GitHub"
|
| 623 |
+
row["publication_venue"] = row["publication_venue"] or row["github_repo"]
|
| 624 |
+
if not row["publication_date"] and row["github_created_at"]:
|
| 625 |
+
row["publication_date"] = normalize_date(row["github_created_at"])
|
| 626 |
+
row["metadata_source"] = "github-api"
|
| 627 |
+
|
| 628 |
+
if not row["publisher"]:
|
| 629 |
+
row["publisher"] = publisher_for_domain(row["domain"]) or "Awesome Loop Engineering"
|
| 630 |
+
if not row["publication_year"]:
|
| 631 |
+
row["publication_year"] = year_from_value(row["publication_date"])
|
| 632 |
+
if not row["publication_year"]:
|
| 633 |
+
row["publication_year"] = year_from_url(row["url"])
|
| 634 |
+
if row["publication_year"] and not row["metadata_source"]:
|
| 635 |
+
row["metadata_source"] = "url-date"
|
| 636 |
+
if not row["metadata_source"]:
|
| 637 |
+
row["metadata_source"] = "domain-fallback"
|
| 638 |
+
row["doi"] = normalize_doi(row["doi"])
|
| 639 |
+
|
| 640 |
+
|
| 641 |
def write_audit(rows: list[dict[str, str]], out_path: Path = AUDIT_CSV) -> None:
|
| 642 |
out_path.parent.mkdir(parents=True, exist_ok=True)
|
| 643 |
with out_path.open("w", encoding="utf-8", newline="") as handle:
|
|
|
|
| 663 |
|
| 664 |
audited.sort(key=lambda row: row["row_id"])
|
| 665 |
enrich_github(audited, timeout=args.timeout, use_gh_cli=args.github_cli)
|
| 666 |
+
enrich_arxiv(audited, timeout=max(args.timeout, 20.0), attempts=args.attempts)
|
| 667 |
+
finalize_publication_metadata(audited)
|
| 668 |
write_audit(audited)
|
| 669 |
|
| 670 |
broken = [row for row in audited if row["audit_status"] in {"broken", "unreachable", "local_missing"}]
|
scripts/check_publication_metadata.py
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Validate bibliographic metadata in the generated resource dataset."""
|
| 3 |
+
|
| 4 |
+
from __future__ import annotations
|
| 5 |
+
|
| 6 |
+
import csv
|
| 7 |
+
import re
|
| 8 |
+
import sys
|
| 9 |
+
from datetime import datetime, timezone
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
ROOT = Path(__file__).resolve().parents[1]
|
| 14 |
+
RESOURCES = ROOT / "data" / "resources.csv"
|
| 15 |
+
YEAR_RE = re.compile(r"^(19|20)\d{2}$")
|
| 16 |
+
REQUIRED_COLUMNS = {
|
| 17 |
+
"authors",
|
| 18 |
+
"publication_date",
|
| 19 |
+
"publication_year",
|
| 20 |
+
"publication_venue",
|
| 21 |
+
"publisher",
|
| 22 |
+
"doi",
|
| 23 |
+
"publication_note",
|
| 24 |
+
"primary_category",
|
| 25 |
+
"metadata_source",
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def main() -> int:
|
| 30 |
+
with RESOURCES.open(encoding="utf-8", newline="") as handle:
|
| 31 |
+
reader = csv.DictReader(handle)
|
| 32 |
+
missing = REQUIRED_COLUMNS - set(reader.fieldnames or [])
|
| 33 |
+
if missing:
|
| 34 |
+
print(f"Missing publication columns: {', '.join(sorted(missing))}", file=sys.stderr)
|
| 35 |
+
return 1
|
| 36 |
+
rows = list(reader)
|
| 37 |
+
|
| 38 |
+
failures: list[str] = []
|
| 39 |
+
maximum_year = datetime.now(timezone.utc).year + 1
|
| 40 |
+
for row in rows:
|
| 41 |
+
row_id = row["row_id"]
|
| 42 |
+
year = row["publication_year"]
|
| 43 |
+
date = row["publication_date"]
|
| 44 |
+
|
| 45 |
+
if not row["publisher"]:
|
| 46 |
+
failures.append(f"{row_id}: publisher/source platform is missing")
|
| 47 |
+
if not row["metadata_source"]:
|
| 48 |
+
failures.append(f"{row_id}: metadata provenance is missing")
|
| 49 |
+
if year:
|
| 50 |
+
if not YEAR_RE.fullmatch(year) or not 1900 <= int(year) <= maximum_year:
|
| 51 |
+
failures.append(f"{row_id}: invalid publication year {year!r}")
|
| 52 |
+
if date and not date.startswith(year):
|
| 53 |
+
failures.append(f"{row_id}: publication date {date!r} disagrees with year {year!r}")
|
| 54 |
+
if row["resource_type"] == "Paper":
|
| 55 |
+
if not row["authors"]:
|
| 56 |
+
failures.append(f"{row_id}: paper authors are missing")
|
| 57 |
+
if not year:
|
| 58 |
+
failures.append(f"{row_id}: paper publication year is missing")
|
| 59 |
+
if row["arxiv_id"]:
|
| 60 |
+
if row["publisher"] != "arXiv":
|
| 61 |
+
failures.append(f"{row_id}: arXiv row has publisher {row['publisher']!r}")
|
| 62 |
+
if not row["authors"]:
|
| 63 |
+
failures.append(f"{row_id}: arXiv authors are missing")
|
| 64 |
+
if not date:
|
| 65 |
+
failures.append(f"{row_id}: arXiv publication date is missing")
|
| 66 |
+
if row["metadata_source"] != "arxiv-api":
|
| 67 |
+
failures.append(f"{row_id}: arXiv metadata is not API-backed")
|
| 68 |
+
doi = row["doi"].lower()
|
| 69 |
+
if doi.startswith(("http://", "https://", "doi:")):
|
| 70 |
+
failures.append(f"{row_id}: DOI is not normalized")
|
| 71 |
+
|
| 72 |
+
if failures:
|
| 73 |
+
print("Publication metadata check failed:", file=sys.stderr)
|
| 74 |
+
for failure in failures[:50]:
|
| 75 |
+
print(f"- {failure}", file=sys.stderr)
|
| 76 |
+
if len(failures) > 50:
|
| 77 |
+
print(f"- ... and {len(failures) - 50} more", file=sys.stderr)
|
| 78 |
+
return 1
|
| 79 |
+
|
| 80 |
+
print(f"Validated publication metadata for {len(rows)} resources.")
|
| 81 |
+
return 0
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
if __name__ == "__main__":
|
| 85 |
+
raise SystemExit(main())
|
scripts/export_resource_dataset.py
CHANGED
|
@@ -71,10 +71,20 @@ FIELDS = [
|
|
| 71 |
"canonical_url",
|
| 72 |
"source_title",
|
| 73 |
"source_description",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
"github_repo",
|
| 75 |
"github_stars",
|
| 76 |
"github_forks",
|
| 77 |
"github_license",
|
|
|
|
| 78 |
"github_updated_at",
|
| 79 |
"arxiv_id",
|
| 80 |
"audited_at",
|
|
@@ -86,6 +96,10 @@ SITE_FIELDS = [
|
|
| 86 |
"url",
|
| 87 |
"canonical_url",
|
| 88 |
"annotation",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
"resource_type",
|
| 90 |
"collection",
|
| 91 |
"user_goal",
|
|
@@ -96,7 +110,18 @@ SITE_FIELDS = [
|
|
| 96 |
"evidence_class",
|
| 97 |
"signal_strength",
|
| 98 |
"source_status",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 99 |
"github_stars",
|
|
|
|
| 100 |
"date_added",
|
| 101 |
]
|
| 102 |
|
|
@@ -479,10 +504,20 @@ def iter_rows(readme_path: Path = README) -> list[dict[str, str]]:
|
|
| 479 |
"canonical_url": audit.get("final_url", "") or url,
|
| 480 |
"source_title": audit.get("source_title", ""),
|
| 481 |
"source_description": audit.get("source_description", ""),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 482 |
"github_repo": audit.get("github_repo", ""),
|
| 483 |
"github_stars": audit.get("github_stars", ""),
|
| 484 |
"github_forks": audit.get("github_forks", ""),
|
| 485 |
"github_license": audit.get("github_license", ""),
|
|
|
|
| 486 |
"github_updated_at": audit.get("github_updated_at", ""),
|
| 487 |
"arxiv_id": audit.get("arxiv_id", ""),
|
| 488 |
"audited_at": audit.get("retrieved_at", ""),
|
|
|
|
| 71 |
"canonical_url",
|
| 72 |
"source_title",
|
| 73 |
"source_description",
|
| 74 |
+
"authors",
|
| 75 |
+
"publication_date",
|
| 76 |
+
"publication_year",
|
| 77 |
+
"publication_venue",
|
| 78 |
+
"publisher",
|
| 79 |
+
"doi",
|
| 80 |
+
"publication_note",
|
| 81 |
+
"primary_category",
|
| 82 |
+
"metadata_source",
|
| 83 |
"github_repo",
|
| 84 |
"github_stars",
|
| 85 |
"github_forks",
|
| 86 |
"github_license",
|
| 87 |
+
"github_created_at",
|
| 88 |
"github_updated_at",
|
| 89 |
"arxiv_id",
|
| 90 |
"audited_at",
|
|
|
|
| 96 |
"url",
|
| 97 |
"canonical_url",
|
| 98 |
"annotation",
|
| 99 |
+
"key_contribution",
|
| 100 |
+
"novelty",
|
| 101 |
+
"impact",
|
| 102 |
+
"signal",
|
| 103 |
"resource_type",
|
| 104 |
"collection",
|
| 105 |
"user_goal",
|
|
|
|
| 110 |
"evidence_class",
|
| 111 |
"signal_strength",
|
| 112 |
"source_status",
|
| 113 |
+
"authors",
|
| 114 |
+
"publication_date",
|
| 115 |
+
"publication_year",
|
| 116 |
+
"publication_venue",
|
| 117 |
+
"publisher",
|
| 118 |
+
"doi",
|
| 119 |
+
"publication_note",
|
| 120 |
+
"primary_category",
|
| 121 |
+
"metadata_source",
|
| 122 |
+
"github_repo",
|
| 123 |
"github_stars",
|
| 124 |
+
"arxiv_id",
|
| 125 |
"date_added",
|
| 126 |
]
|
| 127 |
|
|
|
|
| 504 |
"canonical_url": audit.get("final_url", "") or url,
|
| 505 |
"source_title": audit.get("source_title", ""),
|
| 506 |
"source_description": audit.get("source_description", ""),
|
| 507 |
+
"authors": audit.get("authors", ""),
|
| 508 |
+
"publication_date": audit.get("publication_date", ""),
|
| 509 |
+
"publication_year": audit.get("publication_year", ""),
|
| 510 |
+
"publication_venue": audit.get("publication_venue", ""),
|
| 511 |
+
"publisher": audit.get("publisher", "") or domain or "Awesome Loop Engineering",
|
| 512 |
+
"doi": audit.get("doi", ""),
|
| 513 |
+
"publication_note": audit.get("publication_note", ""),
|
| 514 |
+
"primary_category": audit.get("primary_category", ""),
|
| 515 |
+
"metadata_source": audit.get("metadata_source", "not-audited"),
|
| 516 |
"github_repo": audit.get("github_repo", ""),
|
| 517 |
"github_stars": audit.get("github_stars", ""),
|
| 518 |
"github_forks": audit.get("github_forks", ""),
|
| 519 |
"github_license": audit.get("github_license", ""),
|
| 520 |
+
"github_created_at": audit.get("github_created_at", ""),
|
| 521 |
"github_updated_at": audit.get("github_updated_at", ""),
|
| 522 |
"arxiv_id": audit.get("arxiv_id", ""),
|
| 523 |
"audited_at": audit.get("retrieved_at", ""),
|
scripts/verify_urls.py
CHANGED
|
@@ -16,9 +16,11 @@ import time
|
|
| 16 |
import urllib.error
|
| 17 |
import urllib.request
|
| 18 |
from pathlib import Path
|
|
|
|
| 19 |
|
| 20 |
|
| 21 |
URL_RE = re.compile(r'https?://[^\s)\]}>"]+')
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
class RedirectHandler(urllib.request.HTTPRedirectHandler):
|
|
@@ -56,6 +58,7 @@ def check_url(url: str, timeout: float, attempts: int) -> tuple[bool, str]:
|
|
| 56 |
RedirectHandler(),
|
| 57 |
)
|
| 58 |
last_error = "unknown"
|
|
|
|
| 59 |
|
| 60 |
for attempt in range(1, attempts + 1):
|
| 61 |
for method in ("HEAD", "GET"):
|
|
@@ -66,8 +69,14 @@ def check_url(url: str, timeout: float, attempts: int) -> tuple[bool, str]:
|
|
| 66 |
)
|
| 67 |
try:
|
| 68 |
with opener.open(request, timeout=timeout) as response:
|
|
|
|
|
|
|
|
|
|
| 69 |
return response.status < 400, f"{response.status} {method}"
|
| 70 |
except urllib.error.HTTPError as error:
|
|
|
|
|
|
|
|
|
|
| 71 |
if error.code in {401, 403, 405, 406, 418, 429, 999}:
|
| 72 |
return True, f"{error.code} restricted"
|
| 73 |
if method == "HEAD":
|
|
|
|
| 16 |
import urllib.error
|
| 17 |
import urllib.request
|
| 18 |
from pathlib import Path
|
| 19 |
+
from urllib.parse import urlparse
|
| 20 |
|
| 21 |
|
| 22 |
URL_RE = re.compile(r'https?://[^\s)\]}>"]+')
|
| 23 |
+
CLAUDE_DOC_HOSTS = {"code.claude.com", "docs.anthropic.com"}
|
| 24 |
|
| 25 |
|
| 26 |
class RedirectHandler(urllib.request.HTTPRedirectHandler):
|
|
|
|
| 58 |
RedirectHandler(),
|
| 59 |
)
|
| 60 |
last_error = "unknown"
|
| 61 |
+
source_host = urlparse(url).netloc.lower()
|
| 62 |
|
| 63 |
for attempt in range(1, attempts + 1):
|
| 64 |
for method in ("HEAD", "GET"):
|
|
|
|
| 69 |
)
|
| 70 |
try:
|
| 71 |
with opener.open(request, timeout=timeout) as response:
|
| 72 |
+
final_host = urlparse(response.geturl()).netloc.lower()
|
| 73 |
+
if source_host == "code.claude.com" and final_host not in CLAUDE_DOC_HOSTS:
|
| 74 |
+
return True, f"{response.status} restricted redirect"
|
| 75 |
return response.status < 400, f"{response.status} {method}"
|
| 76 |
except urllib.error.HTTPError as error:
|
| 77 |
+
final_host = urlparse(error.geturl()).netloc.lower()
|
| 78 |
+
if source_host == "code.claude.com" and final_host not in CLAUDE_DOC_HOSTS:
|
| 79 |
+
return True, f"{error.code} restricted redirect"
|
| 80 |
if error.code in {401, 403, 405, 406, 418, 429, 999}:
|
| 81 |
return True, f"{error.code} restricted"
|
| 82 |
if method == "HEAD":
|
templates/resource-entry.md
CHANGED
|
@@ -15,6 +15,10 @@ Use this when adding one resource to `README.md`.
|
|
| 15 |
- **Evidence quality**: Tier A / B / C / D
|
| 16 |
- **Why it belongs**:
|
| 17 |
- **Primary or secondary source**:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
- **Any caveat**:
|
| 19 |
|
| 20 |
## Quality Bar
|
|
|
|
| 15 |
- **Evidence quality**: Tier A / B / C / D
|
| 16 |
- **Why it belongs**:
|
| 17 |
- **Primary or secondary source**:
|
| 18 |
+
- **Authors / organization**:
|
| 19 |
+
- **Publication year**:
|
| 20 |
+
- **Venue or source platform**:
|
| 21 |
+
- **DOI or arXiv ID**:
|
| 22 |
- **Any caveat**:
|
| 23 |
|
| 24 |
## Quality Bar
|