Skip to content

Commit cbc9afc

Browse files
committed
feat: add notification-threshold apply history
1 parent c98ea00 commit cbc9afc

8 files changed

Lines changed: 501 additions & 48 deletions

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

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ Suggested verification slice:
911911
- Best next increment is not broader remediation expansion.
912912
Best next increment is a narrow history surface for apply outcomes and their reconciliation statuses.
913913

914-
### M7.26 (Next): Notification-Threshold Apply Outcome History Surface (Lane Ops Bridge)
914+
### M7.26 (Now): Notification-Threshold Apply Outcome History Surface (Lane Ops Bridge)
915915

916916
Deliverables:
917917

@@ -927,6 +927,64 @@ Suggested verification slice:
927927
- `npm run docs:diataxis:check`
928928
- `npm run docs:site:build`
929929

930+
#### M7.26 Progress Note (2026-04-16)
931+
932+
- [Done] expanded `src/server.ts` with bounded history route:
933+
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation/history?limit=...`.
934+
- [Done] added file-backed apply-outcome history persistence:
935+
- `runtime_data/agent_workspace_diagnostics/triage_remediation_escalation_notification_threshold_apply_outcome_history.v1.json`.
936+
- [Done] added deterministic history helper stack:
937+
- `readAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistory(...)`,
938+
- `appendAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistory(...)`,
939+
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeHistorySurface(...)`.
940+
- [Done] apply execution now writes both:
941+
- latest single-record outcome file for fast reconciliation,
942+
- bounded newest-first history for operator handoff across multiple applies.
943+
- [Done] history payload now exposes bounded per-entry reconciliation state:
944+
- `reconciliation.isLatestOutcome`,
945+
- `reconciliation.latestAuditMatchesEntry`,
946+
- `reconciliation.activeThresholdsMatchEntry`,
947+
- `reconciliation.status`,
948+
- `reconciliation.driftReasons`.
949+
- [Done] history semantics are now explicit:
950+
- latest aligned entry reports `current`,
951+
- older entries superseded by later applies report `superseded`,
952+
- latest entry later invalidated by follow-up overrides reports `drifted`.
953+
- [Done] expanded evidence coverage:
954+
- `src/server.migration.test.ts` now validates newest-first history ordering, persisted history-file contents, superseded older apply entries, and later drift of the newest entry.
955+
- `src/knowledge.api.contract.test.ts`, `src/agent_workspace.verification.contract.test.ts`, and `scripts/verify-agent-workspace-runtime.js` now fail fast on history-route and history-helper drift.
956+
- [Done] verification evidence:
957+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern "notification threshold apply outcome history stays deterministic"`
958+
- `npm run test:agent-workspace:contracts`
959+
- `npm run verify:agent-workspace:runtime`
960+
- `npm run docs:diataxis:check`
961+
- `npm run docs:site:build`
962+
963+
### Post-M7.26 Architecture Judgment
964+
965+
- L5 governance now covers preview, guarded apply, latest-outcome reconciliation, and bounded apply-outcome history for notification-threshold changes.
966+
- Current weak point shifts from handoff continuity to compact summary:
967+
- operators can inspect recent apply history with per-entry status,
968+
- operators still lack a concise aggregate view that says how many recent entries are current, superseded, or drifted without scanning the list.
969+
- Best next increment is not broader remediation or UI work.
970+
Best next increment is a narrow supersession summary surface over the existing history artifacts.
971+
972+
### M7.27 (Next): Notification-Threshold Apply Outcome Supersession Summary (Lane Ops Bridge)
973+
974+
Deliverables:
975+
976+
- add read-only summary surface over bounded apply-outcome history.
977+
- report concise counts and latest-entry snapshots for `current`, `superseded`, and `drifted` states so operator handoff does not require manual list scanning.
978+
- keep scope limited to notification-threshold governance; do not reopen UI, unrelated remediation lanes, or retrieval/memory work.
979+
980+
Suggested verification slice:
981+
982+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern "notification threshold apply outcome supersession summary"`
983+
- `npm run test:agent-workspace:contracts`
984+
- `npm run verify:agent-workspace:runtime`
985+
- `npm run docs:diataxis:check`
986+
- `npm run docs:site:build`
987+
930988
## Success Criteria
931989

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

937995
## Next Step
938996

939-
Proceed to `/prompts:ce-plan` using this document as the source for `M7.26` decomposition (notification-threshold apply outcome history surface), while preserving M7 lane boundary constraints.
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.

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -599,34 +599,34 @@ 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.25 Notification-Threshold Apply Outcome Reconciliation Lane)
603-
604-
- Expanded `src/server.ts` with explicit reconciliation route:
605-
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation`.
606-
- Added file-backed latest-apply outcome persistence:
607-
- `runtime_data/agent_workspace_diagnostics/triage_remediation_escalation_notification_threshold_apply_outcome.v1.json`.
608-
- Added deterministic reconciliation helper stack:
609-
- `readAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcome(...)`,
610-
- `writeAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcome(...)`,
611-
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeReconciliation(...)`.
612-
- Hardened operator readback without widening scope:
613-
- apply execution now persists latest preview fingerprint, applied mode, audit id/changedAt, source/reason, and applied threshold snapshot,
614-
- reconciliation payload now exposes `latestApplyOutcome`, `currentActiveThresholds`, `latestAuditEntry`, and bounded drift booleans/reasons.
615-
- Added deterministic reconciliation semantics:
616-
- no apply outcome yields bounded `no-apply-outcome`,
617-
- superseding audit entries mark the last apply outcome as drifted,
618-
- active threshold divergence is reported independently from audit supersession.
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`.
619619
- Expanded executable evidence:
620-
- `src/server.migration.test.ts` now validates immediate post-apply reconciliation, persisted apply-outcome file contents, and drift detection after a later override.
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.
621621
- 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 reconciliation route and apply-outcome helper drift.
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.
623623
- Verification evidence:
624-
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome reconciliation stays deterministic\"`
624+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome history stays deterministic\"`
625625
- `npm run test:agent-workspace:contracts`
626626
- `npm run verify:agent-workspace:runtime`
627627
- Next direction judgment:
628-
- current bottleneck shifts from latest-outcome readback to bounded operator handoff/history,
629-
- M7.26 should stay bounded to apply-outcome history, not broader remediation or UI expansion.
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.
630630

631631
## Mainline vs Working-Branch Snapshot (2026-04-14)
632632

@@ -676,7 +676,7 @@ This dashboard aligns against the following requirement chain:
676676
| 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 |
677677
| L3 Learning | mastery diagnostics + path/session loop | Expanded in branch | Partially integrated | Contract and integration parity |
678678
| 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 integrated | M7.26: notification-threshold apply outcome history surface |
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 |
680680

681681
## Verification Baseline
682682

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

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

604-
## 主线最新增量(2026-04-16 M7.25 通知阈值 apply 结果对账链路
605-
606-
- 已在 `src/server.ts` 增加显式 reconciliation 路由:
607-
- `GET /api/knowledge/operator/agent-workspace-diagnostics/triage/remediation/escalation/notification-thresholds/reconciliation`
608-
- 已增加 file-backed latest-apply outcome 持久化:
609-
- `runtime_data/agent_workspace_diagnostics/triage_remediation_escalation_notification_threshold_apply_outcome.v1.json`
610-
- 已增加确定性 reconciliation helper 栈:
611-
- `readAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcome(...)`
612-
- `writeAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcome(...)`
613-
- `buildAgentWorkspaceDiagnosticsRemediationEscalationNotificationThresholdApplyOutcomeReconciliation(...)`
614-
- 已在不扩 scope 前提下补足 operator readback
615-
- apply 执行现在持久化 latest preview fingerprint、applied mode、audit id/changedAt、source/reason 与 applied threshold snapshot
616-
- reconciliation 载荷现在输出 `latestApplyOutcome``currentActiveThresholds``latestAuditEntry` 与有界 drift 布尔量/原因
617-
- 已增加确定性 reconciliation 语义:
618-
- 没有 apply outcome 时返回有界 `no-apply-outcome`
619-
- 后续 superseding audit 会把上一条 apply outcome 标记为 drifted
620-
- active threshold divergence 会独立于 audit supersession 单独报告
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`
621621
- 已补可执行证据:
622-
- `src/server.migration.test.ts` 现在覆盖 apply 后即时 reconciliation、apply-outcome 文件持久化内容,以及后续 override 触发的 drift 检测
622+
- `src/server.migration.test.ts` 现在覆盖 newest-first history 顺序、history 文件持久化内容、旧 entry 的 superseded 状态,以及最新 entry 的后续 drift。
623623
- 已加固 runtime 门禁:
624-
- `src/knowledge.api.contract.test.ts``src/agent_workspace.verification.contract.test.ts``scripts/verify-agent-workspace-runtime.js` 现在对 notification-threshold reconciliation 路由与 apply-outcome helper 做 fail-fast 断言。
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 断言。
625625
- 验证证据:
626-
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome reconciliation stays deterministic\"`
626+
- `npm test -- src/server.migration.test.ts --runInBand --testNamePattern \"notification threshold apply outcome history stays deterministic\"`
627627
- `npm run test:agent-workspace:contracts`
628628
- `npm run verify:agent-workspace:runtime`
629629
- 后续方向判断:
630-
- 当前瓶颈从 latest-outcome readback 转向有界 operator handoff/history
631-
- M7.26 应继续收敛在 apply outcome history,不要扩成更大的 remediation 或 UI 子系统。
630+
- 当前瓶颈从 history 可用性转向紧凑 operator summary
631+
- M7.27 应继续收敛在 supersession summary,不要扩成更大的 remediation 或 UI 子系统。
632632

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

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

683683
## 验证基线
684684

0 commit comments

Comments
 (0)