Critical code studies · version 1.9.8

bench-kit

The shared modules of the research benches: static websites for reading, collating and annotating the versions of a program's source code, or of a text, with a group.

1.9.8Current release
217Releases since 11 October 2026
59JavaScript modules
26,398Lines of JavaScript
6Repositories its CI tests on each push
821Kit tests passed in bench-template
01

What it is

bench-kit is the plain JavaScript and CSS that the research benches for SHRDLU, Spacewar!, ELIZA and Melville share, and the translation bench for Kuki Shūzō's Gūzensei no mondai: each version of a program or text set out line by line, any two collated, their descent drawn as a stemma, and annotations kept in a private Hypothesis group. A bench includes the kit as a git submodule, gives its own names, sources and language in a configuration file, and is served as a static site by GitHub Pages, with no build step and nothing to install.

Read

Each version's files as held, with search, highlighting, a citation for any line or range, a reading edition, and export to Word and Markdown.

Collate

Two versions as text, routine by routine, or definition by definition where both are Lisp.

Genealogy

A stemma of the versions, and flows and trees of what each keeps from its parent, moves, edits or drops.

Book

A text whose reader gives its structure (TEI, say) set as pages beside their images, with a slider through the stages of revision, and highlight links between the words and their places on the page (section 06).

Annotation

Through a private Hypothesis group, with replies and reactions; an annotation shows as a ghost on the matching lines of other versions.

Paratexts

Scans, documents and recordings in a private GitHub repository, catalogued in Dublin Core and arranged in collections and sequences.

Implementations

A catalogue of a program's copies, ports and reimplementations, drawn as a tree with the evidence for each line of descent.

References

A short reference for every version and file, and a Software Heritage identifier for each source.

Library

The secondary literature as covers, a list, a gallery or a card catalogue, with ratings, key works, relevance and tags kept in the group, and a To read shelf of book cards for each reader (section 05).

Translation

A translation's text beside its source page by page, its glossary as a concordance, its change lists checked against the text, and its file edited in a box that is locked until opened.

02

Quick start

A new bench starts from bench-template, which runs on an invented example (two versions of a small Python program and a lost first sketch) with the kit in place.

Prerequisites

Steps

  1. On GitHub, open bench-template and choose Use this template to make a repository of your own.
  2. Clone it with the kit, and serve the repository's folder (not research/):
TerminalYour repository
git clone --recurse-submodules https://github.com/YOUR-ORG/YOUR-BENCH
cd YOUR-BENCH
python3 -m http.server 8000
  1. Open http://localhost:8000/research/.
  2. Replace the example: the sources under source/ (a folder for each version), the versions and their descent in research/js/versions.js, the names, language and references in research/js/config.js. The template's README takes each file in turn; the kit's README lists every setting.
  3. On GitHub, turn on Pages (Settings ▸ Pages, the main branch, root). The bench is then at https://YOUR-ORG.github.io/YOUR-BENCH/research/.

To look before making a repository, clone the template itself: git clone --recurse-submodules https://github.com/critical-code-studies/bench-template.

03

Usage

The tests and the views were run on a fresh clone of bench-template 0.1.165 (bench-kit 1.8.28) on 9 November 2026, the server on bench-template 0.1.99 on 27 October 2026; the output is as printed.

Serve a bench and open it

Terminalbench-template
python3 -m http.server 8000
::1 - - [27/Oct/2026 14:11:56] "GET /research/ HTTP/1.1" 200 -

The browser at http://localhost:8000/research/ shows Read on the example's version 2 (the first screenshot in 04).

Run the kit's tests in a bench

The kit's tests run in the bench's own page, in headless Chrome, so they check the kit with the bench's settings and versions. From the repository's folder:

Terminalbench-template
node research/kit/tools/test.js
tests/annotations.html: 806 passed

Open every view, with this bench's kit or another

tools/views.js opens each view in turn and fails on one that throws, draws nothing, or shows that it could not load. With --kit it serves a kit from another folder in place of the bench's own, so a kit change can be tried in a bench without changing the bench.

