@codeledger/core-engine 0.1.1 → 0.2.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/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<s.length;r++){let
|
|
18
|
-
`)
|
|
19
|
-
`))
|
|
20
|
-
`)
|
|
7
|
+
"use strict";var Le=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"]),Oe=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`)),Be=["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`)),z=50,ye=[".sql",".proto",".prisma",".graphql",".gql"],be=["openapi","swagger","schema","migrations"],Ie=new Set(["config","configuration","script","dependency","dependencies","setup","package","tsconfig","eslint","prettier","webpack","vite","rollup"]),We=new Set(["test","tests","testing","ci","pipeline","failing","pass","coverage","jest","vitest","mocha","cypress","playwright"]),je=new Set(["schema","api","endpoint","migration","contract","proto","graphql","openapi","swagger","prisma","database"]),Ue=["package.json","tsconfig","pnpm-workspace",".env.example","eslint","prettier","webpack.config","vite.config","rollup.config"],ze=["vitest.config","jest.config",".github/workflows","ci.yml","ci.yaml","test-setup","test-helper","test-utils"],$e=/\b(?:and then|and also|and|then|also|plus)\b|[;,]/i;function U(e){let t=e.toLowerCase(),o=Pe.some(r=>r.test(t))?new Set([..._e,...Oe]):_e,s=t.split(/[^\p{L}\p{N}]+/u).filter(r=>r.length>1&&!o.has(r));return[...new Set(s)]}function we(e){let t=e.split($e).map(o=>o.trim()).filter(o=>o.length>0);if(t.length<=1)return[U(e)];let n=[];for(let o of t){let s=U(o);s.length>0&&n.push(s)}return n.length>0?n:[U(e)]}function xe(e,t,n){let o=new Map;for(let s of e){let r=0;for(let a of t.files)(a.path.toLowerCase().includes(s)||a.content_keywords?.some(h=>h===s||h===s+"s"||s===h+"s"))&&r++;if(r===0){o.set(s,0);continue}let i=1/Math.sqrt(Math.max(1,r));s.length<=2&&(i=Math.min(i,.35)),r>n&&(i=Math.min(i,.35)),i=Math.max(.35,Math.min(1,i)),o.set(s,i)}return o}function qe(e){let t=e.toLowerCase();return Be.some(n=>n.test(t))}function Ge(e,t){let n=[];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")){n.push(o.path);break}}return n}function J(e,t,n,o){let s=new Set,r=new Set,i=new Set,a=o??n.default_scope,h=we(e),f=[...new Set(h.flat())],l=xe(f,t,n.hot_zone_count),p=a?t.files.filter(b=>a.some(_=>b.path.startsWith(_))):t.files;for(let b of h)for(let _ of p){if(s.has(_.path))continue;let T=_.path.toLowerCase();for(let u of b){if(T.includes(u)){s.add(_.path);break}if(_.content_keywords?.some(v=>v===u||v===u+"s"||u===v+"s")){s.add(_.path);break}}}let d=(n.default_budget.max_files??1/0)<=15,g=new Set(p.map(b=>b.path)),m=t.churn.slice(0,n.hot_zone_count);for(let b of m)g.has(b.path)&&(d&&!s.has(b.path)||s.add(b.path));let c=a?g:void 0,w=[...s];for(let b of w)Ke(b,t,s,n.dependency_depth,n.dependency_cap_per_seed,c);if(qe(e)){let b=Ge(f,t);for(let _ of b){if(s.size>=z)break;let T=t.dep_graph.dependents[_]??[];for(let u of T){if(s.size>=z)break;c&&!c.has(u)||(s.add(u),r.add(u))}if(s.size<z)for(let u of T){if(s.size>=z)break;if(c&&!c.has(u))continue;let v=t.dep_graph.dependents[u]??[];for(let O of v){if(s.size>=z)break;c&&!c.has(O)||(s.add(O),r.add(O))}}}}let x=[...s];for(let b of t.test_map)x.includes(b.source_file)&&(!c||c.has(b.test_file))&&s.add(b.test_file),x.includes(b.test_file)&&(!c||c.has(b.source_file))&&s.add(b.source_file);let C=Xe(t.files,n.contract_patterns);if(C.length>0&&s.size>0){let b=new Set([...s].map(_=>_.split("/").slice(0,-1).join("/")));for(let _ of C){let T=_.split("/").slice(0,-1).join("/");(b.has(T)||[...b].some(v=>v.startsWith(T+"/")||T.startsWith(v+"/")))&&s.add(_)}}let S=new Set(f),L=[...Ie].some(b=>S.has(b)),R=[...We].some(b=>S.has(b)),D=[...je].some(b=>S.has(b));if(L||R||D){let b=D?new Set([...s].map(_=>_.split("/").slice(0,-1).join("/"))):void 0;for(let _ of p){if(s.has(_.path))continue;let T=_.path.toLowerCase();if(L&&Ue.some(u=>T.includes(u))){s.add(_.path),i.add(_.path);continue}if(R&&ze.some(u=>T.includes(u))){s.add(_.path),i.add(_.path);continue}if(D&&b){let u=_.extension.toLowerCase(),v=T.split("/").pop()??"";if(ye.includes(u)||be.some(P=>v.startsWith(P))){let P=_.path.split("/").slice(0,-1).join("/");(b.has(P)||[...b].some(M=>M.startsWith(P+"/")||P.startsWith(M+"/")))&&(s.add(_.path),i.add(_.path))}}}}return{candidates:s,tokenWeights:l,fanoutFiles:r,surfaceFiles:i}}function Xe(e,t){let n=[];for(let o of e){let s=o.extension.toLowerCase(),r=o.path.toLowerCase();if(ye.includes(s)){n.push(o.path);continue}if(t?.some(a=>r.includes(a.toLowerCase()))){n.push(o.path);continue}let i=r.split("/").pop()??"";be.some(a=>i.startsWith(a))&&n.push(o.path)}return n}function Ke(e,t,n,o,s,r){let i=[e],a=0;for(let h=0;h<o&&a<s;h++){let f=[];for(let l of i){let p=t.dep_graph.imports[l]??[];for(let g of p)r&&!r.has(g)||!n.has(g)&&a<s&&(n.add(g),f.push(g),a++);let d=t.dep_graph.dependents[l]??[];for(let g of d)r&&!r.has(g)||!n.has(g)&&a<s&&(n.add(g),f.push(g),a++)}i=f}}var He=["error","exception","validation","validator","schema"];function Ye(e){return(e.path.toLowerCase().split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/).some(r=>He.some(i=>r===i||r===i+"s"))?1:0}function ke(e,t,n,o,s,r){let i=e.path.toLowerCase(),a=e.content_keywords??[],f=(i.split("/").pop()?.replace(/\.\w+$/,"")??"").split(/[-_]/),l=0,p=0,d=!1;for(let E of t){let M=s?.get(E)??1;if(M!==0)if(p+=M,i.includes(E)){let F=f.some(W=>W===E||W===E+"s"||E===W+"s");l+=M*(F?3:1)}else a.some(F=>F===E||F===E+"s"||E===F+"s")&&(l+=M*.5,d=!0)}let g=p>0?Math.min(1,l/(p*1.5)):0,m=n.dep_graph.imports[e.path]?.length??0,c=n.dep_graph.dependents[e.path]?.length??0,w=m+c,x=Math.max(1,...n.files.map(E=>{let M=n.dep_graph.imports[E.path]?.length??0,F=n.dep_graph.dependents[E.path]?.length??0;return M+F})),C=w/x,S=n.churn.find(E=>E.path===e.path),L=S?.time_decayed_score??0,R=S?.days_since_last_touch??999,D=R<=7?1:R<=14?.8:R<=30?.5:R<=60?.2:0,b=n.test_map.filter(E=>E.source_file===e.path||E.test_file===e.path),_=0;b.length>0&&(_=.5,_+=Math.min(.5,b.length*.25));let T=Math.max(0,Math.min(1,e.lines/1e3)),u=o?.success_files.has(e.path)?1:0,v=o?.fail_files.has(e.path)?1:0,O=Ye(e),P=r?.has(e.path)?1:0;return{keyword:g,centrality:C,churn:L,recent_touch:D,test_relevance:_,size_penalty:T,success_prior:u,fail_prior:v,error_infrastructure:O,branch_changed:P,_hasContentMatch:d}}function Te(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 Se(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,n,o,s,r,i,a,h){let f=new Map(n.files.map(p=>[p.path,p])),l=[];for(let p of e){let d=f.get(p);if(!d)continue;let g=ke(d,t,n,s,r,a),c={...Te(g),_hasContentMatch:g._hasContentMatch,branch_changed:g.branch_changed},w=Se(c,o),x=Ee(c);i?.has(p)&&(w+=.25,x.includes("dependent_neighbor")||x.push("dependent_neighbor")),h?.has(p)&&c.keyword===0&&(w=0,x.length=0,x.push("surface_auto_include")),l.push({path:p,score:w,features:c,reasons:x})}return l.sort((p,d)=>d.score-p.score),l}function Je(e){return e.some(t=>t.reasons.includes("keyword_match")||t.reasons.includes("test_relevant"))}function Z(e,t,n,o){return!!(t.max_files&&e.files.length>=t.max_files||t.tokens&&e.totalTokens>=t.tokens||o>0&&e.cumulativeScore/o>=n&&Je(e.files))}var q=require("node:fs"),Ce=require("node:path"),Ve=10*1024*1024;function G(e,t,n,o,s){let r=(0,Ce.join)(e,t),i;try{let c=(0,q.statSync)(r).size;if(c>Ve)return{content:`// File too large (${Math.round(c/1024)}KB), skipped`,spans:null,lineCount:1};i=(0,q.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 w=a[c];if(Ze(w)){let x=Math.max(0,c-1),C=Math.min(a.length-1,c+1);Qe(w)&&(C=et(a,c,20)),h.push({start_line:x+1,end_line:C+1,reason:"type_surface"});for(let S=x;S<=C;S++)f.add(S)}}for(let c=0;c<a.length;c++){let w=a[c];if(tt(w)&&!f.has(c)){let x=Math.max(0,c-1),C=Math.min(a.length-1,c+2);h.push({start_line:x+1,end_line:C+1,reason:"export_signature"});for(let S=x;S<=C;S++)f.add(S)}}for(let c=0;c<a.length;c++){let w=a[c].toLowerCase();for(let x of n)if(w.includes(x)){let C=Math.max(0,c-s),S=Math.min(a.length-1,c+s);h.push({start_line:C+1,end_line:S+1,reason:`keyword_match:${x}`});for(let L=C;L<=S;L++)f.add(L);break}}let l=[...f].sort((c,w)=>c-w),p=[],d=-2;for(let c of l)c>d+1&&p.push(`
|
|
9
|
+
// ... (lines ${d+2}\u2013${c} omitted) ...
|
|
10
|
+
`),p.push(a[c]),d=c;let g=p.join(`
|
|
11
|
+
`),m=st(h);return{content:g,spans:m,lineCount:l.length}}function Ze(e){let n=e.trim().replace(/^export\s+(default\s+)?/,"").replace(/^declare\s+/,"");return n.startsWith("interface ")||n.startsWith("type ")||n.startsWith("enum ")||n.startsWith("function ")&&!n.includes("=>")||n.startsWith("abstract class ")||n.startsWith("class ")}function Qe(e){let t=e.trim();return t.includes("{")&&!t.includes("}")}function et(e,t,n){let o=0,s=Math.min(e.length-1,t+n);for(let r=t;r<=s;r++){let i=e[r];for(let a of i)a==="{"&&o++,a==="}"&&o--;if(o<=0&&r>t)return r}return s}function tt(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 st(e){if(e.length===0)return[];let t=[...e].sort((o,s)=>o.start_line-s.start_line),n=[t[0]];for(let o=1;o<t.length;o++){let s=t[o],r=n[n.length-1];s.start_line<=r.end_line+1?(r.end_line=Math.max(r.end_line,s.end_line),r.reason=`${r.reason}+${s.reason}`):n.push({...s})}return n}var Ne=require("node:crypto");function Q(e,t,n){let o=[],s=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?(s+=.35,o.push(`Strong keyword signal: ${i.length}/${r.length} top files match task keywords`)):a>0?(s+=.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,d=e[1].score;p>0&&d>0&&((p-d)/p>=.3?(s+=.2,o.push("Clear top-ranked file with significant score gap")):s+=.1)}let h=e.reduce((p,d)=>p+d.reasons.length,0)/e.length;h>=2?(s+=.2,o.push("Files selected for multiple independent reasons")):h>=1.5&&(s+=.1),n>=3?s+=.15:n>=2?s+=.1:o.push("Task description has few discriminating keywords \u2014 consider being more specific"),e.filter(p=>!p.reasons.every(d=>d==="test_relevant")).length>=e.length*.5&&(s+=.1);let l;if(s>=.65?l="high":s>=.35?l="medium":l="low",l!=="high"){let p=nt(e,a,n);for(let d of p)o.push(d)}return{level:l,score:Math.round(s*100)/100,reasons:o}}function nt(e,t,n){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 n<=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 Re=require("node:fs"),X=require("node:path");var ot={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},rt=4;function ve(e,t){let n=ot[t.toLowerCase()]??rt;return Math.ceil(e*n)}function B(e,t){let n=at(t);return ve(e,n)}var it={".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 at(e){return it[e.toLowerCase()]??"unknown"}function ee(e,t,n,o,s){let r=new Map;for(let f of t){let l=n.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,X.join)(e,f),p;try{p=(0,Re.readFileSync)(l,"utf-8")}catch{continue}let d=ct(p,f);if(!d)continue;let g=d.split(`
|
|
12
|
+
`).length,m=(0,X.extname)(f),c=B(g,m);if(h+c>s)continue;let w=["interface_stub"];a.push({path:f,score:0,reasons:w,excerpt_spans:null,content:d,token_estimate:c,is_stub:!0}),h+=c}return a}function ct(e,t){let n=e.split(`
|
|
13
|
+
`),o=[],s=0;for(;s<n.length;){let r=n[s],i=r.trim();if(lt(i)){if(i.includes("{")&&!i.includes("}")){let a=ut(n,s);o.push(...a),s+=a.length;continue}o.push(r),s++;continue}if(pt(i)){let a=ft(n,s);o.push(a),s=dt(n,s);continue}s++}return o.length===0?null:`// Interface stub (auto-generated by CodeLedger)
|
|
14
|
+
${o.join(`
|
|
15
|
+
`)}`}function lt(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 pt(e){return e.startsWith("export ")?e.slice(7).replace(/^default\s+/,"").replace(/^async\s+/,"").startsWith("function "):!1}function ut(e,t){let n=[],o=0;for(let s=t;s<e.length&&s<t+50;s++){let r=e[s];n.push(r);for(let i of r)i==="{"&&o++,i==="}"&&o--;if(o<=0&&s>t)break}return n}function ft(e,t){let n="";for(let o=t;o<e.length&&o<t+5;o++){let s=e[o],r=s.indexOf("{");if(r>=0){n+=s.slice(0,r).trimEnd()+";";break}n+=s+`
|
|
16
|
+
`}return n||e[t]}function dt(e,t){let n=0;for(let o=t;o<e.length;o++){let s=e[o];for(let r of s)r==="{"&&n++,r==="}"&&n--;if(n<=0&&o>t)return o+1}return e.length}var ht=[{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 n=[...ht,...t??[]],o=[],s=e.split(`
|
|
17
|
+
`);for(let r=0;r<s.length;r++){let i=s[r],a=i.trim();if(!(a.startsWith("//")||a.startsWith("*")||a.startsWith("/*")))for(let h of n){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 Ae=require("node:fs"),A=require("node:path");var mt=["add","create","implement","build","new","introduce","scaffold","write","make","generate","setup","set up"];function se(e,t,n,o,s,r){if(!o.some(d=>mt.includes(d)))return[];let a=new Set(t.map(d=>d.path)),h=new Map;for(let d of t){if(d.is_stub||d.is_exemplar)continue;let g=(0,A.dirname)(d.path),m=h.get(g)??[];m.push(d.path),h.set(g,m)}let f=[],l=0,p=new Set;for(let[d,g]of h){if(p.has(d))continue;if(f.length>=s)break;let m=n.files.filter(_=>a.has(_.path)||_.is_test?!1:(0,A.dirname)(_.path)===d);if(m.length===0)continue;let c=(0,A.extname)(g[0]),w=m.map(_=>{let T=0;(0,A.extname)(_.path)===c&&(T+=2);let u=(0,A.basename)(_.path,(0,A.extname)(_.path));for(let v of g){let O=(0,A.basename)(v,(0,A.extname)(v)),P=u.split(/[-_.]/),E=O.split(/[-_.]/),M=P.filter(F=>E.includes(F));T+=M.length*.5}return _.lines<=150?T+=1:_.lines<=300&&(T+=.5),{file:_,score:T}});w.sort((_,T)=>T.score-_.score);let x=w[0];if(!x||x.score<1)continue;let C=(0,A.join)(e,x.file.path),S;try{S=(0,Ae.readFileSync)(C,"utf-8")}catch{continue}let L=S.split(`
|
|
18
|
+
`).length,R=(0,A.extname)(x.file.path),D=B(L,R);if(l+D>r)continue;let b=["pattern_exemplar"];f.push({path:x.file.path,score:0,reasons:b,excerpt_spans:null,content:S,token_estimate:D,is_exemplar:!0}),l+=D,p.add(d)}return f}var Me=["test","tests","testing","spec","specs","jest","vitest","mocha"],gt=["config","configuration","settings","setup","env","environment"],_t=["database","migration","schema","sql","query","model","table"];function ne(e,t,n,o){let s=[],r=o.toLowerCase();!e.some(m=>!m.is_stub&&!m.is_exemplar&&m.reasons.includes("keyword_match"))&&e.length>0&&s.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=>Me.includes(m))||Me.some(m=>r.includes(m)),h=e.some(m=>m.path.includes(".test.")||m.path.includes(".spec.")||m.path.includes("__tests__"));a&&!h&&s.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=>gt.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&&s.push({level:"info",code:"missing_config_files",message:"Task mentions configuration but no config files are in the bundle."});let p=t.some(m=>_t.includes(m)),d=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&&!d&&s.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&&s.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&&s.push({level:"warning",code:"empty_bundle",message:"Bundle contains no source files. The task may not match any files in the repository."}),n.length>0&&g.length>0){let m=g[g.length-1].score,c=n.filter(w=>w.score>m&&!e.some(x=>x.path===w.path));c.length>3&&s.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 s}var yt=5;function oe(e,t,n,o,s,r){let i=new Set(t.map(l=>l.path)),a=s??yt,h=[],f=0;for(let l of e){if(f++,i.has(l.path)||l.score<=0)continue;if(h.length>=a)break;let d=r?.get(l.path)??Math.max(1,Math.round(l.features.size_penalty*1e3)),g=l.path.includes(".")?"."+l.path.split(".").pop():"",m=B(d,g),c=o?o-n:1/0,w=Math.max(0,m-c),x=bt(l,w),C=[...l.reasons];h.push({path:l.path,score:Math.round(l.score*1e3)/1e3,rank:f,reasons:C,budget_gap_tokens:w,suggestion:x})}return h}function bt(e,t){let n=[],o=e.path.split("/"),r=(o[o.length-1]??"").replace(/\.\w+$/,"").split(/[-_.]/).join(" ");return t>0&&n.push(`increase budget by ~${t} tokens`),e.features.keyword===0&&r&&n.push(`add "${r}" to your task description`),n.length===0&&n.push("increase --max-files or --budget"),n.join("; or ")}function re(e,t,n){let o=[],s=new Set(e.map(i=>i.path)),r=new Map;for(let i of n){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=>!s.has(p)),h=wt(i.path,t,s),f=new Set,l=r.get(i.path)??[];for(let p of l)f.add(p);for(let p of a){let d=r.get(p)??[];for(let g of d)f.add(g)}for(let p of h){let d=r.get(p)??[];for(let g of d)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 wt(e,t,n){let o=new Set([e]),s=[],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),!n.has(l)&&(s.push(l),s.length>=20))return s;a.push(l)}}if(r=a,r.length===0)break}return s}var xt=["fix","bug","broken","crash","error","issue","wrong","fail","incorrect","invalid","null","undefined","exception","regression","patch","hotfix"],kt=["add","create","implement","build","new","introduce","scaffold","feature","endpoint","component","page","route","service"],Tt=["refactor","restructure","reorganize","clean","simplify","extract","rename","move","split","merge","consolidate","optimize","improve","modernize","upgrade","migrate","replace"],St=["test","tests","testing","spec","specs","coverage","assertion","mock","stub","fixture","jest","vitest","mocha","e2e"],Et=["config","configuration","settings","setup","env","environment","ci","pipeline","deploy","docker","workflow","lint","eslint","prettier","tsconfig","webpack","vite"];function ie(e){let n=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 n)xt.includes(i)&&(o.bug_fix+=1),kt.includes(i)&&(o.feature_add+=1),Tt.includes(i)&&(o.refactor+=1),St.includes(i)&&(o.test_update+=1),Et.includes(i)&&(o.config+=1);let s="general",r=0;for(let[i,a]of Object.entries(o))a>r&&(r=a,s=i);return r>0?s:"general"}var Ct={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 n=Ct[t];if(Object.keys(n).length===0)return e;let o={...e};for(let[s,r]of Object.entries(n)){let i=o[s];typeof i=="number"&&(o[s]=i*r)}return o}var vt=[{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 n=t??vt,o=e.toLowerCase();for(let s of n)if(o.includes(s.pattern))return s.layer;return Rt}function le(e,t){return[...e].sort((n,o)=>{let s=ce(n.path,t),r=ce(o.path,t);return s-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
|
+
`),n=[],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();n.includes(h)||n.push(h);break}}let s=t.length>0?Math.min(1,o/t.length*100):0;return{count:o,density:s,markers:n}}function ue(e){let{taskText:t,repoIndex:n,selectorConfig:o,budget:s=o.default_budget,sufficiencyThreshold:r=o.sufficiency_threshold,ledgerStats:i,explain:a=!1,scope:h,branchChangedFiles:f,includeNearMisses:l=!1,includeBlastRadius:p=!1,layerOrder:d=!1}=e,g=ie(t),m=ae(o.weights,g),c=f&&f.size>0?{...m,branch_changed:m.branch_changed??.15}:m,w=U(t),{candidates:x,tokenWeights:C,fanoutFiles:S,surfaceFiles:L}=J(t,n,o,h),R=V(x,w,n,c,i,C,S,f,L),D=R.reduce((y,k)=>y+Math.max(0,k.score),0),_=(s.max_files??1/0)<=15?2:0,T={...s,max_files:s.max_files?Math.max(1,s.max_files-_):void 0},u={files:[],totalTokens:0,cumulativeScore:0},v={};for(let y of R){if(Z(u,T,r,D))break;let k=G(n.root,y.path,w,o.excerpt_full_file_max_lines,o.excerpt_window_lines),I=y.path.includes(".")?"."+y.path.split(".").pop():"",N=B(k.lineCount,I);if(s.tokens&&u.totalTokens+N>s.tokens*1.1&&u.files.length>0)break;let j=te(k.content,o.deprecation_rules),$=pe(k.content),De={path:y.path,score:Math.round(y.score*1e3)/1e3,reasons:y.reasons,excerpt_spans:k.spans,content:k.content,token_estimate:N,deprecation_warnings:j.length>0?j:void 0,todo_count:$.count>0?$.count:void 0};u.files.push(De),u.totalTokens+=N,u.cumulativeScore+=Math.max(0,y.score),a&&(v[y.path]=y.features)}let O=new Set(u.files.map(y=>y.path)),P=new Map(u.files.map(y=>[y.path,y.score])),E=[];for(let y of n.test_map)O.has(y.source_file)&&!O.has(y.test_file)&&E.push({testPath:y.test_file,sourceScore:P.get(y.source_file)??0});E.sort((y,k)=>k.sourceScore-y.sourceScore);for(let{testPath:y}of E){if(s.max_files&&u.files.length>=s.max_files)break;let k=G(n.root,y,w,o.excerpt_full_file_max_lines,o.excerpt_window_lines),I=y.includes(".")?"."+y.split(".").pop():"",N=B(k.lineCount,I);if(s.tokens&&u.totalTokens+N>s.tokens*1.1)continue;let j=R.find($=>$.path===y);u.files.push({path:y,score:j?Math.round(j.score*1e3)/1e3:0,reasons:j?.reasons??["test_relevant"],excerpt_spans:k.spans,content:k.content,token_estimate:N}),u.totalTokens+=N}let M=new Set(u.files.map(y=>y.path)),F=(s.tokens??1/0)-u.totalTokens,W=Math.max(0,(s.max_files??25)-u.files.length);if(W>0&&F>0){let y=ee(n.root,M,n.dep_graph,Math.min(W,5),Math.min(F,1e3));for(let k of y)u.files.push(k),u.totalTokens+=k.token_estimate}let Fe=Q(u.files,u.cumulativeScore,w.length),de=new Set(u.files.map(y=>y.path)),K=[];for(let y of de){let k=n.dep_graph.imports[y]??[];for(let I of k)de.has(I)&&K.push({from:y,to:I})}let he=(s.tokens??1/0)-u.totalTokens,me=Math.max(0,(s.max_files??25)-u.files.length);if(me>0&&he>0){let y=se(n.root,u.files,n,w,Math.min(me,2),Math.min(he,2e3));for(let k of y)u.files.push(k),u.totalTokens+=k.token_estimate}if(d){let y=u.files.filter(N=>!N.is_stub&&!N.is_exemplar),k=u.files.filter(N=>N.is_stub||N.is_exemplar),I=le(y);u.files=[...I,...k]}let ge=ne(u.files,w,R,t),H=l?(()=>{let y=new Map(n.files.map(k=>[k.path,k.lines]));return oe(R,u.files,u.totalTokens,s.tokens,void 0,y)})():void 0,Y=p?re(u.files,n.dep_graph,n.test_map):void 0;return{bundle_id:`bnd_${(0,Ne.randomUUID)().slice(0,12)}`,task:t,budget:s,sufficiency_threshold:r,cumulative_score:Math.round(u.cumulativeScore*1e3)/1e3,files:u.files,total_tokens:u.totalTokens,generated_at:new Date().toISOString(),confidence:Fe,explain:a?v:void 0,file_relationships:K.length>0?K:void 0,warnings:ge.length>0?ge:void 0,near_misses:H&&H.length>0?H:void 0,blast_radius:Y&&Y.length>0?Y:void 0}}var fe="0.1.0";function Mt(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@contextecf.com","Details: https://contextecf.com/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 Nt(){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 Lt(){if(Mt(process.argv.slice(2)))return;let e=await Nt(),t=JSON.parse(e),n;if(t.indexPath)n=JSON.parse((0,Le.readFileSync)(t.indexPath,"utf-8"));else if(t.repoIndex)n=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,s=ue({taskText:t.task,repoIndex:n,selectorConfig:t.selectorConfig,budget:t.budget,explain:t.explain,ledgerStats:o});process.stdout.write(JSON.stringify(s))}Lt().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,GAAG,CAAC,MAAM,CAAC,CAAC;CACzB;AAED,MAAM,WAAW,mB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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,WAAW,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,C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AAC,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.0",
|
|
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.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^5.4.0",
|
|
32
|
-
"@codeledger/selector": "0.
|
|
32
|
+
"@codeledger/selector": "0.2.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsc",
|