Skip to content

feat(describe): make the changes-diagram direction configurable and adaptive - #2598

Merged
naorpeled merged 6 commits into
The-PR-Agent:mainfrom
IsmaelMartinez:feature/adaptive-diagram-direction
Aug 6, 2026
Merged

naorpeled merged 6 commits into
The-PR-Agent:mainfrom
IsmaelMartinez:feature/adaptive-diagram-direction

Conversation

@IsmaelMartinez

Copy link
Copy Markdown
Collaborator

Picks the /describe changes-diagram direction from the shape of the graph instead of
hard-coding LR. A diagram whose longest chain exceeds
pr_description.pr_diagram_direction_threshold (default 5) is drawn top-down, so wide diagrams
stop being scaled down until unreadable on GitLab. pr_description.pr_diagram_direction pins it
to LR or TD instead.

Deterministic post-processing next to sanitize_diagram() — no prompt or token-cost change. Any
parse failure, cycle or non-flowchart diagram is returned untouched.

One open question: I've defaulted to adaptive. The conservative choice is LR, which preserves
today's behaviour exactly and makes this opt-in. I leaned the other way because GitLab has no
expand control on a rendered diagram — once it's scaled down there's no way to see it, so the
status quo fails silently for the people it affects most. Happy to flip the default if you'd
rather ship it opt-in.

Closes #2597

IsmaelMartinez and others added 4 commits August 5, 2026 21:17
…hain

Refs: AI-189

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Refs: AI-189

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…daptive

Refs: AI-189

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Use graphlib.TopologicalSorter for the longest-chain calculation, drop the
statement-keyword list the connector check already covers, share the setting
defaults through module constants, and parametrize the direction tests.

Refs: AI-189

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the feature 💡 label Aug 5, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Adaptive Mermaid PR-changes diagram direction with configurable threshold

✨ Enhancement 🧪 Tests 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

AI Description

• Automatically choose Mermaid flowchart direction (LR vs TD) based on longest node chain length.
• Add pr_diagram_direction and pr_diagram_direction_threshold settings to pin or tune behavior.
• Update docs and add unit tests for edge parsing, chain measurement, and direction selection.
Diagram

graph TD
  A["PRDescription _prepare_data"] --> B["sanitize_diagram"] --> C["apply_diagram_direction"] --> D["_parse_diagram_edges"] --> E["_longest_diagram_chain"]
  C --> F[("pr_description settings")]
  subgraph Legend
    direction LR
    _proc["Process"] ~~~ _cfg[("Config")]
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Default to LR (opt-in adaptive)
  • ➕ Preserves existing behavior exactly; lowest rollout risk
  • ➕ Avoids surprising direction changes in existing installations
  • ➖ Does not fix unreadable scaled-down diagrams unless users discover and enable the setting
2. Use a Mermaid render/config override instead of rewriting headers
  • ➕ Avoids parsing Mermaid syntax; fewer correctness edge cases
  • ➖ GitLab rendering/scaling controls are limited; may not reliably prevent downscaling
  • ➖ Mermaid doesn’t provide a true auto-direction feature to solve width issues
3. Heuristic based on node/edge counts or max out-degree instead of longest chain
  • ➕ Simpler to compute; less sensitive to parsing corner cases
  • ➖ Less aligned with the actual ‘width’ driver for LR layouts (longest path)
  • ➖ More false positives/negatives for flipping direction

Recommendation: The PR’s approach (deterministic post-processing that flips direction based on longest-chain length, with safe fallbacks) is a good fit for GitLab’s diagram scaling limitations and avoids prompt/token changes. The main product decision is the default: keeping adaptive by default maximizes practical readability wins, while LR default is safer for backward-compatibility. If rollout risk is a concern, consider shipping adaptive behind a config default of LR for one release, then switching the default after gathering feedback.

Files changed (4) +257 / -4

Enhancement (1) +107 / -1
pr_description.pyAdapt Mermaid flowchart direction by parsing edges and longest chain +107/-1

Adapt Mermaid flowchart direction by parsing edges and longest chain

