Ferrell Synthetic Intelligence commited on
Commit
839157e
·
1 Parent(s): 61b024b

Connect Qwen runtime and tighten patch verification

Browse files
harness/README.md CHANGED
@@ -36,6 +36,6 @@ intake -> guard -> retrieve -> plan -> propose -> verify -> revise -> test -> re
36
 
37
  See `orchestrator.mjs` and `policy.json` for the executable contract.
38
 
39
- Run `npm run veritas` from a workspace to execute the allowlisted compile, test, Git diff, manifest, secret, and path-boundary checks. A model verdict never overrides a failed execution check. The orchestrator accepts this runner as `verificationRunner` and blocks the final status until it passes.
40
 
41
  The research and translation boundary is documented in `credo-research.md`. The product uses original engineering language rather than fictional quotations or branding.
 
36
 
37
  See `orchestrator.mjs` and `policy.json` for the executable contract.
38
 
39
+ Run `npm run veritas` from a workspace to execute the allowlisted compile, test, Git diff, manifest, secret, and path-boundary checks. The orchestrator also rejects malformed or fenced model patches before verification. A model verdict never overrides a failed execution check. The orchestrator accepts this runner as `verificationRunner` and blocks the final status until it passes.
40
 
41
  The research and translation boundary is documented in `credo-research.md`. The product uses original engineering language rather than fictional quotations or branding.
harness/orchestrator.mjs CHANGED
@@ -59,6 +59,7 @@ export function createHarness({ providers, tools = {}, policy = {}, verification
59
  task: goal,
60
  plan: bounded(plan, rules.max_context_bytes, 'plan')
61
  }), rules.max_patch_bytes, 'patch');
 
62
  trace.push({ stage: 'propose', status: 'complete', bytes: Buffer.byteLength(patch) });
63
 
64
  const verifier = requireProvider(providers, 'verify');
@@ -72,9 +73,13 @@ export function createHarness({ providers, tools = {}, policy = {}, verification
72
  });
73
  const approved = /^\s*APPROVE\b/i.test(String(verdict));
74
  const execution = verificationRunner ? await verificationRunner({ task: goal, plan, patch, context }) : null;
 
 
 
 
75
  const veritas = execution
76
  ? evaluateExecution({ taskClass: context.taskClass || 'code-change', execution })
77
- : evaluateVeritas({ taskClass: context.taskClass || 'code-change', evidenceScore: context.evidenceScore, checks: context.checks });
78
  trace.push({ stage: 'verify', status: approved ? 'approved-with-notes' : 'blocked' });
79
  trace.push({ stage: 'veritas', status: veritas.status, score: veritas.score, threshold: veritas.threshold });
80
  return {
 
59
  task: goal,
60
  plan: bounded(plan, rules.max_context_bytes, 'plan')
61
  }), rules.max_patch_bytes, 'patch');
62
+ const patchParsePassed = /^diff --git\s+\S+\s+\S+/m.test(patch) && !/^```/m.test(patch);
63
  trace.push({ stage: 'propose', status: 'complete', bytes: Buffer.byteLength(patch) });
64
 
65
  const verifier = requireProvider(providers, 'verify');
 
73
  });
74
  const approved = /^\s*APPROVE\b/i.test(String(verdict));
75
  const execution = verificationRunner ? await verificationRunner({ task: goal, plan, patch, context }) : null;
76
+ if (execution) {
77
+ execution.checks = { ...execution.checks, 'patch-parse': patchParsePassed };
78
+ execution.passed = execution.passed === true && patchParsePassed;
79
+ }
80
  const veritas = execution
81
  ? evaluateExecution({ taskClass: context.taskClass || 'code-change', execution })
82
+ : evaluateVeritas({ taskClass: context.taskClass || 'code-change', evidenceScore: context.evidenceScore, checks: { ...context.checks, 'patch-parse': patchParsePassed } });
83
  trace.push({ stage: 'verify', status: approved ? 'approved-with-notes' : 'blocked' });
84
  trace.push({ stage: 'veritas', status: veritas.status, score: veritas.score, threshold: veritas.threshold });
85
  return {
harness/test-orchestrator.mjs CHANGED
@@ -25,4 +25,5 @@ const verifiedHarness = createHarness({
25
  const verified = await verifiedHarness.run('Run the verified flow', { taskClass: 'code-change' });
26
  assert.equal(verified.status, 'ready-for-apply');
27
  assert.equal(verified.veritas.status, 'verified');
 
28
  console.log('universal harness test passed');
 
25
  const verified = await verifiedHarness.run('Run the verified flow', { taskClass: 'code-change' });
26
  assert.equal(verified.status, 'ready-for-apply');
27
  assert.equal(verified.veritas.status, 'verified');
28
+ assert.equal(verified.execution.checks['patch-parse'], true);
29
  console.log('universal harness test passed');
models/manifest.json CHANGED
@@ -4,57 +4,57 @@
4
  "offline_default": true,
5
  "models": [
6
  {
7
- "id": "lfm25-thinking-local",
8
- "name": "Liquid AI LFM2.5 Thinking (local checkpoint)",
9
  "lane": "research",
10
- "status": "pending",
11
  "roles": ["research", "verify"],
12
  "format": "GGUF / safetensors",
13
  "runtime": "OpenAI-compatible HTTP",
14
- "endpoint": "http://127.0.0.1:8080/v1",
15
- "model": "tinyliquid-research-v8",
16
- "artifact_uri": "local://lfm25-thinking-checkpoint",
17
- "source_revision": "not-confirmed-in-workspace",
18
- "parameters": null,
19
- "context_tokens": null,
20
- "metrics": null,
21
- "description": "Reasoning lane for architecture, requirements, tests, and verification. Import the local checkpoint before use.",
22
  "system_prompt": "You are the research and evidence lane. Analyze the task, identify constraints and risks, cite only supplied workspace evidence, and return concise structured findings. Do not edit files."
23
  },
24
  {
25
- "id": "coding-model-pending",
26
  "name": "Qwen2.5-Coder 1.5B Instruct Q4_K_M",
27
  "lane": "build",
28
- "status": "pending",
29
  "roles": ["build"],
30
  "format": "GGUF / safetensors",
31
  "runtime": "OpenAI-compatible HTTP",
32
  "endpoint": "http://127.0.0.1:8081/v1",
33
- "model": "coding-model-pending",
34
- "artifact_uri": "hf://Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF@main/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
35
- "source_revision": "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF",
36
- "parameters": null,
37
- "context_tokens": null,
38
- "metrics": null,
39
  "description": "Recommended small coding model. License: Apache-2.0; verify the downloaded revision and checksum.",
40
  "system_prompt": "You are the build lane. Produce a minimal unified diff only. Never invent files or claim tests passed."
41
  },
42
  {
43
- "id": "verifier-pending",
44
- "name": "Liquid Thinking Verifier (checkpoint pending)",
45
  "lane": "verify",
46
- "status": "pending",
47
  "roles": ["verify"],
48
  "format": "role-routed",
49
  "runtime": "OpenAI-compatible HTTP",
50
- "endpoint": "http://127.0.0.1:8080/v1",
51
- "model": "lfm25-thinking-local",
52
- "artifact_uri": "local://lfm25-thinking-checkpoint",
53
- "source_revision": "not-confirmed-in-workspace",
54
- "parameters": null,
55
- "context_tokens": null,
56
- "metrics": null,
57
- "description": "Use the Liquid thinking model for verification after its local path and runtime are confirmed.",
58
  "system_prompt": "You are the verification lane. Inspect the proposed patch and return APPROVE, REJECT, or NEEDS-EVIDENCE with concrete reasons. Do not edit files."
59
  }
60
  ]
 
4
  "offline_default": true,
5
  "models": [
6
  {
7
+ "id": "qwen-coder-reasoning-fallback",
8
+ "name": "Qwen Coder (temporary reasoning fallback)",
9
  "lane": "research",
10
+ "status": "experimental",
11
  "roles": ["research", "verify"],
12
  "format": "GGUF / safetensors",
13
  "runtime": "OpenAI-compatible HTTP",
14
+ "endpoint": "http://127.0.0.1:8081/v1",
15
+ "model": "qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
16
+ "artifact_uri": "local:///root/models/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
17
+ "source_revision": "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF@main",
18
+ "parameters": 1540000000,
19
+ "context_tokens": 4096,
20
+ "metrics": {"runtime_health": "verified", "coding_smoke": "passed"},
21
+ "description": "Temporary reasoning fallback until Liquid AI LFM2.5 Thinking is located. Replace without changing the harness.",
22
  "system_prompt": "You are the research and evidence lane. Analyze the task, identify constraints and risks, cite only supplied workspace evidence, and return concise structured findings. Do not edit files."
23
  },
24
  {
25
+ "id": "qwen-coder-1.5b-q4",
26
  "name": "Qwen2.5-Coder 1.5B Instruct Q4_K_M",
27
  "lane": "build",
28
+ "status": "ready",
29
  "roles": ["build"],
30
  "format": "GGUF / safetensors",
31
  "runtime": "OpenAI-compatible HTTP",
32
  "endpoint": "http://127.0.0.1:8081/v1",
33
+ "model": "qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
34
+ "artifact_uri": "local:///root/models/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
35
+ "source_revision": "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF@main",
36
+ "parameters": 1540000000,
37
+ "context_tokens": 4096,
38
+ "metrics": {"runtime_health": "verified", "coding_smoke": "passed"},
39
  "description": "Recommended small coding model. License: Apache-2.0; verify the downloaded revision and checksum.",
40
  "system_prompt": "You are the build lane. Produce a minimal unified diff only. Never invent files or claim tests passed."
41
  },
42
  {
43
+ "id": "qwen-coder-verifier-fallback",
44
+ "name": "Qwen Coder (temporary verifier fallback)",
45
  "lane": "verify",
46
+ "status": "experimental",
47
  "roles": ["verify"],
48
  "format": "role-routed",
49
  "runtime": "OpenAI-compatible HTTP",
50
+ "endpoint": "http://127.0.0.1:8081/v1",
51
+ "model": "qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
52
+ "artifact_uri": "local:///root/models/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf",
53
+ "source_revision": "Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF@main",
54
+ "parameters": 1540000000,
55
+ "context_tokens": 4096,
56
+ "metrics": {"runtime_health": "verified", "coding_smoke": "passed"},
57
+ "description": "Temporary verifier fallback. Replace with Liquid AI LFM2.5 Thinking when its checkpoint is available.",
58
  "system_prompt": "You are the verification lane. Inspect the proposed patch and return APPROVE, REJECT, or NEEDS-EVIDENCE with concrete reasons. Do not edit files."
59
  }
60
  ]
runtime/README.md CHANGED
@@ -5,7 +5,7 @@ AIDE uses local OpenAI-compatible adapters so model runtimes can be replaced wit
5
  ## Recommended Pair
6
 
7
  - **Qwen2.5-Coder 1.5B Instruct Q4_K_M:** builder lane for code completion and reviewable unified diffs.
8
- - **Liquid AI LFM2.5 Thinking:** research, planning, architecture, test design, and verification lane.
9
 
10
  Run both sequentially on constrained hardware. Do not load two large copies unless memory measurements prove it is safe.
11
 
@@ -20,9 +20,11 @@ llama-server -hf Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF:Q4_K_M \
20
 
21
  For a fully offline run, download the exact GGUF first, verify its SHA-256, then replace `-hf ...` with the local file path.
22
 
 
 
23
  ## Liquid Thinking Runtime
24
 
25
- The workspace does not currently contain an identifiable `LFM2.5` artifact, so the Liquid entry in `models/manifest.json` is pending. Once its local file or endpoint is located, expose it at `127.0.0.1:8080/v1` and record the exact revision, tokenizer, prompt template, runtime, quantization, license, and checksum.
26
 
27
  Do not substitute the unfinished TinyLiquid training artifact for LFM2.5. It is not part of the production package.
28
 
 
5
  ## Recommended Pair
6
 
7
  - **Qwen2.5-Coder 1.5B Instruct Q4_K_M:** builder lane for code completion and reviewable unified diffs.
8
+ - **Liquid AI LFM2.5 Thinking:** intended research, planning, architecture, test design, and verification lane when its checkpoint is available.
9
 
10
  Run both sequentially on constrained hardware. Do not load two large copies unless memory measurements prove it is safe.
11
 
 
20
 
21
  For a fully offline run, download the exact GGUF first, verify its SHA-256, then replace `-hf ...` with the local file path.
22
 
23
+ The current ARM smoke-tested configuration uses the local file at `/root/models/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf`, a 4096-token context, four CPU threads, and one parallel slot. It served `/v1/models` and generated a TypeScript function successfully.
24
+
25
  ## Liquid Thinking Runtime
26
 
27
+ The workspace does not currently contain an identifiable `LFM2.5` artifact. AIDE uses Qwen as a temporary reasoning/verifier fallback and records that status in `models/manifest.json`. Once the Liquid file or endpoint is located, replace only the research and verifier entries with its exact revision, tokenizer, prompt template, runtime, quantization, license, and checksum.
28
 
29
  Do not substitute the unfinished TinyLiquid training artifact for LFM2.5. It is not part of the production package.
30