File size: 2,912 Bytes
cd16343
 
 
 
 
 
 
 
 
 
 
 
13bb1e5
 
 
 
cd16343
 
13bb1e5
9cdfbc6
cd16343
 
 
 
13bb1e5
 
 
 
 
cd16343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
44
45
46
47
48
#!/usr/bin/env bash
# Publica o laboratorio no HF em COMMIT ÚNICO (doutrina: o HF bloqueia
# envios parciais em sequência curta). Token SOMENTE de HF_TOKEN (env).
set -euo pipefail
RAIZ="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO="${1:-PowerMachine/laboratorio}"
API="https://huggingface.co/api/models/$REPO"
: "${HF_TOKEN:?exporte HF_TOKEN antes (o valor nunca e gravado em arquivo)}"
# gate L7-regex: aborta se achar token no projeto
if grep -rEq 'hf_[A-Za-z0-9]{20,}' "$RAIZ" --exclude-dir=target --exclude-dir=.git 2>/dev/null; then
  echo "FALHA L7-regex: token encontrado no projeto"; exit 1
fi
# arquivos históricos IDÊNTICOS ao remoto não são re-enviados (higiene
# do commit único: telemetrias v024/v025/v026 já publicadas no ciclo
# r-69 e intocadas pelo r-70 — verificação: git diff --quiet sobre elas)
EXCLUI_HISTORICOS='resultados/telemetria_v024.jsonl resultados/telemetria_v025.jsonl resultados/telemetria_v026.jsonl'
NDJSON="$(mktemp)"
trap 'rm -f "$NDJSON"' EXIT
SUMMARY="laboratorio v0.27-rust (r-70): TREINO REAL dos tres negativos v0.26 — ciencia-mat 0.200→0.467 (+133%), quora 0.662→0.725 (dominancia; meta relativa 80% inatingivel p/ negativo forte, registrada), pontuacao F1 0.144→0.338 (+135%); carga maior A-9 pos-meta com shards ampliados (2000/1200/566); checkpoints safetensors <=1GiB com retomada exata (T-R70-1..3); micro loops de atencao integrados ao treino/inferencia reajustando a arvore (78.7k voltas; T-R70-7); autoajuste em tempo real A-1..A-9 (2237 ajustes auditados); teoremas T-R70-1..7; 29/29 gates L10..L37; 99/99 testes; treino completo 72s em 2 nucleos"
printf '%s\n' "{\"key\":\"header\",\"value\":{\"summary\":\"$SUMMARY\",\"description\":\"v0.24-rust: Rust puro + Assembly (sem Python). Ver ESTRUTURA.md, AUTOCRITICA.md, provas/ (14), docs/r-68-rust-laboratorio.md\"}}" > "$NDJSON"
cd "$RAIZ"
n=0
while IFS= read -r f; do
  rel="${f#./}"
  pular=0
  for exc in $EXCLUI_HISTORICOS; do
    [ "$rel" = "$exc" ] && pular=1
  done
  [ "$pular" = "1" ] && continue
  b64=$(base64 -w0 "$f")
  printf '%s\n' "{\"key\":\"file\",\"value\":{\"path\":\"$rel\",\"content\":\"$b64\",\"encoding\":\"base64\"}}" >> "$NDJSON"
  n=$((n+1))
done < <(find . -type f ! -path "./target*" ! -path "./.git/*" ! -name "*.tmp" | sort)
echo "arquivos no commit: $n (ndjson: $(du -h "$NDJSON" | cut -f1))"
for tentativa in 1 2 3; do
  codigo=$(curl -s -m 600 -X POST "$API/commit/main" \
    -H "Authorization: Bearer $HF_TOKEN" \
    -H "Content-Type: application/x-ndjson" \
    --data-binary "@$NDJSON" -o /home/z/my-project/recon/publish_resp.json \
    -w '%{http_code}')
  echo "tentativa $tentativa: HTTP $codigo"
  if [ "$codigo" = "200" ]; then
    echo "PUBLICADO"; head -c 400 /home/z/my-project/recon/publish_resp.json; echo; exit 0
  fi
  sleep $((tentativa * 20))
done
echo "FALHOU"; head -c 400 /home/z/my-project/recon/publish_resp.json; exit 1