Skip to content

revert: #4802 path CheckRoot (zero measured gain on the CI bench) - #4855

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-revert-4802
Nov 23, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-revert-4802

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Description

Reverts #4802 (merge 8710b95, shipped in v0.38.0). Its containment change measured zero gain on the CI bench, and it adds a security-sensitive class (CheckRoot), a closed-world AST guard and 7 bypass mutations to maintain.

Run Fixture Journeys Paired new/base
45075725397 tree-10 no-op / locked-warm / warm / frozen 1.009 / 1.004 / 1.007 / 1.000
45076262295 tree-50 no-op / locked-warm 1.002 / 1.010

Both runs compare base f0dab6c with new 394e93c, using paired CPU (user+sys incl. children) on 3 runners with interleaved pairs. The A/A noise floor is about 1% (run 45076411610).

The PERF landing bar is >= 2x or >= 30% of the journey, so this is a removal of zero-benefit complexity, ordered by the regent after the tag. #4761's resolve-once (the measured part of the same lane) is untouched.

Issue and approved scope

Issue: Refs #4732

Human scope-approval comment: revert of a merged change under the PERF landing bar, ordered by the regent (PERF VP v2 plan.md, 23:4x); same scope as #4802's record, removed.

Does this PR complete the issue, or what remains? #4732's remaining scope is unchanged by this revert.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation evidence (worktree source via PYTHONPATH=src):

  • pytest -n 2 tests/unit/test_path_security_io.py tests/unit/scripts/test_architecture_runner.py tests/unit/install/ -k "path or deployed or ledger or runner or locator": 556 passed.
  • uvx [email protected] check and format --check on src/, tests/ and the architecture linter: passed.
  • python scripts/lint_architecture_boundaries.py --root .: no findings.
  • No remaining references to path_check_root or CheckRoot.

Changelog

  • One fragment per section, changelog.d/<pr>.<section>.md, holding
    one line: user-visible effect first, 25 words or fewer, ending with
    (#PR); breaking changes only under upgrade notes; no Highlights; no
    new lines under ## [Unreleased]. See changelog.d/README.md and
    .github/instructions/changelog.instructions.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

Not applicable.

… class

CI bench (paired CPU, 3 runners x interleaved pairs): f0dab6c -> 394e93c
tree-10 run 45075725397 paired 1.000-1.009 on no-op/warm/fresh/frozen;
tree-50 run 45076262295 paired 1.002 no-op, 1.010 locked-warm. Below the
PERF landing bar (>= 2x or >= 30%), so the CheckRoot class, its AST guard
and the bypass mutations are removed; #4761's resolve-once stays.

Refs #4732

Co-authored-by: Copilot App <[email protected]>

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.

🟢 Approval recommended

No active review issues block approval of the containment-check rollback.

No open issues 🎉

What changed in this PR

Reverts #4802’s CheckRoot containment optimization after CI benchmarks showed no measurable gain, while preserving #4761’s resolve-once improvements in deployment path handling.

Changes:

  • Removes CheckRoot and restores containment checks using the existing resolution helpers.
  • Restores candidate_resolved handling in deployment locator callers.
  • Removes the dedicated lifetime guard and its associated tests and bypass mutations.
File Description
tests/​unit/​test_path_security_io.py Removes tests specific to CheckRoot.
tests/​integration/​test_architecture_confirmed_bypass_mutations.py Removes CheckRoot lifetime bypass mutations.
src/​apm_cli/​utils/​path_security.py Removes the CheckRoot implementation.
src/​apm_cli/​install/​deployed_paths.py Restores lazy, once-per-call candidate resolution.
src/​apm_cli/​core/​deployment_ledger.py Restores resolution helpers and candidate_resolved handling.
scripts/​architecture_linter/​checks/​transport_auth_platform.py Removes registration and scanning for CheckRoot lifetime checks.
scripts/​architecture_linter/​checks/​path_check_root.py Deletes the dedicated lifetime guard.

Review effort: Balanced

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

HOLD (PERF VP v2, regent order 00:50): not landing until a macOS re-bench decides. The 1.00x verdicts above are from Linux runners, where lstat is cheapest, while #4802 targets an lstat storm. macOS paired runs at tree-10 and tree-50 decide: KEEP if #4802 meets the bar on any OS users run, REVERT only if it's ~1.0x everywhere.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

HOLD LIFTED (PERF VP v2): the cross-OS verdict is REVERT. #4802 shows no measurable CPU change on any OS (paired CPU, base f0dab6c -> 394e93c):

  • Linux: tree-10 run 45075725397 (1.000-1.009), tree-50 run 45076262295 (1.002 / 1.010)
  • macOS: tree-10 run 45085646816 (0.968-1.065), tree-50 run 45085680062 (1.005 / 1.095); A/A noise +-5-10%
  • Windows: tree-10 run 45089661505 (0.986-1.003), tree-50 run 45089669361 (0.995 / 1.001); A/A run 45089653621 (0.997 / 1.005)
    Per the regent's rule (REVERT only if ~1.0x everywhere), this revert proceeds through the normal gates (Copilot at head, QL H8).

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.

🟢 Approval recommended

No active review issues are reported for the containment-check simplification.

No open issues 🎉

Review effort: Balanced

Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 23, 2026
main's revert left the module at 2101 lines; fold the skills filter into
the loop header (no behavior change).

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Antonin Rouxel (Antonin-Rouxel-LaPoste-BGPN) pushed a commit to anrouxel/apm that referenced this pull request Nov 23, 2026
The microsoft#4802 revert (microsoft#4855) and microsoft#4818 landed together and took the file to
2101 lines. The restored _encode call takes one formatted line, as it
did before the revert; no behavior change.

Co-authored-by: Copilot App <[email protected]>
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.

2 participants