fix(teacher): 独立刷新老师目录以缩短配置更新延迟

This commit is contained in:
brother7 committed 2026-09-29 12:03:06 +08:00
1 parent 2767a15017
commit 913ccad577
9 files changed
+184 -7

No files matched your search

@@ -0,0 +1,47 @@
# Task: Investigate teacher catalog refresh and pinned topic configuration
## Identity
- Task ID: 20260929-teacher-publish-ml-e6b32168
- Mode: Feature
- Branch: codex/20260929-teacher-publish-ml-e6b32168-teacher-publish
- Worktree: D:\Datas\OthersProjects\.codex-worktrees\makelore\20260929-teacher-publish-ml-e6b32168
- Base commit: 2767a1501759735684d1509a34c43eb2303784cf
- Owner: codex
- Status: Ready for Integration
## Scope
- Implemented independent teacher catalog refresh, small revision read through Renderer/Main/WS and normal passing regressions. Converted the earlier opt-in failing diagnostic into tests/unit/teacher-catalog-refresh.test.tsx; removed its diagnostic config.
## Intent And Constraints
- User approved implementation after choosing one explicit publish. The maintain-project-docs Concurrent and Planning Gates passed on resume at the recorded unchanged base/branch/worktree; original context and peer scope assessments remain applicable. All changes are isolated to this owned feature worktree. Preserve history, default/pause state, student billing and running-question versions. One fresh read-only Reviewer Agent is explicitly authorized for this pre-merge review only. No destructive data merge, production writes or canonical project-memory edits.
## Outcome
- Entry still loads the full catalog. Focus/visibility and five-second foreground checks read only the catalog revision, fetching full definitions when it changes. Reads are deduplicated and detached from chat, composing, running requests and legacy check-in conditions; hidden/unmounted scopes do not poll. The revision request uses the current account binding without an extra profile read and rejects responses after account changes. Current Main per-question authoritative catalog lookup and stored/running question snapshots remain intact.
## Verification
- Vitest focused six-file set (teacher-catalog-revision, teacher-catalog-refresh, teacher-companion, teacher-conversation, coding-teacher, coding-teacher-ui): 208 passed. Covered empty/never-started/running/completed states, five-second update, hidden pause, focus, unchanged catalogs, offline retry, unmount, account switch and existing conversation/history/project isolation. TypeScript noEmit, changed-file ESLint and build:vite passed. Existing shared node_modules was reused through a worktree-local junction; dependencies were not changed. Paired WS revision/registration tests passed and Yuxi actual editor verified. git diff --check passed.
## Follow-ups
- No commit/merge/client distribution. Deploy WS revision endpoint before installing this client, following the server/Yuxi/client order. Actual installed client and proxy latency remain unmeasured; five seconds is a foreground check interval, not a hard network SLA. Paired Yuxi full backend unit passed in the Python 3.13 runtime; the authorized fresh independent pre-commit review completed.
## Promotion Candidates
- Target: canonical teacher freshness/current-state and frontend flow documentation. Propose independent foreground revision polling with entry/focus refresh, preserving per-project continuous visible chat and per-question fixed execution. Evidence: previously failing actual-hook diagnosis now green plus 208 focused tests/build. Impact: newly delivered or updated teachers appear without waiting for chat lifecycle. Conflict: diagnostic-only status is superseded; no canonical files changed. Human confirmation: user-approved, promote only via Integration Gate.
## Merge Preparation
- User requested local main-branch integration and explicitly approved the three primary-checkout ownership handoffs, preserving seven foreign documents. Same-task feature check/start/status and Planning Gate passed at unchanged bases. Independent review and its bounded repair recheck passed; ready for the source commit.
- Yuxi full non-slow backend suite in existing WSL Python 3.13.13 passed: 2260 passed / 1 skipped. The previous Python 3.12 test-package shadowing limitation is superseded by this actual rerun; no unrelated code changed.
## Independent Review Repair
- The user-authorized fresh Reviewer found one actual compatibility defect: historic teacher ID coding-teacher was rejected by UUID-only publication schemas. WS native registration and legacy operations publication, plus Yuxi native publish, now accept string IDs of length 1..40 matching the database.
- Negative regressions reproduced HTTP 422 uuid_parsing in both repositories before the repair. WS actual HTTP now verifies choosing the legacy ID preserves default/pause, binding and historical versions; the complete relevant set including real PostgreSQL passed 33 cases. Yuxi actual HTTP/PostgreSQL UUID and legacy-ID cases passed both parameterized cases. Changed-file Ruff and Yuxi format checks passed. The same authorized Reviewer independently rechecked the bounded repair and confirmed the blocker closed, with no remaining actionable issue.
- Final pre-commit review: fresh agent /root/teacher_merge_review inspected all three source diffs and untracked code/tests, found the legacy-ID defect, and confirmed its repair on 2026-09-29. Yuxi engineering verifier and all 62 verifier tests passed again after repair. Task documentation and whitespace checks complete the durable source handoff.