Terminalbench-template
node research/kit/tools/views.js
Example Research Bench 0.1.165, kit 1.8.28
  ✓ read
  ✓ analyse
  ✓ functional
  ✓ compare
  ✓ genealogy
  ✓ about
  ✓ findings
  ✓ notes
# with a kit checked out beside the bench:
node research/kit/tools/views.js --kit ../bench-kit

The kit's own workflow runs both tools in all six repositories (the five benches and the template) on every push.

04

Screenshots

Every bench has the colour themes of ⚙ Settings ▸ Display, four dark and three light; the ◐ button switches between the last of each.

bench-template's Read view in the dark Phosphor theme: wordfreq.py of version 2, 29 lines, with line numbers and the Python highlighted.
bench-template, Read, dark (Phosphor). The example's wordfreq.py, version 2.bench-template 0.1.99, bench-kit 0.81.0 · 27 October 2026
The same Read view in the light Paper theme.
bench-template, Read, light (Paper). The same file.bench-template 0.1.99, bench-kit 0.81.0 · 27 October 2026
The Spacewar! bench's Run view: two ships and the central star on the round scope of an emulated PDP-1, beside the Macro source with the line being executed highlighted.
Spacewar!, Run. Spacewar! 3.1 (24 September 1962) assembled from its source and running on an emulated PDP-1, the listing following the program counter.Spacewar! 1.19.64, bench-kit 0.66.3 · 21 October 2026
The Spacewar! bench's Collate view: two texts of Spacewar! 3.1 side by side, unchanged runs folded, a changed line marked.
Spacewar!, Collate. Two witnesses of Spacewar! 3.1; 98 per cent of their lines are shared.Spacewar! 1.19.64, bench-kit 0.66.3 · 21 October 2026
The SHRDLU bench's Graphics tab: the blocks world in three dimensions, green, red and blue blocks, two pyramids and a box holding a pyramid.
SHRDLU, Graphics. The blocks world drawn from the program's data file: shape and colour from DISPLAY-AS, place and size from ATABLE.SHRDLU 0.1.191, bench-kit 0.69.0 · 21 October 2026
The SHRDLU bench's Read view: plnr.182, Micro-Planner source in MacLisp, with line numbers and a repairs stepper in the toolbar.
SHRDLU, Read. plnr.182, Micro-Planner written in MacLisp, in the MIT files as found on ITS, with the stepper (◆) through the version's repairs in the toolbar.SHRDLU 0.1.191, bench-kit 0.69.0 · 21 October 2026
The ELIZA bench's Implementations tree: families of implementations as lanes, from the MAD-SLIP source through Cosell's DOCTOR to the BASIC versions, with lines of descent.
ELIZA, Implementations. The descent of ELIZA's implementations by family and date: solid lines established, dashed probable, dotted possible.ELIZA 0.1.91, bench-kit 0.69.0 · 21 October 2026
The ELIZA bench's Read view: the MAD-SLIP source of ELIZA 1965b with card sequence numbers in the right margin.
ELIZA, Read. ELIZA 1965b in MAD-SLIP, with the card sequence numbers of the original deck.ELIZA 0.1.91, bench-kit 0.69.0 · 21 October 2026
The Melville bench's Book view: a leaf of the Billy Budd manuscript with every revision shown, additions raised and coloured, deletions struck through, the leaf's image on the right.
Melville, Book. A leaf of the Billy Budd manuscript with every revision shown: additions raised, deletions struck, coloured by hand.Melville 0.1.17, bench-kit 0.74.3 · 22 October 2026
The Melville bench's Book view with Compare: the manuscript at stage Fa facing MEL's reading text at the same leaf.
Melville, Book with Compare. The manuscript at stage Fa facing MEL's reading text. Text: Melville Electronic Library, Versions of Billy Budd. Leaf images: Houghton Library, Harvard University, MS Am 188 (363).Melville 0.1.17, bench-kit 0.74.3 · 22 October 2026
05

The Library

The Library tab (library.js) holds the secondary literature on a project: books, articles, chapters, theses, talks, podcasts, films and web pages, each a record in the bench's library.json, with the file where the bench or the group holds one and a link where the work is published. Members of the bench's Hypothesis group rate works, mark key works, set each work's relevance, tag it and write notes on it; a published snapshot shows the ratings, marks and tags to readers with no token. The figures below are from the ELIZA bench, which lists 1,146 works. The Library guide covers setting it up, the manifest's fields and the tools.

The Library as covers on a shelf: key works first, each cover drawn by kind or from an image of the work, with its author, year and whether the bench holds it below; the filters on the left, closed.
Covers. Ordered by relevance, key works first. A cover is drawn from the work's kind, or is an image of the work; a rating shows as stars on it. The filters (kind, relevance, language, rating, decade, author, tag) stand beside the shelf, and the funnel on the bar shows or hides them.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
The Library as a list: each work's title, author, year, kind, its relevance as a label and its Key Work mark.
List. The same works as lines, each with its Key Work mark, its relevance (Essential in red, High, Medium, Low, Minimal) and the group's stars.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
The gallery: a list of works on the left with key work, relevance and stars, and the chosen work's box on the right with its cover, citation and record.
Gallery. The works on the left and the chosen one's box on the right, as a file browser's preview. The arrow keys move through the list; the works on either side are fetched ahead.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
The card catalogue: fifteen wooden drawers with brass plates naming their first and last authors, one pulled out with its front card typed and the tabs of the cards behind it.
Card catalogue. About fifteen drawers made from the list as it stands, by author, title, subject or relevance. A drawer pulled out shows its cards, the front one typed in full; the arrow keys flick through.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
A work's box: its code and Key Work mark, the actions, the cover, the citation with Copy, the record, and the book itself playing from the Internet Archive below.
A work's box. Weizenbaum's Computer Power and Human Reason: the citation in Cite Them Right Harvard, the record, and the book from the Internet Archive below. Open, Share, Export for Zotero and To read sit in a row; Add note opens the group's notes on the work beside it.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
The To read shelf: four book cards, each with a call number, code, author and title, and lines for each loan with the date loaned, the borrower's name and the date due; one card stamped Due soon, one with a white sticker over its full lines.
To read. A reader's own shelf, as the book cards once kept in a book's pocket: a line for each loan and renewal in its own pen and stamp. A card due within the week is stamped DUE SOON; a full card takes a white sticker over its old lines, which show faintly through and open in full when clicked. The loans here are examples.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
A book card turned over: two notes on the work written by hand on its ruled back, each signed and dated, and Add Annotation at its foot.
The back of a card. Turned with ↻, a card carries the group's notes on the work, in the order they were written. The notes here are examples.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
The reader's library card in Settings: the bench's name over a red ground with an open-book seal and LIBRARY CARD, the reader's number, initials and name embossed; and its back, giving the holder, the card number, the bench, the group and the repository.
Settings ▸ Library. The reader's library card, after a 1960s student card, and its back. The same tab sets how book cards are signed and when a loan is due soon, and has Wipe my loan history. The name here is an example.ELIZA 0.2.2, bench-kit 1.8.28 · 9 November 2026
06

Book

Book (book.js) sets a version's text as pages beside their images. A highlight link ties words of the text to their place on the page's image: the words under the pointer are lit on the image, a place on the image lights its words, and a click on either holds both until the next click. Text selected lights every place it runs over. A bench sets the links' colour (doc.linkColor); a reader can choose their own, or turn the links off, in Settings ▸ Book.

The places come from the bench's data, in one of three forms. A document that gives the boxes its revisions are written in (doc.zones) ties each revision to its box. A page break that gives its lines (pb.lines) ties each line of the text to a band on the image, as the Melville bench does for the manuscript of Billy Budd. For a text whose lines are not the page's, such as a translation read beside its source, a support file gives each page's passages (doc.regions): the boxes a passage takes on the image and the words of the text it holds. Book finds those words in the text as it is set, so the file keeps no line numbers and follows the text when it is edited elsewhere. The Kuki bench has 2,754 such places on 330 pages, one for each sentence of the translation or its part on a page, all marked as estimated. The README gives the file's fields.

