Skip to content

Commit 4bd45dc

Browse files
authored
Merge pull request #1283 from FOUNDUPS/fix/reddog-fusion-kimi3-phase1
feat(reddog): add Kimi K3 fusion research
2 parents c84be13 + c3da780 commit 4bd45dc

18 files changed

Lines changed: 355 additions & 50 deletions

extensions/reddog/INTERFACE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ Model and context routing:
307307
- Principal/synthesis default: `z-ai/glm-5.2`.
308308
- Adversarial critic default: `deepseek/deepseek-v4-pro`.
309309
- Implementation critic default: `moonshotai/kimi-k2.7-code`.
310+
- Long-horizon reasoning critic default: `moonshotai/kimi-k3` with mandatory `max` reasoning, no temperature parameter, and a receipt-recorded 4096-token critic budget.
310311
- REGULAR smoke/simple prompts auto-route to `openrouter_single` with the GLM principal and `wsp_holo` HoloIndex grounding (no Fusion panel, Skillz, or git).
311312
- Context is not a 012-facing selector; it is resolved from WSP_15 tier.
312313
- Skillz/Wardrobe/Rolodex/OpenClaw/Hermes discovery is context only. RedDog may recommend a governed handoff, but this extension cannot execute it.

extensions/reddog/ModLog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
# ModLog - RedDog Extension
44

5+
## 2026-07-18 - REDDOG_FUSION_KIMI_K3_PHASE1 (OpenRouter critic integration, 0.4.1)
6+
7+
- Added the verified OpenRouter slug `moonshotai/kimi-k3` to the default manual Fusion panel while retaining Kimi K2.7 Code for implementation comparison and capacity fallback.
8+
- Kimi K3 requests use its published mandatory `max` reasoning contract, omit the unsupported temperature field, and use a receipt-recorded 4096-token critic budget validated by the live compatibility smoke.
9+
- Review packets continue to bind the exact requested panel model IDs; no mutable `kimi-latest` alias is used.
10+
- Version 0.4.0 -> 0.4.1 (package.json + EXTENSION_VERSION + README + interface + contract tests).
11+
- WSP_15: Complexity 3 + Importance 4 + Deferability 4 + Impact 4 = 15 (P1).
12+
513
## 2026-07-16 - REDDOG_PRODUCT_IDENTITY_AND_THIN_CLIENT_0_4_0 (product identity migration, 0.4.0)
614

715
- Renamed the extension folder and product identity from the legacy Foundups Fusion Worker / Foundups(R)Agent surface to RedDog.

extensions/reddog/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RedDog
22

3-
Version: 0.4.0
3+
Version: 0.4.1
44

55
This local Cursor/VS Code extension opens the RedDog resident FoundUps architect thin client as an editor webview tab.
66

@@ -13,7 +13,7 @@ Command:
1313
Default panel:
1414

1515
- Principal/synthesis: `z-ai/glm-5.2`
16-
- Critics: `deepseek/deepseek-v4-pro` and `moonshotai/kimi-k2.7-code`
16+
- Critics: `deepseek/deepseek-v4-pro`, `moonshotai/kimi-k2.7-code`, and `moonshotai/kimi-k3`
1717

1818
## RedDog and the Recursive 0102 DAE Ecosystem
1919

