dsh-github-copilot 0.4.0-alpha.100
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/AGENTS.md +312 -0
- package/CHANGELOG.md +479 -0
- package/CONTRIBUTING.md +46 -0
- package/LICENSE +21 -0
- package/README.md +203 -0
- package/README.zh.md +202 -0
- package/SECURITY.md +29 -0
- package/cordis.patch.yml +16 -0
- package/deployment-baseline.json +1299 -0
- package/docs/agent-readiness.md +110 -0
- package/docs/auto-task-routing.md +234 -0
- package/docs/automatic-model-routing.md +205 -0
- package/docs/copilot-accounts.md +236 -0
- package/docs/copilot-compaction.md +120 -0
- package/docs/copilot-usage.md +125 -0
- package/docs/dual-model.md +66 -0
- package/docs/image-input-compatibility.md +64 -0
- package/docs/images/copilot-accounts-credits.png +0 -0
- package/docs/images/copilot-accounts.png +0 -0
- package/docs/images/copilot-model-preferences.png +0 -0
- package/docs/images/copilot-search-routing.png +0 -0
- package/docs/images/dual-model-desktop.png +0 -0
- package/docs/images/dual-model-mobile.png +0 -0
- package/docs/images/dual-model-provenance.json +35 -0
- package/docs/images/parent-model-follow.png +0 -0
- package/docs/manual-compaction-recovery.md +64 -0
- package/docs/model-compatibility-acceptance.md +164 -0
- package/docs/npm-distribution.md +149 -0
- package/docs/official-first-016-alpha2.md +66 -0
- package/docs/official-first-020-rc1.md +32 -0
- package/docs/official-first-020-rc2.md +16 -0
- package/docs/session-search-routing.md +133 -0
- package/docs/single-route-migration.md +130 -0
- package/docs/web-lifecycle-rc2.md +55 -0
- package/lib/client.js +10822 -0
- package/lib/client.js.map +1 -0
- package/lib/copilot-identity-DRZY_d2X.js +15 -0
- package/lib/index.js +11689 -0
- package/lib/manual-compaction-recovery.js +315 -0
- package/lib/remote.js +734 -0
- package/lib/request-budget-DLY_aRq0.js +87 -0
- package/lib/routed-web.js +120 -0
- package/lib/search-routing-CqysPLve.js +792 -0
- package/lib/types/account-model-auth.d.ts +15 -0
- package/lib/types/account-model-catalog.d.ts +70 -0
- package/lib/types/account-model-source.d.ts +85 -0
- package/lib/types/agent-compaction.d.ts +4 -0
- package/lib/types/authorization-controller.d.ts +119 -0
- package/lib/types/auto-assessment-evidence.d.ts +46 -0
- package/lib/types/auto-model-host.d.ts +27 -0
- package/lib/types/auto-model-intent.d.ts +36 -0
- package/lib/types/auto-model-presentation.d.ts +57 -0
- package/lib/types/auto-model-routing.d.ts +59 -0
- package/lib/types/auto-selection-explanation.d.ts +9 -0
- package/lib/types/auto-task-assessment.d.ts +47 -0
- package/lib/types/auto-task-classifier.d.ts +9 -0
- package/lib/types/background-compaction.d.ts +30 -0
- package/lib/types/client.d.ts +115 -0
- package/lib/types/compact-account.d.ts +42 -0
- package/lib/types/compaction-pressure.d.ts +23 -0
- package/lib/types/compatibility.d.ts +17 -0
- package/lib/types/config.d.ts +89 -0
- package/lib/types/content-file.d.ts +10 -0
- package/lib/types/context-evidence-ui.d.ts +11 -0
- package/lib/types/context-evidence.d.ts +108 -0
- package/lib/types/context-usage.d.ts +4 -0
- package/lib/types/copilot-account-presentation.d.ts +7 -0
- package/lib/types/copilot-accounts-card.d.ts +30 -0
- package/lib/types/copilot-accounts-host.d.ts +75 -0
- package/lib/types/copilot-accounts-remote.d.ts +77 -0
- package/lib/types/copilot-accounts-types.d.ts +42 -0
- package/lib/types/copilot-auth.d.ts +25 -0
- package/lib/types/copilot-grant.d.ts +11 -0
- package/lib/types/copilot-identity.d.ts +11 -0
- package/lib/types/copilot-request.d.ts +11 -0
- package/lib/types/copilot-stream-liveness.d.ts +23 -0
- package/lib/types/copilot-usage-card.d.ts +30 -0
- package/lib/types/copilot-usage-host.d.ts +58 -0
- package/lib/types/copilot-usage-normalize.d.ts +9 -0
- package/lib/types/copilot-usage-remote.d.ts +63 -0
- package/lib/types/copilot-usage-types.d.ts +20 -0
- package/lib/types/copilot-usage-ui.d.ts +4 -0
- package/lib/types/current-provider.d.ts +59 -0
- package/lib/types/deepseek-search-fallback.d.ts +11 -0
- package/lib/types/dual-model-host.d.ts +119 -0
- package/lib/types/dual-model-remote.d.ts +63 -0
- package/lib/types/dual-model-types.d.ts +34 -0
- package/lib/types/external-link.d.ts +3 -0
- package/lib/types/failure.d.ts +38 -0
- package/lib/types/http.d.ts +48 -0
- package/lib/types/image-input-admission.d.ts +5 -0
- package/lib/types/index.d.ts +39 -0
- package/lib/types/manual-compaction-recovery.d.ts +52 -0
- package/lib/types/migration-status.d.ts +50 -0
- package/lib/types/model-exclusions.d.ts +15 -0
- package/lib/types/model-preferences-card.d.ts +9 -0
- package/lib/types/model-protocol.d.ts +31 -0
- package/lib/types/native-select-style.d.ts +4 -0
- package/lib/types/parent-model-follow-card.d.ts +41 -0
- package/lib/types/parent-model-follow.d.ts +44 -0
- package/lib/types/pi-provider-bridge.d.ts +22 -0
- package/lib/types/plan.d.ts +148 -0
- package/lib/types/pre-step-pressure.d.ts +8 -0
- package/lib/types/preview-provider.d.ts +66 -0
- package/lib/types/preview-route.d.ts +74 -0
- package/lib/types/probe.d.ts +39 -0
- package/lib/types/reasoning-presentation.d.ts +55 -0
- package/lib/types/remote-codec.d.ts +10 -0
- package/lib/types/remote.d.ts +199 -0
- package/lib/types/replay-recovery-host.d.ts +28 -0
- package/lib/types/replay-recovery-remote.d.ts +14 -0
- package/lib/types/replay-recovery-types.d.ts +24 -0
- package/lib/types/replay-recovery-ui.d.ts +26 -0
- package/lib/types/replay-recovery.d.ts +17 -0
- package/lib/types/request-body-evidence.d.ts +34 -0
- package/lib/types/request-body-timeout-marker.d.ts +2 -0
- package/lib/types/request-body-timeout.d.ts +4 -0
- package/lib/types/request-budget.d.ts +58 -0
- package/lib/types/request-upload-evidence.d.ts +23 -0
- package/lib/types/response-error-body.d.ts +3 -0
- package/lib/types/responses-reasoning-text.d.ts +24 -0
- package/lib/types/responses-reasoning.d.ts +7 -0
- package/lib/types/responses-replay-compat.d.ts +30 -0
- package/lib/types/route-ownership.d.ts +70 -0
- package/lib/types/routed-web.d.ts +50 -0
- package/lib/types/search-backend.d.ts +16 -0
- package/lib/types/search-routing-host.d.ts +19 -0
- package/lib/types/search-routing-policy.d.ts +18 -0
- package/lib/types/search-routing-remote.d.ts +20 -0
- package/lib/types/search-routing.d.ts +43 -0
- package/lib/types/search-tool-routing.d.ts +22 -0
- package/lib/types/serialize.d.ts +106 -0
- package/lib/types/settings-reader.d.ts +16 -0
- package/lib/types/sse.d.ts +28 -0
- package/lib/types/temporary-models.d.ts +25 -0
- package/lib/types/tool-schema-compat.d.ts +17 -0
- package/lib/types/traditional-search.d.ts +17 -0
- package/lib/types/turn-model-provenance.d.ts +45 -0
- package/lib/types/turn-selection-card.d.ts +10 -0
- package/lib/types/turn-selection-host.d.ts +11 -0
- package/lib/types/turn-selection-remote.d.ts +13 -0
- package/lib/types/turn-selection.d.ts +119 -0
- package/lib/types/turn-usage-evidence.d.ts +66 -0
- package/lib/types/turn-usage-notice.d.ts +7 -0
- package/lib/types/types.d.ts +69 -0
- package/lib/types/usage.d.ts +26 -0
- package/lib/types/watchdog.d.ts +22 -0
- package/lib/types/web-delegate.d.ts +12 -0
- package/lib/types/web-search-routing-card.d.ts +16 -0
- package/lib/types/web-search-routing-config.d.ts +12 -0
- package/lib/types/wire-anthropic.d.ts +37 -0
- package/lib/types/wire.d.ts +56 -0
- package/lib/web-delegate.js +9 -0
- package/output/auto-model-mockup/index.html +207 -0
- package/package.json +236 -0
- package/scripts/check-search-composition.mjs +191 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# Agent readiness audit
|
|
2
|
+
|
|
3
|
+
> **Historical audit:** dated follow-ups preserve plans and validation blockers
|
|
4
|
+
> at the time, not current setup requirements or release status. Start with
|
|
5
|
+
> [AGENTS.md](../AGENTS.md), current README and the
|
|
6
|
+
> [rc.2 review](./official-first-020-rc2.md).
|
|
7
|
+
|
|
8
|
+
Tracking: [#73](https://github.com/cloga/dsh-github-copilot/issues/73). Audited baseline: `d9d0954` (2026-09-05). This is an evidence inventory, not a blanket certification of live Copilot behavior.
|
|
9
|
+
|
|
10
|
+
## Scope and method
|
|
11
|
+
|
|
12
|
+
Read the instruction entrypoints, source ownership boundaries, test/TypeScript configuration, tooling, packaging, CI/release workflows and public Remote contracts. Two independent native DSH reviewers examined verification/release and runtime/diagnostics. All reproduction uses synthetic fixtures. No production credential inspection, sign-in, sign-out, model/search calls, profile installation or DSH restart is part of this audit.
|
|
13
|
+
|
|
14
|
+
The existing project already has useful architecture boundaries, strict Remote codecs, exact Core pins, credential normalization, broad unit tests, bilingual docs and an immutable-release policy. The gaps were mostly between what an agent could observe and what it was allowed to claim.
|
|
15
|
+
|
|
16
|
+
## Improvements with executable evidence
|
|
17
|
+
|
|
18
|
+
| Area | Audit evidence at baseline | Change / acceptance check |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| Onboarding/discovery | Commands scattered across prose; no structured task-to-files map | `agent-contract.json`, `scripts/agent.mjs describe/plan`, `verify:agent` check real paths and scripts |
|
|
21
|
+
| Safe preflight | `status()` and `inspectGitHubCopilotProviderProfile()` sound read-only but reconcile settings | Separate repository-only `agent:doctor`; output lists `notChecked`, actionable checks and stable exit codes; Node tooling tests cover missing dependencies |
|
|
22
|
+
| Attribution | AGENTS/CONTRIBUTING required unspecified co-author; historical bot was copied | Actual-tool `Assisted-by`; DSH example does not invent a bot email; contract validator guards against mandatory copied co-author policy |
|
|
23
|
+
| Runtime floor | Declared Node >=22.0.0 but locked pi-ai requires >=22.19.0 | Align package/baseline to >=22.19.0; recommend Node 24 LTS; CI still uses 24, so the minimum is a dependency floor, not a live Node22 certification |
|
|
24
|
+
| Compiler evidence | `tsconfig.json` included only src; expanded compilation found 17 diagnostics in tests/configs | `typecheck:tests`, accurate mock/brand/narrowing fixes; no blanket ignores; real Core fixture remains checked only in its pinned checkout |
|
|
25
|
+
| Vacuous assertion | Cordis DisposableList was indexed as an array, allowing undefined UID comparisons | Use iterable conversion and assert defined identity before equality in loader tests |
|
|
26
|
+
| Build evidence | verify:package checked Host existence, then claimed built Host verified | Import real built Host without the Vitest Typert alias; assert exported contract and label the evidence as import-only |
|
|
27
|
+
| Archive delivery | Pack/checksum did not check actual exported files or README media; images were omitted | `verify:tarball` inspects bounded tar data without extraction; rejects paths/links/duplicates/unexpected files/trailing payload; compares the full normalized manifest and every packed file to the checkout/build; checks exports and README media; CI/release run it after packing |
|
|
28
|
+
| Desktop shared-package ownership | Alpha.18-alpha.20 tarballs privately declared Host-owned authorization and schema packages, so native Desktop profile validation rejected the graph | Alpha.21 makes both required peers with development-only copies; the packed-manifest gate audits every runtime/peer declaration against hash-pinned 0.1.5 actual descriptor and 0.1.6 generated package-set projections |
|
|
29
|
+
| Client external ownership | Alpha.21 left React as a required nonshared Node peer, so packaged Desktop with `autoInstallPeers: false` stopped before receipts/state | Alpha.22 declares `dsh.client.external: [\"react\"]`, removes the root React peer, retains a dev copy, and verifies the actual built Client requests exactly the shell-owned React singleton |
|
|
30
|
+
| External verifier safety | Fixed fixture path could overwrite then delete a pre-existing upstream file | Exclusive create, pinned clean tracked sources, physical-path containment, identity/byte-guarded cleanup and bounded child; twelve synthetic failure/sentinel tests including a Windows junction |
|
|
31
|
+
| Release prerequisite | Tag workflow could run independently of complete platform/Core matrix | Reuse CI through workflow_call; publish job needs matrix success on tag revision; contract verifier checks the dependency |
|
|
32
|
+
| Session model correctness | Inline preflight checked provider but plan sends default-route candidate.model | Historical guard matched provider AND model and delegated mismatches; alpha.8 replaces default-derived planning with initiating-owner/request identity (see #99 below) |
|
|
33
|
+
| Documentation freshness | Contribution/PR/bug forms omitted alpha.1; build/activation/install evidence blurred | Updated templates, exact approval boundaries, evidence matrix and retry/rollback guidance |
|
|
34
|
+
| Workspace hygiene | Broad lib ignore hid scripts/lib; root packs/.env not ignored | Root-anchor generated /lib, ignore tarballs/secrets; .editorconfig specifies new-file formatting without rewriting history |
|
|
35
|
+
|
|
36
|
+
Run `pnpm verify` for the local checks. Then `pnpm pack --pack-destination artifacts` and `pnpm verify:tarball -- artifacts/dsh-github-copilot-<package-version>.tgz`. The task planner emits the actual path from package.json. Consult the PR's final results for commands actually executed and current CI status; this document does not hard-code a perpetual passing test count.
|
|
37
|
+
|
|
38
|
+
## Evidence ladder
|
|
39
|
+
|
|
40
|
+
1. **Source markers** prove required seams/test names are present, not semantics.
|
|
41
|
+
2. **Typechecks and synthetic tests** verify local assumptions, not installed account eligibility.
|
|
42
|
+
3. **Built import/loader checks** prove modules load without test aliases; they do not call apply().
|
|
43
|
+
4. **Pinned upstream config fixtures** prove configuration against those sources, not the entire companion Host on every runtime.
|
|
44
|
+
5. **Archive/checksum inspection** proves shipped bytes and packaging consistency, not authenticated requests.
|
|
45
|
+
6. **Explicit live acceptance** must separately check installed versus loaded version, actual session model, normal stream/tools, and selected search provider. A page returning HTTP 200 proves only reachability.
|
|
46
|
+
|
|
47
|
+
Missing evidence is `notChecked`, not success. Repository CLI plans do not grant permission to merge, publish, change credentials or install.
|
|
48
|
+
|
|
49
|
+
## Runtime lifecycle follow-up (#75)
|
|
50
|
+
|
|
51
|
+
- **Read-only status delivered:** `status()` and `describeGitHubCopilotProviderProfile()` now share pure planning and return minimal authentication/catalog/route state without mutation, OAuth refresh or network. Explicit `reconcile()` and its UI control perform stored-snapshot repair. Errors preserve configured authentication and expose classified route diagnostics. Tests prove repeated reads are write/network-free, repair is explicit, and conflicts/failures do not leak raw errors.
|
|
52
|
+
- **Proof invalidation delivered:** both search surfaces listen to the exact Copilot credential key and evict successful/failed plans lazily. Attach/settings/events make no network requests. Cancellation and generation-bound candidates prevent stale in-flight proof, account replacement during final auth, fallback-spelling clones and delayed streams from using another generation's authorization. Disposal aborts pending probes and prevents further spelling attempts. Tests use actual synthetic grant changes, not only event emission.
|
|
53
|
+
- **Ownership checks delivered:** raw settings preimages/postimages, validated version-2 journal, revision-checked writes, exact created-profile shape checks, and leaf-only header cleanup protect user additions/edits. Resolved schema defaults do not count as user edits. Tests cover interrupted writes, manual edits, marker loss, legacy markers, process restart and same-process registration resets.
|
|
54
|
+
- **Deliberate recovery limit:** Core does not expose durable registration identity or a cross-namespace transaction. Revision integers/recorded process epochs cannot authorize replay after a namespace reload. Therefore a later invocation never reapplies an unresolved prepared activation/restoration; it keeps the journal and reports conflict for review. Steady postimages may prepare fresh restoration; already-restored targets may clear a marker without rewriting the route. Legacy journals and custom model preimages also fail conservatively rather than guessing ownership. Post-write marker checks detect interference but do not create atomic route/marker/credential commits.
|
|
55
|
+
|
|
56
|
+
## Provider-integrated account controls follow-up (#93)
|
|
57
|
+
|
|
58
|
+
The provider integration introduced in `0.4.0-alpha.5` replaces the older independent-footer-only layout, not the underlying route architecture. The lifecycle from `0.4.0-alpha.6` (#95) remains unchanged in planned `0.4.0-alpha.7`; #97 adds only last-success timestamp presentation:
|
|
59
|
+
|
|
60
|
+
- **Surface ownership:** when an existing configured canonical `github-copilot` provider card is mounted, embed login/status/**Refresh models**/**Manage** there and suppress the separate footer account controller. If no such row is mounted, keep footer fallback usable; old Core retains its settings section. The shared account-state owner, including its in-flight authorization state, survives transfer only while another eligible surface remains mounted. Last-surface unmount or nonoverlapping declaration replacement stops polling. A later controller reads status and separately ensures missing/idle/stale/error/loading signed-in metadata without replaying the old forced-login action. Manual **Refresh models** now lives in **Manage**; errors retain a visible **Retry**.
|
|
61
|
+
- **Discovery triggers (#95):** successful explicit UI **Start sign-in**/account switch forces one bounded discovery after immediate or polled completion. Opening Models separately calls non-forcing `ensureModels()` once for missing/idle/stale/error/loading signed-in metadata; error re-entry retries only after shared cooldown with no same-mount loop; loading joins the existing Host flight to observe completion without extra network. Fresh ready cache needs no request, and true unavailable/empty models do not auto-retry. Status/details remain network-free, not the entire opening flow. Background credential/reset events clear Client state and read status, not force discovery on every token event; next open/use ensures metadata.
|
|
62
|
+
- **Freshness and authority (#95):** `github-copilot` settings default to `accountModelTtlMs: 86400000` (24h maximum reuse) and `accountModelFailureCooldownMs: 300000` (5min failure cooldown). One shared Host flight serves callers; no periodic metadata polling timer (the timestamp's display-only timer is separate). Last same-account metadata may display during TTL refresh/loading/error but never authorize requests. Credential/account/permission invalidation or proof expiry revokes request evidence immediately; the TTL does not extend tokens. Definitive `UNKNOWN_MODEL` triggers one bounded metadata refresh without message replay/model switching; generic HTTP/network errors are not guessed into that category.
|
|
63
|
+
- **Last-success display (#97):** `snapshot.discoveredAt` appears beside the model count outside **Manage**, without a duplicate inside. Past times use English relative text; the tooltip and accessible semantic `time` expose the full local date, time and time zone. Missing/invalid timestamps or no account hide it; future times use an absolute label. One mounted 60-second display-only timer updates the relative text without RPC/status/discovery, and is disposed when the timestamp disappears or the view unmounts. Pending/failed refresh keeps the last success time; successful refresh replaces it and sign-out clears it. Cache/discovery and authorization rules are unchanged.
|
|
64
|
+
- **Honest integration limit:** the published provider-card slot is additive and cannot replace Core **Edit/Delete**. Normal plugin discovery needs no manual model definitions, but the native editor stays available. Embedding account controls does not merge/remove canonical `github-copilot` and managed `github-copilot-preview`, copy credentials, rewrite configuration/history or migrate selection. Any optional real route removal still requires the [separate reviewed migration](./single-route-migration.md).
|
|
65
|
+
- **Acceptance still required:** test missing/idle/stale/error/loading open-time ensure versus fresh-cache no-request, shared Host flight, TTL/cooldown boundaries, display-only stale data, immediate revocation, definitive unknown-model refresh without replay, Manage-only manual refresh and visible Retry. Retain provider/footer/old-Core fallback, overlapping-owner transfer, final-unmount cleanup and once-per-explicit-login tests. Read the implementation PR's actual results before claiming these checks passed; documentation is not runtime or live OAuth evidence.
|
|
66
|
+
- **Browser/media evidence:** `copilot-search-routing.png` shows the current built plugin-detail routing card in isolated Edge with synthetic providers. It is presentation evidence only, not proof of live credentials, provider availability, search success or Desktop activation. Host TTL/cooldown timing and account-control lifecycle remain unit-test evidence rather than screenshot evidence.
|
|
67
|
+
|
|
68
|
+
## Session-scoped Copilot follow-up (#99, planned alpha.8)
|
|
69
|
+
|
|
70
|
+
- **V3 ownership:** one global Host account and shared metadata source supply many models; explicitly selected/history-backed Sessions retain independent model context. Search facts use the captured initiating Session's effective request-header/config or explicit `GenerateOptions`, not another Session or future default C. Plans are cached per owner to prevent A/B different-model reuse/cancellation. No global current-model/search-status card is added.
|
|
71
|
+
- **Cold entrypoints:** Chat picker and `/model` `listModels()` ensure the shared managed source without visiting Settings first. Actual cold managed search performs a non-forcing shared ensure before deriving facts. The same 24h maximum TTL, 5min cooldown, account generation and capability/probe checks remain.
|
|
72
|
+
- **Native API limits:** a new Copilot draft warns that saving a native profile adds another real group, not another account. Add cannot be vetoed and Save cannot be disabled through the public additive slot. Public `session.selectModel` also writes the future global default; unselected empty Sessions can inherit it. Do not claim enforced one-route registration or immutable empty Sessions.
|
|
73
|
+
- **Delivery boundary:** code does not auto-migrate configuration, credentials, selections or history. After release, the operator must resolve approved Session/default choices separately; the config-only v1 Ops command performs no automated selection writes, then may compare-and-swap only the reviewed user-native profile path after ruling out base/journal conflicts, and read back registration. Any search allowlist change to `github-copilot-preview` is a separate reviewed Ops edit, never silent broadening. See [migration](./single-route-migration.md).
|
|
74
|
+
- **Request-context correction:** `Agent.options` remains Core's activation seed, not selected-model evidence. Real `installModelSelection` overrides request/assembly; the Session records effective `requestHeader().config` before tools. Capture the initiating Session's proven request context or use explicit `GenerateOptions`; otherwise traditional search is unavailable. Pending new selection before its next request must not expose the prior header as current prompt guidance.
|
|
75
|
+
- **Acceptance/evidence:** use real `installModelSelection` to check concurrent A/B models against unchanged activation/default seed C, reject unproven or stale-header prompt guidance after a pending selection, cold Chat and `/model` discovery, cold search/probe, owner invalidation, missing initiator, Add warning with Save retained, and CAS-conflict refusal/readback. README screenshots do not prove these behaviors or a completed migration; consult the implementation and operations evidence separately.
|
|
76
|
+
|
|
77
|
+
## Live migration evidence follow-up (#101, planned alpha.9)
|
|
78
|
+
|
|
79
|
+
- **Entry point:** no-argument `githubCopilot.migrationStatus()` reads public live leaves synchronously. Generic `session/list` may be stale and inventory lacks loaded-version evidence. The new result carries loaded build `plugin.name`/`plugin.version`, protocol 1, observation time, five structural capability flags and `complete.sessions/defaultSelection/routes`; unknown/incomplete required selection or route evidence must fail the maintenance gate, not be treated as absence. Idle Agents normally have `activeRequestSelection: null`.
|
|
80
|
+
- **Session scope:** pending model projection → recorded request-header config → current default only for genuinely empty live Sessions with known projection state. Each row has selection provenance; a running Agent's separate `activeRequestSelection` is its latest recorded header, not proof of an in-flight LLM call. `routes.nativeConfigured`, `nativeRegistered` and `managedRegistered` distinguish effective config from registry state.
|
|
81
|
+
- **Read-only boundary:** no authorization status/discovery, credential access, network, settings/Session mutations, normal UI or global model/search card. Seven ordinary authorization Remotes retain their existing codec; the eighth Remote uses its own strict `GitHubCopilotMigrationStatus` codec. Source ownership is `src/migration-status.ts` plus the controller/Remote bridge; focused evidence is `tests/migration-status.spec.ts`.
|
|
82
|
+
- **Limits and Ops handoff:** `historyScope: live-agents-only` excludes cold history. Require operator acknowledgement that older conversations may need explicit selection on resume. Version/capability self-reports are not full Desktop/Core byte attestation or an atomic cross-namespace guarantee; recheck just before CAS. The separate planned Ops `tools/migrate-copilot-managed-route.ps1` in `cloga/dsh-windows-ops` is config-only v1, with no automatic Session/default writes, plugin install, restart or full Desktop-baseline acceptance. This document does not establish its publication, installation or a completed live migration.
|
|
83
|
+
- **Acceptance:** verify loaded identity, missing/malformed seams and incomplete evidence, fresh live-Agent enumeration, pending-versus-recorded selections, truly empty defaults, running-header caveats, effective-config/registry distinction, bounded strict codec and zero side effects. Read actual test/Ops results rather than treating this checklist as a passing report.
|
|
84
|
+
|
|
85
|
+
## Core alpha2 compatibility follow-up (#105, planned alpha.11)
|
|
86
|
+
|
|
87
|
+
- **Exact targets:** retain rc.2, rc.1 development dependencies, `0.1.3-alpha.1` (`d347e703908d0406b7a7ef80e3a0e594d86b2215`) and `0.1.5-alpha.1` (`5dda764ed3aa172535a7967b06ff95d9cbfe536a`); add current `0.1.5-alpha.2` (`b2e3b2a0125854567a4a5fcba75782e42fe84901`), `0.1.5-rc.1` (`183f08e9c6dde7e36cd2318eaee70b0da08fb35e`) and `0.1.5-rc.2` (`fb2c4b9e698e30edb738bca4cf0618587db7d203`). Peer admission is not full runtime proof.
|
|
88
|
+
- **Actual break and narrow fix:** alpha2 `ResolvedPiAiProviderProfile` adds required `modelErrors`, optional `piProvider` and optional `catalogError`. `PiAiAdapter.modelOf` unconditionally calls `profile.modelErrors.get(model)`. The plugin-owned profile now supplies an empty `Map<string, string>` because only already validated account models enter its provider. It retains an actual `piProvider`, so no fabricated `catalogError` is needed. Unknown/rejected models remain fail-closed. No upstream provider, prototype, model catalog or dependency artifact is patched.
|
|
89
|
+
- **Runtime regression:** the existing unchanged tagged-source resolver attests exact Git HEAD, clean tracked sources, public package/export paths and real Context/LlmRuntime/PiAiAdapter class identity. `preview-route.spec.ts` resolves, prepares and synthetically streams an account model through the actual selected adapter, not a stub; the same suite runs against all three alpha pins and the rc.1 development adapter. Session/projection and eight strict Remote fixtures run on both 0.1.5 alphas. File projection and opaque replay remain native-owned.
|
|
90
|
+
- **Other consumed seams audited:** alpha1-to-alpha2 settings mutation/CAS and section installation, credential/authorization APIs, Agent/default-model selection, Session request header and model-selection projection, public gateway, provider-card slot props and Chat assistant-node registration retain the consumed contract. Core adds optional provider-directory `error`, repair UI and Add gating; these do not authorize plugin route migration or alter the account-controller ownership. SessionController file reveal/desktop APIs and API-remotes feedback contributions are additive and unconsumed. Chat file-link closing gains a session argument, but this plugin delegates native rendering and does not call that seam.
|
|
91
|
+
- **In-band system authority:** the broader 0.1.5 audit found newer system-role messages would be demoted by the legacy Anthropic inline serializer. The preflight now delegates any such Anthropic request unchanged to Core before auth/probe/wire; leading and nonleading positions are covered. This deliberately limits inline hosted search, does not rewrite histories, and leaves the legacy Responses inline mapping of system content to user input text unchanged (not filtering). Managed requests always delegate to native transport.
|
|
92
|
+
- **Evidence boundary:** CI extends the Windows/Linux pinned matrix and release rechecks the current tagged runtime before packing. Local tests use synthetic credentials/network and unchanged Core source fixtures only; no Core implementation changes/build, live install, OAuth, provider calls, Desktop restart or GitHub publication is implied. Consult the task's exact command results for passes/skips; documentation and static markers alone cannot certify runtime or live behavior.
|
|
93
|
+
|
|
94
|
+
## DSH 0.1.6 compatibility adaptation (#125, planned alpha.19)
|
|
95
|
+
|
|
96
|
+
- **Exact target:** add official `dsh-v0.1.6-alpha.1` at `0a15e36e7f82b6ed45af6fa9759f29b40dcd965d`, retaining every earlier source pin and the exact `0.1.2-rc.1` development dependency set. The package also declares the same range in `engines.dsh`; neither declaration proves a loaded runtime.
|
|
97
|
+
- **Agent and Session:** the tagged fixture awaits the 0.1.6 `AgentRegistry.register()` publication boundary and verifies that its asynchronous serial `agent/created` listener has completed before migration evidence reads `agents.list()`, `Session.requestHeader()` and model-selection projections. Production code adds no `eventAt()`, `snapshotEvents()` or `ownEvents()` dependency.
|
|
98
|
+
- **Unowned service audit:** static source markers pin MCP SDK v2 resource list/template cursors, the `@deepseek-ai/dsh-ptc-runtime` and `@deepseek-ai/dsh-workflow-ptc` names, isolated Node PTC's empty model environment, cancellable asynchronous Sandbox/Shell preparation, consumer-owned optional-plugin startup failures, attachment request-cache separation from normalized objects, and Team task cursor/limit behavior. The plugin imports none of those service packages.
|
|
99
|
+
- **Tool and attachment behavior:** provider-scoped Copilot filtering removes unavailable `sandbox_permissions` and `justification` fields from the new `run_code` schema as it already does for shell/filesystem tools, while leaving Team pagination untouched. The managed adapter continues to expose only the normalized attachment object's execution-world path; it does not expose DSH request-version cache paths. When the 0.1.6 adapter returns `IMAGE_OFFLOAD_REQUIRED`, the first call remains failed; the exact tagged fixture applies the public durable `image/offload` projection and proves the retry sends mapped placeholder text without image bytes.
|
|
100
|
+
- **Evidence boundary and blocker:** CI and the release workflow use the unchanged exact tagged source on Windows and Linux. This proves source compatibility and synthetic behavior only. The Draft PR remains blocked on the coordinator's Windows Ops 0.1.5 baseline and must not be merged, installed, or published until explicitly unblocked.
|
|
101
|
+
|
|
102
|
+
## Remaining limitations and follow-up acceptance criteria
|
|
103
|
+
|
|
104
|
+
- **Initiator compatibility:** planned alpha.8 derives search from the captured initiating Session's effective request-header/config or explicit `GenerateOptions`, never a global default. Without `agents.currentInitiator`, traditional hosted search reports a named unavailable diagnostic. Explicit marked `GenerateOptions` still supports guarded inline routing, possibly uncached when no owner exists. An OAuth credential notification during initial lazy discovery is indistinguishable from external account change via public status: the first search fails closed with `WEB_PROVIDER_UNAVAILABLE` before probe/wire; a later user/driver request may retry, never automatically. Do not claim seamless first-attempt credential refresh. Verify the initiating-context seam on each pinned Core before extending compatibility claims. Capability/probe and route allowlists still gate search; owner isolation is not unrestricted search support.
|
|
105
|
+
- **Live evidence:** readonly status describes the stored account snapshot, not fresh entitlement or a successful request. A credential update during an in-flight search fails closed; a new explicit request can retry with fresh proof. There is intentionally no automatic retry loop.
|
|
106
|
+
- **Browser acceptance:** pure React element tests and synthetic screenshots do not establish clipboard permissions, keyboard focus, narrow layouts, pending RPC unmount behavior or a loaded Client update. Add mounted/browser tests with synthetic codes before calling those behaviors fully certified.
|
|
107
|
+
- **Minimum runtime/full baseline activation:** local and CI Node24 plus source/config checks are not full Node22.19/live-plugin certifications. Run those explicitly before expanding deployment claims.
|
|
108
|
+
- **Security-sensitive diagnostics:** any suspected credential/session/endpoint exposure requires private triage under SECURITY.md with synthetic-sentinel tests. No real secret exposure was established by this audit; do not publish raw logs or provider bodies as evidence.
|
|
109
|
+
|
|
110
|
+
No attempt is made here to rewrite old commits/tags, auto-enable account models, alter live profile-wide Web provider selection, or introduce a second LLM adapter. The runtime guard can be reverted independently; the tooling and documentation remain useful without installing a plugin release.
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Contextual Auto routing and captured selection reasons
|
|
2
|
+
|
|
3
|
+
Tracking: [#258](https://github.com/cloga/dsh-github-copilot/issues/258) and
|
|
4
|
+
[evidence refinement #262](https://github.com/cloga/dsh-github-copilot/issues/262).
|
|
5
|
+
|
|
6
|
+
**Current contract:** source candidate `0.4.0-alpha.99`, targeting official DSH/Windows
|
|
7
|
+
Desktop `0.2.0-rc.2`. Semantic assessment is enabled by default with bounded
|
|
8
|
+
auxiliary timing/output evidence. Neither publication nor
|
|
9
|
+
these explanations prove the version loaded in a particular Host.
|
|
10
|
+
|
|
11
|
+
## Using Auto
|
|
12
|
+
|
|
13
|
+
Choose **Auto · Balance**, **Auto · Efficiency**, or **Auto · Intelligence**
|
|
14
|
+
under the managed **GitHub Copilot** provider in DSH's ordinary picker. This is
|
|
15
|
+
the plugin's DSH routing policy, not Copilot App's Auto or GitHub's private
|
|
16
|
+
router. Selecting a real model exits Auto. Every step/retry in an admitted
|
|
17
|
+
turn keeps its chosen model; the next turn can choose differently.
|
|
18
|
+
|
|
19
|
+
Semantic assessment is already enabled for locally unknown tasks. To opt out,
|
|
20
|
+
set `autoSemanticAssessment: false` in the plugin's `github-copilot` settings
|
|
21
|
+
namespace; it is not an extra switch on the Web search card. This changes
|
|
22
|
+
subsequent assessments, not an already-admitted turn. Local known-task rules
|
|
23
|
+
still work when auxiliary inference is disabled.
|
|
24
|
+
|
|
25
|
+
Open the reply's selection explanation for the captured decision. Evidence is
|
|
26
|
+
Host-lifetime and bounded; after restart or eviction it can be unavailable.
|
|
27
|
+
Do not infer an old decision from the current picker.
|
|
28
|
+
|
|
29
|
+
| Reading | Meaning |
|
|
30
|
+
|---|---|
|
|
31
|
+
| `uncertain` / unknown demand | The available evidence does not establish task demand; it is not a failed answer or a claim that the conversation is empty. |
|
|
32
|
+
| `insufficient-evidence` | A local rule or classifier could not justify a demand category. Longer context alone does not guarantee classification. |
|
|
33
|
+
| Semantic timeout | No validated result within the 8-second end-to-end budget. Demand remains unknown; Efficiency/Balance target Versatile, Intelligence targets Powerful, subject to eligibility and category fallback. |
|
|
34
|
+
| Missing auxiliary milestone | That milestone was not observed before assessment settled, not proof the supplier never sent data. |
|
|
35
|
+
| Selection unknown/unavailable | Captured selection evidence is absent or could not be read, distinct from unknown task demand. |
|
|
36
|
+
|
|
37
|
+
There is no assessment retry or automatic deadline extension. Caller cancellation
|
|
38
|
+
aborts the turn rather than invoking fallback. Auxiliary calls can add latency
|
|
39
|
+
and supplier charges outside native answer Usage.
|
|
40
|
+
|
|
41
|
+
## Requirements
|
|
42
|
+
|
|
43
|
+
Auto must explain why the initiating turn chose its actual route, not display a
|
|
44
|
+
generic description of prompt length. Intelligence prioritizes response quality
|
|
45
|
+
but can use a lightweight model for demonstrably simple work. Efficiency favors
|
|
46
|
+
economical capability without knowingly underpowering difficult work. Balance
|
|
47
|
+
trades those priorities. All preferences share the same account model pool.
|
|
48
|
+
|
|
49
|
+
The authenticated account `/models` response supplies `model_picker_category`.
|
|
50
|
+
The October 3, 2026 bounded live probe observed `powerful`, `versatile` and
|
|
51
|
+
`lightweight`; some records lacked the field. This is supplier classification,
|
|
52
|
+
not measured latency, quality, price or health. Official documentation's
|
|
53
|
+
`category` is a different source and must not override live account facts.
|
|
54
|
+
Do not derive category from IDs, names, reasoning effort or context capacity.
|
|
55
|
+
|
|
56
|
+
Hard constraints remain first: entitlement, exclusions, current proof, text/image
|
|
57
|
+
capability and actual image format, estimated input headroom and final native
|
|
58
|
+
admission. No preference overrides these. No new Core owner, adapter, credential
|
|
59
|
+
record, general transport, global model mutation or durable decision event.
|
|
60
|
+
|
|
61
|
+
## Task assessment
|
|
62
|
+
|
|
63
|
+
Assessment concerns the task in context, not the last sentence's length.
|
|
64
|
+
An isolated greeting may be low demand. A short request to prove a theorem or
|
|
65
|
+
continue an unresolved investigation is not evidence of low demand. Long input
|
|
66
|
+
can be mechanical. Prior assistant/tool work prevents a greeting/continuation
|
|
67
|
+
shortcut from claiming an isolated simple task.
|
|
68
|
+
|
|
69
|
+
Use conservative local assessment first. Unknown is an explicit outcome, never
|
|
70
|
+
silently translated into simple. Semantic assessment is enabled by default for
|
|
71
|
+
locally unknown demand at the user's explicit rollout request (#267), not
|
|
72
|
+
because labeled-corpus calibration has completed. Set
|
|
73
|
+
`github-copilot.autoSemanticAssessment: false` to disable auxiliary inference;
|
|
74
|
+
an existing explicit false remains respected. It must not claim equivalence to
|
|
75
|
+
GitHub's private router or calibrated confidence.
|
|
76
|
+
|
|
77
|
+
Local rules recognize an isolated, explicit JSON-to-CSV/CSV-to-JSON conversion
|
|
78
|
+
or line sort only when the entire request is at most 1600 characters, contains
|
|
79
|
+
one fenced payload and no other work or non-text content. This establishes
|
|
80
|
+
routine, not simple. An exact acknowledgement/continue request can inherit
|
|
81
|
+
explicit difficult-task evidence from the nearest non-continuation user request
|
|
82
|
+
among the preceding twelve user requests. A new task or an expired anchor stops
|
|
83
|
+
inheritance; simple/routine demand is never inherited.
|
|
84
|
+
|
|
85
|
+
`uncertain` remains a valid task result. `insufficient-evidence` means the local
|
|
86
|
+
rules cannot establish demand, not that the conversation has no context.
|
|
87
|
+
Attachments, unfamiliar instructions and genuinely ambiguous continuations can
|
|
88
|
+
still remain unknown. These refinements do not change category preference,
|
|
89
|
+
previous-model eligibility or semantic safeguards.
|
|
90
|
+
|
|
91
|
+
The semantic assessment uses one fixed concrete account candidate through the
|
|
92
|
+
existing managed native adapter, never an Auto ID and never `ctx.llm` routing
|
|
93
|
+
recursion. It has no tools, bounded text-only assessment context, bounded JSON
|
|
94
|
+
output, one deadline, cancellation and no new retry loop. Text from messages is
|
|
95
|
+
untrusted data, not router instructions. Files/images/reasoning/replay bodies
|
|
96
|
+
are not read; omitted context makes classification uncertain and cannot justify
|
|
97
|
+
downshifting. Assessment input is a separate projection: the actual chat
|
|
98
|
+
messages, system prompt, tools, attachments and history stay untouched.
|
|
99
|
+
|
|
100
|
+
Only locally unknown tasks invoke the enabled assessment. Context packing keeps
|
|
101
|
+
the current and nearest preceding user requests before recent output, then
|
|
102
|
+
restores chronological order. At most twelve complete JSON rows, 1600 text
|
|
103
|
+
characters per row and 8000 serialized characters are retained; JSON escape
|
|
104
|
+
expansion is included in this bound. Any truncation, skipped row or non-text
|
|
105
|
+
content still marks omitted context and prevents a semantic simple/routine
|
|
106
|
+
downshift. Prioritization does not prove omitted output irrelevant.
|
|
107
|
+
|
|
108
|
+
The strict result contains demand (`simple`, `routine`, `complex`, `unknown`)
|
|
109
|
+
and finite evidence signals, not a model ID, raw reasoning or an uncalibrated
|
|
110
|
+
confidence percentage. Invalid/truncated/failed results retain the local
|
|
111
|
+
assessment with an explicit diagnostic. Caller cancellation aborts the turn
|
|
112
|
+
instead of falling back. Credential, metadata and account revocation remain
|
|
113
|
+
fatal through existing lease/admission guards. Extra calls incur supplier
|
|
114
|
+
charges and latency, separate from native chat Usage and without inferred cost.
|
|
115
|
+
|
|
116
|
+
## Auxiliary latency evidence and bounded output (#272)
|
|
117
|
+
|
|
118
|
+
The assessment still has one **8-second end-to-end deadline**, including account
|
|
119
|
+
discovery/preparation and the native call. It does not retry on timeout or try a
|
|
120
|
+
second classifier. The response budget is now 128 output tokens, with compact
|
|
121
|
+
demand JSON and at most three fixed signals requested. The strict decoder
|
|
122
|
+
retains its seven-signal compatibility bound; raw explanation, confidence
|
|
123
|
+
percentages and reasoning are not requested. Truncation remains failure, never
|
|
124
|
+
accepted partial JSON.
|
|
125
|
+
|
|
126
|
+
One monotonic deadline is checked after context packing, discovery and native
|
|
127
|
+
preparation, before native request admission, on delivered chunks and before
|
|
128
|
+
accepting a decoded result. A delayed event-loop timer cannot authorize a
|
|
129
|
+
late auxiliary request or result. It can still delay observed settlement:
|
|
130
|
+
this is not a hard real-time guarantee or evidence of a supplier latency cause.
|
|
131
|
+
The owned timer and abort listener are disposed when assessment settles.
|
|
132
|
+
|
|
133
|
+
Among eligible supplier Lightweight text candidates with the existing input
|
|
134
|
+
headroom, prefer advertised reasoning `off`, then deterministic ID ordering.
|
|
135
|
+
This does not infer speed, health or quality from effort or model names, and
|
|
136
|
+
does not launch a second candidate if native support is absent.
|
|
137
|
+
|
|
138
|
+
Request `off` reasoning only when both current supplier metadata advertises it
|
|
139
|
+
and the public prepared model lists an `off` effort. Supplier metadata alone
|
|
140
|
+
does not establish native support: current managed reasoning maps can decline
|
|
141
|
+
`off` even when advertised. In that case retain native policy, do not change
|
|
142
|
+
shared model maps, guess a wire value or patch Core. No claim that reasoning is
|
|
143
|
+
disabled for all classifiers is made.
|
|
144
|
+
|
|
145
|
+
Captured Host-lifetime selection evidence now includes a bounded public
|
|
146
|
+
classifier ID, configured waiting budget, total monotonic assessment elapsed
|
|
147
|
+
time, adapter-invocation start, first nonempty text time, native stop/non-stop
|
|
148
|
+
finish observation and strict result-validation status. Preparation is included
|
|
149
|
+
in total time; adapter start is **not HTTP dispatch**, first text is **not first
|
|
150
|
+
network byte**, and these milestones cannot distinguish connection, supplier
|
|
151
|
+
queueing or computation. Absence says no milestone was observed before
|
|
152
|
+
settlement, not that the provider never emitted data. Counts are characters,
|
|
153
|
+
not tokens/credits; no prompt, text, replay, credential, error body or hash is
|
|
154
|
+
captured. Late callbacks cannot rewrite a settled decision.
|
|
155
|
+
|
|
156
|
+
The existing strict explicit-Session/turn Remote carries this optional evidence;
|
|
157
|
+
old explanations remain decodable without it. Numeric/model evidence is copied
|
|
158
|
+
and frozen in the bounded store and routing decision, not durably appended or
|
|
159
|
+
reconstructed after restart. The footer says assessment timed out, demand
|
|
160
|
+
remained unknown, and preference policy selected the category as a fallback.
|
|
161
|
+
Progressive details show milestones separately from native answer Usage.
|
|
162
|
+
Continuity copy states the fitting category-pool count and explicitly disclaims
|
|
163
|
+
semantic ranking; all-input-fit counts are not the final category pool.
|
|
164
|
+
|
|
165
|
+
This is instrumentation and bounded output optimization, not a measured latency
|
|
166
|
+
improvement or classifier calibration. No latency-ranked classifier pool,
|
|
167
|
+
cross-turn assessment cache, cooldown, adaptive deadline or extra probe is
|
|
168
|
+
introduced without reviewing real observations. Existing local evidence,
|
|
169
|
+
omitted-context downshift protection, cancellation, account/proof revocation,
|
|
170
|
+
same-turn single-flight, eligibility and category policy remain unchanged.
|
|
171
|
+
|
|
172
|
+
## Category policy and continuity
|
|
173
|
+
|
|
174
|
+
| Task demand | Efficiency | Balance | Intelligence |
|
|
175
|
+
| --- | --- | --- | --- |
|
|
176
|
+
| Proven simple | Lightweight | Lightweight | Lightweight |
|
|
177
|
+
| Routine | Lightweight | Versatile | Powerful |
|
|
178
|
+
| Complex | Powerful | Powerful | Powerful |
|
|
179
|
+
| Unknown | Versatile | Versatile | Powerful |
|
|
180
|
+
|
|
181
|
+
These are declared routing policies, not benchmark rankings. Efficiency's
|
|
182
|
+
routine lightweight selection is an economical approximation, not proof of
|
|
183
|
+
equal output quality. Intelligence never treats short length alone as simple.
|
|
184
|
+
|
|
185
|
+
When the target has no fitting candidates, use the disclosed category fallback:
|
|
186
|
+
powerful -> versatile -> lightweight; versatile -> powerful -> lightweight;
|
|
187
|
+
lightweight -> versatile -> powerful. Unclassified candidates are a final
|
|
188
|
+
explicit fallback only, not fabricated categories. Unknown/new category values
|
|
189
|
+
remain unclassified with a bounded catalog diagnostic.
|
|
190
|
+
|
|
191
|
+
Within the first available category, retain the previous managed model only
|
|
192
|
+
when it remains eligible and suitable. Otherwise use stable equal-weight
|
|
193
|
+
Session/turn selection with deterministic ID ordering as a tie breaker. Do not
|
|
194
|
+
infer quality from that ordering or assign fabricated weights. Once admitted,
|
|
195
|
+
all steps/retries share the turn decision. Continuity reduces unnecessary
|
|
196
|
+
switches but is not a claim of supplier cache savings.
|
|
197
|
+
|
|
198
|
+
If no model fits, preserve the existing largest-admissible-input recovery
|
|
199
|
+
branch and its native compaction diagnostics. Explain that no candidate fits;
|
|
200
|
+
never label this as a successful preference match or silently trim history.
|
|
201
|
+
|
|
202
|
+
## Explanation contract
|
|
203
|
+
|
|
204
|
+
Capture task source/demand/signals, assessment diagnostic, target/selected
|
|
205
|
+
category, fitting category count, category fallback and continuity/tie-break or
|
|
206
|
+
no-fit selection at decision time. Client reads the explicit viewed Session and
|
|
207
|
+
turn through the existing strict Remote. It does not rerun classification or
|
|
208
|
+
consult today's picker. Show a decisive first sentence, bounded supporting
|
|
209
|
+
facts and optional policy detail. Do not repeat the model name or change Usage.
|
|
210
|
+
|
|
211
|
+
Legacy records without detailed evidence show that the reason was not retained.
|
|
212
|
+
Host-lifetime evidence may be lost on restart; do not invent durable history or
|
|
213
|
+
promise cold-history reconstruction.
|
|
214
|
+
|
|
215
|
+
## Acceptance and rollout
|
|
216
|
+
|
|
217
|
+
Regress category normalization (missing/new/invalid values), short difficult
|
|
218
|
+
tasks, isolated greetings, contextual continuation, long mechanical input,
|
|
219
|
+
category fallback, previous-model eligibility, deterministic tie breaking,
|
|
220
|
+
no-fit recovery, one-call semantic success/invalid/failure/timeout/cancellation,
|
|
221
|
+
omitted context, strict Remote and footer English/Chinese explanations.
|
|
222
|
+
|
|
223
|
+
Retain native gateway, parent following, manual selection, exclusion admission,
|
|
224
|
+
account proof, image admission and compaction fixture coverage. Full protected
|
|
225
|
+
Windows/Linux CI remains mandatory before merge/release. No live inference
|
|
226
|
+
calls are needed for synthetic acceptance.
|
|
227
|
+
|
|
228
|
+
Default enablement is a user-authorized rollout, not an accuracy qualification.
|
|
229
|
+
Evaluate a reviewed labeled corpus for complex-to-simple errors, extra latency,
|
|
230
|
+
token use and stability across languages and prompt injection before claiming
|
|
231
|
+
calibrated performance. Synthetic passing tests are not this evaluation.
|
|
232
|
+
Missing settings adopt the enabled default after upgrade; explicit false is
|
|
233
|
+
not overwritten and no profile migration is performed. Publication does not
|
|
234
|
+
authorize profile installation or restart.
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# GitHub Copilot Auto routing contracts
|
|
2
|
+
|
|
3
|
+
Target: official DSH / Windows Desktop `0.2.0-rc.2`. Implementation is plugin-only.
|
|
4
|
+
For ordinary use, start with [task assessment and explanations](./auto-task-routing.md)
|
|
5
|
+
and [parent following](./parent-model-follow.md).
|
|
6
|
+
|
|
7
|
+
## User contract
|
|
8
|
+
|
|
9
|
+
The managed `github-copilot-preview` group provides **Auto · Balance** (`auto`),
|
|
10
|
+
**Auto · Efficiency** and **Auto · Intelligence** in Core's flat picker.
|
|
11
|
+
Only a real model selection exits Auto. Native selection also saves the future
|
|
12
|
+
global default; the plugin does not change that Core behavior.
|
|
13
|
+
|
|
14
|
+
Each admitted Core turn resolves to one real account model. Tool continuations,
|
|
15
|
+
native request retries and compaction retries retain it; a new user or Goal
|
|
16
|
+
turn can choose differently. Transport, replay, native Usage and billing retain
|
|
17
|
+
the actual model identity. Auto never crosses providers/accounts or changes an
|
|
18
|
+
explicit real-model selection.
|
|
19
|
+
|
|
20
|
+
The virtual preference normally remains the Session's pending selection while actual
|
|
21
|
+
request headers record real models. A strict plugin-owned public Session projection
|
|
22
|
+
also retains the latest owner-explicit native `model/selection`: if a virtual
|
|
23
|
+
request header consumes native pending, later concrete headers cannot erase that
|
|
24
|
+
Auto intent. Cold refolding restores intent, not old decisions or reasons.
|
|
25
|
+
Copied fork/child prefixes alone do not establish an owner-explicit choice;
|
|
26
|
+
native pending and the existing parent-following rules remain independent.
|
|
27
|
+
Missing or malformed continuity evidence produces a named diagnostic instead of
|
|
28
|
+
guessing Auto from a real model. A new explicit fixed or other-provider selection
|
|
29
|
+
replaces intent for future turns, even after its native pending is consumed.
|
|
30
|
+
Already admitted Auto turns retain their real route through late picker changes.
|
|
31
|
+
This projection neither writes history/settings nor changes native projection ownership.
|
|
32
|
+
For an otherwise unselected Session that
|
|
33
|
+
inherits default Auto, the first request persists the exact virtual
|
|
34
|
+
`model/selection` intent. A later explicit selection wins. Existing fixed
|
|
35
|
+
Sessions are not converted because the global default changes.
|
|
36
|
+
|
|
37
|
+
## Eligibility and input fit
|
|
38
|
+
|
|
39
|
+
Current authenticated account metadata establishes entitlement, endpoint,
|
|
40
|
+
context/input/output limits, tool/image support and reasoning capabilities.
|
|
41
|
+
Missing/invalid metadata produces diagnostics, not guessed capabilities.
|
|
42
|
+
Exact exclusions and independent account/proof/cancellation guards apply first.
|
|
43
|
+
|
|
44
|
+
The public native TokenMeter estimates every entered message, including
|
|
45
|
+
reasoning and tool history. Its current-surface measurement is an envelope
|
|
46
|
+
floor, not a substitute for candidate-specific final serialization.
|
|
47
|
+
Missing/invalid measurement fails with
|
|
48
|
+
`COPILOT_AUTO_TOKEN_METER_UNAVAILABLE` /
|
|
49
|
+
`COPILOT_AUTO_TOKEN_ESTIMATE_INVALID`.
|
|
50
|
+
|
|
51
|
+
Candidates fit when estimated input does not exceed the hard budget after
|
|
52
|
+
output reservation and safety allowance. If none fits, choose the largest
|
|
53
|
+
input budget for native recovery and explain whether content is fixed,
|
|
54
|
+
compaction unavailable, already attempted, or eligible. This is not permission
|
|
55
|
+
to dispatch an oversized request. The native managed `inspectRequest` guard
|
|
56
|
+
remains authoritative after final framing/attachment projection.
|
|
57
|
+
|
|
58
|
+
Task preference uses supplier `model_picker_category`, not capacity, model
|
|
59
|
+
names or reasoning effort as quality rankings. [Task policy](./auto-task-routing.md)
|
|
60
|
+
owns the demand matrix, default semantic assessment, category fallback,
|
|
61
|
+
continuity and stable same-category allocation.
|
|
62
|
+
|
|
63
|
+
## Images, compaction and search
|
|
64
|
+
|
|
65
|
+
Image eligibility includes historical user/tool image blocks in all entered
|
|
66
|
+
messages, not only current user text. Text-only candidates are removed; Auto
|
|
67
|
+
advertises image input only with an eligible image model. Actual fixed/Auto
|
|
68
|
+
dispatch independently checks explicit account MIME restrictions against
|
|
69
|
+
Core's projected image. Missing MIME lists stay unverified.
|
|
70
|
+
[Image admission limits](./image-input-compatibility.md).
|
|
71
|
+
|
|
72
|
+
Auto does not trim history or own compaction transactions. Estimated pressure
|
|
73
|
+
uses the initiating Agent's public bound recovery service and preserves the
|
|
74
|
+
same real model. If the summary input already exceeds every eligible budget,
|
|
75
|
+
stock one-shot compaction cannot rescue it. [Budget admission](./copilot-compaction.md)
|
|
76
|
+
and [manual recovery](./manual-compaction-recovery.md) describe separate paths.
|
|
77
|
+
|
|
78
|
+
Chat Auto does not own independent hosted search. A nonempty `searchModel`
|
|
79
|
+
override remains authoritative; otherwise that provider uses bounded
|
|
80
|
+
account-owned Responses selection and capability proof. Auto-following search
|
|
81
|
+
sees the initiating real request route. No virtual model reaches transport,
|
|
82
|
+
and the final query is not replayed across candidates.
|
|
83
|
+
[Search routing](./session-search-routing.md).
|
|
84
|
+
|
|
85
|
+
## Attribution and explanation
|
|
86
|
+
|
|
87
|
+
Completed replies show **Auto (preference)** with captured reasons, **Manual**
|
|
88
|
+
only with explicit fixed-selection evidence, or **Selection unknown** when a
|
|
89
|
+
successful read has no record. Failed reads show **Selection unavailable → Retry**.
|
|
90
|
+
Retry rereads the same Session/turn; it never runs inference.
|
|
91
|
+
|
|
92
|
+
The public assistant-actions slot adds the plugin item after native Usage/time.
|
|
93
|
+
It cannot change the native fixed-height parent row, repeats no model name and
|
|
94
|
+
adds no Model details button. A turn without a closing message has no such
|
|
95
|
+
anchor. Optional conversation projections do not control selection mounting.
|
|
96
|
+
|
|
97
|
+
The bounded Host store retains 64 Agents and 128 turns per Agent. Disposal,
|
|
98
|
+
eviction and restart lose new records. Compatible historical Auto events remain
|
|
99
|
+
readable; missing historical preference/reasons are not reconstructed.
|
|
100
|
+
New optional `github-copilot/auto-model-decision` events are **not** emitted:
|
|
101
|
+
official rc.2 `Session.append()` has no public ignorable-envelope option.
|
|
102
|
+
|
|
103
|
+
`TurnSelectionController` extends public `TypertRemoteService` with `@Remote get`.
|
|
104
|
+
Client calls carry explicit viewed Session ID and turn, with no automatic
|
|
105
|
+
Client scope projection that would remove the ID. Native Host Agent lookup,
|
|
106
|
+
access checks and strict codecs remain. Actual Client/Host gateway regressions
|
|
107
|
+
cover reachability, bound contexts and missing/denied identities; mock RPC
|
|
108
|
+
success is not sufficient evidence.
|
|
109
|
+
|
|
110
|
+
Captured evidence includes task/category, eligible/fitting counts,
|
|
111
|
+
fallback/continuity and optional auxiliary milestones. It proves a decision,
|
|
112
|
+
not execution, current occupancy, usage or supplier billing. Native accounting
|
|
113
|
+
remains independent. [Usage limits](./copilot-usage.md).
|
|
114
|
+
|
|
115
|
+
### Recovering affected histories
|
|
116
|
+
|
|
117
|
+
Only histories containing the old incompatible decision event need this
|
|
118
|
+
compatibility utility. Upgrading prevents new writes but does not repair old logs.
|
|
119
|
+
From a source checkout, use Node 24 LTS and the pinned frozen dependencies:
|
|
120
|
+
|
|
121
|
+
```powershell
|
|
122
|
+
# Read-only validation; no conversation content is printed.
|
|
123
|
+
node scripts\repair-auto-model-history.mjs 'C:\absolute\path\session.v4.jsonl.zstd'
|
|
124
|
+
|
|
125
|
+
# Optional detached copy in a NEW private directory, never the live source.
|
|
126
|
+
node scripts\repair-auto-model-history.mjs 'C:\absolute\path\session.v4.jsonl.zstd' --write-copy 'C:\private\new-recovery-directory'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
The utility validates the entire v4 log with the official rc.2 catalog, marks
|
|
130
|
+
only recognized decision envelopes `ignorable: true`, and preserves all other
|
|
131
|
+
logical fields. Unknown events, malformed relationships, torn tails and inputs
|
|
132
|
+
over 128 MiB fail closed. Copy mode refuses existing destinations and creates a
|
|
133
|
+
byte-exact original, validated copy and SHA-256 receipt; keep both logs private.
|
|
134
|
+
|
|
135
|
+
The corrected writer preserves a separate first zstd header frame for Desktop
|
|
136
|
+
discovery. The original utility combined header/events and could make a copy
|
|
137
|
+
disappear despite logical validation. `reframedHeader: true` reports physical
|
|
138
|
+
repair; zero changed event sequences alone is not readability proof.
|
|
139
|
+
|
|
140
|
+
**Applying a copy requires separate approval and stopped writers.** Recheck the
|
|
141
|
+
live source against `originalSha256`; regenerate if changed. Replace only that
|
|
142
|
+
log, compare `repairedSha256` and reopen with the official reader. Do not replay
|
|
143
|
+
business requests as a test. The utility never installs, restarts, writes the
|
|
144
|
+
source, clears credentials or performs automatic migration.
|
|
145
|
+
|
|
146
|
+
## Requested parent-to-child selection inheritance
|
|
147
|
+
|
|
148
|
+
The implemented opt-in [profile-wide switch](./parent-model-follow.md) follows
|
|
149
|
+
supported children on each new turn. Fixed parent selection is passed directly;
|
|
150
|
+
Auto passes the exact preference and evaluates the child's own context.
|
|
151
|
+
Child-owned explicit selections and admitted-turn freezing remain authoritative.
|
|
152
|
+
Legacy `parentModelFollow` bindings stay independent.
|
|
153
|
+
|
|
154
|
+
With both policies off, ordinary native children retain Core's creation-time
|
|
155
|
+
route snapshot. Native resolved options/descriptor v3 do not retain whether an
|
|
156
|
+
equal creation route was an explicit override. Enabling the plugin policy
|
|
157
|
+
authorizes replacing that snapshot; it does not reconstruct original intent,
|
|
158
|
+
fabricate descriptor provenance or rewrite Team labels.
|
|
159
|
+
|
|
160
|
+
The original [investigation #229](https://github.com/cloga/dsh-github-copilot/issues/229)
|
|
161
|
+
and [one-switch follow-up #234](https://github.com/cloga/dsh-github-copilot/issues/234)
|
|
162
|
+
record the design history. Upstream native rules/settings UI is separate work,
|
|
163
|
+
not a dependency or claimed shipped feature of this plugin.
|
|
164
|
+
|
|
165
|
+
## Model exclusions and richer picker boundary
|
|
166
|
+
|
|
167
|
+
**Settings → Models → GitHub Copilot → Manage → Model preferences** offers
|
|
168
|
+
search, All/Enabled/Excluded filters and immediate Exclude/Restore actions.
|
|
169
|
+
Temporarily absent excluded IDs remain restorable. Selected models can also be
|
|
170
|
+
excluded; legacy `lockedModelIds` remains empty.
|
|
171
|
+
|
|
172
|
+
`setModelExcluded(modelId, excluded)` returns a narrow strict preferences result
|
|
173
|
+
after path-level native CAS persistence. It reads no credentials, discovers no
|
|
174
|
+
models and enumerates no Sessions. Unknown settings make rows read-only with
|
|
175
|
+
named diagnostics; status-only Retry cannot imply an empty exclusion set.
|
|
176
|
+
The hidden volatile Config leaf persists through native projection/restart.
|
|
177
|
+
|
|
178
|
+
Directory, Auto pools/modalities, search facts and new-turn admission remove
|
|
179
|
+
exact excluded IDs. An admitted Session/turn/model with the exact native request
|
|
180
|
+
signal may continue steps/retries; `turn/end` clears admission. New turns,
|
|
181
|
+
unbound calls and stale picker rows fail `COPILOT_PREVIEW_MODEL_EXCLUDED`.
|
|
182
|
+
Account/proof/cancellation guards remain revocable. A fixed selection is never
|
|
183
|
+
changed automatically; restore it or select another model before the next turn.
|
|
184
|
+
Zero eligible candidates fails `COPILOT_AUTO_NO_ELIGIBLE_MODEL`.
|
|
185
|
+
|
|
186
|
+
Core owns flat grouping and picker search. The old
|
|
187
|
+
[nested-picker prototype](../output/auto-model-mockup/tiers.html) is historical
|
|
188
|
+
design exploration: its capacity quality scores, nested menu and simulated
|
|
189
|
+
responses are not implementation or model evaluations.
|
|
190
|
+
|
|
191
|
+
## Public seams and evidence limits
|
|
192
|
+
|
|
193
|
+
`PreviewAdapter.listModels/resolveModel`, `agent/pre-step`, public model-selection
|
|
194
|
+
middleware and `agent/request` compose the real route before request-header
|
|
195
|
+
persistence. Unresolved virtual Auto fails in adapter preparation/streaming.
|
|
196
|
+
Per-Agent/turn caching, native adapter leases, OAuth, replay and cancellation
|
|
197
|
+
keep their existing owners.
|
|
198
|
+
|
|
199
|
+
Required unchanged rc.2 source/published-artifact fixtures on Windows/Linux
|
|
200
|
+
cover eligibility, real headers, durable intent, multi-step/retry freezing,
|
|
201
|
+
images, native compaction, exclusions and gateway access. They do not establish
|
|
202
|
+
live model availability, quality, latency, price, account access or Desktop
|
|
203
|
+
activation. No Core/dependency/private-registry/shared-catalog/history patch is
|
|
204
|
+
permitted. Measured ranking, cross-provider Auto, failure-driven model switching,
|
|
205
|
+
side-effect replay and native picker redesign remain out of scope.
|