import { readFile, lstat } from 'node:fs/promises'; import { join } from 'node:path'; import { codeRoot, noSymlinks } from '../evidence/src/filesystem.mjs'; import { sha256 } from '../evidence/src/json.mjs'; // Explicit build/layout scope: no recursive repository capture or content/config export. const sourcePaths=[ 'sites/tech/src/pages.mjs','sites/tech/src/cards.mjs','sites/tech/src/library.mjs','sites/tech/src/release-snapshot.mjs', 'sites/tech/static/style.css','sites/tech/static/cards.css','sites/tech/package.json','sites/tech/package-lock.json', 'tools/site-release/package.mjs','tools/site-release/source-materials.mjs', 'tools/evidence/src/filesystem.mjs','tools/evidence/src/paths.mjs','tools/evidence/src/json.mjs','tools/evidence/src/git-reader.mjs', 'tools/evidence/package.json','tools/evidence/package-lock.json', 'third_party/stablo/LICENSE','third_party/stablo/NOTICE.md','third_party/stablo/provenance.json', 'third_party/stablo/source/components/postlist.js','third_party/stablo/source/pages/index.js', ]; export async function sourceMaterials() { const publicFiles=new Map(),codeFiles=[]; for(const path of sourcePaths.sort()) { const full=join(codeRoot,path);await noSymlinks(full); if(!(await lstat(full)).isFile())throw new Error('Nonregular code source'); const bytes=await readFile(full); publicFiles.set(`source-materials/${path}.txt`,bytes); codeFiles.push({path,sha256:sha256(bytes),size:bytes.length}); } const notice='Corresponding layout and release build source for this package. Stablo-derived layout uses GPL-2.0; see third_party/stablo/LICENSE and NOTICE.md. These are exact executing source bytes, which may include local modifications; the release manifest records codeDirty and actual hashes. Article text, illustrations and private library records are separate and are not relicensed. Install Node >=22, run npm --prefix sites/tech ci and npm --prefix tools/evidence ci, then import prepareRelease from tools/site-release/package.mjs with an explicitly selected local content commit. No original private content or configuration is included. Third-party dependencies retain their licenses; lockfiles identify exact dependencies.\n'; publicFiles.set('source-materials/README.txt',Buffer.from(notice)); publicFiles.set('source-materials/index.html',Buffer.from(`
${notice}