← Back to Pull requests

Stream inference qualification logs directly into GitHub Actions #210

Closed
unknown closed this pull request without merging on Nov 27, 2026 22:38 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 03:59 UTC
Author

Original problem

Inference qualification's Actions step polled native job status without forwarding build/test output. The results comment sent contributors to an external lab record to inspect failures. Contributors should be able to diagnose qualification from GitHub alone.

Diagnostics

At base 6531cce921dd00d9aaeedec15d6ab8314be00184, scripts/inference-dispatch.py::wait read job/formation status but no log pages, while scripts/inference-report.sh generated an external Lab record link for each row.

Verified the existing native log API's cursor, sequence, completion and gap fields against a real run. Read-only replay of existing failed job job_8ja3wgqab02ayhw, attempt run_k03ky59fwdq06fb, forwarded all 44 sequential chunks; a second read kept cursor 44 without duplicate output or capture diagnostics. This did not launch or alter a native job.

Fix

  • Forward incremental native stdout/stderr during existing status polling, covering standalone jobs, both split members and every attempt.

  • Drain late terminal output within a final polling window and save per-attempt JSONL copies under the existing Actions evidence directory. Capture gaps/errors remain explicit diagnostics rather than changing the native qualification verdict.

  • Disable Actions command processing around native text with fresh controller-only resume tokens. Prefix rendered lines and escape terminal controls; retain original chunks in artifacts.

  • Remove the external lab-record column and guidance. Results link directly to configuration Actions logs and the existing saved-evidence artifact.

  • Document the logging contract and add offline regressions for pagination, deduplication, split attempts, late tails, failures, invalid identities/cursors and command injection.
  • No new dependencies, workflow permissions, dispatch credentials, model settings or qualification gates. The existing always-upload artifact step already includes the new evidence files. No workflow YAML or composite actions changed.

    Validation

    Base SHA above plus this PR's working diff:

  • SKIPPY_PYTHON=/Users/michaelneale/.buzz/.scratch/skippy-actions-logs-venv/bin/python just ci-automation — passed: 156 Python tests across 19 suites, 73 Node workflow/controller tests, and shell inference-report contracts. Includes 9 new native-log tests. Python 3.12, using the repository's existing ci/inference-publish-requirements.txt in an isolated environment.

  • bash -n scripts/inference-report.sh scripts/tests/inference-report.sh — passed.

  • git diff --check — passed.

  • Read-only real API replay described above — passed, 44 chunks, no duplicates, no capture diagnostics.
  • The first full-suite attempt stopped at the existing publication test because the default interpreter lacked pyarrow; installing the existing declared reporting requirements in an isolated environment resolved it, and the complete suite then passed.

    Initial validation used offline fixtures and real API replay of an existing failed standalone run, not a new live controller run. Later native qualification and the pre-merge controller rehearsal are recorded below. The credentialed inference workflow intentionally executes protected-main code: ordinary PR inference runs alone cannot validate candidate controller changes. At the initial revision, transport requests retained existing API timeout/retry limits. The review follow-up below bounds log-read timeouts and retry admission; hard runner loss can still truncate diagnostics.

    Follow-up: repair the red native builds

    Qualification run 45543747700 failed at the original head 9488370 in Qwen3.6 standalone and split. Retrieved both failed workers' native logs: attempts run_28nfr87p7jydc3v (standalone) and the worker job job_wyenhrm4are1sag both failed linking skippy-correctness with:

    mold: error: undefined symbol: common_peg_arena::add_parser(std::variant<..., common_peg_token_parser, common_peg_token_not_parser, ...>)
    >>> referenced by kimi-k2.cpp
    

    The split leader was cancelled after its worker failed. The existing build-cache key omitted the native source, so different llama.cpp pins shared Cargo and compiler caches. The logs establish an incompatible cached native object; they do not distinguish which cache supplied it.

    Cherry-picked #209 (10cbdfd) with attribution: include the llama_cpp tree in build identity/Cargo target selection and isolate the compiler-cache directory by that tree. Added an offline regression exercising both cache-directory selections. This adds no dependencies and does not weaken qualification. Old cache entries are not deleted; per-native-tree compiler caches retain the existing 20G limit each.

    At earlier head 4198580e4f6e7af8be9cb7a40372dcb9c32a59e2:

  • SKIPPY_PYTHON=/Users/michaelneale/.buzz/.scratch/skippy-210-py312/bin/python just ci-automation — passed in full, including the cache-isolation regression, all 73 Node tests, and shell reporting contracts.

  • git diff --check — passed.

  • Native qualification run 45548317249 — all seven configurations passed at 4198580, including both previously failing Qwen3.6 jobs. Hosted automation, Same-repository CI and aggregate PR checks also passed. Review is still required.
  • The failed Actions run checked out controller SHA 6531cce921dd00d9aaeedec15d6ab8314be00184, not this PR's controller. Log streaming therefore still needs a post-merge Actions verification; changing the candidate cannot replace the protected-main controller. Main remains untouched.

    Pre-merge streaming evidence

    At c1bd4168e4b1a3cf73b98e548ad4ccab4950df1f, the existing hosted Automation checks job now runs scripts/tests/inference_streaming.py through just ci-automation. No workflow changes, new dependencies or secrets.

    The test starts the candidate's actual inference-dispatch.py::wait and NativeLogs in a normally buffered subprocess. Synthetic API responses supply standalone and split leader/worker log pages. The producer cannot advance to terminal status until the parent has received each live log line; completion-only dumping times out and fails. The parent forwards those exact lines, including the production Actions-command guards, into Actions stdout. It also checks the terminal lines are not duplicated and retained JSONL contents match.

  • Full SKIPPY_PYTHON=/Users/michaelneale/.buzz/.scratch/skippy-210-proof-py312/bin/python just ci-automation — passed at c1bd416, Python 3.12; Python suites, 73 Node tests and shell reporting contracts all passed.

  • Negative control in a disposable copy: replacing the log forwarder's explicit flush=True with flush=False makes the new test fail waiting for live output; it does not print the success marker.

  • git diff --check — passed.

  • A setup attempt with the machine's default Python 3.14 failed building the existing pinned pyarrow dependency; the existing setup recipe succeeded with Python 3.12. No dependency changes.

  • Hosted rehearsal passed: Automation checks — exact Actions output, completed successfully 2026-11-25 06:01:25 UTC. Checkout log confirms candidate c1bd4168e4b1a3cf73b98e548ad4ccab4950df1f, not protected main. Downloaded job output contains all six standalone/leader/worker live and complete lines at 06:01:17 UTC, followed by STREAMING PROOF PASSED: standalone, leader and worker output received before completion; saved logs match. Full hosted automation and Same-repository CI passed.
  • Observed Actions output (synthetic fixture, not live model output):

    [stream-proof-standalone/standalone/run_standalone] fixture: live
    [stream-proof-standalone/standalone/run_standalone] fixture: complete
    [stream-proof-split/leader/run_leader] fixture: live
    [stream-proof-split/worker/run_worker] fixture: live
    [stream-proof-split/leader/run_leader] fixture: complete
    [stream-proof-split/worker/run_worker] fixture: complete
    STREAMING PROOF PASSED: standalone, leader and worker output received before completion; saved logs match.
    

    Scope: this rehearsal tests pre-completion forwarding by candidate controller code into Actions, without native credentials. Synthetic API pages are not evidence of live lab integration or Actions artifact upload; a real post-merge qualification run still needs those checks. The earlier 44-chunk API replay covers the real read interface separately.

    Main refresh and conflict resolution

    At af3e79483cf947b66ee21ef5e626b778f802602c, merged main 24e4090 into this PR branch (not into main). Preserved main's approved-fork admission documentation and native-cache regression alongside the streaming tests.

    The historical #209 cache workaround described above is no longer part of the diff: main now binds Cargo and sccache to the broader native source recipe (058b34e, with cold-build directory fix e8aaad6). scripts/inference-build.py and both existing cache-test files exactly match main; this avoids redundant per-tree compiler caches and preserves main's cache contract.

    Validation rerun on exact commit af3e794:

  • SKIPPY_PYTHON=/Users/michaelneale/.buzz/.scratch/skippy-210-refresh-venv/bin/python just ci-automation — passed in full (Python 3.12): all 21 Python suites, 91 Node tests, and shell report contracts. Includes STREAMING PROOF PASSED for standalone and both split roles before completion.

  • git diff --check — passed.

  • git diff --exit-code origin/main -- scripts/inference-build.py scripts/tests/inference_build.py scripts/tests/inference_contracts.py — passed against 24e4090.
  • Fresh hosted and native CI passed on af3e794. Automation checks output confirms checkout of the exact full head SHA, all six standalone/leader/worker fixture lines, and STREAMING PROOF PASSED at 2026-11-25 22:10:27 UTC. Native qualification passed all seven configurations plus plan and summary. The PR remains open and requires review.

    The hosted proof still uses synthetic API pages; no live lab streaming or artifact-upload qualification claimed. Those remain post-merge checks. No new workflow changes or dependencies in the diff against current main.

    Review follow-up: bounded, best-effort log capture

    At 12a28ba5d20ab887b16be6ecfbaba2ac1ef8e426, addressed jaredwy's three review threads:

  • Catch ordinary unexpected capture exceptions without catching cancellation (KeyboardInterrupt/SystemExit). Diagnostic-file write failures fall back to Actions stderr rather than replacing the native verdict.

  • Give each attempt drain and worker lookup a five-second budget inside a thirty-second capture budget, rather than allowing live log paging to consume the full qualification deadline. Pass remaining time into API socket timeouts and stop retries that cannot start within the budget. Cursors survive partial capture; a busy/broken attempt does not prevent the next attempt from being read.

  • Keep final-tail polling bounded, name incomplete attempts and retain dead-worker/read diagnostics. A capture failure does not fabricate a native job failure: native job/formation status remains authoritative. Late output can still arrive during the final window.
  • These are cooperative paging/retry budgets and socket timeouts, not a hard process deadline around authentication, trickling HTTP bodies or a blocked output filesystem. No new dependencies, workflow changes or permissions.

    Validation at exact 12a28ba:

  • SKIPPY_PYTHON=/Users/michaelneale/.buzz/.scratch/skippy210-review-venv/bin/python just ci-automation — passed in full on Python 3.12: 21 Python suites, 91 Node tests, shell report contracts, and the completion-gated standalone/leader/worker streaming proof.

  • 10 additional regressions: busy-stream yielding/cursor continuation, unexpected run errors, dead-worker final capture, preserved success/failure verdicts, unwritable diagnostics, cancellation, socket timeout wiring, expired read deadline, retry cutoff, and reduced retry timeout. All pass.

  • Negative control: ran the updated log/read tests against copies of the previous af3e794 implementation. Both fail (log tests: four failures/four errors; read tests: three errors).

  • git diff --check — passed. An initial full-suite attempt lacked pyarrow; setup with default Python 3.14 could not build its existing pinned version. Using the repo's pinned Python 3.12 and unchanged declared requirements resolved setup, and the complete suite passed.
  • Fresh hosted/native results for this head are pending. Earlier green results above apply only to their named SHAs. Live lab forwarding and retained-artifact verification still require the protected controller after merge. No merge invoked; review threads are left for the reviewer to resolve.

    Current head after main refresh

    f8a3ffecc4883b4d3660320c373174ee0335ac72 merges main 0682c2d and resolves the overlapping status-read recovery change from #230. Log reads now reuse main's existing status_deadline API with a short budget; scripts/lib/jy_qualification.py exactly matches main. The earlier duplicate deadline parameter is gone. All three controller status reads retain main's longer recovery policy; log paging and its tests retain the fixes above.

  • Full SKIPPY_PYTHON=/Users/michaelneale/.buzz/.scratch/skippy210-review-venv/bin/python just ci-automation passed again at exact f8a3ffe: 22 Python suites, 96 Node tests, shell contracts, and STREAMING PROOF PASSED.

  • git diff --check and git diff --exit-code origin/main -- scripts/lib/jy_qualification.py passed against main 0682c2d.

  • Hosted CI passed on exact f8a3ffe: Automation checks output confirms checkout of the full candidate SHA, all six standalone/leader/worker fixture lines, and STREAMING PROOF PASSED at 2026-11-26 05:25:15 UTC. Full hosted automation and Same-repository CI passed. Native qualification passed on this exact head: all seven configurations, plan, summary and report succeeded (nightly publication intentionally skipped). This uses the protected-main controller and does not establish live forwarding by the candidate controller. Review requested-changes remains for reassessment; live lab streaming/artifact verification remains post-merge. GitHub reports this head mergeable; the conflict alert for 12a28ba is superseded.
  • Acceptance criteria

  • I ran the relevant local checks, or explained why they do not apply.

  • I agree to license my contributions under the Apache License, Version 2.0.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: jaredwy Review duration: 3998m
    All Vouch review confidence checks passed
    Residual risk 0.25 = Change Risk (0.57) × (1 − Review Confidence (0.57)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.57 · 650 lines diff across 8 files
    0.57
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    56%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #210"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 56.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 57% (MEDIUM) · Higher = larger blast radius
    57%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 56.8% · Lower = rushed or shallow review
    56.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 24.7% · Safe to merge
    24.7%