Skip to content

feat: centralize provider-scoped model discovery - #1841

Merged
JAORMX merged 17 commits into
mainfrom
impl/provider-model-discovery
Sep 25, 2026
Merged

JAORMX merged 17 commits into
mainfrom
impl/provider-model-discovery

Conversation

@JAORMX

@JAORMX JAORMX commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Centralize model listing and metadata publication in one Build-owned coordinator with provider-local attempts, cooldowns, retained observations, and coherent inventory/status reads.
  • Require exact context-window evidence at covered Service entry paths, including cold resume, failed-step retry, and restored approval; unresolved echoes remain zero.
  • Preserve typed pre-SessionInit Mecatui submissions for explicit byte-identical Retry or confirmed Back restoration.
  • Prove cross-Build evidence, outage, cooldown, cancellation/shutdown isolation, and lease-conflict-before-discovery behavior; document local/cloud ownership.

Development stage

  • Plan / Interface
  • Implementation — draft stacked implementation under explicit pre-merge exception
  • Combined
  • Spike / Routine / Cleanup

Contract linkage

  • Classification: Architectural.
  • Plan PR plan: consolidate provider-scoped model discovery #1805 remains draft/unmerged.
  • Current amended plan baseline: 534d2c9c65e55df902389fc7ddbcccaf294ff624, an ancestor of this branch.
  • Plan: provider-model-discovery.md, six scenarios and 26 ACs.
  • Proposed decision: ADR 0362.
  • Implementation proceeds under the explicitly authorized pre-merge draft-stack exception. The plan remains unmerged; its six policy decisions are resolved.
  • The landed plan edit is a proposed candidate transition, authoritative only when this Implementation PR merges.

Interfaces match the amended contract: Yes. No engine/provider exported API, protobuf field/RPC, tool schema, CLI/config, event, or persistence-schema change. Inventory is a defensive host-internal combined model/status snapshot. Existing typed context_window_unavailable semantics remain intact.

Verification

Local verification passed: the acceptance-plan checker (six scenarios, 26 ACs), focused normal and race suites, full lint, full task test:race, and whitespace checks. The plan's documentation checks also passed.

The implementation and amendment received separate review passes covering spec adherence, project standards, test adequacy, and architecture. Tests use offline fixtures; no live provider or paid request is required.

Test coverage

  • Cold-resume and pre-execution admission across prompt, retry, and approval paths.
  • Cross-Build evidence, outage, cooldown, cancellation, and shutdown isolation.
  • Lease-conflict rejection before discovery admission.
  • Typed submission recovery preserving exact text/media without automatic replay.
  • Deterministic shutdown, watcher, renewal, and team-liveness fixtures using virtual time or explicit barriers; real filesystem notification integration coverage remains.
  • Mutation controls verify that bypassing admission, leases, timing bounds, or cleanup makes the tests fail.

Scope and limits

Discovery remains replica-local. Positive exact last-good metadata is usable for one Build lifetime, not inference authorization. Session-lifetime leases remain held after metadata rejection; arbitrary-replica retry and holder routing are not guaranteed. Direct child/utility/team admission, generation-bound capabilities/effort, reasoning-field presence, persisted effective model identity, and broader UI identity/footer reconciliation remain deferred.

No merge, release, deployment, binary installation, or live paid testing. Relates to #1805, #1800, and #1798.

@JAORMX
JAORMX force-pushed the impl/provider-model-discovery branch from fc4fe09 to 390e0e3 Compare September 24, 2026 12:09
@JAORMX
JAORMX added this pull request to stack #1877 September 24, 2026 13:23
@JAORMX

JAORMX commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

CI repair verified through completion on the published stack:

The observed failures were addressed by collision-free ADR numbering and deterministic shutdown/debounce tests, not by increasing wall-clock tolerances or changing runtime behavior. The replacement checks were watched to completion; run 36005093770 was superseded and its cancellation-related failures are not the current result. Draft race jobs remain intentionally skipped in CI; the full race suite passed locally.

Both PRs remain draft and unmerged. The bounded monitoring backstop is now paused.

@JAORMX

JAORMX commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Deterministic-test follow-through is complete at 5c1df218d59150acb517b472ab8611febea8eab2.

  • 4f582ca43: the existing watcher loop now accepts private event/error channels. Timing and lifecycle tests drive that same loop with injected events and testing/synctest; real temporary-filesystem tests remain for notification delivery and projected symlink replacement. Production cleanup order and public API are unchanged. The renewal deadline test also uses virtual time instead of assuming a real 1ms tick wins a 20ms deadline.
  • 5c1df218d: CI exposed a finite-stream fixture incorrectly treated as a blocked team. Three team liveness tests now hold an actual mock-provider request behind an explicit barrier, with cancel/release/join cleanup. The diagnostics redaction fixture now joins diagnostic delivery before inspecting records.

Local focused repetitions, mutation controls, full tests/race, lint, demo, and API checks passed across this follow-up. All review findings were resolved.

Replacement CI was watched to completion on this exact head: 28 checks passed, 9 intentionally skipped, none pending or failed. Main CI, kind e2e, and performance succeeded. The bounded monitoring backstop is paused. No PR merge or deployment.

@JAORMX
JAORMX force-pushed the impl/provider-model-discovery branch from 5c1df21 to e93fc7f Compare September 25, 2026 06:27
@JAORMX

JAORMX commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto plan 534d2c9c6 over main a06b86318, and pushed head e93fc7f87. Conflict resolution preserves main's discovery query/cursor behavior alongside the provider-owned inventory snapshot and deterministic tests. Local focused tests, lint, and the full race suite passed; these results do not substitute for CI on the new head.

@JAORMX

JAORMX commented Sep 25, 2026

Copy link
Copy Markdown
Contributor Author

Pushed 55c22c3ba to fix the failing temporary-directory cleanup in the two rehydrated run-control tests. Observing the persisted completed state does not join the detached relay; the tests now close/join the resumed service before removing its JSONL directory, including failure paths.

Validation: both targeted tests passed 20 normal repetitions and 20 race repetitions; the complete server package passed an uncached race run. Runtime code is unchanged. Replacement CI on this exact head is being followed to completion.

@JAORMX
JAORMX marked this pull request as ready for review September 25, 2026 07:52
Base automatically changed from plan/provider-model-discovery to main September 25, 2026 07:59
JAORMX and others added 17 commits September 25, 2026 10:59
Replace independent discovery writers with one provider-local attempt and publication owner. Wire bootstrap, startup, picker, admission and schedule inventory reads through coherent snapshots with bounded fetches, retained last-good metadata, cancellation isolation and joined resource cleanup.

Co-Authored-By: mecatl <[email protected]>
Document Service-entry admission, provider-local discovery lifecycle, coherent inventory readers, and bounded typed submission recovery. Correct the maintained resource and restart-fidelity inventory without changing runtime policy or plan status.

Co-Authored-By: mecatl <[email protected]>
Correct exact-config precedence and first-demand scope, link canonical recovery guidance, and distinguish authoritative server windows from unchanged TUI freshness.

Co-Authored-By: mecatl <[email protected]>
Repair round 1: keep completion diagnostics outside the reserved tail, cover admission and refresh lifecycle boundaries, and remove the unused snapshot projection.

Co-Authored-By: mecatl <[email protected]>
Add cross-Build evidence, outage, cooldown, shutdown and lease-conflict proofs; document the local and cloud lifecycle boundaries.

Co-Authored-By: mecatl <[email protected]>
Replace scheduler-sensitive wall-clock assertions with synctest, preserving bounded shutdown, queued-event rearm, capped-burst grace, and real filesystem delivery coverage.

Co-Authored-By: mecatl <[email protected]>
Drive the existing watcher loop with synthetic events and virtual time; retain real filesystem notification integration tests. Remove a related renewal-deadline test scheduling assumption exposed by the full race suite.

Co-Authored-By: mecatl <[email protected]>
Hold team provider requests explicitly instead of relying on a finite busy stream, and join discovery diagnostic delivery before inspecting recorded facts.

Co-Authored-By: mecatl <[email protected]>
Close the resumed service before temporary JSONL storage is removed, including assertion failure paths, so detached control relays cannot race directory cleanup.

Co-Authored-By: mecatl <[email protected]>
@JAORMX
JAORMX force-pushed the impl/provider-model-discovery branch from 55c22c3 to e6f8574 Compare September 25, 2026 07:59
@JAORMX
JAORMX merged commit 2f2d1de into main Sep 25, 2026
8 checks passed
@JAORMX
JAORMX deleted the impl/provider-model-discovery branch September 25, 2026 07:59
This was referenced Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant