Open
Conversation
Adds an autonomous "閒時探索" loop: at scheduled off-market ticks (or
manual trigger via tool), Alice runs a 4-phase cycle:
1. Guard — skip if the user is actively chatting (session mtime guard)
2. Recall — load relevant skills from data/skills/ by keyword triggers
3. Explore — askWithSession with Alice persona + recalled skills injected;
stream tool_use events to count depth
4. Reflect — if tool depth >= threshold, ask Alice to emit a markdown skill
(or SKIP); persist to data/skills/{id}.md; Brain commit
Design:
- File-driven — every skill is a markdown file with yaml-ish frontmatter
(id, triggers, created, usageCount, confidence, lastUsedAt, summary)
- Recall is simple keyword matching, not embeddings — enough at N<200
- Prune uses usage×confidence÷age so recent high-signal skills stay
- Sonnet 4.6 is the configured default model (bounded subscription cost)
- Disabled by default in exploration.json — flip enabled: true to start
New files:
src/domain/exploration/{types,skill-curator,explorer,scheduler,index}.ts
src/domain/exploration/__tests__/{skill-curator,explorer}.spec.ts
src/tool/exploration.ts (explorationRunNow / explorationStatus /
skillList / skillDelete tools)
Wiring:
src/core/config.ts — new exploration section in Config + sectionSchemas
src/main.ts — build curator + explorer + scheduler, register tools
Tests:
17 new tests (9 curator, 8 explorer) covering persist/recall/prune/
markUsed round-trip, full loop happy path, SKIP reflection, below-
threshold skip, user-active pause, and reflection parser edge cases.
Full backend test suite: 915/915 green. Typecheck clean.
(UI test failures in this run are pre-existing worktree symlink
artifacts — confirmed passing in the real working tree.)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previous default: every hour 14:00–23:00 and 00:00–08:00 TW (≈16 runs spread across off-peak). New default: every 30 minutes from 23:00–06:30 TW only. → ~16 runs concentrated during sleep, zero runs during the day. Rationale: per user request, maximise autonomous research while the user is asleep; minimise token contention during peak trading and work hours when the user is actively chatting with Alice. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.