A Multi-Agent System for intelligent task processing
Project description
Sentinel-MAS Unit Tests (pytest)
How to run
- Ensure your source tree looks like this (package directory name matters):
<repo-root>/
sentinel_mas/
policy_sentinel/
tools/
agents/
app/
...
tests/
-
Copy the
tests/folder from this bundle into your repo root so thattests/sits next to thesentinel_mas/folder. -
(Recommended) Create a virtualenv and install test deps:
pip install -r requirements-test.txt
- Run tests with coverage:
pip install -e .[test]
pytest --cov=sentinel_mas --cov-report=term-missing
If your package directory is not named sentinel_mas, either rename it or update the imports inside the tests accordingly.
Usage
1. Run locally
# Make scripts executable
chmod +x scripts/*.sh
chmod +x scripts/*.py
# Setup development environment
./scripts/setup_dev.sh
# Activate virtual environment
source .venv/bin/activate
# Run the full pipeline locally
./scripts/lint.sh
pytest tests/ --junitxml=test-results/junit.xml --cov=src
python scripts/generate_report.py
Local Sanity Check:
# Run isort to automatically fix import sorting
uv run isort .
uv run black .
uv run flake8 .
uv run mypy sentinel_mas tests
uv run pytest
## Verify the fixes:
isort --check-only .
black --check .
# Check only (CI mode)
./scripts/lint.sh
# Auto-fix all issues (development mode)
./scripts/lint.sh --fix
SonarCube Integration
## Download SonarCube
cd /d/NUS/Mtech\ IS/Year\ 2\ Sem\ 2/Practice\ Module/Development/sentinel/
curl -L -o sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-windows.zip
unzip sonar-scanner.zip -d tools
## update environment variable
export PATH="$PWD/tools/sonar-scanner-5.0.1.3006-windows/bin:$PATH"
## Verify
sonar-scanner -v
Configuration
This project uses separate environment files:
.env.sentinel- Sentinel MAS package configuration.env.api- API service configuration.env.shared- Shared configuration
Setup
- Copy example files:
cp .env.sentinel.example .env.sentinel
cp .env.api.example .env.api
cp .env.shared.example .env.shared
-
Edit
.env.sentinel:- Set
OPENAI_API_KEYwith your OpenAI key
- Set
-
Edit
.env.api:- Generate
SECRET_KEY:openssl rand -hex 32
- Generate
-
Run the application:
python scripts/start_api.py
Environment Files
| File | Purpose | Required Variables |
|---|---|---|
.env.sentinel |
Package config | OPENAI_API_KEY |
.env.api |
API config | SECRET_KEY |
.env.shared |
Shared config | None (has defaults) |
---
## Migration Steps
1. **Backup your current .env:**
```bash
cp .env .env.backup
-
Create the three new files:
- Copy
.env.sentinelcontent - Copy
.env.apicontent - Copy
.env.sharedcontent
- Copy
-
Migrate your values:
- From old
.env, copy values to appropriate new files - Remove
SENTINEL_andAPI_prefixes
- From old
-
Update config files:
- Replace
sentinel_mas/config.py - Replace
api_service/config.py
- Replace
-
Update .gitignore:
- Add the new environment files
-
Test:
python -c "from sentinel_mas.config import Config; print(f'Model: {Config.OPENAI_MODEL}')"
python -c "from api_service.config import get_api_config; print(f'Port: {get_api_config().PORT}')"
- Start the API:
python scripts/start_api.py
---
## Docker Update
**Update `docker/Dockerfile.api`:**
```dockerfile
# Copy environment files
COPY .env.sentinel .env.api .env.shared ./
Update docker-compose.yml:
services:
api:
volumes:
- ./.env.sentinel:/app/.env.sentinel
- ./.env.api:/app/.env.api
- ./.env.shared:/app/.env.shared
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sentinel_mas-0.1.0.tar.gz.
File metadata
- Download URL: sentinel_mas-0.1.0.tar.gz
- Upload date:
- Size: 674.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
436ecaa6a4d87912b4050f557cb6c2cb4adae710d50234a3932ddea4682e74dc
|
|
| MD5 |
5b4b49dd27bfc17705a4d3b00f7b8c11
|
|
| BLAKE2b-256 |
7d89a79e1d7ce409c5b60c86d00e5d2057f2660aa3ff48181af7ad43c5a98425
|
Provenance
The following attestation bundles were made for sentinel_mas-0.1.0.tar.gz:
Publisher:
package-build.yaml on A0291221R/sentinel-mas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sentinel_mas-0.1.0.tar.gz -
Subject digest:
436ecaa6a4d87912b4050f557cb6c2cb4adae710d50234a3932ddea4682e74dc - Sigstore transparency entry: 666744965
- Sigstore integration time:
-
Permalink:
A0291221R/sentinel-mas@d96d5be005709d2e280c8876e651dda848c80b6a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/A0291221R
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package-build.yaml@d96d5be005709d2e280c8876e651dda848c80b6a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file sentinel_mas-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sentinel_mas-0.1.0-py3-none-any.whl
- Upload date:
- Size: 701.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9319c08ce197976804415231793117ba30e7bf97a2d591dc01ccbd37c114e49
|
|
| MD5 |
a65d41f3cd6d7b002e32c3244265c9b9
|
|
| BLAKE2b-256 |
7202304af38e6b4b019c811342191b1cf3f26f4b7838b2e57b83beda58759591
|
Provenance
The following attestation bundles were made for sentinel_mas-0.1.0-py3-none-any.whl:
Publisher:
package-build.yaml on A0291221R/sentinel-mas
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sentinel_mas-0.1.0-py3-none-any.whl -
Subject digest:
a9319c08ce197976804415231793117ba30e7bf97a2d591dc01ccbd37c114e49 - Sigstore transparency entry: 666744989
- Sigstore integration time:
-
Permalink:
A0291221R/sentinel-mas@d96d5be005709d2e280c8876e651dda848c80b6a -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/A0291221R
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
package-build.yaml@d96d5be005709d2e280c8876e651dda848c80b6a -
Trigger Event:
workflow_dispatch
-
Statement type: