Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
*.ico binary
*.webp binary
*.mp4 binary
*.ttf binary
4 changes: 3 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ jobs:
- name: Build release from source
run: python -B tools/build_release.py
- name: Check public site links and fictional demo parity
run: python -B tools/check_site.py
run: python -B tools/check_site.py
- name: Exercise homepage evidence selection and fallback
run: node tools/test_evidence_board.cjs
127 changes: 127 additions & 0 deletions docs/assets/evidence-board.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
(function (root, factory) {
'use strict';
const api = factory();
if (typeof module === 'object' && module.exports) module.exports = api;
if (root && root.document) {
const document = root.document;
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function () {
api.initEvidenceBoard(document);
}, { once: true });
} else {
api.initEvidenceBoard(document);
}
}
}(typeof globalThis !== 'undefined' ? globalThis : this, function () {
'use strict';

const records = Object.freeze({
award: Object.freeze({
id: 'award',
edge: 'e-grant',
nodes: Object.freeze(['cobalt', 'meridian']),
announcement: 'The award notice: Cobalt Foundation awarded a research grant to Meridian Institute.'
}),
agreement: Object.freeze({
id: 'agreement',
edge: 'e-approval',
nodes: Object.freeze(['cobalt', 'brief']),
announcement: 'The signed agreement: Cobalt Foundation holds approval rights over the funded policy brief.'
}),
revision: Object.freeze({
id: 'revision',
edge: 'e-leo-revisions',
nodes: Object.freeze(['leo', 'brief']),
announcement: 'The revision register: Leo Venn requested in-scope revisions to the funded policy brief.'
})
});
const edgeIds = ['e-grant', 'e-approval', 'e-leo-revisions', 'e-direction'];
const nodeIds = ['cobalt', 'meridian', 'leo', 'brief', 'astera'];
const controllers = new WeakMap();

function getRecord(id) {
return typeof id === 'string' && Object.prototype.hasOwnProperty.call(records, id)
? records[id] : null;
}

function unique(scope, selector) {
const matches = scope.querySelectorAll(selector);
return matches.length === 1 ? matches[0] : null;
}

function initEvidenceBoard(document) {
if (!document || typeof document.querySelectorAll !== 'function') return null;
const board = unique(document, '#evidence-board');
if (!board) return null;
if (controllers.has(board)) return controllers.get(board);

// Resolve the whole contract before changing the readable HTML fallback.
const controls = unique(board, '[data-record-controls]');
const announcement = unique(board, '[data-record-announcement]');
if (!controls || !announcement) return null;
const entries = Object.keys(records).map(function (id) {
return {
record: records[id],
article: unique(board, '[data-record="' + id + '"]'),
button: unique(controls, '[data-select-record="' + id + '"]')
};
});
const edges = edgeIds.map(function (id) {
return { id: id, element: unique(board, '[data-edge="' + id + '"]') };
});
const nodes = nodeIds.map(function (id) {
return { id: id, element: unique(board, '[data-node="' + id + '"]') };
});
const validEntries = entries.every(function (entry) {
return entry.article && entry.button &&
entry.article.tagName.toLowerCase() === 'article' &&
entry.button.tagName.toLowerCase() === 'button' &&
entry.article.id === 'record-' + entry.record.id &&
entry.button.getAttribute('aria-controls') === entry.article.id;
});
if (!validEntries || !edges.every(function (edge) { return edge.element; }) ||
!nodes.every(function (node) { return node.element; }) ||
board.querySelectorAll('[data-record]').length !== entries.length ||
controls.querySelectorAll('[data-select-record]').length !== entries.length ||
announcement.getAttribute('role') !== 'status' ||
announcement.getAttribute('aria-live') !== 'polite' ||
entries.some(function (entry) { return entry.article.contains(announcement); })) return null;

let selectedId = null;
function select(id, fromUser) {
const record = getRecord(id);
if (!record) return false;
if (selectedId === id) return true;
entries.forEach(function (entry) {
const active = entry.record.id === id;
entry.article.hidden = !active;
entry.button.setAttribute('aria-pressed', String(active));
});
edges.forEach(function (edge) {
edge.element.classList.toggle('is-active', edge.id === record.edge);
});
nodes.forEach(function (node) {
node.element.classList.toggle('is-active', record.nodes.indexOf(node.id) !== -1);
});
selectedId = id;
if (fromUser) announcement.textContent = record.announcement;
return true;
}

entries.forEach(function (entry) {
// Native button activation supplies keyboard behavior and retains focus.
entry.button.addEventListener('click', function () { select(entry.record.id, true); });
});
select('award', false);
board.classList.add('is-enhanced');
controls.hidden = false;
const controller = Object.freeze({
select: function (id) { return select(id, false); },
get selectedId() { return selectedId; }
});
controllers.set(board, controller);
return controller;
}

return Object.freeze({ getRecord: getRecord, initEvidenceBoard: initEvidenceBoard });
}));
Binary file added docs/assets/fonts/BarlowCondensed-SemiBold.ttf
Binary file not shown.
Binary file added docs/assets/fonts/BebasNeue-Regular.ttf
Binary file not shown.
93 changes: 93 additions & 0 deletions docs/assets/fonts/OFL-Barlow-Condensed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2017 The Barlow Project Authors (https://github.com/jpt/barlow)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
93 changes: 93 additions & 0 deletions docs/assets/fonts/OFL-Bebas-Neue.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright © 2010 by Dharma Type.

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
30 changes: 30 additions & 0 deletions docs/assets/fonts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Self-hosted fonts

RED THREADS serves these fonts locally. They are original, unmodified TTF files from the official [Google Fonts repository](https://github.com/google/fonts/tree/5e35378e6bda803962ee6fd257e444a7d459660d), downloaded on 2026-09-08. No font service is contacted at runtime.

| Font | Use | Version | Weight | Size | Source | License notice |
| --- | --- | --- | --- | --- | --- | --- |
| Bebas Neue Regular | Display lettering | 2.000 | 400 | 61,400 bytes | [Original TTF](https://github.com/google/fonts/blob/5e35378e6bda803962ee6fd257e444a7d459660d/ofl/bebasneue/BebasNeue-Regular.ttf) | [OFL-Bebas-Neue.txt](OFL-Bebas-Neue.txt) |
| Barlow Condensed SemiBold | Headings | 1.408 | 600 | 109,428 bytes | [Original TTF](https://github.com/google/fonts/blob/5e35378e6bda803962ee6fd257e444a7d459660d/ofl/barlowcondensed/BarlowCondensed-SemiBold.ttf) | [OFL-Barlow-Condensed.txt](OFL-Barlow-Condensed.txt) |

Both families use the SIL Open Font License 1.1. The full upstream copyright and license notices accompany the fonts with their wording preserved (line endings and trailing whitespace normalized), from [Bebas Neue's OFL.txt](https://github.com/google/fonts/blob/5e35378e6bda803962ee6fd257e444a7d459660d/ofl/bebasneue/OFL.txt) and [Barlow Condensed's OFL.txt](https://github.com/google/fonts/blob/5e35378e6bda803962ee6fd257e444a7d459660d/ofl/barlowcondensed/OFL.txt). Font metadata, names, glyphs, and embedded copyright notices are preserved. These font licenses remain separate from the surrounding project's license.

The TTF files retain the upstream character coverage. No local font installation, external stylesheet, or conversion is required. For CSS in `docs/assets/site.css`, use:

```css
@font-face {
font-family: "Bebas Neue";
src: url("./fonts/BebasNeue-Regular.ttf") format("truetype");
font-style: normal;
font-weight: 400;
font-display: swap;
}

@font-face {
font-family: "Barlow Condensed";
src: url("./fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
font-style: normal;
font-weight: 600;
font-display: swap;
}
```
Loading