diff --git a/advocate.php b/advocate.php new file mode 100644 index 0000000..2d8cded --- /dev/null +++ b/advocate.php @@ -0,0 +1,182 @@ + +
+ +Select who you are representing, describe the dispute, and optionally upload case documents. The agent will argue your side — identifying supporting statutes, ECHR judgments, and weaknesses in the opposing position.
+Source
+ +The agent is generating adversarial sub-questions and retrieving from the legal corpus on behalf of ${escapeHtml(advocateRole)}. Live progress in the right-hand panel. Expect ${expectedDuration}.
${escapeHtml(data.next_practical_step)}
+${escapeHtml(truncate(s.excerpt || '', 240))}
+No brief was returned.
'; + const sourceSet = new Set((sources || []).map((s) => s.n)); + const escaped = escapeHtml(markdown); + + const withCites = escaped.replace(/\[(\d+(?:\s*[-,]\s*\d+)*)\]/g, (_, group) => { + const nums = expandCiteGroup(group); + return nums.map((n) => `${n}`).join(''); + }); + + const withBold = withCites + .replace(/\*\*([^*]+)\*\*/g, '$1') + .replace(/(^|[^*])\*([^*]+)\*(?!\*)/g, '$1$2') + .replace(/`([^`]+)`/g, '$1');
+
+ const paragraphs = withBold.split(/\n{2,}/).map((p) => {
+ const t = p.trim();
+ if (!t) return '';
+ if (/^### /.test(t)) return `${t.replace(/\n/g, '
')}
Upload a case file or paste a question. An agent expands it into 3–5 angles, runs hybrid rank/rerank RAG across the corpus + your upload, and returns a cited brief.
Pick who you represent. The agent takes your side — generating adversarial sub-questions, identifying the opposing party’s weaknesses, and producing a partisan brief grounded in Lovdata statutes and ECHR judgments.
+