Skip to content

feat(memos-local): auto-promote candidate skills without trial#1943

Open
a844810597 wants to merge 3 commits into
MemTensor:mainfrom
a844810597:feat/candidate-skip-trial
Open

feat(memos-local): auto-promote candidate skills without trial#1943
a844810597 wants to merge 3 commits into
MemTensor:mainfrom
a844810597:feat/candidate-skip-trial

Conversation

@a844810597

Copy link
Copy Markdown

Summary

Closes #1941

Non-repair candidate skills whose eta already satisfies the retrieval threshold may skip the trial loop and become active immediately. The eta value encodes the gain/support of the source policies, carried forward from crystallisation and kept current by reward drift — no additional quality gate needed.

Changes

File Change
core/skill/lifecycle.ts +16: export shouldPromoteCandidate()
core/skill/subscriber.ts +14: lifecycleTick() scans & promotes
core/pipeline/orchestrator.ts +1: call lifecycleTick() after skills.flush()

Why

Candidate skills require agent calls (memos_skill_get + reward.updated) to accumulate trials and promote. In practice, Hermes agents rarely call memos_skill_get → skills get stuck in candidate forever with 0 trials.

What stays the same

  • Repair-origin skills still require a trial pass
  • Existing trial mechanism untouched
  • No DB schema changes
  • No config changes

a844810597 and others added 3 commits June 16, 2026 11:49
… recheck

A candidate policy whose support/gain already satisfy the promotion
thresholds (support >= minSupport && gain >= minGain) but is no longer
cosine-matched by any trace in subsequent episodes will never enter
'touched' and therefore nextStatus() is never executed.

Add Step 5 after Step 4 to scan all candidate policies and promote any
whose stored support/gain already meet the thresholds.

Fixes MemTensor#1932
…el__

The keepalive thread closure in _start_bridge_keepalive captured self
directly, creating a reference cycle that prevented GC from collecting
the provider. Combined with the missing __del__, a leaked provider
would leave its bridge subprocess (Popen) and keepalive thread alive
indefinitely.

Two complementary fixes:

1. weakref — break the reference cycle so GC can collect the provider
   when all external references are dropped.

2. __del__ — safety net that calls shutdown() during GC when the caller
   forgot to invoke it explicitly (e.g. model/routing change paths
   that assign self.agent = None without calling shutdown).

Both are required: weakref enables GC collection, __del__ ensures
cleanup happens when collection occurs.
Non-repair candidate skills whose eta already satisfies the
retrieval threshold may skip the trial loop and become active
immediately.  The eta value encodes the gain/support of the
source policies, carried forward from crystallisation and kept
current by reward drift — no additional quality gate needed.

Adds:
- lifecycle.shouldPromoteCandidate() — pure decision function
- subscriber.lifecycleTick() — scans candidates each flush
- orchestrator.flush() — calls lifecycleTick after skills.flush()

Repair-origin skills still require a trial pass before promotion.

Closes #
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.

feat: auto-promote non-repair candidate skills without trial

1 participant