Skip to content

feat: add opt-in post-task experience drafts - #364

Closed
Sycun wants to merge 2 commits into
AIPentest:mainfrom
Sycun:codex/research-skill-data-flywheel
Closed

Sycun wants to merge 2 commits into
AIPentest:mainfrom
Sycun:codex/research-skill-data-flywheel

Conversation

@Sycun

@Sycun Sycun commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Useful know-how produced during a run currently dies with the transcript. This adds an opt-in, draft-only learner: when a task finishes, a bounded background job distills the run's tool evidence into experience drafts. Nothing is promoted automatically — there is no activation endpoint, drafts are never installed into the skills directory, and no skill, role or tool is enabled by this change. A human reads them in the console.

Boundaries:

  • learning.enabled defaults to false, is captured at startup and requires a restart, matching the documented hot-apply boundaries.
  • One worker goroutine polling every 5s, <=20 jobs per UTC day (cap 200), 60s model timeout (cap 120), 12000 runes of evidence per job (cap 32000, <=2000 per item), <=3 attempts before a job is dropped.
  • A draft must cite at least one tool_result; fragments marked truncated may not be reasoned about. Drafts containing protected configuration values are rejected before storage, and the candidate manifest goes through skillpackage.ValidateSkillMDPackage.
  • Storage: one learning_jobs table plus two queue/conversation indexes. API: one protected read-only route, GET /api/conversations/:id/learning. UI: a chat toolbar entry gated on chat:read, with 11 keys in each of zh-CN / en-US / ru-RU.
  • AgentTaskManager gains SetRunPersistenceHooks so the learner reads from the existing finalization path instead of adding a second write site; the hooks only do bounded persistence and never call a model.

Validation:

  • go build ./...
  • go test ./... across the repository, no failures
  • go test -count=1 ./internal/learning/... ./internal/config/... ./internal/database/... ./internal/handler/...
  • node --test web/static/js/*.test.cjs -> 320/320 pass
  • Rebased onto main after fix: serialize SQLite asset writes without multiplying busy waits #362; the web/templates/index.html change is purely additive and leaves existing ?v= asset versions untouched.

Deliberately excluded: no standalone guide or research note, since 63955c4 just removed internal process journals from docs/. The single documentation edit is a ## 任务经验草稿 section in docs/zh-CN/configuration.md describing the new keys, written to match the existing project.context_checkpoints entry.

@Sycun

Sycun commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Keeping this experimental learner local for now; not opening an upstream PR. Will re-submit if it earns one.

@Sycun Sycun closed this Oct 16, 2026
@Sycun
Sycun deleted the codex/research-skill-data-flywheel branch October 16, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant