Skip to content

feat(works): add Hume's Treatise and first Enquiry - #38

Merged
maehr merged 3 commits into
mainfrom
feat/hume
Aug 26, 2026
Merged

feat(works): add Hume's Treatise and first Enquiry#38
maehr merged 3 commits into
mainfrom
feat/hume

Conversation

@maehr

@maehr maehr commented Aug 26, 2026

Copy link
Copy Markdown
Member

Closes #34. Verified row from #25, part of #28.

Two works, two citation systems, one resolver provider.

Work System References
hume.enquiry-human-understanding hume-section-paragraph 255
hume.treatise hume-book-part-section-paragraph 1,213

Why this provider

Hume Texts Online (Peter Millican, Hertford College, Oxford) is the reference text the Hume Society supports, and it has the best control behaviour of any provider verified for #25: /texts/e/99, /texts/t/9/9/9 and /texts/zzz/1 all return a real HTTP 404. No degraded page, no wrong passage at 200.

It also prints each paragraph's own canonical citation next to the paragraph — "E 10.1, SBN 109", "T 1.3.6.4, SBN 88-9". So the anchor and the locator agree by construction, and a reviewer can check any reference by eye. As a side benefit the same pages carry the Selby-Bigge/Nidditch concordance, if SBN is ever wanted as an additional system.

Where the counts came from

Harvested from the site, not typed from memory.

  • Enquiry: the highest paragraph anchor on each of the 12 section pages. Verified at the boundary — on /texts/e/10 the id 41 is present and 42 is absent; the same check passed for sections 1, 3 and 12. Sum 255.
  • Treatise: walked /texts/t/{book}/{part}/{section} until the site returned 404, then read the highest paragraph anchor per page. Result is the canonical shape — 3 books, 10 parts (I.i–iv, II.i–iii, III.i–iii), 90 sections, 1,213 paragraphs.

Two Treatise sections came back implausibly short, so they were checked by hand rather than trusted: T 1.1.2 has exactly one paragraph (anchor 2 absent) and T 3.2.4 has exactly two (anchor 3 absent). Both are genuine — 1.1.2 is the famously brief "Division of the subject".

A modelling note

The compiler has no four-part range kind. The Treatise uses one book_chapter_verse block per book-and-part, with the book field carrying the {book}.{part} prefix (book: '1.3'). The expansion emits 1.3.6.4 directly, so no compiler change is needed — unlike the Qurʾān in #32, which is blocked on textrefs/textrefs.org#94 for exactly this kind of reason.

Identity

E vs EHU: the site's own siglum for the first Enquiry is E; the secondary literature mostly writes EHU. Both are seeded as alternative labels, along with First Enquiry and the 1748 title.

Wikidata was a trap worth recording. Searching the familiar title returns a book chapter, an edited volume and an all-caps duplicate in the top three — all editions, which AGENTS.md warns against mapping. The Work is Q1306656, filed under the 1748 title Philosophical Essays Concerning Human Understanding, with the familiar title as an alias and P50 = Q37160. The Treatise is Q2451675, a written work with the same author, not one of the several edition items sharing that title.

Provider courtesy — worth carrying into the link checker

My first harvesting pass fired about twenty rapid requests and davidhume.org started dropping connections (SSL handshake timeouts). A single request succeeded immediately afterwards, so it was my rate, not the site. Everything here was re-harvested at one request per 2 seconds with retries.

This is a small academic server. Whatever eventually link-checks the registry should be paced accordingly.

Checks

  • npm run compile:data — 14 works, 12 systems, 69,427 references; no dropped resolver targets
  • npm run validate:data — 69,481/69,481 records valid
  • Boundary spot-checks confirmed absent from the dump: 1.18, 3.4, 10.42, 12.35, 13.1 (Enquiry); 1.1.2.2, 3.2.4.3, 1.3.17.1, 1.5.1.1, 4.1.1.1, 1.1.1.13 (Treatise)

Copilot AI lite review requested due to automatic review settings August 26, 2026 06:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two David Hume works to the TextRefs registry with matching citation systems and resolver templates targeting Hume Texts Online, expanding the registry’s coverage of modern philosophy works with stable, paragraph-addressable reference spaces.

Changes:

  • Added hume.treatise and hume.enquiry-human-understanding works with mappings (Wikidata + Wikipedia), resolvers, and harvested references_range paragraph counts.
  • Introduced two new citation systems (hume-section-paragraph, hume-book-part-section-paragraph) with locator regexes and metadata.
  • Documented harvesting/verification notes inline (counts methodology, boundary checks, and resolver control 404s).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
works/hume.treatise.yaml New work entry for A Treatise of Human Nature with resolver + harvested reference ranges.
works/hume.enquiry-human-understanding.yaml New work entry for the first Enquiry with resolver + per-section paragraph counts.
systems/hume-section-paragraph.yaml New section+paragraph citation system for the first Enquiry.
systems/hume-book-part-section-paragraph.yaml New book+part+section+paragraph citation system for the Treatise.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread systems/hume-book-part-section-paragraph.yaml Outdated
maehr added a commit that referenced this pull request Aug 26, 2026
Copilot review on #38: the locator regex admitted 2.4.x.y and 3.4.x.y, which
are not parts of the Treatise. They would have failed only by going
unregistered, not by failing the shape check.

A leading lookahead pins the pairs that exist — 1.1-1.4, 2.1-2.3, 3.1-3.3 —
while keeping the named capture groups single and unduplicated, so URL
templating is unaffected.

