🚀 Version: North 3.0
North 3.0 is the current production release of the Institutional Compass application, deployed on Google Cloud Platform with enterprise-grade infrastructure and enhanced capabilities.
Cloud Infrastructure
The application is hosted entirely on Google Cloud Platform (GCP) using the following services:
- Cloud Run: Serverless container platform hosting the FastAPI Python backend with automatic scaling and zero-downtime deployments.
- Cloud SQL for PostgreSQL: Fully managed relational database storing all session data, user credentials, and computed artifacts using JSONB for flexible document storage.
- Container Registry (GCR): Docker image repository for versioned application deployments.
- Cloud Build: CI/CD pipeline for automated builds and deployments from source code.
Important: North 3.0 does not require Google Cloud Storage. All diagram artifacts (PNG files) are stored directly in PostgreSQL as Base64-encoded strings in the session_data.artifacts JSONB column, eliminating external file storage dependencies and simplifying the architecture.
System Capabilities
North 3.0 provides the following core capabilities:
- Six-Module Workflow: Progressive institutional analysis from definition through visualization to policy planning and reporting.
- PostgreSQL-Backed Storage: All session state, indicator data, computed vectors, and visualization artifacts stored in a single managed database.
- Headless Diagram Generation: Matplotlib with Agg backend renders three compass diagrams (head-to-tail chains, sector triangle, wish spot validation) without requiring a display server.
- Robust Normalization: Sigmoid-based normalization using comparable benchmarks with IQR-based scaling for outlier resistance.
- Bearer Token Authentication: Secure admin access with token-based authentication and environment-variable credential management.
- Custom Domain Support: Mapped to
institutionalcompass.com via Cloud Run domain mapping.
- Export & Import: JSON stage payloads, CSV indicator datasets, PNG diagram downloads, and DOCX report generation.
Technical Stack
- Backend: Python 3.12, FastAPI, SQLAlchemy, Alembic (migrations), Matplotlib, python-docx
- Frontend: Vanilla JavaScript, CSS custom properties (dark theme), responsive grid layouts
- Database: PostgreSQL 15 with JSONB for semi-structured data (session payloads, artifacts)
- Deployment: Docker containers on Cloud Run (auto-scaling, HTTPS, managed certificates)
- Testing: Pytest for backend unit tests, Selenium for deployed application verification
Deployment URLs
Both URLs serve the same Cloud Run deployment with identical functionality and data access.
What is the Institutional Compass?
The Institutional Compass is an analytical framework for evaluating and visualizing institutional qualities across three core dimensions: Harmony, Discipline, and Excitement.
In this application, the compass is implemented as a six-module workflow that starts with institutional definition and desired direction, moves through indicator collection and robust normalization, and concludes with visualization, validation against an aspirational "wish spot," policy planning, and final report generation.
Table of contents
Jump to a section:
How it works (end-to-end)
The application is designed as a progressive chain of responsibilities. Early modules capture intent and meaning; middle modules capture measurements and normalize them; late modules create decision-friendly visuals and planning artifacts.
- Module 1 defines what institution is being measured.
- Module 2 defines what "better" means by specifying a desired direction and tolerance region (the wish spot).
- Module 3 collects measurable indicators with provenance (sources) and benchmarking context (comparables).
- Module 4 performs robust normalization and places indicators into compass geometry (length + degree + sector + coordinates).
- Module 5 renders three compass diagrams and validates the computed final arrow against the wish spot.
- Module 6 supports policy planning, projection visualization (dual-arrow compass), and report generation (DOCX).
Practical note: stage submission order is enforced in places; later modules may assume earlier modules were submitted.
Core objects and concepts
Throughout the workflow, most data is stored per-session. Each module writes a "payload," and later modules read from it. The most important objects are:
- Session: a container for all module payloads and computed results, identified by a session ID.
- Qualities: the three axes of interpretation — Harmony, Discipline, Excitement.
- Wish spot: a target region in compass space represented by an arrow (length + rotation) and an ellipse tolerance (Rx, Ry).
- Indicator: a named measure with rationale, search guidance, and a data point with source and optional numeric value.
- Comparables: benchmark values for the same indicator from similar institutions; used to contextualize normalization.
- Sector: each indicator is placed into one of three angular ranges associated with Harmony, Discipline, or Excitement.
Module 1 — Defining the Institution
Module 1 establishes the institutional context: identity, boundaries, key actors, and continuity criteria.
The UI uses SMART-style prompts to help users be explicit about scope and meaning so later stages interpret indicators and policies against a stable definition.
- Inputs: structured textual answers describing the institution and what counts as "the same" institution over time.
- Outputs: a Stage 1 payload persisted on the session and summarized in reports.
Module 2 — Defining the Wish Spot
Module 2 captures both (a) qualitative meaning for Harmony, Discipline, and Excitement, and (b) a quantitative target in compass space.
Qualitatively, the module collects words and associations that help define what each quality means in this institution's context.
Quantitatively, it defines a wish spot as an arrow (length + rotation) and an ellipse tolerance region (Rx, Ry).
- Qualitative exploration: for each quality, users provide descriptors and multi-sensory anchors (e.g., adjectives, translations, places, activities).
- Strategic direction: users select which qualities matter most and justify the choice.
- Wish spot geometry: arrow length (0..1), rotation (0..360°), and ellipse radii (Rx, Ry).
- Derived fields: Cartesian wish coordinates are computed from polar inputs for downstream use.
Module 3 — Data Collection & Screening
Module 3 collects the institution's indicators in a structured, repeatable way.
Each indicator includes a rationale (why it matters), a search query (how to find benchmarks), and a data point (name, optional numeric value, notes, and a required source).
Users can enter comparables manually or let the UI generate default comparables from the base value.
- Inputs per indicator: reason, query, data point with provenance, and comparables.
- Automation hints: sphere, direction (higher/lower is better), importance weight, quality hint, include flag, and optional overrides.
- Portability: supports CSV import/export and a downloadable template for batch entry.
Module 4 — Data Analysis
Module 4 transforms raw indicator values into normalized compass vectors.
It uses comparable sets to compute a robust normalized score (0..1), scales this to a readable length (0..10), and assigns a degree (0..359°) that positions the indicator within the compass' three-sector geometry.
This stage also produces per-indicator coordinates and aggregate sector summaries used by Module 5.
- Comparables: define benchmarking context per indicator.
- Length: normalized score mapped to a consistent 0–10 scale.
- Degree: algorithmic mapping from normalized performance to a sector-aware angle.
- Outputs: indicator vectors plus aggregated sector arrows/centroids used for visualization.
Module 5 — Compass Visualization
Module 5 turns the computed vectors into three diagrams and validates the final arrow against the wish spot.
It reads the analyzed results (sector arrows + final arrow), overlays the wish spot (arrow + ellipse tolerance), and classifies whether the outcome is inside the wish region, aligned-but-too-long/short, or misaligned.
- Diagram 1: head-to-tail indicator chains (how sector arrows are constructed).
- Diagram 2: sector analysis triangle + final arrow (summary view).
- Diagram 3: wish spot validation overlay (goal achievement view).
- Interactive editor: slider-based preview and submit of wish spot parameter adjustments.
Module 6 — Report Generation
Module 6 supports policy planning and final documentation.
It suggests "aligning" indicators (near the wish direction) and "opposing" indicators (near the opposite direction), captures two policy narratives (Policy A to strengthen; Policy B to weaken), generates a dual-arrow projection visualization (current vs desired), and produces a final DOCX report for download.
- Suggestions: aligning vs opposing candidates, computed from analyzed indicators and the wish direction.
- Policies: text fields with optional underlying-cause notes, plus a combined reasonableness check.
- Artifacts: dual-arrow compass PNG (current vs desired with wish overlay).
- Report: DOCX export containing stage summaries and computed tables.
Key math (high level)
The implementation uses a small number of recurring geometric and normalization steps.
These are presented here for conceptual clarity (the application also stores intermediate results and logs during computation).
Wish spot: polar → Cartesian
X = L · cos(θ)
Y = L · sin(θ)
L = WishSpot_Arrow_Length
θ = WishSpot_Arrow_Rotation (deg)
Robust normalization (concept)
p = 1 / (1 + e^( -k · (x - m) ))
m = median(sample)
k = 4 / IQR(sample)
length0-10 = 10 · p
Wish validation: ellipse test
Translate: dx = x - cx, dy = y - cy
Rotate into ellipse frame
Test: (dx/rx)^2 + (dy/ry)^2 ≤ 1
inside = true if within tolerance
Outputs, artifacts, and exports
The application emphasizes portability and auditability. Most stages support JSON export/import; indicator datasets can be moved via CSV; visualizations are emitted as PNG artifacts; and the final report is a DOCX download.
- JSON: stage payload import/export for portability and draft recovery.
- CSV: indicator dataset import/export (Module 3) using a template format.
- PNG: Module 5 diagrams and Module 6 dual-arrow projection artifact.
- DOCX: Module 6 report generation and download.
This page describes the current North 3.0 release; wording and UI prompts may evolve as the system is refined.