task-summary-extractor 8.1.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +17 -12
- package/EXPLORATION.md +25 -21
- package/README.md +23 -15
- package/package.json +2 -2
- package/process_and_upload.js +7 -100
- package/prompt.json +199 -131
- package/src/{utils → modes}/deep-dive.js +2 -2
- package/src/{utils → modes}/dynamic-mode.js +2 -2
- package/src/{utils → modes}/focused-reanalysis.js +2 -2
- package/src/{utils → modes}/progress-updater.js +1 -1
- package/src/pipeline.js +9 -8
- package/src/services/gemini.js +4 -4
- package/src/services/git.js +0 -29
- package/src/utils/adaptive-budget.js +0 -2
- package/src/utils/cli.js +30 -3
- package/src/utils/context-manager.js +0 -4
- package/src/utils/diff-engine.js +0 -3
- package/src/utils/json-parser.js +1 -1
- package/src/utils/learning-loop.js +0 -1
- package/src/utils/quality-gate.js +0 -6
- package/src/utils/retry.js +10 -4
- package/src/utils/prompt.js +0 -32
- /package/src/{utils → modes}/change-detector.js +0 -0
- /package/src/utils/{progress.js → checkpoint.js} +0 -0
package/src/services/gemini.js
CHANGED
|
@@ -207,14 +207,14 @@ function buildDocBridgeText(contextDocs) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
bridgeText += `\n\nCRITICAL: Cross-reference these task documents with the
|
|
210
|
+
bridgeText += `\n\nCRITICAL: Cross-reference these task documents with the content being analyzed. When the content mentions a file, class, procedure, module, CR number, or ticket — match it to the corresponding task document. Use exact file paths and component names from the code-map.md and execution-plan.md in your output. The task documents contain the ground truth for what was planned — the content reveals what was actually discussed, confirmed, or changed. Flag any discrepancies between documented state and observed state.`;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
// Tier 2 — Robot/AI knowledge base
|
|
214
214
|
if (robotDocs.length > 0) {
|
|
215
215
|
bridgeText += `\n\n=== TIER 2: CODEBASE KNOWLEDGE BASE (${robotDocs.length}) — FILE MAPS & PATTERNS ===`;
|
|
216
216
|
bridgeText += `\nThese contain complete file maps for every app/service, backend API maps, database schemas, auth configs, coding patterns, and naming conventions.`;
|
|
217
|
-
bridgeText += `\nUse these to RESOLVE exact file paths when the
|
|
217
|
+
bridgeText += `\nUse these to RESOLVE exact file paths when the content mentions a class, component, service, or controller by name.`;
|
|
218
218
|
bridgeText += `\nFiles: ${robotDocs.map(d => d.fileName).join(', ')}`;
|
|
219
219
|
}
|
|
220
220
|
|
|
@@ -222,13 +222,13 @@ function buildDocBridgeText(contextDocs) {
|
|
|
222
222
|
if (archDocs.length > 0) {
|
|
223
223
|
bridgeText += `\n\n=== TIER 3: PROJECT DOCUMENTATION (${archDocs.length}) — ARCHITECTURE & REFERENCE ===`;
|
|
224
224
|
bridgeText += `\nThese provide background on the solution architecture, tech stack, patterns, best practices, payment systems, evaluation system, i18n, and more.`;
|
|
225
|
-
bridgeText += `\nUse for context when the
|
|
225
|
+
bridgeText += `\nUse for context when the content discusses system concepts, design decisions, or technical constraints.`;
|
|
226
226
|
bridgeText += `\nFiles: ${archDocs.map(d => d.fileName).join(', ')}`;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
// Other docs
|
|
230
230
|
if (otherDocs.length > 0) {
|
|
231
|
-
bridgeText += `\n\n===
|
|
231
|
+
bridgeText += `\n\n=== SUPPORTING DOCUMENTS (${otherDocs.length}) — SUBTITLES, TRANSCRIPTS, NOTES, OTHER ===`;
|
|
232
232
|
bridgeText += `\nFiles: ${otherDocs.map(d => d.fileName).join(', ')}`;
|
|
233
233
|
}
|
|
234
234
|
|
package/src/services/git.js
CHANGED
|
@@ -254,34 +254,6 @@ function getDiffSummary(repoPath, sinceISO) {
|
|
|
254
254
|
return output || 'No stat available';
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
/**
|
|
258
|
-
* Get actual diff content, truncated to maxBytes.
|
|
259
|
-
* Used for keyword matching, NOT sent to Gemini directly.
|
|
260
|
-
*
|
|
261
|
-
* @param {string} repoPath
|
|
262
|
-
* @param {string} sinceISO
|
|
263
|
-
* @param {number} [maxBytes=100000]
|
|
264
|
-
* @returns {string} Diff content (may be truncated)
|
|
265
|
-
*/
|
|
266
|
-
function getDiffContent(repoPath, sinceISO, maxBytes = 100000) {
|
|
267
|
-
const commits = getCommitsSince(repoPath, sinceISO);
|
|
268
|
-
if (commits.length === 0) return '';
|
|
269
|
-
|
|
270
|
-
const oldestHash = commits[commits.length - 1].hash;
|
|
271
|
-
let output = execGit(
|
|
272
|
-
['diff', '--no-color', '-U2', `${oldestHash}~1`, 'HEAD'],
|
|
273
|
-
repoPath,
|
|
274
|
-
);
|
|
275
|
-
if (!output) {
|
|
276
|
-
output = execGit(['diff', '--no-color', '-U2', oldestHash, 'HEAD'], repoPath);
|
|
277
|
-
}
|
|
278
|
-
if (!output) return '';
|
|
279
|
-
|
|
280
|
-
return output.length > maxBytes
|
|
281
|
-
? output.slice(0, maxBytes) + '\n... (truncated at ' + Math.round(maxBytes / 1024) + ' KB)'
|
|
282
|
-
: output;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
257
|
// ======================== WORKING TREE ========================
|
|
286
258
|
|
|
287
259
|
/**
|
|
@@ -322,7 +294,6 @@ module.exports = {
|
|
|
322
294
|
getCommitsWithFiles,
|
|
323
295
|
getChangedFilesSince,
|
|
324
296
|
getDiffSummary,
|
|
325
|
-
getDiffContent,
|
|
326
297
|
getWorkingTreeChanges,
|
|
327
298
|
getCurrentBranch,
|
|
328
299
|
normPath,
|
package/src/utils/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI argument parser
|
|
2
|
+
* CLI utilities — argument parser, interactive prompts, folder/model selection.
|
|
3
3
|
*
|
|
4
4
|
* Supports:
|
|
5
5
|
* --flag Boolean flag
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* --key value Key-value (next arg)
|
|
8
8
|
* positional args Collected separately
|
|
9
9
|
*
|
|
10
|
-
* Also includes interactive folder selection
|
|
10
|
+
* Also includes interactive prompts, folder selection, and model selection.
|
|
11
11
|
*
|
|
12
12
|
* Usage:
|
|
13
13
|
* const { flags, positional } = parseArgs(process.argv.slice(2));
|
|
@@ -412,4 +412,31 @@ function showHelp() {
|
|
|
412
412
|
throw Object.assign(new Error('HELP_SHOWN'), { code: 'HELP_SHOWN' });
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
-
module.exports = { parseArgs, showHelp, discoverFolders, selectFolder, selectModel };
|
|
415
|
+
module.exports = { parseArgs, showHelp, discoverFolders, selectFolder, selectModel, promptUser, promptUserText };
|
|
416
|
+
|
|
417
|
+
// ======================== INTERACTIVE PROMPTS ========================
|
|
418
|
+
|
|
419
|
+
/** Prompt user for a yes/no question on stdin. Returns true for yes. */
|
|
420
|
+
function promptUser(question) {
|
|
421
|
+
const readline = require('readline');
|
|
422
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
423
|
+
return new Promise(resolve => {
|
|
424
|
+
rl.question(question, answer => {
|
|
425
|
+
rl.close();
|
|
426
|
+
const a = (answer || '').trim().toLowerCase();
|
|
427
|
+
resolve(a === 'y' || a === 'yes');
|
|
428
|
+
});
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** Prompt user for free text input. Returns trimmed string. */
|
|
433
|
+
function promptUserText(question) {
|
|
434
|
+
const readline = require('readline');
|
|
435
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
436
|
+
return new Promise(resolve => {
|
|
437
|
+
rl.question(question, answer => {
|
|
438
|
+
rl.close();
|
|
439
|
+
resolve((answer || '').trim());
|
|
440
|
+
});
|
|
441
|
+
});
|
|
442
|
+
}
|
|
@@ -486,12 +486,8 @@ function detectBoundaryContext(vttContent, segmentStartSec, segmentEndSec, segme
|
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
module.exports = {
|
|
489
|
-
PRIORITY,
|
|
490
489
|
estimateTokens,
|
|
491
|
-
estimateDocTokens,
|
|
492
|
-
classifyDocPriority,
|
|
493
490
|
selectDocsByBudget,
|
|
494
|
-
parseVttCues,
|
|
495
491
|
sliceVttForSegment,
|
|
496
492
|
buildProgressiveContext,
|
|
497
493
|
buildSegmentFocus,
|
package/src/utils/diff-engine.js
CHANGED
package/src/utils/json-parser.js
CHANGED
|
@@ -242,4 +242,4 @@ function extractJson(rawText) {
|
|
|
242
242
|
return null;
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
module.exports = { extractJson
|
|
245
|
+
module.exports = { extractJson };
|
|
@@ -418,12 +418,6 @@ function getConfidenceStats(analysis) {
|
|
|
418
418
|
module.exports = {
|
|
419
419
|
assessQuality,
|
|
420
420
|
formatQualityLine,
|
|
421
|
-
buildRetryHints,
|
|
422
421
|
getConfidenceStats,
|
|
423
422
|
THRESHOLDS,
|
|
424
|
-
// Expose for testing
|
|
425
|
-
scoreStructure,
|
|
426
|
-
scoreDensity,
|
|
427
|
-
scoreIntegrity,
|
|
428
|
-
scoreCrossReferences,
|
|
429
423
|
};
|
package/src/utils/retry.js
CHANGED
|
@@ -3,11 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Used for Gemini API calls and Firebase operations that may fail
|
|
5
5
|
* due to rate limits, network issues, or temporary outages.
|
|
6
|
+
*
|
|
7
|
+
* Defaults are self-contained (no upward dependency on config).
|
|
8
|
+
* Callers can override via opts.maxRetries and opts.baseDelay.
|
|
6
9
|
*/
|
|
7
10
|
|
|
8
11
|
'use strict';
|
|
9
12
|
|
|
10
|
-
|
|
13
|
+
/** Default retry attempts — overridable via opts.maxRetries */
|
|
14
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
15
|
+
/** Default base delay in ms — overridable via opts.baseDelay */
|
|
16
|
+
const DEFAULT_BASE_DELAY_MS = 2000;
|
|
11
17
|
|
|
12
18
|
/**
|
|
13
19
|
* Known transient error patterns that should be retried.
|
|
@@ -63,8 +69,8 @@ function isTransientError(err) {
|
|
|
63
69
|
* @returns {Promise<any>} Result of fn()
|
|
64
70
|
*/
|
|
65
71
|
async function withRetry(fn, opts = {}) {
|
|
66
|
-
const maxRetries = opts.maxRetries ??
|
|
67
|
-
const baseDelay = opts.baseDelay ??
|
|
72
|
+
const maxRetries = opts.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
73
|
+
const baseDelay = opts.baseDelay ?? DEFAULT_BASE_DELAY_MS;
|
|
68
74
|
const label = opts.label || 'operation';
|
|
69
75
|
const shouldRetry = opts.shouldRetry || isTransientError;
|
|
70
76
|
const onRetry = opts.onRetry || null;
|
|
@@ -126,4 +132,4 @@ async function parallelMap(items, fn, concurrency = 3) {
|
|
|
126
132
|
return results;
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
module.exports = { withRetry, parallelMap
|
|
135
|
+
module.exports = { withRetry, parallelMap };
|
package/src/utils/prompt.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interactive CLI prompts (stdin/stdout).
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
/** Prompt user for a yes/no question on stdin. Returns true for yes. */
|
|
8
|
-
function promptUser(question) {
|
|
9
|
-
const readline = require('readline');
|
|
10
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
11
|
-
return new Promise(resolve => {
|
|
12
|
-
rl.question(question, answer => {
|
|
13
|
-
rl.close();
|
|
14
|
-
const a = (answer || '').trim().toLowerCase();
|
|
15
|
-
resolve(a === 'y' || a === 'yes');
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** Prompt user for free text input. Returns trimmed string. */
|
|
21
|
-
function promptUserText(question) {
|
|
22
|
-
const readline = require('readline');
|
|
23
|
-
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
24
|
-
return new Promise(resolve => {
|
|
25
|
-
rl.question(question, answer => {
|
|
26
|
-
rl.close();
|
|
27
|
-
resolve((answer || '').trim());
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
module.exports = { promptUser, promptUserText };
|
|
File without changes
|
|
File without changes
|