Note this is deliberately stricter than the registry's usual convention, where
the regex is a shape check and bounds live in the registered references (see
`integer-section`, and `bekker` admitting pages up to 9999). Here the invalid
combinations are a small closed set, so pinning them costs nothing and is
better than deferring the error.

Refs #34

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CD9MxbT2jSZmJyR9ywJGEs
maehr and others added 3 commits August 26, 2026 09:23
…tion

Verified row from registry #25, tracked in #34.

Hume Texts Online (Peter Millican, Hertford College, Oxford) addresses the
Enquiry by section page with a per-paragraph anchor, and prints each
paragraph's own canonical citation next to it ("E 10.1, SBN 109"), so the
anchor and the locator agree by construction.

Checked 2026-08-26 with invalid controls: /texts/e/99, /texts/t/9/9/9 and
/texts/zzz/1 all return a real HTTP 404. That is the cleanest control
behaviour of any provider verified for #25.

The 12 paragraph counts were harvested from the site, not typed from memory,
and verified at the boundary: on /texts/e/10 the anchor id 41 is present and
42 is absent; the same check passed for sections 1, 3 and 12. Sum = 255.

Wikidata Q1306656 verified as the Work — "Philosophical Essays Concerning
Human Understanding", the 1748 title, with "An Enquiry Concerning Human
Understanding" among its aliases and P50 = Q37160 (David Hume). Most search
hits for this title are editions or book chapters, which the authoring rule
in AGENTS.md warns against.

Refs #34

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CD9MxbT2jSZmJyR9ywJGEs
…ation

Verified row from registry #25, tracked in #34.

Structure and paragraph counts were harvested from Hume Texts Online on
2026-08-26 by walking /texts/t/{book}/{part}/{section} until the site returned
404, then reading the highest paragraph anchor on each page. The result is the
canonical shape of the Treatise: 3 books, 10 parts (I.i-iv, II.i-iii,
III.i-iii), 90 sections, 1,213 paragraphs.

Two sections looked implausibly short, so they were checked by hand rather than
trusted: T 1.1.2 has exactly one paragraph (anchor id 2 absent) and T 3.2.4 has
exactly two (id 3 absent). Both are genuine.

The compiler has no four-part range kind, so this uses one book_chapter_verse
block per book-and-part with the `book` field carrying the `{book}.{part}`
prefix. The expansion emits book.part.section.paragraph directly, and no
compiler change is needed.

Wikidata Q2451675 verified as the Work — "A Treatise of Human Nature", a
written work with P50 = Q37160 (David Hume), not one of the several edition
items that share the title.

Refs #34

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CD9MxbT2jSZmJyR9ywJGEs
Copilot review on #38: the locator regex admitted 2.4.x.y and 3.4.x.y, which
are not parts of the Treatise. They would have failed only by going
unregistered, not by failing the shape check.

A leading lookahead pins the pairs that exist — 1.1-1.4, 2.1-2.3, 3.1-3.3 —
while keeping the named capture groups single and unduplicated, so URL
templating is unaffected.

Note this is deliberately stricter than the registry's usual convention, where
the regex is a shape check and bounds live in the registered references (see
`integer-section`, and `bekker` admitting pages up to 9999). Here the invalid
combinations are a small closed set, so pinning them costs nothing and is
better than deferring the error.

Refs #34

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CD9MxbT2jSZmJyR9ywJGEs
@maehr
maehr merged commit 559c628 into main Aug 26, 2026
4 checks passed
@maehr
maehr deleted the feat/hume branch August 26, 2026 07:24
maehr added a commit to textrefs/textrefs.org that referenced this pull request Aug 26, 2026
* chore(data): bump the registry pointer to 7d109195

Picks up the second-wave works verified against registry #25:

- textrefs/registry#39 — Dante, Divina Commedia (14,233 references), with the
  verse-level Princeton resolver and a canto-level Dante Lab companion
- textrefs/registry#38 — Hume, Treatise and first Enquiry (1,468 references)
- textrefs/registry#40 — eight Nietzsche works (2,737 references)

Closes registry #34, #36 and #37. The registry goes from 12 works to 23, and
from 67,959 references to 86,397.

npm run verify passes on the new pin: 86,477 records valid, 259,811 pages built,
all internal links valid.

* chore(deps): safe update of all dependencies within their semver ranges

`npm update` only. package.json is untouched; the lockfile moves seven packages
to the newest version their declared range already allows:

- @astrojs/starlight     0.41.7 -> 0.41.9
- @commitlint/cli        21.2.1 -> 21.2.2
- @commitlint/config-conventional 21.2.0 -> 21.2.2
- astro                   7.2.1 -> 7.2.7
- mermaid                11.16.1 -> 11.17.2
- starlight-openapi      0.26.0 -> 0.26.1
- uuid                   14.0.1 -> 14.0.2

Deliberately not taken, because neither is a safe update:

- starlight-blog 0.28.0 -> 0.29.0 is outside the declared range.
- typescript 6.0.3 -> 7.0.2 is a major.

Three high-severity advisories remain and are NOT fixed here. All three are the
same chain — form-data (CRLF injection) via httpsnippet via starlight-openapi —
and npm's only offered remedy is a DOWNGRADE of starlight-openapi to 0.24.0,
which it flags isSemVerMajor. `npm audit fix --force` would move the tree
backwards, so it was not run. starlight-openapi is a devDependency used to
render the API docs at build time; nothing in that chain reaches a published
page.

npm run verify passes: 86,477 records valid, 259,811 pages built, all internal
links valid.

---------

Co-authored-by: Moritz Mähr <14755525+maehr@users.noreply.github.com>
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.

data: add Hume's Treatise and first Enquiry, resolved by Hume Texts Online

2 participants