@codeledger/selector 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/blast-radius.d.ts +7 -0
  2. package/dist/blast-radius.d.ts.map +1 -0
  3. package/dist/blast-radius.js +105 -0
  4. package/dist/blast-radius.js.map +1 -0
  5. package/dist/bundle.d.ts +10 -0
  6. package/dist/bundle.d.ts.map +1 -1
  7. package/dist/bundle.js +83 -9
  8. package/dist/bundle.js.map +1 -1
  9. package/dist/candidates.d.ts +12 -1
  10. package/dist/candidates.d.ts.map +1 -1
  11. package/dist/candidates.js +147 -22
  12. package/dist/candidates.js.map +1 -1
  13. package/dist/confidence.d.ts.map +1 -1
  14. package/dist/confidence.js +31 -0
  15. package/dist/confidence.js.map +1 -1
  16. package/dist/exemplars.d.ts +8 -0
  17. package/dist/exemplars.d.ts.map +1 -0
  18. package/dist/exemplars.js +122 -0
  19. package/dist/exemplars.js.map +1 -0
  20. package/dist/index.d.ts +19 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +15 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/knowledge-bundle.d.ts +41 -0
  25. package/dist/knowledge-bundle.d.ts.map +1 -0
  26. package/dist/knowledge-bundle.js +200 -0
  27. package/dist/knowledge-bundle.js.map +1 -0
  28. package/dist/knowledge-candidates.d.ts +27 -0
  29. package/dist/knowledge-candidates.d.ts.map +1 -0
  30. package/dist/knowledge-candidates.js +123 -0
  31. package/dist/knowledge-candidates.js.map +1 -0
  32. package/dist/knowledge-excerpt.d.ts +26 -0
  33. package/dist/knowledge-excerpt.d.ts.map +1 -0
  34. package/dist/knowledge-excerpt.js +179 -0
  35. package/dist/knowledge-excerpt.js.map +1 -0
  36. package/dist/knowledge-scorer.d.ts +33 -0
  37. package/dist/knowledge-scorer.d.ts.map +1 -0
  38. package/dist/knowledge-scorer.js +234 -0
  39. package/dist/knowledge-scorer.js.map +1 -0
  40. package/dist/layer-ordering.d.ts +37 -0
  41. package/dist/layer-ordering.d.ts.map +1 -0
  42. package/dist/layer-ordering.js +93 -0
  43. package/dist/layer-ordering.js.map +1 -0
  44. package/dist/mode-detect.d.ts +23 -0
  45. package/dist/mode-detect.d.ts.map +1 -0
  46. package/dist/mode-detect.js +76 -0
  47. package/dist/mode-detect.js.map +1 -0
  48. package/dist/near-miss.d.ts +9 -0
  49. package/dist/near-miss.d.ts.map +1 -0
  50. package/dist/near-miss.js +78 -0
  51. package/dist/near-miss.js.map +1 -0
  52. package/dist/scorer.d.ts +2 -2
  53. package/dist/scorer.d.ts.map +1 -1
  54. package/dist/scorer.js +23 -6
  55. package/dist/scorer.js.map +1 -1
  56. package/dist/stubs.d.ts.map +1 -1
  57. package/dist/stubs.js +4 -3
  58. package/dist/stubs.js.map +1 -1
  59. package/dist/task-type.d.ts +28 -0
  60. package/dist/task-type.d.ts.map +1 -0
  61. package/dist/task-type.js +115 -0
  62. package/dist/task-type.js.map +1 -0
  63. package/dist/todo-scan.d.ts +31 -0
  64. package/dist/todo-scan.d.ts.map +1 -0
  65. package/dist/todo-scan.js +63 -0
  66. package/dist/todo-scan.js.map +1 -0
  67. package/dist/token-calibration.d.ts +27 -0
  68. package/dist/token-calibration.d.ts.map +1 -0
  69. package/dist/token-calibration.js +113 -0
  70. package/dist/token-calibration.js.map +1 -0
  71. package/dist/validation.d.ts +7 -0
  72. package/dist/validation.d.ts.map +1 -0
  73. package/dist/validation.js +108 -0
  74. package/dist/validation.js.map +1 -0
  75. package/package.json +2 -2
