Skip to content

Bug: UI-thread schema initialization stalls broad tests and raises compiled-regex/test timeouts #1653

Closed

Description

@JoshuaRowePhantom

Summary

Fresh in-memory repository startup can perform built-in schema validation synchronously on the Avalonia dispatcher, blocking MainWindowViewModel construction before a true asynchronous yield. The validator also rebuilds a composed JsonSchema for every entity, even when multiple entities in one request have identical compositions. These are confirmed structural causes of UI unresponsiveness and redundant startup work. The #1505 build-gate incident additionally recorded a compiled-regex exception and test timeout; the precise reason those simple regex matches timed out remains unproven.

Diagnosis scope: diagnosed applies to the dispatcher-blocking startup path and repeated composed-schema construction, not a proven explanation of every incident delay or a resolved JsonSchema.Net/runtime defect.

Revision and investigation scope

  • Current implementation references below are pinned to remote features at d2a1a3b0752609321853f409d6fb1654fe17e7ff. The local features checkout was clean at 1b86a98feb52d32a4bbfef82d624117a57b8fdd4, one commit behind; remote-only startup diagnostics were read rather than assumed missing.
  • Incident: worktrees\fix-1505-build-gate-f6cd63a233, HEAD 11e8feeb3b15bf67611458d79bf96db2700cadc7. That worktree's constructor/lifetime/disposal architecture differs from current remote features. Its InitializeCoreAsync and disposal line numbers must not be used as the current design.
  • Dependency context: Directory.Packages.props:24 pins JsonSchema.Net 9.4.0; Phantom.Workspaces.Data.Core\Phantom.Workspaces.Data.Core.csproj:3,22 targets net10.0 and references that package.
  • This update inspected code and archived text evidence. No tests, builds, profiling, or implementation were performed.

Incident evidence and limits

During #1505 verification, the existing scripts\run-tests.ps1 -Mode fast -NoBuild broad run remained active for over an hour. The stale log's last reported process-isolated split acceptance test did not identify the test executing when stacks were captured.

The recorded process tree was PID 60040 pwsh → 41632 dotnet test → 26308 vstest → 54048 testhost → 12264 Phantom.Workspaces.Tests.exe. PID 12264 was the xUnit v3 assembly runner, not the split acceptance caller/worker role executable.

Archived text under worktrees\fix-1505-build-gate-f6cd63a233\dumps\1653\ records:

Evidence Observation
ui-stack.txt:2-8,137-153 OS thread 0x3cc0 / 15552, SOS thread 7, is on the Avalonia dispatcher in schema evaluation/seed startup during OpenWorkspaceAsync_WithTopLevelTabsArray_PopulatesPaneTabsInSavedOrder.
heap-ui-schema.txt:2-9,220-251 The same dispatcher thread is later in the same startup chain, but during a different test, CycleTabForwardCommand_WithThreeTabs_WrapsAroundForward, with Regex240403_TryMatchAtCurrentPosition / Regex240403_Scan above PatternPropertiesKeyword.Evaluate.
test-results-captured.log:400-443 The latter test reports approximately 90 seconds elapsed, RegexMatchTimeoutException, and the 15,000 ms xUnit timeout. Historical disposal aggregates the initialization exception with the timeout.
regex-pattern-timeouts.txt:1-50 and regex analysis outputs The sampled keyword's patterns are ^.*entity-id$ and ^.*entity-ids$, with recorded options 264 (Compiled | CultureInvariant) and an internal match timeout of 5 seconds. These match JsonSchemas\entity.json:53-60.

The recorded mini/heap captures were at 19:02:44 and 19:05:17 local on 2026-10-21. The investigation recorded runner CPU increasing from 1129.28s to 1211.94s and dispatcher-thread accumulated CPU of 927.61s, much higher than other sampled threads. This supports CPU-active synchronous startup rather than a passive transport deadlock.

