Skip to content

Commit 494d0c8

Browse files
committed
feat: add notification-threshold supersession summary
1 parent cbc9afc commit 494d0c8

8 files changed

Lines changed: 378 additions & 48 deletions

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

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ Suggested verification slice:
969969
- Best next increment is not broader remediation or UI work.
970970
Best next increment is a narrow supersession summary surface over the existing history artifacts.
971971

972-
### M7.27 (Next): Notification-Threshold Apply Outcome Supersession Summary (Lane Ops Bridge)
972+
### M7.27 (Now): Notification-Threshold Apply Outcome Supersession Summary (Lane Ops Bridge)
973973

974974
Deliverables:
975975

@@ -985,6 +985,60 @@ Suggested verification slice:
985985
- `npm run docs:diataxis:check`
986986
- `npm run docs:site:build`
987987

988+
#### M7.27 Progress Note (2026-04-16)
989+
990+
- [Done] expanded `src/server.ts` with compact supersession summary route:
991+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/summary?limit=...`.
992+
- [Done] added deterministic summary helper:
993+
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeSupersessionSummary(...)`.
994+
- [Done] summary payload now layers compact operator handoff over the existing bounded history surface:
995+
- `summary.scannedEntries`,
996+
- `summary.counts.current`,
997+
- `summary.counts.superseded`,
998+
- `summary.counts.drifted`,
999+
- `summary.latestCurrent`,
1000+
- `summary.latestSuperseded`,
1001+
- `summary.latestDrifted`.
1002+
- [Done] summary semantics are now explicit:
1003+
- aligned latest entry is surfaced as `latestCurrent`,
1004+
- older covered entries are compacted under `latestSuperseded`,
1005+
- later-invalidated newest entry is surfaced as `latestDrifted`,
1006+
- all values remain bounded by the requested history scan limit.
1007+
- [Done] expanded evidence coverage:
1008+
- `src/server.migration.test.ts` now validates pre-drift summary counts and latest snapshots, then validates drifted counts and latest drifted snapshot after a later override.
1009+
- `src/knowledge.api.contract.test.ts`, `src/agent_workspace.verification.contract.test.ts`, and `scripts/verify-agent-workspace-runtime.js` now fail fast on summary-route and summary-helper drift.
1010+
- [Done] verification evidence:
1011+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern "notification threshold apply outcome supersession summary stays deterministic"`
1012+
- `npm run test:agent-workspace:contracts`
1013+
- `npm run verify:agent-workspace:runtime`
1014+
- `npm run docs:diataxis:check`
1015+
- `npm run docs:site:build`
1016+
1017+
### Post-M7.27 Architecture Judgment
1018+
1019+
- L5 governance now covers preview, guarded apply, reconciliation, bounded history, and compact supersession summary for notification-threshold changes.
1020+
- Current weak point shifts from operator scan effort to filterability:
1021+
- operators can now get a compact summary without scanning the whole list,
1022+
- operators still cannot request a targeted filtered slice such as drifted-only or superseded-only entries from the history surface.
1023+
- Best next increment is not broader remediation or UI work.
1024+
Best next increment is a narrow filtered history surface over the existing bounded apply-outcome history.
1025+
1026+
### M7.28 (Next): Notification-Threshold Filtered Outcome History Views (Lane Ops Bridge)
1027+
1028+
Deliverables:
1029+
1030+
- add read-only filtered history views for bounded apply-outcome history.
1031+
- support compact filtering by reconciliation status so operators can request drifted-only, superseded-only, or current-only slices without client-side scanning.
1032+
- keep scope limited to notification-threshold governance; do not reopen UI, unrelated remediation lanes, or retrieval/memory work.
1033+
1034+
Suggested verification slice:
1035+
1036+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern "notification threshold filtered outcome history"`
1037+
- `npm run test:agent-workspace:contracts`
1038+
- `npm run verify:agent-workspace:runtime`
1039+
- `npm run docs:diataxis:check`
1040+
- `npm run docs:site:build`
1041+
9881042
## Success Criteria
9891043

9901044
- CI failure mode that previously blocked the three agent-workspace suites is eliminated on mainline.
@@ -994,4 +1048,4 @@ Suggested verification slice:
9941048

