titan-agent 7.1.0 → 7.2.1

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/README.md CHANGED
@@ -50,6 +50,27 @@
50
50
 
51
51
  <a id="whats-new"></a>
52
52
 
53
+ ## What's new in v7.2.0 "Conscience" — Honesty as an Enforced Invariant
54
+
55
+ **TITAN stopped being able to bluff.** Two honesty organs turn any model — local
56
+ or cloud — into one that *verifies before it claims* and *critiques before it
57
+ speaks*. Flip one switch (`agent.reliabilityMode: true`) and your local model
58
+ behaves with the reliability discipline of a frontier model, because reliability
59
+ is enforced in the harness, not hoped for in the prompt.
60
+
61
+ - 🛡️ **Verification wall (always on):** claim you sent/posted/deleted/deployed/
62
+ saved something with no tool that did it → TITAN appends a visible correction.
63
+ - 🧠 **Self-critique (Reliability Mode):** the model reviews its own draft
64
+ adversarially and appends honest "on reflection" caveats. Live-proven: a local
65
+ model caught its own over-precise number and a definitional conflation,
66
+ unprompted.
67
+ - ⚡ **Perf:** ~19MB/turn read deleted (tail-read trajectories); every timer
68
+ `.unref()`'d.
69
+
70
+ See **[CHANGELOG.md](CHANGELOG.md)** for the full v7.2.0 entry.
71
+
72
+ ---
73
+
53
74
  ## What's new in v7.1.0 "Council" — Local-First Intelligence, Together
54
75
 
55
76
  **Agents advising agents, models sized to their machines, and benchmarks you can trust.**
@@ -65,6 +86,16 @@ TITAN now **learns each deployment's real context ceiling from live traffic** an
65
86
 
66
87
  **Proof, not vibes**: under the new `TITAN_BENCH=1` isolation mode, **Qwen3.6-35B-A3B NVFP4 on DGX-Spark-class hardware scores 85% through TITAN's harness — tying the RTX 5090's best local model.** Full corrected tables in [benchmarks/MODEL_COMPARISON.md](benchmarks/MODEL_COMPARISON.md).
67
88
 
89
+ ### 🛡️ Honesty as an enforced invariant (any model)
90
+ TITAN won't let a model bluff. The **verification wall** appends a visible
91
+ correction if a reply claims it *did* something (sent, posted, deleted,
92
+ deployed, saved) with no tool that actually did it — deterministic, always on.
93
+ Turn on **Reliability Mode** (`agent.reliabilityMode: true` — one switch) and TITAN
94
+ also critiques its own draft before you see it, appending honest "on reflection"
95
+ caveats for anything it didn't verify. This is how a local model reaches
96
+ frontier *reliability* without frontier size — and it works on whatever brain
97
+ you plug in.
98
+
68
99
  See **[CHANGELOG.md](CHANGELOG.md)** for the complete v7.1.0 entry.
69
100
 
70
101
  ---
@@ -1243,6 +1243,15 @@ CRITICAL: Widgets are NOT files. Do NOT use write_file, edit_file, or any file t
1243
1243
  enrichedSystemPrompt += earlyPersona.systemPromptAppendix;
1244
1244
  logger.info(COMPONENT, `[Persona:${earlyPersona.id}] system prompt appendix injected`);
1245
1245
  }
1246
+ try {
1247
+ const relMode = config.agent.reliabilityMode === true;
1248
+ if (relMode) {
1249
+ const { buildDisciplinePrompt } = await import("./disciplinePrompt.js");
1250
+ const frag = buildDisciplinePrompt(message, true);
1251
+ if (frag) enrichedSystemPrompt += frag;
1252
+ }
1253
+ } catch {
1254
+ }
1246
1255
  const messages = [
1247
1256
  { role: "system", content: enrichedSystemPrompt },
1248
1257
  ...historyMessages
@@ -1542,12 +1551,23 @@ ${buildSystemWidgetGate(sw)}` : buildSystemWidgetGate(sw);
1542
1551
  logger.info(COMPONENT, `[SystemWidgetShortcut] Deterministically emitted _____widget gate for ${sw.source}`);
1543
1552
  }
1544
1553
  }
1554
+ try {
1555
+ const agentCfg = config.agent;
1556
+ const { resolveSelfCritique, runSelfCritique } = await import("./selfCritique.js");
1557
+ const scCfg = resolveSelfCritique(agentCfg.selfCritique, agentCfg.reliabilityMode === true);
1558
+ if (scCfg.enabled) {
1559
+ const sc = await runSelfCritique(scCfg, message, finalContent, [...new Set(toolsUsed)], modelUsed);
1560
+ if (sc.critiqued && sc.issues.length > 0) finalContent = sc.content;
1561
+ }
1562
+ } catch (e) {
1563
+ logger.debug(COMPONENT, `Self-critique wrapper skipped: ${e.message}`);
1564
+ }
1545
1565
  {
1546
- const claimsScheduled = /\b(i(?:'|’)?(?:ve| have)\s+(?:set|scheduled|created)|(?:reminder|schedule[d]?)\s+(?:is\s+)?(?:set|created|scheduled)|i(?:'|’)?ll remind you|scheduled a reminder)\b/i.test(finalContent);
1547
- const schedulingToolRan = toolsUsed.some((t) => /^(reminder|cron|schedule|event_trigger|workflows?|social_scheduler)/i.test(t));
1548
- if (claimsScheduled && !schedulingToolRan) {
1549
- finalContent += "\n\n\u26A0\uFE0F Correction: I described scheduling that, but I did not actually create a scheduled job this turn. Ask me again and I'll set it with the reminder tool properly.";
1550
- logger.warn(COMPONENT, "[HonestyGuard] Reply claimed scheduling without a scheduling tool \u2014 appended correction");
1566
+ const { applyHonestyGuard } = await import("./honestyGuard.js");
1567
+ const guarded = applyHonestyGuard(finalContent, toolsUsed);
1568
+ if (guarded.flagged.length > 0) {
1569
+ finalContent = guarded.content;
1570
+ logger.warn(COMPONENT, `[HonestyGuard] Reply claimed ${guarded.flagged.join(", ")} without a capable tool \u2014 appended correction`);
1551
1571
  }
1552
1572
  }
1553
1573
  addMessage(session, "assistant", finalContent, {