Skip to content

Validate Terra Runtime And Local Model Integration#62

Open
PSchmiedmayer wants to merge 3 commits into
mainfrom
testing/terra
Open

Validate Terra Runtime And Local Model Integration#62
PSchmiedmayer wants to merge 3 commits into
mainfrom
testing/terra

Conversation

@PSchmiedmayer

Copy link
Copy Markdown
Contributor

♻️ Current Situation & Problem

Progresses #42 and #51.

The published 0.2.0-beta.2 Terra image preserved Jupyter, project persistence, the authenticated proxy route, and the shared CLI, browser, and notebook contracts. A synthetic NVIDIA T4 validation also exposed three release-blocking gaps: the 16 GB model recommendation referenced the wrong repository revision, vLLM child processes did not inherit the required Transformers 5 compatibility boundary, and the isolated Heartwood kernel inherited incompatible Terra IPython startup extensions. The immutable beta image required test-time repair before it could complete a local-model OpenHands action, so it is not recorded as fully live-validated.

This pull request incorporates the live findings without introducing model weights, credentials, workspace data, or controlled data into the repository.

⚙️ Release Notes

  • Replace the invalid 16 GB GPU recommendation with the immutable Qwen2.5 7B Instruct AWQ revision that completed the synthetic OpenHands tool-use workflow on an NVIDIA T4.
  • Apply the reviewed Transformers 5 compatibility boundary to vLLM child processes, exercise tokenizer caching and Qwen architecture inspection during image verification, and discard ambient Python module paths.
  • Use a 32,768-token local-model default with explicit resource and compatibility guidance, and resolve loaded Skill scripts from the location returned by OpenHands.
  • Verify recommended Hugging Face revisions in pull requests and release creation while treating bounded provider outages as non-blocking only before release.
  • Report early model-runtime exits accurately and isolate the Terra Heartwood kernel from platform IPython startup files.
  • Expand the Terra workflow with environment configuration order, resource starting points, interface responsibilities, authenticated proxy guidance, local-model performance evidence, troubleshooting, persistence, and safe compute shutdown.

📚 Documentation

The Terra guide now follows one goal-oriented path from environment creation through synthetic validation and compute shutdown. The tutorial notebook, local-model guide, troubleshooting guide, platform support matrix, container guide, and architecture and testing references are aligned with the same behavior and evidence boundary.

The support matrix records that 0.2.0-beta.2 required test-time intervention and that a corrected immutable artifact still needs the complete live workflow before a full Terra validation claim is made.

✅ Testing

  • uv run pytest: 611 tests passed with 90.37% coverage.
  • Ruff formatting and linting passed.
  • Mypy passed for 104 source files.
  • Web formatting, linting, license review, 62 tests with 95.29% coverage, and the production build passed.
  • Strict Zensical documentation build and the stable/preview publication smoke test passed.
  • Both recommended Hugging Face repositories resolved to their exact immutable commits.
  • The complete synthetic workflow passed on Terra through the CLI, notebook, and REST-backed browser gateway after applying the corrections represented by this pull request. It included one grouped approval, one rejection, exact aggregate results, replay, and scrubbed audit export.
  • Local Docker image construction could not run unattended because Docker Desktop required a macOS privileged-helper confirmation. Pull-request CI builds both NVIDIA targets through the gpu-ci-validate stage and is the authoritative container build for this change.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copilot AI review requested due to automatic review settings July 17, 2026 02:15
@github-project-automation github-project-automation Bot moved this to Backlog in Heartwood Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@PSchmiedmayer, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5233fa2c-5fbb-453d-8591-1206af8ce086

📥 Commits

Reviewing files that changed from the base of the PR and between f3d7ccd and 87bac62.

📒 Files selected for processing (4)
  • deploy/verify_model_sources.py
  • docs/platform-support.md
  • packages/compliance/tests/test_documentation_assets.py
  • packages/compliance/tests/test_model_source_verification.py
📝 Walkthrough

Walkthrough

The PR adds immutable Hugging Face model-source verification to validation and release workflows, replaces the recommended AWQ model entry, and raises the default local context window to 32,768 tokens. GPU images now install startup compatibility hooks for Transformers and vLLM runtime checks. Launcher diagnostics distinguish early runtime exits from timeouts. Terra documentation, notebook instructions, Jupyter kernel isolation, and OpenHands Skill path guidance are also updated.

Sequence Diagram(s)

sequenceDiagram
  participant ValidateWorkflow
  participant ModelSourceVerifier
  participant SnapshotCatalog
  participant HuggingFaceAPI
  ValidateWorkflow->>ModelSourceVerifier: verify recommended sources
  ModelSourceVerifier->>SnapshotCatalog: load repository and revision pins
  ModelSourceVerifier->>HuggingFaceAPI: query immutable revision endpoint
  HuggingFaceAPI-->>ModelSourceVerifier: return id and sha
  ModelSourceVerifier-->>ValidateWorkflow: complete or report verification status
Loading

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main Terra runtime and local model validation changes.
Description check ✅ Passed The description matches the changeset and summarizes the Terra validation, model, and documentation updates.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR incorporates findings from Terra live validation to harden local-model (vLLM) startup and the Terra Jupyter experience, while improving governance checks that recommended Hugging Face model pins remain immutable and resolvable.

Changes:

  • Update the recommended 16 GB GPU model snapshot (Qwen2.5 7B Instruct AWQ) and standardize the default local context window to 32,768 tokens across planning/CLI/gateway.
  • Ensure the reviewed Transformers 5 compatibility boundary is applied in all vLLM processes (including child processes) and expand GPU runtime verification checks.
  • Add CI/release-time verification of recommended Hugging Face model revisions; document and test the Terra workflow updates (proxy, runtime behavior, safe shutdown, and troubleshooting).

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/gateway/tests/test_openhands_sdk.py Asserts updated OpenHands system suffix guidance for Skill-path resolution.
packages/gateway/tests/test_model_snapshots.py Updates expected recommended Terra snapshot ID/repo.
packages/gateway/tests/test_local_models.py Aligns local-model plan expectations with 32,768 context and new model IDs.
packages/gateway/tests/test_gateway_contract.py Updates expected first recommended model ID in gateway contract tests.
packages/gateway/src/heartwood/gateway/_openhands_sdk.py Adjusts AgentContext system suffix to constrain Skill path resolution.
packages/gateway/src/heartwood/gateway/_local_model_contract.py Raises default local context window to 32,768.
packages/compliance/tests/test_release_governance.py Ensures workflows invoke the model-source verification script.
packages/compliance/tests/test_model_source_verification.py Adds unit tests for the model-source verification script and outage handling.
packages/compliance/tests/test_container_assets.py Extends container-asset expectations (IPYTHONDIR isolation; vLLM runtime assets).
packages/cli/tests/test_launch.py Adds coverage for early vLLM exit messaging; updates context window expectations.
packages/cli/src/heartwood/cli/_launch.py Reports early runtime exit distinctly from readiness timeout.
images/platform/scripts/terra_jupyter_contract_smoke.sh Verifies the Heartwood kernel sets IPYTHONDIR for isolation.
images/platform/Dockerfile Adds ipykernel --env IPYTHONDIR and installs vLLM sitecustomize.
images/gpu/sitecustomize.py Applies Transformers compatibility hook on interpreter startup.
images/gpu/heartwood-vllm Sets PYTHONPATH to the isolated runtime bin for child-process inheritance.
images/gpu/heartwood_vllm.py Expands Transformers/vLLM verification, tokenizer cache subprocess check, and Qwen registry inspection.
images/generic/local-runtime/snapshots.toml Renames/updates the recommended 16 GB GPU snapshot to Qwen2.5 7B Instruct AWQ.
images/generic/Dockerfile Installs vLLM sitecustomize into the GPU runtime environment.
docs/troubleshooting.md Updates guidance for early runtime exit vs timeout.
docs/terra-jupyter-demo.md Expands Terra runbook (config order, interface roles, safe shutdown, updated model IDs).
docs/terra-jupyter-demo.ipynb Aligns notebook prompt/task wording with the updated runbook command.
docs/platform-support.md Refines Terra validation claims and clarifies what was/wasn’t validated in 0.2.0-beta.2.
docs/getting-started-offline.md Updates context-window defaults/claims when model metadata is missing.
docs/container-images.md Updates 16 GB NVIDIA model download guidance to the new model ID.
design/07-testing-eval.md Adds runtime-integration details about GPU-image verification and external-source preflight.
design/03-architecture.md Updates architecture text to reflect the 32,768 default when model metadata is missing.
deploy/verify_model_sources.py Adds a script to verify recommended Hugging Face repos resolve at pinned commits.
deploy/carina/bootstrap.sh Installs vLLM sitecustomize into the Carina vLLM bundle.
.github/workflows/validate.yml Adds a CI job to verify recommended model sources (allowing bounded outages).
.github/workflows/create-release.yml Adds strict model-source verification to the release workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deploy/verify_model_sources.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/platform-support.md`:
- Line 45: Revise the documentation paragraph to describe only the currently
validated Terra deployment behavior and limitations. Remove the
development-history details about prior image failures, test-only intervention,
replacing recommendations, and vLLM compatibility fixes; retain the requirement
for real workspace validation and the stated Heartwood authorization boundaries.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 28d6a7d0-f197-49a3-af1c-c4ff83a0b84a

📥 Commits

Reviewing files that changed from the base of the PR and between 06c4399 and f3d7ccd.

📒 Files selected for processing (30)
  • .github/workflows/create-release.yml
  • .github/workflows/validate.yml
  • deploy/carina/bootstrap.sh
  • deploy/verify_model_sources.py
  • design/03-architecture.md
  • design/07-testing-eval.md
  • docs/container-images.md
  • docs/getting-started-offline.md
  • docs/platform-support.md
  • docs/terra-jupyter-demo.ipynb
  • docs/terra-jupyter-demo.md
  • docs/troubleshooting.md
  • images/generic/Dockerfile
  • images/generic/local-runtime/snapshots.toml
  • images/gpu/heartwood-vllm
  • images/gpu/heartwood_vllm.py
  • images/gpu/sitecustomize.py
  • images/platform/Dockerfile
  • images/platform/scripts/terra_jupyter_contract_smoke.sh
  • packages/cli/src/heartwood/cli/_launch.py
  • packages/cli/tests/test_launch.py
  • packages/compliance/tests/test_container_assets.py
  • packages/compliance/tests/test_model_source_verification.py
  • packages/compliance/tests/test_release_governance.py
  • packages/gateway/src/heartwood/gateway/_local_model_contract.py
  • packages/gateway/src/heartwood/gateway/_openhands_sdk.py
  • packages/gateway/tests/test_gateway_contract.py
  • packages/gateway/tests/test_local_models.py
  • packages/gateway/tests/test_model_snapshots.py
  • packages/gateway/tests/test_openhands_sdk.py

Comment thread docs/platform-support.md Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants