@hmharness/evolution 0.14.0 → 0.14.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/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './memory.ts';
2
2
  export * from './ranker.ts';
3
3
  export * from './candidates.ts';
4
+ export * from './skillpayload.ts';
4
5
  export * from './dataset.ts';
5
6
  export * from './readiness.ts';
6
7
  export * from './labels.ts';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from "./memory.js";
2
2
  export * from "./ranker.js";
3
3
  export * from "./candidates.js";
4
+ export * from "./skillpayload.js";
4
5
  export * from "./dataset.js";
5
6
  export * from "./readiness.js";
6
7
  export * from "./labels.js";
@@ -0,0 +1 @@
1
+ export declare function loadSkillPayload(home: string, payload: string): Promise<string>;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Resolve a treatment-arm skills prompt for a skill-target candidate: the
3
+ * payload names the skill; the arm must inject the skill's CONTENT (draft
4
+ * first, promoted second), never the bare name string. (Day-49 SELFFEED:
5
+ * the first real experiment injected "+34 tokens" of name - it measured the
6
+ * instrument, not the skill.)
7
+ */
8
+ import { readFile } from 'node:fs/promises';
9
+ import { join } from 'node:path';
10
+ export async function loadSkillPayload(home, payload) {
11
+ const name = payload.trim();
12
+ if (!name)
13
+ return '';
14
+ const candidates = [
15
+ join(home, 'skills', 'drafts', `${name}.md`),
16
+ join(home, 'skills', `${name}.md`),
17
+ ];
18
+ for (const f of candidates) {
19
+ try {
20
+ const md = await readFile(f, 'utf8');
21
+ if (md.trim())
22
+ return md.trim().slice(0, 4000);
23
+ }
24
+ catch { /* next */ }
25
+ }
26
+ // no file found: fall back to the raw string so the arm still runs
27
+ return name;
28
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmharness/evolution",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "hmharness evolution subsystem: persistent memory, insight capture, skill library, and the bench that gives evolution its fitness signal. First-class kernel citizen, not a plugin.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",