@sonnechasser/ntrp 1.4.7 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1637,6 +1637,7 @@ function buildSessionContextDoc(file, opts = {}) {
1637
1637
  lines.push(`- Exchanges: ${exchanges}`);
1638
1638
  if (file.summary) lines.push(`- Summary: ${file.summary}`);
1639
1639
  if (file.resumed_from) lines.push(`- Resumed from: ${file.resumed_from}`);
1640
+ lines.push("- Packaging: answer-first; recommendations filtered (silent idea-gate on deep/think/strategy)");
1640
1641
  lines.push("");
1641
1642
  lines.push("## Dataset");
1642
1643
  lines.push("");
@@ -8706,6 +8707,8 @@ KINDS:
8706
8707
  - "preference": how the user wants analysis done or framed.
8707
8708
  - "calibration": a judgment update \u2014 an adjustment to HOW this business should be analyzed. Write it as an applicable rule, e.g. "Enterprise freshness reds here trace to rep coverage gaps, not data hygiene \u2014 cut by owner first" or "This team treats 45 quiet days as normal cadence; don't flag staleness before that." Capture corrections the user made to your reasoning as calibrations, not preferences.
8708
8709
 
8710
+ AFTER-ACTION LENS (silent \u2014 never name AAR to anyone): prefer items that capture BELIEF that changed, EVIDENCE that forced the change, or the NEXT BET the team should re-check. Calibrations that supersede contradictions are the highest-value distillates.
8711
+
8709
8712
  SUPERSEDING (calibrations only): the current calibrations are provided with ids. If the session contradicts or refines one, return the replacement with "supersedes" set to the old id. Never emit a calibration that duplicates an existing one.
8710
8713
 
8711
8714
  EXCLUDE:
@@ -21425,6 +21428,21 @@ var init_tool_schemas = __esm({
21425
21428
  required: ["play_id"]
21426
21429
  }
21427
21430
  },
21431
+ {
21432
+ name: "get_framework_detail",
21433
+ description: "Read a consulting/operating framework pack by id: when to use, vital links, board vs operator cut, kill rules, and full body. The system prompt lists only the catalog \u2014 call this when you need depth before recommending. Never name brand labels (Heilmeier, Minto, TOC, MEDDPICC, \u2026) to the user.",
21434
+ parameters: {
21435
+ type: "object",
21436
+ properties: {
21437
+ framework_id: {
21438
+ type: "string",
21439
+ maxLength: 40,
21440
+ description: "Exact id from the framework catalog, e.g. 'bottleneck', 'packaging', 'aar', 'meddpicc'."
21441
+ }
21442
+ },
21443
+ required: ["framework_id"]
21444
+ }
21445
+ },
21428
21446
  {
21429
21447
  name: "get_session_brief",
21430
21448
  description: "Read the 1-page context brief of a PRIOR session by id or 4-char suffix: status, dataset, scope, computed scores with dollar values, headline metrics, deliverables, and conversation log. Use when the user references earlier work \u2014 'last week we found\u2026', 'compare with the previous analysis', 'what did session 9297 conclude?'. Read-only.",
@@ -21526,6 +21544,251 @@ var init_tool_arg_validate = __esm({
21526
21544
  }
21527
21545
  });
21528
21546
 
21547
+ // src/data/frameworks.ts
21548
+ var frameworks_exports = {};
21549
+ __export(frameworks_exports, {
21550
+ FRAMEWORK_PACKS: () => FRAMEWORK_PACKS,
21551
+ PLAY_FRAMEWORK_HOOKS: () => PLAY_FRAMEWORK_HOOKS,
21552
+ buildFrameworkCatalogBlock: () => buildFrameworkCatalogBlock,
21553
+ frameworkIdsForPlay: () => frameworkIdsForPlay,
21554
+ getFrameworkById: () => getFrameworkById,
21555
+ listFrameworkIds: () => listFrameworkIds
21556
+ });
21557
+ function listFrameworkIds() {
21558
+ return FRAMEWORK_PACKS.map((p) => p.id);
21559
+ }
21560
+ function getFrameworkById(id) {
21561
+ return FRAMEWORK_PACKS.find((p) => p.id === id);
21562
+ }
21563
+ function buildFrameworkCatalogBlock() {
21564
+ const lines = FRAMEWORK_PACKS.filter((p) => p.always_on_catalog).map((p) => p.catalog_line);
21565
+ return `FRAMEWORK TOOLKIT (silent brands \u2014 call get_framework_detail for full body; never name brands to the user):
21566
+ ${lines.join("\n")}
21567
+ Optional packs via get_framework_detail: meddpicc, challenger, jtbd, porter, mckinsey_7s, ooda.`;
21568
+ }
21569
+ function frameworkIdsForPlay(playId) {
21570
+ return PLAY_FRAMEWORK_HOOKS[playId] ?? [];
21571
+ }
21572
+ var PLAY_FRAMEWORK_HOOKS, SILENT, FRAMEWORK_PACKS;
21573
+ var init_frameworks = __esm({
21574
+ "src/data/frameworks.ts"() {
21575
+ "use strict";
21576
+ PLAY_FRAMEWORK_HOOKS = {
21577
+ "clean-dead-pipeline": ["bottleneck", "heilmeier", "aar"],
21578
+ "unstick-pipeline": ["bottleneck", "okr_measurability", "owner_shape"],
21579
+ "fix-handoff-gap": ["bottleneck", "owner_shape", "aar"],
21580
+ "retarget-effort": ["bottleneck", "gtm_engineering"],
21581
+ "multi-thread-deals": ["owner_shape", "heilmeier"]
21582
+ };
21583
+ SILENT = "Never name this framework (or DARPA, McKinsey, Goldratt, etc.) in customer-visible text. Apply the moves; keep the brand silent.";
21584
+ FRAMEWORK_PACKS = [
21585
+ {
21586
+ id: "bottleneck",
21587
+ catalog_line: "- bottleneck \u2014 name the constraint vital/stage before prescribing; do not fix non-constraints",
21588
+ internal_name: "Theory of Constraints / bottleneck",
21589
+ always_on_catalog: true,
21590
+ vital_links: ["freshness", "flow_rate", "drop_rate", "signal_to_noise", "thread_depth"],
21591
+ board_cut: "One constraint is gating the dollar outcome. Fixing anything else is theater.",
21592
+ operator_cut: "Locate the gating vital (layer order) or the stage where deals die; put the first play there.",
21593
+ when_to_use: "Before recommending a play or sequencing workstreams.",
21594
+ kill_rules: [
21595
+ "If the recommendation does not move the constraint, demote or drop it.",
21596
+ "Do not prescribe parallel fixes that starve the constraint of capacity."
21597
+ ],
21598
+ silent_brand_rule: SILENT,
21599
+ body: `BOTTLENECK (constraint first):
21600
+ - Respect layer gating: freshness trust \u2192 flow/drop movement \u2192 signal efficiency \u2192 thread resilience.
21601
+ - Name the single constraint vital or pipeline stage with its score and dollar label.
21602
+ - Prescribe against the constraint first. Non-constraint work is optional polish.
21603
+ - If two problems compete, pick the one that unblocks the other (dependency), not the louder scorecard row.`
21604
+ },
21605
+ {
21606
+ id: "packaging",
21607
+ catalog_line: "- packaging \u2014 answer first, then situation/complication that make it true, then so-what",
21608
+ internal_name: "Minto pyramid + SCQA sibling",
21609
+ always_on_catalog: true,
21610
+ vital_links: [],
21611
+ board_cut: "Open with the call and the dollar. Context is support, not the lead.",
21612
+ operator_cut: "Headline \u226420 words \u2192 2\u20133 non-overlapping drivers \u2192 owner-shaped so-what.",
21613
+ when_to_use: "Every executive-facing answer, finding, recap Story, summary_30k.",
21614
+ kill_rules: ["Never open with methodology or a full scorecard.", "Merge overlapping drivers."],
21615
+ silent_brand_rule: SILENT,
21616
+ body: `PACKAGING (answer-first):
21617
+ - Governing thought first (verdict + dollars).
21618
+ - Then the situation and complication that make the call true (support, not opener).
21619
+ - Then drivers (distinct, non-overlapping) and so-what / ask.
21620
+ - Brief: one headline + \u22642 drivers + one so-what.`
21621
+ },
21622
+ {
21623
+ id: "aar",
21624
+ catalog_line: "- after-action \u2014 what we believed, what changed, next bet",
21625
+ internal_name: "After Action Review",
21626
+ always_on_catalog: true,
21627
+ vital_links: [],
21628
+ board_cut: "What we thought would move, what the instruments showed, what we bet next.",
21629
+ operator_cut: "Belief \u2192 evidence from vitals/metrics \u2192 keep, kill, or re-sequence the play.",
21630
+ when_to_use: "Strategy review, session distill calibrations, win/miss logging.",
21631
+ kill_rules: ["Do not log vanity narrative without a measured instrument.", "Calibrations supersede; do not pile contradictions."],
21632
+ silent_brand_rule: SILENT,
21633
+ body: `AFTER-ACTION:
21634
+ - BELIEF: what we expected to move (metric + range + check date).
21635
+ - EVIDENCE: what the instruments actually showed (baseline \u2192 reading).
21636
+ - LEARNING: keep, kill, or re-sequence \u2014 write as a calibration when judgment changed.
21637
+ - NEXT BET: the single next exam, not a new multi-week program.`
21638
+ },
21639
+ {
21640
+ id: "owner_shape",
21641
+ catalog_line: "- owner-shape \u2014 function-shaped owner and decision rights; not named people",
21642
+ internal_name: "RACI-lite",
21643
+ always_on_catalog: true,
21644
+ vital_links: [],
21645
+ board_cut: "Every ask names who decides and who executes by function.",
21646
+ operator_cut: "RevOps / AE lead / CS lead / Marketing ops \u2014 R does, A decides; avoid named individuals in plans.",
21647
+ when_to_use: "Workstream titles, handoff plans, play prescriptions.",
21648
+ kill_rules: ["No orphan actions without an accountable function.", "Do not invent headcount or reorgs."],
21649
+ silent_brand_rule: SILENT,
21650
+ body: `OWNER-SHAPE:
21651
+ - Name the function (RevOps, sales manager, CS lead, marketing ops) \u2014 not a person's name from the CRM.
21652
+ - Accountable decides; Responsible executes. Consulted optional; Inform via existing channels.
21653
+ - First action must be startable by that function within 48 hours with no new tooling.`
21654
+ },
21655
+ {
21656
+ id: "okr_measurability",
21657
+ catalog_line: "- exams \u2014 mid-term and final checks as dated key results with instruments",
21658
+ internal_name: "OKR / measurability dialect",
21659
+ always_on_catalog: true,
21660
+ vital_links: ["freshness", "flow_rate", "drop_rate", "signal_to_noise", "thread_depth"],
21661
+ board_cut: "Objective + dated key results the board can re-read next quarter.",
21662
+ operator_cut: "Baseline, target range, check date, measured_by instrument \u2014 or demote to assumption.",
21663
+ when_to_use: "Strategist outcomes, Heilmeier exams, milestones.",
21664
+ kill_rules: ["No 'improve' without a number.", "No exam faster than sales-cycle physics."],
21665
+ silent_brand_rule: SILENT,
21666
+ body: `EXAMS (objective + key results):
21667
+ - Objective = precise end state in one line.
21668
+ - Key results = mid-term check + final exam: metric, baseline, target RANGE, check date, instrument.
21669
+ - If unmeasurable with current data, exclude from targets and record as an assumption.`
21670
+ },
21671
+ {
21672
+ id: "heilmeier",
21673
+ catalog_line: "- idea-gate \u2014 newness, stake, and exams must pass before a recommendation ships",
21674
+ internal_name: "Heilmeier catechism",
21675
+ always_on_catalog: true,
21676
+ vital_links: [],
21677
+ board_cut: "Only recommendations with stake and exams reach the room.",
21678
+ operator_cut: "Kill restatements; demote unmeasurable ideas.",
21679
+ when_to_use: "Deep recommend, think before draft_strategy, strategist Stage C.",
21680
+ kill_rules: ["Fail newness, stake, or exams \u2192 do not recommend."],
21681
+ silent_brand_rule: SILENT,
21682
+ body: `IDEA GATE: end state, status quo + limit, newness, stake + cost of inaction, risks/payoffs, effort, time physics, mid+final exams. Kill on newness/stake/exams failure.`
21683
+ },
21684
+ {
21685
+ id: "minto",
21686
+ catalog_line: "- pyramid \u2014 headline, drivers, so-what for recall",
21687
+ internal_name: "Minto Pyramid Principle",
21688
+ always_on_catalog: true,
21689
+ vital_links: [],
21690
+ board_cut: "Repeatable headline + one number an hour later.",
21691
+ operator_cut: "Same shape for findings and deep answers.",
21692
+ when_to_use: "All packaged analyst prose.",
21693
+ kill_rules: ["Methodology-first openers die."],
21694
+ silent_brand_rule: SILENT,
21695
+ body: `PYRAMID: HEADLINE FIRST \u2192 DRIVERS (non-overlapping) \u2192 SO-WHAT. Recall test. Altitude control.`
21696
+ },
21697
+ {
21698
+ id: "gtm_engineering",
21699
+ catalog_line: "- systems \u2014 data foundation \u2192 modeling \u2192 activation; mechanism per fix",
21700
+ internal_name: "GTM engineering",
21701
+ always_on_catalog: true,
21702
+ vital_links: ["signal_to_noise", "drop_rate", "freshness"],
21703
+ board_cut: "Durable systems, not heroics.",
21704
+ operator_cut: "Pair every cleanup with a mechanism and an instrument.",
21705
+ when_to_use: "When recommending action on tool-capable surfaces.",
21706
+ kill_rules: ["Skipping the rung below will not hold."],
21707
+ silent_brand_rule: SILENT,
21708
+ body: `GTM SYSTEMS: three rungs (foundation \u2192 modeling \u2192 activation); signals over lists; CRM is cheapest pipeline; every fix gets a mechanism; instrument what you change.`
21709
+ },
21710
+ {
21711
+ id: "meddpicc",
21712
+ catalog_line: "- deal-qualification pack (optional) \u2014 use when threading or late-stage risk needs a qualification lens",
21713
+ internal_name: "MEDDPICC",
21714
+ always_on_catalog: false,
21715
+ vital_links: ["thread_depth", "flow_rate"],
21716
+ board_cut: "Late-stage risk is usually missing economic buyer or decision process \u2014 not more activity.",
21717
+ operator_cut: "Map Metrics, Economic buyer, Decision criteria/process, Paper process, Identify pain, Champion, Competition \u2014 as observation, not CRM surgery.",
21718
+ when_to_use: "Thread-depth or stuck late-stage deals when the user asks how to qualify.",
21719
+ kill_rules: ["Do not rewrite the CRM; observe and recommend contacts/process gaps."],
21720
+ silent_brand_rule: SILENT,
21721
+ body: `DEAL QUALIFICATION LENS: use when single-threaded or stuck late-stage deals need a checklist. Prefer introducing a second contact and clarifying decision process over more outbound volume.`
21722
+ },
21723
+ {
21724
+ id: "challenger",
21725
+ catalog_line: "- teach-tailor-take pack (optional) \u2014 pressure-test weak narratives in think",
21726
+ internal_name: "Challenger Sale",
21727
+ always_on_catalog: false,
21728
+ vital_links: ["signal_to_noise"],
21729
+ board_cut: "Insight that reframes the problem beats more activity.",
21730
+ operator_cut: "In think: teach with evidence, tailor to this pipeline, take control of next step \u2014 still stethoscope.",
21731
+ when_to_use: "Think channel when the user is soft on a weak story.",
21732
+ kill_rules: ["Do not turn into a pitch script or CRM sequence builder."],
21733
+ silent_brand_rule: SILENT,
21734
+ body: `TEACH-TAILOR-TAKE: reframe with verified numbers; tailor to segment/motion; land one owner-shaped next step.`
21735
+ },
21736
+ {
21737
+ id: "jtbd",
21738
+ catalog_line: "- job-of-the-metric pack (optional) \u2014 what job this number does for this board",
21739
+ internal_name: "Jobs to be Done",
21740
+ always_on_catalog: false,
21741
+ vital_links: [],
21742
+ board_cut: "Each metric has a job in a decision \u2014 name the job or drop the chart.",
21743
+ operator_cut: "When explaining ARR/NRR/vitals: what decision does this number unlock?",
21744
+ when_to_use: "Metric definitions / board deck framing.",
21745
+ kill_rules: ["Ornamental metrics without a decision job die."],
21746
+ silent_brand_rule: SILENT,
21747
+ body: `JOB OF THE METRIC: for each number, name the decision it serves. If none, cut it from the board package.`
21748
+ },
21749
+ {
21750
+ id: "porter",
21751
+ catalog_line: "- industry-structure pack (optional, weak vital fit) \u2014 only if the user asks competitive structure",
21752
+ internal_name: "Porter Five Forces",
21753
+ always_on_catalog: false,
21754
+ vital_links: [],
21755
+ board_cut: "Industry structure is context, not a substitute for pipeline dollars.",
21756
+ operator_cut: "Do not let industry essays displace vital-sign evidence.",
21757
+ when_to_use: "Only when the user explicitly asks for competitive structure.",
21758
+ kill_rules: ["Never use as a substitute for gating vital diagnosis."],
21759
+ silent_brand_rule: SILENT,
21760
+ body: `INDUSTRY STRUCTURE: optional context. Prefer vital signs and dollars for recommendations.`
21761
+ },
21762
+ {
21763
+ id: "mckinsey_7s",
21764
+ catalog_line: "- org-alignment pack (optional, weak vital fit) \u2014 only if the user asks org design",
21765
+ internal_name: "McKinsey 7S",
21766
+ always_on_catalog: false,
21767
+ vital_links: [],
21768
+ board_cut: "Org redesign is out of stethoscope scope.",
21769
+ operator_cut: "Refuse surgery; observe handoff/ownership symptoms via vitals.",
21770
+ when_to_use: "Only if asked; redirect to owner-shape + bottleneck.",
21771
+ kill_rules: ["No reorg prescriptions."],
21772
+ silent_brand_rule: SILENT,
21773
+ body: `ORG ALIGNMENT: out of scope for CRM surgery. Point to function-shaped owners and the constraint vital instead.`
21774
+ },
21775
+ {
21776
+ id: "ooda",
21777
+ catalog_line: "- observe-orient loop pack (optional) \u2014 overlaps gating; use sparingly",
21778
+ internal_name: "OODA",
21779
+ always_on_catalog: false,
21780
+ vital_links: [],
21781
+ board_cut: "Prefer layer gating and hypothesis-first grounding.",
21782
+ operator_cut: "Already covered by Stage A + bottleneck \u2014 do not duplicate jargon.",
21783
+ when_to_use: "Rarely; prefer existing grounding.",
21784
+ kill_rules: ["Do not invent a parallel loop vocabulary for the user."],
21785
+ silent_brand_rule: SILENT,
21786
+ body: `OBSERVE-ORIENT: prefer NTRP layer gating and Stage A hypothesis-first over a separate combat loop.`
21787
+ }
21788
+ ];
21789
+ }
21790
+ });
21791
+
21529
21792
  // src/conversation/agent-context.ts
21530
21793
  var agent_context_exports = {};
21531
21794
  __export(agent_context_exports, {
@@ -21939,10 +22202,10 @@ function wrapForTarget(target, analysisBlock, conversationBlock, openQuestions,
21939
22202
  const contextLabel = handoffInstructionPrefix(ctx.analysis.primary);
21940
22203
  const forWhom = audiencePhrase(ctx.scope?.audience);
21941
22204
  const instructions = {
21942
- deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}. Pyramid structure: (1) HEADLINE \u2014 the governing number and verdict in one line; (2) DRIVERS \u2014 2\u20133 distinct, non-overlapping risks or causes with dollar impact (not a full scorecard); (3) SO-WHAT \u2014 recommended plays; (4) ASKS / decisions the room must make. Optionally one pipeline-health slide after the headline if it supports the call. Use the Metric definitions appendix so every slide can briefly remind the room what the number means for this audience.`,
21943
- asana: `produce an Asana project plan with sections and tasks tied to findings for ${forWhom}. Prioritize by dollar impact. Reference metric definitions when a task owner needs to know what "good" looks like.`,
22205
+ deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}. Pyramid structure: (1) HEADLINE \u2014 the governing number and verdict in one line; (2) DRIVERS \u2014 2\u20133 distinct, non-overlapping risks or causes with dollar impact (not a full scorecard); (3) SO-WHAT \u2014 recommended plays with function-shaped owners (RevOps / sales manager / CS \u2014 not personal names); (4) ASKS / decisions the room must make. Optionally one pipeline-health slide after the headline if it supports the call. Use the Metric definitions appendix so every slide can briefly remind the room what the number means for this audience.`,
22206
+ asana: `produce an Asana project plan with sections and tasks tied to findings for ${forWhom}. Prioritize by dollar impact. Assign by function (not personal names). Reference metric definitions when a task owner needs to know what "good" looks like.`,
21944
22207
  clay: `produce a Clay table specification to operationalize the highest-impact finding for ${forWhom}.`,
21945
- plan: `produce a prioritized action plan for ${forWhom}, answer-first: open with the governing call (highest-dollar problem), then items each with problem, play, first 3 steps, owner, and leading indicator. Ground indicators in the Metric definitions appendix. End with the sharpest asks / decisions.`
22208
+ plan: `produce a prioritized action plan for ${forWhom}, answer-first: open with the governing call (highest-dollar problem / constraint), then items each with problem, play, first 3 steps, function-shaped owner, and leading indicator. Ground indicators in the Metric definitions appendix. End with the sharpest asks / decisions.`
21946
22209
  };
21947
22210
  const parts = [
21948
22211
  `# NTRP handoff \u2192 ${target}`,
@@ -22304,6 +22567,7 @@ async function handleGetPlayDetail(input) {
22304
22567
  }
22305
22568
  } catch {
22306
22569
  }
22570
+ const { frameworkIdsForPlay: frameworkIdsForPlay2 } = await Promise.resolve().then(() => (init_frameworks(), frameworks_exports));
22307
22571
  const detail = {
22308
22572
  play_id: play.id,
22309
22573
  play_name: play.name,
@@ -22315,7 +22579,8 @@ async function handleGetPlayDetail(input) {
22315
22579
  tools_that_help: play.tools_that_help,
22316
22580
  expected_outcome: play.expected_outcome,
22317
22581
  source: play.source ?? "seed",
22318
- local_track_record: trackRecord
22582
+ local_track_record: trackRecord,
22583
+ framework_ids: frameworkIdsForPlay2(play.id)
22319
22584
  };
22320
22585
  if (play.source === "learned") {
22321
22586
  detail.security_notice = UNTRUSTED_CONTENT_NOTICE;
@@ -22326,6 +22591,30 @@ async function handleGetPlayDetail(input) {
22326
22591
  }
22327
22592
  return detail;
22328
22593
  }
22594
+ async function handleGetFrameworkDetail(input) {
22595
+ const frameworkId = typeof input.framework_id === "string" ? input.framework_id.trim() : "";
22596
+ const { getFrameworkById: getFrameworkById2, listFrameworkIds: listFrameworkIds2 } = await Promise.resolve().then(() => (init_frameworks(), frameworks_exports));
22597
+ const pack = frameworkId ? getFrameworkById2(frameworkId) : void 0;
22598
+ if (!pack) {
22599
+ return {
22600
+ error: `Unknown framework id '${frameworkId}'.`,
22601
+ valid_framework_ids: listFrameworkIds2()
22602
+ };
22603
+ }
22604
+ return {
22605
+ framework_id: pack.id,
22606
+ catalog_line: pack.catalog_line,
22607
+ always_on_catalog: pack.always_on_catalog,
22608
+ vital_links: pack.vital_links,
22609
+ board_cut: pack.board_cut,
22610
+ operator_cut: pack.operator_cut,
22611
+ when_to_use: pack.when_to_use,
22612
+ kill_rules: pack.kill_rules,
22613
+ silent_brand_rule: pack.silent_brand_rule,
22614
+ body: pack.body,
22615
+ notice: "Apply the moves in body/board_cut/operator_cut. Never name internal brand labels to the user."
22616
+ };
22617
+ }
22329
22618
  async function handleGetRevenueMetrics(_input, ctx) {
22330
22619
  if (!ctx.metrics || ctx.metrics.length === 0) {
22331
22620
  const { computeFullMetrics: computeFullMetrics2 } = await Promise.resolve().then(() => (init_compute(), compute_exports));
@@ -22620,6 +22909,7 @@ var init_tool_handlers = __esm({
22620
22909
  query_segment_comparison: handleQuerySegmentComparison,
22621
22910
  query_entity_counts: (input, _) => handleQueryEntityCounts(input),
22622
22911
  get_play_detail: (input, _) => handleGetPlayDetail(input),
22912
+ get_framework_detail: (input, _) => handleGetFrameworkDetail(input),
22623
22913
  get_session_brief: (input, _) => handleGetSessionBrief(input),
22624
22914
  get_revenue_metrics: handleGetRevenueMetrics,
22625
22915
  get_revenue_metrics_timeseries: (input, _) => handleGetRevenueMetricsTimeseries(input),
@@ -22901,6 +23191,12 @@ ${GTM_ENGINEERING_BLOCK}
22901
23191
  IDEA GATE (when recommending a play or before draft_strategy \u2014 silent; probing/imagination turns skip this until you conclude):
22902
23192
  ${HEILMEIER_GATE}
22903
23193
 
23194
+ BOTTLENECK (when concluding or recommending \u2014 silent):
23195
+ ${BOTTLENECK_GATE}
23196
+
23197
+ OWNER SHAPE (when recommending \u2014 silent):
23198
+ ${OWNER_SHAPE_BLOCK}
23199
+
22904
23200
  OUTPUT DOCTRINE (how answers are structured for recall):
22905
23201
  ${PYRAMID_OUTPUT_BLOCK}
22906
23202
 
@@ -22915,6 +23211,8 @@ ${VITAL_SIGNS_BLOCK}
22915
23211
  PLAYBOOK \u2014 name a play when it helps the user act (not a full program):
22916
23212
  ${buildPlaybookBlock()}
22917
23213
 
23214
+ ${buildFrameworkCatalogBlock()}
23215
+
22918
23216
  ${commandSection}
22919
23217
  ${formattingSection}
22920
23218
  OUTPUT RULES:
@@ -22943,6 +23241,7 @@ var init_think_prompt = __esm({
22943
23241
  "src/ai/think-prompt.ts"() {
22944
23242
  "use strict";
22945
23243
  init_prompt_parts();
23244
+ init_frameworks();
22946
23245
  init_prompt();
22947
23246
  }
22948
23247
  });
@@ -22973,6 +23272,7 @@ var init_ghost_hints = __esm({
22973
23272
  ],
22974
23273
  explore: [
22975
23274
  'try "what is the most expensive problem?"',
23275
+ 'try "which constraint is gating the dollars?"',
22976
23276
  'try "how should we fix this?"',
22977
23277
  'try "which segment is weakest?"',
22978
23278
  'try "what is ARR?"',
@@ -23063,9 +23363,28 @@ function buildSituationalAwarenessBlock(ctx, opts = {}) {
23063
23363
  if (examples.length > 0) {
23064
23364
  lines.push(`User may try: ${examples.join(" \xB7 ")}`);
23065
23365
  }
23066
- lines.push(
23067
- "Your job in this harness: fill the judgment gap after formula compute \u2014 connect dollars, name the expensive problem, do not restate scorecards the user already saw"
23068
- );
23366
+ if (channel === "think") {
23367
+ lines.push(
23368
+ "Doctrine: probing leads with the sharpest question (idea-gate off until you conclude); concluding/recommend turns \u2014 silent idea-gate then bottleneck then pyramid packaging; never name frameworks to the user"
23369
+ );
23370
+ } else if (responseMode === "brief") {
23371
+ lines.push(
23372
+ "Doctrine: brief packaging \u2014 headline \u226420 words, \u22642 drivers, one so-what; idea-gate off; never name frameworks to the user; do not restate The Call/scorecard \u2014 advance"
23373
+ );
23374
+ } else {
23375
+ lines.push(
23376
+ "Doctrine: deep/recommend \u2014 silent idea-gate then bottleneck then owner-shape then pyramid packaging; call get_framework_detail for toolkit depth; never name frameworks to the user"
23377
+ );
23378
+ }
23379
+ if (analysisReady) {
23380
+ lines.push(
23381
+ "Your job in this harness: after formula compute, lead with the most expensive or actionable implication \u2014 connect dollars, name the constraint, do not restate scorecards or The Call the user already saw"
23382
+ );
23383
+ } else {
23384
+ lines.push(
23385
+ "Your job in this harness: help the user through the funnel; CLI owns pre-explore gates"
23386
+ );
23387
+ }
23069
23388
  lines.push(
23070
23389
  "Pre-explore funnel gates are handled by the CLI; you speak in explore/think/strategist unless tools explicitly allow a restart"
23071
23390
  );
@@ -23078,10 +23397,12 @@ function buildSituationalRuntimeFacts(ctx, opts = {}) {
23078
23397
  return {
23079
23398
  phase,
23080
23399
  mode: responseMode,
23400
+ channel,
23081
23401
  lens: ctx.scope?.primary_lens,
23082
23402
  stage: ctx.stage,
23083
23403
  can_compute: ctx.gapAudit?.can_compute === void 0 ? void 0 : String(ctx.gapAudit.can_compute),
23084
- engine: canUseReplAi(ctx) ? "connected" : "none"
23404
+ engine: canUseReplAi(ctx) ? "connected" : "none",
23405
+ idea_gate: channel === "think" || responseMode === "deep" ? "on" : "off"
23085
23406
  };
23086
23407
  }
23087
23408
  function getConversationPhaseBlock(ctx, opts = {}) {
@@ -23301,7 +23622,7 @@ ${commandStyleRule}`;
23301
23622
  - Respond in plain text (not JSON). You do NOT need to emit the findings schema \u2014 only emit structured findings if the user explicitly asks for them.
23302
23623
  - Include specific numbers from tool results, never guess.
23303
23624
  - When you have enough information, answer directly. Don't call tools you don't need.`;
23304
- const executionBiasSection = responseMode === "brief" ? `OUTPUT DOCTRINE (brief \u2014 one headline + \u22642 drivers + one so-what):
23625
+ const executionBiasSection = responseMode === "brief" ? `OUTPUT DOCTRINE (brief \u2014 one headline + \u22642 drivers + one so-what; situation/complication only as support after the headline):
23305
23626
  ${PYRAMID_OUTPUT_BLOCK}
23306
23627
 
23307
23628
  ` : `EXECUTION BIAS (how you work):
@@ -23313,6 +23634,12 @@ ${GTM_ENGINEERING_BLOCK}
23313
23634
  IDEA GATE (when recommending action \u2014 silent):
23314
23635
  ${HEILMEIER_GATE}
23315
23636
 
23637
+ BOTTLENECK (constraint first \u2014 silent):
23638
+ ${BOTTLENECK_GATE}
23639
+
23640
+ OWNER SHAPE (when recommending action \u2014 silent):
23641
+ ${OWNER_SHAPE_BLOCK}
23642
+
23316
23643
  OUTPUT DOCTRINE (how answers are structured for recall):
23317
23644
  ${PYRAMID_OUTPUT_BLOCK}
23318
23645
 
@@ -23328,6 +23655,8 @@ ${VITAL_SIGNS_BLOCK}
23328
23655
  PLAYBOOK \u2014 recommend these plays when appropriate:
23329
23656
  ${buildPlaybookBlock()}
23330
23657
 
23658
+ ${buildFrameworkCatalogBlock()}
23659
+
23331
23660
  ${commandSection}`;
23332
23661
  const stable = `You are a world-class GTM operating partner \u2014 the kind of analyst a CEO keeps on speed dial. You are exceptionally well-read, rigorous, and commercially sharp, and you have tools to query a local database of this company's CRM and pipeline data. The user is having an ongoing, free-form conversation with you about their go-to-market health and SaaS metrics.
23333
23662
 
@@ -23576,6 +23905,7 @@ var init_agentic_loop = __esm({
23576
23905
  init_thread();
23577
23906
  init_untrusted();
23578
23907
  init_prompt_parts();
23908
+ init_frameworks();
23579
23909
  init_think_prompt();
23580
23910
  init_prompt();
23581
23911
  init_context2();
@@ -28480,13 +28810,16 @@ ${companyContextSection4()}${operatorSection4()}HOW YOU THINK (the strategist me
28480
28810
  8. RESPECT CAPACITY. Total effort must fit the team that actually exists. A brilliant plan the team cannot staff is a bad plan.
28481
28811
 
28482
28812
  ALTITUDE CONTRACT (the plan must work at every altitude a client reads it at):
28483
- - 30,000 FT: summary_30k is answer-first \u2014 open with the governing thought and what leadership should expect by when, then the situation and complication that make it true. A board member reads only this; it must survive being forwarded unedited.
28484
- - 10,000 FT: each workstream's title + problem line is a delegation unit \u2014 a one-liner an owner could receive in Slack and know what they own, why it's theirs, and what number they move.
28813
+ - 30,000 FT: summary_30k is answer-first \u2014 open with the governing thought (the answer) and what leadership should expect by when, then the situation and complication that make it true as support. A board member reads only this; it must survive being forwarded unedited.
28814
+ - 10,000 FT: each workstream's title + problem line is a delegation unit \u2014 a one-liner an owner could receive in Slack and know what they own, why it's theirs, and what number they move. Use function-shaped owners (see OWNER SHAPE).
28485
28815
  - GROUND LEVEL: actions are Monday-morning prescriptive. You have built this before \u2014 read the linked play's full detail with get_play_detail and prescribe its known-good sequence adapted to THIS company's numbers and constraints. The first action of every workstream must be startable within 48 hours with no new tooling.
28486
28816
 
28487
28817
  OUTPUT DOCTRINE (narrative fields \u2014 summary_30k and workstream problem lines \u2014 follow pyramid recall):
28488
28818
  ${PYRAMID_OUTPUT_BLOCK}
28489
28819
 
28820
+ OWNER SHAPE (workstreams and actions \u2014 silent):
28821
+ ${OWNER_SHAPE_BLOCK}
28822
+
28490
28823
  ${buildUserVisibleProseBlock()}
28491
28824
 
28492
28825
  GTM ENGINEERING (plans install systems, not heroics):
@@ -28501,7 +28834,10 @@ ${METRICS_BLOCK}
28501
28834
  PLAYBOOK (every workstream must link to at least one play by exact id):
28502
28835
  ${buildPlaybookBlock()}
28503
28836
 
28837
+ ${buildFrameworkCatalogBlock()}
28838
+
28504
28839
  MEASURABILITY CONTRACT (non-negotiable \u2014 this is what separates you from a slide deck):
28840
+ - Treat the objective as the end state; treat expected outcomes and leading indicators as key results (mid-term and final exams).
28505
28841
  - Every expected outcome and leading indicator needs: a metric, the current baseline copied from your verified grounding work, a target RANGE, a check date, and the named instrument that will measure it.
28506
28842
  - Banned words for outcomes: "improve", "better", "significantly", "optimize", "increase" without a number. If you cannot quantify it, it is not an outcome \u2014 demote it to an assumption or replace it with its best measurable proxy.
28507
28843
  - Every workstream needs at least one dated milestone with a verification method that names a number and threshold.
@@ -28520,9 +28856,13 @@ function buildGroundingMessage(input) {
28520
28856
 
28521
28857
  Establish verified reality before any planning. Work hypothesis-first, like an engagement manager on day one: form your top candidate explanations for what stands between today and the objective, then use tools to confirm or kill each one \u2014 don't boil the ocean.
28522
28858
  1. Current state: which vital signs / metrics are worst, what are the exact scores and dollar values, which segments concentrate the problem?
28523
- 2. What is already in flight (active strategies below, if any), what has worked before (wins), and what the local play track record says.
28524
- 3. What are the binding constraints: data gaps that limit measurability, sales-cycle length that bounds verification speed, capacity signals?
28525
- Rank the problems you verify by dollars at stake \xD7 confidence in the read \xD7 speed to impact \u2014 that ranking becomes the spine of the plan.`);
28859
+ 2. CONSTRAINT: name the single gating vital (layer order) or stage where deals die \u2014 with score and dollar label. This is the bottleneck the plan must move first.
28860
+ 3. What is already in flight (active strategies below, if any), what has worked before (wins), and what the local play track record says.
28861
+ 4. What are the binding constraints: data gaps that limit measurability, sales-cycle length that bounds verification speed, capacity signals?
28862
+ Rank the problems you verify by dollars at stake \xD7 confidence in the read \xD7 speed to impact \u2014 that ranking becomes the spine of the plan. Non-constraint problems wait.
28863
+
28864
+ BOTTLENECK (silent):
28865
+ ${BOTTLENECK_GATE}`);
28526
28866
  sections.push(`CURRENT HEALTH SNAPSHOT (verified \u2014 you may cite these numbers as baselines):
28527
28867
  ${input.healthSnapshot}`);
28528
28868
  if (input.gapAuditBlock) {
@@ -28571,6 +28911,8 @@ function buildStressTestMessage() {
28571
28911
  8. ALTITUDE CHECK: does summary_30k survive being forwarded to a board member unedited? Is each workstream title + problem a self-contained delegation one-liner? Is every first action startable within 48 hours?
28572
28912
  9. HEILMEIER GATE (silent \u2014 never name this to the user). Run every workstream through this filter. Failures: cut the workstream, demote it to assumptions, or rewrite until it passes \u2014 then emit final JSON.
28573
28913
  ${HEILMEIER_GATE}
28914
+ 10. AFTER-ACTION PREP (silent). Ensure each workstream's exams can support a later belief\u2192evidence\u2192next-bet review. Fold gaps into assumptions or contingencies.
28915
+ ${AAR_BLOCK}
28574
28916
 
28575
28917
  Then respond with the FINAL revised plan as strict JSON in the same schema \u2014 no markdown fences, no prose. Fold what you learned into constraints, assumptions, risks, and confidence. This version is the one that gets saved and reviewed against, so make every number one you are willing to be checked on.`;
28576
28918
  }
@@ -28579,6 +28921,7 @@ var init_strategist_prompt = __esm({
28579
28921
  "src/ai/strategist-prompt.ts"() {
28580
28922
  "use strict";
28581
28923
  init_prompt_parts();
28924
+ init_frameworks();
28582
28925
  init_prompt();
28583
28926
  STRATEGIST_PLAN_SCHEMA_BLOCK = `{
28584
28927
  "title": "Short plan name, e.g. 'Q4 Pipeline Recovery'",
@@ -30286,6 +30629,11 @@ function renderReport(report) {
30286
30629
  `${strategy.slug} \xB7 baseline batch ${shortBatch(report.baseline_batch_id)} \u2192 latest ${shortBatch(report.latest_batch_id)}`
30287
30630
  )
30288
30631
  );
30632
+ console.log(
30633
+ " " + chalk38.dim(
30634
+ "Read as belief \u2192 evidence \u2192 next bet: what we expected, what instruments showed, what to keep/kill/re-sequence."
30635
+ )
30636
+ );
30289
30637
  if (report.single_batch) {
30290
30638
  console.log(
30291
30639
  " " + chalk38.yellow("Only one compute batch exists \u2014 ingest fresh data and re-run for a real before/after.")
@@ -36564,7 +36912,8 @@ handler: ../commands/knowledge.ts
36564
36912
 
36565
36913
  Teach the analyst from work done outside the platform.
36566
36914
  Type \`/knowledge add <file>\` to ingest a markdown, text, or PDF case study, framework, or benchmark report.
36567
- NTRP indexes it for retrieval during analysis. Type \`/knowledge list\` to show what is indexed.
36915
+ NTRP indexes it for retrieval during analysis (your own consulting packs welcome \u2014 built-in toolkit is silent and lives behind get_framework_detail).
36916
+ Type \`/knowledge list\` to show what is indexed.
36568
36917
  Drop files into ~/.ntrp/knowledge to stage them.`
36569
36918
  },
36570
36919
  {
@@ -37100,7 +37449,7 @@ function formatCatalogLine(meta) {
37100
37449
  const note = DESTRUCTIVE_COMMAND_NOTES[meta.name] ? ` (${DESTRUCTIVE_COMMAND_NOTES[meta.name]})` : "";
37101
37450
  return `- /${meta.name}${args} \u2014 ${meta.description}${note}`;
37102
37451
  }
37103
- var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, HEILMEIER_GATE, PYRAMID_OUTPUT_BLOCK;
37452
+ var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, HEILMEIER_GATE, BOTTLENECK_GATE, OWNER_SHAPE_BLOCK, AAR_BLOCK, PYRAMID_OUTPUT_BLOCK;
37104
37453
  var init_prompt_parts = __esm({
37105
37454
  "src/ai/prompt-parts.ts"() {
37106
37455
  "use strict";
@@ -37180,17 +37529,33 @@ Instrument trust: every metric here carries confidence and reliability_gate fiel
37180
37529
  - INSTRUMENT WHAT YOU CHANGE. A system you can't measure is a system you can't defend at the next QBR. Name the metric each mechanism should move and where it will be read.
37181
37530
  Restraint: you diagnose and prescribe the system; you do not build it here. Name the mechanism class, not a vendor shopping list.`;
37182
37531
  HEILMEIER_GATE = `Before you recommend an action, play, or workstream \u2014 run this gate. Failures are silent: kill, demote to an assumption, or ask one sharper question. Never say Heilmeier, DARPA, or catechism to the user.
37183
- - END STATE. Name the precise outcome in one line. Vague goals die here.
37532
+ - END STATE. Name the precise outcome in one line (the objective). Vague goals die here.
37184
37533
  - STATUS QUO. How is it done today, and what is the hard limit of that approach?
37185
37534
  - NEWNESS. What is new in this approach, and why might it work when the status quo fails? If nothing is new, kill it as a restatement.
37186
37535
  - STAKE. Who cares? If it works, what difference does it make \u2014 dollars recovered or a decision unlocked? Name the cost of doing nothing. No stake \u2192 do not recommend.
37187
37536
  - RISKS AND PAYOFFS. State the main downside and the upside in the same breath.
37188
37537
  - EFFORT. Rough cost in team hours or capacity. If it cannot fit the team that exists, cut or re-sequence \u2014 do not soft-pedal.
37189
37538
  - TIME. Bound by sales-cycle and metric-update physics. Dates faster than evidence can appear are invalid.
37190
- - EXAMS. Name a mid-term check and a final exam: dated, measurable, with an instrument that exists. No exams \u2192 demote to assumption or drop.
37539
+ - EXAMS (key results). Name a mid-term check and a final exam: dated, measurable, with baseline + target RANGE + an instrument that exists. These are the objective's key results. No exams \u2192 demote to assumption or drop.
37191
37540
  - KILL RULE. If newness, stake, or exams fail: do not recommend. Demote, drop, or ask one sharper question. Surviving ideas then get pyramid packaging.`;
37541
+ BOTTLENECK_GATE = `Before you prescribe a fix \u2014 name the constraint. Never say Theory of Constraints, TOC, or Goldratt to the user.
37542
+ - CONSTRAINT FIRST. Identify the single gating vital (layer order: freshness \u2192 flow_rate/drop_rate \u2192 signal_to_noise \u2192 thread_depth) or the pipeline stage where deals die \u2014 with score and dollar label.
37543
+ - PRESCRIBE THE CONSTRAINT. The first play or workstream must move that constraint. Non-constraint work is optional polish.
37544
+ - DEPENDENCY OVER NOISE. If two problems compete, pick the one that unblocks the other.
37545
+ - KILL RULE. If the recommendation does not move the named constraint, demote or drop it.`;
37546
+ OWNER_SHAPE_BLOCK = `When you recommend action \u2014 shape the owner. Never say RACI to the user.
37547
+ - FUNCTION NOT PERSON. Name RevOps, sales manager, CS lead, marketing ops, or AE lead \u2014 not a CRM contact's personal name.
37548
+ - ACCOUNTABLE DECIDES; RESPONSIBLE EXECUTES. One accountable function per ask.
37549
+ - 48-HOUR START. The first action must be startable by that function within 48 hours with no new tooling.
37550
+ - NO REORG. Do not invent headcount or redesign the company.`;
37551
+ AAR_BLOCK = `When reviewing outcomes or distilling learning \u2014 run after-action. Never say AAR or after-action review to the user.
37552
+ - BELIEF. What we expected to move (metric + range + check date).
37553
+ - EVIDENCE. What the instruments showed (baseline \u2192 reading).
37554
+ - LEARNING. Keep, kill, or re-sequence. Write judgment changes as calibrations that supersede contradictions.
37555
+ - NEXT BET. One next exam \u2014 not a new multi-week program.`;
37192
37556
  PYRAMID_OUTPUT_BLOCK = `Structure everything the way a client remembers it \u2014 pyramid, answer first:
37193
37557
  - HEADLINE FIRST. Open with the verdict and the number in one sentence (\u226420 words): what is true and what it costs. Never open with methodology or context.
37558
+ - SITUATION AS SUPPORT. After the headline, the situation and complication that make the call true may follow as support \u2014 never as the opener. Do not name SCQA to the user.
37194
37559
  - THEN THE DRIVERS. Support the headline with 2-3 drivers that are distinct, non-overlapping, and together explain the headline \u2014 each with its own number. If two points share a cause, merge them.
37195
37560
  - THEN THE SO-WHAT. Close with what it means for the decision at hand: the action, the owner-shaped next step, or the sharpest next cut.
37196
37561
  - THE RECALL TEST. A busy executive should be able to repeat your headline and one number to their CEO an hour later. If they couldn't, tighten it.
@@ -1297,6 +1297,7 @@ function buildSessionContextDoc(file, opts = {}) {
1297
1297
  lines.push(`- Exchanges: ${exchanges}`);
1298
1298
  if (file.summary) lines.push(`- Summary: ${file.summary}`);
1299
1299
  if (file.resumed_from) lines.push(`- Resumed from: ${file.resumed_from}`);
1300
+ lines.push("- Packaging: answer-first; recommendations filtered (silent idea-gate on deep/think/strategy)");
1300
1301
  lines.push("");
1301
1302
  lines.push("## Dataset");
1302
1303
  lines.push("");
@@ -8039,6 +8040,8 @@ KINDS:
8039
8040
  - "preference": how the user wants analysis done or framed.
8040
8041
  - "calibration": a judgment update \u2014 an adjustment to HOW this business should be analyzed. Write it as an applicable rule, e.g. "Enterprise freshness reds here trace to rep coverage gaps, not data hygiene \u2014 cut by owner first" or "This team treats 45 quiet days as normal cadence; don't flag staleness before that." Capture corrections the user made to your reasoning as calibrations, not preferences.
8041
8042
 
8043
+ AFTER-ACTION LENS (silent \u2014 never name AAR to anyone): prefer items that capture BELIEF that changed, EVIDENCE that forced the change, or the NEXT BET the team should re-check. Calibrations that supersede contradictions are the highest-value distillates.
8044
+
8042
8045
  SUPERSEDING (calibrations only): the current calibrations are provided with ids. If the session contradicts or refines one, return the replacement with "supersedes" set to the old id. Never emit a calibration that duplicates an existing one.
8043
8046
 
8044
8047
  EXCLUDE:
@@ -10194,7 +10197,8 @@ handler: ../commands/knowledge.ts
10194
10197
 
10195
10198
  Teach the analyst from work done outside the platform.
10196
10199
  Type \`/knowledge add <file>\` to ingest a markdown, text, or PDF case study, framework, or benchmark report.
10197
- NTRP indexes it for retrieval during analysis. Type \`/knowledge list\` to show what is indexed.
10200
+ NTRP indexes it for retrieval during analysis (your own consulting packs welcome \u2014 built-in toolkit is silent and lives behind get_framework_detail).
10201
+ Type \`/knowledge list\` to show what is indexed.
10198
10202
  Drop files into ~/.ntrp/knowledge to stage them.`
10199
10203
  },
10200
10204
  {
@@ -10730,7 +10734,7 @@ function formatCatalogLine(meta) {
10730
10734
  const note = DESTRUCTIVE_COMMAND_NOTES[meta.name] ? ` (${DESTRUCTIVE_COMMAND_NOTES[meta.name]})` : "";
10731
10735
  return `- /${meta.name}${args} \u2014 ${meta.description}${note}`;
10732
10736
  }
10733
- var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, HEILMEIER_GATE, PYRAMID_OUTPUT_BLOCK;
10737
+ var ANALYST_FILE_NAME, ANALYST_FILE_MAX_CHARS, EXECUTION_BIAS_BLOCK, ANALYST_INSTINCT_BLOCK, SAFETY_BLOCK, VITAL_SIGNS_BLOCK, PLAYBOOK_BLOCK, DESTRUCTIVE_COMMAND_NOTES, METRICS_BLOCK, GTM_ENGINEERING_BLOCK, HEILMEIER_GATE, BOTTLENECK_GATE, OWNER_SHAPE_BLOCK, AAR_BLOCK, PYRAMID_OUTPUT_BLOCK;
10734
10738
  var init_prompt_parts = __esm({
10735
10739
  "src/ai/prompt-parts.ts"() {
10736
10740
  "use strict";
@@ -10810,17 +10814,33 @@ Instrument trust: every metric here carries confidence and reliability_gate fiel
10810
10814
  - INSTRUMENT WHAT YOU CHANGE. A system you can't measure is a system you can't defend at the next QBR. Name the metric each mechanism should move and where it will be read.
10811
10815
  Restraint: you diagnose and prescribe the system; you do not build it here. Name the mechanism class, not a vendor shopping list.`;
10812
10816
  HEILMEIER_GATE = `Before you recommend an action, play, or workstream \u2014 run this gate. Failures are silent: kill, demote to an assumption, or ask one sharper question. Never say Heilmeier, DARPA, or catechism to the user.
10813
- - END STATE. Name the precise outcome in one line. Vague goals die here.
10817
+ - END STATE. Name the precise outcome in one line (the objective). Vague goals die here.
10814
10818
  - STATUS QUO. How is it done today, and what is the hard limit of that approach?
10815
10819
  - NEWNESS. What is new in this approach, and why might it work when the status quo fails? If nothing is new, kill it as a restatement.
10816
10820
  - STAKE. Who cares? If it works, what difference does it make \u2014 dollars recovered or a decision unlocked? Name the cost of doing nothing. No stake \u2192 do not recommend.
10817
10821
  - RISKS AND PAYOFFS. State the main downside and the upside in the same breath.
10818
10822
  - EFFORT. Rough cost in team hours or capacity. If it cannot fit the team that exists, cut or re-sequence \u2014 do not soft-pedal.
10819
10823
  - TIME. Bound by sales-cycle and metric-update physics. Dates faster than evidence can appear are invalid.
10820
- - EXAMS. Name a mid-term check and a final exam: dated, measurable, with an instrument that exists. No exams \u2192 demote to assumption or drop.
10824
+ - EXAMS (key results). Name a mid-term check and a final exam: dated, measurable, with baseline + target RANGE + an instrument that exists. These are the objective's key results. No exams \u2192 demote to assumption or drop.
10821
10825
  - KILL RULE. If newness, stake, or exams fail: do not recommend. Demote, drop, or ask one sharper question. Surviving ideas then get pyramid packaging.`;
10826
+ BOTTLENECK_GATE = `Before you prescribe a fix \u2014 name the constraint. Never say Theory of Constraints, TOC, or Goldratt to the user.
10827
+ - CONSTRAINT FIRST. Identify the single gating vital (layer order: freshness \u2192 flow_rate/drop_rate \u2192 signal_to_noise \u2192 thread_depth) or the pipeline stage where deals die \u2014 with score and dollar label.
10828
+ - PRESCRIBE THE CONSTRAINT. The first play or workstream must move that constraint. Non-constraint work is optional polish.
10829
+ - DEPENDENCY OVER NOISE. If two problems compete, pick the one that unblocks the other.
10830
+ - KILL RULE. If the recommendation does not move the named constraint, demote or drop it.`;
10831
+ OWNER_SHAPE_BLOCK = `When you recommend action \u2014 shape the owner. Never say RACI to the user.
10832
+ - FUNCTION NOT PERSON. Name RevOps, sales manager, CS lead, marketing ops, or AE lead \u2014 not a CRM contact's personal name.
10833
+ - ACCOUNTABLE DECIDES; RESPONSIBLE EXECUTES. One accountable function per ask.
10834
+ - 48-HOUR START. The first action must be startable by that function within 48 hours with no new tooling.
10835
+ - NO REORG. Do not invent headcount or redesign the company.`;
10836
+ AAR_BLOCK = `When reviewing outcomes or distilling learning \u2014 run after-action. Never say AAR or after-action review to the user.
10837
+ - BELIEF. What we expected to move (metric + range + check date).
10838
+ - EVIDENCE. What the instruments showed (baseline \u2192 reading).
10839
+ - LEARNING. Keep, kill, or re-sequence. Write judgment changes as calibrations that supersede contradictions.
10840
+ - NEXT BET. One next exam \u2014 not a new multi-week program.`;
10822
10841
  PYRAMID_OUTPUT_BLOCK = `Structure everything the way a client remembers it \u2014 pyramid, answer first:
10823
10842
  - HEADLINE FIRST. Open with the verdict and the number in one sentence (\u226420 words): what is true and what it costs. Never open with methodology or context.
10843
+ - SITUATION AS SUPPORT. After the headline, the situation and complication that make the call true may follow as support \u2014 never as the opener. Do not name SCQA to the user.
10824
10844
  - THEN THE DRIVERS. Support the headline with 2-3 drivers that are distinct, non-overlapping, and together explain the headline \u2014 each with its own number. If two points share a cause, merge them.
10825
10845
  - THEN THE SO-WHAT. Close with what it means for the decision at hand: the action, the owner-shaped next step, or the sharpest next cut.
10826
10846
  - THE RECALL TEST. A busy executive should be able to repeat your headline and one number to their CEO an hour later. If they couldn't, tighten it.
@@ -11595,6 +11615,21 @@ var init_tool_schemas = __esm({
11595
11615
  required: ["play_id"]
11596
11616
  }
11597
11617
  },
11618
+ {
11619
+ name: "get_framework_detail",
11620
+ description: "Read a consulting/operating framework pack by id: when to use, vital links, board vs operator cut, kill rules, and full body. The system prompt lists only the catalog \u2014 call this when you need depth before recommending. Never name brand labels (Heilmeier, Minto, TOC, MEDDPICC, \u2026) to the user.",
11621
+ parameters: {
11622
+ type: "object",
11623
+ properties: {
11624
+ framework_id: {
11625
+ type: "string",
11626
+ maxLength: 40,
11627
+ description: "Exact id from the framework catalog, e.g. 'bottleneck', 'packaging', 'aar', 'meddpicc'."
11628
+ }
11629
+ },
11630
+ required: ["framework_id"]
11631
+ }
11632
+ },
11598
11633
  {
11599
11634
  name: "get_session_brief",
11600
11635
  description: "Read the 1-page context brief of a PRIOR session by id or 4-char suffix: status, dataset, scope, computed scores with dollar values, headline metrics, deliverables, and conversation log. Use when the user references earlier work \u2014 'last week we found\u2026', 'compare with the previous analysis', 'what did session 9297 conclude?'. Read-only.",
@@ -11696,6 +11731,251 @@ var init_tool_arg_validate = __esm({
11696
11731
  }
11697
11732
  });
11698
11733
 
11734
+ // src/data/frameworks.ts
11735
+ var frameworks_exports = {};
11736
+ __export(frameworks_exports, {
11737
+ FRAMEWORK_PACKS: () => FRAMEWORK_PACKS,
11738
+ PLAY_FRAMEWORK_HOOKS: () => PLAY_FRAMEWORK_HOOKS,
11739
+ buildFrameworkCatalogBlock: () => buildFrameworkCatalogBlock,
11740
+ frameworkIdsForPlay: () => frameworkIdsForPlay,
11741
+ getFrameworkById: () => getFrameworkById,
11742
+ listFrameworkIds: () => listFrameworkIds
11743
+ });
11744
+ function listFrameworkIds() {
11745
+ return FRAMEWORK_PACKS.map((p) => p.id);
11746
+ }
11747
+ function getFrameworkById(id) {
11748
+ return FRAMEWORK_PACKS.find((p) => p.id === id);
11749
+ }
11750
+ function buildFrameworkCatalogBlock() {
11751
+ const lines = FRAMEWORK_PACKS.filter((p) => p.always_on_catalog).map((p) => p.catalog_line);
11752
+ return `FRAMEWORK TOOLKIT (silent brands \u2014 call get_framework_detail for full body; never name brands to the user):
11753
+ ${lines.join("\n")}
11754
+ Optional packs via get_framework_detail: meddpicc, challenger, jtbd, porter, mckinsey_7s, ooda.`;
11755
+ }
11756
+ function frameworkIdsForPlay(playId) {
11757
+ return PLAY_FRAMEWORK_HOOKS[playId] ?? [];
11758
+ }
11759
+ var PLAY_FRAMEWORK_HOOKS, SILENT, FRAMEWORK_PACKS;
11760
+ var init_frameworks = __esm({
11761
+ "src/data/frameworks.ts"() {
11762
+ "use strict";
11763
+ PLAY_FRAMEWORK_HOOKS = {
11764
+ "clean-dead-pipeline": ["bottleneck", "heilmeier", "aar"],
11765
+ "unstick-pipeline": ["bottleneck", "okr_measurability", "owner_shape"],
11766
+ "fix-handoff-gap": ["bottleneck", "owner_shape", "aar"],
11767
+ "retarget-effort": ["bottleneck", "gtm_engineering"],
11768
+ "multi-thread-deals": ["owner_shape", "heilmeier"]
11769
+ };
11770
+ SILENT = "Never name this framework (or DARPA, McKinsey, Goldratt, etc.) in customer-visible text. Apply the moves; keep the brand silent.";
11771
+ FRAMEWORK_PACKS = [
11772
+ {
11773
+ id: "bottleneck",
11774
+ catalog_line: "- bottleneck \u2014 name the constraint vital/stage before prescribing; do not fix non-constraints",
11775
+ internal_name: "Theory of Constraints / bottleneck",
11776
+ always_on_catalog: true,
11777
+ vital_links: ["freshness", "flow_rate", "drop_rate", "signal_to_noise", "thread_depth"],
11778
+ board_cut: "One constraint is gating the dollar outcome. Fixing anything else is theater.",
11779
+ operator_cut: "Locate the gating vital (layer order) or the stage where deals die; put the first play there.",
11780
+ when_to_use: "Before recommending a play or sequencing workstreams.",
11781
+ kill_rules: [
11782
+ "If the recommendation does not move the constraint, demote or drop it.",
11783
+ "Do not prescribe parallel fixes that starve the constraint of capacity."
11784
+ ],
11785
+ silent_brand_rule: SILENT,
11786
+ body: `BOTTLENECK (constraint first):
11787
+ - Respect layer gating: freshness trust \u2192 flow/drop movement \u2192 signal efficiency \u2192 thread resilience.
11788
+ - Name the single constraint vital or pipeline stage with its score and dollar label.
11789
+ - Prescribe against the constraint first. Non-constraint work is optional polish.
11790
+ - If two problems compete, pick the one that unblocks the other (dependency), not the louder scorecard row.`
11791
+ },
11792
+ {
11793
+ id: "packaging",
11794
+ catalog_line: "- packaging \u2014 answer first, then situation/complication that make it true, then so-what",
11795
+ internal_name: "Minto pyramid + SCQA sibling",
11796
+ always_on_catalog: true,
11797
+ vital_links: [],
11798
+ board_cut: "Open with the call and the dollar. Context is support, not the lead.",
11799
+ operator_cut: "Headline \u226420 words \u2192 2\u20133 non-overlapping drivers \u2192 owner-shaped so-what.",
11800
+ when_to_use: "Every executive-facing answer, finding, recap Story, summary_30k.",
11801
+ kill_rules: ["Never open with methodology or a full scorecard.", "Merge overlapping drivers."],
11802
+ silent_brand_rule: SILENT,
11803
+ body: `PACKAGING (answer-first):
11804
+ - Governing thought first (verdict + dollars).
11805
+ - Then the situation and complication that make the call true (support, not opener).
11806
+ - Then drivers (distinct, non-overlapping) and so-what / ask.
11807
+ - Brief: one headline + \u22642 drivers + one so-what.`
11808
+ },
11809
+ {
11810
+ id: "aar",
11811
+ catalog_line: "- after-action \u2014 what we believed, what changed, next bet",
11812
+ internal_name: "After Action Review",
11813
+ always_on_catalog: true,
11814
+ vital_links: [],
11815
+ board_cut: "What we thought would move, what the instruments showed, what we bet next.",
11816
+ operator_cut: "Belief \u2192 evidence from vitals/metrics \u2192 keep, kill, or re-sequence the play.",
11817
+ when_to_use: "Strategy review, session distill calibrations, win/miss logging.",
11818
+ kill_rules: ["Do not log vanity narrative without a measured instrument.", "Calibrations supersede; do not pile contradictions."],
11819
+ silent_brand_rule: SILENT,
11820
+ body: `AFTER-ACTION:
11821
+ - BELIEF: what we expected to move (metric + range + check date).
11822
+ - EVIDENCE: what the instruments actually showed (baseline \u2192 reading).
11823
+ - LEARNING: keep, kill, or re-sequence \u2014 write as a calibration when judgment changed.
11824
+ - NEXT BET: the single next exam, not a new multi-week program.`
11825
+ },
11826
+ {
11827
+ id: "owner_shape",
11828
+ catalog_line: "- owner-shape \u2014 function-shaped owner and decision rights; not named people",
11829
+ internal_name: "RACI-lite",
11830
+ always_on_catalog: true,
11831
+ vital_links: [],
11832
+ board_cut: "Every ask names who decides and who executes by function.",
11833
+ operator_cut: "RevOps / AE lead / CS lead / Marketing ops \u2014 R does, A decides; avoid named individuals in plans.",
11834
+ when_to_use: "Workstream titles, handoff plans, play prescriptions.",
11835
+ kill_rules: ["No orphan actions without an accountable function.", "Do not invent headcount or reorgs."],
11836
+ silent_brand_rule: SILENT,
11837
+ body: `OWNER-SHAPE:
11838
+ - Name the function (RevOps, sales manager, CS lead, marketing ops) \u2014 not a person's name from the CRM.
11839
+ - Accountable decides; Responsible executes. Consulted optional; Inform via existing channels.
11840
+ - First action must be startable by that function within 48 hours with no new tooling.`
11841
+ },
11842
+ {
11843
+ id: "okr_measurability",
11844
+ catalog_line: "- exams \u2014 mid-term and final checks as dated key results with instruments",
11845
+ internal_name: "OKR / measurability dialect",
11846
+ always_on_catalog: true,
11847
+ vital_links: ["freshness", "flow_rate", "drop_rate", "signal_to_noise", "thread_depth"],
11848
+ board_cut: "Objective + dated key results the board can re-read next quarter.",
11849
+ operator_cut: "Baseline, target range, check date, measured_by instrument \u2014 or demote to assumption.",
11850
+ when_to_use: "Strategist outcomes, Heilmeier exams, milestones.",
11851
+ kill_rules: ["No 'improve' without a number.", "No exam faster than sales-cycle physics."],
11852
+ silent_brand_rule: SILENT,
11853
+ body: `EXAMS (objective + key results):
11854
+ - Objective = precise end state in one line.
11855
+ - Key results = mid-term check + final exam: metric, baseline, target RANGE, check date, instrument.
11856
+ - If unmeasurable with current data, exclude from targets and record as an assumption.`
11857
+ },
11858
+ {
11859
+ id: "heilmeier",
11860
+ catalog_line: "- idea-gate \u2014 newness, stake, and exams must pass before a recommendation ships",
11861
+ internal_name: "Heilmeier catechism",
11862
+ always_on_catalog: true,
11863
+ vital_links: [],
11864
+ board_cut: "Only recommendations with stake and exams reach the room.",
11865
+ operator_cut: "Kill restatements; demote unmeasurable ideas.",
11866
+ when_to_use: "Deep recommend, think before draft_strategy, strategist Stage C.",
11867
+ kill_rules: ["Fail newness, stake, or exams \u2192 do not recommend."],
11868
+ silent_brand_rule: SILENT,
11869
+ body: `IDEA GATE: end state, status quo + limit, newness, stake + cost of inaction, risks/payoffs, effort, time physics, mid+final exams. Kill on newness/stake/exams failure.`
11870
+ },
11871
+ {
11872
+ id: "minto",
11873
+ catalog_line: "- pyramid \u2014 headline, drivers, so-what for recall",
11874
+ internal_name: "Minto Pyramid Principle",
11875
+ always_on_catalog: true,
11876
+ vital_links: [],
11877
+ board_cut: "Repeatable headline + one number an hour later.",
11878
+ operator_cut: "Same shape for findings and deep answers.",
11879
+ when_to_use: "All packaged analyst prose.",
11880
+ kill_rules: ["Methodology-first openers die."],
11881
+ silent_brand_rule: SILENT,
11882
+ body: `PYRAMID: HEADLINE FIRST \u2192 DRIVERS (non-overlapping) \u2192 SO-WHAT. Recall test. Altitude control.`
11883
+ },
11884
+ {
11885
+ id: "gtm_engineering",
11886
+ catalog_line: "- systems \u2014 data foundation \u2192 modeling \u2192 activation; mechanism per fix",
11887
+ internal_name: "GTM engineering",
11888
+ always_on_catalog: true,
11889
+ vital_links: ["signal_to_noise", "drop_rate", "freshness"],
11890
+ board_cut: "Durable systems, not heroics.",
11891
+ operator_cut: "Pair every cleanup with a mechanism and an instrument.",
11892
+ when_to_use: "When recommending action on tool-capable surfaces.",
11893
+ kill_rules: ["Skipping the rung below will not hold."],
11894
+ silent_brand_rule: SILENT,
11895
+ body: `GTM SYSTEMS: three rungs (foundation \u2192 modeling \u2192 activation); signals over lists; CRM is cheapest pipeline; every fix gets a mechanism; instrument what you change.`
11896
+ },
11897
+ {
11898
+ id: "meddpicc",
11899
+ catalog_line: "- deal-qualification pack (optional) \u2014 use when threading or late-stage risk needs a qualification lens",
11900
+ internal_name: "MEDDPICC",
11901
+ always_on_catalog: false,
11902
+ vital_links: ["thread_depth", "flow_rate"],
11903
+ board_cut: "Late-stage risk is usually missing economic buyer or decision process \u2014 not more activity.",
11904
+ operator_cut: "Map Metrics, Economic buyer, Decision criteria/process, Paper process, Identify pain, Champion, Competition \u2014 as observation, not CRM surgery.",
11905
+ when_to_use: "Thread-depth or stuck late-stage deals when the user asks how to qualify.",
11906
+ kill_rules: ["Do not rewrite the CRM; observe and recommend contacts/process gaps."],
11907
+ silent_brand_rule: SILENT,
11908
+ body: `DEAL QUALIFICATION LENS: use when single-threaded or stuck late-stage deals need a checklist. Prefer introducing a second contact and clarifying decision process over more outbound volume.`
11909
+ },
11910
+ {
11911
+ id: "challenger",
11912
+ catalog_line: "- teach-tailor-take pack (optional) \u2014 pressure-test weak narratives in think",
11913
+ internal_name: "Challenger Sale",
11914
+ always_on_catalog: false,
11915
+ vital_links: ["signal_to_noise"],
11916
+ board_cut: "Insight that reframes the problem beats more activity.",
11917
+ operator_cut: "In think: teach with evidence, tailor to this pipeline, take control of next step \u2014 still stethoscope.",
11918
+ when_to_use: "Think channel when the user is soft on a weak story.",
11919
+ kill_rules: ["Do not turn into a pitch script or CRM sequence builder."],
11920
+ silent_brand_rule: SILENT,
11921
+ body: `TEACH-TAILOR-TAKE: reframe with verified numbers; tailor to segment/motion; land one owner-shaped next step.`
11922
+ },
11923
+ {
11924
+ id: "jtbd",
11925
+ catalog_line: "- job-of-the-metric pack (optional) \u2014 what job this number does for this board",
11926
+ internal_name: "Jobs to be Done",
11927
+ always_on_catalog: false,
11928
+ vital_links: [],
11929
+ board_cut: "Each metric has a job in a decision \u2014 name the job or drop the chart.",
11930
+ operator_cut: "When explaining ARR/NRR/vitals: what decision does this number unlock?",
11931
+ when_to_use: "Metric definitions / board deck framing.",
11932
+ kill_rules: ["Ornamental metrics without a decision job die."],
11933
+ silent_brand_rule: SILENT,
11934
+ body: `JOB OF THE METRIC: for each number, name the decision it serves. If none, cut it from the board package.`
11935
+ },
11936
+ {
11937
+ id: "porter",
11938
+ catalog_line: "- industry-structure pack (optional, weak vital fit) \u2014 only if the user asks competitive structure",
11939
+ internal_name: "Porter Five Forces",
11940
+ always_on_catalog: false,
11941
+ vital_links: [],
11942
+ board_cut: "Industry structure is context, not a substitute for pipeline dollars.",
11943
+ operator_cut: "Do not let industry essays displace vital-sign evidence.",
11944
+ when_to_use: "Only when the user explicitly asks for competitive structure.",
11945
+ kill_rules: ["Never use as a substitute for gating vital diagnosis."],
11946
+ silent_brand_rule: SILENT,
11947
+ body: `INDUSTRY STRUCTURE: optional context. Prefer vital signs and dollars for recommendations.`
11948
+ },
11949
+ {
11950
+ id: "mckinsey_7s",
11951
+ catalog_line: "- org-alignment pack (optional, weak vital fit) \u2014 only if the user asks org design",
11952
+ internal_name: "McKinsey 7S",
11953
+ always_on_catalog: false,
11954
+ vital_links: [],
11955
+ board_cut: "Org redesign is out of stethoscope scope.",
11956
+ operator_cut: "Refuse surgery; observe handoff/ownership symptoms via vitals.",
11957
+ when_to_use: "Only if asked; redirect to owner-shape + bottleneck.",
11958
+ kill_rules: ["No reorg prescriptions."],
11959
+ silent_brand_rule: SILENT,
11960
+ body: `ORG ALIGNMENT: out of scope for CRM surgery. Point to function-shaped owners and the constraint vital instead.`
11961
+ },
11962
+ {
11963
+ id: "ooda",
11964
+ catalog_line: "- observe-orient loop pack (optional) \u2014 overlaps gating; use sparingly",
11965
+ internal_name: "OODA",
11966
+ always_on_catalog: false,
11967
+ vital_links: [],
11968
+ board_cut: "Prefer layer gating and hypothesis-first grounding.",
11969
+ operator_cut: "Already covered by Stage A + bottleneck \u2014 do not duplicate jargon.",
11970
+ when_to_use: "Rarely; prefer existing grounding.",
11971
+ kill_rules: ["Do not invent a parallel loop vocabulary for the user."],
11972
+ silent_brand_rule: SILENT,
11973
+ body: `OBSERVE-ORIENT: prefer NTRP layer gating and Stage A hypothesis-first over a separate combat loop.`
11974
+ }
11975
+ ];
11976
+ }
11977
+ });
11978
+
11699
11979
  // src/baselines/metrics-benchmarks.ts
11700
11980
  function resolveMetricBenchmarks(motion) {
11701
11981
  return METRICS_BENCHMARKS[motion ?? "mid_market"];
@@ -17012,10 +17292,10 @@ function wrapForTarget(target, analysisBlock, conversationBlock, openQuestions,
17012
17292
  const contextLabel = handoffInstructionPrefix(ctx.analysis.primary);
17013
17293
  const forWhom = audiencePhrase(ctx.scope?.audience);
17014
17294
  const instructions = {
17015
- deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}. Pyramid structure: (1) HEADLINE \u2014 the governing number and verdict in one line; (2) DRIVERS \u2014 2\u20133 distinct, non-overlapping risks or causes with dollar impact (not a full scorecard); (3) SO-WHAT \u2014 recommended plays; (4) ASKS / decisions the room must make. Optionally one pipeline-health slide after the headline if it supports the call. Use the Metric definitions appendix so every slide can briefly remind the room what the number means for this audience.`,
17016
- asana: `produce an Asana project plan with sections and tasks tied to findings for ${forWhom}. Prioritize by dollar impact. Reference metric definitions when a task owner needs to know what "good" looks like.`,
17295
+ deck: `produce an executive review deck outline for ${company}, framed for ${forWhom}. Pyramid structure: (1) HEADLINE \u2014 the governing number and verdict in one line; (2) DRIVERS \u2014 2\u20133 distinct, non-overlapping risks or causes with dollar impact (not a full scorecard); (3) SO-WHAT \u2014 recommended plays with function-shaped owners (RevOps / sales manager / CS \u2014 not personal names); (4) ASKS / decisions the room must make. Optionally one pipeline-health slide after the headline if it supports the call. Use the Metric definitions appendix so every slide can briefly remind the room what the number means for this audience.`,
17296
+ asana: `produce an Asana project plan with sections and tasks tied to findings for ${forWhom}. Prioritize by dollar impact. Assign by function (not personal names). Reference metric definitions when a task owner needs to know what "good" looks like.`,
17017
17297
  clay: `produce a Clay table specification to operationalize the highest-impact finding for ${forWhom}.`,
17018
- plan: `produce a prioritized action plan for ${forWhom}, answer-first: open with the governing call (highest-dollar problem), then items each with problem, play, first 3 steps, owner, and leading indicator. Ground indicators in the Metric definitions appendix. End with the sharpest asks / decisions.`
17298
+ plan: `produce a prioritized action plan for ${forWhom}, answer-first: open with the governing call (highest-dollar problem / constraint), then items each with problem, play, first 3 steps, function-shaped owner, and leading indicator. Ground indicators in the Metric definitions appendix. End with the sharpest asks / decisions.`
17019
17299
  };
17020
17300
  const parts = [
17021
17301
  `# NTRP handoff \u2192 ${target}`,
@@ -17410,13 +17690,16 @@ ${companyContextSection2()}${operatorSection2()}HOW YOU THINK (the strategist me
17410
17690
  8. RESPECT CAPACITY. Total effort must fit the team that actually exists. A brilliant plan the team cannot staff is a bad plan.
17411
17691
 
17412
17692
  ALTITUDE CONTRACT (the plan must work at every altitude a client reads it at):
17413
- - 30,000 FT: summary_30k is answer-first \u2014 open with the governing thought and what leadership should expect by when, then the situation and complication that make it true. A board member reads only this; it must survive being forwarded unedited.
17414
- - 10,000 FT: each workstream's title + problem line is a delegation unit \u2014 a one-liner an owner could receive in Slack and know what they own, why it's theirs, and what number they move.
17693
+ - 30,000 FT: summary_30k is answer-first \u2014 open with the governing thought (the answer) and what leadership should expect by when, then the situation and complication that make it true as support. A board member reads only this; it must survive being forwarded unedited.
17694
+ - 10,000 FT: each workstream's title + problem line is a delegation unit \u2014 a one-liner an owner could receive in Slack and know what they own, why it's theirs, and what number they move. Use function-shaped owners (see OWNER SHAPE).
17415
17695
  - GROUND LEVEL: actions are Monday-morning prescriptive. You have built this before \u2014 read the linked play's full detail with get_play_detail and prescribe its known-good sequence adapted to THIS company's numbers and constraints. The first action of every workstream must be startable within 48 hours with no new tooling.
17416
17696
 
17417
17697
  OUTPUT DOCTRINE (narrative fields \u2014 summary_30k and workstream problem lines \u2014 follow pyramid recall):
17418
17698
  ${PYRAMID_OUTPUT_BLOCK}
17419
17699
 
17700
+ OWNER SHAPE (workstreams and actions \u2014 silent):
17701
+ ${OWNER_SHAPE_BLOCK}
17702
+
17420
17703
  ${buildUserVisibleProseBlock()}
17421
17704
 
17422
17705
  GTM ENGINEERING (plans install systems, not heroics):
@@ -17431,7 +17714,10 @@ ${METRICS_BLOCK}
17431
17714
  PLAYBOOK (every workstream must link to at least one play by exact id):
17432
17715
  ${buildPlaybookBlock()}
17433
17716
 
17717
+ ${buildFrameworkCatalogBlock()}
17718
+
17434
17719
  MEASURABILITY CONTRACT (non-negotiable \u2014 this is what separates you from a slide deck):
17720
+ - Treat the objective as the end state; treat expected outcomes and leading indicators as key results (mid-term and final exams).
17435
17721
  - Every expected outcome and leading indicator needs: a metric, the current baseline copied from your verified grounding work, a target RANGE, a check date, and the named instrument that will measure it.
17436
17722
  - Banned words for outcomes: "improve", "better", "significantly", "optimize", "increase" without a number. If you cannot quantify it, it is not an outcome \u2014 demote it to an assumption or replace it with its best measurable proxy.
17437
17723
  - Every workstream needs at least one dated milestone with a verification method that names a number and threshold.
@@ -17450,9 +17736,13 @@ function buildGroundingMessage(input) {
17450
17736
 
17451
17737
  Establish verified reality before any planning. Work hypothesis-first, like an engagement manager on day one: form your top candidate explanations for what stands between today and the objective, then use tools to confirm or kill each one \u2014 don't boil the ocean.
17452
17738
  1. Current state: which vital signs / metrics are worst, what are the exact scores and dollar values, which segments concentrate the problem?
17453
- 2. What is already in flight (active strategies below, if any), what has worked before (wins), and what the local play track record says.
17454
- 3. What are the binding constraints: data gaps that limit measurability, sales-cycle length that bounds verification speed, capacity signals?
17455
- Rank the problems you verify by dollars at stake \xD7 confidence in the read \xD7 speed to impact \u2014 that ranking becomes the spine of the plan.`);
17739
+ 2. CONSTRAINT: name the single gating vital (layer order) or stage where deals die \u2014 with score and dollar label. This is the bottleneck the plan must move first.
17740
+ 3. What is already in flight (active strategies below, if any), what has worked before (wins), and what the local play track record says.
17741
+ 4. What are the binding constraints: data gaps that limit measurability, sales-cycle length that bounds verification speed, capacity signals?
17742
+ Rank the problems you verify by dollars at stake \xD7 confidence in the read \xD7 speed to impact \u2014 that ranking becomes the spine of the plan. Non-constraint problems wait.
17743
+
17744
+ BOTTLENECK (silent):
17745
+ ${BOTTLENECK_GATE}`);
17456
17746
  sections.push(`CURRENT HEALTH SNAPSHOT (verified \u2014 you may cite these numbers as baselines):
17457
17747
  ${input.healthSnapshot}`);
17458
17748
  if (input.gapAuditBlock) {
@@ -17501,6 +17791,8 @@ function buildStressTestMessage() {
17501
17791
  8. ALTITUDE CHECK: does summary_30k survive being forwarded to a board member unedited? Is each workstream title + problem a self-contained delegation one-liner? Is every first action startable within 48 hours?
17502
17792
  9. HEILMEIER GATE (silent \u2014 never name this to the user). Run every workstream through this filter. Failures: cut the workstream, demote it to assumptions, or rewrite until it passes \u2014 then emit final JSON.
17503
17793
  ${HEILMEIER_GATE}
17794
+ 10. AFTER-ACTION PREP (silent). Ensure each workstream's exams can support a later belief\u2192evidence\u2192next-bet review. Fold gaps into assumptions or contingencies.
17795
+ ${AAR_BLOCK}
17504
17796
 
17505
17797
  Then respond with the FINAL revised plan as strict JSON in the same schema \u2014 no markdown fences, no prose. Fold what you learned into constraints, assumptions, risks, and confidence. This version is the one that gets saved and reviewed against, so make every number one you are willing to be checked on.`;
17506
17798
  }
@@ -17509,6 +17801,7 @@ var init_strategist_prompt = __esm({
17509
17801
  "src/ai/strategist-prompt.ts"() {
17510
17802
  "use strict";
17511
17803
  init_prompt_parts();
17804
+ init_frameworks();
17512
17805
  init_prompt();
17513
17806
  STRATEGIST_PLAN_SCHEMA_BLOCK = `{
17514
17807
  "title": "Short plan name, e.g. 'Q4 Pipeline Recovery'",
@@ -18849,6 +19142,7 @@ var init_ghost_hints = __esm({
18849
19142
  ],
18850
19143
  explore: [
18851
19144
  'try "what is the most expensive problem?"',
19145
+ 'try "which constraint is gating the dollars?"',
18852
19146
  'try "how should we fix this?"',
18853
19147
  'try "which segment is weakest?"',
18854
19148
  'try "what is ARR?"',
@@ -18939,9 +19233,28 @@ function buildSituationalAwarenessBlock(ctx, opts = {}) {
18939
19233
  if (examples.length > 0) {
18940
19234
  lines.push(`User may try: ${examples.join(" \xB7 ")}`);
18941
19235
  }
18942
- lines.push(
18943
- "Your job in this harness: fill the judgment gap after formula compute \u2014 connect dollars, name the expensive problem, do not restate scorecards the user already saw"
18944
- );
19236
+ if (channel === "think") {
19237
+ lines.push(
19238
+ "Doctrine: probing leads with the sharpest question (idea-gate off until you conclude); concluding/recommend turns \u2014 silent idea-gate then bottleneck then pyramid packaging; never name frameworks to the user"
19239
+ );
19240
+ } else if (responseMode === "brief") {
19241
+ lines.push(
19242
+ "Doctrine: brief packaging \u2014 headline \u226420 words, \u22642 drivers, one so-what; idea-gate off; never name frameworks to the user; do not restate The Call/scorecard \u2014 advance"
19243
+ );
19244
+ } else {
19245
+ lines.push(
19246
+ "Doctrine: deep/recommend \u2014 silent idea-gate then bottleneck then owner-shape then pyramid packaging; call get_framework_detail for toolkit depth; never name frameworks to the user"
19247
+ );
19248
+ }
19249
+ if (analysisReady) {
19250
+ lines.push(
19251
+ "Your job in this harness: after formula compute, lead with the most expensive or actionable implication \u2014 connect dollars, name the constraint, do not restate scorecards or The Call the user already saw"
19252
+ );
19253
+ } else {
19254
+ lines.push(
19255
+ "Your job in this harness: help the user through the funnel; CLI owns pre-explore gates"
19256
+ );
19257
+ }
18945
19258
  lines.push(
18946
19259
  "Pre-explore funnel gates are handled by the CLI; you speak in explore/think/strategist unless tools explicitly allow a restart"
18947
19260
  );
@@ -18954,10 +19267,12 @@ function buildSituationalRuntimeFacts(ctx, opts = {}) {
18954
19267
  return {
18955
19268
  phase,
18956
19269
  mode: responseMode,
19270
+ channel,
18957
19271
  lens: ctx.scope?.primary_lens,
18958
19272
  stage: ctx.stage,
18959
19273
  can_compute: ctx.gapAudit?.can_compute === void 0 ? void 0 : String(ctx.gapAudit.can_compute),
18960
- engine: canUseReplAi(ctx) ? "connected" : "none"
19274
+ engine: canUseReplAi(ctx) ? "connected" : "none",
19275
+ idea_gate: channel === "think" || responseMode === "deep" ? "on" : "off"
18961
19276
  };
18962
19277
  }
18963
19278
  function getConversationPhaseBlock(ctx, opts = {}) {
@@ -25280,6 +25595,7 @@ async function handleGetPlayDetail(input) {
25280
25595
  }
25281
25596
  } catch {
25282
25597
  }
25598
+ const { frameworkIdsForPlay: frameworkIdsForPlay2 } = await Promise.resolve().then(() => (init_frameworks(), frameworks_exports));
25283
25599
  const detail = {
25284
25600
  play_id: play.id,
25285
25601
  play_name: play.name,
@@ -25291,7 +25607,8 @@ async function handleGetPlayDetail(input) {
25291
25607
  tools_that_help: play.tools_that_help,
25292
25608
  expected_outcome: play.expected_outcome,
25293
25609
  source: play.source ?? "seed",
25294
- local_track_record: trackRecord
25610
+ local_track_record: trackRecord,
25611
+ framework_ids: frameworkIdsForPlay2(play.id)
25295
25612
  };
25296
25613
  if (play.source === "learned") {
25297
25614
  detail.security_notice = UNTRUSTED_CONTENT_NOTICE;
@@ -25302,6 +25619,30 @@ async function handleGetPlayDetail(input) {
25302
25619
  }
25303
25620
  return detail;
25304
25621
  }
25622
+ async function handleGetFrameworkDetail(input) {
25623
+ const frameworkId = typeof input.framework_id === "string" ? input.framework_id.trim() : "";
25624
+ const { getFrameworkById: getFrameworkById2, listFrameworkIds: listFrameworkIds2 } = await Promise.resolve().then(() => (init_frameworks(), frameworks_exports));
25625
+ const pack = frameworkId ? getFrameworkById2(frameworkId) : void 0;
25626
+ if (!pack) {
25627
+ return {
25628
+ error: `Unknown framework id '${frameworkId}'.`,
25629
+ valid_framework_ids: listFrameworkIds2()
25630
+ };
25631
+ }
25632
+ return {
25633
+ framework_id: pack.id,
25634
+ catalog_line: pack.catalog_line,
25635
+ always_on_catalog: pack.always_on_catalog,
25636
+ vital_links: pack.vital_links,
25637
+ board_cut: pack.board_cut,
25638
+ operator_cut: pack.operator_cut,
25639
+ when_to_use: pack.when_to_use,
25640
+ kill_rules: pack.kill_rules,
25641
+ silent_brand_rule: pack.silent_brand_rule,
25642
+ body: pack.body,
25643
+ notice: "Apply the moves in body/board_cut/operator_cut. Never name internal brand labels to the user."
25644
+ };
25645
+ }
25305
25646
  async function handleGetRevenueMetrics(_input, ctx) {
25306
25647
  if (!ctx.metrics || ctx.metrics.length === 0) {
25307
25648
  const { computeFullMetrics: computeFullMetrics2 } = await Promise.resolve().then(() => (init_compute(), compute_exports));
@@ -25596,6 +25937,7 @@ var init_tool_handlers = __esm({
25596
25937
  query_segment_comparison: handleQuerySegmentComparison,
25597
25938
  query_entity_counts: (input, _) => handleQueryEntityCounts(input),
25598
25939
  get_play_detail: (input, _) => handleGetPlayDetail(input),
25940
+ get_framework_detail: (input, _) => handleGetFrameworkDetail(input),
25599
25941
  get_session_brief: (input, _) => handleGetSessionBrief(input),
25600
25942
  get_revenue_metrics: handleGetRevenueMetrics,
25601
25943
  get_revenue_metrics_timeseries: (input, _) => handleGetRevenueMetricsTimeseries(input),
@@ -25733,6 +26075,12 @@ ${GTM_ENGINEERING_BLOCK}
25733
26075
  IDEA GATE (when recommending a play or before draft_strategy \u2014 silent; probing/imagination turns skip this until you conclude):
25734
26076
  ${HEILMEIER_GATE}
25735
26077
 
26078
+ BOTTLENECK (when concluding or recommending \u2014 silent):
26079
+ ${BOTTLENECK_GATE}
26080
+
26081
+ OWNER SHAPE (when recommending \u2014 silent):
26082
+ ${OWNER_SHAPE_BLOCK}
26083
+
25736
26084
  OUTPUT DOCTRINE (how answers are structured for recall):
25737
26085
  ${PYRAMID_OUTPUT_BLOCK}
25738
26086
 
@@ -25747,6 +26095,8 @@ ${VITAL_SIGNS_BLOCK}
25747
26095
  PLAYBOOK \u2014 name a play when it helps the user act (not a full program):
25748
26096
  ${buildPlaybookBlock()}
25749
26097
 
26098
+ ${buildFrameworkCatalogBlock()}
26099
+
25750
26100
  ${commandSection}
25751
26101
  ${formattingSection}
25752
26102
  OUTPUT RULES:
@@ -25775,6 +26125,7 @@ var init_think_prompt = __esm({
25775
26125
  "src/ai/think-prompt.ts"() {
25776
26126
  "use strict";
25777
26127
  init_prompt_parts();
26128
+ init_frameworks();
25778
26129
  init_prompt();
25779
26130
  }
25780
26131
  });
@@ -25969,7 +26320,7 @@ ${commandStyleRule}`;
25969
26320
  - Respond in plain text (not JSON). You do NOT need to emit the findings schema \u2014 only emit structured findings if the user explicitly asks for them.
25970
26321
  - Include specific numbers from tool results, never guess.
25971
26322
  - When you have enough information, answer directly. Don't call tools you don't need.`;
25972
- const executionBiasSection = responseMode === "brief" ? `OUTPUT DOCTRINE (brief \u2014 one headline + \u22642 drivers + one so-what):
26323
+ const executionBiasSection = responseMode === "brief" ? `OUTPUT DOCTRINE (brief \u2014 one headline + \u22642 drivers + one so-what; situation/complication only as support after the headline):
25973
26324
  ${PYRAMID_OUTPUT_BLOCK}
25974
26325
 
25975
26326
  ` : `EXECUTION BIAS (how you work):
@@ -25981,6 +26332,12 @@ ${GTM_ENGINEERING_BLOCK}
25981
26332
  IDEA GATE (when recommending action \u2014 silent):
25982
26333
  ${HEILMEIER_GATE}
25983
26334
 
26335
+ BOTTLENECK (constraint first \u2014 silent):
26336
+ ${BOTTLENECK_GATE}
26337
+
26338
+ OWNER SHAPE (when recommending action \u2014 silent):
26339
+ ${OWNER_SHAPE_BLOCK}
26340
+
25984
26341
  OUTPUT DOCTRINE (how answers are structured for recall):
25985
26342
  ${PYRAMID_OUTPUT_BLOCK}
25986
26343
 
@@ -25996,6 +26353,8 @@ ${VITAL_SIGNS_BLOCK}
25996
26353
  PLAYBOOK \u2014 recommend these plays when appropriate:
25997
26354
  ${buildPlaybookBlock()}
25998
26355
 
26356
+ ${buildFrameworkCatalogBlock()}
26357
+
25999
26358
  ${commandSection}`;
26000
26359
  const stable = `You are a world-class GTM operating partner \u2014 the kind of analyst a CEO keeps on speed dial. You are exceptionally well-read, rigorous, and commercially sharp, and you have tools to query a local database of this company's CRM and pipeline data. The user is having an ongoing, free-form conversation with you about their go-to-market health and SaaS metrics.
26001
26360
 
@@ -26244,6 +26603,7 @@ var init_agentic_loop = __esm({
26244
26603
  init_thread();
26245
26604
  init_untrusted();
26246
26605
  init_prompt_parts();
26606
+ init_frameworks();
26247
26607
  init_think_prompt();
26248
26608
  init_prompt();
26249
26609
  init_context2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonnechasser/ntrp",
3
- "version": "1.4.7",
3
+ "version": "1.4.8",
4
4
  "description": "GTM Health Diagnostic CLI — local pipeline analysis tool",
5
5
  "homepage": "https://ntrp.sonnechasser.com",
6
6
  "repository": {