@@ -144,7 +144,7 @@ Output is prefixed with a visible **RedDog Routing** block (tier, effort, mode,
144144
| Claim | Status |
145145
| --- | --- |
146146
| Principal default `z-ai/glm-5.2` | OBSERVED |
147-
| Critics default DeepSeek V4 Pro + Kimi K2.7 Code | OBSERVED |
147+
| Critics default DeepSeek V4 Pro + Kimi K2.7 Code + Kimi K3 | OBSERVED |
148148
| 012 work focus -> 0102 WSP task prompt | OBSERVED |
149149
| Review packet work_focus_digest + wsp_prompt_digest | OBSERVED |
150150
| WORK_FOCUS_NOT_AUTHORITY | OBSERVED |
@@ -191,12 +191,13 @@ The lead is configurable. Use Cursor settings or workspace/user settings:
191191
"reddog.leadModel": "z-ai/glm-5.2",
192192
"reddog.panelModels": [
193193
"deepseek/deepseek-v4-pro",
194-
"moonshotai/kimi-k2.7-code"
194+
"moonshotai/kimi-k2.7-code",
195+
"moonshotai/kimi-k3"
195196
]
196197
}
197198
```
198199

199-
The extension uses up to four panel models. RedDog defaults to GLM-5.2 as principal, DeepSeek V4 Pro as adversarial critic, and Kimi K2.7 Code as implementation critic.
200+
The extension uses up to four panel models. RedDog defaults to GLM-5.2 as principal, DeepSeek V4 Pro as adversarial critic, Kimi K2.7 Code as implementation critic, and Kimi K3 as a long-horizon reasoning critic. Kimi K3 uses OpenRouter's explicit `moonshotai/kimi-k3` slug; its request omits unsupported temperature, records mandatory `max` reasoning, and uses a 4096-token critic budget because lower budgets did not produce quorum-usable final output in the live compatibility smoke. The review packet records the actual per-panel token budgets.
200201

201202
## Bounded Repo Context
202203

@@ -224,6 +225,6 @@ vsce package --no-dependencies
224225
From Cursor:
225226

226227
1. Open Command Palette.
227-
2. Run `Extensions: Install from VSIX...` and select the generated `reddog-0.4.0.vsix` (or current package version).
228+
2. Run `Extensions: Install from VSIX...` and select the generated `reddog-0.4.1.vsix` (or current package version).
228229
3. Do not use workspace-extension install for normal operation; install the VSIX and reload the window.
229230
4. Run `RedDog: Open` from Command Palette or the three-dot command list.

extensions/reddog/ROADMAP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Status
44

5-
Phase: RedDog 0.4.0 resident architect thin-client surface.
5+
Phase: RedDog 0.4.1 resident architect thin-client surface.
66

77
Current implementation:
88

extensions/reddog/extension.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const crypto = require('crypto');
44
const path = require('path');
55
const fs = require('fs');
66

7-
const EXTENSION_VERSION = '0.4.0';
7+
const EXTENSION_VERSION = '0.4.1';
88
const REDDOG_EXTENSION_ID = 'foundups.reddog';
99
const REDDOG_LEGACY_EXTENSION_ID = 'foundups.foundups-fusion-worker';
1010
const REDDOG_CONFIG_NAMESPACE = 'reddog';
@@ -3817,7 +3817,7 @@ function appendValidationFailureContent(content, validationState) {
38173817
const DEFAULT_FUSION_WORKER = {
38183818
title: 'RedDog',
38193819
lead: 'z-ai/glm-5.2',
3820-
panel: ['deepseek/deepseek-v4-pro', 'moonshotai/kimi-k2.7-code']
3820+
panel: ['deepseek/deepseek-v4-pro', 'moonshotai/kimi-k2.7-code', 'moonshotai/kimi-k3']
38213821
};
38223822

38233823
const REDDOG_ARCHITECT_SYSTEM_PROMPT = [
@@ -5129,7 +5129,7 @@ function activate(context) {
51295129
const installState = detectRedDogInstallState(context);
51305130
if (installState.stale_install_detected) {
51315131
vscode.window.showWarningMessage(
5132-
'RedDog 0.4.0 detected a legacy Foundups Fusion Worker install. Keep only one RedDog extension active after migration.'
5132+
'RedDog 0.4.1 detected a legacy Foundups Fusion Worker install. Keep only one RedDog extension active after migration.'
51335133
);
51345134
}
51355135
context.subscriptions.push(

extensions/reddog/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "reddog",
33
"displayName": "RedDog - FoundUps Architect",
44
"description": "Open the RedDog resident 0102 architect thin client for FoundUps.",
5-
"version": "0.4.0",
5+
"version": "0.4.1",
66
"publisher": "foundups",
77
"icon": "icon.png",
88
"engines": {
@@ -68,7 +68,8 @@
6868
"type": "array",
6969
"default": [
7070
"deepseek/deepseek-v4-pro",
71-
"moonshotai/kimi-k2.7-code"
71+
"moonshotai/kimi-k2.7-code",
72+
"moonshotai/kimi-k3"
7273
],
7374
"items": {
7475
"type": "string"
@@ -94,7 +95,8 @@
9495
"type": "array",
9596
"default": [
9697
"deepseek/deepseek-v4-pro",
97-
"moonshotai/kimi-k2.7-code"
98+
"moonshotai/kimi-k2.7-code",
99+
"moonshotai/kimi-k3"
98100
],
99101
"items": {
100102
"type": "string"

extensions/reddog/tests/TestModLog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Foundups(R)Agent TestModLog
22

3+
## 2026-07-18 - REDDOG_FUSION_KIMI_K3_PHASE1
4+
5+
- Asserted the 0.4.1 package/runtime version lock and default Kimi K3 panel membership.
6+
- Asserted the bridge emits Kimi K3 requests with mandatory `max` reasoning, without temperature, and with the 4096-token panel budget.
7+
- Retained Kimi K2.7 Code coverage so the default panel can compare the two Kimi generations.
8+
- Reconciled the stale resident-session contract assertion with the already-shipped durable AgentDB runtime symbol; production resident code was not changed.
9+
310
## 2026-07-09 - REDDOG_EXTENSION_TO_WRE_OPERATIONAL_SPINE_DRYRUN_WIRE_PHASE1 (WRE-DRY-001..WRE-DRY-010)
411

512
| ID | Asserts |

extensions/reddog/tests/verify_extension_contract.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ function assertFusionRedactionGateFails(contextText, expectedReason, label) {
198198
assertFusionRedactionGateBlocks(contextText, expectedReason, label);
199199
}
200200

201-
assert.strictEqual(pkg.version, '0.4.0', 'package version must be 0.4.0');
202-
includes(extensionJs, "const EXTENSION_VERSION = '0.4.0'", 'extension build mismatch');
201+
assert.strictEqual(pkg.version, '0.4.1', 'package version must be 0.4.1');
202+
includes(extensionJs, "const EXTENSION_VERSION = '0.4.1'", 'extension build mismatch');
203203
assert.strictEqual(pkg.name, 'reddog', 'package id must be canonical RedDog in 0.4.0');
204204
assert.strictEqual(pkg.displayName, 'RedDog - FoundUps Architect', 'display name must be canonical RedDog');
205205
includes(JSON.stringify(pkg), 'RedDog: Open', 'canonical command title must use RedDog');
@@ -219,7 +219,7 @@ includes(extensionJs, 'REDDOG_STAGE_ACTIONS', 'structured stage map missing');
219219
includes(extensionJs, 'REDDOG_PROGRESS_ACTIONS', 'progress regex fallback missing');
220220
includes(extensionJs, 'function matchReddogProgress', 'matchReddogProgress missing');
221221
includes(extensionJs, 'function formatElapsed', 'formatElapsed missing');
222-
includes(readme, 'Version: 0.4.0', 'README version mismatch');
222+
includes(readme, 'Version: 0.4.1', 'README version mismatch');
223223
includes(extensionJs, 'function buildBridgePythonEnv', 'bridge Python UTF-8 env helper missing');
224224
includes(extensionJs, 'PYTHONIOENCODING', 'bridge must set PYTHONIOENCODING=utf-8');
225225
includes(extensionJs, 'PYTHONUTF8', 'bridge must set PYTHONUTF8=1');
@@ -270,6 +270,10 @@ includes(bridgePy, 'messages = [{"role": "system", "content": _system_prompt(pay
270270
includes(bridgePy, 'base_system = _system_prompt(payload)', 'manual panel system prompt missing');
271271
includes(bridgePy, 'GLM_PRINCIPAL_MODEL = "z-ai/glm-5.2"', 'bridge GLM principal missing');
272272
includes(bridgePy, 'DEEPSEEK_CRITIC_MODEL = "deepseek/deepseek-v4-pro"', 'bridge DeepSeek V4 critic missing');
273+
includes(bridgePy, 'KIMI_PANEL_MODEL = "moonshotai/kimi-k3"', 'bridge Kimi K3 critic missing');
274+
includes(bridgePy, 'KIMI_K3_PANEL_MAX_TOKENS = 4096', 'Kimi K3 critic budget missing');
275+
includes(bridgePy, 'body["reasoning"] = {"effort": "max"}', 'Kimi K3 max-reasoning request contract missing');
276+
includes(bridgePy, '"panel_max_tokens": panel_max_tokens', 'Kimi K3 actual panel budget receipt missing');
273277

274278
includes(iface, 'SPECIFIED_NOT_IMPLEMENTED', 'interface truth boundary missing');
275279
includes(iface, 'WSP_15 Priority', 'interface priority contract missing');
@@ -408,6 +412,7 @@ includes(iface, '012 Work Focus to 0102 WSP Task Prompt', 'INTERFACE work focus
408412
includes(roadmap, 'REDDOG_BRIDGE_HARDENING_PHASE1', 'bridge hardening roadmap slice missing');
409413
includes(extensionJs, 'Routing: Auto via WSP_15', 'auto routing label missing');
410414
includes(extensionJs, 'deepseek/deepseek-v4-pro', 'DeepSeek V4 Pro critic default missing');
415+
includes(extensionJs, 'moonshotai/kimi-k3', 'Kimi K3 critic default missing');
411416
includes(extensionJs, 'z-ai/glm-5.2', 'GLM 5.2 principal default missing');
412417
includes(extensionJs, 'openrouter_fusion_alias', 'OpenRouter Fusion alias path must remain implemented');
413418
assert(!extensionJs.includes('<select id="mode"'), 'Mode must not be a 012-facing dropdown');
@@ -1087,7 +1092,7 @@ assert.strictEqual(spinePreview.dry_run_only, true, 'WRE preview must be dry-run
10871092
assert.strictEqual(spinePreview.candidate_work_order_emitted, true, 'WRE preview emits typed candidate shape');
10881093
assert(spinePreview.governed_work_order_candidate, 'WRE preview must include governed work-order candidate');
10891094
assert(/^rdog-wo-[a-f0-9]{16}$/.test(spinePreview.governed_work_order_candidate.work_order_id), 'candidate work_order_id shape');
1090-
assert.strictEqual(spinePreview.governed_work_order_candidate.red_dog_instance_id, 'foundups-agent-0.4.0', 'candidate must bind extension version');
1095+
assert.strictEqual(spinePreview.governed_work_order_candidate.red_dog_instance_id, 'foundups-agent-0.4.1', 'candidate must bind extension version');
10911096
assert.strictEqual(spinePreview.governed_work_order_candidate.repo_permission_snapshot.source, 'extension_runtime_candidate', 'candidate must not forge permission source');
10921097
assert.strictEqual(spinePreview.governed_work_order_candidate.repo_permission_snapshot.permission_level, 'needs_verification', 'candidate must fail closed on permission');
10931098
assert.deepStrictEqual(spinePreview.governed_work_order_candidate.allowed_paths, [
@@ -2579,7 +2584,7 @@ const recallTargets = orchestrator.inferRecallTargetPaths(extAcc001Prompt);
25792584
assert(recallTargets.includes(fixtures.EXT_ACC_001_TARGET_PATH), 'EXT-ACC-001 prompt must map to extension.js');
25802585

25812586
const extensionSnippet = orchestrator.readBoundedTargetSnippet(root, fixtures.EXT_ACC_001_TARGET_PATH, 24000);
2582-
includes(extensionSnippet.content, "const EXTENSION_VERSION = '0.4.0'", 'target snippet must include extension.js source');
2587+
includes(extensionSnippet.content, "const EXTENSION_VERSION = '0.4.1'", 'target snippet must include extension.js source');
25832588
assert(extensionSnippet.chars > 0, 'target snippet chars must be nonzero');
25842589
assert.strictEqual(extensionSnippet.omitted_reason, 'none', 'extension.js snippet must not be omitted');
25852590

@@ -2593,7 +2598,7 @@ assert.strictEqual(safeResolve.ok, true, 'extension.js must resolve inside works
25932598
const targetSection = orchestrator.buildTargetRecallContentSection(root, extAcc001Prompt, 24000);
25942599
includes(targetSection.text, '### Target recall content', 'target recall section header missing');
25952600
includes(targetSection.text, fixtures.EXT_ACC_001_TARGET_PATH, 'target recall must cite extension.js path');
2596-
includes(targetSection.text, "const EXTENSION_VERSION = '0.4.0'", 'target recall must include source snippet');
2601+
includes(targetSection.text, "const EXTENSION_VERSION = '0.4.1'", 'target recall must include source snippet');
25972602
assert.strictEqual(targetSection.meta.target_content_included, true, 'target_content_included must be true when snippets present');
25982603
assert(targetSection.meta.target_content_chars > 0, 'target_content_chars must be > 0');
25992604

@@ -2605,7 +2610,7 @@ assert.strictEqual(wsp97Excerpt.meta.wsp97_excerpt_included, true, 'wsp97_excerp
26052610
const boundedContext = orchestrator.buildBoundedRepoContext('wsp_holo_skillz', extAcc001Prompt);
26062611
includes(boundedContext.text, '### Target recall content', 'bounded context must include target recall section');
26072612
includes(boundedContext.text, fixtures.EXT_ACC_001_TARGET_PATH, 'bounded context must include extension.js path');
2608-
includes(boundedContext.text, "const EXTENSION_VERSION = '0.4.0'", 'bounded context must include source snippet');
2613+
includes(boundedContext.text, "const EXTENSION_VERSION = '0.4.1'", 'bounded context must include source snippet');
26092614
includes(boundedContext.text, '### WSP protocol excerpt (bounded)', 'WSP_97 task must include protocol excerpt');
26102615
includes(boundedContext.text, 'WSP 97: System Execution Prompting Protocol', 'bounded context must include WSP_97 excerpt body');
26112616
assert.strictEqual(boundedContext.holoindex_scorecard.target_content_included, true, 'scorecard target_content_included must be true');
@@ -3484,7 +3489,7 @@ vscodeMock.extensions.getExtension = (id) => (
34843489
id === 'foundups.foundups-fusion-worker'
34853490
? { id, packageJSON: { version: '0.3.68' } }
34863491
: id === 'foundups.reddog'
3487-
? { id, packageJSON: { version: '0.4.0' } }
3492+
? { id, packageJSON: { version: '0.4.1' } }
34883493
: undefined
34893494
);
34903495
const duplicateDetectedState = orchestrator.detectRedDogInstallState({
@@ -3502,7 +3507,7 @@ includes(extensionJs, "reddogConfigValue('enableResidentArchitectSession'", 'RAS
35023507
includes(extensionJs, 'function runResidentArchitectSessionBridge', 'RAS-001: resident session extension bridge missing');
35033508
includes(extensionJs, 'resident_architect_session_result', 'RAS-001: resident session result must attach to review packet');
35043509
includes(extensionJs, 'buildResidentArchitectSessionSection', 'RAS-001: Copy MD resident session section missing');
3505-
includes(residentArchitectBridgePy, 'run_reddog_readonly_audit_research_decision_e2e', 'RAS-002: bridge must delegate to resident E2E runtime');
3510+
includes(residentArchitectBridgePy, 'run_reddog_resident_architect_durable_agentdb_cycle', 'RAS-002: bridge must delegate to resident durable runtime');
35063511
includes(residentArchitectBridgePy, 'explicit_resident_architect_session_requested', 'RAS-002: bridge must require explicit request');
35073512
includes(residentArchitectBridgePy, 'no_holoindex_reindex_performed', 'RAS-002: bridge must surface no-reindex attestation');
35083513
includes(residentArchitectBridgePy, 'no_repo_mutation_performed', 'RAS-002: bridge must surface no-repo-mutation attestation');

modules/ai_intelligence/ai_gateway/INTERFACE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ enabled automatically by `main.py` and does not perform verification, promotion,
162162
PatternMemory writes, HoloIndex mutation, runtime binding, command execution, or
163163
repository mutation.
164164

165+
OpenRouter candidates use provider `openrouter` and an exact model ID such as
166+
`moonshotai/kimi-k3`. The provider is available only through explicit configured
167+
gateway assignments and allowlisting; it is not inserted into normal fallback
168+
routing. Kimi K3 remains an AutoResearch candidate until signed benchmark and
169+
promotion evidence authorizes a production binding. Its configured provider
170+
records separate input/output token prices for bounded cost-gate estimates.
171+
165172
The campaign execution bootstrap accepts this runner only through the explicit
166173
`configured_gateway` mode, an outside-repo prompt-record file, an explicit
167174
provider allowlist, an outside-repo output-evidence JSONL path, and the

modules/ai_intelligence/ai_gateway/ModLog.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# AI Gateway Module Change Log
22

3+
## [2026-07-18] - Kimi K3 OpenRouter AutoResearch Candidate
4+
5+
**Who:** 0102 Codex
6+
**Type:** Model Candidate / Configured Gateway Wiring
7+
**Slice:** MODEL_AUTORESEARCH_OPENROUTER_KIMI_K3_PHASE1
8+
9+
**What:** Added Kimi K3 to the static candidate catalog and enabled the existing
10+
configured AutoResearch gateway to target exact OpenRouter model assignments.
11+
12+
**Why:** The combination harness and campaign loop were already implemented, but
13+
`AIGatewayConfiguredModelCaller` could not execute an OpenRouter candidate. This
14+
prevented governed held-out comparison of Kimi K3 with RedDog's existing panel.
15+
16+
**Truth Boundary:**
17+
- IMPLEMENTED: explicit `openrouter` provider, exact `moonshotai/kimi-k3`
18+
candidate metadata, mandatory-max-reasoning request shape, 4096-token default,
19+
separate input/output cost accounting, catalog and caller tests.
20+
- NOT IMPLEMENTED: automatic fallback to OpenRouter, automatic promotion,
21+
implicit candidate-pool mutation, or bypass of benchmark/verifier receipts.
22+
23+
**WSP References:** WSP 15, WSP 22, WSP 50, WSP 84, WSP 97.
24+
25+
**WSP_15 Score:** Complexity 3 + Importance 4 + Deferability 4 + Impact 4 =
26+
15 (P1).
27+
28+
---
29+
330
## [2026-07-17] - Model AutoResearch Cycle Feedback Chain Main Preflight
431

532
**Who:** 0102 Codex

0 commit comments

Comments
 (0)