carthagent 0.0.0-stage → 1.0.7
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/LICENSE +21 -0
- package/README.md +219 -2
- package/bin/ctg.mjs +736 -0
- package/docs/budgets.md +72 -0
- package/docs/compaction.md +34 -0
- package/docs/context-efficiency-plan.md +24 -0
- package/docs/context-efficiency-review.md +27 -0
- package/docs/context-efficiency.md +49 -0
- package/docs/deepseek-jev-benchmark-plan.md +70 -0
- package/docs/deepseek-jev-benchmark-repair-plan.md +20 -0
- package/docs/deepseek-jev-benchmark-restart.md +9 -0
- package/docs/deepseek-jev-benchmark-results.md +77 -0
- package/docs/deepseek-jev-benchmark-running.md +60 -0
- package/docs/deepseek-jev-benchmark-v3-results.md +41 -0
- package/docs/deepseek-jev-benchmark-v4-protocol.md +15 -0
- package/docs/deepseek-jev-benchmark-v4-results.md +119 -0
- package/docs/deepseek-jev-http400-diagnosis.md +45 -0
- package/docs/delivery-review-evidence.md +53 -0
- package/docs/delivery-timeout-repair-plan.md +51 -0
- package/docs/evaluation-readiness.md +31 -0
- package/docs/evaluation.md +70 -0
- package/docs/extending.md +354 -0
- package/docs/glm-pilot-execution.md +9 -0
- package/docs/glm-pilot-plan.md +15 -0
- package/docs/glm-pilot-results.md +71 -0
- package/docs/graph-context-optimization.md +15 -0
- package/docs/jev-repository-pilot-plan.md +25 -0
- package/docs/jev-repository-pilot-protocol.md +39 -0
- package/docs/jev-repository-pilot-restart.md +7 -0
- package/docs/jev-repository-pilot-results.md +79 -0
- package/docs/jev.md +32 -0
- package/docs/model-registry.md +25 -0
- package/docs/native-compatibility.md +117 -0
- package/docs/opencode-archive.md +9 -0
- package/docs/opencode-migration.md +115 -0
- package/docs/opencode-runtime.md +94 -0
- package/docs/opencode-workspace.md +31 -0
- package/docs/owned-runtime-workflow-registration.md +17 -0
- package/docs/plan-advisor-evaluation.md +38 -0
- package/docs/planning-startup-fix-plan.md +23 -0
- package/docs/planning-startup-fix-review.md +24 -0
- package/docs/planning.md +118 -0
- package/docs/production-merge-review.md +23 -0
- package/docs/quality.md +35 -0
- package/docs/repository-benchmark-design.md +111 -0
- package/docs/review-assurance.md +9 -0
- package/docs/review-experiment-results.md +59 -0
- package/docs/tested-planning-roadmap.md +58 -0
- package/docs/tested-planning.md +58 -0
- package/docs/tui-pickers.md +9 -0
- package/docs/webdriver.md +83 -0
- package/docs/workflow-modes.md +26 -0
- package/docs/workflow.d2 +17 -0
- package/docs/workflow.svg +149 -0
- package/docs/workspace-coordination.md +9 -0
- package/evaluate.mjs +249 -0
- package/extensions/codegraph.ts +36 -0
- package/extensions/delivery.ts +819 -0
- package/extensions/experiential.ts +21 -0
- package/extensions/subscriptions.ts +21 -0
- package/guidance/profiles/authenticated-web.json +24 -0
- package/guidance/profiles/data-visualization.json +25 -0
- package/guidance/profiles/database-change.json +24 -0
- package/guidance/profiles/external-api.json +24 -0
- package/guidance/profiles/transactional-data.json +25 -0
- package/guidance/profiles/web-application.json +26 -0
- package/lib/acceptance-review.mjs +4 -0
- package/lib/browser-bin.mjs +160 -0
- package/lib/browser-errors.mjs +54 -0
- package/lib/browser.mjs +219 -0
- package/lib/budget.mjs +37 -0
- package/lib/cdp.mjs +221 -0
- package/lib/cloud/client.mjs +275 -0
- package/lib/cloud/control-plane.mjs +350 -0
- package/lib/cloud/gateway.mjs +380 -0
- package/lib/cloud/http.mjs +135 -0
- package/lib/cloud/ledger.mjs +215 -0
- package/lib/codegraph-query.mjs +60 -0
- package/lib/codegraph.mjs +378 -0
- package/lib/context-archive.mjs +18 -0
- package/lib/delivery-context.mjs +132 -0
- package/lib/delivery-guidance.mjs +9 -0
- package/lib/delivery-review.mjs +94 -0
- package/lib/delivery.mjs +610 -0
- package/lib/engine.mjs +137 -0
- package/lib/guidance.mjs +71 -0
- package/lib/jev-advisor.mjs +47 -0
- package/lib/opencode/archive.mjs +122 -0
- package/lib/opencode/compatibility.mjs +19 -0
- package/lib/opencode/credentials.mjs +205 -0
- package/lib/opencode/evaluation-budget-plugin/index.ts +147 -0
- package/lib/opencode/evaluation.mjs +242 -0
- package/lib/opencode/file-lock.mjs +86 -0
- package/lib/opencode/headless.mjs +200 -0
- package/lib/opencode/review.mjs +213 -0
- package/lib/opencode/runtime.mjs +246 -0
- package/lib/opencode/service.mjs +249 -0
- package/lib/opencode/session-options.mjs +60 -0
- package/lib/opencode/workspace.mjs +133 -0
- package/lib/openrouter-jev.mjs +37 -0
- package/lib/outcome-contract.mjs +21 -0
- package/lib/plan-advisor.mjs +38 -0
- package/lib/planning-access.mjs +7 -0
- package/lib/planning-advice.mjs +28 -0
- package/lib/planning-discovery.mjs +14 -0
- package/lib/planning-guide.mjs +34 -0
- package/lib/planning-view.mjs +57 -0
- package/lib/planning.mjs +155 -0
- package/lib/probe-diagnostics.mjs +13 -0
- package/lib/providers/experiential.mjs +292 -0
- package/lib/providers/model-catalog.json +700 -0
- package/lib/providers/model-catalog.mjs +7 -0
- package/lib/providers/names.mjs +13 -0
- package/lib/providers/subscription-models.mjs +483 -0
- package/lib/reports.mjs +80 -0
- package/lib/review-state.mjs +49 -0
- package/lib/review.mjs +114 -0
- package/lib/scenarios.mjs +99 -0
- package/lib/ship-auth.mjs +44 -0
- package/lib/ship-jev.mjs +59 -0
- package/lib/ship-telemetry.mjs +183 -0
- package/lib/tui/ansi.mjs +255 -0
- package/lib/tui/app.mjs +2445 -0
- package/lib/tui/auth.mjs +249 -0
- package/lib/tui/carthage.mjs +109 -0
- package/lib/tui/clipboard.mjs +122 -0
- package/lib/tui/d2.mjs +431 -0
- package/lib/tui/feed.mjs +467 -0
- package/lib/tui/framing.mjs +80 -0
- package/lib/tui/glyphs.mjs +172 -0
- package/lib/tui/hash-worker.mjs +11 -0
- package/lib/tui/mock-engine.mjs +222 -0
- package/lib/tui/models.mjs +73 -0
- package/lib/tui/picker.mjs +18 -0
- package/lib/tui/theme.mjs +663 -0
- package/lib/tui/title.mjs +7 -0
- package/lib/update-channel.mjs +62 -0
- package/lib/update.mjs +230 -0
- package/lib/webdriver.mjs +82 -0
- package/lib/workflow.mjs +88 -0
- package/lib/workspace.mjs +39 -0
- package/metadata.json +8 -0
- package/package.json +94 -4
- package/plugins/carthagent/index.ts +3 -0
- package/plugins/carthagent/package.json +28 -0
- package/plugins/carthagent/src/archive-rpc.ts +46 -0
- package/plugins/carthagent/src/bootstrap.ts +38 -0
- package/plugins/carthagent/src/index.ts +62 -0
- package/plugins/carthagent/src/pull-request-rpc.ts +54 -0
- package/plugins/carthagent/src/rpc.ts +76 -0
- package/plugins/carthagent/src/server/archive-rpc.ts +327 -0
- package/plugins/carthagent/src/server/budgets.ts +21 -0
- package/plugins/carthagent/src/server/codegraph.ts +46 -0
- package/plugins/carthagent/src/server/delivery.ts +488 -0
- package/plugins/carthagent/src/server/device-auth.ts +91 -0
- package/plugins/carthagent/src/server/native-delivery.ts +26 -0
- package/plugins/carthagent/src/server/orchestration.ts +56 -0
- package/plugins/carthagent/src/server/policy.ts +24 -0
- package/plugins/carthagent/src/server/providers.ts +424 -0
- package/plugins/carthagent/src/server/pull-request-rpc.ts +387 -0
- package/plugins/carthagent/src/server/session-controls.ts +82 -0
- package/plugins/carthagent/src/server/telemetry.ts +92 -0
- package/plugins/carthagent/src/server/workspace-rpc.ts +349 -0
- package/plugins/carthagent/src/session-rpc.ts +31 -0
- package/plugins/carthagent/src/testing.ts +85 -0
- package/plugins/carthagent/src/workspace-rpc.ts +133 -0
- package/plugins/carthagent/test-plugin/index.ts +4 -0
- package/plugins/carthagent/test-plugin/package.json +1 -0
- package/plugins/carthagent/tsconfig.json +19 -0
- package/plugins/carthagent/tui.ts +1 -0
- package/prompts/delivery.md +7 -0
- package/public/index.html +983 -0
- package/scenarios/cli/grade_cli.py +69 -0
- package/scenarios/cli/scenario.json +21 -0
- package/scenarios/game/baseline/minecraft.py +193 -0
- package/scenarios/game/context.md +1 -0
- package/scenarios/game/grade_minecraft_clone.py +603 -0
- package/scenarios/game/requirements.txt +2 -0
- package/scenarios/game/scenario.json +33 -0
- package/server.mjs +341 -0
- package/skills/game-development/SKILL.md +36 -0
- package/skills/game-development/assets/ursina_starter.py +98 -0
- package/skills/game-development/scripts/verify_ursina.py +80 -0
- package/skills/software-delivery/SKILL.md +50 -0
- package/skills/typescript-delivery/SKILL.md +69 -0
- package/tests/acceptance-review.test.mjs +13 -0
- package/tests/auth.test.mjs +234 -0
- package/tests/bounded-summary.test.mjs +68 -0
- package/tests/browser-bin.test.mjs +91 -0
- package/tests/browser.test.mjs +96 -0
- package/tests/budget-engine.test.mjs +110 -0
- package/tests/budget.test.mjs +23 -0
- package/tests/cli.test.mjs +245 -0
- package/tests/clipboard.test.mjs +79 -0
- package/tests/cloud-client.test.mjs +129 -0
- package/tests/cloud-control-plane.test.mjs +144 -0
- package/tests/cloud-gateway.test.mjs +147 -0
- package/tests/cloud-http.test.mjs +102 -0
- package/tests/cloud-ledger.test.mjs +75 -0
- package/tests/codegraph-query.test.mjs +66 -0
- package/tests/codegraph.test.mjs +142 -0
- package/tests/delivery-context.test.mjs +66 -0
- package/tests/delivery-review.test.mjs +139 -0
- package/tests/delivery.test.mjs +343 -0
- package/tests/engine-api.mjs +24 -0
- package/tests/experiential-extension.test.mjs +37 -0
- package/tests/experiential.test.mjs +300 -0
- package/tests/extension.test.mjs +921 -0
- package/tests/fixtures/archive-plugin/index.ts +10 -0
- package/tests/guidance.test.mjs +78 -0
- package/tests/model-registry.test.mjs +68 -0
- package/tests/models.test.mjs +70 -0
- package/tests/openai-idempotency.test.mjs +99 -0
- package/tests/opencode-archive-rpc.test.mjs +82 -0
- package/tests/opencode-delivery.test.mjs +231 -0
- package/tests/opencode-providers.test.mjs +414 -0
- package/tests/opencode-runtime.test.mjs +455 -0
- package/tests/opencode-session-controls.test.mjs +115 -0
- package/tests/opencode-session-options.test.mjs +26 -0
- package/tests/opencode-workspace.test.mjs +339 -0
- package/tests/outcome-contract.test.mjs +17 -0
- package/tests/picker.test.mjs +34 -0
- package/tests/plan-advisor.test.mjs +88 -0
- package/tests/plan-review-loop.test.mjs +53 -0
- package/tests/planning-advice.test.mjs +27 -0
- package/tests/planning-contract.test.mjs +65 -0
- package/tests/planning-startup.test.mjs +38 -0
- package/tests/planning-view.test.mjs +33 -0
- package/tests/planning.test.mjs +223 -0
- package/tests/probe-diagnostics.test.mjs +21 -0
- package/tests/pull-request-rpc.test.mjs +366 -0
- package/tests/review-state.test.mjs +32 -0
- package/tests/review.test.mjs +127 -0
- package/tests/server.test.mjs +252 -0
- package/tests/ship-jev.test.mjs +77 -0
- package/tests/ship-telemetry.test.mjs +333 -0
- package/tests/standard-workflow.test.mjs +28 -0
- package/tests/subscription-models.test.mjs +416 -0
- package/tests/subscriptions-extension.test.mjs +27 -0
- package/tests/terminal-title.test.mjs +13 -0
- package/tests/test_grade_minecraft_clone.py +199 -0
- package/tests/test_starter.py +78 -0
- package/tests/theme.test.mjs +175 -0
- package/tests/tui-copy-paste.test.mjs +54 -0
- package/tests/tui.test.mjs +808 -0
- package/tests/update-channels.test.mjs +129 -0
- package/tests/update.test.mjs +175 -0
- package/tests/webdriver.test.mjs +31 -0
- package/tests/workflow.test.mjs +47 -0
- package/tests/workspace-rpc.test.mjs +236 -0
- package/tests/workspace.test.mjs +24 -0
- package/tools/benchmark/advisor.test.mjs +7 -0
- package/tools/benchmark/advisor.ts +27 -0
- package/tools/benchmark/campaign.mjs +45 -0
- package/tools/benchmark/diagnose-request.mjs +40 -0
- package/tools/benchmark/eval-common.mjs +32 -0
- package/tools/benchmark/eval-ledger.mjs +22 -0
- package/tools/benchmark/eval-shop.mjs +26 -0
- package/tools/benchmark/eval-voxel.mjs +20 -0
- package/tools/benchmark/evaluate.mjs +24 -0
- package/tools/benchmark/evaluators.test.mjs +13 -0
- package/tools/benchmark/fixtures/shop/server.mjs +18 -0
- package/tools/benchmark/fixtures/shop/ui.html +8 -0
- package/tools/benchmark/freeze.mjs +30 -0
- package/tools/benchmark/gateway.mjs +91 -0
- package/tools/benchmark/gateway.test.mjs +38 -0
- package/tools/benchmark/generator.mjs +11 -0
- package/tools/benchmark/generator.test.mjs +26 -0
- package/tools/benchmark/guard.test.mjs +133 -0
- package/tools/benchmark/guard.ts +136 -0
- package/tools/benchmark/native-plugin/index.ts +24 -0
- package/tools/benchmark/planning-startup.test.mjs +47 -0
- package/tools/benchmark/preflight-live.mjs +31 -0
- package/tools/benchmark/preflight.mjs +22 -0
- package/tools/benchmark/replay-diagnostic.mjs +23 -0
- package/tools/benchmark/runner.mjs +141 -0
- package/tools/benchmark/runner.test.mjs +93 -0
- package/tools/benchmark/runtime.mjs +23 -0
- package/tools/benchmark/selftest.mjs +47 -0
- package/tools/benchmark/smoke-jev.mjs +5 -0
- package/tools/benchmark/tasks.mjs +20 -0
- package/tools/benchmark/transport.mjs +65 -0
- package/tools/benchmark/transport.test.mjs +44 -0
- package/tools/benchmark/upstream-error.mjs +18 -0
- package/tools/benchmark/upstream-error.test.mjs +10 -0
- package/tools/browser-check.mjs +109 -0
- package/tools/check-syntax.mjs +27 -0
- package/tools/evaluate-plan-advisor.mjs +20 -0
- package/tools/native-fixture.mjs +194 -0
- package/tools/native-pty-smoke.py +108 -0
- package/tools/native-report-plugin/index.ts +50 -0
- package/tools/native-report-plugin/package.json +7 -0
- package/tools/patch-compaction.mjs +24 -0
- package/tools/patch-model-catalog.mjs +12 -0
- package/tools/patch-print-shutdown.mjs +39 -0
- package/tools/repo-pilot/evaluator.cjs +32 -0
- package/tools/repo-pilot/reference.mjs +43 -0
- package/tools/repo-pilot/runner.mjs +85 -0
- package/tools/repo-pilot/sandbox-entry.mjs +12 -0
- package/tools/repo-pilot/tasks.mjs +20 -0
- package/tools/repo-pilot/type-evaluator.cjs +6 -0
- package/tools/test-native-controls.mjs +84 -0
- package/tools/test-native-delivery-host.mjs +307 -0
- package/tools/test-native-evaluation.mjs +46 -0
- package/tools/test-native-host.mjs +385 -0
- package/tools/test-native-outcomes.mjs +73 -0
- package/tools/test-native-package.mjs +70 -0
- package/tools/test-native-pty.mjs +20 -0
- package/tools/test-native-report.mjs +88 -0
- package/tools/test-native-swe-host.mjs +132 -0
- package/tools/test-native-swe.mjs +122 -0
- package/tools/test-picker-pty.py +45 -0
- package/tools/test-python.mjs +29 -0
- package/tools/test-webdriver.mjs +54 -0
- package/tools/verify-release-version.mjs +37 -0
- package/tools/webdriver-check.mjs +52 -0
- package/vendor/agent/bounded-summary.mjs +88 -0
- package/vendor/agent/chunks/anthropic-messages-VWZZOSJQ.js +6 -0
- package/vendor/agent/chunks/anthropic.js +75 -0
- package/vendor/agent/chunks/azure-openai-responses-BJLAM6CD.js +2 -0
- package/vendor/agent/chunks/bedrock-converse-stream.js +74 -0
- package/vendor/agent/chunks/chord-context.js +96 -0
- package/vendor/agent/chunks/chunk-4L3WN2XY.js +2 -0
- package/vendor/agent/chunks/chunk-6CYCI3EJ.js +12 -0
- package/vendor/agent/chunks/chunk-6R7UI4IY.js +2 -0
- package/vendor/agent/chunks/chunk-7ZC4UXSL.js +2 -0
- package/vendor/agent/chunks/chunk-AXIIZGTV.js +2 -0
- package/vendor/agent/chunks/chunk-CLNPYIDP.js +42 -0
- package/vendor/agent/chunks/chunk-DRQDKNXA.js +2 -0
- package/vendor/agent/chunks/chunk-GMWCTUPB.js +2 -0
- package/vendor/agent/chunks/chunk-IDDQWTHI.js +2 -0
- package/vendor/agent/chunks/chunk-JVUZSMYM.js +1548 -0
- package/vendor/agent/chunks/chunk-L2ZPNLYD.js +2 -0
- package/vendor/agent/chunks/chunk-NUHFSC37.js +25 -0
- package/vendor/agent/chunks/chunk-OUXLLA64.js +11 -0
- package/vendor/agent/chunks/chunk-PGXDEOVV.js +2 -0
- package/vendor/agent/chunks/chunk-PJACZCIR.js +2 -0
- package/vendor/agent/chunks/chunk-PRRNXB7S.js +2 -0
- package/vendor/agent/chunks/chunk-TEPMHNKQ.js +2 -0
- package/vendor/agent/chunks/chunk-TRDNDS6A.js +4 -0
- package/vendor/agent/chunks/chunk-U6ZMQKGD.js +50 -0
- package/vendor/agent/chunks/chunk-UAQELI3K.js +2 -0
- package/vendor/agent/chunks/chunk-USJZMAIR.js +2 -0
- package/vendor/agent/chunks/chunk-XDUWOHPL.js +6 -0
- package/vendor/agent/chunks/chunk-XNGRGP62.js +2 -0
- package/vendor/agent/chunks/github-copilot.js +2 -0
- package/vendor/agent/chunks/google-generative-ai-Q2K7FBDI.js +2 -0
- package/vendor/agent/chunks/google-vertex-7UJBF4S7.js +2 -0
- package/vendor/agent/chunks/https-proxy-agent-2VXB7436.js +13 -0
- package/vendor/agent/chunks/image-resize-worker.js +2 -0
- package/vendor/agent/chunks/kimi-coding.js +2 -0
- package/vendor/agent/chunks/lib-HGQMNYVT.js +9 -0
- package/vendor/agent/chunks/mistral-conversations-4M6BZBX6.js +5 -0
- package/vendor/agent/chunks/multipart-parser-SQ6GDJL7.js +3 -0
- package/vendor/agent/chunks/node-KG362ECQ.js +16 -0
- package/vendor/agent/chunks/node-TWVVAGPO.js +2 -0
- package/vendor/agent/chunks/openai-codex-responses-R6VYZTVY.js +10 -0
- package/vendor/agent/chunks/openai-codex.js +75 -0
- package/vendor/agent/chunks/openai-completions-EKZT2IH2.js +7 -0
- package/vendor/agent/chunks/openai-responses-TFDINO6W.js +2 -0
- package/vendor/agent/chunks/openrouter-images-N4XVVFSD.js +2 -0
- package/vendor/agent/chunks/openrouter.js +75 -0
- package/vendor/agent/chunks/pi-messages-PML4SPVJ.js +8 -0
- package/vendor/agent/chunks/radius.js +75 -0
- package/vendor/agent/chunks/src-UK77SYZE.js +4 -0
- package/vendor/agent/chunks/xai.js +2 -0
- package/vendor/agent/cli.js +3 -0
- package/vendor/agent/dist/modes/interactive/theme/dark.json +91 -0
- package/vendor/agent/dist/modes/interactive/theme/light.json +90 -0
- package/vendor/agent/dist/modes/interactive/theme/theme-schema.json +356 -0
- package/vendor/agent/index.js +2 -0
- package/vendor/agent/modes/interactive/theme/dark.json +91 -0
- package/vendor/agent/modes/interactive/theme/light.json +90 -0
- package/vendor/agent/modes/interactive/theme/theme-schema.json +356 -0
- package/vendor/agent/package.json +14 -0
- package/vendor/agent/rpc-entry.js +3 -0
- package/vendor/agent/theme/dark.json +91 -0
- package/vendor/agent/theme/light.json +90 -0
- package/vendor/agent/theme/theme-schema.json +356 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Integrated Jev repository pilot — results
|
|
2
|
+
|
|
3
|
+
## Executive finding
|
|
4
|
+
|
|
5
|
+
**Plain pi completed both Fastify feature tickets and passed all measured behavior/type/regression checks. No Carthagent treatment completed a feature. The experiment does not establish Jev effectiveness: neither scored Jev cell reached plan inspection, so neither called Jev.** Three treatment runs ended on provider deadlines, one on a curl receive error. Treat those as unavailable/infrastructure outcomes, not comparative semantic quality scores.
|
|
6
|
+
|
|
7
|
+
The clear workflow observation is that treatment discovery consumed 19–54 tool starts without creating a plan. New compact delivery projections cannot help before a plan exists. Native compaction worked but repeatedly summarized growing discovery history. The next fix should target bounded discovery/plan startup and compaction reliability, not another larger task matrix or relaxed approval gates.
|
|
8
|
+
|
|
9
|
+
## Delivered implementation
|
|
10
|
+
|
|
11
|
+
- Built-in automatic Jev critic on successful plan inspection, explicit `--delivery-jev` opt-in, OpenRouter/direct TypeSafe choice, fixed endpoints or explicit loopback broker.
|
|
12
|
+
- Durable identity-bound reuse, <=3 attempts/run, sanitized unavailable mode, compact findings in recovery/status. No approval, finding-resolution or requirement authority.
|
|
13
|
+
- First-class production integration exercised via a live isolated smoke; not the old benchmark-only advisor extension.
|
|
14
|
+
- `docs/jev.md` configuration/disclosure; plan/protocol saved before execution.
|
|
15
|
+
- Quality: **355/355 repository tests**, lint/typecheck/build; six focused real-wire transport/gateway tests. Author validation, not independent review or remote CI/merge.
|
|
16
|
+
- Commits: `52d3c3f` implementation/protocol, `602e6b6` sandbox hostname repair. Earlier context efficiency `93b5c5f`.
|
|
17
|
+
|
|
18
|
+
## Tasks and conditions
|
|
19
|
+
|
|
20
|
+
Pinned [Fastify v5.6.2](https://github.com/fastify/fastify/tree/f15d4eaba03d86786bec2de7aed1236718c813f9), SHA `f15d4eaba03d86786bec2de7aed1236718c813f9`,384 tracked files,72,231 tracked JS/TS lines including tests. Add `reply.appendHeader` and `reply.vary`: atomic validation, raw/Fastify header precedence, HTTP behavior, types, documentation, tests. More realistic than greenfield single-file tasks, but **not** a large commerce application/browser feature benchmark.
|
|
21
|
+
|
|
22
|
+
Same pi0.85.1/Node26.7.0/DeepSeek v4.1 flash/high across arms; native compaction enabled (30k threshold,6k recent). Same900s/120 tool/$2.30 per cell,400KB request ceiling,16,384 output tokens. One replicate/task/arm. Network-isolated bubblewrap namespaces, read-only harness/dependencies/references, hidden supervisor evaluators not mounted during generation. Documentation was downloaded/frozen equally: [Node HTTP22.19](https://raw.githubusercontent.com/nodejs/node/v22.19.0/doc/api/http.md), [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.txt). **No live web search or browser UI comparison** occurred; do not claim otherwise.
|
|
23
|
+
|
|
24
|
+
Provider endpoints varied: AtlasCloud, Together, Relace, InferenceNet. No candidate repair/retry after evaluator feedback. All artifacts retained.
|
|
25
|
+
|
|
26
|
+
## Corrected-environment six-cell results
|
|
27
|
+
|
|
28
|
+
| Task | Arm | Terminal outcome | Runtime | Tool starts | External behavior | External types | Original94 regressions | Known bill |
|
|
29
|
+
|---|---|---|---:|---:|---:|---|---|---:|
|
|
30
|
+
| appendHeader | Plain pi | Completed |162.660s|61|7/7|Pass|Pass|$0.0338129304|
|
|
31
|
+
| appendHeader | Carthagent | Provider180s deadline during compaction |284.627s|35|1/7*|Missing API|Pass unchanged base|$0.0282421188 +$0.15 hold|
|
|
32
|
+
| appendHeader | Carthagent+Jev | Provider180s deadline after earlier compactions |279.450s|38|1/7*|Missing API|Pass unchanged base|$0.0322767560 +$0.15 hold|
|
|
33
|
+
| vary | Plain pi | Completed |204.847s|43|7/7|Pass|Pass|$0.0201047092|
|
|
34
|
+
| vary | Carthagent | Provider180s deadline during compaction |368.284s|54|1/7*|Missing API|Pass unchanged base|$0.0248195060 +$0.15 hold|
|
|
35
|
+
| vary | Carthagent+Jev | Transport receive error `CURL_56` |35.843s|19|1/7*|Missing API|Pass unchanged base|$0.0036290660 +$0.15 hold|
|
|
36
|
+
|
|
37
|
+
`*` Unmodified base passes the negative-invalid-input category because calling a missing method raises TypeError. This is a known partial-credit limitation detected by base selftest; **1/7 is not implemented functionality**. Positive tests require actual methods. All four treatment product diffs empty; no plan/review/approval/finish receipt. Do not aggregate their incomplete artifacts into a causal '14/14 vs2/14' quality claim.
|
|
38
|
+
|
|
39
|
+
Two plain runs produced final explanations, declarations, docs and new tests. Supervisor reran their candidate tests independently: append100/100; vary109/109 (94 original+15 new). Both complete tsd suites passed. Protected external type tests include readonly arrays, chaining and invalid type rejections. Original94 regressions were mounted from base, not candidate-editable versions. Full upstream runtime suite/browser/security audit not performed; finite green checks do not prove universal correctness. `git diff --stat` omits untracked files; vary's new `test/reply-vary.test.js` exists and was separately run.
|
|
40
|
+
|
|
41
|
+
## Jev finding
|
|
42
|
+
|
|
43
|
+
Scored Jev calls: **zero**. Both cells were interrupted before `delivery_design inspect`, so Jev cannot have affected those trajectories. Live integration smoke successfully called returned model `typesafe/jev-1.13-20260917`, srp.12/di.28/tests.29, no >=.5 flags, authority none. Expected blocked infrastructure handoff. This demonstrates connectivity/integration, **not efficacy**.
|
|
44
|
+
|
|
45
|
+
## Context and discovery findings
|
|
46
|
+
|
|
47
|
+
- Plain completed with one successful native compaction per task.
|
|
48
|
+
- append/harness, append/Jev and vary/harness each had two successful native compactions before their later failure; vary/Jev had none.
|
|
49
|
+
- append/harness and vary/harness failed additional compaction requests; append/Jev's final timeout was an ordinary generation request following successful compactions. Earlier chat progress overgeneralized all three as compaction failures; this report corrects that distinction based on event ordering.
|
|
50
|
+
- No corrected cell reached400KB or16,384 output-token stop. This does **not** demonstrate context growth is solved: earlier stops and different tasks prevent that inference.
|
|
51
|
+
- Repeated discovery and docs reads occurred before any delivery plan. 2/4/3/5 shell attempts were blocked in append/harness, append/Jev, vary/harness, vary/Jev respectively. Read-only discovery remained available; do not introduce a shell-regex permission bypass to solve it.
|
|
52
|
+
- The schema document is repeatedly read and summaries grow. A focused preplanning schema guide, explicit discovery budget/checkpoint and plan skeleton authoring should be evaluated in unscored fixtures. Do not weaken exact acceptance or replace scenario reasoning with empty boilerplate.
|
|
53
|
+
|
|
54
|
+
## Infrastructure deviations and preserved history
|
|
55
|
+
|
|
56
|
+
Initial root `/home/baissi/benchmarks/jev-repo-pilot`: missing `/etc/hosts` meant localhost-based protected regressions failed even though numeric-address external tests worked. Initial plain append completed7/7/types with$0.0724732348 and340.232s. Initial harness append manually stopped after157.869s/$0.0415978068 with$0.15 unresolved hold. Four cells unstarted. Baseline had initially run only on host: readiness gap. Two incorrect tap-path setup commands also retained; actual repository uses Node test runner.
|
|
57
|
+
|
|
58
|
+
Repair added minimal hosts/nsswitch and proved94 original tests pass **inside** namespace. Uniform fresh-root restart `/home/baissi/benchmarks/jev-repo-pilot-v2`; no first-root candidate reused/repaired. Old freeze retained separately. Same tasks/evaluators/budgets; new freeze bound mounted engine/dependencies/binary/system config. Post-run manifest verification passed before report additions.
|
|
59
|
+
|
|
60
|
+
Matrix stops on infrastructure error. Supervisor inspected receipts and continued **only unstarted cells** in saved continuation scripts, without changing frozen source, request deadline or candidate outputs. Each interruption retained its unknown charge. This is a disclosed exploratory continuation, not a pristine uninterrupted randomized experiment. No extra paid diagnostic replays. Native engine attempted further requests after some failed compactions, but gateway rejected them locally after the unknown-billing stop; no additional dispatch for those rejected requests.
|
|
61
|
+
|
|
62
|
+
## Accounting
|
|
63
|
+
|
|
64
|
+
- Corrected six cells known **$0.1428850864**, unresolved reservations **$0.60**.
|
|
65
|
+
- Initial interrupted environment known **$0.1140710416**, unresolved **$0.15**.
|
|
66
|
+
- Live preflight known **$0.0113118196**, no outstanding smoke holds.
|
|
67
|
+
- **Total known$0.2682679476 + unresolved$0.75 = conservative$1.0182679476**, within the newly announced$15 ceiling.
|
|
68
|
+
|
|
69
|
+
Holds are not confirmed charges and may not be assumed free. No vendor account cap guarantee. Durable shared accounting `/home/baissi/benchmarks/jev-repo-pilot/campaign.json`; old$27 campaign untouched.
|
|
70
|
+
|
|
71
|
+
## Recommendation
|
|
72
|
+
|
|
73
|
+
Keep Jev built in and opt-in; do not advertise it as validated benefit. Pause broader paid benchmarking until an offline/cheap end-to-end fixture reliably goes from bounded discovery to plan approval, implementation, checks and final review with compaction. Investigate provider summarization deadlines without silently retrying unknown bills. Then run different held-out tickets with repetitions and the same compaction/network settings; add actual browser/API and permissioned live-research tracks on suitable infrastructure.
|
|
74
|
+
|
|
75
|
+
Practical observed outcome: **plain pi delivered both changes; Carthagent is not yet reliably reaching implementation on this setup.** Provider failures block a clean quality comparison, but they do not erase the costly pre-plan discovery behavior observed before failure.
|
|
76
|
+
|
|
77
|
+
## Artifacts
|
|
78
|
+
|
|
79
|
+
Both roots retain raw events, sessions, invocation, gateway receipts, workspace, evaluation/type/regression/candidate-check logs, freeze manifests and continuation logs. Corrected `summary.json` is numeric overview. Setup reference/mutant results and initial failed evaluator selftest retained. No upstream pull request, deployment, primary-checkout changes, independent review or remote merge claimed.
|
package/docs/jev.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Built-in Jev planning critic
|
|
2
|
+
|
|
3
|
+
Jev is built into the delivery extension. On Carthagent Ship (managed cloud) it is **on by default** — advice rides the managed `/v1/jev` endpoint, which the backend proxies to Experiential's free System One endpoint (`jev-latest`) outside the billing gateway, so it never draws on managed usage. Presence of a credential alone never triggers paid calls on BYOK providers.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
# Carthagent Ship: enabled automatically; opt out with a literal false value
|
|
7
|
+
node bin/ctg.mjs --delivery-jev=false
|
|
8
|
+
|
|
9
|
+
# BYOK providers still require explicit opt-in:
|
|
10
|
+
OPENROUTER_API_KEY=... node bin/ctg.mjs --delivery-jev
|
|
11
|
+
# Or with direct TypeSafe credentials:
|
|
12
|
+
TYPESAFE_API_KEY=... node bin/ctg.mjs --delivery-jev --delivery-jev-provider typesafe
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Flags must be passed to the pi/delivery session (CLI forwarding depends on invocation; `pi -e /absolute/path/extensions/delivery.ts --delivery-jev` is the direct form). Do not put keys in command arguments or project files.
|
|
16
|
+
|
|
17
|
+
Schema repair is deterministic and free of advisor calls: use `delivery_design action=guide`, validate and repair references first. Invalid inspection neither dispatches Jev nor consumes an advice attempt.
|
|
18
|
+
|
|
19
|
+
The disclosed semantic input includes goal, exact acceptance, **check definitions (including executable argv), outputs and assumptions**, design and workflow. These additional fields let Jev assess scenario-to-check links and promised-output coverage; they can contain confidential paths/arguments and are sent to the chosen provider only while advice is enabled (automatic on Ship). The 64KB bound still applies; larger input becomes unavailable rather than silently truncated. Commands are declarations, not proof of execution.
|
|
20
|
+
|
|
21
|
+
After successful `delivery_design inspect`, the enabled critic automatically assesses the captured plan for SRP, DI seams and missing test assertions/boundaries. Ship calls go to `POST {control-plane}/v1/jev` with the session OAuth token — no provider key needed. OpenRouter uses `typesafe/jev-1.13` at its Decisions endpoint, not a chat/router model. The direct TypeSafe adapter retains its existing model configuration.
|
|
22
|
+
|
|
23
|
+
- At most **three attempts per delivery run**, reserved in the report before network dispatch.
|
|
24
|
+
- Identical run/revision/digest/source inspections reuse a receipt, including unavailable/interrupted attempts. Changed plans/source get fresh identities, subject to the cap.
|
|
25
|
+
- Advice and its identity survive report/session restore and appear in status/recovery. Old receipts remain history, not fresh approval.
|
|
26
|
+
- Probabilities >=0.5 identify investigation topics; lower scores are not flags. The model is asked to record dispositions in ordinary adversarial review. No flags does not mean correct.
|
|
27
|
+
- Missing credentials, timeout and invalid data report unavailable. They do not grant approval or prevent normal review. No retries.
|
|
28
|
+
- Advice cannot alter requirements, resolve blockers, authorize execution, or replace checks/final review.
|
|
29
|
+
- Input max64KB, response max64KiB, OpenRouter deadline15s; direct TypeSafe retains3s default. Calls/unknown cost are visible but the normal adapter does not enforce an account-level dollar ceiling. Use provider limits or a trusted billing broker when needed.
|
|
30
|
+
- An explicit `--delivery-jev-broker http://127.0.0.1:PORT/jev` uses a trusted local supervisor without sending a provider key. Non-loopback and arbitrary endpoints are rejected. This is host configuration, not a model tool parameter.
|
|
31
|
+
|
|
32
|
+
Plan text is disclosed to the chosen external provider when enabled. It may contain confidential source information; no universal secret scrubber or zero-retention claim. Transport/provider failures are sanitized in reports. Jev is an additional fallible critic, not independent proof of delivery quality.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Carthagent model registry
|
|
2
|
+
|
|
3
|
+
Carthagent discovers Claude and ChatGPT models directly from their provider
|
|
4
|
+
endpoints. It does not use pi.dev's version-gated remote model catalog.
|
|
5
|
+
The forked engine remains the inference/session implementation; this change
|
|
6
|
+
does not replace that engine or its protocol-compatible OAuth integrations.
|
|
7
|
+
|
|
8
|
+
`lib/providers/model-catalog.json` is the versioned, offline metadata catalog
|
|
9
|
+
for these providers. Initial definitions were migrated from the bundled engine
|
|
10
|
+
to preserve existing compatibility and pricing; future changes are reviewed
|
|
11
|
+
here, independently of engine upgrades. Opus 5.5 has a 1M context window and
|
|
12
|
+
128K output limit. Its price is intentionally omitted until verified, rather
|
|
13
|
+
than assuming an earlier model's price. Unknown discovered models still use
|
|
14
|
+
conservative provider defaults, so discovery is not a claim of verified limits.
|
|
15
|
+
|
|
16
|
+
Direct discovery merges account-visible IDs with known metadata and stores a
|
|
17
|
+
last-known-good discovery in `subscription-models.json`. Failed discovery does
|
|
18
|
+
not replace that snapshot. The TUI reads the live registry on picker open,
|
|
19
|
+
direct model selection and thinking checks. While an overlay is open, its
|
|
20
|
+
existing 2.5-second state poll also refreshes the model list (local RPC only).
|
|
21
|
+
|
|
22
|
+
After replacing vendor/agent, reapply `node tools/patch-model-catalog.mjs`
|
|
23
|
+
alongside the compaction patch. The patch fails if its anchor changes; the
|
|
24
|
+
runtime regression test rejects pi.dev requests. Other engine providers retain
|
|
25
|
+
their bundled offline definitions and any native provider discovery hooks.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Native runtime acceptance matrix
|
|
2
|
+
|
|
3
|
+
This is the compatibility inventory for the migration from baseline
|
|
4
|
+
`599a8ad`. A name appearing in a command registry is not evidence that its
|
|
5
|
+
behavior works. Default-switch approval requires the following checks against
|
|
6
|
+
the installed native package.
|
|
7
|
+
|
|
8
|
+
## Terminal commands
|
|
9
|
+
|
|
10
|
+
| Command | Aliases / arguments | Required behavior |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| `/help` | | CTG commands, arguments and actual native shortcuts |
|
|
13
|
+
| `/resume` | `/sessions`, `[id\|name]` | Search and open native sessions; legacy results explicitly archive-only |
|
|
14
|
+
| `/new` | | New independent native session, without deleting current work |
|
|
15
|
+
| `/restart` | `/kill` | Interrupt/recover the selected session without restarting other sessions |
|
|
16
|
+
| `/theme` | `[name]` | Native theme picker; explicit name applies; confirmation commits selection |
|
|
17
|
+
| `/model` | `[name]` | Provider-aware search/selection; explicit name actually selects a model |
|
|
18
|
+
| `/thinking` | | Supported variant selection, honest errors for unsupported levels |
|
|
19
|
+
| `/compact` | `[notes]` | Await or report admitted compaction correctly; notes reach summary context |
|
|
20
|
+
| `/autocompact` | `[on\|off]` | Preserve the requested session policy, not a misleading UI-only switch |
|
|
21
|
+
| `/review` | `/review-mode`, `[ask\|yes\|no\|status]` | Persist review default/override; fresh reviewer with bounded admission |
|
|
22
|
+
| `/export` | `[file]` | Complete HTML transcript, escaped content, explicit output location |
|
|
23
|
+
| `/copy` | | Full last assistant response, including content beyond visible viewport |
|
|
24
|
+
| `/stats` | | Actual usage/cost; unknown prices remain unknown |
|
|
25
|
+
| `/clear` | | Clear presentation without deleting durable transcript |
|
|
26
|
+
| `/abort` | | Stop selected session and underlying cancellable work |
|
|
27
|
+
| `/raw` | `<prompt>` | Bypass framing for that prompt; keep execution policy enforced |
|
|
28
|
+
| `/guide` | `[task]` | Toggle framing or send a framed task |
|
|
29
|
+
| `/login` | `/auth` | Native CTG-scoped provider connection |
|
|
30
|
+
| `/account` | `/cloud` | Ship credit, plan, grants, sessions |
|
|
31
|
+
| `/usage` | | Recent Ship usage from the control plane |
|
|
32
|
+
| `/billing` | `[checkout [plan]\|portal]` | Open the authenticated billing destination |
|
|
33
|
+
| `/logout-cloud` | `[session-id]` | Revoke/remove current connection or revoke specified Ship session |
|
|
34
|
+
| `/update` | `/upgrade`, `[check]` | Check/update CTG without upgrading regular OpenCode |
|
|
35
|
+
| `/quit` | `/q`, `/exit` | Clean shutdown of TUI resources and terminal restoration |
|
|
36
|
+
| `/workflow` | | Show authoritative execution workflow |
|
|
37
|
+
| `/architecture` | | Show current architecture view |
|
|
38
|
+
| `/evidence` | | Show check receipts and freshness |
|
|
39
|
+
|
|
40
|
+
Delivery extension commands, including budget inspection/reset, must be listed
|
|
41
|
+
by the native delivery adapter and included in the installed-host test as well.
|
|
42
|
+
Built-in OpenCode command collisions must be tested through actual typed input.
|
|
43
|
+
|
|
44
|
+
## Launcher
|
|
45
|
+
|
|
46
|
+
Preserve `tui/ui/interactive`, `resume/sessions`, `continue`, `demo`, `status/s`,
|
|
47
|
+
`check/c`, `hash/fingerprint`, `validate`, `login/auth`, `account/cloud`,
|
|
48
|
+
`billing`, `logout-cloud`, `serve/web/start`, `test`, `eval`, `review`, `update`,
|
|
49
|
+
`help/--help/-h`, `--version/-v`, `--list-models`, and bare/prompt invocation.
|
|
50
|
+
|
|
51
|
+
Preserve provider/model/thinking/theme, engine executable override aliases,
|
|
52
|
+
session selection, validators/context, shell and session budgets, review mode,
|
|
53
|
+
extension/skill isolation, strict/standard workflow, framing, glyph tier,
|
|
54
|
+
codegraph cap, demo, print and JSON flags. Validate before starting work.
|
|
55
|
+
The `--` separator must allow literal prompts beginning with a dash.
|
|
56
|
+
|
|
57
|
+
Headless output needs real terminal success/error/cancel classification,
|
|
58
|
+
bounded cancellation, and a documented JSONL contract for evaluation consumers.
|
|
59
|
+
`ctg review` preserves exits 0 (approve), 1 (changes requested), and 2
|
|
60
|
+
(inconclusive/infrastructure failure). Admission limits do not reset on restart.
|
|
61
|
+
|
|
62
|
+
## Cross-cutting gates
|
|
63
|
+
|
|
64
|
+
- Two simultaneous tasks in different worktrees cannot share active contracts,
|
|
65
|
+
budget counters, Ship telemetry identities, or review receipts.
|
|
66
|
+
- Normal OpenCode configuration, credentials, service and sessions remain
|
|
67
|
+
separate. Project/ancestor/home discovery and inherited environment settings
|
|
68
|
+
must be probed, not inferred from XDG paths alone.
|
|
69
|
+
- Workspace tools retain the intended user environment; host isolation must not
|
|
70
|
+
redirect unrelated tools' config/cache/credentials.
|
|
71
|
+
- Reconnect restores snapshots after lost events. Cached stale data cannot
|
|
72
|
+
produce a verified/reviewed state.
|
|
73
|
+
- Unicode/large paste, selection, clipboard, terminal title restoration, narrow
|
|
74
|
+
layout, picker keyboard navigation and cancellation work under a real PTY.
|
|
75
|
+
- Package-owned runtime resolves from a fresh production-only install on the
|
|
76
|
+
supported platforms. Package contents exclude workspace dependency folders.
|
|
77
|
+
- Deterministic software-engineering fixtures execute native tools, edit code,
|
|
78
|
+
run failing/passing checks, and exercise recovery. Mocks alone do not prove
|
|
79
|
+
runtime integration.
|
|
80
|
+
|
|
81
|
+
## Performance measurements
|
|
82
|
+
|
|
83
|
+
Targets remain input p95 at most 50 ms, warm session switch p95 at most 150 ms,
|
|
84
|
+
cached workspace load at most 300 ms, bounded plugin memory and no plugin-owned
|
|
85
|
+
idle redraw loop. Startup time in the bootstrap PTY smoke includes intentional
|
|
86
|
+
input delays and must not be reported as a performance measurement.
|
|
87
|
+
|
|
88
|
+
## Executable native-host evidence
|
|
89
|
+
|
|
90
|
+
The following probes use a disposable profile and deterministic loopback provider.
|
|
91
|
+
`CTG_OPENCODE_BIN` can select an explicit test binary; the default is the pinned
|
|
92
|
+
package-owned `node_modules/@opencode/cli/bin/opencode.exe`. An optional first
|
|
93
|
+
argument selects an installed plugin directory.
|
|
94
|
+
|
|
95
|
+
- `node tools/test-native-controls.mjs`: concurrent framing/raw admission,
|
|
96
|
+
persisted launcher settings and framing overrides, compaction notes reaching
|
|
97
|
+
the summary request, cross-location RPC rejection, and whole-service restart
|
|
98
|
+
with authoritative session snapshots.
|
|
99
|
+
- `node tools/test-native-outcomes.mjs`: provider rejection produces a failed
|
|
100
|
+
outcome; interrupt closes an in-flight provider request; a neighboring session
|
|
101
|
+
succeeds; the interrupted session recovers with its history preserved.
|
|
102
|
+
- `node tools/test-native-delivery-host.mjs <plugin-dir>` loads the production
|
|
103
|
+
`setupCarthagent(..., { delivery: true })` composition, not the isolated test
|
|
104
|
+
plugin. Scenarios cover standard/strict delivery, explicit `delivery:false`,
|
|
105
|
+
configured budget interruption (`resume:false`), mixed session settings, and
|
|
106
|
+
simultaneous identical shell commands in one worktree with per-session counts.
|
|
107
|
+
- `npm run test:native-package` repeats those probes against the packed,
|
|
108
|
+
production-only installed artifact. In OpenCode 2.0.32, `ShellCreateBefore`
|
|
109
|
+
lacks session/call identity, so it is never used for attribution or charging;
|
|
110
|
+
the authoritative `tool:execute.before` event supplies session/call identity.
|
|
111
|
+
|
|
112
|
+
Native `session.wait()` can resolve before the durable session projection exposes
|
|
113
|
+
its terminal outcome. Consumers must reconcile within a bounded deadline and
|
|
114
|
+
treat a missing outcome as unresolved. Assistant errors appear as `finish: error`
|
|
115
|
+
with error details; terminal outcomes are recorded by the final `idle` message.
|
|
116
|
+
These probes establish host behavior; delivery adapters, CLI output and installed
|
|
117
|
+
UI integration still require their own acceptance checks above.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Native legacy archive RPC
|
|
2
|
+
|
|
3
|
+
`carthagent.archive` exposes the old Pi session JSONL transcripts as an explicitly read-only archive. It never writes to them and never treats an archive as a live OpenCode session. Clients call `list`, `search`, `read`, or `export` using an opaque SHA-256 transcript ID returned by `list`/`search`; filesystem paths are not part of the RPC contract. Export returns JSON or original JSONL content to the client. Any HTML rendering or save destination is a client responsibility.
|
|
4
|
+
|
|
5
|
+
## Root configuration and limits
|
|
6
|
+
|
|
7
|
+
The host registers the RPC with trusted server-side options: `registerArchive(ctx, { archiveRoots: ['/absolute/path', ...] })`, or the legacy single `archiveDir`. Caller-supplied roots and paths are never accepted. Native hosts should pass the archive directory resolved from the user's original profile/home; if no option is configured, the server falls back to `~/.carthagent/agent/sessions` under the plugin process home. No shared environment discovery is performed. Roots must be normalized absolute paths using the current platform's path rules. Symlinks are skipped and canonical file paths are checked against their configured root.
|
|
8
|
+
|
|
9
|
+
Directory scanning uses streaming `opendir` traversal, checks cancellation throughout async enumeration and descriptor reads, and rejects more than 10,000 entries (including directories) or 2,000 transcripts. Before reading bytes, the server opens the leaf with no-follow semantics, resolves the current path and checks the opened descriptor's `fstat` device/inode against the resolved path's stat, and confirms the resolved target remains under the canonical configured root. This rejects an ancestor directory replaced by an escaping symlink between enumeration and open. Node does not provide portable `openat`/directory-handle-relative traversal, so this is a point-in-time path/descriptor verification rather than an atomic guarantee against a privileged concurrent actor repeatedly renaming ancestors after verification; reads stay bound to the already-verified descriptor. File sizes are obtained from `fstat` immediately before reads, with a 4,000,000-byte per-file cap and 50,000,000-byte total cap. Reads are chunked and enforce the cap independently of enumeration. Parsed JSONL retains valid records and reports bounded malformed-line diagnostics; response parsing is limited to 10,000 rows. List/search pages contain at most 100 items; search queries are limited to 200 characters and excerpts to 400 characters. `archiveOnly: true` marks non-live status. Each method declares `archive_error` with `invalid_request`, `not_found`, `limit_exceeded`, and `archive_io` codes; request schema violations are rejected by the RPC layer as invalid input.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Native OpenCode migration
|
|
2
|
+
|
|
3
|
+
## Product contract
|
|
4
|
+
|
|
5
|
+
Carthagent is moving to OpenCode 2's native terminal host and agent runtime.
|
|
6
|
+
The supported workflow is CTG-only and local: project, task, worktree, session,
|
|
7
|
+
evidence, independent review. Agent of Empires informs the workspace workflow;
|
|
8
|
+
its Rust/tmux runtime is not a dependency. Existing Pi sessions are read-only
|
|
9
|
+
archives. New sessions use a CTG-owned OpenCode service and state namespace.
|
|
10
|
+
|
|
11
|
+
The delivery contract, required validators, fingerprints, check evidence,
|
|
12
|
+
standard/strict workflow distinctions, budget admission and review receipts
|
|
13
|
+
remain Carthagent domain behavior. A completed model response is not a verified
|
|
14
|
+
delivery. Events invalidate cached state; snapshots restore authoritative state
|
|
15
|
+
after reconnect.
|
|
16
|
+
|
|
17
|
+
## Baseline
|
|
18
|
+
|
|
19
|
+
- Source baseline: `599a8ad19836788a6aaa8a4ce24865e20c211388`.
|
|
20
|
+
- Development package: 1.0.3; local installed package at discovery: 1.0.1.
|
|
21
|
+
- Target host: OpenCode 2.0.32.
|
|
22
|
+
- Authoring/client packages: `@opencode/plugin` and `@opencode/client` 2.0.32.
|
|
23
|
+
- Runtime package: pinned `@opencode/cli` 2.0.32. Its platform-specific optional
|
|
24
|
+
package is installed/materialized by npm postinstall; CTG must invoke this
|
|
25
|
+
package-owned binary, never replace or upgrade a user's global OpenCode.
|
|
26
|
+
- Authoring renderer peer baseline: OpenTUI 0.5.17, Solid 1.9.12 (the exact
|
|
27
|
+
Solid peer required by the published OpenTUI package). The host owns runtime
|
|
28
|
+
module resolution; installed-package tests must prove compatibility. The npm
|
|
29
|
+
lock pins transitive `seroval` to patched 1.6.9 (compatible with Solid's
|
|
30
|
+
`^1.0` range) while the required Solid peer is still 1.9.12.
|
|
31
|
+
- The user's original checkout contains unrelated in-progress work and is not
|
|
32
|
+
the integration checkout. Title and copy/paste fixes are in the baseline.
|
|
33
|
+
- Baseline quality passed: lint, typecheck, syntax build, 474/474 tests.
|
|
34
|
+
- Executable host probe: `npm run test:native-host` launches a disposable,
|
|
35
|
+
authenticated 2.0.32 server, loads CTG, validates its health RPC and tears down
|
|
36
|
+
the owned process. It does not test complete product isolation or native UI.
|
|
37
|
+
- Local directories on 2.0.32 require root `index.ts` and `tui.ts` entrypoints;
|
|
38
|
+
package `exports` alone did not load. Keep both forms for packaged/local use.
|
|
39
|
+
- Plugin inventory can initially be empty during activation. Readiness must
|
|
40
|
+
wait for the actual CTG plugin, not just a healthy HTTP listener.
|
|
41
|
+
- Packaged-artifact probe passed after `npm pack` and a clean
|
|
42
|
+
`npm install <tarball> --omit=dev`: server plugin discovery, authenticated RPC,
|
|
43
|
+
rejection of unauthenticated requests and invalid RPC input. The TUI feature
|
|
44
|
+
is discoverable; rendering and interaction still need their separate gate.
|
|
45
|
+
- `npm run test:native-package` verifies the npm tarball excludes `node_modules`,
|
|
46
|
+
contains the server and TUI entrypoints, installs with production dependencies
|
|
47
|
+
into a clean prefix, resolves the platform binary from
|
|
48
|
+
`node_modules/@opencode/cli/bin/opencode.exe`, and starts the isolated server
|
|
49
|
+
using that exact binary. CI also runs the owned binary server test on each
|
|
50
|
+
supported OS/Node matrix row; the PTY check is explicitly Unix-only.
|
|
51
|
+
- Linux PTY diagnostic passed with the native `/ctg-status` command rendering
|
|
52
|
+
its RPC result. Global commands need `mode: 'global'` in the keymap layer;
|
|
53
|
+
omitting it registered a plugin but left its slash command undiscoverable.
|
|
54
|
+
This is a bootstrap test, not approval of the upcoming full product UI.
|
|
55
|
+
- `node tools/test-native-controls.mjs` exercises two concurrent sessions through
|
|
56
|
+
a local deterministic provider on the real 2.0.32 host: delivery framing,
|
|
57
|
+
explicit raw bypass, successful terminal outcomes and compaction notes in the
|
|
58
|
+
actual summary request. Compaction notes use a queued synthetic message because
|
|
59
|
+
the native compact API has no notes parameter; the host can process that
|
|
60
|
+
message in a primary turn before summarizing it.
|
|
61
|
+
|
|
62
|
+
## Delivery ledger
|
|
63
|
+
|
|
64
|
+
Each row requires executable evidence, independent review and an exact-head
|
|
65
|
+
integration check before its PR merges. In-progress does not mean shipped.
|
|
66
|
+
|
|
67
|
+
| Workstream | State | Acceptance |
|
|
68
|
+
| --- | --- | --- |
|
|
69
|
+
| Baseline/build contracts | In progress | Existing checks recorded; new TS/TSX included in checks |
|
|
70
|
+
| Runtime/isolation | In progress | CTG and normal OpenCode coexist; authenticated persistent service |
|
|
71
|
+
| Native plugin host | In progress | Installed package loads server and TUI entrypoints |
|
|
72
|
+
| Providers/auth/telemetry | In progress | Concurrent requests/refreshes maintain credential and session identity |
|
|
73
|
+
| Delivery/policy/budgets | In progress | Native execution preserves evidence, validators and recovery |
|
|
74
|
+
| Native theme/commands/panels | In progress | CTG commands work; host owns input/rendering; semantic themes |
|
|
75
|
+
| Workspace/worktrees | In progress | Independent worktrees and durable task/session mappings |
|
|
76
|
+
| Review | In progress | Fresh-context findings bound to source and PR head; bounded admission |
|
|
77
|
+
| Legacy archive | In progress | Read-only searchable transcripts; no implicit continuation |
|
|
78
|
+
| CLI/headless/dashboard | Pending | Output/exit/locking behavior verified against native runtime |
|
|
79
|
+
| Packaging/upgrade | Pending | Fresh installation and migration tested from packaged artifact |
|
|
80
|
+
| Terminal/performance | Pending | PTY, interaction, streaming and reconnect evidence |
|
|
81
|
+
| Default switch/retirement | Pending | No supported default execution path depends on Pi |
|
|
82
|
+
|
|
83
|
+
## Review workflow
|
|
84
|
+
|
|
85
|
+
Implementation uses `lattice/gpt-6-luna#high` in separate worktrees. A different
|
|
86
|
+
fresh-context Luna session reviews each PR. The parent integrator checks the
|
|
87
|
+
actual diff, tests, integration contracts and exact head before merging. New
|
|
88
|
+
commits invalidate the previous head's approval. No implementation agent merges
|
|
89
|
+
its own work. Required CI remains authoritative; failures are not converted to
|
|
90
|
+
success by documentation or model verdicts.
|
|
91
|
+
|
|
92
|
+
## Important compatibility decisions
|
|
93
|
+
|
|
94
|
+
- Preserve CTG slash names, aliases and arguments through one command manifest.
|
|
95
|
+
- `/raw` bypasses prompt framing, not execution policy.
|
|
96
|
+
- `/restart` must not restart every session's shared service.
|
|
97
|
+
- `/clear` must not delete durable transcript history.
|
|
98
|
+
- Existing `--isolate` means extension/skill discovery isolation, not a worktree.
|
|
99
|
+
- `.harness` state remains per worktree; project views aggregate it.
|
|
100
|
+
- Independent worktree tasks use explicitly located sessions. Native child
|
|
101
|
+
sessions inherit their parent's location and are not assumed isolated.
|
|
102
|
+
- Ship telemetry must be request/session scoped, never one process-global
|
|
103
|
+
current session. Rotating credentials require serialized atomic refresh.
|
|
104
|
+
- CTG runtime XDG overrides must not leak into workspace command environments.
|
|
105
|
+
- Theme names remain compatible; V1 token objects must be converted to V2.
|
|
106
|
+
- Legacy transcripts are archives. No experimental transcript import is needed.
|
|
107
|
+
|
|
108
|
+
## Evidence policy
|
|
109
|
+
|
|
110
|
+
Use deterministic offline provider fixtures for automated integration and PTY
|
|
111
|
+
tests. External repository fixtures are pinned and isolated. Paid model
|
|
112
|
+
comparisons require a separately recorded spending cap and are not necessary to
|
|
113
|
+
prove deterministic runtime integration. Record native terminal/platform gaps
|
|
114
|
+
explicitly. Saved screenshots or recordings are not visual approval by
|
|
115
|
+
themselves.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# CTG native OpenCode runtime
|
|
2
|
+
|
|
3
|
+
CTG runs the package-owned native OpenCode v2.0.32 CLI from the pinned
|
|
4
|
+
`@opencode/cli` dependency. It never downloads, replaces, or implicitly uses a
|
|
5
|
+
user installation. An explicitly supplied `CTG_OPENCODE_BIN` is accepted only
|
|
6
|
+
when its version is exactly 2.0.32.
|
|
7
|
+
|
|
8
|
+
## Isolation and persistence
|
|
9
|
+
|
|
10
|
+
The default CTG profile is `~/.carthagent/opencode`. `CTG_OPENCODE_HOME` (or a
|
|
11
|
+
`root` argument in the runtime API) can select another profile. CTG applies
|
|
12
|
+
private `XDG_CONFIG_HOME`, `XDG_DATA_HOME`, `XDG_STATE_HOME`, and
|
|
13
|
+
`XDG_CACHE_HOME`, plus `OPENCODE_DB`, to native child processes. Config,
|
|
14
|
+
database, credentials, service registration, and cache therefore do not touch
|
|
15
|
+
the normal OpenCode service/profile. Profile directories are mode 0700 and
|
|
16
|
+
generated config is mode 0600. It also sets a private `HOME`,
|
|
17
|
+
`OPENCODE_TEST_HOME`, and `OPENCODE_CONFIG_DIR`, and uses OpenCode 2.0.32's
|
|
18
|
+
supported `OPENCODE_CONFIG_PROJECT_DISABLE` switch to disable project config
|
|
19
|
+
discovery. All inherited `OPENCODE_*` variables are removed before setting
|
|
20
|
+
CTG-owned profile values. It never copies user credentials. Authenticate with
|
|
21
|
+
the CTG-owned service to keep credentials independent. Workspace-local tool execution uses OpenCode's
|
|
22
|
+
session environment endpoint and retains the caller's existing environment.
|
|
23
|
+
|
|
24
|
+
The normal subprocess environment remains unchanged in the workspace. Use
|
|
25
|
+
`workspaceEnvironment(workspace, env)` to prepare the workspace process
|
|
26
|
+
environment; it adds the workspace marker but deliberately does not override
|
|
27
|
+
host XDG values. `setSessionEnvironment(service, sessionID, env, { location })`
|
|
28
|
+
applies it to native shell commands for that OpenCode session. TUI launch retains
|
|
29
|
+
the isolated OpenCode configuration while inheriting the workspace's actual
|
|
30
|
+
credentials through its normal parent environment.
|
|
31
|
+
|
|
32
|
+
## Runtime API
|
|
33
|
+
|
|
34
|
+
`lib/opencode/runtime.mjs` exports `runtimePaths`, `runtimeEnvironment`,
|
|
35
|
+
`provisionRuntime`, `resolveOpenCode`, `runCapture`, and
|
|
36
|
+
`workspaceEnvironment`. Provision with `pluginPath` pointing to the absolute
|
|
37
|
+
CTG plugin entry path (`plugins/carthagent`); this runtime does not bundle or
|
|
38
|
+
resolve the plugin on behalf of the CLI integration.
|
|
39
|
+
|
|
40
|
+
`lib/opencode/service.mjs` exports `ensureService`, `serviceRequest`,
|
|
41
|
+
`createSession`, `getSession`, `promptSession`, `cancelSession`, `sessionMessages`,
|
|
42
|
+
`setSessionEnvironment`, `stopService`, and `launchTui`. `ensureService({ root, pluginPath, profile, startupTimeout })`
|
|
43
|
+
returns the isolated service URL, auth headers, registration metadata, paths,
|
|
44
|
+
and executable after a health/version/PID check. Startup is bounded (20s by
|
|
45
|
+
default), concurrent ensure/stop calls serialize on one profile lifecycle lock,
|
|
46
|
+
and no normal OpenCode service is stopped or restarted. Use `launchTui` to open the
|
|
47
|
+
native OpenCode TUI pointed at CTG's environment, preserving workspace cwd and
|
|
48
|
+
native session flags.
|
|
49
|
+
The TUI attaches with the native CLI `--server` option and CTG service password;
|
|
50
|
+
it does not discover or start another background service. `runHeadless` accepts
|
|
51
|
+
an optional `timeout` in milliseconds (120 seconds by default), aborts the wait
|
|
52
|
+
request and interrupts the session on timeout/cancellation, and returns message
|
|
53
|
+
history in chronological order with the latest assistant result reconciled to
|
|
54
|
+
the newly accepted prompt.
|
|
55
|
+
`stopService({ root })` stops only the healthy process identified by that
|
|
56
|
+
profile's private registration. If a registered process is alive but unhealthy,
|
|
57
|
+
the registration is retained and an error is reported rather than orphaning or
|
|
58
|
+
duplicating the daemon. Lock recovery removes only dead-owner or sufficiently
|
|
59
|
+
old incomplete lock files. A persistent recovery marker causes bounded failure
|
|
60
|
+
with manual lock-file recovery guidance; CTG does not guess whether another
|
|
61
|
+
recovery owner is still active.
|
|
62
|
+
|
|
63
|
+
`lib/opencode/headless.mjs` exports `runHeadless` and the session helpers. It
|
|
64
|
+
uses native `/api/session`, `/prompt`, `/message`, `/interrupt`, environment,
|
|
65
|
+
and wait APIs. It polls the session projection and returns the refreshed session,
|
|
66
|
+
terminal outcome (`succeeded`, `failed`, `interrupted`, or `timed-out`), accepted
|
|
67
|
+
input, chronological messages, and the assistant result. Provider failures and
|
|
68
|
+
missing terminal outcomes are never reported as success. Polling handles transient
|
|
69
|
+
503 responses within the configured timeout; cancellation uses `resume=false`
|
|
70
|
+
and bounded requests. Slash templates
|
|
71
|
+
can be mapped through `nativeCommandConfig` in `compatibility.mjs` into native
|
|
72
|
+
OpenCode `commands` configuration. A real-host check is available via
|
|
73
|
+
`npm run test:native-host`; it uses disposable roots and validates native plugin
|
|
74
|
+
activation, RPC execution/result, and schema failures against v2.0.32.
|
|
75
|
+
|
|
76
|
+
The native CLI integration can use these signatures directly:
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
const service = await ensureService({ root, pluginPath, profile });
|
|
80
|
+
const session = await createSession(service, workspace, { body: { title } });
|
|
81
|
+
await setSessionEnvironment(service, session.id, process.env, { location: workspace });
|
|
82
|
+
const result = await runHeadless(service, workspace, prompt, { signal, env: process.env });
|
|
83
|
+
const tui = launchTui(service, workspace, { sessionID: session.id, env: process.env });
|
|
84
|
+
await stopService({ root });
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`runHeadless` returns `{ session, accepted, messages, result, outcome, terminal,
|
|
88
|
+
error, reason, budgetReason }`; `result` may be absent if the turn produced no
|
|
89
|
+
assistant message. Supply `location` to session helpers when the session's
|
|
90
|
+
workspace differs from the default.
|
|
91
|
+
|
|
92
|
+
Legacy CTG sessions are intentionally not imported into OpenCode. Keep any
|
|
93
|
+
archive/recovery policy in CTG's existing session store; this runtime only
|
|
94
|
+
creates native OpenCode sessions in the isolated profile.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# CTG native OpenCode orchestration
|
|
2
|
+
|
|
3
|
+
CTG's native workflow treats a task, worktree, and session as a durable logical unit. New task sessions are independent root sessions created with an explicit `location.directory`; CTG deliberately does not create OpenCode child sessions because native children inherit the parent's location. Each native worktree keeps its own `.harness` evidence naturally, while the project-level canonical checkout stores `.harness/opencode-tasks.json` as the task relationship and operation journal.
|
|
4
|
+
|
|
5
|
+
The `carthagent.workspace` RPC bridge runs inside the actual OpenCode plugin `Context`. The plugin API has no session-list operation: the server can inventory durable task sessions from task records and in-flight operation journals, then fetch each through native `session.get` and retain it only when its native project ID and location match the project root or that task's recorded worktree. This means the plugin RPC cannot enumerate untracked UI-created sessions; the native TUI client can and should combine its own global session list with this durable server snapshot. Session execution state is `running`, a native terminal outcome, `unknown` (no authoritative lifecycle information), or `unavailable` (the native record could not be fetched); task status never guesses idle from an absent outcome. The UI should use its native session status for ordinary sessions.
|
|
6
|
+
|
|
7
|
+
Delivery status reads `.harness/active.json` rather than selecting a report by modification time, validates the selected report, verifies that its run directory belongs to the requested session, and evaluates check receipts against the current source fingerprint and plan identity. Review is reported unavailable/stale when appropriate; starting a local review rechecks session ownership, snapshots exact local source, launches a location-bound reviewer, and persists the source-bound result. Native session status and execution lifecycle events emit the shared `updated` RPC event; only project-root and recorded task-worktree locations are accepted. Registration is awaited before the event listener starts, and cleanup aborts the stream and disposes the RPC. Legacy transcript import/export is not part of this RPC contract yet; the existing archive helpers are read-only and can be exposed after the shared contract is extended.
|
|
8
|
+
|
|
9
|
+
The native API requires `projectID` for worktree create/list/refresh/remove. Use `ctx.location.project.id` and `ctx.location.project.canonical`, the latter as the canonical plugin/configuration root. Live `session.*` and `worktree.updated` events are invalidation hints only: re-fetch native and CTG task state; do not treat events as durable state or replay missed events.
|
|
10
|
+
|
|
11
|
+
## Durable operations
|
|
12
|
+
|
|
13
|
+
Each create intent is persisted before calling the OpenCode APIs. Successful worktree + root session creation completes the journal entry and records the task. If the operation fails between native API calls, its intent remains `recovery-required`; reconciliation only repairs outcomes that can be verified and never blindly retries a worktree/session create. The JSON state is atomically replaced, and a cooperative exclusive lock serializes local CTG writers. A leftover lock is an explicit recovery condition, not an invitation to steal it automatically.
|
|
14
|
+
|
|
15
|
+
## Legacy Pi archive
|
|
16
|
+
|
|
17
|
+
Pi JSONL files are read-only archive inputs. Listing, searching, transcript display, and JSON/JSONL export are supported; malformed lines are reported with line numbers and valid records remain available. This code does not import, migrate, mutate, or resume archived sessions. All new work starts in a fresh OpenCode session.
|
|
18
|
+
|
|
19
|
+
## Reviews
|
|
20
|
+
|
|
21
|
+
Local delivery review and remote PR review are separate modes. Local delivery review snapshots the exact local diff and HEAD, opens a fresh explicitly located reviewer session, validates only the final assistant text plus a successful session outcome, and rechecks that both source and HEAD remain unchanged before admitting the result. Reviewer sessions use the registered native `build` agent by default with deny-all permissions followed by explicit read/glob/grep allows, blocking shell execution, edits, Code Mode, subagents, and skills. Review waits are abortable and default to a bounded five-minute timeout; cancellation uses the native `continue: false` interruption input and reports if interruption was not confirmed. Structured, validated findings are persisted in the review receipt. PR review queries GitHub via authenticated `gh api`, fetches the authoritative head/base refs into dedicated local refs, derives source from those exact Git objects, and re-fetches metadata and objects after review before recording a verdict. The repository and PR number are inputs; refs/source are never caller-supplied. GitHub CLI authentication is required. Existing `.harness/reviews` state via `lib/review-state.mjs` enforces the three-attempt limit. Neither mode pushes or merges. The default reviewer model is `lattice/gpt-6-luna` variant `high`, configurable by the service. No automatic merge permission is granted.
|
|
22
|
+
|
|
23
|
+
## Reusable module contracts
|
|
24
|
+
|
|
25
|
+
- `createTask({ ctx, projectID, canonical, task, from?, branch?, model?, agent? })` returns a persisted `{ id, task, projectID, canonical, worktree, sessionID, parentTaskID, status, createdAt }` task record.
|
|
26
|
+
- `listTasks({ canonical, includeOperations? })` returns the records, optionally with the operation journal.
|
|
27
|
+
- `listNativeSessions({ ctx, canonical, projectID })` verifies journaled root sessions using the supported `ctx.session.get` API; the plugin `Context` does not expose a session-list method. `listNativeWorktrees({ ctx, canonical, projectID })` uses only native `ctx.worktree.list({ projectID })` inventory.
|
|
28
|
+
- `reconcileTasks({ canonical, projectID, sessionIDs, worktreeDirectories })` returns `{ tasks, operations }` without retrying APIs, scoped to the native project ID. In-process pending operations remain pending during concurrent reconciliation; restart-interrupted operations are adopted only when both the native session and worktree inventories prove their completion.
|
|
29
|
+
- Archive exports: `listLegacyArchive({ roots })`, `searchLegacyArchive({ roots, query })`, `readLegacyTranscript({ path, roots })`, and `exportLegacyTranscript({ path, format?, roots })`. Reads require configured archive roots; symlink files/directories and real paths escaping roots are excluded or rejected.
|
|
30
|
+
- Review exports: `startReview({ ctx, cwd, identity?, model?, agent?, signal?, timeoutMs? })`, `startPullRequestReview({ ctx, cwd, repository, prNumber, model?, agent?, signal?, timeoutMs? })`, `createReviewSnapshot({ source, head })`, and `verifyPullRequestHeads({ localHead, remoteHead, pullRequestHead })`. PR metadata/source commands run via the real `gh` and `git` executables; there is no injectable production command runner. Reviewer agent defaults to the registered native `build` agent and is checked before session creation. Timeout defaults to 300000 ms (maximum 300000); caller cancellation and timeout abort native requests and attempt a bounded interrupt of an already-created reviewer.
|
|
31
|
+
- `registerOrchestration(ctx, options?)` in `plugins/carthagent/src/server/orchestration.ts` returns these operations in a server-oriented facade and an event `watch(signal)` invalidation stream.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Owned-runtime workflow registration bootstrap
|
|
2
|
+
|
|
3
|
+
This PR registers `.github/workflows/publish-owned-opencode-runtime.yml` on
|
|
4
|
+
`main` so GitHub can expose its `workflow_dispatch` entry point. The workflow
|
|
5
|
+
was copied byte-for-byte from reviewed source candidate
|
|
6
|
+
`70882269e25ebcb62c843f9265345342b9e6844d`; its checkout and build inputs are
|
|
7
|
+
selected by explicit reviewed source SHA, so this registration PR does not
|
|
8
|
+
include or imply approval of the product candidate.
|
|
9
|
+
|
|
10
|
+
After this bootstrap is independently reviewed and approved/merged, a
|
|
11
|
+
non-publishing prebuild may be dispatched against the reviewed source branch
|
|
12
|
+
only after that exact source candidate receives independent approval. The
|
|
13
|
+
workflow binds the requested source SHA to the dispatch commit. Publish mode
|
|
14
|
+
remains restricted to the default branch and revalidates the exact final
|
|
15
|
+
package manifest and immutable candidate bytes. This PR does not authorize a
|
|
16
|
+
dispatch, build, publish, or release upload; each requires its own review and
|
|
17
|
+
approval.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Optional plan advisor: evaluation, not approval
|
|
2
|
+
|
|
3
|
+
The deterministic planning gate works without Jev, credentials or network access. `lib/plan-advisor.mjs` defines an injected classifier port; `lib/jev-advisor.mjs` adapts the documented TypeSafe Noul API. Neither imports approval policy or mutates delivery state. Suggestions route SRP, DI and test-gap concerns to adversarial review; a probability is not a defect receipt or permission to implement.
|
|
4
|
+
|
|
5
|
+
## Explicit opt-in
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
# No network, no credentials: no-advisor baseline
|
|
9
|
+
node tools/evaluate-plan-advisor.mjs tests/fixtures/plan-advisor-corpus.json
|
|
10
|
+
|
|
11
|
+
# Optional live evaluation: explicitly transmits design/acceptance/workflow to TypeSafe
|
|
12
|
+
TYPESAFE_API_KEY=... node tools/evaluate-plan-advisor.mjs your-reviewed-corpus.json --jev
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Do not put secrets or private source into planning artifacts sent to an external provider without authorization. Only goal, acceptance, design and workflow are transmitted, not arbitrary top-level state, but those fields may themselves contain sensitive data. The adapter does not claim automatic redaction or default zero retention. No live request was made during this implementation. The default provider model is pinned to `jev-1.13.0`; the adapter accepts an explicitly configured model for later evaluation.
|
|
16
|
+
|
|
17
|
+
The adapter has a 3-second default deadline, no retries, a conservative 64KB request cap and 64KB streamed response cap, rejects redirects, malformed probabilities, missing model identity and provider errors. Failure returns `unavailable` with `authority:none` and cannot weaken deterministic gates. Unknown cost is `null`, not zero. Optional injected input pricing yields an estimate, not billing evidence.
|
|
18
|
+
|
|
19
|
+
## What was actually evaluated
|
|
20
|
+
|
|
21
|
+
- **Local quality: 348 tests**, including no-key operation, injected classifier immutability, typed HTTP request/response contract, timeout even for an uncooperative fake, invalid/oversized response, missing key, HTTP errors and sanitized failure output. A real loopback HTTP server exercises the fetch/streaming adapter and cancellation of a delayed body; no external service is used.
|
|
22
|
+
- **Three-case, supervisor-authored illustrative corpus**: cohesive pure policy, mixed policy/hidden network, and missing parser failure cases. This is neither blind nor representative. Labels are judgments, not independently adjudicated truth. The corpus tests evaluation plumbing, not production readiness.
|
|
23
|
+
- No-advisor baseline: 9 category decisions, 4 false negatives, 5 true negatives, no positive alerts, undefined precision/Brier score and unknown cost. This is an intentionally silent baseline, **not a comparison against Carthagent's deterministic validator or generative review**.
|
|
24
|
+
- Injected probability fixture: one true positive, one false positive, one false negative, Brier score approximately 0.4467. These values test metric calculations only; they are not Jev measurements.
|
|
25
|
+
- **No live Jev accuracy, calibration, latency, cost or net-value claim.** The adapter remains off the normal delivery path until a properly labeled comparison establishes useful additional findings over deterministic + generative review, with acceptable missed defects, false alarms and privacy/cost trade-offs.
|
|
26
|
+
|
|
27
|
+
The evaluator reports TP/FP/FN/TN, precision, recall, Brier score, availability failures, measured local request duration and known/unknown cost separately. Brier score on a tiny corpus is not evidence of general calibration. Future evaluations should retain raw outputs, provenance, human adjudication, false-negative examples, domain strata and a no-Jev generative-review baseline.
|
|
28
|
+
|
|
29
|
+
## Primary API sources
|
|
30
|
+
|
|
31
|
+
The request and response contracts were verified against retrieved primary documentation (not merely search snippets):
|
|
32
|
+
|
|
33
|
+
- [TypeSafe API](https://docs.typesafe.ai/api): `POST /v1/systemone`, typed questions, Noul answers and usage fields.
|
|
34
|
+
- [Model documentation](https://docs.typesafe.ai/models): model identities and vendor-listed pricing/limits.
|
|
35
|
+
- [Known weaknesses](https://docs.typesafe.ai/model-jaggedness/jev-1.13): numeric, multi-hop and cross-question consistency limitations.
|
|
36
|
+
- [Confidence](https://docs.typesafe.ai/confidence): confidence is not an independent correctness oracle.
|
|
37
|
+
|
|
38
|
+
Vendor performance claims are not independently replicated here. Optional integration is deliberately an evaluation boundary, not a mandatory dependency or an approval authority.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Planning startup repair — design and author challenge
|
|
2
|
+
|
|
3
|
+
Reconstructed after the temporary worktree disappeared. Committed benchmark evidence remains unchanged. New persistent worktree: `/home/baissi/ctg-planning-startup`.
|
|
4
|
+
|
|
5
|
+
## Goal and scope
|
|
6
|
+
|
|
7
|
+
Pilot treatments consumed19–54 tools in discovery without a plan. Guide the model into an accurate initial contract sooner without dropping requirements or weakening gates. Provider timeouts remain a separate unresolved problem. No paid benchmark or automatic retry in this change.
|
|
8
|
+
|
|
9
|
+
## Design
|
|
10
|
+
|
|
11
|
+
- Pure `planning-guide.mjs`: short exact field guide, illustrative example tested with production validators, actionable reference diagnostics. Never synthesize/approve a user's plan.
|
|
12
|
+
- Pure `planning-discovery.mjs`: numeric branch-restored pre-plan checkpoint. After8 completed discovery results or2 blocked implementation attempts, recommend first plan or ONE focused unresolved question; after16 reads emphasize expanding discovery. Advisory only; necessary reads always remain available. Restore bounded numeric fields defensively. New user prompt starts a checkpoint; existing/informational plans suppress it.
|
|
13
|
+
- Extension composition: `delivery_design action=guide` works without plan, source fingerprint or workspace mutation. Short startup guidance replaces blanket instructions to read long docs. Checkpoints injected outbound only and persisted as numeric custom entries; no approvals/secrets/requirements stored there. Successful plan suppresses reminders.
|
|
14
|
+
- Deterministic validation: offending component/check/requirement references reported alongside allowed IDs. Preserve finding codes/severity, exact acceptance, user validators, blockers and approval policy.
|
|
15
|
+
- Jev semantic context: include existing check definitions, outputs and assumptions in both built-in adapters; judge scenario-to-check adequacy, not syntax. Same bounded input/output, opt-in, identity-bound3-attempt cap. Invalid plans cannot inspect or invoke Jev; schema repair costs zero calls. Document added external disclosure.
|
|
16
|
+
|
|
17
|
+
## Challenge (author review, not independent approval)
|
|
18
|
+
|
|
19
|
+
Hard discovery cutoff could force guessed designs: rejected. Automatic boilerplate scenarios could launder semantic quality: rejected. Probabilistic schema validation is unnecessary/unsafe: rejected. Do not expand a mandatory schema or repeat full examples each turn. Checkpoint classification is heuristic and cannot authorize anything. Restored state must come from active branch, not an unrelated newer branch. No reapproval on normal implementation edits. Advice bounds/timeouts/gates remain unchanged. More Jev context can hit64KB earlier; report unavailable rather than truncate exact obligations or retry. No claims these changes fix provider reliability or prove model improvement.
|
|
20
|
+
|
|
21
|
+
## Acceptance/tests
|
|
22
|
+
|
|
23
|
+
Guide example passes real validators and stays small. Unknown references remain blocking and actionable. Checkpoints survive compaction/restoration, reset on input, stop on plan, do not nag questions or block reads. Full extension loop guide -> bad schema -> repair -> captured valid plan -> local mock Jev -> self-review -> approval -> edit -> real check -> final diff review -> verified; assert no Jev before valid inspect and preserved exact obligations. Existing stale-source/blocker/user-validator suites remain green. Both adapters send new context unchanged, preserve no-mutation/bounds. Scripted installed-engine offline smoke if available verifies guide/checkpoint/tool pairing, not model efficacy. Focused tests then full quality; preserve all historical artifacts.
|