polymath-society 0.2.11 → 0.2.13

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 (36) hide show
  1. package/dist/cli.js +109 -49
  2. package/dist/engine/chat-loops.js +23 -2
  3. package/dist/engine/exp-allfacets.js +23 -2
  4. package/dist/engine/exp-person.js +23 -2
  5. package/dist/engine/exp-pipeline.js +22 -1
  6. package/dist/engine/ingest-export.js +2 -2
  7. package/dist/engine/peak-demos.js +23 -2
  8. package/dist/engine/person-dimension-summary.js +23 -2
  9. package/dist/engine/person-facet-lines.js +23 -2
  10. package/dist/engine/person-headline.js +23 -2
  11. package/dist/engine/person-report.js +23 -2
  12. package/dist/engine/person-self-image.js +23 -2
  13. package/dist/engine/public-report.js +25 -4
  14. package/dist/engine/run-analysis.js +23 -2
  15. package/dist/engine/run-tagger.js +22 -1
  16. package/dist/index.js +37 -8
  17. package/dist/pipeline/coding-agglomerate.js +25 -4
  18. package/dist/pipeline/coding-aggregate.js +3 -3
  19. package/dist/pipeline/coding-build.js +3 -3
  20. package/dist/pipeline/coding-coaching.js +25 -4
  21. package/dist/pipeline/coding-day-digest.js +25 -4
  22. package/dist/pipeline/coding-delegation.js +25 -4
  23. package/dist/pipeline/coding-expertise.js +25 -4
  24. package/dist/pipeline/coding-flow.js +3 -3
  25. package/dist/pipeline/coding-focus.js +22 -1
  26. package/dist/pipeline/coding-frontier-detail.js +25 -4
  27. package/dist/pipeline/coding-frontier.js +3 -3
  28. package/dist/pipeline/coding-gap-dist.js +3 -3
  29. package/dist/pipeline/coding-gap.js +25 -4
  30. package/dist/pipeline/coding-grade.js +40 -5
  31. package/dist/pipeline/coding-nutshell.js +25 -4
  32. package/dist/pipeline/coding-projects.js +3 -3
  33. package/dist/pipeline/coding-walkthrough.js +41 -5
  34. package/dist/web/app.js +65 -2
  35. package/dist/web/styles.css +1 -1
  36. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -841,7 +841,19 @@ function aiWindowCutoff(sessions, opts = {}) {
841
841
  const floorStart = gradableStarts[floor - 1];
842
842
  return floorStart < windowCutoff ? floorStart : windowCutoff;
843
843
  }
844
- var GATE, AI_WINDOW;
844
+ function maxGraded() {
845
+ const n = Number(process.env.POLYMATH_MAX_GRADED);
846
+ return Number.isFinite(n) && n >= 0 ? n : MAX_GRADED_DEFAULT;
847
+ }
848
+ function substanceRank(a, b) {
849
+ return b.humanChars * Math.log1p(b.humanTurns) - a.humanChars * Math.log1p(a.humanTurns);
850
+ }
851
+ function capGradable(gradable) {
852
+ const sorted = gradable.slice().sort(substanceRank);
853
+ const cap = maxGraded();
854
+ return cap > 0 && sorted.length > cap ? sorted.slice(0, cap) : sorted;
855
+ }
856
+ var GATE, AI_WINDOW, MAX_GRADED_DEFAULT;
845
857
  var init_gate = __esm({
846
858
  "../coding-core/dist/gate.js"() {
847
859
  "use strict";
@@ -860,6 +872,7 @@ var init_gate = __esm({
860
872
  minSessions: 40
861
873
  // extend the window back until this many gradable sessions
862
874
  };
875
+ MAX_GRADED_DEFAULT = 150;
863
876
  }
864
877
  });
865
878
 
@@ -868,10 +881,14 @@ var gate_exports = {};
868
881
  __export(gate_exports, {
869
882
  AI_WINDOW: () => AI_WINDOW,
870
883
  GATE: () => GATE,
884
+ MAX_GRADED_DEFAULT: () => MAX_GRADED_DEFAULT,
871
885
  aiWindowCutoff: () => aiWindowCutoff,
886
+ capGradable: () => capGradable,
872
887
  isGradable: () => isGradable,
873
888
  isTrivial: () => isTrivial,
874
- partition: () => partition
889
+ maxGraded: () => maxGraded,
890
+ partition: () => partition,
891
+ substanceRank: () => substanceRank
875
892
  });
876
893
  var init_gate2 = __esm({
877
894
  "src/gate.ts"() {
@@ -880,6 +897,31 @@ var init_gate2 = __esm({
880
897
  }
881
898
  });
882
899
 
900
+ // ../coding-core/dist/env.js
901
+ function claudeCliEnv(base2 = process.env) {
902
+ if (process.env.POLYMATH_USE_API_KEY === "1")
903
+ return base2;
904
+ const present = AUTH_VARS.filter((k) => base2[k]);
905
+ if (!present.length)
906
+ return base2;
907
+ if (!warned) {
908
+ warned = true;
909
+ console.error(`[polymath-society] ${present.join(" + ")} is set in your shell \u2014 ignoring it so the analysis runs on your claude.ai login (the key would take over auth and either fail or bill your API account). Set POLYMATH_USE_API_KEY=1 if you really want the API key used.`);
910
+ }
911
+ const scrubbed = { ...base2 };
912
+ for (const k of AUTH_VARS)
913
+ delete scrubbed[k];
914
+ return scrubbed;
915
+ }
916
+ var AUTH_VARS, warned;
917
+ var init_env = __esm({
918
+ "../coding-core/dist/env.js"() {
919
+ "use strict";
920
+ AUTH_VARS = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"];
921
+ warned = false;
922
+ }
923
+ });
924
+
883
925
  // src/grade/adapter.ts
884
926
  function extractJson(text2) {
885
927
  const fences = [...text2.matchAll(/```json\s*([\s\S]*?)```/gi)];
@@ -1005,7 +1047,7 @@ var init_backends = __esm({
1005
1047
  });
1006
1048
 
1007
1049
  // src/grade/cliAdapter.ts
1008
- import { spawn } from "child_process";
1050
+ import { spawn as spawn2 } from "child_process";
1009
1051
  function toolTarget(input) {
1010
1052
  return String(input.file_path ?? input.path ?? input.pattern ?? input.query ?? input.command ?? "");
1011
1053
  }
@@ -1013,6 +1055,7 @@ var cliAdapter;
1013
1055
  var init_cliAdapter = __esm({
1014
1056
  "src/grade/cliAdapter.ts"() {
1015
1057
  "use strict";
1058
+ init_env();
1016
1059
  init_adapter();
1017
1060
  init_backends();
1018
1061
  cliAdapter = {
@@ -1047,9 +1090,11 @@ var init_cliAdapter = __esm({
1047
1090
  let costUsd;
1048
1091
  let numTurns;
1049
1092
  await new Promise((resolve2, reject) => {
1050
- const child = spawn(bin, args, {
1093
+ const child = spawn2(bin, args, {
1051
1094
  cwd: inv.cwd ?? inv.addDir,
1052
- env: process.env,
1095
+ // scrubbed: a stray ANTHROPIC_API_KEY in the user's shell hijacks the
1096
+ // claude CLI away from their claude.ai login (coding-core/env.ts)
1097
+ env: claudeCliEnv(),
1053
1098
  stdio: ["ignore", "pipe", "pipe"],
1054
1099
  // Own process group, so a timeout can kill the WHOLE tree (claude spawns
1055
1100
  // children that otherwise orphan and pile up).
@@ -1148,7 +1193,7 @@ var init_cliAdapter = __esm({
1148
1193
  });
1149
1194
 
1150
1195
  // src/grade/codexAdapter.ts
1151
- import { spawn as spawn2 } from "child_process";
1196
+ import { spawn as spawn3 } from "child_process";
1152
1197
  function composePrompt(inv, roots) {
1153
1198
  return [
1154
1199
  inv.systemPrompt ? `<system>
@@ -1190,7 +1235,7 @@ var init_codexAdapter = __esm({
1190
1235
  let resultText = "";
1191
1236
  let numTurns = 0;
1192
1237
  await new Promise((resolve2, reject) => {
1193
- const child = spawn2(bin, args, { cwd, env: process.env, stdio: ["ignore", "pipe", "pipe"] });
1238
+ const child = spawn3(bin, args, { cwd, env: process.env, stdio: ["ignore", "pipe", "pipe"] });
1194
1239
  let buf = "";
1195
1240
  let err = "";
1196
1241
  const timeoutMs = inv.timeoutMs ?? 3e5;
@@ -1496,15 +1541,15 @@ var init_exportLinks = __esm({
1496
1541
  });
1497
1542
 
1498
1543
  // src/notify.ts
1499
- import { spawn as spawn8 } from "node:child_process";
1544
+ import { spawn as spawn9 } from "node:child_process";
1500
1545
  function systemNotify(title, body) {
1501
1546
  try {
1502
1547
  const opts = { stdio: "ignore" };
1503
1548
  if (process.platform === "darwin") {
1504
- spawn8("osascript", ["-e", `display notification ${JSON.stringify(body)} with title ${JSON.stringify(title)} sound name "Glass"`], opts).on("error", () => {
1549
+ spawn9("osascript", ["-e", `display notification ${JSON.stringify(body)} with title ${JSON.stringify(title)} sound name "Glass"`], opts).on("error", () => {
1505
1550
  });
1506
1551
  } else if (process.platform === "linux") {
1507
- spawn8("notify-send", [title, body], opts).on("error", () => {
1552
+ spawn9("notify-send", [title, body], opts).on("error", () => {
1508
1553
  });
1509
1554
  }
1510
1555
  } catch {
@@ -2458,19 +2503,19 @@ function makeMultiBar(out = process.stderr) {
2458
2503
  const lanes = /* @__PURE__ */ new Map();
2459
2504
  let link = "";
2460
2505
  let paintedRows = 0;
2461
- const laneText = (name17, l) => {
2462
- const w = l.within ? ` ${l.within.done}/${l.within.total}` : "";
2463
- return `${name17} ${l.i}/${l.total} ${l.label.slice(0, 26)}${w}`;
2464
- };
2465
2506
  const rows = () => {
2466
- const frac = (l) => l.total ? (l.i - 1 + (l.within && l.within.total ? l.within.done / l.within.total : 0)) / l.total : 0;
2467
- const parts = [...lanes.entries()].map(([n, l]) => laneText(n, l));
2468
- const avg2 = lanes.size ? [...lanes.values()].reduce((a, l) => a + frac(l), 0) / lanes.size : 0;
2469
- const width = 14;
2470
- const fill = Math.max(0, Math.min(width, Math.round(avg2 * width)));
2507
+ const width = 16;
2471
2508
  const elapsedMin = Math.round((Date.now() - t0) / 6e4);
2472
- const bar = `[${"\u2588".repeat(fill)}${"\u2591".repeat(width - fill)}] ${parts.join(" \xB7 ")} \xB7 ${elapsedMin}m`;
2473
- return link ? [bar, `\u21B3 report (live, fills in as stages finish) \u2192 ${link}`] : [bar];
2509
+ const laneRow = ([name17, l]) => {
2510
+ const frac = l.total ? (l.i - 1 + (l.within && l.within.total ? l.within.done / l.within.total : 0)) / l.total : 0;
2511
+ const clamped = Math.max(0, Math.min(1, frac));
2512
+ const fill = Math.round(clamped * width);
2513
+ return ` ${name17.padEnd(6)} [${"\u2588".repeat(fill)}${"\u2591".repeat(width - fill)}] ${String(Math.round(clamped * 100)).padStart(3)}%`;
2514
+ };
2515
+ const out2 = [];
2516
+ if (link) out2.push(`\u21B3 your reports (live, fill in as stages finish) \u2192 ${link} \xB7 ${elapsedMin}m`);
2517
+ out2.push(...[...lanes.entries()].map(laneRow));
2518
+ return out2.length ? out2 : [`(starting\u2026 ${elapsedMin}m)`];
2474
2519
  };
2475
2520
  const clearPinned = () => {
2476
2521
  if (!paintedRows) return;
@@ -2601,7 +2646,19 @@ try {
2601
2646
  import { promises as fs36, existsSync as existsSync7 } from "fs";
2602
2647
  import path41 from "path";
2603
2648
  import { fileURLToPath as fileURLToPath5 } from "url";
2604
- import { spawn as spawn9 } from "child_process";
2649
+
2650
+ // src/openBrowser.ts
2651
+ import { spawn } from "child_process";
2652
+ function openBrowser(url, cmd) {
2653
+ const bin = cmd ?? (process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open");
2654
+ try {
2655
+ const child = spawn(bin, [url], { stdio: "ignore", detached: true });
2656
+ child.on("error", () => console.log(` (couldn't open a browser here \u2014 open ${url} yourself)`));
2657
+ child.unref();
2658
+ } catch {
2659
+ console.log(` (couldn't open a browser here \u2014 open ${url} yourself)`);
2660
+ }
2661
+ }
2605
2662
 
2606
2663
  // src/analyze.ts
2607
2664
  init_raw2();
@@ -3545,7 +3602,7 @@ var CODING_CRITERIA = [
3545
3602
  label: "Abstraction \u2014 seeing the load-bearing thing, and being right",
3546
3603
  graded: true,
3547
3604
  definition: "Under genuine ambiguity (an obvious path sitting right there, no answer key): did the USER see that the obvious path was subtly wrong \u2014 or that something decisive was invisible \u2014 and do the non-obvious thing that made it right, AND were they right? The graded unit is the whole move: the CATCH (noticing the fork) -> the QUESTION (formulating it) -> the CALL (resolving it). The move surfaces three interchangeable ways, scored identically: a REFRAME (collapse a mess to its real axis), a QUESTION (pose the hard thing nobody posed), or an INSTRUMENT (build the code/chart/structure that makes the truth legible, then read it). Tag the SUBSTANCE, not the medium \u2014 a chart built (technical act) to make a human-intensity call legible is a JUDGMENT catch.",
3548
- read: "FOUR LEVERS set the height: (1) INVISIBILITY \u2014 how non-obvious there was anything to catch; a sharp operator in the flow drives past it (the DOMINANT lever); (2) DIFFICULTY of forming the catch; (3) STAKES \u2014 'without this, things silently go wrong' is the 9-10 condition; (4) SOUNDNESS \u2014 did the call hold. THREE OVERRIDING GATES: (a) OBVIOUSNESS KILLS IT \u2014 a correct, even load-bearing catch a sharp operator reaches anyway scores LOW ('you're evaluating the person not the AI' is correct but obvious -> ~5; 'compute in the OAuth dead-time' is real but fairly obvious -> ~6). (b) LEVERAGE BEATS INSIGHT \u2014 a move whose payoff is a HIGHER RATE OF FUTURE INSIGHT (building the tool that lets him set his own boundaries; timestamp-by-timestamp structure to instruct the grader precisely) raises the bandwidth of the loop that produces every later catch, and can outrank a clean one-off reframe. (c) SOUNDNESS GATE \u2014 a confident WRONG call to a noticed fork is an ANTI-SIGNAL; an honest 'not sure, here's a range' is NOT penalized. HUNT THE FORK BLIND \u2014 reconstruct what continuing-without-noticing looked like, then check whether/why he diverged; do NOT hand yourself the fork pre-formed or you score everyone's problem-finding a 10. TAG every instance: kind = systems | judgment | both (+ optional register: human/product/measurement). Reasoning and instrument-building are the SAME criterion. ANCHORS: 10 = 'OCEAN won't change, measure effectiveness of actions' (reframe that redefines the measure) / 'don't hurt Natalie, not long-term compatible' (lived judgment, requires being the person) / 'plot it sorted, let me set the boundaries' (leverage \u2014 builds the bandwidth tool); 9 = 'word count IS the proxy \u2014 sitting there is unfakeable focus' / 'uncertainty collapses in that direction'; 8 = 'a better metric is the difficulty of content + original synthesis' (hard opening question); 7 = 'this candidate seems too strong for his judgement to be real' (real non-obvious catch, modest stakes); 6 = 'compute in the OAuth dead-time' / 'why overcomplicate it, single agent' (real but obvious); 5 = 'you're evaluating the person not the AI' (correct but obvious).",
3605
+ read: "FOUR LEVERS set the height: (1) INVISIBILITY \u2014 how non-obvious there was anything to catch; a sharp operator in the flow drives past it (the DOMINANT lever); (2) DIFFICULTY of forming the catch; (3) STAKES \u2014 'without this, things silently go wrong' is the 9-10 condition; (4) SOUNDNESS \u2014 did the call hold. THREE OVERRIDING GATES: (a) OBVIOUSNESS KILLS IT \u2014 a correct, even load-bearing catch a sharp operator reaches anyway scores LOW ('you're evaluating the person not the AI' is correct but obvious -> ~5; 'compute in the OAuth dead-time' is real but fairly obvious -> ~6). (b) LEVERAGE BEATS INSIGHT \u2014 a move whose payoff is a HIGHER RATE OF FUTURE INSIGHT (building the tool that lets him set his own boundaries; timestamp-by-timestamp structure to instruct the grader precisely) raises the bandwidth of the loop that produces every later catch, and can outrank a clean one-off reframe. (c) SOUNDNESS GATE \u2014 a confident WRONG call to a noticed fork is an ANTI-SIGNAL; an honest 'not sure, here's a range' is NOT penalized. HUNT THE FORK BLIND \u2014 reconstruct what continuing-without-noticing looked like, then check whether/why he diverged; do NOT hand yourself the fork pre-formed or you score everyone's problem-finding a 10. TAG every instance: kind = systems | judgment | both (+ optional register: human/product/measurement). Reasoning and instrument-building are the SAME criterion. ANCHORS: 10 = 'OCEAN won't change, measure effectiveness of actions' (reframe that redefines the measure) / a human-stakes call where the person overrode the analytically-clean answer on knowledge only they could have about someone involved, and was right (lived judgment, requires being the person) / 'plot it sorted, let me set the boundaries' (leverage \u2014 builds the bandwidth tool); 9 = 'word count IS the proxy \u2014 sitting there is unfakeable focus' / 'uncertainty collapses in that direction'; 8 = 'a better metric is the difficulty of content + original synthesis' (hard opening question); 7 = 'this candidate seems too strong for his judgement to be real' (real non-obvious catch, modest stakes); 6 = 'compute in the OAuth dead-time' / 'why overcomplicate it, single agent' (real but obvious); 5 = 'you're evaluating the person not the AI' (correct but obvious).",
3549
3606
  rungs: [
3550
3607
  { level: 2, marker: "A fork existed; defers the call to the AI, or takes the obvious branch; vague." },
3551
3608
  { level: 4, marker: "Notices something, but the question is vague or obvious \u2014 anyone in the seat asks it." },
@@ -4138,11 +4195,11 @@ async function getAccessToken(dataDir) {
4138
4195
 
4139
4196
  // ../../lib/calibration/index.ts
4140
4197
  var DEFAULT_CALIBRATION = {
4141
- version: "2026-07-14.2",
4198
+ version: "2026-07-15.1",
4142
4199
  // = RUBRIC_FINGERPRINT of the shipped npm rubric (packages/coding-analyzer/
4143
4200
  // src/grade/criteria.ts). A unit test fails loud when the rubric changes
4144
4201
  // without this being updated (and re-pushed to the server).
4145
- rubricVersion: "f51b3a93a3",
4202
+ rubricVersion: "7983c01d53",
4146
4203
  // Canonical scale = the one the product owner set for the public report
4147
4204
  // (11=0.01% … 8=2%), extended downward from the old report ladder. The old
4148
4205
  // CodeAnalysisView / npm-viewer maps (7→10%/15%, 6→25%/30%) were drift, not
@@ -4360,7 +4417,8 @@ import { readFileSync } from "fs";
4360
4417
  import path13 from "path";
4361
4418
 
4362
4419
  // ../../lib/agents/shared/cliAdapter.ts
4363
- import { spawn as spawn3 } from "child_process";
4420
+ init_env();
4421
+ import { spawn as spawn4 } from "child_process";
4364
4422
  import { promises as fs7 } from "fs";
4365
4423
  import path7 from "path";
4366
4424
 
@@ -4466,9 +4524,11 @@ var cliAdapter2 = {
4466
4524
  let numTurns;
4467
4525
  let usage;
4468
4526
  await new Promise((resolve2, reject) => {
4469
- const child = spawn3(CLAUDE_BIN, args, {
4527
+ const child = spawn4(CLAUDE_BIN, args, {
4470
4528
  cwd: inv.cwd ?? inv.addDir,
4471
- env: process.env,
4529
+ // scrubbed: a stray ANTHROPIC_API_KEY in the user's shell hijacks the
4530
+ // claude CLI away from their claude.ai login (coding-core/env.ts)
4531
+ env: claudeCliEnv(),
4472
4532
  stdio: ["ignore", "pipe", "pipe"],
4473
4533
  // Own process group, so a timeout can kill the WHOLE tree (claude spawns
4474
4534
  // its own children that otherwise orphan and pile up — the root cause of
@@ -4594,7 +4654,7 @@ var cliAdapter2 = {
4594
4654
  };
4595
4655
 
4596
4656
  // ../../lib/agents/shared/codexAdapter.ts
4597
- import { spawn as spawn4 } from "child_process";
4657
+ import { spawn as spawn5 } from "child_process";
4598
4658
  import { existsSync as existsSync4, statSync } from "fs";
4599
4659
  import path9 from "path";
4600
4660
 
@@ -4748,7 +4808,7 @@ var codexAdapter2 = {
4748
4808
  let resultText = "";
4749
4809
  let numTurns = 0;
4750
4810
  await new Promise((resolve2, reject) => {
4751
- const child = spawn4(bin, args, {
4811
+ const child = spawn5(bin, args, {
4752
4812
  cwd,
4753
4813
  env: process.env,
4754
4814
  stdio: ["ignore", "pipe", "pipe"]
@@ -4826,7 +4886,7 @@ var codexAdapter2 = {
4826
4886
  };
4827
4887
 
4828
4888
  // ../../lib/agents/shared/cursorAdapter.ts
4829
- import { spawn as spawn5 } from "child_process";
4889
+ import { spawn as spawn6 } from "child_process";
4830
4890
  function composePrompt3(inv, roots) {
4831
4891
  return [
4832
4892
  inv.systemPrompt ? `<system>
@@ -4849,7 +4909,7 @@ var cursorAdapter = {
4849
4909
  const started = Date.now();
4850
4910
  let out = "";
4851
4911
  await new Promise((resolve2, reject) => {
4852
- const child = spawn5(bin, args, {
4912
+ const child = spawn6(bin, args, {
4853
4913
  cwd: inv.cwd ?? inv.addDir,
4854
4914
  env: process.env,
4855
4915
  stdio: ["ignore", "pipe", "pipe"]
@@ -20837,7 +20897,7 @@ var growthLens = {
20837
20897
  {
20838
20898
  key: "implementation",
20839
20899
  name: "Observed execution improvement",
20840
- definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament (often OCD-like), so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
20900
+ definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament, so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
20841
20901
  rungs: [
20842
20902
  { level: 3, marker: "The same BEHAVIORS recur across the window, unchanged \u2014 recognition (if any) never becomes a change in action. (A recurring feeling alongside changed behavior does NOT belong here \u2014 that is a fix, scored higher.)" },
20843
20903
  { level: 5, marker: "Occasionally a fix happens \u2014 intends to solve, and sometimes it lands, but not usually." },
@@ -24494,8 +24554,9 @@ function startServer(opts) {
24494
24554
  if (req.method === "GET" && route === "/auth/callback") {
24495
24555
  try {
24496
24556
  const id = await completeLogin(dataDir, new URL(url, serverUrl).searchParams);
24557
+ const back = host === "127.0.0.1" ? serverUrl.replace("//127.0.0.1:", "//localhost:") : serverUrl;
24497
24558
  res.writeHead(200, { "content-type": MIME[".html"] });
24498
- res.end(`<!doctype html><meta charset="utf-8"><title>Signed in</title><body style="font-family:system-ui;padding:40px"><p>Signed in as <b>${id.email.replace(/</g, "&lt;")}</b>.</p><p><a href="/">Back to your report</a> (or just close this tab \u2014 the report page picks it up on its own).</p></body>`);
24559
+ res.end(`<!doctype html><meta charset="utf-8"><title>Signed in</title><body style="font-family:system-ui;padding:40px"><p>Signed in as <b>${id.email.replace(/</g, "&lt;")}</b>.</p><p><a href="${back}/">Back to your report</a> (or just close this tab \u2014 the report page picks it up on its own).</p></body>`);
24499
24560
  } catch (e) {
24500
24561
  res.writeHead(400, { "content-type": MIME[".html"] });
24501
24562
  res.end(`<!doctype html><meta charset="utf-8"><title>Sign-in failed</title><body style="font-family:system-ui;padding:40px"><p><b>Sign-in failed.</b></p><p>${String(e.message).replace(/</g, "&lt;")}</p><p><a href="/auth/login">Try again</a></p></body>`);
@@ -24659,7 +24720,12 @@ function startServer(opts) {
24659
24720
  }).catch(() => {
24660
24721
  });
24661
24722
  resolve2({
24662
- url: serverUrl,
24723
+ // The DISPLAYED/opened URL says localhost — friendlier than 127.0.0.1
24724
+ // (owner call 2026-07-15); same server, same loopback. serverUrl itself
24725
+ // stays on the bound host because the Google sign-in redirect is
24726
+ // allow-listed for http://127.0.0.1:*/** in Supabase — auth flows
24727
+ // through 127.0.0.1 no matter which name the person's tab uses.
24728
+ url: host === "127.0.0.1" ? `http://localhost:${port}` : serverUrl,
24663
24729
  port,
24664
24730
  close: () => new Promise((r) => server.close(() => r())),
24665
24731
  setProfile: (p) => {
@@ -24678,7 +24744,7 @@ function startServer(opts) {
24678
24744
  }
24679
24745
 
24680
24746
  // src/pipeline.ts
24681
- import { spawn as spawn6 } from "child_process";
24747
+ import { spawn as spawn7 } from "child_process";
24682
24748
  import os8 from "os";
24683
24749
  import path36 from "path";
24684
24750
  import { existsSync as existsSync5, promises as fs31 } from "fs";
@@ -24939,7 +25005,7 @@ function stageInvocation(repoRoot, scriptRel, args) {
24939
25005
  function runStage(repoRoot, st, env, onLine) {
24940
25006
  return new Promise((resolve2, reject) => {
24941
25007
  const { cmd, argv, cwd } = stageInvocation(repoRoot, st.script, st.args);
24942
- const child = spawn6(cmd, argv, { cwd, env, stdio: ["ignore", "pipe", "pipe"] });
25008
+ const child = spawn7(cmd, argv, { cwd, env, stdio: ["ignore", "pipe", "pipe"] });
24943
25009
  const pump = (buf) => {
24944
25010
  if (!onLine) return;
24945
25011
  for (const line of buf.toString().split(/\r?\n/)) if (line.trim()) onLine(line);
@@ -24970,11 +25036,12 @@ function upToDateSkip(i) {
24970
25036
  }
24971
25037
  async function evalUpToDate(codingDir, threshold, regrade) {
24972
25038
  try {
24973
- const { partition: partition2, aiWindowCutoff: aiWindowCutoff2 } = await Promise.resolve().then(() => (init_gate2(), gate_exports));
25039
+ const { partition: partition2, aiWindowCutoff: aiWindowCutoff2, capGradable: capGradable2 } = await Promise.resolve().then(() => (init_gate2(), gate_exports));
24974
25040
  const sessions = JSON.parse(await fs31.readFile(path36.join(codingDir, "sessions.json"), "utf8"));
24975
25041
  const live = sessions.filter((s) => s.klass === "interactive" && !s.duplicateOf);
24976
25042
  const cutoff = aiWindowCutoff2(live);
24977
- const { gradable } = partition2(cutoff ? live.filter((s) => (s.start ?? "") >= cutoff) : live);
25043
+ const { gradable: uncapped } = partition2(cutoff ? live.filter((s) => (s.start ?? "") >= cutoff) : live);
25044
+ const gradable = capGradable2(uncapped);
24978
25045
  const graded = new Set(
24979
25046
  (await fs31.readdir(path36.join(codingDir, "grades")).catch(() => [])).filter((f) => f.endsWith(".json")).map((f) => f.slice(0, -5))
24980
25047
  );
@@ -25002,7 +25069,7 @@ function startKeepAwake(o = {}) {
25002
25069
  const up = () => {
25003
25070
  if (stopped) return;
25004
25071
  try {
25005
- child = spawn6(cmd, argv, { detached: true, stdio: "ignore" });
25072
+ child = spawn7(cmd, argv, { detached: true, stdio: "ignore" });
25006
25073
  child.unref();
25007
25074
  child.on("error", () => {
25008
25075
  stopped = true;
@@ -25125,7 +25192,7 @@ async function runPipeline(o) {
25125
25192
 
25126
25193
  // src/chatPipeline.ts
25127
25194
  init_manifest();
25128
- import { spawn as spawn7 } from "child_process";
25195
+ import { spawn as spawn8 } from "child_process";
25129
25196
  import path37 from "path";
25130
25197
  import { existsSync as existsSync6, promises as fs32 } from "fs";
25131
25198
  import { fileURLToPath as fileURLToPath4 } from "url";
@@ -25189,7 +25256,7 @@ async function finalChatArtifacts(dataRoot) {
25189
25256
  function runStage2(repoRoot, st, env, onLine) {
25190
25257
  return new Promise((resolve2, reject) => {
25191
25258
  const { cmd, argv, cwd } = stageInvocation2(repoRoot, st.script, st.args);
25192
- const child = spawn7(cmd, argv, { cwd, env, stdio: ["ignore", "pipe", "pipe"] });
25259
+ const child = spawn8(cmd, argv, { cwd, env, stdio: ["ignore", "pipe", "pipe"] });
25193
25260
  const pump = (buf) => {
25194
25261
  if (!onLine) return;
25195
25262
  for (const line of buf.toString().split(/\r?\n/)) if (line.trim()) onLine(line);
@@ -25824,13 +25891,6 @@ async function maybePrintUpdateNotice(opts) {
25824
25891
  clearTimeout(timer);
25825
25892
  }
25826
25893
  }
25827
- function openBrowser(url) {
25828
- const cmd = process.platform === "darwin" ? "open" : process.platform === "win32" ? "start" : "xdg-open";
25829
- try {
25830
- spawn9(cmd, [url], { stdio: "ignore", detached: true }).unref();
25831
- } catch {
25832
- }
25833
- }
25834
25894
  main().catch((e) => {
25835
25895
  console.error(e);
25836
25896
  process.exit(1);
@@ -551,7 +551,7 @@ var init_growth = __esm({
551
551
  {
552
552
  key: "implementation",
553
553
  name: "Observed execution improvement",
554
- definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament (often OCD-like), so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
554
+ definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament, so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
555
555
  rungs: [
556
556
  { level: 3, marker: "The same BEHAVIORS recur across the window, unchanged \u2014 recognition (if any) never becomes a change in action. (A recurring feeling alongside changed behavior does NOT belong here \u2014 that is a fix, scored higher.)" },
557
557
  { level: 5, marker: "Occasionally a fix happens \u2014 intends to solve, and sometimes it lands, but not usually." },
@@ -1356,6 +1356,25 @@ import { spawn } from "child_process";
1356
1356
  import { promises as fs2 } from "fs";
1357
1357
  import path2 from "path";
1358
1358
 
1359
+ // ../coding-core/dist/env.js
1360
+ var AUTH_VARS = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"];
1361
+ var warned = false;
1362
+ function claudeCliEnv(base = process.env) {
1363
+ if (process.env.POLYMATH_USE_API_KEY === "1")
1364
+ return base;
1365
+ const present = AUTH_VARS.filter((k) => base[k]);
1366
+ if (!present.length)
1367
+ return base;
1368
+ if (!warned) {
1369
+ warned = true;
1370
+ console.error(`[polymath-society] ${present.join(" + ")} is set in your shell \u2014 ignoring it so the analysis runs on your claude.ai login (the key would take over auth and either fail or bill your API account). Set POLYMATH_USE_API_KEY=1 if you really want the API key used.`);
1371
+ }
1372
+ const scrubbed = { ...base };
1373
+ for (const k of AUTH_VARS)
1374
+ delete scrubbed[k];
1375
+ return scrubbed;
1376
+ }
1377
+
1359
1378
  // ../../lib/agents/shared/adapter.ts
1360
1379
  function extractJson(text2) {
1361
1380
  const fences = [...text2.matchAll(/```json\s*([\s\S]*?)```/gi)];
@@ -1460,7 +1479,9 @@ var cliAdapter = {
1460
1479
  await new Promise((resolve2, reject) => {
1461
1480
  const child = spawn(CLAUDE_BIN, args, {
1462
1481
  cwd: inv.cwd ?? inv.addDir,
1463
- env: process.env,
1482
+ // scrubbed: a stray ANTHROPIC_API_KEY in the user's shell hijacks the
1483
+ // claude CLI away from their claude.ai login (coding-core/env.ts)
1484
+ env: claudeCliEnv(),
1464
1485
  stdio: ["ignore", "pipe", "pipe"],
1465
1486
  // Own process group, so a timeout can kill the WHOLE tree (claude spawns
1466
1487
  // its own children that otherwise orphan and pile up — the root cause of
@@ -153,6 +153,25 @@ import { spawn } from "child_process";
153
153
  import { promises as fs2 } from "fs";
154
154
  import path3 from "path";
155
155
 
156
+ // ../coding-core/dist/env.js
157
+ var AUTH_VARS = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"];
158
+ var warned = false;
159
+ function claudeCliEnv(base = process.env) {
160
+ if (process.env.POLYMATH_USE_API_KEY === "1")
161
+ return base;
162
+ const present = AUTH_VARS.filter((k) => base[k]);
163
+ if (!present.length)
164
+ return base;
165
+ if (!warned) {
166
+ warned = true;
167
+ console.error(`[polymath-society] ${present.join(" + ")} is set in your shell \u2014 ignoring it so the analysis runs on your claude.ai login (the key would take over auth and either fail or bill your API account). Set POLYMATH_USE_API_KEY=1 if you really want the API key used.`);
168
+ }
169
+ const scrubbed = { ...base };
170
+ for (const k of AUTH_VARS)
171
+ delete scrubbed[k];
172
+ return scrubbed;
173
+ }
174
+
156
175
  // ../../lib/agents/shared/adapter.ts
157
176
  function extractJson(text2) {
158
177
  const fences = [...text2.matchAll(/```json\s*([\s\S]*?)```/gi)];
@@ -257,7 +276,9 @@ var cliAdapter = {
257
276
  await new Promise((resolve2, reject) => {
258
277
  const child = spawn(CLAUDE_BIN, args, {
259
278
  cwd: inv.cwd ?? inv.addDir,
260
- env: process.env,
279
+ // scrubbed: a stray ANTHROPIC_API_KEY in the user's shell hijacks the
280
+ // claude CLI away from their claude.ai login (coding-core/env.ts)
281
+ env: claudeCliEnv(),
261
282
  stdio: ["ignore", "pipe", "pipe"],
262
283
  // Own process group, so a timeout can kill the WHOLE tree (claude spawns
263
284
  // its own children that otherwise orphan and pile up — the root cause of
@@ -16469,7 +16490,7 @@ var growthLens = {
16469
16490
  {
16470
16491
  key: "implementation",
16471
16492
  name: "Observed execution improvement",
16472
- definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament (often OCD-like), so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
16493
+ definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament, so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
16473
16494
  rungs: [
16474
16495
  { level: 3, marker: "The same BEHAVIORS recur across the window, unchanged \u2014 recognition (if any) never becomes a change in action. (A recurring feeling alongside changed behavior does NOT belong here \u2014 that is a fix, scored higher.)" },
16475
16496
  { level: 5, marker: "Occasionally a fix happens \u2014 intends to solve, and sometimes it lands, but not usually." },
@@ -153,6 +153,25 @@ import { spawn } from "child_process";
153
153
  import { promises as fs2 } from "fs";
154
154
  import path3 from "path";
155
155
 
156
+ // ../coding-core/dist/env.js
157
+ var AUTH_VARS = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"];
158
+ var warned = false;
159
+ function claudeCliEnv(base = process.env) {
160
+ if (process.env.POLYMATH_USE_API_KEY === "1")
161
+ return base;
162
+ const present = AUTH_VARS.filter((k) => base[k]);
163
+ if (!present.length)
164
+ return base;
165
+ if (!warned) {
166
+ warned = true;
167
+ console.error(`[polymath-society] ${present.join(" + ")} is set in your shell \u2014 ignoring it so the analysis runs on your claude.ai login (the key would take over auth and either fail or bill your API account). Set POLYMATH_USE_API_KEY=1 if you really want the API key used.`);
168
+ }
169
+ const scrubbed = { ...base };
170
+ for (const k of AUTH_VARS)
171
+ delete scrubbed[k];
172
+ return scrubbed;
173
+ }
174
+
156
175
  // ../../lib/agents/shared/adapter.ts
157
176
  function extractJson(text2) {
158
177
  const fences = [...text2.matchAll(/```json\s*([\s\S]*?)```/gi)];
@@ -257,7 +276,9 @@ var cliAdapter = {
257
276
  await new Promise((resolve2, reject) => {
258
277
  const child = spawn(CLAUDE_BIN, args, {
259
278
  cwd: inv.cwd ?? inv.addDir,
260
- env: process.env,
279
+ // scrubbed: a stray ANTHROPIC_API_KEY in the user's shell hijacks the
280
+ // claude CLI away from their claude.ai login (coding-core/env.ts)
281
+ env: claudeCliEnv(),
261
282
  stdio: ["ignore", "pipe", "pipe"],
262
283
  // Own process group, so a timeout can kill the WHOLE tree (claude spawns
263
284
  // its own children that otherwise orphan and pile up — the root cause of
@@ -16391,7 +16412,7 @@ var growthLens = {
16391
16412
  {
16392
16413
  key: "implementation",
16393
16414
  name: "Observed execution improvement",
16394
- definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament (often OCD-like), so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
16415
+ definition: "The slope itself: whether diagnosed problems get attacked with experiments and whether the change in BEHAVIOR lands and sticks. Graded from dated evidence on ACTIONS, not feelings: a recurring feeling, urge, or complaint is expected base temperament and is NOT a mark against implementation \u2014 only a recurring unchanged behavior is. Credit a changed action even when the underlying feeling repeats verbatim (e.g. still dreads cold outreach but now sends it daily). A COMPULSION OR URGE IS TEMPERAMENT, NOT AN ACTION: a perfectionism / over-analysis / decision-paralysis loop is the behavioral face of base temperament, so if the person INCREASINGLY OVERRIDES it and still ships, that is temperament being managed better over time \u2014 a RISING slope, NOT a recurring unchanged action \u2014 and must NOT cap the score. Only count such a loop against implementation if the ACTION genuinely shows NO improvement across the window (still loses whole days with no rising ability to override and ship). A FIX THAT NEEDED A FORCING FUNCTION STILL COUNTS, FULLY: a change triggered by a deadline, a painful lesson, or 'getting burnt' that then LANDS and STICKS is a real fix on a legitimate route \u2014 learning from consequence is how humans change \u2014 so do NOT dock a landed, sticky fix for needing a catalyst; the catalyst is not a defect. Judge the slope over LONG horizons (weeks\u2192months across the dated record), NEVER within a single day or conversation \u2014 behavior change takes time, so the absence of same-day change is NOT a failure and must NEVER buckle the score. GRADE THE AGGREGATE SLOPE, not the one unfixed thread: humans cannot fix everything, and very few fix anything at all \u2014 so fixing several genuinely hard, DISTINCT stuck-points and making them stick across the window is exceptional and scores HIGH (9-10), and one stubborn temperament loop that is being increasingly overridden does NOT pull an otherwise broad, rising, sticky record down. The real question: across the record, did the problems they identified earlier become LESS of an issue in their later ACTIONS? Internal baselines (neuroticism, needing people to feel happy) are not the unit here \u2014 grade the actions.",
16395
16416
  rungs: [
16396
16417
  { level: 3, marker: "The same BEHAVIORS recur across the window, unchanged \u2014 recognition (if any) never becomes a change in action. (A recurring feeling alongside changed behavior does NOT belong here \u2014 that is a fix, scored higher.)" },
16397
16418
  { level: 5, marker: "Occasionally a fix happens \u2014 intends to solve, and sometimes it lands, but not usually." },
@@ -148,6 +148,25 @@ import { spawn } from "child_process";
148
148
  import { promises as fs2 } from "fs";
149
149
  import path2 from "path";
150
150
 
151
+ // ../coding-core/dist/env.js
152
+ var AUTH_VARS = ["ANTHROPIC_API_KEY", "ANTHROPIC_AUTH_TOKEN"];
153
+ var warned = false;
154
+ function claudeCliEnv(base = process.env) {
155
+ if (process.env.POLYMATH_USE_API_KEY === "1")
156
+ return base;
157
+ const present = AUTH_VARS.filter((k) => base[k]);
158
+ if (!present.length)
159
+ return base;
160
+ if (!warned) {
161
+ warned = true;
162
+ console.error(`[polymath-society] ${present.join(" + ")} is set in your shell \u2014 ignoring it so the analysis runs on your claude.ai login (the key would take over auth and either fail or bill your API account). Set POLYMATH_USE_API_KEY=1 if you really want the API key used.`);
163
+ }
164
+ const scrubbed = { ...base };
165
+ for (const k of AUTH_VARS)
166
+ delete scrubbed[k];
167
+ return scrubbed;
168
+ }
169
+
151
170
  // ../../lib/agents/shared/adapter.ts
152
171
  function extractJson(text2) {
153
172
  const fences = [...text2.matchAll(/```json\s*([\s\S]*?)```/gi)];
@@ -252,7 +271,9 @@ var cliAdapter = {
252
271
  await new Promise((resolve2, reject) => {
253
272
  const child = spawn(CLAUDE_BIN, args, {
254
273
  cwd: inv.cwd ?? inv.addDir,
255
- env: process.env,
274
+ // scrubbed: a stray ANTHROPIC_API_KEY in the user's shell hijacks the
275
+ // claude CLI away from their claude.ai login (coding-core/env.ts)
276
+ env: claudeCliEnv(),
256
277
  stdio: ["ignore", "pipe", "pipe"],
257
278
  // Own process group, so a timeout can kill the WHOLE tree (claude spawns
258
279
  // its own children that otherwise orphan and pile up — the root cause of
@@ -661,11 +661,11 @@ var GIFTS = [
661
661
 
662
662
  // ../../lib/calibration/index.ts
663
663
  var DEFAULT_CALIBRATION = {
664
- version: "2026-07-14.2",
664
+ version: "2026-07-15.1",
665
665
  // = RUBRIC_FINGERPRINT of the shipped npm rubric (packages/coding-analyzer/
666
666
  // src/grade/criteria.ts). A unit test fails loud when the rubric changes
667
667
  // without this being updated (and re-pushed to the server).
668
- rubricVersion: "f51b3a93a3",
668
+ rubricVersion: "7983c01d53",
669
669
  // Canonical scale = the one the product owner set for the public report
670
670
  // (11=0.01% … 8=2%), extended downward from the old report ladder. The old
671
671
  // CodeAnalysisView / npm-viewer maps (7→10%/15%, 6→25%/30%) were drift, not