polymath-society 0.2.20 → 0.2.22

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 (38) hide show
  1. package/dist/cli.js +23943 -21630
  2. package/dist/engine/chat-loops.js +8 -1
  3. package/dist/engine/exp-allfacets.js +8 -1
  4. package/dist/engine/exp-person.js +8 -1
  5. package/dist/engine/exp-pipeline.js +8 -1
  6. package/dist/engine/ingest-export.js +7 -6
  7. package/dist/engine/peak-demos.js +8 -1
  8. package/dist/engine/person-dimension-summary.js +8 -1
  9. package/dist/engine/person-facet-lines.js +8 -1
  10. package/dist/engine/person-headline.js +8 -1
  11. package/dist/engine/person-report.js +8 -1
  12. package/dist/engine/person-self-image.js +8 -1
  13. package/dist/engine/public-report.js +15 -7
  14. package/dist/engine/run-analysis.js +8 -1
  15. package/dist/engine/run-tagger.js +8 -1
  16. package/dist/index.js +19647 -17969
  17. package/dist/pipeline/coding-agglomerate.js +826 -82
  18. package/dist/pipeline/coding-aggregate.js +307 -23
  19. package/dist/pipeline/coding-build.js +453 -95
  20. package/dist/pipeline/coding-coaching.js +479 -88
  21. package/dist/pipeline/coding-day-digest.js +308 -36
  22. package/dist/pipeline/coding-delegation.js +376 -52
  23. package/dist/pipeline/coding-expertise.js +356 -62
  24. package/dist/pipeline/coding-flow.js +288 -15
  25. package/dist/pipeline/coding-focus.js +371 -51
  26. package/dist/pipeline/coding-frontier-detail.js +344 -50
  27. package/dist/pipeline/coding-frontier.js +7 -6
  28. package/dist/pipeline/coding-gap-dist.js +288 -15
  29. package/dist/pipeline/coding-gap.js +507 -115
  30. package/dist/pipeline/coding-grade.js +342 -45
  31. package/dist/pipeline/coding-growth.js +17041 -0
  32. package/dist/pipeline/coding-nutshell.js +15 -7
  33. package/dist/pipeline/coding-projects.js +7 -6
  34. package/dist/pipeline/coding-walkthrough.js +317 -37
  35. package/dist/pipeline/coding-workbrief.js +16387 -0
  36. package/dist/web/app.js +2095 -1395
  37. package/dist/web/styles.css +1 -1
  38. package/package.json +1 -1
@@ -134,13 +134,13 @@ var require_secure_json_parse = __commonJS({
134
134
  });
135
135
 
136
136
  // ../../scripts/coding-agglomerate.mts
137
- import { promises as fs8 } from "fs";
138
- import path12 from "path";
137
+ import { promises as fs9 } from "fs";
138
+ import path13 from "path";
139
139
 
140
140
  // ../../lib/agents/coding/agglomerate.ts
141
- import { promises as fs7 } from "fs";
142
- import os2 from "os";
143
- import path10 from "path";
141
+ import { promises as fs8 } from "fs";
142
+ import os3 from "os";
143
+ import path11 from "path";
144
144
 
145
145
  // ../../lib/agents/shared/agent.ts
146
146
  import { readFileSync } from "fs";
@@ -508,6 +508,13 @@ ${report}`);
508
508
  }
509
509
 
510
510
  // ../../lib/agents/shared/codexAdapter.ts
511
+ var CODEX_DEFAULT_MODEL = "gpt-5.5";
512
+ var CODEX_MINI_MODEL = "gpt-5.4-mini";
513
+ function mapCodexTier(model2, env = process.env) {
514
+ if (model2 && !/^(claude|haiku|sonnet|opus)/i.test(model2)) return model2;
515
+ if (model2 && /^haiku/i.test(model2)) return env.POLYMATH_CODEX_MODEL_MINI || CODEX_MINI_MODEL;
516
+ return env.POLYMATH_CODEX_MODEL || CODEX_DEFAULT_MODEL;
517
+ }
511
518
  function composePrompt(inv, roots) {
512
519
  return [
513
520
  inv.systemPrompt ? `<system>
@@ -548,7 +555,7 @@ var codexAdapter = {
548
555
  "read-only",
549
556
  "--json"
550
557
  ];
551
- if (inv.model && !/^claude/i.test(inv.model)) args.push("--model", inv.model);
558
+ args.push("--model", mapCodexTier(inv.model));
552
559
  args.push(composePrompt(inv, roots));
553
560
  const started = Date.now();
554
561
  const toolCalls = [];
@@ -2176,8 +2183,8 @@ function getErrorMap() {
2176
2183
 
2177
2184
  // ../../node_modules/zod/v3/helpers/parseUtil.js
2178
2185
  var makeIssue = (params) => {
2179
- const { data, path: path13, errorMaps, issueData } = params;
2180
- const fullPath = [...path13, ...issueData.path || []];
2186
+ const { data, path: path14, errorMaps, issueData } = params;
2187
+ const fullPath = [...path14, ...issueData.path || []];
2181
2188
  const fullIssue = {
2182
2189
  ...issueData,
2183
2190
  path: fullPath
@@ -2293,11 +2300,11 @@ var errorUtil;
2293
2300
 
2294
2301
  // ../../node_modules/zod/v3/types.js
2295
2302
  var ParseInputLazyPath = class {
2296
- constructor(parent, value, path13, key) {
2303
+ constructor(parent, value, path14, key) {
2297
2304
  this._cachedPath = [];
2298
2305
  this.parent = parent;
2299
2306
  this.data = value;
2300
- this._path = path13;
2307
+ this._path = path14;
2301
2308
  this._key = key;
2302
2309
  }
2303
2310
  get path() {
@@ -15084,39 +15091,39 @@ function createOpenAI(options = {}) {
15084
15091
  });
15085
15092
  const createChatModel = (modelId, settings = {}) => new OpenAIChatLanguageModel(modelId, settings, {
15086
15093
  provider: `${providerName}.chat`,
15087
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15094
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15088
15095
  headers: getHeaders,
15089
15096
  compatibility,
15090
15097
  fetch: options.fetch
15091
15098
  });
15092
15099
  const createCompletionModel = (modelId, settings = {}) => new OpenAICompletionLanguageModel(modelId, settings, {
15093
15100
  provider: `${providerName}.completion`,
15094
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15101
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15095
15102
  headers: getHeaders,
15096
15103
  compatibility,
15097
15104
  fetch: options.fetch
15098
15105
  });
15099
15106
  const createEmbeddingModel = (modelId, settings = {}) => new OpenAIEmbeddingModel(modelId, settings, {
15100
15107
  provider: `${providerName}.embedding`,
15101
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15108
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15102
15109
  headers: getHeaders,
15103
15110
  fetch: options.fetch
15104
15111
  });
15105
15112
  const createImageModel = (modelId, settings = {}) => new OpenAIImageModel(modelId, settings, {
15106
15113
  provider: `${providerName}.image`,
15107
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15114
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15108
15115
  headers: getHeaders,
15109
15116
  fetch: options.fetch
15110
15117
  });
15111
15118
  const createTranscriptionModel = (modelId) => new OpenAITranscriptionModel(modelId, {
15112
15119
  provider: `${providerName}.transcription`,
15113
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15120
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15114
15121
  headers: getHeaders,
15115
15122
  fetch: options.fetch
15116
15123
  });
15117
15124
  const createSpeechModel = (modelId) => new OpenAISpeechModel(modelId, {
15118
15125
  provider: `${providerName}.speech`,
15119
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15126
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15120
15127
  headers: getHeaders,
15121
15128
  fetch: options.fetch
15122
15129
  });
@@ -15137,7 +15144,7 @@ function createOpenAI(options = {}) {
15137
15144
  const createResponsesModel = (modelId) => {
15138
15145
  return new OpenAIResponsesLanguageModel(modelId, {
15139
15146
  provider: `${providerName}.responses`,
15140
- url: ({ path: path13 }) => `${baseURL}${path13}`,
15147
+ url: ({ path: path14 }) => `${baseURL}${path14}`,
15141
15148
  headers: getHeaders,
15142
15149
  fetch: options.fetch
15143
15150
  });
@@ -15777,19 +15784,20 @@ var GRADED_CRITERIA = CODING_CRITERIA.filter((c) => c.graded);
15777
15784
  var RUBRIC_FINGERPRINT = rubricFingerprint(GRADED_CRITERIA);
15778
15785
 
15779
15786
  // ../../lib/agents/coding/docsDir.ts
15780
- import { promises as fs5 } from "fs";
15781
- import path9 from "path";
15787
+ import { promises as fs6 } from "fs";
15788
+ import path10 from "path";
15782
15789
 
15783
15790
  // ../../lib/agents/coding/materialize.ts
15784
- import { promises as fs4 } from "fs";
15791
+ import { promises as fs5 } from "fs";
15785
15792
 
15786
15793
  // ../coding-core/dist/injected.js
15794
+ var SYSTEM_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
15787
15795
  function isHarnessEntry(e) {
15788
15796
  return e.isMeta === true || e.isCompactSummary === true;
15789
15797
  }
15790
15798
 
15791
15799
  // ../coding-core/dist/codex.js
15792
- var SYSTEM_REMINDER_RE = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
15800
+ var SYSTEM_REMINDER_RE2 = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
15793
15801
  var CODEX_INJECTED_TEXT_RE = /^\s*(<(environment_context|user_instructions|ENVIRONMENT_CONTEXT|turn_aborted)\b|#\s*AGENTS\.md instructions\b)/;
15794
15802
  function isCodexInjectedUserText(text2) {
15795
15803
  return CODEX_INJECTED_TEXT_RE.test(text2);
@@ -15852,7 +15860,7 @@ function extractCodexEvents(raw) {
15852
15860
  const ptype = p.type;
15853
15861
  if (ptype === "message") {
15854
15862
  const role = p.role;
15855
- const text2 = codexContentText(p.content).replace(SYSTEM_REMINDER_RE, "").trim();
15863
+ const text2 = codexContentText(p.content).replace(SYSTEM_REMINDER_RE2, "").trim();
15856
15864
  if (!text2)
15857
15865
  continue;
15858
15866
  if (role === "user") {
@@ -15879,8 +15887,288 @@ function extractCodexEvents(raw) {
15879
15887
  return out;
15880
15888
  }
15881
15889
 
15890
+ // ../coding-core/dist/cursor.js
15891
+ import { promises as fs4 } from "fs";
15892
+ var NODE_SQLITE = "node:sqlite";
15893
+ async function openCursorSqlite(dbPath) {
15894
+ try {
15895
+ await fs4.access(dbPath);
15896
+ } catch {
15897
+ return null;
15898
+ }
15899
+ let mod;
15900
+ try {
15901
+ mod = await import(NODE_SQLITE);
15902
+ } catch {
15903
+ return null;
15904
+ }
15905
+ const DatabaseSync = mod?.DatabaseSync;
15906
+ if (!DatabaseSync)
15907
+ return null;
15908
+ let db;
15909
+ try {
15910
+ db = new DatabaseSync(dbPath, { readOnly: true });
15911
+ } catch {
15912
+ try {
15913
+ db = new DatabaseSync(dbPath);
15914
+ } catch {
15915
+ return null;
15916
+ }
15917
+ }
15918
+ const asText = (v) => v == null ? null : typeof v === "string" ? v : Buffer.from(v).toString("utf-8");
15919
+ return {
15920
+ prefix(prefix) {
15921
+ try {
15922
+ const rows = db.prepare("SELECT key, value FROM cursorDiskKV WHERE key LIKE ? ESCAPE '\\'").all(likePrefix(prefix));
15923
+ return rows.map((r) => ({ key: r.key, value: asText(r.value) ?? "" }));
15924
+ } catch {
15925
+ return [];
15926
+ }
15927
+ },
15928
+ get(key) {
15929
+ try {
15930
+ const row = db.prepare("SELECT value FROM cursorDiskKV WHERE key = ?").get(key);
15931
+ return row ? asText(row.value) : null;
15932
+ } catch {
15933
+ return null;
15934
+ }
15935
+ },
15936
+ close() {
15937
+ try {
15938
+ db.close();
15939
+ } catch {
15940
+ }
15941
+ }
15942
+ };
15943
+ }
15944
+ function likePrefix(prefix) {
15945
+ return prefix.replace(/[\\%_]/g, (c) => "\\" + c) + "%";
15946
+ }
15947
+ var CURSOR_USER_QUERY_RE = /<user_query>\s*([\s\S]*?)\s*<\/user_query>/;
15948
+ function cleanUserText(raw) {
15949
+ let t = raw.replace(SYSTEM_REMINDER_RE, "");
15950
+ const m = t.match(CURSOR_USER_QUERY_RE);
15951
+ if (m)
15952
+ t = m[1];
15953
+ return t.trim();
15954
+ }
15955
+ var msFrom = (v) => {
15956
+ if (typeof v === "number" && Number.isFinite(v))
15957
+ return v;
15958
+ if (typeof v === "string") {
15959
+ const n = Date.parse(v);
15960
+ return Number.isFinite(n) ? n : null;
15961
+ }
15962
+ return null;
15963
+ };
15964
+ function readCursorComposer(db, composerId) {
15965
+ const cdRaw = db.get(`composerData:${composerId}`);
15966
+ if (!cdRaw)
15967
+ return null;
15968
+ let cd;
15969
+ try {
15970
+ cd = JSON.parse(cdRaw);
15971
+ } catch {
15972
+ return null;
15973
+ }
15974
+ const headers = Array.isArray(cd.fullConversationHeadersOnly) ? cd.fullConversationHeadersOnly : [];
15975
+ if (headers.length === 0)
15976
+ return null;
15977
+ const bubbles = /* @__PURE__ */ new Map();
15978
+ for (const row of db.prefix(`bubbleId:${composerId}:`)) {
15979
+ const bid = row.key.slice(`bubbleId:${composerId}:`.length);
15980
+ try {
15981
+ bubbles.set(bid, JSON.parse(row.value));
15982
+ } catch {
15983
+ }
15984
+ }
15985
+ const turns = [];
15986
+ let clock = msFrom(cd.createdAt) ?? 0;
15987
+ for (const h of headers) {
15988
+ const b = bubbles.get(h.bubbleId);
15989
+ if (!b)
15990
+ continue;
15991
+ const type = h.type === 1 ? 1 : 2;
15992
+ const tool2 = type === 2 && b.toolFormerData && typeof b.toolFormerData.name === "string" ? b.toolFormerData.name : null;
15993
+ const rawText = typeof b.text === "string" ? b.text : "";
15994
+ const text2 = type === 1 ? cleanUserText(rawText) : rawText.replace(SYSTEM_REMINDER_RE, "").trim();
15995
+ if (!text2 && !tool2)
15996
+ continue;
15997
+ const t = msFrom(b.createdAt);
15998
+ clock = Math.max(clock, t ?? clock + 1);
15999
+ const model2 = b.modelInfo && typeof b.modelInfo.modelName === "string" ? b.modelInfo.modelName : null;
16000
+ turns.push({ t: clock, type, text: text2, tool: tool2, model: model2 });
16001
+ }
16002
+ if (turns.length === 0)
16003
+ return null;
16004
+ const gitRepo = Array.isArray(cd.trackedGitRepos) && cd.trackedGitRepos[0] && typeof cd.trackedGitRepos[0].repoPath === "string" ? cd.trackedGitRepos[0].repoPath : null;
16005
+ return {
16006
+ composerId,
16007
+ createdAt: msFrom(cd.createdAt),
16008
+ updatedAt: msFrom(cd.lastUpdatedAt),
16009
+ name: typeof cd.name === "string" && cd.name.trim() ? cd.name.trim() : null,
16010
+ gitRepo,
16011
+ turns
16012
+ };
16013
+ }
16014
+ function sniffCursorRaw(raw) {
16015
+ for (const lineRaw of raw.split("\n")) {
16016
+ const line = lineRaw.trim();
16017
+ if (!line)
16018
+ continue;
16019
+ try {
16020
+ const e = JSON.parse(line);
16021
+ return (e.role === "user" || e.role === "assistant") && typeof e.message === "object" && e.message !== null && "content" in e.message && !("type" in e);
16022
+ } catch {
16023
+ return false;
16024
+ }
16025
+ }
16026
+ return false;
16027
+ }
16028
+ function jsonlText(content) {
16029
+ const parts = [];
16030
+ const tools = [];
16031
+ if (Array.isArray(content)) {
16032
+ for (const item of content) {
16033
+ if (!item || typeof item !== "object")
16034
+ continue;
16035
+ const it = item;
16036
+ if (it.type === "text" && it.text)
16037
+ parts.push(it.text);
16038
+ else if (it.type === "tool_use" && it.name)
16039
+ tools.push(it.name);
16040
+ }
16041
+ } else if (typeof content === "string")
16042
+ parts.push(content);
16043
+ return { text: parts.join("\n"), tools };
16044
+ }
16045
+ function parseCursorJsonl(raw, base) {
16046
+ const turns = [];
16047
+ let clock = base;
16048
+ for (const lineRaw of raw.split("\n")) {
16049
+ const line = lineRaw.trim();
16050
+ if (!line)
16051
+ continue;
16052
+ let e;
16053
+ try {
16054
+ e = JSON.parse(line);
16055
+ } catch {
16056
+ continue;
16057
+ }
16058
+ if (e.role !== "user" && e.role !== "assistant")
16059
+ continue;
16060
+ const { text: rawText, tools } = jsonlText(e.message?.content);
16061
+ const type = e.role === "user" ? 1 : 2;
16062
+ const text2 = type === 1 ? cleanUserText(rawText) : rawText.replace(SYSTEM_REMINDER_RE, "").trim();
16063
+ if (type === 2 && tools.length) {
16064
+ for (const tool2 of tools) {
16065
+ clock += 1;
16066
+ turns.push({ t: clock, type: 2, text: "", tool: tool2, model: null });
16067
+ }
16068
+ }
16069
+ if (!text2)
16070
+ continue;
16071
+ clock += 1;
16072
+ turns.push({ t: clock, type, text: text2, tool: null, model: null });
16073
+ }
16074
+ if (turns.length === 0)
16075
+ return null;
16076
+ return { composerId: "", createdAt: base, updatedAt: clock, name: null, gitRepo: null, turns };
16077
+ }
16078
+ var AI_GIST = 500;
16079
+ function renderCursorTranscript(c) {
16080
+ const lines = [];
16081
+ let humanTurns = 0, humanChars = 0;
16082
+ let aiProse = "";
16083
+ const aiTools = /* @__PURE__ */ new Map();
16084
+ const flushAI = () => {
16085
+ if (!aiProse && aiTools.size === 0)
16086
+ return;
16087
+ const tools = [...aiTools.entries()].map(([n, k]) => k > 1 ? `${n}\xD7${k}` : n).join(", ");
16088
+ const gist = aiProse ? aiProse.length > AI_GIST ? aiProse.slice(0, AI_GIST) + "\u2026" : aiProse : "";
16089
+ const bits = [];
16090
+ if (gist)
16091
+ bits.push(gist);
16092
+ if (tools)
16093
+ bits.push(`ran ${tools}`);
16094
+ lines.push(`[AI: ${bits.join(" \xB7 ")}]`);
16095
+ aiProse = "";
16096
+ aiTools.clear();
16097
+ };
16098
+ for (const turn of c.turns) {
16099
+ if (turn.type === 1) {
16100
+ flushAI();
16101
+ humanTurns++;
16102
+ humanChars += turn.text.length;
16103
+ lines.push(`>> ${turn.text}`);
16104
+ } else {
16105
+ if (turn.tool)
16106
+ aiTools.set(turn.tool, (aiTools.get(turn.tool) ?? 0) + 1);
16107
+ if (turn.text)
16108
+ aiProse = turn.text.replace(/\s+/g, " ").trim();
16109
+ }
16110
+ }
16111
+ flushAI();
16112
+ return { text: lines.join("\n"), humanTurns, humanChars };
16113
+ }
16114
+ function composerIdFromFile(file2) {
16115
+ const m = file2.match(/agent-transcripts\/([^/]+)\/[^/]+\.jsonl$/);
16116
+ return m ? m[1] : null;
16117
+ }
16118
+ async function loadCursorComposer(file2, raw, dbPath) {
16119
+ const cid = composerIdFromFile(file2);
16120
+ if (cid && dbPath) {
16121
+ const db = await openCursorSqlite(dbPath);
16122
+ if (db) {
16123
+ try {
16124
+ const c = readCursorComposer(db, cid);
16125
+ if (c)
16126
+ return c;
16127
+ } finally {
16128
+ db.close();
16129
+ }
16130
+ }
16131
+ }
16132
+ return parseCursorJsonl(raw, 0);
16133
+ }
16134
+
16135
+ // ../coding-core/dist/raw.js
16136
+ import path9 from "path";
16137
+ import os2 from "os";
16138
+ var SOURCE_ROOT_ENV_VARS = [
16139
+ "CLAUDE_PROJECTS_DIR",
16140
+ "CODEX_SESSIONS_DIR",
16141
+ "CURSOR_WORKSPACE_DIR",
16142
+ "CURSOR_PROJECTS_DIR",
16143
+ // Cursor's globalStorage dir (holds state.vscdb — the composer bubbles that
16144
+ // carry a Cursor session's real per-turn timestamps + content). Same
16145
+ // isolation contract: overriding any root disables every unset source.
16146
+ "CURSOR_GLOBAL_DIR"
16147
+ ];
16148
+ var anyRootOverridden = () => SOURCE_ROOT_ENV_VARS.some((v) => !!process.env[v]);
16149
+ function resolveSourceRoot(envVar, ...defaultSegments) {
16150
+ const explicit = process.env[envVar];
16151
+ if (explicit)
16152
+ return explicit;
16153
+ if (anyRootOverridden())
16154
+ return null;
16155
+ return path9.join(os2.homedir(), ...defaultSegments);
16156
+ }
16157
+ var cursorGlobalRoot = () => resolveSourceRoot("CURSOR_GLOBAL_DIR", "Library", "Application Support", "Cursor", "User", "globalStorage");
16158
+ function cursorGlobalDbPath() {
16159
+ const root = cursorGlobalRoot();
16160
+ return root === null ? null : path9.join(root, "state.vscdb");
16161
+ }
16162
+ var MACHINE_CURSOR_FILE_RE = /^(.*[/\\]machines[/\\][^/\\]+[/\\]\.cursor)[/\\]projects[/\\]/;
16163
+ function cursorDbPathForFile(file2) {
16164
+ const m = file2.match(MACHINE_CURSOR_FILE_RE);
16165
+ if (m)
16166
+ return path9.join(m[1], "globalStorage", "state.vscdb");
16167
+ return cursorGlobalDbPath();
16168
+ }
16169
+
15882
16170
  // ../../lib/agents/coding/materialize.ts
15883
- var SYSTEM_REMINDER_RE2 = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
16171
+ var SYSTEM_REMINDER_RE3 = /<system-reminder>[\s\S]*?<\/system-reminder>/g;
15884
16172
  var INJECT_GIST = 120;
15885
16173
  var INJECTED = [
15886
16174
  { re: /<task-notification>[\s\S]*?<\/task-notification>/g, label: "bg task", gistRe: /<summary>([\s\S]*?)<\/summary>/ },
@@ -15900,7 +16188,7 @@ function collapseInjected(input) {
15900
16188
  return "";
15901
16189
  });
15902
16190
  }
15903
- return { text: text2.replace(SYSTEM_REMINDER_RE2, "").trim(), markers };
16191
+ return { text: text2.replace(SYSTEM_REMINDER_RE3, "").trim(), markers };
15904
16192
  }
15905
16193
  function extractText(content) {
15906
16194
  if (typeof content === "string") return content;
@@ -15916,7 +16204,7 @@ function extractText(content) {
15916
16204
  function isToolResultOnly(content) {
15917
16205
  return Array.isArray(content) && content.length > 0 && content.every((c) => c && typeof c === "object" && c.type === "tool_result");
15918
16206
  }
15919
- var AI_GIST = 160;
16207
+ var AI_GIST2 = 160;
15920
16208
  function materializeCodex(raw) {
15921
16209
  const lines = [];
15922
16210
  let humanTurns = 0, humanChars = 0;
@@ -15925,7 +16213,7 @@ function materializeCodex(raw) {
15925
16213
  const flushAI = () => {
15926
16214
  if (!aiLastProse && aiTools.size === 0) return;
15927
16215
  const tools = [...aiTools.entries()].map(([n, c]) => c > 1 ? `${n}\xD7${c}` : n).join(", ");
15928
- const gist = aiLastProse ? aiLastProse.length > AI_GIST ? aiLastProse.slice(0, AI_GIST) + "\u2026" : aiLastProse : "";
16216
+ const gist = aiLastProse ? aiLastProse.length > AI_GIST2 ? aiLastProse.slice(0, AI_GIST2) + "\u2026" : aiLastProse : "";
15929
16217
  const bits = [];
15930
16218
  if (gist) bits.push(gist);
15931
16219
  if (tools) bits.push(`ran ${tools}`);
@@ -15949,14 +16237,19 @@ function materializeCodex(raw) {
15949
16237
  flushAI();
15950
16238
  return { text: lines.join("\n"), humanTurns, humanChars };
15951
16239
  }
16240
+ async function materializeCursor(file2, raw) {
16241
+ const composer = await loadCursorComposer(file2, raw, cursorDbPathForFile(file2));
16242
+ return composer ? renderCursorTranscript(composer) : { text: "", humanTurns: 0, humanChars: 0 };
16243
+ }
15952
16244
  async function materializeSession(file2) {
15953
16245
  let raw;
15954
16246
  try {
15955
- raw = await fs4.readFile(file2, "utf-8");
16247
+ raw = await fs5.readFile(file2, "utf-8");
15956
16248
  } catch {
15957
16249
  return null;
15958
16250
  }
15959
16251
  if (sniffCodexRaw(raw)) return materializeCodex(raw);
16252
+ if (sniffCursorRaw(raw)) return materializeCursor(file2, raw);
15960
16253
  const lines = [];
15961
16254
  let humanTurns = 0, humanChars = 0;
15962
16255
  const pendingQueued = [];
@@ -15969,7 +16262,7 @@ async function materializeSession(file2) {
15969
16262
  const flushAI = () => {
15970
16263
  if (!aiLastProse && aiTools.size === 0) return;
15971
16264
  const tools = [...aiTools.entries()].map(([n, c]) => c > 1 ? `${n}\xD7${c}` : n).join(", ");
15972
- const gist = aiLastProse ? aiLastProse.length > AI_GIST ? aiLastProse.slice(0, AI_GIST) + "\u2026" : aiLastProse : "";
16265
+ const gist = aiLastProse ? aiLastProse.length > AI_GIST2 ? aiLastProse.slice(0, AI_GIST2) + "\u2026" : aiLastProse : "";
15973
16266
  const bits = [];
15974
16267
  if (gist) bits.push(gist);
15975
16268
  if (tools) bits.push(`ran ${tools}`);
@@ -16049,10 +16342,10 @@ async function materializeSession(file2) {
16049
16342
 
16050
16343
  // ../../lib/agents/coding/docsDir.ts
16051
16344
  async function writeScoreboard(codingDir, docs) {
16052
- const gradesDir = path9.join(codingDir, "grades");
16345
+ const gradesDir = path10.join(codingDir, "grades");
16053
16346
  let files = [];
16054
16347
  try {
16055
- files = (await fs5.readdir(gradesDir)).filter((f) => f.endsWith(".json")).sort();
16348
+ files = (await fs6.readdir(gradesDir)).filter((f) => f.endsWith(".json")).sort();
16056
16349
  } catch {
16057
16350
  return;
16058
16351
  }
@@ -16060,7 +16353,7 @@ async function writeScoreboard(codingDir, docs) {
16060
16353
  for (const f of files) {
16061
16354
  let g;
16062
16355
  try {
16063
- g = JSON.parse(await fs5.readFile(path9.join(gradesDir, f), "utf8"));
16356
+ g = JSON.parse(await fs6.readFile(path10.join(gradesDir, f), "utf8"));
16064
16357
  } catch {
16065
16358
  continue;
16066
16359
  }
@@ -16076,8 +16369,8 @@ async function writeScoreboard(codingDir, docs) {
16076
16369
  ([key, rows]) => `## ${key}
16077
16370
  ${rows.sort((a, b) => b.s - a.s).map((r) => r.line).join("\n")}`
16078
16371
  );
16079
- await fs5.writeFile(
16080
- path9.join(docs, "_scoreboard.md"),
16372
+ await fs6.writeFile(
16373
+ path10.join(docs, "_scoreboard.md"),
16081
16374
  `# Scoreboard \u2014 every graded session per criterion, best first.
16082
16375
  # Lx~ = estimate. Format: level \xB7 date \xB7 title \xB7 sessionId \u2014 graded instance.
16083
16376
 
@@ -16086,24 +16379,24 @@ ${blocks.join("\n\n")}
16086
16379
  );
16087
16380
  }
16088
16381
  async function ensureCodingDocs(codingDir, sessions) {
16089
- const docs = path9.join(codingDir, "docs");
16090
- await fs5.mkdir(docs, { recursive: true });
16382
+ const docs = path10.join(codingDir, "docs");
16383
+ await fs6.mkdir(docs, { recursive: true });
16091
16384
  const user = sessions.filter((s) => s.sessionId && !s.duplicateOf && (!("klass" in s) || s.klass === "interactive"));
16092
16385
  let written = 0;
16093
16386
  for (const s of user) {
16094
- const out = path9.join(docs, `${s.sessionId}.txt`);
16387
+ const out = path10.join(docs, `${s.sessionId}.txt`);
16095
16388
  try {
16096
- await fs5.access(out);
16389
+ await fs6.access(out);
16097
16390
  continue;
16098
16391
  } catch {
16099
16392
  }
16100
16393
  const mat = await materializeSession(s.file).catch(() => null);
16101
16394
  if (!mat?.text) continue;
16102
- await fs5.writeFile(out, mat.text);
16395
+ await fs6.writeFile(out, mat.text);
16103
16396
  written++;
16104
16397
  }
16105
16398
  const rows = user.sort((a, b) => (a.start ?? "") < (b.start ?? "") ? -1 : 1).map((s) => `${(s.start ?? "").slice(0, 10)} \xB7 ${(s.title ?? "").replace(/\n.*/s, "").slice(0, 80)} \xB7 ${s.sessionId}`);
16106
- await fs5.writeFile(path9.join(docs, "_map.md"), rows.join("\n") + "\n");
16399
+ await fs6.writeFile(path10.join(docs, "_map.md"), rows.join("\n") + "\n");
16107
16400
  await writeScoreboard(codingDir, docs);
16108
16401
  if (written) console.log(`[docs] materialized ${written} new transcript(s) \u2192 ${docs}`);
16109
16402
  return docs;
@@ -16116,7 +16409,7 @@ SOURCE LOOKUP \u2014 you have Read/Grep/Glob over the working directory, which h
16116
16409
 
16117
16410
  // ../../lib/agents/coding/promptCache.ts
16118
16411
  import { createHash as createHash2 } from "crypto";
16119
- import { promises as fs6 } from "fs";
16412
+ import { promises as fs7 } from "fs";
16120
16413
  function promptSha(parts) {
16121
16414
  const h = createHash2("sha256");
16122
16415
  for (const p of parts) {
@@ -16127,58 +16420,486 @@ function promptSha(parts) {
16127
16420
  }
16128
16421
  async function reusableOutput(outPath, sha, valid, key = "promptSha") {
16129
16422
  try {
16130
- const o = JSON.parse(await fs6.readFile(outPath, "utf8"));
16423
+ const o = JSON.parse(await fs7.readFile(outPath, "utf8"));
16131
16424
  if (o[key] === sha && valid(o)) return o;
16132
16425
  } catch {
16133
16426
  }
16134
16427
  return null;
16135
16428
  }
16136
16429
 
16430
+ // ../../lib/agents/coding/titles.ts
16431
+ function cleanSessionTitle(raw) {
16432
+ let s = String(raw ?? "");
16433
+ s = s.replace(/<[a-z][\w-]*(\s[^>]*)?(>|$)/gi, " ");
16434
+ s = s.replace(/\b(name|path|src)=("[^"]*("|$)|\[[^\]]*(\]|$)|\S+)/gi, " ");
16435
+ s = s.replace(/\s+/g, " ").trim().replace(/^[·:;,.\-—\s]+/, "").trim();
16436
+ return s || "untitled session";
16437
+ }
16438
+
16439
+ // ../../lib/agents/engine/lenses/reasoning.ts
16440
+ var reasoningLens = {
16441
+ key: "reasoning",
16442
+ label: "Observed reasoning",
16443
+ intro: "It judges how this person's thinking MOVES in raw, real-time transcripts: their raw reasoning ability, whether they choose the right things to work on, whether they resist their own biases, and how they explain wins and setbacks. Built only from visible moves \u2014 never a claim about IQ.",
16444
+ gateLabel: "CONTENT DIFFICULTY",
16445
+ gateLadder: ` 3 \u2014 everyday practical matter (logistics, how-to, routine decisions)
16446
+ 5 \u2014 requires holding a multi-part model in mind (a system with interacting parts)
16447
+ 7 \u2014 open conceptual question on which informed people genuinely disagree
16448
+ 9 \u2014 frontier question without expert consensus
16449
+ 11 \u2014 a recognized open problem`,
16450
+ processNote: "COMPRESSION SPEED \u2014 live transcripts show what polished work hides: how directly the person moved from meeting hard material to its underlying principle (turns/steps, not word count). First contact is a bonus signal for raw ability, never required.",
16451
+ selectHint: "Pick conversations where the person is ENGAGING WITH NEW, HARD MATERIAL \u2014 encountering a concept, theory, or domain they are LEARNING (an unfamiliar idea in science, math, philosophy, economics, a technical system) and visibly thinking hard about it: questioning it, building a mental model, pushing back, re-deriving it, synthesizing, catching flaws. Reasoning shows most when someone reasons through the UNFAMILIAR \u2014 not when they execute competently in territory they already own. STRONGLY PREFER conversations where a genuinely hard NEW theory or concept is being grappled with and the person is generating their own ideas about it. DEPRIORITIZE (these look substantial but reveal far less reasoning): long strategy/product/planning threads inside their own domain (that is competence, not the reasoning ceiling), debugging/how-to/logistics, and anything personal/emotional/relational. ON LENGTH: depth usually SHOWS UP as length \u2014 the deeper someone goes into a hard topic, the longer the conversation grows (once it is past just a few messages), so among genuinely deep conversations the longer ones are often the richer. But length is a CORRELATE of depth, not a substitute: a long familiar-territory thread is still competence, while a shorter conversation wrestling hard with a NEW concept beats it. Use length to compare AMONG deep conversations, never to pick a shallow-but-long one. JUDGMENT IS THE EXCEPTION TO THE DEPRIORITIZE: the personal/emotional/relational/high-stakes decisions you would skip for reasoning-horsepower are exactly the PRIME evidence for the Judgment facet \u2014 a hard call made under real emotional, ego, or personal pull (love, conflict, insecurity, a relationship or partner decision, a status threat) is where judgment is most visible. Include those conversations; they are deprioritized only for Capability, never for Judgment.",
16452
+ facets: [
16453
+ {
16454
+ key: "capability",
16455
+ name: "Raw reasoning ability",
16456
+ definition: "Thinking horsepower, all in one: how fast they grasp new material, how high a level of abstraction they operate at, what genuinely new things they generate beyond their inputs, and how reliably they catch flaws and edge cases. The gestalt of how good the thinking is \u2014 graded as a ceiling (the level proven across multiple conversations, not one lucky moment). SYNTHESIS AND NEW IDEAS HAPPEN IN EVERY DOMAIN, not only technical ones, and are often fast: seeing a recurring pattern and naming the real issue behind it then the fix, or thinking through something and landing a genuine new epiphany of one's own \u2014 e.g. realizing the non-obvious variable that actually drives an outcome, or collapsing a messy personal or strategic decision to the single factor that truly discriminates. A real insight counts whether the subject is a theory, a startup, or oneself \u2014 judge the cognitive MOVE (was genuinely new understanding generated and reached independently?), never the topic. Do NOT discount reasoning because a conversation looks emotional, personal, or self-reflective; epiphanies about oneself or one's situation are synthesis too. ASKING a genuinely novel, hard-hitting question is itself FIRST-CLASS generation \u2014 equal to producing an answer or a synthesis, not a lesser thing. A cross-domain or reframing question that opens a problem up counts as a new idea even when no full synthesis follows (e.g. lifting a framework from one field to pose a sharp new question in another); a great question does not need an answer attached to count. (Calibration: one sharp novel question shows the generative instinct \u2014 strong, but not the ceiling on its own; doing this as a DEFAULT MODE, repeatedly cutting to the load-bearing question, is the rung-11 pattern-recognition route.) At the top, judge the WHOLE: whether the person is genuinely exceptional at the core of reasoning \u2014 generating new ideas, seeing the load-bearing thing others miss (the pattern-recognition that unearths non-obvious truths), critiquing and overturning their own, and breaking new ground. Being world-class at ANY ONE of these is enough; the rungs are calibration, not a checklist, and a missing sub-move is not a cap. THE ASSISTANT IS THE PERSON'S INSTRUMENT: how much the AI explains, formalizes, or elaborates around the person's move is IRRELEVANT to the grade \u2014 never discount for 'AI-scaffolded', 'guided', 'co-constructed', 'stays within the AI's frames', or the person's small share of the words. ORIGINATION is the only gate: the objection, mechanism, counterexample, synthesis, or reframing question must START in the person; merely ratifying the AI's suggestion is not origination. And multiple independently-originated top-rung moves in one conversation \u2014 or one such move the person drives into their own synthesis \u2014 reach the ceiling together: never average several strong moves down to the rung of any single one.",
16457
+ rungs: [
16458
+ {
16459
+ level: 2,
16460
+ marker: "Can't get off the ground \u2014 doesn't grasp the concept and bails ('forget it'). No completion, no generation. Example: hits a real tradeoff, says 'too complicated', drops it."
16461
+ },
16462
+ {
16463
+ level: 4,
16464
+ marker: "Gets there with effort \u2014 several passes, maybe a wrong model first, loses the thread of fast multi-step arguments, but perseveres and genuinely arrives (often visible excitement when it clicks). Needing passes because the EXPLANATION was bad \u2014 demanding it be made legible \u2014 is not slow uptake; grade the thinker, not the teacher. Example: misapplies a new concept, course-corrects after pushback, lands it."
16465
+ },
16466
+ {
16467
+ level: 6,
16468
+ marker: "Fluent user \u2014 grasps new concepts and uses them correctly later; applies a known framework cleanly in a domain it didn't come from; names the governing pattern when pointed near it. Example: lifts a pricing framework from another industry and applies it correctly to their own."
16469
+ },
16470
+ {
16471
+ level: 7,
16472
+ marker: "Sharp on hard material \u2014 fast uptake; unprompted, collapses a messy situation to its governing principle; asks problem-finding questions that fit the model, or catches a real counterexample when one is there. Example: cuts a tangled strategy debate to 'only X matters', and it's right."
16473
+ },
16474
+ {
16475
+ level: 9,
16476
+ marker: "Generates and breaks \u2014 collapses hard material to first principles fast; produces genuinely new positions, INCLUDING re-deriving cold a result or objection the field considers hard (counts fully even if it already exists in the literature \u2014 the cognitive act is graded, not its novelty to the world); reliably finds the load-bearing flaw \u2014 fast to WHERE an argument fails, not just that it feels off. Example: walks into a theory cold and reconstructs its strongest published objection from their own pushback."
16477
+ },
16478
+ {
16479
+ level: 10,
16480
+ marker: "Builds a new frame \u2014 invents a framing that reorganizes a hard problem at a high level of abstraction; catches loopholes and edge cases live as the discussion moves; carries the new idea to cases the source never covered. The interlocutor supplying facts or formalism on request never caps this \u2014 the person supplies the moves. Example: splits a muddled concept into two clean axes that survive the standard counterexamples (a position the source didn't contain) and applies it to a new case."
16481
+ },
16482
+ {
16483
+ level: 11,
16484
+ marker: "The full live ceiling, CALIBRATED TO THE MEDIUM \u2014 the most a person can show reasoning out loud on hard material. Reached by ANY of these routes alone (you do NOT need more than one, and you do NOT need every sub-move within a route): (c) DENSITY \u2014 SEVERAL independent rung-10 moves in ONE conversation (distinct originated frames, load-bearing flaw-catches, or cold re-derivations of hard results, each clearing rung 10 on its own) IS the ceiling: a person generating top-rung moves repeatedly in a single sitting is exhibiting ceiling capability even if no single move alone would be an 11. NEVER average multiple top-rung moves down to the rung of the best single one. The gate is strict: each counted move must INDEPENDENTLY clear rung 10 \u2014 any number of rung-7/8 moves never aggregates upward. (a) GENERATIVE + CRITICAL LOOP at full power \u2014 generates a novel frame or synthesis the source didn't contain AND drives it: finds the load-bearing flaw, draws out the uncomfortable consequences, and/or figures out things the material never stated. (b) SUPERHUMAN PATTERN-RECOGNITION / LOAD-BEARING INSIGHT \u2014 as a default mode, repeatedly finds the genuinely novel question or thought that is LOAD-BEARING: cuts straight to the deepest assumption, sees what everyone else missed, unearths a non-obvious truth about the world. This is 11 ON ITS OWN \u2014 even with NO engagement with new material, NO synthesis, and NO self-critique. Being world-class at finding what is load-bearing IS the ceiling. A new CONCEPTUAL frame or insight counts fully; inventing fresh formal/mathematical machinery or a publishable theory is NOT required (a research-paper standard, impossible live). The interlocutor supplying facts, names, notation, or sharper precision never caps it. CO-CONSTRUCTION WITH THE AI IS FINE \u2014 thinking WITH the AI as a partner is the medium, not a deduction. The test is whether genuinely NEW things were SYNTHESIZED in the thread (a new frame, insight, or connection), NOT whether the person reached it alone, 'owned' every step, or could have done it without the AI. Do NOT require solo, AI-free authorship. GRADE THE PEAK, NOT THE WHOLE. This rung is cleared by genuine MOMENTS of brilliance \u2014 a real new synthesis, a load-bearing insight, a novel frame the person reached on hard material. It does NOT require that EVERY move be novel, that the generative loop run at full power for the WHOLE conversation, or that the questions be DRIVEN TO RESOLUTION / closed. A conversation can meander, spend stretches on the ordinary, hand threads back open, and still be an 11 on the strength of a few genuine peak moments. Grade the HIGH-WATER MARK of the thinking, not its average and not whether it was carried to completion. Concretely, NONE of these is a cap: (1) the brilliant move ENDS IN AN OPEN QUESTION \u2014 leaving the deepest tension unresolved is fine; the moment of synthesis already happened, resolution is NOT required. (2) the synthesis RECOMBINES EXISTING / IMPORTED frames (e.g. integration-\u03A6 + Deutsch's universal explainers fused into a new two-axis model of a hard problem). Recombining known ideas into a frame the source didn't contain counts FULLY; 'it leans on an existing frame / isn't from-scratch / isn't invented machinery' is NOT a valid cap (same rule as re-derivation \u2014 the cognitive act is graded, not its novelty to the world). (3) do NOT withhold 11 'on caution' or defer it to cross-corpus tempo ('would move to 11 if it holds across weeks'). If THIS conversation contains the peak moment, score it 11 \u2014 the 'proven across conversations, not one lucky moment' caveat is the AGGREGATOR's job (it reads many conversations), never a reason to cap a genuine single-conversation peak at 10. (4) the synthesis was CO-CONSTRUCTED WITH THE AI, or is written up as a condensed SUMMARY/recap. Neither caps it: do NOT hold at 10 because you 'can't tell whether the person or the AI reached it,' or because the move appears in a summary rather than a live derivation. If genuinely new things were synthesized in the thread, that IS the 11 \u2014 provenance-purity (solo, AI-free) is NOT the bar; new synthesis is. Examples: (a) cold on a hard theory, generates a cleaner framing that survives the standard counterexamples and corners the theory into its most uncomfortable commitment; (b) keeps asking the one question that cracks the problem open or names the load-bearing assumption nobody else saw."
16485
+ }
16486
+ ]
16487
+ },
16488
+ {
16489
+ key: "taste",
16490
+ name: "Taste",
16491
+ definition: "An intuitive AESTHETIC SENSIBILITY \u2014 a feel for what is GOOD / beautiful / elegant and what will RESONATE \u2014 AND the ability to ACT on it without running the experiment. The 'art' side of the mind. THE SPINE IS A GRADIENT: DETECT \u2192 PREDICT \u2192 GENERATE, and the positive, GENERATIVE end is the ceiling. Merely detecting that something is off/cringe is the FLOOR of real taste (~7); predicting what will resonate is higher (8-9); GENERATING the thing that actually lands \u2014 the line, the design, the insight that hits \u2014 is the top (10-11). PRIMARY EVIDENCE is the active, vindicated, LED aesthetic call \u2014 a reaction that ORIGINATES in the person (a flinch, 'this is cringe', 'no \u2014 more like this'), where THEY drive the direction. ORIGINATION GATE: passively ratifying the AI's option ('okay, that looks good') is NOT taste, wherever it would otherwise land \u2014 the signal must be sourced by them, not approved. SOUNDNESS: grade whether the call ACTUALLY lands, NOT whether the AI agreed (the assistant folds out of sycophancy, so its agreement is confounded); an outside observer should be able to tell they were right. A confident call that is BAD taste \u2014 shipping the cringe/shiny/conventional version thinking it's great \u2014 is an ANTI-SIGNAL. GENERIC-CORRECTNESS IS NON-EVIDENCE: 'make it cleaner / more professional' \u2014 anything the AI could have gone either way on \u2014 does not count; the call must be specific and load-bearing. THE BAR / CARE raises the read: refusing the mediocre version, pushing it to be 'more and more good', holding a high standard \u2014 i.e. how hard they push toward the top rung. AFFINITY / DIET is a CORROBORATOR AND A FLOOR, NOT the driver (a deliberate flip from a diet-primary reading): the canon they curate and study (design/craft reading, Jobs/Ive/Hara/Zumthor/Rubin \u2014 check Obsidian), the sophistication of their aesthetic reasoning (naming WHY something resonates or falls flat), and self-reported care \u2014 these RAISE CONFIDENCE and set a baseline when no live calls were sampled, but cannot carry the top alone. MEDIUM IS INCIDENTAL: taste surfaces across registers \u2014 visual/design, product-feel, writing/copy, craft/engineering-elegance, curatorial \u2014 and scores the SAME; judge the substance, not the medium. Independently-verifiable great OUTPUT rarely appears on a chat stage, so its absence is a sampling gap, never a cap. Distinct from Judgment (rightness of a decision under pull), Prioritization (choosing what to pursue), and Capability (raw thinking). Boundary vs Abstraction: if the value is 'it LANDS / it resonates', score it here; if the value is 'it's a non-obvious TRUTH', that is Abstraction \u2014 the same move can be evidence for both, scored on its own dimension.",
16492
+ rungs: [
16493
+ { level: 2, marker: "No discernible taste \u2014 can't tell good from mediocre even when it matters; satisfied with whatever's in front of them; preferences purely conventional / shiny-chasing." },
16494
+ { level: 4, marker: "Emerging \u2014 recognizes good from bad mostly only once it's pointed out; ratifies others' / the AI's calls ('looks good') rather than sourcing them; reaches for the safe, conventional version." },
16495
+ { level: 6, marker: "Real but informal \u2014 a genuine sense of quality: reactions originate in them and they recognize the better option WHEN SHOWN it and iterate toward it, but stay reactive (responding to options, not yet generating the direction)." },
16496
+ { level: 7, marker: "Reliable negative sensor \u2014 UNPROMPTED, detects what's off / cringe / mediocre and is RIGHT, before anyone tests it. Real, originated, vindicated taste \u2014 but a NEGATIVE call: names the problem, does not yet produce the better thing. The floor of the high range." },
16497
+ { level: 8, marker: "Begins to lead \u2014 EITHER predicts a better DIRECTION that is right but partial/modest and drives toward it, OR an exceptionally fine, non-obvious cringe-catch beyond a plain 7 (spots what others wouldn't flag as off). Forward simulation starting, but not yet a clean, fully-landed resonance call." },
16498
+ { level: 9, marker: "Predicts resonance and leads it \u2014 names the BETTER DIRECTION before testing ('this way will land', 'this will make them feel seen') and it's RIGHT; forward simulation of reception, not just the alarm; actively drives collaborators / the AI toward it rather than reacting." },
16499
+ { level: 10, marker: "Generates the resonant thing \u2014 produces the actual artifact / line / design / insight that HITS (not 'this is off' but 'here \u2014 this'), at a fine level of discrimination (good\u2192great, not garbage\u2192gold); names the resonant core others miss; holds a high bar and refuses the mediocre version." },
16500
+ { level: 11, marker: "World-class, as a DEFAULT MODE \u2014 repeatedly generates what resonates and cuts straight to what's great with almost no need to experiment; a curated canon, sophisticated aesthetic thinking, and self-reported care converge (each plays a role, none required alone). Produced great work confirms it when present but is rarely on the chat stage and never required. (Default-mode is a person-level read \u2014 the aggregator's job, not a single conversation.)" }
16501
+ ]
16502
+ },
16503
+ {
16504
+ key: "judgment",
16505
+ name: "Judgment (decision soundness)",
16506
+ definition: "Making the RIGHT call and acting on it \u2014 where 'right' means the choice whose LONG-TERM consequences are best, not the one that feels good now (Naval: judgment is knowing the long-term effects of your decisions and choosing accordingly). Judgment is a DISPOSITION read over MANY decisions, never a verdict on one: the question is which way the person RELIABLY leans \u2014 toward the long arc or the short pull, toward the honest read or the wishful one \u2014 not whether any single call was perfect. Even the soundest people slip; a base rate of avoiding bad calls is the trait, not a highlight reel of brilliant ones. Its SIGNATURE is the COSTLY-BUT-CORRECT call: paying a real short-term price \u2014 emotional, social, ego \u2014 because the person sees the long arc and chooses it anyway. A decision that HURT to make or came out of conflict but was right on the long horizon (e.g. sending a hard, kind message to save a friendship they'd have regretted losing) is TOP-rung judgment, NOT a lapse \u2014 grade the decision on its merits and long-horizon correctness, NEVER on how painful or emotional it was. Conversely, an emotion or OUTCOME that happened TO them (being hurt, not being believed in, a painful event they did not author) is NOT a decision and carries NO penalty. Resisting short-term pull, flattery, and incentive-caused bias (letting what you WANT bend what you CONCLUDE) is core; so is not letting an irrational belief corrupt the METHOD for a high-stakes choice (a partner, what to build). THE STAKES AXIS \u2014 JUDGMENT IS MOST VISIBLE WHERE THE PULL IS STRONGEST: the 'difficulty' that matters for judgment is NOT the intellectual complexity of the topic (that is Capability) but the strength of the emotional / ego / personal STAKES \u2014 insecurity, craving, love, betrayal, conflict, status threat, fear. A 'routine' topic on the content ladder can be the HARDEST judgment test on the stakes ladder; a high-stakes personal/relational decision is PRIME judgment evidence, never low-grade because the subject is not intellectual. A sound call made under MAXIMAL pull is the ceiling; a sound call on a low-stakes matter does not set it, and a slip on a low-stakes passing impulse is not diagnostic. NOT reasoning horsepower (Capability), aesthetic feel (Taste), or where effort is pointed (Prioritization). Boundary \u2014 score the CHOICE here: the accuracy of the underlying READ is Bias resistance, and authoring a decision against external pull overlaps with Self-authorship (agency); do not count one moment across all three. Deliberating, weighing tradeoffs, voicing uncertainty, and taking time are the PROCESS \u2014 never a penalty; and a right call reached by INTUITION or feeling counts exactly as much as one reached by visible calculation \u2014 do not reward shown work or 'caught every edge case' over a heartfelt call that lands right. RULE-BENDING IS NOT A LAPSE \u2014 PRICE THE DOWNSIDE, DON'T POLICE THE RULE: bending norms, conventions, or gatekeeping to get things done \u2014 selling a vision ahead of reality, projecting confidence, stating a deliverable OUTCOME as present-tense ('we have routes into X' when you are confident you will get the candidate in front of X) \u2014 is NOT dishonesty and is often HIGH judgment. 'Fake it till you make it' backed by genuine ability to DELIVER is not a lie; the test is deliverability and bounded, recoverable downside, NOT whether a rule was bent. The ONLY integrity-related ding is a MISPRICED long-arc downside: a claim a counterparty relies on that the person cannot or will not back, where discovery would compound against them \u2014 AND the person doesn't see it or rationalizes past it. A cheap probe with bounded downside, killed fast, is sound judgment even if aggressive. SELF-DIAGNOSED PAST DECISIONS COUNT AS DECISIONS: when the person's own later post-mortem describes a specific past decision failure in their own words (the class: 'I ignored what I already knew about them', 'I decided on far too little signal', 'I let an outside voice outweigh my own better-grounded assessment'), the GRADED OBJECT is that described past decision, weighed at the severity the record supports \u2014 a lapse documented after the fact is decision evidence exactly like one enacted live. Writing the post-mortem does NOT convert the lapse into mere self-awareness: the insight is diagnosis (credit it under growth/self facets), but the decision it describes belongs HERE, as judgment evidence. Do not skip such a described lapse because the conversation's other decisions lean well. Grade which way they reliably lean and where they land on the long arc.",
16507
+ rungs: [
16508
+ { level: 2, marker: "Takes the sweetest or easiest option; chases the short-term payoff with little regard for where it leads." },
16509
+ { level: 4, marker: "Readily rationalizes toward what they want; the comfortable or flattering option keeps winning; misses considerations an honest look would catch." },
16510
+ { level: 6, marker: "Oriented to the right call and resists the obvious temptations, but inconsistent \u2014 a strong incentive or a charged moment can still bend the bigger decisions." },
16511
+ { level: 8, marker: "Usually lands on the right long-term call and resists short-term pull, INCLUDING calls that cost them something; directionally sound as a default, even if a hard call is occasionally read incompletely." },
16512
+ { level: 10, marker: "Reliably right on the long arc, as a default: chooses the long-term-correct thing over the short pull again and again \u2014 INCLUDING the costly-but-correct calls others flinch from \u2014 and acts on it. Reached by EITHER route, neither required: thorough consequence-reasoning that catches the edge cases, OR a sound, vindicated read that lands right even when it was intuitive rather than visibly calculated. A right call reached by feel counts FULLY." },
16513
+ { level: 11, marker: "Holds even on very hard, high-stakes, genuinely difficult calls \u2014 near-impossible to manipulate, judgment you would TRUST to get the outcome when it is hardest and costliest; the long-term-right choice stays the default even under real personal pressure." }
16514
+ ]
16515
+ },
16516
+ {
16517
+ key: "prioritization",
16518
+ name: "Outcome-orientedness / prioritization",
16519
+ definition: "Pointing effort where it actually moves the outcome: picking the load-bearing problem, the highest-leverage move, knowing what to ignore, deciding what to bet on. Tightly linked to ambition. Distinct from Judgment (rightness of a choice under pull), Taste (aesthetic feel), and Capability (raw thinking). Graded by where they sit on the spectrum \u2014 it NEVER requires a particular signature (e.g. explicit 'leverage / opportunity-cost / one-way-door' talk, or cheap empirical tests); sound prioritization that lands on the genuinely important thing counts however it is reasoned. (Choosing to build a new meaning system for the post-AGI world, say, is a high-prioritization move \u2014 picking a load-bearing problem at scale.) This is the facet where disproportionate effort on a LOW-leverage question (e.g. circling 'did I give too much away') is a legitimate ding \u2014 never penalize deliberation itself here, only effort aimed at the wrong thing.",
16520
+ rungs: [
16521
+ { level: 2, marker: "Effort goes wherever \u2014 no sense of what matters; works on whatever is in front of them." },
16522
+ { level: 4, marker: "Mis-aimed \u2014 pulled toward the shiny or easy; overbuilds the wrong thing; identifies what matters mostly only when told." },
16523
+ { level: 6, marker: "Aimed \u2014 identifies what actually matters for the outcome and works on it; prioritization still informal, and can sink real time into low-leverage questions." },
16524
+ { level: 8, marker: "Ruthless within the problem: given a goal or task, cuts to the biggest bottleneck / highest-leverage move and discards the rest. A sharp prioritizer on the choices in front of them." },
16525
+ { level: 10, marker: "Reliably right across the field, as a default: not just the lever inside one problem but which bets/goals to pursue at all among many messy options \u2014 their sense of what matters is consistently well-aimed without having to be told." },
16526
+ { level: 11, marker: "Exceptional prioritization \u2014 originates the high-leverage bet others don't even look at (defines the bet, doesn't just pick from the menu), on problems at the largest scale, and the choices reliably convert into outsized outcomes." }
16527
+ ]
16528
+ },
16529
+ {
16530
+ key: "bias",
16531
+ name: "Bias resistance",
16532
+ definition: "How well they resist their own cognitive biases \u2014 whether what they believe stays honest. What happens to a held belief when counterevidence arrives, and whether they hunt for the ways they're wrong or defend their ego. Graded on MOVES (belief movement, concessions, self-generated objections), never on polite words. The high rungs require high stakes \u2014 conceding on things you don't care about proves nothing (see egoStakes).",
16533
+ rungs: [
16534
+ {
16535
+ level: 2,
16536
+ marker: "Facts can't get in \u2014 could be given all the facts perfectly and still rejects them and calls the person an idiot; treats one counterexample as demolishing a whole thesis; puts down capable people when their success threatens self-image."
16537
+ },
16538
+ {
16539
+ level: 4,
16540
+ marker: "Considers it, then skews back \u2014 restates the original position unchanged; the comfortable/wishful estimate keeps winning. Includes performed open-mindedness ('interesting, I'll think about it') with no actual movement, ever."
16541
+ },
16542
+ { level: 5, marker: "Honest stubbornness \u2014 admits they can't counter the argument ('I don't have an answer, but I still think X') and holds the prior WITHOUT confabulating a fake rebuttal." },
16543
+ { level: 6, marker: "Genuinely updates when beaten \u2014 visible concessions ('you're right, I had that wrong') and real belief movement." },
16544
+ { level: 8, marker: "Proactively stress-tests their own position \u2014 generates objections before anyone else does, premortems their own plans, asks what would prove them wrong." },
16545
+ { level: 10, marker: "Habitually hunts disconfirmation \u2014 once they form an argument, they attack it from every angle and deliberately look for data that proves them wrong." },
16546
+ {
16547
+ level: 11,
16548
+ marker: "Does it on identity-loaded beliefs \u2014 their own project, their own ability, the things it hurts to be wrong about \u2014 and visibly acts on what it turns up."
16549
+ }
16550
+ ]
16551
+ },
16552
+ {
16553
+ key: "outlook",
16554
+ name: "Optimism / energy",
16555
+ definition: "How they explain what has already happened, especially setbacks, and whether that explanation keeps them generative \u2014 the lean of their causal stories (temporary\u2194permanent, specific\u2194pervasive, fixable\u2194personal-flaw) and whether it fuels or drains forward energy. The average across many explanations is the trait, never the best day. Only explanations of things that mattered to them count. Owns the PAST; mood is OCEAN's, forecasts are 'choosing the right thing / taste'.",
16556
+ rungs: [
16557
+ {
16558
+ level: 2,
16559
+ marker: "Doom \u2014 bad events are permanent, everywhere, and their own fault ('I always ruin this', 'everything's like this'); good events are luck. The profile that predicts quitting."
16560
+ },
16561
+ { level: 4, marker: "Pessimistic lean \u2014 setbacks usually read as stable and global; wins get discounted." },
16562
+ { level: 6, marker: "Realistic \u2014 explanations track the evidence; no systematic doom, no systematic rescue." },
16563
+ { level: 8, marker: "Optimistic style \u2014 setbacks explained as temporary, specific, actionable ('that channel didn't work, this variable was off'); wins partly own-doing. The persistence profile." },
16564
+ { level: 10, marker: "Markedly optimistic-generative as a DEFAULT \u2014 sits high on the optimism spectrum: setbacks reliably read as temporary/specific/actionable and the energy stays forward across the board. Reached by EITHER route, neither required: (a) sustained high optimism on its own (you do NOT need to see a genuinely bad stretch \u2014 purely very optimistic, consistently, is enough), OR (b) energizing under fire \u2014 mid a bad stretch, turns immediately to causes and next moves." },
16565
+ { level: 11, marker: "The top of the spectrum \u2014 exceptional, durable optimistic energy that is also CALIBRATED: the optimistic explanations check out against evidence (bias resistance stays high alongside, so it's conviction not delusion), and/or it visibly energizes under genuine fire." }
16566
+ ]
16567
+ }
16568
+ ],
16569
+ references: []
16570
+ };
16571
+
16572
+ // ../../lib/agents/engine/lenses/agency.ts
16573
+ var agencyLens = {
16574
+ key: "agency",
16575
+ label: "Agency",
16576
+ intro: "It judges this person's self-directed power to act on the world, from visible MOVES in raw transcripts: who sets the goals they pursue, how big an irreversible bet fear actually permits (relative to what they have), whether they self-start and persist past barriers, and how fast deciding becomes doing. Words about boldness are not boldness; only executed moves climb the high rungs.",
16577
+ gateLabel: "STAKES",
16578
+ gateLadder: ` 3 \u2014 routine, fully reversible choice; nothing meaningful at risk
16579
+ 5 \u2014 costs real time or money but recoverable; mild social exposure
16580
+ 7 \u2014 irreversible or socially risky for THIS person: public commitment, cold outreach to strangers, a meaningful slice of their savings or standing
16581
+ 9 \u2014 a major fraction of their available resources, reputation, or optionality on the line
16582
+ 11 \u2014 bet-the-runway scale for them, taken against unanimous discouragement
16583
+ JUDGE STAKES RELATIVE TO THE PERSON'S VISIBLE CAPACITY \u2014 the excerpt reveals their scale (someone agonizing over a $200 spend or a first cold email is telling you their scale; someone casually approving a contractor invoice is telling you theirs).`,
16584
+ processNote: "LATENCY & FOLLOW-THROUGH \u2014 transcripts show what narratives hide: note the gap between deciding and doing (timestamps, turns), and whether stated intentions later appear as completed actions. 'Said it Monday, did it Monday' is a move; 'planned for weeks, never sent' is also a move.",
16585
+ selectHint: "Pick conversations where the person is DECIDING or ACTING on something with REAL STAKES \u2014 making a bold or risky move, choosing their own direction against the grain or against advice, committing to something big, quitting/starting/betting, or pushing through a hard barrier. Agency shows in high-stakes action and self-authorship, not in abstract discussion. STRONGLY PREFER moments of genuine consequence (money, reputation, a major life or company decision on the line). DEPRIORITIZE pure ideation, learning, or analysis with nothing at stake, and routine logistics. Length helps only as a side effect of a real, worked-through decision \u2014 never pick on length alone.",
16586
+ facets: [
16587
+ {
16588
+ key: "frame-scope",
16589
+ name: "Self-authorship",
16590
+ definition: "Whose goals are they actually chasing \u2014 handed to them, or authored by them? From executing someone else's spec, up through running their own life on first principles, to world-scale aims. Graded from which frame the episode shows them operating in and whether they question the frame itself ('should I even be doing this?'). Distinct from Initiative (self-STARTING action) \u2014 this is about whose goals.",
16591
+ rungs: [
16592
+ {
16593
+ level: 3,
16594
+ marker: "Executes only what they're told at the current job/role; does not think and synthesize on their own; does not simulate how people would actually react to the thing they're building; implements the spec but not the extra mile where some thought would have shown a much better option existed; people have to repeatedly tell them to do this and that."
16595
+ },
16596
+ {
16597
+ level: 5,
16598
+ marker: "The optimizer \u2014 puts real effort into the job, learns, does tasks without consistent oversight, gets outcomes, has ownership over the work. But they are optimizing to be really good at a task someone else decided; the guardrails were set by other people and never questioned. (If they chose the frame deliberately, with eyes open \u2014 a considered bet on a job or degree \u2014 that ranks a notch above defaulting into it.)"
16599
+ },
16600
+ {
16601
+ level: 7,
16602
+ marker: "The explorer \u2014 building things on their own, doing things outside the norm of what's necessary for them, because they're interested or want to explore. Hasn't taken the leap to committing to something world-scale."
16603
+ },
16604
+ {
16605
+ level: 9,
16606
+ marker: "Self-authored, with some hedging \u2014 runs major life and work choices from first principles, including what to work on; contrarian, off the default path \u2014 but at moderate intensity, not yet all-in (still partly tethered to what's safe or expected)."
16607
+ },
16608
+ {
16609
+ level: 10,
16610
+ marker: "Self-authored at full conviction \u2014 runs their whole life from first principles, including what to work on, at high intensity and urgency; thoroughly contrarian; does what they want and never lets conformism or 'this won't work' stop them. Same move as 9, lived all the way."
16611
+ },
16612
+ {
16613
+ level: 11,
16614
+ marker: "Aims really high, off the consensus path \u2014 world-scale goals chosen against the standard playbook. Offered the safe, legible version of their ambition (the vertical-SaaS-shaped choice), they turn it down. The goal stays up when every credible voice says it's bad."
16615
+ }
16616
+ ]
16617
+ },
16618
+ {
16619
+ key: "fear-gate",
16620
+ name: "Risk taking",
16621
+ definition: "How much FEAR is allowed to block or delay an irreversible, scary move \u2014 judged by DECISIVENESS, not by the dollar size of the bet. The real tell is the AGONIZING: do they stall, deliberate endlessly, and flinch from the scary irreversible thing \u2014 or do they just DO it? The currency is whatever they fear losing (money, reputation, optionality, rejection) RELATIVE to their own capacity: a broke student risking their whole runway and a funded founder making a six-figure bet sit on the SAME rung if the fear is the same. Stakes/money size is at most a weak proxy \u2014 NEVER score on the amount; score on whether fear gated or delayed the move. (Defiance of consensus scores HERE; how they PROCESSED the consensus they defied scores under bias resistance.)",
16622
+ rungs: [
16623
+ { level: 3, marker: "Fear closes the option space \u2014 the scary irreversible move is never conceived, or never survives to a plan ('not something people like me do' operates silently)." },
16624
+ { level: 5, marker: "Agonizes and stalls \u2014 concrete scary plans form (researched, costed, sometimes scheduled) and the last step never happens; fear holds the door even once the plan is ready." },
16625
+ { level: 7, marker: "Does the scary thing at the edge of comfort, but only after heavy agonizing/delay \u2014 the irreversible move eventually happens with a lot of hand-wringing; it is not their default and it visibly costs them." },
16626
+ { level: 9, marker: "Often just does it \u2014 executes irreversible, scary moves with little agonizing on the things that grip them; deliberation is short and action follows; the very scariest tier still occasionally stalls." },
16627
+ { level: 10, marker: "Decisive on irreversible risk as a DEFAULT \u2014 when the right scary move is clear they just do it, fast and repeatedly, with minimal agonizing; fear rarely gates or delays. Only the single scariest tier may still give brief pause." },
16628
+ { level: 11, marker: "Fear gates essentially nothing \u2014 they execute the scariest irreversible moves decisively and repeatedly, before any guarantee, sustained even against unanimous discouragement with real downside live. Thinking happens but never delays the action. The tell is the ABSENCE of agonizing where almost anyone else would freeze: they just do the thing." }
16629
+ ]
16630
+ },
16631
+ {
16632
+ key: "ambition",
16633
+ name: "Ambition",
16634
+ definition: "What they WANT to pursue \u2014 the lens through which they see the world, not the pursuit itself (acting on the want scores under frame-scope, fear-gate, and initiative; a big-wanting non-actor is ambition 10 / fear-gate 3, and that profile is the point). THE AXIS IS THE REACH OF THE WANT: what has to be true of a future for it to count as worth wanting \u2014 personal safety \u2192 the work itself \u2192 their own days \u2192 the world \u2192 authored legacy \u2192 counterfactual history. Graded from the REVEALED lens, not declarations: how they evaluate options, what they dismiss as too small, which futures keep recurring when they think out loud. One grand statement is nothing; the same evaluative lens across many episodes is the trait. Two cautions: (1) DEEP HUMAN CONNECTION NEVER LOWERS AMBITION \u2014 someone who is empathetic and deeply connected AND ambitious is, if anything, a stronger profile; never deduct for caring about people, friends, or love. (2) The civilization / large-scale frame need NOT be explicit \u2014 infer the reach from what consistently drives them across the corpus, not from explicit 'change the world' declarations; the absence of grand civilizational talk is not evidence of small ambition.",
16635
+ rungs: [
16636
+ {
16637
+ level: 2,
16638
+ marker: "Safety only \u2014 they'll do what they get, as long as it gives them stability; work is purely instrumental and whether it's done well is irrelevant to them. The want stops at themselves-as-safe."
16639
+ },
16640
+ {
16641
+ level: 4,
16642
+ marker: "Safety, plus the work should be GOOD \u2014 still takes what they get, horizon unchanged, but a real want attaches to the work itself: pride, standards, caring about being good at it. The first reach of wanting beyond self-preservation. (Grades the CARING, revealed in how they talk about work \u2014 whether the work actually is good scores under caliber/conscientiousness.)"
16643
+ },
16644
+ { level: 5, marker: "Their own days \u2014 they want to enjoy doing what they want; it doesn't much matter what it's working towards. The want directs life choices, but its object is their own experience." },
16645
+ { level: 7, marker: "Good work for the world \u2014 real impact matters to them, but within structures other people own; their own thing isn't the requirement." },
16646
+ { level: 8, marker: "Their own thing + generational wealth \u2014 ownership is the requirement; the future they want has their name on it and changes their family's trajectory." },
16647
+ { level: 9, marker: "Reshape a whole industry or field \u2014 wants to change how a whole domain works, huge but bounded; the win is being the one who reshaped it." },
16648
+ { level: 10, marker: "Reshape how many people live \u2014 impact at the scale of an institution or a way-of-doing-things for a large population; their own dent in the world, beyond a single industry." },
16649
+ {
16650
+ level: 11,
16651
+ marker: "Civilization-scale ambition \u2014 the lens admits almost nothing smaller; smaller futures feel viscerally not-enough. ONE OPTIONAL flavor (NOT required \u2014 do NOT index hard on it) is wanting specifically the things that would not happen without them ('is this big enough, and would it happen anyway?'). Plenty of people with civilization-scale ambition never think in counterfactual-impact terms; grade the REACH and intensity of the want, never whether they frame it as 'only I could do this.'"
16652
+ }
16653
+ ]
16654
+ },
16655
+ {
16656
+ key: "initiative",
16657
+ name: "Bias to action",
16658
+ definition: "The gap between wanting and doing \u2014 do they self-start, with urgency, and follow through, without being told? The one thing the other agency facets don't catch: self-authorship is whose goals, ambition is what they want, risk-taking is how big a bet, barriers is what happens after a block \u2014 this is whether they actually MOVE. (Grounded in Frese's Personal Initiative construct \u2014 self-starting, proactive, follow-through.)",
16659
+ rungs: [
16660
+ { level: 2, marker: "Doesn't start \u2014 intentions don't become action; 'I should do X' recurs without X ever happening; waits to be told and waits to be unblocked." },
16661
+ { level: 4, marker: "Acts only when pushed or when it's easy \u2014 does what's asked and follows through on low-friction things, but stalls on anything that requires initiating from cold; long lag between deciding and doing." },
16662
+ { level: 6, marker: "Self-starts on what matters \u2014 turns intentions into action without being told, reasonable urgency, follows through on most of what they commit to; does a bit more than asked." },
16663
+ { level: 9, marker: "Acts fast and unprompted SOMETIMES \u2014 near-zero lag between decision and action on the things that grip them, but not yet across the board." },
16664
+ { level: 10, marker: "Bias to action is their DEFAULT \u2014 decisions become action almost immediately, across the board, as how they operate; the intention-action gap is consistently tiny." },
16665
+ { level: 11, marker: "Exceptional urgency \u2014 thinking never delays action; operates at maximum speed, ships and reaches out relentlessly, essentially no gap between deciding and doing." }
16666
+ ]
16667
+ },
16668
+ {
16669
+ key: "barriers",
16670
+ name: "Barrier persistence",
16671
+ definition: "What happens after a block, judged on the SEQUENCE of moves (not the mood). Track THREE things together: (1) ROUTE GENERATION \u2014 how many distinct, high-leverage ways past the block they generate, with how little delay; (2) MORALE RESILIENCE \u2014 do they keep going when punched in the face, when they feel low-status, when others don't respect them, and is their drive independent of that status; (3) COMMITMENT TO THE GOAL \u2014 they route around as long as the final mission still seems possible. A confessed doubt ('should I give up?', 'I'm cooked', 'my brain is in a rut') is corroborating color, NOT a cap: if any route follows it \u2014 here or later \u2014 score the routes and let the doubt pass. A doubt lowers the score ONLY when it is the TERMINUS (no route follows and the effort ends). Score the sequence, never the feeling.",
16672
+ rungs: [
16673
+ { level: 3, marker: "The first obstacle ends the attempt, or they wait for someone else to unblock them \u2014 or they give up without enough reason to give up." },
16674
+ { level: 5, marker: "Retries the same approach harder, escalates politely, then stalls; a dip in morale ends the effort." },
16675
+ { level: 7, marker: "Generates a second and third genuinely distinct route past the block; keeps going on what matters, though not relentlessly across the board." },
16676
+ { level: 9, marker: "Routes around the blocks that matter as a near-default \u2014 finds the side door and keeps the final goal alive; mostly holds morale, occasionally still stalls on lesser blocks." },
16677
+ { level: 10, marker: "An idea-machine that keeps finding alternate ways to the SAME mission \u2014 DOES lose morale under hard hits, but bounces back EVERY time and keeps going; being punched / disrespected / made to feel low-status stings but does not stop them. Always recovering despite morale dips is the realistic HUMAN ceiling here \u2014 it brushes 11; do not treat the dips themselves as a knock." },
16678
+ { level: 11, marker: "Never loses morale (a near-superhuman bar \u2014 almost no one truly never dips, so reserve 11 for genuinely no morale loss) \u2014 picks themselves up immediately and acts; exhausts the methods and goes for the highest-leverage ones with very little delay; routes around any block as long as the final goal still seems possible; a relentless idea-machine generating many fresh ways to the same mission; keeps going when punched in the face and when they feel low-status, with drive that is independent of how others respect them." }
16679
+ ]
16680
+ }
16681
+ ],
16682
+ references: []
16683
+ };
16684
+
16137
16685
  // ../../lib/agents/coding/agglomerate.ts
16686
+ var AXIS_SOURCES = {
16687
+ judgement: ["generative"],
16688
+ agency: ["outcomes", "caliber"],
16689
+ taste: ["taste"],
16690
+ // Owner call 2026-07-21: the qualitatives mirror the chat report's breadth —
16691
+ // every construct with real graded volume gets a card. Delegation places on
16692
+ // its OWN criteria.ts rungs (coding-native ladder).
16693
+ delegation: ["delegation"]
16694
+ };
16138
16695
  var LABEL = new Map(GRADED_CRITERIA.map((c) => [c.key, c.label]));
16139
- function renderTakes(grades) {
16696
+ var eff = (t) => t.score ?? t.best ?? 0;
16697
+ var oneLine = (s, n) => (s || "").replace(/\s+/g, " ").trim().slice(0, n);
16698
+ function takesFor(grades, keys) {
16699
+ const out = [];
16700
+ for (const g of grades) {
16701
+ for (const key of keys) {
16702
+ const c = g.criteria.find((x) => x.key === key);
16703
+ if (!c || c.score == null && c.bestEstimate == null) continue;
16704
+ out.push({
16705
+ sessionId: g.sessionId,
16706
+ title: cleanSessionTitle(g.title) || g.sessionId,
16707
+ date: g.date || "",
16708
+ score: typeof c.score === "number" ? c.score : null,
16709
+ best: typeof c.bestEstimate === "number" ? c.bestEstimate : null,
16710
+ instance: c.instance || "",
16711
+ why: c.why || "",
16712
+ quotes: c.quotes || []
16713
+ });
16714
+ }
16715
+ }
16716
+ return out.sort((a, b) => eff(b) - eff(a));
16717
+ }
16718
+ function axisStatsLine(takes, nGraded) {
16719
+ const exercised = takes.filter((t) => t.score != null || t.best != null);
16720
+ const sessions = new Set(exercised.map((t) => t.sessionId)).size;
16721
+ const dist = exercised.map(eff).sort((a, b) => b - a).join(", ") || "none";
16722
+ return `${sessions} of ${nGraded} graded sessions exercised this (score-or-null grading: the rest had no opportunity, not lows) \xB7 scores high to low: ${dist}`;
16723
+ }
16724
+ function qualifyingTakes(takes) {
16725
+ const scored = takes.filter((t) => typeof t.score === "number");
16726
+ if (!scored.length) return { scored: 0, qualifying: 0, peak: null };
16727
+ const sorted = [...scored].sort((a, b) => b.score - a.score);
16728
+ const peak = sorted[0];
16729
+ const qualifying = sorted.filter((t) => t.score >= Math.max(8, peak.score - 1)).length;
16730
+ return { scored: scored.length, qualifying, peak };
16731
+ }
16732
+ var K_PEAKS = 8;
16733
+ var K_FLOORS = 3;
16734
+ function takeEntry(t) {
16735
+ const est = t.score == null ? "~" : "";
16736
+ const quotes = (t.quotes || []).slice(0, 2).map((q) => `
16737
+ > "${oneLine(q, 300)}"`).join("");
16738
+ return `- [L${eff(t)}${est} \xB7 "${oneLine(t.title, 60)}" \xB7 ${(t.date || "?").slice(0, 10)} \xB7 session ${t.sessionId}] ${oneLine(t.instance, 400)}${t.why ? `
16739
+ WHY: ${oneLine(t.why, 700)}` : ""}${quotes}`;
16740
+ }
16741
+ function renderDossier(grades) {
16742
+ const n = grades.length;
16140
16743
  const blocks = [];
16141
16744
  for (const c of GRADED_CRITERIA) {
16142
- const rows = [];
16143
- for (const g of grades) {
16144
- const t = g.criteria.find((x) => x.key === c.key);
16145
- if (!t || t.score == null && t.bestEstimate == null) continue;
16146
- const s = t.score != null ? `L${t.score}` : `~L${t.bestEstimate}`;
16147
- const q = t.quotes[0] ? ` | quote: "${t.quotes[0].slice(0, 180)}"` : "";
16148
- rows.push(` - [${s}] ${(g.title || g.sessionId).replace(/\n.*/, "").slice(0, 50)} (${(g.date || "").slice(0, 10)}): ${t.instance}${t.why ? ` \u2014 ${t.why.slice(0, 240)}` : ""}${q}`);
16745
+ const takes = takesFor(grades, [c.key]);
16746
+ if (!takes.length) continue;
16747
+ const peaks = takes.slice(0, K_PEAKS);
16748
+ const floors = takes.slice(K_PEAKS).filter((t) => t.score != null).slice(-K_FLOORS);
16749
+ let block = `### ${c.label} (${c.key})
16750
+ STATS: ${axisStatsLine(takes, n)}
16751
+ PEAKS \u2014 the top ${peaks.length} take(s), in full:
16752
+ ${peaks.map(takeEntry).join("\n")}`;
16753
+ if (floors.length) block += `
16754
+ FLOORS \u2014 the bottom ${floors.length} scored take(s) (the ceiling tests):
16755
+ ${floors.map(takeEntry).join("\n")}`;
16756
+ blocks.push(block);
16757
+ }
16758
+ return blocks.join("\n\n");
16759
+ }
16760
+ var SYSTEM = "You synthesize how a person works across many of their coding-agent sessions. You are given the per-session findings (already graded, with the user's verbatim quotes), pre-digested by code into per-criterion stats, peaks, and floors. Your job is INSIGHT and honest VERDICTS: find the patterns, the signature moves, and the honest gaps, then place each display axis with a best + range + conditions \u2014 never a bare point score on thin evidence. Ground every claim in the evidence given; never invent. Most people are mostly hand-holding the model \u2014 say so plainly when the evidence is thin. Thin evidence cuts both ways: the truth can sit below the peak as easily as above it. Write tight, specific prose; no flattery, no filler; no em dashes in any user-facing line.";
16761
+ var AXIS_LADDER_FACETS = {
16762
+ judgement: { lens: reasoningLens, keys: ["judgment"] },
16763
+ agency: { lens: agencyLens, keys: ["frame-scope", "initiative", "barriers"] },
16764
+ taste: { lens: reasoningLens, keys: ["taste"] },
16765
+ // Coding-native construct: the ladder is the criterion's own rung set from
16766
+ // criteria.ts (the same rungs the per-session grader placed the takes on).
16767
+ delegation: { criterion: "delegation" }
16768
+ };
16769
+ function axisLadders() {
16770
+ const blocks = [];
16771
+ for (const axis of Object.keys(AXIS_LADDER_FACETS)) {
16772
+ const { lens, keys, criterion } = AXIS_LADDER_FACETS[axis];
16773
+ if (criterion) {
16774
+ const c = GRADED_CRITERIA.find((x) => x.key === criterion);
16775
+ if (!c?.rungs?.length) throw new Error(`axis ladder missing: ${axis}/${criterion} \u2014 criteria.ts changed shape?`);
16776
+ blocks.push(`### ${axis} ladder \u2014 ${c.label}
16777
+ ${c.rungs.map((r) => ` L${r.level} \u2014 ${r.marker}`).join("\n")}`);
16778
+ continue;
16779
+ }
16780
+ for (const key of keys ?? []) {
16781
+ const f = lens?.facets.find((x) => x.key === key);
16782
+ if (!f?.rungs?.length) throw new Error(`axis ladder missing: ${axis}/${key} \u2014 engine lens changed shape?`);
16783
+ blocks.push(`### ${axis} ladder \u2014 ${f.name}
16784
+ ${f.rungs.map((r) => ` L${r.level} \u2014 ${r.marker}`).join("\n")}`);
16149
16785
  }
16150
- if (rows.length) blocks.push(`### ${c.label} (${c.key})
16151
- ${rows.join("\n")}`);
16152
16786
  }
16153
16787
  return blocks.join("\n\n");
16154
16788
  }
16155
- var SYSTEM = "You synthesize how a person works across many of their coding-agent sessions. You are given the per-session findings (already graded, with the user's verbatim quotes). Your job is INSIGHT, not scoring: find the patterns, the signature moves, and the honest gaps. Ground every claim in the evidence given; never invent. Most people are mostly hand-holding the model \u2014 say so plainly when the evidence is thin. Write tight, specific prose; no flattery, no filler.";
16156
16789
  function buildPrompt(grades) {
16157
- return `Below are the per-session findings for ONE person across ${grades.length} of their Claude Code sessions, grouped by criterion. Each line is one session's distilled finding for that criterion (level in brackets, then what it showed, then a verbatim quote of the user's own words).
16790
+ const n = grades.length;
16791
+ const axisStats = Object.keys(AXIS_SOURCES).map((axis) => `- ${axis} (from ${AXIS_SOURCES[axis].join(" + ")}): ${axisStatsLine(takesFor(grades, AXIS_SOURCES[axis]), n)}`).join("\n");
16792
+ return `Below are the per-session findings for ONE person across ${n} of their coding-agent sessions, grouped by criterion. For each criterion you get STATS (how many of the graded sessions exercised it, and the full score distribution high to low), the PEAKS (the top takes in full: the instance, the grader's why, verbatim quotes of the user's own words), and the FLOORS (the bottom scored takes \u2014 the ceiling tests), when they exist.
16158
16793
 
16159
- ${renderTakes(grades)}
16794
+ ${renderDossier(grades)}
16160
16795
 
16161
- Per-session scores are capped at 10. YOU are the aggregator that can promote a criterion to 11 \u2014 but ONLY when the corpus shows enough CONSISTENCY or a genuine sustained peak (taste/expertise/delegation/metacognition consistency across many sessions; abstraction peaks that out-reason the tool more than once; outcomes stacked across a day). Say so explicitly when an 11 is warranted, and refuse it when the evidence is one good session.
16796
+ Per-session scores are capped at 10; the person-type ladders below run to 11. YOU are the aggregator: your verdicts place the PERSON on those ladders from the whole record, which is a different judgment than any single session's grade.
16162
16797
 
16163
16798
  Synthesize across ALL of it:
16164
16799
  1. "overall" \u2014 2\u20133 tight paragraphs: how this person actually works in their coding agents. What's genuinely strong, what's routine, where the real signal is vs. where it's just scaffolding the model. Be specific and honest. Preface any absent dimension gently ("we haven't seen evidence yet \u2014 very possibly the work just hasn't called for it"), never as a deficit.
16165
16800
  2. "signatureMoves" \u2014 the 3\u20136 single most telling moments (the SPIKES/FLARES) across EVERY session (a sharp override, a real taste call, an out-reasons-the-tool insight, a system-design move). Each: what it was, which session, and the verbatim quote.
16166
16801
  3. "criteria" \u2014 for each criterion present above: a one-line "headline" and a 2\u20134 sentence "insight" describing the PATTERN across sessions; state whether the aggregate merits an 11 and why/why-not. For "frontier", END the insight with a concrete LEVEL-UP LIST \u2014 the specific frontier techniques (loops, workflow orchestration, scheduled cloud agents, broader MCP, queue-ahead) they're NOT yet using. Only include criteria that have evidence.
16802
+ 4. "verdicts" \u2014 the person-level verdict for each of the FOUR DISPLAY AXES the report renders. Each axis draws ONLY on its own criteria's takes:
16803
+ \u2022 "judgement" \u2190 the Abstraction (generative) takes.
16804
+ \u2022 "agency" \u2190 the Outcomes takes PLUS the Caliber takes. Caliber's autonomy half \u2014 originating the hard thing and unblocking their own path, never needing rescue \u2014 is agency evidence; so is shipping verified outcomes.
16805
+ \u2022 "taste" \u2190 the Taste takes.
16806
+ \u2022 "delegation" \u2190 the Delegation takes (when to hold the leash vs let the AI run, front-loading vs correction rounds).
16807
+ NEVER borrow evidence across axes: a receipt that earned one criterion its score cannot also earn another axis's verdict. If an axis's own takes are empty, its verdict is null \u2014 never fill the hole from a neighboring criterion.
16808
+
16809
+ SHARED VERDICT LAWS (these override any instinct to be generous):
16810
+ \u2022 A RUNG IS A CEILING, NOT AN AVERAGE \u2014 BUT A CEILING MUST BE EARNED. The best few genuine demonstrations set the level; routine stretches never drag it down. A level is earned by a few clear demonstrations that the person CAN operate at that altitude \u2014 more than a single lucky one-off, but never a requirement to sustain it throughout. A level seen ONCE is a PROVISIONAL PEAK, not a proven level: one brilliant moment proves the altitude is reachable, not that it is where they live \u2014 report it as best + an honestly wide range. AWARD THE RUNG THE EVIDENCE MATCHES \u2014 never deny a level for lacking the NEXT level's criteria, and never withhold the top on caution; SEVERAL independent demonstrations at a level SETTLE that level (density is ceiling behavior) \u2014 never average strong takes down below the rung they prove, and never promote above the demonstrated rung on density alone.
16811
+ \u2022 PLACEMENT BY PERSON-TYPE LADDER (how "best" is decided). Build a MENTAL MODEL of the person from the whole record \u2014 stats, peaks, floors, base rates \u2014 then place them on the axis's LADDER below: "best" is the rung whose PERSON-TYPE the record matches, the honest answer to "what kind of person produces this record, and what can people like that do". The ladder markers describe dispositions and records, not single moments \u2014 so a record can match a rung no single session hit (dense strong takes whose shape reads like the higher type), and a record can FAIL to match a rung despite touching its number once (one lucky moment does not make the person that type). Read the marker's words against the record and place where it genuinely fits; the marker decides, never arithmetic over the distribution and never generosity.
16812
+ \u2022 THE GAP IS MANDATORY. For every verdict, "gap" states concretely what the NEXT rung's record would contain that this one does not \u2014 read the next marker and name what is missing, checkably (the kind of moment, at what stakes, with what vindication). If you cannot articulate a real gap, you have under-placed: move up. If the gap is glaring, do not let density talk you past it. A placement without a named gap is invalid.
16813
+ \u2022 THE GAP MUST BE VISIBLE IN THIS MEDIUM \u2014 AND LEAD WITH IT. The gap's FIRST sentence names the concrete behavior these coding logs COULD contain but do not: a kind of session, move, or verified outcome that would show up right here. Some next-rung markers are legible only outside coding logs (life-scale ambition, org-scale moves, how they carry other people); penalizing their absence from a coding record is a category error \u2014 and so is RECITING that rung's content: never open with or describe the off-medium rung. If it must be acknowledged at all, one short trailing clause ("the rest of that rung lives outside these logs") is the maximum. Where the record already contains a smaller version of the missing behavior, say what the larger version would look like without belittling the one that happened. A gap the person would read and rightly answer "these logs could never show that" \u2014 or a generic self-help line that fits anyone \u2014 is invalid.
16814
+ \u2022 CONFIDENCE IS EARNED BY RECURRENCE. "provisional" = the level rests on one or two moments; "grounded" = the same altitude recurs across several independent sessions; "strong" = it recurs consistently across many sessions and contexts. Never label a one-moment read grounded or strong.
16815
+ \u2022 ALWAYS BEST + RANGE + THE CONDITIONS THAT MOVE EACH BOUND \u2014 never a bare point score. The range is not a hedge; it is a structured query for the next runs: "conditions" states exactly what evidence would push the score to the high bound and what to the low bound (e.g. "high if the same altitude recurs on the next genuinely hard fork; low if the next several ambiguous calls land conventional"). A confident verdict still carries a range \u2014 just a tight one; the WIDTH encodes your confidence.
16816
+ \u2022 NULL SESSIONS ARE SAMPLING GAPS, NEVER LOWS. Score-or-null grading means a session without a take had no opportunity to show the criterion \u2014 it must not drag the verdict down, and it must not count as evidence of consistency either.
16817
+ \u2022 FREQUENCY IS PART OF THE VERDICT. Echo the code-computed stats line for the axis (given below) into "statsLine" verbatim, and state the base rate plainly inside "verdictLine" (e.g. "one judgement-grade moment across two graded sessions"). A pattern requires multiple distinct sessions; one moment is one moment.
16818
+ \u2022 THIN EVIDENCE CUTS BOTH WAYS \u2014 NO FLATTERY, NO UPWARD-ONLY HEDGING. With little evidence the truth can sit below the peak as easily as above it; never write "probably even better than this shows", and never quietly round a range up. State what the takes show, at the confidence they earn \u2014 and no more.
16819
+ \u2022 ORIGINATION IS THE GATE. The AI is the person's instrument: never discount a move because the AI elaborated or formalized around it \u2014 and never credit one that merely ratifies the AI's own suggestion. The move must start in the person.
16820
+ \u2022 GROUND EVERY CLAIM in the takes given: cite session titles/dates; "peak" names the single strongest take of THAT axis (its sessionId, title, date, score). Never invent or paraphrase a quote. In verdictLine/gap/conditions, describe moves in plain what-the-person-did words \u2014 stored session titles are auto-generated noise: copy them verbatim only as identifiers, never lean on them for meaning, and never coin ornamental names for what happened.
16821
+ \u2022 PEAKS ARE DEMONSTRATIONS, NOT HIGH SCORES. "peaks" lists the sessionIds of the 2-3 takes (from THIS axis's takes only) a reader should see to BELIEVE the verdict \u2014 chosen for how purely they demonstrate the AXIS'S OWN CONSTRUCT, not for their score. A take can carry a top score on its source criterion and still be a poor demonstration of this axis (a well-executed delivery scores high on outcomes but demonstrates nothing about agency's self-authorship; a clean routine call demonstrates nothing about judgement's high-stakes forks). For agency pick the origination stories (evidence sought outside the work, mid-flight redirection, self-derived constraints) over well-executed delivery; for judgement the calls where the most rode on being right; for taste the sharpest vindicated bars; for delegation the leash calls. Order them strongest-demonstration first.
16822
+ "verdictLine" is 1\u20132 sentences, plain language, no em dashes: the pattern plus its base rate.
16823
+
16824
+ PER-AXIS JUDGMENT (how to read each construct):
16825
+ \u2022 JUDGEMENT is PEAK-DRIVEN, AND ITS PEAKS ARE THE HIGH-STAKES CALLS. It is most visible exactly where the stakes of the call are real \u2014 shipping risk, irreversibility, measurement integrity, a fork where continuing-without-noticing silently corrupts the result \u2014 not in cool routine threads. Hard rules: (1) GRADE THE CALL ON ITS OWN MERITS, isolated from the noise around it: a sound call amid a messy session is sound judgement; something that happened TO them (a tool failure, a broken environment) is not a decision and carries no penalty. (2) REAL-TIME RECONSIDERATION IS DELIBERATION, NOT A FAILURE MODE: catching themselves and weighing it is the process working \u2014 grade where they LAND, never the wavering on the way. (3) A failure-mode cap fires ONLY on a genuine PATTERN of landing on the wrong call across distinct sessions \u2014 letting what they want bend the decision, chasing the short-term fix against the long arc; it does NOT fire on charged-but-sound moments, on costly-but-correct calls (paying a real price in time or rework to do the long-term-right thing is TOP-rung judgement), or on the ordinary slips every sound person makes; a single low amid strong takes is a slip, never the level. (4) WEIGHT BY THE STAKES OF THE DECISION, not the topic's intellectual prestige: the ceiling is set by sound calls made where the most rode on being right; a correct call on a trivial matter does not set it.
16826
+ \u2022 AGENCY is self-directed power to act, judged from visible MOVES: words about boldness are not boldness; only executed moves climb. Read three things in the outcomes + caliber takes: (1) SELF-AUTHORSHIP \u2014 whose goals are they chasing: do they originate the direction and question the frame itself, or execute what was handed to them? Self-sourced moves count at full weight; a move the AI handed them does not. (2) BIAS TO ACTION AND FOLLOW-THROUGH \u2014 the gap between deciding and doing, and whether stated intentions later appear as completed, verified actions ("said it, did it" is a move; "planned, never shipped" is also a move). (3) BARRIER PERSISTENCE \u2014 judge the SEQUENCE of moves after a block, not the mood: how many distinct routes past it they generate, whether they unblock their own path rather than wait to be rescued (never needing to be unblocked across the corpus is itself a top-tier signal; needing constant rescue caps the tier no matter the occasional brilliance). A confessed doubt is corroborating color, not a cap \u2014 it lowers the verdict only when it is the TERMINUS, with no route after it. (4) EXECUTION IS NOT AGENCY. Competently working through already-identified work \u2014 fixing a list of reported bugs, implementing a change someone directed, tuning a gate or threshold the task already called for \u2014 is execution and never climbs this ladder on its own, however clean. What converts the same stretch into agency evidence is the SELF-ORIGINATED LOOP around it: putting the thing in front of real users without being asked and systematically working what came back; going outside the codebase for evidence (user conversations, watching real adoption) and letting it REDIRECT the work mid-flight; deriving a constraint nobody handed them from how people will actually use the thing, then re-engineering to meet it. When choosing peaks, rank origination-of-direction above cleverness-of-implementation.
16827
+ \u2022 TASTE is how high and how RIGHT a quality bar they hold \u2014 the rare, specific, vindicated call the AI could never have reached on its own, or a developed up-front vision where the AI is weakest, plus knowing where NOT to impose a bar (letting the AI run on throwaway is calibration, not absence). Generic corrections the AI could have gone either way on are NON-EVIDENCE, never low taste; a low score on rote work is no penalty, while a withheld bar on taste-heavy work is a real miss. The verdict discipline is the same as everywhere: the ceiling is the tested bar, a bar shown once is a one-off until it recurs, and the base rate rides in the verdict.
16828
+
16829
+ THE PERSON-TYPE LADDERS (verbatim from the chat engine's lenses \u2014 the SAME ladders the person's chat report is placed on, so a 9 means one thing everywhere. They were authored for live-chat evidence: read them at PERSON level \u2014 "what kind of person produces this record" \u2014 and translate their stakes to the coding medium: shipping risk, irreversibility, measurement integrity, data loss. Where a marker says "conversation", read "session"):
16830
+
16831
+ ${axisLadders()}
16832
+
16833
+ AXIS STATS (code-computed \u2014 echo each verbatim into that axis's "statsLine"):
16834
+ ${axisStats}
16167
16835
 
16168
16836
  Output a SINGLE fenced \`\`\`json block:
16169
16837
  \`\`\`json
16170
16838
  {
16171
16839
  "overall": "",
16172
16840
  "signatureMoves": [ { "what": "", "session": "", "quote": "" } ],
16173
- "criteria": [ { "key": "taste", "headline": "", "insight": "" } ]
16174
- }
16175
- \`\`\``;
16841
+ "criteria": [ { "key": "taste", "headline": "", "insight": "" } ],
16842
+ "verdicts": {
16843
+ "judgement": { "best": 0, "low": 0, "high": 0, "confidence": "provisional|grounded|strong", "statsLine": "", "verdictLine": "", "peak": { "sessionId": "", "title": "", "date": "", "score": 0 }, "peaks": ["sessionId of the 2-3 takes that best DEMONSTRATE this axis, strongest first"], "conditions": "", "gap": "what the next rung's record would contain that this one doesn't" },
16844
+ "agency": null,
16845
+ "taste": null,
16846
+ "delegation": null
16847
+ }
16848
+ }
16849
+ \`\`\`
16850
+ (an axis whose criteria have no takes is null; the other two follow the schema above \u2014 "gap" is REQUIRED on every non-null verdict)`;
16851
+ }
16852
+ function applyVerdictSeatbelt(llm, takes, nGraded, log = (m) => console.warn(m)) {
16853
+ const { scored, qualifying, peak } = qualifyingTakes(takes);
16854
+ if (scored === 0 || !peak) return null;
16855
+ if (!llm || typeof llm !== "object") return null;
16856
+ const o = llm;
16857
+ const num2 = (v) => {
16858
+ const x = typeof v === "number" ? v : typeof v === "string" ? Number(v) : NaN;
16859
+ return Number.isFinite(x) ? Math.round(x) : null;
16860
+ };
16861
+ let best = num2(o.best);
16862
+ if (best == null) return null;
16863
+ best = Math.max(2, Math.min(11, best));
16864
+ let low = Math.max(1, Math.min(num2(o.low) ?? best, best));
16865
+ const high = Math.min(11, Math.max(num2(o.high) ?? best, best));
16866
+ const confidence = o.confidence === "grounded" || o.confidence === "strong" || o.confidence === "provisional" ? o.confidence : "provisional";
16867
+ if (low >= best && (qualifying <= 1 || confidence === "provisional")) {
16868
+ low = Math.max(1, best - (qualifying <= 1 ? 2 : 1));
16869
+ log(`[agglomerate] seatbelt: ${qualifying} qualifying take(s) but the model returned a point score (best ${best} = low) \u2014 range opened to ${low}-${high}; check the prompt's provisionality laws`);
16870
+ }
16871
+ const clean = (s, n) => String(s ?? "").replace(/\s*—\s*/g, ", ").replace(/\s+/g, " ").trim().slice(0, n);
16872
+ const citedId = o.peak && typeof o.peak === "object" ? String(o.peak.sessionId ?? "") : "";
16873
+ const cited = takes.find((t) => t.sessionId === citedId && typeof t.score === "number");
16874
+ const p = cited ?? peak;
16875
+ const ownScored = new Set(takes.filter((t) => typeof t.score === "number").map((t) => t.sessionId));
16876
+ const peaksArr = (Array.isArray(o.peaks) ? o.peaks : []).map((x) => String(x ?? "")).filter((id, i, a) => ownScored.has(id) && a.indexOf(id) === i).slice(0, 3);
16877
+ const gap = clean(o.gap, 500);
16878
+ if (!gap) {
16879
+ log(`[agglomerate] INVALID: no "gap" named for a placement (best ${best}) \u2014 the prompt requires one on every verdict`);
16880
+ throw new Error(`agglomerate: verdict missing its mandatory "gap" (placement best ${best}) \u2014 generation rejected, existing output kept`);
16881
+ }
16882
+ return {
16883
+ best,
16884
+ low,
16885
+ high,
16886
+ confidence,
16887
+ qualifying,
16888
+ scored,
16889
+ statsLine: axisStatsLine(takes, nGraded),
16890
+ verdictLine: clean(o.verdictLine, 600),
16891
+ peak: { sessionId: p.sessionId, title: oneLine(p.title, 90), date: (p.date || "").slice(0, 10), score: p.score },
16892
+ ...peaksArr.length ? { peaks: peaksArr } : {},
16893
+ conditions: clean(o.conditions, 600),
16894
+ gap
16895
+ };
16176
16896
  }
16177
- function validate(raw, n, costUsd) {
16897
+ function validate(raw, grades, costUsd) {
16178
16898
  if (!raw || typeof raw !== "object") return null;
16179
16899
  const r = raw;
16180
16900
  const overall = typeof r.overall === "string" ? r.overall.trim() : "";
16181
16901
  if (!overall) return null;
16902
+ if (!r.verdicts || typeof r.verdicts !== "object") return null;
16182
16903
  const keys = new Set(GRADED_CRITERIA.map((c) => c.key));
16183
16904
  const criteria = (Array.isArray(r.criteria) ? r.criteria : []).map((c) => {
16184
16905
  const o = c ?? {};
@@ -16190,34 +16911,43 @@ function validate(raw, n, costUsd) {
16190
16911
  const o = m ?? {};
16191
16912
  return { what: String(o.what ?? "").slice(0, 400), session: String(o.session ?? "").slice(0, 120), quote: String(o.quote ?? "").slice(0, 400) };
16192
16913
  }).filter((m) => m.what).slice(0, 8);
16193
- return { generatedAt: (/* @__PURE__ */ new Date()).toISOString(), sessionsUsed: n, overall, signatureMoves, criteria, meta: { costUsd } };
16914
+ const v = r.verdicts;
16915
+ const n = grades.length;
16916
+ const verdicts = {
16917
+ judgement: applyVerdictSeatbelt(v.judgement, takesFor(grades, AXIS_SOURCES.judgement), n),
16918
+ agency: applyVerdictSeatbelt(v.agency, takesFor(grades, AXIS_SOURCES.agency), n),
16919
+ taste: applyVerdictSeatbelt(v.taste, takesFor(grades, AXIS_SOURCES.taste), n),
16920
+ delegation: applyVerdictSeatbelt(v.delegation, takesFor(grades, AXIS_SOURCES.delegation), n)
16921
+ };
16922
+ return { generatedAt: (/* @__PURE__ */ new Date()).toISOString(), sessionsUsed: n, overall, signatureMoves, criteria, verdicts, meta: { costUsd } };
16194
16923
  }
16195
16924
  async function agglomerate(opts) {
16196
16925
  let files = [];
16197
16926
  try {
16198
- files = (await fs7.readdir(opts.gradesDir)).filter((f) => f.endsWith(".json")).sort();
16927
+ files = (await fs8.readdir(opts.gradesDir)).filter((f) => f.endsWith(".json")).sort();
16199
16928
  } catch {
16200
16929
  return null;
16201
16930
  }
16202
16931
  const grades = [];
16203
16932
  for (const f of files) {
16204
16933
  try {
16205
- grades.push(JSON.parse(await fs7.readFile(path10.join(opts.gradesDir, f), "utf8")));
16934
+ grades.push(JSON.parse(await fs8.readFile(path11.join(opts.gradesDir, f), "utf8")));
16206
16935
  } catch {
16207
16936
  }
16208
16937
  }
16209
16938
  if (grades.length === 0) return null;
16210
16939
  const prompt = buildPrompt(grades);
16211
16940
  const system = opts.sourceDir ? SYSTEM + sourceLookupNote() : SYSTEM;
16212
- const sha = promptSha([system, prompt, opts.model ?? "sonnet"]);
16941
+ const model2 = opts.model ?? "opus";
16942
+ const sha = promptSha([system, prompt, model2]);
16213
16943
  if (!opts.refresh) {
16214
- const prev = await reusableOutput(opts.outFile, sha, (o) => !!o.overall);
16944
+ const prev = await reusableOutput(opts.outFile, sha, (o) => !!o.overall && o.verdicts !== void 0);
16215
16945
  if (prev) {
16216
16946
  console.log(`[agglomerate] inputs unchanged \u2014 reusing output from ${prev.generatedAt} (--refresh to regenerate)`);
16217
16947
  return prev;
16218
16948
  }
16219
16949
  }
16220
- const sandbox = opts.sourceDir ?? await fs7.mkdtemp(path10.join(os2.tmpdir(), "ps-coding-agg-"));
16950
+ const sandbox = opts.sourceDir ?? await fs8.mkdtemp(path11.join(os3.tmpdir(), "ps-coding-agg-"));
16221
16951
  try {
16222
16952
  const run2 = await invokeAgent({
16223
16953
  prompt,
@@ -16226,21 +16956,21 @@ async function agglomerate(opts) {
16226
16956
  allowedTools: opts.sourceDir ? ["Read", "Grep", "Glob"] : ["Read"],
16227
16957
  maxTurns: opts.sourceDir ? 10 : 6,
16228
16958
  timeoutMs: 3e5,
16229
- model: opts.model ?? "sonnet"
16959
+ model: model2
16230
16960
  });
16231
- const agg = validate(run2.json, grades.length, run2.costUsd);
16232
- if (!agg) return null;
16961
+ const agg = validate(run2.json, grades, run2.costUsd);
16962
+ if (!agg) throw new Error("agglomerate: the model returned no valid synthesis (overall + verdicts required) \u2014 existing output kept");
16233
16963
  agg.promptSha = sha;
16234
- await fs7.writeFile(opts.outFile, JSON.stringify(agg, null, 2));
16964
+ await fs8.writeFile(opts.outFile, JSON.stringify(agg, null, 2));
16235
16965
  return agg;
16236
16966
  } finally {
16237
- if (!opts.sourceDir) await fs7.rm(sandbox, { recursive: true, force: true }).catch(() => {
16967
+ if (!opts.sourceDir) await fs8.rm(sandbox, { recursive: true, force: true }).catch(() => {
16238
16968
  });
16239
16969
  }
16240
16970
  }
16241
16971
 
16242
16972
  // ../../lib/agents/coding/profile.ts
16243
- import path11 from "path";
16973
+ import path12 from "path";
16244
16974
 
16245
16975
  // ../../lib/agents/coding/walkthrough.ts
16246
16976
  var IDLE_CAP_MS = 12 * 6e4;
@@ -16251,7 +16981,7 @@ var TRANSCRIPT_LINE_RE = new RegExp(`^\\s*(${NOTE})((,| and) ${NOTE})*\\s*$|^\\s
16251
16981
 
16252
16982
  // ../../lib/calibration/index.ts
16253
16983
  var DEFAULT_CALIBRATION = {
16254
- version: "2026-07-16.2",
16984
+ version: "2026-07-21.1",
16255
16985
  // = RUBRIC_FINGERPRINT of the shipped npm rubric (packages/coding-analyzer/
16256
16986
  // src/grade/criteria.ts). A unit test fails loud when the rubric changes
16257
16987
  // without this being updated (and re-pushed to the server).
@@ -16347,13 +17077,14 @@ var DEFAULT_CALIBRATION = {
16347
17077
  },
16348
17078
  codingBenchmarks: {
16349
17079
  flow: {
16350
- // typical knowledge worker ≈ 35% of an 8h day focused; ~4h/day is the
16351
- // recognized deep-work ceiling (Newport) 50% most sit far below it.
17080
+ // typical knowledge worker ≈ 35% of an 8h day focused; the ~4h/day
17081
+ // deep-work ceiling (Newport) sits nearer ~40% of a real (9-10h) top
17082
+ // performer's day — 50% overstated it (owner call 2026-07-21).
16352
17083
  typicalPctOfDay: 0.35,
16353
- topPctOfDay: 0.5,
17084
+ topPctOfDay: 0.4,
16354
17085
  tag: "measured",
16355
- source: "RescueTime 2019 (~2h48m focused/day) \xB7 Cal Newport, Deep Work (~4h/day deep-work ceiling)",
16356
- line: "the best spend ~half the workday in true deep flow; ~4h/day is the human ceiling"
17086
+ source: "RescueTime 2019 (~2h48m focused/day) \xB7 Cal Newport, Deep Work (~4h/day deep-work ceiling against a 9-10h day)",
17087
+ line: "the best spend ~40% of the workday in true deep flow; ~4h/day is the human ceiling"
16357
17088
  },
16358
17089
  longestRun: {
16359
17090
  typicalHours: 0.67,
@@ -16402,18 +17133,18 @@ var BEST = DEFAULT_CALIBRATION.codingBenchmarks;
16402
17133
 
16403
17134
  // ../../lib/agents/coding/profile.ts
16404
17135
  var ROOT = process.cwd();
16405
- var CODING_DIR = process.env.POLYMATH_DATA_DIR ? path11.join(process.env.POLYMATH_DATA_DIR, "coding") : path11.join(ROOT, ".data", "coding");
16406
- var GRADES = path11.join(CODING_DIR, "grades");
17136
+ var CODING_DIR = process.env.POLYMATH_DATA_DIR ? path12.join(process.env.POLYMATH_DATA_DIR, "coding") : path12.join(ROOT, ".data", "coding");
17137
+ var GRADES = path12.join(CODING_DIR, "grades");
16407
17138
 
16408
17139
  // ../../scripts/coding-agglomerate.mts
16409
17140
  var argv = process.argv.slice(2);
16410
- var model = argv.indexOf("--model") >= 0 ? argv[argv.indexOf("--model") + 1] : "sonnet";
17141
+ var model = argv.indexOf("--model") >= 0 ? argv[argv.indexOf("--model") + 1] : "opus";
16411
17142
  var CODING = CODING_DIR;
16412
17143
  async function main() {
16413
17144
  console.log(`[agglomerate] synthesizing across graded sessions on ${model}\u2026`);
16414
- const sessions = await fs8.readFile(path12.join(CODING, "sessions.json"), "utf8").then(JSON.parse).catch(() => []);
17145
+ const sessions = await fs9.readFile(path13.join(CODING, "sessions.json"), "utf8").then(JSON.parse).catch(() => []);
16415
17146
  await ensureCodingDocs(CODING, sessions);
16416
- const agg = await agglomerate({ model, gradesDir: path12.join(CODING, "grades"), outFile: path12.join(CODING, "agglomerate.json"), refresh: process.argv.includes("--refresh"), sourceDir: CODING });
17147
+ const agg = await agglomerate({ model, gradesDir: path13.join(CODING, "grades"), outFile: path13.join(CODING, "agglomerate.json"), refresh: process.argv.includes("--refresh"), sourceDir: CODING });
16417
17148
  if (!agg) {
16418
17149
  console.log("[agglomerate] no grades found \u2014 run coding-grade.mts first");
16419
17150
  return;
@@ -16426,6 +17157,19 @@ ${agg.overall}
16426
17157
  console.log(`SIGNATURE MOVES:`);
16427
17158
  for (const m of agg.signatureMoves) console.log(` \u2022 ${m.what} \u2014 ${m.session}
16428
17159
  "${m.quote}"`);
17160
+ if (agg.verdicts) {
17161
+ console.log(`
17162
+ VERDICTS:`);
17163
+ for (const [axis, v] of Object.entries(agg.verdicts)) {
17164
+ if (!v) {
17165
+ console.log(` ${axis}: null (no takes of its own)`);
17166
+ continue;
17167
+ }
17168
+ console.log(` ${axis}: best ${v.best} \xB7 range ${v.low}-${v.high} \xB7 ${v.confidence} (${v.qualifying} qualifying / ${v.scored} scored)`);
17169
+ console.log(` stats: ${v.statsLine}`);
17170
+ console.log(` ${v.verdictLine}`);
17171
+ }
17172
+ }
16429
17173
  console.log(`
16430
17174
  wrote \u2192 .data/coding/agglomerate.json`);
16431
17175
  }