@codeledger/core-engine 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.
- package/bin/codeledger-core.cjs +16 -14
- package/dist/bridge.d.ts +10 -0
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +12 -0
- package/dist/bridge.js.map +1 -1
- package/package.json +3 -3
package/bin/codeledger-core.cjs
CHANGED
|
@@ -4,18 +4,20 @@
|
|
|
4
4
|
/* Free for individual use. Commercial use requires a license. */
|
|
5
5
|
/* No network calls. No telemetry. Runs entirely local. */
|
|
6
6
|
/* Run with --license or --explain-architecture for details. */
|
|
7
|
-
"use strict";var
|
|
8
|
-
`);if(
|
|
9
|
-
// ... (lines ${
|
|
10
|
-
`),
|
|
11
|
-
`),
|
|
12
|
-
`).length
|
|
13
|
-
`),
|
|
14
|
-
${
|
|
15
|
-
`)}`}function
|
|
16
|
-
`}return
|
|
17
|
-
`);for(let r=0;r<
|
|
18
|
-
`)
|
|
19
|
-
`))
|
|
20
|
-
`)
|
|
7
|
+
"use strict";var De=require("node:fs");var _e=new Set(["the","a","an","and","or","but","in","on","at","to","for","of","with","by","from","is","it","that","this","be","as","are","was","were","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","need","must","not","no","if","then","else","when","up","out","so","than","too","very","just","about","into","over","after","before","between","under","above","all","each","every","both","few","more","most","some","any","add","fix","update","change","make","use","get","set","find","check","look","see","know","think","want","try","run","show","help","work","take","give","tell","call","go","come","keep","let","begin","start","end","stop","ready","live","done","good","new","old","big","small"]),je=new Set(["test","tests","testing","build","lint","debug","deploy","review","audit","evaluate","assess","analyze","examine","application","app","project","codebase","code","repo"]),Pe=["ready for","go live","production ready","readiness","find out","evaluate","assess","audit","review the","status of","state of","quality of","health of","overall","end to end","full","comprehensive"].map(e=>new RegExp(`\\b${e}\\b`)),We=["replace","everywhere","all files","every file","migrate","files that import","files that use","across all","update all","rename all"].map(e=>new RegExp(`\\b${e}\\b`)),U=50,ye=[".sql",".proto",".prisma",".graphql",".gql"],we=["openapi","swagger","schema","migrations"],Be=new Set(["config","configuration","script","dependency","dependencies","setup","package","tsconfig","eslint","prettier","webpack","vite","rollup"]),ze=new Set(["test","tests","testing","ci","pipeline","failing","pass","coverage","jest","vitest","mocha","cypress","playwright"]),Ue=new Set(["schema","api","endpoint","migration","contract","proto","graphql","openapi","swagger","prisma","database"]),Ke=["package.json","tsconfig","pnpm-workspace",".env.example","eslint","prettier","webpack.config","vite.config","rollup.config"],$e=["vitest.config","jest.config",".github/workflows","ci.yml","ci.yaml","test-setup","test-helper","test-utils"],Ge=/\b(?:and then|and also|and|then|also|plus)\b|[;,]/i;function z(e){let t=e.toLowerCase(),o=Pe.some(r=>r.test(t))?new Set([..._e,...je]):_e,n=t.split(/[^\p{L}\p{N}]+/u).filter(r=>r.length>1&&!o.has(r));return[...new Set(n)]}function xe(e){let t=e.split(Ge).map(o=>o.trim()).filter(o=>o.length>0);if(t.length<=1)return[z(e)];let s=[];for(let o of t){let n=z(o);n.length>0&&s.push(n)}return s.length>0?s:[z(e)]}function be(e,t,s){let o=new Map;for(let n of e){let r=0;for(let a of t.files)(a.path.toLowerCase().includes(n)||a.content_keywords?.some(h=>h===n||h===n+"s"||n===h+"s"))&&r++;if(r===0){o.set(n,0);continue}let i=1/Math.sqrt(Math.max(1,r));n.length<=2&&(i=Math.min(i,.35)),r>s&&(i=Math.min(i,.35)),i=Math.max(.35,Math.min(1,i)),o.set(n,i)}return o}function qe(e){let t=e.toLowerCase();return We.some(s=>s.test(t))}function He(e,t){let s=[];for(let o of t.files){let i=(o.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/);for(let a of e)if(i.some(f=>f===a||f===a+"s"||a===f+"s")){s.push(o.path);break}}return s}function J(e,t,s,o){let n=new Set,r=new Set,i=new Set,a=o??s.default_scope,h=xe(e),f=[...new Set(h.flat())],l=be(f,t,s.hot_zone_count),p=a?t.files.filter(w=>a.some(_=>w.path.startsWith(_))):t.files;for(let w of h)for(let _ of p){if(n.has(_.path))continue;let S=_.path.toLowerCase();for(let d of w){if(S.includes(d)){n.add(_.path);break}if(_.content_keywords?.some(v=>v===d||v===d+"s"||d===v+"s")){n.add(_.path);break}}}let u=(s.default_budget.max_files??1/0)<=15,g=new Set(p.map(w=>w.path)),m=t.churn.slice(0,s.hot_zone_count);for(let w of m)g.has(w.path)&&(u&&!n.has(w.path)||n.add(w.path));let c=a?g:void 0,x=[...n];for(let w of x)Ye(w,t,n,s.dependency_depth,s.dependency_cap_per_seed,c);if(qe(e)){let w=He(f,t);for(let _ of w){if(n.size>=U)break;let S=t.dep_graph.dependents[_]??[];for(let d of S){if(n.size>=U)break;c&&!c.has(d)||(n.add(d),r.add(d))}if(n.size<U)for(let d of S){if(n.size>=U)break;if(c&&!c.has(d))continue;let v=t.dep_graph.dependents[d]??[];for(let O of v){if(n.size>=U)break;c&&!c.has(O)||(n.add(O),r.add(O))}}}}let b=[...n];for(let w of t.test_map)b.includes(w.source_file)&&(!c||c.has(w.test_file))&&n.add(w.test_file),b.includes(w.test_file)&&(!c||c.has(w.source_file))&&n.add(w.source_file);let C=Xe(t.files,s.contract_patterns);if(C.length>0&&n.size>0){let w=new Set([...n].map(_=>_.split("/").slice(0,-1).join("/")));for(let _ of C){let S=_.split("/").slice(0,-1).join("/");(w.has(S)||[...w].some(v=>v.startsWith(S+"/")||S.startsWith(v+"/")))&&n.add(_)}}let T=new Set(f),N=[...Be].some(w=>T.has(w)),M=[...ze].some(w=>T.has(w)),D=[...Ue].some(w=>T.has(w));if(N||M||D){let w=D?new Set([...n].map(_=>_.split("/").slice(0,-1).join("/"))):void 0;for(let _ of p){if(n.has(_.path))continue;let S=_.path.toLowerCase();if(N&&Ke.some(d=>S.includes(d))){n.add(_.path),i.add(_.path);continue}if(M&&$e.some(d=>S.includes(d))){n.add(_.path),i.add(_.path);continue}if(D&&w){let d=_.extension.toLowerCase(),v=S.split("/").pop()??"";if(ye.includes(d)||we.some(I=>v.startsWith(I))){let I=_.path.split("/").slice(0,-1).join("/");(w.has(I)||[...w].some(R=>R.startsWith(I+"/")||I.startsWith(R+"/")))&&(n.add(_.path),i.add(_.path))}}}}return{candidates:n,tokenWeights:l,fanoutFiles:r,surfaceFiles:i}}function Xe(e,t){let s=[];for(let o of e){let n=o.extension.toLowerCase(),r=o.path.toLowerCase();if(ye.includes(n)){s.push(o.path);continue}if(t?.some(a=>r.includes(a.toLowerCase()))){s.push(o.path);continue}let i=r.split("/").pop()??"";we.some(a=>i.startsWith(a))&&s.push(o.path)}return s}function Ye(e,t,s,o,n,r){let i=[e],a=0;for(let h=0;h<o&&a<n;h++){let f=[];for(let l of i){let p=t.dep_graph.imports[l]??[];for(let g of p)r&&!r.has(g)||!s.has(g)&&a<n&&(s.add(g),f.push(g),a++);let u=t.dep_graph.dependents[l]??[];for(let g of u)r&&!r.has(g)||!s.has(g)&&a<n&&(s.add(g),f.push(g),a++)}i=f}}var Je=["error","exception","validation","validator","schema"];function Ve(e){return(e.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/).some(r=>Je.some(i=>r===i||r===i+"s"))?1:0}function ke(e,t,s,o,n,r){let i=e.path.toLowerCase(),a=e.content_keywords??[],f=(i.split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/),l=0,p=0,u=!1;for(let E of t){let R=n?.get(E)??1;if(R!==0)if(p+=R,i.includes(E)){let F=f.some(W=>W===E||W===E+"s"||E===W+"s");l+=R*(F?3:1)}else a.some(F=>F===E||F===E+"s"||E===F+"s")&&(l+=R*.5,u=!0)}let g=p>0?Math.min(1,l/(p*1.5)):0,m=s.dep_graph.imports[e.path]?.length??0,c=s.dep_graph.dependents[e.path]?.length??0,x=m+c,b=Math.max(1,...s.files.map(E=>{let R=s.dep_graph.imports[E.path]?.length??0,F=s.dep_graph.dependents[E.path]?.length??0;return R+F})),C=x/b,T=s.churn.find(E=>E.path===e.path),N=T?.time_decayed_score??0,M=T?.days_since_last_touch??999,D=M<=7?1:M<=14?.8:M<=30?.5:M<=60?.2:0,w=s.test_map.filter(E=>E.source_file===e.path||E.test_file===e.path),_=0;w.length>0&&(_=.5,_+=Math.min(.5,w.length*.25));let S=Math.max(0,Math.min(1,e.lines/1e3)),d=o?.success_files.has(e.path)?1:0,v=o?.fail_files.has(e.path)?1:0,O=Ve(e),I=r?.has(e.path)?1:0;return{keyword:g,centrality:C,churn:N,recent_touch:D,test_relevance:_,size_penalty:S,success_prior:d,fail_prior:v,error_infrastructure:O,branch_changed:I,_hasContentMatch:u}}function Se(e){let t;return e.keyword>=.3?t=1:e.keyword>0?t=.5:e.test_relevance>0||e.centrality>.1?t=.4:t=0,t===1?e:{...e,churn:e.churn*t,recent_touch:e.recent_touch*t}}function Te(e,t){return e.keyword*t.keyword+e.centrality*t.centrality+e.churn*t.churn+e.recent_touch*t.recent_touch+e.test_relevance*t.test_relevance-e.size_penalty*t.size_penalty+e.success_prior*t.success_prior-e.fail_prior*t.fail_prior+e.error_infrastructure*(t.error_infrastructure??.08)+e.branch_changed*(t.branch_changed??0)}function Ee(e){let t=[];return e.keyword>0&&(t.push("keyword_match"),e._hasContentMatch&&t.push("content_match")),e.centrality>.3&&t.push("dependency_neighbor"),e.churn>.3&&t.push("high_churn"),e.recent_touch>.5&&t.push("recent_touch"),e.test_relevance>0&&t.push("test_relevant"),e.size_penalty>.5&&t.push("size_penalty"),e.success_prior>0&&t.push("success_prior"),e.error_infrastructure>0&&t.push("error_infrastructure"),e.branch_changed>0&&t.push("branch_changed"),t}function V(e,t,s,o,n,r,i,a,h){let f=new Map(s.files.map(p=>[p.path,p])),l=[];for(let p of e){let u=f.get(p);if(!u)continue;let g=ke(u,t,s,n,r,a),c={...Se(g),_hasContentMatch:g._hasContentMatch,branch_changed:g.branch_changed},x=Te(c,o),b=Ee(c);i?.has(p)&&(x+=.25,b.includes("dependent_neighbor")||b.push("dependent_neighbor")),h?.has(p)&&c.keyword===0&&(x=0,b.length=0,b.push("surface_auto_include")),l.push({path:p,score:x,features:c,reasons:b})}return l.sort((p,u)=>u.score-p.score),l}function Ze(e){return e.some(t=>t.reasons.includes("keyword_match")||t.reasons.includes("test_relevant"))}function Z(e,t,s,o){return!!(t.max_files&&e.files.length>=t.max_files||t.tokens&&e.totalTokens>=t.tokens||o>0&&e.cumulativeScore/o>=s&&Ze(e.files))}var $=require("node:fs"),Ce=require("node:path"),Qe=10*1024*1024;function G(e,t,s,o,n){let r=(0,Ce.join)(e,t),i;try{let c=(0,$.statSync)(r).size;if(c>Qe)return{content:`// File too large (${Math.round(c/1024)}KB), skipped`,spans:null,lineCount:1};i=(0,$.readFileSync)(r,"utf-8")}catch{return{content:"",spans:null,lineCount:0}}let a=i.split(`
|
|
8
|
+
`);if(a.length<=o)return{content:i,spans:null,lineCount:a.length};let h=[],f=new Set;for(let c=0;c<a.length;c++){let x=a[c];if(et(x)){let b=Math.max(0,c-1),C=Math.min(a.length-1,c+1);tt(x)&&(C=nt(a,c,20)),h.push({start_line:b+1,end_line:C+1,reason:"type_surface"});for(let T=b;T<=C;T++)f.add(T)}}for(let c=0;c<a.length;c++){let x=a[c];if(st(x)&&!f.has(c)){let b=Math.max(0,c-1),C=Math.min(a.length-1,c+2);h.push({start_line:b+1,end_line:C+1,reason:"export_signature"});for(let T=b;T<=C;T++)f.add(T)}}for(let c=0;c<a.length;c++){let x=a[c].toLowerCase();for(let b of s)if(x.includes(b)){let C=Math.max(0,c-n),T=Math.min(a.length-1,c+n);h.push({start_line:C+1,end_line:T+1,reason:`keyword_match:${b}`});for(let N=C;N<=T;N++)f.add(N);break}}let l=[...f].sort((c,x)=>c-x),p=[],u=-2;for(let c of l)c>u+1&&p.push(`
|
|
9
|
+
// ... (lines ${u+2}\u2013${c} omitted) ...
|
|
10
|
+
`),p.push(a[c]),u=c;let g=p.join(`
|
|
11
|
+
`),m=ot(h);return{content:g,spans:m,lineCount:l.length}}function et(e){let s=e.trim().replace(/^export\s+(default\s+)?/,"").replace(/^declare\s+/,"");return s.startsWith("interface ")||s.startsWith("type ")||s.startsWith("enum ")||s.startsWith("function ")&&!s.includes("=>")||s.startsWith("abstract class ")||s.startsWith("class ")}function tt(e){let t=e.trim();return t.includes("{")&&!t.includes("}")}function nt(e,t,s){let o=0,n=Math.min(e.length-1,t+s);for(let r=t;r<=n;r++){let i=e[r];for(let a of i)a==="{"&&o++,a==="}"&&o--;if(o<=0&&r>t)return r}return n}function st(e){let t=e.trim();return t.startsWith("export ")&&(t.includes("function ")||t.includes("class ")||t.includes("interface ")||t.includes("type ")||t.includes("const ")||t.includes("enum "))}function ot(e){if(e.length===0)return[];let t=[...e].sort((o,n)=>o.start_line-n.start_line),s=[t[0]];for(let o=1;o<t.length;o++){let n=t[o],r=s[s.length-1];n.start_line<=r.end_line+1?(r.end_line=Math.max(r.end_line,n.end_line),r.reason=`${r.reason}+${n.reason}`):s.push({...n})}return s}var Ae=require("node:crypto");function Q(e,t,s){let o=[],n=0;if(e.length===0)return{level:"low",score:0,reasons:["Empty bundle \u2014 no files matched"]};let r=e.slice(0,5),i=r.filter(p=>p.reasons.includes("keyword_match")),a=i.length/r.length;if(a>=.6?(n+=.35,o.push(`Strong keyword signal: ${i.length}/${r.length} top files match task keywords`)):a>0?(n+=.15,o.push(`Weak keyword signal: only ${i.length}/${r.length} top files match task keywords`)):o.push("No keyword matches in top 5 files \u2014 selection driven by churn/centrality"),e.length>=2){let p=e[0].score,u=e[1].score;p>0&&u>0&&((p-u)/p>=.3?(n+=.2,o.push("Clear top-ranked file with significant score gap")):n+=.1)}let h=e.reduce((p,u)=>p+u.reasons.length,0)/e.length;h>=2?(n+=.2,o.push("Files selected for multiple independent reasons")):h>=1.5&&(n+=.1),s>=3?n+=.15:s>=2?n+=.1:o.push("Task description has few discriminating keywords \u2014 consider being more specific"),e.filter(p=>!p.reasons.every(u=>u==="test_relevant")).length>=e.length*.5&&(n+=.1);let l;if(n>=.65?l="high":n>=.35?l="medium":l="low",l!=="high"){let p=rt(e,a,s);for(let u of p)o.push(u)}return{level:l,score:Math.round(n*100)/100,reasons:o}}function rt(e,t,s){let o=[];if(t===0){let r=e.slice(0,3).map(i=>{let a=i.path.split("/");return a[a.length-1]?.replace(/\.\w+$/,"")??i.path});r.length>0&&o.push(`Suggestion: try including file-specific keywords like "${r.join('", "')}" in your task`)}return s<=1&&o.push('Suggestion: use a more descriptive task \u2014 e.g., "fix JWT refresh in auth middleware" instead of "fix auth"'),e.every(r=>r.path.includes(".test.")||r.path.includes(".spec.")||r.path.includes("tests/"))&&e.length>0&&o.push("Suggestion: bundle contains only test files \u2014 add source file keywords to your task"),o}var Me=require("node:fs"),q=require("node:path");var it={typescript:3.5,javascript:3.5,tsx:3.5,jsx:3.5,go:3.8,rust:4.2,c:3.8,cpp:4,java:4.5,kotlin:3.8,csharp:4.2,python:3.2,ruby:3,php:3.8,json:2.5,yaml:2.5,toml:2.5,xml:4,markdown:5,bash:3.5,shell:3.5,css:3,scss:3.2,sql:4,graphql:3,protobuf:3.5,prisma:3},at=4;function ve(e,t){let s=it[t.toLowerCase()]??at;return Math.ceil(e*s)}function j(e,t){let s=lt(t);return ve(e,s)}var ct={".ts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"jsx",".mjs":"javascript",".cjs":"javascript",".py":"python",".go":"go",".rs":"rust",".java":"java",".kt":"kotlin",".cs":"csharp",".rb":"ruby",".php":"php",".c":"c",".cpp":"cpp",".h":"c",".hpp":"cpp",".json":"json",".yaml":"yaml",".yml":"yaml",".toml":"toml",".xml":"xml",".md":"markdown",".mdx":"markdown",".sh":"bash",".bash":"bash",".css":"css",".scss":"scss",".sql":"sql",".graphql":"graphql",".gql":"graphql",".proto":"protobuf",".prisma":"prisma"};function lt(e){return ct[e.toLowerCase()]??"unknown"}function ee(e,t,s,o,n){let r=new Map;for(let f of t){let l=s.imports[f]??[];for(let p of l)t.has(p)||r.set(p,(r.get(p)??0)+1)}if(r.size===0)return[];let i=[...r.entries()].sort((f,l)=>l[1]-f[1]).slice(0,o),a=[],h=0;for(let[f]of i){let l=(0,q.join)(e,f),p;try{p=(0,Me.readFileSync)(l,"utf-8")}catch{continue}let u=pt(p,f);if(!u)continue;let g=u.split(`
|
|
12
|
+
`).length,m=(0,q.extname)(f),c=j(g,m);if(h+c>n)continue;let x=["interface_stub"];a.push({path:f,score:0,reasons:x,excerpt_spans:null,content:u,token_estimate:c,is_stub:!0}),h+=c}return a}function pt(e,t){let s=e.split(`
|
|
13
|
+
`),o=[],n=0;for(;n<s.length;){let r=s[n],i=r.trim();if(dt(i)){if(i.includes("{")&&!i.includes("}")){let a=ut(s,n);o.push(...a),n+=a.length;continue}o.push(r),n++;continue}if(ft(i)){let a=ht(s,n);o.push(a),n=mt(s,n);continue}n++}return o.length===0?null:`// Interface stub (auto-generated by CodeLedger)
|
|
14
|
+
${o.join(`
|
|
15
|
+
`)}`}function dt(e){let t=e.startsWith("export ")?e.slice(7).replace(/^default\s+/,""):null;return t?t.startsWith("interface ")||t.startsWith("type ")||t.startsWith("enum "):!1}function ft(e){return e.startsWith("export ")?e.slice(7).replace(/^default\s+/,"").replace(/^async\s+/,"").startsWith("function "):!1}function ut(e,t){let s=[],o=0;for(let n=t;n<e.length&&n<t+50;n++){let r=e[n];s.push(r);for(let i of r)i==="{"&&o++,i==="}"&&o--;if(o<=0&&n>t)break}return s}function ht(e,t){let s="";for(let o=t;o<e.length&&o<t+5;o++){let n=e[o],r=n.indexOf("{");if(r>=0){s+=n.slice(0,r).trimEnd()+";";break}s+=n+`
|
|
16
|
+
`}return s||e[t]}function mt(e,t){let s=0;for(let o=t;o<e.length;o++){let n=e[o];for(let r of n)r==="{"&&s++,r==="}"&&s--;if(s<=0&&o>t)return o+1}return e.length}var gt=[{pattern:"\\bfs\\.exists\\b",message:"fs.exists is deprecated \u2014 use fs.access() or fs.stat()"},{pattern:"\\bfs\\.existsSync\\b",message:"fs.existsSync is deprecated in async contexts \u2014 prefer fs.accessSync()"},{pattern:"\\bnew Buffer\\(",message:"Buffer() constructor is deprecated \u2014 use Buffer.from() or Buffer.alloc()"},{pattern:"\\brequire\\('url'\\)\\.parse",message:"url.parse() is deprecated \u2014 use new URL() constructor"},{pattern:"\\burl\\.parse\\(",message:"url.parse() is deprecated \u2014 use new URL() constructor"},{pattern:"\\butil\\.isArray\\b",message:"util.isArray is deprecated \u2014 use Array.isArray()"},{pattern:"\\butil\\.isDate\\b",message:"util.isDate is deprecated \u2014 use instanceof Date"},{pattern:"\\butil\\.isRegExp\\b",message:"util.isRegExp is deprecated \u2014 use instanceof RegExp"},{pattern:"\\bcomponentWillMount\\b",message:"componentWillMount is deprecated \u2014 use componentDidMount or useEffect"},{pattern:"\\bcomponentWillReceiveProps\\b",message:"componentWillReceiveProps is deprecated \u2014 use getDerivedStateFromProps or useEffect"},{pattern:"\\bcomponentWillUpdate\\b",message:"componentWillUpdate is deprecated \u2014 use getSnapshotBeforeUpdate"},{pattern:"\\bReact\\.createClass\\b",message:"React.createClass is removed \u2014 use class components or function components"},{pattern:"\\bReactDOM\\.render\\(",message:"ReactDOM.render is deprecated in React 18+ \u2014 use createRoot().render()"},{pattern:"@ts-ignore",message:"Prefer @ts-expect-error over @ts-ignore for better error tracking"}];function te(e,t){let s=[...gt,...t??[]],o=[],n=e.split(`
|
|
17
|
+
`);for(let r=0;r<n.length;r++){let i=n[r],a=i.trim();if(!(a.startsWith("//")||a.startsWith("*")||a.startsWith("/*")))for(let h of s){let f;try{f=new RegExp(h.pattern)}catch{continue}let l=f.exec(i);l&&o.push({line:r+1,matched:l[0],message:h.message})}}return o}var Le=require("node:fs"),L=require("node:path");var _t=["add","create","implement","build","new","introduce","scaffold","write","make","generate","setup","set up"];function ne(e,t,s,o,n,r){if(!o.some(u=>_t.includes(u)))return[];let a=new Set(t.map(u=>u.path)),h=new Map;for(let u of t){if(u.is_stub||u.is_exemplar)continue;let g=(0,L.dirname)(u.path),m=h.get(g)??[];m.push(u.path),h.set(g,m)}let f=[],l=0,p=new Set;for(let[u,g]of h){if(p.has(u))continue;if(f.length>=n)break;let m=s.files.filter(_=>a.has(_.path)||_.is_test?!1:(0,L.dirname)(_.path)===u);if(m.length===0)continue;let c=(0,L.extname)(g[0]),x=m.map(_=>{let S=0;(0,L.extname)(_.path)===c&&(S+=2);let d=(0,L.basename)(_.path,(0,L.extname)(_.path));for(let v of g){let O=(0,L.basename)(v,(0,L.extname)(v)),I=d.split(/[-_.]/),E=O.split(/[-_.]/),R=I.filter(F=>E.includes(F));S+=R.length*.5}return _.lines<=150?S+=1:_.lines<=300&&(S+=.5),{file:_,score:S}});x.sort((_,S)=>S.score-_.score);let b=x[0];if(!b||b.score<1)continue;let C=(0,L.join)(e,b.file.path),T;try{T=(0,Le.readFileSync)(C,"utf-8")}catch{continue}let N=T.split(`
|
|
18
|
+
`).length,M=(0,L.extname)(b.file.path),D=j(N,M);if(l+D>r)continue;let w=["pattern_exemplar"];f.push({path:b.file.path,score:0,reasons:w,excerpt_spans:null,content:T,token_estimate:D,is_exemplar:!0}),l+=D,p.add(u)}return f}var Re=["test","tests","testing","spec","specs","jest","vitest","mocha"],yt=["config","configuration","settings","setup","env","environment"],wt=["database","migration","schema","sql","query","model","table"];function se(e,t,s,o){let n=[],r=o.toLowerCase();!e.some(m=>!m.is_stub&&!m.is_exemplar&&m.reasons.includes("keyword_match"))&&e.length>0&&n.push({level:"warning",code:"no_keyword_match",message:"No files matched task keywords. Bundle is based on churn/centrality signals only \u2014 consider rephrasing the task."});let a=t.some(m=>Re.includes(m))||Re.some(m=>r.includes(m)),h=e.some(m=>m.path.includes(".test.")||m.path.includes(".spec.")||m.path.includes("__tests__"));a&&!h&&n.push({level:"warning",code:"missing_test_files",message:"Task mentions testing but no test files are in the bundle. Test files may have been filtered or out of budget."});let f=t.some(m=>yt.includes(m)),l=e.some(m=>{let c=m.path.toLowerCase();return c.includes("config")||c.includes(".env")||c.includes("tsconfig")||c.includes("package.json")});f&&!l&&n.push({level:"info",code:"missing_config_files",message:"Task mentions configuration but no config files are in the bundle."});let p=t.some(m=>wt.includes(m)),u=e.some(m=>{let c=m.path.toLowerCase();return c.includes("model")||c.includes("migration")||c.includes("schema")||c.includes(".sql")||c.includes("db/")||c.includes("database")});p&&!u&&n.push({level:"info",code:"missing_db_files",message:"Task mentions database/schema but no database files are in the bundle."});let g=e.filter(m=>!m.is_stub&&!m.is_exemplar);if(g.length>=5){let m=g[0]?.score??0,c=g[g.length-1]?.score??0;m>0&&c>0&&c/m>.85&&n.push({level:"info",code:"score_plateau",message:"File scores are very close together \u2014 no strong signal file. The task may be too broad or generic."})}if(g.length===0&&n.push({level:"warning",code:"empty_bundle",message:"Bundle contains no source files. The task may not match any files in the repository."}),s.length>0&&g.length>0){let m=g[g.length-1].score,c=s.filter(x=>x.score>m&&!e.some(b=>b.path===x.path));c.length>3&&n.push({level:"info",code:"budget_squeeze",message:`${c.length} files with strong scores were excluded by budget constraints. Consider increasing --budget or --max-files.`})}return n}var xt=5;function oe(e,t,s,o,n,r){let i=new Set(t.map(l=>l.path)),a=n??xt,h=[],f=0;for(let l of e){if(f++,i.has(l.path)||l.score<=0)continue;if(h.length>=a)break;let u=r?.get(l.path)??Math.max(1,Math.round(l.features.size_penalty*1e3)),g=l.path.includes(".")?"."+l.path.split(".").pop():"",m=j(u,g),c=o?o-s:1/0,x=Math.max(0,m-c),b=bt(l,x),C=[...l.reasons];h.push({path:l.path,score:Math.round(l.score*1e3)/1e3,rank:f,reasons:C,budget_gap_tokens:x,suggestion:b})}return h}function bt(e,t){let s=[],o=e.path.split("/"),r=(o[o.length-1]??"").replace(/\.\w+$/,"").split(/[-_.]/).join(" ");return t>0&&s.push(`increase budget by ~${t} tokens`),e.features.keyword===0&&r&&s.push(`add "${r}" to your task description`),s.length===0&&s.push("increase --max-files or --budget"),s.join("; or ")}function re(e,t,s){let o=[],n=new Set(e.map(i=>i.path)),r=new Map;for(let i of s){let a=r.get(i.source_file)??[];a.push(i.test_file),r.set(i.source_file,a)}for(let i of e){if(i.is_stub||i.is_exemplar)continue;let a=(t.dependents[i.path]??[]).filter(p=>!n.has(p)),h=kt(i.path,t,n),f=new Set,l=r.get(i.path)??[];for(let p of l)f.add(p);for(let p of a){let u=r.get(p)??[];for(let g of u)f.add(g)}for(let p of h){let u=r.get(p)??[];for(let g of u)f.add(g)}a.length===0&&h.length===0&&f.size===0||o.push({path:i.path,direct_dependents:a,transitive_dependents:h,impacted_tests:[...f]})}return o.sort((i,a)=>{let h=i.direct_dependents.length+i.transitive_dependents.length+i.impacted_tests.length;return a.direct_dependents.length+a.transitive_dependents.length+a.impacted_tests.length-h}),o}function kt(e,t,s){let o=new Set([e]),n=[],r=[e];for(let i=0;i<3;i++){let a=[];for(let h of r){let f=t.dependents[h]??[];for(let l of f)if(!o.has(l)){if(o.add(l),!s.has(l)&&(n.push(l),n.length>=20))return n;a.push(l)}}if(r=a,r.length===0)break}return n}var St=["fix","bug","broken","crash","error","issue","wrong","fail","incorrect","invalid","null","undefined","exception","regression","patch","hotfix"],Tt=["add","create","implement","build","new","introduce","scaffold","feature","endpoint","component","page","route","service"],Et=["refactor","restructure","reorganize","clean","simplify","extract","rename","move","split","merge","consolidate","optimize","improve","modernize","upgrade","migrate","replace"],Ct=["test","tests","testing","spec","specs","coverage","assertion","mock","stub","fixture","jest","vitest","mocha","e2e"],vt=["config","configuration","settings","setup","env","environment","ci","pipeline","deploy","docker","workflow","lint","eslint","prettier","tsconfig","webpack","vite"];function ie(e){let s=e.toLowerCase().split(/[^\p{L}\p{N}]+/u).filter(i=>i.length>0),o={bug_fix:0,feature_add:0,refactor:0,test_update:0,config:0,general:0};for(let i of s)St.includes(i)&&(o.bug_fix+=1),Tt.includes(i)&&(o.feature_add+=1),Et.includes(i)&&(o.refactor+=1),Ct.includes(i)&&(o.test_update+=1),vt.includes(i)&&(o.config+=1);let n="general",r=0;for(let[i,a]of Object.entries(o))a>r&&(r=a,n=i);return r>0?n:"general"}var Mt={bug_fix:{error_infrastructure:1.5,recent_touch:1.3,churn:1.2,keyword:1.1},feature_add:{centrality:1.3,keyword:1.2,test_relevance:.8},refactor:{churn:1.4,centrality:1.3,size_penalty:.7},test_update:{test_relevance:1.5,keyword:1.2,churn:.8},config:{keyword:1.3,churn:.7,centrality:.8},general:{}};function ae(e,t){let s=Mt[t];if(Object.keys(s).length===0)return e;let o={...e};for(let[n,r]of Object.entries(s)){let i=o[n];typeof i=="number"&&(o[n]=i*r)}return o}var Lt=[{pattern:"/types/",layer:0},{pattern:"/types.",layer:0},{pattern:"/interfaces/",layer:0},{pattern:"/models/",layer:1},{pattern:"/entities/",layer:1},{pattern:"/schemas/",layer:1},{pattern:"/repo/",layer:2},{pattern:"/repositories/",layer:2},{pattern:"/db/",layer:2},{pattern:"/database/",layer:2},{pattern:"/migrations/",layer:2},{pattern:"/services/",layer:3},{pattern:"/service.",layer:3},{pattern:"/use-cases/",layer:3},{pattern:"/domain/",layer:3},{pattern:"/api/",layer:4},{pattern:"/routes/",layer:4},{pattern:"/controllers/",layer:4},{pattern:"/handlers/",layer:4},{pattern:"/pages/",layer:4},{pattern:"/components/",layer:4},{pattern:"/middleware/",layer:5},{pattern:"/config/",layer:6},{pattern:"/utils/",layer:6},{pattern:"/helpers/",layer:6},{pattern:"/lib/",layer:6},{pattern:"/jobs/",layer:7},{pattern:"/workers/",layer:7},{pattern:"/tasks/",layer:7},{pattern:"/tests/",layer:8},{pattern:"/test/",layer:8},{pattern:"/__tests__/",layer:8},{pattern:".test.",layer:8},{pattern:".spec.",layer:8}],Rt=5;function ce(e,t){let s=t??Lt,o=e.toLowerCase();for(let n of s)if(o.includes(n.pattern))return n.layer;return Rt}function le(e,t){return[...e].sort((s,o)=>{let n=ce(s.path,t),r=ce(o.path,t);return n-r})}var At=[/\bTODO\b/i,/\bFIXME\b/i,/\bHACK\b/i,/\bXXX\b/i,/\bBUG\b(?:\s*#?\d+)/i,/\bWORKAROUND\b/i];function pe(e){let t=e.split(`
|
|
19
|
+
`),s=[],o=0;for(let r of t)for(let i of At){let a=i.exec(r);if(a){o++;let h=a[0].toUpperCase();s.includes(h)||s.push(h);break}}let n=t.length>0?Math.min(1,o/t.length*100):0;return{count:o,density:n,markers:s}}function de(e){let{taskText:t,repoIndex:s,selectorConfig:o,budget:n=o.default_budget,sufficiencyThreshold:r=o.sufficiency_threshold,ledgerStats:i,explain:a=!1,scope:h,branchChangedFiles:f,includeNearMisses:l=!1,includeBlastRadius:p=!1,layerOrder:u=!1}=e,g=ie(t),m=ae(o.weights,g),c=f&&f.size>0?{...m,branch_changed:m.branch_changed??.15}:m,x=z(t),{candidates:b,tokenWeights:C,fanoutFiles:T,surfaceFiles:N}=J(t,s,o,h),M=V(b,x,s,c,i,C,T,f,N),D=M.reduce((y,k)=>y+Math.max(0,k.score),0),_=(n.max_files??1/0)<=15?2:0,S={...n,max_files:n.max_files?Math.max(1,n.max_files-_):void 0},d={files:[],totalTokens:0,cumulativeScore:0},v={};for(let y of M){if(Z(d,S,r,D))break;let k=G(s.root,y.path,x,o.excerpt_full_file_max_lines,o.excerpt_window_lines),P=y.path.includes(".")?"."+y.path.split(".").pop():"",A=j(k.lineCount,P);if(n.tokens&&d.totalTokens+A>n.tokens*1.1&&d.files.length>0)break;let B=te(k.content,o.deprecation_rules),K=pe(k.content),Ie={path:y.path,score:Math.round(y.score*1e3)/1e3,reasons:y.reasons,excerpt_spans:k.spans,content:k.content,token_estimate:A,deprecation_warnings:B.length>0?B:void 0,todo_count:K.count>0?K.count:void 0};d.files.push(Ie),d.totalTokens+=A,d.cumulativeScore+=Math.max(0,y.score),a&&(v[y.path]=y.features)}let O=new Set(d.files.map(y=>y.path)),I=new Map(d.files.map(y=>[y.path,y.score])),E=[];for(let y of s.test_map)O.has(y.source_file)&&!O.has(y.test_file)&&E.push({testPath:y.test_file,sourceScore:I.get(y.source_file)??0});E.sort((y,k)=>k.sourceScore-y.sourceScore);for(let{testPath:y}of E){if(n.max_files&&d.files.length>=n.max_files)break;let k=G(s.root,y,x,o.excerpt_full_file_max_lines,o.excerpt_window_lines),P=y.includes(".")?"."+y.split(".").pop():"",A=j(k.lineCount,P);if(n.tokens&&d.totalTokens+A>n.tokens*1.1)continue;let B=M.find(K=>K.path===y);d.files.push({path:y,score:B?Math.round(B.score*1e3)/1e3:0,reasons:B?.reasons??["test_relevant"],excerpt_spans:k.spans,content:k.content,token_estimate:A}),d.totalTokens+=A}let R=new Set(d.files.map(y=>y.path)),F=(n.tokens??1/0)-d.totalTokens,W=Math.max(0,(n.max_files??25)-d.files.length);if(W>0&&F>0){let y=ee(s.root,R,s.dep_graph,Math.min(W,5),Math.min(F,1e3));for(let k of y)d.files.push(k),d.totalTokens+=k.token_estimate}let Oe=Q(d.files,d.cumulativeScore,x.length),ue=new Set(d.files.map(y=>y.path)),H=[];for(let y of ue){let k=s.dep_graph.imports[y]??[];for(let P of k)ue.has(P)&&H.push({from:y,to:P})}let he=(n.tokens??1/0)-d.totalTokens,me=Math.max(0,(n.max_files??25)-d.files.length);if(me>0&&he>0){let y=ne(s.root,d.files,s,x,Math.min(me,2),Math.min(he,2e3));for(let k of y)d.files.push(k),d.totalTokens+=k.token_estimate}if(u){let y=d.files.filter(A=>!A.is_stub&&!A.is_exemplar),k=d.files.filter(A=>A.is_stub||A.is_exemplar),P=le(y);d.files=[...P,...k]}let ge=se(d.files,x,M,t),X=l?(()=>{let y=new Map(s.files.map(k=>[k.path,k.lines]));return oe(M,d.files,d.totalTokens,n.tokens,void 0,y)})():void 0,Y=p?re(d.files,s.dep_graph,s.test_map):void 0;return{bundle_id:`bnd_${(0,Ae.randomUUID)().slice(0,12)}`,task:t,budget:n,sufficiency_threshold:r,cumulative_score:Math.round(d.cumulativeScore*1e3)/1e3,files:d.files,total_tokens:d.totalTokens,generated_at:new Date().toISOString(),confidence:Oe,explain:a?v:void 0,file_relationships:H.length>0?H:void 0,warnings:ge.length>0?ge:void 0,near_misses:X&&X.length>0?X:void 0,blast_radius:Y&&Y.length>0?Y:void 0}}var Ne=require("node:fs"),Nt=require("node:path"),Cn=10*1024*1024;var Fe=require("node:crypto");var fe="0.1.0";function Bt(e){return e.includes("--version")?(process.stdout.write(`codeledger-core ${fe}
|
|
20
|
+
`),!0):e.includes("--license")?(process.stdout.write([`CodeLedger Core Engine v${fe}`,"","Copyright (c) 2025 Intelligent Context AI, Inc.","","This binary is licensed under the CodeLedger Core License:"," - FREE for individual developer use"," - FREE for open-source projects"," - Commercial and CI/CD usage requires a CodeLedger Pro license","","Contact: team@codeledger.dev","Details: https://codeledger.dev/license","","Privacy: This engine runs entirely locally. No network calls,","no telemetry, no data collection. Your code never leaves your machine.",""].join(`
|
|
21
|
+
`)),!0):e.includes("--explain-architecture")?(process.stdout.write([`CodeLedger Core Engine v${fe} \u2014 Architecture`,"","The engine selects the most relevant files for a coding task using","a deterministic, multi-signal scoring algorithm:",""," 1. CANDIDATE GENERATION (five-stage pipeline)"," - Keyword matching with IDF weighting"," - Hot-zone inclusion from git churn history"," - Dependency graph expansion (imports + dependents)"," - Fan-out detection for cross-cutting changes"," - Test neighborhood pairing",""," 2. SCORING (weighted multi-signal)"," Each candidate is scored across 9 signals:"," keyword, centrality, churn, recency, test_relevance,"," size_penalty, success_prior, fail_prior, error_infrastructure",""," 3. BOUNDED SELECTION"," Files are selected in score order until the token budget"," or file count ceiling is reached. A sufficiency threshold"," stops early when cumulative score plateaus.",""," 4. POST-PROCESSING"," - Deterministic test pairing (source \u2192 test)"," - Interface stub generation for adjacent dependencies"," - Confidence assessment (high / medium / low)"," - Smart excerpt extraction with keyword windowing","","Input: Task description + repo index + config","Output: Deterministic ContextBundle (same input = same rankings and content; metadata fields like bundle_id vary)","","Privacy: Runs entirely local. No network calls. No telemetry.",""].join(`
|
|
22
|
+
`)),!0):!1}async function zt(){let e=[];for await(let t of process.stdin)e.push(Buffer.isBuffer(t)?t:Buffer.from(t));return Buffer.concat(e).toString("utf-8")}async function Ut(){if(Bt(process.argv.slice(2)))return;let e=await zt(),t=JSON.parse(e),s;if(t.indexPath)s=JSON.parse((0,De.readFileSync)(t.indexPath,"utf-8"));else if(t.repoIndex)s=t.repoIndex;else throw new Error("Either indexPath or repoIndex must be provided");let o=t.ledgerStats?{success_files:new Set(t.ledgerStats.success_files),fail_files:new Set(t.ledgerStats.fail_files)}:void 0,n=de({taskText:t.task,repoIndex:s,selectorConfig:t.selectorConfig,budget:t.budget,explain:t.explain,ledgerStats:o});process.stdout.write(JSON.stringify(n))}Ut().catch(e=>{process.stderr.write(JSON.stringify({error:String(e)})+`
|
|
21
23
|
`),process.exit(1)});
|
package/dist/bridge.d.ts
CHANGED
|
@@ -31,6 +31,16 @@ export interface EngineSelectOptions {
|
|
|
31
31
|
indexPath?: string;
|
|
32
32
|
/** Ledger-derived prior data. When omitted, success_prior and fail_prior score as 0. */
|
|
33
33
|
ledgerStats?: LedgerStats;
|
|
34
|
+
/** Scope restriction: only consider files under these path prefixes */
|
|
35
|
+
scope?: string[];
|
|
36
|
+
/** Files changed on the current branch (for work-in-progress scoring boost) */
|
|
37
|
+
branchChangedFiles?: Set<string>;
|
|
38
|
+
/** When true, include near-miss files in the bundle output */
|
|
39
|
+
includeNearMisses?: boolean;
|
|
40
|
+
/** When true, compute blast radius for each selected file */
|
|
41
|
+
includeBlastRadius?: boolean;
|
|
42
|
+
/** When true, sort bundle files by architectural layer */
|
|
43
|
+
layerOrder?: boolean;
|
|
34
44
|
}
|
|
35
45
|
/**
|
|
36
46
|
* Generate a deterministic context bundle.
|
package/dist/bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAK1F,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,UAAU,EAAE,GA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U,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,mBAAmB,GACxB,OAAO,CAAC,aAAa,CAAC,CAQxB"}
|
package/dist/bridge.js
CHANGED
|
@@ -49,6 +49,13 @@ function invokeBinary(opts) {
|
|
|
49
49
|
fail_files: [...opts.ledgerStats.fail_files],
|
|
50
50
|
}
|
|
51
51
|
: undefined,
|
|
52
|
+
scope: opts.scope,
|
|
53
|
+
branchChangedFiles: opts.branchChangedFiles
|
|
54
|
+
? [...opts.branchChangedFiles]
|
|
55
|
+
: undefined,
|
|
56
|
+
includeNearMisses: opts.includeNearMisses ?? false,
|
|
57
|
+
includeBlastRadius: opts.includeBlastRadius ?? false,
|
|
58
|
+
layerOrder: opts.layerOrder ?? false,
|
|
52
59
|
});
|
|
53
60
|
const result = execFileSync('node', [CORE_BINARY], {
|
|
54
61
|
input,
|
|
@@ -69,6 +76,11 @@ async function directBuildBundle(opts) {
|
|
|
69
76
|
budget: opts.budget,
|
|
70
77
|
explain: opts.explain,
|
|
71
78
|
ledgerStats: opts.ledgerStats,
|
|
79
|
+
scope: opts.scope,
|
|
80
|
+
branchChangedFiles: opts.branchChangedFiles,
|
|
81
|
+
includeNearMisses: opts.includeNearMisses,
|
|
82
|
+
includeBlastRadius: opts.includeBlastRadius,
|
|
83
|
+
layerOrder: opts.layerOrder,
|
|
72
84
|
});
|
|
73
85
|
}
|
|
74
86
|
//# sourceMappingURL=bridge.js.map
|
package/dist/bridge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAA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AS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;QAC3C,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,kBAAkB,EAAE,IAAI,CAAC,kBAAkB;QAC3C,UAAU,EAAE,IAAI,CAAC,UAAU;KAC5B,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeledger/core-engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Protected scoring engine for CodeLedger — compiled binary bridge",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE-CORE",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@codeledger/types": "0.
|
|
28
|
+
"@codeledger/types": "0.2.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.4.0",
|
|
32
|
-
"@codeledger/selector": "0.
|
|
32
|
+
"@codeledger/selector": "0.2.1"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsc",
|