Repository navigation
Open
Labels
enhancementNew feature or requestNew feature or requestpythonPull requests that update python codePull requests that update python coderules
Description
Summary
Node-local AI remediation rewrites producers without updating consumers. After remediating a large repo, a review found:
- L080 (
set_fact→__foo) — facts written to__foo, tasks still readfoo(role default, usuallyfalse). Configure/start tasks skipped; pkg mgr vars undefined. - L006 (
cat→slurp) — module swapped, Jinja still usesstdout_lines(slurp does not provide it). RCA report output empty. - L006 + piped
cat— first-token match fired oncat /proc/meminfo | grep …; AI moved the pipeline ontocommand(no shell).
Short-term: stop auto-applying these (see the companion PR). This issue is the real fix.
Is this project-level AI?
Yes. These fixes belong in ADR-027 (agentic project-level remediation with search/read/write), not in node-local propose_node_fix().
A graph walk of data_flow edges is not sufficient. We do not know every use:
| What we have | Gap |
|---|---|
EdgeType.DATA_FLOW from register / set_fact |
Built by _extract_variable_references() — Jinja {{ }} only, in when_expr and string module_options |
| David's actual consumers | Bare when: chrony_config_chrony_installed (no braces) — no data_flow edge |
| Role defaults | Old name stays defined, so L039 never fires after a rename |
| Not scanned | failed_when, changed_when, loop, task name, nested maps, .j2 templates, hostvars[] / vars[], extra vars |
ARI TaskCall.variable_use |
Exists on the ARI model, not copied onto ContentNode, unused for data_flow |
A stronger usage index would help the common YAML-task cases. It cannot be the sole source of truth for a rename or a register-shape change. Templates and dynamic lookups need project-wide search.
What a complete fix should do
- L080 / variable rename: find every reference (YAML + Jinja templates), rename them, or refuse the transform.
- L006
cat→slurp: rewrite register consumers tocontent \| b64decode/splitlines; do not substitute when the command has pipes or extra tokens. - Convergence: mark consumers dirty (not just the producer). A dropped
data_flowedge after a transform should fail the changeset. - Routing: keep L006/L080 on the project-level path until the above exists.
Do not re-enable node-local AI for these rules as a shortcut.
Related
- ADR-027 (agentic project-level AI)
- ADR-044 (data_flow edges; semantic preservation / graph isomorphism)
- Companion PR: stop node-local AI from applying L006/L080; skip piped
catin L006; refuse L007 shell→command when the command cannot be inspected
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpythonPull requests that update python codePull requests that update python coderules
Activity
cidrblock commentedon Aug 19, 2026
Short-term stopgap: #566 — L006/L080 no longer auto-remediated; piped
catis not L006; L007 will not move an uninspectable/piped command ontocommand.fix(remediation): stop node-local AI from breaking data-flow consumers
fix(remediation): stop node-local AI from breaking data-flow consumers (