9951049
## Next Step
9961050

997-
Proceed to `/prompts:ce-plan` using this document as the source for `M7.27` decomposition (notification-threshold apply outcome supersession summary), while preserving M7 lane boundary constraints.
1051+
Proceed to `/prompts:ce-plan` using this document as the source for `M7.28` decomposition (notification-threshold filtered outcome history views), while preserving M7 lane boundary constraints.

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

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -599,34 +599,31 @@ 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.26 Notification-Threshold Apply Outcome History Surface Lane)
603-
604-
- Expanded `src/server.ts` with bounded history route:
605-
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/history?limit=...`.
606-
- Added file-backed apply-outcome history persistence:
607-
- `runtime_data/agent_workspace_diagnostics/triage_remediation_escalation_notification_threshold_apply_outcome_history.v1.json`.
608-
- Added deterministic history helper stack:
609-
- `readAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistory(...)`,
610-
- `appendAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistory(...)`,
611-
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistorySurface(...)`.
612-
- Hardened operator handoff without widening scope:
613-
- apply execution now writes both the latest single-record outcome and bounded newest-first history,
614-
- history payload now exposes per-entry `reconciliation.isLatestOutcome`, `reconciliation.latestAuditMatchesEntry`, `reconciliation.activeThresholdsMatchEntry`, `reconciliation.status`, and `reconciliation.driftReasons`.
615-
- Added deterministic history semantics:
616-
- aligned newest entry reports `current`,
617-
- older entries superseded by later applies report `superseded`,
618-
- newest entry later invalidated by follow-up overrides reports `drifted`.
602+
## Latest Mainline Increment (2026-04-16 M7.27 Notification-Threshold Apply Outcome Supersession Summary Lane)
603+
604+
- Expanded `src/server.ts` with compact supersession summary route:
605+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/summary?limit=...`.
606+
- Added deterministic summary helper:
607+
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeSupersessionSummary(...)`.
608+
- Hardened operator scan effort without widening scope:
609+
- summary payload now exposes `summary.scannedEntries`, `summary.counts`, `summary.latestCurrent`, `summary.latestSuperseded`, and `summary.latestDrifted`,
610+
- summary is computed over the existing bounded history surface rather than introducing a separate persistence model.
611+
- Added deterministic supersession summary semantics:
612+
- aligned latest entry is surfaced as `latestCurrent`,
613+
- older covered entries compact under `latestSuperseded`,
614+
- later-invalidated newest entry is surfaced as `latestDrifted`,
615+
- all values stay bounded by the requested scan limit.
619616
- Expanded executable evidence:
620-
- `src/server.migration.test.ts` now validates newest-first history ordering, persisted history-file contents, superseded older entries, and later drift of the newest entry.
617+
- `src/server.migration.test.ts` now validates pre-drift summary counts/latest snapshots and post-drift counts/latest drifted snapshot after a later override.
621618
- Hardened runtime verification gate:
622-
- `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-threshold history route and history-helper drift.
619+
- `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-threshold summary route and summary-helper drift.
623620
- Verification evidence:
624-
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome history stays deterministic\"`
621+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome supersession summary stays deterministic\"`
625622
- `npm run test:agent-workspace:contracts`
626623
- `npm run verify:agent-workspace:runtime`
627624
- Next direction judgment:
628-
- current bottleneck shifts from history availability to compact operator summary,
629-
- M7.27 should stay bounded to supersession summary, not broader remediation or UI expansion.
625+
- current bottleneck shifts from summary compactness to filterability,
626+
- M7.28 should stay bounded to filtered history views, not broader remediation or UI expansion.
630627

631628
## Mainline vs Working-Branch Snapshot (2026-04-14)
632629

