@hmharness/agent 0.14.22 → 0.14.24

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 (2) hide show
  1. package/dist/runner.js +13 -2
  2. package/package.json +1 -1
package/dist/runner.js CHANGED
@@ -11,7 +11,7 @@ import { readFile } from 'node:fs/promises';
11
11
  import { readFileSync, writeFileSync } from 'node:fs';
12
12
  import { join, dirname } from 'node:path';
13
13
  import { extractFeatures, routeDecision, recordRoutingOutcome } from '@hmharness/kernel';
14
- import { appendMemory, listSkills, readInsights, readNotes, recentInsights, recordInsight, redactSecrets, retrieveMemory, skillsToPrompt, sessionGetsCanary, canaryWatermark, listCanary, workspaceForCwd } from '@hmharness/evolution';
14
+ import { appendMemory, listSkills, readInsights, readNotes, retrieveInsights, recordInsight, redactSecrets, retrieveMemory, skillsToPrompt, sessionGetsCanary, canaryWatermark, listCanary, workspaceForCwd } from '@hmharness/evolution';
15
15
  import { harmonyTools } from '@hmharness/domain-harmony';
16
16
  import { opsTools } from '@hmharness/domain-ops';
17
17
  import * as readline from 'node:readline/promises';
@@ -130,7 +130,13 @@ export async function contextPack(task, sessionId, opts = {}) {
130
130
  const [memory, skills, insights] = await Promise.all([
131
131
  retrieveMemory(home, task, { workspace: opts.workspace ?? undefined, embedding: opts.embedding }),
132
132
  listSkills(home),
133
- recentInsights(home),
133
+ // 2026-09-27 plan A: experience retrieval - the K most RELEVANT past
134
+ // insights for THIS task (bigram similarity, recency tiebreak) instead
135
+ // of the 5 most recent; a task similar to one from a month ago now
136
+ // surfaces that lesson instead of five unrelated recent rows.
137
+ // Plan C: cross-project lessons stay retrievable but carry their
138
+ // origin stamp ([来自项目:X]) so the model can weigh them.
139
+ retrieveInsights(home, task, { workspace: opts.workspace ?? undefined }),
134
140
  ]);
135
141
  let canaryBlock = '';
136
142
  let canaryNames = [];
@@ -489,6 +495,11 @@ export async function runAgentTask(opts) {
489
495
  toolUses: result.toolUses,
490
496
  toolsUsed: [...new Set(toolsUsed)],
491
497
  skillsInjected: pack.skillsInjected,
498
+ // plan C (2026-09-27): provenance for cross-project experience - a
499
+ // lesson learned in project A stays retrievable everywhere (plan A
500
+ // retrieval is global) AND carries its origin so the model can weigh
501
+ // "same tooling" vs "different codebase" advice appropriately
502
+ ...(workspace ? { workspace } : {}),
492
503
  });
493
504
  // daily self-evolution: every N insights, one background cycle fires
494
505
  // (default on; autoEvolveEvery: 0 disables). Fire-and-forget - it never
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/agent",
3
- "version": "0.14.22",
3
+ "version": "0.14.24",
4
4
  "description": "hmharness agent execution layer: base tools, system prompt, sub-agent spawn, and the shared task runner that frontends (cli, web) drive.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",