mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-20 13:39:27 +00:00
Tasks 1.1, 5.1, 5.2, 5.4 and the data half of 5.3. - mechanisms.toml: closed vocabulary v1 (20 ids) every expected row cites. - vibe-py: 35 Real-Vuln-Benchmark pairs (Apache-2.0), human provenance only because the LLM-generated repositories carry no license (escalated). - vfc-js: 17 Node fix-commit pairs harvested upstream (MIT/Apache-2.0), SecBench.js itself is not vendored (no license); sinks derived on 13/17. - agent-vfc: 29 agent-trailer fixes as catalog-candidates.toml plus REVIEW.md; the loaded catalog stays empty until a human reviews them. - datasets.toml and README document every slice and its review status. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
47 lines
1.6 KiB
TypeScript
47 lines
1.6 KiB
TypeScript
// Provenance: handielson/Mercado-do-vale-news (fixed).
|
|
// repo: handielson/Mercado-do-vale-news
|
|
// commit: 9b5fcf2dae41e56f5f97952266f2d6ba59598598
|
|
// parent: 70ca282b819ac1d60f4b5e665d224b1043ff1ccc
|
|
// commit_url: https://github.com/handielson/Mercado-do-vale-news/commit/9b5fcf2dae41e56f5f97952266f2d6ba59598598
|
|
// cve:
|
|
// license: MIT
|
|
// function: fetchMetadata
|
|
// relpath: services/catalogMetadataService.ts
|
|
// provenance: agent
|
|
// mechanism: permissive_default
|
|
|
|
async function fetchMetadata(): Promise<MetadataCache | null> {
|
|
// Deduplicação de requisições concorrentes
|
|
if (pendingFetch) return pendingFetch;
|
|
|
|
pendingFetch = (async () => {
|
|
try {
|
|
const controller = new AbortController();
|
|
const timer = setTimeout(() => controller.abort(), 10000);
|
|
|
|
// Bypass completo de cache de CDN e Browser
|
|
const timestamp = Date.now();
|
|
const res = await fetch(buildVpsUrl(`/catalog/metadata?_t=${timestamp}`), {
|
|
signal: controller.signal,
|
|
headers: { Accept: 'application/json' },
|
|
cache: 'no-store',
|
|
});
|
|
clearTimeout(timer);
|
|
if (!res.ok) return null;
|
|
const data = await res.json();
|
|
return {
|
|
categories: data.categories || [],
|
|
brands: data.brands || [],
|
|
priceRange: data.priceRange || null,
|
|
timestamp: Date.now(),
|
|
};
|
|
} catch {
|
|
return null;
|
|
} finally {
|
|
pendingFetch = null;
|
|
}
|
|
})();
|
|
|
|
return pendingFetch;
|
|
}
|