@@ -676,7 +673,7 @@ This dashboard aligns against the following requirement chain:
676673
| 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 |
677674
| L3 Learning | mastery diagnostics + path/session loop | Expanded in branch | Partially integrated | Contract and integration parity |
678675
| L4 Interaction | agent conversation + focus/path pane runtime | Implemented in branch | M1-M4 baseline integrated on mainline | Expand capability surface via typed contract only |
679-
| 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 + notification-threshold override/audit governance + rollback preview/drift-diff governance + rollback apply guardrails + latest apply-outcome reconciliation + bounded apply-outcome history integrated | M7.27: notification-threshold apply outcome supersession summary |
676+
| 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 + notification-threshold override/audit governance + rollback preview/drift-diff governance + rollback apply guardrails + latest apply-outcome reconciliation + bounded apply-outcome history + supersession summary integrated | M7.28: notification-threshold filtered outcome history views |
680677

681678
## Verification Baseline
682679

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

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -601,34 +601,31 @@
601601
- `npm run test:agent-workspace:contracts`
602602
- `npm run verify:agent-workspace:runtime`
603603

604-
## 主线最新增量(2026-04-16 M7.26 通知阈值 apply outcome history surface 链路)
605-
606-
- 已在 `src/server.ts` 增加有界 history 路由:
607-
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/history?limit=...`
608-
- 已增加 file-backed apply-outcome history 持久化:
609-
- `runtime_data/agent_workspace_diagnostics/triage_remediation_escalation_notification_threshold_apply_outcome_history.v1.json`
610-
- 已增加确定性 history helper 栈:
611-
- `readAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistory(...)`
612-
- `appendAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistory(...)`
613-
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistorySurface(...)`
614-
- 已在不扩 scope 前提下补足 operator handoff:
615-
- apply 执行现在同时写入 latest 单记录 outcome 与有界 newest-first history,
616-
- history 载荷现在输出逐条 `reconciliation.isLatestOutcome``reconciliation.latestAuditMatchesEntry``reconciliation.activeThresholdsMatchEntry``reconciliation.status``reconciliation.driftReasons`
617-
- 已增加确定性 history 语义:
618-
- 对齐的最新 entry 报告 `current`
619-
- 被后续 apply 覆盖的旧 entry 报告 `superseded`
620-
- 最新 entry 被后续 override 破坏时报告 `drifted`
604+
## 主线最新增量(2026-04-16 M7.27 通知阈值 apply outcome supersession summary 链路)
605+
606+
- 已在 `src/server.ts` 增加紧凑 supersession summary 路由:
607+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/summary?limit=...`
608+
- 已增加确定性 summary helper:
609+
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeSupersessionSummary(...)`
610+
- 已在不扩 scope 前提下压缩 operator 扫描成本:
611+
- summary 载荷现在输出 `summary.scannedEntries``summary.counts``summary.latestCurrent``summary.latestSuperseded``summary.latestDrifted`
612+
- summary 基于既有 bounded history surface 计算,不再引入新的持久化模型。
613+
- 已增加确定性 supersession summary 语义:
614+
- 对齐的最新 entry 被汇总为 `latestCurrent`
615+
- 仍在扫描窗口内的旧 entry 被压缩到 `latestSuperseded`
616+
- 被后续 override 破坏的最新 entry 被汇总为 `latestDrifted`
617+
- 所有值都受请求扫描上限约束。
621618
- 已补可执行证据:
622-
- `src/server.migration.test.ts` 现在覆盖 newest-first history 顺序、history 文件持久化内容、旧 entry 的 superseded 状态,以及最新 entry 的后续 drift
619+
- `src/server.migration.test.ts` 现在覆盖 drift 前 summary 计数/最新快照,以及后续 override 之后的 drifted summary 计数/最新快照
623620
- 已加固 runtime 门禁:
624-
- `src/knowledge.api.contract.test.ts``src/agent_workspace.verification.contract.test.ts``scripts/verify-agent-workspace-runtime.js` 现在对 notification-threshold history 路由与 history helper 做 fail-fast 断言。
621+
- `src/knowledge.api.contract.test.ts``src/agent_workspace.verification.contract.test.ts``scripts/verify-agent-workspace-runtime.js` 现在对 notification-threshold summary 路由与 summary helper 做 fail-fast 断言。
625622
- 验证证据:
626-
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome history stays deterministic\"`
623+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome supersession summary stays deterministic\"`
627624
- `npm run test:agent-workspace:contracts`
628625
- `npm run verify:agent-workspace:runtime`
629626
- 后续方向判断:
630-
- 当前瓶颈从 history 可用性转向紧凑 operator summary
631-
- M7.27 应继续收敛在 supersession summary,不要扩成更大的 remediation 或 UI 子系统。
627+
- 当前瓶颈从 summary 紧凑性转向 filterability
628+
- M7.28 应继续收敛在 filtered history views,不要扩成更大的 remediation 或 UI 子系统。
632629

