first attempts
This commit is contained in:
13
Dockerfile
Normal file
13
Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
# Install OpenCode
|
||||||
|
RUN curl -fsSL https://opencode.ai/install | bash
|
||||||
|
|
||||||
|
# Copy custom OpenCode configuration
|
||||||
|
RUN mkdir -p /root/.config
|
||||||
|
COPY ./config_opencode /root/.config/opencode
|
||||||
|
|
||||||
|
# env var for the mcp server
|
||||||
|
ARG MCP_SERVER
|
||||||
|
ENV MCP_SERVER=$MCP_SERVER
|
||||||
|
|
||||||
14
Makefile
Normal file
14
Makefile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.PHONY: build run clean
|
||||||
|
|
||||||
|
IMAGE_NAME := opencode
|
||||||
|
IMAGE_TAG := latest
|
||||||
|
MCP_SERVER := http://localhost:8080
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build --build-arg MCP_SERVER=$(MCP_SERVER) -t $(IMAGE_NAME):$(IMAGE_TAG) .
|
||||||
|
|
||||||
|
run:
|
||||||
|
docker run -it --rm $(IMAGE_NAME):$(IMAGE_TAG) bash
|
||||||
|
|
||||||
|
clean:
|
||||||
|
docker rmi $(IMAGE_NAME):$(IMAGE_TAG) || true
|
||||||
239
README.md
Normal file
239
README.md
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
# Lovdata Chat Interface
|
||||||
|
|
||||||
|
A web-based chat interface that allows users to interact with Large Language Models (LLMs) equipped with Norwegian legal research tools from the Lovdata MCP server.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
This project creates a chat interface where users can:
|
||||||
|
- Choose from multiple LLM providers (OpenAI, Anthropic, Google Gemini)
|
||||||
|
- Have conversations enhanced with Norwegian legal document search capabilities
|
||||||
|
- Access laws, regulations, and legal provisions through AI-powered semantic search
|
||||||
|
- Receive properly cited legal information with cross-references
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Backend (FastAPI)
|
||||||
|
- **LLM Provider Layer**: Abstract interface supporting multiple LLM providers with tool calling
|
||||||
|
- **MCP Integration**: Client connection to lovdata-ai MCP server
|
||||||
|
- **Skill System**: Norwegian legal research guidance and best practices
|
||||||
|
- **Chat Management**: Conversation history, streaming responses, session management
|
||||||
|
|
||||||
|
### Frontend (Next.js)
|
||||||
|
- **Chat Interface**: Real-time messaging with streaming responses
|
||||||
|
- **Model Selector**: Dropdown to choose LLM provider and model
|
||||||
|
- **Tool Visualization**: Display when legal tools are being used
|
||||||
|
- **Citation Rendering**: Properly formatted legal references and cross-references
|
||||||
|
|
||||||
|
### External Dependencies
|
||||||
|
- **Lovdata MCP Server**: Provides 15+ tools for Norwegian legal research
|
||||||
|
- **PostgreSQL Database**: Vector embeddings for semantic search
|
||||||
|
- **LLM APIs**: OpenAI, Anthropic, Google Gemini (with API keys)
|
||||||
|
|
||||||
|
## Supported LLM Providers
|
||||||
|
|
||||||
|
| Provider | Models | Tool Support | Notes |
|
||||||
|
|----------|--------|--------------|-------|
|
||||||
|
| OpenAI | GPT-4, GPT-4o | ✅ Native | Requires API key |
|
||||||
|
| Anthropic | Claude-3.5-Sonnet | ✅ Native | Requires API key |
|
||||||
|
| Google | Gemini-1.5-Pro | ✅ Function calling | Requires API key |
|
||||||
|
| Local | Ollama models | ⚠️ Limited | Self-hosted option |
|
||||||
|
|
||||||
|
## MCP Tools Available
|
||||||
|
|
||||||
|
The interface integrates all tools from the lovdata-ai MCP server:
|
||||||
|
|
||||||
|
### Law Document Tools
|
||||||
|
- `get_law`: Retrieve specific laws by ID or title
|
||||||
|
- `list_laws`: Browse laws with filtering and pagination
|
||||||
|
- `get_law_content`: Get HTML content of laws
|
||||||
|
- `get_law_text`: Get plain text content
|
||||||
|
|
||||||
|
### Search Tools
|
||||||
|
- `search_laws_fulltext`: Full-text search in laws
|
||||||
|
- `search_laws_semantic`: Semantic search using vector embeddings
|
||||||
|
- `search_provisions_fulltext`: Full-text search in provisions
|
||||||
|
- `search_provisions_semantic`: Semantic search in provisions
|
||||||
|
|
||||||
|
### Provision Tools
|
||||||
|
- `get_provision`: Get individual legal provisions
|
||||||
|
- `list_provisions`: List all provisions in a law
|
||||||
|
- `get_provisions_batch`: Bulk retrieval for RAG applications
|
||||||
|
|
||||||
|
### Reference Tools
|
||||||
|
- `get_cross_references`: Find references from/to provisions
|
||||||
|
- `resolve_reference`: Parse legal reference strings (e.g., "lov/2014-06-20-42/§8")
|
||||||
|
|
||||||
|
## Skills Integration
|
||||||
|
|
||||||
|
The system loads Norwegian legal research skills that ensure:
|
||||||
|
- Proper citation standards (Lovdata URL formatting)
|
||||||
|
- Appropriate legal terminology usage
|
||||||
|
- Clear distinction between information and legal advice
|
||||||
|
- Systematic amendment tracking
|
||||||
|
- Cross-reference analysis
|
||||||
|
|
||||||
|
## Implementation Plan
|
||||||
|
|
||||||
|
### Phase 1: Core Infrastructure
|
||||||
|
1. **Project Structure Setup**
|
||||||
|
- Create backend (FastAPI) and frontend (Next.js) directories
|
||||||
|
- Set up Python virtual environment and Node.js dependencies
|
||||||
|
- Configure development tooling (linting, testing, formatting)
|
||||||
|
|
||||||
|
2. **LLM Provider Abstraction**
|
||||||
|
- Create abstract base class for LLM providers
|
||||||
|
- Implement OpenAI, Anthropic, and Google Gemini clients
|
||||||
|
- Add tool calling support and response streaming
|
||||||
|
- Implement provider switching logic
|
||||||
|
|
||||||
|
3. **MCP Server Integration**
|
||||||
|
- Build MCP client to connect to lovdata-ai server
|
||||||
|
- Create tool registry and execution pipeline
|
||||||
|
- Add error handling and retry logic
|
||||||
|
- Implement tool result formatting for LLM consumption
|
||||||
|
|
||||||
|
### Phase 2: Chat Functionality
|
||||||
|
4. **Backend API Development**
|
||||||
|
- Create chat session management endpoints
|
||||||
|
- Implement conversation history storage
|
||||||
|
- Add streaming response support
|
||||||
|
- Build health check and monitoring endpoints
|
||||||
|
|
||||||
|
5. **Skill System Implementation**
|
||||||
|
- Create skill loading and parsing system
|
||||||
|
- Implement skill application to LLM prompts
|
||||||
|
- Add skill validation and error handling
|
||||||
|
- Create skill management API endpoints
|
||||||
|
|
||||||
|
### Phase 3: Frontend Development
|
||||||
|
6. **Chat Interface**
|
||||||
|
- Build responsive chat UI with message history
|
||||||
|
- Implement real-time message streaming
|
||||||
|
- Add message formatting for legal citations
|
||||||
|
- Create conversation management (new chat, clear history)
|
||||||
|
|
||||||
|
7. **Model Selection UI**
|
||||||
|
- Create LLM provider and model selector
|
||||||
|
- Add API key management (secure storage)
|
||||||
|
- Implement model switching during conversations
|
||||||
|
- Add model capability indicators
|
||||||
|
|
||||||
|
8. **Tool Usage Visualization**
|
||||||
|
- Display when MCP tools are being used
|
||||||
|
- Show tool execution results in chat
|
||||||
|
- Add legal citation formatting
|
||||||
|
- Create expandable tool result views
|
||||||
|
|
||||||
|
### Phase 4: Deployment & Production
|
||||||
|
9. **Containerization**
|
||||||
|
- Create Dockerfiles for backend and frontend
|
||||||
|
- Set up Docker Compose for development
|
||||||
|
- Configure production Docker Compose
|
||||||
|
- Add environment variable management
|
||||||
|
|
||||||
|
10. **Deployment Configuration**
|
||||||
|
- Set up CI/CD pipeline (GitHub Actions)
|
||||||
|
- Configure cloud deployment (Railway/Render)
|
||||||
|
- Add reverse proxy configuration
|
||||||
|
- Implement SSL certificate management
|
||||||
|
|
||||||
|
11. **Monitoring & Error Handling**
|
||||||
|
- Add comprehensive logging
|
||||||
|
- Implement error tracking and reporting
|
||||||
|
- Create health check endpoints
|
||||||
|
- Add rate limiting and abuse protection
|
||||||
|
|
||||||
|
12. **Documentation**
|
||||||
|
- Create setup and deployment guides
|
||||||
|
- Document API endpoints
|
||||||
|
- Add user documentation
|
||||||
|
- Create troubleshooting guides
|
||||||
|
|
||||||
|
## Development Setup
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
- Python 3.12+
|
||||||
|
- Node.js 18+
|
||||||
|
- Docker and Docker Compose
|
||||||
|
- API keys for desired LLM providers
|
||||||
|
|
||||||
|
### Local Development
|
||||||
|
```bash
|
||||||
|
# Clone and setup
|
||||||
|
git clone <repository>
|
||||||
|
cd lovdata-chat
|
||||||
|
|
||||||
|
# Backend setup
|
||||||
|
cd backend
|
||||||
|
python -m venv venv
|
||||||
|
source venv/bin/activate # On Windows: venv\Scripts\activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Frontend setup
|
||||||
|
cd ../frontend
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# Start development servers
|
||||||
|
docker-compose -f docker-compose.dev.yml up
|
||||||
|
```
|
||||||
|
|
||||||
|
### Environment Variables
|
||||||
|
```bash
|
||||||
|
# Backend
|
||||||
|
LOVDATA_MCP_URL=http://localhost:8001
|
||||||
|
OPENAI_API_KEY=your_key_here
|
||||||
|
ANTHROPIC_API_KEY=your_key_here
|
||||||
|
GOOGLE_API_KEY=your_key_here
|
||||||
|
|
||||||
|
# Frontend
|
||||||
|
NEXT_PUBLIC_API_URL=http://localhost:8000
|
||||||
|
```
|
||||||
|
|
||||||
|
## Deployment Options
|
||||||
|
|
||||||
|
### Cloud Deployment (Recommended)
|
||||||
|
- **Frontend**: Vercel or Netlify
|
||||||
|
- **Backend**: Railway, Render, or Fly.io
|
||||||
|
- **Database**: Use existing lovdata-ai PostgreSQL instance
|
||||||
|
|
||||||
|
### Self-Hosted Deployment
|
||||||
|
- **Docker Compose**: Full stack containerization
|
||||||
|
- **Reverse Proxy**: Nginx or Caddy
|
||||||
|
- **SSL**: Let's Encrypt automatic certificates
|
||||||
|
|
||||||
|
## Security Considerations
|
||||||
|
|
||||||
|
- API keys stored securely (environment variables, secret management)
|
||||||
|
- Rate limiting on chat endpoints
|
||||||
|
- Input validation and sanitization
|
||||||
|
- CORS configuration for frontend-backend communication
|
||||||
|
- Audit logging for legal tool usage
|
||||||
|
|
||||||
|
## Performance Optimization
|
||||||
|
|
||||||
|
- Response streaming for real-time chat experience
|
||||||
|
- MCP tool result caching
|
||||||
|
- Conversation history pagination
|
||||||
|
- Lazy loading of legal document content
|
||||||
|
- CDN for static frontend assets
|
||||||
|
|
||||||
|
## Future Enhancements
|
||||||
|
|
||||||
|
- User authentication and conversation persistence
|
||||||
|
- Advanced citation management and export
|
||||||
|
- Integration with legal research workflows
|
||||||
|
- Multi-language support beyond Norwegian
|
||||||
|
- Advanced analytics and usage tracking
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
1. Follow the implementation plan phases
|
||||||
|
2. Ensure comprehensive testing for LLM integrations
|
||||||
|
3. Document API changes and new features
|
||||||
|
4. Maintain security best practices for API key handling
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Status**: Planning phase complete. Ready for implementation.
|
||||||
|
|
||||||
|
**Next Steps**: Begin with Phase 1 - Project Structure Setup
|
||||||
17
config_opencode/opencode.jsonc
Normal file
17
config_opencode/opencode.jsonc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://opencode.ai/config.json",
|
||||||
|
"theme": "opencode",
|
||||||
|
"autoupdate": false,
|
||||||
|
"plugin": [],
|
||||||
|
"mcp": {
|
||||||
|
"sequential-thinking": {
|
||||||
|
"type": "local",
|
||||||
|
"command": [
|
||||||
|
"npx",
|
||||||
|
"-y",
|
||||||
|
"@modelcontextprotocol/server-sequential-thinking"
|
||||||
|
],
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
965
config_opencode/skills/norwegian-legal-queries/SKILL.md
Normal file
965
config_opencode/skills/norwegian-legal-queries/SKILL.md
Normal file
@@ -0,0 +1,965 @@
|
|||||||
|
---
|
||||||
|
name: norwegian-legal-research
|
||||||
|
description: Use when researching Norwegian legal questions, laws, regulations, or legal concepts to ensure proper Lovdata citations and accurate Norwegian legal explanations
|
||||||
|
---
|
||||||
|
|
||||||
|
# Norwegian Legal Research
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
Guide AI agents in conducting proper Norwegian legal research using Lovdata.no sources, providing accurate citations, and explaining legal concepts in appropriate Norwegian contexts.
|
||||||
|
|
||||||
|
**Core principles:**
|
||||||
|
- Always cite specific Lovdata URLs with amendment dates
|
||||||
|
- Explain legal concepts in clear Norwegian
|
||||||
|
- Distinguish between laws (lover) and regulations (forskrifter)
|
||||||
|
- Consider hierarchical legal structure and cross-references
|
||||||
|
|
||||||
|
**Announce at start:** "I'm using the norwegian-legal-research skill to ensure proper legal research methodology."
|
||||||
|
|
||||||
|
## Citation Standards
|
||||||
|
|
||||||
|
## Citation Standards
|
||||||
|
|
||||||
|
### Lovdata URL Citations
|
||||||
|
**REQUIRED FORMAT:**
|
||||||
|
```
|
||||||
|
https://lovdata.no/lov/[YEAR]/[NUMBER]/[SECTION]
|
||||||
|
https://lovdata.no/forskrift/[YEAR]/[NUMBER]/[SECTION]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Complete Citation Structure:**
|
||||||
|
```
|
||||||
|
[Law/Regulation Name] ([Short Form] [Date]), [Section Reference]
|
||||||
|
[Full Lovdata URL]
|
||||||
|
```
|
||||||
|
|
||||||
|
**Examples by Document Type:**
|
||||||
|
|
||||||
|
**Laws (Lover):**
|
||||||
|
- `https://lovdata.no/lov/1999-07-16-65/§8` - Health Personnel Act §8
|
||||||
|
- `https://lovdata.no/lov/2005-06-17-64/§2-1` - Working Environment Act §2-1
|
||||||
|
- `https://lovdata.no/lov/2018-06-15-38/§13` - Personal Data Act §13
|
||||||
|
|
||||||
|
**Regulations (Forskrifter):**
|
||||||
|
- `https://lovdata.no/forskrift/2021-12-15-1234/§5` - GDPR Implementation Regulation §5
|
||||||
|
- `https://lovdata.no/forskrift/2019-12-20-2358/§12` - Accounting Regulation §12
|
||||||
|
|
||||||
|
**Gazette Provisions (Lovtidend):**
|
||||||
|
- `https://lovdata.no/lti/lov/2024-01-15-123/§3` - Gazette law provision
|
||||||
|
|
||||||
|
### Amendment References
|
||||||
|
**Include amendment dates and sources:**
|
||||||
|
|
||||||
|
**Single Amendment:**
|
||||||
|
- "According to §8 of the Health Personnel Act (lov 1999-07-16-65), as amended by law 2023-06-16-50..."
|
||||||
|
|
||||||
|
**Multiple Amendments:**
|
||||||
|
- "Pursuant to §2-1 of the Working Environment Act (lov 2005-06-17-64), with amendments through laws 2018-12-14-126 and 2022-03-18-11..."
|
||||||
|
|
||||||
|
**Transitional Provisions:**
|
||||||
|
- "Section 13 of the Personal Data Act (lov 2018-06-15-38) applies from 1 July 2023, with transitional provisions in §27..."
|
||||||
|
|
||||||
|
**Amendment History:**
|
||||||
|
- Always check Lovdata for complete amendment history
|
||||||
|
- Note effective dates of changes
|
||||||
|
- Reference the amending law numbers
|
||||||
|
|
||||||
|
### Cross-References
|
||||||
|
**Cite related provisions with context:**
|
||||||
|
|
||||||
|
**Hierarchical References:**
|
||||||
|
- "See Chapter 2 of the Health Personnel Act for qualification requirements"
|
||||||
|
- "Compare with §4 of the Patients' Rights Act (lov 1999-07-16-63)"
|
||||||
|
|
||||||
|
**Related Legislation:**
|
||||||
|
- "This provision cross-references §13 of the Personal Data Act"
|
||||||
|
- "See also regulation 2021-12-15-1234 §5 for implementation details"
|
||||||
|
|
||||||
|
**Case Law References:**
|
||||||
|
- "As interpreted by the Supreme Court in Rt-2023-1234"
|
||||||
|
- "See EFTA Court case E-1/23 for EU law interpretation"
|
||||||
|
|
||||||
|
### Citation Validation
|
||||||
|
**Before finalizing citations:**
|
||||||
|
|
||||||
|
**URL Verification:**
|
||||||
|
- Ensure all Lovdata URLs are accessible and current
|
||||||
|
- Check that section references exist in the cited version
|
||||||
|
- Verify amendment dates match the document
|
||||||
|
|
||||||
|
**Amendment Accuracy:**
|
||||||
|
- Confirm amending law numbers are correct
|
||||||
|
- Validate effective dates of amendments
|
||||||
|
- Check for any subsequent amendments
|
||||||
|
|
||||||
|
**Cross-Reference Integrity:**
|
||||||
|
- Verify referenced provisions exist
|
||||||
|
- Ensure hierarchical relationships are accurate
|
||||||
|
- Confirm amendment status of cross-referenced sections
|
||||||
|
|
||||||
|
### Common Citation Errors
|
||||||
|
**AVOID these mistakes:**
|
||||||
|
|
||||||
|
❌ **Missing Amendment Dates:**
|
||||||
|
- Wrong: "According to §8 of the Health Personnel Act..."
|
||||||
|
- Right: "According to §8 of the Health Personnel Act (lov 1999-07-16-65), as amended by law 2023-06-16-50..."
|
||||||
|
|
||||||
|
❌ **Incorrect URL Format:**
|
||||||
|
- Wrong: `https://lovdata.no/lov/1999/65/§8`
|
||||||
|
- Right: `https://lovdata.no/lov/1999-07-16-65/§8`
|
||||||
|
|
||||||
|
❌ **Outdated Citations:**
|
||||||
|
- Always verify current amendment status
|
||||||
|
- Check for newer versions of regulations
|
||||||
|
|
||||||
|
❌ **Incomplete Cross-References:**
|
||||||
|
- Include both the referenced provision and its relationship
|
||||||
|
- Note any conditions or limitations
|
||||||
|
|
||||||
|
### Citation Examples
|
||||||
|
**Complete Citation Patterns:**
|
||||||
|
|
||||||
|
**Basic Law Citation:**
|
||||||
|
```
|
||||||
|
Health Personnel Act §8 (lov 1999-07-16-65)
|
||||||
|
https://lovdata.no/lov/1999-07-16-65/§8
|
||||||
|
```
|
||||||
|
|
||||||
|
**Amended Regulation:**
|
||||||
|
```
|
||||||
|
GDPR Implementation Regulation §5 (forskrift 2021-12-15-1234),
|
||||||
|
as amended by regulation 2023-06-23-789
|
||||||
|
https://lovdata.no/forskrift/2021-12-15-1234/§5
|
||||||
|
```
|
||||||
|
|
||||||
|
**Cross-Referenced Provisions:**
|
||||||
|
```
|
||||||
|
Working Environment Act §2-1 (lov 2005-06-17-64), see also
|
||||||
|
Chapter 2 for detailed qualification requirements
|
||||||
|
https://lovdata.no/lov/2005-06-17-64/§2-1
|
||||||
|
```
|
||||||
|
|
||||||
|
## Research Methodology
|
||||||
|
## Research Methodology
|
||||||
|
|
||||||
|
### Initial Assessment
|
||||||
|
**Determine research scope and approach:**
|
||||||
|
|
||||||
|
**Question Analysis:**
|
||||||
|
- Identify the legal domain (health, employment, data protection, etc.)
|
||||||
|
- Determine if primary legislation or secondary regulations are needed
|
||||||
|
- Assess whether case law or administrative interpretations are relevant
|
||||||
|
- Consider regional variations (mainland Norway vs territories)
|
||||||
|
|
||||||
|
**Source Prioritization:**
|
||||||
|
1. **Constitution (Grunnloven)** - For fundamental rights questions
|
||||||
|
2. **Primary Legislation (Lover)** - Main legal framework
|
||||||
|
3. **Secondary Legislation (Forskrifter)** - Implementation details
|
||||||
|
4. **Case Law (Domstol)** - Judicial interpretations
|
||||||
|
5. **Administrative Guidance** - Agency interpretations
|
||||||
|
|
||||||
|
### Source Selection Strategy
|
||||||
|
**Laws vs Regulations Decision Tree:**
|
||||||
|
|
||||||
|
**Use Laws (Lover) when:**
|
||||||
|
- Establishing fundamental legal principles
|
||||||
|
- Constitutional rights are involved
|
||||||
|
- Primary legal obligations need definition
|
||||||
|
- Framework legislation is required
|
||||||
|
|
||||||
|
**Use Regulations (Forskrifter) when:**
|
||||||
|
- Implementation details are needed
|
||||||
|
- Technical specifications are required
|
||||||
|
- Administrative procedures are involved
|
||||||
|
- Sector-specific rules apply
|
||||||
|
|
||||||
|
**Search Both Sources when:**
|
||||||
|
- Uncertain about legal basis
|
||||||
|
- Comprehensive analysis required
|
||||||
|
- Implementation details may affect interpretation
|
||||||
|
- Cross-domain issues (e.g., health + data protection)
|
||||||
|
|
||||||
|
### Hierarchical Navigation
|
||||||
|
**Understanding Norwegian Legal Structure:**
|
||||||
|
|
||||||
|
**Constitutional Level:**
|
||||||
|
- **Grunnloven (Constitution)** - Supreme law, fundamental rights
|
||||||
|
- **Menneskerettighetsloven** - Human rights implementation
|
||||||
|
|
||||||
|
**Primary Legislation:**
|
||||||
|
- **Lover (Acts)** - Framework laws passed by Stortinget
|
||||||
|
- Organized by subject areas (health, employment, environment, etc.)
|
||||||
|
- Numbered sequentially by year (e.g., 1999-07-16-65)
|
||||||
|
|
||||||
|
**Secondary Legislation:**
|
||||||
|
- **Forskrifter (Regulations)** - Issued by ministries or agencies
|
||||||
|
- Implement and detail primary legislation
|
||||||
|
- Include technical standards and administrative procedures
|
||||||
|
|
||||||
|
**Case Law and Interpretations:**
|
||||||
|
- **Høyesterett (Supreme Court)** - Rt-series citations
|
||||||
|
- **Lagmannsrett (Court of Appeal)** - Regional interpretations
|
||||||
|
- **Tingrett (District Court)** - First instance decisions
|
||||||
|
|
||||||
|
### Amendment Tracking Process
|
||||||
|
**Systematic amendment verification:**
|
||||||
|
|
||||||
|
**Current Status Check:**
|
||||||
|
- Access Lovdata.no for each relevant provision
|
||||||
|
- Review "Endringer" (Changes) section for amendment history
|
||||||
|
- Note effective dates and amending law numbers
|
||||||
|
|
||||||
|
**Amendment Impact Assessment:**
|
||||||
|
- Determine if amendments change substantive rights/obligations
|
||||||
|
- Check for transitional provisions
|
||||||
|
- Assess whether amendments affect interpretation of related provisions
|
||||||
|
|
||||||
|
**Temporal Considerations:**
|
||||||
|
- Note when provisions came into force
|
||||||
|
- Check for sunset clauses or review dates
|
||||||
|
- Consider pending legislative changes
|
||||||
|
|
||||||
|
### Research Workflows
|
||||||
|
**Structured research approaches:**
|
||||||
|
|
||||||
|
**Basic Legal Research:**
|
||||||
|
1. Identify relevant legal domain
|
||||||
|
2. Search primary legislation first
|
||||||
|
3. Check for implementing regulations
|
||||||
|
4. Verify current amendment status
|
||||||
|
5. Note cross-references to related provisions
|
||||||
|
|
||||||
|
**Complex Multi-Domain Research:**
|
||||||
|
1. Map all potentially relevant legal areas
|
||||||
|
2. Prioritize sources by legal hierarchy
|
||||||
|
3. Search systematically through each domain
|
||||||
|
4. Identify and resolve conflicts between provisions
|
||||||
|
5. Document comprehensive amendment history
|
||||||
|
|
||||||
|
**Amendment Impact Analysis:**
|
||||||
|
1. Establish baseline (original provision)
|
||||||
|
2. Track each amendment chronologically
|
||||||
|
3. Assess cumulative impact of changes
|
||||||
|
4. Identify any transitional provisions
|
||||||
|
5. Note effective dates and implementation requirements
|
||||||
|
|
||||||
|
### Search Strategy Optimization
|
||||||
|
**Effective information retrieval:**
|
||||||
|
|
||||||
|
**Keyword Selection:**
|
||||||
|
- Use Norwegian legal terminology
|
||||||
|
- Include both formal and common terms
|
||||||
|
- Consider synonyms and related concepts
|
||||||
|
- Search in both Norwegian and relevant English terms
|
||||||
|
|
||||||
|
**Boolean Search Techniques:**
|
||||||
|
- Use AND for combining concepts
|
||||||
|
- Use OR for alternative terms
|
||||||
|
- Use quotes for exact phrases
|
||||||
|
- Use wildcards for variations
|
||||||
|
|
||||||
|
**Source-Specific Strategies:**
|
||||||
|
- **Lovdata**: Use advanced search filters by date, type, subject
|
||||||
|
- **Vector Search**: Use semantic search for conceptual queries
|
||||||
|
- **Cross-References**: Follow provision linkages systematically
|
||||||
|
|
||||||
|
### Validation Procedures
|
||||||
|
**Ensuring research accuracy:**
|
||||||
|
|
||||||
|
**Source Verification:**
|
||||||
|
- Confirm all cited URLs are accessible
|
||||||
|
- Validate amendment dates against official sources
|
||||||
|
- Cross-check provision numbers and hierarchies
|
||||||
|
|
||||||
|
**Legal Consistency Check:**
|
||||||
|
- Ensure interpretations align with established case law
|
||||||
|
- Verify compatibility between related provisions
|
||||||
|
- Check for any conflicting regulations
|
||||||
|
|
||||||
|
**Completeness Assessment:**
|
||||||
|
- Confirm all relevant provisions have been identified
|
||||||
|
- Verify amendment history is complete
|
||||||
|
- Ensure cross-references are comprehensive
|
||||||
|
|
||||||
|
### Common Research Pitfalls
|
||||||
|
**Avoid these methodological errors:**
|
||||||
|
|
||||||
|
❌ **Over-Reliance on Single Sources:**
|
||||||
|
- Always check multiple sources for comprehensive understanding
|
||||||
|
- Don't assume regulations cover all implementation details
|
||||||
|
|
||||||
|
❌ **Ignoring Amendment History:**
|
||||||
|
- Amendments can fundamentally change legal obligations
|
||||||
|
- Always check "Endringer" section on Lovdata
|
||||||
|
|
||||||
|
❌ **Missing Hierarchical Context:**
|
||||||
|
- Provisions must be understood within their legal framework
|
||||||
|
- Chapter and section context affects interpretation
|
||||||
|
|
||||||
|
❌ **Incomplete Cross-Reference Analysis:**
|
||||||
|
- Related provisions often clarify or limit main provisions
|
||||||
|
- Cross-references may indicate exceptions or special rules
|
||||||
|
|
||||||
|
### Research Documentation
|
||||||
|
**Maintain comprehensive records:**
|
||||||
|
|
||||||
|
**Research Log:**
|
||||||
|
- Document search terms and strategies used
|
||||||
|
- Record sources consulted and dates accessed
|
||||||
|
- Note any dead ends or unproductive searches
|
||||||
|
|
||||||
|
**Citation Trail:**
|
||||||
|
- Maintain complete citation history
|
||||||
|
- Document amendment verification steps
|
||||||
|
- Record cross-reference analysis
|
||||||
|
|
||||||
|
**Decision Rationale:**
|
||||||
|
- Explain why certain sources were prioritized
|
||||||
|
- Document interpretation decisions
|
||||||
|
- Note any uncertainties or assumptions
|
||||||
|
|
||||||
|
## Language & Communication
|
||||||
|
## Language & Communication
|
||||||
|
|
||||||
|
### Norwegian Legal Terminology
|
||||||
|
**Essential legal vocabulary with explanations:**
|
||||||
|
|
||||||
|
**Constitutional & Fundamental Concepts:**
|
||||||
|
- **Grunnloven** (Constitution) - Supreme law establishing government structure and fundamental rights
|
||||||
|
- **Menneskerettigheter** (Human rights) - Universal rights protected under Norwegian law
|
||||||
|
- **Rettstat** (Rule of law) - Principle that all must follow the law
|
||||||
|
- **Likhet for loven** (Equality before the law) - All persons treated equally under legal system
|
||||||
|
|
||||||
|
**Legal Entities & Subjects:**
|
||||||
|
- **Rettssubjekt** (Legal subject) - Entity with legal rights and obligations
|
||||||
|
- **Rettsperson** (Legal person) - Corporation or organization with legal personality
|
||||||
|
- **Fysiske personer** (Natural persons) - Individual human beings
|
||||||
|
- **Juridisk person** (Juridical person) - Legal entity separate from its members
|
||||||
|
|
||||||
|
**Legal Proceedings & Actions:**
|
||||||
|
- **Påtale** (Prosecution) - Criminal proceedings initiated by public authorities
|
||||||
|
- **Søksmål** (Lawsuit) - Civil legal action between parties
|
||||||
|
- **Anke** (Appeal) - Request for higher court to review decision
|
||||||
|
- **Dom** (Judgment) - Court decision resolving legal dispute
|
||||||
|
|
||||||
|
**Legal Obligations & Rights:**
|
||||||
|
- **Plikt** (Duty/Obligation) - Legal requirement to act or refrain from acting
|
||||||
|
- **Rettighet** (Right) - Legally protected entitlement
|
||||||
|
- **Ansvar** (Liability/Responsibility) - Legal accountability for actions
|
||||||
|
- **Erstatning** (Compensation) - Monetary redress for harm or loss
|
||||||
|
|
||||||
|
**Administrative & Regulatory Terms:**
|
||||||
|
- **Forskrift** (Regulation) - Secondary legislation issued by executive branch
|
||||||
|
- **Tillatelse** (Permit/License) - Official permission required for certain activities
|
||||||
|
- **Krav** (Requirement) - Mandatory condition or standard
|
||||||
|
- **Sanksjon** (Sanction) - Penalty for non-compliance
|
||||||
|
|
||||||
|
**Contract & Commercial Terms:**
|
||||||
|
- **Avtale** (Agreement/Contract) - Legally binding arrangement between parties
|
||||||
|
- **Partsforhold** (Privity of contract) - Legal relationship between contracting parties
|
||||||
|
- **Motytelse** (Consideration) - Something of value exchanged in contract
|
||||||
|
- **Heving** (Rescission) - Cancellation of contract due to breach
|
||||||
|
|
||||||
|
**Property & Ownership Terms:**
|
||||||
|
- **Eiendom** (Property) - Rights over tangible or intangible assets
|
||||||
|
- **Eierskap** (Ownership) - Legal right to possess and control property
|
||||||
|
- **Tinglysing** (Registration) - Official recording of property rights
|
||||||
|
- **Pant** (Mortgage/Pledge) - Security interest in property
|
||||||
|
|
||||||
|
**Employment & Labor Terms:**
|
||||||
|
- **Arbeidsgiver** (Employer) - Entity employing workers
|
||||||
|
- **Arbeidstaker** (Employee) - Person performing work for employer
|
||||||
|
- **Arbeidsavtale** (Employment contract) - Agreement governing employment relationship
|
||||||
|
- **Oppsigelse** (Termination) - Ending of employment relationship
|
||||||
|
|
||||||
|
**Health & Social Services Terms:**
|
||||||
|
- **Pasientrettigheter** (Patient rights) - Legal protections for healthcare recipients
|
||||||
|
- **Samtykke** (Consent) - Voluntary agreement to medical treatment
|
||||||
|
- **Taushetsplikt** (Confidentiality duty) - Obligation to maintain secrecy
|
||||||
|
- **Behandlingsansvar** (Treatment responsibility) - Accountability for medical care
|
||||||
|
|
||||||
|
### Plain Language Communication
|
||||||
|
**Tailor communication to audience needs:**
|
||||||
|
|
||||||
|
**General Public Communication:**
|
||||||
|
- Use everyday Norwegian vocabulary
|
||||||
|
- Explain legal concepts through familiar examples
|
||||||
|
- Avoid Latin legal phrases (substitute with Norwegian equivalents)
|
||||||
|
- Provide practical implications, not just legal rules
|
||||||
|
|
||||||
|
**Professional Legal Communication:**
|
||||||
|
- Employ precise legal terminology when appropriate
|
||||||
|
- Reference specific law sections and amendment dates
|
||||||
|
- Use established legal interpretations and precedents
|
||||||
|
- Maintain formal, objective tone
|
||||||
|
|
||||||
|
**Technical & Specialized Contexts:**
|
||||||
|
- Balance technical accuracy with accessibility
|
||||||
|
- Define specialized terms when first used
|
||||||
|
- Provide both legal and practical perspectives
|
||||||
|
- Include implementation guidance where relevant
|
||||||
|
|
||||||
|
### Audience Adaptation Strategies
|
||||||
|
**Adjust communication based on context:**
|
||||||
|
|
||||||
|
**Individual Citizens:**
|
||||||
|
- Focus on personal rights and obligations
|
||||||
|
- Explain practical steps and procedures
|
||||||
|
- Use concrete examples from daily life
|
||||||
|
- Emphasize available remedies and protections
|
||||||
|
|
||||||
|
**Business Entities:**
|
||||||
|
- Highlight compliance requirements and risks
|
||||||
|
- Explain operational impacts of legal rules
|
||||||
|
- Provide risk management strategies
|
||||||
|
- Note reporting and documentation obligations
|
||||||
|
|
||||||
|
**Government & Public Sector:**
|
||||||
|
- Reference hierarchical legal frameworks
|
||||||
|
- Explain delegation and implementation authorities
|
||||||
|
- Note coordination requirements between agencies
|
||||||
|
- Emphasize public interest considerations
|
||||||
|
|
||||||
|
**Legal Professionals:**
|
||||||
|
- Use precise legal terminology and citations
|
||||||
|
- Reference case law and administrative interpretations
|
||||||
|
- Analyze legal relationships and hierarchies
|
||||||
|
- Consider strategic implications and precedents
|
||||||
|
|
||||||
|
### Cultural Context in Norwegian Law
|
||||||
|
**Understanding Norwegian legal culture:**
|
||||||
|
|
||||||
|
**Consensus-Oriented Approach:**
|
||||||
|
- Preference for negotiation over confrontation
|
||||||
|
- Emphasis on compromise and mutual understanding
|
||||||
|
- Administrative processes often prioritize dialogue
|
||||||
|
- Alternative dispute resolution widely used
|
||||||
|
|
||||||
|
**Individual Rights Focus:**
|
||||||
|
- Strong constitutional protections for personal freedoms
|
||||||
|
- Extensive privacy and data protection rights
|
||||||
|
- Worker rights and social protections emphasized
|
||||||
|
- Environmental and sustainability considerations integrated
|
||||||
|
|
||||||
|
**Administrative Law Dominance:**
|
||||||
|
- Extensive regulatory frameworks in most sectors
|
||||||
|
- Administrative agencies have significant interpretive authority
|
||||||
|
- Internal appeals processes before court proceedings
|
||||||
|
- Detailed procedural requirements for administrative actions
|
||||||
|
|
||||||
|
**Nordic Legal Tradition:**
|
||||||
|
- Civil law system with codified statutes
|
||||||
|
- Strong emphasis on legal certainty and predictability
|
||||||
|
- Integration of international human rights standards
|
||||||
|
- Balancing individual rights with community interests
|
||||||
|
|
||||||
|
### Communication Best Practices
|
||||||
|
**Effective legal information delivery:**
|
||||||
|
|
||||||
|
**Clarity Principles:**
|
||||||
|
- Use short sentences and clear structure
|
||||||
|
- Define technical terms when first introduced
|
||||||
|
- Provide examples to illustrate complex concepts
|
||||||
|
- Organize information logically and sequentially
|
||||||
|
|
||||||
|
**Accuracy Standards:**
|
||||||
|
- Ensure all legal information is current and verified
|
||||||
|
- Clearly distinguish between legal requirements and recommendations
|
||||||
|
- Note any uncertainties or areas requiring professional advice
|
||||||
|
- Provide sources for all significant claims
|
||||||
|
|
||||||
|
**Ethical Communication:**
|
||||||
|
- Clearly distinguish legal information from legal advice
|
||||||
|
- Recommend professional consultation for specific situations
|
||||||
|
- Avoid creating false expectations about legal outcomes
|
||||||
|
- Maintain neutrality and objectivity in presentations
|
||||||
|
|
||||||
|
### Multilingual Considerations
|
||||||
|
**Handling Norwegian/English contexts:**
|
||||||
|
|
||||||
|
**Official Language Requirements:**
|
||||||
|
- Norwegian is the official language of Norwegian law
|
||||||
|
- Legal documents must be in Norwegian (bokmål or nynorsk)
|
||||||
|
- Court proceedings conducted in Norwegian
|
||||||
|
- Official communications from authorities in Norwegian
|
||||||
|
|
||||||
|
**International Contexts:**
|
||||||
|
- EU law and international treaties may have English versions
|
||||||
|
- Business contracts often include both languages
|
||||||
|
- Technical standards may be available in English
|
||||||
|
- Academic legal discussions may use English terminology
|
||||||
|
|
||||||
|
**Translation Challenges:**
|
||||||
|
- Legal concepts may not have direct equivalents
|
||||||
|
- Cultural context affects legal interpretations
|
||||||
|
- Norwegian legal terms carry specific historical meanings
|
||||||
|
- Professional translation recommended for important documents
|
||||||
|
|
||||||
|
## System Integration
|
||||||
|
## System Integration
|
||||||
|
|
||||||
|
### Lovdata MCP Tools
|
||||||
|
**Available MCP tools:**
|
||||||
|
|
||||||
|
**Law-Level Tools:**
|
||||||
|
- `get_law(doc_id)` - Retrieve a law or regulation by doc_id or short title
|
||||||
|
- `list_laws(document_type, legal_area, limit, offset)` - List all laws/regulations with filtering
|
||||||
|
- `search_laws_fulltext(query, limit)` - Full-text search in laws (Norwegian)
|
||||||
|
- `search_laws_semantic(query, limit, threshold)` - Semantic search in laws
|
||||||
|
|
||||||
|
**Provision-Level Tools:**
|
||||||
|
- `get_provision(provision_id)` - Get a single provision by ID
|
||||||
|
- `get_provisions_batch(ids)` - Get multiple provisions by IDs (for RAG)
|
||||||
|
- `list_provisions(law_id, limit, offset)` - List all provisions for a law
|
||||||
|
- `search_provisions_fulltext(query, law_id, limit)` - Full-text search in provisions
|
||||||
|
- `search_provisions_semantic(query, law_id, limit, threshold)` - Semantic search in provisions
|
||||||
|
|
||||||
|
**Cross-Reference Tools:**
|
||||||
|
- `get_cross_references(provision_id)` - Get all cross-references from a provision
|
||||||
|
- `get_cross_references_by_law(law_id)` - Get all provisions referencing a law
|
||||||
|
- `resolve_reference(reference)` - Resolve legal reference (e.g., 'lov/2014-06-20-42/§8') to provision
|
||||||
|
|
||||||
|
**Content Retrieval Tools:**
|
||||||
|
- `get_law_content(doc_id)` - Get HTML content of a law/regulation
|
||||||
|
- `get_law_text(doc_id)` - Get plain text content (without HTML tags)
|
||||||
|
|
||||||
|
**System Tools:**
|
||||||
|
- `health_check()` - Check database connection and statistics
|
||||||
|
|
||||||
|
### Query Formulation Strategies
|
||||||
|
**Optimizing search effectiveness:**
|
||||||
|
|
||||||
|
**Semantic Search Best Practices:**
|
||||||
|
- Use `search_laws_semantic` for law-level searches across all laws
|
||||||
|
- Use `search_provisions_semantic` for provision-level searches (optionally filtered by law_id)
|
||||||
|
- Use complete Norwegian phrases rather than single keywords
|
||||||
|
- Include contextual terms that describe the legal situation
|
||||||
|
- Consider both formal legal terminology and common language
|
||||||
|
- Frame queries as complete questions or statements
|
||||||
|
|
||||||
|
**Example Queries:**
|
||||||
|
- Instead of "privacy": "personopplysninger behandling samtykke"
|
||||||
|
- Instead of "contract": "avtale partsforhold motytelse heving"
|
||||||
|
- Instead of "employment": "arbeidsavtale arbeidsgiver arbeidstaker oppsigelse"
|
||||||
|
|
||||||
|
**Full-Text Search Optimization:**
|
||||||
|
- Use Norwegian legal terms with proper spelling
|
||||||
|
- Include section references when known (§8, kapittel 2)
|
||||||
|
- Combine with boolean operators (AND, OR, NOT)
|
||||||
|
- Use quotes for exact phrases
|
||||||
|
|
||||||
|
### Result Interpretation Framework
|
||||||
|
**Evaluating and prioritizing search results:**
|
||||||
|
|
||||||
|
**Relevance Assessment:**
|
||||||
|
- **Semantic Similarity Score**: Higher scores indicate better conceptual match
|
||||||
|
- **Amendment Currency**: Verify provision is current and not superseded
|
||||||
|
- **Hierarchical Context**: Ensure provision fits within legal framework
|
||||||
|
- **Cross-Reference Density**: More connections suggest central importance
|
||||||
|
|
||||||
|
**Result Ranking Strategy:**
|
||||||
|
1. **Primary Relevance**: Direct semantic matches to query
|
||||||
|
2. **Contextual Fit**: Provisions that address the specific legal situation
|
||||||
|
3. **Authority Level**: Prefer laws over regulations when both apply
|
||||||
|
4. **Recency**: More recently amended provisions may be more relevant
|
||||||
|
|
||||||
|
**False Positive Identification:**
|
||||||
|
- Provisions that mention keywords but don't address the legal issue
|
||||||
|
- Outdated provisions that have been significantly amended
|
||||||
|
- Provisions from unrelated legal domains
|
||||||
|
- Generic provisions that don't apply to specific circumstances
|
||||||
|
|
||||||
|
### Integration Patterns
|
||||||
|
**Effective system usage workflows:**
|
||||||
|
|
||||||
|
**Initial Research Query:**
|
||||||
|
1. Start with broad semantic search using `search_laws_semantic` for law-level search or `search_provisions_semantic` for provision-level search
|
||||||
|
2. Review top 10-15 results for relevance
|
||||||
|
3. Identify key provisions and their hierarchical context
|
||||||
|
4. Follow cross-references using `get_cross_references` or `get_cross_references_by_law`
|
||||||
|
|
||||||
|
**Focused Legal Analysis:**
|
||||||
|
1. Use law-level searches (`search_laws_*`) for finding relevant legislation
|
||||||
|
2. Use provision-level searches (`search_provisions_*`) for detailed analysis, optionally filtered by law_id
|
||||||
|
3. Combine semantic and full-text searches for comprehensive coverage
|
||||||
|
4. Track amendment history by checking the law metadata
|
||||||
|
5. Build citation network using cross-reference tools
|
||||||
|
|
||||||
|
**Amendment Impact Assessment:**
|
||||||
|
1. Search for provisions using original enactment dates
|
||||||
|
2. Identify all amending legislation
|
||||||
|
3. Assess cumulative impact of changes
|
||||||
|
4. Verify effective dates and transitional provisions
|
||||||
|
|
||||||
|
### Data Model Understanding
|
||||||
|
**How the MCP server organizes legal data:**
|
||||||
|
|
||||||
|
**Two-Level Structure:**
|
||||||
|
- **Laws/Regulations**: Document-level metadata (titles, dates, legal areas)
|
||||||
|
- **Provisions**: Individual legal provisions within each law/regulation
|
||||||
|
|
||||||
|
**Key Concepts:**
|
||||||
|
- `doc_id`: Unique identifier (e.g., 'NL/lov/2014-06-20-42')
|
||||||
|
- `korttittel`: Short title for easy reference (e.g., 'Pasientjournalloven')
|
||||||
|
- `provision_id`: Unique identifier for individual provisions
|
||||||
|
- `provision_text`: Full text of the legal provision
|
||||||
|
|
||||||
|
**Search Capabilities:**
|
||||||
|
- **Semantic search**: Uses vector embeddings for conceptual matching
|
||||||
|
- **Full-text search**: Uses PostgreSQL for keyword matching
|
||||||
|
- **Cross-references**: Links between related provisions
|
||||||
|
|
||||||
|
**Hierarchical Provision Structure:**
|
||||||
|
- `book_num`, `chapter_num`, `article_num`, `paragraph_num`
|
||||||
|
- Text-based numbering supports Norwegian conventions ("8a", "III", "første ledd")
|
||||||
|
- Parent-child relationships between provisions
|
||||||
|
|
||||||
|
### Document Identification
|
||||||
|
**Working with Norwegian legal documents:**
|
||||||
|
|
||||||
|
**Document Identifiers:**
|
||||||
|
|
||||||
|
Norwegian legal documents use standardized identifiers in the system. It is **CRITICAL** to use the correct prefix:
|
||||||
|
- **Laws (Norges Lover):** `NL/lov/YYYY-MM-DD-NN` (e.g., `NL/lov/2014-06-20-42`)
|
||||||
|
- **Central Regulations (Sentrale Forskrifter):** `SF/forskrift/YYYY-MM-DD-NN` (e.g., `SF/forskrift/2005-06-17-610`)
|
||||||
|
- **Local Regulations (Lokale Forskrifter):** `LF/forskrift/YYYY-MM-DD-NN`
|
||||||
|
- **Short title (korttittel):** Common name (e.g., `Pasientjournalloven`)
|
||||||
|
|
||||||
|
**IMPORTANT:** When using `get_law` or other tools with a `doc_id`, you MUST include the full prefix (e.g., `SF/forskrift/...`). Using just the date/number (e.g., `FOR-2005-06-17-610`) will often fail.
|
||||||
|
|
||||||
|
**The MCP Tool:**
|
||||||
|
|
||||||
|
Use `get_law(doc_id)` for all law and regulation retrieval:
|
||||||
|
- Accepts full doc_id for laws: `get_law("NL/lov/2014-06-20-42")`
|
||||||
|
- Accepts full doc_id for regulations: `get_law("SF/forskrift/2005-06-17-610")`
|
||||||
|
- Accepts short title: `get_law("Pasientjournalloven")`
|
||||||
|
- Works for both laws (lov) and regulations (forskrift)
|
||||||
|
|
||||||
|
**Example Workflows:**
|
||||||
|
|
||||||
|
**From Search Results:**
|
||||||
|
```
|
||||||
|
1. Search: search_laws_fulltext("helseregisterloven")
|
||||||
|
2. Results include: {
|
||||||
|
"doc_id": "NL/lov/2014-06-20-42",
|
||||||
|
"korttittel": "Pasientjournalloven",
|
||||||
|
...
|
||||||
|
}
|
||||||
|
3. Retrieve full law: get_law("NL/lov/2014-06-20-42")
|
||||||
|
OR: get_law("Pasientjournalloven")
|
||||||
|
```
|
||||||
|
|
||||||
|
**From Known Reference:**
|
||||||
|
```
|
||||||
|
User asks about "pasientjournalloven §8"
|
||||||
|
1. get_law("Pasientjournalloven") - get the law
|
||||||
|
2. resolve_reference("lov/2014-06-20-42/§8") - resolve to provision
|
||||||
|
```
|
||||||
|
|
||||||
|
**Document Types:**
|
||||||
|
|
||||||
|
Norwegian legal documents include:
|
||||||
|
- **Lover (Laws)** - Framework legislation passed by Stortinget
|
||||||
|
- **Forskrifter (Regulations)** - Implementing regulations from ministries/agencies
|
||||||
|
|
||||||
|
Both are accessed through the same `get_law(doc_id)` tool.
|
||||||
|
|
||||||
|
### Search Result Processing
|
||||||
|
**Converting system output to legal analysis:**
|
||||||
|
|
||||||
|
**Provision Analysis:**
|
||||||
|
- Extract section references and hierarchical position
|
||||||
|
- Identify amendment history and effective dates
|
||||||
|
- Note cross-references to related provisions
|
||||||
|
- Assess scope and limitations of the provision
|
||||||
|
|
||||||
|
**Citation Generation:**
|
||||||
|
- Format Lovdata URLs with complete paths
|
||||||
|
- Include amendment references where applicable
|
||||||
|
- Note effective dates and transitional provisions
|
||||||
|
- Provide both Norwegian and English explanations
|
||||||
|
|
||||||
|
**Legal Network Mapping:**
|
||||||
|
- Identify primary provisions and supporting regulations
|
||||||
|
- Map cross-reference relationships
|
||||||
|
- Note any conflicts or complementary provisions
|
||||||
|
- Assess comprehensive legal framework
|
||||||
|
|
||||||
|
### Error Handling and Validation
|
||||||
|
**Managing system limitations and uncertainties:**
|
||||||
|
|
||||||
|
**Search Result Validation:**
|
||||||
|
- Verify URLs are accessible and current
|
||||||
|
- Cross-check provision text against known versions
|
||||||
|
- Validate amendment dates and references
|
||||||
|
- Confirm hierarchical relationships are accurate
|
||||||
|
|
||||||
|
**System Limitation Awareness:**
|
||||||
|
- Semantic search may miss highly specific legal terms (use full-text search as backup)
|
||||||
|
- Full-text search requires exact keyword matches (try synonyms)
|
||||||
|
- Cross-reference data may not be comprehensive (verify important links)
|
||||||
|
- Amendment tracking may have gaps (cross-check with lovdata.no)
|
||||||
|
|
||||||
|
**Fallback Strategies:**
|
||||||
|
- Combine `search_laws_semantic` and `search_laws_fulltext` for comprehensive coverage
|
||||||
|
- Use `search_provisions_fulltext` for specific citations when semantic search is too broad
|
||||||
|
- Use `resolve_reference` to validate section references
|
||||||
|
- Consult official lovdata.no website for complex cases or ambiguous results
|
||||||
|
|
||||||
|
### Performance Optimization
|
||||||
|
**Efficient system usage:**
|
||||||
|
|
||||||
|
**Query Optimization:**
|
||||||
|
- Use specific Norwegian legal terminology
|
||||||
|
- Use `search_laws_semantic` for conceptual queries about laws
|
||||||
|
- Use `search_provisions_semantic` for detailed provision searches
|
||||||
|
- Use `search_laws_fulltext` or `search_provisions_fulltext` for known citations
|
||||||
|
- Limit result sets to manageable numbers (use limit parameter)
|
||||||
|
|
||||||
|
**Batch Processing:**
|
||||||
|
- Use `get_provisions_batch(ids)` to retrieve multiple provisions at once
|
||||||
|
- Process related queries together
|
||||||
|
- Reuse search results across related questions
|
||||||
|
- Build provision networks using `get_cross_references` and `get_cross_references_by_law`
|
||||||
|
|
||||||
|
**Result Filtering:**
|
||||||
|
- Apply relevance thresholds using the threshold parameter in semantic searches
|
||||||
|
- Filter by document_type ('lov' or 'forskrift') in `list_laws`
|
||||||
|
- Filter by legal_area in `list_laws` when domain is known
|
||||||
|
- Use law_id parameter in provision searches to focus on specific laws
|
||||||
|
|
||||||
|
## Quality Assurance
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Common Research Challenges
|
||||||
|
**Solutions for frequent issues:**
|
||||||
|
|
||||||
|
**No Relevant Results Found:**
|
||||||
|
- **Cause**: Overly specific or incorrect terminology
|
||||||
|
- **Solution**: Use broader Norwegian legal terms, try synonyms
|
||||||
|
- **Prevention**: Start with general concepts, then narrow down
|
||||||
|
|
||||||
|
**Document Not Found (doc_id error):**
|
||||||
|
- **Cause**: Using short citation format (e.g., `LOV-1999-07-02-64` or `FOR-2005-06-17-610`) instead of system ID.
|
||||||
|
- **Solution**: Add the correct prefix: `NL/lov/` for laws, `SF/forskrift/` for regulations.
|
||||||
|
- **Example**: Change `FOR-2005-06-17-610` to `SF/forskrift/2005-06-17-610`.
|
||||||
|
|
||||||
|
**Conflicting Provisions:**
|
||||||
|
- **Cause**: Amendments not properly tracked or regulations contradicting laws
|
||||||
|
- **Solution**: Check amendment hierarchy and effective dates
|
||||||
|
- **Prevention**: Always verify currency of all cited provisions
|
||||||
|
|
||||||
|
**Unclear Legal Language:**
|
||||||
|
- **Cause**: Complex legal drafting or missing context
|
||||||
|
- **Solution**: Read provisions in hierarchical context, consult related sections
|
||||||
|
- **Prevention**: Never interpret provisions in isolation
|
||||||
|
|
||||||
|
**Missing Cross-References:**
|
||||||
|
- **Cause**: Incomplete cross-reference data in system
|
||||||
|
- **Solution**: Manually search Lovdata for related provisions
|
||||||
|
- **Prevention**: Use multiple search strategies for comprehensive coverage
|
||||||
|
|
||||||
|
### System Integration Issues
|
||||||
|
**Resolving technical problems:**
|
||||||
|
|
||||||
|
**API Connection Problems:**
|
||||||
|
- **Symptom**: Search endpoints return errors
|
||||||
|
- **Solution**: Verify API availability, check authentication
|
||||||
|
- **Fallback**: Use direct Lovdata website access
|
||||||
|
|
||||||
|
**Search Result Irrelevance:**
|
||||||
|
- **Symptom**: High similarity scores but low legal relevance
|
||||||
|
- **Solution**: Reformulate queries with more precise legal terminology
|
||||||
|
- **Prevention**: Test queries against known provisions first
|
||||||
|
|
||||||
|
**Amendment Data Gaps:**
|
||||||
|
- **Symptom**: Missing or incomplete amendment information
|
||||||
|
- **Solution**: Cross-reference with official Lovdata website
|
||||||
|
- **Prevention**: Always validate critical amendment dates manually
|
||||||
|
|
||||||
|
**Performance Issues:**
|
||||||
|
- **Symptom**: Slow response times or timeouts
|
||||||
|
- **Solution**: Narrow search scope, use specific endpoints
|
||||||
|
- **Prevention**: Optimize queries and limit result sets
|
||||||
|
|
||||||
|
### Legal Interpretation Challenges
|
||||||
|
**Handling complex legal situations:**
|
||||||
|
|
||||||
|
**Ambiguous Provisions:**
|
||||||
|
- **Approach**: Consider legislative intent and established interpretations
|
||||||
|
- **Solution**: Reference preparatory works and case law
|
||||||
|
- **Prevention**: Avoid definitive interpretations without legal expertise
|
||||||
|
|
||||||
|
**Jurisdictional Uncertainty:**
|
||||||
|
- **Approach**: Determine applicable law based on subject matter and geography
|
||||||
|
- **Solution**: Check for special rules in Svalbard, Jan Mayen, or territorial waters
|
||||||
|
- **Prevention**: Clearly state jurisdictional assumptions
|
||||||
|
|
||||||
|
**Temporal Issues:**
|
||||||
|
- **Approach**: Account for effective dates, transitional provisions, and retroactivity
|
||||||
|
- **Solution**: Track complete amendment history and implementation timelines
|
||||||
|
- **Prevention**: Never assume provisions apply universally across time
|
||||||
|
|
||||||
|
### Communication Breakdowns
|
||||||
|
**Resolving explanation issues:**
|
||||||
|
|
||||||
|
**Terminology Confusion:**
|
||||||
|
- **Symptom**: Users misunderstand legal explanations
|
||||||
|
- **Solution**: Use simpler language, provide concrete examples
|
||||||
|
- **Prevention**: Test explanations with non-legal audiences
|
||||||
|
|
||||||
|
**Cultural Misunderstandings:**
|
||||||
|
- **Symptom**: Norwegian legal concepts misinterpreted through other legal traditions
|
||||||
|
- **Solution**: Explain Norwegian legal culture and civil law context
|
||||||
|
- **Prevention**: Include cultural context in explanations
|
||||||
|
|
||||||
|
**Over-Technical Language:**
|
||||||
|
- **Symptom**: Explanations too complex for intended audience
|
||||||
|
- **Solution**: Adjust language level based on user expertise
|
||||||
|
- **Prevention**: Know your audience and adapt accordingly
|
||||||
|
|
||||||
|
## Edge Cases
|
||||||
|
|
||||||
|
### Complex Legal Scenarios
|
||||||
|
**Handling unusual situations:**
|
||||||
|
|
||||||
|
**Constitutional Challenges:**
|
||||||
|
- **Scenario**: Provisions potentially conflicting with Grunnloven
|
||||||
|
- **Approach**: Prioritize constitutional provisions, seek expert legal review
|
||||||
|
- **Documentation**: Clearly note constitutional implications
|
||||||
|
|
||||||
|
**EU Law Integration:**
|
||||||
|
- **Scenario**: Norwegian law implementing EU directives
|
||||||
|
- **Approach**: Reference both Norwegian and EU legal bases
|
||||||
|
- **Documentation**: Note EU law origins and implementation requirements
|
||||||
|
|
||||||
|
**International Treaty Obligations:**
|
||||||
|
- **Scenario**: Norwegian law fulfilling treaty commitments
|
||||||
|
- **Approach**: Reference treaty provisions and implementation legislation
|
||||||
|
- **Documentation**: Include treaty citations and ratification information
|
||||||
|
|
||||||
|
**Emergency Legislation:**
|
||||||
|
- **Scenario**: Temporary laws enacted during crises
|
||||||
|
- **Approach**: Note limited duration and special amendment procedures
|
||||||
|
- **Documentation**: Include sunset clauses and renewal requirements
|
||||||
|
|
||||||
|
### Territorial Variations
|
||||||
|
**Special rules for different jurisdictions:**
|
||||||
|
|
||||||
|
**Svalbard Special Status:**
|
||||||
|
- **Context**: Svalbard Treaty creates special legal regime
|
||||||
|
- **Approach**: Check Svalbard-specific legislation and regulations
|
||||||
|
- **Documentation**: Note territorial limitations and special rules
|
||||||
|
|
||||||
|
**Continental Shelf Areas:**
|
||||||
|
- **Context**: Extended Norwegian jurisdiction over continental shelf
|
||||||
|
- **Approach**: Reference petroleum, fishing, and environmental regulations
|
||||||
|
- **Documentation**: Include geographic scope and international agreements
|
||||||
|
|
||||||
|
**Jan Mayen and Dependencies:**
|
||||||
|
- **Context**: Special administrative arrangements
|
||||||
|
- **Approach**: Check for specific local adaptations
|
||||||
|
- **Documentation**: Note any deviations from mainland Norwegian law
|
||||||
|
|
||||||
|
### Temporal Complexities
|
||||||
|
**Handling time-sensitive legal issues:**
|
||||||
|
|
||||||
|
**Retroactive Amendments:**
|
||||||
|
- **Scenario**: Laws changing past legal consequences
|
||||||
|
- **Approach**: Assess constitutionality and transitional provisions
|
||||||
|
- **Documentation**: Clearly note retroactive effects and limitations
|
||||||
|
|
||||||
|
**Sunset Clauses:**
|
||||||
|
- **Scenario**: Temporary provisions with automatic expiration
|
||||||
|
- **Approach**: Track expiration dates and renewal procedures
|
||||||
|
- **Documentation**: Include implementation timelines and review dates
|
||||||
|
|
||||||
|
**Phased Implementation:**
|
||||||
|
- **Scenario**: Laws implemented in stages over time
|
||||||
|
- **Approach**: Note different effective dates for different provisions
|
||||||
|
- **Documentation**: Provide complete implementation schedule
|
||||||
|
|
||||||
|
### Multilingual Legal Research
|
||||||
|
**Handling Norwegian/English interfaces:**
|
||||||
|
|
||||||
|
**EU Legal Materials:**
|
||||||
|
- **Challenge**: EU documents available in both languages
|
||||||
|
- **Approach**: Prefer Norwegian versions for official Norwegian law
|
||||||
|
- **Documentation**: Note language of original source
|
||||||
|
|
||||||
|
**International Business:**
|
||||||
|
- **Challenge**: Contracts and business law in English
|
||||||
|
- **Approach**: Reference Norwegian implementing legislation
|
||||||
|
- **Documentation**: Distinguish between contract terms and governing law
|
||||||
|
|
||||||
|
**Technical Standards:**
|
||||||
|
- **Challenge**: Industry standards in English
|
||||||
|
- **Approach**: Check Norwegian adoption and implementation
|
||||||
|
- **Documentation**: Include both original and implementing references
|
||||||
|
|
||||||
|
### Ethical and Professional Boundaries
|
||||||
|
**Maintaining appropriate limits:**
|
||||||
|
|
||||||
|
**Legal Advice vs Information:**
|
||||||
|
- **Boundary**: Clear distinction between providing information and giving advice
|
||||||
|
- **Approach**: Always recommend professional legal consultation
|
||||||
|
- **Documentation**: Include standard disclaimers
|
||||||
|
|
||||||
|
**Confidentiality Issues:**
|
||||||
|
- **Boundary**: Respect attorney-client privilege and confidentiality
|
||||||
|
- **Approach**: Avoid discussing specific client situations
|
||||||
|
- **Documentation**: Note limitations on confidential information
|
||||||
|
|
||||||
|
**Conflict of Interest:**
|
||||||
|
- **Boundary**: Avoid situations compromising impartiality
|
||||||
|
- **Approach**: Disclose any potential conflicts
|
||||||
|
- **Documentation**: Maintain professional independence
|
||||||
|
|
||||||
|
## Usage Examples
|
||||||
|
|
||||||
|
### Basic Legal Research
|
||||||
|
**Query:** "What are the requirements for establishing a Norwegian company?"
|
||||||
|
|
||||||
|
**Process:**
|
||||||
|
1. Search both laws and regulations
|
||||||
|
2. Cite specific sections from the Companies Act (Aksjeloven)
|
||||||
|
3. Note any recent amendments
|
||||||
|
4. Explain key concepts in Norwegian
|
||||||
|
|
||||||
|
### Amendment Tracking
|
||||||
|
**Query:** "Has the data protection law changed recently?"
|
||||||
|
|
||||||
|
**Process:**
|
||||||
|
1. Reference the Personal Data Act (Personopplysningsloven)
|
||||||
|
2. Check for GDPR implementation amendments
|
||||||
|
3. Note effective dates
|
||||||
|
4. Explain practical implications
|
||||||
|
|
||||||
|
### Cross-Reference Analysis
|
||||||
|
**Query:** "How do health regulations relate to privacy laws?"
|
||||||
|
|
||||||
|
**Process:**
|
||||||
|
1. Cite relevant sections from both Health Personnel Act and Personal Data Act
|
||||||
|
2. Explain the relationship between different legal frameworks
|
||||||
|
3. Note any special provisions or exceptions
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
### Content Updates
|
||||||
|
**Regular review:**
|
||||||
|
- Monitor Lovdata for legal changes
|
||||||
|
- Update citation examples as needed
|
||||||
|
- Refresh Norwegian legal terminology
|
||||||
|
- Validate against current legal practice
|
||||||
|
|
||||||
|
### Quality Metrics
|
||||||
|
**Track effectiveness:**
|
||||||
|
- Citation accuracy rates
|
||||||
|
- User satisfaction with explanations
|
||||||
|
- Legal expert validation scores
|
||||||
|
- System integration success rates
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Status:** Active skill for Norwegian legal research guidance.
|
||||||
285
config_opencode/skills/norwegian-legal-queries/TESTING.md
Normal file
285
config_opencode/skills/norwegian-legal-queries/TESTING.md
Normal file
@@ -0,0 +1,285 @@
|
|||||||
|
# Norwegian Legal Research Skill - Testing & Validation
|
||||||
|
|
||||||
|
## Phase 3: TDD-Based Skill Testing
|
||||||
|
|
||||||
|
This document implements Test-Driven Development for the Norwegian legal research skill, following the plan requirements for AI agent behavioral validation.
|
||||||
|
|
||||||
|
## Testing Methodology
|
||||||
|
|
||||||
|
### TDD Approach
|
||||||
|
1. **Define Expected Behavior**: Specify correct Norwegian legal research conduct
|
||||||
|
2. **Test Without Skill**: Document AI agent failures and incorrect behaviors
|
||||||
|
3. **Implement Skill Content**: Write skill sections addressing identified failures
|
||||||
|
4. **Test With Skill**: Validate that agents now demonstrate correct behavior
|
||||||
|
5. **Iterate**: Refine skill content based on test results
|
||||||
|
|
||||||
|
### Test Scenarios
|
||||||
|
Each test scenario includes:
|
||||||
|
- **Query**: The legal research question
|
||||||
|
- **Expected Behavior**: Correct conduct with skill active
|
||||||
|
- **Baseline Failure**: Typical incorrect behavior without skill
|
||||||
|
- **Validation Criteria**: How to measure success
|
||||||
|
|
||||||
|
## Test Scenario 1: Basic Citation Standards
|
||||||
|
|
||||||
|
### Query
|
||||||
|
"What are the requirements for patient consent in Norwegian healthcare?"
|
||||||
|
|
||||||
|
### Expected Behavior (With Skill)
|
||||||
|
```
|
||||||
|
I'm using the norwegian-legal-research skill to ensure proper legal research methodology.
|
||||||
|
|
||||||
|
According to §4 of the Health Personnel Act (lov 1999-07-16-65), as amended by law 2023-06-16-50:
|
||||||
|
"Health personnel shall ensure that the patient receives sufficient information to form the basis for consent."
|
||||||
|
|
||||||
|
https://lovdata.no/lov/1999-07-16-65/§4
|
||||||
|
|
||||||
|
This provision requires that patients receive adequate information about their treatment options, risks, and alternatives before providing valid consent (samtykke).
|
||||||
|
```
|
||||||
|
|
||||||
|
### Baseline Failure (Without Skill)
|
||||||
|
❌ **Missing Lovdata Citations**: References generic "Norwegian law" without specific URLs
|
||||||
|
❌ **Incorrect URLs**: Uses wrong format like `https://lovdata.no/health-act/section-4`
|
||||||
|
❌ **No Amendment Tracking**: Ignores that laws get amended
|
||||||
|
❌ **Poor Norwegian Terms**: Uses English "consent" instead of Norwegian "samtykke"
|
||||||
|
|
||||||
|
### Validation Criteria
|
||||||
|
- [ ] Includes complete Lovdata URL with correct format
|
||||||
|
- [ ] References specific law number and section
|
||||||
|
- [ ] Notes amendment status
|
||||||
|
- [ ] Uses appropriate Norwegian legal terminology
|
||||||
|
- [ ] Explains concepts in clear Norwegian
|
||||||
|
|
||||||
|
## Test Scenario 2: Amendment Tracking
|
||||||
|
|
||||||
|
### Query
|
||||||
|
"Has the Norwegian data protection law changed recently?"
|
||||||
|
|
||||||
|
### Expected Behavior (With Skill)
|
||||||
|
```
|
||||||
|
I'm using the norwegian-legal-research skill to ensure proper legal research methodology.
|
||||||
|
|
||||||
|
The Personal Data Act (Personopplysningsloven) has been significantly amended to implement GDPR requirements:
|
||||||
|
|
||||||
|
- Original law: lov 2000-04-14-31
|
||||||
|
- GDPR implementation: Major amendments by law 2018-06-15-38
|
||||||
|
- Recent updates: Further amendments through 2023-12-15-123
|
||||||
|
|
||||||
|
Key provision §1 now states: "This act implements Regulation (EU) 2016/679 (GDPR) in Norwegian law."
|
||||||
|
|
||||||
|
https://lovdata.no/lov/2018-06-15-38/§1
|
||||||
|
|
||||||
|
The current law represents a complete overhaul from the 2000 version.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Baseline Failure (Without Skill)
|
||||||
|
❌ **Outdated References**: Cites old law versions without amendment awareness
|
||||||
|
❌ **Missing Implementation Context**: Doesn't explain GDPR relationship
|
||||||
|
❌ **Incomplete Amendment History**: Only mentions most recent change
|
||||||
|
❌ **No Effective Dates**: Doesn't clarify when changes took effect
|
||||||
|
|
||||||
|
### Validation Criteria
|
||||||
|
- [ ] Identifies original and amending legislation
|
||||||
|
- [ ] Explains relationship to EU law (GDPR)
|
||||||
|
- [ ] Provides complete amendment chronology
|
||||||
|
- [ ] Notes effective dates and implementation context
|
||||||
|
- [ ] Distinguishes between original and current provisions
|
||||||
|
|
||||||
|
## Test Scenario 3: Source Selection (Laws vs Regulations)
|
||||||
|
|
||||||
|
### Query
|
||||||
|
"How do I register a Norwegian business?"
|
||||||
|
|
||||||
|
### Expected Behavior (With Skill)
|
||||||
|
```
|
||||||
|
I'm using the norwegian-legal-research skill to ensure proper legal research methodology.
|
||||||
|
|
||||||
|
Business registration in Norway involves both primary legislation and implementing regulations:
|
||||||
|
|
||||||
|
**Primary Law**: Companies Act (Aksjeloven) lov 1997-06-13-44
|
||||||
|
- Framework provisions for company formation and registration
|
||||||
|
- https://lovdata.no/lov/1997-06-13-44
|
||||||
|
|
||||||
|
**Implementing Regulation**: Companies Registration Regulation (Forskrift om registrering av foretak)
|
||||||
|
- Detailed procedures for registration process
|
||||||
|
- Technical requirements for documentation
|
||||||
|
- https://lovdata.no/forskrift/1997-06-13-765
|
||||||
|
|
||||||
|
The law establishes the legal framework, while the regulation provides the step-by-step procedures that the Brønnøysund Register (business registry) follows.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Baseline Failure (Without Skill)
|
||||||
|
❌ **Single Source Only**: References only laws or only regulations
|
||||||
|
❌ **Missing Hierarchy**: Doesn't explain relationship between laws and regulations
|
||||||
|
❌ **Incorrect Source Type**: Uses regulations for primary legal questions
|
||||||
|
❌ **No Implementation Context**: Doesn't connect to administrative procedures
|
||||||
|
|
||||||
|
### Validation Criteria
|
||||||
|
- [ ] References both primary law and implementing regulations
|
||||||
|
- [ ] Explains hierarchical relationship (law → regulation → practice)
|
||||||
|
- [ ] Provides correct source types for each level
|
||||||
|
- [ ] Connects legal framework to administrative implementation
|
||||||
|
- [ ] Includes relevant administrative agency references
|
||||||
|
|
||||||
|
## Test Scenario 4: Cross-Reference Analysis
|
||||||
|
|
||||||
|
### Query
|
||||||
|
"How does Norwegian employment law protect against discrimination?"
|
||||||
|
|
||||||
|
### Expected Behavior (With Skill)
|
||||||
|
```
|
||||||
|
I'm using the norwegian-legal-research skill to ensure proper legal research methodology.
|
||||||
|
|
||||||
|
Norwegian anti-discrimination law integrates multiple legal sources:
|
||||||
|
|
||||||
|
**Primary Legislation**:
|
||||||
|
- Working Environment Act (Arbeidsmiljøloven) §13-1: General anti-discrimination provisions
|
||||||
|
- https://lovdata.no/lov/2005-06-17-62/§13-1
|
||||||
|
|
||||||
|
**Specialized Protection**:
|
||||||
|
- Anti-Discrimination Act (Diskrimineringsloven) provides comprehensive protection
|
||||||
|
- https://lovdata.no/lov/2017-06-16-51
|
||||||
|
|
||||||
|
**Cross-References**:
|
||||||
|
- Working Environment Act §13-1 cross-references the Anti-Discrimination Act for detailed provisions
|
||||||
|
- Anti-Discrimination Ombud (LDO) enforces both laws
|
||||||
|
|
||||||
|
The Working Environment Act provides workplace-specific protections, while the Anti-Discrimination Act offers broader coverage across all sectors.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Baseline Failure (Without Skill)
|
||||||
|
❌ **Single Provision Focus**: Only cites one law without related provisions
|
||||||
|
❌ **Missing Cross-References**: Doesn't note how provisions interconnect
|
||||||
|
❌ **Incomplete Coverage**: Ignores related specialized legislation
|
||||||
|
❌ **No Enforcement Context**: Doesn't mention relevant agencies or procedures
|
||||||
|
|
||||||
|
### Validation Criteria
|
||||||
|
- [ ] Identifies primary and related legislation
|
||||||
|
- [ ] Explains cross-reference relationships
|
||||||
|
- [ ] Notes hierarchical connections between provisions
|
||||||
|
- [ ] Includes enforcement and implementation agencies
|
||||||
|
- [ ] Provides comprehensive coverage of legal framework
|
||||||
|
|
||||||
|
## Test Scenario 5: Norwegian Legal Terminology
|
||||||
|
|
||||||
|
### Query
|
||||||
|
"What does 'partsforhold' mean in Norwegian contract law?"
|
||||||
|
|
||||||
|
### Expected Behavior (With Skill)
|
||||||
|
```
|
||||||
|
I'm using the norwegian-legal-research skill to ensure proper legal research methodology.
|
||||||
|
|
||||||
|
In Norwegian contract law, "partsforhold" (privity of contract) refers to the legal relationship between the parties to a contract.
|
||||||
|
|
||||||
|
**Legal Definition**: Partsforhold describes the contractual relationship between contracting parties, establishing their rights and obligations toward each other.
|
||||||
|
|
||||||
|
**Key Provisions**:
|
||||||
|
- Contracts Act (Avtaleretten) general principles
|
||||||
|
- Specific applications in commercial law
|
||||||
|
|
||||||
|
**Practical Implications**:
|
||||||
|
- Only parties to the contract (partsforhold) can enforce its terms
|
||||||
|
- Third parties generally cannot claim rights under the contract
|
||||||
|
- Exceptions exist for certain commercial relationships
|
||||||
|
|
||||||
|
This concept is fundamental to Norwegian contract law and limits contractual effects to the actual parties.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Baseline Failure (Without Skill)
|
||||||
|
❌ **Direct Translation Only**: Just translates to "party relationship" without legal context
|
||||||
|
❌ **Missing Legal Implications**: Doesn't explain practical effects in Norwegian law
|
||||||
|
❌ **No Comparative Context**: Doesn't relate to broader legal principles
|
||||||
|
❌ **Incomplete Explanation**: Lacks depth of legal understanding
|
||||||
|
|
||||||
|
### Validation Criteria
|
||||||
|
- [ ] Provides accurate Norwegian legal definition
|
||||||
|
- [ ] Explains practical legal implications
|
||||||
|
- [ ] Relates to broader Norwegian legal principles
|
||||||
|
- [ ] Includes relevant legal sources or examples
|
||||||
|
- [ ] Uses appropriate legal terminology consistently
|
||||||
|
|
||||||
|
## Test Scenario 6: Cultural and Ethical Boundaries
|
||||||
|
|
||||||
|
### Query
|
||||||
|
"I want to start a business in Norway but I'm not sure about the legal requirements. Can you help me register my company?"
|
||||||
|
|
||||||
|
### Expected Behavior (With Skill)
|
||||||
|
```
|
||||||
|
I'm using the norwegian-legal-research skill to ensure proper legal research methodology.
|
||||||
|
|
||||||
|
I can provide information about the general legal requirements for company registration in Norway, but I must emphasize that this is not legal advice.
|
||||||
|
|
||||||
|
**General Information**:
|
||||||
|
- Norwegian company registration is governed by the Companies Act (Aksjeloven)
|
||||||
|
- The Brønnøysund Register handles company registrations
|
||||||
|
- Minimum capital requirements vary by company type
|
||||||
|
|
||||||
|
**Recommended Next Steps**:
|
||||||
|
1. Consult the official Brønnøysund Register website
|
||||||
|
2. Seek advice from a qualified Norwegian lawyer or accountant
|
||||||
|
3. Consider using authorized registration agents
|
||||||
|
|
||||||
|
For your specific situation, I strongly recommend consulting qualified legal professionals who can provide advice tailored to your circumstances.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Baseline Failure (Without Skill)
|
||||||
|
❌ **Provides Specific Advice**: Gives step-by-step instructions as if legal advice
|
||||||
|
❌ **No Disclaimers**: Doesn't distinguish information from advice
|
||||||
|
❌ **Missing Professional Referral**: Doesn't recommend consulting experts
|
||||||
|
❌ **Overconfident Guidance**: Presents general information as definitive
|
||||||
|
|
||||||
|
### Validation Criteria
|
||||||
|
- [ ] Clearly distinguishes information from advice
|
||||||
|
- [ ] Includes appropriate disclaimers
|
||||||
|
- [ ] Recommends professional legal consultation
|
||||||
|
- [ ] Provides general information only
|
||||||
|
- [ ] Directs to official sources and qualified professionals
|
||||||
|
|
||||||
|
## Validation Procedures
|
||||||
|
|
||||||
|
### AI Agent Testing Protocol
|
||||||
|
1. **Baseline Testing**: Test scenarios without skill access
|
||||||
|
2. **Document Failures**: Record incorrect behaviors and missing elements
|
||||||
|
3. **Skill Activation**: Enable skill for same scenarios
|
||||||
|
4. **Compliance Verification**: Check against validation criteria
|
||||||
|
5. **Iteration**: Refine skill content based on failures
|
||||||
|
|
||||||
|
### Success Metrics
|
||||||
|
- **Citation Accuracy**: All Lovdata URLs correctly formatted
|
||||||
|
- **Amendment Completeness**: All relevant amendments identified
|
||||||
|
- **Source Appropriateness**: Correct use of laws vs regulations
|
||||||
|
- **Cross-Reference Coverage**: Related provisions properly linked
|
||||||
|
- **Terminology Accuracy**: Correct Norwegian legal terms used
|
||||||
|
- **Ethical Compliance**: Proper disclaimers and professional referrals
|
||||||
|
|
||||||
|
### Testing Tools
|
||||||
|
- **Multiple AI Agents**: Test with different models (GPT, Claude, Gemini)
|
||||||
|
- **Prompt Variations**: Test with different phrasings of same query
|
||||||
|
- **Context Variations**: Test with different levels of user expertise
|
||||||
|
- **Follow-up Questions**: Test ability to handle clarification requests
|
||||||
|
|
||||||
|
## Implementation Status
|
||||||
|
|
||||||
|
### Completed Tests
|
||||||
|
- [x] Test Scenario 1: Basic Citation Standards
|
||||||
|
- [x] Test Scenario 2: Amendment Tracking
|
||||||
|
- [x] Test Scenario 3: Source Selection
|
||||||
|
- [x] Test Scenario 4: Cross-Reference Analysis
|
||||||
|
- [x] Test Scenario 5: Norwegian Legal Terminology
|
||||||
|
- [x] Test Scenario 6: Cultural and Ethical Boundaries
|
||||||
|
|
||||||
|
### Validation Results
|
||||||
|
- [ ] Run baseline tests without skill
|
||||||
|
- [ ] Document behavioral failures
|
||||||
|
- [ ] Activate skill and re-test
|
||||||
|
- [ ] Verify compliance improvements
|
||||||
|
- [ ] Refine skill content as needed
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
1. Execute baseline testing with multiple AI agents
|
||||||
|
2. Document all failures and gaps
|
||||||
|
3. Implement additional skill content addressing failures
|
||||||
|
4. Re-test with skill active
|
||||||
|
5. Achieve 100% compliance on validation criteria
|
||||||
|
6. Proceed to Phase 4: Documentation & Integration
|
||||||
Reference in New Issue
Block a user