Interpretation boundaries:

  • Different sampled test methods establish progress between slow/failing tests, not one permanently hung test. The broad run cannot be counted as passing.
  • A large generated regex ordinal is not a reliable count of compilations, allocation measurement, or profiling result.
  • Repeated composed-schema construction is directly visible in code. Its compiled-regex churn contribution is plausible, with moderate confidence; its share of elapsed time and the reason a simple match timed out require measurement.
  • These snapshots do not prove catastrophic backtracking, a JIT/runtime root cause, or that every regex caused delay. A 5-second internal timeout also does not explain the whole 90-second test duration.
  • The inspected archive contains bounded text analyses, a log snapshot, and SHA256SUMS.txt; raw .dmp files were absent. Historical dump paths/sizes recorded in text do not establish that dumps are currently available. Do not upload process-memory dumps.

The original incident comparison against its features baseline listed seven changed files (Agent GUI MainWindowAxamlTests, IntegrationTests DevTunnelIntegrationAccess, Llm.Core.Tests AgentChatTests, Llm.Core McpBrokerClientTransport, Tests AuthorizationEndToEndTests, ReconnectingDevTunnelLifetimeTests, and WorkspacesTransportHostTests). It reported the implicated schema/startup path and package declaration unchanged by that seven-file build-gate diff. The credential-status callback was not on this constructor/schema path. This does not establish a pre-access-broker-arc baseline; no such baseline was run.

Root cause in current remote features

1. Async startup has no guaranteed worker boundary

Phantom.Workspaces\ViewModels\MainWindowViewModel.cs:127-129 starts initialization directly in the constructor:

this.entityBrokerTask = EntityBroker.CreateInitializedAsync(
    repositorySource,
    userComputerProfileOverride: configuration?.UserComputerProfileOverride);

No cancellation token is supplied. InitializeAsync only later awaits that task (:648-650); this does not defer work already executed while calling it.

EntityBroker.cs:90-110 awaits EntityRepository.CreateAsync before constructing the broker, without offloading repository creation. EntityRepository.cs:76-90 creates the validated pipeline and awaits EnsureSeedDataIfNeededAsync; :104-115 maps UnknownRepositorySource to InMemoryDataAccessLayer.

SchemaPopulator.cs:29-53 loads embedded resources and submits one batch marked TrustedEmbeddedSeed. That designation does not bypass validation:

MainWindowViewModel constructor
  → EntityBroker.CreateInitializedAsync
    → EntityRepository.CreateAsync
      → EnsureSeedDataIfNeededAsync / SchemaPopulator.PopulateAsync
        → MergeProcessingDataAccessLayer.UpdateInternalAsync
          → ReferentialIntegrityDataAccessLayer.UpdateAsync
            → inherited SchemaValidatingDataAccessLayer.UpdateAsync
              → ValidateChangeAsync → JsonSchema.Evaluate (synchronous)

Pipeline evidence: ValidatedDataAccessLayerFactory.cs:16-21 constructs merge → referential-integrity, whose class inherits the schema validator (ReferentialIntegrityDataAccessLayer.cs:11). Merge forwards the processed request (:223-246), and referential integrity invokes base.UpdateAsync (:39-60).

In-memory reads/writes return completed tasks (Phantom.Workspaces.Data.Offline\InMemoryDataAccessLayer.cs:72-88,764-823). Awaiting a completed task, including with ConfigureAwait(false), does not move execution to a worker thread. Fresh in-memory seed validation can therefore run on the calling dispatcher before the first true async yield.

The integration helper (MainWindowIntegrationTests.cs:7693-7707) creates a fresh UnknownRepositorySource and directly constructs the view model. SkipStartupWorkspace = true skips the startup workspace, not repository schema seeding. Many independent fixtures repeat this path.

2. Registry caching does not cache composed schemas

SchemaValidatingDataAccessLayer.cs:59-87 creates the request overlay/registry and iterates changes. For each applicable entity, ValidateChangeAsync constructs:

