fix: auto-enable leader summary routing
This commit is contained in:
1 parent
8fb066f345
commit
0b3aa5c42d
14 files changed
+618
-623
No files matched your search
@@ -0,0 +1,56 @@
|
||||
# Task: Auto-enable leader summaries from AgentBus routing
|
||||
|
||||
## Identity
|
||||
|
||||
- Task ID: 20260907-auto-leader-summary-routing-5e8c1a73
|
||||
- Mode: Feature
|
||||
- Branch: codex/20260907-auto-leader-summary-routing-5e8c1a73-auto-leader-summary-routing
|
||||
- Worktree: /Users/inmanx/Documents/lwltAPI-auto-leader-summary-routing-5e8c1a73
|
||||
- Base commit: 8fb066f3453dde079b3b58f67c95cd57de60923d
|
||||
- Owner: codex
|
||||
- Status: Ready for Integration
|
||||
|
||||
## Scope
|
||||
|
||||
- Replace administrator-managed leader summary subscriptions with role-driven automatic activation for active `team_lead` accounts.
|
||||
- Resolve the proactive AgentBus recipient and conversation from the leader-owned channel, preferring the latest valid inbound route and falling back to the channel external user reference.
|
||||
- Keep encrypted route snapshots, durable low-priority delivery, future-only projection, source coverage, privacy filtering, and role/channel fail-closed behavior.
|
||||
- Reduce the channels page to read-only automatic-delivery status and remove the manual mutation API and form controls.
|
||||
- Update active component documentation and contract tests. No database migration or production send is in scope.
|
||||
|
||||
## Intent And Constraints
|
||||
|
||||
- User explicitly superseded the accepted default-off/manual-target product behavior: an active team lead with an enabled owned AgentBus channel should receive summaries automatically.
|
||||
- Include both manual and AgentBus tasks assigned to other non-administrator employees in the same organization; never backfill history.
|
||||
- A channel disable, ownership change, inactive account, or role change must stop delivery and cancel unsent rows rather than reroute them.
|
||||
- Never expose or log plaintext routing targets, task instructions, traveler/customer data, attachments, or technical errors in leader summaries.
|
||||
- Preserve the existing schema version 020 tables so the fix can deploy without another database change.
|
||||
|
||||
## Outcome
|
||||
|
||||
- Active team-lead accounts now receive an automatic organization-wide summary subscription whenever their owned AgentBus channel is enabled and has a safe route.
|
||||
- Route resolution prefers the latest accepted inbound route whose task is assigned to the current channel owner, falls back to the channel external user reference, and learns exact future routes after successful AgentBus ingestion.
|
||||
- Route/policy changes reset the future-only boundary and revision; invalid roles, accounts, ownership, or disabled channels cancel unsent rows and fail closed.
|
||||
- Channel owner changes clear the previous external user reference, preventing a new owner from inheriting the former owner's proactive route.
|
||||
- The manual subscription mutation API and all recipient/conversation/source/verification/enable controls were removed. `/channels` now displays automatic status only.
|
||||
- Existing migration 020 remains sufficient; no database migration or production data change was introduced.
|
||||
|
||||
## Verification
|
||||
|
||||
- `node --run check:repo` — passed (10 tests).
|
||||
- `node --run check` — passed.
|
||||
- `node --run test:control-plane` — passed (176 tests).
|
||||
- `node --run test:legacy` — passed (270 tests).
|
||||
- `node --run build` — passed.
|
||||
- `node --check LianSyn-platform/app.js` — passed.
|
||||
- Targeted AgentBus and leader-summary contract suite — passed (28 tests).
|
||||
- Disposable PostgreSQL 16.14 validation applied migrations 001–020, confirmed first reconciliation creates one enabled encrypted automatic row, the second reconciliation is idempotent, an employee terminal result projects and claims on the leader's exact inbound route, and a leader-to-user role change disables the row and cancels its pending delivery. The temporary database was stopped and moved to Trash.
|
||||
- No real AgentBus/WeChat message, production database mutation, deployment, or restart was performed.
|
||||
|
||||
## Follow-ups
|
||||
|
||||
- None recorded.
|
||||
|
||||
## Promotion Candidates
|
||||
|
||||
- Revise accepted decision `AUTH-003-leader-task-summary-notifications.md` during Integration: activation and routing are automatic consequences of an active `team_lead` role plus its owned AgentBus channel, rather than an administrator-managed default-off subscription.
|
||||
Reference in new issue
Block a user