blun-king-cli 9.1.440 → 9.1.442
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 +20 -5
- 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,17 @@ 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';
|
|
87
|
+
const decisionThread = hasProblemFrame ? [
|
|
88
|
+
`Goal is ${status}`,
|
|
89
|
+
`Phase ${checkpointPhase}`,
|
|
90
|
+
`Last verified: ${bounded(lastVerified, 80)}`,
|
|
91
|
+
`Decision: ${bounded(frameSelectedAction, 64)}`,
|
|
92
|
+
`Why: ${bounded(frameSelectionReason, 64)}`,
|
|
93
|
+
`Support: ${bounded(frameSupportChoice, 64)}`,
|
|
94
|
+
`Risk: ${bounded(frameRisk, 64)}`,
|
|
95
|
+
`Reversible: ${bounded(frameReversibility, 64)}`,
|
|
96
|
+
].join('; ') : '';
|
|
86
97
|
const digest = crypto.createHash('sha256')
|
|
87
98
|
.update([
|
|
88
99
|
goalId, objective, completionCriterion, status, String(turnsUsed),
|
|
@@ -112,16 +123,20 @@ function buildCognitiveWorkFocus(goal) {
|
|
|
112
123
|
{
|
|
113
124
|
domain: 'open_thread', key: `${keyRoot}:status`,
|
|
114
125
|
value: bounded(hasCheckpoint
|
|
115
|
-
? [
|
|
126
|
+
? hasProblemFrame ? decisionThread : [
|
|
116
127
|
`Goal is ${status}. Phase ${checkpointPhase}. Last verified: ${lastVerified}`,
|
|
117
128
|
`Next action: ${nextAction}`,
|
|
118
|
-
|
|
119
|
-
hasProblemFrame ? `Risk: ${frameRisk}` : '',
|
|
120
|
-
hasProblemFrame ? `Selected action: ${frameSelectedAction}` : '',
|
|
121
|
-
].filter(Boolean).join(' ')
|
|
129
|
+
].join(' ')
|
|
122
130
|
: `Goal is ${status}.`),
|
|
123
131
|
confidence: 1, epistemicState, scope: focusScope,
|
|
124
132
|
},
|
|
133
|
+
{
|
|
134
|
+
domain: 'knowledge_gap', key: `${keyRoot}:knowledge-gaps`,
|
|
135
|
+
value: knowledgeGapValue,
|
|
136
|
+
confidence: 1,
|
|
137
|
+
epistemicState: hasProblemFrame ? 'unknown' : 'verified',
|
|
138
|
+
scope: focusScope,
|
|
139
|
+
},
|
|
125
140
|
{
|
|
126
141
|
domain: 'next_trigger', key: `${keyRoot}:next`,
|
|
127
142
|
value: status === 'active' && hasCheckpoint ? triggerValue : NEXT_TRIGGER.get(status),
|