instar 1.3.730 → 1.3.732
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 +161 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/config/ConfigDefaults.d.ts.map +1 -1
- package/dist/config/ConfigDefaults.js +26 -0
- package/dist/config/ConfigDefaults.js.map +1 -1
- package/dist/core/CoherenceGate.d.ts +119 -0
- package/dist/core/CoherenceGate.d.ts.map +1 -1
- package/dist/core/CoherenceGate.js +342 -19
- package/dist/core/CoherenceGate.js.map +1 -1
- package/dist/core/CoherenceReviewer.d.ts +30 -0
- package/dist/core/CoherenceReviewer.d.ts.map +1 -1
- package/dist/core/CoherenceReviewer.js +14 -0
- package/dist/core/CoherenceReviewer.js.map +1 -1
- package/dist/core/ConversationRegistry.d.ts +260 -0
- package/dist/core/ConversationRegistry.d.ts.map +1 -0
- package/dist/core/ConversationRegistry.js +1151 -0
- package/dist/core/ConversationRegistry.js.map +1 -0
- package/dist/core/FileClassifier.d.ts.map +1 -1
- package/dist/core/FileClassifier.js +7 -0
- package/dist/core/FileClassifier.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts +13 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +105 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/core/ResponseReviewDecisionLog.d.ts +45 -0
- package/dist/core/ResponseReviewDecisionLog.d.ts.map +1 -0
- package/dist/core/ResponseReviewDecisionLog.js +85 -0
- package/dist/core/ResponseReviewDecisionLog.js.map +1 -0
- package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
- package/dist/core/WriteDomainRegistry.js +21 -0
- package/dist/core/WriteDomainRegistry.js.map +1 -1
- package/dist/core/conversationContextWiring.d.ts +51 -0
- package/dist/core/conversationContextWiring.d.ts.map +1 -0
- package/dist/core/conversationContextWiring.js +78 -0
- package/dist/core/conversationContextWiring.js.map +1 -0
- package/dist/core/conversationIdentity.d.ts +112 -0
- package/dist/core/conversationIdentity.d.ts.map +1 -0
- package/dist/core/conversationIdentity.js +141 -0
- package/dist/core/conversationIdentity.js.map +1 -0
- package/dist/core/deliverToConversation.d.ts +62 -0
- package/dist/core/deliverToConversation.d.ts.map +1 -0
- package/dist/core/deliverToConversation.js +85 -0
- package/dist/core/deliverToConversation.js.map +1 -0
- 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/reviewers/conversational-tone.d.ts.map +1 -1
- package/dist/core/reviewers/conversational-tone.js +15 -1
- package/dist/core/reviewers/conversational-tone.js.map +1 -1
- package/dist/core/types.d.ts +76 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/untrustedConversationContext.d.ts +77 -0
- package/dist/core/untrustedConversationContext.d.ts.map +1 -0
- package/dist/core/untrustedConversationContext.js +134 -0
- package/dist/core/untrustedConversationContext.js.map +1 -0
- package/dist/monitoring/ReviewCanaryBattery.d.ts +160 -0
- package/dist/monitoring/ReviewCanaryBattery.d.ts.map +1 -0
- package/dist/monitoring/ReviewCanaryBattery.js +416 -0
- package/dist/monitoring/ReviewCanaryBattery.js.map +1 -0
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +15 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/dist/server/AgentServer.d.ts +7 -0
- package/dist/server/AgentServer.d.ts.map +1 -1
- package/dist/server/AgentServer.js +13 -0
- package/dist/server/AgentServer.js.map +1 -1
- package/dist/server/CapabilityIndex.d.ts.map +1 -1
- package/dist/server/CapabilityIndex.js +15 -0
- package/dist/server/CapabilityIndex.js.map +1 -1
- package/dist/server/routes.d.ts +10 -0
- package/dist/server/routes.d.ts.map +1 -1
- package/dist/server/routes.js +114 -1
- package/dist/server/routes.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +64 -64
- package/src/scaffold/templates/jobs/instar/review-canary-battery.md +31 -0
- package/src/scaffold/templates.ts +15 -0
- package/upgrades/1.3.731.md +97 -0
- package/upgrades/1.3.732.md +107 -0
- package/upgrades/side-effects/context-aware-outbound-review.md +62 -0
- package/upgrades/side-effects/durable-conversation-identity-increment1.md +89 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
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,OAAO,EAAE,eAAe,EAAiC,MAAM,iCAAiC,CAAC;AAyBjG,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA6H7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAgFtD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAUT;AAyID,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAu/CD,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,eAAe,EACzB,cAAc,EAAE,cAAc,EAC9B,YAAY,CAAC,EAAE,YAAY,EAC3B,WAAW,CAAC,EAAE,WAAW,EACzB,WAAW,CAAC,EAAE,WAAW,EACzB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAGvE,UAAU,CAAC,EAAE,MAAM,OAAO,8BAA8B,EAAE,WAAW,GAAG,IAAI,EAK5E,qBAAqB,CAAC,EAAE,MAAM,OAAO,gCAAgC,EAAE,kBAAkB,GAAG,IAAI,EAKhG,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,GACpD,IAAI,CAijBN;AA2lBD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA63kBtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,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
|
@@ -29,6 +29,7 @@ import { resolveDevAgentGate, resolveStateSyncStores } from '../core/devAgentGat
|
|
|
29
29
|
import { resolveAntiThrashKnobs, readingValidity } from '../core/SwapAntiThrash.js';
|
|
30
30
|
import { shouldReleaseOnComplete, planClaimOnSpawn, ownershipNonce } from '../core/ownershipFollowsLiveWork.js';
|
|
31
31
|
import { PrHandLease } from '../core/PrHandLease.js';
|
|
32
|
+
import { ConversationRegistry } from '../core/ConversationRegistry.js';
|
|
32
33
|
import { claimSuspensionExcludesPin } from '../core/TopicClaimAnnotationStore.js';
|
|
33
34
|
import { parseProfileTrigger, platformMessageIdFrom } from '../core/topicProfileIngress.js';
|
|
34
35
|
import { slugifyChannelName } from '../messaging/slack/sanitize.js';
|
|
@@ -6659,6 +6660,38 @@ export async function startServer(options) {
|
|
|
6659
6660
|
}
|
|
6660
6661
|
// ── Slack adapter initialization ─────────────────────────────────
|
|
6661
6662
|
let slackAdapter;
|
|
6663
|
+
// ── Durable conversation identity (durable-conversation-identity §3/§6.3) ──
|
|
6664
|
+
// ALWAYS constructed (the foundation is always-on once shipped — only
|
|
6665
|
+
// DELIVERY is dev-gated), so GET /conversations/health answers 200 even on a
|
|
6666
|
+
// Telegram-only agent (an empty, healthy registry). getLocalWorkspaceId is
|
|
6667
|
+
// late-bound over the adapter declared above; the D1 kill-switch + fsync
|
|
6668
|
+
// escape hatch are read LIVE at the chokepoint (no restart to apply).
|
|
6669
|
+
const conversationRegistry = new ConversationRegistry({
|
|
6670
|
+
stateDir: config.stateDir,
|
|
6671
|
+
machineId: () => _meshSelfId ?? os.hostname(),
|
|
6672
|
+
isRecordingEnabled: () => config.conversationIdentity?.recording?.enabled !== false,
|
|
6673
|
+
isJournalFsyncDisabled: () => config.conversationIdentity?.recording?.disableJournalFsync === true,
|
|
6674
|
+
getLocalWorkspaceId: () => slackAdapter?.getWorkspaceId(),
|
|
6675
|
+
getConfigWorkspacePin: () => config.conversationIdentity?.workspacePin,
|
|
6676
|
+
breaker: config.conversationIdentity?.mintBreaker,
|
|
6677
|
+
onAttention: (dedupeKey, title, body) => {
|
|
6678
|
+
try {
|
|
6679
|
+
_meshAttentionRaise?.({ id: dedupeKey, title, body, priority: 'medium', sourceContext: 'conversation-identity' });
|
|
6680
|
+
}
|
|
6681
|
+
catch { /* @silent-fallback-ok — attention is observability; a failed raise never gates identity or delivery */ }
|
|
6682
|
+
},
|
|
6683
|
+
log: (line) => console.log(pc.dim(` ${line}`)),
|
|
6684
|
+
});
|
|
6685
|
+
try {
|
|
6686
|
+
conversationRegistry.load();
|
|
6687
|
+
}
|
|
6688
|
+
catch (err) {
|
|
6689
|
+
// @silent-fallback-ok — fail toward delivery (§3.6): a broken registry boot
|
|
6690
|
+
// must never take the server down; mints degrade to in-memory candidates
|
|
6691
|
+
// (behavior-identical to legacy hashing) until healed, and the failure is
|
|
6692
|
+
// logged loudly here.
|
|
6693
|
+
console.warn(` [conversation-registry] boot load failed (degraded to in-memory candidates): ${err instanceof Error ? err.message : String(err)}`);
|
|
6694
|
+
}
|
|
6662
6695
|
const slackConfig = config.messaging?.find(m => m.type === 'slack' && m.enabled);
|
|
6663
6696
|
if (slackConfig) {
|
|
6664
6697
|
try {
|
|
@@ -6886,6 +6919,21 @@ export async function startServer(options) {
|
|
|
6886
6919
|
const isThreadSession = slackAdapter.isThreadRoutingKey(routingKey);
|
|
6887
6920
|
// The thread_ts to thread replies under (only when this is a thread session).
|
|
6888
6921
|
const replyThreadTs = isThreadSession ? threadTs : undefined;
|
|
6922
|
+
// ── §6.3 eager mint (durable-conversation-identity) ────────────────
|
|
6923
|
+
// Get-or-create the durable conversation id for the RESOLVED routing
|
|
6924
|
+
// key on EVERY inbound (one cached registry read after the first).
|
|
6925
|
+
// Carried under the PINNED field key `conversationId` in message
|
|
6926
|
+
// metadata + the session bootstrap context so the session can attach
|
|
6927
|
+
// durable state to it. Fail toward delivery (§3.6): a mint
|
|
6928
|
+
// degradation ("no durable id") never blocks the message.
|
|
6929
|
+
let conversationId = null;
|
|
6930
|
+
try {
|
|
6931
|
+
conversationId = conversationRegistry.mintForInbound(routingKey).id;
|
|
6932
|
+
if (conversationId !== null && message.metadata) {
|
|
6933
|
+
message.metadata.conversationId = conversationId;
|
|
6934
|
+
}
|
|
6935
|
+
}
|
|
6936
|
+
catch { /* @silent-fallback-ok — identity never costs a message (§3.6 fail-toward-delivery): the inbound proceeds without a durable id and re-mints later */ }
|
|
6889
6937
|
// Build injection tag with sender info (matches Telegram's buildInjectionTag pattern)
|
|
6890
6938
|
const slackUserId = message.metadata?.slackUserId;
|
|
6891
6939
|
// Sanitize sender name at injection boundary (prevents injection attacks)
|
|
@@ -6946,6 +6994,13 @@ export async function startServer(options) {
|
|
|
6946
6994
|
contextLines.push('');
|
|
6947
6995
|
contextLines.push('Strip the [slack:] prefix before interpreting the message.');
|
|
6948
6996
|
contextLines.push('Only relay conversational text — not tool output, file contents, or internal reasoning.');
|
|
6997
|
+
if (conversationId !== null) {
|
|
6998
|
+
// §6.3: the durable conversation id rides the session bootstrap
|
|
6999
|
+
// context (pinned metadata key `conversationId`; the prompt phrasing
|
|
7000
|
+
// below is build-time cheap-to-change).
|
|
7001
|
+
contextLines.push('');
|
|
7002
|
+
contextLines.push(`Conversation id: ${conversationId} — the durable identity of THIS Slack conversation. Use it as the topicId when opening durable state (e.g. POST /commitments) for this conversation.`);
|
|
7003
|
+
}
|
|
6949
7004
|
const contextData = contextLines.join('\n');
|
|
6950
7005
|
// Also write to file as backup reference
|
|
6951
7006
|
const ctxPath = path.join(tmpDir, `ctx-${channelId}-${Date.now()}.txt`);
|
|
@@ -7046,6 +7101,32 @@ export async function startServer(options) {
|
|
|
7046
7101
|
// Expose to the owner-side mesh bridge (a forwarded Slack message replays
|
|
7047
7102
|
// through the same dispatch on the machine that owns the conversation).
|
|
7048
7103
|
_slackInboundDispatch = slackInboundDispatch;
|
|
7104
|
+
// ── §6.2 adoption pass (durable-conversation-identity) ─────────────
|
|
7105
|
+
// Idempotent boot-time ensure: pre-register channel-LEVEL conversations
|
|
7106
|
+
// from slack-channel-registry.json with their legacy-hash ids, inside
|
|
7107
|
+
// ONE batched-save window. Gated to channels with authorized-sender
|
|
7108
|
+
// traffic on record (security-B8): a channel enters the session
|
|
7109
|
+
// registry ONLY via the authorized-sender dispatch above, so presence
|
|
7110
|
+
// there IS the authorized-traffic evidence — an auto-joined channel
|
|
7111
|
+
// with no authorized activity never appears and mints lazily on its
|
|
7112
|
+
// first authorized inbound instead. A pre-population convenience, not a
|
|
7113
|
+
// recovery requirement (§6.2).
|
|
7114
|
+
try {
|
|
7115
|
+
const channelRegistry = slackAdapter.getChannelRegistry();
|
|
7116
|
+
const channelIds = new Map();
|
|
7117
|
+
for (const [routingKey, entry] of Object.entries(channelRegistry)) {
|
|
7118
|
+
const chId = routingKey.includes(':') ? routingKey.slice(0, routingKey.indexOf(':')) : routingKey;
|
|
7119
|
+
if (!channelIds.has(chId))
|
|
7120
|
+
channelIds.set(chId, entry.channelName);
|
|
7121
|
+
}
|
|
7122
|
+
conversationRegistry.runAdoptionPass([...channelIds].map(([channelId, name]) => ({ channelId, ...(name ? { name } : {}) })), () => true);
|
|
7123
|
+
}
|
|
7124
|
+
catch (err) {
|
|
7125
|
+
// @silent-fallback-ok — the adoption pass is a pre-population CONVENIENCE,
|
|
7126
|
+
// not a recovery requirement (§6.2): every channel mints lazily on its
|
|
7127
|
+
// next authorized inbound; the failure is logged loudly here.
|
|
7128
|
+
console.warn(` [conversation-registry] adoption pass failed (channels mint lazily on next inbound): ${err instanceof Error ? err.message : String(err)}`);
|
|
7129
|
+
}
|
|
7049
7130
|
slackAdapter.onMessage(async (message) => {
|
|
7050
7131
|
const channelId = message.channel.identifier;
|
|
7051
7132
|
const messageTs = message.metadata?.ts;
|
|
@@ -14367,17 +14448,96 @@ export async function startServer(options) {
|
|
|
14367
14448
|
// even without ANTHROPIC_API_KEY. Falls back to direct Anthropic API if a key is set
|
|
14368
14449
|
// and no intelligence is available.
|
|
14369
14450
|
let responseReviewGate;
|
|
14451
|
+
let reviewCanaryBattery;
|
|
14370
14452
|
if (config.responseReview?.enabled) {
|
|
14371
14453
|
if (sharedIntelligence) {
|
|
14372
14454
|
const { CoherenceGate } = await import('../core/CoherenceGate.js');
|
|
14455
|
+
const { buildConversationContext } = await import('../core/conversationContextWiring.js');
|
|
14456
|
+
// Context-aware reviewers (context-aware-outbound-review §D10): the
|
|
14457
|
+
// WIRING layer resolves the dev-gate (resolveDevAgentGate needs the
|
|
14458
|
+
// top-level developmentAgent flag, which the gate never receives) and
|
|
14459
|
+
// hands the gate a PRE-RESOLVED conversationalContext block through
|
|
14460
|
+
// the LIVE getter — the kill-switch (`conversationalContext.enabled:
|
|
14461
|
+
// false`) then takes effect at the NEXT evaluate, no restart.
|
|
14462
|
+
const resolveConversationalContext = () => {
|
|
14463
|
+
const cc = liveConfig.get('responseReview.conversationalContext', config.responseReview?.conversationalContext) ?? {};
|
|
14464
|
+
const dev = liveConfig.get('developmentAgent', config.developmentAgent);
|
|
14465
|
+
return {
|
|
14466
|
+
enabled: resolveDevAgentGate(typeof cc.enabled === 'boolean' ? cc.enabled : undefined, { developmentAgent: dev }),
|
|
14467
|
+
maxMessages: typeof cc.maxMessages === 'number' ? cc.maxMessages : undefined,
|
|
14468
|
+
maxCharsPerMessage: typeof cc.maxCharsPerMessage === 'number' ? cc.maxCharsPerMessage : undefined,
|
|
14469
|
+
maxTotalChars: typeof cc.maxTotalChars === 'number' ? cc.maxTotalChars : undefined,
|
|
14470
|
+
injectReviewers: Array.isArray(cc.injectReviewers) ? cc.injectReviewers : undefined,
|
|
14471
|
+
};
|
|
14472
|
+
};
|
|
14373
14473
|
responseReviewGate = new CoherenceGate({
|
|
14374
14474
|
config: config.responseReview,
|
|
14375
14475
|
stateDir: config.stateDir,
|
|
14376
14476
|
intelligence: sharedIntelligence,
|
|
14377
14477
|
relationships: relationships ?? undefined,
|
|
14378
14478
|
adaptiveTrust: adaptiveTrust ?? undefined,
|
|
14479
|
+
// LIVE config getter (round-1 M2 build items 1+2): carries BOTH the
|
|
14480
|
+
// CMT-1794 fail-closed kill-switch AND the resolved
|
|
14481
|
+
// conversationalContext block. Reads through LiveConfig so a config
|
|
14482
|
+
// edit applies at the next evaluate without a restart.
|
|
14483
|
+
liveConfig: () => ({
|
|
14484
|
+
failClosedOnCriticalAbstain: liveConfig.get('responseReview.failClosedOnCriticalAbstain', config.responseReview?.failClosedOnCriticalAbstain),
|
|
14485
|
+
conversationalContext: resolveConversationalContext(),
|
|
14486
|
+
}),
|
|
14487
|
+
// §D1 conversation source: TopicMemory rows + the topic's verified
|
|
14488
|
+
// operator binding, distilled by the wiring-layer principal
|
|
14489
|
+
// computation (buildConversationContext — Know Your Principal). Any
|
|
14490
|
+
// throw here is caught at acquisition inside the gate (§D5).
|
|
14491
|
+
conversationContextProvider: (topicId, limit) => {
|
|
14492
|
+
if (!topicMemory)
|
|
14493
|
+
return { messages: [], askLicenseMode: 'weak-corroboration-only' };
|
|
14494
|
+
const rows = topicMemory.getRecentMessages(topicId, limit);
|
|
14495
|
+
const operator = _agentServerRef?.getTopicOperatorStore()?.getOperator(topicId) ?? null;
|
|
14496
|
+
return buildConversationContext(rows, operator);
|
|
14497
|
+
},
|
|
14379
14498
|
});
|
|
14380
14499
|
console.log(pc.green(` Response review pipeline: enabled via shared IntelligenceProvider (${Object.keys(config.responseReview.reviewers ?? {}).length} reviewers configured)`));
|
|
14500
|
+
if (resolveConversationalContext().enabled) {
|
|
14501
|
+
console.log(pc.green(' Response review conversational context: LIVE (context-aware reviewers — dev-gate resolved)'));
|
|
14502
|
+
}
|
|
14503
|
+
else {
|
|
14504
|
+
console.log(pc.dim(' Response review conversational context: dark (dev-gate resolved off)'));
|
|
14505
|
+
}
|
|
14506
|
+
// §D9.4b canary-battery driver — replays through the Bearer-gated
|
|
14507
|
+
// /review/test route (the SAME plumbing real reviews use; no auth-less
|
|
14508
|
+
// bypass seam) and writes its per-run summary through the gate's §D8
|
|
14509
|
+
// writer. The trigger route 503s while the feature is dark.
|
|
14510
|
+
if (topicMemory) {
|
|
14511
|
+
const { ReviewCanaryBattery } = await import('../monitoring/ReviewCanaryBattery.js');
|
|
14512
|
+
const gateForBattery = responseReviewGate;
|
|
14513
|
+
reviewCanaryBattery = new ReviewCanaryBattery({
|
|
14514
|
+
topicMemory,
|
|
14515
|
+
callReviewTest: async (body) => {
|
|
14516
|
+
const resp = await fetch(`http://127.0.0.1:${config.port}/review/test`, {
|
|
14517
|
+
method: 'POST',
|
|
14518
|
+
headers: {
|
|
14519
|
+
'Content-Type': 'application/json',
|
|
14520
|
+
Authorization: `Bearer ${config.authToken ?? ''}`,
|
|
14521
|
+
},
|
|
14522
|
+
body: JSON.stringify(body),
|
|
14523
|
+
});
|
|
14524
|
+
let parsed = null;
|
|
14525
|
+
try {
|
|
14526
|
+
parsed = (await resp.json());
|
|
14527
|
+
}
|
|
14528
|
+
catch {
|
|
14529
|
+
// @silent-fallback-ok — a non-JSON body is reported as a null
|
|
14530
|
+
// body; the driver records the arm as an error (inconclusive),
|
|
14531
|
+
// never a silent skip.
|
|
14532
|
+
}
|
|
14533
|
+
return { status: resp.status, body: parsed };
|
|
14534
|
+
},
|
|
14535
|
+
writeDecisionRow: (row) => gateForBattery.appendDecisionRow(row),
|
|
14536
|
+
isFeatureLive: () => resolveConversationalContext().enabled,
|
|
14537
|
+
isObserveOnly: () => liveConfig.get('responseReview.observeOnly', config.responseReview?.observeOnly) === true,
|
|
14538
|
+
isTestEndpointEnabled: () => liveConfig.get('responseReview.testEndpointDisabled', config.responseReview?.testEndpointDisabled) !== true,
|
|
14539
|
+
});
|
|
14540
|
+
}
|
|
14381
14541
|
}
|
|
14382
14542
|
else {
|
|
14383
14543
|
console.warn(pc.yellow(` Response review pipeline: configured but no IntelligenceProvider available (path-constraints.md Rule 2 forbids direct API path)`));
|
|
@@ -20150,7 +20310,7 @@ export async function startServer(options) {
|
|
|
20150
20310
|
const server = new AgentServer({ config, sessionManager, state, scheduler, telegram, relationships, feedback, feedbackAnomalyDetector, dispatches, updateChecker, autoUpdater, autoDispatcher, quotaTracker, quotaManager, publisher, viewer, tunnel, evolution, watchdog, topicMemory, triageNurse, projectMapper, cartographer: cartographer ?? undefined, coherenceGate: scopeVerifier, contextHierarchy, canonicalState, operationGate, sentinel, adaptiveTrust, memoryMonitor, orphanReaper, coherenceMonitor, commitmentTracker, subscriptionPool, accountFollowMePeerViews: async () => { const nickById = new Map((_listPoolMachines?.() ?? []).map((m) => [m.machineId, m.nickname ?? m.machineId])); let peers = (_resolvePeerUrls?.() ?? []).map((p) => ({ machineId: p.machineId, nickname: nickById.get(p.machineId) ?? p.machineId, url: p.url })); if (peers.length === 0) {
|
|
20151
20311
|
peers = (_listPoolMachines?.() ?? []).filter((m) => m.machineId !== _meshSelfId && !!m.lastKnownUrl).map((m) => ({ machineId: m.machineId, nickname: m.nickname ?? m.machineId, url: m.lastKnownUrl }));
|
|
20152
20312
|
} if (peers.length === 0)
|
|
20153
|
-
return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, writeAdmission: writeAdmission ?? undefined, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, topicPinSkewQuarantine: _topicPinSkewQuarantine ?? undefined, topicPinFoldView: _topicPinFoldView ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
|
|
20313
|
+
return []; const { fetchPeerSubscriptionViews } = await import('../core/fetchPeerSubscriptionViews.js'); return fetchPeerSubscriptionViews({ peers: () => peers, fetchImpl: fetch, authToken: config.authToken ?? '' }); }, quotaPoller, quotaAwareScheduler: _quotaAwareScheduler ?? undefined, proactiveSwapMonitor: _proactiveSwapMonitor ?? undefined, inUseAccountResolver, enrollmentWizard, accountFollowMeRevocation, credentialRepointing, semanticMemory, activitySentinel, rateLimitSentinel, releaseReadinessSentinel: releaseReadinessSentinel ?? undefined, greenPrAutoMerger: greenPrAutoMerger ?? undefined, guardLatchStore: guardLatchStore ?? undefined, messageRouter, summarySentinel, spawnManager, systemReviewer, capabilityMapper, selfKnowledgeTree, coverageAuditor, topicResumeMap: _topicResumeMap ?? undefined, topicProfile: _topicProfileCtx ?? undefined, sessionRefresh: _sessionRefresh ?? undefined, autonomyManager, trustElevationTracker, autonomousEvolution, coordinator: coordinator.enabled ? coordinator : undefined, meshBindActive: coordinator.managers.identityManager.hasIdentity() && config.multiMachine?.meshTransport?.enabled !== false, localSigningKeyPem, leaseTransport, peerEndpointRecorder, getSelfMeshEndpoints, onLeasePullRequest: () => leaseCoordinatorRef?.currentLease() ?? null, liveTailReceiver, handoffWireTransport, onHandoffBegin, onHandoffInitiate: handoffInitiate, handoffInProgress: handoffSentinelInProgress, messageLedger, currentInboundByTopic, replyMarkerTransport, onReplyMarker: messageLedger ? (marker) => { const m = marker; messageLedger.applyRemoteReplyMarker(m.dedupeKey, { platform: m.platform, replyIdempotencyKey: m.replyIdempotencyKey, epoch: m.epoch, topic: m.topic ?? null }); } : undefined, whatsapp: whatsappAdapter, slack: slackAdapter, imessage: imessageAdapter, conversationRegistry, whatsappBusinessBackend, messageBridge, hookEventReceiver, worktreeMonitor, subagentTracker, instructionsVerifier, handshakeManager: threadlineHandshake, threadlineRouter, conversationStore, threadLog, threadMessageRecorder, warrantsReplyGate, collaborationSurfacer, threadResumeMap, topicLinkageHandler: topicLinkageHandler ?? undefined, threadlineRelayClient, threadlineReplyWaiters, listenerManager: listenerManager ?? undefined, a2aDeliveryTracker: a2aDeliveryTracker ?? undefined, responseReviewGate, reviewCanaryBattery, messagingToneGate, outboundDedupGate, telemetryHeartbeat, pasteManager, featureRegistry, discoveryEvaluator, completionEvaluator, unifiedTrust, liveConfig, sharedStateLedger, ledgerSessionRegistry, worktreeManager, oidcEnrolledRepos: parallelDevConfig?.oidcEnrolledRepos, initiativeTracker, projectRoundRunner, projectDriftChecker, machineHeartbeat, machinePoolRegistry, ropeHealthMonitor, writeAdmission: writeAdmission ?? undefined, getInboundQueue: () => _inboundQueue, meshRpcDispatcher, workingSetPullCoordinator, commitmentReplicaStore, preferenceReplicaStore, replicatedRecordEmitter, conflictStore, rollbackUnmerge, droppedOriginRegistry, preferencesUnionReader, forwardCommitmentMutate, sessionOwnershipRegistry, topicPinStore: _topicPinStore ?? undefined, topicPinSkewQuarantine: _topicPinSkewQuarantine ?? undefined, topicPinFoldView: _topicPinFoldView ?? undefined, ownershipReconciler: _ownershipReconciler ?? undefined, staleOwnerEngine: _staleOwnerEngine ?? undefined, leaseHandback: _leaseHandbackCtx ?? undefined, streamTicketStore: _streamTicketStore ?? undefined, poolStreamAllowRemoteInput: config.dashboard?.poolStream?.allowRemoteInput ?? false, poolStreamConnector: _poolStreamConnector ?? undefined, secretSync: _secretSyncHandle ?? undefined, meshSelfId: _meshSelfId ?? undefined, resolveRouterUrl: _resolveRouterUrl ?? undefined, resolvePeerUrls: _resolvePeerUrls ?? undefined, guardRegistry, listPoolMachines: _listPoolMachines ?? undefined, deliverMandateToMachine: _deliverMandateToMachine ?? undefined, poolLink: _poolLink ?? undefined, poolPollCache: _poolPollCache ?? undefined, sessionPoolE2EResultStore, proxyCoordinator, topicIntentStore, topicIntentArcCheck, usherSignalStore, intelligence: sharedIntelligence ?? undefined, telegramBridgeConfig, telegramBridge: telegramBridge ?? undefined, threadlineObservability, briefDeps, workingMemory, taskFlowRegistry, threadlineFlowBridge, sessionReaper, agentWorktreeReaper, orphanedWorkSentinel, mcpProcessReaper, geminiLoopRunner, sleepController, agentActivityState, reapLog, resumeQueue, resumeDrainer, autonomousLivenessReconciler, enforcedTerminationStatus: () => enforcedTerminationWatchdog?.guardStatus() ?? null, prHandLease: prHandLease ?? undefined, operatorStopRecorder: recordOperatorStop, sleepWakeDetector, unjustifiedStopGate, stopGateDb, stopNotifier, liveTestGate, liveTestGateMode, liveTestRunnerCtx }); // Resolve the late-bound topic-operator getter (increment 2e): routing was
|
|
20154
20314
|
// wired before the server existed; from here on inbound binds use the
|
|
20155
20315
|
// server's own store instance.
|
|
20156
20316
|
_agentServerRef = server;
|