@vellumai/assistant 0.4.30 → 0.4.31

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.
Files changed (91) hide show
  1. package/Dockerfile +14 -8
  2. package/README.md +2 -2
  3. package/docs/architecture/memory.md +28 -29
  4. package/docs/runbook-trusted-contacts.md +1 -4
  5. package/package.json +1 -1
  6. package/src/__tests__/commit-message-enrichment-service.test.ts +0 -4
  7. package/src/__tests__/config-schema.test.ts +0 -9
  8. package/src/__tests__/conflict-policy.test.ts +76 -0
  9. package/src/__tests__/conflict-store.test.ts +14 -20
  10. package/src/__tests__/contacts-tools.test.ts +8 -61
  11. package/src/__tests__/contradiction-checker.test.ts +5 -1
  12. package/src/__tests__/guardian-decision-primitive-canonical.test.ts +5 -3
  13. package/src/__tests__/guardian-routing-invariants.test.ts +6 -4
  14. package/src/__tests__/memory-lifecycle-e2e.test.ts +11 -10
  15. package/src/__tests__/registry.test.ts +0 -10
  16. package/src/__tests__/script-proxy-session-runtime.test.ts +6 -1
  17. package/src/__tests__/session-agent-loop.test.ts +0 -2
  18. package/src/__tests__/session-conflict-gate.test.ts +243 -388
  19. package/src/__tests__/session-profile-injection.test.ts +0 -2
  20. package/src/__tests__/session-runtime-assembly.test.ts +2 -3
  21. package/src/__tests__/session-skill-tools.test.ts +0 -49
  22. package/src/__tests__/session-workspace-cache-state.test.ts +0 -1
  23. package/src/__tests__/session-workspace-injection.test.ts +0 -1
  24. package/src/__tests__/session-workspace-tool-tracking.test.ts +0 -1
  25. package/src/__tests__/tool-grant-request-escalation.test.ts +2 -1
  26. package/src/__tests__/trusted-contact-inline-approval-integration.test.ts +2 -1
  27. package/src/approvals/guardian-decision-primitive.ts +11 -7
  28. package/src/approvals/guardian-request-resolvers.ts +5 -3
  29. package/src/calls/relay-server.ts +5 -0
  30. package/src/config/bundled-skills/contacts/SKILL.md +7 -18
  31. package/src/config/bundled-skills/contacts/TOOLS.json +4 -20
  32. package/src/config/bundled-skills/contacts/tools/contact-merge.ts +2 -4
  33. package/src/config/bundled-skills/contacts/tools/contact-search.ts +6 -12
  34. package/src/config/bundled-skills/contacts/tools/contact-upsert.ts +3 -24
  35. package/src/config/bundled-tool-registry.ts +0 -5
  36. package/src/config/memory-schema.ts +0 -10
  37. package/src/config/system-prompt.ts +6 -0
  38. package/src/contacts/contact-store.ts +36 -62
  39. package/src/contacts/contacts-write.ts +14 -3
  40. package/src/contacts/types.ts +9 -4
  41. package/src/daemon/handlers/config-heartbeat.ts +1 -2
  42. package/src/daemon/handlers/contacts.ts +2 -2
  43. package/src/daemon/handlers/guardian-actions.ts +1 -1
  44. package/src/daemon/handlers/sessions.ts +2 -1
  45. package/src/daemon/ipc-contract/contacts.ts +2 -2
  46. package/src/daemon/session-agent-loop.ts +1 -45
  47. package/src/daemon/session-conflict-gate.ts +21 -82
  48. package/src/daemon/session-memory.ts +7 -52
  49. package/src/daemon/session-process.ts +3 -1
  50. package/src/daemon/session-runtime-assembly.ts +18 -35
  51. package/src/heartbeat/heartbeat-service.ts +5 -1
  52. package/src/memory/conflict-intent.ts +3 -6
  53. package/src/memory/conflict-policy.ts +34 -0
  54. package/src/memory/conflict-store.ts +10 -18
  55. package/src/memory/contradiction-checker.ts +2 -2
  56. package/src/memory/db-init.ts +4 -0
  57. package/src/memory/job-handlers/conflict.ts +0 -7
  58. package/src/memory/migrations/134-contacts-notes-column.ts +51 -0
  59. package/src/memory/migrations/135-backfill-contact-interaction-stats.ts +31 -0
  60. package/src/memory/migrations/index.ts +2 -0
  61. package/src/memory/schema.ts +1 -18
  62. package/src/messaging/index.ts +0 -1
  63. package/src/messaging/types.ts +0 -38
  64. package/src/runtime/guardian-action-service.ts +3 -2
  65. package/src/runtime/guardian-outbound-actions.ts +3 -3
  66. package/src/runtime/guardian-reply-router.ts +4 -4
  67. package/src/runtime/http-server.ts +12 -0
  68. package/src/runtime/routes/approval-strategies/guardian-callback-strategy.ts +6 -3
  69. package/src/runtime/routes/contact-routes.ts +308 -29
  70. package/src/runtime/routes/conversation-routes.ts +2 -1
  71. package/src/runtime/routes/global-search-routes.ts +2 -2
  72. package/src/runtime/routes/guardian-action-routes.ts +1 -1
  73. package/src/runtime/routes/guardian-approval-interception.ts +2 -1
  74. package/src/runtime/routes/guardian-bootstrap-routes.ts +6 -1
  75. package/src/runtime/routes/inbound-stages/acl-enforcement.ts +5 -1
  76. package/src/runtime/routes/inbound-stages/guardian-reply-intercept.ts +2 -1
  77. package/src/runtime/routes/migration-routes.ts +17 -17
  78. package/src/workspace/git-service.ts +6 -4
  79. package/src/__tests__/get-weather.test.ts +0 -393
  80. package/src/__tests__/weather-skill-regression.test.ts +0 -276
  81. package/src/autonomy/autonomy-resolver.ts +0 -62
  82. package/src/autonomy/autonomy-store.ts +0 -138
  83. package/src/autonomy/disposition-mapper.ts +0 -31
  84. package/src/autonomy/index.ts +0 -11
  85. package/src/autonomy/types.ts +0 -43
  86. package/src/config/bundled-skills/weather/SKILL.md +0 -38
  87. package/src/config/bundled-skills/weather/TOOLS.json +0 -36
  88. package/src/config/bundled-skills/weather/icon.svg +0 -24
  89. package/src/config/bundled-skills/weather/tools/get-weather.ts +0 -12
  90. package/src/messaging/triage-engine.ts +0 -344
  91. package/src/tools/weather/service.ts +0 -712
@@ -135,7 +135,6 @@ const TEST_CONFIG = {
135
135
  enabled: true,
136
136
  gateMode: "soft" as const,
137
137
  relevanceThreshold: 0.2,
138
- reaskCooldownTurns: 3,
139
138
  resolverLlmTimeoutMs: 250,
140
139
  },
141
140
  profile: {
@@ -397,7 +396,7 @@ describe("Memory lifecycle E2E regression", () => {
397
396
  confidence: 0.88,
398
397
  importance: 0.8,
399
398
  fingerprint: "fp-item-ui-existing",
400
- verificationState: "assistant_inferred",
399
+ verificationState: "user_reported",
401
400
  scopeId: "default",
402
401
  firstSeenAt: now + 30,
403
402
  lastSeenAt: now + 30,
@@ -413,7 +412,7 @@ describe("Memory lifecycle E2E regression", () => {
413
412
  confidence: 0.84,
414
413
  importance: 0.8,
415
414
  fingerprint: "fp-item-ui-candidate",
416
- verificationState: "assistant_inferred",
415
+ verificationState: "user_reported",
417
416
  scopeId: "default",
418
417
  firstSeenAt: now + 31,
419
418
  lastSeenAt: now + 31,
@@ -432,23 +431,25 @@ describe("Memory lifecycle E2E regression", () => {
432
431
  });
433
432
 
434
433
  const conflictGate = new ConflictGate();
435
- const firstGateDecision = await conflictGate.evaluate(
434
+
435
+ // First evaluation: conflict remains pending; evaluate returns void (no
436
+ // user-facing output — conflict handling is fully internal)
437
+ const firstResult = await conflictGate.evaluate(
436
438
  "Need react roadmap update today",
437
439
  TEST_CONFIG.memory.conflicts,
438
440
  );
439
- expect(firstGateDecision).not.toBeNull();
440
- expect(firstGateDecision?.relevant).toBe(true);
441
- expect(firstGateDecision?.question).toContain("React");
441
+ expect(firstResult).toBeUndefined();
442
442
 
443
443
  const pendingAfterFirstGate = getConflictById(gatedConflict.id);
444
444
  expect(pendingAfterFirstGate?.status).toBe("pending_clarification");
445
- expect(pendingAfterFirstGate?.lastAskedAt).not.toBeNull();
446
445
 
447
- const secondGateDecision = await conflictGate.evaluate(
446
+ // Second evaluation: clarification-like reply resolves the conflict
447
+ // internally; still no user-facing prompt is produced
448
+ const secondResult = await conflictGate.evaluate(
448
449
  "Use the new renderer going forward.",
449
450
  TEST_CONFIG.memory.conflicts,
450
451
  );
451
- expect(secondGateDecision).toBeNull();
452
+ expect(secondResult).toBeUndefined();
452
453
 
453
454
  const resolvedAfterSecondGate = getConflictById(gatedConflict.id);
454
455
  expect(resolvedAfterSecondGate?.status).toBe("resolved_keep_candidate");
@@ -255,16 +255,6 @@ describe("baseline characterization: hardcoded tool loading", () => {
255
255
  }
256
256
  });
257
257
 
258
- test("weather tool is NOT in global registry after initializeTools()", async () => {
259
- await initializeTools();
260
- const tool = getTool("get_weather");
261
- expect(tool).toBeUndefined();
262
- });
263
-
264
- test("weather tool name is NOT in eagerModuleToolNames manifest", () => {
265
- expect(eagerModuleToolNames).not.toContain("get_weather");
266
- });
267
-
268
258
  test("claude_code is NOT in global registry after initializeTools()", async () => {
269
259
  await initializeTools();
270
260
  const tool = getTool("claude_code");
@@ -1,7 +1,12 @@
1
1
  import { createServer, request as httpRequest, type Server } from "node:http";
2
2
  import { afterEach, describe, expect, test } from "bun:test";
3
3
 
4
- import { createSession, startSession, stopAllSessions, stopSession } from '../tools/network/script-proxy/session-manager.js';
4
+ import {
5
+ createSession,
6
+ startSession,
7
+ stopAllSessions,
8
+ stopSession,
9
+ } from "../tools/network/script-proxy/session-manager.js";
5
10
 
6
11
  let upstreamServer: Server | null = null;
7
12
 
@@ -189,9 +189,7 @@ mock.module("../daemon/session-memory.js", () => ({
189
189
  latencyMs: 0,
190
190
  },
191
191
  dynamicProfile: { text: "" },
192
- softConflictInstruction: null,
193
192
  recallInjectionStrategy: "prepend_user_block" as const,
194
- conflictClarification: null,
195
193
  }),
196
194
  }));
197
195