Add Case Advocate tab — partisan brief grounded in Norwegian law

New /advocate.php tab: user selects who they represent (biological
father, mother, foster carer, CWS, etc.) and the agent takes their
side entirely. Adversarial sub-questions target supporting Lovdata
statutes + ECHR precedents; synthesis returns client_strengths[] and
opposing_weaknesses[] alongside the advocate brief.

- DeepResearchAgent: add advocateRole param to run(), interpretSeed(),
  expandQueries(), synthesise(). Neutral path unchanged (empty string).
- api/deep-research.php: extract + validate advocate_role from payload;
  telemetry logs tool='advocate' vs 'deep_research'.
- advocate.php: new page with role dropdown (presets + custom), same
  corpus slices/engine/controls/upload zone as deep research.
- assets/js/advocate.js: page-scoped JS; renders advocate banner,
  client strengths card (teal), advocate brief, opposing weaknesses
  card (amber), sub-Q cards, sources, uncertainty, next step.
- assets/css/tools.css: append .adv-* rules (~120 lines).
- includes/layout.php: add Advocate nav tab between Deep research and
  Summarize.
- index.php: add Advocate cap-card tile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 12:26:05 +02:00
parent 85a6bc8134
commit 640778454f
7 changed files with 1154 additions and 26 deletions
+6 -1
View File
@@ -91,7 +91,7 @@ if (dbnToolsIsAuthenticated()) {
<section class="cap-section">
<div class="section-inner">
<h2 class="section-heading">Seven tools, one suite</h2>
<h2 class="section-heading">Eight tools, one suite</h2>
<div class="cap-grid">
<div class="cap-card">
<span class="cap-label">Ask</span>
@@ -108,6 +108,11 @@ if (dbnToolsIsAuthenticated()) {
<h3>Deep research</h3>
<p>Upload a case file or paste a question. An agent expands it into 35 angles, runs hybrid rank/rerank RAG across the corpus + your upload, and returns a cited brief.</p>
</div>
<div class="cap-card cap-card--featured">
<span class="cap-label">Advocate</span>
<h3>Case Advocate</h3>
<p>Pick who you represent. The agent takes your side — generating adversarial sub-questions, identifying the opposing party&rsquo;s weaknesses, and producing a partisan brief grounded in Lovdata statutes and ECHR judgments.</p>
</div>
<div class="cap-card">
<span class="cap-label">Summarize</span>
<h3>Summarize</h3>