Skip to content

Promote develop to main: Force the Containment Signal in test_install's In-Process Registration Checks - #2466

Merged
ptr727 merged 1 commit into
mainfrom
develop
Oct 7, 2026
Merged

ptr727 merged 1 commit into
mainfrom
develop

Conversation

@ptr727

@ptr727 ptr727 commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Summary

Promotes #2465 to main. On a host without a systemd user manager, every Windows and macOS host among them, 11 TestRegistration cases in the agent-safety install suite failed. Each case installs through a subprocess that forces the containment signal on. The in-process registration_problems() check that follows read the host's real capability instead, and judged the forced prefix as stale. TestRegistration now sets the same signal for each case. Only the test changes, and the installer is unchanged.

On Linux, forcing the in-process signal off reproduced exactly the 11 failures, and with the fix the whole suite passes (137 tests) with the signal forced off and on the host's real signal. The native Windows run is the maintainer's, and its result goes on #2465.

Closes #2462

🤖 Generated with Claude Code

…n Checks (#2465)

## Summary

On a host without a systemd user manager, every Windows and macOS host
among them, 11 `TestRegistration` cases in
`host-setup/agent-safety/claude/test_install.py` failed (#2462).

- Each case installs through `run()`, which forces
`AGENT_SAFETY_CONTAINMENT_OVERRIDE=1` on the installer subprocess, so
the install registers the containment prefix.
- The case then calls `install.registration_problems()` in-process, with
no override set. That call judged containment against the host's real
capability and reported the forced prefix as stale.
- `TestRegistration.setUp` now patches the same override into
`os.environ` for each case, so the in-process check judges containment
the same way the install did. The patch is undone in each case's
cleanup.

## Verification

- Reproduced on Linux by exporting `AGENT_SAFETY_CONTAINMENT_OVERRIDE=0`
to the test process, which makes the in-process judgment match a host
that cannot contain. Before the fix, `TestRegistration` failed exactly
the 11 cases #2462 lists. After it, all 26 pass with the outer signal at
`0`, at `1`, and unset.
- The whole `test_install.py` suite passes, all 137 tests, both with the
outer signal at `0` and on this host's real signal.
- ruff and the prose gate are clean, and the local strict review raised
no finding.
- The native Windows run is still to come, and the maintainer runs it.

Fixes #2462

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Test setup now applies the safety-containment configuration
consistently and cleans up environment changes after each test. This
helps keep test runs isolated and repeatable without changing the app’s
user-facing behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Claude Opus 5.5 <[email protected]>
Copilot AI lite review requested due to automatic review settings October 7, 2026 03:14
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Repository: ptr727/ProjectTemplate/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 900542de-14ce-4a5a-80df-194ec351b1f7
  • Autopilot · 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

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

@ptr727

ptr727 commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit is not prompted here, because its one included review per hour went to #2465, which it reviewed at head 551e9930fef1303e65ab2a517ef1d56aa2a97637 with no actionable comments. This promotion carries exactly that content, and two facts show it. Anyone can re-run both:

  • git rev-parse 551e9930fef1303e65ab2a517ef1d56aa2a97637^{tree} and git rev-parse 4d9963793b38d8eed9472868b0e752bfac2ba5f7^{tree} both print 9d616d7debbb1e84bb3ad41f7b2281603afd9441, so the squash commit's tree is the reviewed head's tree.
  • git diff 551e9930fef1303e65ab2a517ef1d56aa2a97637^ 551e9930fef1303e65ab2a517ef1d56aa2a97637 | sha256sum and git diff origin/main origin/develop | sha256sum both begin a6a988c3367727e7, so this promotion's diff is the reviewed diff.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The reviewed test-only change has no unresolved blocking issues.

Review effort: Lite
Findings: None

What changed in this PR

Test-only fix aligning in-process registration checks with the containment signal used by installer subprocesses.

Changes:

  • Forces containment capability during TestRegistration setup.
  • Restores the environment after each test.
File Description
host-setup/​agent-safety/​claude/​test_install.py Aligns test-process containment state with installer behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Oct 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.47%. Comparing base (e93b673) to head (4d99637).
⚠️ Report is 318 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2466   +/-   ##
=======================================
  Coverage   58.47%   58.47%           
=======================================
  Files          16       16           
  Lines        8062     8062           
=======================================
  Hits         4714     4714           
  Misses       3348     3348           
Flag Coverage Δ
python-3.13 58.47% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 4539946 into main Oct 7, 2026
13 checks passed
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.

Force the Containment Signal in test_install's In-Process Registration Checks

2 participants