feat(settings): add Blocks tab — 12-block decision schema reference
All checks were successful
Build & Deploy / build-and-deploy (push) Successful in 1m35s

Read-only display of BLOCK_CONFIG from block_writer.py with CREAC role
and JWM functional-purpose annotations per block (sourced from
docs/block-schema.md).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-04 07:58:04 +00:00
parent ae35934383
commit e90faa9ba4
4 changed files with 206 additions and 1 deletions

View File

@@ -2830,6 +2830,53 @@ async def api_mcp_registrations():
return list_registrations()
@app.get("/api/settings/mcp/blocks")
async def api_mcp_blocks():
"""List the 12-block decision schema (read-only reference)."""
from legal_mcp.services.block_writer import BLOCK_CONFIG
# CREAC role per block (from docs/block-schema.md). Static map —
# kept here rather than in BLOCK_CONFIG to avoid coupling LLM
# generation config to documentation metadata.
CREAC_ROLE = {
"block-alef": None, "block-bet": None, "block-gimel": None,
"block-dalet": None, "block-yod-bet": None,
"block-he": "Conclusion (preview)",
"block-vav": "Facts (R-context)",
"block-zayin": "Arguments",
"block-chet": "Procedural record",
"block-tet": "Rule (R)",
"block-yod": "C → R → E → A → C (full CREAC)",
"block-yod-alef": "Conclusion (final)",
}
# JWM functional purpose (Federal Judicial Center mapping)
JWM_PURPOSE = {
"block-alef": "Orientation", "block-bet": "Orientation",
"block-gimel": "Orientation", "block-dalet": "Orientation",
"block-he": "Orientation",
"block-vav": "Framing", "block-zayin": "Argumentation",
"block-chet": "Procedural record",
"block-tet": "Deliberation (rules)",
"block-yod": "Deliberation (analysis)",
"block-yod-alef": "Disposition",
"block-yod-bet": "Disposition (signatures)",
}
blocks = []
for block_id, cfg in sorted(BLOCK_CONFIG.items(), key=lambda kv: kv[1]["index"]):
blocks.append({
"id": block_id,
"index": cfg["index"],
"title": cfg["title"],
"gen_type": cfg["gen_type"],
"model": cfg["model"],
"temperature": cfg.get("temp"),
"max_tokens": cfg.get("max_tokens"),
"creac_role": CREAC_ROLE.get(block_id),
"jwm_purpose": JWM_PURPOSE.get(block_id),
})
return {"blocks": blocks, "count": len(blocks)}
# ── Settings: Tag → Company Mappings ──────────────────────────────
@app.get("/api/settings/paperclip-companies")