@aliip/pilah 0.0.0-stage → 1.0.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 (84) hide show
  1. package/BUILD_STATUS.md +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +108 -2
  4. package/assets/logo.svg +5 -0
  5. package/docs/ACCEPTANCE_GATE.md +41 -0
  6. package/docs/ADAPTIVE_RCA_WORKFLOW.md +93 -0
  7. package/docs/AGENT_DECISION_REVIEW.md +17 -0
  8. package/docs/ALWAYS_ON_5_WHYS.md +75 -0
  9. package/docs/ARCHITECTURE.md +43 -0
  10. package/docs/BEHAVIORAL_5_WHYS_V2_0_1.md +117 -0
  11. package/docs/CHECKPOINT_RECOVERY.md +86 -0
  12. package/docs/CI_EFFICIENCY.md +63 -0
  13. package/docs/COMPATIBILITY.md +84 -0
  14. package/docs/CONTRACTS.md +177 -0
  15. package/docs/CONVERSATION_USAGE.md +52 -0
  16. package/docs/ENGINEERING_METHOD.md +68 -0
  17. package/docs/HOST_VALIDATION.md +35 -0
  18. package/docs/INDEPENDENT_ACCEPTANCE_RUNBOOK.md +72 -0
  19. package/docs/INTERVENTION_LEDGER.md +25 -0
  20. package/docs/MAIN_VALIDATION_BACKLOG.md +19 -0
  21. package/docs/NATIVE_FIRST_WORKFLOW.md +27 -0
  22. package/docs/OPEN_SOURCE_ENGINEERING_STANDARDS.md +62 -0
  23. package/docs/ORCHESTRATION_ADVISOR.md +36 -0
  24. package/docs/PRE_VNEXT_INTEGRATION.md +27 -0
  25. package/docs/README.md +54 -0
  26. package/docs/RELEASE.md +33 -0
  27. package/docs/RELEASE_AUTHORIZATION.md +33 -0
  28. package/docs/RISK_GUIDANCE.md +18 -0
  29. package/docs/SECURITY.md +76 -0
  30. package/docs/SECURITY_RELIABILITY_AUDIT_V2_0_1.md +55 -0
  31. package/docs/SEMANTIC_EVIDENCE.md +27 -0
  32. package/docs/SOURCES.md +13 -0
  33. package/docs/TOKEN_EFFICIENCY.md +71 -0
  34. package/docs/TOKEN_PROVENANCE.md +15 -0
  35. package/docs/V2_0_1_TRACEABILITY.md +66 -0
  36. package/hooks.json +45 -0
  37. package/mcp_config.json +16 -0
  38. package/package.json +31 -4
  39. package/plugin.json +27 -0
  40. package/rules/AGENTS.md +2 -0
  41. package/schemas/database.sql +84 -0
  42. package/schemas/mcp-tools.json +552 -0
  43. package/scripts/a2a.mjs +344 -0
  44. package/scripts/check-release.mjs +42 -0
  45. package/scripts/check-syntax.mjs +30 -0
  46. package/scripts/checkpoint.mjs +50 -0
  47. package/scripts/compare-agent-traces.mjs +53 -0
  48. package/scripts/context-guardian.mjs +132 -0
  49. package/scripts/evaluate-acceptance.mjs +110 -0
  50. package/scripts/export-benchmark.mjs +31 -0
  51. package/scripts/generate-contracts.mjs +6 -0
  52. package/scripts/hook.mjs +406 -0
  53. package/scripts/host-check.mjs +40 -0
  54. package/scripts/intervention-ledger.mjs +94 -0
  55. package/scripts/pilah.mjs +3 -0
  56. package/scripts/release-authorization.mjs +137 -0
  57. package/scripts/review-agent-decisions.mjs +34 -0
  58. package/scripts/semantic-evidence.mjs +15 -0
  59. package/scripts/verifykit.mjs +3 -0
  60. package/skills/pilah/SKILL.md +24 -0
  61. package/src/acceptance-matrix.mjs +84 -0
  62. package/src/browser-evidence.mjs +40 -0
  63. package/src/context-health.mjs +14 -0
  64. package/src/conversations.mjs +302 -0
  65. package/src/engine.mjs +494 -0
  66. package/src/graph.mjs +169 -0
  67. package/src/mcp-diagnostics.mjs +53 -0
  68. package/src/mcp.mjs +151 -0
  69. package/src/model-recovery.mjs +108 -0
  70. package/src/native-tool-recovery.mjs +45 -0
  71. package/src/node-runtime.mjs +13 -0
  72. package/src/orchestration-advisor.mjs +24 -0
  73. package/src/rca.mjs +174 -0
  74. package/src/risk-guidance.mjs +95 -0
  75. package/src/scanner.mjs +303 -0
  76. package/src/security.mjs +793 -0
  77. package/src/semantic-evidence.mjs +144 -0
  78. package/src/skill-discovery.mjs +23 -0
  79. package/src/sqlite-compat.mjs +11 -0
  80. package/src/storage.mjs +455 -0
  81. package/src/tokens.mjs +627 -0
  82. package/src/tools.mjs +164 -0
  83. package/src/verification.mjs +567 -0
  84. package/src/workflow-router.mjs +34 -0
