Skip to content

fix(conformance): correct P023's fix guidance (1 repo) - #4711

Merged
cmgrote merged 4 commits into
mainfrom
conformance/rule-fix/p023
Nov 3, 2026
Merged

cmgrote merged 4 commits into
mainfrom
conformance/rule-fix/p023

Conversation

@connectivity-ai

@connectivity-ai connectivity-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

P023: fix guidance corrected in the rule

Updated P023's full description and prescription to keep whole-block offloading for wholly synchronous work while explicitly allowing streaming async producers with sequential per-chunk offloading of synchronous sink calls (await run_in_thread(handle.write, chunk)). The clarification preserves streaming and avoids moving the async producer into sync code or buffering the whole response. Followed the Metabase callable-offload pattern, with the Tableau streaming case as the documented exception. The detector was unchanged and still reports 86 Tableau findings, 8 Metabase findings, and 0 for MySQL/OpenAPI. Ruff passed; the focused documentation/prescription tests passed (568 passed, 1 xfailed). The import check is unavailable in this rule-fix task.

  • Evidence: the remediation lane's reviewer judged the rule's guidance wrong in 1 repo(s); the rule's detection was right
  • Detection unchanged: atlanhq/atlan-tableau-app → 86, atlanhq/atlan-mysql-app → 0, atlanhq/atlan-metabase-app → 8, atlanhq/atlan-openapi-app → 0
  • Not verified: the full conformance suite and the other 190-odd rules; CI is the gate for those.
Reviewer evidence
  • atlanhq/atlan-tableau-app: At app/extracts/api/workbook_content.py:199, 209-211, and 225, the code incrementally consumes async response.aiter_bytes() and preserves a size cap plus rollback. P023's prescription says to offload the whole block owning a file handle; here that would require moving the async producer into synchronous code or materializing the response and changing the documented streaming behavior. Sequential await run_in_thread(f.write, chunk) calls remove the blocking writes while preserving that behavior. The prescription should explicitly allow per-chunk offloading at async boundaries when a synchronous sink consumes an async producer.

Opened by the conformance remediation lane (agent-sdk). Never merged automatically.

Tracking: FND-4530

Opened by the conformance remediation lane.
@linear

linear Bot commented Nov 3, 2026

Copy link
Copy Markdown

FND-4530

The corrected P023 guidance tells an async producer feeding a sync sink to
offload each sink call (`await run_in_thread(fh.write, chunk)`). Pin that the
detector accepts this shape, alongside the on-loop write it still catches, so
the guidance can't drift into recommending a fix that stays flagged.

Claude-Session: https://claude.ai/code/session_01AbKqGZp7MEAd51EaXtM6Gi
…-hop offload

The streaming exception prescribed per-chunk `run_in_thread(fh.write, chunk)`
while leaving `with open(...)` on the loop, which contradicts the rule's own
"offloading the send alone while the open stays on the loop moves half the
cost". Tell the sink's open and close to be offloaded the same way, regenerate
the rule docs, and pin that fully offloaded shape as silent.

Claude-Session: https://claude.ai/code/session_01AbKqGZp7MEAd51EaXtM6Gi
@cmgrote

cmgrote commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

/lens

@atlan-app-fleet

atlan-app-fleet Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

lens summary · updated after round 2 (re-review · only commits since e65c06f)

✅ Ready to merge — every finding is resolved

Open findings: 🔴 0 critical · 🟠 0 high · 🟡 0 medium · ⚪ 0 low (nit)

lens reads this PR as — P023 correctly detects blocking synchronous sink calls in async code, but its whole-block offloading guidance did not fit an async producer streaming into a synchronous sink: following it could force moving the producer into sync code or buffering the response, changing streaming behavior. How: The PR preserves whole-block offloading for wholly synchronous work while documenting a streaming exception: keep the async producer awaited and sequentially offload each sink operation, including open and close. It updates the prescription sources and rule description, with focused tests that check the on-loop write is reported and the offloaded streaming form is not; detection itself is unchanged.

Approach check — sound.

✔️ Resolved (1)
id severity where finding found resolved how
F-94d09d 🟡 medium packages/conformance/conformance/programs/areas/prescriptions.prose.md:972 The offload example cannot bound a stuck file operation round 1 round 2 verified fixed
🕘 Round history (2)
round run commits new resolved blocking open cost log
1 first review 3f373cd..e65c06f 1 0 0 $0.022 run
2 re-review · only commits since e65c06f e65c06f..4e25c21 0 1 0 $0.015 run

round 2 · $0.037 of $1.00 · 35 model calls · 0 failed requests · 85% prompt cache hits · gpt-6-luna

File open/write/close take no timeout, so per-chunk run_in_thread offload
cannot bound a sink that hangs, and run_in_thread's own progress hold is
unbounded. Prescribe a bounded holding_progress around the open-through-close
span so a wedged sink fails the task at a chosen bound, and say that the
stuck thread itself is not recovered.

Claude-Session: https://claude.ai/code/session_01AbKqGZp7MEAd51EaXtM6Gi
@cmgrote

cmgrote commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

/lens

@atlan-app-fleet

Copy link
Copy Markdown
Contributor

✅ lens · round 2 · re-review · only commits since e65c06f — ready to merge — every finding resolved · $0.04

Open findings: 🔴 0 critical · 🟠 0 high · 🟡 0 medium · ⚪ 0 low (nit)
Resolved this round: 1

Approach check — ✅ sound

  • Problem: P023 correctly detects blocking synchronous sink calls in async code, but its whole-block offloading guidance did not fit an async producer streaming into a synchronous sink: following it could force moving the producer into sync code or buffering the response, changing streaming behavior.
  • How the PR solves it: The PR preserves whole-block offloading for wholly synchronous work while documenting a streaming exception: keep the async producer awaited and sequentially offload each sink operation, including open and close. It updates the prescription sources and rule description, with focused tests that check the on-loop write is reported and the offloaded streaming form is not; detection itself is unchanged.

$0.037 of $1.00 · 35 model calls · 0 failed requests

Full summary · Run log

@atlan-ci atlan-ci left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lens: ready to merge — every finding at every level is resolved (round 2).

@cmgrote
cmgrote added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit a17fa9a Nov 3, 2026
29 checks passed
@cmgrote
cmgrote deleted the conformance/rule-fix/p023 branch November 3, 2026 12:14
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