Skip to content

[1945 by GPT-5.6 Sol] Verify configured runtime packages in current agent images - #1948

Merged
integry merged 1 commit into
mainfrom
1945/gpt-5.6-sol-verify-configured-runtime-20260825-2001-o7r
Aug 25, 2026
Merged

integry merged 1 commit into
mainfrom
1945/gpt-5.6-sol-verify-configured-runtime-20260825-2001-o7r

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #1945

Branch: 1945/gpt-5.6-sol-verify-configured-runtime-20260825-2001-o7r
Commits: ✅ Changes committed (47df314)


AI Processing Completed

Execution Details:

Summary:
Implemented GitHub issue #1945.

Key changes:

  • Added propr runtime packages verify with human and --json output.
  • Added authenticated POST /api/agent-runtime/packages/verify.
  • Implemented read-only verification of:
    • Desired/active package drift and catalog validity
    • Base-image availability and lineage
    • Derived-image existence and resolution
    • Runtime/installation labels and non-root user
    • Installed packages and pinned versions
  • Package checks run in short-lived, network-disabled containers.
  • Unhealthy verification exits non-zero with runtime packages apply --wait remediation.
  • Empty profiles return a successful explicit disabled result.
  • Updated CLI and operations documentation.
  • Added core, API, permission, and CLI coverage for requested scenarios.

Validation completed:

  • All workspace builds passed.
  • TypeScript checks passed.
  • ESLint passed.
  • 34 focused tests passed.
  • CLI help verified.

Transient SQLite files created by tests were removed; no user data was affected.

Detailed Logs:

  • Conversation: 96 messages
  • Session: 01a03a85-0dd2-7920-8efc-6faf4ffcf2c8

Log files stored at:

  • conversation: /tmp/claude-logs/issue-1945-2026-08-25T20-17-28-347Z-conversation.json
  • output: /tmp/claude-logs/issue-1945-2026-08-25T20-17-28-347Z-output.txt
Latest Conversation Messages

This PR was created automatically by ProPR after processing issue #1945.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…current agen

Implemented by ProPR AI using gpt-5.6-sol model.

Implementation completed successfully.
@integry

integry commented Aug 25, 2026

Copy link
Copy Markdown
Owner

/ultrafix goal=8 max=10

@propr-dev propr-dev Bot added the ultrafix label Aug 25, 2026
@propr-dev

propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — claude:claude-sonnet-5

⚠️ Review output was invalid and could not be displayed safely.


🤖 Review Details

  • Model: Claude Sonnet 5
  • Time: 3m 53s
  • Tokens: 91,766 (68,130 in / 23,636 out)
  • Cost: $0.41

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — claude:claude-sonnet-5

Overall Evaluation

This PR implements the read-only propr runtime packages verify workflow end-to-end: a new core verification module (agentRuntimePackageVerification.ts), a route (POST /api/agent-runtime/packages/verify) gated by the existing instance.manage_runtime permission, CLI plumbing (verifyAgentRuntimePackages, printRuntimePackageVerification, exit-code helper), and documentation updates across propr-cli.md, maintenance.md, and the CLI README. The implementation closely mirrors the existing production semantics it verifies against (deterministic image tagging via getAgentRuntimeImageTag, the non-building resolution logic of resolveAgentRuntimeImage, and the runtime/installation labels and non-root final-user contract enforced at build time), and it is exercised by a large, well-targeted test suite covering route authorization, disabled/healthy/unhealthy states, stale lineage, missing images/packages, version pin mismatches, label/user mismatches, Docker failures/timeouts, and multi-image verification. All current-head checks pass.

I traced the changed control/data paths (route → core verification → Docker inspection/exec → CLI rendering) and did not find a correctness or safety regression introduced by this diff. Package names are passed as quoted positional shell parameters rather than interpolated into script text, so there is no injection vector despite invalid/malformed desired specs being fed through when syntax validation fails. The "disabled" short-circuit, drift detection, and per-image resolution logic are all internally consistent with the pre-existing build/resolve contracts referenced in the surrounding context.

✅ Correct read-only image resolution replication — verifyImage in packages/core/src/agents/runtime/agentRuntimePackageVerification.ts reproduces the exact non-building decision from resolveAgentRuntimeImage (activePackages presence + baseImageId match + confirmed local image existence via successful inspection), keeping the verification output faithful to what execution actually resolves.

✅ Safe package-name handling in the container check — Package names are passed as Docker CLI argv elements (not shell-interpolated) and referenced via quoted "$package_name" inside the sh -c script (agentRuntimePackageVerification.ts), avoiding shell injection even for malformed configured package specs.

✅ Comprehensive test coverage for a nontrivial feature — test/agentRuntimePackageVerification.test.ts and packages/api/test/agentRuntimeRoutes.test.ts cover disabled/healthy/unhealthy states, stale lineage, missing images/packages, pinned-version mismatches, label/user mismatches, Docker failures/timeouts, and permission boundaries.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Duplicated non-building resolution logic risks drift

verifyImage in packages/core/src/agents/runtime/agentRuntimePackageVerification.ts re-implements the exact decision logic of resolveAgentRuntimeImage (lines ~406 of agentRuntimePackages.ts) rather than calling a shared helper, with only a code comment noting the duplication. This is currently correct (verified by inspection and tests), but if resolveAgentRuntimeImage's decision logic changes in the future, this verification path could silently diverge and misreport what execution actually resolves. Extracting the shared predicate into a small exported helper used by both would remove that maintenance risk; not required for this PR to be correct today.

S2: 🟢 Overlapping issue codes for the same root cause

When a base image is replaced (stale_base_image_lineage), the recomputed expectedImage will also differ from record.image, so derived_image_tag_mismatch fires simultaneously for the same underlying cause (agentRuntimePackageVerification.ts, verifyImage). This isn't incorrect, but it could read as two separate problems to an operator. Consider suppressing the tag-mismatch issue when lineage is already flagged as stale, to reduce noise in propr runtime packages verify output.

S3: 🟢 Per-image Docker call chain approaches the route timeout on slow hosts

Each image's verification does up to three sequential Docker calls (base inspect, derived inspect, package-check run) at a default 30s command timeout each (DEFAULT_VERIFY_COMMAND_TIMEOUT_MS in agentRuntimePackageVerification.ts), while the route wraps the whole call in a 2-minute default timeout (withRuntimePackageRequestTimeout in agentRuntimeRoutes.ts). Images verify concurrently via Promise.all, but on a loaded host with slow Docker I/O, a single image's worst case (~90s) leaves little margin before the route-level timeout fires. Making the per-command timeout configurable or documenting the interaction would help operators tune large multi-image installations.

S4: 🟢 CLI-side result types are hand-duplicated from core

packages/cli/src/api/agentRuntime.ts redefines AgentRuntimeImageVerification, AgentRuntimePackageCheck, AgentRuntimeVerificationIssue, etc., independently of the core types exported from packages/core/src/agents/runtime/agentRuntimePackageVerification.ts. This mirrors the pre-existing pattern for AgentRuntimePackageState and is a reasonable choice to keep the published propr-cli package decoupled from @propr/core, but the two definitions can silently drift out of sync over time (e.g., a new issue code or field added to core without updating the CLI copy). A type-check test or codegen step that keeps them in sync would be a good low-cost follow-up.

Score

No actionable findings, all current-head checks pass, and the changed behavior is well-tested and consistent with the invariants of the surrounding runtime-package system.

Score: 9/10


🤖 Review Details

  • Model: Claude Sonnet 5
  • Time: 3m 2s
  • Tokens: 89,753 (71,224 in / 18,529 out)
  • Cost: $0.36

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Aug 25, 2026
@integry
integry merged commit dbace75 into main Aug 25, 2026
30 checks passed
@integry
integry deleted the 1945/gpt-5.6-sol-verify-configured-runtime-20260825-2001-o7r branch September 1, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify configured runtime packages in current agent images

1 participant