✅ Cognitive Alignment – Action Review & Feedback Loop
cognitivealignment records the final verdict on every material decision taken by Reggie.
It completes the chain that starts in reasonlog: once an action is executed (or vetoed), an entry here states whether the outcome aligned with policy, safety, and organisational values.
Regular analysis of this table tunes future risk thresholds and autonomy levels.
1. Purpose
| Why it exists | How it helps |
|---|
| Governance & Safety | Ensures each high-impact action is judged against compliance, privacy and ethical standards. |
| Continuous Learning | Misaligned outcomes feed back into training; aligned ones reinforce good heuristics. |
| Scalable Monitoring | Supports a spectrum from Review-All to Spot-Check as confidence grows. |
| Audit Trail | Immutable record linked to reasonlog lets auditors replay thought-to-judgement history. |
2. Monitoring Levels
| Level | Name | Operational Behaviour |
|---|
| 0 | Review-All | Every action requires human approval before execution. |
| 1 | Pre-Exec Sampling | High-risk (risk ≥ 0.5) actions block for review; low-risk auto-execute. |
| 2 | Post-Exec Review | All actions execute; high-risk ones enter an after-the-fact audit queue. |
| 3 | Spot-Check | Random N % of actions plus any anomaly flags are reviewed. |
| 4 | Autonomous | Agent acts freely; reviews triggered only by downstream alerts. |
Current level is stored per-module and adjusted via the Aspirations roadmap.
3. Table Schema (PostgreSQL)
| Column | Type | Notes |
|---|
id | uuid PK | Unique review identifier |
reason_id | uuid NOT NULL | FK → reasonlog.id (links to decision’s chain-of-thought) |
timestamp | timestamptz NOT NULL | Review completion time |
outcome | text NOT NULL | APPROVED, REJECTED, ADJUSTED |
alignment_score | numeric(3,2) | −1.00 (strongly misaligned) → 1.00 (strongly aligned) |
notes | text | Free-form reviewer comments |
vector | vector(768) | Embedding of notes for semantic recall |
reviewer | text | Human UID or automated agent name |
monitor_level | smallint | Level 0-4 in force for this review |
4. Review Workflow & Learning Loop
- Creation – When monitoring rules require oversight, a row with
outcome = 'PENDING' is inserted.
- Linkage –
reason_id ties directly to the originating reasonlog entry.
- Verdict – Human reviewer or automated rule sets
outcome and alignment_score; DB trigger updates reasonlog.status.
- Learning – Nightly job analyses
(risk, alignment_score) pairs, updating risk calibration curves and populating context buckets with lessons learned.
- Autonomy Tuning – If ≥ 5 high-priority misalignments occur in 24 h, the module’s monitoring level automatically downgrades (e.g., 3 → 1).
5. Metrics & Governance
| Metric | Alert Threshold |
|---|
alignment_mean_24h | < 0.70 triggers “yellow” alert |
misalignment_high_priority_cnt | ≥ 5 in 24 h triggers autonomy rollback |
review_queue_lag_seconds | > 900 s pages reviewer on-call |
Edits to this file require sign-off by both the Clinical Lead and Security Officer.
CI lints alignment_score ranges and prevents removal of historical rows.