dsh-vision-router 2.0.0 → 2.1.0
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 +33 -16
- package/README.zh.md +34 -17
- package/cordis.patch.yml +19 -9
- package/docs/architecture/2x-contract-ledger.md +165 -0
- package/docs/architecture/compat-inventory.md +121 -0
- package/docs/architecture/dsh-compatibility-matrix.md +57 -0
- package/docs/architecture/dsh-support-window.md +50 -0
- package/docs/architecture/final-closure-audit.md +148 -0
- package/docs/architecture/p2-jobs-feasibility.md +94 -0
- package/docs/architecture/p3-compat-retirement.md +46 -0
- package/docs/architecture/p3-host-native-seams.md +43 -0
- package/docs/architecture/p3-native-recovery-evaluation.md +65 -0
- package/docs/architecture/runtime-boundaries.md +124 -0
- package/docs/releases/v2.0.1.md +17 -0
- package/docs/releases/v2.1.0-support-window.md +29 -0
- package/docs/releases/v2.1.0.md +83 -0
- package/entry.js +13 -307
- package/index.js +85 -352
- package/lib/abort-signal-compat.js +191 -0
- package/lib/adapter-update-coalescer.js +113 -29
- package/lib/adversarial-hardening.js +24 -9
- package/lib/artifact-boundary.js +16 -175
- package/lib/artifact-io.js +220 -0
- package/lib/artifact-retention.js +305 -53
- package/lib/catalog-corrections.js +6 -1
- package/lib/client-host-compat-prelude.js +249 -0
- package/lib/client-presentation-boundary.js +61 -3
- package/lib/client.js +71 -72
- package/lib/core-vision-surface.js +124 -0
- package/lib/depth-guidance.js +114 -90
- package/lib/doctor-cli-p0.js +168 -0
- package/lib/doctor-cli.js +7 -0
- package/lib/doctor-vision-limits.js +72 -0
- package/lib/dsh-contract-compat.js +207 -39
- package/lib/dsh-host-capabilities.js +107 -0
- package/lib/dsh-support-window.js +48 -0
- package/lib/http-compat.js +22 -6
- package/lib/image-resource-governor.js +35 -10
- package/lib/legacy-core-vision-policy-bridge.js +25 -226
- package/lib/legacy-global-proxy-boundary.js +127 -0
- package/lib/live-model-client-prelude.js +0 -12
- package/lib/mixed-router.js +81 -81
- package/lib/public-entry.js +42 -4
- package/lib/runtime-composition.js +348 -0
- package/lib/runtime-i18n-boundary.js +683 -0
- package/lib/runtime-i18n-core-scope.js +56 -0
- package/lib/runtime-i18n-core.js +34 -0
- package/lib/runtime-i18n.js +121 -0
- package/lib/session-surface-policy.js +97 -0
- package/lib/session-vision-index.js +282 -0
- package/lib/session-vision-runtime.js +48 -0
- package/lib/settings-factory-lifecycle.js +144 -0
- package/lib/settings-ia-client-prelude.js +74 -2
- package/lib/settings-limit-client-prelude.js +110 -0
- package/lib/settings-native-card-layout.js +297 -0
- package/lib/settings-number-contract.js +29 -0
- package/lib/structured-flow-hardening.js +207 -76
- package/lib/tesseract-exec-compat.js +58 -32
- package/lib/update-check.js +17 -5
- package/lib/v2-settings-ia-integration.js +9 -4
- package/lib/vision-artifact-store.js +77 -0
- package/lib/vision-backend-runtime-policy.js +6 -2
- package/lib/vision-background-benchmark.js +130 -41
- package/lib/vision-background-failure-policy.js +70 -0
- package/lib/vision-background-stop-store.js +54 -9
- package/lib/vision-capability-benchmark-client.js +57 -66
- package/lib/vision-capability-benchmark-presentation.js +97 -0
- package/lib/vision-capability-benchmark-service.js +3 -3
- package/lib/vision-execution-order-apply.js +61 -0
- package/lib/vision-execution-order-plan.js +64 -0
- package/lib/vision-execution-order.js +38 -0
- package/lib/vision-limit-diagnostics.js +202 -0
- package/lib/vision-product-presentation.js +284 -0
- package/lib/vision-provider-transport.js +197 -0
- package/lib/vision-resilience.js +87 -45
- package/lib/vision-routing-evidence.js +366 -0
- package/lib/vision-routing-runtime.js +278 -0
- package/lib/vision-tool-runtime-boundary.js +27 -21
- package/lib/vision-turn-budget-client-prelude.js +9 -9
- package/lib/web/benchmark-panel.js +6 -0
- package/lib/web/diagnostics-panel.js +44 -0
- package/lib/web/index.js +60 -0
- package/lib/web/model-picker.js +22 -0
- package/lib/web/onboarding.js +6 -0
- package/lib/web/product-state.js +59 -0
- package/lib/web/remote-settings-client.js +8 -0
- package/lib/web/routing-section.js +6 -0
- package/lib/web/settings-controller.js +6 -0
- package/lib/web-capability-boundary.js +65 -9
- package/lib/windows-screenshot-dpi-compat.js +148 -0
- package/package.json +14 -6
- package/lib/vision-capability-shadow.js +0 -576
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# DSH compatibility matrix
|
|
2
|
+
|
|
3
|
+
This document is the P0 compatibility baseline for dsh-vision-router 2.x.
|
|
4
|
+
|
|
5
|
+
The matrix is capability-based. Runtime code must feature-detect the seam it needs; it must not branch on a DSH version string merely to select a behavior. Version labels below name the CI fixtures that prove each capability.
|
|
6
|
+
|
|
7
|
+
## Gating fixtures
|
|
8
|
+
|
|
9
|
+
| CI fixture | DSH package line | Role |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `minimum-contract` | `0.1.0-rc.6` | Minimum supported Host contract. Must remain green. |
|
|
12
|
+
| `legacy-contract` | `0.1.0-rc.8` | Legacy contract carrying batch attachments and dimension policy. |
|
|
13
|
+
| `current-contract` | `0.1.1-rc.2` | Current contract baseline for 2.x convergence. Must be green before P1. |
|
|
14
|
+
| `latest-dsh` | resolved dynamically from npm | Scheduled canary only. Never a normal PR required check. |
|
|
15
|
+
|
|
16
|
+
Node 22 and Node 24 remain the general required runtime matrix. The Host contract jobs are additive; they do not replace the normal test matrix.
|
|
17
|
+
|
|
18
|
+
## Capability matrix
|
|
19
|
+
|
|
20
|
+
`yes` means the fixture has a direct positive test or feature probe. `no` means a direct negative probe exists. `compat` means the fixture proves Vision Router can safely carry the newer input/config through that Host, but does **not** claim the Host owns that capability. `probe` means the capability is intentionally not inferred from the version label and is verified at runtime/contract-test time.
|
|
21
|
+
|
|
22
|
+
| Capability | minimum-contract rc.6 | legacy-contract rc.8 | current-contract rc.2 | Evidence / detection |
|
|
23
|
+
| --- | --- | --- | --- | --- |
|
|
24
|
+
| Batch attachment save | no | yes | yes | `hasBatchAttachmentContract()` checks the released `attachments.saveImages` prototype; `tests/rc6-rc7-compat.test.js`; contract CI. |
|
|
25
|
+
| Max image dimension policy | compat | yes | yes | All fixtures parse the complete attachment-local row; rc.8/current positively retain the field and the established admission tests exercise the 10000/10001 boundary. Older Schemastery passthrough is not treated as ownership evidence. |
|
|
26
|
+
| Adapter registration | yes | yes | yes | released `ctx.llm.registerAdapter` surface plus adapter contract tests. |
|
|
27
|
+
| Atomic registration replace | probe | probe | yes | current-contract exercises the real registration handle's `replace()` and disposer; Doctor reports `unknown` if a live Host cannot prove replacement without mutating topology. |
|
|
28
|
+
| Settings live namespace | yes | yes | yes | `settings.register()` + live `scope.get()/watch()` compatibility tests; current-contract mounts the real SettingsProvider contract through a minimal storage subclass. |
|
|
29
|
+
| Tool registration / execution | probe | probe | yes | current-contract mounts the released `@deepseek-ai/dsh-tools` runtime, registers a typed tool, executes it, and disposes it; Vision Router tool-runtime boundary tests remain additive. |
|
|
30
|
+
| `prepareCall` | no | no | yes | `tests/adapter-prepare-call-compat.test.js`; current-contract exercises the installed LLM runtime's `prepareCall()`. |
|
|
31
|
+
| Native image coexistence | yes | yes | yes | `tests/native-image-coexistence.test.js`, `tests/issue-289-native-nonintervention.test.js`, cold-resume workflow. |
|
|
32
|
+
| Jobs service | probe | probe | probe | read-only Doctor capability probe only; P2 must run a separate feasibility spike before any scheduler migration. |
|
|
33
|
+
| Client surface replacement | probe | probe | probe | no version inference; keep `unknown` until a safe readable Host seam is available. |
|
|
34
|
+
| Settings web exposure | probe | probe | probe | presentation capability; never inferred from the settings persistence service. |
|
|
35
|
+
| Effect/dispose cleanup | yes | yes | yes | compatibility lifecycle tests plus current-contract adapter/tool/watch disposer checks; plugin registrations remain Cordis-effect owned. |
|
|
36
|
+
| Public entry boot | yes | yes | yes | packed plugin public entry import in each Host contract fixture. |
|
|
37
|
+
| Packaged tarball install | yes | yes | yes | each Host contract fixture packs the plugin then installs the tarball into an isolated Host package. |
|
|
38
|
+
|
|
39
|
+
## Compatibility inventory and exit criteria
|
|
40
|
+
|
|
41
|
+
Every compatibility seam must answer the same six questions: **Reason**, **Host gap**, **First needed for**, **Feature detection**, **Removal condition**, and **Tests**. Source modules carry the detailed annotation; this table is the architectural index.
|
|
42
|
+
|
|
43
|
+
| Seam | Reason / Host gap | Feature detection | Removal condition | Primary tests |
|
|
44
|
+
| --- | --- | --- | --- | --- |
|
|
45
|
+
| `lib/dsh-contract-compat.js` | Keep rc.6 single-attachment behavior, rc.8 attachment overlay repair, and settings/provider ownership semantics across the support window. | attachment/settings/LLM methods, never a version string. | Supported Host window provides the needed public seams natively and minimum supported DSH advances beyond the gap. | `rc6-rc7-compat`, `rc6-real-settings-persistence`, `attachment-admission-policy`, contract CI. |
|
|
46
|
+
| `lib/adapter-update-coalescer.js` | Older Vision Router adapters are duck-typed while DSH 0.1.1 dispatches through `prepareCall`; synchronous topology events can re-enter reconciliation. | adapter has `prepareCall`; event behavior is bounded by the coalescer. | All supported adapters implement the Host contract directly and no supported Host needs the reconciliation guard. | `adapter-prepare-call-compat`, adapter/runtime regression tests. |
|
|
47
|
+
| `lib/android-attachment-compat.js` | Termux/Android file persistence can fail at the permission boundary on the minimum Host contract. | actual Android/Termux environment plus permission-boundary failure and absence of batch attachment ownership. | Minimum supported Host owns a working Android attachment store for this path. | `android-attachment-compat`, resource tests. |
|
|
48
|
+
| `lib/replay-envelope-v2-compat.js` | Durable replay producer identity moved into the v2 replay envelope. | exact `response.kind === 'pi-ai' && response.version === 2` producer proof. | Support window no longer contains histories/runtime needing the old source normalization. | `replay-delegation`, replay/session tests. |
|
|
49
|
+
| `lib/pi-ai-bridge-wire-compat.js` | The legacy direct image bridge predates pi-ai declared wire compatibility. | exact non-streaming image bridge fingerprint and resolved pi-ai route/model facts. | Direct bridge is removed or every supported Host executes the request through the native pi-ai wire contract. | `pi-ai-bridge-wire-compat`, native process-restart contract. |
|
|
50
|
+
| `lib/settings-client-rc8-lifecycle.js` | Browser-side settings lifecycle differs across supported Host generations. | browser/runtime surface behavior, not DSH version parsing. | Support window exposes one stable settings client lifecycle. | settings IA/lifecycle regression tests. |
|
|
51
|
+
|
|
52
|
+
## Rules
|
|
53
|
+
|
|
54
|
+
1. A new version-specific branch requires evidence that no stable capability probe exists.
|
|
55
|
+
2. A compatibility layer may narrow behavior to preserve an existing product contract; it may not expand routing authority.
|
|
56
|
+
3. `latest-dsh` can reveal upstream drift, but a canary failure must not silently redefine the supported contract.
|
|
57
|
+
4. P1 may begin only when all three gating fixtures and the existing cold-resume/resource baselines are green.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# DSH Host support window
|
|
2
|
+
|
|
3
|
+
Status: normative for the DVR 2.x compatibility program.
|
|
4
|
+
|
|
5
|
+
## Current DVR 2.1.x window
|
|
6
|
+
|
|
7
|
+
| Role | DSH train | Meaning |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Minimum Supported Host | `0.1.0-rc.8` | Oldest Host generation that DVR 2.1.x publicly supports. |
|
|
10
|
+
| Previous Supported Train | `0.1.1-rc.1` | Previous released Host train kept in the compatibility matrix. |
|
|
11
|
+
| Current Supported Train | `0.1.1-rc.2` | Current released train used by the required current-contract gate. |
|
|
12
|
+
| Canary only | `0.1.2-alpha.4` | Latest upstream prerelease evidence at v2.1.0 release preparation time. It is not a released support-floor claim and does not authorize compat deletion by itself. |
|
|
13
|
+
|
|
14
|
+
DVR `2.1.x` therefore supports DSH `0.1.0-rc.8` and newer released trains covered by the published matrix. Runtime branching remains capability-based rather than version-string-driven.
|
|
15
|
+
|
|
16
|
+
## Floor transition from DVR 2.0.x
|
|
17
|
+
|
|
18
|
+
DVR 2.0.x was released with DSH `0.1.0-rc.6` as its minimum Host. The 2.1.0 boundary was announced in advance and raises the public minimum to DSH `0.1.0-rc.8`.
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
DVR 2.0.x minimum: DSH 0.1.0-rc.6
|
|
22
|
+
DVR 2.1.x minimum: DSH 0.1.0-rc.8
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Users still on rc.6/rc.7 should upgrade DSH before upgrading to DVR 2.1.x.
|
|
26
|
+
|
|
27
|
+
This support-floor transition does **not** require deleting every rc.6-era compatibility seam in the same release. Compatibility code is retired only after a separate proof shows it is unreachable or unnecessary on every supported Host and durable-history path.
|
|
28
|
+
|
|
29
|
+
No later support-floor increase is currently announced.
|
|
30
|
+
|
|
31
|
+
## Support-window change protocol
|
|
32
|
+
|
|
33
|
+
A Host support-floor change is valid only when all of the following are true:
|
|
34
|
+
|
|
35
|
+
1. the change is announced in a DVR minor or major release, never only in a patch release;
|
|
36
|
+
2. README / support documentation and release notes state the old and new floors;
|
|
37
|
+
3. Doctor reports the effective support window and gives a capability-based upgrade result for Hosts below the active floor;
|
|
38
|
+
4. required CI has stable minimum, previous, current, and canary evidence for the declared window;
|
|
39
|
+
5. compatibility seams are removed only after the new minimum Host proves the replacement capability;
|
|
40
|
+
6. removal PRs keep restart, settings, native-image coexistence, tool execution, Node 22/24 and supported-platform regressions green.
|
|
41
|
+
|
|
42
|
+
## Capability-first rule
|
|
43
|
+
|
|
44
|
+
Version labels describe the public support window; runtime branching still uses capabilities.
|
|
45
|
+
|
|
46
|
+
DVR must not turn this table into widespread version-string conditionals. Runtime compatibility continues to feature-detect the concrete Host seam it needs. If a capability cannot be proven safely, the compatibility path fails open or reports an explicit unsupported/unknown state according to that seam's contract.
|
|
47
|
+
|
|
48
|
+
## Compatibility-retirement rule
|
|
49
|
+
|
|
50
|
+
The 2.1.x floor makes rc.6-only compatibility candidates eligible for a fresh deletion audit, but does not automatically authorize deletion. Durable session formats, replay envelopes, adapter wire shapes, and other historical inputs may outlive the Host version that originally produced them.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# 2.x Architecture Closure — final adversarial audit
|
|
2
|
+
|
|
3
|
+
Audit baseline: `main@1c11c1c3c7046268ae1c7b8f2287b023aeb1eb26` (after C3-B / PR #339).
|
|
4
|
+
|
|
5
|
+
This document records the final adversarial architecture review. It is not a feature roadmap and does not claim that PDF, video, CAD or GUI-agent support exists. The final `CLOSED` declaration is allowed only after the accompanying final Closure gate is merged and the resulting `main` gates are green.
|
|
6
|
+
|
|
7
|
+
## Severity result
|
|
8
|
+
|
|
9
|
+
| Severity | Structural blockers |
|
|
10
|
+
| --- | ---: |
|
|
11
|
+
| High | 0 |
|
|
12
|
+
| Medium | 0 |
|
|
13
|
+
|
|
14
|
+
No remaining finding establishes a second semantic owner for Authority, routing, Session recovery/surface repair, Artifact storage, Router-owned provider HTTP, Host product decisions, or browser presentation.
|
|
15
|
+
|
|
16
|
+
## Single-owner result
|
|
17
|
+
|
|
18
|
+
| Semantic responsibility | Current owner | Permanent evidence |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| User routing/background authority | `lib/vision-routing-authority.js` | P1 routing parity + Architecture Closure |
|
|
21
|
+
| Capability evidence collection | `lib/vision-routing-evidence.js` | routing evidence/runtime parity |
|
|
22
|
+
| Capability planning/scoring | `lib/vision-capability-router.js` | P1 routing parity |
|
|
23
|
+
| Scoped execution order | `lib/vision-execution-order.js` | execution-order wiring/parity |
|
|
24
|
+
| Session indexing, durable recovery and surface repair | `lib/session-vision-index.js` | `session-runtime-core-wiring.test.js` |
|
|
25
|
+
| Session bounded state | `lib/session-vision-state.js` | Session runtime/state integration gates |
|
|
26
|
+
| Managed artifact publication/lifetime | `lib/vision-artifact-store.js` | artifact boundary/store gates |
|
|
27
|
+
| Router-owned provider HTTP | `lib/vision-provider-transport.js` | P2 provider-transport gates |
|
|
28
|
+
| Host product/presentation decisions | `lib/vision-product-presentation.js` | presentation convergence/switch gates |
|
|
29
|
+
| Browser rendering | Web benchmark client/panel | browser second-owner algorithms are forbidden by `presentation-switch.test.js` |
|
|
30
|
+
|
|
31
|
+
## Duplicate-owner adversarial checks
|
|
32
|
+
|
|
33
|
+
### Session
|
|
34
|
+
|
|
35
|
+
- Production creates one explicit `SessionVisionRuntime` and supplies the same index owner to the Session boundary and Core.
|
|
36
|
+
- `currentSessionVisionStateStore`, module-global `currentStore`, lookup monkey-patching and the old Core scan/recovery/surface-repair algorithms are forbidden by the Closure suite.
|
|
37
|
+
- Repository search at the audit baseline finds `currentSessionVisionStateStore` only inside the test that forbids its return.
|
|
38
|
+
|
|
39
|
+
Result: **PASS**.
|
|
40
|
+
|
|
41
|
+
### Core policy / Settings impersonation
|
|
42
|
+
|
|
43
|
+
`legacy-core-vision-policy-bridge.js` retains only two real pre-step compatibility behaviors. The Closure suite forbids projected Settings/config/scope/child views and forbids interception of `ctx.get('settings')` or injected Settings children.
|
|
44
|
+
|
|
45
|
+
Result: **PASS**.
|
|
46
|
+
|
|
47
|
+
### Browser product ownership
|
|
48
|
+
|
|
49
|
+
The browser consumes Host candidate `presentation` state. The final switch gate forbids browser implementations of background eligibility, deferred/excluded interpretation, measured-text-only inference and the retired runtime-status fetch/switch shim.
|
|
50
|
+
|
|
51
|
+
Result: **PASS**.
|
|
52
|
+
|
|
53
|
+
### Capability shadow
|
|
54
|
+
|
|
55
|
+
`lib/vision-capability-shadow.js` and its historical test path are deleted. A recursive gate forbids imports of the retired shadow surface from production, tests or scripts.
|
|
56
|
+
|
|
57
|
+
Result: **PASS**.
|
|
58
|
+
|
|
59
|
+
## Compatibility result
|
|
60
|
+
|
|
61
|
+
The normative compatibility inventory now requires every retained seam to document:
|
|
62
|
+
|
|
63
|
+
- reason;
|
|
64
|
+
- Host/internal gap;
|
|
65
|
+
- feature/capability detection;
|
|
66
|
+
- removal condition;
|
|
67
|
+
- tests.
|
|
68
|
+
|
|
69
|
+
The inventory-completeness gate covers 11 retained seams.
|
|
70
|
+
|
|
71
|
+
Two notable retained items are intentionally **not blockers**:
|
|
72
|
+
|
|
73
|
+
1. `legacy-core-vision-policy-bridge.js` remains for the two supported pre-step behaviors described above.
|
|
74
|
+
2. `vision-provider-transport.js` retains one scoped process/profile registry because mature OpenAI-compat and Anthropic catalog-correction callers still read `currentVisionProviderTransport()`. Its install/release lifecycle and deletion trigger are explicit.
|
|
75
|
+
|
|
76
|
+
A repository-wide audit of the exact `const installed = []` pattern found only the inventoried VisionProviderTransport registry. The retired Session current-owner locator is absent from production.
|
|
77
|
+
|
|
78
|
+
Result: **PASS / justified compatibility only**.
|
|
79
|
+
|
|
80
|
+
## Future-modality tabletop
|
|
81
|
+
|
|
82
|
+
The Closure architecture is tested against hypothetical future additions:
|
|
83
|
+
|
|
84
|
+
- PDF;
|
|
85
|
+
- video;
|
|
86
|
+
- CAD screenshot;
|
|
87
|
+
- GUI agent;
|
|
88
|
+
- `1+X` structured-first / free-follow-up vision.
|
|
89
|
+
|
|
90
|
+
These are architecture scenarios, not implemented features.
|
|
91
|
+
|
|
92
|
+
An acceptable future change may add:
|
|
93
|
+
|
|
94
|
+
- capability vocabulary;
|
|
95
|
+
- evidence/intent mapping;
|
|
96
|
+
- an operation/tool or model path;
|
|
97
|
+
- presentation state when needed.
|
|
98
|
+
|
|
99
|
+
The tabletop fails if the feature proposal requires a new semantic infrastructure owner such as:
|
|
100
|
+
|
|
101
|
+
- Settings proxy/impersonation;
|
|
102
|
+
- new context wrapper carrying internal policy semantics;
|
|
103
|
+
- new module-global runtime registry;
|
|
104
|
+
- new Session cache/owner;
|
|
105
|
+
- new Host patch or lifecycle exception used to bypass existing owners.
|
|
106
|
+
|
|
107
|
+
`tests/final-architecture-closure.test.js` also binds the tabletop to the real current owner modules and recursively checks production for hidden module-global `current*` owners and unregistered `installed[]` registries.
|
|
108
|
+
|
|
109
|
+
Result at audit design time: **PASS, pending final PR/main execution**.
|
|
110
|
+
|
|
111
|
+
## Long-term anti-regression gate
|
|
112
|
+
|
|
113
|
+
Architecture Closure permanently carries these constituent gates:
|
|
114
|
+
|
|
115
|
+
- external/cross-boundary contract baseline;
|
|
116
|
+
- compatibility inventory completeness;
|
|
117
|
+
- Settings impersonation closure;
|
|
118
|
+
- Host-presentation/browser switch closure;
|
|
119
|
+
- capability-shadow retirement;
|
|
120
|
+
- Session runtime/Core single-owner wiring;
|
|
121
|
+
- final owner/tabletop/runtime-locator closure gate.
|
|
122
|
+
|
|
123
|
+
This deliberately protects ownership/dependency direction rather than trying to make every occurrence of words such as `legacy`, `Proxy` or `current` illegal.
|
|
124
|
+
|
|
125
|
+
## Regression evidence on the C3-B merged baseline
|
|
126
|
+
|
|
127
|
+
Exact baseline: `1c11c1c3c7046268ae1c7b8f2287b023aeb1eb26`.
|
|
128
|
+
|
|
129
|
+
- Architecture Closure: run `33258346425`, Node 22/24 success.
|
|
130
|
+
- P3 Compatibility Convergence: run `33258346400`, Node 22/24 success.
|
|
131
|
+
- DSH Contract: run `33258346423`, minimum/legacy/current success.
|
|
132
|
+
- P1 Routing Parity: run `33258346406`, Node 22/24 success.
|
|
133
|
+
- P2 Data Boundary: run `33258346424`, all Node 22/24 boundary jobs success.
|
|
134
|
+
- Native multimodal cold resume: run `33258346404`, rc.7/rc.8 on Node 22/24 success.
|
|
135
|
+
- CI: run `33258346403`, Node 22/24, rc.6/rc.7/rc.8 and Ubuntu/macOS/Windows success.
|
|
136
|
+
- CodeQL: run `33258346338`, Actions and JavaScript/TypeScript analyses success.
|
|
137
|
+
|
|
138
|
+
## Final decision rule
|
|
139
|
+
|
|
140
|
+
At this baseline the adversarial audit has **zero High/Medium structural blockers**. Architecture convergence must not be declared closed merely from this document or from a green PR.
|
|
141
|
+
|
|
142
|
+
Closure becomes final only when:
|
|
143
|
+
|
|
144
|
+
1. the future-modality/runtime-locator gate in this final PR passes;
|
|
145
|
+
2. the final PR is merged normally;
|
|
146
|
+
3. the resulting `main` SHA passes the required and Architecture Closure gates (plus the normal regression/security matrix triggered by the change).
|
|
147
|
+
|
|
148
|
+
After those conditions are met, stop architecture convergence rather than continuing purity refactors. Future PDF/video/1+X work belongs to product PRs that must respect these owner boundaries.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# P2-F — `ctx.jobs` Feasibility Spike
|
|
2
|
+
|
|
3
|
+
Status: **NO-GO: retain current scheduler**
|
|
4
|
+
|
|
5
|
+
Reviewed against:
|
|
6
|
+
|
|
7
|
+
- DeepSeek Harness `main` at `cd5ef8148158c3a752a658978873241fdf8e2bbc` (`dsh@0.1.2-alpha.1` release merge, 2026-08-27).
|
|
8
|
+
- Official Jobs subsystem contract: `docs/subsystems/jobs.md` at the same commit.
|
|
9
|
+
- Vision Router `createBackgroundCapabilityProfiler()` and its current regression suites.
|
|
10
|
+
|
|
11
|
+
This is a feasibility result, not a rejection of `ctx.jobs` as a Host feature. Jobs is the correct generic long-running-work registry when its ownership model matches the producer. The question here is narrower: **would replacing Vision Router's background capability scheduler with `ctx.jobs` reduce custom lifecycle code without weakening routing authority, priority, or restart semantics?** The answer is no on the current Host contract.
|
|
12
|
+
|
|
13
|
+
## Host contract observed
|
|
14
|
+
|
|
15
|
+
The current DSH Jobs contract provides:
|
|
16
|
+
|
|
17
|
+
- atomic registration and lifecycle state;
|
|
18
|
+
- optional exact `Agent` ownership with session-fenced access;
|
|
19
|
+
- unowned jobs when no owner is supplied;
|
|
20
|
+
- cancellation, bounded wait, output/status reads and completion listeners;
|
|
21
|
+
- owner disposal and service disposal cancellation/await semantics;
|
|
22
|
+
- an attached-controller admission fence: `start()` refuses work when no attached job controller serves the selected owner;
|
|
23
|
+
- one registry across process compositions, with visibility/delivery determined by the registering context and owner.
|
|
24
|
+
|
|
25
|
+
It does **not** define a producer-independent priority scheduler. In particular, the Jobs contract has no native concept of:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
foreground visual work
|
|
29
|
+
> manual capability benchmark
|
|
30
|
+
> unattended background benchmark
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Nor does it know Vision Router's live measurement authority, endpoint identity/fingerprint, local-free eligibility, topology revision, or publish fence.
|
|
34
|
+
|
|
35
|
+
## Ten required checks
|
|
36
|
+
|
|
37
|
+
| # | Requirement | Current scheduler | `ctx.jobs` as replacement | Result |
|
|
38
|
+
|---|---|---|---|---|
|
|
39
|
+
| 1 | profile-wide job ownership | Profiler is installed once on the plugin composition/capability store and is not session-owned. | An **unowned** Job can be profile/process-visible, but an owned Job is tied to an exact Agent and requires a serving controller. Choosing unowned preserves profile scope but gains no useful owner lifecycle over the current profiler. | **No migration benefit** |
|
|
40
|
+
| 2 | Web settings page close must not stop work | Background profiler lives in the plugin fiber; the Web route is only a status/control projection. Closing the page does not own the profiler. | Possible only if the Job registration/controller is kept outside the page/client scope. This adds composition/controller placement constraints rather than removing them. | **Current is simpler** |
|
|
41
|
+
| 3 | plugin dispose immediately terminates work | `installBackgroundCapabilityProfiling()` registers an effect disposer that unregisters listeners and calls `profiler.stop()`, which aborts current work. | Jobs service/owner disposal can cancel and await compliant producers. | **Jobs capable, no decisive gain** |
|
|
42
|
+
| 4 | `all → off` immediately aborts | Policy polling and `settingsChanged()` revoke authorization and abort the active controller; yielded work does not receive provider backoff. | Jobs can carry a `cancel()` hook, but it does not observe Vision Router settings or infer authority revoke. We would retain the same settings watcher/policy logic to call it. | **No lifecycle reduction** |
|
|
43
|
+
| 5 | `all → local-free` narrows correctly | `workStillAuthorized()` re-evaluates live authority and candidate eligibility; paid work aborts while eligible local work may continue. | Jobs has no backend/authority semantics. The same Vision Router eligibility code must remain outside the registry. | **No lifecycle reduction** |
|
|
44
|
+
| 6 | manual Benchmark preempts background | `manualStart()` increments a lease, aborts current background work, and blocks new background ticks until all manual work releases. | Jobs has no cross-kind priority/preemption contract. We would have to rebuild the same arbitration above Jobs. | **FAIL as replacement** |
|
|
45
|
+
| 7 | foreground visual work has highest priority | `foregroundStart()` immediately aborts background work and resets the idle window; foreground tool wrappers bracket activity. | Jobs has no producer-independent priority/preemption contract. | **FAIL as replacement** |
|
|
46
|
+
| 8 | headless behavior | Scheduler depends on settings/core/store/timers, not on a browser page or Agent owner. | An unowned Job can be headless, but an owned Job adds owner/controller admission requirements. Using unowned Jobs again removes the principal ownership benefit. | **Current is simpler / fewer assumptions** |
|
|
47
|
+
| 9 | process restart semantics | Work itself is intentionally not resumed. On restart the scheduler reconstructs from persisted measured evidence, image verdicts and bounded background-stop records, then chooses fresh work. | Current JobRegistry is a process-local lifecycle registry; the documented contract does not provide durable replay/resume of producer work. We would still need Vision Router's persisted evidence/stop semantics. | **No migration benefit** |
|
|
48
|
+
| 10 | background stop/evidence publish fencing | Before `store.put`, `assertBackgroundPublishable()` rechecks live authority, current candidate existence, benchmarkability, endpoint fingerprint and current background eligibility. Persistent stops are separately bounded and credential-aware. | Jobs settlement records generic lifecycle state; it does not validate model identity, fingerprint, routing authority, or evidence publication. The full fence must remain. | **FAIL as simplification** |
|
|
49
|
+
|
|
50
|
+
## GO criteria evaluation
|
|
51
|
+
|
|
52
|
+
The implementation plan allows migration only if Jobs satisfies all of these architecture outcomes.
|
|
53
|
+
|
|
54
|
+
| GO criterion | Evaluation |
|
|
55
|
+
|---|---|
|
|
56
|
+
| Reduce custom lifecycle code | **FAIL.** Priority, settings/topology invalidation, eligibility and publish fencing all remain; Jobs adds registration/controller placement. |
|
|
57
|
+
| Do not weaken authority revoke | Achievable only by retaining the current revoke logic around Jobs; therefore no simplification. |
|
|
58
|
+
| Preserve priority | **FAIL natively.** Current DSH Jobs has no foreground/manual/background priority contract. |
|
|
59
|
+
| Preserve Web-close continuation | Achievable only with careful unowned/profile-scoped registration, which adds scope assumptions. |
|
|
60
|
+
| Do not add session-owner assumptions | **FAIL for owned Jobs;** unowned Jobs avoid the assumption but also discard the ownership benefit. |
|
|
61
|
+
|
|
62
|
+
## Decision
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
NO-GO: retain current scheduler
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
This is a successful P2-F outcome under the implementation plan.
|
|
69
|
+
|
|
70
|
+
The current `createBackgroundCapabilityProfiler()` remains production authority for unattended benchmark scheduling. `ctx.jobs` should be reconsidered only if a future Host contract adds a generic priority/resource scheduler or a profile-scoped owner/controller seam that demonstrably eliminates Vision Router's custom arbitration rather than wrapping it.
|
|
71
|
+
|
|
72
|
+
## Evidence / regression coverage
|
|
73
|
+
|
|
74
|
+
Current repository tests already exercise the semantics that a migration would have to preserve:
|
|
75
|
+
|
|
76
|
+
- `tests/vision-background-benchmark.test.js`
|
|
77
|
+
- foreground abort/preemption;
|
|
78
|
+
- manual benchmark lease/preemption;
|
|
79
|
+
- `all → off` revoke;
|
|
80
|
+
- `all → local-free` narrowing;
|
|
81
|
+
- topology-change abort;
|
|
82
|
+
- local-free eligibility.
|
|
83
|
+
- `tests/vision-background-lifecycle.test.js`
|
|
84
|
+
- bounded persistent-stop lifetime;
|
|
85
|
+
- credential-rotation release;
|
|
86
|
+
- failure-lifetime separation.
|
|
87
|
+
- `lib/vision-background-benchmark.js`
|
|
88
|
+
- plugin effect disposal;
|
|
89
|
+
- headless timer ownership;
|
|
90
|
+
- pre-publish live authority / candidate / fingerprint fence.
|
|
91
|
+
|
|
92
|
+
Official DSH reference used for the spike:
|
|
93
|
+
|
|
94
|
+
- `https://github.com/deepseek-ai/deepseek-harness/blob/cd5ef8148158c3a752a658978873241fdf8e2bbc/docs/subsystems/jobs.md`
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# P3-B compatibility retirement audit
|
|
2
|
+
|
|
3
|
+
Decision date: 2026-08-28
|
|
4
|
+
|
|
5
|
+
Current DVR train: `2.0.x`
|
|
6
|
+
|
|
7
|
+
Current minimum supported Host: DSH `0.1.0-rc.6`
|
|
8
|
+
|
|
9
|
+
## Result
|
|
10
|
+
|
|
11
|
+
**NO COMPAT DELETION IS CURRENTLY AUTHORIZED.**
|
|
12
|
+
|
|
13
|
+
P3-B is intentionally a retirement audit, not a quota to delete files. Under the current 2.0.x support window, every Host-generation compatibility seam that materially exists for rc.6/rc.8 users still has a reachable support case.
|
|
14
|
+
|
|
15
|
+
## Seam review
|
|
16
|
+
|
|
17
|
+
| Seam | Why it still exists in 2.0.x | Earliest retirement trigger |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| attachment contract / Android attachment fallback | rc.6 remains the minimum and does not provide the later batch-attachment contract used by the modern path | after the released minimum Host no longer needs the single-attachment/permission fallback and the replacement is proven on the new minimum |
|
|
20
|
+
| Host settings compatibility | rc.6 remains supported; live settings/client behavior differs across the support window | after the new minimum exposes the stable settings seam used by DVR without compatibility wrapping |
|
|
21
|
+
| rc.8 browser/client lifecycle compatibility | rc.8 is still inside the declared support window and remains the Previous Supported Train | only after rc.8 itself leaves the support window or the same path becomes unreachable by capability proof |
|
|
22
|
+
| replay envelope v2 compatibility | old durable histories remain valid inputs even when the live Host is newer | only when the supported history/runtime window no longer needs producer rebinding or Host provides an equivalent native replay identity seam |
|
|
23
|
+
| adapter prepareCall/coalescing compatibility | the support matrix still spans Host generations with different adapter-registration/update behavior | only when the minimum Host and every DVR-owned adapter satisfy one stable registration/update contract |
|
|
24
|
+
| pi-ai bridge wire compatibility | legacy direct-bridge traffic remains a supported route shape | only after the direct bridge is retired or all supported Hosts execute that path through an equivalent native wire seam |
|
|
25
|
+
| process-global proxy compatibility | P2-E already reduced this to Host-owned/raw-fetch compatibility only; the minimum Host still lacks a provider-scoped/shared proxy seam | when the minimum supported Host provides a provider-scoped/shared HTTP proxy seam |
|
|
26
|
+
|
|
27
|
+
## First planned deletion window
|
|
28
|
+
|
|
29
|
+
The announced DVR 2.1.0 floor is DSH `0.1.0-rc.8`. That boundary makes **rc.6-only** compatibility candidates eligible for a fresh deletion audit, but it does not automatically delete them.
|
|
30
|
+
|
|
31
|
+
Each deletion still requires proof on:
|
|
32
|
+
|
|
33
|
+
- minimum Host;
|
|
34
|
+
- current Host;
|
|
35
|
+
- process restart / cold resume;
|
|
36
|
+
- settings read/write behavior;
|
|
37
|
+
- native multimodal coexistence;
|
|
38
|
+
- tool registration and execution;
|
|
39
|
+
- Node 22 and Node 24;
|
|
40
|
+
- Ubuntu, macOS and Windows where the seam affects runtime/platform behavior.
|
|
41
|
+
|
|
42
|
+
## P3-B verdict
|
|
43
|
+
|
|
44
|
+
`PASS — no expired seam under the current 2.0.x support window.`
|
|
45
|
+
|
|
46
|
+
Deleting a still-supported rc.6 seam merely to make the compatibility inventory smaller would violate the P3 plan and the published 2.0.x compatibility contract.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# P3-D Host-native seam migration evaluation
|
|
2
|
+
|
|
3
|
+
Decision date: 2026-08-28
|
|
4
|
+
|
|
5
|
+
Support window: DVR `2.0.x` / minimum DSH `0.1.0-rc.6` / previous `0.1.0-rc.8` / current `0.1.1-rc.2`.
|
|
6
|
+
|
|
7
|
+
P3-D permits a migration only when all four conditions are true:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
official API stable
|
|
11
|
+
+ minimum Host supports it
|
|
12
|
+
+ parity proved
|
|
13
|
+
+ replacement is simpler
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Current result: **NO NEW HOST-NATIVE MIGRATION IS AUTHORIZED IN DVR 2.0.x.**
|
|
17
|
+
|
|
18
|
+
| Candidate | Current evidence | Decision |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| settings exposure | Newer Hosts expose stronger live settings seams, but rc.6 remains the minimum and existing compatibility is still required for the supported window | NO-GO in 2.0.x |
|
|
21
|
+
| provider transport / proxy | P2-D moved Router-owned HTTP to `VisionProviderTransport`; P2-E reduced the global patch to Host-owned/raw-fetch compatibility. The minimum Host still has no proven provider-scoped/shared proxy seam | KEEP P2 boundary; no native migration |
|
|
22
|
+
| `ctx.jobs` | P2-F's ten-point spike found that Jobs does not replace DVR's priority, authority-revoke, topology-abort and evidence-publication fencing without retaining the custom scheduler | NO-GO; retain current scheduler |
|
|
23
|
+
| adapter registration replacement | Current Host generations expose better replacement behavior, but a read-only capability probe cannot prove a stable returned handle across the full minimum/previous/current window | NO-GO until minimum Host contract and parity tests prove one handle contract |
|
|
24
|
+
| scoped tool execution hooks | Current DSH has richer tool pipeline seams, but the rc.6 support floor and existing mature wrapper behavior mean a migration would be a split-path compatibility rewrite rather than simplification | NO-GO in 2.0.x |
|
|
25
|
+
|
|
26
|
+
## Important distinction
|
|
27
|
+
|
|
28
|
+
P3-D is not a requirement to consume every API present on upstream `main`. A seam visible only on a development/canary Host does not satisfy the support-window rule.
|
|
29
|
+
|
|
30
|
+
Likewise, a native seam that still requires DVR to keep the old implementation for the minimum Host fails the "replacement is simpler" criterion unless the split itself has a concrete product or reliability benefit.
|
|
31
|
+
|
|
32
|
+
## Revisit trigger
|
|
33
|
+
|
|
34
|
+
Re-run this matrix when one of these occurs:
|
|
35
|
+
|
|
36
|
+
1. DVR 2.1.0 actually raises the minimum Host to rc.8;
|
|
37
|
+
2. a released DSH train exposes a provider-scoped/shared proxy contract;
|
|
38
|
+
3. adapter replacement or tool-execution hooks become stable on the declared minimum Host;
|
|
39
|
+
4. upstream Jobs semantics materially change enough to satisfy the P2-F go criteria.
|
|
40
|
+
|
|
41
|
+
## P3-D verdict
|
|
42
|
+
|
|
43
|
+
`PASS — evaluated; no migration currently meets the plan's four mandatory conditions.`
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# P3-E native request recovery vs Vision Chain
|
|
2
|
+
|
|
3
|
+
Decision date: 2026-08-28
|
|
4
|
+
|
|
5
|
+
Upstream evidence baseline: DeepSeek Harness `main@cd5ef8148158c3a752a658978873241fdf8e2bbc` (`dsh@0.1.2-alpha.1` release merge) plus the released support window used by DVR 2.0.x.
|
|
6
|
+
|
|
7
|
+
## Question
|
|
8
|
+
|
|
9
|
+
Can DSH-native `agent/request`, `agent/request-error`, `llm/stream` and Host retry semantics replace DVR's mature synthetic `vision-chain` without losing behavior?
|
|
10
|
+
|
|
11
|
+
## Result
|
|
12
|
+
|
|
13
|
+
**KEEP `vision-chain`.**
|
|
14
|
+
|
|
15
|
+
The upstream retry executor is intentionally an agent-loop request-recovery mechanism. It handles a failed model request at the open-step `agent/request-error` boundary and re-runs that step under the selected provider's retry policy. Its own package contract states that it does **not** wrap the streaming call itself and that direct `ctx.llm.stream()` consumers remain single-attempt.
|
|
16
|
+
|
|
17
|
+
That is useful Host behavior, but it is not the same execution problem as DVR's visual backend chain.
|
|
18
|
+
|
|
19
|
+
## Required semantic comparison
|
|
20
|
+
|
|
21
|
+
| Required DVR behavior | Native recovery fit | Finding |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| cross-provider fallback | insufficient | Host retry is provider-policy request recovery; DVR must deliberately move across visual backends/providers |
|
|
24
|
+
| shared total deadline | insufficient as replacement | DVR owns one visual-task deadline across multiple backend attempts; independent Host retries can add latency/budget unless separately fenced |
|
|
25
|
+
| fair per-backend budget | insufficient | DVR reserves bounded attempt budgets so one backend cannot consume the whole visual task |
|
|
26
|
+
| circuit breaker | not replacement-equivalent | DVR breaker is backend/deployment-aware and integrated with fallback selection |
|
|
27
|
+
| exact route identity | partial | Host retry preserves/reconstructs a request identity, but DVR also needs exact candidate/deployment identity while changing backends |
|
|
28
|
+
| no retry amplification | risk | stacking provider retry with DVR fallback can multiply attempts unless one layer is explicitly disabled/fenced |
|
|
29
|
+
| cancellation | supported by Host retry, already supported by DVR | not a simplification by itself |
|
|
30
|
+
| v1/legacy Host | insufficient | DVR 2.0.x still supports rc.6; current upstream recovery semantics cannot become the sole path |
|
|
31
|
+
|
|
32
|
+
## Why a split modern path is not adopted
|
|
33
|
+
|
|
34
|
+
A modern-Host-only native recovery branch would still need DVR's own:
|
|
35
|
+
|
|
36
|
+
- cross-provider candidate loop;
|
|
37
|
+
- shared total deadline;
|
|
38
|
+
- per-attempt budget;
|
|
39
|
+
- breaker/failure classification;
|
|
40
|
+
- exact deployment identity;
|
|
41
|
+
- cancellation fencing;
|
|
42
|
+
- legacy/minimum-Host path.
|
|
43
|
+
|
|
44
|
+
That creates two recovery authorities without deleting the hard part of the current executor. It therefore fails the P3 migration rule that a Host-native replacement must be semantically equivalent **and simpler**.
|
|
45
|
+
|
|
46
|
+
## Interaction with Host retry
|
|
47
|
+
|
|
48
|
+
DVR should continue to treat Host retry as an outer/adjacent Host concern and keep its own visual chain from accidentally amplifying retries. Future work may consume a more explicit Host recovery decision seam if DSH exposes one that can coordinate provider changes and total budgets, but this evaluation does not authorize such a rewrite.
|
|
49
|
+
|
|
50
|
+
## Revisit trigger
|
|
51
|
+
|
|
52
|
+
Re-run the spike only if released DSH adds a recovery contract that can explicitly express or delegate:
|
|
53
|
+
|
|
54
|
+
- provider replacement;
|
|
55
|
+
- one shared request-family deadline;
|
|
56
|
+
- bounded attempt accounting;
|
|
57
|
+
- cancellation/disposal quiescence;
|
|
58
|
+
- durable identity across changed providers;
|
|
59
|
+
- retry/fallback composition without amplification;
|
|
60
|
+
|
|
61
|
+
and that contract exists on the declared minimum supported Host.
|
|
62
|
+
|
|
63
|
+
## P3-E verdict
|
|
64
|
+
|
|
65
|
+
`PASS — KEEP vision-chain; native request recovery is not a simpler semantic replacement.`
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Runtime boundaries
|
|
2
|
+
|
|
3
|
+
This document freezes the ownership boundaries that must remain true during the dsh-vision-router 2.x convergence work. P0 does not redesign routing behavior; it makes the existing product contract explicit so later refactors cannot accidentally move authority or lifecycle ownership.
|
|
4
|
+
|
|
5
|
+
## Dependency direction
|
|
6
|
+
|
|
7
|
+
The intended runtime direction is:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Authority -> Evidence -> Planner -> Execution
|
|
11
|
+
\-> Presentation (read-only projection)
|
|
12
|
+
Session / Storage / Compat are supporting boundaries, not alternate policy owners.
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Execution may consume a plan and live authority. It must not synthesize broader authority than the plan was allowed to use. Presentation may render state. It must not re-derive routing eligibility independently.
|
|
16
|
+
|
|
17
|
+
## Authority
|
|
18
|
+
|
|
19
|
+
**Owns:** authorization to perform behavior with user/resource/security consequences.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
- whether Auto routing is currently authorized;
|
|
23
|
+
- whether background capability measurement is allowed;
|
|
24
|
+
- whether paid background work is allowed;
|
|
25
|
+
- whether remote settings mutation is allowed.
|
|
26
|
+
|
|
27
|
+
Rules:
|
|
28
|
+
- absence of authority is denial, not an invitation to infer intent;
|
|
29
|
+
- authority is checked at the point where work begins and, for revocable operations, again before publication/continuation;
|
|
30
|
+
- evidence, planner scores, cached state, UI state, or compatibility shims may never grant authority.
|
|
31
|
+
|
|
32
|
+
## Evidence
|
|
33
|
+
|
|
34
|
+
**Owns:** observed model/provider capability facts and their scope, freshness and persistence policy.
|
|
35
|
+
|
|
36
|
+
Rules:
|
|
37
|
+
- evidence says what has been observed, not what the user authorized;
|
|
38
|
+
- durable capability evidence is kept separate from process-local runtime performance;
|
|
39
|
+
- negative evidence and uncertainty must remain distinguishable;
|
|
40
|
+
- evidence collection may not mutate settings or route order merely to make planning easier.
|
|
41
|
+
|
|
42
|
+
## Planner
|
|
43
|
+
|
|
44
|
+
**Owns:** pure selection/ranking from authorized candidates plus evidence and preference inputs.
|
|
45
|
+
|
|
46
|
+
Rules:
|
|
47
|
+
- no provider network I/O;
|
|
48
|
+
- no persistence writes;
|
|
49
|
+
- no settings mutation;
|
|
50
|
+
- no Host service registration;
|
|
51
|
+
- no authority expansion;
|
|
52
|
+
- output is data describing an execution choice/order, not a disguised settings object.
|
|
53
|
+
|
|
54
|
+
The existing `vision-capability-router.js` is the productized planner. P1 converges how its output reaches execution; P0 does not create a second planner.
|
|
55
|
+
|
|
56
|
+
## Execution
|
|
57
|
+
|
|
58
|
+
**Owns:** performing the selected visual work under deadlines, fallback, breaker, cancellation and provider/runtime contracts.
|
|
59
|
+
|
|
60
|
+
Rules:
|
|
61
|
+
- consumes authorized candidates/plan; cannot add a provider that was not already eligible;
|
|
62
|
+
- cannot reinterpret planner output as permission;
|
|
63
|
+
- preserves native multimodal non-intervention when the Host/model owns image input;
|
|
64
|
+
- cancellation and authority revocation must not publish stale work;
|
|
65
|
+
- compatibility adaptation stays narrow to the Host seam actually missing.
|
|
66
|
+
|
|
67
|
+
## Session
|
|
68
|
+
|
|
69
|
+
**Owns:** durable conversation/session facts that need to survive process restart, plus explicitly bounded process-local projections used to execute the current session safely.
|
|
70
|
+
|
|
71
|
+
Rules:
|
|
72
|
+
- durable Host/session facts and process-local caches are different lifetimes;
|
|
73
|
+
- a process-local store is not a second source of truth for durable conversation identity;
|
|
74
|
+
- restart/resume correctness is part of the product contract;
|
|
75
|
+
- do not replace `SessionVisionStateStore` in P0/P1 merely for architectural symmetry.
|
|
76
|
+
|
|
77
|
+
## Storage
|
|
78
|
+
|
|
79
|
+
**Owns:** attachment/artifact placement, retention and deletion safety.
|
|
80
|
+
|
|
81
|
+
Two classes must remain distinct:
|
|
82
|
+
- **Host-owned attachments:** durable identities/content governed by the DSH attachment service;
|
|
83
|
+
- **Vision Router derived artifacts:** temporary or managed outputs created by plugin operations.
|
|
84
|
+
|
|
85
|
+
Rules:
|
|
86
|
+
- never delete unknown/user-owned entries;
|
|
87
|
+
- no P0 artifact layout migration;
|
|
88
|
+
- storage cleanup may use only plugin-owned namespaces/provenance;
|
|
89
|
+
- `.run-meta.json` is not introduced as part of P0.
|
|
90
|
+
|
|
91
|
+
## Compat
|
|
92
|
+
|
|
93
|
+
**Owns:** the smallest translation necessary when a supported Host contract lacks a seam required by the product contract.
|
|
94
|
+
|
|
95
|
+
Rules:
|
|
96
|
+
- capability detection first; version-persona branching last resort;
|
|
97
|
+
- every major shim records Reason, Host gap, First needed for, Feature detection, Removal condition and Tests;
|
|
98
|
+
- compat may preserve existing semantics but must not invent new routing authority;
|
|
99
|
+
- a shim is removed only after the supported Host window and tests prove the native seam covers it.
|
|
100
|
+
|
|
101
|
+
See `dsh-compatibility-matrix.md` for the inventory and exit criteria.
|
|
102
|
+
|
|
103
|
+
## Presentation
|
|
104
|
+
|
|
105
|
+
**Owns:** user-visible projection and interaction surfaces.
|
|
106
|
+
|
|
107
|
+
Rules:
|
|
108
|
+
- UI does not own route eligibility, authority, breaker state, credential validity or evidence validity;
|
|
109
|
+
- presentation consumes structured product/runtime state instead of recreating routing rules in browser code;
|
|
110
|
+
- P0 does not split the Web UI; it only freezes this ownership rule for later P3 work.
|
|
111
|
+
|
|
112
|
+
## P0 invariants
|
|
113
|
+
|
|
114
|
+
The following are deliberate stop conditions for any P0 change:
|
|
115
|
+
|
|
116
|
+
- Auto or Ordered routing behavior changes;
|
|
117
|
+
- authority becomes broader than before;
|
|
118
|
+
- native multimodal requests are newly intercepted;
|
|
119
|
+
- session restart/resume semantics change;
|
|
120
|
+
- artifact layout or cleanup scope changes;
|
|
121
|
+
- background scheduler is migrated to `ctx.jobs`;
|
|
122
|
+
- `vision-capability-shadow.js` execution flow is split or rewritten.
|
|
123
|
+
|
|
124
|
+
P0 is complete when the Host contract gates, compatibility inventory, Doctor capability snapshot, runtime-boundary documentation and logical test groups are all present while the existing behavior remains unchanged.
|