Files
makelore/.project-docs/30-worklog/tasks/20260923-teacher-discussion-e742a91c.md
T

7.6 KiB
Raw Blame History

Task: Integrate pinned teacher discussion tools and update current trial

Identity

  • Task ID: 20260923-teacher-discussion-e742a91c
  • Mode: Feature
  • Branch: codex/20260923-teacher-discussion-e742a91c-teacher-discussion
  • Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore-teacher-discussion
  • Base commit: 7951cca700
  • Owner: codex
  • Status: Ready for Integration

Scope

  • Integrate the user-approved pinned teacher discussion workspace above the independently scrolling replies and the existing composer. Support ordinary replies, idea board, structure, flow/condition and aligned comparison; update the same isolated temporary application/profile.

Intent And Constraints

  • Content is generated by the teacher Agent as structured data, not selected by frontend keyword matching. An active tool keeps its type until the student explicitly finishes/pauses or chooses idea-to-structure conversion.
  • Keep existing proactive teacher presence, friend consultation, account/project isolation, retries and drafts. Teacher discussions never execute project changes. Use generic creation/game imagery.
  • Preserve other dirty worktrees/main and the installed production app. Reuse the current trial profile; do not fabricate live responses or seed its conversations with demo data.
  • One previously authorized subagent handles only the new shared schema/parser and its tests.

Project Context Loaded

  • Task identity/feature ownership/branch/absolute worktree/base match start and status; isolated registration succeeded.
  • Read: read-before-planning, memory-index, active record, project-positioning, current-state (integrated entry and relevant teacher context), decision-index and coding-teacher ADR, system-overview, relevant business rules, success criteria, commitments, AGENTS and existing teacher service/UI/contracts.
  • Peers: classroom-workspace and teacher-presence are completed source ancestors; classroom-integration is a completed candidate with an unchanged product tree. Their task records were inspected read-only. No conflicting semantic direction. Main retains unrelated uncommitted consensus work; old teacher-components prototype worktree is preserved.
  • Project goal: student creation workspace with product/structured thinking, AI collaboration and judgment through guidance. Latest actual trial uses 7951cca with independent teacher/friend and proactive presence.
  • Integrated canonical positioning still has template fields, and the teacher ADR has obsolete source-scoped/bring-back behavior. User-approved classroom source and this conversation are authoritative for the requested behavior; no canonical memory is changed here.
  • Existing Main owns model/auth/runtime and persistence; renderer uses host-api. Keep light Makelore visuals and bundled teacher avatar.
  • Modules: shared/coding-teacher and new discussion contract; electron/coding-teacher context/service/store; teacher Host API; TeacherChatPanel and component renderer; focused unit/E2E fixtures, README.
  • Unknowns: real model/account availability in the signed-out trial; successful live generation must not be claimed based on fixtures.
  • Gate: Passed.

Plan

  1. Add bounded structured teacher replies and project/topic-scoped discussion state with explicit lifecycle and type locking.
  2. Implement pinned component renderers and interactions using the existing input/reply stream; preserve ordinary replies, friend behavior, drafts and stop/retry behavior.
  3. Run focused tests, typecheck, lint, build and interaction checks; update README and this record.
  4. Update the exact existing isolated temporary app source/profile and verify the actual app window.

Outcome

  • Implemented production teacher reply envelope and bounded shared contracts for ideas, structure, flow/conditions and aligned comparison. Ordinary prose remains compatible. The teacher supplies content in the existing single model request; Main owns identity, lifecycle, revision checks and explicit type transitions.
  • Added pinned top content with independent scrolling replies and the existing composer. Tool offer/enter, pause/chat, provisional finish, resume, focus selection, direct comparison questions, idea acceptance/aside/first intent and explicit idea-to-structure/back are connected to Host API and persistent topic state. No project execution or branch creation.
  • Full valid data applies atomically after completion. Stop/failure/invalid structure retains previous content; JSON does not stream into the conversation. History snapshots and previous ideas/structure are preserved; store reload validates saved structures. Existing teacher presence, friend and legacy teacher replies remain compatible.
  • Projects use a generic gamepad icon. The approved light Makelore layout and bundled pixel avatar remain.
  • Updated and relaunched the exact existing temporary application bundle/profile with the new build. Trial PID 91696 loads this worktree's dist-electron/main/index.js; the existing Host API port 54599 is listening. The installed production app and other worktrees are untouched.
  • Post-restart native verification completed after the user unlocked the Mac: the window URL points to this worktree’s built Renderer, the original alice project/conversations remain, and the updated gamepad project icon and teacher pane are visible. The unpackaged trial lost its in-memory login; teacher controls are correctly disabled with “请先登录”. Opened the native “登录并继续” form for the user to sign in to their original account. Real-model component generation remains unverified; no credentials or fake conversations were injected.

Verification

  • Focused unit tests: 197 passed across coding-teacher, coding-teacher-ui, teacher-discussion and teacher-discussion-state (196 in the combined run, plus the added direct-comparison interaction passing in the final 25-test UI run).
  • Browser E2E: 10 passed, exercising ordinary/ideas/structure/flow/comparison at 319px and 508px; scroll does not move pinned tool or composer; input stays within the viewport; no horizontal overflow or page errors; type stays stable; ideas survive conversion and return; provisional finish preserves draft and resumes.
  • Inspected rendered screenshots for narrow idea/comparison layouts. Production build:vite passed for Renderer, Main, Preload and utility worker. Final renderer pnpm run typecheck passed. Changed TypeScript/test files passed ESLint; git diff --check passed.
  • Standalone Main type checking has pre-existing failures. With composite disabled for type diagnostics, both the base and this worktree report the same 66 errors, with no new diagnostics. The original composite project additionally omits shared source files from its include list; it is not a clean check and is not reported as passing. The original tsconfig is unchanged.
  • Native app inspected before restart and after the user unlocked it. Post-restart screenshot/AX confirms the original project and new Renderer URL. Teacher panel opens in place; signed-out access is rejected, and the app’s own recovery action reaches its login form. Process identity and listener verified after relaunch.
  • Task-aware project-doc drift check passed.

Follow-ups

  • User sign-in is pending in the already-opened temporary app. After login to the original account, verify live teacher-generated structures separately from fixtures. Do not request credentials in chat or bypass authentication.

Promotion Candidates

  • Promote the pinned teacher workspace, structured reply contract, explicit lifecycle/type locking and topic persistence to the canonical teacher architecture during a serialized integration task. This feature task only updates its owned task record and README.