• Adds deterministic post-processing to rewrite 'flowchart/graph' headers to LR or TD based on settings and computed longest-path length. Implements tolerant Mermaid edge extraction (ignoring labels/comments/structural statements), computes longest chain via 'graphlib.TopologicalSorter', and falls back to returning the original diagram on parse failures, cycles, non-flowchart diagrams, or missing edges.

pr_agent/tools/pr_description.py

Tests (1) +137 / -2
test_pr_description.pyAdd unit tests for edge parsing, longest-chain, and direction selection +137/-2

Add unit tests for edge parsing, longest-chain, and direction selection

• Extends '_prepare_data' tests to verify adaptive flipping and pinned direction behavior. Adds focused test suites for Mermaid edge parsing variants, longest-chain calculation (including cycle detection), and 'apply_diagram_direction' behavior across headers, thresholds, and failure cases.

tests/unittest/test_pr_description.py

Documentation (1) +11 / -1
describe.mdDocument adaptive changes-diagram direction and new settings +11/-1

Document adaptive changes-diagram direction and new settings

• Explains that the changes diagram direction is now chosen based on the diagram’s longest chain length. Adds documentation for 'pr_diagram_direction' (adaptive/LR/TD) and 'pr_diagram_direction_threshold', and updates wording to remove the assumption of horizontal-only diagrams.

docs/docs/tools/describe.md

Other (1) +2 / -0
configuration.tomlAdd defaults for pr_diagram_direction and threshold +2/-0

Add defaults for pr_diagram_direction and threshold

• Introduces 'pr_diagram_direction='adaptive'' and 'pr_diagram_direction_threshold=5' to control/pin Mermaid flowchart direction selection for '/describe' PR change diagrams.

pr_agent/settings/configuration.toml

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Single-quoted strings in tests 📘 Rule violation ⚙ Maintainability
Description
New/modified Python and test code introduces single-quoted string literals where the repository
formatting standard requires double quotes, creating inconsistent style across the codebase. This
reduces consistency and may trigger style/lint failures.
Code

tests/unittest/test_pr_description.py[R18-20]

+SHORT_CHAIN = 'A --> B --> C'
+THRESHOLD_CHAIN = 'A --> B --> C --> D --> E'
+LONG_CHAIN = 'A --> B --> C --> D --> E --> F'
Evidence
PR Compliance ID 13 requires Python changes to follow repository formatting standards including a
double-quote preference, but the cited additions show single-quoted literals in multiple places: the
tests define constants/defaults with single quotes (e.g., SHORT_CHAIN = 'A --> B --> C' in
tests/unittest/test_pr_description.py[15-38]) and the diagram-direction logic similarly introduces
single-quoted strings (e.g., DIAGRAM_LABEL_OPENERS = ('--', '==', '-.') in
pr_agent/tools/pr_description.py[813-913]), demonstrating nonconformance with the required quoting
style.

CLAUDE.md, AGENTS.md: Python Code Must Conform to Repository Linting and Formatting Standards (Ruff/Import Ordering/Quotes): CLAUDE.md, AGENTS.md: Python Code Must Conform to Repository Linting and Formatting Standards (Ruff/Import Ordering/Quotes)
tests/unittest/test_pr_description.py[18-20]
pr_agent/tools/pr_description.py[821-821]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Update new/modified Python and test code to use double-quoted string literals instead of single-quoted ones to comply with the repository formatting standard and keep style consistent.
## Issue Context
PR Compliance ID 13 requires adherence to repository formatting standards, including a double-quote preference for Python strings. The touched test file already contains double-quoted strings in other places (e.g., `KEYS_FIX`), but the new constants/defaults were added with single quotes, and the PR’s diagram direction logic adds additional single-quoted literals (including regex/tuple contents and return values), creating style drift and potential lint/formatting issues.
## Fix Focus Areas
- tests/unittest/test_pr_description.py[15-38]
- pr_agent/tools/pr_description.py[813-913]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Reverse arrows misparsed 🐞 Bug ≡ Correctness
Description
_parse_diagram_edges() always builds edges left-to-right between node groups and ignores connector
direction, so reverse connectors like  B instead of B -> A. This can change the computed longest
chain and flip the chosen diagram direction incorrectly under adaptive mode.
Code

pr_agent/tools/pr_description.py[R864-866]

+        for left, right in zip(node_groups, node_groups[1:], strict=False):
+            edges.extend((source, target) for source in left for target in right)
+    return edges
Evidence
The connector regex explicitly matches an optional leading '<', but edge generation always links
consecutive node groups as (source,target) in left-to-right order without checking whether the
connector was reverse-directed, so reverse arrows are necessarily misinterpreted.

pr_agent/tools/pr_description.py[813-866]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`_parse_diagram_edges()` extracts “directed edges” but currently discards the actual connector token when creating edges. Because `DIAGRAM_CONNECTOR_PATTERN` matches connectors with an optional leading `<`, reverse-arrow connectors (e.g. `<--`) will be parsed as forward edges, which can inflate/deflate `_longest_diagram_chain()` and lead `apply_diagram_direction()` to pick the wrong orientation.
### Issue Context
The parser already captures connector tokens via `DIAGRAM_CONNECTOR_PATTERN.split(cleaned)` but only uses connectors to skip label chunks. Edge construction uses only the order of node groups.
### Fix Focus Areas
- pr_agent/tools/pr_description.py[813-910]
- tests/unittest/test_pr_description.py[203-244]
### Suggested approach
- While building `node_groups`, also retain the originating `parts` index (or otherwise keep enough information to look up the connector(s) between consecutive node groups).
- When generating edges between consecutive node groups, inspect the connector token(s) between them:
- If the final connector token is reverse-only (starts with `<` and does not end with `>`), swap source/target.
- If bidirectional (both `<` and `>`), either add both directions (accepting that cycles will cause `apply_diagram_direction()` to leave the diagram untouched) or choose a consistent single direction.
- Add unit tests for reverse connectors, e.g.:
- `A <-- B` should yield `[('B','A')]`
- `A <-- B --> C` should yield `[('B','A'), ('B','C')]`

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Defaults test env-flaky 🐞 Bug ☼ Reliability
Description
The new test test_shipped_defaults_match_what_these_tests_assume() asserts Dynaconf runtime
settings equal the shipped defaults, but the settings loader is explicitly configured to allow
environment variables to take precedence. This can cause the test to fail depending on the runner
environment, even if configuration.toml is unchanged.
Code

tests/unittest/test_pr_description.py[R275-278]

+    """Guards the test defaults above against drift in configuration.toml."""
+    from pr_agent.config_loader import get_settings
+    assert get_settings().pr_description.pr_diagram_direction == 'adaptive'
+    assert get_settings().pr_description.pr_diagram_direction_threshold == 5
Evidence
The test asserts against get_settings(), but the settings loader includes an environment-variable
loader with precedence, and other tests demonstrate the SECTION__KEY env override convention, so
environment variables can legitimately change these values and break the assertion.

tests/unittest/test_pr_description.py[274-278]
pr_agent/config_loader.py[12-16]
tests/unittest/test_extra_config_url.py[594-623]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`test_shipped_defaults_match_what_these_tests_assume()` currently asserts `get_settings().pr_description.*` equals the defaults. But `get_settings()` is environment-overridable by design, so this test is not stable across environments.
### Issue Context
Dynaconf is configured with an env loader and the repo already relies on env vars being highest precedence (including the `SECTION__KEY` convention). This means `PR_DESCRIPTION__PR_DIAGRAM_DIRECTION` or `PR_DESCRIPTION__PR_DIAGRAM_DIRECTION_THRESHOLD` can change `get_settings()`.
### Fix Focus Areas
- tests/unittest/test_pr_description.py[274-278]
- pr_agent/config_loader.py[12-16]
### Suggested approach
- Instead of calling `get_settings()` for this assertion, parse the shipped `pr_agent/settings/configuration.toml` directly (e.g., `tomllib.load(...)`) and assert the `[pr_description]` keys.
- This validates “shipped defaults” independent of env overrides.
- Alternatively, explicitly clear the relevant env vars for the duration of this test (and, if needed, reload env into settings), but reading the TOML file is the most direct way to test shipped defaults.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View more (3)
4. DEFAULT_DIAGRAM_DIRECTION* duplicates defaults ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
pr_diagram_direction and pr_diagram_direction_threshold defaults are hardcoded in Python
(DEFAULT_DIAGRAM_DIRECTION*) even though they are already defined in
pr_agent/settings/configuration.toml, creating duplicated sources of truth that can drift. Prefer
sourcing defaults only from Dynaconf settings to keep runtime behavior single-sourced.
Code

pr_agent/tools/pr_description.py[R820-822]

+DEFAULT_DIAGRAM_DIRECTION = 'adaptive'
+DEFAULT_DIAGRAM_DIRECTION_THRESHOLD = 5
+
Evidence
Rule 11 and Rule 17 require runtime-tunable values and their defaults to be single-sourced in
Dynaconf settings rather than duplicated in code. The PR adds the same default values in
configuration.toml and again as Python constants used as fallback defaults in the
diagram-direction logic.

AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/): AGENTS.md: Avoid Hardcoded Runtime Configuration (Use .pr_agent.toml and pr_agent/settings/)
CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files): CLAUDE.md, AGENTS.md: Keep Prompt/Config Values Single-Sourced (Do Not Fork the Same Defaults Across Files)
pr_agent/settings/configuration.toml[133-135]
pr_agent/tools/pr_description.py[820-822]
pr_agent/tools/pr_description.py[476-482]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The defaults for `pr_description.pr_diagram_direction` and `pr_description.pr_diagram_direction_threshold` are defined both in `pr_agent/settings/configuration.toml` and again in Python (`DEFAULT_DIAGRAM_DIRECTION`, `DEFAULT_DIAGRAM_DIRECTION_THRESHOLD`). This duplication risks configuration drift and violates the single-source-of-truth configuration approach.
## Issue Context
The Dynaconf settings already provide authoritative defaults via `pr_agent/settings/configuration.toml`. The Python code should not re-declare those same defaults; instead it should read the values from settings and pass them through.
## Fix Focus Areas
- pr_agent/tools/pr_description.py[473-482]
- pr_agent/tools/pr_description.py[814-907]
- pr_agent/settings/configuration.toml[133-135]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Invalid direction still rewrites 🐞 Bug ≡ Correctness
Description
apply_diagram_direction() states that an unusable direction setting leaves the diagram untouched,
but any value other than LR/TD currently falls into the adaptive branch and may rewrite the
flowchart header. A mis-typed config value can therefore unexpectedly flip diagram direction when
edges are parseable.
Code

pr_agent/tools/pr_description.py[R897-900]

+        requested = str(direction).strip().upper()
+        if requested in ('LR', 'TD'):
+            chosen = requested
+        else:
Evidence
The docstring promises no changes for unusable settings, but the control flow adapts for any
non-LR/TD value and can rewrite the header line.

pr_agent/tools/pr_description.py[883-907]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`apply_diagram_direction()` claims that “an unusable setting” returns the diagram untouched, but the implementation treats every non-`LR`/`TD` value as `adaptive` and may rewrite the header.
## Issue Context
This can silently change output when users misconfigure `pr_description.pr_diagram_direction` (typo/unsupported value).
## Fix Focus Areas
- pr_agent/tools/pr_description.py[883-907]
## Suggested fix
- Explicitly recognize `ADAPTIVE` (and possibly empty/None) as the only values that trigger adaptive behavior.
- For any other non-`LR`/`TD` value, return `diagram` unchanged (optionally log a debug message about invalid config).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Edge labels parsed as nodes ✓ Resolved 🐞 Bug ≡ Correctness
Description
_strip_diagram_labels() only removes quoted and pipe-form labels, so an unquoted edge label between
connectors can survive and be treated as a node ID by _parse_diagram_edges(). This can inflate the
computed longest chain and cause apply_diagram_direction() to flip diagrams incorrectly (especially
near the threshold).
Code

pr_agent/tools/pr_description.py[R855-858]

+            for token in chunk.split('&'):
+                match = DIAGRAM_NODE_ID_PATTERN.search(token)
+                if match:
+                    node_ids.append(match.group(0))
Evidence
Label stripping removes only quoted/pipe labels, while node extraction uses a regex search on each
connector-split chunk, allowing plain words to become node IDs.

pr_agent/tools/pr_description.py[824-864]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The edge parser strips only quoted (`"..."`) and pipe (`|...|`) labels. If a diagram uses an unquoted edge label chunk between connectors, `_parse_diagram_edges()` can interpret that label text as a node ID, skewing longest-chain measurement and direction selection.
## Issue Context
This PR’s adaptive direction feature depends on `_parse_diagram_edges()` producing a faithful edge list. Mis-parsing label text as nodes changes the path length calculation.
## Fix Focus Areas
- pr_agent/tools/pr_description.py[824-864]
## Suggested fix
- Extend label stripping to remove/ignore unquoted edge-label segments between connectors (so they don’t become `node_groups`).
- Alternatively, replace the “split on connectors + search token” approach with a more explicit edge matcher that extracts only endpoint node IDs around connectors.
- Add a regression unit test for a line shaped like `A -- calls --> B` to ensure it yields only `('A','B')` and does not affect direction selection.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


  • Author self-review: I have reviewed the code review findings, and addressed the relevant ones.

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Read the direction settings from Dynaconf only, so configuration.toml stays the
single source of the defaults. Treat an unrecognised direction as adaptive and
log it, matching the docstring. Detect two-character connectors as middle-label
openers so an unquoted edge label no longer counts as a node in the chain.

Refs: AI-189

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

Grey Divider

New Review Started

This review has been superseded by a new analysis

Grey Divider

Qodo Logo

@IsmaelMartinez

Copy link
Copy Markdown
Collaborator Author

Thanks — all three applied in 796109e8.

Duplicated defaults. The Python constants are gone. apply_diagram_direction now takes direction and threshold as required arguments and the call site reads them straight from Dynaconf, so configuration.toml is the only place the defaults live. Added a test asserting the shipped settings still match what the unit tests assume, so drift fails loudly rather than silently.

Invalid direction. Fixed, though as a fallback rather than a no-op: an unrecognised value now logs a debug line and uses adaptive, and the docstring says that instead of promising no change. Returning the diagram untouched on a typo would silently disable the feature, which seemed worse than falling back to the documented default.

Unquoted edge labels. Good catch — this was a real mis-parse. A two-character connector (--, ==, -.) now marks a middle-label opener, so A -- calls --> B yields one edge, while A --- B --> C still reads as a three-node chain since --- is a real link. A four-node chain written with unquoted labels used to measure 7 and now measures 4.

A misconfigured pr_diagram_direction falls back to adaptive; log it loudly
enough to be noticed rather than silently.

Refs: AI-189

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@IsmaelMartinez

Copy link
Copy Markdown
Collaborator Author

On the remaining "invalid direction still rewrites" finding — the defect was real but it was in the docstring, which promised no change while the code fell back to adaptive. That's fixed, and I've kept the fallback rather than making an unrecognised value a no-op: a typo in pr_diagram_direction silently disabling the feature seems worse than falling back to the documented default.

The fair half of the objection was "silently", so in 030602fe the fallback logs at warning rather than debug. A misconfiguration is now visible in the logs instead of invisible.

Happy to switch to a strict no-op if a maintainer prefers that — it's a one-line change either way.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 030602f

@naorpeled

Copy link
Copy Markdown
Member

Hey @IsmaelMartinez,
Thanks for this, I'm good with making the breaking change as we're pre v1 and this will be released in the next minor 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(describe): choose changes-diagram direction from graph shape instead of hard-coding LR

2 participants