promptup-plugin 0.1.8 → 0.1.9

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/evaluator.js CHANGED
@@ -11,6 +11,7 @@ import { ulid } from 'ulid';
11
11
  import { BASE_DIMENSIONS, BASE_DIMENSION_KEYS, DOMAIN_DIMENSIONS, DOMAIN_DIMENSION_KEYS, WEIGHT_PROFILES, } from './shared/dimensions.js';
12
12
  import { computeCompositeScore, computeDomainComposite, computeTechComposite, computeOverallComposite, computeGrandComposite, computeRiskFlagsWithHistory, } from './shared/scoring.js';
13
13
  import { getLatestEvaluation, insertEvaluation, insertDecision, } from './db.js';
14
+ import { detectDecisions } from './decision-detector.js';
14
15
  /**
15
16
  * Combined role + skill roadmaps catalog for tech detection.
16
17
  * Mirrors the full list from @promptup/shared/roadmaps without importing it.
@@ -362,6 +363,19 @@ export async function evaluateSession(sessionId, messages, triggerType, weightPr
362
363
  domainDimensionScores = heuristic.domainDimensionScores;
363
364
  techExpertise = heuristicTechDetect(messages);
364
365
  recommendations = heuristic.recommendations;
366
+ // Extract decisions via heuristic detector (Claude path does this via LLM)
367
+ try {
368
+ const heuristicDecisions = detectDecisions(messages, sessionId);
369
+ if (heuristicDecisions.length > 0) {
370
+ for (const d of heuristicDecisions) {
371
+ insertDecision(d);
372
+ }
373
+ console.log(`[eval] Heuristic extracted ${heuristicDecisions.length} decisions`);
374
+ }
375
+ }
376
+ catch (decErr) {
377
+ console.warn(`[eval] Heuristic decision extraction failed: ${decErr}`);
378
+ }
365
379
  rawEvaluation = JSON.stringify({
366
380
  activity_log: heuristicActivityLog(messages),
367
381
  domain_dimensions: domainDimensionScores,
@@ -130,22 +130,23 @@ function matchSessionsToBranch(branch, commits, projectPath) {
130
130
  }
131
131
  // ─── Decision gathering ───────────────────────────────────────────────────────
132
132
  function gatherDecisions(sessionIds) {
133
- // First try plugin/daemon-captured decisions
133
+ // Get existing decisions from DB
134
134
  const existing = getDecisionsBySessions(sessionIds);
135
- if (existing.length > 0)
136
- return existing;
137
- // Fall back to heuristic detection from messages
138
- const heuristic = [];
135
+ // Also run heuristic detection on sessions that have no decisions yet
136
+ const sessionsWithDecisions = new Set(existing.map(d => d.session_id));
139
137
  for (const sid of sessionIds) {
138
+ if (sessionsWithDecisions.has(sid))
139
+ continue; // Already has decisions from Claude or previous heuristic
140
140
  const messages = getMessagesBySession(sid, 10000, 0);
141
+ if (messages.length < 3)
142
+ continue;
141
143
  const detected = detectDecisions(messages, sid);
142
- // Persist detected decisions so they're available in future queries
143
144
  for (const d of detected) {
144
145
  insertDecision(d);
145
146
  }
146
- heuristic.push(...detected);
147
+ existing.push(...detected);
147
148
  }
148
- return heuristic;
149
+ return existing;
149
150
  }
150
151
  function getSignal(d) {
151
152
  return d.signal ?? 'low';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "promptup-plugin",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "AI coding skill evaluator for Claude Code — 11-dimension scoring, decision intelligence, PR reports",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",