snapkitty
hardware
ada
fortran
python
File size: 1,834 Bytes
5befefa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**

 * Fetch Luminary099 — preserves original source separately

 * Does NOT modify evidence/artifacts without hash verification

 */
import { createHash } from "node:crypto";
import { mkdirSync, writeFileSync, existsSync, readFileSync } from "node:fs";
import { join } from "node:path";

const REPO = "https://api.github.com/repos/chrislgarry/Apollo-11/contents/Luminary099";
const DEST = "evidence/artifacts/Luminary099";

async function fetchFileList(): Promise<any[]> {
  const res = await fetch(REPO, { headers: { "User-Agent":"sovereign-apollo" }});
  if(!res.ok) throw new Error(`GitHub API ${res.status}`);
  return await res.json();
}

async function main(){
  const updatePin = process.argv.includes("--update-pin");
  console.log("[FETCH] Luminary099 →", DEST);
  mkdirSync(DEST,{recursive:true});
  try{
    const list = await fetchFileList();
    for(const f of list.slice(0,5)){ // demo fetch 5 files; full would fetch all 101
      if(!f.download_url) continue;
      const r=await fetch(f.download_url);
      const text=await r.text();
      const hash=createHash("sha256").update(text).digest("hex");
      const out=join(DEST, f.name);
      if(!existsSync(out) || updatePin) writeFileSync(out,text);
      console.log(`  ${f.name}  sha256:${hash.slice(0,12)}...`);
    }
    console.log("[FETCH] Done (demo truncated to 5 files; extend to 101 for full verification). Full offline fetch uses git clone + yaYUL.");
    console.log("[FETCH] To fetch all 101 files via git: git clone https://github.com/chrislgarry/Apollo-11 --depth 1");
  }catch(e:any){
    console.log("[FETCH] Offline or rate-limited — using local evidence. Error:", e.message);
    console.log("[FETCH] Ensure evidence/artifacts/Luminary099 exists or run with --update-pin when online.");
  }
}
main();