coding-artifact-evaluation-shell 0.0.0-stage → 0.1.0-eidolon.a1a6ca75ec65e
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/AGENTS.md +15 -0
- package/README.md +56 -2
- package/SKILL.md +30 -0
- package/SOP.md +157 -0
- package/adapter/benchmark.ts +28 -0
- package/app/app.ts +15 -0
- package/app/host.ts +30 -0
- package/budget.ts +49 -0
- package/bun.lock +1045 -0
- package/calibrate.ts +81 -0
- package/calibration-history.ts +33 -0
- package/calibration-recheck.ts +74 -0
- package/calibration-report.ts +36 -0
- package/campaign.ts +85 -0
- package/capsule.ts +162 -0
- package/cli.ts +23 -0
- package/coding-scope.ts +13 -0
- package/contract.ts +116 -0
- package/counter-review.ts +74 -0
- package/coverage.ts +74 -0
- package/environment.ts +11 -0
- package/feedback.ts +31 -0
- package/history.ts +11 -0
- package/host.xnl +7 -0
- package/index.ts +6 -0
- package/logic.ts +135 -0
- package/manifest.xnl +10 -0
- package/native-references.ts +21 -0
- package/needs.ts +33 -0
- package/obligation-graph.ts +47 -0
- package/package.json +32 -4
- package/proposal.ts +94 -0
- package/protocol-error.ts +1 -0
- package/replay.ts +39 -0
- package/representation.ts +24 -0
- package/resources/counter-review.md +16 -0
- package/resources/evaluate.md +34 -0
- package/resources/iterate.md +20 -0
- package/resources/review.md +25 -0
- package/resources/submit.md +18 -0
- package/support/agent-runtime.ts +520 -0
- package/support/artifact-inventory.ts +20 -0
- package/support/artifact-links.ts +82 -0
- package/support/browser-channel.ts +209 -0
- package/support/browser-client.ts +33 -0
- package/support/browser-owner.ts +69 -0
- package/support/browser-worker.ts +61 -0
- package/support/campaign-ledger.ts +66 -0
- package/support/code-knowledge.ts +73 -0
- package/support/counter-review.ts +35 -0
- package/support/ego-tools.ts +19 -0
- package/support/evidence-catalog.ts +37 -0
- package/support/evidence-input.ts +70 -0
- package/support/evidence-object.ts +9 -0
- package/support/evidence-read.ts +18 -0
- package/support/execution-profile.ts +65 -0
- package/support/guidance.ts +16 -0
- package/support/history.ts +89 -0
- package/support/http-request.ts +21 -0
- package/support/isolation.ts +94 -0
- package/support/judge.ts +60 -0
- package/support/model-turn.ts +94 -0
- package/support/observation-agent.ts +279 -0
- package/support/observation-protocol.ts +33 -0
- package/support/observers.ts +102 -0
- package/support/process.ts +22 -0
- package/support/proposal-check.ts +82 -0
- package/support/retention.ts +93 -0
- package/support/runtime-binding.ts +39 -0
- package/support/runtime-preflight.ts +16 -0
- package/support/service-evidence.ts +23 -0
- package/support/service-group.ts +45 -0
- package/support/service.ts +84 -0
- package/support/source-identity.ts +22 -0
- package/support/target-group-view.ts +11 -0
- package/target-groups.ts +57 -0
package/package.json
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coding-artifact-evaluation-shell",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0-eidolon.a1a6ca75ec65e",
|
|
4
|
+
"private": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "Code-development artifact evaluator and code-first Halfcode SkillApp",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.ts",
|
|
9
|
+
"./run": "./capsule.ts",
|
|
10
|
+
"./evidence": "./support/evidence-catalog.ts",
|
|
11
|
+
"./app": "./app/app.ts"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"*.ts",
|
|
15
|
+
"*.md",
|
|
16
|
+
"*.xnl",
|
|
17
|
+
"bun.lock",
|
|
18
|
+
"app",
|
|
19
|
+
"support",
|
|
20
|
+
"resources",
|
|
21
|
+
"adapter"
|
|
22
|
+
],
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"halfcode-lite-skill-app-contract": "0.2.2"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"bun": ">=1.3.0"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public",
|
|
32
|
+
"registry": "https://registry.npmjs.com/"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/proposal.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { POLICY, type Diagnostic, type EvaluationInput, type Proposal } from './contract';
|
|
2
|
+
import {referenceEvidence,resolveObservation} from './native-references';
|
|
3
|
+
import {JudgeProtocolError} from './protocol-error';
|
|
4
|
+
export {JudgeProtocolError} from './protocol-error';
|
|
5
|
+
|
|
6
|
+
/** Transport decoding only. Native facts and official decisions are never imported. */
|
|
7
|
+
export function decodeProposal(value: unknown, input: EvaluationInput): Proposal {
|
|
8
|
+
if (!value || typeof value !== 'object') throw new JudgeProtocolError('Judge output must be a JSON object');
|
|
9
|
+
const data = value as Record<string, unknown>;
|
|
10
|
+
if(data.format==='compact-v1'||data.format==='compact-v2')return expandCompact(data,input);
|
|
11
|
+
if (Array.isArray(data.obligations) && Array.isArray(data.claims)) return data as unknown as Proposal;
|
|
12
|
+
const nested = data.proposal as Proposal | undefined;
|
|
13
|
+
if (data.schemaVersion === 1 && data.policyVersion === POLICY && data.runId === input.runId &&
|
|
14
|
+
data.artifactDigest === input.artifactDigest && nested && data.judgment === nested.judgment &&
|
|
15
|
+
Array.isArray(nested.obligations) && Array.isArray(nested.claims)) return nested;
|
|
16
|
+
throw new JudgeProtocolError('Unexpected Proposal envelope or mismatched identity/verdict');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Transport expansion only: no new expectation, reasoning, verdict or evidence. */
|
|
20
|
+
function expandCompact(data:Record<string,unknown>,input:EvaluationInput):Proposal {
|
|
21
|
+
const native=data.format==='compact-v2';
|
|
22
|
+
const noncertifying=native&&(data.judgment==='fail'||data.judgment==='indeterminate');
|
|
23
|
+
// This default records lack of a submitted review, never completeness or support.
|
|
24
|
+
if(noncertifying&&data.sourceReviews===undefined)data={...data,sourceReviews:[]};
|
|
25
|
+
if(Object.keys(data).some(key=>!['format','judgment','obligations','claims','findings','sourceReviews','needReviews'].includes(key))||!Array.isArray(data.obligations)||!Array.isArray(data.claims)||!Array.isArray(data.findings)||!Array.isArray(data.sourceReviews))throw new JudgeProtocolError('Malformed compact Proposal');
|
|
26
|
+
const obligations=(data.obligations as (Proposal['obligations'][number]&{needRef?:unknown})[]).map(o=>{
|
|
27
|
+
if(native&&o?.needRef!==undefined){
|
|
28
|
+
const need=input.needs?.find(n=>n.needId===o.needRef);
|
|
29
|
+
if(!need)throw new JudgeProtocolError('Unknown native needRef');
|
|
30
|
+
if(o.sourceId!==undefined&&o.sourceId!==need.sourceId||o.expectation!==undefined&&o.expectation!==need.expectation||o.quote!==undefined&&o.quote!==need.quote)throw new JudgeProtocolError('needRef cannot override the retained source/expectation/quote');
|
|
31
|
+
const {needRef:_needRef,...fields}=o;
|
|
32
|
+
return {...fields,sourceId:need.sourceId,expectation:need.expectation,quote:need.quote};
|
|
33
|
+
}
|
|
34
|
+
if(!native||o?.quote!==undefined)return o;
|
|
35
|
+
const source=input.sources.find(s=>s.id===o?.sourceId);
|
|
36
|
+
if(!source)throw new JudgeProtocolError('Unknown obligation sourceId');
|
|
37
|
+
return {...o,quote:source.content};
|
|
38
|
+
});
|
|
39
|
+
const claims=data.claims.map((value:unknown)=>{
|
|
40
|
+
if(!value||typeof value!=='object'||Array.isArray(value))throw new JudgeProtocolError('Malformed compact claim');
|
|
41
|
+
const c={...value as Record<string,any>};
|
|
42
|
+
if(native&&c.judgment==='indeterminate'&&c.evidence===undefined)c.evidence=[];
|
|
43
|
+
if(Object.keys(c).some(key=>!['obligationId','judgment','reasoning','limitations','evidence','preconditions'].includes(key))||!Array.isArray(c.evidence))throw new JudgeProtocolError('Compact claim must not override owner-derived fields');
|
|
44
|
+
const matches=obligations.filter(o=>o?.id===c.obligationId);
|
|
45
|
+
if(matches.length!==1)throw new JudgeProtocolError('Compact claim needs one unambiguous obligation');
|
|
46
|
+
const evidence=native?c.evidence.map((e:unknown)=>referenceEvidence(input,e)):c.evidence;
|
|
47
|
+
const facts=evidence.map((e:any)=>input.observations.find(o=>o.id===e?.observationId)).filter((o):o is EvaluationInput['observations'][number]=>!!o);
|
|
48
|
+
const preconditions=native&&c.preconditions?{...c.preconditions,evidenceIds:c.preconditions.evidenceIds?.map((ref:unknown)=>resolveObservation(input,ref).id)}:c.preconditions;
|
|
49
|
+
// Explicit v2 default reuses only the model's own comparisons. It neither
|
|
50
|
+
// infers support from authentic bytes nor changes any selected judgment.
|
|
51
|
+
const reasoning=native&&c.reasoning===undefined?evidence.map((e:any)=>e.supports).join('; '):c.reasoning;
|
|
52
|
+
return {...c,evidence,reasoning,...(preconditions?{preconditions}:{}),semanticExpectation:matches[0]!.expectation,method:[...new Set(facts.map(o=>o.method))].join('; ')||'No native delivery evidence',conditions:[...new Set(facts.map(o=>o.conditions))].join('; ')||'No observed conditions',limitations:c.limitations??[]} as Proposal['claims'][number];
|
|
53
|
+
});
|
|
54
|
+
const sourceReviews=data.sourceReviews.map((value:unknown)=>{
|
|
55
|
+
if(!value||typeof value!=='object'||Array.isArray(value))throw new JudgeProtocolError('Malformed compact source review');
|
|
56
|
+
const review=value as Record<string,unknown>;
|
|
57
|
+
if(Object.keys(review).some(key=>!['sourceId','complete','omissions','ambiguities'].includes(key)))throw new JudgeProtocolError('Unexpected compact source review field');
|
|
58
|
+
return {...review,omissions:review.omissions??[],ambiguities:review.ambiguities??[]} as Proposal['sourceReviews'][number];
|
|
59
|
+
});
|
|
60
|
+
if(noncertifying)for(const source of input.sources){
|
|
61
|
+
if(source.authority!=='inferred'&&!sourceReviews.some(r=>r.sourceId===source.id))sourceReviews.push({sourceId:source.id,complete:false,omissions:['No complete source review submitted.'],ambiguities:[]});
|
|
62
|
+
}
|
|
63
|
+
let needReviews=data.needReviews as Proposal['needReviews'];
|
|
64
|
+
if(noncertifying&&(needReviews===undefined||Array.isArray(needReviews))){
|
|
65
|
+
needReviews=[...(needReviews??[])];
|
|
66
|
+
for(const need of input.needs??[])if(!needReviews.some(r=>r?.needId===need.needId))needReviews.push({needId:need.needId,disposition:'unresolved',obligationIds:[],reasoning:'No disposition submitted; retained as unresolved.'});
|
|
67
|
+
}
|
|
68
|
+
return {judgment:data.judgment as Proposal['judgment'],obligations,claims,findings:data.findings as Proposal['findings'],sourceReviews,...(needReviews!==undefined?{needReviews}: {})};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** A restricted delta: the model cannot rewrite business semantics during repair. */
|
|
72
|
+
export function decodeEvidenceRepair(value:unknown,repair:{proposal:Proposal;diagnostics:Diagnostic[]}):Proposal {
|
|
73
|
+
if(!value||typeof value!=='object'||Array.isArray(value))throw new JudgeProtocolError('Expected evidence-only repair patches');
|
|
74
|
+
const data=value as Record<string,unknown>;
|
|
75
|
+
if(Object.keys(data).length!==1||!Array.isArray(data.evidencePatches)||!data.evidencePatches.length)throw new JudgeProtocolError('Only evidencePatches are accepted');
|
|
76
|
+
const proposal=structuredClone(repair.proposal),seen=new Set<string>();
|
|
77
|
+
const locations=new Set(repair.diagnostics.filter(d=>d.repairable).map(d=>d.location));
|
|
78
|
+
for(const patch of data.evidencePatches) {
|
|
79
|
+
if(!patch||typeof patch!=='object'||Array.isArray(patch)||Object.keys(patch).some(k=>!['claimIndex','evidenceIndex','observationId','excerpt'].includes(k)))throw new JudgeProtocolError('Repair contains forbidden fields');
|
|
80
|
+
const {claimIndex,evidenceIndex,observationId,excerpt}=patch;
|
|
81
|
+
const location=`claims[${claimIndex}].evidence[${evidenceIndex}]`;
|
|
82
|
+
const evidence=proposal.claims[claimIndex]?.evidence[evidenceIndex];
|
|
83
|
+
if(!Number.isSafeInteger(claimIndex)||claimIndex<0||!Number.isSafeInteger(evidenceIndex)||evidenceIndex<0||!evidence||!locations.has(location)||seen.has(location))throw new JudgeProtocolError('Repair must target one diagnosed evidence slot');
|
|
84
|
+
if(observationId===undefined&&excerpt===undefined)throw new JudgeProtocolError('Empty evidence patch');
|
|
85
|
+
if(observationId!==undefined&&(typeof observationId!=='string'||!observationId.trim())||excerpt!==undefined&&(typeof excerpt!=='string'||!excerpt.trim()))throw new JudgeProtocolError('Evidence patch fields must be strings');
|
|
86
|
+
if(observationId!==undefined)evidence.observationId=observationId;
|
|
87
|
+
if(excerpt!==undefined)evidence.excerpt=excerpt;
|
|
88
|
+
seen.add(location);
|
|
89
|
+
}
|
|
90
|
+
return proposal;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const EVIDENCE_REPAIR_GUIDANCE = `Repair only the diagnosed native evidence representation in the frozen Proposal. Do not implement, run business operations, delegate, or alter any judgment, obligation, source review, finding, expectation, reasoning, support explanation, or limitations. Read the supplied immutable input and diagnostics. Return ONLY {"evidencePatches":[{"claimIndex":0,"evidenceIndex":0,"observationId":"native-id","excerpt":"literal native content"}]} with real zero-based indices at diagnosed slots. observationId and excerpt are optional individually; at least one is required per patch. excerpt must be copied verbatim from that Observation.content, not JSON metadata. Do not repeat the full Proposal or include any other fields. The owner applies these patches while preserving all business fields, then independently re-admits them.`;
|
|
94
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export class JudgeProtocolError extends Error {}
|
package/replay.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import { evaluate, defaultConfig } from './logic';
|
|
5
|
+
import type { Decision, EvaluationInput, Judgment } from './contract';
|
|
6
|
+
import { decodeProposal } from './proposal';
|
|
7
|
+
import { loadCalibrationHistory } from './calibration-history';
|
|
8
|
+
import { calibrationReport } from './calibration-report';
|
|
9
|
+
import { createEvaluationRun, digest, fingerprint } from './support/isolation';
|
|
10
|
+
|
|
11
|
+
const [source,output]=process.argv.slice(2);
|
|
12
|
+
if(!source||!output)throw Error('Usage: bun evaluation/replay.ts <failed-calibration-root> <NEW-/tmp/depa-codument-eval-root>');
|
|
13
|
+
const prior=loadCalibrationHistory(source);
|
|
14
|
+
const samples=fs.readFileSync(path.join(source,'samples.jsonl'),'utf8').trim().split('\n').filter(Boolean).map(s=>JSON.parse(s) as {id:string;expected:Judgment;expectedLeaves?:{obligationId:string;judgment:Judgment}[];runId:string});
|
|
15
|
+
const ownRuns=fs.readdirSync(path.join(source,'runs')).map(slot=>({slot,root:path.join(source,'runs',slot)})).filter(r=>fs.existsSync(path.join(r.root,'decision.json')));
|
|
16
|
+
// Reuse the ownership/path guard; no observation or model capability is opened.
|
|
17
|
+
const run=createEvaluationRun(output,path.join(source,'assets'));
|
|
18
|
+
const results=[];
|
|
19
|
+
for(const sample of samples) {
|
|
20
|
+
const original=ownRuns.find(r=>JSON.parse(fs.readFileSync(path.join(r.root,'decision.json'),'utf8')).runId===sample.runId);
|
|
21
|
+
if(!original)throw Error('Missing original sample');
|
|
22
|
+
const originalFile=path.join(original.root,'decision.json'),before=fs.readFileSync(originalFile,'utf8'),decision=JSON.parse(before) as Decision;
|
|
23
|
+
const invocation=decision.invocations.find(i=>i.phase==='judgment'&&i.completed);
|
|
24
|
+
if(!invocation)throw Error('Cannot replay without a completed native judgment');
|
|
25
|
+
const inputFile=path.join(original.root,'input',`${invocation.id}.json`),rawInput=fs.readFileSync(inputFile,'utf8'),input=JSON.parse(rawInput) as EvaluationInput;
|
|
26
|
+
const rawFile=path.join(original.root,'home','tmp',`${invocation.id}.json`),raw=fs.readFileSync(rawFile,'utf8');
|
|
27
|
+
if(input.runId!==decision.runId || input.artifactDigest!==decision.artifactDigest || JSON.stringify(input.observations)!==JSON.stringify(decision.observations))throw Error('Native input/decision drift');
|
|
28
|
+
if(fingerprint(path.join(source,'assets',original.slot))!==input.artifactDigest || input.sources.some(s=>digest(fs.readFileSync(s.path))!==s.digest))throw Error('Frozen source/artifact drift');
|
|
29
|
+
const decoded=decodeProposal(JSON.parse(raw.trim().replace(/^```(?:json)?\s*|\s*```$/g,'')),input);
|
|
30
|
+
const replayed=await evaluate({judge:{invocations:()=>decision.invocations,judge:async(_input,repair)=>{if(repair)throw Error('Replay cannot invoke a model or invent repaired evidence');return decoded;}},record:event=>fs.appendFileSync(path.join(run.root,'ledger.jsonl'),JSON.stringify(event)+'\n')},input,{...defaultConfig,includeCommitments:(input as EvaluationInput & {policy?:{includeCommitments:boolean}}).policy?.includeCommitments??false});
|
|
31
|
+
const evidence={sourceDecision:{path:originalFile,digest:digest(before)},sourceInput:{path:inputFile,digest:digest(rawInput)},nativeModelOutput:{path:rawFile,digest:digest(raw)},transportDecoder:'Proposal-envelope/v1',additionalModelCalls:0};
|
|
32
|
+
fs.appendFileSync(path.join(run.root,'ledger.jsonl'),JSON.stringify({replay:replayed,evidence})+'\n');
|
|
33
|
+
results.push({id:sample.id,expected:sample.expected,expectedLeaves:sample.expectedLeaves,decision:replayed});
|
|
34
|
+
}
|
|
35
|
+
for(const file of prior.files)if(digest(fs.readFileSync(file.path))!==file.digest)throw Error('Historical calibration changed');
|
|
36
|
+
const replaced=new Set(results.map(r=>r.decision.runId)),history=prior.decisions.filter(d=>!replaced.has(d.runId));
|
|
37
|
+
const report={schemaVersion:1,profile:'judge-calibration-replay',sourceCalibration:prior.files.at(-1),additionalModelCalls:0,...calibrationReport(results,history,prior.budget,false,Date.now()),limitations:['Read-only decoding of existing native model outputs; not a new model experiment','Semantic expectations/verdicts/evidence/gold are unchanged','Unknown original launch costs remain unknown']};
|
|
38
|
+
fs.writeFileSync(path.join(run.root,'calibration.json'),JSON.stringify(report,null,2)+'\n',{flag:'wx'});
|
|
39
|
+
console.log(JSON.stringify(report,null,2));process.exit(report.status==='passed'?0:1);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** A literal evidence excerpt, never a test of semantic adequacy. */
|
|
2
|
+
export function excerptDiagnostic(content:string,excerpt:unknown,location:string) {
|
|
3
|
+
return typeof excerpt==='string'&&excerpt.trim()&&content.includes(excerpt)?null:{rule:'native-excerpt',location,message:'Evidence excerpt is not a literal part of the native observation',repairable:true};
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/** Object key ordering is transport representation, not business semantics. */
|
|
7
|
+
export function canonicalIdentity(value:unknown):string {
|
|
8
|
+
function normalize(item:unknown):unknown {
|
|
9
|
+
if(Array.isArray(item))return item.map(normalize);
|
|
10
|
+
if(item && typeof item==='object')return Object.fromEntries(Object.entries(item).sort(([a],[b])=>a.localeCompare(b)).map(([key,entry])=>[key,normalize(entry)]));
|
|
11
|
+
return item;
|
|
12
|
+
}
|
|
13
|
+
return JSON.stringify(normalize(value))??'undefined';
|
|
14
|
+
}
|
|
15
|
+
/** Common one-repair controller, with caller-owned semantic identity and error classification. */
|
|
16
|
+
export async function repairOnce<T>(runtime:{admit(value:T):void;repair(value:T,diagnostic:string):Promise<T>;identity(value:T):string;repairable(error:unknown):boolean;record(event:unknown):void},input:T):Promise<T> {
|
|
17
|
+
try{runtime.admit(input);return input;}catch(error){
|
|
18
|
+
if(!runtime.repairable(error))throw error;
|
|
19
|
+
const identity=runtime.identity(input);runtime.record({phase:'protocol-repair',round:1,diagnostic:String(error)});
|
|
20
|
+
const repaired=await runtime.repair(input,String(error));
|
|
21
|
+
if(runtime.identity(repaired)!==identity)throw Error('Protocol repair changed business judgement, coverage or expectations');
|
|
22
|
+
runtime.admit(repaired);runtime.record({phase:'protocol-repair-completed',round:1});return repaired;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
envelopeVersion: halfcode.resource-envelope/v1
|
|
3
|
+
specVersion: 1
|
|
4
|
+
kind: SOP
|
|
5
|
+
metadata:
|
|
6
|
+
fqn: ArtifactEvaluation.SOP.CounterReview
|
|
7
|
+
spec:
|
|
8
|
+
profile: freeform
|
|
9
|
+
description: Experimental independent counter-review within the original evaluation budget
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Independently challenge the candidate. For PASS, inspect original material conditions left unsupported or contradicted. For FAIL, check whether its witness contradicts an applicable original requirement under actual conditions, not an added assumption. Do not manufacture disagreement. WholeSource/wholeObject in the candidate replace only exact duplicate full bodies: follow sourceId/observationRef to the complete native object. All other candidate choices are verbatim. Read the candidate object once; no prior sessions or scores.
|
|
13
|
+
|
|
14
|
+
Capabilities are closed. No collection, business actions or delegation. Return one concise JSON object: {"disposition":"uphold"|"challenge"|"unresolved","reason":"source/fact-grounded explanation","sourceIds":["original-source-id"],"observationRefs":["obs:N"]}. Uphold preserves the candidate; challenge/unresolved without a replacement yields indeterminate, NEVER automatic opposite judgment. For an upheld PASS include all authoritative sources. Missing facts are not failed behavior.
|
|
15
|
+
|
|
16
|
+
Only if you find a concrete applicable business contradiction, you MAY add replacement containing an existing compact-v2 FAIL Proposal. Its minimal witness must pass the SAME admission, preserving caller obligations/needs and full-source review limits; do not fabricate a PASS or rewrite the candidate. Read {{replacementGuide}} only if needed for this optional replacement. No checker or duplicated scorecard is needed for the ordinary four-field review. Leave time to return within the original deadline.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
envelopeVersion: halfcode.resource-envelope/v1
|
|
3
|
+
specVersion: 1
|
|
4
|
+
kind: SOP
|
|
5
|
+
metadata:
|
|
6
|
+
fqn: ArtifactEvaluation.SOP.Evaluate
|
|
7
|
+
spec:
|
|
8
|
+
profile: freeform
|
|
9
|
+
description: Assess frozen code-development artifacts using owned native observations and independent judgment
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Evaluate a frozen coding delivery
|
|
13
|
+
|
|
14
|
+
Read the runner procedure in [SOP.md](../SOP.md), including isolation and capability preparation. Read [AGENTS.md](../AGENTS.md) as evaluator policy, not as application instructions.
|
|
15
|
+
|
|
16
|
+
Inputs are complete original coding requirements, unchanged delivered code, trusted capability declarations and a new output root. The current public entry is `runCodingEvaluation` from `coding-artifact-evaluation-shell/run`, with an explicit codingScope and new retainTo directory. The CLI uses `bun cli.ts evaluate /absolute/manifest.json /absolute/new-output --scope-file=/absolute/coding-scope.json --retain-to=/absolute/new-archive`. Use `--no-model` only for infrastructure smoke; it cannot certify code correctness. The lower-level runEvaluation and historical artifact-evaluation/v1 / ArtifactEvaluation.* identities remain compatible; never rewrite old records. This evaluator does not assess arbitrary non-code business or research tasks.
|
|
17
|
+
|
|
18
|
+
For an explicitly selected model/runtime experiment, the same package entry exports `createCodexRuntime` and `EvaluationOptions`. Trusted callers may pass pinned `agentRuntime`/`judgeRuntime` dependencies; never derive them from application files. Pin the same actual CLI when comparing models, retain its version/digest and native per-turn identities, and keep the original finite budget. Defaults are unchanged. Different model settings are not additional evaluator roles. A current run cannot prove a missing historical event; missing collection is not an observed business failure.
|
|
19
|
+
|
|
20
|
+
Collect facts through the runner's owned process/HTTP/browser/file capabilities. Review them against the originals, request material missing evidence while the leases remain open, then submit independent judgments. Keep actual deadlines, model usage, failures and indeterminate outcomes. Do not edit historical applications, infer process execution from source declarations, or turn infrastructure failures into business defects.
|
|
21
|
+
|
|
22
|
+
The dynamic Evidence, Check and Groups LocalFunctions are read-only tools over explicit input paths. They do not grant execution rights, write verdicts or approve model budgets. Automated isolated model turns use the same implementation compiled into their owned scratch, not a generic host with broader permissions.
|
|
23
|
+
|
|
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
|
+
|
|
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.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
envelopeVersion: halfcode.resource-envelope/v1
|
|
3
|
+
specVersion: 1
|
|
4
|
+
kind: SOP
|
|
5
|
+
metadata:
|
|
6
|
+
fqn: ArtifactEvaluation.SOP.Iterate
|
|
7
|
+
spec:
|
|
8
|
+
profile: freeform
|
|
9
|
+
description: Improve the reusable evaluator from observed failures without case-specific scoring
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Iterate the evaluator
|
|
13
|
+
|
|
14
|
+
Reconstruct the goal and unresolved failures from immutable reports and actual observations before editing. Separate protocol rejection, environment/tool failure, evidence insufficiency and semantic misjudgment. Faster rejection is not improved usefulness; passing transport tests is not a credible verdict.
|
|
15
|
+
|
|
16
|
+
Change the smallest shared implementation or single text authority that explains the failure. Do not add case names, selectors, expected business outputs or gold into the evaluator. Keep historical artifacts, original requirements and prior reports unchanged.
|
|
17
|
+
|
|
18
|
+
Run `bun run check`, Halfcode `Resource validate --json`, and the relevant generic negative checks. Then freeze a new evaluator identity and use gpt-5.6-terra / medium on fixed inputs with finite per-run controls. Compare like phases: collection+review versus collection+review, sealed review versus sealed review. Report credible verdicts, incorrect PASS/FAIL, protocol failures, elapsed time and actual input/cache/output/unknown usage, including all unsuccessful runs. A historical cohort is not unseen validation.
|
|
19
|
+
|
|
20
|
+
Repeat Halfcode discovery/invoke after editing; the next call loads the changed generation. Do not mutate a running frozen generation or restart a terminal assessment to reset its costs. Package with `bun pm pack`; consume the complete package including its lock and text resources, not copied fragments.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
envelopeVersion: halfcode.resource-envelope/v1
|
|
3
|
+
specVersion: 1
|
|
4
|
+
kind: SOP
|
|
5
|
+
metadata:
|
|
6
|
+
fqn: ArtifactEvaluation.SOP.Review
|
|
7
|
+
spec:
|
|
8
|
+
profile: freeform
|
|
9
|
+
description: Compare complete original requirements with authenticated facts
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Goal → fact → comparison:
|
|
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
|
+
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
|
+
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
|
+
Fix the relevant acceptance boundary from the originals before judging a discovered implementation. Additional routes, controls or graph hits do not silently expand that boundary: a contradiction on an optional surface needs an original constraint whose quantifier actually covers it; preserve genuinely global constraints as global. If plausible original-scope readings would change the outcome and the supplied sources do not resolve them, record that specific ambiguity and remain indeterminate instead of selecting whichever reading makes this attempt PASS or FAIL. A limitation cannot disclaim a required condition while certifying that same condition. Likewise, missing execution alone does not invalidate a source-provable static requirement; distinguish those objects rather than applying a blanket UI/E2E rule.
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
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.
|
|
24
|
+
|
|
25
|
+
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.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
envelopeVersion: halfcode.resource-envelope/v1
|
|
3
|
+
specVersion: 1
|
|
4
|
+
kind: SOP
|
|
5
|
+
metadata:
|
|
6
|
+
fqn: ArtifactEvaluation.SOP.Submit
|
|
7
|
+
spec:
|
|
8
|
+
profile: freeform
|
|
9
|
+
description: Represent an independent judgment with native references
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Return compact-v2, never a Decision envelope:
|
|
13
|
+
{"format":"compact-v2","judgment":"pass|fail|indeterminate","obligations":[],"claims":[],"findings":[],"sourceReviews":[]}.
|
|
14
|
+
Obligation: {id:string,sourceId:string,quote?:string,expectation:string,rationale:string,relation:"leaf|all|any|conditional",children:string[],condition:"applicable|not-applicable|unresolved"}. Omitted quote binds COMPLETE original bytes. Preserve caller-owned obligations unchanged. A leaf has children:[]; all/any MUST reference actual child obligation IDs, not leave children empty or hide them in a sentence. Compare leaves; parents fold their children without a duplicate claim.
|
|
15
|
+
Claim: {obligationId:string,judgment:"pass|fail|indeterminate",reasoning?:string,limitations?:string[],evidence?:[{observationRef:"obs:N",supports:string}],preconditions?:{status:"established|unresolved|incompatible",reasoning:string,evidenceIds:["obs:N"]}}.
|
|
16
|
+
Use CURRENT obs:N refs after reading those complete objects; input/setup-only or failed facts cannot support delivery claims. Evidence.supports is a nonempty expected-vs-actual comparison STRING, NEVER a boolean. Normally omit reasoning: the owner reuses supports. Only indeterminate may omit evidence; empty evidence requires explicit reasoning. The owner expands exact IDs/content and expectation/method/conditions; do not transcribe them, logs or digests. Optional excerpt must be literal contiguous native text. Authentication is not semantic proof. Record actual limits, not repeated boilerplate.
|
|
17
|
+
Finding: {id:string,obligationIds:string[],description:string}. SourceReview: {sourceId:string,complete:boolean,omissions?:string[],ambiguities?:string[]}; omitted arrays mean [].
|
|
18
|
+
Findings reference failed leaves only. Review EVERY authoritative source. Omissions describe unassessed material scope; ambiguities are goal interpretations changing acceptance, not ordinary sampling. For FAIL/indeterminate, unsubmitted sourceReviews are conservatively recorded as incomplete, and unsubmitted needReviews as unresolved; omit repeated unknown boilerplate, never invent positive claims to fill it. Explicit dispositions remain unchanged and validated. PASS requires explicit complete source reviews and every need disposition; these defaults cannot certify anything. All other fields required. Owner-only execution/observations/diagnostics/usage/identities never belong in this object.
|