composedSchema = JsonSchema.FromText(
    this.BuildComposedSchemaText(resolvedSchemas, shouldCloseUnevaluatedProperties),
    new BuildOptions
    {
        SchemaRegistry = schemaRegistry,
        Dialect = WorkspacesSchemaDialect.AllowingUnknownKeywords,
    });

Construction is at :208-236, followed by synchronous composedSchema.Evaluate(data, new EvaluationOptions { ... }). BuildComposedSchemaText (:713-747) inlines applicable payloads under allOf, including inherited base patternProperties, and conditionally writes unevaluatedProperties: false.

SchemaAccessor.cs:56-95 already caches/invalidate its registry. Its per-request overlay (:387-433) makes request-local schema definitions visible. Neither avoids rebuilding identical composed schema text/objects per entity. Fixing only registry lookup leaves this confirmed repeated work intact.

Affected files

Paths are relative to the product repository. Evidence/context entries are not mandatory edit targets.

File Contribution / intended scope
Phantom.Workspaces\ViewModels\MainWindowViewModel.cs Constructor kickoff, InitializeAsync, startup lifetime/cancellation, and current disposal (:4914-4972).
Phantom.Workspaces\EntityBroker.cs Narrow repository offload boundary before caller-context broker construction/initialization.
Phantom.Workspaces\EntityRepository.cs Validated seed startup and cancellation/resource ownership review.
Phantom.Workspaces.Data.Core\SchemaValidatingDataAccessLayer.cs Per-request composed-schema reuse and cooperative cancellation around synchronous validation.
Phantom.Workspaces.Data.Core\SchemaAccessor.cs Existing registry invalidation and overlay semantics to preserve; not a missing-registry-cache diagnosis.
Phantom.Workspaces.Data.Core\RepositoryStartupDiagnostics.cs Existing ActivitySource stage tracer to extend with safe counts/durations.
Phantom.Workspaces.Data.Core\SchemaPopulator.cs Existing resource/load/update stages and trusted seed batch; preserve validation.
Phantom.Workspaces.Data.Core\ValidatedDataAccessLayerFactory.cs, MergeProcessingDataAccessLayer.cs, ReferentialIntegrityDataAccessLayer.cs Pipeline evidence; no blanket wrapper rewrite proposed.
Phantom.Workspaces.Data.Offline\InMemoryDataAccessLayer.cs, Phantom.Workspaces.Data.Core\JsonSchemas\entity.json Completed-task and pattern evidence; no mandatory store/schema edit.
Phantom.Workspaces.Tests\MainWindowIntegrationTests.cs, EntityRepositoryTests.cs, RepositoryStartupDiagnosticsTests.cs Dispatcher responsiveness, independent seed startup, diagnostic privacy/nesting coverage.
Phantom.Workspaces.Data.Core.Tests\SchemaValidatingDataAccessLayerTests.cs, SchemaPopulatorTests.cs Composition reuse, overlay isolation, cancellation, and existing seed-validation invariants.

Design / fix

A. Offload repository creation only; preserve UI ownership

In EntityBroker.CreateInitializedAsync, introduce a genuine worker boundary around repository creation, not the whole broker/UI pipeline. Illustrative shape:

var repository = await Task.Run(
    () => EntityRepository.CreateAsync(options, cancellationToken),
    cancellationToken);

// Keep the existing caller-context continuation for broker construction
// and UI-sensitive initialization.
var broker = new EntityBroker(repository);
await broker.InitializeAsync(cancellationToken);

options represents the existing initialization options, not a new API requirement. Review repository dependencies for background safety and preserve error/cleanup ownership before introducing this boundary. Do not wrap all of EntityBroker.CreateInitializedAsync in a view-model Task.Run, and do not suppress caller-context continuation at the broker construction boundary.

Give startup an explicit cancellation owner in the view model, pass its token to broker/repository initialization, cancel when the owner is disposed, observe outstanding startup failures, and release partially created repository/broker resources exactly once. Handle disposal racing with startup completion so a late-created resource is not leaked or attached to a disposed owner. Do not import the incident worktree's InitializeCoreAsync/aggregation design unchanged.

