sneakoscope 2.0.2 → 2.0.5
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/README.md +12 -8
- package/crates/sks-core/Cargo.lock +1 -1
- package/crates/sks-core/Cargo.toml +1 -1
- package/crates/sks-core/src/main.rs +1 -1
- package/dist/.sks-build-stamp.json +4 -4
- package/dist/bin/sks.js +1 -1
- package/dist/build-manifest.json +86 -8
- package/dist/commands/doctor.js +14 -0
- package/dist/core/agents/agent-orchestrator.js +70 -4
- package/dist/core/agents/agent-patch-proof.js +5 -0
- package/dist/core/agents/agent-proof-evidence.js +61 -0
- package/dist/core/agents/agent-roster.js +35 -6
- package/dist/core/agents/agent-schema.js +1 -1
- package/dist/core/agents/native-worker-backend-router.js +31 -9
- package/dist/core/agents/ollama-worker-config.js +164 -15
- package/dist/core/codex/codex-0-137-compat.js +119 -0
- package/dist/core/codex-control/codex-control-proof.js +4 -1
- package/dist/core/codex-control/codex-fake-sdk-adapter.js +20 -0
- package/dist/core/codex-control/codex-output-schemas.js +5 -1
- package/dist/core/codex-control/codex-sdk-capability.js +1 -1
- package/dist/core/codex-control/codex-task-runner.js +329 -5
- package/dist/core/codex-control/gpt-final-arbiter.js +160 -0
- package/dist/core/codex-control/gpt-final-context-compressor.js +17 -0
- package/dist/core/codex-control/gpt-final-proof-pack.js +120 -0
- package/dist/core/codex-control/gpt-final-review-schema.js +71 -0
- package/dist/core/codex-control/python-codex-sdk-adapter.js +197 -0
- package/dist/core/codex-control/python-codex-sdk-event-translator.js +14 -0
- package/dist/core/commands/local-model-command.js +79 -18
- package/dist/core/commands/naruto-command.js +195 -12
- package/dist/core/commands/run-command.js +6 -2
- package/dist/core/doctor/doctor-readiness-matrix.js +34 -0
- package/dist/core/feature-fixtures.js +4 -0
- package/dist/core/fsx.js +1 -1
- package/dist/core/git-simple.js +143 -4
- package/dist/core/local-llm/local-collaboration-policy.js +93 -0
- package/dist/core/local-llm/local-llm-backpressure.js +20 -0
- package/dist/core/local-llm/local-llm-capability.js +29 -0
- package/dist/core/local-llm/local-llm-client.js +100 -0
- package/dist/core/local-llm/local-llm-config.js +20 -0
- package/dist/core/local-llm/local-llm-context-cache.js +21 -0
- package/dist/core/local-llm/local-llm-control-adapter.js +101 -0
- package/dist/core/local-llm/local-llm-json-repair.js +52 -0
- package/dist/core/local-llm/local-llm-metrics.js +42 -0
- package/dist/core/local-llm/local-llm-ollama-client.js +67 -0
- package/dist/core/local-llm/local-llm-openai-compatible-client.js +30 -0
- package/dist/core/local-llm/local-llm-prompt-cache.js +12 -0
- package/dist/core/local-llm/local-llm-scheduler.js +29 -0
- package/dist/core/local-llm/local-llm-schema-enforcer.js +15 -0
- package/dist/core/local-llm/local-llm-smoke.js +83 -0
- package/dist/core/local-llm/local-llm-warmup.js +20 -0
- package/dist/core/local-llm/local-worker-eligibility.js +27 -0
- package/dist/core/naruto/hardware-capacity-probe.js +36 -0
- package/dist/core/naruto/naruto-active-pool.js +118 -0
- package/dist/core/naruto/naruto-backpressure.js +13 -0
- package/dist/core/naruto/naruto-concurrency-governor.js +65 -0
- package/dist/core/naruto/naruto-finalizer.js +18 -0
- package/dist/core/naruto/naruto-generation-scheduler.js +18 -0
- package/dist/core/naruto/naruto-gpt-final-pack.js +49 -0
- package/dist/core/naruto/naruto-parallel-patch-apply.js +95 -0
- package/dist/core/naruto/naruto-patch-transaction-batch.js +42 -0
- package/dist/core/naruto/naruto-role-policy.js +107 -0
- package/dist/core/naruto/naruto-verification-dag.js +42 -0
- package/dist/core/naruto/naruto-verification-pool.js +18 -0
- package/dist/core/naruto/naruto-work-graph.js +198 -0
- package/dist/core/naruto/naruto-work-item.js +40 -0
- package/dist/core/naruto/naruto-work-stealing.js +11 -0
- package/dist/core/naruto/resource-pressure-monitor.js +32 -0
- package/dist/core/pipeline/final-gpt-patch-stage.js +31 -0
- package/dist/core/pipeline/final-gpt-review-stage.js +5 -0
- package/dist/core/pipeline/finalize-pipeline-result.js +58 -0
- package/dist/core/pipeline/gpt-final-required.js +12 -0
- package/dist/core/prompt/prompt-placeholder-guard.js +30 -0
- package/dist/core/router/capability-card.js +13 -0
- package/dist/core/router/route-cache.js +3 -0
- package/dist/core/router/ultra-router.js +2 -1
- package/dist/core/routes.js +4 -4
- package/dist/core/safety/mutation-guard.js +2 -0
- package/dist/core/update-check.js +60 -25
- package/dist/core/version.js +1 -1
- package/dist/core/zellij/zellij-lane-runtime.js +2 -2
- package/dist/core/zellij/zellij-naruto-dashboard.js +36 -0
- package/dist/core/zellij/zellij-worker-pane-manager.js +4 -4
- package/dist/scripts/blackbox-command-import-smoke.js +10 -1
- package/dist/scripts/check-package-boundary.js +12 -3
- package/dist/scripts/codex-0-137-compat-check.js +27 -0
- package/dist/scripts/codex-environment-scoped-approvals-check.js +10 -0
- package/dist/scripts/codex-plugin-list-json-check.js +8 -0
- package/dist/scripts/codex-sdk-team-naruto-agent-pipeline-check.js +2 -1
- package/dist/scripts/codex-thread-runtime-choice-check.js +10 -0
- package/dist/scripts/gpt-final-arbiter-check.js +63 -0
- package/dist/scripts/gpt-final-arbiter-performance-check.js +36 -0
- package/dist/scripts/local-collab-all-pipelines-final-gpt-check.js +21 -0
- package/dist/scripts/local-collab-gpt-final-availability-check.js +58 -0
- package/dist/scripts/local-collab-no-local-only-final-check.js +27 -0
- package/dist/scripts/local-collab-policy-check.js +17 -0
- package/dist/scripts/local-llm-all-pipelines-check.js +11 -0
- package/dist/scripts/local-llm-cache-performance-check.js +10 -0
- package/dist/scripts/local-llm-capability-check.js +14 -0
- package/dist/scripts/local-llm-smoke-check.js +23 -0
- package/dist/scripts/local-llm-structured-output-check.js +11 -0
- package/dist/scripts/local-llm-throughput-check.js +10 -0
- package/dist/scripts/local-llm-tool-call-repair-check.js +10 -0
- package/dist/scripts/local-llm-warmup-check.js +11 -0
- package/dist/scripts/naruto-active-pool-check.js +27 -0
- package/dist/scripts/naruto-concurrency-governor-check.js +52 -0
- package/dist/scripts/naruto-gpt-final-pack-check.js +34 -0
- package/dist/scripts/naruto-parallel-patch-apply-check.js +41 -0
- package/dist/scripts/naruto-real-local-gpt-final-smoke.js +16 -0
- package/dist/scripts/naruto-role-distribution-check.js +23 -0
- package/dist/scripts/naruto-shadow-clone-swarm-check.js +6 -0
- package/dist/scripts/naruto-verification-pool-check.js +36 -0
- package/dist/scripts/naruto-work-graph-check.js +24 -0
- package/dist/scripts/naruto-zellij-massive-ui-check.js +23 -0
- package/dist/scripts/prompt-placeholder-guard-check.js +33 -0
- package/dist/scripts/python-codex-sdk-all-pipelines-check.js +47 -0
- package/dist/scripts/python-codex-sdk-capability-check.js +75 -0
- package/dist/scripts/python-codex-sdk-sandbox-policy-check.js +10 -0
- package/dist/scripts/python-codex-sdk-stream-bridge-check.js +12 -0
- package/dist/scripts/release-parallel-check.js +1 -1
- package/dist/scripts/release-real-check.js +5 -0
- package/dist/scripts/zellij-worker-pane-manager-check.js +1 -1
- package/package.json +38 -4
- package/schemas/local-llm/local-collaboration-policy.schema.json +57 -0
- package/schemas/local-llm/local-model-config.schema.json +74 -0
- package/schemas/naruto/naruto-concurrency-governor.schema.json +21 -0
- package/schemas/naruto/naruto-work-graph.schema.json +22 -0
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Set up this agent project with Sneakoscope Codex. Use [[mandarange/Sneakoscope-C
|
|
|
16
16
|
|
|
17
17
|
## Current Release
|
|
18
18
|
|
|
19
|
-
SKS **2.0.
|
|
19
|
+
SKS **2.0.5** is a P0 Codex App Fast UI and MAD Zellij worker-pane closure patch on top of the 2.0 execution layer. `sks --mad` now relies on launch-time Fast/high overrides instead of user-level Codex config rewrites, safe Fast UI repair runs through `sks doctor --fix`, provider badges read env/auth/config.toml consistently, and interactive MAD worker panes attach to the real Zellij session as scheduler slots spawn.
|
|
20
20
|
|
|
21
21
|
What changed:
|
|
22
22
|
|
|
@@ -398,9 +398,9 @@ Manual fan-out syntax:
|
|
|
398
398
|
|
|
399
399
|
Effort is assigned per agent. Simple read-only/docs slices can run low, ordinary tooling and lease mapping use medium, safety/DB/schema/release lanes use high, and frontier/forensic research can escalate to xhigh. If a lease conflict, schema failure, proof blocker, DB risk, or release risk appears, the parent can escalate that lane while keeping unrelated lanes cheaper and faster.
|
|
400
400
|
|
|
401
|
-
### Naruto
|
|
401
|
+
### Naruto Massive Parallel Work Swarm (`$Naruto`)
|
|
402
402
|
|
|
403
|
-
`$Naruto` (影分身 / Kage Bunshin no Jutsu) is
|
|
403
|
+
`$Naruto` (影分身 / Kage Bunshin no Jutsu) is the hardware-safe massive parallel work mode of the native agent kernel. It is not limited to validation. A Naruto run builds a mixed work graph, keeps a safe active worker pool full, and assigns clones to implementation, modification, test generation, verification, research, documentation, conflict resolution, rollback planning, integration support, and GPT final review input work. It lifts the standard 20-agent ceiling to **up to 100 total clone generations** for this route while keeping active workers under the live hardware, lease, memory, terminal UI, file descriptor, local LLM, and remote API caps.
|
|
404
404
|
|
|
405
405
|
```sh
|
|
406
406
|
sks naruto run "sweep the codebase for TODO comments and summarize"
|
|
@@ -411,9 +411,11 @@ sks naruto status
|
|
|
411
411
|
|
|
412
412
|
Aliases: `$ShadowClone`, `$Kagebunshin`, and the CLI flag `sks --naruto`.
|
|
413
413
|
|
|
414
|
-
- **
|
|
414
|
+
- **Hardware-safe governor:** `--clones N` is the total work fan-out, but `$Naruto` never spawns the whole count at once. Live concurrency is throttled by current load, memory, file descriptors, Zellij pane budget, local LLM request budget, remote API budget, disk pressure, pending queue, and active lease conflicts.
|
|
415
|
+
- **Dynamic active pool:** completed workers are drained and replaced while runnable work remains, so the active pool does not sit empty between generations.
|
|
415
416
|
- **Dynamic per-clone effort (like Team):** truly simple / no-tool work runs at `low`, any tool use lifts a clone to `medium` (never high/xhigh), and every clone runs in fast service tier.
|
|
416
|
-
- **Safe parallel writes:** clones
|
|
417
|
+
- **Safe parallel writes:** write-capable clones produce patch envelopes for leased files. Non-overlapping envelopes can apply in parallel; overlapping envelopes serialize or route to conflict resolution. Local worker output remains a draft until the GPT final arbiter approves or modifies it.
|
|
418
|
+
- **Massive UI without pane overload:** Zellij shows visible active worker panes up to the UI cap and tracks the remaining active headless workers in the Naruto dashboard.
|
|
417
419
|
|
|
418
420
|
See [docs/naruto.md](docs/naruto.md) for the full reference.
|
|
419
421
|
|
|
@@ -513,18 +515,20 @@ $DB inspect this migration for destructive risk
|
|
|
513
515
|
|
|
514
516
|
### Optional Local LLM Workers
|
|
515
517
|
|
|
516
|
-
Local
|
|
518
|
+
Local model workers are off by default, so SKS stays GPT-only unless you explicitly enable them. Use the Codex App prompt commands:
|
|
517
519
|
|
|
518
520
|
```text
|
|
519
521
|
$with-local-llm-on
|
|
520
522
|
$with-local-llm-off
|
|
521
523
|
```
|
|
522
524
|
|
|
523
|
-
When enabled,
|
|
525
|
+
When enabled, SKS auto-detects an installed local model from a running MLX LM server, OpenAI-compatible local server, or Ollama. If no local model is available, activation stays blocked and reports that no local model was found. The local model can only help with policy-eligible simple code patch-envelope work or read-only collection. GPT/Codex still owns strategy, planning, design, review, verification, safety, and integration. Check or tune the machine-local setting from the terminal:
|
|
524
526
|
|
|
525
527
|
```sh
|
|
526
528
|
sks with-local-llm status --json
|
|
527
|
-
sks with-local-llm on
|
|
529
|
+
sks with-local-llm on
|
|
530
|
+
sks with-local-llm on --provider mlx-lm --model mlx-community/Qwen3.6-35B-A3B-4bit --base-url http://127.0.0.1:8080
|
|
531
|
+
sks with-local-llm on --provider ollama --model rafw007/qwen36-a3b-claude-coder:q4_K_M
|
|
528
532
|
sks with-local-llm off
|
|
529
533
|
```
|
|
530
534
|
|
|
@@ -4,7 +4,7 @@ use std::io::{self, Read, Seek, SeekFrom};
|
|
|
4
4
|
fn main() {
|
|
5
5
|
let mut args = std::env::args().skip(1);
|
|
6
6
|
match args.next().as_deref() {
|
|
7
|
-
Some("--version") => println!("sks-rs 2.0.
|
|
7
|
+
Some("--version") => println!("sks-rs 2.0.5"),
|
|
8
8
|
Some("compact-info") => {
|
|
9
9
|
let mut input = String::new();
|
|
10
10
|
let _ = io::stdin().read_to_string(&mut input);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "sks.dist-build-stamp.v1",
|
|
3
3
|
"package_name": "sneakoscope",
|
|
4
|
-
"package_version": "2.0.
|
|
5
|
-
"source_digest": "
|
|
6
|
-
"source_file_count":
|
|
7
|
-
"built_at_source_time":
|
|
4
|
+
"package_version": "2.0.5",
|
|
5
|
+
"source_digest": "696706cb9d175c4200c967130fbc5e680f4b6c905ec6e7fad5b1671827bcb4cb",
|
|
6
|
+
"source_file_count": 1948,
|
|
7
|
+
"built_at_source_time": 1780613485190
|
|
8
8
|
}
|
package/dist/bin/sks.js
CHANGED
package/dist/build-manifest.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": "sks.dist-build.v2",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"package_version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
|
+
"package_version": "2.0.5",
|
|
5
5
|
"typescript": true,
|
|
6
6
|
"mjs_runtime_files": 0,
|
|
7
|
-
"compiled_file_count":
|
|
8
|
-
"compiled_js_count":
|
|
7
|
+
"compiled_file_count": 1014,
|
|
8
|
+
"compiled_js_count": 1014,
|
|
9
9
|
"compiled_dts_count": 0,
|
|
10
|
-
"source_digest": "
|
|
11
|
-
"source_file_count":
|
|
12
|
-
"source_files_hash": "
|
|
13
|
-
"source_list_hash": "
|
|
10
|
+
"source_digest": "696706cb9d175c4200c967130fbc5e680f4b6c905ec6e7fad5b1671827bcb4cb",
|
|
11
|
+
"source_file_count": 1948,
|
|
12
|
+
"source_files_hash": "50906865545a9076d7b2736ee379a428160a8869749b85ee79c4ddab8eab4b12",
|
|
13
|
+
"source_list_hash": "50906865545a9076d7b2736ee379a428160a8869749b85ee79c4ddab8eab4b12",
|
|
14
14
|
"src_mjs_runtime_files": 0,
|
|
15
15
|
"dist_stamp_schema": "sks.dist-build-stamp.v1",
|
|
16
16
|
"files": [
|
|
@@ -212,6 +212,12 @@
|
|
|
212
212
|
"core/codex-control/codex-sdk-sandbox-policy.js",
|
|
213
213
|
"core/codex-control/codex-task-runner.js",
|
|
214
214
|
"core/codex-control/codex-thread-registry.js",
|
|
215
|
+
"core/codex-control/gpt-final-arbiter.js",
|
|
216
|
+
"core/codex-control/gpt-final-context-compressor.js",
|
|
217
|
+
"core/codex-control/gpt-final-proof-pack.js",
|
|
218
|
+
"core/codex-control/gpt-final-review-schema.js",
|
|
219
|
+
"core/codex-control/python-codex-sdk-adapter.js",
|
|
220
|
+
"core/codex-control/python-codex-sdk-event-translator.js",
|
|
215
221
|
"core/codex-control/schemas/agent-worker-result.schema.js",
|
|
216
222
|
"core/codex-exec-output-schema.js",
|
|
217
223
|
"core/codex-hooks/codex-hook-actual-discovery.js",
|
|
@@ -233,6 +239,7 @@
|
|
|
233
239
|
"core/codex/codex-0-134-compat.js",
|
|
234
240
|
"core/codex/codex-0-135-compat.js",
|
|
235
241
|
"core/codex/codex-0-136-compat.js",
|
|
242
|
+
"core/codex/codex-0-137-compat.js",
|
|
236
243
|
"core/codex/codex-cli-syntax-builder.js",
|
|
237
244
|
"core/codex/codex-config-eperm-repair.js",
|
|
238
245
|
"core/codex/codex-config-readability.js",
|
|
@@ -357,6 +364,23 @@
|
|
|
357
364
|
"core/init.js",
|
|
358
365
|
"core/json-schema-validator.js",
|
|
359
366
|
"core/language-preference.js",
|
|
367
|
+
"core/local-llm/local-collaboration-policy.js",
|
|
368
|
+
"core/local-llm/local-llm-backpressure.js",
|
|
369
|
+
"core/local-llm/local-llm-capability.js",
|
|
370
|
+
"core/local-llm/local-llm-client.js",
|
|
371
|
+
"core/local-llm/local-llm-config.js",
|
|
372
|
+
"core/local-llm/local-llm-context-cache.js",
|
|
373
|
+
"core/local-llm/local-llm-control-adapter.js",
|
|
374
|
+
"core/local-llm/local-llm-json-repair.js",
|
|
375
|
+
"core/local-llm/local-llm-metrics.js",
|
|
376
|
+
"core/local-llm/local-llm-ollama-client.js",
|
|
377
|
+
"core/local-llm/local-llm-openai-compatible-client.js",
|
|
378
|
+
"core/local-llm/local-llm-prompt-cache.js",
|
|
379
|
+
"core/local-llm/local-llm-scheduler.js",
|
|
380
|
+
"core/local-llm/local-llm-schema-enforcer.js",
|
|
381
|
+
"core/local-llm/local-llm-smoke.js",
|
|
382
|
+
"core/local-llm/local-llm-warmup.js",
|
|
383
|
+
"core/local-llm/local-worker-eligibility.js",
|
|
360
384
|
"core/loop-blocker.js",
|
|
361
385
|
"core/mad-sks/audit-ledger.js",
|
|
362
386
|
"core/mad-sks/authorization-manifest.js",
|
|
@@ -387,6 +411,22 @@
|
|
|
387
411
|
"core/mission.js",
|
|
388
412
|
"core/mistake-memory.js",
|
|
389
413
|
"core/mistake-recall.js",
|
|
414
|
+
"core/naruto/hardware-capacity-probe.js",
|
|
415
|
+
"core/naruto/naruto-active-pool.js",
|
|
416
|
+
"core/naruto/naruto-backpressure.js",
|
|
417
|
+
"core/naruto/naruto-concurrency-governor.js",
|
|
418
|
+
"core/naruto/naruto-finalizer.js",
|
|
419
|
+
"core/naruto/naruto-generation-scheduler.js",
|
|
420
|
+
"core/naruto/naruto-gpt-final-pack.js",
|
|
421
|
+
"core/naruto/naruto-parallel-patch-apply.js",
|
|
422
|
+
"core/naruto/naruto-patch-transaction-batch.js",
|
|
423
|
+
"core/naruto/naruto-role-policy.js",
|
|
424
|
+
"core/naruto/naruto-verification-dag.js",
|
|
425
|
+
"core/naruto/naruto-verification-pool.js",
|
|
426
|
+
"core/naruto/naruto-work-graph.js",
|
|
427
|
+
"core/naruto/naruto-work-item.js",
|
|
428
|
+
"core/naruto/naruto-work-stealing.js",
|
|
429
|
+
"core/naruto/resource-pressure-monitor.js",
|
|
390
430
|
"core/no-question-guard.js",
|
|
391
431
|
"core/openclaw.js",
|
|
392
432
|
"core/perf-bench.js",
|
|
@@ -398,6 +438,10 @@
|
|
|
398
438
|
"core/pipeline.js",
|
|
399
439
|
"core/pipeline/active-context.js",
|
|
400
440
|
"core/pipeline/agent-stage-policy.js",
|
|
441
|
+
"core/pipeline/final-gpt-patch-stage.js",
|
|
442
|
+
"core/pipeline/final-gpt-review-stage.js",
|
|
443
|
+
"core/pipeline/finalize-pipeline-result.js",
|
|
444
|
+
"core/pipeline/gpt-final-required.js",
|
|
401
445
|
"core/pipeline/pipeline-plan-writer.js",
|
|
402
446
|
"core/pipeline/plan-schema.js",
|
|
403
447
|
"core/pipeline/prompt-context-answer.js",
|
|
@@ -430,6 +474,7 @@
|
|
|
430
474
|
"core/ppt.js",
|
|
431
475
|
"core/preflight/parallel-preflight-engine.js",
|
|
432
476
|
"core/prompt-context-builder.js",
|
|
477
|
+
"core/prompt/prompt-placeholder-guard.js",
|
|
433
478
|
"core/proof-field.js",
|
|
434
479
|
"core/proof/auto-finalize.js",
|
|
435
480
|
"core/proof/claim-ledger.js",
|
|
@@ -560,6 +605,7 @@
|
|
|
560
605
|
"core/zellij/zellij-lane-runtime.js",
|
|
561
606
|
"core/zellij/zellij-launcher.js",
|
|
562
607
|
"core/zellij/zellij-layout-builder.js",
|
|
608
|
+
"core/zellij/zellij-naruto-dashboard.js",
|
|
563
609
|
"core/zellij/zellij-pane-proof.js",
|
|
564
610
|
"core/zellij/zellij-screen-proof.js",
|
|
565
611
|
"core/zellij/zellij-worker-pane-manager.js",
|
|
@@ -671,6 +717,7 @@
|
|
|
671
717
|
"scripts/codex-0-134-runner-truth-check.js",
|
|
672
718
|
"scripts/codex-0-135-compat-check.js",
|
|
673
719
|
"scripts/codex-0-136-compat-check.js",
|
|
720
|
+
"scripts/codex-0-137-compat-check.js",
|
|
674
721
|
"scripts/codex-app-fast-ui-preservation-check.js",
|
|
675
722
|
"scripts/codex-app-provider-badge-check.js",
|
|
676
723
|
"scripts/codex-app-ui-clobber-guard-check.js",
|
|
@@ -688,6 +735,7 @@
|
|
|
688
735
|
"scripts/codex-control-structured-output-check.js",
|
|
689
736
|
"scripts/codex-control-thread-registry-check.js",
|
|
690
737
|
"scripts/codex-control-tool-call-sequence-repair-check.js",
|
|
738
|
+
"scripts/codex-environment-scoped-approvals-check.js",
|
|
691
739
|
"scripts/codex-exec-output-schema-actual-syntax-check.js",
|
|
692
740
|
"scripts/codex-fast-mode-profile-propagation-check.js",
|
|
693
741
|
"scripts/codex-history-search-check.js",
|
|
@@ -702,6 +750,7 @@
|
|
|
702
750
|
"scripts/codex-managed-proxy-env-check.js",
|
|
703
751
|
"scripts/codex-output-schema-fixture-check.js",
|
|
704
752
|
"scripts/codex-permission-profiles-check.js",
|
|
753
|
+
"scripts/codex-plugin-list-json-check.js",
|
|
705
754
|
"scripts/codex-profile-primary-check.js",
|
|
706
755
|
"scripts/codex-project-config-policy-merge-regression.js",
|
|
707
756
|
"scripts/codex-project-config-policy-splitter-check.js",
|
|
@@ -723,6 +772,7 @@
|
|
|
723
772
|
"scripts/codex-sdk-thread-registry-check.js",
|
|
724
773
|
"scripts/codex-sdk-ux-ppt-review-pipeline-check.js",
|
|
725
774
|
"scripts/codex-sdk-zellij-pane-binding-check.js",
|
|
775
|
+
"scripts/codex-thread-runtime-choice-check.js",
|
|
726
776
|
"scripts/codex-web-adapter-check.js",
|
|
727
777
|
"scripts/computer-use-live-evidence-check.js",
|
|
728
778
|
"scripts/computer-use-live-optional-check.js",
|
|
@@ -763,6 +813,8 @@
|
|
|
763
813
|
"scripts/flagship-proof-graph-v4-check.js",
|
|
764
814
|
"scripts/git-precommit-fixture-check.js",
|
|
765
815
|
"scripts/goal-mode-official-default-check.js",
|
|
816
|
+
"scripts/gpt-final-arbiter-check.js",
|
|
817
|
+
"scripts/gpt-final-arbiter-performance-check.js",
|
|
766
818
|
"scripts/gpt-image-2-real-file-smoke.js",
|
|
767
819
|
"scripts/gpt-image-2-request-validator-check.js",
|
|
768
820
|
"scripts/hooks-0.134-context-parity-check.js",
|
|
@@ -792,6 +844,18 @@
|
|
|
792
844
|
"scripts/lib/real-codex-parallel-gate.js",
|
|
793
845
|
"scripts/lib/real-codex-parallel-proof-fixture.js",
|
|
794
846
|
"scripts/lib/valid-png-fixture.js",
|
|
847
|
+
"scripts/local-collab-all-pipelines-final-gpt-check.js",
|
|
848
|
+
"scripts/local-collab-gpt-final-availability-check.js",
|
|
849
|
+
"scripts/local-collab-no-local-only-final-check.js",
|
|
850
|
+
"scripts/local-collab-policy-check.js",
|
|
851
|
+
"scripts/local-llm-all-pipelines-check.js",
|
|
852
|
+
"scripts/local-llm-cache-performance-check.js",
|
|
853
|
+
"scripts/local-llm-capability-check.js",
|
|
854
|
+
"scripts/local-llm-smoke-check.js",
|
|
855
|
+
"scripts/local-llm-structured-output-check.js",
|
|
856
|
+
"scripts/local-llm-throughput-check.js",
|
|
857
|
+
"scripts/local-llm-tool-call-repair-check.js",
|
|
858
|
+
"scripts/local-llm-warmup-check.js",
|
|
795
859
|
"scripts/loop-blocker-check.js",
|
|
796
860
|
"scripts/mad-preflight-blocks-unreadable-config-check.js",
|
|
797
861
|
"scripts/mad-sks-actual-executor-blackbox.js",
|
|
@@ -818,7 +882,16 @@
|
|
|
818
882
|
"scripts/mcp-tool-naming-parity-check.js",
|
|
819
883
|
"scripts/memory-summary-rebuild-check.js",
|
|
820
884
|
"scripts/mutation-callsite-coverage-check.js",
|
|
885
|
+
"scripts/naruto-active-pool-check.js",
|
|
886
|
+
"scripts/naruto-concurrency-governor-check.js",
|
|
887
|
+
"scripts/naruto-gpt-final-pack-check.js",
|
|
888
|
+
"scripts/naruto-parallel-patch-apply-check.js",
|
|
889
|
+
"scripts/naruto-real-local-gpt-final-smoke.js",
|
|
890
|
+
"scripts/naruto-role-distribution-check.js",
|
|
821
891
|
"scripts/naruto-shadow-clone-swarm-check.js",
|
|
892
|
+
"scripts/naruto-verification-pool-check.js",
|
|
893
|
+
"scripts/naruto-work-graph-check.js",
|
|
894
|
+
"scripts/naruto-zellij-massive-ui-check.js",
|
|
822
895
|
"scripts/non-recursive-pipeline-check.js",
|
|
823
896
|
"scripts/npm-publish-performance-check.js",
|
|
824
897
|
"scripts/official-docs-compat-report.js",
|
|
@@ -843,8 +916,13 @@
|
|
|
843
916
|
"scripts/prepublish-fast-check.js",
|
|
844
917
|
"scripts/prepublish-release-check-or-fast.js",
|
|
845
918
|
"scripts/priority-full-closure-check.js",
|
|
919
|
+
"scripts/prompt-placeholder-guard-check.js",
|
|
846
920
|
"scripts/provider-badge-context-check.js",
|
|
847
921
|
"scripts/provider-context-config-toml-check.js",
|
|
922
|
+
"scripts/python-codex-sdk-all-pipelines-check.js",
|
|
923
|
+
"scripts/python-codex-sdk-capability-check.js",
|
|
924
|
+
"scripts/python-codex-sdk-sandbox-policy-check.js",
|
|
925
|
+
"scripts/python-codex-sdk-stream-bridge-check.js",
|
|
848
926
|
"scripts/python-tools-smoke-check.js",
|
|
849
927
|
"scripts/qa-actual-route-backfill-check.js",
|
|
850
928
|
"scripts/qa-backfill-route-blackbox.js",
|
package/dist/commands/doctor.js
CHANGED
|
@@ -17,6 +17,7 @@ import { inventoryCodexPermissionProfiles } from '../core/codex/codex-permission
|
|
|
17
17
|
import { appendMigrationEvents, hashConfigText } from '../core/migration/migration-transaction-journal.js';
|
|
18
18
|
import { repairCodexAppFastUi } from '../core/codex-app/codex-app-fast-ui-repair.js';
|
|
19
19
|
import { resolveProviderContext } from '../core/provider/provider-context.js';
|
|
20
|
+
import { readLocalModelConfig } from '../core/agents/ollama-worker-config.js';
|
|
20
21
|
export async function run(_command, args = []) {
|
|
21
22
|
let setupRepair = null;
|
|
22
23
|
let migrationPreFix = null;
|
|
@@ -136,6 +137,7 @@ export async function run(_command, args = []) {
|
|
|
136
137
|
}))
|
|
137
138
|
: codexAppUiPlan;
|
|
138
139
|
const zellij = await checkZellijCapability({ root, require: process.env.SKS_REQUIRE_ZELLIJ === '1' });
|
|
140
|
+
const localModel = await readLocalModelConfig().catch(() => null);
|
|
139
141
|
const permissionProfiles = await inventoryCodexPermissionProfiles(root, { writeReport: true });
|
|
140
142
|
const globalSksInstallCleanup = flag(args, '--fix') && !flag(args, '--local-only')
|
|
141
143
|
? await cleanDuplicateGlobalSksInstalls({ root, fix: true }).catch((err) => ({ schema: 'sks.global-sks-install-cleanup.v1', ok: false, fix: true, error: err?.message || String(err), blockers: ['global_sks_install_cleanup_exception'] }))
|
|
@@ -151,6 +153,7 @@ export async function run(_command, args = []) {
|
|
|
151
153
|
codex_doctor: codexDoctor,
|
|
152
154
|
require_codex_doctor: flag(args, '--fix') || flag(args, '--require-actual-codex'),
|
|
153
155
|
zellij,
|
|
156
|
+
local_model: localModel,
|
|
154
157
|
repair: configRepair,
|
|
155
158
|
codex_app_ui: codexAppUi,
|
|
156
159
|
require_codex_cli_config_load: flag(args, '--fix') || flag(args, '--require-actual-codex'),
|
|
@@ -175,6 +178,7 @@ export async function run(_command, args = []) {
|
|
|
175
178
|
codex_doctor: codexDoctor,
|
|
176
179
|
codex_doctor_diff: codexDoctorDiff,
|
|
177
180
|
zellij,
|
|
181
|
+
local_model: localModel,
|
|
178
182
|
zellij_readiness: zellijReadiness,
|
|
179
183
|
codex_permission_profiles: permissionProfiles,
|
|
180
184
|
imagegen: {
|
|
@@ -234,6 +238,16 @@ export async function run(_command, args = []) {
|
|
|
234
238
|
}
|
|
235
239
|
}
|
|
236
240
|
console.log(`codex-lb: ${codexLb.ok ? 'ok' : `warning ${codexLb.circuit?.state || 'unknown'}`}`);
|
|
241
|
+
if (localModel) {
|
|
242
|
+
console.log('Local LLM:');
|
|
243
|
+
console.log(` enabled: ${localModel.enabled ? 'yes' : 'no'}`);
|
|
244
|
+
console.log(` status: ${localModel.status}`);
|
|
245
|
+
console.log(` provider: ${localModel.provider}`);
|
|
246
|
+
console.log(` model: ${localModel.model}`);
|
|
247
|
+
console.log(` endpoint: ${localModel.base_url}`);
|
|
248
|
+
console.log(` last smoke: ${localModel.last_smoke?.ok ? `ok ${localModel.last_smoke.latency_ms || 0}ms ${localModel.last_smoke.tokens_per_second || 0} tok/s` : 'missing'}`);
|
|
249
|
+
console.log(' final arbiter: GPT required');
|
|
250
|
+
}
|
|
237
251
|
console.log(`Permissions: config profile and permission profile are tracked separately (${permissionProfiles.codex_config_profile_field}, ${permissionProfiles.codex_permission_profile_field})`);
|
|
238
252
|
console.log('Ready:');
|
|
239
253
|
console.log(` cli_ready: ${ready.cli_ready ? 'yes' : 'no'}`);
|
|
@@ -49,6 +49,9 @@ import { writeNativeCliSessionProof } from './native-cli-session-proof.js';
|
|
|
49
49
|
import { writeNoSubagentScalingPolicy } from './no-subagent-scaling-policy.js';
|
|
50
50
|
import { runCodexTask } from '../codex-control/codex-control-plane.js';
|
|
51
51
|
import { CODEX_AGENT_WORKER_RESULT_SCHEMA_ID, codexAgentWorkerResultSchema } from '../codex-control/schemas/agent-worker-result.schema.js';
|
|
52
|
+
import { resolveLocalCollaborationPolicy, localCollaborationParticipated } from '../local-llm/local-collaboration-policy.js';
|
|
53
|
+
import { runFinalGptReviewStage } from '../pipeline/final-gpt-review-stage.js';
|
|
54
|
+
import { selectFinalGptPatchSource } from '../pipeline/final-gpt-patch-stage.js';
|
|
52
55
|
export async function runNativeAgentOrchestrator(opts = {}) {
|
|
53
56
|
const root = path.resolve(opts.root || process.cwd());
|
|
54
57
|
const prompt = String(opts.prompt || 'Native agent run');
|
|
@@ -369,15 +372,51 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
369
372
|
});
|
|
370
373
|
const noSubagentScalingPolicy = await writeNoSubagentScalingPolicy(ledgerRoot, { nativeProof: nativeCliSessionProof });
|
|
371
374
|
const fastModePropagation = await writeFastModePropagationProof(ledgerRoot, { policy: fastModePolicy, backend, results });
|
|
375
|
+
const localCollaborationPolicy = resolveLocalCollaborationPolicy();
|
|
376
|
+
await writeJsonAtomic(path.join(ledgerRoot, 'local-collaboration-policy.json'), localCollaborationPolicy);
|
|
377
|
+
const localParticipated = localCollaborationParticipated(results);
|
|
378
|
+
const candidatePatchEnvelopes = results.flatMap((result) => Array.isArray(result.patch_envelopes) ? result.patch_envelopes : []);
|
|
379
|
+
const gptFinalArbiter = localParticipated
|
|
380
|
+
? await runFinalGptReviewStage({
|
|
381
|
+
schema: 'sks.gpt-final-arbiter-input.v1',
|
|
382
|
+
route,
|
|
383
|
+
mission_id: missionId,
|
|
384
|
+
local_mode: localCollaborationPolicy.mode,
|
|
385
|
+
local_outputs: results.map((result) => ({
|
|
386
|
+
worker_id: result.agent_id,
|
|
387
|
+
backend: result.backend_router_report?.selected_backend || result.backend || backend,
|
|
388
|
+
status: result.status,
|
|
389
|
+
summary: result.summary,
|
|
390
|
+
patch_envelopes: result.patch_envelopes || [],
|
|
391
|
+
proof: result.verification?.status || '',
|
|
392
|
+
blockers: result.blockers || [],
|
|
393
|
+
changed_files: result.changed_files || []
|
|
394
|
+
})),
|
|
395
|
+
candidate_diff: '',
|
|
396
|
+
candidate_patch_envelopes: candidatePatchEnvelopes,
|
|
397
|
+
verification_results: results.map((result) => result.verification || { status: result.status || 'unknown' }),
|
|
398
|
+
side_effect_report: { schema: 'sks.agent-side-effect-summary.v1', ok: true, route, mutation_owner: 'parent_agent_orchestrator' },
|
|
399
|
+
mutation_ledger: { parallel_write_policy: parallelWritePolicy, result_count: results.length },
|
|
400
|
+
rollback_plan: { verification_rollback_dag: strategyCompiled.verification_rollback_dag || null }
|
|
401
|
+
}, { cwd: root, mutationLedgerRoot: path.join(ledgerRoot, 'gpt-final-arbiter') })
|
|
402
|
+
: null;
|
|
403
|
+
const finalGptPatchStage = localParticipated
|
|
404
|
+
? selectFinalGptPatchSource(gptFinalArbiter, candidatePatchEnvelopes)
|
|
405
|
+
: null;
|
|
406
|
+
const resultsForPatchSwarm = localParticipated && finalGptPatchStage?.ok === true && gptFinalArbiter?.result?.status === 'modified'
|
|
407
|
+
? withFinalGptPatchEnvelopes(results, finalGptPatchStage.patch_envelopes)
|
|
408
|
+
: results;
|
|
372
409
|
const patchSwarm = await runAgentPatchSwarmRuntime(root, ledgerRoot, {
|
|
373
410
|
missionId,
|
|
374
411
|
route,
|
|
375
412
|
routeCommand,
|
|
376
413
|
writeCapable,
|
|
377
|
-
results,
|
|
414
|
+
results: resultsForPatchSwarm,
|
|
378
415
|
parallelWritePolicy,
|
|
379
416
|
verificationRollbackDag: strategyCompiled.verification_rollback_dag,
|
|
380
|
-
dryRun: opts.dryRunPatches === true || opts.applyPatches !== true
|
|
417
|
+
dryRun: opts.dryRunPatches === true || opts.applyPatches !== true || (localParticipated && gptFinalArbiter?.ok !== true),
|
|
418
|
+
gptFinalArbiter,
|
|
419
|
+
finalGptPatchStage
|
|
381
420
|
});
|
|
382
421
|
const stale = await detectStaleAgentSessions(ledgerRoot);
|
|
383
422
|
if (!stale.ok)
|
|
@@ -403,6 +442,8 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
403
442
|
...(nativeCliSessionProof.ok ? [] : nativeCliSessionProof.blockers),
|
|
404
443
|
...(noSubagentScalingPolicy.ok ? [] : noSubagentScalingPolicy.blockers),
|
|
405
444
|
...(fastModePropagation.ok ? [] : fastModePropagation.blockers),
|
|
445
|
+
...(localParticipated && gptFinalArbiter?.ok !== true ? gptFinalArbiter?.blockers || ['gpt_final_arbiter_not_ok'] : []),
|
|
446
|
+
...(localParticipated && finalGptPatchStage?.ok === false ? finalGptPatchStage.blockers || ['final_gpt_patch_stage_not_ok'] : []),
|
|
406
447
|
...(patchSwarm.ok ? [] : patchSwarm.blockers),
|
|
407
448
|
...(janitor.ok ? [] : janitor.blockers)
|
|
408
449
|
];
|
|
@@ -438,7 +479,10 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
438
479
|
fastModePolicy,
|
|
439
480
|
fastModePropagation,
|
|
440
481
|
triwikiContext,
|
|
441
|
-
selectedCoreSkill
|
|
482
|
+
selectedCoreSkill,
|
|
483
|
+
localCollaborationPolicy,
|
|
484
|
+
gptFinalArbiter,
|
|
485
|
+
finalGptPatchStage
|
|
442
486
|
});
|
|
443
487
|
await writeAgentCodexCockpitArtifacts(dir, { missionId, projectHash: namespace.root_hash });
|
|
444
488
|
await setCurrent(root, { mission_id: missionId, mode: 'AGENT', phase: proof.ok ? 'AGENT_NATIVE_KERNEL_DONE' : 'AGENT_NATIVE_KERNEL_BLOCKED', native_agent_backend: backend, updated_at: nowIso() });
|
|
@@ -478,10 +522,30 @@ export async function runNativeAgentOrchestrator(opts = {}) {
|
|
|
478
522
|
no_subagent_scaling_policy: noSubagentScalingPolicy,
|
|
479
523
|
fast_mode_policy: fastModePolicy,
|
|
480
524
|
fast_mode_propagation: fastModePropagation,
|
|
525
|
+
local_collaboration_policy: localCollaborationPolicy,
|
|
526
|
+
gpt_final_arbiter: gptFinalArbiter,
|
|
527
|
+
final_gpt_patch_stage: finalGptPatchStage,
|
|
481
528
|
patch_swarm: patchSwarm,
|
|
482
529
|
proof
|
|
483
530
|
};
|
|
484
531
|
}
|
|
532
|
+
function withFinalGptPatchEnvelopes(results, patchEnvelopes = []) {
|
|
533
|
+
const byAgent = new Map();
|
|
534
|
+
for (const envelope of patchEnvelopes) {
|
|
535
|
+
const agentId = String(envelope?.agent_id || 'gpt-final-arbiter');
|
|
536
|
+
byAgent.set(agentId, [...(byAgent.get(agentId) || []), envelope]);
|
|
537
|
+
}
|
|
538
|
+
let assigned = false;
|
|
539
|
+
const next = results.map((result) => {
|
|
540
|
+
const envelopes = byAgent.get(String(result.agent_id || '')) || [];
|
|
541
|
+
if (envelopes.length)
|
|
542
|
+
assigned = true;
|
|
543
|
+
return { ...result, patch_envelopes: envelopes };
|
|
544
|
+
});
|
|
545
|
+
if (!assigned && patchEnvelopes.length && next[0])
|
|
546
|
+
next[0] = { ...next[0], patch_envelopes: patchEnvelopes };
|
|
547
|
+
return next;
|
|
548
|
+
}
|
|
485
549
|
async function legacyCodexExecBlockedRun(input) {
|
|
486
550
|
const blockers = ['legacy_codex_exec_runtime_removed'];
|
|
487
551
|
const ledgerRoot = path.join(input.dir, 'agents');
|
|
@@ -706,7 +770,9 @@ async function runAgentPatchSwarmRuntime(root, ledgerRoot, input) {
|
|
|
706
770
|
verification: verificationResults.results.map((result) => result.status),
|
|
707
771
|
parallelWritePolicy: input.parallelWritePolicy,
|
|
708
772
|
conflictRebase,
|
|
709
|
-
verificationRollbackDag: input.verificationRollbackDag
|
|
773
|
+
verificationRollbackDag: input.verificationRollbackDag,
|
|
774
|
+
gptFinalArbiter: input.gptFinalArbiter,
|
|
775
|
+
finalGptPatchStage: input.finalGptPatchStage
|
|
710
776
|
};
|
|
711
777
|
const initialProof = buildAgentPatchProof(proofInput);
|
|
712
778
|
await writeJsonAtomic(path.join(ledgerRoot, 'agent-patch-proof.json'), initialProof);
|
|
@@ -50,6 +50,8 @@ export function buildAgentPatchProof(input = {}) {
|
|
|
50
50
|
...journalBlockers,
|
|
51
51
|
...rebaseBlockers,
|
|
52
52
|
...parallelGroupBlockers,
|
|
53
|
+
...(input.gptFinalArbiter && input.gptFinalArbiter.ok !== true ? input.gptFinalArbiter.blockers || ['gpt_final_arbiter_not_ok'] : []),
|
|
54
|
+
...(input.finalGptPatchStage && input.finalGptPatchStage.ok !== true ? input.finalGptPatchStage.blockers || ['final_gpt_patch_stage_not_ok'] : []),
|
|
53
55
|
...applyResults.flatMap((applyResult) => applyResult.ok ? [] : (applyResult.violations || ['patch_apply_failed']))
|
|
54
56
|
].map(String);
|
|
55
57
|
const changedFilesByAgent = changedFilesGroupedByAgent(applyResults);
|
|
@@ -71,6 +73,9 @@ export function buildAgentPatchProof(input = {}) {
|
|
|
71
73
|
verification_node_coverage: strictWiring.verification_node_coverage,
|
|
72
74
|
rollback_node_coverage: strictWiring.rollback_node_coverage,
|
|
73
75
|
parallel_patch_apply_verified: hasParallelGroup,
|
|
76
|
+
gpt_final_arbiter: input.gptFinalArbiter ? 'gpt-final-arbiter/gpt-final-arbiter.json' : null,
|
|
77
|
+
gpt_final_status: input.gptFinalArbiter?.result?.status || null,
|
|
78
|
+
final_patch_source: input.finalGptPatchStage?.final_patch_source || null,
|
|
74
79
|
patch_conflict_count: Number(input.merge?.conflicts?.length || 0),
|
|
75
80
|
serial_bottleneck_count: Number(input.merge?.serial_conflicts?.length || 0),
|
|
76
81
|
changed_files_by_agent: changedFilesByAgent,
|
|
@@ -8,6 +8,7 @@ import { assertAgentSessionGenerationsClosed } from './agent-session-generation.
|
|
|
8
8
|
import { readZellijLaneSupervisor } from './zellij-lane-supervisor.js';
|
|
9
9
|
import { writeFakeRealProofPolicyReport } from '../proof/fake-real-proof-policy.js';
|
|
10
10
|
import { buildRuntimeTruthMatrix, writeRuntimeTruthMatrix } from '../proof/runtime-truth-matrix.js';
|
|
11
|
+
import { evaluateLocalCollaborationFinalGate, localCollaborationParticipated, resolveLocalCollaborationPolicy } from '../local-llm/local-collaboration-policy.js';
|
|
11
12
|
export async function writeAgentProofEvidence(root, input) {
|
|
12
13
|
const lifecycle = await assertAllAgentSessionsClosed(root);
|
|
13
14
|
const terminal = await assertAgentTerminalSessionsClosed(root);
|
|
@@ -28,6 +29,25 @@ export async function writeAgentProofEvidence(root, input) {
|
|
|
28
29
|
const patchRollbackProof = await readJson(path.join(root, 'agent-patch-rollback-proof.json'), null);
|
|
29
30
|
const patchProof = await readJson(path.join(root, 'agent-patch-proof.json'), null);
|
|
30
31
|
const patchSwarm = input.patchSwarm || await readJson(path.join(root, 'agent-patch-swarm-runtime.json'), null);
|
|
32
|
+
const localCollaborationPolicy = input.localCollaborationPolicy || await readJson(path.join(root, 'local-collaboration-policy.json'), null) || resolveLocalCollaborationPolicy();
|
|
33
|
+
const gptFinalArbiter = input.gptFinalArbiter || await readJson(path.join(root, 'gpt-final-arbiter', 'gpt-final-arbiter.json'), null);
|
|
34
|
+
const narutoWorkGraph = await readJson(path.join(root, 'naruto-work-graph.json'), null);
|
|
35
|
+
const narutoRoleDistribution = await readJson(path.join(root, 'naruto-role-distribution.json'), null);
|
|
36
|
+
const narutoConcurrencyGovernor = await readJson(path.join(root, 'naruto-concurrency-governor.json'), null);
|
|
37
|
+
const narutoActivePool = await readJson(path.join(root, 'naruto-active-pool.json'), null);
|
|
38
|
+
const narutoVerificationDag = await readJson(path.join(root, 'naruto-verification-dag.json'), null);
|
|
39
|
+
const narutoGptFinalPack = await readJson(path.join(root, 'naruto-gpt-final-pack.json'), null);
|
|
40
|
+
const narutoZellijDashboard = await readJson(path.join(root, 'naruto-zellij-dashboard.json'), null);
|
|
41
|
+
const localParticipated = localCollaborationParticipated(input.results || []) || Number(gptFinalArbiter?.local_outputs_count || 0) > 0;
|
|
42
|
+
const finalGptPatchStage = input.finalGptPatchStage || null;
|
|
43
|
+
const localFinalGate = gptFinalArbiter?.final_gate || evaluateLocalCollaborationFinalGate({
|
|
44
|
+
policy: localCollaborationPolicy,
|
|
45
|
+
localParticipated,
|
|
46
|
+
gptFinalStatus: gptFinalArbiter?.result?.status || null,
|
|
47
|
+
gptFinalAvailable: Boolean(gptFinalArbiter),
|
|
48
|
+
gptFinalBackend: gptFinalArbiter?.backend || null,
|
|
49
|
+
applyPatches: parallelWritePolicy?.apply_patches === true
|
|
50
|
+
});
|
|
31
51
|
const nativeCliSessionProof = input.nativeCliSessionProof || await readJson(path.join(root, 'native-cli-session-proof.json'), null);
|
|
32
52
|
const noSubagentScalingPolicy = input.noSubagentScalingPolicy || await readJson(path.join(root, 'no-subagent-scaling-policy.json'), null);
|
|
33
53
|
const fastModePropagation = input.fastModePropagation || await readJson(path.join(root, 'fast-mode-propagation-proof.json'), null);
|
|
@@ -61,6 +81,7 @@ export async function writeAgentProofEvidence(root, input) {
|
|
|
61
81
|
const workQueueGoalRefsOk = Boolean(workQueue?.items?.length) && workQueue.items.every((item) => item.goal_mode_ref);
|
|
62
82
|
const workQueueStrategyRefsOk = Boolean(workQueue?.items?.length) && workQueue.items.every((item) => item.slice?.strategy_refs);
|
|
63
83
|
const route = String(input.route || taskGraph?.route_type || '$Agent');
|
|
84
|
+
const isNarutoRoute = route === '$Naruto';
|
|
64
85
|
const routeCommand = String(input.routeCommand || 'sks agent run');
|
|
65
86
|
const genericAgentRouteStandIn = !/\$?agent$/i.test(route) && /\bagent\s+run\b/i.test(routeCommand) && /--route/i.test(routeCommand);
|
|
66
87
|
const realRouteCommandUsed = !genericAgentRouteStandIn;
|
|
@@ -161,6 +182,19 @@ export async function writeAgentProofEvidence(root, input) {
|
|
|
161
182
|
...(patchSwarm && !patchApplyOk ? ['patch_apply_not_ok'] : []),
|
|
162
183
|
...(patchSwarm && !patchVerificationOk ? ['patch_verification_not_ok'] : []),
|
|
163
184
|
...(patchSwarm && !patchRollbackOk ? ['patch_rollback_not_ok'] : []),
|
|
185
|
+
...(localParticipated && localFinalGate.ok !== true ? localFinalGate.blockers || ['gpt_final_arbiter_gate_not_ok'] : []),
|
|
186
|
+
...(localParticipated && gptFinalArbiter?.ok !== true ? gptFinalArbiter?.blockers || ['gpt_final_arbiter_not_ok'] : []),
|
|
187
|
+
...(localParticipated && finalGptPatchStage?.ok === false ? finalGptPatchStage.blockers || ['final_gpt_patch_stage_not_ok'] : []),
|
|
188
|
+
...(isNarutoRoute && !narutoWorkGraph ? ['naruto_work_graph_missing'] : []),
|
|
189
|
+
...(isNarutoRoute && narutoWorkGraph?.ok === false ? narutoWorkGraph.blockers || ['naruto_work_graph_not_ok'] : []),
|
|
190
|
+
...(isNarutoRoute && !narutoRoleDistribution ? ['naruto_role_distribution_missing'] : []),
|
|
191
|
+
...(isNarutoRoute && narutoRoleDistribution?.ok === false ? narutoRoleDistribution.blockers || ['naruto_role_distribution_not_ok'] : []),
|
|
192
|
+
...(isNarutoRoute && !narutoConcurrencyGovernor ? ['naruto_concurrency_governor_missing'] : []),
|
|
193
|
+
...(isNarutoRoute && !narutoActivePool ? ['naruto_active_pool_missing'] : []),
|
|
194
|
+
...(isNarutoRoute && narutoActivePool?.ok === false ? narutoActivePool.blockers || ['naruto_active_pool_not_ok'] : []),
|
|
195
|
+
...(isNarutoRoute && !narutoVerificationDag ? ['naruto_verification_dag_missing'] : []),
|
|
196
|
+
...(isNarutoRoute && !narutoGptFinalPack ? ['naruto_gpt_final_pack_missing'] : []),
|
|
197
|
+
...(isNarutoRoute && !narutoZellijDashboard ? ['naruto_zellij_dashboard_missing'] : []),
|
|
164
198
|
...agentChangedFileLeaseViolations(input.results || [], input.partition?.leases || [])
|
|
165
199
|
];
|
|
166
200
|
const evidence = {
|
|
@@ -197,6 +231,32 @@ export async function writeAgentProofEvidence(root, input) {
|
|
|
197
231
|
parallel_write_apply_patches: parallelWritePolicy?.apply_patches === true,
|
|
198
232
|
parallel_write_dry_run_patches: parallelWritePolicy?.dry_run_patches === true,
|
|
199
233
|
parallel_write_max_write_agents: Number(parallelWritePolicy?.max_write_agents || 0),
|
|
234
|
+
local_collaboration_policy: 'local-collaboration-policy.json',
|
|
235
|
+
local_collaboration_mode: localCollaborationPolicy.mode || null,
|
|
236
|
+
local_collaboration_participated: localParticipated,
|
|
237
|
+
gpt_final_arbiter: gptFinalArbiter ? 'gpt-final-arbiter/gpt-final-arbiter.json' : null,
|
|
238
|
+
gpt_final_status: gptFinalArbiter?.result?.status || (localParticipated ? 'missing' : 'not_required_no_local_outputs'),
|
|
239
|
+
gpt_final_backend: gptFinalArbiter?.backend || null,
|
|
240
|
+
gpt_final_patch_source: finalGptPatchStage?.final_patch_source || (localParticipated ? 'blocked' : 'not_applicable'),
|
|
241
|
+
gpt_final_gate_ok: localFinalGate.ok === true,
|
|
242
|
+
gpt_final_gate: localFinalGate,
|
|
243
|
+
naruto_work_graph: narutoWorkGraph ? 'naruto-work-graph.json' : null,
|
|
244
|
+
naruto_total_work_items: Number(narutoWorkGraph?.total_work_items || 0),
|
|
245
|
+
naruto_mixed_work_kinds: narutoWorkGraph?.mixed_work_kinds || [],
|
|
246
|
+
naruto_write_allowed_count: Number(narutoWorkGraph?.write_allowed_count || 0),
|
|
247
|
+
naruto_role_distribution: narutoRoleDistribution ? 'naruto-role-distribution.json' : null,
|
|
248
|
+
naruto_role_distribution_entries: narutoRoleDistribution?.entries || [],
|
|
249
|
+
naruto_verifier_only: narutoRoleDistribution?.verifier_only === true,
|
|
250
|
+
naruto_implementation_like_ratio: Number(narutoRoleDistribution?.implementation_like_ratio || 0),
|
|
251
|
+
naruto_concurrency_governor: narutoConcurrencyGovernor ? 'naruto-concurrency-governor.json' : null,
|
|
252
|
+
naruto_safe_active_workers: Number(narutoConcurrencyGovernor?.safe_active_workers || 0),
|
|
253
|
+
naruto_safe_zellij_visible_panes: Number(narutoConcurrencyGovernor?.safe_zellij_visible_panes || 0),
|
|
254
|
+
naruto_headless_workers: Number(narutoConcurrencyGovernor?.headless_workers || 0),
|
|
255
|
+
naruto_active_pool: narutoActivePool ? 'naruto-active-pool.json' : null,
|
|
256
|
+
naruto_active_pool_refill_events: Number(narutoActivePool?.refill_events || 0),
|
|
257
|
+
naruto_verification_dag: narutoVerificationDag ? 'naruto-verification-dag.json' : null,
|
|
258
|
+
naruto_gpt_final_pack: narutoGptFinalPack ? 'naruto-gpt-final-pack.json' : null,
|
|
259
|
+
naruto_zellij_dashboard: narutoZellijDashboard ? 'naruto-zellij-dashboard.json' : null,
|
|
200
260
|
patch_swarm_runtime: patchSwarm ? 'agent-patch-swarm-runtime.json' : null,
|
|
201
261
|
patch_queue: patchSwarm ? 'agent-patch-queue.json' : null,
|
|
202
262
|
patch_queue_events: patchSwarm ? 'agent-patch-queue-events.jsonl' : null,
|
|
@@ -329,6 +389,7 @@ export async function writeAgentProofEvidence(root, input) {
|
|
|
329
389
|
'strategy-gate.json': strategyGate,
|
|
330
390
|
'agent-patch-proof.json': patchProof,
|
|
331
391
|
'agent-patch-swarm-runtime.json': patchSwarm,
|
|
392
|
+
'gpt-final-arbiter/gpt-final-arbiter.json': gptFinalArbiter,
|
|
332
393
|
'native-cli-session-proof.json': nativeCliSessionProof,
|
|
333
394
|
'no-subagent-scaling-policy.json': noSubagentScalingPolicy,
|
|
334
395
|
'fast-mode-propagation-proof.json': fastModePropagation
|