Skip to content

fix(install): print each hook summary line once per package - #4395

Merged
Daniel Meppiel (danielmeppiel) merged 5 commits into
mainfrom
danielmeppiel-t1-hook-summary-once
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 5 commits into
mainfrom
danielmeppiel-t1-hook-summary-once

Conversation

@danielmeppiel

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

Copy link
Copy Markdown
Collaborator

Fixes #4336
Fixes #4243

What

_log_hook_display_payloads (install/services.py) printed one | <Event>: runs <cmd> (<file>) line per target display payload. When several targets render the same hook identically (Claude + Codex, Claude + Windsurf, or a hook file), the identical line repeated within one package block. Each distinct line now prints once per package. Lines that differ, such as Copilot's preToolUse casing, still print. Verbose JSON output is unchanged.

The #4243 strict output cell (install-hook-line-per-target) is removed in this PR because the duplicate is gone.

Validation

  • New unit test test_log_hook_display_payloads_prints_an_identical_line_once. pytest tests/unit/test_install_hook_transparency.py: 15 passed.
  • The failing-before nodes now pass with the cell removed: tests/integration/test_user_authored_name_collision_lifecycle.py 7 passed (includes the identical_user_hook test); tests/integration/test_primitive_target_covering_array.py 12 passed (includes claude-codex-hook-narrow).

Steward pre-approval (A-C)

…4243)

Targets that render one hook identically (Claude and Codex, Claude and Windsurf)
each produced a display payload, so '|   PreToolUse: runs ... (<file>)' printed
once per target. _log_hook_display_payloads now prints each distinct line once;
lines that differ (for example Copilot's preToolUse casing) still print. The
#4243 strict output cell is retired.

Fixes #4336
Fixes #4243

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 remain for the per-package hook-output deduplication change.

No open issues 🎉

What changed in this PR

This PR fixes repeated hook summary lines in APM’s install output by printing each distinct line once per package, addressing #4336 and #4243.

Changes:

  • Deduplicates hook summaries and fallback lines while preserving distinct text, including event casing, and leaving verbose JSON output unchanged.
  • Adds a regression test for duplicate suppression and preservation of differently cased events.
  • Removes the lifecycle oracle exception for the resolved duplicate-output behavior.
File Description
tests/​utils/​lifecycle_evidence.py Removes the known-output exception for repeated per-target hook lines.
tests/​unit/​test_install_hook_transparency.py Tests that identical lines print once while distinct event casing remains visible.
src/​apm_cli/​install/​services.py Deduplicates summary lines within each package’s payload logging call.

Review effort: Balanced

# Conflicts:
#	tests/lifecycle/generator/factors.py
#	tests/lifecycle/generator/rules.py
#	tests/quality/lifecycle_obligations.json
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit dba4d0e into main Nov 20, 2026
38 of 40 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-t1-hook-summary-once branch November 20, 2026 17:11
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
Co-authored-by: Copilot App <[email protected]>

# Conflicts:
#	tests/lifecycle/generator/rules.py
#	tests/quality/lifecycle_obligations.json
Daniel Meppiel (danielmeppiel) added a commit that referenced this pull request Nov 20, 2026
…4143)

Take #4395's hook-summary dedupe and drop the #4243 cell widening it supersedes; generator anchors follow line drift; obligations regenerated.

Co-authored-by: copilot-swe-agent[bot] <[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.

apm install lists one hook summary line twice for a single package Hook summary repeats the same hook line once per target

2 participants