Skip to content

MAIN-RED FIX: move withheld-executable wording out of install/exec_gate.py (LOC budget) - #4777

Merged
Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
danielmeppiel-fix-exec-gate-loc
Nov 22, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 3 commits into
mainfrom
danielmeppiel-fix-exec-gate-loc

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Main 387ae90 fails tests/unit/install/test_architecture_invariants.py::test_no_install_module_exceeds_loc_budget. src/apm_cli/install/exec_gate.py is 1007 lines against a 1000-line budget, because #4724 and #4729 each grew it.

This PR moves executable_skip_reason and withheld_executable_reason into a new module, src/apm_cli/install/exec_skip_reasons.py. These two functions word what install and pack print when the executables gate parks an executable.

  • The new module is listed under the executable-trust-context owner in .apm/architecture/owners/install-deployment.json. That owner already covers "the approve command parked notices print".
  • Callers (exec_gate.py, target_warnings.py, bundle/plugin_exporter.py) import from the new module directly; nothing is re-exported.
  • exec_gate.py goes from 1007 to 945 lines. There is no budget raise and no cosmetic trimming, and behaviour does not change.

Issue and approved scope

Issue: Refs #4714

Human scope-approval comment: main-red fix ordered by the 0.38 program lead (PGM v3) and Regent; it follows up the merged #4729. It is a refactor only, with no behaviour change.

Does this PR complete the issue, or what remains? It restores green main. #4714 was completed by #4729.

Type of change

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

Testing

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

Local runs at c9ebb45:

  • pytest tests/unit/install/test_architecture_invariants.py tests/unit/bundle/test_plugin_exporter_canvas.py tests/unit/core/test_remediation_block_proofs.py: 801 passed. The LOC budget test passes.
  • [email protected] check and format --check, lint-auth-signals.sh, the complexity ratchet and the architecture linter (including module ownership): all clean.

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)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

…_reasons.py (exec_gate.py 1007 -> 945 LOC)

Main 387ae90 failed test_no_install_module_exceeds_loc_budget after
#4724 and #4729 both grew exec_gate.py. executable_skip_reason and
withheld_executable_reason (the wording install and pack print for a
parked executable) move to their own module under the
executable-trust-context owner; callers import it directly. No budget raise.

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 were identified for the shared skip-diagnostics extraction.

No open issues 🎉

What changed in this PR

This refactor addresses the install-module line-count failure following #4724 and #4729. It moves shared executable-skip diagnostics out of exec_gate.py, reducing it from 1007 to 945 lines without changing behavior or raising the 1000-line budget.

Changes:

  • Extracts both skip-reason helpers into exec_skip_reasons.py.
  • Updates install and pack callers to import from the new module.
  • Registers the module under the existing executable-trust-context owner.
File Description
src/​apm_cli/​install/​target_warnings.py Imports canvas skip wording from the extracted module.
src/​apm_cli/​install/​exec_skip_reasons.py Houses the unchanged shared skip-reason helpers.
src/​apm_cli/​install/​exec_gate.py Removes helper definitions and imports the extracted helper, restoring the line budget.
src/​apm_cli/​bundle/​plugin_exporter.py Imports pack warning wording from the extracted module.
.apm/​architecture/​owners/​install-deployment.json Records ownership of the new diagnostics module.

Review effort: Balanced

apm-spec-waiver: pure move of withheld-executable wording into install/exec_skip_reasons.py; no observable behaviour change

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 skip-reason helper extraction.

No open issues 🎉

Review effort: Balanced

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