Skip to content

#333 child: Make the first Docker answer independent of Compose and cold-start work #336

Description

@Joncallim

Parent: #333. Baseline from the performance child should exist before final acceptance.

Problem

DockerMap already keeps optional host providers off the Docker publication path, but two remaining choices still make the first useful answer slower than necessary:

  1. collect_docker_snapshot_candidate() waits for bounded Compose filesystem projection inside the same five-second Docker snapshot budget after Docker inventory has already completed.
  2. daemon startup awaits refresh_cache() before binding the HTTP listener.
  3. Docker container, network and volume list reads are independent but currently performed sequentially.

Goal

Publish the earliest truthful Docker model as soon as Docker evidence is available. Treat Compose correlation as later enrichment tied to the exact Docker observation it was computed against.

Architecture direction

Target shape:

listener ready
    ↓
initial state = collecting / no authoritative Docker model
    ↓
Docker inventory (bounded)
    ↓
publish Docker snapshot/runtime/findings that require Docker-only evidence
    ↓
Compose projection worker (bounded + single-flight, keyed to Docker observation revision)
    ↓
if still coherent: publish Compose binding + Compose-dependent findings
if Docker changed: retain/suppress as stale according to an explicit contract

The exact internal types may differ, but Compose filesystem work must no longer be able to delay a completed Docker observation.

Scope

  • Bind/start the daemon HTTP server before the first collection completes.
  • Define a safe explicit initializing/unavailable publication state; do not serve mock as if initialization were failure when mock fallback is disabled.
  • Run independent Docker inventory reads concurrently under one overall observation deadline if the gateway/client semantics permit it.
  • Split Compose runtime correlation from the Docker critical path.
  • Preserve the existing Compose projection single-flight guarantee and filesystem bounds/symlink rules.
  • Bind Compose results to a stable Docker observation identity, not to wall-clock timing.
  • Recompute/publish Compose-dependent Findings only when the enrichment matches current Docker evidence.

Acceptance criteria

  • Listener availability does not depend on the initial five-second observation budget.
  • A slow Compose filesystem cannot delay first authoritative Docker publication.
  • A timed-out Compose projection leaves Docker data usable and explicitly lacks current Compose correlation.
  • A Compose result that completes after Docker changes cannot be attached to the newer observation.
  • No overlapping Compose filesystem tasks after timeout/unwind.
  • Container/network/volume Docker reads are concurrent, or the PR records controlled evidence showing why they must remain sequential.
  • Docker gateway authority/route allowlist is unchanged.
  • Source transitions (Docker ↔ unavailable/mock where permitted) remain fail closed.
  • Epic: Build deterministic Findings and drift analysis from provenance-backed evidence #69 Docker-only rules keep exactly their truth semantics.
  • Compose mount-drift rule appears only after coherent Compose binding exists.
  • Controlled benchmark demonstrates improvement or at minimum eliminates the Compose/cold-start coupling without regression elsewhere.
  • Live-Docker and production-image tests pass.

Non-goals

  • No new Compose semantics.
  • No project-identity UI work.
  • No persistent cache across daemon restart.
  • No broad filesystem watcher.
  • No change to provider scheduling cadence.

Risk: MEDIUM · read_only_product_behavior: true · security_sensitive: true (publication/source coherence) · data_migration: false · routing_mode: stable

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions