Replace all instances of "Sovereign Locally-trained Language Model" with "Situated Language Layer" across village-ai.html, all 3 architectural-alignment papers, and the EN locale file. Canonical definition: an architectural layer comprising a small language model that is sovereign (locally trained, locally deployed, community-controlled) and situated (shaped by the specific context, values, and vocabulary of the community it serves). Note: pre-existing inline-style CSP warnings in alignment paper licence sections (pandoc-generated) — not introduced by this commit. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
156 lines
10 KiB
JavaScript
156 lines
10 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Add Table of Contents and Glossary to the Taiuru mapping blog post
|
|
*
|
|
* Usage:
|
|
* node scripts/add-toc-glossary-taiuru.js # local dev DB
|
|
* node scripts/add-toc-glossary-taiuru.js mongodb://... # production DB
|
|
*/
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const MONGODB_URI = process.argv[2] || 'mongodb://localhost:27017/tractatus_dev';
|
|
const SLUG = 'kaupapa-maori-ai-framework-tractatus-mapping';
|
|
|
|
const tableOfContents = `
|
|
<nav id="table-of-contents" style="background: var(--bg-secondary, #f8fafc); border: 1px solid var(--border-color, #e2e8f0); border-radius: 0.5rem; padding: 1.5rem 2rem; margin-bottom: 2rem;">
|
|
<h2 style="margin-top: 0; font-size: 1.2rem;">Contents</h2>
|
|
<ol style="margin-bottom: 0; line-height: 1.8;">
|
|
<li><a href="#two-frameworks">Two Frameworks, Two Traditions, One Problem</a></li>
|
|
<li><a href="#he-tangata">He Tangata: The Person</a></li>
|
|
<li><a href="#he-karetao">He Karetao: The Puppet</a></li>
|
|
<li><a href="#guardian-agents">Guardian Agents: The Karetao's Accountability Mechanism</a></li>
|
|
<li><a href="#he-atarangi">He Ātārangi: The Shadow</a></li>
|
|
<li><a href="#steering-vectors">Steering Vectors, Polycentric Governance, and Cultural Weight</a></li>
|
|
<li><a href="#federation">Federation: From Village to Network</a></li>
|
|
<li><a href="#te-tiriti">Te Tiriti Principles and the Architecture</a></li>
|
|
<li><a href="#what-both-reveal">What Both Frameworks Reveal About Each Other</a></li>
|
|
<li><a href="#research-directions">Research Directions</a></li>
|
|
<li><a href="#legal-governance">The Legal Governance Layer: Kaitiakitanga Licence</a></li>
|
|
<li><a href="#economics">The Economics of Sovereign AI</a></li>
|
|
<li><a href="#gaps">Gaps</a></li>
|
|
<li><a href="#glossary">Glossary</a></li>
|
|
</ol>
|
|
</nav>
|
|
`;
|
|
|
|
const glossary = `
|
|
<hr style="margin: 3rem 0 2rem;">
|
|
<h2 id="glossary">Glossary</h2>
|
|
|
|
<h3>Te Reo Māori Terms</h3>
|
|
<dl style="line-height: 1.8;">
|
|
<dt><strong>Ātārangi</strong></dt><dd>Shadow or reflection. In Taiuru's framework, the third dimension of AI — AI is constituted entirely by human thought, language, and culture. The shadow carries something of the original.</dd>
|
|
<dt><strong>Hapū</strong></dt><dd>Sub-tribe or clan. A political and social unit within an iwi, typically comprising several whānau.</dd>
|
|
<dt><strong>He Tangata</strong></dt><dd>A person, a human being. In Taiuru's framework, the first dimension — AI presents as a person but meets none of the conditions of personhood in te ao Māori.</dd>
|
|
<dt><strong>Hui</strong></dt><dd>A gathering, meeting, or assembly for discussion and decision-making.</dd>
|
|
<dt><strong>Iwi</strong></dt><dd>Tribe or nation. The largest political unit in Māori society, comprising multiple hapū.</dd>
|
|
<dt><strong>Kaitiakitanga</strong></dt><dd>Guardianship, stewardship. The obligation to care for and protect something for future generations.</dd>
|
|
<dt><strong>Karetao</strong></dt><dd>Puppet or marionette. In Taiuru's framework, the second dimension — AI is animated by external forces (developers, operators, users) like a puppet by strings.</dd>
|
|
<dt><strong>Kaupapa Māori</strong></dt><dd>A Māori approach or philosophy. A framework grounded in Māori worldview, values, and practices.</dd>
|
|
<dt><strong>Kōrero</strong></dt><dd>Speech, discussion, conversation.</dd>
|
|
<dt><strong>Mana Motuhake</strong></dt><dd>Autonomous authority, self-determination. The right of Māori to control their own affairs.</dd>
|
|
<dt><strong>Marae</strong></dt><dd>A communal meeting ground and its buildings. The focal point of Māori community life.</dd>
|
|
<dt><strong>Mātauranga Māori</strong></dt><dd>Māori knowledge, wisdom, and understanding. The body of knowledge originating from Māori ancestors.</dd>
|
|
<dt><strong>Mauri</strong></dt><dd>Life force, vital essence. An essential quality of all things, both animate and inanimate.</dd>
|
|
<dt><strong>Noa</strong></dt><dd>Free from tapu, ordinary, unrestricted.</dd>
|
|
<dt><strong>Pūrākau</strong></dt><dd>Stories, narratives. Traditional and contemporary Māori storytelling.</dd>
|
|
<dt><strong>Rōpū</strong></dt><dd>Group, organisation, or collective.</dd>
|
|
<dt><strong>Taonga</strong></dt><dd>A treasured possession, something of value. Can be tangible (an artifact) or intangible (language, knowledge).</dd>
|
|
<dt><strong>Tapu</strong></dt><dd>Sacred, restricted, set apart. Indicates spiritual restriction and the need for respectful handling.</dd>
|
|
<dt><strong>Te Ao Māori</strong></dt><dd>The Māori world, worldview, and way of understanding reality.</dd>
|
|
<dt><strong>Te Tiriti o Waitangi</strong></dt><dd>The Treaty of Waitangi (1840). The founding document of New Zealand, establishing the relationship between Māori and the Crown.</dd>
|
|
<dt><strong>Tikanga</strong></dt><dd>Correct procedure, custom, protocol. The Māori way of doing things according to cultural values.</dd>
|
|
<dt><strong>Tino Rangatiratanga</strong></dt><dd>Absolute sovereignty, self-determination, autonomy. The right of Māori to govern their own affairs.</dd>
|
|
<dt><strong>Waka Hourua</strong></dt><dd>Double-hulled canoe. Used by Te Kāhui Raraunga as a governance model — two hulls (te ao Māori and Kāwanatanga) structurally independent, neither dominating, connected by a shared deck.</dd>
|
|
<dt><strong>Wānanga</strong></dt><dd>A forum for discussion, learning, and deliberation. An extended meeting for deep consideration of issues.</dd>
|
|
<dt><strong>Whakapapa</strong></dt><dd>Genealogy, lineage, identity. The network of relationships connecting people, ancestors, and the natural world.</dd>
|
|
<dt><strong>Whānau</strong></dt><dd>Extended family group. The foundational social unit in Māori society.</dd>
|
|
</dl>
|
|
|
|
<h3>Technical and Governance Terms</h3>
|
|
<dl style="line-height: 1.8;">
|
|
<dt><strong>CARE Principles</strong></dt><dd>Collective Benefit, Authority to Control, Responsibility, Ethics — principles for indigenous data governance developed by the Global Indigenous Data Alliance.</dd>
|
|
<dt><strong>Constitutional AI</strong></dt><dd>An approach to AI safety where behaviour is governed by a set of principles (a constitution) rather than case-by-case rules.</dd>
|
|
<dt><strong>Federation</strong></dt><dd>A system where independent communities form bilateral agreements to share specific capabilities while each retaining full sovereignty over their own data and governance.</dd>
|
|
<dt><strong>Guardian Agents</strong></dt><dd>Deterministic (non-AI) code that evaluates AI outputs before they reach community members. Four-phase system: evidence gathering, baseline comparison, classification, risk assessment.</dd>
|
|
<dt><strong>Koha</strong></dt><dd>A gift given with reciprocity. In the platform context, voluntary contributions without transaction fees.</dd>
|
|
<dt><strong>Metagovernance</strong></dt><dd>Governance of the governance system itself — ensuring that the mechanisms controlling AI are themselves accountable and auditable.</dd>
|
|
<dt><strong>OCAP Principles</strong></dt><dd>Ownership, Control, Access, Possession — First Nations (Canadian) principles asserting community-level authority over data.</dd>
|
|
<dt><strong>Polycentric Governance</strong></dt><dd>A governance model with multiple independent centres of authority (drawn from Elinor Ostrom's work), as opposed to a single hierarchical structure.</dd>
|
|
<dt><strong>Situated Language Layer (SLL)</strong></dt><dd>Product-type-specific AI model fine-tuning. Each community type gets an AI tuned to its domain knowledge and vocabulary.</dd>
|
|
<dt><strong>Steering Vectors</strong></dt><dd>Mathematical adjustments applied to an AI model's internal representations during inference, shaping how it processes concepts at the embedding layer. Only possible with sovereign model hosting.</dd>
|
|
<dt><strong>Steering Packs</strong></dt><dd>Versioned governance artefacts published by steering authorities. Can contain system prompt additions, cultural boundary sets, or activation vectors that shape AI behaviour.</dd>
|
|
<dt><strong>Tractatus Framework</strong></dt><dd>An architectural framework for AI governance developed by My Digital Sovereignty Ltd. Enforces governance structurally through boundary enforcement, mathematical verification, and layered accountability. Published under Apache 2.0.</dd>
|
|
</dl>
|
|
`;
|
|
|
|
// Section heading ID mapping
|
|
const headingIds = {
|
|
'Two Frameworks, Two Traditions, One Problem': 'two-frameworks',
|
|
'He Tangata: The Person': 'he-tangata',
|
|
'He Karetao: The Puppet': 'he-karetao',
|
|
'Guardian Agents: The Karetao\'s Accountability Mechanism': 'guardian-agents',
|
|
'He Ātārangi: The Shadow': 'he-atarangi',
|
|
'Steering Vectors, Polycentric Governance, and Cultural Weight': 'steering-vectors',
|
|
'Federation: From Village to Network': 'federation',
|
|
'Te Tiriti Principles and the Architecture': 'te-tiriti',
|
|
'What Both Frameworks Reveal About Each Other': 'what-both-reveal',
|
|
'Research Directions': 'research-directions',
|
|
'The Legal Governance Layer: Kaitiakitanga Licence': 'legal-governance',
|
|
'The Economics of Sovereign AI: Training, Inference, and Value': 'economics',
|
|
'What Remains Genuinely Missing': 'gaps',
|
|
'Gaps': 'gaps'
|
|
};
|
|
|
|
async function main() {
|
|
await mongoose.connect(MONGODB_URI);
|
|
console.log('Connected to:', MONGODB_URI);
|
|
|
|
const db = mongoose.connection.db;
|
|
const post = await db.collection('blog_posts').findOne({ slug: SLUG });
|
|
|
|
if (!post) {
|
|
console.error('Blog post not found:', SLUG);
|
|
process.exit(1);
|
|
}
|
|
|
|
console.log('Found:', post.title);
|
|
console.log('Content length:', (post.content || '').length);
|
|
|
|
let content = post.content || '';
|
|
|
|
// Check if already applied
|
|
if (content.includes('id="table-of-contents"')) {
|
|
console.log('ToC already present. Skipping.');
|
|
await mongoose.disconnect();
|
|
return;
|
|
}
|
|
|
|
// Add section IDs to headings
|
|
for (const [heading, id] of Object.entries(headingIds)) {
|
|
// Match <h2>heading text</h2> and add id attribute
|
|
const escaped = heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
const regex = new RegExp(`<h2>(${escaped})</h2>`, 'gi');
|
|
content = content.replace(regex, `<h2 id="${id}">$1</h2>`);
|
|
}
|
|
|
|
// Add ToC at start, glossary at end
|
|
content = tableOfContents + '\n' + content + '\n' + glossary;
|
|
|
|
await db.collection('blog_posts').updateOne(
|
|
{ _id: post._id },
|
|
{ $set: { content, updatedAt: new Date() } }
|
|
);
|
|
|
|
console.log('Updated. New content length:', content.length);
|
|
console.log('ToC: added');
|
|
console.log('Glossary: added');
|
|
console.log('Section IDs: added to headings');
|
|
|
|
await mongoose.disconnect();
|
|
console.log('Done.');
|
|
}
|
|
|
|
main().catch(err => { console.error(err); process.exit(1); });
|