coding-artifact-evaluation-shell 0.1.0-eidolon.a1b37cbcd7c07 → 0.1.0-eidolon.a40d355425c38

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/capsule.ts CHANGED
@@ -22,14 +22,12 @@ import {counterReview} from './support/counter-review';
22
22
  import {assertCodingScope,type CodingScope} from './coding-scope';
23
23
  import {projectTargetGroups} from './target-groups';
24
24
  import {retainEvaluation,assertRetentionDestination} from './support/retention';
25
- import {attachCodeKnowledgeEvidence,type CodeEvidenceSelection} from './support/code-knowledge';
26
- export {attachCodeKnowledgeEvidence,type CodeEvidenceSelection} from './support/code-knowledge';
27
25
  export {createCodexRuntime,type AgentRuntime} from './support/agent-runtime';
28
26
  export {retainEvaluation,verifyRetainedEvaluation} from './support/retention';
29
27
  export type {CodingScope} from './coding-scope';
30
28
 
31
29
  /** Runtime dependencies are trusted caller inputs, never discovered in delivered assets. */
32
- export interface EvaluationOptions {space?:number;judge?:JudgePort;budget?:Budget;noModel?:boolean;experimentalCounterReview?:boolean;agentRuntime?:AgentRuntime;judgeRuntime?:AgentRuntime;codingScope?:CodingScope;retainTo?:string;codeEvidence?:CodeEvidenceSelection}
30
+ export interface EvaluationOptions {space?:number;judge?:JudgePort;budget?:Budget;noModel?:boolean;experimentalCounterReview?:boolean;agentRuntime?:AgentRuntime;judgeRuntime?:AgentRuntime;codingScope?:CodingScope;retainTo?:string}
33
31
  interface ObservationRuntime {
34
32
  run:AgentRun;agent:AgentRuntime;state:ProcessState;budget:Budget;invocations:Invocation[];
35
33
  review?:JudgePort['review'];onProposal?:(proposal:Proposal)=>void;
@@ -104,7 +102,6 @@ export async function runEvaluation(manifest:Manifest,output:string,options:Eval
104
102
  if(options.retainTo)assertRetentionDestination(options.retainTo,[output,fs.realpathSync(manifest.artifact)]);
105
103
  if(options.experimentalCounterReview&&(options.noModel||options.judge))throw Error('Experimental counter-review requires the native model runtime');
106
104
  const run=prepareExecution(bindRuntime(createEvaluationRun(output,manifest.artifact),manifest.runtime),manifest.execution),agent=options.agentRuntime??resolveAgentRuntime('codex'),judgeAgent=options.judgeRuntime??agent,state={interrupted:false};
107
- if(options.codeEvidence)manifest=attachCodeKnowledgeEvidence({...manifest,artifact:run.workspace},options.codeEvidence);
108
105
  const ceiling=options.noModel?0:(manifest.agentObservation?6:2);
109
106
  const budget=options.budget??newBudget(Date.now(),ceiling,1200000);
110
107
  const sources=readSources(manifest.targets),artifactDigest=fingerprint(run.workspace),runId=randomUUID();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coding-artifact-evaluation-shell",
3
- "version": "0.1.0-eidolon.a1b37cbcd7c07",
3
+ "version": "0.1.0-eidolon.a40d355425c38",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Code-development artifact evaluator and code-first Halfcode SkillApp",
@@ -24,11 +24,3 @@ The dynamic Evidence, Check and Groups LocalFunctions are read-only tools over e
24
24
  For grouped results, the caller explicitly supplies `{id,label,rootIds}` entries selecting actual root obligation IDs from the admitted decision. Use `projectTargetGroups(input, decision, groups)` from the package, or discover the Groups LocalFunction and invoke it with absolute native `inputPath`, `decisionPath`, and `groups`. It reuses the original graph, shows ungrouped/shared roots, and preserves the overall result. Non-root/unknown selections are rejected for admitted decisions; unfinished or rejected drafts never yield partial PASS. There are no built-in domains or automatic categories. Labels do not certify unlisted requirements: a group of selected calculations is not proof of an entire product. Missing historical process evidence remains missing; a group view cannot supply it or repair a mistaken original judgment.
25
25
 
26
26
  For current coding runs, explicit nonempty `codingScope.groups` also asks the same judge to compare every applicable caller-owned leaf, including after an overall FAIL. It does not add a role, scoring protocol, evidence or new requirements. An absent claim is unreviewed, distinct from an explicit indeterminate claim. Historical and ungrouped minimal FAIL decisions retain their original meaning; completeness and semantic correctness still require actual evidence.
27
-
28
- Record the caller's intended scope and method/depth in its trusted codingScope description and capability declarations; report the work actually completed. The current description is retained caller metadata, not an automatic model-input field, execution profile or target filter: authoritative acceptance boundaries belong in the complete original targets, and actual grants/conditions in trusted capability inputs. See [Review](review.md) for the shared evidence-depth guidance used by both collection and judgment. The existing claim method/conditions/reasoning/limitations support scope, actual investigation, coverage and gaps; there is no new wire field or depth score. A code-review-only selection cannot certify an original full-delivery requirement left unobserved. Index/search tools are optional, explicitly supplied locators whose version, resolution and coverage must be checked against frozen source; they do not substitute for execution or unavailable historical facts.
29
-
30
- ## Optional code navigation evidence
31
-
32
- Trusted callers of `runCodingEvaluation` may supply `codeEvidence:{path,sourceRoot}` in options. Both paths are relative to their owned frozen artifact; the evidence JSON must be outside the selected source subtree. This selects the existing file observation channel, not a new judge or execution permission. The runner validates the complete raw-byte snapshot and coverage before a model call, reads the bounded navigation file, and back-reads its bounded UTF-8 candidate source files. With the option omitted, existing behavior is unchanged.
33
-
34
- The evidence can be produced by depa-knowledge-base.cs `tools/Depa.CodeEvidence`. It includes unsupported/excluded/oversize files, actual parser/resolvers, unresolved calls and omitted graph counts. Inspect these conditions when reasoning; source locations are candidates, missing hits do not prove absence, and paths establish no runtime or historical event. The adapter authenticates source binding and structure, not semantic correctness of a parser or all requirements. Keep the original complete targets and ordinary source/process/browser observations.
@@ -13,11 +13,3 @@ Goal → fact → comparison:
13
13
  Read COMPLETE originals first; preserve each independent qualifier, modality and quantifier. Exclusion is not all-member selection; do not transfer a qualifier between objects without a source relation. A neighboring attribute cannot satisfy another property. Split independent conditions under all/any instead of partially certifying a broad leaf. Compare the ACTUAL CONTENT of static deliverables, not their titles/existence. Challenge PASS: could cited facts remain unchanged if the required property were absent? Challenge absence FAIL: inspect the bounded candidate set and relevant alternative implementations/call sites; unread/uncited supplied facts are not unavailable; ambiguous wording cannot become a stronger mechanism requirement. No extra planning file is required.
14
14
  Evidence must distinguish the promised consumer PURPOSE, not just setup/access/empty state. Genuine tests count for what their real seams/assertions exercise: cite BOTH their definition and native execution; a replaced entrance is not proven even when other dependencies are real. Ask which required failure a test detects. Temporal/causal/lifecycle requirements need observations distinguishing those conditions, not final values alone. Free-text probe conditions describe intent; neither a word such as "settled" nor tool completion proves business completion. For absence require established prerequisites and an observed completion/deadline, not immediate silence: unknown completion means indeterminate; an unavailable environment prerequisite is not a business capability failure. Representative acceptance is finite sampling; disclose limits without waiving material conditions. No exhaustive branch checklist is required; equivalent observable semantics count unless originals mandate the form.
15
15
  Derive expected outcomes before comparison; artifact output, exit 0, coverage labels and self-assertions never define the goal. PASS needs all required conditions; FAIL needs an applicable original contradiction surviving valid alternative readings/implementations; missing or ambiguous evidence is indeterminate. Keep judgments consistent with comparisons and findings. Actual facts and finite sampling are not universal proofs.
16
-
17
- Describe evidence depth per comparison, using existing fields: `method` names what actually happened (source inspection, symbol/call tracing, executed tests, integration or consumer observation); `conditions` identifies the assessed boundary, artifact/version and actual execution or historical conditions; `reasoning` states which required distinctions the evidence covers; `limitations` identifies material uncovered distinctions and why. This supports a scope | actual method/depth | coverage | judgment | gap view without extra output keys, a second score, or mandatory repeated checklists. A requested depth label is an operational plan, never evidence that the work happened. Keep explanations concise and reuse evidence references.
18
-
19
- Scope, method, depth and coverage are independent: scope selects the authorized object/requirements; methods obtain facts; depth describes how far the actual investigation followed relevant dependencies, transitions, error paths or counterexamples; coverage states inspected versus unassessed conditions. Choose the least costly sufficient evidence for each original requirement, deepening only for a material unresolved distinction within available capabilities and the same budget. Static architecture/deliverable requirements can be established by adequate source inspection without executing E2E; passing tests or a successful consumer journey do not establish unrelated architecture or all branches. Neither add generic testing/E2E/process obligations nor silently waive frozen original conditions. A deliberately unperformed method is not itself a failed requirement; an original behavioral condition still lacking support remains unresolved.
20
-
21
- Symbol indexes, call graphs and search results locate candidate evidence. When supplied, check their binding to the frozen artifact, source/file hashes or matching revision, supported languages, parser/resolver confidence, exclusions, unresolved edges and truncation; follow relevant locators back to actual source before making a code claim. Do not infer freshness from HEAD alone for dirty/non-git artifacts. A missing hit/path is not proof of absence when resolution, scope or traversal is incomplete, and a static graph is not an executed trace. Use only explicitly available capabilities; do not discover/install an indexer or invent a tool.
22
-
23
- Separate actual counterevidence from unperformed observations, unavailable/lost inputs, unresolved interpretation and exhausted investigation. State the specific missing fact in `limitations`; do not label already supplied unread evidence unavailable. Current source or a new execution cannot recreate a missing historical development/review event. Localize ambiguities and gaps to their actual requirement; preserve supported subcomparisons instead of describing successful test execution as unperformed. Original aggregate judgments and source-review admission rules still apply; do not turn a selected positive view into full-delivery PASS.
@@ -1,73 +0,0 @@
1
- import * as fs from 'node:fs';
2
- import * as path from 'node:path';
3
- import {digest} from './isolation';
4
- import type {Manifest} from '../contract';
5
-
6
- /** Caller-selected, optional navigation. No tool process, graph DB or new judge authority. */
7
- export interface CodeEvidenceSelection {path:string;sourceRoot:string}
8
- interface ByteIdentity {path:string;sha256:string;bytes:number}
9
- export function sourceByteInventory(root:string):ByteIdentity[] {
10
- const result:ByteIdentity[]=[];let bytes=0;
11
- function visit(dir:string):void {
12
- if(fs.lstatSync(dir).isSymbolicLink())throw Error('Code evidence cannot follow links');
13
- for(const name of fs.readdirSync(dir)){
14
- const file=path.join(dir,name),stat=fs.lstatSync(file);
15
- if(stat.isSymbolicLink())throw Error('Code evidence cannot follow links');
16
- if(stat.isDirectory()){visit(file);continue;}
17
- if(!stat.isFile())throw Error('Code evidence requires regular files');
18
- const relative=path.relative(root,file).split(path.sep).join('/');
19
- if(/[\0\r\n\\]/.test(relative))throw Error('Unsupported snapshot path');
20
- bytes+=stat.size;if(result.length>=10000||bytes>128*1024*1024)throw Error('Code snapshot exceeds inventory bound');
21
- result.push({path:relative,sha256:digest(fs.readFileSync(file)),bytes:stat.size});
22
- }
23
- }
24
- visit(root);return result.sort((a,b)=>a.path<b.path?-1:a.path>b.path?1:0);
25
- }
26
- export function sourceByteDigest(files:ByteIdentity[]):string {
27
- return digest(files.map(f=>`${f.path}\0${f.sha256}\0${f.bytes}\n`).join(''));
28
- }
29
- function owned(root:string,relative:string):string {
30
- if(!relative||path.isAbsolute(relative)||relative.split(/[\\/]/).some(p=>p==='..'||p==='.'||p===''))throw Error('Code evidence path escapes artifact');
31
- let current=root;
32
- for(const part of relative.split('/')){
33
- current=path.join(current,part);
34
- if(fs.lstatSync(current).isSymbolicLink())throw Error('Code evidence cannot follow links');
35
- }
36
- return current;
37
- }
38
-
39
- /** Called after native artifact freezing; stale envelopes fail before model invocation.
40
- * The ordinary file observer reads this envelope plus bounded candidate source files.
41
- * Unsupported/unreadable sources remain in inventory; no observation is invented. */
42
- export function attachCodeKnowledgeEvidence(manifest:Manifest,selection:CodeEvidenceSelection):Manifest {
43
- const root=fs.realpathSync(manifest.artifact),source=owned(root,selection.sourceRoot),file=owned(root,selection.path);
44
- if(file===source||file.startsWith(source+path.sep))throw Error('Evidence must be outside its source snapshot');
45
- if(fs.statSync(file).size>1048576)throw Error('Code evidence exceeds file observation bound');
46
- const evidence=JSON.parse(fs.readFileSync(file,'utf8'));
47
- if(evidence.format!=='depa-code-navigation-v1')throw Error('Unknown code evidence format');
48
- const inventory=sourceByteInventory(source),identity=sourceByteDigest(inventory);
49
- if(evidence.snapshotDigest!==identity||JSON.stringify(evidence.inventory)!==JSON.stringify(inventory))throw Error('Stale or different code evidence snapshot');
50
- if(!Array.isArray(evidence.coverage)||evidence.coverage.length!==inventory.length)throw Error('Incomplete code evidence coverage');
51
- const seen=new Set<string>(),fileIds=new Map<string,string>();
52
- for(const row of evidence.coverage){
53
- const original=inventory.find(f=>f.path===row.path);
54
- if(!original||seen.has(row.path)||original.sha256!==row.sha256||original.bytes!==row.bytes||!['document','text-or-regex-fallback','semantic-candidate','over-size-or-excluded','skipped','unsupported-or-excluded'].includes(row.status)||!Array.isArray(row.resolvers))throw Error('Invalid code evidence coverage');
55
- seen.add(row.path);if(row.fileId)fileIds.set(row.fileId,row.path);
56
- }
57
- if(!Array.isArray(evidence.symbols)||!Array.isArray(evidence.edges)||evidence.symbols.length>200||evidence.edges.length>400||!evidence.parser||!evidence.settings||!Array.isArray(evidence.limitations)||!evidence.limitations.length)throw Error('Incomplete bounded code evidence');
58
- for(const kind of ['symbols','edges'] as const){
59
- const omitted=kind==='symbols'?'omittedSymbols':'omittedEdges';
60
- if(!Number.isSafeInteger(evidence.totals?.[kind])||evidence.totals[kind]<evidence[kind].length||evidence.totals[omitted]!==evidence.totals[kind]-evidence[kind].length)throw Error('Invalid code evidence truncation');
61
- }
62
- for(const row of [...evidence.symbols,...evidence.edges])if(row.fileId&&!fileIds.has(row.fileId))throw Error('Code location outside frozen inventory');
63
- const probes=[...(manifest.files??[])];
64
- const add=(relative:string,conditions:string)=>{if(!probes.some(p=>p.path===relative))probes.push({path:relative,conditions});};
65
- add(selection.path,'Optional static code navigation from byte-bound frozen source. Inspect coverage, parser/resolvers, unresolved calls and truncation. Missing hits prove no absence; paths prove no execution or past event. Back-read source before using a candidate; original requirements and judge authority are unchanged.');
66
- for(const relative of new Set<string>(evidence.symbols.map((s:{fileId:string})=>fileIds.get(s.fileId)).filter(Boolean))){
67
- const content=fs.readFileSync(path.join(source,relative));
68
- try{if(content.length>1048576)continue;new TextDecoder('utf-8',{fatal:true}).decode(content);}
69
- catch{continue;}
70
- add(selection.sourceRoot+'/'+relative,'Actual frozen source read to check optional navigation candidates. Static inspection establishes neither runtime execution nor completeness of unsupported files.');
71
- }
72
- return {...manifest,files:probes};
73
- }