@@ -0,0 +1,302 @@
1
+ // Historical Antigravity usage reader. Purely local, read-only, and metadata-only.
2
+ // Internal transcript token counters are not provider-verified billing figures.
3
+ import fs from 'node:fs';
4
+ import {getHomeDir} from './security.mjs';
5
+ import path from 'node:path';
6
+ import {parseOfficialAgyUsage} from './tokens.mjs';
7
+
8
+ const VALID_ID=/^[a-zA-Z0-9._-]{4,128}$/;
9
+ const safeCount=v=>Number.isSafeInteger(v)&&v>=0?v:0;
10
+ const blank=()=>({input:0,cache:0,output:0,steps:0,tools:0,a2a:0});
11
+ function add(a,b){for(const k of Object.keys(a))a[k]+=b[k]||0}
12
+ export function localBrainRoots(){
13
+ return process.env.ANTIGRAVITY_APP_DATA_DIR
14
+ ? [path.join(path.resolve(process.env.ANTIGRAVITY_APP_DATA_DIR),'brain')]
15
+ : ['antigravity','antigravity-cli','antigravity-ide'].map(n=>path.join(getHomeDir(),'.gemini',n,'brain'));
16
+ }
17
+ const A2A_TOOL_NAMES=new Set(['pilah_context','pilah_impact','pilah_verify','pilah_evidence','a2a_context','a2a_impact','a2a_verify','a2a_evidence',
18
+ 'verifykit_context','verifykit_impact','verifykit_verify','verifykit_evidence']);
19
+ const A2A_SERVERS=new Set(['pilah','pilah_pilah','a2a','a2a_a2a','verifykit','verifykit_verifykit']);
20
+ const normalized=M=>String(M??'').trim().replace(/^["']|["']$/g,'');
21
+ function isA2ACall(tc){
22
+ const name=normalized(tc?.name||tc?.toolName);
23
+ const explicitServer=normalized(tc?.args?.ServerName??tc?.args?.server_name??tc?.serverName??tc?.server_name);
24
+ if(A2A_TOOL_NAMES.has(name))return !explicitServer||A2A_SERVERS.has(explicitServer);
25
+ for(const server of A2A_SERVERS){
26
+ for(const tool of A2A_TOOL_NAMES){
27
+ if(name===`mcp_${server}_${tool}`||name===`mcp__${server}__${tool}`||
28
+ name===`${server}/${tool}`)return true;
29
+ }
30
+ }
31
+ if(name==='call_mcp_tool'){
32
+ const server=normalized(tc?.args?.ServerName??tc?.args?.server_name);
33
+ const tool=normalized(tc?.args?.ToolName??tc?.args?.tool_name);
34
+ return A2A_SERVERS.has(server)&&A2A_TOOL_NAMES.has(tool);
35
+ }
36
+ // This counter measures actual A2A MCP use, not a CLI diagnostics call.
37
+ return false;
38
+ }
39
+ function safeLog(file,root){
40
+ try{
41
+ const base=fs.realpathSync(root),requested=path.resolve(file),rel=path.relative(path.resolve(root),requested);
42
+ if(!rel||rel==='..'||rel.startsWith('..'+path.sep)||path.isAbsolute(rel))return false;
43
+ let cursor=path.resolve(root);
44
+ for(const segment of rel.split(path.sep)){
45
+ cursor=path.join(cursor,segment);
46
+ if(fs.lstatSync(cursor).isSymbolicLink())return false;
47
+ }
48
+ const real=fs.realpathSync(requested);
49
+ return path.relative(base,real)===rel&&fs.statSync(real).isFile();
50
+ }catch{return false}
51
+ }
52
+ function parseLocalLog(file,id){
53
+ const byStep=new Map(),loose=[];
54
+ let userTurns=0,model=null,last=null,official=null,lines=0,bad=0,tooLong=0,subagent=false,partial=false;
55
+ const userSeen=new Set();
56
+ function consume(line){
57
+ if(++lines>150000){partial=true;return}
58
+ if(line.length>1024*1024){tooLong++;partial=true;return}
59
+ if(line.includes('<subagent_reminder>'))subagent=true;
60
+ let x;try{x=JSON.parse(line)}catch{bad++;partial=true;return}
61
+ if(!x||typeof x!=='object')return;
62
+ if(x.model&&typeof x.model==='string')model=x.model.slice(0,100);
63
+ if(x.event==='result'){
64
+ try{
65
+ const p=parseOfficialAgyUsage(x);
66
+ if(p.conversation_id===id&&(!official||p.usage.total_tokens>=official.usage.total_tokens))official=p;
67
+ }catch{}
68
+ }else if(x?.usage?.total_tokens!==undefined&&x.conversation_id===id){
69
+ try{
70
+ const p=parseOfficialAgyUsage(x);
71
+ if(!official||p.usage.total_tokens>=official.usage.total_tokens)official=p;
72
+ }catch{}
73
+ }
74
+ if(x.type==='USER_INPUT'){
75
+ if(Number.isSafeInteger(x.step_index)){if(!userSeen.has(x.step_index)){userTurns++;userSeen.add(x.step_index)}}
76
+ else userTurns++;
77
+ }
78
+ if(x.type!=='PLANNER_RESPONSE'&&!(x.input_tokens!==undefined&&!x.type))return;
79
+ const calls=Array.isArray(x.tool_calls)?x.tool_calls.slice(0,2000):[];
80
+ const c={input:safeCount(x.input_tokens),cache:safeCount(x.cache_read_tokens),
81
+ output:safeCount(x.output_tokens),steps:1,tools:calls.length,a2a:calls.filter(isA2ACall).length};
82
+ last={input:c.input,cache:c.cache,output:c.output};
83
+ if(Number.isSafeInteger(x.step_index)){
84
+ if(byStep.size<50000||byStep.has(x.step_index))byStep.set(x.step_index,c);
85
+ else partial=true;
86
+ }else if(loose.length<50000)loose.push(c);
87
+ else partial=true;
88
+ }
89
+ // Stream through a bounded buffer, without loading prompts or transcripts into a database.
90
+ const fd=fs.openSync(file,'r'),buf=Buffer.alloc(65536),decoder=new TextDecoder('utf-8');
91
+ try{
92
+ let tail='',size=0;
93
+ while(!partial){
94
+ const n=fs.readSync(fd,buf,0,buf.length,null);
95
+ if(!n)break;
96
+ size+=n;
97
+ if(size>128*1024*1024){partial=true;break}
98
+ const bits=(tail+decoder.decode(buf.subarray(0,n),{stream:true})).split('\n');
99
+ tail=bits.pop()||'';
100
+ for(const bit of bits){consume(bit.replace(/\r$/,''));if(partial)break}
101
+ if(tail.length>1024*1024){tooLong++;partial=true;break}
102
+ }
103
+ tail+=decoder.decode();
104
+ if(!partial&&tail.trim())consume(tail);
105
+ }finally{fs.closeSync(fd)}
106
+ const totals=blank();
107
+ for(const v of byStep.values())add(totals,v);
108
+ for(const v of loose)add(totals,v);
109
+ return {id,model,official,totals,last,userTurns,subagent,lines,bad,tooLong,complete:!partial};
110
+ }
111
+ function activeConversationId(base){
112
+ if(!base)return null;
113
+ try{
114
+ const file=path.join(base,'active-session.json');
115
+ if(!fs.lstatSync(file).isFile()||fs.statSync(file).size>131072)return null;
116
+ const id=JSON.parse(fs.readFileSync(file,'utf8'))?.latest?.conversationId;
117
+ return typeof id==='string'&&VALID_ID.test(id)?id:null;
118
+ }catch{return null}
119
+ }
120
+ function view(r){
121
+ return {
122
+ conversation_id:r.id,short_id:r.id.slice(0,8),last_modified:r.date,active:r.active,
123
+ model:r.model,subagent:r.subagent,steps:r.totals.steps,user_turns:r.userTurns,
124
+ a2a_calls:r.totals.a2a,tool_calls:r.totals.tools,complete:r.complete,
125
+ official_tokens:r.official?.usage?.total_tokens??null,
126
+ local_counters:r.official?null:{input:r.totals.input,cache:r.totals.cache,output:r.totals.output},
127
+ latest_step:r.last,
128
+ };
129
+ }
130
+ export function scanConversationHistory({brainRoots=localBrainRoots(),dataDirPath=null,limit=10,
131
+ includeSubagents=false,conversationId=null,onlyLatest=false,officialRuns=[],maxConversations=3000,maxTotalBytes=1024*1024*1024}={}){
132
+ const active=activeConversationId(dataDirPath),records=new Map();
133
+ const warnings=[];
134
+ let found=0,skipped=0,bytes=0,partial=0;
135
+ const candidates=[];
136
+ for(const dir of [...new Set(brainRoots.map(x=>path.resolve(x)))]) {
137
+ let root,entries;
138
+ try{
139
+ if(!fs.lstatSync(dir).isDirectory())continue;
140
+ root=fs.realpathSync(dir);entries=fs.readdirSync(root,{withFileTypes:true});
141
+ }catch{continue}
142
+ for(const entry of entries){
143
+ if(!entry.isDirectory()||!VALID_ID.test(entry.name))continue;
144
+ if(conversationId&&entry.name!==conversationId)continue;
145
+ found++;
146
+ if(found>maxConversations){skipped++;continue}
147
+ const file=path.join(root,entry.name,'.system_generated','logs','transcript.jsonl');
148
+ if(!safeLog(file,root))continue;
149
+ try{
150
+ const stat=fs.statSync(file);
151
+ candidates.push({id:entry.name,file,stat});
152
+ }catch{skipped++}
153
+ }
154
+ }
155
+ // A request for the current session should not read all historical transcripts.
156
+ // Stat the directories, prefer the active hook session, then the freshest file.
157
+ if(onlyLatest){
158
+ candidates.sort((a,b)=>Number(b.id===active)-Number(a.id===active)||b.stat.mtimeMs-a.stat.mtimeMs);
159
+ candidates.splice(1);
160
+ }
161
+ for(const candidate of candidates){
162
+ const {id,file,stat}=candidate;
163
+ if(stat.size>128*1024*1024||bytes+stat.size>maxTotalBytes){skipped++;continue}
164
+ try{
165
+ bytes+=stat.size;
166
+ const r=parseLocalLog(file,id);
167
+ if(!r.complete)partial++;
168
+ const value={...r,date:stat.mtime.toISOString(),mtime:stat.mtimeMs,active:id===active};
169
+ if(!records.has(id)||records.get(id).mtime<value.mtime)records.set(id,value);
170
+ }catch{skipped++}
171
+ }
172
+ // User-supplied official result supersedes, rather than double-counts, an internal transcript.
173
+ for(const report of officialRuns){
174
+ if(!report?.usage||!VALID_ID.test(report.conversation_id||''))continue;
175
+ const r=records.get(report.conversation_id);
176
+ if(r)r.official=report;
177
+ else records.set(report.conversation_id,{id:report.conversation_id,model:null,official:report,
178
+ totals:blank(),last:null,userTurns:report.num_turns||0,subagent:false,complete:true,
179
+ date:null,mtime:0,active:report.conversation_id===active});
180
+ }
181
+ const all=[...records.values()].sort((a,b)=>Number(b.active)-Number(a.active)||b.mtime-a.mtime);
182
+ const sessions=all.filter(r=>(includeSubagents||!r.subagent)&&(!conversationId||r.id===conversationId));
183
+ const internal=blank();
184
+ let official=0,officialInput=0,officialOutput=0,officialCache=0,officialSessions=0,
185
+ internalSessions=0,noCounts=0;
186
+ for(const r of sessions){
187
+ if(r.official){
188
+ officialSessions++;official+=r.official.usage.total_tokens;
189
+ officialInput+=r.official.usage.input_tokens;officialOutput+=r.official.usage.output_tokens;
190
+ officialCache+=r.official.usage.cache_read_tokens||0;
191
+ }else if(r.totals.steps){internalSessions++;add(internal,r.totals)}
192
+ else noCounts++;
193
+ }
194
+ if(skipped)warnings.push('Some files could not be read or exceeded scan limits. This report may not include your entire history.');
195
+ if(partial)warnings.push('Some conversation logs are damaged or incomplete, so their local counts may be partial.');
196
+ if(!sessions.length)warnings.push('No readable conversations were found in the local Antigravity history.');
197
+ const subagentSessions=sessions.filter(r=>r.subagent);
198
+ const parentSessions=sessions.filter(r=>!r.subagent);
199
+ if(subagentSessions.length)warnings.push('Included worker/subagent logs may overlap parent conversation usage. Do not add worker totals to parent totals or interpret their sum as billing.');
200
+ const usageAccounting={
201
+ source_priority:['official-cli-result','internal-local-log','unknown'],
202
+ official_conversations:officialSessions,
203
+ internal_only_conversations:internalSessions,
204
+ conversations_missing_counts:noCounts,
205
+ parent_conversations:parentSessions.length,
206
+ worker_conversations:subagentSessions.length,
207
+ overlapping_worker_accounting:subagentSessions.length?'possible':'excluded-from-aggregate',
208
+ safe_to_combine_worker_and_parent_totals:subagentSessions.length===0,
209
+ missing_or_partial_records:skipped+partial,
210
+ pilah_calls_detected:sessions.reduce((n,r)=>n+r.totals.a2a,0),
211
+ a2a_calls_detected:sessions.reduce((n,r)=>n+r.totals.a2a,0), // compatibility
212
+ a2a_attributable_model_tokens:null,
213
+ current_in_progress_step_tokens:null,
214
+ weekly_quota_consumption:null,
215
+ measured_token_savings:null,
216
+ note:'Tool-call frequency is observable; model tokens caused by PILAH are not independently attributable. Free Tier quota is not a fixed token budget.'
217
+ };
218
+ const last=sessions[0]||null;
219
+ return {
220
+ title:'Antigravity conversation token usage',
221
+ status:skipped||partial?'partial':'available_local_history',
222
+ scans:{found_dirs:found,conversations:sessions.length,skipped,partial,bytes_scanned:bytes,
223
+ excluded_subagents:all.filter(r=>r.subagent).length},
224
+ official_usage:{conversations:officialSessions,total_tokens:officialSessions?official:null,
225
+ input_tokens:officialSessions?officialInput:null,output_tokens:officialSessions?officialOutput:null,
226
+ cache_read_tokens:officialSessions?officialCache:null,
227
+ note:'Only conversations with an official Antigravity usage report are included in this confirmed total.'},
228
+ historical_log_counters:{conversations:internalSessions,input:internal.input,
229
+ cache_read:internal.cache,output:internal.output,
230
+ alternative_total_if_cache_included:internal.input+internal.output,
231
+ alternative_total_if_cache_separate:internal.input+internal.cache+internal.output,
232
+ note:'These are counters found in older local logs. Cache accounting is undocumented; neither interpretation is a confirmed usage total or bill.'},
233
+ latest_conversation:last?view(last):null,
234
+ recent_conversations:sessions.slice(0,Math.min(30,Math.max(1,limit))).map(view),
235
+ pilah_calls_seen:sessions.reduce((n,r)=>n+r.totals.a2a,0),
236
+ a2a_calls_seen:sessions.reduce((n,r)=>n+r.totals.a2a,0), // compatibility
237
+ conversations_without_counts:noCounts,
238
+ usage_accounting:usageAccounting,
239
+ self_report:{current_invocation:1,response_bytes:null,estimated_text_tokens:null,
240
+ included_in_model_usage:false,note:'Running this report does not call Gemini. If an AI agent reads it, any additional model usage can only be observed after the model turn completes.'},
241
+ warnings,
242
+ };
243
+ }
244
+ export function formatConversationReport(r){
245
+ const num=x=>Number(x||0).toLocaleString('en-US');
246
+ const official=r.official_usage,logs=r.historical_log_counters,last=r.latest_conversation;
247
+ const lines=[
248
+ 'PILAH | Conversation Token Usage',
249
+ '-----------------------------------',
250
+ 'Conversations found: '+num(r.scans.conversations)+' (including chats from before PILAH was installed).',
251
+ '',
252
+ 'Confirmed by Antigravity:',
253
+ official.conversations
254
+ ? '- '+num(official.total_tokens)+' tokens from '+num(official.conversations)+' conversations with official usage data.'
255
+ : '- No official token totals were available for these conversations.',
256
+ '',
257
+ 'From local conversation logs (not confirmed billing usage):',
258
+ '- '+num(logs.conversations)+' conversations | Input: '+num(logs.input)+' | Cache reads: '+num(logs.cache_read)+' | Output: '+num(logs.output),
259
+ '- If cache reads are already included in input: '+num(logs.alternative_total_if_cache_included)+' tokens.',
260
+ '- If cache reads are counted separately: '+num(logs.alternative_total_if_cache_separate)+' tokens.',
261
+ '- Both figures are interpretations of local logs, not confirmed totals.',
262
+ '- Workers included: '+(r.usage_accounting?.worker_conversations??0)+(r.usage_accounting?.overlapping_worker_accounting==='possible'?' (possible overlap; do not sum with parent)':' (excluded by default)'),
263
+ "- PILAH-specific model tokens: unknown; CLI counts do not isolate the plugin's contribution.",
264
+ '',
265
+ ];
266
+ if(last){
267
+ lines.push('Latest conversation: '+last.short_id+(last.active?' (marked active)':' (most recently updated)'));
268
+ lines.push('- Model: '+(last.model||'not recorded')+' | Model steps: '+num(last.steps)+' | Tool calls: '+num(last.tool_calls));
269
+ if(last.official_tokens!==null)lines.push('- Official usage: '+num(last.official_tokens)+' tokens.');
270
+ else if(last.latest_step){
271
+ lines.push('- Latest completed step: Input '+num(last.latest_step.input)+', Cache reads '+num(last.latest_step.cache)+', Output '+num(last.latest_step.output)+' (local log counters).');
272
+ }
273
+ lines.push('');
274
+ }
275
+ lines.push('PILAH activity:');
276
+ lines.push('- A2A tool calls found in these logs: '+num(r.a2a_calls_seen)+'.');
277
+ lines.push('- Size of this report: about '+num(r.self_report.estimated_text_tokens)+' estimated text tokens ('+num(r.self_report.response_bytes)+' bytes).');
278
+ lines.push('- This is the report\'s approximate size, not tokens already billed by Gemini.');
279
+ if(r.recent_conversations.length){
280
+ lines.push('','Recent conversations:');
281
+ for(const c of r.recent_conversations.slice(0,10)){
282
+ const usage=c.official_tokens!==null
283
+ ? num(c.official_tokens)+' confirmed tokens'
284
+ : num(c.local_counters?.input)+' input / '+num(c.local_counters?.cache)+' cache-read (local logs)';
285
+ lines.push('- '+c.short_id+' | '+usage+(c.a2a_calls===0?' | No A2A tool calls found':''));
286
+ }
287
+ }
288
+ if(r.warnings.length)lines.push('','Notes: '+r.warnings.join(' '));
289
+ lines.push('','For confirmed run usage: a2a tokens --usage-file agy-result.json');
290
+ lines.push('Your conversations are read locally. Their contents are not copied or sent anywhere.');
291
+ return lines.join('\n');
292
+ }
293
+ export function attachReportSize(report,{format='text'}={}){
294
+ for(let i=0;i<6;i++){
295
+ const text=format==='json'?JSON.stringify(report,null,2):formatConversationReport(report);
296
+ const bytes=Buffer.byteLength(text,'utf8'),estimate=Math.max(1,Math.round(text.length/3.8));
297
+ if(report.self_report.response_bytes===bytes&&report.self_report.estimated_text_tokens===estimate)break;
298
+ report.self_report.response_bytes=bytes;
299
+ report.self_report.estimated_text_tokens=estimate;
300
+ }
301
+ return report;
302
+ }