633630
## 主线 vs 工作分支快照(2026-04-14)
634631

@@ -678,7 +675,7 @@
678675
| L2 检索层 | 可解释混合/向量检索 + 治理 | 分支规划增强中 | 主线当前为 file-backed 基线(`src/learning/store.ts`| 待主线出现对应模块证据后再收敛 |
679676
| L3 学习层 | 掌握诊断 + 路径/会话闭环 | 分支增强中 | 主线部分集成 | 契约与集成一致性 |
680677
| L4 交互层 | agent 对话 + focus/path pane 运行时 | 分支已实现 | 主线 M1-M4 已落入基线 | 继续通过 typed contract 扩展动作面 |
681-
| L5 治理层 | runbook/诊断/回放与自动化 | 分支增强中 | 主线已集成运维诊断持久化/分级/趋势历史/阈值治理 + runbook 自动化/阈值审计 + 自适应模拟/自动修复 + 回测/批准门禁 + 批准策略硬化/回归告警 + 批准策略漂移/升级 + 升级确认生命周期/审计 + 升级 SLA/提醒基线 + 通知摘要/抑制基线 + 交付日志可观测性 + 陈旧通知健康审计 + 异常/retention 治理 + 通知 SLO 治理 + 通知阈值覆盖/审计治理 + 回滚预览/drift-diff 治理 + 回滚 apply guardrails + latest apply-outcome reconciliation + bounded apply-outcome history | M7.27:通知阈值 apply outcome supersession summary |
678+
| L5 治理层 | runbook/诊断/回放与自动化 | 分支增强中 | 主线已集成运维诊断持久化/分级/趋势历史/阈值治理 + runbook 自动化/阈值审计 + 自适应模拟/自动修复 + 回测/批准门禁 + 批准策略硬化/回归告警 + 批准策略漂移/升级 + 升级确认生命周期/审计 + 升级 SLA/提醒基线 + 通知摘要/抑制基线 + 交付日志可观测性 + 陈旧通知健康审计 + 异常/retention 治理 + 通知 SLO 治理 + 通知阈值覆盖/审计治理 + 回滚预览/drift-diff 治理 + 回滚 apply guardrails + latest apply-outcome reconciliation + bounded apply-outcome history + supersession summary | M7.28:通知阈值 filtered outcome history views |
682679

683680
## 验证基线
684681

scripts/verify-agent-workspace-runtime.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ function verifyAgentWorkspaceRuntime(repoRoot = path.resolve(__dirname, '..')) {
176176
serverSource.includes('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/history'),
177177
'Missing diagnostics remediation escalation notification-threshold reconciliation history route in src/server.ts'
178178
);
179+
assert(
180+
serverSource.includes('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/summary'),
181+
'Missing diagnostics remediation escalation notification-threshold reconciliation summary route in src/server.ts'
182+
);
179183
assert(
180184
serverSource.includes('/api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/audit'),
181185
'Missing diagnostics remediation escalation notification-threshold audit route in src/server.ts'
@@ -392,6 +396,10 @@ function verifyAgentWorkspaceRuntime(repoRoot = path.resolve(__dirname, '..')) {
392396
serverSource.includes('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistorySurface'),
393397
'Missing remediation escalation notification threshold history surface helper in src/server.ts'
394398
);
399+
assert(
400+
serverSource.includes('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeSupersessionSummary'),
401+
'Missing remediation escalation notification threshold supersession summary helper in src/server.ts'
402+
);
395403
assert(
396404
serverSource.includes('buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationAnomalyReport'),
397405
'Missing remediation escalation notification anomaly report helper in src/server.ts'

0 commit comments

Comments
 (0)