{
  "schema": "d25-msdl-baseline/v1",
  "captured_at": "2026-09-21",
  "stage": "D25.01",
  "stage_name": "Contracts & Baseline",
  "status": "baseline_captured",
  "scope": "One-PC inventory of the existing browser, sitemap, HTTP/archive and asset-related workers before MSDL implementation.",
  "services": {
    "TT.01.02": {
      "role": "freeze browser capture",
      "client_files": ["tt-01-ui.js", "tt01-storage.js"],
      "bridge": "http://127.0.0.1:8765/freeze",
      "live_health": {
        "ok": true,
        "service": "local-browser-service",
        "version": "0.3.0"
      },
      "request_contract": {
        "profileId": "edge-hermes",
        "navigationTimeoutMs": 3000,
        "captureWindowMs": 1250,
        "snapshotMs": [250, 500, 750, 1000],
        "previousHtml_supported": true
      },
      "storage": {
        "database": "mathcast-tt01",
        "version": 2,
        "stores": ["html-documents", "captures", "active-captures"]
      },
      "ownership": "Existing browser UI and bridge; not yet an MSDL worker adapter."
    },
    "SM.02.04": {
      "role": "deep sitemap and page discovery",
      "client_files": ["sm-02-ui.js", "sm02-storage.js"],
      "bridge": "http://127.0.0.1:8765/browse",
      "live_health": {
        "ok": true,
        "service": "local-browser-service",
        "version": "0.3.0"
      },
      "limits": {
        "maxSitemaps": 1000,
        "maxPages": 300,
        "maxDepth": 3,
        "maxLinks": 10000,
        "maxRedirectChain": 10
      },
      "storage": {
        "database": "mathcast-sm02",
        "version": 2,
        "stores": ["deep-maps", "jobs"]
      },
      "ownership": "Existing discovery UI and bridge; discovery output still needs an MSDL Job/Result adapter."
    },
    "soft_mode_service_8766": {
      "role": "browser-profile service used by the current manual/soft-mode flow",
      "base_url": "http://127.0.0.1:8766",
      "live_health": {
        "ok": true,
        "service": "22_exp_place_ti_figma_local_service",
        "version": "not exposed by /health"
      },
      "profile_chain": [
        {"id": "moscow", "browser": "yandex", "role": "primary"},
        {"id": "librewolf", "browser": "librewolf", "role": "reserve"},
        {"id": "opera", "browser": "opera", "role": "reserve"}
      ],
      "soft_mode": {
        "enabled": true,
        "concurrency": 1,
        "min_gap_seconds": 45,
        "jitter_seconds": [3, 8],
        "cache_ttl_seconds": 3600,
        "profile_cooldown_seconds": 900,
        "profile_limit": {"max_requests": 6, "window_seconds": 600},
        "global_limit": {"max_requests": 25, "window_seconds": 3600}
      },
      "msdl_interpretation": "Baseline only. The 45-second source gap must be owned by one authoritative Global Domain Gate in D25.06; local/profile limits may only add delay."
    },
    "D22_VSEI_bridge": {
      "role": "remote Playwright/Chromium capture candidate",
      "source_file": "tools/d22_vsei_browser_bridge.py",
      "configured_endpoint": "http://127.0.0.1:8789",
      "configured_limits": {
        "max_html_bytes": 20971520,
        "command_timeout_seconds": 75,
        "navigation_timeout_ms": 10000,
        "robots_required": true
      },
      "live_status": "not reachable during D25.01 capture",
      "msdl_interpretation": "Do not route production jobs here until health/capability advertisement is implemented."
    },
    "save_internet_core": {
      "role": "standard-library HTTPS archive core and article/asset parser",
      "source_files": [
        "services/save_internet/core.py",
        "services/save_internet/test_core.py",
        "services/save_internet/ARCHITECTURE.md"
      ],
      "verified": [
        "10 unit tests pass",
        "HTTPS-only and SSRF boundary",
        "robots.txt enforcement",
        "article HTML plus relevant images/PDF manifest",
        "atomic JSON job state",
        "bounded retry waits 30/60/120 seconds"
      ],
      "defaults": {
        "min_delay_seconds": 45,
        "max_delay_seconds": 120,
        "one_job_at_a_time": true
      },
      "storage_contract": {
        "archive_root": "/mnt/data10tb/mathchast-private/save-internet",
        "folders": ["raw-html", "readable-html", "text", "assets", "manifests"],
        "authoritative_control_db": "not present in this package; current state is atomic JSON"
      },
      "api_status": "The api.py integration packet imports modules absent from this workspace; only core.py was treated as verified baseline."
    }
  },
  "browser_profiles_8765": {
    "service_version": "0.3.0",
    "endpoint": "http://127.0.0.1:8765/profiles",
    "available_profiles": [
      "edge-hermes",
      "chrome-hermes",
      "brave-hermes",
      "vivaldi-hermes",
      "opera-hermes",
      "yandex-hermes",
      "firefox-hermes"
    ],
    "profile_root": "C:\\AI\\browser_profiles",
    "note": "Availability is reported by the running service from executable discovery; profile health and ban state are not yet MSDL control-plane state."
  },
  "storage_and_reporting": {
    "existing_browser_storage": "IndexedDB in TT.01 and SM.02",
    "archive_artifacts": "Existing archive folders on H: are external to this repository",
    "msdl_control_db": "not implemented",
    "msdl_live_report": "not implemented; current reports are page/checkpoint artifacts, not event-driven control-plane output"
  },
  "implementation_gaps": [
    "No MSDL dispatcher/control-plane process is present in the repository.",
    "No authoritative local-SSD SQLite control database exists yet.",
    "No dynamic queue with atomic claim, leases and fencing exists yet.",
    "No single Global Domain Gate is wired across HTTP, browser and asset paths.",
    "No MSDL capability advertisement/adapter contract is wired to the existing endpoints.",
    "8765 exposes profiles but does not expose MSDL health, leases, rate policy or task ownership.",
    "8766 exposes local soft-mode limits; they must not be multiplied per worker after MSDL starts."
  ],
  "verification": {
    "save_internet_unit_tests": "PASS: 10 tests",
    "javascript_syntax_tt01": "PASS",
    "javascript_syntax_sm02": "PASS",
    "python_compile_core_and_d22": "PASS",
    "live_health_8765": "PASS",
    "live_profiles_8765": "PASS: 7 available profiles reported",
    "live_health_8766": "PASS",
    "live_health_8789": "NOT REACHABLE"
  },
  "next_stage": {
    "code": "D25.02",
    "name": "Control Plane & State Model",
    "entry_condition": "This baseline JSON and its plan checkpoint are published and remain unchanged while D25.02 is designed.",
    "stop_before": "Do not start parallel workers or site crawling from MSDL before control DB/state model is implemented."
  }
}