Tests may link their runner cancellation token through a suitable startup seam; production must not depend on xUnit or TestContext.

B. Request-scoped composed-schema cache

Within one UpdateAsync request, keep a fixed request registry/overlay and a dictionary of successfully built composed JsonSchema objects:

  1. Resolve the applicable schemas and generate their exact composed schema text, including ordered payload content, flattened references, and closure semantics (unevaluatedProperties).
  2. Use that exact text as the request-local cache key. On a miss, build using the fixed request registry and current dialect; on a hit, reuse only the schema representation.
  3. Continue evaluating each entity independently, creating its own evaluation options/results and preserving per-entity validation errors. Never cache validity outcomes.
  4. Discard the dictionary at request completion. A later request with an overriding schema, even under the same schema reference/ID, must not reuse the previous request's composition.

This avoids repeated parsing/building for identical compositions without inventing a global registry-generation scheme. It does not promise that text composition itself is free or eliminate every regex allocation.

Check cancellation before each entity, before composition/build work, and immediately before/after synchronous Evaluate. A token check cannot interrupt an evaluation already in progress; retain bounded regex timeout protection. Offloading protects dispatcher responsiveness but is not a hard wall-clock cancellation guarantee.

C. Extend existing diagnostics; measure the remaining hypothesis

RepositoryStartupDiagnostics.cs:5-11 already defines Phantom.Workspaces.RepositoryStartup. Remote startup already emits nested broker/repository/schema stages, including load-resources, concurrency-tag reads, and update. Do not introduce a replacement tracer on the premise that instrumentation is absent.

Extend existing instrumentation with bounded composition build/cache-hit/evaluation counts and durations for a fresh repository/request, sufficient to distinguish rebuilding from evaluation time. Preserve nested activity relationships and diagnostic privacy: no entity JSON, schema text, property values, credentials, or unbounded identifiers. Review existing privacy assertions when adding safe numeric metadata.

Measure repeated fresh in-memory initialization before attributing remaining latency to regex compilation, runtime/JIT, scheduling, or dependency behavior. Do not use regex ordinals as a counter.

Considered / background

  • Increase test timeouts: rejected as the primary fix; it masks dispatcher blocking/redundant work.
  • Add only a registry cache: insufficient; SchemaAccessor already caches it, while composed schemas are rebuilt.
  • Skip validation for TrustedEmbeddedSeed or bypass the validating DAL: rejected. Keep one validated seed pass, malformed-seed rejection, cancellation, and independent repositories.
  • Cross-request/cross-repository cache: deferred until measurements justify it and content/version identity, request-overlay isolation, bounds/eviction, invalidation, and thread-safety are designed. Do not share mutable evaluation state.
  • Offload the entire broker/UI startup: rejected because construction/continuations can own UI-sensitive state; use the narrow repository boundary.
  • External watchdog: complementary, separate infrastructure scope, not the product/schema root-cause fix. The incident's 240s outer VSTest watchdog did not stop this occurrence. Add xunit.runner.json with inProcess:true so hang dumps capture actual test stacks #582 explains why outer-runner dumps can miss the xUnit v3 child; Adopt Phantom.xUnit.ParallelProcess with assembly-default process parallelism #1581 concerns process isolation and is not a duplicate of this startup hotspot. A future watchdog should target the owned assembly-child/process tree, capture that child's evidence before terminating only the owned tree, and have dedicated non-cooperative-child coverage. It does not establish that a split acceptance test caused this incident.

Expected tests

These are proposed tests, not executed results. Use the existing test projects and naming style.

Test name Class What it verifies
MainWindowViewModel_RepositoryStartupIsBlocked_DispatcherRemainsResponsive MainWindowIntegrationTests A deterministic gated repository-startup seam holds work on a worker while view-model construction returns and a dispatcher heartbeat executes before releasing the gate; initialization still completes correctly afterward. Avoid real regex timing or sleep-based performance thresholds.
UpdateAsync_RepeatedCompositionInOneRequest_BuildsComposedSchemaOnce SchemaValidatingDataAccessLayerTests Multiple entities with identical exact compositions build once but each evaluates independently, including a valid/invalid pair; differing closure/composition content does not collide.
UpdateAsync_RequestSchemaOverride_DoesNotReusePreviousComposition SchemaValidatingDataAccessLayerTests A subsequent request changes schema content under the same reference/ID and receives current validation behavior; an in-request override remains isolated from other requests.
UpdateAsync_CancelledBetweenEntities_DoesNotValidateRemainingChanges SchemaValidatingDataAccessLayerTests A deterministic hook cancels between entities; remaining entities do not enter composition/evaluation or publish a partially validated batch. Assert cooperative boundaries, not interruption inside Evaluate.
CreateAsync_RepeatedFreshInMemoryInstances_PreservesIndependentValidatedSeeds EntityRepositoryTests Repeated fresh repositories retain independent stores and one trusted validated seed pass each; reuse never suppresses seeding or shares mutable state.

Also cover owner disposal/cancellation during gated startup and late completion: token propagation, no unobserved startup failures, and exactly-once cleanup of partial resources without a production xUnit dependency.

Preserve and extend existing regression coverage:

  • SchemaValidatingDataAccessLayerTests.cs:1169-1293: registry reuse, invalidation after schema changes, and request-local schema overrides.
  • SchemaPopulatorTests.cs:14-28,72-109,154-168: one trusted seed validation pass, malformed trusted-seed rejection without publication, and pre-cancelled startup without publication.
  • EntityRepositoryTests.cs:13-74: eager in-memory startup, independent concurrent seeds, and pre-cancelled startup.
  • Phantom.Workspaces.Tests\RepositoryStartupDiagnosticsTests.cs:10-32: existing nested stage timings and no payload disclosure; extend privacy/nesting assertions for any numeric measurements added.

Acceptance requires both dispatcher responsiveness and preserved validation/overlay/cancellation semantics. A future benchmark/profile is needed to quantify performance improvement and investigate residual regex timeouts; this issue update claims neither a measured speedup nor a complete explanation of the historical regex failure.

Activity

  1. added
    bug
    on Oct 22, 2026
  2. changed the title [-]Bug: broad test run stalls in UI-thread schema seeding while nested xUnit child escapes timeout[/-] [+]Bug: UI-thread schema initialization stalls broad tests and raises compiled-regex/test timeouts[/+] on Oct 22, 2026
  3. added
    diagnosed
    on Oct 22, 2026
  4. JoshuaRowePhantom commented on Oct 22, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Design

    Working only in assigned incident candidate, not importing remote-feature lifetime code. Confirmed source chain: MainWindowViewModel already owns startup cancellation and observes/cleans late completion; EntityBroker currently awaits repository creation directly, allowing completed in-memory awaits to perform seeding on the dispatcher. SchemaValidatingDataAccessLayer reconstructs exact same composed schema per entity.

    Test-first plan: deterministic actual-seed gate and dispatcher heartbeat; cancellation/disposal while gated and late failure observation; per-request composition build/evaluation activities and numeric counts to measure reuse rather than infer regex counts. Use a narrow Task.Run boundary around repository creation only, retain caller-context broker construction and existing cleanup. Cache successful schema representations by exact composed text within one UpdateAsync only; evaluate every entity, preserve overlay/closure semantics, check cancellation between entities and around Evaluate. No seed bypass, global mutable cache, timeouts, sleeps, wraparound weakening or regex-protection removal.

    Will measure baseline build/evaluation counts before enabling reuse and record actual focused wraparound results. Historical simple-regex timeout itself remains unproven unless new measurement establishes its cause; repeated construction and dispatcher blocking must be independently demonstrated. Planned files: EntityBroker.cs, SchemaValidatingDataAccessLayer.cs, focused Data.Core and App startup/diagnostic tests. Existing repository/view-model lifetime code will change only if regressions establish a gap.

  5. JoshuaRowePhantom commented on Oct 22, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Root cause measurement / progress

    Fresh deterministic regressions in the assigned incident candidate failed before the fixes: actual repository-schema-population ran on the Avalonia dispatcher (2/2 startup regressions red), repeated compositions built twice (both valid/invalid pairs red), and cancellation after one evaluation still entered the second entity.

    Instrumented controlled uncached replay of three fresh validated seed requests measured 179 builds / 179 evaluations / 0 hits each, with validation durations 3822/3125/2647 ms (build 413/313/179 ms; evaluation 2980/2575/2275 ms). After request-local reuse, all three retain 179 independent evaluations with 17 builds / 162 hits each, validation 687/589/499 ms (build 14/17/11 ms; evaluation 523/464/391 ms). These are fresh local measurements, not an assertion about a pre-access-arc baseline or a universal performance bound. Evidence: candidate .scratch/1653-fresh-seed-uncached-measurement.log and 1653-fresh-seed-cached-measurement.txt, raw TRXs.

    The worker boundary preserves caller-context broker construction. Actual-seed gated tests now prove dispatcher heartbeat before release, owner cancellation, late-created repository exactly-once disposal, and identical observed startup failures for concurrent/repeated shutdown. Existing disposal ownership required no redesign. Focused schema/populator classes now pass 93/93; App startup/repository/diagnostics/disposal and unchanged forward/backward cycle tests pass 20/20. Solution build: zero warnings/errors. An initial full-class failure in new diagnostics tests exposed cross-test listener capture; trace-scoped listeners corrected that test isolation bug, not product validation assertions.

    The historical simple compiled-regex timeout itself has not recurred or been independently attributed to a runtime defect; the confirmed dispatcher blocking and redundant work are fixed without changing regex protection, seed validation, or wraparound assertions. Stock targeted stability is next; broad final acceptance remains coordinator-owned.

  6. JoshuaRowePhantom commented on Oct 22, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Implementation notes

    Commits: d358c81

    Deviations from proposed design

    The assigned incident candidate already owns startup cancellation, observes initialization failures, and cleans late-created repositories. Kept that existing lifetime design; added deterministic actual-seed/late-resource regressions instead of replacing it with remote-feature lifecycle code. Added one repository-disposal activity to verify exactly-once late resource cleanup. The narrow worker boundary is only repository creation; broker construction/initialization still continue on the captured caller context.

    Request-local cache keys are exact composed schema text (including ordered payload/ref/closure content) and use that request's fixed registry. Each entity is still evaluated separately with fresh options/results; subsequent requests cannot reuse stale schema representations. Cancellation checks surround composition/evaluation and run between entities/before publication; they do not claim interruption inside synchronous Evaluate or remove the regex timeout.

    Scope changes

    Added numeric build/hit/evaluation counts and nested build/evaluation timings to the existing diagnostics source, with payload privacy tests. Fresh measurements prove redundant work reduction: each of three validated seed requests retains all 179 evaluations, while builds drop 179 to 17 with 162 hits. Final measured validation durations were 615/547/426 ms; uncached controlled replay 3822/3125/2647 ms. These are local samples, not universal bounds or a pre-access-arc baseline. The historical simple compiled-regex timeout's exact runtime trigger remains unproven; unchanged forward/backward cycle tests pass without timeout changes or weakened assertions.

    The unrelated stock prerequisite cache contract defect is now #1654; it was not modified here and the stability gate was not waived.

    Files changed

    • Phantom.Workspaces/EntityBroker.cs
    • Phantom.Workspaces/EntityRepository.cs
    • Phantom.Workspaces.Data.Core/SchemaValidatingDataAccessLayer.cs
    • Phantom.Workspaces.Data.Core.Tests/SchemaValidatingDataAccessLayerTests.cs
    • Phantom.Workspaces.Tests/EntityRepositoryTests.cs
    • Phantom.Workspaces.Tests/MainWindowStartupTests.cs
    • Phantom.Workspaces.Tests/RepositoryStartupDiagnosticsTests.cs

    Validation

    Test-first red: dispatcher 0/2; instrumented schema 2/5; controlled three-seed uncached replay fails with 179 builds/evaluations each. Final exact diff: existing scripts/build.ps1 succeeds with 0 warnings/errors; Data.Core SchemaValidatingDataAccessLayerTests + SchemaPopulatorTests 93/93, App MainWindowStartupTests + EntityRepositoryTests + RepositoryStartupDiagnosticsTests + CredentialAccessExecutorRegistryTests + unchanged CycleTabForwardCommand/CycleTabBackwardCommand methods + existing exactly-once-disposal method 20/20, zero failures/skips.

    Stock run-tests-stability.ps1 -Runs 10 -NoBuild attempted; zero complete passes. Run 1 passed Data.Core 93/93 then entered unrelated Install.Tests immutable prerequisite native republish. Confirmed #1654 reader14/writer15 mismatch (runtime.node); archived logs and stopped only the owned process tree rather than spinning through the previous multi-hour loop. No broad final acceptance was run; coordinator owns that and independent verification.

    Evidence: candidate .scratch/1653-build-exact-final.log, 1653-schema-exact-final.log, 1653-app-exact-final.log, 1653-schema-instrumented-red.log, 1653-startup-red.log, 1653-fresh-seed-uncached-measurement.log, 1653-fresh-seed-cached-measurement.log (renamed from .txt). Skills .scratch/unblock1652-1653-evidence contains seven raw red/green TRXs with hashes/counts and final seed metrics; unblock1652-1653-stability-blocker.json records exact source/manifest evidence. Durable progress: .scratch/unblock1652-1653-progress.json. Existing dumps/1653 text evidence retained. No push, closure, features update, skills edit, or live restart.

  7. JoshuaRowePhantom commented on Oct 22, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Verification result

    Status: Verified locally — fresh independent inspection and targeted execution; not broad/stability acceptance.
    HEAD: d358c8140d469abea7f2ab8d01aa6cd09bbbf8c1.
    Bounded commits checked: 11e8feeb3b15bf67611458d79bf96db2700cadc7..HEAD: f88a241a, d358c814.

    Outstanding gaps

    None within this issue's diagnosed structural scope.

    • Traced constructor -> lifetime token -> broker -> worker-only repository creation -> validated seed pipeline. Task.Run encloses only repository creation; broker construction and initialization retain caller-context continuation. Existing owner cancellation/failure observation/cleanup was independently inspected rather than assumed absent.
    • Actual seed-stage gated tests prove dispatcher heartbeat before gate release, UI-context broker construction, cancellation during startup, late repository exactly-once disposal, and consistent observed failing-startup exceptions on concurrent/repeated shutdown.
    • Each request owns its schema dictionary and fixed overlay registry. Keys are the exact composed text, including ordered schema payload/reference flattening and closure text. Only successful schema builds are reused; each entity gets a fresh evaluation/options/result. Validation failures and cancellation prevent batch publication. Checks surround composition/evaluation and precede subsequent entities/publication.
    • Passing coverage includes valid/invalid shared compositions, differing compositions, same-ID schema replacement and request isolation, cache invalidation, cancellation, one trusted validated seed pass, malformed-seed rejection, independent fresh stores, diagnostics nesting/privacy and unchanged forward/backward tab wraparound.
    • Reviewed the bounded diff for disabled/quarantined tests, unresolved TODOs, time-based primary synchronization, fixed dispatcher pumping and newly introduced UI/lock task blocking: none found. The new synchronous gate waits only on the repository worker and is documented. The pre-existing completed-task .Result fallback is unchanged and guarded by IsCompletedSuccessfully, not a newly introduced wait.

    Fresh commands and results

    Executed from the assigned worktree, using only the existing scripts:

    .\scripts\build.ps1
    .\scripts\run-tests.ps1 -Mode fast -NoBuild -TestProject .\Phantom.Workspaces.Data.Core.Tests\Phantom.Workspaces.Data.Core.Tests.csproj -TestNames SchemaValidatingDataAccessLayerTests,SchemaPopulatorTests
    .\scripts\run-tests.ps1 -Mode fast -NoBuild -TestProject .\Phantom.Workspaces.Tests\Phantom.Workspaces.Tests.csproj -TestNames MainWindowStartupTests,EntityRepositoryTests,RepositoryStartupDiagnosticsTests,CredentialAccessExecutorRegistryTests,CycleTabForwardCommand,CycleTabBackwardCommand,DisposeAsync_DisposesOwnedAccessServicesExactlyOnce
    .\scripts\run-tests.ps1 -Mode fast -NoBuild -TestProject .\Phantom.Workspaces.Tests\Phantom.Workspaces.Tests.csproj -TestNames MainWindowViewModel_DisposeAsync_IsExactlyOnceAndPreventsLateInitialization
    • Solution build: 0 warnings / 0 errors.
    • Data.Core batch: 93 passed / 0 failed / 0 skipped.
    • App batch: 19 passed / 0 failed / 0 skipped.
    • Existing exactly-once lifecycle regression: 1 passed / 0 failed / 0 skipped.
    • 113 total fresh passing tests, with raw TRX and actual runner logs preserved. The last selector of the 19-test batch matches no method; the fourth command explicitly runs the correctly named existing regression instead. No zero-match selector is counted as coverage.

    Fresh three-seed metrics independently observed in TRX: each request 17 builds / 162 cache hits / 179 evaluations. Validation durations 545.374 / 433.715 / 490.442 ms; build totals 10.615 / 12.345 / 16.531 ms; evaluation totals 409.202 / 332.587 / 372.116 ms. These are local observations, not a latency guarantee. This verifier did not modify code to replay an uncached baseline and does not independently claim a measured before/after speedup or explain the historical simple-regex timeout.

    Checkout deviation, gate ownership and evidence limits

    Explicitly authorized deviation: no checkout-source.ps1 because of known shared MXC worktree metadata corruption. Read-only initial/final checks confirmed clean parent/submodules, exact requested parent HEAD, and gitlink/checked-out HEAD equality: MXC 29702c3a408462a4e6be0f265328693a0d2169eb; Dock 8c8d11f948e10b86f375cf3e4e186e039450c8c9.

    Broad and stability suites were deliberately not run: coordinator owns them. The earlier reported #1654 prerequisite-cache blocker was neither reproduced nor repaired by this targeted project-scoped verification; no gate is waived. Add needs-slow-tests conservatively for the repository-layer change so checkin retains the full gate.

    Evidence: skills .scratch\unblock1652-1653-independent-verification contains fresh build/logs, three raw TRX files, source diff and complete saved issue/comments. Prior results were archived before the runner overwrote its log. No source mutation, commits, push, feature update, issue closure or live-app interaction.

  8. added
    verified-locally
    needs-slow-tests
    on Oct 22, 2026
  9. JoshuaRowePhantom commented on Oct 27, 2026

    @JoshuaRowePhantom
    OwnerAuthor

    Closing as completed per the explicit request to close verified fixes integrated into LOCAL features at 22bca70779858b479a68e3b059bc835a945d7087.

    Fix commit(s): d358c8140d469abea7f2ab8d01aa6cd09bbbf8c1.
    Offloaded repository creation and request-local schema composition reuse; independent structural verification and now-complete current whole/full/stability gates.

    Evidence: #1653 (comment). At this unchanged local tip: solution build 0 warnings/errors, whole fast 9030/9030, whole full 9263/9263, and 10 consecutive stock combined stability runs, 2788/2788 each; zero failures/skips. Final combined receipt.

    Publication boundary: hosted features remains d2a1a3b0752609321853f409d6fb1654fe17e7ff. Fixes are not pushed/published; no remote integration, release, or external live-provider authentication acceptance is claimed.

  10. added a commit that references this issue on Oct 27, 2026
    d358c81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdiagnosedneeds-slow-testsverified-locally

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions