Merge empty-work preview into main

This commit is contained in:
鲨鱼辣椒
2026-09-29 20:15:44 +08:00
12 changed files with 450 additions and 15 deletions

View File

@@ -0,0 +1,48 @@
# Task: Merge empty work preview into current main
## Identity
- Task ID: 20260929-empty-work-merge-39c633d0
- Mode: Feature
- Branch: codex/20260929-empty-work-merge-39c633d0-empty-work-merge
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260929-empty-work-merge-39c633d0
- Base commit: 5aabaaf530a453e1459541fb7389d3afad221abf
- Owner: codex
- Status: Planning
## Scope
- Merge completed empty-work preview source f26cba5 (implementation 0167d36) into latest local main, preserving current published teacher shortcuts and window lifecycle changes. Verify the combined tree and fast-forward main. No remote push requested.
## Intent And Constraints
- User explicitly requests merging this task into main after latest code was pulled. `git fetch origin` confirms local main 5aabaaf is two commits ahead and zero behind origin/main; main is clean. Preserve those local commits and all foreign worktrees.
- Concurrent Gate passed in this isolated feature-mode checkout. App worktree creation reports the parent is not a Git repository. Skill isolation created the linked checkout before reporting the canonical integration lock held by 20260923-classroom-integration-8b4f1e62; the clean created checkout was then successfully claimed in feature mode, with matching status/branch/task reservation. The lock is unchanged. No canonical reconciliation is included.
- No application restart, deployment, model request, configuration publication, push or cleanup is included. Source task records remain unchanged.
## Project Context Loaded
- Task ID: 20260929-empty-work-merge-39c633d0; mode: feature; branch/worktree/base as recorded above. Ownership and task reservation verified.
- Read: AGENTS, read-before-planning, memory-index, active task, planning-gate, project-positioning, current-state, decision-index, relevant teacher ADR, system-overview/data-flow, business-rules, success-criteria, evidence-index, commitments and stale-items; all registered peer Scope, Intent And Constraints and Promotion Candidates sections.
- Project goal: three-module creation client with Main-owned local project/runtime and published teacher identities. Current integrated work includes project-isolated teacher chat, Yuxi-configured shortcuts and safe macOS window recreation.
- Active peers: shortcut button layout, teacher reply release, help-label and child-language tasks are planning; others are ready for integration. The child-language record has undefined scope, so its coordination context is unknown; current main already has the separately accepted bundled plugin. No concrete dependency on that unfinished task exists. Existing preview task is the source; the user explicitly authorized its no-work exception to the older always-start behavior.
- Preserve Main ownership, local project scope, source task history, latest shortcut contracts, unknown/existing-work startup, browser restoration and window lifecycle. Product/code/README are current; older canonical claims and placeholders are read-only. Shared-memory promotion remains for the existing integration owner.
- Gate: Passed. Plan: merge the source branch into this owned checkout, resolve only concrete overlaps, run typecheck and relevant unit/UI tests plus production build, independently review, commit the verified merge and fast-forward clean main after rechecking its HEAD.
## Outcome
- Prepared a conflict-free merge of f26cba5 into 5aabaaf with source history intact. All changed product/test files exactly match the source commit; README auto-merge retains the latest shortcut configuration and macOS window lifecycle descriptions. Local main update follows the verified candidate commit and a fresh clean-HEAD check.
## Verification
- Repository-pinned pnpm 10.33.4; standard typecheck, scoped ESLint, production Renderer/Main/Preload/utility build, 148 unit cases across 11 files and 10 isolated headless browser layout cases passed. Unit coverage includes work absence, busy/unknown paths, host-show, browser adapter and latest window close/reopen behavior. No native trial or paid model call used.
- Independent read-only review passed for the current-main compatibility and final staged merge. `git diff --check` and staged whitespace checks passed.
- The drift script reports only the unchanged source task record as FOREIGN_DOC because it compares added paths against this merge task's main base. Verified its source/index/worktree Git blob is identical (`e5fb9d1b…`); all shared canonical docs are unchanged. This is imported history required by the user's explicit merge request, not an edit/adoption of another task's work. No registry, lock or drift-script bypass/override was used; the diagnostic remains recorded rather than claimed as a passing script result.
## Follow-ups
- Fast-forward clean local main to the verified merge; leave remote publication and worktree cleanup for explicit user instructions.
## Promotion Candidates
- The source task's accepted local-empty-preview rule remains a canonical promotion candidate for the existing integration owner. Source task documentation is retained verbatim, and this merge introduces no additional product decision.

View File

@@ -0,0 +1,55 @@
# Task: Show a local empty state without invoking the Agent when no work exists
## Identity
- Task ID: 20260929-empty-work-preview-9c3f72a1
- Mode: Feature
- Branch: codex/20260929-empty-work-preview-9c3f72a1-empty-work-preview
- Worktree: /Users/chillishark/Makelore 麦洛/.codex-worktrees/makelore/20260929-empty-work-preview-9c3f72a1
- Base commit: 077184aabac89783a67913e964a32ed0f519b6d6
- Owner: codex
- Status: Ready for Integration
## Scope
- Show a deterministic local empty state when the project has no work to preview, before creating an operation conversation or sending OPEN_WORK_PROMPT. Preserve preview restoration, existing-work startup, busy waiting and failure recovery.
## Intent And Constraints
- User approved implementation after read-only evaluation. Empty copy: “还没有作品,快和老师聊聊吧”. No Yuxi quick-prompt implementation, cloud publication, model calls, app replacement or main-branch merge is included in this change.
- Concurrent and Planning Gates passed. App worktree tool reported the parent workspace is not a Git repository; used the skill isolation fallback at main 077184a. Matching task reservation/worktree owner verified.
- Read AGENTS, entry/memory/planning gate, active task, positioning, integrated state, decisions, architecture, domain, success criteria, evidence and relevant scaffold/teacher decisions. Peer scopes reviewed; teacher-help-label/release and child-language-skill are active (the latter scope undefined), with no concrete dependency. Completed teacher presence owns historical preview behavior; this user's explicit request authorizes the no-work exception. Canonical memory partly predates current README/code and remains read-only.
- Plan: add a bounded conservative Main-owned work-presence check; return an empty result before conversation creation/submission; render exact local copy; verify real filesystem absence/asset-only and existing-work paths, UI and existing preview lifecycle; update README and this record.
## Outcome
- Implemented a Main-owned bounded names/types scan before any conversation creation or internal prompt submission. New/metadata/knowledge/material-only projects return `empty`; unknown formats, unreadable directories, links and scan bounds retain the existing startup path. Known reachable pages still bypass the scan. Presence is rechecked after reopening and is not cached as a terminal attempt.
- Added the `empty` preview result and exact local copy “还没有作品,快和老师聊聊吧”. No model call, added chat message, recovery button, technical error or background polling for the empty state; retained return-to-operation-chat action. A later host show event rechecks the same request so newly opened work appears without tab/focus changes.
- Existing work startup, busy-project waiting, known-page restoration, failure recovery and uncertain-request deduplication are preserved. README synchronized. No cloud configuration, installed app, live project data or main branch changed.
## Verification
- `corepack pnpm` verified at the repository-pinned 10.33.4; reused local dependency tree through an ignored node_modules symlink.
- 125 related unit tests passed across work presence/preview, browser routes/panel, hook, coding chat and conversation timeline. Independent review found the empty-to-host-show edge case; added a failing regression, fixed it, and reran all 26 panel/hook tests successfully (one additional unique regression).
- 10 isolated headless Chrome layout/E2E cases passed, including exact empty copy, no failure/retry UI, no teacher auto-open, and no checks over 60 seconds. Inspected the generated empty-state screenshot. No real Electron focus change or paid model requests.
- Final standard `pnpm run typecheck`, scoped ESLint, `pnpm run build:vite` and `git diff --check` passed. Extended Main `tsc --project tsconfig.node.json --composite false --incremental false --noEmit` reports the same 66 error signatures as clean main at 077184a; no added diagnostics.
- Independent review of scanner boundaries and complete change passed after fixing and verifying the host-show regression. Task documentation drift check passed.
## Follow-ups
- Source is ready for integration. The existing temporary app was updated under the later explicit request below; main-branch integration and formal installed-app replacement remain outside scope.
## Promotion Candidates
- Target: canonical Code preview behavior/architecture during later serialized integration. Record that confirmed empty/material-only projects render a local empty state before creating a conversation or dispatching OPEN_WORK_PROMPT, while existing/uncertain work retains startup and healthy-address recovery. Evidence: user approval, Main side-effect assertions and UI regressions. Future impact: prevents browsing empty projects from adding operation-chat context or consuming model calls. This narrows the older always-start-on-missing-URL behavior; user approval is already supplied. No canonical documents changed in this feature task.
## Follow-up: Update The Existing Temporary App
- User explicitly requests updating the temporary application. Same-task ownership resumed and verified; current context remains applicable. Read the current live trial publisher's task record and launch metadata; that chat is idle. No cross-chat messages sent.
- Current trial is PID 19053, Main/Renderer ead34078906336492c509ebb616c9cbb1ab9870a with index-BiMeMtQo.js, same trial bundle/profile/Host API 54599. It includes newer welcome UI, teacher dock toggle, help label and timestamps that must be preserved. Formal /Applications/Makelore.app is separate and untouched.
- Planning Gate passed. Prepare a generated source export of the exact current live commit, apply only this feature's product/tests patch, verify and build. The foreign source checkout remains read-only. Recheck manifest and actual active work before mutation; capture state, gracefully stop only the verified trial PID, back up its profile, relaunch the same bundle/profile/port in the background, then verify preservation and live empty behavior without model calls.
- Updated the live trial using a generated full source export of ead34078906336492c509ebb616c9cbb1ab9870a plus product/test changes from 0167d36. The E2E addition was adapted to the newer fixture while retaining its existing cases. Candidate build, typecheck, scoped lint, 140 unit tests across eight files and all 14 isolated headless layout cases passed. No foreign checkout was edited.
- Live source/build: `/var/folders/mx/ltbgwsks5_n8zllj69p_wbcw0000gn/T/makelore-trial-tdq_nuah/empty-work-preview-9c3f72a1/source`. Verified trial PID 19053 was idle, then gracefully quit; copied its full user-data profile before starting PID 23355 with the same bundle/profile and Host API port 54599. New Main module and Renderer asset `index-OKXW93my.js` are loaded. Launch metadata records the base plus feature overlay explicitly, rather than claiming a combined Git commit.
- Account restored through the normal auth store `init()` and Main-owned session. Same active project, selected teacher and open teacher dock retained; all 14 existing drafts and all 34 previously recorded conversation/runtime files are byte-identical. One new idle-worker extension metadata file is expected after startup. Help-label UI and 15 rendered timestamps verified. No prompts/model requests were dispatched by the update; no existing project was switched for testing.
- Window remains hidden and unfocused as before. After restart the client stays on its default operation-chat tab: the current project has possible work, so reopening preview solely for verification would invoke the existing startup path. Empty-state behavior is verified by isolated Main/unit and headless UI tests, not by prompting or switching a live project. Temporary inspector closed; formal `/Applications/Makelore.app` PID 16701 untouched.
- Verification and rollback evidence: `/var/folders/mx/ltbgwsks5_n8zllj69p_wbcw0000gn/T/makelore-trial-tdq_nuah/empty-work-preview-9c3f72a1/verification.json`; profile backup, prior launch manifest, source patch and build/test logs are alongside it. Keep this generated source while the trial uses it. No main merge, push, Yuxi shortcut implementation or formal-app publication was performed.