@@ -0,0 +1,115 @@
1
+ const BUG_FIX_PATTERNS = [
2
+ 'fix', 'bug', 'broken', 'crash', 'error', 'issue', 'wrong', 'fail',
3
+ 'incorrect', 'invalid', 'null', 'undefined', 'exception', 'regression',
4
+ 'patch', 'hotfix',
5
+ ];
6
+ const FEATURE_ADD_PATTERNS = [
7
+ 'add', 'create', 'implement', 'build', 'new', 'introduce', 'scaffold',
8
+ 'feature', 'endpoint', 'component', 'page', 'route', 'service',
9
+ ];
10
+ const REFACTOR_PATTERNS = [
11
+ 'refactor', 'restructure', 'reorganize', 'clean', 'simplify', 'extract',
12
+ 'rename', 'move', 'split', 'merge', 'consolidate', 'optimize',
13
+ 'improve', 'modernize', 'upgrade', 'migrate', 'replace',
14
+ ];
15
+ const TEST_UPDATE_PATTERNS = [
16
+ 'test', 'tests', 'testing', 'spec', 'specs', 'coverage', 'assertion',
17
+ 'mock', 'stub', 'fixture', 'jest', 'vitest', 'mocha', 'e2e',
18
+ ];
19
+ const CONFIG_PATTERNS = [
20
+ 'config', 'configuration', 'settings', 'setup', 'env', 'environment',
21
+ 'ci', 'pipeline', 'deploy', 'docker', 'workflow', 'lint', 'eslint',
22
+ 'prettier', 'tsconfig', 'webpack', 'vite',
23
+ ];
24
+ /**
25
+ * Infer the task type from the task description.
26
+ * Returns the most likely type based on keyword pattern matching.
27
+ */
28
+ export function inferTaskType(taskText) {
29
+ const lower = taskText.toLowerCase();
30
+ // Split on non-alphanumeric to strip punctuation (e.g. "fix," → "fix", "test." → "test")
31
+ const words = lower.split(/[^\p{L}\p{N}]+/u).filter((w) => w.length > 0);
32
+ // Score each type by keyword hits
33
+ const scores = {
34
+ bug_fix: 0,
35
+ feature_add: 0,
36
+ refactor: 0,
37
+ test_update: 0,
38
+ config: 0,
39
+ general: 0,
40
+ };
41
+ for (const word of words) {
42
+ if (BUG_FIX_PATTERNS.includes(word))
43
+ scores.bug_fix += 1;
44
+ if (FEATURE_ADD_PATTERNS.includes(word))
45
+ scores.feature_add += 1;
46
+ if (REFACTOR_PATTERNS.includes(word))
47
+ scores.refactor += 1;
48
+ if (TEST_UPDATE_PATTERNS.includes(word))
49
+ scores.test_update += 1;
50
+ if (CONFIG_PATTERNS.includes(word))
51
+ scores.config += 1;
52
+ }
53
+ // Find the highest scoring type
54
+ let bestType = 'general';
55
+ let bestScore = 0;
56
+ for (const [type, typeScore] of Object.entries(scores)) {
57
+ if (typeScore > bestScore) {
58
+ bestScore = typeScore;
59
+ bestType = type;
60
+ }
61
+ }
62
+ // Require at least 1 keyword hit to classify
63
+ return bestScore > 0 ? bestType : 'general';
64
+ }
65
+ /**
66
+ * Weight adjustment multipliers for each task type.
67
+ * Values > 1.0 emphasize, < 1.0 de-emphasize, 1.0 = no change.
68
+ */
69
+ const WEIGHT_ADJUSTMENTS = {
70
+ bug_fix: {
71
+ error_infrastructure: 1.5,
72
+ recent_touch: 1.3,
73
+ churn: 1.2,
74
+ keyword: 1.1,
75
+ },
76
+ feature_add: {
77
+ centrality: 1.3,
78
+ keyword: 1.2,
79
+ test_relevance: 0.8,
80
+ },
81
+ refactor: {
82
+ churn: 1.4,
83
+ centrality: 1.3,
84
+ size_penalty: 0.7,
85
+ },
86
+ test_update: {
87
+ test_relevance: 1.5,
88
+ keyword: 1.2,
89
+ churn: 0.8,
90
+ },
91
+ config: {
92
+ keyword: 1.3,
93
+ churn: 0.7,
94
+ centrality: 0.8,
95
+ },
96
+ general: {},
97
+ };
98
+ /**
99
+ * Apply task-type weight adjustments to the base weights.
100
+ * Returns a new weights object with scaled values.
101
+ */
102
+ export function applyTaskTypeWeights(baseWeights, taskType) {
103
+ const adjustments = WEIGHT_ADJUSTMENTS[taskType];
104
+ if (Object.keys(adjustments).length === 0)
105
+ return baseWeights;
106
+ const adjusted = { ...baseWeights };
107
+ for (const [key, multiplier] of Object.entries(adjustments)) {
108
+ const current = adjusted[key];
109
+ if (typeof current === 'number') {
110
+ adjusted[key] = current * multiplier;
111
+ }
112
+ }
113
+ return adjusted;
114
+ }
115
+ //# sourceMappingURL=task-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-type.js","sourceRoot":"","sources":["../src/task-type.ts"],"names":[],"mappings":"AA0BA,MAAM,gBAAgB,GAAG;IACvB,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM;IAClE,WAAW,EAAE,SAAS,E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* Returns a relevance score (0–1) based on the density and recency
6
+ * of these markers. Files with many TODOs are more likely to need
7
+ * attention and should get a small scoring boost.
8
+ */
9
+ export interface TodoScanResult {
10
+ /** Total count of TODO-like markers found */
11
+ count: number;
12
+ /** Normalized score 0–1 (higher = more TODOs relative to file size) */
13
+ density: number;
14
+ /** The specific markers found */
15
+ markers: string[];
16
+ }
17
+ /**
18
+ * Scan file content for TODO/FIXME markers.
19
+ * Returns count, density (normalized by file length), and matched markers.
20
+ */
21
+ export declare function scanTodos(content: string): TodoScanResult;
22
+ /**
23
+ * Compute a TODO relevance boost for scoring.
24
+ * Returns a value between 0 and 1:
25
+ * - 0: no TODOs
26
+ * - 0.3: a few TODOs
27
+ * - 0.6: moderate TODO density
28
+ * - 1.0: high TODO density
29
+ */
30
+ export declare function todoRelevanceScore(content: string): number;
31
+ //# sourceMappingURL=todo-scan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-scan.d.ts","sourceRoot":"","sources":["../src/todo-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,MAAM,WAAW,cAAc;IAC7B,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAyBzD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM1D"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * TODO/FIXME Awareness (Feature 14)
3
+ *
4
+ * Scans file content for TODO, FIXME, HACK, and XXX comments.
5
+ * Returns a relevance score (0–1) based on the density and recency
6
+ * of these markers. Files with many TODOs are more likely to need
7
+ * attention and should get a small scoring boost.
8
+ */
9
+ /** Patterns that indicate incomplete or problematic code */
10
+ const TODO_PATTERNS = [
11
+ /\bTODO\b/i,
12
+ /\bFIXME\b/i,
13
+ /\bHACK\b/i,
14
+ /\bXXX\b/i,
15
+ /\bBUG\b(?:\s*#?\d+)/i,
16
+ /\bWORKAROUND\b/i,
17
+ ];
18
+ /**
19
+ * Scan file content for TODO/FIXME markers.
20
+ * Returns count, density (normalized by file length), and matched markers.
21
+ */
22
+ export function scanTodos(content) {
23
+ const lines = content.split('\n');
24
+ const markers = [];
25
+ let count = 0;
26
+ for (const line of lines) {
27
+ for (const pattern of TODO_PATTERNS) {
28
+ const match = pattern.exec(line);
29
+ if (match) {
30
+ count++;
31
+ const marker = match[0].toUpperCase();
32
+ if (!markers.includes(marker)) {
33
+ markers.push(marker);
34
+ }
35
+ break; // only count once per line
36
+ }
37
+ }
38
+ }
39
+ // Density: TODOs per 100 lines, capped at 1.0
40
+ const density = lines.length > 0
41
+ ? Math.min(1, (count / lines.length) * 100)
42
+ : 0;
43
+ return { count, density, markers };
44
+ }
45
+ /**
46
+ * Compute a TODO relevance boost for scoring.
47
+ * Returns a value between 0 and 1:
48
+ * - 0: no TODOs
49
+ * - 0.3: a few TODOs
50
+ * - 0.6: moderate TODO density
51
+ * - 1.0: high TODO density
52
+ */
53
+ export function todoRelevanceScore(content) {
54
+ const { count, density } = scanTodos(content);
55
+ if (count === 0)
56
+ return 0;
57
+ if (count <= 2)
58
+ return 0.3;
59
+ if (density < 0.5)
60
+ return 0.6;
61
+ return 1.0;
62
+ }
63
+ //# sourceMappingURL=todo-scan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"todo-scan.js","sourceRoot":"","sources":["../src/todo-scan.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,4DAA4D;AAC5D,MAAM,aAAa,GAAG;IACpB,WAAW;IACX,YAAY;IACZ,WAAW;IACX,UAAU;IACV,sBAAsB;IACtB,iBAAiB;CAClB,CAAC;AAWF;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,MAAM,KAA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@ -0,0 +1,27 @@
1
+ /**
2
+ * Token Calibration (Feature 17)
3
+ *
4
+ * Language-aware token estimation that improves on the flat 4-tokens-per-line
5
+ * estimate. Different languages have different average token densities.
6
+ *
7
+ * Calibrated from OpenAI tokenizer empirical data:
8
+ * - TypeScript/JavaScript: ~3.5 tokens/line (concise syntax)
9
+ * - Python: ~3.2 tokens/line (significant whitespace, shorter lines)
10
+ * - Go: ~3.8 tokens/line (verbose types, error handling)
11
+ * - Rust: ~4.2 tokens/line (lifetime annotations, verbose syntax)
12
+ * - Java: ~4.5 tokens/line (verbose OOP)
13
+ * - JSON/YAML/Config: ~2.5 tokens/line (simple key-value)
14
+ * - Markdown/Text: ~5.0 tokens/line (natural language)
15
+ * - Default: 4.0 tokens/line (conservative estimate)
16
+ */
17
+ /**
18
+ * Estimate tokens for a file based on line count and language.
19
+ * Falls back to the default rate of 4 tokens/line for unknown languages.
20
+ */
21
+ export declare function estimateTokensCalibrated(lines: number, language: string): number;
22
+ /**
23
+ * Estimate tokens from a file extension.
24
+ * Maps common extensions to their language for token rate lookup.
25
+ */
26
+ export declare function estimateTokensByExtension(lines: number, extension: string): number;
27
+ //# sourceMappingURL=token-calibration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-calibration.d.ts","sourceRoot":"","sources":["../src/token-calibration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA6CH;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,GACf,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Token Calibration (Feature 17)
3
+ *
4
+ * Language-aware token estimation that improves on the flat 4-tokens-per-line
5
+ * estimate. Different languages have different average token densities.
6
+ *
7
+ * Calibrated from OpenAI tokenizer empirical data:
8
+ * - TypeScript/JavaScript: ~3.5 tokens/line (concise syntax)
9
+ * - Python: ~3.2 tokens/line (significant whitespace, shorter lines)
10
+ * - Go: ~3.8 tokens/line (verbose types, error handling)
11
+ * - Rust: ~4.2 tokens/line (lifetime annotations, verbose syntax)
12
+ * - Java: ~4.5 tokens/line (verbose OOP)
13
+ * - JSON/YAML/Config: ~2.5 tokens/line (simple key-value)
14
+ * - Markdown/Text: ~5.0 tokens/line (natural language)
15
+ * - Default: 4.0 tokens/line (conservative estimate)
16
+ */
17
+ const LANGUAGE_TOKEN_RATES = {
18
+ // Web languages
19
+ typescript: 3.5,
20
+ javascript: 3.5,
21
+ tsx: 3.5,
22
+ jsx: 3.5,
23
+ // Systems languages
24
+ go: 3.8,
25
+ rust: 4.2,
26
+ c: 3.8,
27
+ cpp: 4.0,
28
+ // Managed languages
29
+ java: 4.5,
30
+ kotlin: 3.8,
31
+ csharp: 4.2,
32
+ // Scripting languages
33
+ python: 3.2,
34
+ ruby: 3.0,
35
+ php: 3.8,
36
+ // Config/data formats
37
+ json: 2.5,
38
+ yaml: 2.5,
39
+ toml: 2.5,
40
+ xml: 4.0,
41
+ // Documentation
42
+ markdown: 5.0,
43
+ // Shell
44
+ bash: 3.5,
45
+ shell: 3.5,
46
+ // CSS
47
+ css: 3.0,
48
+ scss: 3.2,
49
+ // SQL
50
+ sql: 4.0,
51
+ // GraphQL/Proto
52
+ graphql: 3.0,
53
+ protobuf: 3.5,
54
+ prisma: 3.0,
55
+ };
56
+ /** Default rate when language is unknown */
57
+ const DEFAULT_RATE = 4.0;
58
+ /**
59
+ * Estimate tokens for a file based on line count and language.
60
+ * Falls back to the default rate of 4 tokens/line for unknown languages.
61
+ */
62
+ export function estimateTokensCalibrated(lines, language) {
63
+ const rate = LANGUAGE_TOKEN_RATES[language.toLowerCase()] ?? DEFAULT_RATE;
64
+ return Math.ceil(lines * rate);
65
+ }
66
+ /**
67
+ * Estimate tokens from a file extension.
68
+ * Maps common extensions to their language for token rate lookup.
69
+ */
70
+ export function estimateTokensByExtension(lines, extension) {
71
+ const language = extensionToLanguage(extension);
72
+ return estimateTokensCalibrated(lines, language);
73
+ }
74
+ const EXTENSION_MAP = {
75
+ '.ts': 'typescript',
76
+ '.tsx': 'tsx',
77
+ '.js': 'javascript',
78
+ '.jsx': 'jsx',
79
+ '.mjs': 'javascript',
80
+ '.cjs': 'javascript',
81
+ '.py': 'python',
82
+ '.go': 'go',
83
+ '.rs': 'rust',
84
+ '.java': 'java',
85
+ '.kt': 'kotlin',
86
+ '.cs': 'csharp',
87
+ '.rb': 'ruby',
88
+ '.php': 'php',
89
+ '.c': 'c',
90
+ '.cpp': 'cpp',
91
+ '.h': 'c',
92
+ '.hpp': 'cpp',
93
+ '.json': 'json',
94
+ '.yaml': 'yaml',
95
+ '.yml': 'yaml',
96
+ '.toml': 'toml',
97
+ '.xml': 'xml',
98
+ '.md': 'markdown',
99
+ '.mdx': 'markdown',
100
+ '.sh': 'bash',
101
+ '.bash': 'bash',
102
+ '.css': 'css',
103
+ '.scss': 'scss',
104
+ '.sql': 'sql',
105
+ '.graphql': 'graphql',
106
+ '.gql': 'graphql',
107
+ '.proto': 'protobuf',
108
+ '.prisma': 'prisma',
109
+ };
110
+ function extensionToLanguage(ext) {
111
+ return EXTENSION_MAP[ext.toLowerCase()] ?? 'unknown';
112
+ }
113
+ //# sourceMappingURL=token-calibration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-calibration.js","sourceRoot":"","sources":["../src/token-calibration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,oBAAoB,GAA2B;IACnD,gBAAgB;IAChB,UAAU,EAAE,GAAG;IACf,UAAU,EAAE,GAAG;IACf,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,oBAAoB;IACpB,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,GAAG;IACT,CAAC,EAAE,GAAG;IACN,GAAG,EAAE,GAAG;IACR,oBAAoB;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I;IACX,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,QAAQ;IACf,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,MAAM;IACd,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,KAAK;IACb,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,SAAS;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,QAAQ;CACpB,CAAC;AAEF,SAAS,mBAAmB,CAAC,GAAW;IACtC,OAAO,aAAa,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,SAAS,CAAC;AACvD,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { BundleFile, BundleWarning, ScoredFile } from '@codeledger/types';
2
+ /**
3
+ * Validate a generated bundle and produce diagnostic warnings.
4
+ * Called after the bundle is fully assembled.
5
+ */
6
+ export declare function validateBundle(files: BundleFile[], taskKeywords: string[], allScored: ScoredFile[], taskText: string): BundleWarning[];
7
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAmB/E;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EAAE,EACnB,YAAY,EAAE,MAAM,EAAE,EACtB,SAAS,EAAE,UAAU,EAAE,EACvB,QAAQ,EAAE,MAAM,GACf,aAAa,EAAE,CAuGjB"}
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Bundle Validation — Pre-flight Warnings
3
+ *
4
+ * Catches obviously-bad bundles before the agent wastes turns. Validates
5
+ * bundle quality against the task description and raises warnings for
6
+ * common failure modes.
7
+ */
8
+ /** Keywords that suggest the task involves testing */
9
+ const TEST_KEYWORDS = ['test', 'tests', 'testing', 'spec', 'specs', 'jest', 'vitest', 'mocha'];
10
+ /** Keywords that suggest the task involves configuration */
11
+ const CONFIG_KEYWORDS = ['config', 'configuration', 'settings', 'setup', 'env', 'environment'];
12
+ /** Keywords that suggest the task involves database operations */
13
+ const DB_KEYWORDS = ['database', 'migration', 'schema', 'sql', 'query', 'model', 'table'];
14
+ /**
15
+ * Validate a generated bundle and produce diagnostic warnings.
16
+ * Called after the bundle is fully assembled.
17
+ */
18
+ export function validateBundle(files, taskKeywords, allScored, taskText) {
19
+ const warnings = [];
20
+ const taskLower = taskText.toLowerCase();
21
+ // Warning 1: No keyword matches at all
22
+ const hasKeywordMatch = files.some((f) => !f.is_stub && !f.is_exemplar && f.reasons.includes('keyword_match'));
23
+ if (!hasKeywordMatch && files.length > 0) {
24
+ warnings.push({
25
+ level: 'warning',
26
+ code: 'no_keyword_match',
27
+ message: 'No files matched task keywords. Bundle is based on churn/centrality signals only — consider rephrasing the task.',
28
+ });
29
+ }
30
+ // Warning 2: Task mentions tests but no test files in bundle
31
+ const mentionsTests = taskKeywords.some((kw) => TEST_KEYWORDS.includes(kw)) ||
32
+ TEST_KEYWORDS.some((kw) => taskLower.includes(kw));
33
+ const hasTestFile = files.some((f) => f.path.includes('.test.') || f.path.includes('.spec.') || f.path.includes('__tests__'));
34
+ if (mentionsTests && !hasTestFile) {
35
+ warnings.push({
36
+ level: 'warning',
37
+ code: 'missing_test_files',
38
+ message: 'Task mentions testing but no test files are in the bundle. Test files may have been filtered or out of budget.',
39
+ });
40
+ }
41
+ // Warning 3: Task mentions config but no config-like files
42
+ const mentionsConfig = taskKeywords.some((kw) => CONFIG_KEYWORDS.includes(kw));
43
+ const hasConfigFile = files.some((f) => {
44
+ const lower = f.path.toLowerCase();
45
+ return lower.includes('config') || lower.includes('.env') ||
46
+ lower.includes('tsconfig') || lower.includes('package.json');
47
+ });
48
+ if (mentionsConfig && !hasConfigFile) {
49
+ warnings.push({
50
+ level: 'info',
51
+ code: 'missing_config_files',
52
+ message: 'Task mentions configuration but no config files are in the bundle.',
53
+ });
54
+ }
55
+ // Warning 4: Task mentions DB/schema but no DB files
56
+ const mentionsDb = taskKeywords.some((kw) => DB_KEYWORDS.includes(kw));
57
+ const hasDbFile = files.some((f) => {
58
+ const lower = f.path.toLowerCase();
59
+ return lower.includes('model') || lower.includes('migration') ||
60
+ lower.includes('schema') || lower.includes('.sql') ||
61
+ lower.includes('db/') || lower.includes('database');
62
+ });
63
+ if (mentionsDb && !hasDbFile) {
64
+ warnings.push({
65
+ level: 'info',
66
+ code: 'missing_db_files',
67
+ message: 'Task mentions database/schema but no database files are in the bundle.',
68
+ });
69
+ }
70
+ // Warning 5: Very low score concentration — bundle is diluted
71
+ const nonStubFiles = files.filter((f) => !f.is_stub && !f.is_exemplar);
72
+ if (nonStubFiles.length >= 5) {
73
+ const topScore = nonStubFiles[0]?.score ?? 0;
74
+ const bottomScore = nonStubFiles[nonStubFiles.length - 1]?.score ?? 0;
75
+ if (topScore > 0 && bottomScore > 0) {
76
+ const ratio = bottomScore / topScore;
77
+ if (ratio > 0.85) {
78
+ warnings.push({
79
+ level: 'info',
80
+ code: 'score_plateau',
81
+ message: 'File scores are very close together — no strong signal file. The task may be too broad or generic.',
82
+ });
83
+ }
84
+ }
85
+ }
86
+ // Warning 6: Bundle is empty
87
+ if (nonStubFiles.length === 0) {
88
+ warnings.push({
89
+ level: 'warning',
90
+ code: 'empty_bundle',
91
+ message: 'Bundle contains no source files. The task may not match any files in the repository.',
92
+ });
93
+ }
94
+ // Warning 7: High-scoring files were excluded (budget too tight)
95
+ if (allScored.length > 0 && nonStubFiles.length > 0) {
96
+ const lastIncludedScore = nonStubFiles[nonStubFiles.length - 1].score;
97
+ const excludedHighScorers = allScored.filter((s) => s.score > lastIncludedScore && !files.some((f) => f.path === s.path));
98
+ if (excludedHighScorers.length > 3) {
99
+ warnings.push({
100
+ level: 'info',
101
+ code: 'budget_squeeze',
102
+ message: `${excludedHighScorers.length} files with strong scores were excluded by budget constraints. Consider increasing --budget or --max-files.`,
103
+ });
104
+ }
105
+ }
106
+ return warnings;
107
+ }
108
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,sDAAsD;AACtD,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;AAE/F,4DAA4D;AAC5D,MAAM,eAAe,GAAG,CAAC,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC;AAE/F,kEAAkE;AAClE,MAAM,WAAW,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAE1F;;;GAGG;AACH,MAAM,UAAU,cAAc,CAC5B,KAAmB,EACnB,YAAsB,EACtB,SAAuB,EACvB,QAAgB;IAEhB,MAAM,QAAQ,GAAoB,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IAEzC,uCAAuC;IACvC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,CAChC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,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AAE,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAC5E,CAAC;QACF,IAAI,mBAAmB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACnC,QAAQ,CAAC,IAAI,CAAC;gBACZ,KAAK,EAAE,MAAM;gBACb,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,GAAG,mBAAmB,CAAC,MAAM,6GAA6G;aACpJ,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeledger/selector",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "description": "Deterministic context selection algorithm for CodeLedger",
6
6
  "license": "Apache-2.0",
@@ -24,7 +24,7 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@codeledger/types": "0.1.1"
27
+ "@codeledger/types": "0.2.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "typescript": "^5.4.0"