@vibgrate/haile 2026.903.2 → 2026.903.3
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/README.md +1 -1
- package/dist/engine/haile.wasm +0 -0
- package/dist/index.d.ts +32 -2
- package/dist/index.js +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ import { createHaileProvider } from "@vibgrate/haile";
|
|
|
24
24
|
const kernel = createHaileProvider();
|
|
25
25
|
// null when dist/engine/haile.wasm is missing — never a dummy provider.
|
|
26
26
|
kernel?.version();
|
|
27
|
-
// "haile-fast/
|
|
27
|
+
// "haile-fast/2026.903.3" (or the version string the wasm exports)
|
|
28
28
|
kernel?.classify({
|
|
29
29
|
name: "CreateUser",
|
|
30
30
|
path: "src/controllers/UsersController.cs",
|
package/dist/engine/haile.wasm
CHANGED
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -28,11 +28,34 @@ interface HaileClassifyInput {
|
|
|
28
28
|
/** Catalog AST role for the file, if the host has one. */
|
|
29
29
|
astRole?: string;
|
|
30
30
|
/**
|
|
31
|
-
* What the body
|
|
31
|
+
* What the body's code calls, scanned not run (vg-graph `node.effects`): bounded counts such as
|
|
32
32
|
* `sqlWrite`, `http`, `respond`, `render`, `calls`, `branches`, plus
|
|
33
33
|
* `apis`. The kernel scores purposes from these ahead of names.
|
|
34
34
|
*/
|
|
35
35
|
effects?: Readonly<Record<string, number | readonly string[]>>;
|
|
36
|
+
/**
|
|
37
|
+
* Ordered duty IR (vg-graph `node.duties`): `{ k, o?, via?, g?, live, hop?, line }`
|
|
38
|
+
* rows the extractor reconstructed from the syntax tree. The kernel scores
|
|
39
|
+
* purposes from these first, renders the intent from them, and evaluates
|
|
40
|
+
* the boundary policy over them.
|
|
41
|
+
*/
|
|
42
|
+
duties?: readonly HaileDutyInput[];
|
|
43
|
+
}
|
|
44
|
+
interface HaileDutyInput {
|
|
45
|
+
k: string;
|
|
46
|
+
o?: string;
|
|
47
|
+
via?: string;
|
|
48
|
+
t?: string;
|
|
49
|
+
g?: string;
|
|
50
|
+
live: boolean;
|
|
51
|
+
hop?: number;
|
|
52
|
+
line?: number;
|
|
53
|
+
}
|
|
54
|
+
/** A boundary finding from the kernel's policy pack (additive). */
|
|
55
|
+
interface HaileFinding {
|
|
56
|
+
rule: string;
|
|
57
|
+
severity: string;
|
|
58
|
+
message: string;
|
|
36
59
|
}
|
|
37
60
|
interface HaileClassification {
|
|
38
61
|
primary: string;
|
|
@@ -56,6 +79,7 @@ interface HaileClassification {
|
|
|
56
79
|
signal: string;
|
|
57
80
|
weight: number;
|
|
58
81
|
}[];
|
|
82
|
+
findings: HaileFinding[];
|
|
59
83
|
}
|
|
60
84
|
interface HaileProvider {
|
|
61
85
|
version(): string;
|
|
@@ -65,7 +89,7 @@ interface HaileProvider {
|
|
|
65
89
|
declare const HAILE_MAGIC = "vg.haile.v1";
|
|
66
90
|
declare const HAILE_TAXONOMY = "haile.taxonomy.v1";
|
|
67
91
|
declare const HAILE_IR = "haile.ir.v1";
|
|
68
|
-
declare const HAILE_ENGINE_VERSION = "haile-fast/
|
|
92
|
+
declare const HAILE_ENGINE_VERSION = "haile-fast/2026.903.3";
|
|
69
93
|
declare const DEFAULT_PROFILE: HaileProfile;
|
|
70
94
|
declare const DEFAULT_SYMBOL_CAP = 8000;
|
|
71
95
|
|
|
@@ -101,10 +125,14 @@ interface GraphNodeLike {
|
|
|
101
125
|
file: string;
|
|
102
126
|
lang?: string;
|
|
103
127
|
signature?: string;
|
|
128
|
+
/** Decorators above a Python `def` (vg-graph ≥ 1.1, additive): `@router.post("/login")`. */
|
|
129
|
+
decorators?: string;
|
|
104
130
|
/** Short leading doc-comment / docstring summary (vg-graph ≥ 1.1). */
|
|
105
131
|
doc?: string;
|
|
106
132
|
/** Body effect profile (vg-graph ≥ 1.1, additive). */
|
|
107
133
|
effects?: Record<string, number | string[]>;
|
|
134
|
+
/** Ordered duty IR (vg-graph ≥ 1.1, additive). */
|
|
135
|
+
duties?: unknown[];
|
|
108
136
|
}
|
|
109
137
|
interface GraphEdgeLike {
|
|
110
138
|
kind: string;
|
|
@@ -135,6 +163,8 @@ interface HaileCallable {
|
|
|
135
163
|
imports: string[];
|
|
136
164
|
/** Body effect profile, passed through untouched. */
|
|
137
165
|
effects?: Record<string, number | string[]>;
|
|
166
|
+
/** Duty IR rows, passed through untouched (the kernel validates them). */
|
|
167
|
+
duties?: unknown[];
|
|
138
168
|
}
|
|
139
169
|
declare function isCallableKind(kind: string): boolean;
|
|
140
170
|
declare function symbolKindOf(kind: string): string;
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{pathToFileURL as X}from"node:url";import*as y from"node:fs";import*as
|
|
2
|
-
`),1;if(!
|
|
3
|
-
`),1;let i=O(
|
|
4
|
-
`),1;let s=O(
|
|
5
|
-
`),1;let f=s,
|
|
6
|
-
`),1;let e;try{let
|
|
7
|
-
`),1;e=JSON.parse(
|
|
8
|
-
`),1}let
|
|
9
|
-
`),y.renameSync(
|
|
10
|
-
`),1}return 0}function z(){let
|
|
1
|
+
import{pathToFileURL as X}from"node:url";import*as y from"node:fs";import*as _ from"node:path";var v="vg.haile.v1",w="haile.taxonomy.v1",H="haile.ir.v1",g="haile-fast/2026.903.3",A="balanced",x=8e3,P=new Set(["function","method","route","test","component","job"]);var R=240,K=400,T=16,G=32,W=new Set(["public","private","protected","internal","static","async","override","virtual","abstract","final","def","fn","function","func","sub","pub","export","const","let","var","new","sealed","extern","unsafe","readonly","partial","default","synchronized","native","inline","constexpr","friend","explicit","operator","suspend","open","lateinit","get","set"]);function N(r){return P.has(r)}function C(r){switch(r){case"method":return"method";case"route":return"route";case"test":return"test";case"job":return"job";case"component":return"handler";default:return"function"}}function M(r,t=""){let i=t?r.indexOf(`${t}(`):-1;if(i<0&&(r.startsWith("@")||r.startsWith("[")))return[];let s=i>=0?i+t.length:r.indexOf("("),f=r.lastIndexOf(")");if(s<0||f<=s)return[];let n=r.slice(s+1,f).trim();return!n||n==="void"?[]:n.split(",").map(e=>e.trim()).filter(Boolean).slice(0,16).map(e=>{let l=e.replace(/\b(const|mut|ref|public|private|protected|readonly|final)\b/g,"").trim();if(l.includes(":")){let[a,d]=l.split(":").map(p=>p.trim());return{name:a||"arg",type_name:d||void 0}}let c=l.split(/\s+/);return c.length>=2?{name:c[c.length-1],type_name:c[0]}:{name:l}})}function D(r,t){let i=r.lastIndexOf("->");if(i>=0)return r.slice(i+2).replace(/[{;].*$/,"").trim()||void 0;let s=r.lastIndexOf(":"),f=r.lastIndexOf(")");if(s>f&&f>=0)return r.slice(s+1).replace(/[{;].*$/,"").replace(/\s*=>.*$/,"").trim()||void 0;let n=t?r.indexOf(`${t}(`):-1;if(n>0){let e=r.slice(0,n).trim(),l=0,c=0;for(let d=e.length-1;d>=0;d--){let p=e[d];if(p===">"||p==="]"||p===")")l++;else if(p==="<"||p==="["||p==="(")l--;else if(/\s/.test(p)&&l===0){c=d+1;break}}let a=e.slice(c).trim();if(a&&!a.startsWith("@")&&!a.startsWith("[")&&!W.has(a)&&a!=="void"&&!a.endsWith(")")&&!a.endsWith("]"))return a}}function F(r,t,i,s){let f=[],n=[],e=new Set,l=new Set;for(let c of t){if(c.src!==r||c.kind!=="call"&&c.kind!=="references")continue;let a=i.get(c.dst);if(!a)continue;let d=a.qualifiedName||a.name;if(!(!d||e.has(d))&&(e.add(d),f.push(d),a.file&&a.file!==s&&!l.has(a.file)&&n.length<T&&(l.add(a.file),n.push(a.file)),f.length>=24))break}return{calls:f,calleePaths:n}}function U(r,t,i){let s=new Map;for(let n of r)(n.kind==="file"||n.kind==="module")&&s.set(n.id,n.file);let f=new Map;for(let n of t){if(n.kind!=="import")continue;let e=s.get(n.src);if(!e)continue;let l=i.get(n.dst),c=l?.qualifiedName||l?.name;if(!c)continue;let a=f.get(e);a||(a=[],f.set(e,a)),a.length<G&&!a.includes(c)&&a.push(c)}return f}function I(r){let t=r.nodes??[],i=r.edges??[],s=new Map;for(let e of t)s.set(e.id,e);let f=U(t,i,s),n=[];for(let e of t){if(!N(e.kind))continue;let l=typeof e.decorators=="string"?e.decorators.trim():"",c=`${l?`${l} `:""}${e.signature??""}`.slice(0,K),{calls:a,calleePaths:d}=F(e.id,i,s,e.file),p=typeof e.doc=="string"?e.doc.trim().slice(0,R):"";n.push({node_id:e.id,file_path:e.file,name:e.name,qualified_name:e.qualifiedName||e.name,symbol_kind:C(e.kind),language:e.lang??"",signature:c,calls:a,parameters:M(c,e.name),return_type:D(c,e.name),...p?{doc:p}:{},callee_paths:d,imports:f.get(e.file)??[],...e.effects&&typeof e.effects=="object"?{effects:e.effects}:{},...Array.isArray(e.duties)?{duties:e.duties.slice(0,48)}:{}})}return n.sort((e,l)=>e.node_id<l.node_id?-1:e.node_id>l.node_id?1:0),n}import*as b from"node:fs";import{fileURLToPath as q}from"node:url";var m;function $(){return[new URL("./engine/haile.wasm",import.meta.url),new URL("../engine/haile.wasm",import.meta.url),new URL("../crate/target/wasm32-unknown-unknown/release/vibgrate_haile_kernel.wasm",import.meta.url)].map(r=>q(r))}function j(r){try{let t=new WebAssembly.Module(r),s=new WebAssembly.Instance(t,{}).exports;if(typeof s.vg_alloc!="function"||typeof s.vg_free!="function"||typeof s.vg_version!="function"||typeof s.vg_classify!="function"||!s.memory)return null;let f=e=>{let l=new TextEncoder().encode(e),c=s.vg_alloc(l.length);return new Uint8Array(s.memory.buffer,c,l.length).set(l),{ptr:c,len:l.length}},n=e=>{if(!e)return"";let l=new DataView(s.memory.buffer,e,4).getUint32(0,!0),c=new TextDecoder().decode(new Uint8Array(s.memory.buffer,e+4,l));return s.vg_free(e,4+l),c};return{version:()=>{try{return n(s.vg_version())||g}catch{return g}},classifyJson:e=>{let l=JSON.stringify({name:e.name??"",path:e.path??"",symbolKind:e.symbolKind??"function",fileKind:e.fileKind??"source",calls:e.calls??[],types:e.types??[],idents:e.idents??[],profile:e.profile??"balanced",qualifiedName:e.qualifiedName??"",doc:e.doc??"",signature:e.signature??"",params:e.params??[],returnType:e.returnType??"",calleePaths:e.calleePaths??[],imports:e.imports??[],astRole:e.astRole??"",effects:e.effects??{},duties:e.duties??[]}),{ptr:c,len:a}=f(l);try{return n(s.vg_classify(c,a))}finally{s.vg_free(c,a)}}}}catch{return null}}function E(){if(m!==void 0)return m;m=null;try{let r=$().find(t=>b.existsSync(t));return r&&(m=j(b.readFileSync(r))),m}catch{return m=null,m}}function B(){m=void 0}function S(r){return Array.isArray(r)?r.filter(t=>typeof t=="string"):[]}function J(r){if(!r)return null;try{let t=JSON.parse(r);if(!t||typeof t!="object")return null;let i=t.role&&typeof t.role=="object"?t.role:t,s=typeof i.primary=="string"?i.primary:"";if(!s)return null;let f=t.intent&&typeof t.intent=="object"?t.intent:{};return{primary:s,confidence:typeof i.confidence=="number"?i.confidence:0,band:typeof i.band=="string"?i.band:"abstain",alternatives:Array.isArray(i.alternatives)?i.alternatives.filter(n=>typeof n?.role=="string").map(n=>({role:n.role,confidence:typeof n.confidence=="number"?n.confidence:0})):[],purposes:Array.isArray(t.purposes)?t.purposes.filter(n=>typeof n?.purpose=="string").map(n=>({purpose:n.purpose,confidence:typeof n.confidence=="number"?n.confidence:0})):[],intent:{text:typeof f.text=="string"?f.text:"",verbs:S(f.verbs),objects:S(f.objects)},findings:Array.isArray(t.findings)?t.findings.filter(n=>typeof n?.rule=="string"&&typeof n?.message=="string").map(n=>({rule:n.rule,severity:typeof n.severity=="string"?n.severity:"warn",message:n.message})).slice(0,8):[],evidence:Array.isArray(t.evidence)?t.evidence.filter(n=>typeof n?.kind=="string"&&typeof n?.signal=="string").map(n=>({kind:n.kind,signal:n.signal,weight:typeof n.weight=="number"?n.weight:0})):[]}}catch{return null}}function L(r){let t=r===void 0?E():r;return t?{version:()=>t.version(),classify:i=>{try{return J(t.classifyJson(i))}catch{return null}}}:null}var V=new Set(["strict","balanced","exploratory"]);function O(r,t){let i=r.indexOf(t);if(!(i<0||i+1>=r.length))return r[i+1]}function Y(){return new Promise((r,t)=>{let i=[];process.stdin.on("data",s=>i.push(Buffer.from(s))),process.stdin.on("end",()=>r(Buffer.concat(i).toString("utf8"))),process.stdin.on("error",t)})}async function k(r=process.argv.slice(2),t={}){if(r[0]!=="sidecar")return process.stderr.write(`usage: node index.js sidecar --stdin --out <file> --profile <strict|balanced|exploratory>
|
|
2
|
+
`),1;if(!r.includes("--stdin"))return process.stderr.write(`sidecar requires --stdin
|
|
3
|
+
`),1;let i=O(r,"--out");if(!i)return process.stderr.write(`sidecar requires --out <file>
|
|
4
|
+
`),1;let s=O(r,"--profile")??A;if(!V.has(s))return process.stderr.write(`invalid --profile ${s}
|
|
5
|
+
`),1;let f=s,n=t.provider===void 0?L():t.provider;if(!n)return process.stderr.write(`architecture kernel wasm missing \u2014 refusing to classify
|
|
6
|
+
`),1;let e;try{let o=(await(t.readInput??Y)()).trim();if(!o)return process.stderr.write(`sidecar stdin was empty
|
|
7
|
+
`),1;e=JSON.parse(o)}catch{return process.stderr.write(`sidecar stdin was not valid JSON
|
|
8
|
+
`),1}let l=I({nodes:Array.isArray(e.nodes)?e.nodes:[],edges:Array.isArray(e.edges)?e.edges:[]}),c=n.version()||g,a=[],d=!1;for(let o of l){if(a.length>=8e3){d=!0;break}let u=n.classify({name:o.name,path:o.file_path,symbolKind:o.symbol_kind,fileKind:"source",calls:o.calls,types:[...o.parameters.map(h=>h.type_name).filter(h=>!!h),...o.return_type?[o.return_type]:[]],idents:[o.name,...o.calls].slice(0,24),profile:f,qualifiedName:o.qualified_name,doc:o.doc??"",signature:o.signature,params:o.parameters.map(h=>h.name),returnType:o.return_type??"",calleePaths:o.callee_paths,imports:o.imports,...o.ast_role?{astRole:o.ast_role}:{},...o.effects?{effects:o.effects}:{},...o.duties?{duties:o.duties}:{}});u&&a.push({node_id:o.node_id,file_path:o.file_path,name:o.name,qualified_name:o.qualified_name,symbol_kind:o.symbol_kind,role:{primary:u.primary,alternatives:u.alternatives,confidence:u.confidence,band:u.band},purposes:u.purposes,intent:u.intent,evidence:u.evidence,...u.findings.length?{findings:u.findings}:{}})}let p={magic:v,taxonomy:w,ir:H,corpus_hash:e.provenance?.corpusHash??"",engine_version:c,profile:f,symbols:a,...d?{symbols_capped:!0}:{}};try{y.mkdirSync(_.dirname(_.resolve(i)),{recursive:!0});let o=`${i}.${process.pid}.tmp`;y.writeFileSync(o,`${JSON.stringify(p)}
|
|
9
|
+
`),y.renameSync(o,i)}catch{return process.stderr.write(`sidecar failed to write ${i}
|
|
10
|
+
`),1}return 0}function z(){let r=process.argv[1];if(!r)return!1;try{return import.meta.url===X(r).href}catch{return!1}}z()&&k().then(r=>{process.exit(r)});export{A as DEFAULT_PROFILE,x as DEFAULT_SYMBOL_CAP,g as HAILE_ENGINE_VERSION,H as HAILE_IR,v as HAILE_MAGIC,w as HAILE_TAXONOMY,I as adaptGraph,L as createHaileProvider,N as isCallableKind,E as loadWasmHaileKernel,B as resetWasmHaileKernelCache,k as runSidecarCli,C as symbolKindOf};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibgrate/haile",
|
|
3
|
-
"version": "2026.903.
|
|
3
|
+
"version": "2026.903.3",
|
|
4
4
|
"description": "Vibgrate HAILE architecture kernel: deterministic callable classification (role, purposes, intent, band) over a vg-graph. Proprietary distribution — compiled WASM engine plus a minified loader; the taxonomy is not included.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"type": "module",
|