feat(tools): reposition as Do Better Legal two-track Norwegian-law MCP

De-family-ify shared JSON tools (persona-aware routing + neutral base
prompt), make the verification review pick its engine per track
(family/child-welfare -> dbn-legal-agent-v3, others -> gpt-4o interim),
and route product-name strings through dbnToolsProductName(). Rebrand the
MCP/tools surface (mcp.php + i18n mcp_* strings) to Do Better Legal.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-02 07:45:17 +02:00
parent d156f8cf6b
commit 7fcd317205
12 changed files with 158 additions and 72 deletions
+8 -5
View File
@@ -440,7 +440,7 @@ final class DbnDeepResearchAgent
dbnToolsAbort('The family-legal corpus package is not active.', 503, 'package_unavailable');
}
if (!dbnToolsHasActiveSubscription($clientId, (int)$package['id'])) {
dbnToolsAbort('Do Better Norge does not have an active family-legal subscription.', 503, 'subscription_missing');
dbnToolsAbort(dbnToolsProductName() . ' does not have an active family-legal subscription.', 503, 'subscription_missing');
}
return $package;
}
@@ -487,8 +487,9 @@ final class DbnDeepResearchAgent
$priorContextBlock = implode("\n", $parts) . "\n\nNow investigate this branch:\n";
}
$product = dbnToolsProductName();
$prompt = <<<PROMPT
{$rolePrefix}{$priorContextBlock}You are reviewing the input below to set up a deep legal research pass against the Do Better Norge family-law corpus.
{$rolePrefix}{$priorContextBlock}You are reviewing the input below to set up a deep legal research pass against the {$product} Norwegian legal corpus.
Input:
{$seedDescription}
@@ -580,8 +581,9 @@ Rules:
- Write the questions in {$locale}.
PROMPT;
} else {
$product = dbnToolsProductName();
$prompt = <<<PROMPT
You are decomposing a Do Better Norge legal-research request into {$targetCount} focused sub-questions that should each be answered by the legal corpus (Norwegian family law, child welfare, ECHR/Hague).
You are decomposing a {$product} legal-research request into {$targetCount} focused sub-questions that should each be answered by the legal corpus (Norwegian law — e.g. family, child welfare, immigration, labour, consumer/tenancy, ECHR/Hague).
Research brief:
{$brief}
@@ -1064,9 +1066,10 @@ PROMPT;
? "\nKey retrieval signals (statutory/factual terms that drove corpus search — ground your brief in these where sources permit):\n" . implode(', ', $keySignals) . "\n"
: '';
$product = dbnToolsProductName();
if ($advocateRole !== '') {
$prompt = <<<PROMPT
You are Do Better Norge Legal Tools producing a legal preparation brief in {$locale}.
You are {$product} Tools producing a legal preparation brief in {$locale}.
Your client: {$advocateRole}
{$priorContextSection}
User input:
@@ -1106,7 +1109,7 @@ Return JSON:
PROMPT;
} else {
$prompt = <<<PROMPT
You are Do Better Norge Legal Tools running a deep-research synthesis. You MUST ground every claim in the numbered sources below, using inline `[n]` citation markers that map to the source list. Do NOT cite a source you did not use. Do NOT invent statutes, paragraph numbers, case names, dates, or parties.
You are {$product} Tools running a deep-research synthesis. You MUST ground every claim in the numbered sources below, using inline `[n]` citation markers that map to the source list. Do NOT cite a source you did not use. Do NOT invent statutes, paragraph numbers, case names, dates, or parties.
{$priorContextSection}
User input:
{$seedDescription}