Skip to content

feat(approvals): overlay Jev aging suggestion on pending items - #506

Merged
PeterGuy326 merged 5 commits into
mainfrom
feat/466-approval-aging-overlay
Oct 21, 2026
Merged

PeterGuy326 merged 5 commits into
mainfrom
feat/466-approval-aging-overlay

Conversation

@waterbro-8

@waterbro-8 waterbro-8 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Approval aging overlay on pending items.

  • Deterministic clock vs createdAt; expired vs pending still use existing clock helpers.
  • Jev Choice nudge / wait / discuss-close is copy only.
  • Overlay cannot hide pending high; needsAttention=false stays in the same rule-risk layer.
  • No decision POST. Clicking the suggestion only opens the item.
  • Server-side ranking is wired into the real GET /approvals projection; flag-off preserves original order.

Verification

  • node --test apps/server/dist/test/approval-aging-overlay.test.js — 9/9
  • package-layout runtime manifest + closed imports — 2/2
  • renderer approval-queue.test.tsx — 29/29

Product tracking remains open: #422

Refs #466

Aging overlay is copy-only (nudge / wait / discuss-close).
Deterministic clock vs createdAt; expiry still uses existing helpers.
Pending high stays visible in the rule-risk layer.
No decision POST; click opens the item.

#422
@waterbro-8
waterbro-8 marked this pull request as draft September 24, 2026 18:30
presentAgingQueue/agingNeedsAttention now rank GET /approvals without
crossing the rule-risk layer. Flag-off lists keep original order.
Package aging-overlay.js on the runtime allowlist.

#422
@waterbro-8
waterbro-8 marked this pull request as ready for review September 24, 2026 18:44
@waterbro-8

Copy link
Copy Markdown
Collaborator Author

复审 exact head 88ef0abf77e2e591cf1e0e978a7d4334a0e3eb1b:aging overlay 已接入真实 GET /approvals projection;flag-off 保持原顺序,overlay 仅在同 rule-risk 层内重排,pending high 不隐藏;expired/actionable 仍由既有 clock helpers 判定;renderer 点击仅打开目标事项,不触发 approve/deny。

Hosted checks 当前 11/11 全绿,closingIssuesReferences=[];正文已补 Refs #466 并继续用完整 URL 保持产品 tracking issue 开放。PR 已转 Ready,并正式请求 @Bindy-lbb / @PeterGuy326 独立审核。

当前 GitHub 身份是作者,只做技术收口,不自批、不自合。

@waterbro-8

Copy link
Copy Markdown
Collaborator Author

Independent technical recap (not an Approve). Author waterbro-8 is my identity — I will not Approve or merge.

Exact head 88ef0abf77e2e591cf1e0e978a7d4334a0e3eb1b unchanged. Required checks 11/11 green. closingIssuesReferences empty (Refs #466; #422 stays open).

Named criteria

  • Provider boundary: Laya payload is only createdAt / now / decision.kind / risk. Extra keys throw. Description, target, turn bodies are not sent.
  • GET/list sort: rankApprovalViews / presentAgingQueue sort inside a rule-risk layer (high then other). needsAttention cannot lift a medium above a pending high. Flag-off (no overlay) returns original order.
  • No verdict: Overlay is copy (nudge|wait|discuss-close). Invalid/off/non-pending → undefined. catch fail-open. Clicking the card/suggestion uses existing onOpen; no decision POST from this overlay.
  • Perf/race residual (not a verdict leak): list() Promise.all awaits attachApprovalAgingOverlay per row, so GET /approvals waits on N Laya asks. Each view() uses its own Date.now(); rank uses a later Date.now(). If Laya hangs, the list hangs. Ranking itself is deterministic given overlays.

No blocker on aging boundary / sort / no-verdict. Residual: list latency bound to Laya.

@Bindy-lbb @PeterGuy326 please independent-review this SHA.

#506
#422

sun-970
sun-970 previously approved these changes Sep 25, 2026

@sun-970 sun-970 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review of exact head 88ef0abf77e2e591cf1e0e978a7d4334a0e3eb1b. Not product验收. I am not merging.

Verify 11/11 green. Aging overlay on pending approvals, suggestion-only.

Technical APPROVE of this SHA.

@waterbro-8
waterbro-8 requested a review from sun-970 September 25, 2026 05:22
@PeterGuy326

Copy link
Copy Markdown
Contributor

Current live status: DIRTY against main. Please rebase after the foundational overlay/receipt changes are settled, preserve deterministic approval state as authority and Laya aging output as advisory only, rerun exact-head CI/security, then request re-review. Old approval cannot carry over conflict resolution.

Resolve conflicts:
- CHANGELOG.md: keep both sides (Unreleased entries from main plus the #466 entry).
- ApprovalDetailDrawer.tsx was replaced by ApprovalDetail.tsx on main; port the
  optional Jev aging-overlay tag into the new detail component's meta row.
…etail component

main replaced ApprovalDetailDrawer with ApprovalDetail; assert the new
approval-detail testid and data-approval-id attribute instead.
npm audit --audit-level=high (the security:check step of npm run check)
started failing on vite <= 6.4.3 due to GHSA-698v-4r3x-3vcv and related
launch-editor advisories. Lock the dev-only vite entry to the 6.x patch
release 6.4.4; no other dependency changes.

@PeterGuy326 PeterGuy326 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed after the conflict resolution push. Changes since the original approval: (1) merge of current main, resolving CHANGELOG by keeping both Unreleased entries and porting the aging-overlay tag into the new ApprovalDetail component that replaced ApprovalDetailDrawer on main; (2) test adaptation to the new approval-detail testid; (3) dev-only lockfile bump of vite to 6.4.4 to clear the npm audit high advisory (GHSA-698v-4r3x-3vcv) that broke the security:check step on every branch. Feature semantics unchanged: the aging overlay stays suggestion-only, payload is { createdAt, now, decision.kind, risk }, pending high is never hidden, clicking only opens the item. All 11 checks green.

@PeterGuy326
PeterGuy326 merged commit 8930e45 into main Oct 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants