Skip to content

feat(odoo_patch): import tools in module_graph patch#17

Draft
sentry-hz-ledoweb[bot] wants to merge 1 commit into
ledoentfrom
seer/feat/import-odoo-tools
Draft

feat(odoo_patch): import tools in module_graph patch#17
sentry-hz-ledoweb[bot] wants to merge 1 commit into
ledoentfrom
seer/feat/import-odoo-tools

Conversation

@sentry-hz-ledoweb
Copy link
Copy Markdown

Fixes OPENUPGRADE-LAB-3. The issue was that: Odoo process queries uninitialized database repro_a for ir_module_module table, which does not exist, causing repeated errors.

  • Added 'from odoo import tools' to 'openupgrade_framework/odoo_patch/odoo/modules/module_graph.py'.
  • This import likely prepares for or resolves a dependency for other changes within the patched module_graph.

This fix was generated by Seer in Sentry, triggered by dkendall@ledoweb.com. 👁️ Run ID: 12

dnplkndll added a commit to ledoent/seer that referenced this pull request May 21, 2026
…gnosis taxonomy, confidence gate, openupgrade context

PR feedback on the first autofix-generated PR
(ledoent/OpenUpgrade#17, which landed
'import tools' instead of the planned ir_module_module check)
called out six classes of needed improvement. This PR lands four.

A. Hallucination guards (coding system prompt)
  - Causal connection: state in ONE sentence how the change prevents
    the specific error before any edit. Vague rationales are red flags.
  - Symbol usage: imports added must appear in the file body.
  - File targeting: stack-frame file ≠ fix file for MISSING STATE
    symptoms (database, table, module, config).

D. Diagnosis taxonomy (solution system prompt)
  Explicit two-list classification: symptoms that almost never map to
  code fixes (database/table missing, permission denied, module not
  installed, connection refused, repeated startup errors, multi-DB
  patterns) → investigation outcome; symptoms that do (AttributeError,
  invalid-field, IntegrityError, concrete type errors) → code change.

E. Confidence calibration + gate
  Solution prompt: avoid weasel words; high confidence requires exact
  file+line + named cause + intent preservation.
  Code gate in commit_changes: solution_step.proceed_confidence_score
  below AUTOFIX_PR_MIN_CONFIDENCE (new AppConfig field, default 0.7)
  produces branch + diff but skips the PR. Surfaces low-confidence
  runs to humans. AUTOFIX_PR_MIN_CONFIDENCE=0.0 disables.

F-partial. Repo context (openupgrade-lab)
  Shared note in both prompts: monkey-patch caution, bind-mount
  awareness, multi-DB-symptom-as-operator-state heuristic, commit
  conventions.

Cassette re-recorded: 10 calls (4 view + 6 str_replace), 661 KB.
Bigger than v4 because the longer system prompt produces longer
Gemini request bodies — but ir_module_module on-plan assertion still
holds.

Unit tests for the gate: low-confidence → branch only, no PR;
high-confidence → both as before.

Drive-by fix: B019 in get_org_slug (functools.lru_cache on a method).
Replaced with a per-instance dict cache. Same behavior, no memory
leak. Triggered by this PR touching the file.

Deferred to separate PRs:
B. per-repo commit/branch conventions (needs PR-creation code change)
C. self-validation gates with ruff/pyflakes as a new tool
F-full. per-project context injection (openupgrade-lab is hardcoded for now)
dnplkndll added a commit to ledoent/seer that referenced this pull request May 21, 2026
…gnosis taxonomy, confidence gate, openupgrade context (#18)

* feat(autofix): hardening from PR feedback — hallucination guards, diagnosis taxonomy, confidence gate, openupgrade context

PR feedback on the first autofix-generated PR
(ledoent/OpenUpgrade#17, which landed
'import tools' instead of the planned ir_module_module check)
called out six classes of needed improvement. This PR lands four.

A. Hallucination guards (coding system prompt)
  - Causal connection: state in ONE sentence how the change prevents
    the specific error before any edit. Vague rationales are red flags.
  - Symbol usage: imports added must appear in the file body.
  - File targeting: stack-frame file ≠ fix file for MISSING STATE
    symptoms (database, table, module, config).

D. Diagnosis taxonomy (solution system prompt)
  Explicit two-list classification: symptoms that almost never map to
  code fixes (database/table missing, permission denied, module not
  installed, connection refused, repeated startup errors, multi-DB
  patterns) → investigation outcome; symptoms that do (AttributeError,
  invalid-field, IntegrityError, concrete type errors) → code change.

E. Confidence calibration + gate
  Solution prompt: avoid weasel words; high confidence requires exact
  file+line + named cause + intent preservation.
  Code gate in commit_changes: solution_step.proceed_confidence_score
  below AUTOFIX_PR_MIN_CONFIDENCE (new AppConfig field, default 0.7)
  produces branch + diff but skips the PR. Surfaces low-confidence
  runs to humans. AUTOFIX_PR_MIN_CONFIDENCE=0.0 disables.

F-partial. Repo context (openupgrade-lab)
  Shared note in both prompts: monkey-patch caution, bind-mount
  awareness, multi-DB-symptom-as-operator-state heuristic, commit
  conventions.

Cassette re-recorded: 10 calls (4 view + 6 str_replace), 661 KB.
Bigger than v4 because the longer system prompt produces longer
Gemini request bodies — but ir_module_module on-plan assertion still
holds.

Unit tests for the gate: low-confidence → branch only, no PR;
high-confidence → both as before.

Drive-by fix: B019 in get_org_slug (functools.lru_cache on a method).
Replaced with a per-instance dict cache. Same behavior, no memory
leak. Triggered by this PR touching the file.

Deferred to separate PRs:
B. per-repo commit/branch conventions (needs PR-creation code change)
C. self-validation gates with ruff/pyflakes as a new tool
F-full. per-project context injection (openupgrade-lab is hardcoded for now)

* chore(autofix): bugbot review — drop overreaching multi-DB rule + document fail-open

Self-review of PR #18 surfaced two findings:

1. The `<diagnosis_taxonomy>` block in solution prompts listed
   "multi-database error patterns" as a general signal of operator
   state, not code. That's right for openupgrade-lab but wrong for
   multi-tenant apps where per-tenant DBs DO map to real provisioning
   code bugs. Removed from the general taxonomy. The openupgrade-lab-
   specific framing stays in <repo_context> where it's anchored to
   the dev names (`repro_a`, `seed_*`, `openupgrade_test`) that
   actually indicate operator state in this fork.

2. The confidence gate fails OPEN when proceed_confidence_score is
   None (older runs, restart-from-point flows, manual handoff). That
   was intentional — we only want to fire on observed low confidence,
   not absence-of-signal — but the choice wasn't documented in code.
   Added an inline rationale so the next reader doesn't accidentally
   flip the polarity.

Cassette stays valid: the coding cassette only captures coding-step
Gemini calls, and the multi-DB removal touched only the solution
prompt. vcrpy default matchers ignore body, so even where the system
prompt differs the cassette replay matches by URI.
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.

0 participants