instar 1.3.752 → 1.3.753
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/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +76 -2
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +18 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/MoveIntentClassifier.d.ts +135 -0
- package/dist/core/MoveIntentClassifier.d.ts.map +1 -0
- package/dist/core/MoveIntentClassifier.js +284 -0
- package/dist/core/MoveIntentClassifier.js.map +1 -0
- package/dist/core/NicknameCommand.d.ts +23 -17
- package/dist/core/NicknameCommand.d.ts.map +1 -1
- package/dist/core/NicknameCommand.js +20 -65
- package/dist/core/NicknameCommand.js.map +1 -1
- package/dist/core/componentCategories.d.ts.map +1 -1
- package/dist/core/componentCategories.js +5 -0
- package/dist/core/componentCategories.js.map +1 -1
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +6 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/machineCoherenceManifest.d.ts.map +1 -1
- package/dist/core/machineCoherenceManifest.js +1 -0
- package/dist/core/machineCoherenceManifest.js.map +1 -1
- package/dist/data/llmBenchCoverage.d.ts.map +1 -1
- package/dist/data/llmBenchCoverage.js +6 -0
- package/dist/data/llmBenchCoverage.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/src/data/llmBenchCoverage.ts +7 -0
- package/upgrades/1.3.753.md +44 -0
- package/upgrades/side-effects/nickname-move-intent-llm-rebuild.md +160 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiDH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAU3D,OAA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,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
|
package/dist/commands/server.js
CHANGED
|
@@ -20173,13 +20173,57 @@ export async function startServer(options) {
|
|
|
20173
20173
|
// routed message re-places onto the pinned machine via the already-wired
|
|
20174
20174
|
// placeAndClaim → spawnOnMachine → owner-side onAccepted resume path.
|
|
20175
20175
|
// Inert unless the rollout stage is past 'dark' (gated at the call site).
|
|
20176
|
-
const nickMod = await import('../core/NicknameCommand.js');
|
|
20177
20176
|
const transferMod = await import('../core/TransferByNickname.js');
|
|
20177
|
+
const moveIntentMod = await import('../core/MoveIntentClassifier.js');
|
|
20178
20178
|
const autonomousSessionsModule = await import('../core/AutonomousSessions.js');
|
|
20179
20179
|
const pinMod = await import('../core/TopicPlacementPinStore.js');
|
|
20180
20180
|
const pinMutationMod = await import('../core/TopicPinMutation.js');
|
|
20181
20181
|
const relocSetMod = await import('../core/RelocationNicknameSet.js');
|
|
20182
20182
|
const nickAssignMod = await import('../core/NicknameAssigner.js');
|
|
20183
|
+
// §L4 move-intent recognizer (docs/specs/nickname-move-intent-llm-rebuild.md):
|
|
20184
|
+
// the "move/run/pin this on <nickname>" decision is inferred by an LLM
|
|
20185
|
+
// over the message + recent conversation (MoveIntentClassifier), NOT a
|
|
20186
|
+
// keyword verb list (the 2026-07-03 hijack of "keep the work on the
|
|
20187
|
+
// laptop"). Dev-gated dark (resolveDevAgentGate) + dry-run FIRST: while
|
|
20188
|
+
// dark or dry-run, the message ALWAYS passes through (never hijacked);
|
|
20189
|
+
// the classifier still runs on a dev agent and LOGS would-hijack vs
|
|
20190
|
+
// would-pass for the soak. Fail-OPEN on any uncertainty.
|
|
20191
|
+
const _moveIntentCfg = config.multiMachine?.sessionPool?.moveIntent;
|
|
20192
|
+
const _moveIntentEnabled = resolveDevAgentGate(_moveIntentCfg?.enabled, config);
|
|
20193
|
+
const _moveIntentDryRun = _moveIntentCfg?.dryRun ?? true;
|
|
20194
|
+
const _moveIntentMinConfidence = _moveIntentCfg?.minConfidence ?? 0.85;
|
|
20195
|
+
const _moveIntentTimeoutMs = _moveIntentCfg?.timeoutMs ?? 4000;
|
|
20196
|
+
const _moveIntentContextTurns = _moveIntentCfg?.contextWindowTurns ?? 6;
|
|
20197
|
+
const _moveIntentModelTier = _moveIntentCfg?.modelTier ?? 'fast';
|
|
20198
|
+
const _logMoveIntent = (topicId, text, result, acted) => {
|
|
20199
|
+
try {
|
|
20200
|
+
// Log ONLY LLM-engaged decisions (the soak signal). A prefilter-skip
|
|
20201
|
+
// is always a would-pass and is the bulk of inbound traffic — logging
|
|
20202
|
+
// it would over-collect a message preview for every message. Skipping
|
|
20203
|
+
// it cuts volume AND the privacy surface to messages that named a
|
|
20204
|
+
// machine and actually reached the classifier.
|
|
20205
|
+
if (result.source === 'prefilter-skip')
|
|
20206
|
+
return;
|
|
20207
|
+
const logDir = path.join(config.stateDir, 'logs');
|
|
20208
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
20209
|
+
const decision = result.isCommand ? (acted ? 'hijack' : 'would-hijack') : 'pass';
|
|
20210
|
+
const line = JSON.stringify({
|
|
20211
|
+
ts: new Date().toISOString(),
|
|
20212
|
+
topicId,
|
|
20213
|
+
decision,
|
|
20214
|
+
dryRun: _moveIntentDryRun,
|
|
20215
|
+
source: result.source,
|
|
20216
|
+
intent: result.intent,
|
|
20217
|
+
target: result.targetNickname,
|
|
20218
|
+
confidence: result.confidence,
|
|
20219
|
+
reason: result.reason,
|
|
20220
|
+
// Truncated, whitespace-collapsed preview for soak inspection.
|
|
20221
|
+
textPreview: String(text).replace(/\s+/g, ' ').trim().slice(0, 80),
|
|
20222
|
+
});
|
|
20223
|
+
fs.appendFileSync(path.join(logDir, 'move-intent.jsonl'), line + '\n');
|
|
20224
|
+
}
|
|
20225
|
+
catch { /* audit is observability — never gates the message path */ }
|
|
20226
|
+
};
|
|
20183
20227
|
_topicPinStore = new pinMod.TopicPlacementPinStore({
|
|
20184
20228
|
filePath: path.join(config.stateDir, 'session-pool', 'topic-pins.json'),
|
|
20185
20229
|
// U4.1 §2C (fixes defect 3): a corrupt pin file quarantines ASIDE +
|
|
@@ -20237,7 +20281,37 @@ export async function startServer(options) {
|
|
|
20237
20281
|
selfMachineId: meshSelfId,
|
|
20238
20282
|
selfNickname: resolveSelfNickname(caps),
|
|
20239
20283
|
});
|
|
20240
|
-
|
|
20284
|
+
// Dark gate: when the recognizer isn't enabled (fleet default), never
|
|
20285
|
+
// hijack — pass the message through to the agent.
|
|
20286
|
+
if (!_moveIntentEnabled)
|
|
20287
|
+
return { handled: false };
|
|
20288
|
+
// Bounded window of recent turns so context-dependent commands ("yes,
|
|
20289
|
+
// move it") can resolve their target. Best-effort — the classifier
|
|
20290
|
+
// works on the message alone if history is unavailable.
|
|
20291
|
+
let conversationContext = [];
|
|
20292
|
+
try {
|
|
20293
|
+
const hist = telegram?.getTopicHistory(topicId, _moveIntentContextTurns) ?? [];
|
|
20294
|
+
conversationContext = hist.map((h) => ({ fromUser: !!h.fromUser, text: String(h.text ?? '') }));
|
|
20295
|
+
}
|
|
20296
|
+
catch { /* @silent-fallback-ok — context is best-effort; classify on the message alone */ }
|
|
20297
|
+
const moveResult = await moveIntentMod.classifyRelocationIntent({
|
|
20298
|
+
text,
|
|
20299
|
+
knownNicknames,
|
|
20300
|
+
conversationContext,
|
|
20301
|
+
intelligence: _sharedIntelligence,
|
|
20302
|
+
minConfidence: _moveIntentMinConfidence,
|
|
20303
|
+
timeoutMs: _moveIntentTimeoutMs,
|
|
20304
|
+
maxContextTurns: _moveIntentContextTurns,
|
|
20305
|
+
modelTier: _moveIntentModelTier,
|
|
20306
|
+
});
|
|
20307
|
+
const _willAct = moveResult.isCommand && !_moveIntentDryRun;
|
|
20308
|
+
_logMoveIntent(topicId, text, moveResult, _willAct);
|
|
20309
|
+
// Dry-run (the soak): log would-hijack vs would-pass, but pass the
|
|
20310
|
+
// message through untouched. Real hijacking needs a deliberate
|
|
20311
|
+
// dryRun:false, AND fail-open means uncertainty never hijacks.
|
|
20312
|
+
if (!_willAct)
|
|
20313
|
+
return { handled: false };
|
|
20314
|
+
const cmd = moveIntentMod.toNicknameCommand(moveResult);
|
|
20241
20315
|
if (!cmd)
|
|
20242
20316
|
return { handled: false };
|
|
20243
20317
|
const plan = transferMod.planTransferByNickname(cmd, {
|