Skip to content

test(lifecycle): I9 skips logging records on stderr only for verbose or debug runs - #4370

Merged
Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-t1-oracle-cells-2
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 1 commit into
mainfrom
danielmeppiel-t1-oracle-cells-2

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Refs #4113

Why

Integration runs with --verbose (or APM_DEBUG) emit Python logging records on stderr, for example DEBUG apm_cli.core.token_manager gh auth token failed for github.com: ..., and the same record can print twice. The global output oracle's I9 then reports "stderr repeats a line", which kept main red on #4137's integration run.

Change

output_violations drops stderr lines that look like Python logging records (DEBUG|INFO <logger.name> ...) before it runs the I9 noise check, but only when the run itself asked for diagnostics: -v or --verbose in the arguments, or APM_DEBUG set. A default run still fails I9 on the same repeated record (steward condition).

Validation

  • Two unit cases, one per side: test_logging_records_repeat_freely_on_a_verbose_run and test_logging_records_still_fail_i9_on_a_default_run.
  • pytest tests/unit/scripts/test_lifecycle_evidence.py -k "logging_records or rejects_each or known_output": 18 passed.
  • ruff check and format: clean.

Out of scope

…erbose or debug runs (#4113)

A run with -v/--verbose or APM_DEBUG asked for logging records
('DEBUG apm_cli.core.token_manager ...'); their repeats are diagnostics, not user
output. In a default run the same repeated record still fails I9.

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.

🟡 Changes recommended

The lifecycle check reads pytest’s environment instead of the child command’s explicit environment, causing incorrect I9 results when their APM_DEBUG settings differ.

1 open issue
What changed in this PR

This test-infrastructure change refines the lifecycle output oracle from #4113 to allow repeated Python logging records during diagnostic runs while preserving duplicate detection for default runs.

Changes:

  • Filters matching DEBUG and INFO records from stderr before the I9 noise check when verbose flags or APM_DEBUG indicate diagnostics.
  • Adds regression tests for verbose-run acceptance and default-run rejection.
File Description
tests/​utils/​lifecycle_evidence.py Adds diagnostic-mode detection and stderr logging-record filtering.
tests/​unit/​scripts/​test_lifecycle_evidence.py Tests repeated logging records in verbose and default runs.

Review effort: Balanced

Comment thread tests/utils/lifecycle_evidence.py Resolved
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 4f5984f into main Nov 20, 2026
20 of 25 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-t1-oracle-cells-2 branch November 20, 2026 15:20
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