Skip to content

Commit 9bec93d

Browse files
committed
feat(agent-workspace): add notification SLO governance
1 parent f09715d commit 9bec93d

8 files changed

Lines changed: 384 additions & 5 deletions

docs/brainstorms/2026-04-16-mainline-ci-stabilization-and-m7-direction-requirements.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,36 @@ Deliverables:
643643
- `npm run test:agent-workspace:contracts`
644644
- `npm run verify:agent-workspace:runtime`
645645

646+
### M7.21 (Now): Notification Escalation SLOs and Anomaly-Threshold Governance (Lane Ops Bridge)
647+
648+
Deliverables:
649+
650+
- add bounded notification SLO report route for operator governance review.
651+
- expose anomaly-threshold policy explicitly instead of keeping thresholds implicit in helper logic.
652+
- keep breach synthesis deterministic from current notification trail state.
653+
654+
#### M7.21 Progress Note (2026-04-16)
655+
656+
- [Done] expanded `src/server.ts` with notification SLO route:
657+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-slo?limit=...`.
658+
- [Done] expanded notification-policy output:
659+
- `/triage/remediation/escalation/notification-policy` now includes `anomalyThresholdPolicy`.
660+
- [Done] added deterministic anomaly-threshold/SLO helper stack:
661+
- `getAgentWorkspaceDiagnosticsRemediationEscalationNotificationAnomalyThresholdPolicy(...)`,
662+
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationSloReport(...)`.
663+
- [Done] SLO breach synthesis now covers at least:
664+
- suppressed notification count threshold,
665+
- throttled digest count threshold,
666+
- suppressed-to-emitted ratio threshold.
667+
- [Done] expanded evidence coverage:
668+
- `src/server.migration.test.ts` now validates anomaly-threshold policy payload and notification SLO route semantics.
669+
- `src/knowledge.api.contract.test.ts` now fail-fast checks notification-slo route contract.
670+
- `src/agent_workspace.verification.contract.test.ts` + `scripts/verify-agent-workspace-runtime.js` now fail fast on SLO/threshold helper and route drift.
671+
- [Done] verification evidence:
672+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern "escalation notification SLOs and anomaly-threshold governance stay deterministic"`
673+
- `npm run test:agent-workspace:contracts`
674+
- `npm run verify:agent-workspace:runtime`
675+
646676
## Success Criteria
647677

648678
- CI failure mode that previously blocked the three agent-workspace suites is eliminated on mainline.
@@ -652,4 +682,4 @@ Deliverables:
652682

653683
## Next Step
654684

655-
Proceed to `/prompts:ce-plan` using this document as the source for `M7.21` decomposition (notification escalation SLOs and anomaly-threshold governance), while preserving M7 lane boundary constraints.
685+
Proceed to `/prompts:ce-plan` using this document as the source for `M7.22` decomposition (notification threshold overrides and audit-trail governance), while preserving M7 lane boundary constraints.

docs/diataxis/en/explanation/development-progress-dashboard.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,25 @@ Execution anchor:
599599
- `npm run test:agent-workspace:contracts`
600600
- `npm run verify:agent-workspace:runtime`
601601

602+
## Latest Mainline Increment (2026-04-16 M7.21 Notification Escalation SLOs and Anomaly-Threshold Governance Lane)
603+
604+
- Expanded `src/server.ts` with notification SLO route:
605+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-slo?limit=...`.
606+
- Expanded notification governance payload:
607+
- `/triage/remediation/escalation/notification-policy` now includes explicit `anomalyThresholdPolicy`.
608+
- Added deterministic notification SLO synthesis:
609+
- suppression-count warning threshold,
610+
- throttled-digest warning threshold,
611+
- suppressed-to-emitted ratio warning threshold.
612+
- Expanded executable evidence:
613+
- `src/server.migration.test.ts` now validates anomaly-threshold policy payload and notification SLO route semantics.
614+
- Hardened runtime verification gate:
615+
- `src/knowledge.api.contract.test.ts`, `src/agent_workspace.verification.contract.test.ts`, and `scripts/verify-agent-workspace-runtime.js` now fail fast on notification-slo route and anomaly-threshold/SLO helper drift.
616+
- Verification evidence:
617+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"escalation notification SLOs and anomaly-threshold governance stay deterministic\"`
618+
- `npm run test:agent-workspace:contracts`
619+
- `npm run verify:agent-workspace:runtime`
620+
602621
## Mainline vs Working-Branch Snapshot (2026-04-14)
603622

604623
| Capability Slice | Working Branch (`feat/learning-multi-tutor-adapter`) | Mainline (`origin/main`) | Integration Status |
@@ -647,7 +666,7 @@ This dashboard aligns against the following requirement chain:
647666
| L2 Retrieval | explainable hybrid/vector retrieval + governance | Expanded in branch-oriented plans | Mainline file-backed baseline only (`src/learning/store.ts`) | Re-enter lane after concrete module evidence lands on mainline |
648667
| L3 Learning | mastery diagnostics + path/session loop | Expanded in branch | Partially integrated | Contract and integration parity |
649668
| L4 Interaction | agent conversation + focus/path pane runtime | Implemented in branch | M1-M4 baseline integrated on mainline | Expand capability surface via typed contract only |
650-
| L5 Governance | runbook, diagnostics, replay/autonomy controls | Expanded in branch | Operator diagnostics persistence/triage/history/threshold governance + runbook automation/audit + adaptive simulation/remediation + remediation backtest/approval-gate + approval-policy hardening/regression-alarms + approval-policy drift/escalation + escalation acknowledgement lifecycle/audit + escalation SLA/reminder baseline + notification digest/suppression baseline + delivery-log observability + stale-cleanup health auditing + anomaly/retention governance integrated | M7.21: notification escalation SLOs and anomaly-threshold governance |
669+
| L5 Governance | runbook, diagnostics, replay/autonomy controls | Expanded in branch | Operator diagnostics persistence/triage/history/threshold governance + runbook automation/audit + adaptive simulation/remediation + remediation backtest/approval-gate + approval-policy hardening/regression-alarms + approval-policy drift/escalation + escalation acknowledgement lifecycle/audit + escalation SLA/reminder baseline + notification digest/suppression baseline + delivery-log observability + stale-cleanup health auditing + anomaly/retention governance + notification SLO governance integrated | M7.22: notification threshold overrides and audit-trail governance |
651670

652671
## Verification Baseline
653672

docs/diataxis/zh/explanation/development-progress-dashboard.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,25 @@
601601
- `npm run test:agent-workspace:contracts`
602602
- `npm run verify:agent-workspace:runtime`
603603

604+
## 主线最新增量(2026-04-16 M7.21 通知升级 SLO 与异常阈值治理链路)
605+
606+
- 已在 `src/server.ts` 增加通知 SLO 路由:
607+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-slo?limit=...`
608+
- 已扩展通知治理输出:
609+
- `/triage/remediation/escalation/notification-policy` 现在输出显式 `anomalyThresholdPolicy`
610+
- 已新增确定性通知 SLO 合成:
611+
- suppressed count 告警阈值,
612+
- throttled digest 告警阈值,
613+
- suppressed-to-emitted ratio 告警阈值。
614+
- 已补可执行证据:
615+
- `src/server.migration.test.ts` 新增 anomaly-threshold policy 载荷与 notification SLO 路由语义断言。
616+
- 已加固 runtime 门禁:
617+
- `src/knowledge.api.contract.test.ts``src/agent_workspace.verification.contract.test.ts``scripts/verify-agent-workspace-runtime.js` 新增 notification-slo 路由与 anomaly-threshold/SLO helper 的 fail-fast 断言。
618+
- 验证证据:
619+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"escalation notification SLOs and anomaly-threshold governance stay deterministic\"`
620+
- `npm run test:agent-workspace:contracts`
621+
- `npm run verify:agent-workspace:runtime`
622+
604623
## 主线 vs 工作分支快照(2026-04-14)
605624

606625
| 能力切片 | 工作分支(`feat/learning-multi-tutor-adapter`| 主线(`origin/main`| 集成状态 |
@@ -649,7 +668,7 @@
649668
| L2 检索层 | 可解释混合/向量检索 + 治理 | 分支规划增强中 | 主线当前为 file-backed 基线(`src/learning/store.ts`| 待主线出现对应模块证据后再收敛 |
650669
| L3 学习层 | 掌握诊断 + 路径/会话闭环 | 分支增强中 | 主线部分集成 | 契约与集成一致性 |
651670
| L4 交互层 | agent 对话 + focus/path pane 运行时 | 分支已实现 | 主线 M1-M4 已落入基线 | 继续通过 typed contract 扩展动作面 |
652-
| L5 治理层 | runbook/诊断/回放与自动化 | 分支增强中 | 主线已集成运维诊断持久化/分级/趋势历史/阈值治理 + runbook 自动化/阈值审计 + 自适应模拟/自动修复 + 回测/批准门禁 + 批准策略硬化/回归告警 + 批准策略漂移/升级 + 升级确认生命周期/审计 + 升级 SLA/提醒基线 + 通知摘要/抑制基线 + 交付日志可观测性 + 陈旧通知健康审计 + 异常/retention 治理 | M7.21:通知升级 SLO 与异常阈值治理 |
671+
| L5 治理层 | runbook/诊断/回放与自动化 | 分支增强中 | 主线已集成运维诊断持久化/分级/趋势历史/阈值治理 + runbook 自动化/阈值审计 + 自适应模拟/自动修复 + 回测/批准门禁 + 批准策略硬化/回归告警 + 批准策略漂移/升级 + 升级确认生命周期/审计 + 升级 SLA/提醒基线 + 通知摘要/抑制基线 + 交付日志可观测性 + 陈旧通知健康审计 + 异常/retention 治理 + 通知 SLO 治理 | M7.22:通知阈值覆盖与审计轨迹治理 |
653672

654673
## 验证基线
655674

scripts/verify-agent-workspace-runtime.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ function verifyAgentWorkspaceRuntime(repoRoot = path.resolve(__dirname, '..')) {
172172
serverSource.includes('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-anomalies'),
173173
'Missing diagnostics remediation escalation notification anomalies route in src/server.ts'
174174
);
175+
assert(
176+
serverSource.includes('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-slo'),
177+
'Missing diagnostics remediation escalation notification SLO route in src/server.ts'
178+
);
175179
assert(
176180
serverSource.includes('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/digest'),
177181
'Missing diagnostics remediation escalation digest route in src/server.ts'
@@ -308,10 +312,18 @@ function verifyAgentWorkspaceRuntime(repoRoot = path.resolve(__dirname, '..')) {
308312
serverSource.includes('getAgentWorkspaceDiagnosticsRemediationEscalationNotificationRetentionPolicy'),
309313
'Missing remediation escalation notification retention policy helper in src/server.ts'
310314
);
315+
assert(
316+
serverSource.includes('getAgentWorkspaceDiagnosticsRemediationEscalationNotificationAnomalyThresholdPolicy'),
317+
'Missing remediation escalation notification anomaly threshold helper in src/server.ts'
318+
);
311319
assert(
312320
serverSource.includes('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationAnomalyReport'),
313321
'Missing remediation escalation notification anomaly report helper in src/server.ts'
314322
);
323+
assert(
324+
serverSource.includes('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationSloReport'),
325+
'Missing remediation escalation notification SLO report helper in src/server.ts'
326+
);
315327
assert(
316328
serverSource.includes('applyAgentWorkspaceDiagnosticsRemediationEscalationReminderSuppressionPolicy'),
317329
'Missing remediation escalation reminder suppression policy helper in src/server.ts'
@@ -379,14 +391,14 @@ function verifyAgentWorkspaceRuntime(repoRoot = path.resolve(__dirname, '..')) {
379391
'diagnostics remediation policy drift route exists',
380392
'diagnostics remediation escalation route exists',
381393
'diagnostics remediation escalation SLA/reminder routes exist',
382-
'diagnostics remediation escalation notification policy, log, health, anomaly, and digest routes exist',
394+
'diagnostics remediation escalation notification policy, log, health, anomaly, SLO, and digest routes exist',
383395
'diagnostics remediation escalation acknowledgement routes exist',
384396
'diagnostics remediation approval routes exist',
385397
'diagnostics triage remediation route exists',
386398
'diagnostics retention governance exists',
387399
'diagnostics alert-threshold governance helpers exist',
388400
'diagnostics threshold simulation, drift, remediation, escalation, and SLA helpers exist',
389-
'diagnostics escalation notification, digest cadence, reminder suppression, delivery-log, health, and anomaly helpers exist',
401+
'diagnostics escalation notification, digest cadence, reminder suppression, delivery-log, health, anomaly, and SLO helpers exist',
390402
'diagnostics remediation policy and alarm helpers exist',
391403
'diagnostics threshold audit helpers exist',
392404
'diagnostics remediation approval trail helpers exist',

src/agent_workspace.verification.contract.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ describe('agent workspace verification script contracts', () => {
6666
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notifications');
6767
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-health');
6868
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-anomalies');
69+
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-slo');
6970
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/digest');
7071
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/acknowledge');
7172
expect(runtimeSource).toContain('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/approvals');
@@ -99,6 +100,8 @@ describe('agent workspace verification script contracts', () => {
99100
expect(runtimeSource).toContain('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationHealthReport');
100101
expect(runtimeSource).toContain('getAgentWorkspaceDiagnosticsRemediationEscalationNotificationRetentionPolicy');
101102
expect(runtimeSource).toContain('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationAnomalyReport');
103+
expect(runtimeSource).toContain('getAgentWorkspaceDiagnosticsRemediationEscalationNotificationAnomalyThresholdPolicy');
104+
expect(runtimeSource).toContain('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationSloReport');
102105
expect(runtimeSource).toContain('applyAgentWorkspaceDiagnosticsRemediationEscalationReminderSuppressionPolicy');
103106
expect(runtimeSource).toContain('buildAgentWorkspaceDiagnosticsRemediationEscalationGovernanceContext');
104107
expect(runtimeSource).toContain('acknowledgeAgentWorkspaceDiagnosticsRemediationEscalation');

src/knowledge.api.contract.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ describe('Knowledge mastery API contract wiring', () => {
3030
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notifications',
3131
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-health',
3232
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-anomalies',
33+
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-slo',
3334
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/digest',
3435
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/acknowledge',
3536
'/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/approvals',

0 commit comments

Comments
 (0)