mirror of
https://github.com/Kaelio/ktx.git
synced 2026-07-25 12:01:03 +02:00
fix(memory): fire SL capture signal for SQL-bearing external ingest
The SQL-aggregate signal gated on userMessage.length >= 100, but `ktx ingest --file` sets a fixed boilerplate user message and carries the artifact in the assistant message. SQL-heavy files therefore never force-loaded the SL capture skill and defaulted to wiki capture. External ingest now treats the deliberate submission itself as the substantive signal, so verified SQL fires the SL signal regardless of the boilerplate user message. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
77c38e9ea2
commit
84d329b24b
2 changed files with 36 additions and 1 deletions
|
|
@ -16,8 +16,18 @@ export function detectCaptureSignals(input: MemoryAgentInput): CaptureSignals {
|
|||
const assistantMessage = input.assistantMessage?.trim() ?? '';
|
||||
const reasons: string[] = [];
|
||||
|
||||
// The user-message length gate is a research-path proxy for "the turn was substantive
|
||||
// enough to promote the assistant's SQL." External ingest carries a fixed boilerplate
|
||||
// user message and keeps the real content in the assistant message, so the proxy never
|
||||
// holds there - treat the deliberate submission itself as the substantive signal.
|
||||
const deliberateSubmission = input.sourceType === 'external_ingest';
|
||||
|
||||
let sl = false;
|
||||
if (assistantMessage && SQL_AGGREGATE_PATTERN.test(assistantMessage) && userMessage.length >= 100) {
|
||||
if (
|
||||
assistantMessage &&
|
||||
SQL_AGGREGATE_PATTERN.test(assistantMessage) &&
|
||||
(deliberateSubmission || userMessage.length >= 100)
|
||||
) {
|
||||
sl = true;
|
||||
reasons.push('sql aggregate in assistant message');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue