Skip to content

Commit 540eac6

Browse files
author
OneFineStarstuff
committed
docs(gov): add capacity-aware roadmap, glossary mapping, readiness checklist, artefact templates; feat(gov): governance cockpit page; feat(risk): mock risk scores API and pulse on /risk
1 parent fea6321 commit 540eac6

13 files changed

Lines changed: 195 additions & 6 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export const runtime = 'nodejs';
2+
export async function GET() {
3+
// Mock time-series risk per layer: core/operational/context
4+
const now = Date.now();
5+
const series = ['core','operational','context'].map((k, i) => ({
6+
key: k,
7+
points: Array.from({ length: 12 }, (_, j) => ({ t: now - (11 - j) * 3600_000, v: clamp(0, 100, 30 + i*20 + Math.sin(j/2+i)*15 + Math.random()*10) }))
8+
}));
9+
return Response.json({ series });
10+
}
11+
function clamp(min:number,max:number,v:number){return Math.max(min,Math.min(max,v));}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readFileSync } from 'fs';
2+
import path from 'path';
3+
export const dynamic = 'force-static';
4+
export default function Page() {
5+
const md = readFileSync(path.join(process.cwd(), 'next-app', 'docs', 'governance-terms-mapping.md'), 'utf8');
6+
return <pre className="whitespace-pre-wrap text-sm">{md}</pre>;
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readFileSync } from 'fs';
2+
import path from 'path';
3+
export const dynamic = 'force-static';
4+
export default function Page() {
5+
const md = readFileSync(path.join(process.cwd(), 'next-app', 'docs', 'readiness-checklist.md'), 'utf8');
6+
return <pre className="whitespace-pre-wrap text-sm">{md}</pre>;
7+
}

next-app/app/docs/roadmap/page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readFileSync } from 'fs';
2+
import path from 'path';
3+
export const dynamic = 'force-static';
4+
export default function Page() {
5+
const md = readFileSync(path.join(process.cwd(), 'next-app', 'docs', 'roadmap.md'), 'utf8');
6+
return <pre className="whitespace-pre-wrap text-sm">{md}</pre>;
7+
}

next-app/app/governance/page.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Link from 'next/link';
2+
3+
export const metadata = { title: 'Governance Cockpit' };
4+
export default function GovernancePage() {
5+
return (
6+
<main className="space-y-4">
7+
<h1 className="text-2xl font-semibold">Governance Cockpit</h1>
8+
<p className="text-sm text-slate-600">Board-ready artifact hub with live roadmap, mappings, and templates.</p>
9+
<ul className="list-disc pl-6 text-amber-800">
10+
<li><Link href="/docs/roadmap" className="underline">Roadmap (capacity-aware)</Link></li>
11+
<li><Link href="/docs/governance-terms-mapping" className="underline">Integrated 18‑Point Mapping</Link></li>
12+
<li><Link href="/docs/readiness-checklist" className="underline">Implementation Readiness Checklist</Link></li>
13+
<li><Link href="/templates/artefact-templates" className="underline">Governance Artefact Templates</Link></li>
14+
<li><Link href="/risk" className="underline">Interactive Risk & Governance Demos</Link></li>
15+
</ul>
16+
</main>
17+
);
18+
}

next-app/app/risk/page.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
export const metadata = { title: 'AI Risk Navigator' };
1+
export const metadata = { title: 'AI Risk Navigator' } as const;
2+
import { PULSE_SCRIPT } from './pulse-script';
3+
24
export default function RiskPage() {
35
return (
46
<main className="space-y-4">
5-
<h1 className="text-2xl font-semibold">Interactive 10-Stage AI Risk Matrix</h1>
7+
<h1 className="text-2xl font-semibold">Interactive 10-Stage AI Risk Matrix <span id="pulse" className="ml-2 text-xs text-slate-500"></span></h1>
68
<p className="text-sm text-slate-600">Filterable matrix and governance dashboard demos.</p>
7-
<iframe srcDoc={RISK_HTML} className="h-[80vh] w-full rounded border" />
9+
<iframe id="riskFrame" srcDoc={RISK_HTML} className="h-[80vh] w-full rounded border" />
10+
<script dangerouslySetInnerHTML={{__html: PULSE_SCRIPT}} />
811
</main>
912
);
1013
}
@@ -15,6 +18,7 @@ const RISK_HTML = `<!DOCTYPE html>
1518
</head><body>
1619
${MATRIX_SECTION}
1720
${GOV_DASHBOARD}
21+
<script>window.addEventListener('message',e=>{if(e.data&&e.data.type==='risk-pulse'){document.body.style.boxShadow='inset 0 0 0 3px rgba(234,179,8,.6)';setTimeout(()=>{document.body.style.boxShadow='none';},300);}})</script>
1822
</body></html>`;
1923

2024
const MATRIX_SECTION = `
@@ -79,8 +83,8 @@ const GOV_DASHBOARD = `
7983
<div style="font-size:12px;color:#475569;margin-bottom:6px">Aggregated Risk: <span id="aggRisk" style="font-weight:700;color:#16a34a">Low</span></div>
8084
<div style="font-size:12px;color:#475569;margin-bottom:6px">Governance: <span id="govBody">Safety Oversight Board</span></div>
8185
<div style="display:flex;gap:8px;margin-top:8px">
82-
<button onclick="alert('Exporting report...')" style="flex:1;padding:8px 10px;border:none;border-radius:8px;background:#667eea;color:#fff;font-weight:600">Export Report</button>
83-
<button onclick="alert('Scheduling review...')" style="flex:1;padding:8px 10px;border:none;border-radius:8px;background:#764ba2;color:#fff;font-weight:600">Schedule Review</button>
86+
<button onclick="parent.postMessage({type:'risk-pulse'},'*')" style="flex:1;padding:8px 10px;border:none;border-radius:8px;background:#667eea;color:#fff;font-weight:600">Export Report</button>
87+
<button onclick="parent.postMessage({type:'risk-pulse'},'*')" style="flex:1;padding:8px 10px;border:none;border-radius:8px;background:#764ba2;color:#fff;font-weight:600">Schedule Review</button>
8488
</div>
8589
</div>
8690
</div>

next-app/app/risk/pulse-script.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export const PULSE_SCRIPT = `
2+
(async function(){
3+
const pulseEl = document.getElementById('pulse');
4+
async function tick(){
5+
try{
6+
const res = await fetch('/api/risk/scores');
7+
const json = await res.json();
8+
const ctx = json.series.find((s:any)=>s.key==='context');
9+
const last = ctx?.points?.[ctx.points.length-1]?.v ?? 0;
10+
if(pulseEl){ pulseEl.textContent = 'Context risk: ' + Math.round(last); }
11+
const iframe = document.getElementById('riskFrame') as HTMLIFrameElement | null;
12+
iframe?.contentWindow?.postMessage({type:'risk-pulse'}, '*');
13+
}catch(e){ if(pulseEl) pulseEl.textContent = 'Risk: n/a'; }
14+
setTimeout(tick, 6000);
15+
}
16+
tick();
17+
})();
18+
`;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { readFileSync } from 'fs';
2+
import path from 'path';
3+
export const dynamic = 'force-static';
4+
export default function Page() {
5+
const md = readFileSync(path.join(process.cwd(), 'next-app', 'templates', 'artefact-templates.md'), 'utf8');
6+
return <pre className="whitespace-pre-wrap text-sm">{md}</pre>;
7+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Integrated 18‑Point Glossary → Phase Mapping
2+
3+
This table anchors each concept to: phase, artefacts, risk hooks, roles, dependencies, and notes. Use alongside docs/roadmap.md.
4+
5+
| # | Term | Phase | Artefacts | Risk Hooks | Roles | Dependencies | Notes |
6+
| - | ---- | ----- | --------- | ---------- | ----- | ------------ | ----- |
7+
| 1 | Framework | 1 | Architecture docs, standards charter | Vendor lock‑in check | Architects, Standards | → Model, System | Validate enterprise fit |
8+
| 2 | Architecture | 1 | System diagrams, dependency maps | Scalability & vuln scans | Architects, Security | All | Ensure adaptive access |
9+
| 3 | Dataset | 1 | Governance policy, audit trails | Contamination detection | Data Gov, Legal | → Model, Metrics | Privacy by design |
10+
| 4 | Model | 2 | Review board records, training logs | Drift detection | ML Eng, Ethics | Framework, Dataset | Thresholds trigger reviews |
11+
| 5 | Algorithm | 2 | Ethics panel reviews | Fairness monitoring | Ethics, Auditors | Model | Baseline fairness & cycles |
12+
| 6 | Pipeline | 2 | Dashboards, audit trails | Failure recovery | DevOps, SRE | Dataset→Model | Escalation on fail |
13+
| 7 | System | 3 | Integration board docs | Rollback procedures | Integration, Arch | 1–2 | Gate before deploy |
14+
| 8 | Agent | 3 | Behavior logs, autonomy limits | Anomaly detection | Oversight, Auditors | 4–6 | Enforce boundaries |
15+
| 9 | Environment | 3 | Safety assessments | Boundary monitoring | Safety, Ops | Agent | Pre‑defined protocols |
16+
|10 | Interface | 3 | Accessibility & UX records | Access control checks | UX, A11y | System | Transparency by default |
17+
|11 | Module | 3 | Integration docs | Isolation & impact checks | Module Arch | All | Define clear contracts |
18+
|12 | Controller | 4 | Oversight logs | Authority validation | Oversight | Agent, Policy | Escalation paths |
19+
|13 | Policy | 4 | Compliance monitoring | Constraint enforcement | Policy, Compliance | Agent, Controller | Adaptive policies |
20+
|14 | Knowledge Base | 4 | Accuracy validation | Integrity checks | Info Arch | Memory | Build from ops history |
21+
|15 | Memory | 4 | Retention docs | Corruption detection | Mgmt Board | Knowledge Base | Audit continuously |
22+
|16 | Reward Function | 4 | Alignment validation | Reward hacking detection | Alignment | Agent | Sandbox validation |
23+
|17 | Evaluation Metrics | 4 | Benchmarks | Manipulation detection | Validation | All | Prevent gaming |
24+
|18 | Safety Layer | 4 | Incident logs | Escalation & enforcement | Safety | All | Rapid response integration |
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Implementation Readiness Checklist
2+
3+
Assess before committing timelines:
4+
5+
- People & Competencies
6+
- Roles staffed or contracting plan (Architecture, Data Gov, Ethics, UX, Safety)
7+
- Training paths identified; time boxed
8+
- Technology
9+
- Hosting & data residency constraints documented
10+
- Secrets management, logging, monitoring plan
11+
- DB & messaging choices fit capacity
12+
- Processes
13+
- Governance councils named; decision rights clear
14+
- Escalation/incident process defined
15+
- Documentation habit & templates adopted
16+
- Compliance & Risk
17+
- Regulatory scope mapped; artefact list reconciled
18+
- Privacy & data handling policies approved
19+
- Third‑party/vendor assessments ready

0 commit comments

Comments
 (0)