Skip to content

Run llama upgrade preparation on JY with Goose and cold merge bases - #169

Merged
i386 merged 2 commits into
mainfrom
fix/llama-upgrade-preparation
Nov 22, 2026
Merged

i386 merged 2 commits into
mainfrom
fix/llama-upgrade-preparation

Conversation

@i386

@i386 i386 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Original problem

The first llama upgrade run after #162 failed during candidate preparation, before graph tests or CI. Preparation and repair ran on a hosted CPU container, while the installed Goose agent and its provider configuration belong to the native JY runner. The repair command was empty, so no repair attempt ran.

A separate cold-repository defect prevented Git from reaching ordinary merge conflicts: later queue entries reference file versions produced by earlier patches on the current pin. A fresh upstream clone lacks those intermediate blobs when replay starts directly at a newer revision.

This fixes the workflow. It does not perform the requested llama upgrade or change the upstream pin or native patch queues. Tracks #12.

Diagnostics

Failed candidate job, source d3607ae972439905715de576e93f9ddd05775f5c, selected upstream 225a5345bbb0e0c70859af5441ba922beb666fcf:

error: sha1 information is lacking or useless (src/llama-context.cpp).
error: could not build fake ancestor
Patch failed at 0003 feat(llama): integrate live stage planning and execution

I reproduced this locally using the supplied native repository's upstream objects in a fresh object database that excluded patch-result blobs. Replaying the protected current pin 8954f194837d2ec4d5f67f20c81b84abe63883ba and its queue supplied the missing objects. Retrying the selected revision then reached genuine source conflicts in llama-context.cpp, llama-kv-cache.cpp and llama-model.cpp. Those conflicts are left for the workflow's bounded repair; this PR does not resolve them manually.

Fix

  • Run both candidate preparation and repair directly on group jy-rnr_vfnz8k5p4yrh334, labels [self-hosted, jy-linux-docker, Linux, X64], restoring the original native upgrade runner contract.
  • Remove the hosted CPU container and its image-identity dependency from those jobs so they use the runner's installed Goose, configuration and LLVM/Clang 22.
  • Default to noninteractive Goose with the developer extension. Preserve the repository-variable command override. Preflight the selected executable and native tools before preparation; the check does not open an agent session.
  • Seed the protected current queue's intermediate Git blobs before replaying a changed upstream pin. Use protected base patches even when a candidate has already been repaired. Skip seeding for unchanged-pin rehearsals and preserve the selected target pin.
  • Preserve existing compiler cache setup for both JY preparation jobs and report failures explicitly when a local invocation has no repair command configured.

Usage

After this workflow change lands, dispatch and source selection remain unchanged:

gh workflow run llama-upgrade.yml --ref main \
  -f upstream_sha=225a5345bbb0e0c70859af5441ba922beb666fcf

JY jobs default to the following command, with the diagnostic prompt appended as a single argument:

goose run --no-session --with-builtin developer --text "$PROMPT"

GOOSE_MODE=auto enables noninteractive repair. Goose uses the runner's existing provider/model configuration; no provider credentials or model choice are added here. SKIPPY_UPGRADE_REPAIR_COMMAND remains an optional JSON argv override.

The new preflight is available as:

just automation-run upgrade runner-check

Illustrative successful output:

Using repair executable: /path/to/goose
1.54.0

Architecture

Only the two preparation jobs move to native JY. The existing full CI implementation and protected publisher retain their current runners. Repairs remain bounded, preserve the selected upstream revision and allowed change paths, and require fresh full CI before publication. No publication credentials are passed to Goose.

flowchart TD
    Dispatch["Protected-main llama upgrade dispatch"] --> Tools{"JY Goose and native tools available?"}
    Tools -->|No| Stop["Retain diagnostics; do not publish"]
    Tools -->|Yes| Candidate["Native JY candidate job<br/>Seed protected current queue merge bases<br/>Replay selected revision and regenerate"]
    Candidate -->|Preparation failure| Goose["One bounded Goose repair<br/>Native JY runner configuration"]
    Goose -->|Recheck preparation| Prepared["Freeze exact candidate bundle"]
    Candidate -->|Preparation passed| Prepared
    Prepared --> CI["Existing full CI<br/>Current shared runner policy"]
    CI -->|Passed| Publish["Protected publisher<br/>Verify selected candidate and open upgrade PR"]
    CI -->|Failed| Repair["Native JY repair job<br/>Goose repair and fresh candidate"]
    Repair --> ReCI["Fresh full CI"]
    ReCI -->|Passed| Publish
    Goose -->|Still failing| Stop
    Repair -->|Preparation still failing| Stop
    ReCI -->|Failed| Stop
Loading

Compatibility

No changes to llama source selection, patch contents/order, native ABI, Rust API, wire protocol or recipe hash framing. Existing full CI, four-model inference qualification and informational architecture coverage gaps remain unchanged. The native JY runner must provide Goose, provider authentication and LLVM/Clang development inputs; no replacement Goose installation is downloaded by the job.

Validation

Passed locally:

SKIPPY_PYTHON=python3.12 just ci-automation-setup "$PWD/target/upgrade-repro/automation-venv"
SKIPPY_PYTHON="$PWD/target/upgrade-repro/automation-venv/bin/python" just ci-automation
actionlint .github/workflows/llama-upgrade.yml
bash -n scripts/automation-run.sh
git diff --check

79 Python automation tests, 55 workflow/controller tests and the shell reporting contracts passed. Main was merged to include its new ci-automation-setup recipe after the first protected CI run failed before testing because that recipe was absent from the older branch base. The cold-Git regression first reproduces could not build fake ancestor, then verifies baseline seeding permits a genuine three-way merge and leaves the target pin unchanged. Runner tests catch missing tools and prevent either preparation job returning to Depot or a hosted CPU container.

The preflight also ran locally against installed Goose 1.54.0 and LLVM/Clang 22, using the workflow's default command. Goose version/help inspection was performed; no LLM repair session was started locally.

just llama-check also exited successfully against the unchanged pinned source on macOS:

export PATH="/Users/jdumay/.rustup/toolchains/1.99.1-aarch64-apple-darwin/bin:$PATH"
export LLAMA_STAGE_BACKEND=cpu LLAMA_STAGE_LINK_MODE=static
export LLAMA_STAGE_BUILD_DIR="$PWD/target/upgrade-repro/pinned-native"
export LLAMA_BUILD_DIR="$LLAMA_STAGE_BUILD_DIR"
export SKIPPY_REWRITER_LLVM_PREFIX=/opt/homebrew/opt/llvm@22
export CMAKE_BUILD_PARALLEL_LEVEL=4 CTEST_PARALLEL_LEVEL=1
just llama-check

The recipe selects Metal on macOS, overriding the initial CPU backend environment. The native build, rewriter compilation/regeneration, graph coverage validation (95 registered / 97 total cases), bindings and API-document checks completed. Of 318 native CTest entries, 317 passed and one was skipped: skippy_resident_checkpoint_gpu_long requires SKIPPY_NATIVE_TEST_REAL_MODEL, which was unset. This skipped proof does not establish real-model GPU qualification. Native CTest took 1797.27 seconds. Native/vendor compiler warnings remain; none were suppressed. Local logs are retained under target/upgrade-repro/ and target/skippy-stage-rewriter-check/.

No production model weights were downloaded or used. The selected newer revision remains blocked by real source conflicts after the cold-Git defect is removed. Native JY Goose execution and a complete changed-pin workflow pilot remain unverified until this workflow change lands.

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.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Walkthrough

Candidate preparation and repair now run on the native JY Linux runner. The workflow checks runner tools before preparation. Preparation seeds patch preimages before regeneration when the checkout pin differs from the selected base pin.

Changes: Native runner and preflight

Layer / File(s) Summary
Runner configuration and preflight
.github/workflows/llama-upgrade.yml, .github/actionlint.yaml, scripts/automation-run.sh, scripts/upgrade-runner-check.py, scripts/lib/upgrade_repair.py
The candidate and repair jobs use the JY Linux Docker runner, set LLVM 22 and Goose environment values, and run a native-tool preflight. The preflight validates the repair executable, required tools, LLVM paths, and Goose version when applicable.
Runner checks and operating guidance
.github/scripts/llama-upgrade.test.cjs, scripts/tests/upgrade_contracts.py, .agents/skills/manage-ci/SKILL.md, ci/README.md
Tests check runner settings and preflight behavior. The skill and README describe the native runner, Goose configuration, and repair command options.

Patch preimage seeding

Layer / File(s) Summary
Seed preimages during preparation
scripts/lib/upgrade_preimages.py, scripts/upgrade-source.py, scripts/tests/automation_contracts.py, scripts/tests/upgrade_contracts.py, ci/README.md
Preparation seeds the selected base pin and patch queue before regeneration when the checkout pin differs. Tests cover replay with seeded preimages and confirm that matching pins require no seeding. The README documents the replay behavior and unchanged-pin exception.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant UpgradeWorkflow
  participant RunnerCheck
  participant UpgradeSource
  participant PreimageSeeder
  participant LlamaPrepare
  UpgradeWorkflow->>RunnerCheck: check native tools and repair executable
  UpgradeWorkflow->>UpgradeSource: run candidate preparation
  UpgradeSource->>PreimageSeeder: seed preimages when the checkout pin differs
  PreimageSeeder->>LlamaPrepare: prepare with the base pin and patch queue
Loading

Possibly related issues

  • Issue 12: The PR changes the candidate preparation and bounded repair path, including the cold-Git preparation behavior. The issue also covers changed-pin pilots and exact-source publication, which this PR does not add.
  • Issue 16: The PR changes candidate preparation, repair, and Git seeding in the upgrade workflow. It does not add the nightly schedule or the second certification pass.

Possibly related PRs

  • Mesh-LLM/skippy#136: Both PRs change runner assignments in the llama-upgrade workflow, including different stated runner outcomes for the publisher job.

Suggested reviewers: michaelneale

Merge Risk: Minimal · up to 79492

This change moves llama-upgrade candidate preparation and repair to the native JY runner, adds a tool preflight, and seeds patch preimages so upstream replay can reach real merge conflicts. No concrete defect was found. The native runner pilot has not been run, so check that the runner group is registered and accessible when the workflow is first dispatched.

Pre-merge checks: Passed 2

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main changes in the PR: llama upgrade preparation moves to the native JY runner with Goose, and cold merge bases are seeded from the protected patch queue. The raw summary and …
Full details: Title check

Explanation

The title names the two main changes in the PR: llama upgrade preparation moves to the native JY runner with Goose, and cold merge bases are seeded from the protected patch queue. The raw summary and objectives both confirm these as the primary changes across the workflow, scripts, tests, and docs.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@i386
i386 merged commit 1b26d74 into main Nov 22, 2026
33 of 35 checks passed
@i386
i386 deleted the fix/llama-upgrade-preparation branch November 22, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant