You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Lifecycle generator rules cite source by line number, so unrelated PRs conflict in a merge train #4696
area/testingTest infrastructure, fixtures, e2e harness, coverage.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.type/bugSomething does not work as documented.
Reporting and investigating a bug need no permission. Before implementing a
substantive fix for inclusion in APM, obtain human scope approval and a review
contact on this issue. Trivial documentation corrections have standing
preapproval. See Contributing.
For vulnerabilities, use SECURITY.md
instead of a public issue. Remove credentials and other sensitive data from logs.
Describe the bug
The lifecycle generator rules cite product source by line number, for example exec_gate.py:679 in tests/lifecycle/generator/rules.py, install/services.py:1025 in factors.py, and install.py:1233 in test_generator_rules.py. New rules generated in flight do the same (one cites audit.py:1431). A line number changes whenever the cited file changes, so two PRs that each edit the cited source file and refresh the citation conflict when they are combined in a merge train, even though neither is wrong. Combined landing then has to fall back to one PR at a time.
To Reproduce
Open two PRs that each change src/apm_cli/commands/audit.py and regenerate or update the lifecycle rules that cite it by line.
Combine both PRs in one merge train.
The rule files conflict on the citation lines.
Expected behavior
Rules cite source by a stable anchor, such as module.py::qualname or the symbol name, so an unrelated edit to the cited file does not change the citation.
Environment (please complete the following information):
OS: any
Python Version: 3.12
APM Version: main (0.38.0 development)
VSCode Version (if relevant): n/a
Logs
A merge train combining two such PRs failed on the citation conflict.
Additional context
Tests only; no product behaviour change.
Decision: approve
Area: project
Scope: Source citations in the lifecycle generator (tests/lifecycle/generator/rules.py, factors.py, test_generator_rules.py, and whatever emits new rules) use a stable anchor such as module.py::qualname or the symbol name instead of a line number, so an edit elsewhere in the cited file never changes the citation. Existing line-number citations are converted, and a check rejects new path.py:NNN citations in those files. Tests only; no product behaviour change.
Done when: No file under tests/lifecycle/generator cites source as path.py:; a test fails when one is added; two PRs that both edit a cited source file combine without conflict on the rule files; CI is green. No CHANGELOG line (tests only).
Out of scope: Citations in product source, docs or other test trees; changes to what the rules assert.
Review contact: Daniel Meppiel (@danielmeppiel)
area/testingTest infrastructure, fixtures, e2e harness, coverage.status/acceptedHuman scope approval; verify the issue's approval record and review contact before work.type/bugSomething does not work as documented.
Activity
danielmeppiel commentedon Nov 21, 2026
Decision: approve
Area: project
Scope: Source citations in the lifecycle generator (tests/lifecycle/generator/rules.py, factors.py, test_generator_rules.py, and whatever emits new rules) use a stable anchor such as module.py::qualname or the symbol name instead of a line number, so an edit elsewhere in the cited file never changes the citation. Existing line-number citations are converted, and a check rejects new path.py:NNN citations in those files. Tests only; no product behaviour change.
Done when: No file under tests/lifecycle/generator cites source as path.py:; a test fails when one is added; two PRs that both edit a cited source file combine without conflict on the rule files; CI is green. No CHANGELOG line (tests only).
Out of scope: Citations in product source, docs or other test trees; changes to what the rules assert.
Review contact: Daniel Meppiel (@danielmeppiel)
Merge #4725 (train/20261122-lapse-w1 @784272a7) into #4702; symbol ev…
test(lifecycle): cite generator rule evidence by symbol, never by line
test(lifecycle): cite generator rule evidence by symbol, never by line
test(lifecycle): cite generator rule evidence by symbol, never by line
test(lifecycle): cite generator rule evidence by symbol, never by line
test(lifecycle): cite generator rule evidence by symbol, never by line
test(lifecycle): cite generator rule evidence by symbol, never by line
test(lifecycle): cite generator rule evidence by symbol, never by line