While a passage's highlight link is held, Share highlight makes a picture of the page with the place marked and the passage beside it, with the bench's citation (doc.shareCite) and the image's credit. Copy link gives a link that opens Book with the same highlight held. Email… hands the picture and the passage to the system's sharing where the browser can pass a file, and elsewhere starts a message with the passage and the link and copies the picture to paste in. Download PNG and Copy PNG give the picture. Share page is the link to Book as it is set.

Where a version has stages of revision, the slider shows the text at a stage and “every revision” shows them all at once; moving the slider, or ◀ ▶, turns “every revision” off. On a translation bench, Edit (vt-edit.js) sets the file's text in a box of its own, greyed while locked and white once its padlock is opened.

The Melville bench's Book: four lines of the manuscript's text selected on the left, and the bands of those lines lit on the leaf's image on the right.
Melville, lines. Four lines of the manuscript’s text selected, and the band of each lit on the leaf beside it. A band under the pointer lights its line in the text, and a click holds it. Text: Melville Electronic Library, Versions of Billy Budd. Leaf images: Houghton Library, Harvard University, MS Am 188 (363).Melville 0.4.30, bench-kit 1.9.8 · 12 November 2026
The Melville bench's Book with the stage slider at stage C b, the twelfth of thirty-three, and every revision unticked.
Melville, stages. The slider at stage C b, the twelfth of thirty-three. With every revision shown the slider is drawn fainter; moving it turns every revision off and shows the text at the stage. Text: Melville Electronic Library, Versions of Billy Budd. Leaf images: Houghton Library, Harvard University, MS Am 188 (363).Melville 0.4.30, bench-kit 1.9.8 · 12 November 2026
The Kuki bench's Pages view at page 81: a sentence of the translation marked in the text, and its four columns filled on the image of the 1948 page.
Kuki, a passage held. A sentence of the translation clicked on p. 81, and its columns filled on the page of the 1948 printing. The bench estimates each place from the sentence’s share of the page’s text. Page image: 国立国会図書館 National Diet Library, Japan, pid 1037966 (public domain).Kuki 0.2.41, bench-kit 1.9.8 · 12 November 2026
The Share highlight dialog on the Kuki bench: the picture, the citation, and the buttons Copy link, Email, Download PNG and Copy PNG.
Share highlight. The dialog for the passage held: the picture, the bench’s citation, and Copy link, Email…, Download PNG and Copy PNG. Page image: 国立国会図書館 National Diet Library, Japan, pid 1037966 (public domain).Kuki 0.2.41, bench-kit 1.9.8 · 12 November 2026
The picture Share highlight makes: the 1948 page with the passage's columns filled, the passage in English beside it, the citation, the bench's name and the library's credit.
The picture sent. The page with the place marked, the passage, the bench’s citation, the image’s credit and, for an estimated place, a line saying so. Shown reduced; the file is 1,400 pixels wide. Page image: 国立国会図書館 National Diet Library, Japan, pid 1037966 (public domain).Kuki 0.2.41, bench-kit 1.9.8 · 12 November 2026
The Kuki bench's Edit view, locked: the translation's Markdown in a greyed box with a padlock at its head, the page's image beside it.
Edit, locked. The translation’s file as written (Markdown) in a greyed box. The padlock at the box’s head, or the one in the toolbar, unlocks it. Page image: 国立国会図書館 National Diet Library, Japan, pid 1037966 (public domain).Kuki 0.2.41, bench-kit 1.9.8 · 12 November 2026
The Kuki bench's Edit view, unlocked: the same box white, with an edge in the bench's accent.
Edit, unlocked. The same box white, with an edge in the bench’s accent, open for editing. Page image: 国立国会図書館 National Diet Library, Japan, pid 1037966 (public domain).Kuki 0.2.41, bench-kit 1.9.8 · 12 November 2026
Settings, Book, on the Kuki bench: the page with its trim frame and the four sides beside it, and Highlight links with a switch, a colour and a sample.
Settings ▸ Book. The pages’ edges, trimmed by dragging an edge or by percentage, and Highlight links: a switch, a colour and the bench’s default. Page image: 国立国会図書館 National Diet Library, Japan, pid 1037966 (public domain).Kuki 0.2.41, bench-kit 1.9.8 · 12 November 2026
07

