Skip to content

Phase 6: nemar.org llms.txt and a footer link - #293

Merged
neuromechanist merged 6 commits into
feature/issue-284-epic-agent-readinessfrom
feature/issue-289-phase6-website-llms
Sep 3, 2026
Merged

neuromechanist merged 6 commits into
feature/issue-284-epic-agent-readinessfrom
feature/issue-289-phase6-website-llms

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Adds a small /llms.txt on nemar.org and a footer link to it, the website half of phase 6 (issue #289).

src/lib/llms-txt.ts is a pure body builder: an H1 naming the site, a blockquote summary that states plainly the data is not hosted on nemar.org, then Data/API/Docs/Datasets/License sections of markdown links. src/pages/llms.txt.ts serves it as text/plain; charset=utf-8, unGated -- the same body on every host, since this route does no upstream fetch (unlike sitemap.xml.ts, which gates its catalog fan-out). Non-production hosts already carry Disallow: / and X-Robots-Tag: noindex, so there is nothing to hide and a second body would just be a second thing to keep correct.

Host resolution follows the established pattern: resolveDataBase/apiBase/resolveDocsBase (matching Footer.astro's Data column) resolve the data/api/docs hosts per build, and only the nemar.org links themselves are pinned to MARKETING_BASE_URL, mirroring how robots.ts pins its Sitemap directive.

The footer link lives in the existing Data column (the machine-surface group with data.nemar.org/api.nemar.org/docs.nemar.org) as a plain same-origin anchor, matching the ExternalLink-vs-plain-anchor convention already in that file. Its purpose is auditability, not crawling -- OSCAR parity means a human can read the same index a crawler would fetch.

llms.txt ships here as a cheap, no-regret addition, not a findability or SEO win. The evidence in nemar-cli's .context/research-agent-findability.md is that llms.txt sees close to no real use -- 97 percent of published files got zero requests in Ahrefs' measured month -- and Google has stated on the record that Search ignores it. It is shipped because it costs nothing to keep correct, not because it is expected to move any metric.

Constraint: descriptive only. Nothing here changes an API response shape, the Zarr index contract, the data.nemar.org layout, or any served field.

curl evidence

$ curl -sI http://localhost:4321/llms.txt | grep -iE '^HTTP|content-type'
HTTP/1.1 200 OK
content-type: text/plain; charset=utf-8

$ curl -s http://localhost:4321/llms.txt
# NEMAR

> The Neuroelectromagnetic Data Archive and Tools Resource (NEMAR) is a
> catalog and browser for neuroimaging datasets (EEG, MEG, iEEG, EMG, and
> more) in BIDS format. Dataset bytes are not hosted on nemar.org --
> they are served from data.nemar.org, described below.

## Data

- [data.nemar.org](https://data.nemar.org/): BIDS-shaped file access over HTTPS. A dataset's current release is served under `/<id>/latest/`; earlier releases are under `/<id>/<version>/`.

## API

- [api.nemar.org/datasets](https://api.nemar.org/datasets): paginated dataset catalog, JSON.
- [api.nemar.org/datasets/search](https://api.nemar.org/datasets/search): full-text and faceted dataset search, JSON.

## Docs

- [For agents](https://docs.nemar.org/platform/for-agents/): the data.nemar.org layout, API examples with curl, the CLI, and when to stream via Zarr instead of downloading.
- [Zarr contract](https://docs.nemar.org/platform/zarr/): the zarr.nemar.org index.json contract for streaming a single recording without a full download.

## Datasets

- [/dataset/<id>](https://nemar.org/dataset/<id>): server-rendered dataset page with a schema.org Dataset JSON-LD block in the page head; a markdown mirror is served at `/dataset/<id>.md`.

## License

Dataset licenses vary per dataset and are often non-commercial (for example CC-BY-NC-SA). Check each dataset's own license before reuse -- it is not the same across NEMAR.

$ curl -s http://localhost:4321/ | grep -o 'href="/llms.txt"'
href="/llms.txt"

Test plan

  • bun run lint -- clean, 241 files checked, 0 errors
  • bun run typecheck -- 246 files, 0 errors, 0 warnings (5 pre-existing hints unrelated to this change)
  • bun run test -- 65 test files, 1562 tests passed, including the new src/lib/llms-txt.test.ts (13 tests)
  • NEMAR_SKIP_OG_GENERATE=1 bun run build -- succeeds
  • curl evidence above, captured against bun run dev

llms.txt is a no-regret addition here, not a claimed findability or SEO win -- see the PR description above and the file's own doc comment for the evidence.

Part of #289
Part of epic #284

@cloudflare-workers-and-pages

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

Copy link
Copy Markdown

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Status update on the reviewer's docs/mirror flag:

At the time this PR was opened, docs.nemar.org/platform/for-agents/ did not
exist and the markdown mirror at /dataset/<id>.md was not served, so both
claims in llms.txt were aspirational rather than true.

Current state (verified live, 2026-09-03):

  • docs.nemar.org/platform/for-agents/ now returns 200 -- nemarOrg/docs#16
    merged as 145a2ab.
  • /dataset/<id>.md still 404s. It ships in website#291, which the epic lead
    is merging into the epic branch before this PR.

Both claims become true once #291 lands. Recording this explicitly so nobody
merges this PR ahead of #291 -- doing so would ship an llms.txt that
overclaims the markdown mirror again, exactly the class of bug the other
fixes in this PR address.

No code change needed for this; it resolves itself once #291 merges first.

@neuromechanist

Copy link
Copy Markdown
Contributor Author

Review addressed. All five findings acted on, in four commits aa06f8d..a3ed8a1.

Important, the license claim was wrong by an order of magnitude. The file said licenses "are often non-commercial". Measured across all 755 public datasets, independently twice with matching results: CC0 and the public-domain family is about 572 (roughly 76 percent), plain CC-BY about 120, and anything carrying a non-commercial or no-derivatives term about 38 (roughly 5 percent). CC0 outnumbers non-commercial by about 15 to 1. The wording was inherited from the OSCAR worked example, which described an older and more restrictive corpus. This mattered more than a normal wording nit because the file is a machine-read index an agent will treat as ground truth for reuse terms, and overcaution is still a wrong answer. The new wording says most are CC0 or CC-BY and a minority carry a non-commercial or no-derivatives term, and it deliberately avoids hard percentages so it stays true as the distribution drifts. The instruction to check each dataset's own license, which was the actionable part, is kept.

Important, a linked endpoint returned 400 when followed. api.nemar.org/datasets/search requires q; a bare GET answers 400. The link now carries a working ?q=EEG and the description states that q is required.

Moderate, a placeholder that silently 404s. Version paths were written /<id>/<version>/, but NEMAR version identifiers carry a v prefix. Confirmed directly: data.nemar.org/nm000281/v1.0.3/dataset_description.json resolves and .../1.0.3/... returns 404. An agent extracting the bare semver from a DOI suffix like nemar.nm000281.v1.0.4 would have substituted 1.0.4 and got nothing. Now written /<id>/v<version>/ with an explicit example and a note that the bare semver 404s.

Suggestion, a markdown link whose target always 404s. [/dataset/<id>](https://nemar.org/dataset/<id>) implied a resolvable target. It is now a code span, matching the convention the file already used two lines earlier for its own /<id>/latest/ placeholder. A test now asserts no <id>-style placeholder appears inside a link target, since that is the mechanical form of the mistake and it would otherwise recur.

Important, the merge-order dependency. Both claims that were untrue when this PR opened are now true. The docs For-agents page shipped (nemarOrg/docs#16, merged as 145a2ab) and returns 200. The markdown mirror shipped in #291, which merged into this epic branch as 465b176 before this PR. No code change was needed; the ordering was the fix, and it has happened.

Every URL in the generated body was re-fetched after the edits and all return 200, including the two docs pages that were not live when the review ran. The only 404 is the deliberate nemar.org/dataset/<id> placeholder, which is no longer expressed as a link.

Gates: lint clean, typecheck 0 errors, 1564 tests green across 65 files, and NEMAR_SKIP_OG_GENERATE=1 bun run build completes.

On re-review: rather than a second full review pass, I verified the rendered output myself end to end against the live hosts, which is the stronger check for a change that is entirely content in one pure module with tests. The body above is what /llms.txt actually serves, and the footer link renders.

@neuromechanist
neuromechanist merged commit c3b7084 into feature/issue-284-epic-agent-readiness Sep 3, 2026
5 checks passed
@neuromechanist
neuromechanist deleted the feature/issue-289-phase6-website-llms branch September 3, 2026 11:09
neuromechanist added a commit that referenced this pull request Sep 3, 2026
…lms.txt (#294)

* Phase 1: AI crawler tokens in robots.txt and a real-lastmod sitemap (#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

* Phase 2: server-rendered Use-this-data section and .md mirror (#291)

* 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

* Phase 6: nemar.org llms.txt and a footer link (#293)

* 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

* Phase 3: Signposting Link headers and link elements (#292)

* lib: add signposting link model and tests

* dataset: emit Signposting Link header and tags

* Rewrite Zarr recipe to be index-agnostic

* Correct the download facts and add a cd step

* Check value/note discipline in every section

* Cite the published version, not the selected one

* Number both references; soften sparse access

* Escape interpolated text in the .md mirror

* Validate ORCIDs and reject unsafe Link hrefs

* Strip a trailing slash from the .md alternate

* Split Applebot out and pin robots groups

* Cache robots and llms.txt; noindex the mirror

* Add route tests for the four new routes

* Cite sources for the routing and ORCID notes
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