instar 1.3.254 → 1.3.256
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/init.js +15 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +4 -3
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +18 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/SessionManager.d.ts.map +1 -1
- package/dist/core/SessionManager.js +3 -2
- package/dist/core/SessionManager.js.map +1 -1
- package/dist/messaging/shared/telegramInboundFiles.d.ts +2 -0
- package/dist/messaging/shared/telegramInboundFiles.d.ts.map +1 -0
- package/dist/messaging/shared/telegramInboundFiles.js +5 -0
- package/dist/messaging/shared/telegramInboundFiles.js.map +1 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +26 -7
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +65 -65
- package/src/templates/hooks/dangerous-command-guard.sh +25 -0
- package/upgrades/1.3.255.md +38 -0
- package/upgrades/1.3.256.md +92 -0
- package/upgrades/side-effects/force-with-lease-own-branch.md +103 -0
- package/upgrades/side-effects/telegram-inbound-project-dir.md +147 -0
- package/upgrades/side-effects/threadline-canonicalize-peer-address.md +93 -0
- package/upgrades/threadline-canonicalize-peer-address.eli16.md +58 -0
package/dist/server/routes.js
CHANGED
|
@@ -30,6 +30,7 @@ import { CorrectionLedger } from '../monitoring/CorrectionLedger.js';
|
|
|
30
30
|
import { scrubSecrets as scrubCorrectionSecrets } from '../monitoring/scrubSecrets.js';
|
|
31
31
|
import { HumanAsDetectorLog, LEARNING_DETERMINISTIC_THRESHOLD } from '../monitoring/HumanAsDetectorLog.js';
|
|
32
32
|
import { APPRENTICESHIP_CYCLE_CHANNELS } from '../monitoring/ApprenticeshipCycleStore.js';
|
|
33
|
+
import { getTelegramInboundDir } from '../messaging/shared/telegramInboundFiles.js';
|
|
33
34
|
import { parseVersion, compareVersions } from '../lifeline/versionHandshake.js';
|
|
34
35
|
import { readLatestCodexUsage } from '../providers/adapters/openai-codex/observability/codexRateLimitReader.js';
|
|
35
36
|
import { GATE_ROUTE_VERSION, GATE_ROUTE_MINIMUM_VERSION, getHotPathState, setKillSwitch, getKillSwitch, recordSessionStart, getMode, setMode, } from './stopGate.js';
|
|
@@ -8823,7 +8824,7 @@ export function createRoutes(ctx) {
|
|
|
8823
8824
|
``,
|
|
8824
8825
|
systemMsg,
|
|
8825
8826
|
];
|
|
8826
|
-
const tmpDir =
|
|
8827
|
+
const tmpDir = getTelegramInboundDir(ctx.config.projectDir);
|
|
8827
8828
|
fs.mkdirSync(tmpDir, { recursive: true });
|
|
8828
8829
|
const ctxPath = path.join(tmpDir, `ctx-${topicId}-${Date.now()}.txt`);
|
|
8829
8830
|
fs.writeFileSync(ctxPath, contextLines.join('\n'));
|
|
@@ -9391,7 +9392,7 @@ export function createRoutes(ctx) {
|
|
|
9391
9392
|
``,
|
|
9392
9393
|
`This session was auto-created for Telegram topic ${topicId}.`,
|
|
9393
9394
|
];
|
|
9394
|
-
const tmpDir =
|
|
9395
|
+
const tmpDir = getTelegramInboundDir(ctx.config.projectDir);
|
|
9395
9396
|
fs.mkdirSync(tmpDir, { recursive: true });
|
|
9396
9397
|
const ctxPath = path.join(tmpDir, `ctx-${topicId}-${Date.now()}.txt`);
|
|
9397
9398
|
fs.writeFileSync(ctxPath, contextLines.join('\n'));
|
|
@@ -13591,7 +13592,17 @@ export function createRoutes(ctx) {
|
|
|
13591
13592
|
* existing commitment when one already exists for this threadId, so 4
|
|
13592
13593
|
* call-sites below are safe.
|
|
13593
13594
|
*/
|
|
13594
|
-
|
|
13595
|
+
// `canonicalRemoteAgent` MUST be the peer's resolved FULL fingerprint (the
|
|
13596
|
+
// same identity used for routing) — NOT a display name or a "name:fpPrefix"
|
|
13597
|
+
// address. The inbound anti-hijack guard (ThreadlineRouter) compares a reply's
|
|
13598
|
+
// senderFingerprint against the stored thread owner (`remoteAgent`); if we
|
|
13599
|
+
// stored a composite/display string instead of the full fingerprint, a known
|
|
13600
|
+
// peer's reply fails the match and gets false-isolated to a fresh cold-spawn
|
|
13601
|
+
// thread — breaking A2A continuity (the "one coherent individual" property).
|
|
13602
|
+
// The human-facing display name is preserved separately. Mirrors
|
|
13603
|
+
// telegramBridge.mirrorOutbound, which already stores the resolved fingerprint
|
|
13604
|
+
// as `remoteAgent` and the raw target as `remoteAgentName`.
|
|
13605
|
+
const captureOrigin = async (effThreadId, canonicalRemoteAgent, displayName) => {
|
|
13595
13606
|
if (!ctx.topicLinkageHandler)
|
|
13596
13607
|
return;
|
|
13597
13608
|
if (!resolvedOriginTopicId)
|
|
@@ -13599,8 +13610,8 @@ export function createRoutes(ctx) {
|
|
|
13599
13610
|
try {
|
|
13600
13611
|
ctx.topicLinkageHandler.captureOriginOnSend({
|
|
13601
13612
|
threadId: effThreadId,
|
|
13602
|
-
remoteAgent:
|
|
13603
|
-
remoteAgentDisplayName:
|
|
13613
|
+
remoteAgent: canonicalRemoteAgent,
|
|
13614
|
+
remoteAgentDisplayName: displayName ?? canonicalRemoteAgent,
|
|
13604
13615
|
originTopicId: resolvedOriginTopicId,
|
|
13605
13616
|
purpose: resolvedPurpose,
|
|
13606
13617
|
subject: 'Threadline conversation',
|
|
@@ -13905,7 +13916,10 @@ export function createRoutes(ctx) {
|
|
|
13905
13916
|
outcome,
|
|
13906
13917
|
}).catch(() => { });
|
|
13907
13918
|
}
|
|
13908
|
-
|
|
13919
|
+
// Store the resolved full fingerprint as the canonical thread
|
|
13920
|
+
// owner (display = the local agent's name) so a reply matches
|
|
13921
|
+
// the anti-hijack guard instead of being false-isolated.
|
|
13922
|
+
await captureOrigin(effectiveThreadId, localTarget.fingerprint || localTarget.publicKey?.substring(0, 32) || localTarget.name, localTarget.name);
|
|
13909
13923
|
if (waitForReply) {
|
|
13910
13924
|
const reply = await waitForThreadlineReply(ctx, localTarget.name, effectiveThreadId, timeoutSeconds);
|
|
13911
13925
|
res.json({
|
|
@@ -14018,7 +14032,12 @@ export function createRoutes(ctx) {
|
|
|
14018
14032
|
outcome: 'relay-sent',
|
|
14019
14033
|
}).catch(() => { });
|
|
14020
14034
|
}
|
|
14021
|
-
|
|
14035
|
+
// `resolvedId` is the peer's full routing fingerprint; store IT as the
|
|
14036
|
+
// canonical thread owner (display = the raw target the caller typed) so a
|
|
14037
|
+
// reply matches the anti-hijack guard instead of being false-isolated.
|
|
14038
|
+
// This is the fix for the composite "name:fpPrefix" address being stored
|
|
14039
|
+
// un-resolved and causing a known peer's replies to cold-spawn.
|
|
14040
|
+
await captureOrigin(effectiveRelayThreadId, resolvedId, targetAgent);
|
|
14022
14041
|
if (waitForReply) {
|
|
14023
14042
|
const reply = await waitForThreadlineReply(ctx, resolvedId, effectiveRelayThreadId, timeoutSeconds);
|
|
14024
14043
|
res.json({
|