blun-king-cli 9.1.440 → 9.1.441
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cognitive-effective-view.cjs +1 -1
- package/bin/cognitive-focus-projection.cjs +5 -1
- package/bin/cognitive-salience-policy.cjs +2 -1
- package/bin/cognitive-state-store.cjs +4 -1
- package/bin/cognitive-turn-lifecycle.cjs +2 -1
- package/bin/cognitive-work-focus.cjs +8 -1
- package/package.json +1 -1
|
@@ -7,13 +7,15 @@ const {
|
|
|
7
7
|
} = require('./cognitive-salience-policy.cjs');
|
|
8
8
|
|
|
9
9
|
const FOCUS_DOMAINS = new Set([
|
|
10
|
-
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', '
|
|
10
|
+
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', 'knowledge_gap',
|
|
11
|
+
'next_trigger', 'expected_evidence',
|
|
11
12
|
]);
|
|
12
13
|
const DOMAIN_WEIGHTS = new Map([
|
|
13
14
|
['goal', 60],
|
|
14
15
|
['open_thread', 50],
|
|
15
16
|
['next_trigger', 40],
|
|
16
17
|
['expected_evidence', 30],
|
|
18
|
+
['knowledge_gap', 28],
|
|
17
19
|
['assumption', 25],
|
|
18
20
|
['team', 20],
|
|
19
21
|
['world', 15],
|
|
@@ -24,6 +26,7 @@ const LABELS = new Map([
|
|
|
24
26
|
['open_thread', 'Open thread'],
|
|
25
27
|
['next_trigger', 'Next trigger'],
|
|
26
28
|
['expected_evidence', 'Expected evidence'],
|
|
29
|
+
['knowledge_gap', 'Knowledge gap'],
|
|
27
30
|
['assumption', 'Assumption'],
|
|
28
31
|
['team', 'Team'],
|
|
29
32
|
['world', 'World fact'],
|
|
@@ -97,6 +100,7 @@ function buildCognitiveFocusSelection(state, {
|
|
|
97
100
|
if (!scopes.includes(latest.scope)) continue;
|
|
98
101
|
const effective = resolveCognitiveEvidenceGroup(entries);
|
|
99
102
|
if (!effective) continue;
|
|
103
|
+
if (effective.domain === 'knowledge_gap' && effective.value === 'none') continue;
|
|
100
104
|
ranked.push({
|
|
101
105
|
...effective,
|
|
102
106
|
salience: salience.get(cognitiveEntityKey(effective)) ?? 1,
|
|
@@ -6,7 +6,8 @@ const SALIENCE_DECAY = 0.05;
|
|
|
6
6
|
const SALIENCE_FLOOR = 0.1;
|
|
7
7
|
const SALIENCE_REINFORCEMENT = 0.25;
|
|
8
8
|
const FOCUS_DOMAINS = new Set([
|
|
9
|
-
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', '
|
|
9
|
+
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', 'knowledge_gap',
|
|
10
|
+
'next_trigger', 'expected_evidence',
|
|
10
11
|
]);
|
|
11
12
|
const ACCESS_KEY_RE = /^focus:access:([a-f0-9]{40})$/u;
|
|
12
13
|
const SAFE_ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
@@ -6,7 +6,10 @@ const path = require('node:path');
|
|
|
6
6
|
const { DatabaseSync } = require('node:sqlite');
|
|
7
7
|
|
|
8
8
|
const SAFE_ID_RE = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
9
|
-
const DOMAINS = new Set([
|
|
9
|
+
const DOMAINS = new Set([
|
|
10
|
+
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', 'knowledge_gap',
|
|
11
|
+
'next_trigger', 'expected_evidence',
|
|
12
|
+
]);
|
|
10
13
|
const EPISTEMIC_STATES = new Set([
|
|
11
14
|
'verified', 'credible_unverified', 'hypothesis', 'uncertain_memory', 'stale', 'unknown', 'legacy_unknown',
|
|
12
15
|
]);
|
|
@@ -17,7 +17,8 @@ const TOOL_POLICY_DECISIONS = new Set(['passed', 'blocked', 'error']);
|
|
|
17
17
|
const TOOL_OUTCOMES = new Set(['success', 'error', 'cancelled']);
|
|
18
18
|
const TURN_REASONS = new Set(['completed', 'cancelled', 'filtered', 'failed']);
|
|
19
19
|
const FOCUS_DOMAINS = new Set([
|
|
20
|
-
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', '
|
|
20
|
+
'self', 'world', 'team', 'goal', 'open_thread', 'assumption', 'knowledge_gap',
|
|
21
|
+
'next_trigger', 'expected_evidence',
|
|
21
22
|
]);
|
|
22
23
|
const FOCUS_EPISTEMIC_STATES = new Set([
|
|
23
24
|
'verified', 'credible_unverified', 'hypothesis', 'uncertain_memory', 'stale', 'unknown', 'legacy_unknown',
|
|
@@ -83,6 +83,7 @@ function buildCognitiveWorkFocus(goal) {
|
|
|
83
83
|
&& nextAction && checkpointEvidence;
|
|
84
84
|
const epistemicState = hasCheckpoint && EPISTEMIC_STATES.has(checkpointEpistemicState)
|
|
85
85
|
? checkpointEpistemicState : hasCheckpoint ? 'legacy_unknown' : 'verified';
|
|
86
|
+
const knowledgeGapValue = hasProblemFrame ? frameMissingKnowledge.join(' | ') : 'none';
|
|
86
87
|
const digest = crypto.createHash('sha256')
|
|
87
88
|
.update([
|
|
88
89
|
goalId, objective, completionCriterion, status, String(turnsUsed),
|
|
@@ -115,13 +116,19 @@ function buildCognitiveWorkFocus(goal) {
|
|
|
115
116
|
? [
|
|
116
117
|
`Goal is ${status}. Phase ${checkpointPhase}. Last verified: ${lastVerified}`,
|
|
117
118
|
`Next action: ${nextAction}`,
|
|
118
|
-
hasProblemFrame ? `Missing knowledge: ${frameMissingKnowledge.join(' | ')}` : '',
|
|
119
119
|
hasProblemFrame ? `Risk: ${frameRisk}` : '',
|
|
120
120
|
hasProblemFrame ? `Selected action: ${frameSelectedAction}` : '',
|
|
121
121
|
].filter(Boolean).join(' ')
|
|
122
122
|
: `Goal is ${status}.`),
|
|
123
123
|
confidence: 1, epistemicState, scope: focusScope,
|
|
124
124
|
},
|
|
125
|
+
{
|
|
126
|
+
domain: 'knowledge_gap', key: `${keyRoot}:knowledge-gaps`,
|
|
127
|
+
value: knowledgeGapValue,
|
|
128
|
+
confidence: 1,
|
|
129
|
+
epistemicState: hasProblemFrame ? 'unknown' : 'verified',
|
|
130
|
+
scope: focusScope,
|
|
131
|
+
},
|
|
125
132
|
{
|
|
126
133
|
domain: 'next_trigger', key: `${keyRoot}:next`,
|
|
127
134
|
value: status === 'active' && hasCheckpoint ? triggerValue : NEXT_TRIGGER.get(status),
|