- Summarize: new depth param (brief/standard/detailed) with depth-aware prompt
instructions and coverage mandate; wired through API + JS
- Korrespond: new letter length param (concise/standard/detailed) injected as
Lengde: instruction in draft pass; wired through API + JS
- Korrespond draft prompt: add §-discipline rule (cite only directly relevant §§)
plus Opphevet guard (aligned with dobetterlegal-tools)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire the legal-domain persona picker into corpus, deep-research, korrespond and
the dashboard chat. Each endpoint reads the chosen profile, resolves its packages
against client 57, and scopes retrieval via package_ids (falling back to family
when omitted). New dashboard tenants now subscribe to all DBN domain packages so
persona switching survives the subscription intersection.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Generalize the family-locked legal tools into caveauAI persona profiles
(client 57 chat profiles, resolved in-process via the chat_profiles bridge).
Each tool accepts an optional `profile` slug that scopes the corpus package(s),
search method, system prompt and synthesis model; omitting it falls back to the
family-legal package so existing behaviour is unchanged.
- dbnToolsResolvePersona / dbnToolsListPersonas / dbnToolsBootChatProfiles in
bootstrap.php; new api/personas.php + dbn.list_personas MCP tool.
- LegalTools search/ask/corpusContextForSummarize and the BvjAnalyzer /
LegalAnalysis / translate paths take the persona's packages + prompt + model.
- Persona <select> on ask/search/summarize (populated from api/personas.php).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- renderTimeline(): group consecutive same-date+actor events into one card
with a bullet list; single events keep their current layout
- Date format: YYYY-MM-DD → "1 Jun 2023" (3-letter month, international)
- Time shown in header when available
- Remove date_type badge; confidence badge replaced by amber ⚠ flag on
low-confidence events only (high/medium border colour still shows)
- LegalTools.php: resolve azure_full/azure_mini to Bedrock Sonnet/Haiku
when DbnBedrockGateway is active; claude_sonnet/claude_haiku also handled
- timeline.php + api/timeline.php: engine labels updated (Claude Haiku/Sonnet);
claude_haiku + claude_sonnet added to valid engine list
- i18n engine labels updated in all 4 languages
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove GPU/cuttlefish engine from timeline.php, api/timeline.php, LegalTools.php, tools.js (all 4 langs)
- Add engine-aware credit cost: gpt-4o-mini=1 credit, gpt-4o=2 credits (matches redact pattern)
- Remove multiple attribute from file input (single document only)
- New api/timeline-stream.php: SSE endpoint emitting status events + final result
- New api/timeline-download.php: DOCX export of timeline events
- LegalTools::timeline() gains ?callable $onProgress for live status updates
- tools.js: spinner on run, SSE streaming fetch, Export to Word button
- Save to My Docs was already wired (showSaveResultButton at line 1136)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove js-save-corpus button from redact output (was failing with 'no_workspace'
for users without a linked CaveauAI workspace)
- Single save path now goes through showSaveResultButton() → api/case/save-result.php,
which works for all paid (Plus/Pro) users without workspace dependency
- Relabel 'Save result' → 'Save to My Docs' and update success message
- Fix DOCX: contentTypesXml() had wrong ContentType for docProps/core.xml
(application/package/... → application/vnd.openxmlformats-package.core-properties+xml);
Word validates this strictly and was rejecting the file
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove GPU/regex engine options; keep only azure_mini (1 credit) and azure_full (2 credits)
- Variable credit cost: engine-aware pre-check and charge in api/redact.php; PricingCatalog base = 1
- Fix ATTORNEY not preserved when keepOfficials=true: add to LLM prompt, generic-tag, pseudonym regexes
- Replace Azure credits hint with per-engine credit cost text (all 4 languages)
- Single-file upload only (was: up to 5); simplify status messages
- Clear previous redaction output and show pulsing spinner when a new run starts
- Add "Save to My Docs" button in redact output panel (corpus-save.js path)
- corpus-save.js: capture source_doc_ids from button dataset, pass in POST payload
- api/save-to-corpus.php: accept source_doc_ids, store first as source_url=corpus-doc:{id}
- doc-picker.js: show "✂ Redacted" badge for documents saved from the redact tool
- CSS: .redact-working spinner, doc-item__badge--redact pill styles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Cards, status row, account bar, and pricing tiers were rendering at
.78–.94rem with 18–20px padding — felt microscopic on 1440+ viewports.
Lift every token ~12–15% and widen card padding so the Crimson Pro /
IBM Plex editorial character reads as intended.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restored min-height:200px + display:flex on .dashboard-tool-card in CSS,
and removed the conflicting min-height:0 inline overrides on each card div.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- layout.php: replace large manifesto section (eyebrow/title/sub/4 stats) with
a slim dbn-context-bar strip linking to why-ours, pricing, MCP, and privacy
- i18n.php: add context_bar_* + footer_privacy_link + privacy_page_title keys
to all 4 language blocks (en, no, uk, pl)
- dbn-tools-redesign.css: add .dbn-context-bar styles with mobile wrap
- privacy.php: new standalone page in 4 languages covering in-memory processing,
metadata-only logging, My Case opt-in storage, EU data locations, and HTTPS transport
- footer.php: add Privacy link to first footer column
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The redesign CSS was forcing .kdoc-hero__title to var(--dbn-blue) (#00205b)
— the same color as the hero background, making it invisible. The kicker
was also overridden to red, which clashed with the dark navy overlay.
Added more-specific .kdoc-hero .kdoc-hero__* overrides to restore white text.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add doc_picker_btn/audio_picker_btn to i18n.php (en/no/uk/pl), add
docPickerBtn to REDACT_I18N + TIMELINE_I18N and audioPickerBtn to
TRANSCRIBE_I18N in tools.js. PHP-render picker labels in legal-analysis,
translate, summarize, tool_form, and layout_footer using dbnToolsT().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
New dbn-tools-redesign.css with warm paper surface, navy tools nav, gold
accent, and per-tool themes via body[data-active-tool]. Updated all 21 tool
PHP pages, shared layout/nav/footer includes, and advocate route (new).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The tool now respects the chosen UI language end-to-end — even if the
source document is Norwegian, a user on EN/UK/PL gets the analysis in
their language. Norwegian statute references (barnevernsloven § 4-25,
EMK Art. 8) and case names (Strand Lobben mot Norge 37283/13) are kept
verbatim because they are proper nouns.
LLM (LegalAnalysisAgent.php):
- extractIssues: prompt asks for question + brief_context in user's
language; statute refs preserved
- answerIssue: Norwegian core system prompt (keeps fine-tune precision)
+ language-coercion line for non-NO; localised context/source labels
- synthesise: overall_assessment, next_steps, disclaimer in user's
language; explicit per-language disclaimer text
- runFullAnalysis empty-case fallback also localised
- what_to_check translated per language
UI:
- 40 new la_* translation keys in i18n.php × 4 languages (NO/EN/UK/PL)
- legal-analysis.php: 4-way lang switcher, dbnToolsT() for every label,
emits window.DBN_LA_I18N for runtime JS strings
- legal-analysis.js: t() helper reads from window.DBN_LA_I18N
- layout_footer.php: emits window.DBN_CURRENT_LANG +
window.DBN_ADDON_I18N so the legal-analysis add-on button works in
the page's language no matter which tool it's invoked from
- tools.js add-on: reads from DBN_ADDON_I18N, passes DBN_CURRENT_LANG
to /api/legal-analysis.php so server responds in same language
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Same defensive guard as legal-analysis + summarize, now applied to the
upload-zone and audio-zone handlers in tools.js. Affects redact,
timeline, and transcribe (which all share these zones via tools.js's
setupUpload / setupAudioUpload). Stops native label-for clicks and the
input's own click from bubbling into the zone handler that would
otherwise programmatically re-open the picker.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The "browse" label's native for=input trigger AND the upload-zone click
handler both called uploadInput.click(), so the picker opened twice when
the user clicked the browse text. Stop propagation on the label and the
input itself, plus tighten the zone handler to recognise any label-for
descendant.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restores the dbn-legal-agent-v3 fine-tune on ocelot (was silently aliased
to plain qwen2.5:14b in LiteLLM since the viper retirement) and ships a
new tool that uses it via a two-pass flow:
Pass 1 (Azure 4o-mini) → extract up to 5 distinct legal issues
Pass 2 (ocelot v3 only) → answer each issue, ≤350 tokens, with corpus
Pass 3 (Azure 4o-mini) → synthesise overall assessment + next steps
The 12GB-VRAM constraint motivates the split: dbn-legal-agent-v3 stays
hot in VRAM through the 5 sequential per-issue calls because issue
extraction and synthesis run on Azure, not on ocelot.
New surface:
- includes/LegalAnalysisAgent.php
- api/legal-analysis.php (NDJSON streaming endpoint)
- legal-analysis.php (dedicated tool page)
- assets/js/legal-analysis.js (streamed UI with per-issue cards)
- Save-result + case-result.php rendering for legal-analysis output
- Nav registration in all four UI languages
Add-on integration: a "⚖️🇳🇴 Run deep legal analysis on this text"
button now appears on Summarize, Ask, and Redact result pages and
streams the same pipeline inline below the existing result.
Existing tools relabelled: the misleading "🇳🇴 Norwegian specialist v3 ⭐"
option on advocate/deep-research/discrepancy/barnevernet is now honestly
"DBN Legal Agent" — now that the real fine-tune is actually deployed,
the label finally matches reality. The advocate.php v2 option was
removed since the v2 GGUF is retired.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All tool results can now be saved to My Case manually. Users click
'Save result', type a description, and confirm. This replaces the
previous silent auto-save on barnevernet/timeline/etc., giving users
control over what stays and what it's called (supports multiple runs
of the same tool with different titles).
- CaseResults: extend ELIGIBLE_TOOLS to include summarize, ask, redact,
transcribe; add toolLabel/toolIcon entries; support explicit title
via meta['title'] in save()
- api/case/save-result.php: new client-initiated save endpoint;
accepts tool + title + input_payload + output_payload + meta
- Remove CaseResults::save() auto-save from barnevernet, deep-research,
discrepancy, korrespond, timeline API endpoints
- tools.js: add showSaveResultButton() (exposed as window.dbnShowSaveResultButton);
wire for ask, redact, timeline, transcribe (both file-upload and
stored-audio paths)
- barnevernet.js: wire save button after final result render
- summarize.js: wire save button after renderFinal(); passes sumResults
container so widget appears in the correct #sumResults div
- case-result.php: rich tool-specific rendering for summarize, ask,
redact, transcribe, timeline; update re-run link map to include all
new tools
- tools.css: styles for .save-result-widget and its states (idle,
prompt, done, error)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- summarize.php: full custom inline form (replaces tool_form.php wrapper) with
lang switcher, azure_mini/azure_full/gpu engine selector, 8 corpus-slice
toggles (all off by default), doc picker, file upload zone, and textarea
- api/summarize.php: rewritten to streaming NDJSON (matches barnevernet pattern);
accepts JSON payload with text, language, engine, slices[], doc_ids[]
- includes/LegalTools.php: adds corpusContextForSummarize() (keyword search via
ClientRagPipeline) and summarizeWithContext() (engine-aware LLM call with
optional corpus prepend); returns structured JSON matching existing summarize format
- assets/js/summarize.js: self-contained IIFE handling file upload via
api/extract.php, slice toggles, NDJSON stream reader, result rendering,
and trace panel update
- includes/i18n.php: adds 'summarize' to nav in all 4 languages (EN/NO/UK/PL),
inserted after 'redact' in the tool order with icon 'SZ'
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isPaidUser() was checking DBN_FREE_TIER_BALANCE === undefined, which
is only true for CaveauAI sessions. SSO users (even plus/pro) always
have DBN_FREE_TIER_BALANCE set, so the picker was showing the upgrade
modal for everyone in the SSO flow. Now reads DBN_USER_TIER explicitly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add "Select from My Docs" button to all text tool forms; free-tier
users see an upgrade modal, paid (CaveauAI) users get a searchable
multi-select modal backed by /api/dashboard/documents.php
- Add "Select from My Audio" picker on Transcribe with single-select
and a "Save to My Audio" button for persisting uploaded clips
- New PHP helpers in bootstrap.php: dbnToolsFetchDocChunks,
dbnToolsClientIdFromSession, dbnToolsInjectDocContent
- timeline, ask, redact APIs prepend selected document content
(fetched from client_chunks SQL) before the textarea text
- api/dashboard/audio-upload.php stores audio files on server and
creates a client_documents row with source_type='audio'
- api/transcribe.php falls back to stored audio via audio_doc_id POST
field when no file is uploaded
- api/dashboard/documents.php supports ?source_type= filter
- tools.js: doc_ids added to JSON payload; stored-audio transcribe path
- New assets/css/doc-picker.css, assets/js/doc-picker.js
- SQL migration: scripts/sql/audio_docs_column.sql
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New includes/nav.php: sticky site-wide nav with Tools dropdown, Dashboard
link, compact language switcher, user identity → /account.php, Log out
- New account.php: credits & plan, profile, team, usage sections
- New api/corpus-summary.php: JSON endpoint for corpus doc count + last updated
- Replaces topbar in layout.php, layout_dashboard.php, and dashboard.php
- Fixes hardcoded Norwegian strings in dashboard.php credit cards via dbnToolsT()
- Adds 35 new i18n keys across all 4 languages (en/no/uk/pl) in i18n.php
- CSS: .dbn-nav navbar + .account-* account page styles in tools.css
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Full private corpus dashboard for tools.dobetternorge.no users — each SSO
account gets an auto-provisioned CaveauAI tenant (clients row, corpus) on
first visit. Includes upload (file/paste/URL), RAG chat with SSE streaming
and citation chips, document CRUD, FalkorDB graph relations tab, and
improved save-from-tool flow with tag/preview support.
- dashboard/{index,documents,document,upload,chat,settings}.php
- api/dashboard/{corpus-init,documents,upload,ingest-status,chat-stream,
save-from-tool,graph}.php
- includes/{CorpusProvision,layout_dashboard,layout_dashboard_footer}.php
- assets/css/dashboard.css assets/js/corpus-save.js (routing upgrade)
- includes/{bootstrap,layout}.php extended for dashboard provisioning
Migration 141 (clients.dbn_sso_uid + import_method enum) applied on chloe.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- dashboard.php: welcome overlay modal on first visit, shows all 10 tool
tips in a 2-col grid; localStorage key dbn-welcome-v1-seen persists
dismiss; "Don't show again" checkbox (default checked); backdrop+Escape
close without persisting
- index.php: Sign in / Join free buttons added to sticky nav; access gate
section moved from page bottom to immediately after hero so login CTAs
are the first thing a visitor sees without scrolling; gate card titles
enlarged and top-border accent added for visual weight
- tools.css: .wlc-* welcome modal styles; .lt-nav__btn-signin/join nav
CTA button styles; .lt-gate--prominent and .lt-gate__card-title--large
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- POST /api/save-to-corpus.php — saves tool output text to user's default CaveauAI corpus via ClientRagPipeline
- api/case/upload.php — dual-writes uploaded PDFs to CaveauAI client_documents (best-effort)
- assets/js/corpus-save.js — shared <dialog> handler for .js-save-corpus buttons on all tool pages
- includes/layout_footer.php — injects corpus-save.js + shared save dialog markup
- korrespond/deep-research/barnevernet/discrepancy JS — save-to-corpus buttons on output sections
- api/search.php + LegalTools::search() — corpus_scope param ('shared'|'private'|'both'), merges personal CaveauAI corpus with shared legal library when 'both'
- includes/tool_form.php + assets/js/tools.js — corpus scope radio toggle shown on search tab
- api/user-docs.php — add POST upload method for non-SSO authenticated users
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add prominent navy why-ours banner strip between hero and tools grid:
eyebrow, large title, sub-text, 3 checkmark bullet points, gold CTA button
- Add pricing CTA strip after trust section: eyebrow, title, sub-text,
4 tier pill tags (€0/€9/€29/€79), navy CTA button to pricing.php
- Remove the small pill links from the bottom of the trust section
- All new sections fully translated in no/en/uk/pl (11 new i18n keys)
- Add .lt-why-strip and .lt-pricing-strip CSS in tools.css
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- index.php: translate hardcoded hero kicker, stat, explore CTA, tools
section title/sub, and learn-more arrow; add Pricing nav link
- footer.php: fully translate tagline, privacy note, nav links, and
disclaimer into all 4 languages via dbnToolsT()
- includes/i18n.php: 15 new keys per language (hero_kicker, footer_*,
tools_section_*, pricing_nav_link, why_ours_trust_link, learn_more)
- translations/why-ours.php: complete uk + pl translations (70 keys each)
- assets/css/tools.css: add .lt-nav__secondary-link style
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed hard-coded pixel width/height attributes from <img> tags and
tightened kdoc-diagram-img CSS (max-width:100%, overflow:hidden) so
images scale fluidly at all viewport sizes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Swaps the CSS-only kdoc-compare and kdoc-graph blocks for two custom
transparent-background PNGs (+ lossless WebP) designed by the user.
memoryVlibrary shows the two-path General AI vs DBN flow; norwegianLaw
shows the connected-law knowledge graph. Both served via <picture> with
WebP primary and PNG fallback.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Explains why Do Better Norge tools give different answers than ChatGPT:
RAG, BM25+vector search, reranker, knowledge graph, fine-tuned model.
Includes EN/NO translations, 5 optimised WebP/JPEG images, new kdoc-compare
and kdoc-graph CSS components. Link added from index.php trust section.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>