Skip to content

Agent readiness: crawler tokens, dataset instructions, Signposting, llms.txt - #294

Merged
neuromechanist merged 16 commits into
stagingfrom
feature/issue-284-epic-agent-readiness
Sep 3, 2026
Merged

neuromechanist merged 16 commits into
stagingfrom
feature/issue-284-epic-agent-readiness

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

Epic #284, four phases, evidence-ordered from the 2026-09-03 findability research (nemarOrg/nemar-cli .context/research-agent-findability.md). Descriptive only: no API response shape, Zarr index contract, data host layout, or served field changes anywhere in this PR.

Phase 1 (#285): robots.txt names every AI crawler token over one stacked Allow rule with a Sitemap line, production hosts only, non-production still disallowed; sitemap.xml with per-dataset lastmod taken from the dataset's own last change rather than build time; no canonical to openneuro.org.

Phase 2 (#286): a server-rendered Use-this-data section on the dataset page built from the data the page already fetches (what it is, license and required citations, where the bytes are, how to download, how to assess fit without downloading, and a Zarr block only when has_zarr is set), plus a /dataset/.md mirror generated from the same model and linked with rel=alternate. Most AI crawlers execute no JavaScript, so this is the only channel they have.

Phase 3 (#287): FAIR Signposting as both HTTP Link headers and head link elements from one model, so the two serializations cannot disagree: cite-as on the concept DOI, describedby for the metadata and API documents, item, license, type, and author ORCIDs.

Phase 6 (#289): a For-agents guide and generated llms.txt on docs.nemar.org (merged separately as nemarOrg/docs#16), plus a small nemar.org llms.txt with a footer link so the file is auditable. llms.txt ships as a no-regret addition, not as a findability claim: the evidence says it is not read at scale.

Closes #285
Closes #286
Closes #287
Closes #289

Phase 4 (#288, registry listings and DataCite completeness) stays open as an operations checklist. Phase 5 is nemarOrg/nemar-cli#937: its OpenAPI half landed on dev as nemarOrg/nemar-cli#1239, and the website contract-type adoption remains open there.

Test plan

  • Each phase PR ran lint, typecheck (astro check), the vitest suite, and a production build before merging into the epic branch.
  • Private datasets: no markdown mirror, no Signposting headers, no sitemap entry.
  • The dataset page still renders its instructions and JSON-LD with JavaScript disabled.

…290)

* Allow AI crawlers in robots.txt

* Add real-lastmod sitemap.xml route

* Add tests and fixture for robots/sitemap

* Move escapeXml to a neutral xml module

* Assert the crawler block stays contiguous

* Reuse isManagedDatasetId in the sitemap filter

* Skip the sitemap on noindex hosts
* lib: export license helpers from jsonld

* types: add zarr status fields to Dataset

* lib: add use-this-data model and tests

* add UseThisData section component

* layout: add generic headLinks to Base

* dataset: render Use this data section

* dataset: add markdown mirror endpoint

* fix: render Use this data outside unpublished ternary

* fix: make page unpublished flag authoritative

* fix: mark up commands and URLs, not sentences
* Add /llms.txt endpoint with tests

* Link llms.txt from the footer

* Fix llms.txt license claim, was off by 10x

* Give llms.txt search link a working q example

* Require v prefix on llms.txt version placeholder

* Un-link llms.txt dataset-page placeholder
* lib: add signposting link model and tests

* dataset: emit Signposting Link header and tags
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

@neuromechanist
neuromechanist merged commit 469d495 into staging Sep 3, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-284-epic-agent-readiness branch September 3, 2026 15:11
neuromechanist added a commit to nemarOrg/nemar-cli that referenced this pull request Sep 3, 2026
Closes the last warn-only gap in the wire-contract chain (#937 item 4).

The catalog latest_version check is now a hard assert: it was warn-only while #899 was in flight and the deployed backend still served bare 1.0.0, but that deploy landed long ago and all 7 rows on api-test.nemar.org now serve canonical vX.Y.Z, so the warning had nothing left to report.

The data-plane check was worse than warn-only, it was inert: it defaulted to nm099999, whose metadata.json is 404 on dev, and returned early on the 404, so it validated nothing and would have reported success however far the shape drifted. It now resolves a dataset that actually serves a data plane (TEST_DATA_DATASET, else the first anonymous catalog row, else the old default), throws instead of returning when there is nothing to validate, and hard-asserts the neuroschema envelope, which passes against every dataset dev serves.

Full JSON-Schema conformance stays warn-only because fixing the dataset selection surfaced three real drifts in the served data: publish_date is not RFC 3339 date-time, signal_defaults is not always an object, and ORCIDs are served bare where neuroschema declares format uri (the same mismatch found from the website side in nemarOrg/website#294). Filed as #1247; the warning names it.

Tested: bun run lint, bun run typecheck; the suite against api-test.nemar.org (6 pass, 0 fail, the #1247 warning emitted); skips correctly with no TEST_API_URL and against prod without TEST_ALLOW_PROD. Both new asserts mutation-proved: inverting the version filter fails the assert, and TEST_DATA_DATASET=nm099999 now throws where it used to pass silently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant