Commit 79d8cbd
committed
Module cleanup agent: forbid hoisting non-capturing lambdas into static fields
The existing rule only forbade flagging/fixing non-capturing lambdas as
allocation issues, which allowed the agent to rationalize hoisting them
into private static final fields under other justifications (e.g.,
"matching the singletons pattern"). The singleton accessor pattern in
.github/copilot-instructions.md applies to stored singleton fields like
Instrumenter, not arbitrary lambda expressions.
Tighten the rule to forbid the hoist regardless of justification, matching
the corresponding review-side guidance already in
.github/agents/knowledge/general-rules.md.1 parent ccd1942 commit 79d8cbd
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | | - | |
294 | | - | |
295 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
296 | 300 | | |
297 | 301 | | |
298 | 302 | | |
| |||
0 commit comments