Foundation - Source Excerpt 35
Summary
This source excerpt preserves a bounded section of Anti-Christ.org/wp-content/plugins/fftac-foundation-core/inc/foundation.php so readers can inspect the evidence without opening the full source file.
**Source path:** Anti-Christ.org/wp-content/plugins/fftac-foundation-core/inc/foundation.php
'record_id' => $record_id,
'anchor' => $anchor,
'atlas_url' => antichrist_engine_foundation_build_target_url('research', array(), $anchor),
'research_url' => antichrist_engine_foundation_build_target_url('research', array(), $anchor),
'record_request_url' => $record_request_url,
'record_url' => $record_request_url . '#research-record',
'record_type' => 'claim',
'type_label' => antichrist_engine_foundation_get_research_record_type_labels()['claim'],
'keyword_terms' => antichrist_engine_foundation_get_claim_keyword_terms($claim),
'source_count' => count((array) ($claim['source_keys'] ?? array())),
'episode_count' => count((array) ($claim['episodes'] ?? array())),
'source_references' => $source_references,
'related_claims' => array(),
));
}
$claims = $base_claims;
foreach ($base_claims as $index => $claim) {
$related_claims = array();
foreach ($base_claims as $other_index => $other_claim) {
if ($index === $other_index) {
continue;
}
$shared_sources = array_values(array_intersect(
(array) ($claim['source_keys'] ?? array()),
(array) ($other_claim['source_keys'] ?? array())
));
$shared_terms = array_values(array_intersect(
(array) ($claim['keyword_terms'] ?? array()),
(array) ($other_claim['keyword_terms'] ?? array())
));
$same_category = (string) ($claim['category'] ?? '') === (string) ($other_claim['category'] ?? '');
$same_verdict = (string) ($claim['verdict'] ?? '') === (string) ($other_claim['verdict'] ?? '');
$same_evidence = (string) ($claim['evidence'] ?? '') === (string) ($other_claim['evidence'] ?? '');
$score = (count($shared_sources) * 5) + min(3, count($shared_terms));
$shared_source_records = array();
if ($same_category) {
$score += 3;
}
if ($same_verdict) {
$score += 2;
}
if ($same_evidence) {
$score += 1;
}
if ($score <= 0) {
continue;
}
foreach (array_slice($shared_sources, 0, 3) as $shared_source_key) {
if (!isset($source_lookup[$shared_source_key])) {
continue;
}
$shared_source_records[] = array(
'record_id' => (string) $source_lookup[$shared_source_key]['record_id'],
'title' => (string) $source_lookup[$shared_source_key]['title'],
'record_url' => (string) $source_lookup[$shared_source_key]['record_url'],
);
}
$related_claims[] = array(
'record_id' => (string) $other_claim['record_id'],
'title' => (string) ($other_claim['title'] ?? ''),
'anchor' => (string) $other_claim['anchor'],
'atlas_url' => (string) $other_claim['atlas_url'],
'research_url' => (string) $other_claim['research_url'],
'record_request_url' => (string) $other_claim['record_request_url'],
'record_url' => (string) $other_claim['record_url'],
'category' => (string) ($other_claim['category'] ?? ''),
'score' => $score,
'same_category' => $same_category,
'same_verdict' => $same_verdict,
'same_evidence' => $same_evidence,
'shared_source_count'=> count($shared_sources),
'shared_source_records' => $shared_source_records,
'shared_terms' => array_slice($shared_terms, 0, 3),
);
}
usort($related_claims, static function ($left, $right) {
if ((int) $left['score'] === (int) $right['score']) {
return strcasecmp((string) $left['title'], (string) $right['title']);
}
return (int) $right['score'] <=> (int) $left['score'];
});
$claims[$index]['related_claim_count'] = count($related_claims);
$claims[$index]['related_claims'] = array_slice($related_claims, 0, 3);
}
return $claims;
}
/**
* Returns flattened chronology entries as projection-ledger records.
*
* @return array<int, array<string, mixed>>
*/
function antichrist_engine_foundation_get_projection_ledger_entries()
{
static $entries = null;
if (null !== $entries) {
return $entries;
}
$entries = array();
$claim_labels = antichrist_engine_foundation_get_claim_category_labels();
$verdicts = antichrist_engine_foundation_claim_verdicts();
$evidence_levels = antichrist_engine_foundation_claim_evidence_levels();
$type_labels = antichrist_engine_foundation_get_research_record_type_labels();
foreach (antichrist_engine_foundation_get_enriched_claim_dossiers() as $claim) {
foreach ((array) ($claim['episodes'] ?? array()) as $episode_index => $episode) {
if (!is_array($episode)) {
continue;
}
$sequence = count($entries) + 1;
$period = trim((string) ($episode['period'] ?? ''));
$source = trim((string) ($episode['source'] ?? ''));
$status = trim((string) ($episode['status'] ?? ''));
$summary = trim((string) ($episode['summary'] ?? ''));
$record_id = antichrist_engine_foundation_get_research_record_id('PRJ', $sequence);
$record_request_url = antichrist_engine_foundation_get_research_record_request_url($record_id);
$anchor = 'projection-' . sanitize_title(implode(' ', array_filter(array(
$record_id,
$claim['record_id'] ?? '',
$period,
))));
$title = trim(implode(' / ', array_filter(array(
$claim['title'] ?? '',
$period,
))));
$category = (string) ($claim['category'] ?? '');
$verdict = (string) ($claim['verdict'] ?? '');
$evidence = (string) ($claim['evidence'] ?? '');
$keywords = implode(' ', array(
$record_id,
$title,
$summary,
$period,
$source,
$status,
$claim['record_id'] ?? '',
$claim['title'] ?? '',
$claim['summary'] ?? '',
$claim['keywords'] ?? '',
$claim_labels[$category] ?? '',
$verdicts[$verdict]['label'] ?? '',
$evidence_levels[$evidence]['label'] ?? '',
));
$entries[] = array(
'sequence' => $sequence,
'episode_sequence' => $episode_index + 1,
'record_id' => $record_id,
'anchor' => $anchor,
'title' => $title,
'summary' => $summary,
'period' => $period,
'source' => $source,
'status' => $status,
'status_slug' => sanitize_title($status),
'claim_record_id' => (string) ($claim['record_id'] ?? ''),
'claim_title' => (string) ($claim['title'] ?? ''),
'claim_summary' => (string) ($claim['summary'] ?? ''),
'claim_category' => $category,
'claim_category_label' => (string) ($claim_labels[$category] ?? ucwords(str_replace('-', ' ', $category))),
'claim_verdict' => $verdict,
'claim_verdict_label' => (string) ($verdicts[$verdict]['label'] ?? ''),
'claim_evidence' => $evidence,
'claim_evidence_label' => (string) ($evidence_levels[$evidence]['label'] ?? ''),
'claim_record_request_url' => (string) ($claim['record_request_url'] ?? ''),
'claim_record_url' => (string) ($claim['record_url'] ?? ''),
'claim_atlas_url' => (string) ($claim['atlas_url'] ?? ''),