Repository navigation
[DRAFT RDTE] Acquire WineBot writer lease before entrypoint mutations; share FD into API - #184
Conversation
Carry one verified kernel OFD from root/user shell into API without unlock/relock gap; reject root/FD config changes and unadmitted /tmp fallback; exercise real inherited child vs competing writer and SIGKILL. Source-bounded Linux single-instance workcell; no distributed CAS claim.
The checkout stores docker/entrypoint.sh, but the test Dockerfile copies it to /entrypoint.sh and does not materialize /docker/entrypoint.sh. Verify the same source ordering under both layouts; retain the assertions.
Exact public CI #44981998178: 302 pass, 5 fail when synthetic unit image runs as root without a winebot account. A freshly root-owned lock does not require alternate UID lookup; for a legacy chowned lock retain strict account resolution and fail-closed checks. No lock gate bypass.
2026-11-22 — early-entrypoint first-failure diagnosis and exact correctionSource-authoritative early admission PR #184 first head Corrective exact source: |
2026-11-22 R035 — exact source, first native test result and ongoing gates
Independent next-release finding: draft #185 branches from preadmission canonical #181 and investigates |
…fely After real layered Wine11 HIL first health gate failed with only a reached-infrastructure marker, emit fixed non-sensitive checkpoints for session-directory, Xvfb, and WM bootstrap and priority fail-closed root. Do not expose raw service logs, loosen health or allow unadmitted /tmp.
2026-11-22 — source-exact real layered HIL failure, bounded diagnostic recoveryReal native composite failure on exact Diagnostic-only corrective head: commit Parallel durable model #185 exact |
2026-11-22 — additional cross-layer bootstrap boundary (source review, no runtime claim)The original #183 API-only process lock was corrected to a pre-entrypoint runtime lock in #184, but three-layer Compose has a preceding state-init phase: |
Real Wine11 layered HIL #44982906871 passed only infra begin, never session directories or API health. Replace unbounded /dev/urandom shell pipeline with short secure stdlib generator and add fixed path-free checkpoints around identity, volatile pointer and mkdir. Fail closed on entropy, unadmitted root or bounded mkdir failure; no /tmp fallback.
… change First exact real failure was infrastructure health_initial. Later source startup diagnostics and CSPRNG fixes did not trigger native HIL because workflow filters omitted those paths. Enroll writer-admission, API, infra, setup, diagnostic and synthetic admission test changes so future source commits cannot pass only model/lint while guest health is stale.
2026-11-22 — real Wine11 first-failure narrowing and missing native CI path corrected
|
Purpose and source custody
Correct the critical source-bound startup ordering defect in API-only #183: the shell entrypoint writes instance state, config, initializes Wine/desktop, may start recorder/trace/API token before uvicorn lifespan gets its process lock. This candidate acquires one single Linux kernel
flockopen-file description (OFD) before any00-setup-user.sh, instance-state, infrastructure, Wine, trace, recorder or API side effects, and passes the same FD across root/usergosuand the API process without release/reacquire.One atomic 7-path source update to qualified #183
04aa0061a008563d04dda5b4755b8bbe42d9a5c8, new exact head71d5e93cf048c309c9620cfb08b782ac883caf87. Compare: one ahead, zero behind, exactly seven intended paths, mandatory shell/test runner executable modes preserved.Implementation
api/core/writer_admission.py: new explicit--exec-entrypointcommand securely acquires a nonblocking exclusive directory-relativeO_NOFOLLOWlock, duplicates FD high (>=200), marks it inheritable, andexecves hard-coded/entrypoint.sh.--validate-inheritedvalidates exact root, regular single-link lock inode/device against FD, mode and kernel OFD lock, rejects missing/forged/mismatched FD. API lifespan reuses the inherited lock withoutLOCK_UN, preventing an unlock gap; standalone API retains existing independent admission. Root may accept an existing lock chowned to the winebot UID by legacy entrypoint setup, otherwise owner/permissions fail closed.docker/entrypoint.sh: first acquisition occurs before root setup. Shell validates FD immediately and after trusted configuration load; refuses a config-modified session root, marker or FD. No reentrant acquisition or untrusted bypass.scripts/init/10-setup-infra.sh: when admitted, failure to create session dirs no longer silently switches to unadmitted/tmp/winebot-sessions; aborts with classified status.tests/test_early_writer_admission.pyand mandatoryscripts/ci/test.sh: require mock exec on same OFD, real independent Python process inheriting FD across exec/SIGKILL, explicit competing-writer denial, mismatch/spoof rejection and source-level ordering/fallback checks.formal/SESSION_WRITER_FENCING.mddocuments design and non-claims.Qualification/exit
Run exact-head public $0 GHA full lint/unit+frozen v1 conformance+smoke, existing four TLC blue models+three red expected counterexamples, isolation/provenance/security/disposable guards; investigate any first failure and requalify after a minimal corrective commit. Then real two complete entrypoints, root->gosu->child API transfer, Wine11 layered/legacy mount and SIGKILL stages on disposable cloud hosts before owner promotion. Do not treat a unit/model PASS as native/system end-to-end proof.
Boundaries
An admitted single cooperative process family may include entrypoint, one uvicorn API, and Wine subprocesses. High FD may survive with a child and therefore safely delay takeover after parent death; this must be tested, not interpreted as support for untrusted same-UID actors. POSIX
flockis not cross-host NFS/distributed fencing, monotonic durable owner epoch/CAS, cross-file commit, orphan-recorder effect retraction, or native WinInspect v0.5 HWND qualification. Existing WineBot #166/WinInspect-private #468/Agent Dispatch #561 native blocker remains. Preserve DRAFT / NOT_READY_FOR_HARDWARE_TEST, no private actions spend, paid cloud, user hardware, private source projection, branch force, merge or release.