Skip to content

Commit 0ecca10

Browse files
committed
feat: Principal-level portfolio upgrade
Major enhancements to transform repo from research project to hireable portfolio piece: README Overhaul: - Executive brief with Who/Problem/Solution/KPIs - 60-second quick demo section - Evaluation results table with α tradeoffs - Score distribution visualization - Architecture diagram (ASCII) - CI badges Principal Program Artifacts (/docs): - PRD.md: Problem, users, metrics, non-goals - Architecture.md: Sequence diagrams, data flow, components - Risks.md: Full risk register with mitigations - Roadmap.md: MVP → Beta → GA with exit criteria - Decision-log.md: 10 key technical decisions with rationale Golden Demo Path: - demo.py: Offline demo (no API key required) - Makefile: dev shortcuts (demo, test, lint, dashboard) Engineering Hygiene: - .github/workflows/ci.yml: Lint, test, security scan - pyproject.toml: Modern Python packaging - tests/test_scorer.py: 24 unit tests for edge cases Addresses feedback: - Outcomes page with metrics ✓ - Demo friction reduced to <60 seconds ✓ - Principal-grade artifacts added ✓ - CI/test infrastructure ✓
1 parent dc683c6 commit 0ecca10

13 files changed

Lines changed: 2448 additions & 68 deletions

File tree

.github/workflows/ci.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: '3.10'
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install flake8
25+
26+
- name: Run flake8
27+
run: |
28+
flake8 *.py tests/ --max-line-length=120 --ignore=E501,W503 --count --show-source --statistics
29+
30+
test:
31+
name: Test
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.10'
40+
41+
- name: Install dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install -r requirements.txt
45+
pip install pytest pytest-cov
46+
47+
- name: Install Bandit
48+
run: pip install bandit
49+
50+
- name: Run tests
51+
run: |
52+
pytest tests/ -v --cov=. --cov-report=xml --cov-report=term-missing
53+
54+
- name: Upload coverage to Codecov
55+
uses: codecov/codecov-action@v4
56+
with:
57+
files: ./coverage.xml
58+
fail_ci_if_error: false
59+
continue-on-error: true
60+
61+
demo:
62+
name: Demo Smoke Test
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: '3.10'
71+
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install bandit
76+
77+
- name: Run offline demo
78+
run: |
79+
python demo.py
80+
81+
security:
82+
name: Security Scan
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Set up Python
88+
uses: actions/setup-python@v5
89+
with:
90+
python-version: '3.10'
91+
92+
- name: Install Bandit
93+
run: pip install bandit
94+
95+
- name: Run Bandit on source
96+
run: |
97+
bandit -r . -x ./tests --severity-level medium --confidence-level medium -f json -o bandit-report.json || true
98+
bandit -r . -x ./tests --severity-level medium --confidence-level medium
99+
continue-on-error: true

Makefile

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Makefile for Assured Sentinel
2+
# Provides common development commands
3+
4+
.PHONY: help install demo calibrate dashboard test lint clean
5+
6+
# Default target
7+
help:
8+
@echo "Assured Sentinel - Available Commands"
9+
@echo "======================================"
10+
@echo ""
11+
@echo " make install - Install dependencies"
12+
@echo " make demo - Run offline demo (no API key needed)"
13+
@echo " make calibrate - Run calibration to generate threshold"
14+
@echo " make dashboard - Launch Streamlit dashboard"
15+
@echo " make test - Run unit tests"
16+
@echo " make lint - Run linting (flake8)"
17+
@echo " make clean - Remove generated files"
18+
@echo ""
19+
20+
# Install dependencies
21+
install:
22+
pip install -r requirements.txt
23+
24+
# Run offline demo (no API key required)
25+
demo:
26+
python demo.py
27+
28+
# Run calibration
29+
calibrate:
30+
python calibration.py
31+
32+
# Launch dashboard
33+
dashboard:
34+
python -m streamlit run dashboard.py
35+
36+
# Run with LLM (requires Azure OpenAI)
37+
run:
38+
python run_day5.py
39+
40+
# Run tests
41+
test:
42+
pytest tests/ -v
43+
44+
# Run tests with coverage
45+
test-cov:
46+
pytest tests/ --cov=. --cov-report=term-missing --cov-report=html
47+
48+
# Lint code
49+
lint:
50+
flake8 *.py tests/ --max-line-length=120 --ignore=E501,W503
51+
52+
# Type checking (if mypy is installed)
53+
typecheck:
54+
mypy *.py --ignore-missing-imports
55+
56+
# Clean generated files
57+
clean:
58+
rm -f calibration_data.pkl
59+
rm -rf __pycache__
60+
rm -rf .pytest_cache
61+
rm -rf htmlcov
62+
rm -rf .coverage
63+
find . -name "*.pyc" -delete
64+
find . -name "__pycache__" -type d -delete
65+
66+
# Full CI check (lint + test)
67+
ci: lint test
68+
@echo "CI checks passed!"
69+
70+
# Quick verification of a code snippet (usage: make verify CODE="print('hello')")
71+
verify:
72+
@python -c "from commander import Commander; c = Commander(); print(c.verify('''$(CODE)'''))"

0 commit comments

Comments
 (0)