Skip to content

fix: report malformed executable trust config (closes #2715) - #2719

Merged
Daniel Meppiel (danielmeppiel) merged 7 commits into
mainfrom
fix/2715-doctor-malformed-executables
Aug 30, 2026
Merged

fix: report malformed executable trust config (closes #2715)#2719
Daniel Meppiel (danielmeppiel) merged 7 commits into
mainfrom
fix/2715-doctor-malformed-executables

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Aug 30, 2026

Copy link
Copy Markdown
Collaborator

When an apm.yml executable trust block is a string or list, apm doctor
now renders a failed informational executable trust row with the parser error
and an actionable instruction to fix the executables block instead of
silently omitting the row.

The fix preserves best-effort handling for policy discovery and user-config
failures. Project-controlled parser details are converted to printable ASCII
and rendered as literal Rich text, preventing malformed keys from injecting
terminal markup. Failed informational checks use the [!] status while
remaining exempt from the command's non-zero exit decision.

Tests cover malformed top-level shapes, printable diagnostics, configuration
provenance, literal Rich rendering, warning status, and the fixture-backed CLI
path. The doctor reference and packaged guide documentation describe the new
behavior.

Validation

Scenario Evidence

# Scenario (user promise) Principle(s) Test(s) proving it Type
1 Running apm doctor on a project with malformed executable trust configuration shows a safe repair instruction without failing the command Secure by default, Governed by policy, DevX tests/integration/marketplace/test_doctor_integration.py::test_malformed_executable_key_is_safely_rendered (regression-trap for #2715) integration

Commands run:

uv run --frozen --extra dev pytest -q tests/unit/commands/test_marketplace_doctor.py tests/unit/marketplace/test_marketplace_commands_surface.py tests/integration/marketplace/test_doctor_integration.py
145 passed

uv run --frozen --extra dev ruff check src/ tests/
All checks passed!

uv run --frozen --extra dev ruff format --check src/ tests/
1677 files already formatted

Closes #2715

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

Review tier: Lite
Findings: 1 Medium severity

New issues introduced by this change (1)
Severity Finding
Medium severity src/​apm_cli/​commands/​marketplace/​doctor.py — The doctor row interpolates the raw ValueError message into CLI output. Some ValueError messages…
What changed in this PR

This PR improves apm doctor diagnostics for executable-trust by ensuring malformed executables: configuration in apm.yml is reported (instead of silently dropping the row), aligning the behavior more closely with apm policy explain and making remediation actionable.

Changes:

  • Update the executable-trust drift check to convert ValueError from executable-trust parsing into an informational failing doctor row with a clear fix instruction.
  • Add regression tests covering malformed executables: shapes (string and list) to ensure the row is always rendered.
  • Update CLI and packaged guide documentation to describe the new doctor behavior for malformed executable configuration.
File Description
tests/​unit/​commands/​test_marketplace_doctor.py Adds parameterized regression coverage asserting malformed executables: is surfaced as an informational failing doctor check.
src/​apm_cli/​commands/​marketplace/​doctor.py Refines _executable_trust_drift_check to report invalid project executable configuration while keeping best-effort behavior for other failures.
packages/​apm-guide/​.apm/​skills/​apm-usage/​governance.md Documents that the doctor row also reports malformed executables configuration.
packages/​apm-guide/​.apm/​skills/​apm-usage/​commands.md Updates apm doctor command description to include malformed executables reporting.
docs/​src/​content/​docs/​reference/​cli/​doctor.md Updates the doctor reference to explain malformed executables reporting and where it points users for fixes.

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

Comment on lines +62 to +68
except ValueError as exc:
return _DoctorCheck(
name="executable trust",
passed=False,
detail=f"Invalid executables block: {exc}. Fix 'executables' in apm.yml.",
informational=True,
)
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: needs_rework

The doctor diagnostic improves executable-trust recovery, but malformed config can still misidentify its source, crash output, or inject terminal hyperlinks.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel agrees the core behavior is valuable: best-effort discovery with an actionable, zero-exit diagnostic reduces governance setup friction, and the documentation is accurate. The two passing unit cases confirm the helper-level path, but they do not exercise the rendered CLI boundary.

The highest-signal concerns converge around untrusted diagnostic output. Rich markup injection has only manual evidence, and the non-ASCII crash path lacks CLI regression coverage; on a policy surface, those missing automated guardrails carry substantial weight. Separately, both architecture and DevX reviewers found that the broad ValueError boundary can blame apm.yml for malformed user configuration. These are bounded corrections within the PR's stated scope.

Aligned with: Secure by default: malformed configuration must be rendered as literal, sanitized text rather than executable terminal markup. Governed by policy: doctor should identify both the invalid trust policy and its actual configuration source accurately. Pragmatic as npm: best-effort discovery and actionable zero-exit diagnostics keep recovery straightforward.

Growth signal. A trustworthy doctor diagnostic reduces friction when teams adopt executable-governance policy and makes configuration failures easier to self-correct.

Panel summary

Persona B R N Takeaway
Python Architect 0 1 0 The ValueError boundary can misattribute malformed user config to apm.yml.
CLI Logging Expert 0 2 0 Sanitize malformed-config details and render actionable failures as warnings.
DevX UX Expert 0 1 0 The project-config recovery is clear, but the broad ValueError catch can direct users to the wrong file.
Supply Chain Security Expert 0 1 0 Escape malformed-config diagnostics before Rich rendering; crafted YAML keys can inject terminal hyperlinks.
OSS Growth Hacker 0 0 0 The actionable doctor diagnostic reduces governance setup friction; no growth-surface concerns.
Doc Writer 0 0 0 Docs accurately describe malformed project executable-trust reporting, remediation, and informational exit behavior.
Test Coverage Expert 0 1 1 Generic malformed blocks pass at unit tier, but no CLI fixture covers repr-bearing non-ASCII errors.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 4 follow-ups

  1. [Supply Chain Security Expert] Render malformed-config details as literal text with Rich markup disabled or escaped. -- User-controlled YAML keys can currently produce OSC 8 terminal hyperlinks.
  2. [CLI Logging Expert] Sanitize ValueError details with printable ASCII handling. -- Non-ASCII malformed keys can turn the recovery diagnostic into a UnicodeEncodeError; Copilot independently corroborated this risk.
  3. [Python Architect] Preserve configuration provenance when validating executable trust settings. -- A malformed user config can currently be reported as an apm.yml error, sending users to the wrong remediation target.
  4. [Test Coverage Expert] Add a fixture-backed CLI regression using a malformed nested mapping with a crafted non-ASCII markup key. -- The test should assert safe rendering, accurate remediation, and the intended informational exit code of zero.

Architecture

classDiagram
    direction LR
    class TopLevelDoctorModule {
      <<CLIEntryPoint>>
      +doctor(verbose)
    }
    class MarketplaceDoctorModule {
      <<ProceduralModule>>
      +run_doctor(verbose, logger_name) int
      -_executable_trust_drift_check(project_root, logger) _DoctorCheck
    }
    class ExecutableTrustModule {
      <<DomainOwner>>
      +parse_project_executables(data) tuple
      +build_exec_trust_context(policy, project_data) ExecTrustContext
      +resolve_exec_decision(context, package_key, exec_type) ExecDecision
    }
    class ApproveModule {
      <<Gateway>>
      +load_org_policy(project_root, logger) ApmPolicy
      +scan_installed_executable_packages(path) list
    }
    class DoctorCheck {
      <<ResultObject>>
      +name
      +passed
      +detail
      +informational
    }
    TopLevelDoctorModule ..> MarketplaceDoctorModule : calls
    MarketplaceDoctorModule ..> ApproveModule : discovers policy and packages
    MarketplaceDoctorModule ..> ExecutableTrustModule : resolves trust
    MarketplaceDoctorModule ..> DoctorCheck : creates
    class MarketplaceDoctorModule:::touched
    classDef touched fill:#fff3b0,stroke:#d47600
Loading
flowchart TD
    A["apm doctor"] --> B["run_doctor()"]
    B --> C["_executable_trust_drift_check()"]
    C --> D{"apm.yml exists?"}
    D -->|no| E["omit row"]
    D -->|yes| F["load project and organization policy"]
    F --> G["build_exec_trust_context()"]
    G --> H{"builder result"}
    H -->|ValueError| I["failed informational check"]
    H -->|other error| E
    H -->|context| J["resolve trust drift"]
    I --> K["render doctor table"]
    J --> K
Loading

Recommendation

Recommend one focused in-PR revision covering literal sanitized rendering, source-accurate attribution, and the fixture-backed CLI regression; then ship the improved diagnostic.


Full per-persona findings

Python Architect

  • [recommended] Report only project-sourced validation errors as apm.yml failures at src/apm_cli/commands/marketplace/doctor.py:62
    build_exec_trust_context() also reads user configuration, so a malformed user setting can be reported as an apm.yml problem.

CLI Logging Expert

  • [recommended] Sanitize parser text before rendering it at src/apm_cli/commands/marketplace/doctor.py:66
    Raw project-controlled parser details can violate the printable-ASCII output contract.
  • [recommended] Render informational failures with a warning status
    A failed diagnostic should remain visually actionable even when it does not affect the process exit code.

DevX UX Expert

  • [recommended] Do not always direct caught ValueErrors to apm.yml at src/apm_cli/commands/marketplace/doctor.py:66
    A malformed user setting needs a source-accurate recovery action.

Supply Chain Security Expert

  • [recommended] Render parser errors as literal text at src/apm_cli/commands/marketplace/doctor.py:66
    Rich markup in a project-controlled key can emit a terminal hyperlink.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

Changes do not affect authentication, token, credential, host classification, or authorization behavior.

Doc Writer

No findings.

Test Coverage Expert

  • [nit] Current regression trap protects helper output only at tests/unit/commands/test_marketplace_doctor.py:824
    The two parameter cases pass but do not prove the rendered CLI boundary.
  • [recommended] Add a CLI-level malformed-config regression trap.
    No fixture-backed doctor test currently covers safe rendering, accurate remediation, and the informational exit code.

Performance Expert -- inactive

No performance-relevant hot path is changed.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

Doctor now reports malformed executable trust configuration safely and actionably, with green CI and integration coverage.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel converges on a sound implementation: the canonical parser and centralized rendering are preserved, terminal output is safe and actionable, and the earlier output-injection concern is fixed. No architecture, DevX, logging, documentation, or supply-chain defects remain.

Passing integration evidence confirms the secure-by-default promise at tests/integration/marketplace/test_doctor_integration.py: assert "\x1b]8;" not in result.output. The remaining items concern communication and evidence discoverability, not product correctness: record the user-visible fix under Unreleased and map this passing scenario to the secure-by-default and DevX promises in the PR body.

Aligned with: Secure by default: project-controlled parser details are rendered literally without permitting terminal-link injection. Pragmatic as npm: doctor turns malformed trust configuration into a clear diagnosis and concrete repair instruction.

Growth signal. A concise Unreleased entry will make this trust-diagnostic improvement visible to users and preserve confidence in APM's secure defaults.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 No architectural defects; validation remains with the canonical parser and rendering is centralized and safe.
CLI Logging Expert 0 0 0 CLI diagnostics are safe, actionable, correctly attributed, and use accurate status symbols.
DevX UX Expert 0 0 0 Malformed executable configuration is reported safely without changing informational exit semantics.
Supply Chain Security Expert 0 0 0 Diagnostic sanitization, literal Rich rendering, and project-source attribution are adequately hardened.
OSS Growth Hacker 0 1 0 Add the required release-facing changelog entry.
Doc Writer 0 0 0 Documentation is accurate, concise, discoverable, and consistent with informational exit behavior.
Test Coverage Expert 0 1 0 Regression coverage passes at the integration tier; add the required Scenario Evidence mapping.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 2 follow-ups

  1. [OSS Growth Hacker] Add the doctor fix to the Unreleased changelog. -- This user-visible behavior needs a durable release note.
  2. [Test Coverage Expert] Add the required Scenario Evidence table to the PR body. -- Map the passing CLI integration test to the secure-by-default and DevX promises.

Architecture

classDiagram
    class DoctorCLI
    class MarketplaceDoctorModule
    class ExecutableTrustRules {
      <<CanonicalParser>>
    }
    class DiagnosticsModule {
      +printable_ascii_text(value) str
    }
    class MarketplaceCommandsModule {
      +_doctor_status_icon(check) str
      +_render_doctor_table(logger, checks)
    }
    DoctorCLI ..> MarketplaceDoctorModule : calls
    MarketplaceDoctorModule ..> ExecutableTrustRules : validates
    MarketplaceDoctorModule ..> DiagnosticsModule : sanitizes
    MarketplaceDoctorModule ..> MarketplaceCommandsModule : renders
Loading
flowchart TD
    A["apm doctor"] --> B["load project config"]
    B --> C["canonical project parser"]
    C --> D{"valid?"}
    D -->|no| E["sanitize parser detail"]
    E --> F["render literal failed informational row"]
    D -->|yes| G["build trust context"]
    G --> H["render trust result"]
Loading

Recommendation

The current head is technically ready to ship; fold in the two bounded communication follow-ups so the release record and PR evidence match the quality already demonstrated by the implementation and green CI.


Full per-persona findings

Python Architect

  • [nit] Architecture pattern assessment
    The canonical-parser preflight and shared status helper are the simplest correct design at this scope.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

  • [recommended] Add this user-visible doctor fix to the Unreleased changelog at CHANGELOG.md:8.
    Runtime diagnostics, tests, and docs changed, so the release record must include the user impact.

Auth Expert -- inactive

The touched doctor, test, and documentation files do not change authentication behavior.

Doc Writer

No findings.

Test Coverage Expert

  • [recommended] Add the required Scenario Evidence table to the PR body.
    The passing integration test proves the safe-rendering and actionable-remediation promise but is not mapped in the PR body.

Performance Expert -- inactive

The touched doctor, test, and documentation files do not change a performance-sensitive path.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

PR #2719 strengthens executable-trust diagnostics, with one remaining DevX follow-up for accurate deprecated-alias remediation.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel converges on a sound change: CI is green, prior follow-ups are folded, and architecture, logging, security, documentation, testing, and growth reviewers found no material concerns. The Python architecture nit requires no follow-up.

The remaining DevX recommendation is in scope. Because parse_project_executables still accepts deprecated allowExecutables, doctor should not always direct users to fix executables; it should identify the actual source key or give neutral executable-trust guidance. An alias regression test should preserve that user-facing contract.

Aligned with: Secure by default: executable-trust validation remains centralized, while accurate remediation avoids users weakening or misconfiguring trust policy. Pragmatic as npm: doctor guidance should lead directly from the malformed key users wrote to a reliable fix.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Canonical executable parsing is preserved and rendering remains shared.
CLI Logging Expert 0 0 0 Doctor output is clear, safe, actionable, and uses correct warning semantics.
DevX UX Expert 0 1 0 Make remediation accurate for the supported allowExecutables alias.
Supply Chain Security Expert 0 0 0 Printable ASCII and literal Rich rendering contain terminal injection risk.
OSS Growth Hacker 0 0 0 The fix is discoverable in docs, packaged guidance, and the changelog.
Doc Writer 0 0 0 Documentation matches the informational-warning behavior.
Test Coverage Expert 0 0 0 Malformed configuration, rendering, warning, and exit behavior are covered.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 1 follow-up

  1. [DevX UX Expert] Make doctor remediation source-accurate for malformed deprecated allowExecutables, or use neutral executable-trust guidance, and add an alias regression test. -- The current message sends alias users to the wrong key.

Architecture

classDiagram
    class DoctorProbe
    class ProjectExecutableParser {
      <<CanonicalOwner>>
    }
    class DoctorRenderer
    DoctorProbe ..> ProjectExecutableParser : validates
    DoctorProbe ..> DoctorRenderer : supplies safe result
Loading
flowchart TD
    A["project executable trust config"] --> B["canonical parser"]
    B --> C{"valid?"}
    C -->|no| D["source-accurate repair guidance"]
    C -->|yes| E["build trust context"]
Loading

Recommendation

Fold the source-accurate alias guidance and regression test into this PR; no other panel evidence warrants further changes.


Full per-persona findings

Python Architect

  • [nit] No architectural follow-up required at this head.

CLI Logging Expert

No findings.

DevX UX Expert

  • [recommended] Name the actual malformed manifest key at src/apm_cli/commands/marketplace/doctor.py:66.
    parse_project_executables validates the supported allowExecutables alias, but the message always says to fix executables.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

The touched files do not change authentication behavior.

Doc Writer

No findings.

Test Coverage Expert

No findings.

Performance Expert -- inactive

The touched files do not change a performance-sensitive path.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

PR #2719 makes doctor diagnostics accurately identify malformed executable policy blocks, including the deprecated compatibility key.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel converges that the runtime change is sound: CI is green, and architecture, CLI logging, DevX, security, growth, and test coverage found no substantive concern. The Python architecture nit does not warrant follow-up.

The documentation gap is directly in scope. Before shipping, align the doctor reference, packaged commands documentation, governance documentation, and changelog so each names both executables and deprecated allowExecutables, and explains that the offending block is reported.

Aligned with: Portability by manifest: diagnostics identify malformed executable configuration across canonical and compatibility manifest keys. Governed by policy: reporting the offending policy block makes failures actionable. Pragmatic as npm: source-accurate diagnostics reduce troubleshooting friction.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Canonical parser ownership and diagnostic boundaries are preserved.
CLI Logging Expert 0 0 0 Diagnostics are actionable, source-accurate, and safely rendered.
DevX UX Expert 0 0 0 Diagnostics are safe, actionable, documented, and regression-tested.
Supply Chain Security Expert 0 0 0 Project-controlled diagnostics are sanitized and rendered as literal text.
OSS Growth Hacker 0 0 0 Actionable diagnostics and aligned documentation remove onboarding friction.
Doc Writer 0 1 0 Docs omit the supported deprecated allowExecutables diagnostic path.
Test Coverage Expert 0 0 0 Critical doctor failure paths have unit and fixture-backed CLI coverage.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 1 follow-up

  1. [Doc Writer] Update the four affected documentation surfaces to describe both executable keys and offending-block reporting. -- Runtime diagnoses both executables and deprecated allowExecutables; the troubleshooting contract should match.

Recommendation

Fold the bounded documentation update into this PR, then ship; the implementation and CI evidence otherwise support release.


Full per-persona findings

Python Architect

  • [nit] The implementation is appropriately scoped and preserves canonical ownership.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

The touched files do not change authentication behavior.

Doc Writer

  • [recommended] Document the deprecated allowExecutables diagnostic path.
    The source names the offending canonical or compatibility key, while current docs mention only executables.

Test Coverage Expert

No findings.

Performance Expert -- inactive

The touched files do not change a performance-sensitive path.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_with_followups

PR #2719 is technically ready, with one bounded documentation clarification to keep executable-trust guidance precise.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel converges on a healthy implementation: runtime behavior, tests, CI, and architecture are sound. The Python architecture nit requires no action; all other active technical reviewers reported no findings.

The doc-writer's recommendation is narrow but worthwhile. Clarifying that diagnostics concern malformed executable-trust configuration under either key avoids implying that every use of the deprecated alias is itself reported.

Aligned with: Secure by default: accurate executable-trust wording distinguishes malformed policy from supported compatibility behavior. Governed by policy: the implementation and documentation preserve a clear policy boundary across current and deprecated keys. Pragmatic as npm: backward compatibility remains usable without obscuring the preferred configuration.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 Canonical parser ownership and diagnostic boundaries are preserved.
CLI Logging Expert 0 0 0 Diagnostics are safe, actionable, and source-accurate.
DevX UX Expert 0 0 0 Repair guidance is actionable, documented, and regression-tested.
Supply Chain Security Expert 0 0 0 Project-controlled diagnostics are sanitized and literal.
OSS Growth Hacker 0 0 0 The doctor warning is consistently documented.
Doc Writer 0 1 0 Clarify that only malformed values under either key are reported.
Test Coverage Expert 0 0 0 All changed doctor promises have regression traps.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 1 follow-up

  1. [Doc Writer] Scope "malformed" to executable-trust configuration under either executables or deprecated allowExecutables. -- This prevents readers from inferring that any deprecated alias triggers a diagnostic.

Recommendation

Fold the bounded wording clarification; no implementation, test, CI, or architectural concern warrants further work.


Full per-persona findings

Python Architect

  • [nit] The implementation is appropriately scoped and preserves canonical ownership.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

No authentication surface changed.

Doc Writer

  • [recommended] Scope "malformed" to both executable-trust keys.
    Say "malformed executable-trust configuration under either executables or the deprecated allowExecutables key" across all four documentation surfaces.

Test Coverage Expert

No findings.

Performance Expert -- inactive

No performance-sensitive path changed.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: needs_rework

PR #2719 is CI-green, but its doctor status icons bypass APM's canonical console vocabulary.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel converges on one in-scope architectural fault: _doctor_status_icon hard-codes [!], [x], [i], and [+] instead of using utils/console.py::STATUS_SYMBOLS. This creates a parallel output vocabulary that can drift as terminal conventions evolve.

The Python Architect's canonical-owner evidence outweighs the otherwise clean panel and green CI. Fold this correction and add a static architecture boundary with a matching test so future output helpers cannot bypass STATUS_SYMBOLS.

Aligned with: Pragmatic as npm: a single canonical status vocabulary keeps CLI output predictable and maintainable.

Panel summary

Persona B R N Takeaway
Python Architect 1 0 0 Route doctor status icons through canonical STATUS_SYMBOLS.
CLI Logging Expert 0 0 0 Diagnostics are safe, actionable, and source-accurate.
DevX UX Expert 0 0 0 Current and deprecated key guidance is concrete and tested.
Supply Chain Security Expert 0 0 0 Diagnostics are ASCII-sanitized and literal.
OSS Growth Hacker 0 0 0 User-facing guidance and changelog are complete.
Doc Writer 0 0 0 Documentation matches the implementation.
Test Coverage Expert 0 0 0 Malformed executable diagnostics have fixture-backed coverage.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Top 1 follow-up

  1. [Python Architect] (blocking-severity) Route _doctor_status_icon through STATUS_SYMBOLS and enforce that ownership boundary with a matching architecture test. -- Parallel hard-coded symbols create architectural drift.

Recommendation

Fold the canonical STATUS_SYMBOLS integration and architecture regression test before shipping; no other panel follow-up is warranted.


Full per-persona findings

Python Architect

  • [blocking] Route doctor status icons through canonical STATUS_SYMBOLS at src/apm_cli/commands/marketplace/__init__.py:1311.
    The canonical-owner table assigns output vocabulary to utils/console.py; literal glyphs duplicate that authority.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

No authentication surface changed.

Doc Writer

No findings.

Test Coverage Expert

No findings.

Performance Expert -- inactive

No performance-sensitive path changed.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

APM Review Panel: ship_now

PR #2719 lands a minimal centralized design with dual guardrails, aligned documentation, mutation-tested defenses, and green CI.

cc Sergio Sisternes (@sergio-sisternes-epam) -- a fresh advisory pass is ready for your review.

The panel converges on shipping exact head 2672a608f1ab5df087b8d9aaff370992b75b65a6. The architecture remains intentionally minimal and centralized, all earlier follow-ups are folded, and the dual guardrails hold under mutation-break testing. Every active specialist found no material issue.

The doctor.md wording note is optional polish: the documentation accurately matches the implementation without overstatement. It does not warrant delaying landing.

Aligned with: Secure by default: dual guardrails are backed by passing mutation-break coverage. Pragmatic as npm: the centralized design keeps the implementation direct and maintainable without unnecessary abstraction.

Panel summary

Persona B R N Takeaway
Python Architect 0 0 1 No architectural concerns: doctor reuses the executable parser, ASCII sanitizer, and console status vocabulary with dual guardrails.
CLI Logging Expert 0 0 0 Canonical status symbols, safe literal rendering, and actionable diagnostics are correctly guarded.
DevX UX Expert 0 0 0 Doctor provides safe, source-accurate remediation while preserving informational exit behavior.
Supply Chain Security Expert 0 0 0 Printable ASCII sanitization and literal Rich rendering prevent terminal-control injection.
OSS Growth Hacker 0 0 0 Docs and changelog clearly communicate the trust-diagnostic improvement.
Doc Writer 0 0 1 Documentation matches the implementation without overstatement.
Test Coverage Expert 0 0 0 Malformed-config behavior has unit and fixture-backed CLI regression tests.

B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.

Architecture

classDiagram
    direction LR
    class DoctorCommand {
      <<CLIEntryPoint>>
      +doctor(verbose)
    }
    class DoctorRunner {
      <<ProceduralOrchestrator>>
      +run_doctor(verbose, logger_name) int
      -_executable_trust_drift_check(project_root, logger) DoctorCheck
    }
    class ExecutableTrustAuthority {
      <<CanonicalOwner>>
      +parse_project_executables(data) tuple
      +build_exec_trust_context(policy, project_data) ExecTrustContext
    }
    class DiagnosticAuthority {
      <<CanonicalOwner>>
      +printable_ascii_text(value) str
    }
    class DoctorRenderer {
      <<Adapter>>
      -_doctor_status_icon(check) str
      -_render_doctor_table(logger, checks)
    }
    class ConsoleAuthority {
      <<CanonicalOwner>>
      +STATUS_SYMBOLS dict
    }
    DoctorCommand ..> DoctorRunner : delegates
    DoctorRunner ..> ExecutableTrustAuthority : routes through
    DoctorRunner ..> DiagnosticAuthority : sanitizes with
    DoctorRunner ..> DoctorRenderer : renders through
    DoctorRenderer ..> ConsoleAuthority : consumes
Loading
flowchart TD
    A["apm doctor"] --> B["load project and policy"]
    B --> C["canonical executable parser"]
    C --> D{"valid?"}
    D -->|no| E["printable ASCII diagnostic"]
    D -->|yes| F["build trust context"]
    E --> G["canonical status symbol lookup"]
    F --> G
    G --> H["literal doctor table rendering"]
Loading

Recommendation

Land exact head 2672a608f1ab5df087b8d9aaff370992b75b65a6; CI is green and no material follow-up remains.


Full per-persona findings

Python Architect

  • [nit] Architecture is appropriately minimal and centralized.
    _doctor_status_icon adapts _DoctorCheck state to the canonical console vocabulary without creating another owner.

CLI Logging Expert

No findings.

DevX UX Expert

No findings.

Supply Chain Security Expert

No findings.

OSS Growth Hacker

No findings.

Auth Expert -- inactive

No authentication surface changed.

Doc Writer

  • [nit] One doctor reference sentence could read more smoothly.
    The current wording is accurate and does not overstate behavior.

Test Coverage Expert

No findings.

Performance Expert -- inactive

No performance-sensitive path changed.

Folded in this run

  • (copilot) Sanitize raw parser details before CLI rendering -- resolved in d0dfb9cf31.
  • (panel) Render malformed configuration details as literal Rich text -- resolved in d0dfb9cf31.
  • (panel) Preserve project configuration provenance during validation -- resolved in d0dfb9cf31.
  • (panel) Add fixture-backed CLI coverage for crafted malformed keys -- resolved in d0dfb9cf31.
  • (panel) Show warning status for failed informational checks -- resolved in d0dfb9cf31.
  • (panel) Add the user-visible doctor fix to the Unreleased changelog -- resolved in bb5369399a.
  • (panel) Add the required Scenario Evidence table to the PR body -- resolved at bb5369399a.
  • (panel) Name the deprecated allowExecutables key in remediation -- resolved in 52d910715a.
  • (panel) Document the deprecated allowExecutables diagnostic path -- resolved in 4271a96d6c.
  • (panel) Clarify that only malformed values under either key are reported -- resolved in 674e8547bb.
  • (panel) Route doctor status icons through canonical STATUS_SYMBOLS with dual guardrails -- resolved in 2672a608f1.

Copilot signals reviewed

  • src/apm_cli/commands/marketplace/doctor.py:68 -- LEGIT: raw user-controlled parser details violated printable-ASCII output and enabled Rich markup interpretation (resolved in d0dfb9cf31).

Regression-trap evidence (mutation-break gate)

  • test_malformed_executables_block_is_reported -- deleted project executable parser preflight; test FAILED as expected; guard restored.
  • test_malformed_project_detail_is_printable_ascii -- deleted printable_ascii_text conversion; test FAILED as expected; guard restored.
  • test_malformed_user_config_is_not_attributed_to_project -- deleted generic builder-error best-effort handling; test FAILED as expected; guard restored.
  • test_rich_detail_is_rendered_as_literal_text -- deleted literal Text(c.detail) rendering; test FAILED as expected; guard restored.
  • test_failed_informational_check_shows_warning_icon -- deleted failed-informational status precedence; test FAILED as expected; guard restored.
  • test_malformed_executable_key_is_safely_rendered -- deleted printable_ascii_text conversion; test FAILED as expected; guard restored.
  • test_malformed_deprecated_alias_names_alias_in_remediation -- deleted alias remediation selection; test FAILED as expected; guard restored.
  • test_doctor_status_icon_uses_canonical_console_vocabulary -- replaced STATUS_SYMBOLS lookups with literals; test FAILED as expected; guard restored.
  • test_doctor_status_symbols_use_console_owner -- replaced STATUS_SYMBOLS lookups with literals; architecture test and boundary lint FAILED as expected; guard restored.

Lint contract

uv run --frozen --extra dev ruff check src/ tests/ exited 0 with All checks passed!; uv run --frozen --extra dev ruff format --check src/ tests/ exited 0 with 1677 files already formatted. Pylint R0801, auth-signals, and architecture-boundary lint also exited 0.

CI

All 18 checks passed on the latest head: https://github.com/microsoft/apm/actions/runs/33308105341 (after 0 CI fix iterations).

Mergeability status

PR head SHA CEO stance iters folds defers Copilot rounds CI mergeable mergeStateStatus notes
#2719 2672a60 ship_now 4 11 0 2 green MERGEABLE BLOCKED pending required review

Convergence

4 outer iterations; 2 Copilot rounds. Final panel recommendation: ship_now.

Ready for maintainer review.

This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Render malformed executable diagnostics as literal printable ASCII, preserve project-config attribution, and make informational failures visibly actionable. Adds fixture-backed CLI and mutation-trap coverage; addresses Copilot review and panel follow-ups.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the user-visible doctor fix to the Unreleased release record, addressing the final review-panel follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep doctor remediation source-accurate when the supported deprecated allowExecutables alias is malformed. Adds a mutation-proven regression test; addresses the final DevX panel follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document that doctor names malformed canonical and deprecated executable-trust blocks, addressing the terminal doc-writer panel follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Make clear that doctor reports malformed values under either executable-trust key, rather than implying every deprecated alias is reported. Addresses the final doc-writer follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route doctor status rendering through the canonical console vocabulary and add behavioral plus static architecture guards. Mutation checks prove both guards fail if literal symbols return; addresses the Python Architect follow-up.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danielmeppiel
Daniel Meppiel (danielmeppiel) force-pushed the fix/2715-doctor-malformed-executables branch from 2672a60 to f6aff5e Compare August 30, 2026 15:07
@danielmeppiel

Copy link
Copy Markdown
Collaborator Author

Rebased onto current main at 59b70a5c8ef7e01a00e103ad98e5a72d3369a664 -> f6aff5e95c346c317f69e63ab10be986705ab810.

The exact head rebased cleanly, so no three-way conflicting paths required manual resolution. Main's regenerated apm.lock.yaml hashes were preserved; the architecture instruction file SHA-256 was verified as 1464599396f2dd661b98fbe153f4b08d8f0c90945e94587ad183e510dbd530ae, matching both derived lock entries.

Regression tests: the 10 exact doctor and architecture regression cases passed. The rebase did not touch a PR regression-trap test, so no post-rebase mutation-break rerun was required.

Lint contract: ruff check, ruff format check, pylint R0801, auth-signal lint, architecture-boundary lint, and the CI YAML/file-length/relative-path guards all passed post-rebase.

Post-push mergeability: gh pr view --json mergeStateStatus,mergeable reports BLOCKED / MERGEABLE. Per the mergeability gate, BLOCKED is a required-review or CI gate, not a conflict; conflict resolution is complete with that gate note. Push used git push --force-with-lease=fix/2715-doctor-malformed-executables:2672a608f1ab5df087b8d9aaff370992b75b65a6 origin HEAD:fix/2715-doctor-malformed-executables (--force-with-lease, never bare --force).

Ready for maintainer review.

@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 94cdad7 into main Aug 30, 2026
18 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the fix/2715-doctor-malformed-executables branch August 30, 2026 15:15
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.

[BUG] apm doctor omits the executable-trust row when executables: is malformed

2 participants