Add/Update web/assets/js/main.js (Batch 2: Gilmore teardown + governance JS)

This commit is contained in:
2026-08-10 02:10:29 +00:00
parent e8eef136f1
commit d9ebf5b94d
+37
View File
@@ -0,0 +1,37 @@
document.addEventListener('DOMContentLoaded', () => {
// Evidence Governance Toggle Logic
const approveBtn = document.getElementById('approve-btn');
const rejectBtn = document.getElementById('reject-btn');
const agentBadge = document.getElementById('agent-badge');
const finalBadge = document.getElementById('final-badge');
const statusText = document.getElementById('review-status');
if (approveBtn && rejectBtn) {
// Human Approves the Finding
approveBtn.addEventListener('click', () => {
agentBadge.className = 'badge-tier2 line-through opacity-50';
finalBadge.className = 'badge-tier1';
finalBadge.textContent = 'Tier 1 Verified (Human Approved)';
statusText.textContent = 'SUCCESS: Finding verified by human analyst. Promoted to Tier 1.';
statusText.className = 'text-green-400 text-sm mb-6 font-mono font-bold';
disableButtons();
});
// Human Rejects the Finding (Triggers the Fallback Protocol)
rejectBtn.addEventListener('click', () => {
agentBadge.className = 'badge-tier2';
finalBadge.className = 'badge-tier2';
finalBadge.textContent = 'Tier 2: Indicative (Fallback Applied)';
statusText.textContent = 'FALLBACK: Tier 1 rejected. Defaulted to Tier 2 as per governance protocol.';
statusText.className = 'text-yellow-400 text-sm mb-6 font-mono font-bold';
disableButtons();
});
}
function disableButtons() {
approveBtn.disabled = true;
rejectBtn.disabled = true;
approveBtn.classList.add('opacity-50', 'cursor-not-allowed');
rejectBtn.classList.add('opacity-50', 'cursor-not-allowed');
}
});