humanish 0.104.3 → 0.105.0
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/actor-contract.d.ts +8 -0
- package/dist/actor-contract.js.map +1 -1
- package/dist/computer-use.js +3 -1
- package/dist/computer-use.js.map +1 -1
- package/dist/concurrent-shared-world-lab.js +2 -0
- package/dist/concurrent-shared-world-lab.js.map +1 -1
- package/dist/cua-actor-lab.js +7 -9
- package/dist/cua-actor-lab.js.map +1 -1
- package/dist/e2b-terminal-lab.d.ts +1 -13
- package/dist/e2b-terminal-lab.js +8 -49
- package/dist/e2b-terminal-lab.js.map +1 -1
- package/dist/init-templates.js +0 -1
- package/dist/init-templates.js.map +1 -1
- package/dist/labs.d.ts +7 -0
- package/dist/labs.js +17 -1
- package/dist/labs.js.map +1 -1
- package/dist/observer-app.html +4 -4
- package/dist/persona-resolve.d.ts +2 -2
- package/dist/persona-resolve.js +15 -25
- package/dist/persona-resolve.js.map +1 -1
- package/dist/persona.d.ts +17 -13
- package/dist/persona.js +118 -115
- package/dist/persona.js.map +1 -1
- package/dist/program.js +1 -0
- package/dist/program.js.map +1 -1
- package/dist/run.js +4 -2
- package/dist/run.js.map +1 -1
- package/dist/shared-world-lab.js +2 -0
- package/dist/shared-world-lab.js.map +1 -1
- package/docs/contracts/schemas.md +32 -1
- package/docs/goals/current.md +7 -3
- package/docs/principles/actor-fidelity.md +12 -21
- package/docs/ramp/README.md +6 -1
- package/docs/release/0.105.0-participant-backgrounds.md +50 -0
- package/package.json +1 -1
- package/skills/humanish/SKILL.md +40 -23
|
@@ -5,8 +5,8 @@ export declare const PERSONA_ID_PATTERN: RegExp;
|
|
|
5
5
|
/** Title-case an id for the fallback display name (`skeptical-power-user` -> `Skeptical Power User`). */
|
|
6
6
|
export declare function personaTitleFromId(personaId: string): string;
|
|
7
7
|
/**
|
|
8
|
-
* Resolve ONE committed persona. Returns `null`
|
|
9
|
-
* unsafe or no file exists
|
|
8
|
+
* Resolve ONE committed persona. Returns `null` with a warning when the id is
|
|
9
|
+
* unsafe or no file exists. Invalid rich backgrounds reject the study before execution.
|
|
10
10
|
*/
|
|
11
11
|
export declare function resolveCommittedPersona(projectRoot: PreparedSelectedOutputDirectory, personaId: string): Promise<{
|
|
12
12
|
persona: ResolvedPersona | null;
|
package/dist/persona-resolve.js
CHANGED
|
@@ -1,24 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// #308 gave the terminal lane this: read `humanish/personas/<id>.yaml`, compile the traits into
|
|
4
|
-
// behavioral directives, and record truthfully which traits were applied. The computer-use lanes
|
|
5
|
-
// never got it — they composed a bare `Persona: <id>.` line and hardcoded `traitsApplied: []`, so
|
|
6
|
-
// on browser routes the persona axis was a label rather than a behavior. A live two-lane contrast
|
|
7
|
-
// (an impatient expert vs a patient newcomer, same app, same mission) came back with near-identical
|
|
8
|
-
// action profiles, which read like evidence that personas do not matter and was actually evidence
|
|
9
|
-
// that personas were never applied.
|
|
10
|
-
//
|
|
11
|
-
// This module is the shared implementation so the two routes cannot drift again: one containment
|
|
12
|
-
// rule, one compiler, one fallback polarity.
|
|
13
|
-
//
|
|
14
|
-
// FAIL-SAFE, not fail-closed — deliberately the opposite polarity to the scorer loader. A persona
|
|
15
|
-
// that declared nothing must never be given fabricated traits, so an unsafe id, a missing file, or
|
|
16
|
-
// unparseable YAML falls back to the bare id line with a truthful EMPTY traitsApplied (warning only
|
|
17
|
-
// when the file existed but could not be read). Silence here is honest; invention would not be.
|
|
1
|
+
// Shared contained persona resolution for browser and terminal participants.
|
|
18
2
|
import { parse as parseYaml } from "yaml";
|
|
19
3
|
import path from "node:path";
|
|
20
|
-
import { parseResolvedPersona } from "./persona.js";
|
|
4
|
+
import { parseResolvedPersona, PersonaConfigError } from "./persona.js";
|
|
21
5
|
import { prepareSelectedOutputDirectory, readContainedRegularFile } from "./selected-output-paths.js";
|
|
6
|
+
import { digestText, redactText } from "./redaction.js";
|
|
22
7
|
import { realpath } from "node:fs/promises";
|
|
23
8
|
/** Persona ids are file-name segments, never paths: the same grammar the terminal lane enforces. */
|
|
24
9
|
export const PERSONA_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]*$/;
|
|
@@ -31,12 +16,12 @@ export function personaTitleFromId(personaId) {
|
|
|
31
16
|
.join(" ");
|
|
32
17
|
}
|
|
33
18
|
/**
|
|
34
|
-
* Resolve ONE committed persona. Returns `null`
|
|
35
|
-
* unsafe or no file exists
|
|
19
|
+
* Resolve ONE committed persona. Returns `null` with a warning when the id is
|
|
20
|
+
* unsafe or no file exists. Invalid rich backgrounds reject the study before execution.
|
|
36
21
|
*/
|
|
37
22
|
export async function resolveCommittedPersona(projectRoot, personaId) {
|
|
38
23
|
if (!PERSONA_ID_PATTERN.test(personaId)) {
|
|
39
|
-
return { persona: null, warnings: [] };
|
|
24
|
+
return { persona: null, warnings: ["Persona id is not a safe filename; using the id only (no persona context)."] };
|
|
40
25
|
}
|
|
41
26
|
for (const candidate of [
|
|
42
27
|
path.posix.join("humanish", "personas", `${personaId}.yaml`),
|
|
@@ -55,9 +40,12 @@ export async function resolveCommittedPersona(projectRoot, personaId) {
|
|
|
55
40
|
warnings: [`${candidate} could not be parsed as YAML; the lane ran with the persona id only (no traits applied).`]
|
|
56
41
|
};
|
|
57
42
|
}
|
|
58
|
-
|
|
43
|
+
const warnings = [];
|
|
44
|
+
const persona = parseResolvedPersona(raw, { id: personaId, name: personaTitleFromId(personaId) }, warnings);
|
|
45
|
+
persona.sourceDigest = digestText(bytes.toString("utf8"));
|
|
46
|
+
return { persona, warnings: warnings.map(warning => `${candidate}: ${warning}`) };
|
|
59
47
|
}
|
|
60
|
-
return { persona: null, warnings: [] };
|
|
48
|
+
return { persona: null, warnings: [`Persona ${redactText(personaId)} has no readable file under humanish/personas; using the id only (no persona context).`] };
|
|
61
49
|
}
|
|
62
50
|
/**
|
|
63
51
|
* Resolve every distinct persona id a run will use, once, before lane specs are built. Returning a
|
|
@@ -102,8 +90,10 @@ export async function resolveCommittedPersonasForCwd(cwd, personaIds) {
|
|
|
102
90
|
const projectRoot = await prepareSelectedOutputDirectory(path.dirname(physical), physical);
|
|
103
91
|
return await resolveCommittedPersonas(projectRoot, personaIds);
|
|
104
92
|
}
|
|
105
|
-
catch {
|
|
106
|
-
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (error instanceof PersonaConfigError)
|
|
95
|
+
throw error;
|
|
96
|
+
return { personas: new Map(), warnings: ["Persona directory could not be read; no persona context was loaded."] };
|
|
107
97
|
}
|
|
108
98
|
}
|
|
109
99
|
//# sourceMappingURL=persona-resolve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona-resolve.js","sourceRoot":"","sources":["../src/persona-resolve.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"persona-resolve.js","sourceRoot":"","sources":["../src/persona-resolve.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAwB,MAAM,cAAc,CAAC;AAC9F,OAAO,EACL,8BAA8B,EAC9B,wBAAwB,EAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,oGAAoG;AACpG,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEhE,yGAAyG;AACzG,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IAClD,OAAO,SAAS;SACb,KAAK,CAAC,MAAM,CAAC;SACb,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,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C,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACrC,IAAI,IAAI,CAAC,OAAO;gBAAE,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,GAAW,EACX,UAA2C;IAE3C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,MAAM,8BAA8B,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC3F,OAAO,MAAM,wBAAwB,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACjE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,kBAAkB;YAAE,MAAM,KAAK,CAAC;QACrD,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,EAAE,QAAQ,EAAE,CAAC,qEAAqE,CAAC,EAAE,CAAC;IACpH,CAAC;AACH,CAAC"}
|
package/dist/persona.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
import type { ActorPersonaRef } from "./actor-contract.js";
|
|
1
2
|
export type PersonaLevel = "low" | "medium" | "high";
|
|
3
|
+
export declare const PERSONA_BACKGROUND_MAX_BYTES: number;
|
|
4
|
+
export declare const PERSONA_COMPILER_VERSION = 2;
|
|
5
|
+
export declare class PersonaConfigError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
2
8
|
export interface ResolvedPersona {
|
|
3
9
|
id: string;
|
|
4
10
|
name: string;
|
|
5
11
|
summary?: string;
|
|
12
|
+
background?: string;
|
|
13
|
+
/** Digest of the source file, when resolved from disk. */
|
|
14
|
+
sourceDigest?: string;
|
|
6
15
|
traits: {
|
|
7
|
-
patience
|
|
8
|
-
skill
|
|
16
|
+
patience?: PersonaLevel;
|
|
17
|
+
skill?: PersonaLevel;
|
|
9
18
|
accessibilityNeeds?: string;
|
|
10
19
|
};
|
|
11
20
|
constraints: string[];
|
|
@@ -15,21 +24,16 @@ export interface PersonaDirectives {
|
|
|
15
24
|
skillBias: string;
|
|
16
25
|
accessibilityBehavior?: string;
|
|
17
26
|
constraints: string[];
|
|
27
|
+
/** Directives included in the prompt, not proof of behavioral adherence. */
|
|
18
28
|
traitsApplied: string[];
|
|
19
29
|
}
|
|
20
|
-
/**
|
|
21
|
-
* Parse a YAML-parsed persona object into a normalized ResolvedPersona. `fallback`
|
|
22
|
-
* supplies id/name when the document omits them (or is not a record at all).
|
|
23
|
-
*/
|
|
30
|
+
/** Legacy short fields keep their bounds, but every discarded value is diagnosed. */
|
|
24
31
|
export declare function parseResolvedPersona(raw: unknown, fallback: {
|
|
25
32
|
id: string;
|
|
26
33
|
name: string;
|
|
27
|
-
}): ResolvedPersona;
|
|
34
|
+
}, warnings?: string[]): ResolvedPersona;
|
|
28
35
|
export declare function personaToDirectives(persona: ResolvedPersona): PersonaDirectives;
|
|
29
|
-
/**
|
|
30
|
-
* Render the persona section injected into an actor prompt. Replaces the bare
|
|
31
|
-
* `Persona: <name>.` line so the persona's friction tolerance, skill, and
|
|
32
|
-
* accessibility behavior actually shape the run. Returns a single space-joined
|
|
33
|
-
* string to match the existing prompt-builder style.
|
|
34
|
-
*/
|
|
35
36
|
export declare function renderPersonaPromptSection(persona: ResolvedPersona): string;
|
|
37
|
+
/** Only the authored persona section; excludes task criteria, runtime grants and inbox URLs. */
|
|
38
|
+
export declare function personaBrief(persona: ResolvedPersona, scrub?: (text: string) => string): NonNullable<ActorPersonaRef["brief"]>;
|
|
39
|
+
export declare function scrubPersonaBrief(persona: ActorPersonaRef, scrub: (text: string) => string): ActorPersonaRef;
|
package/dist/persona.js
CHANGED
|
@@ -1,141 +1,144 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// directive tells the actor when, in character, to stop and report the friction.
|
|
7
|
-
const LEVELS = ["low", "medium", "high"];
|
|
8
|
-
function normalizeLevel(value, fallback = "medium") {
|
|
9
|
-
if (typeof value === "string") {
|
|
10
|
-
const lowered = value.trim().toLowerCase();
|
|
11
|
-
if (LEVELS.includes(lowered)) {
|
|
12
|
-
return lowered;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return fallback;
|
|
16
|
-
}
|
|
17
|
-
// Persona files are committed public-safe source, but they still flow into an
|
|
18
|
-
// actor prompt, so replace control characters with spaces and cap length to
|
|
19
|
-
// limit prompt-injection surface from a hand-authored persona.
|
|
20
|
-
function stripControlChars(value) {
|
|
21
|
-
let out = "";
|
|
22
|
-
for (const ch of value) {
|
|
23
|
-
const code = ch.codePointAt(0) ?? 0;
|
|
24
|
-
out += code < 0x20 || code === 0x7f ? " " : ch;
|
|
25
|
-
}
|
|
26
|
-
return out;
|
|
27
|
-
}
|
|
28
|
-
function sanitizePersonaText(value, maxLength) {
|
|
29
|
-
if (typeof value !== "string") {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const cleaned = stripControlChars(value)
|
|
33
|
-
// Neutralize the actor verdict/nonce markers so persona text injected into a
|
|
34
|
-
// prompt cannot forge a verdict line an actor might echo back.
|
|
35
|
-
.replace(/HUMANISH_ACTOR_(?:VERDICT|NONCE)/gi, "HUMANISH_ACTOR_[neutralized]")
|
|
36
|
-
.replace(/\s+/g, " ")
|
|
37
|
-
.trim();
|
|
38
|
-
if (cleaned.length === 0) {
|
|
39
|
-
return undefined;
|
|
40
|
-
}
|
|
41
|
-
return cleaned.length > maxLength ? `${cleaned.slice(0, maxLength - 1)}…` : cleaned;
|
|
1
|
+
import { digestText, redactText } from "./redaction.js";
|
|
2
|
+
export const PERSONA_BACKGROUND_MAX_BYTES = 32 * 1024;
|
|
3
|
+
export const PERSONA_COMPILER_VERSION = 2;
|
|
4
|
+
export class PersonaConfigError extends Error {
|
|
5
|
+
constructor(message) { super(message); this.name = "PersonaConfigError"; }
|
|
42
6
|
}
|
|
7
|
+
const LEVELS = ["low", "medium", "high"];
|
|
8
|
+
const PERSONA_FIELDS = new Set(["schema", "id", "name", "summary", "background", "traits", "constraints"]);
|
|
9
|
+
const TRAIT_FIELDS = new Set(["patience", "technical_confidence", "accessibility_needs"]);
|
|
43
10
|
function isRecord(value) {
|
|
44
11
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45
12
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
13
|
+
function cleanText(value) {
|
|
14
|
+
return value.replace(/\r\n?/g, "\n").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, " ")
|
|
15
|
+
.replace(/HUMANISH_ACTOR_(?:VERDICT|NONCE)/gi, "HUMANISH_ACTOR_[neutralized]").trim();
|
|
16
|
+
}
|
|
17
|
+
/** Legacy short fields keep their bounds, but every discarded value is diagnosed. */
|
|
18
|
+
export function parseResolvedPersona(raw, fallback, warnings = []) {
|
|
51
19
|
const record = isRecord(raw) ? raw : {};
|
|
52
20
|
const traits = isRecord(record.traits) ? record.traits : {};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
.
|
|
62
|
-
|
|
21
|
+
if (!isRecord(raw))
|
|
22
|
+
warnings.push("Persona must be a mapping; using the legacy defaults.");
|
|
23
|
+
for (const field of Object.keys(record)) {
|
|
24
|
+
if (!PERSONA_FIELDS.has(field))
|
|
25
|
+
warnings.push(`Unsupported persona field ${redactText(JSON.stringify(field))}; it is not sent to the participant. Use background for relevant context.`);
|
|
26
|
+
}
|
|
27
|
+
for (const field of Object.keys(traits)) {
|
|
28
|
+
if (!TRAIT_FIELDS.has(field))
|
|
29
|
+
warnings.push(`Unsupported persona trait ${redactText(JSON.stringify(field))}; it is not sent to the participant.`);
|
|
30
|
+
}
|
|
31
|
+
const short = (value, max, field) => {
|
|
32
|
+
if (value === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
if (typeof value !== "string") {
|
|
35
|
+
warnings.push(`${field} must be text; ignored.`);
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const cleaned = cleanText(value).replace(/\s+/g, " ");
|
|
39
|
+
if (!cleaned)
|
|
40
|
+
return undefined;
|
|
41
|
+
if (cleaned.length > max)
|
|
42
|
+
warnings.push(`${field} exceeds ${max} characters and was shortened; move detailed context to background.`);
|
|
43
|
+
return cleaned.length > max ? `${cleaned.slice(0, max - 1)}…` : cleaned;
|
|
44
|
+
};
|
|
45
|
+
let background;
|
|
46
|
+
if (record.background !== undefined) {
|
|
47
|
+
if (typeof record.background !== "string")
|
|
48
|
+
throw new PersonaConfigError("Persona background must be text.");
|
|
49
|
+
background = cleanText(record.background);
|
|
50
|
+
if (!background)
|
|
51
|
+
throw new PersonaConfigError("Persona background must not be empty.");
|
|
52
|
+
if (Buffer.byteLength(record.background, "utf8") > PERSONA_BACKGROUND_MAX_BYTES || Buffer.byteLength(background, "utf8") > PERSONA_BACKGROUND_MAX_BYTES) {
|
|
53
|
+
throw new PersonaConfigError(`Persona background exceeds ${PERSONA_BACKGROUND_MAX_BYTES} UTF-8 bytes; shorten it explicitly. No background was truncated.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const level = (field) => {
|
|
57
|
+
const value = traits[field];
|
|
58
|
+
const normalized = typeof value === "string" ? value.trim().toLowerCase() : undefined;
|
|
59
|
+
if (LEVELS.includes(normalized))
|
|
60
|
+
return normalized;
|
|
61
|
+
if (value !== undefined)
|
|
62
|
+
warnings.push(`traits.${field} must be low, medium or high; ${background ? "ignored" : "using medium"}.`);
|
|
63
|
+
return background ? undefined : "medium";
|
|
64
|
+
};
|
|
65
|
+
if (record.traits !== undefined && !isRecord(record.traits))
|
|
66
|
+
warnings.push("Persona traits must be a mapping; invalid traits ignored.");
|
|
67
|
+
if (background && Object.keys(traits).some(field => field === "patience" || field === "technical_confidence")) {
|
|
68
|
+
warnings.push("Background and explicit trait directives are both sent to the participant. Review the brief for conflicting instructions; prose conflicts are not automatically detected.");
|
|
69
|
+
}
|
|
70
|
+
let accessibilityNeeds = short(traits.accessibility_needs, 80, "traits.accessibility_needs");
|
|
71
|
+
if (accessibilityNeeds && /^(none[ _-]declared|none|not[ _-]applicable)$/i.test(accessibilityNeeds))
|
|
72
|
+
accessibilityNeeds = undefined;
|
|
73
|
+
if (record.constraints !== undefined && !Array.isArray(record.constraints))
|
|
74
|
+
warnings.push("Persona constraints must be a list; ignored.");
|
|
75
|
+
const allConstraints = Array.isArray(record.constraints) ? record.constraints : [];
|
|
76
|
+
if (allConstraints.length > 8)
|
|
77
|
+
warnings.push("Only the first eight persona constraints are used; move detailed context to background.");
|
|
78
|
+
const constraints = allConstraints.slice(0, 8).map(value => short(value, 160, "constraint")).filter((value) => value !== undefined);
|
|
79
|
+
const patience = level("patience"), skill = level("technical_confidence");
|
|
80
|
+
const summary = short(record.summary, 280, "summary");
|
|
63
81
|
return {
|
|
64
|
-
id,
|
|
65
|
-
name,
|
|
82
|
+
id: short(record.id, 120, "id") ?? fallback.id,
|
|
83
|
+
name: short(record.name, 120, "name") ?? fallback.name,
|
|
66
84
|
...(summary === undefined ? {} : { summary }),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
// Persona YAML uses `technical_confidence`; the directive model calls it skill.
|
|
70
|
-
skill: normalizeLevel(traits.technical_confidence),
|
|
71
|
-
...(accessibilityNeeds === undefined ? {} : { accessibilityNeeds })
|
|
72
|
-
},
|
|
85
|
+
...(background === undefined ? {} : { background }),
|
|
86
|
+
traits: { ...(patience === undefined ? {} : { patience }), ...(skill === undefined ? {} : { skill }), ...(accessibilityNeeds === undefined ? {} : { accessibilityNeeds }) },
|
|
73
87
|
constraints
|
|
74
88
|
};
|
|
75
89
|
}
|
|
76
90
|
const FRICTION_TOLERANCE = {
|
|
77
|
-
low: "You are impatient: if you hit repeated friction
|
|
78
|
-
medium: "You have moderate patience: work through some friction, but
|
|
79
|
-
high: "You are determined:
|
|
91
|
+
low: "You are impatient: if you hit repeated friction or stop making progress toward your goal, you are likely to stop. Describe what you actually encountered.",
|
|
92
|
+
medium: "You have moderate patience: you will work through some friction, but may stop if further effort no longer seems worthwhile.",
|
|
93
|
+
high: "You are determined: you are willing to spend effort on recovery when the goal matters to you, but may stop at an unrecoverable dead-end."
|
|
80
94
|
};
|
|
81
|
-
// Skill describes how COMPETENTLY an actor works the surfaces its population actually uses — it
|
|
82
|
-
// must not name an affordance that escapes those surfaces. The `high` directive used to say
|
|
83
|
-
// "inspect configuration, and try the recovery paths an expert would", which a computer-use actor
|
|
84
|
-
// can honestly read as license to open devtools or type a `javascript:` URL: a human-persona run
|
|
85
|
-
// then routes around the very friction the study exists to measure and still returns green. Skill
|
|
86
|
-
// is now modality-neutral (an expert human uses advanced UI and settings; an expert agent uses the
|
|
87
|
-
// documented API), so which affordances are in scope is a property of the declared population,
|
|
88
|
-
// not a side effect of a trait table.
|
|
89
95
|
const SKILL_BIAS = {
|
|
90
|
-
low: "You are not technically confident
|
|
91
|
-
medium: "You have moderate technical confidence
|
|
92
|
-
high: "You are technically confident
|
|
96
|
+
low: "You are not technically confident and generally rely on familiar, visible controls. Describe confusion only when you actually encounter it.",
|
|
97
|
+
medium: "You have moderate technical confidence and generally use straightforward paths through the product.",
|
|
98
|
+
high: "You are technically confident and comfortable with keyboard shortcuts and advanced options on the surfaces this product gives you."
|
|
93
99
|
};
|
|
94
100
|
function accessibilityBehavior(needs) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
return "You rely on clear terminal output
|
|
101
|
-
}
|
|
102
|
-
return `You have the accessibility need "${needs}"; treat violations of it as defects and report them.`;
|
|
101
|
+
if (/keyboard[ _-]first/i.test(needs))
|
|
102
|
+
return "You prefer keyboard navigation, but can use a pointer when needed. Describe any difficulty you encounter switching between them.";
|
|
103
|
+
if (/keyboard[ _-]only/i.test(needs))
|
|
104
|
+
return "You can only use the keyboard. If an essential control has no discoverable keyboard path, describe where you could not proceed.";
|
|
105
|
+
if (/terminal|output/i.test(needs))
|
|
106
|
+
return "You rely on clear terminal output. Describe any difficulty understanding the output you actually encounter.";
|
|
107
|
+
return `Your accessibility requirement is: ${needs}. Use the available interface within this requirement and describe any difficulty you encounter.`;
|
|
103
108
|
}
|
|
104
109
|
export function personaToDirectives(persona) {
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (persona.
|
|
110
|
-
traitsApplied.push(`accessibility:${persona.traits.accessibilityNeeds}`);
|
|
111
|
-
}
|
|
112
|
-
if (persona.constraints.length > 0) {
|
|
110
|
+
const { patience, skill, accessibilityNeeds } = persona.traits;
|
|
111
|
+
const traitsApplied = [...(patience ? [`patience:${patience}`] : []), ...(skill ? [`skill:${skill}`] : [])];
|
|
112
|
+
if (accessibilityNeeds)
|
|
113
|
+
traitsApplied.push(`accessibility:${accessibilityNeeds}`);
|
|
114
|
+
if (persona.constraints.length)
|
|
113
115
|
traitsApplied.push(`constraints:${persona.constraints.length}`);
|
|
114
|
-
}
|
|
115
116
|
return {
|
|
116
|
-
frictionTolerance: FRICTION_TOLERANCE[
|
|
117
|
-
skillBias: SKILL_BIAS[
|
|
118
|
-
...(
|
|
119
|
-
constraints: persona.constraints,
|
|
120
|
-
traitsApplied
|
|
117
|
+
frictionTolerance: patience ? FRICTION_TOLERANCE[patience] : "",
|
|
118
|
+
skillBias: skill ? SKILL_BIAS[skill] : "",
|
|
119
|
+
...(accessibilityNeeds ? { accessibilityBehavior: accessibilityBehavior(accessibilityNeeds) } : {}),
|
|
120
|
+
constraints: persona.constraints, traitsApplied
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
|
-
/**
|
|
124
|
-
* Render the persona section injected into an actor prompt. Replaces the bare
|
|
125
|
-
* `Persona: <name>.` line so the persona's friction tolerance, skill, and
|
|
126
|
-
* accessibility behavior actually shape the run. Returns a single space-joined
|
|
127
|
-
* string to match the existing prompt-builder style.
|
|
128
|
-
*/
|
|
129
123
|
export function renderPersonaPromptSection(persona) {
|
|
130
124
|
const directives = personaToDirectives(persona);
|
|
131
|
-
|
|
132
|
-
`Persona: ${persona.name}.`,
|
|
133
|
-
|
|
134
|
-
directives.frictionTolerance,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
125
|
+
return [
|
|
126
|
+
`Persona: ${persona.name}.`, persona.summary,
|
|
127
|
+
persona.background ? `Background:\n${persona.background}` : undefined,
|
|
128
|
+
directives.frictionTolerance, directives.skillBias, directives.accessibilityBehavior,
|
|
129
|
+
persona.constraints.length ? `Honor these constraints: ${persona.constraints.join("; ")}.` : undefined
|
|
130
|
+
].filter(Boolean).join("\n\n");
|
|
131
|
+
}
|
|
132
|
+
/** Only the authored persona section; excludes task criteria, runtime grants and inbox URLs. */
|
|
133
|
+
export function personaBrief(persona, scrub = text => text) {
|
|
134
|
+
const original = renderPersonaPromptSection(persona), text = redactText(scrub(original));
|
|
135
|
+
return { compilerVersion: PERSONA_COMPILER_VERSION, text, digest: digestText(original), redacted: text !== original,
|
|
136
|
+
...(persona.sourceDigest ? { sourceDigest: persona.sourceDigest } : {}) };
|
|
137
|
+
}
|
|
138
|
+
export function scrubPersonaBrief(persona, scrub) {
|
|
139
|
+
if (!persona.brief)
|
|
140
|
+
return persona;
|
|
141
|
+
const text = redactText(scrub(persona.brief.text));
|
|
142
|
+
return { ...persona, brief: { ...persona.brief, text, redacted: persona.brief.redacted || text !== persona.brief.text } };
|
|
140
143
|
}
|
|
141
144
|
//# sourceMappingURL=persona.js.map
|
package/dist/persona.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persona.js","sourceRoot":"","sources":["../src/persona.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"persona.js","sourceRoot":"","sources":["../src/persona.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,GAAG,IAAI,CAAC;AACtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,OAAe,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC;CACnF;AA0BD,MAAM,MAAM,GAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AACzD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;AAC3G,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,sBAAsB,EAAE,qBAAqB,CAAC,CAAC,CAAC;AAE1F,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,mCAAmC,EAAE,GAAG,CAAC;SACnF,OAAO,CAAC,oCAAoC,EAAE,8BAA8B,CAAC,CAAC,IAAI,EAAE,CAAC;AAC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E,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,KAAK,QAAQ;QACjH,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAwB,EAAE,KAA+B;IACzF,IAAI,CAAC,OAAO,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC;IACnC,MAAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,OAAO,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,KAAK,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;AAC5H,CAAC"}
|
package/dist/program.js
CHANGED
|
@@ -3696,6 +3696,7 @@ function formatLabInspectHuman(result) {
|
|
|
3696
3696
|
...(result.path ? [`path: ${result.path}`] : []),
|
|
3697
3697
|
...(result.origin ? [`origin: ${result.origin}`] : []),
|
|
3698
3698
|
...(config.subject.repos?.length ? [`repos: ${config.subject.repos.join(", ")}`] : []),
|
|
3699
|
+
...(result.personas ?? []).map(persona => `persona ${persona.id}: ${persona.brief ? `authored context (before runtime additions)\n${persona.brief.text}` : "unresolved; id only"}`),
|
|
3699
3700
|
...result.warnings.map((warning) => `warning: ${warning}`)
|
|
3700
3701
|
].join("\n") + "\n";
|
|
3701
3702
|
}
|