Configuration and tokens

A bench has no server, no environment variables and no API keys of its own. Its settings are in research/js/config.js, read by the browser. Two services take a personal token, and both are optional: without them a bench reads, collates and draws as usual, keeps annotations as drafts in the browser, and does not open the paratext archive.

Each person pastes their own token into ⚙ Settings. It is kept in that browser's localStorage, under the bench's storage prefix (store in config.js), and is left out of Help ▸ Back up my data. Nothing is sent anywhere but the service it belongs to.

Hypothesis API token, for shared annotations

Provider
Hypothesis. An account is free.
Get it
Signed in, at hypothes.is/account/developer, where Hypothesis makes and shows your token.
Where it goes
⚙ Settings ▸ Annotations: the group link from your invitation in Group link or ID (it is reduced to the ID), the token in API token. Stored as <store>group and <store>token.
Bench setting
The private group's ID, as the default for everyone, in config.js; members join through the bench's invitation (Help ▸ Annotating and sharing ▸ Getting set up).
research/js/config.jsexample
group: 'AbC123xy',      // the private Hypothesis group's ID

To check it: Settings ▸ Annotations ▸ Test connection. A working token and group give Connected as acct:NAME@hypothes.is; group “GROUP” found.

MessageWhat it means
The token was not accepted.Hypothesis does not know the token (it answers as for a visitor who is not signed in): it was mistyped, revoked or replaced. Generate a new one and paste it again.
Connected as acct:NAME@hypothes.is; but that group was not found for this account.The token works, but the account is not a member of the group in Settings: accept the invitation, or check the group ID.
Hypothesis 4xx: …Any other refusal, with the first part of Hypothesis's own reply.

GitHub fine-grained token, for the paratext archive

Provider
GitHub. Free; the archive is a private repository the bench names, and each member must be given access to it.
Get it
Settings ▸ Paratexts ▸ Open the token form. The bench opens github.com/settings/personal-access-tokens/new with the name, owner, a year's expiry and Contents (read and write) filled in; choose Only select repositories and the archive by hand.
Where it goes
⚙ Settings ▸ Paratexts ▸ GitHub token. Stored as <store>gh.token.
Bench setting
The archive's owner and repository, and the name of the browser cache, in config.js.
Limits
GitHub allows an authenticated user 5,000 REST requests an hour; without a token it is 60. The bench caches the catalogue and files it has fetched in the browser.
research/js/config.jsexample
paratexts: { org: 'YOUR-ORG', repo: 'your-bench_paratexts', cache: 'your-bench-paratexts' },

To check it: open the Paratexts tab; with a working token the catalogue loads. The token is read and write, so give the steps (Settings ▸ Paratexts ▸ Copy the steps to send) only to people who are to catalogue.

MessageWhat it means
The GitHub token was refused: check it in ⚙ Settings.HTTP 401: the token is wrong, revoked or expired.
GitHub refused: the token may lack write access to OWNER/REPO, or the rate limit is reached.HTTP 403: the token was made without Contents read and write, or the hourly limit is used up.
Not found: the token may not reach OWNER/REPO (ask to be added to the crew).HTTP 404: the archive was not chosen under Only select repositories, or the account has no access to it.

Local and deployed

Browsers keep localStorage for each origin, so http://localhost:8000 and https://YOUR-ORG.github.io hold separate settings: a token pasted while testing locally has to be pasted again on the published bench. The same token works in both. Safari clears a site's stored data after seven days without a visit; the token then has to be pasted again, or a new one made if it was not kept.

Settings ▸ Bench

Since 0.81.0 a bench whose config.js says editable: true, and which loads kit/project.js straight after js/config.js, lets its user set the name, title, citation, references and language in ⚙ Settings ▸ Bench. The GitHub locations there (the repository, the published address, the paratext archive) are locked once set: changing one takes Unlock, with a warning, and the new value typed a second time, and each change is logged with Put back. bench-template loads project.js with editable: false.

08

Troubleshooting

The FAQ answers wider questions: what a bench is, joining a group, where notes are kept, tokens, and highlight links.