Skip to content

Rename tips references to guidelines#215

Merged
visahak merged 6 commits into
mainfrom
codex/locate-keyword-tips-references
Apr 25, 2026
Merged

Rename tips references to guidelines#215
visahak merged 6 commits into
mainfrom
codex/locate-keyword-tips-references

Conversation

@gaodan-fang
Copy link
Copy Markdown
Collaborator

@gaodan-fang gaodan-fang commented Apr 22, 2026

Summary

  • Rename the tip-generation and consolidation surface to guidelines throughout the repo.
  • Update the core schema, LLM prompts, client/CLI/MCP wiring, docs, examples, and tests to use guideline terminology consistently.
  • Remove the old tips module paths in favor of the new guidelines structure.

Testing

  • Unit tests covering guideline generation, consolidation, Phoenix sync, MCP, CLI, and clustering passed.

Summary by CodeRabbit

  • Breaking Changes

    • Runtime, CLI outputs, API fields, and metrics renamed from “tips” to “guidelines”; config key tips_model → guidelines_model (legacy key honored as deprecated fallback).
  • Updates

    • UI text, placeholders, docs, examples, and demos now use “guideline” wording; sync/publish flows and reports show guideline counts.
  • Tests & Compatibility

    • Tests updated to reflect wording changes; a backward-compatible property emits a deprecation warning mapping old tips metrics to guidelines.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 2026

Warning

Rate limit exceeded

@gaodan-fang has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 42 minutes and 23 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 42 minutes and 23 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3c063970-6d1a-47ef-a8a9-6e2f01a06964

📥 Commits

Reviewing files that changed from the base of the PR and between 2e0ca27 and 326f81c.

⛔ Files ignored due to path filters (4)
  • docs/assets/architecture-dark.svg is excluded by !**/*.svg
  • docs/assets/architecture-light.svg is excluded by !**/*.svg
  • docs/assets/architecture-wide-dark.svg is excluded by !**/*.svg
  • docs/assets/architecture-wide-light.svg is excluded by !**/*.svg
📒 Files selected for processing (48)
  • AGENTS.md
  • CHANGELOG.md
  • README.md
  • altk_evolve/cli/cli.py
  • altk_evolve/config/llm.py
  • altk_evolve/frontend/api/routes.py
  • altk_evolve/frontend/client/evolve_client.py
  • altk_evolve/frontend/mcp/mcp_server.py
  • altk_evolve/frontend/ui/src/components/CreateEntityModal.tsx
  • altk_evolve/llm/guidelines/__init__.py
  • altk_evolve/llm/guidelines/clustering.py
  • altk_evolve/llm/guidelines/guidelines.py
  • altk_evolve/llm/guidelines/prompts/combine_guidelines.jinja2
  • altk_evolve/llm/guidelines/prompts/generate_guidelines.jinja2
  • altk_evolve/schema/guidelines.py
  • altk_evolve/schema/tips.py
  • altk_evolve/sync/phoenix_sync.py
  • docs/archive/save-session-as-skill-design.md
  • docs/guides/configuration.md
  • docs/guides/low-code-tracing.md
  • docs/guides/phoenix-sync.md
  • examples/low_code/litellm_demo.py
  • examples/low_code/manual_phoenix_demo.py
  • examples/low_code/openai_agents_demo.py
  • examples/low_code/simple_openai.py
  • examples/low_code/smolagents_demo.py
  • platform-integrations/bob/evolve-full/custom_modes.yaml
  • platform-integrations/claude/plugins/evolve-lite/skills/recall/SKILL.md
  • platform-integrations/claude/plugins/evolve-lite/skills/save/SKILL.md
  • platform-integrations/codex/plugins/evolve-lite/skills/recall/SKILL.md
  • tests/e2e/test_e2e_pipeline.py
  • tests/e2e/test_mcp.py
  • tests/platform_integrations/conftest.py
  • tests/platform_integrations/test_audit.py
  • tests/platform_integrations/test_codex_sharing.py
  • tests/platform_integrations/test_entity_io_core.py
  • tests/platform_integrations/test_publish.py
  • tests/platform_integrations/test_retrieve.py
  • tests/platform_integrations/test_save_entities.py
  • tests/platform_integrations/test_subscribe.py
  • tests/platform_integrations/test_sync.py
  • tests/unit/test_cli.py
  • tests/unit/test_clustering.py
  • tests/unit/test_combine_guidelines.py
  • tests/unit/test_guidelines.py
  • tests/unit/test_llm_config.py
  • tests/unit/test_mcp_server.py
  • tests/unit/test_phoenix_sync.py
📝 Walkthrough

Walkthrough

Renames and migrates "tips" to "guidelines" across code, tests, prompts, docs, examples, and configs: adds a new guidelines schema, removes the tips schema, updates LLM prompts/handlers, config keys, CLI/client/sync/MCP flows, UI placeholders, and extensive test updates to use guideline terminology and fields.

Changes

Cohort / File(s) Summary
Schema & Types
altk_evolve/schema/guidelines.py, altk_evolve/schema/tips.py
Adds Guideline models and result dataclasses; removes legacy tips.py.
LLM generation & clustering
altk_evolve/llm/guidelines/guidelines.py, altk_evolve/llm/guidelines/clustering.py, altk_evolve/llm/guidelines/prompts/*
Replaces tips-generation/clustering with guidelines variants, switches response parsing to guidelines keys and uses llm_settings.guidelines_model.
Config
altk_evolve/config/llm.py, docs/guides/configuration.md
Introduces guidelines_model (env EVOLVE_GUIDELINES_MODEL) with backward-compat fallback to EVOLVE_TIPS_MODEL; docs updated.
Client / CLI / Sync / MCP
altk_evolve/frontend/client/evolve_client.py, altk_evolve/cli/cli.py, altk_evolve/sync/phoenix_sync.py, altk_evolve/frontend/mcp/mcp_server.py
Renames public/internal methods and result fields to guidelines (cluster/consolidate/generate), updates sync accounting and adds ValueError handling for unavailable clustering/consolidation.
API & UI
altk_evolve/frontend/api/routes.py, altk_evolve/frontend/ui/src/components/CreateEntityModal.tsx
Pre-insert validation now targets Guideline schema when structured metadata present; UI placeholders changed from "tip" → "guideline".
Prompts / Templates
altk_evolve/llm/guidelines/prompts/*.jinja2
Prompt templates updated to request/emit a top-level "guidelines" JSON array and guideline-specific wording.
Examples & Demos
examples/low_code/*, examples/low_code/.../manual_phoenix_demo.py
Model-fallbacks updated to prefer EVOLVE_GUIDELINES_MODEL / llm_settings.guidelines_model.
Platform integrations & configs
platform-integrations/.../*.yaml, platform-integrations/.../SKILL.md
Text and example filenames updated to guideline terminology.
Docs & README/CHANGELOG
README.md, CHANGELOG.md, docs/guides/*, docs/archive/*
Prose, anchors, and provenance wording changed from tips → guidelines; links updated.
Tests (unit, integration, e2e)
tests/unit/*, tests/platform_integrations/*, tests/e2e/*, tests/**/conftest.py
Extensive test updates: fixtures, mocks, patch targets, filenames, assertions, regexes, and result fields switched to guidelines; new LLM-settings unit tests added.
CLI tests & behavior
tests/unit/test_cli.py
Tests updated for renamed sync stats and added tests asserting user-facing messages when consolidation is unavailable.
Miscellaneous small edits
platform-integrations/bob/.../custom_modes.yaml, docs/*, examples/*
Numerous small textual/filepath edits adopting "guideline" terminology across examples and configs.

Sequence Diagram(s)

(Skipped)

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • visahak
  • vinodmut
  • jayaramkr

Poem

🐰 I hopped through code both near and wide,
Swapped every "tip" for a steady "guide".
Prompts, schemas, tests all realigned,
Docs and demos neatly redesigned.
A small rabbit hop — a tidy stride.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 39.80% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title "Rename tips references to guidelines" is concise and accurately summarizes the primary change: systematically renaming tip-related terminology to guideline terminology across the codebase.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/locate-keyword-tips-references

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
docs/guides/configuration.md (1)

22-50: ⚠️ Potential issue | 🟠 Major

Environment variable for guidelines generation has been silently renamed without backward compatibility.

The field guidelines_model in altk_evolve/config/llm.py binds to EVOLVE_GUIDELINES_MODEL (via pydantic-settings with env_prefix="EVOLVE_"), not EVOLVE_TIPS_MODEL as documented. Without an alias, setting EVOLVE_TIPS_MODEL will be silently ignored and the default model used instead.

The documentation at lines 22, 30, and 46 of docs/guides/configuration.md references the old EVOLVE_TIPS_MODEL. Additionally, examples/low_code/manual_phoenix_demo.py still reads EVOLVE_TIPS_MODEL directly from the environment, which only works because it bypasses pydantic-settings.

Either:

  • Update the docs and examples to use EVOLVE_GUIDELINES_MODEL, or
  • Add a validation_alias to the field to preserve backward compatibility for EVOLVE_TIPS_MODEL and document both names with the old one marked as deprecated.

(Note: EVOLVE_CONFLICT_RESOLUTION_MODEL and EVOLVE_FACT_EXTRACTION_MODEL are correctly named in both code and docs.)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/guides/configuration.md` around lines 22 - 50, The docs/examples
reference EVOLVE_TIPS_MODEL but the code field guidelines_model in
altk_evolve/config/llm.py binds to EVOLVE_GUIDELINES_MODEL, so EVOLVE_TIPS_MODEL
is ignored; either restore backward compatibility by adding a validation_alias
to the guidelines_model field to accept the legacy name (so pydantic-settings
will read EVOLVE_TIPS_MODEL as well), or update docs and examples to use
EVOLVE_GUIDELINES_MODEL (and mark EVOLVE_TIPS_MODEL deprecated) — if you choose
compatibility, modify guidelines_model in altk_evolve/config/llm.py to include a
validation_alias for the legacy env name, and if you choose documentation,
update docs/guides/configuration.md (lines referencing EVOLVE_TIPS_MODEL) and
examples/low_code/manual_phoenix_demo.py to read EVOLVE_GUIDELINES_MODEL instead
and add a deprecation note for EVOLVE_TIPS_MODEL.
tests/e2e/test_e2e_pipeline.py (1)

210-248: ⚠️ Potential issue | 🟡 Minor

Require a positive guideline count before passing.

generated 0 guidelines currently sets the success flag, so the E2E test can pass without any guideline being generated. This is also a good spot to finish the stale tips_found rename.

Proposed fix
-    tips_found = False
+    guidelines_found = False
@@
             match = re.search(r"generated (\d+) guidelines", line_stripped)
             if match:
-                count = match.group(1)
-                print(f"\n✅ SUCCESS: Generated {count} guidelines!")
-                tips_found = True
+                count = int(match.group(1))
+                if count > 0:
+                    print(f"\n✅ SUCCESS: Generated {count} guidelines!")
+                    guidelines_found = True
+                    break
-                break
@@
-    if not tips_found:
+    if not guidelines_found:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/test_e2e_pipeline.py` around lines 210 - 248, The test currently
treats any "generated X guidelines" as success even when X is "0" and still uses
the stale variable name tips_found; update the logic so you parse count =
int(match.group(1)) and only set success when count > 0, rename tips_found to
guidelines_found (and update all references including the final if not
guidelines_found: and the success print) to make intent clear and ensure the
test fails when zero guidelines are generated.
altk_evolve/cli/cli.py (1)

353-397: ⚠️ Potential issue | 🟡 Minor

Handle unconfigured guideline clustering without a traceback.

client.cluster_guidelines and client.consolidate_guidelines can raise ValueError when the cluster model is not configured (altk_evolve/frontend/client/evolve_client.py:89-126). The CLI currently misses that path.

🐛 Proposed fix
     try:
         clusters = client.cluster_guidelines(namespace, threshold=effective_threshold)
     except NamespaceNotFoundException:
         console.print(f"[red]Namespace '{namespace}' not found.[/red]")
         raise typer.Exit(1)
+    except ValueError as e:
+        console.print(f"[red]Clustering failed: {e}[/red]")
+        raise typer.Exit(1)
@@
-    except EvolveException as e:
+    except (EvolveException, ValueError) as e:
         console.print(f"[red]Consolidation failed: {e}[/red]")
         raise typer.Exit(1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@altk_evolve/cli/cli.py` around lines 353 - 397, The CLI currently only
catches NamespaceNotFoundException and EvolveException but misses ValueError
thrown by client.cluster_guidelines and client.consolidate_guidelines when the
clustering model is unconfigured; update the try/except blocks around
client.cluster_guidelines(...) and client.consolidate_guidelines(...) to also
catch ValueError and handle it cleanly (no traceback) by printing a user-facing
message via console.print (e.g., explain that the clustering model is not
configured and how to configure it) and exiting or returning appropriately;
reference the functions cluster_guidelines and consolidate_guidelines and
preserve existing handling for NamespaceNotFoundException and EvolveException,
adding ValueError handling near those existing except clauses.
altk_evolve/sync/phoenix_sync.py (1)

28-35: ⚠️ Potential issue | 🟡 Minor

Breaking API change: SyncResult.tips_generatedguidelines_generated.

SyncResult is part of the public Python API exercised in docs/guides/phoenix-sync.md (the example code reads result.guidelines_generated). Any external user or script that previously accessed result.tips_generated will fail with AttributeError after upgrading, with no deprecation path.

Consider one of:

  • Add a migration note to the top-level changelog entry for this PR (the current CHANGELOG changes only retroactively rewrite prior release notes — they don't document this rename as a breaking change for the upcoming release).
  • Keep a transitional tips_generated alias (e.g., via a @property) that emits a DeprecationWarning for one release cycle.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@altk_evolve/sync/phoenix_sync.py` around lines 28 - 35, SyncResult introduced
a breaking rename from tips_generated to guidelines_generated; restore a
transitional alias by adding a tips_generated property on the SyncResult
dataclass that returns self.guidelines_generated and emits a DeprecationWarning
(use the warnings module) so existing callers don’t break immediately; implement
the property method on the SyncResult class (keep the dataclass fields
unchanged) and include a short comment noting it’s temporary for one release
cycle.
CHANGELOG.md (1)

38-435: ⚠️ Potential issue | 🟡 Minor

Consider preserving historical changelog entries verbatim.

The changes retroactively rewrite past release notes (v1.0.0 through v1.0.6) to say "guideline" instead of "tip". However, the referenced commits (e.g., d373e7e, d2a4d0a, 8ea2051, 1154b4a, ce1ead3) and PRs (#56, #58, #60, #73, #124) were authored with "tip"/"tips" terminology in their actual commit messages and bodies. Rewriting past changelog entries detaches the file from the git history it summarizes and can mislead users who cross-reference a release note with the underlying commit.

Consider either leaving historical entries untouched and only applying the rename going forward, or adding a one-line note at the top of the changelog explaining the terminology migration.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 38 - 435, The changelog retroactively renames
"tip"/"tips" to "guideline" across historical entries (seen in sections "v1.0.0"
through "v1.0.6" and references like commits `d373e7e`, `d2a4d0a`, `8ea2051`,
`1154b4a`, `ce1ead3`), which breaks fidelity to git history; revert those past
release lines back to the original "tip"/"tips" wording (or preserve the
original phrasing verbatim) and instead add a single-line migration note at the
top of CHANGELOG.md explaining that terminology has been changed moving forward
and mapping "tip" => "guideline" for clarity; update the entries under headings
like "### Bug Fixes" and "### Features" in the historic release blocks
(v1.0.0–v1.0.6) to match the original commit language while leaving new releases
using "guideline".
🧹 Nitpick comments (8)
tests/unit/test_mcp_server.py (1)

26-31: Finish renaming stale test locals.

mock_tip and tip_entity are still tip terminology in a guideline-specific test. Renaming them keeps this test aligned with the PR-wide terminology change.

Proposed cleanup
-        mock_tip = MagicMock()
-        mock_tip.content = "Always write unit tests"
-        mock_tip.category = "testing"
-        mock_tip.rationale = "Helps catch bugs early"
-        mock_tip.trigger = "writing code"
-        mock_result.guidelines = [mock_tip]
+        mock_guideline = MagicMock()
+        mock_guideline.content = "Always write unit tests"
+        mock_guideline.category = "testing"
+        mock_guideline.rationale = "Helps catch bugs early"
+        mock_guideline.trigger = "writing code"
+        mock_result.guidelines = [mock_guideline]
@@
-        tip_entity = entities[0]
-        assert tip_entity.type == "guideline"
+        guideline_entity = entities[0]
+        assert guideline_entity.type == "guideline"

Also applies to: 48-49

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/test_mcp_server.py` around lines 26 - 31, Rename outdated "tip"
locals to guideline terminology: replace mock_tip with mock_guideline (and
tip_entity with guideline_entity) where used to build mock_result.guidelines and
in assertions; update the MagicMock assignments (mock_tip.content, .category,
.rationale, .trigger) to use the new variable name and update any references at
the other occurrence (around the second instance noted) so tests consistently
use mock_guideline/mock_guideline_entity and mock_result.guidelines.
tests/platform_integrations/test_entity_io_core.py (1)

49-58: Prefer the shared platform fixture/helper for filesystem setup.

These changed collision and load fixtures still create files inline. Please use or extend the conftest.py helper fixtures for this test data instead of manual touch() / write_text() setup.

As per coding guidelines, “Use fixtures from conftest.py to create test data (bob_fixtures, file_assertions, etc.) - do not manually create files”.

Also applies to: 144-149

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/platform_integrations/test_entity_io_core.py` around lines 49 - 58,
Replace the inline filesystem setup in tests test_increments_suffix_on_collision
and test_keeps_incrementing (which currently use temp_project_dir /
"my-guideline".touch() and similar) with the shared fixtures/helpers from
conftest.py (e.g., use the project/file creation fixture such as bob_fixtures or
the file-creation helper used elsewhere) so the test data is created via the
reusable fixture instead of manual touch()/write_text(); keep the assertions
that call entity_io.unique_filename unchanged and ensure the fixture produces
the same filenames ("my-guideline.md" and "my-guideline-2.md") so the expected
paths (temp_project_dir / "my-guideline-2.md" and / "my-guideline-3.md") still
match.
tests/platform_integrations/test_retrieve.py (1)

39-47: Use the platform test-data fixture/helper for entity files.

These changed setups still create markdown fixtures inline. Please route guideline fixture creation through the repository’s conftest.py helpers so platform integration test data stays centralized.

As per coding guidelines, “Use fixtures from conftest.py to create test data (bob_fixtures, file_assertions, etc.) - do not manually create files”.

Also applies to: 108-113

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/platform_integrations/test_retrieve.py` around lines 39 - 47, The test
is creating entity markdown files inline using variables own_dir and sub_dir
instead of the central test-data helpers; replace the manual mkdir/write_text
blocks in tests/platform_integrations/test_retrieve.py with the conftest
fixtures (e.g. use the provided bob_fixtures or other test-data helper
functions) to create the owned and subscribed guideline entities and their
metadata, and use file_assertions if assertions about file presence/content are
needed; update both occurrences (the owned entity block and the subscribed
entity block) to call the existing fixture helper APIs rather than manually
writing files.
tests/platform_integrations/test_sync.py (1)

152-174: Finish the local rename from tip to guideline.

tip_one now points at guideline-one.md; renaming it keeps this test aligned with the rest of the PR.

♻️ Proposed cleanup
-        tip_one = p["evolve_dir"] / "entities" / "subscribed" / "alice" / "guideline" / "guideline-one.md"
-        assert tip_one.exists()
+        guideline_one = p["evolve_dir"] / "entities" / "subscribed" / "alice" / "guideline" / "guideline-one.md"
+        assert guideline_one.exists()
@@
-        assert not tip_one.exists()
+        assert not guideline_one.exists()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/platform_integrations/test_sync.py` around lines 152 - 174, Rename the
local test variable `tip_one` to `guideline_one` in
tests/platform_integrations/test_sync.py and update every usage (the Path
construction, the initial exists() assert and the final not exists() assert) so
the name matches the rest of the PR; ensure references to `tip_one` (in the Path
assignment and both asserts) are replaced with `guideline_one` to complete the
local rename from "tip" to "guideline".
altk_evolve/frontend/api/routes.py (1)

216-218: Rename the stale tip_meta local.

This branch now validates Guideline; keeping the old tip name makes the rename incomplete and can confuse future schema work.

♻️ Proposed cleanup
-            tip_meta = {k: v for k, v in req.metadata.items() if k != "content"}
-            Guideline(content=req.content, **tip_meta)
+            guideline_meta = {k: v for k, v in req.metadata.items() if k != "content"}
+            Guideline(content=req.content, **guideline_meta)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@altk_evolve/frontend/api/routes.py` around lines 216 - 218, The local
variable tip_meta is a stale name now that Guideline is being validated; rename
tip_meta to a clearer name (e.g., guideline_meta or guideline_kwargs) in the
block where you build metadata from req.metadata and where you pass it into
Guideline(content=req.content, **...), update any other references in the same
scope to use the new name, and run tests to ensure no remaining references to
tip_meta remain (look for usages around the Guideline call and any subsequent
code in routes.py).
tests/unit/test_cli.py (1)

655-671: Assert the renamed result label, not only the count.

The 20 assertion would still pass if the CLI accidentally printed a stale “Tips generated” row. Add an explicit label check for this rename.

🧪 Proposed test hardening
             assert result.exit_code == 0
             assert "Sync Results" in result.stdout
+            assert "Guidelines generated" in result.stdout
             assert "10" in result.stdout  # processed
             assert "5" in result.stdout  # skipped
             assert "20" in result.stdout  # guidelines_generated
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/test_cli.py` around lines 655 - 671, In
test_sync_phoenix_displays_results, the test currently only checks numeric
counts; update it to assert the explicit renamed label appears (e.g., check that
"Guidelines generated" is present in result.stdout after runner.invoke(app,
["sync", "phoenix"]) and that the line showing 20 is associated with that
label), and optionally assert the old label (e.g., "Tips generated") is not
present to prevent false positives; reference the test function
test_sync_phoenix_displays_results and the PhoenixSync mock used by
runner.invoke/app to locate where to add these assertions.
tests/unit/test_phoenix_sync.py (1)

562-587: Rename stale tip-prefixed locals for consistency.

The test logic and assertions were updated to "guidelines", but several local variables still use the old tip naming: mock_tip1, mock_tip2, tip_update_call, tip_entities (here and the similar mock_tip at lines 630-634). This creates a confusing mix of terminology in the same test. Since this is an all-in rename PR, finishing the rename in these locals would keep the file consistent.

♻️ Proposed rename
-        # Create mock Guideline objects with required attributes
-        mock_tip1 = MagicMock()
-        mock_tip1.content = "Guideline 1 content"
-        mock_tip1.category = "strategy"
-        mock_tip1.rationale = "Guideline 1 rationale"
-        mock_tip1.trigger = "Guideline 1 trigger"
-        mock_tip2 = MagicMock()
-        mock_tip2.content = "Guideline 2 content"
-        mock_tip2.category = "optimization"
-        mock_tip2.rationale = "Guideline 2 rationale"
-        mock_tip2.trigger = "Guideline 2 trigger"
-        mock_generate_guidelines.return_value = GuidelineGenerationResult(guidelines=[mock_tip1, mock_tip2], task_description="Hello")
+        # Create mock Guideline objects with required attributes
+        mock_guideline1 = MagicMock()
+        mock_guideline1.content = "Guideline 1 content"
+        mock_guideline1.category = "strategy"
+        mock_guideline1.rationale = "Guideline 1 rationale"
+        mock_guideline1.trigger = "Guideline 1 trigger"
+        mock_guideline2 = MagicMock()
+        mock_guideline2.content = "Guideline 2 content"
+        mock_guideline2.category = "optimization"
+        mock_guideline2.rationale = "Guideline 2 rationale"
+        mock_guideline2.trigger = "Guideline 2 trigger"
+        mock_generate_guidelines.return_value = GuidelineGenerationResult(
+            guidelines=[mock_guideline1, mock_guideline2], task_description="Hello"
+        )
 
         result = phoenix_sync.sync(limit=10)
 
         assert result.processed == 1
         assert result.guidelines_generated == 2
         phoenix_sync.client.update_entities.assert_called()
 
         # Verify provenance metadata is persisted in guideline entities
-        tip_update_call = phoenix_sync.client.update_entities.call_args_list[-1]
-        tip_entities = tip_update_call.kwargs["entities"]
-        assert all(e.metadata.get("task_description") == "Hello" for e in tip_entities)
-        assert all(e.metadata.get("source_task_id") == "t1" for e in tip_entities)
-        assert all(e.metadata.get("source_span_id") == "s1" for e in tip_entities)
-        assert all(e.metadata.get("creation_mode") == "auto-phoenix" for e in tip_entities)
+        guideline_update_call = phoenix_sync.client.update_entities.call_args_list[-1]
+        guideline_entities = guideline_update_call.kwargs["entities"]
+        assert all(e.metadata.get("task_description") == "Hello" for e in guideline_entities)
+        assert all(e.metadata.get("source_task_id") == "t1" for e in guideline_entities)
+        assert all(e.metadata.get("source_span_id") == "s1" for e in guideline_entities)
+        assert all(e.metadata.get("creation_mode") == "auto-phoenix" for e in guideline_entities)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/test_phoenix_sync.py` around lines 562 - 587, Rename the stale
"tip"-prefixed local variables in this test to "guideline" for consistency:
change mock_tip1/mock_tip2 to mock_guideline1/mock_guideline2 (and any other
mock_tip at lines ~630-634), and rename tip_update_call and tip_entities to
guideline_update_call and guideline_entities; update their usages in the
assertions that check phoenix_sync.client.update_entities call args and the
metadata checks (references: mock_generate_guidelines return
GuidelineGenerationResult, phoenix_sync.sync,
phoenix_sync.client.update_entities) so the variable names match the updated
"guidelines" terminology throughout the test.
tests/unit/test_combine_guidelines.py (1)

38-64: Stale TIPS identifiers remaining after rename.

The constant SAMPLE_TIPS (line 38) and the test method test_combine_cluster_returns_tips (line 64) still carry the old terminology even though the file, classes, and assertions were renamed to guidelines. Consider finishing the rename for consistency.

♻️ Proposed rename
-SAMPLE_TIPS = [
+SAMPLE_GUIDELINES = [
     {
         "content": "Use retry logic for flaky APIs",
@@
 ]
@@
-    def test_combine_cluster_returns_tips(self, _mock_params, _mock_schema, mock_completion):
-        mock_completion.return_value = _mock_completion_response(SAMPLE_TIPS)
+    def test_combine_cluster_returns_guidelines(self, _mock_params, _mock_schema, mock_completion):
+        mock_completion.return_value = _mock_completion_response(SAMPLE_GUIDELINES)

(Also update the remaining SAMPLE_TIPS references at lines 87 and 114.)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/test_combine_guidelines.py` around lines 38 - 64, Rename the
leftover TIPS identifiers to guidelines: change the constant SAMPLE_TIPS to
SAMPLE_GUIDELINES and update all usages (including assertions and variables
inside TestCombineCluster and helper references) and rename the test method
test_combine_cluster_returns_tips to test_combine_cluster_returns_guidelines
(and update any other occurrences of SAMPLE_TIPS at the remaining places
referenced in the file). Ensure imports/patches still reference
altk_evolve.llm.guidelines.clustering and that any variable names inside the
test (e.g., mocks or expected values) reflect SAMPLE_GUIDELINES so names are
consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/guides/phoenix-sync.md`:
- Around line 129-133: The ASCII diagram's third box ("Generate Guidelines") is
wider than the others causing misalignment; update the diagram so all three
boxes share the same interior width by either expanding the top/bottom borders
(e.g., change the sibling box borders like "┌───────────────┐" /
"└───────┬───────┘" to match the wider width) or shorten the label to fit the
existing 15-character interior (e.g., "Gen Guidelines" or "Guidelines" trimmed)
so the lines containing "Deduplicate", "Convert to OpenAI format", and "Generate
Guidelines" render with consistent box widths.

In `@examples/low_code/litellm_demo.py`:
- Around line 13-16: The print statement currently always shows
llm_settings.guidelines_model while the completion call may use the
EVOLVE_EXAMPLE_AGENT_MODEL override; fix this by computing the actual model
string once (e.g., model = os.environ.get("EVOLVE_EXAMPLE_AGENT_MODEL") or
llm_settings.guidelines_model) and then use that variable in both the print and
the completion(...) call so both log and request show the same model; update
references to llm_settings.guidelines_model and the completion(...) invocation
accordingly.

In `@README.md`:
- Around line 136-141: The phrase "full audibility" in the "Guideline
Provenance" section is a typo; change it to "auditability" so the sentence reads
that source_task_id provides full auditability; update the README.md text under
the "Guideline Provenance" heading and verify surrounding mentions of
`metadata`, `creation_mode`, and `source_task_id` remain consistent.

---

Outside diff comments:
In `@altk_evolve/cli/cli.py`:
- Around line 353-397: The CLI currently only catches NamespaceNotFoundException
and EvolveException but misses ValueError thrown by client.cluster_guidelines
and client.consolidate_guidelines when the clustering model is unconfigured;
update the try/except blocks around client.cluster_guidelines(...) and
client.consolidate_guidelines(...) to also catch ValueError and handle it
cleanly (no traceback) by printing a user-facing message via console.print
(e.g., explain that the clustering model is not configured and how to configure
it) and exiting or returning appropriately; reference the functions
cluster_guidelines and consolidate_guidelines and preserve existing handling for
NamespaceNotFoundException and EvolveException, adding ValueError handling near
those existing except clauses.

In `@altk_evolve/sync/phoenix_sync.py`:
- Around line 28-35: SyncResult introduced a breaking rename from tips_generated
to guidelines_generated; restore a transitional alias by adding a tips_generated
property on the SyncResult dataclass that returns self.guidelines_generated and
emits a DeprecationWarning (use the warnings module) so existing callers don’t
break immediately; implement the property method on the SyncResult class (keep
the dataclass fields unchanged) and include a short comment noting it’s
temporary for one release cycle.

In `@CHANGELOG.md`:
- Around line 38-435: The changelog retroactively renames "tip"/"tips" to
"guideline" across historical entries (seen in sections "v1.0.0" through
"v1.0.6" and references like commits `d373e7e`, `d2a4d0a`, `8ea2051`, `1154b4a`,
`ce1ead3`), which breaks fidelity to git history; revert those past release
lines back to the original "tip"/"tips" wording (or preserve the original
phrasing verbatim) and instead add a single-line migration note at the top of
CHANGELOG.md explaining that terminology has been changed moving forward and
mapping "tip" => "guideline" for clarity; update the entries under headings like
"### Bug Fixes" and "### Features" in the historic release blocks
(v1.0.0–v1.0.6) to match the original commit language while leaving new releases
using "guideline".

In `@docs/guides/configuration.md`:
- Around line 22-50: The docs/examples reference EVOLVE_TIPS_MODEL but the code
field guidelines_model in altk_evolve/config/llm.py binds to
EVOLVE_GUIDELINES_MODEL, so EVOLVE_TIPS_MODEL is ignored; either restore
backward compatibility by adding a validation_alias to the guidelines_model
field to accept the legacy name (so pydantic-settings will read
EVOLVE_TIPS_MODEL as well), or update docs and examples to use
EVOLVE_GUIDELINES_MODEL (and mark EVOLVE_TIPS_MODEL deprecated) — if you choose
compatibility, modify guidelines_model in altk_evolve/config/llm.py to include a
validation_alias for the legacy env name, and if you choose documentation,
update docs/guides/configuration.md (lines referencing EVOLVE_TIPS_MODEL) and
examples/low_code/manual_phoenix_demo.py to read EVOLVE_GUIDELINES_MODEL instead
and add a deprecation note for EVOLVE_TIPS_MODEL.

In `@tests/e2e/test_e2e_pipeline.py`:
- Around line 210-248: The test currently treats any "generated X guidelines" as
success even when X is "0" and still uses the stale variable name tips_found;
update the logic so you parse count = int(match.group(1)) and only set success
when count > 0, rename tips_found to guidelines_found (and update all references
including the final if not guidelines_found: and the success print) to make
intent clear and ensure the test fails when zero guidelines are generated.

---

Nitpick comments:
In `@altk_evolve/frontend/api/routes.py`:
- Around line 216-218: The local variable tip_meta is a stale name now that
Guideline is being validated; rename tip_meta to a clearer name (e.g.,
guideline_meta or guideline_kwargs) in the block where you build metadata from
req.metadata and where you pass it into Guideline(content=req.content, **...),
update any other references in the same scope to use the new name, and run tests
to ensure no remaining references to tip_meta remain (look for usages around the
Guideline call and any subsequent code in routes.py).

In `@tests/platform_integrations/test_entity_io_core.py`:
- Around line 49-58: Replace the inline filesystem setup in tests
test_increments_suffix_on_collision and test_keeps_incrementing (which currently
use temp_project_dir / "my-guideline".touch() and similar) with the shared
fixtures/helpers from conftest.py (e.g., use the project/file creation fixture
such as bob_fixtures or the file-creation helper used elsewhere) so the test
data is created via the reusable fixture instead of manual touch()/write_text();
keep the assertions that call entity_io.unique_filename unchanged and ensure the
fixture produces the same filenames ("my-guideline.md" and "my-guideline-2.md")
so the expected paths (temp_project_dir / "my-guideline-2.md" and /
"my-guideline-3.md") still match.

In `@tests/platform_integrations/test_retrieve.py`:
- Around line 39-47: The test is creating entity markdown files inline using
variables own_dir and sub_dir instead of the central test-data helpers; replace
the manual mkdir/write_text blocks in
tests/platform_integrations/test_retrieve.py with the conftest fixtures (e.g.
use the provided bob_fixtures or other test-data helper functions) to create the
owned and subscribed guideline entities and their metadata, and use
file_assertions if assertions about file presence/content are needed; update
both occurrences (the owned entity block and the subscribed entity block) to
call the existing fixture helper APIs rather than manually writing files.

In `@tests/platform_integrations/test_sync.py`:
- Around line 152-174: Rename the local test variable `tip_one` to
`guideline_one` in tests/platform_integrations/test_sync.py and update every
usage (the Path construction, the initial exists() assert and the final not
exists() assert) so the name matches the rest of the PR; ensure references to
`tip_one` (in the Path assignment and both asserts) are replaced with
`guideline_one` to complete the local rename from "tip" to "guideline".

In `@tests/unit/test_cli.py`:
- Around line 655-671: In test_sync_phoenix_displays_results, the test currently
only checks numeric counts; update it to assert the explicit renamed label
appears (e.g., check that "Guidelines generated" is present in result.stdout
after runner.invoke(app, ["sync", "phoenix"]) and that the line showing 20 is
associated with that label), and optionally assert the old label (e.g., "Tips
generated") is not present to prevent false positives; reference the test
function test_sync_phoenix_displays_results and the PhoenixSync mock used by
runner.invoke/app to locate where to add these assertions.

In `@tests/unit/test_combine_guidelines.py`:
- Around line 38-64: Rename the leftover TIPS identifiers to guidelines: change
the constant SAMPLE_TIPS to SAMPLE_GUIDELINES and update all usages (including
assertions and variables inside TestCombineCluster and helper references) and
rename the test method test_combine_cluster_returns_tips to
test_combine_cluster_returns_guidelines (and update any other occurrences of
SAMPLE_TIPS at the remaining places referenced in the file). Ensure
imports/patches still reference altk_evolve.llm.guidelines.clustering and that
any variable names inside the test (e.g., mocks or expected values) reflect
SAMPLE_GUIDELINES so names are consistent.

In `@tests/unit/test_mcp_server.py`:
- Around line 26-31: Rename outdated "tip" locals to guideline terminology:
replace mock_tip with mock_guideline (and tip_entity with guideline_entity)
where used to build mock_result.guidelines and in assertions; update the
MagicMock assignments (mock_tip.content, .category, .rationale, .trigger) to use
the new variable name and update any references at the other occurrence (around
the second instance noted) so tests consistently use
mock_guideline/mock_guideline_entity and mock_result.guidelines.

In `@tests/unit/test_phoenix_sync.py`:
- Around line 562-587: Rename the stale "tip"-prefixed local variables in this
test to "guideline" for consistency: change mock_tip1/mock_tip2 to
mock_guideline1/mock_guideline2 (and any other mock_tip at lines ~630-634), and
rename tip_update_call and tip_entities to guideline_update_call and
guideline_entities; update their usages in the assertions that check
phoenix_sync.client.update_entities call args and the metadata checks
(references: mock_generate_guidelines return GuidelineGenerationResult,
phoenix_sync.sync, phoenix_sync.client.update_entities) so the variable names
match the updated "guidelines" terminology throughout the test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0e1dd8f-30c1-46e6-8526-4b5df2d845b6

📥 Commits

Reviewing files that changed from the base of the PR and between b670d92 and 1d68f6f.

⛔ Files ignored due to path filters (4)
  • docs/assets/architecture-dark.svg is excluded by !**/*.svg
  • docs/assets/architecture-light.svg is excluded by !**/*.svg
  • docs/assets/architecture-wide-dark.svg is excluded by !**/*.svg
  • docs/assets/architecture-wide-light.svg is excluded by !**/*.svg
📒 Files selected for processing (43)
  • CHANGELOG.md
  • README.md
  • altk_evolve/cli/cli.py
  • altk_evolve/config/llm.py
  • altk_evolve/frontend/api/routes.py
  • altk_evolve/frontend/client/evolve_client.py
  • altk_evolve/frontend/mcp/mcp_server.py
  • altk_evolve/frontend/ui/src/components/CreateEntityModal.tsx
  • altk_evolve/llm/guidelines/__init__.py
  • altk_evolve/llm/guidelines/clustering.py
  • altk_evolve/llm/guidelines/guidelines.py
  • altk_evolve/llm/guidelines/prompts/combine_guidelines.jinja2
  • altk_evolve/llm/guidelines/prompts/generate_guidelines.jinja2
  • altk_evolve/schema/guidelines.py
  • altk_evolve/schema/tips.py
  • altk_evolve/sync/phoenix_sync.py
  • docs/archive/save-session-as-skill-design.md
  • docs/guides/configuration.md
  • docs/guides/low-code-tracing.md
  • docs/guides/phoenix-sync.md
  • examples/low_code/litellm_demo.py
  • examples/low_code/openai_agents_demo.py
  • examples/low_code/simple_openai.py
  • examples/low_code/smolagents_demo.py
  • platform-integrations/bob/evolve-full/custom_modes.yaml
  • platform-integrations/claude/plugins/evolve-lite/skills/recall/SKILL.md
  • platform-integrations/claude/plugins/evolve-lite/skills/save/SKILL.md
  • tests/e2e/test_e2e_pipeline.py
  • tests/e2e/test_mcp.py
  • tests/platform_integrations/conftest.py
  • tests/platform_integrations/test_audit.py
  • tests/platform_integrations/test_entity_io_core.py
  • tests/platform_integrations/test_publish.py
  • tests/platform_integrations/test_retrieve.py
  • tests/platform_integrations/test_save_entities.py
  • tests/platform_integrations/test_subscribe.py
  • tests/platform_integrations/test_sync.py
  • tests/unit/test_cli.py
  • tests/unit/test_clustering.py
  • tests/unit/test_combine_guidelines.py
  • tests/unit/test_guidelines.py
  • tests/unit/test_mcp_server.py
  • tests/unit/test_phoenix_sync.py
💤 Files with no reviewable changes (1)
  • altk_evolve/schema/tips.py

Comment thread docs/guides/phoenix-sync.md Outdated
Comment thread examples/low_code/litellm_demo.py Outdated
Comment thread README.md
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
altk_evolve/sync/phoenix_sync.py (1)

38-47: Backward-compat shim looks good; note default-filter caveat.

SyncResult.tips_generated correctly emits a DeprecationWarning with stacklevel=2 and returns guidelines_generated. Worth noting: DeprecationWarning is silenced by default outside __main__ in CPython, so library consumers may not see it unless they enable warnings or you temporarily switch to FutureWarning for higher visibility during the transition release.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@altk_evolve/sync/phoenix_sync.py` around lines 38 - 47, The deprecation
warning in the SyncResult.tips_generated property uses DeprecationWarning which
is ignored by default by most users; change the warning class to FutureWarning
(or emit both) in the tips_generated property so the message is visible during
the transition, e.g., replace DeprecationWarning with FutureWarning while
keeping stacklevel=2 and the return of self.guidelines_generated; ensure the
docstring still notes the temporary compatibility alias and that
guidelines_generated is the new name.
tests/unit/test_phoenix_sync.py (1)

79-88: Deprecation-warning test is solid.

warnings.simplefilter("always") inside catch_warnings ensures the DeprecationWarning is captured regardless of the ambient filter configuration, and the assertions verify both count and category. Minor optional improvement: also assert a substring of the message (e.g., "tips_generated") to guard against accidental message regressions.

Optional tightening
     assert len(caught) == 1
     assert caught[0].category is DeprecationWarning
+    assert "tips_generated" in str(caught[0].message)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/unit/test_phoenix_sync.py` around lines 79 - 88, The test currently
verifies a DeprecationWarning is emitted when accessing
SyncResult.tips_generated but doesn't assert the warning message; update the
test_sync_result_tips_generated_warns_and_returns_guidelines_count to also
assert that the captured warning's message text contains a relevant substring
(e.g., "tips_generated") by checking str(caught[0].message) includes
"tips_generated" after the existing category assertion, referencing the
SyncResult.tips_generated access point.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@altk_evolve/frontend/api/routes.py`:
- Around line 213-218: The code currently always constructs
Guideline(content=req.content, **guideline_meta) which fails for legacy/compact
guideline entities missing rationale, category, or trigger; modify the logic to
only invoke the structured Guideline validation when those detailed metadata
keys are present (e.g., check if 'rationale' in req.metadata and 'category' in
req.metadata and 'trigger' in req.metadata) and otherwise perform only the
generic entity validation (e.g., ensure req.type == "guideline" and req.content
exists) or skip structured validation so compact guidelines (type + content)
remain accepted; update the branch around Guideline(...) and
req.metadata/guideline_meta to conditionally call Guideline.

---

Nitpick comments:
In `@altk_evolve/sync/phoenix_sync.py`:
- Around line 38-47: The deprecation warning in the SyncResult.tips_generated
property uses DeprecationWarning which is ignored by default by most users;
change the warning class to FutureWarning (or emit both) in the tips_generated
property so the message is visible during the transition, e.g., replace
DeprecationWarning with FutureWarning while keeping stacklevel=2 and the return
of self.guidelines_generated; ensure the docstring still notes the temporary
compatibility alias and that guidelines_generated is the new name.

In `@tests/unit/test_phoenix_sync.py`:
- Around line 79-88: The test currently verifies a DeprecationWarning is emitted
when accessing SyncResult.tips_generated but doesn't assert the warning message;
update the test_sync_result_tips_generated_warns_and_returns_guidelines_count to
also assert that the captured warning's message text contains a relevant
substring (e.g., "tips_generated") by checking str(caught[0].message) includes
"tips_generated" after the existing category assertion, referencing the
SyncResult.tips_generated access point.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 64ca6a67-e10a-437e-bcb3-6c73d015bb44

📥 Commits

Reviewing files that changed from the base of the PR and between 1d68f6f and d820dc6.

📒 Files selected for processing (20)
  • CHANGELOG.md
  • README.md
  • altk_evolve/cli/cli.py
  • altk_evolve/config/llm.py
  • altk_evolve/frontend/api/routes.py
  • altk_evolve/sync/phoenix_sync.py
  • docs/guides/configuration.md
  • docs/guides/low-code-tracing.md
  • docs/guides/phoenix-sync.md
  • examples/low_code/litellm_demo.py
  • examples/low_code/manual_phoenix_demo.py
  • tests/e2e/test_e2e_pipeline.py
  • tests/platform_integrations/test_entity_io_core.py
  • tests/platform_integrations/test_retrieve.py
  • tests/platform_integrations/test_sync.py
  • tests/unit/test_cli.py
  • tests/unit/test_combine_guidelines.py
  • tests/unit/test_llm_config.py
  • tests/unit/test_mcp_server.py
  • tests/unit/test_phoenix_sync.py
✅ Files skipped from review due to trivial changes (6)
  • CHANGELOG.md
  • examples/low_code/manual_phoenix_demo.py
  • tests/unit/test_llm_config.py
  • tests/unit/test_mcp_server.py
  • README.md
  • docs/guides/phoenix-sync.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • examples/low_code/litellm_demo.py
  • altk_evolve/config/llm.py
  • docs/guides/configuration.md
  • tests/e2e/test_e2e_pipeline.py
  • tests/platform_integrations/test_sync.py
  • altk_evolve/cli/cli.py
  • docs/guides/low-code-tracing.md
  • tests/unit/test_cli.py

Comment thread altk_evolve/frontend/api/routes.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
altk_evolve/frontend/api/routes.py (1)

212-224: LGTM — conditional structured validation preserves compact guideline entities.

The gating on {"rationale", "category", "trigger"} <= guideline_meta.keys() correctly keeps legacy/compact type: "guideline" entities (just type + content) accepted while still enforcing the full Guideline schema for generation-shaped payloads, addressing the prior review feedback.

One minor consideration: partial structured metadata (e.g., caller supplies rationale and category but omits trigger) will silently skip validation rather than surface a 422. If you want to catch half-populated payloads, consider validating when any of the structured fields is present:

Optional stricter gating
-            guideline_meta = {k: v for k, v in req.metadata.items() if k != "content"}
-            structured_fields = {"rationale", "category", "trigger"}
-            if structured_fields <= guideline_meta.keys():
-                Guideline(content=req.content, **guideline_meta)
+            guideline_meta = {k: v for k, v in req.metadata.items() if k != "content"}
+            structured_fields = {"rationale", "category", "trigger"}
+            if structured_fields & guideline_meta.keys():
+                Guideline(content=req.content, **guideline_meta)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@altk_evolve/frontend/api/routes.py` around lines 212 - 224, The current
gating only runs Guideline validation when all structured_fields are present, so
partial structured metadata (e.g., missing "trigger") is ignored; change the
condition in the entity_type == "guideline" block (where guideline_meta and
structured_fields are defined) to run validation when any of the structured
fields is present (e.g., check intersection or use any(...) over
structured_fields against guideline_meta.keys()), then attempt Guideline(...)
and keep the existing logger.error and HTTPException path for failures to
surface a 422 for half-populated payloads.
tests/platform_integrations/test_entity_io_core.py (1)

144-148: Use file_assertions for this test-data setup too.

This changed guideline file is still created manually with mkdir() / write_text(). Keep platform integration setup consistent by using the shared fixture.

♻️ Proposed refactor
-    def test_loads_from_nested_type_dirs(self, temp_project_dir):
-        (temp_project_dir / "guideline").mkdir()
-        (temp_project_dir / "guideline" / "guideline.md").write_text("---\ntype: guideline\n---\n\nKeep it simple.\n")
-        (temp_project_dir / "preference").mkdir()
-        (temp_project_dir / "preference" / "pref.md").write_text("---\ntype: preference\n---\n\nUse snake_case.\n")
+    def test_loads_from_nested_type_dirs(self, temp_project_dir, file_assertions):
+        file_assertions.write_text(
+            temp_project_dir / "guideline" / "guideline.md",
+            "---\ntype: guideline\n---\n\nKeep it simple.\n",
+        )
+        file_assertions.write_text(
+            temp_project_dir / "preference" / "pref.md",
+            "---\ntype: preference\n---\n\nUse snake_case.\n",
+        )

As per coding guidelines, “Use fixtures from conftest.py to create test data (bob_fixtures, file_assertions, etc.) - do not manually create files”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/platform_integrations/test_entity_io_core.py` around lines 144 - 148,
In test_loads_from_nested_type_dirs replace the manual
temp_project_dir.mkdir()/write_text() calls with the shared file_assertions
fixture to create the same files; specifically, use file_assertions to create
"guideline/guideline.md" and "preference/pref.md" with the same frontmatter and
body instead of calling (temp_project_dir / ...).mkdir() and .write_text(), so
the test uses the standard fixture-based test-data setup.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@altk_evolve/frontend/api/routes.py`:
- Around line 212-224: The current gating only runs Guideline validation when
all structured_fields are present, so partial structured metadata (e.g., missing
"trigger") is ignored; change the condition in the entity_type == "guideline"
block (where guideline_meta and structured_fields are defined) to run validation
when any of the structured fields is present (e.g., check intersection or use
any(...) over structured_fields against guideline_meta.keys()), then attempt
Guideline(...) and keep the existing logger.error and HTTPException path for
failures to surface a 422 for half-populated payloads.

In `@tests/platform_integrations/test_entity_io_core.py`:
- Around line 144-148: In test_loads_from_nested_type_dirs replace the manual
temp_project_dir.mkdir()/write_text() calls with the shared file_assertions
fixture to create the same files; specifically, use file_assertions to create
"guideline/guideline.md" and "preference/pref.md" with the same frontmatter and
body instead of calling (temp_project_dir / ...).mkdir() and .write_text(), so
the test uses the standard fixture-based test-data setup.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f16ecea9-e551-4fd6-bf45-a040c006963c

📥 Commits

Reviewing files that changed from the base of the PR and between d820dc6 and b24d402.

📒 Files selected for processing (8)
  • altk_evolve/frontend/api/routes.py
  • tests/platform_integrations/test_audit.py
  • tests/platform_integrations/test_entity_io_core.py
  • tests/platform_integrations/test_publish.py
  • tests/platform_integrations/test_retrieve.py
  • tests/platform_integrations/test_save_entities.py
  • tests/platform_integrations/test_subscribe.py
  • tests/platform_integrations/test_sync.py
✅ Files skipped from review due to trivial changes (3)
  • tests/platform_integrations/test_subscribe.py
  • tests/platform_integrations/test_audit.py
  • tests/platform_integrations/test_save_entities.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/platform_integrations/test_sync.py
  • tests/platform_integrations/test_publish.py

@gaodan-fang
Copy link
Copy Markdown
Collaborator Author

should we merge this refactor first? @visahak

@visahak
Copy link
Copy Markdown
Collaborator

visahak commented Apr 24, 2026

Looking at it now.

illeatmyhat
illeatmyhat previously approved these changes Apr 24, 2026
@visahak
Copy link
Copy Markdown
Collaborator

visahak commented Apr 24, 2026

Summary

This PR renames the “tips” surface to “guidelines” across the runtime, CLI, MCP server, docs, examples, and tests. It also includes a follow-up API fix so compact guideline entities can still be
created without forcing the full structured guideline schema.

Findings

  1. Codex sharing integration tests still use the old tip-*.md fixture names (confidence: 100/100)
    • Why it matters: the shared platform-integration fixture now seeds guideline-one.md, but several Codex sharing tests still assert or mutate tip-one.md / tip-two.md, so the e2e suite stays
      red after this rename.
    • Evidence: tests/platform_integrations/conftest.py:632 now creates guideline-one.md, while tests/platform_integrations/test_codex_sharing.py:267, :456, :495, :513, :562, :572,
      :596, :600, and :631 still reference tip-one.md / tip-two.md.
    • Example: test_subscribe_sync_and_unsubscribe_round_trip checks for .evolve/entities/subscribed/alice/guideline/tip-one.md, but the fixture repo contains guideline-one.md, so the
      assertion fails immediately.

Testing

  • uv run pytest -m e2e -v: 97 passed, 7 failed, 469 deselected in 137.02s

Test Errors

  1. tests/platform_integrations/test_codex.py::TestCodexInstall::test_uninstall_prunes_evolve_only_hook_groups

    • The uninstall flow leaves an empty UserPromptSubmit hook group in .codex/hooks.json:
      {"UserPromptSubmit": [{"hooks": [], "matcher": ""}]}
    • The test expects the UserPromptSubmit key to be removed entirely when the only remaining group is empty.
  2. tests/platform_integrations/test_codex_sharing.py::TestCodexSharingScripts::test_subscribe_sync_and_unsubscribe_round_trip

    • The test expects .evolve/entities/subscribed/alice/guideline/tip-one.md to exist after sync, but that file is missing.
  3. tests/platform_integrations/test_codex_sharing.py::TestCodexSharingScripts::test_sync_uses_workspace_config_with_custom_evolve_dir

    • The test expects .evolve/entities/subscribed/alice/guideline/tip-one.md under the custom evolve directory, but that file is missing.
  4. tests/platform_integrations/test_codex_sharing.py::TestCodexSharingScripts::test_sync_skips_symlinked_markdown_files

    • The test expects tip-one.md to exist after sync, but it does not.
  5. tests/platform_integrations/test_codex_sharing.py::TestCodexSharingScripts::test_sync_removed_entity_disappears_after_sync

    • The test expects tip-one.md to exist before the remote delete step, but it does not.
  6. tests/platform_integrations/test_codex_sharing.py::TestCodexSharingScripts::test_sync_migrates_legacy_subscribed_repo

    • The test expects the migrated repo to contain guideline/tip-one.md, but that file is missing.
  7. tests/platform_integrations/test_sync.py::TestSync::test_skips_symlinked_entities

    • The sync mirror still contains link.md after syncing a repo with a symlinked guideline file.
    • The test expects symlinked entity files to be skipped and not mirrored locally.

@visahak
Copy link
Copy Markdown
Collaborator

visahak commented Apr 24, 2026

There is a PR for the two of the tests here #220 (7 and 1)

Copy link
Copy Markdown
Collaborator

@visahak visahak left a comment

Choose a reason for hiding this comment

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

added the findings.

@gaodan-fang
Copy link
Copy Markdown
Collaborator Author

Addressed this review point on this branch.

I updated the Codex sharing integration tests to use the renamed seeded fixtures (guideline-one.md / guideline-two.md) instead of stale tip-one.md / tip-two.md paths in tests/platform_integrations/test_codex_sharing.py (the assertions and repo mutation steps now match tests/platform_integrations/conftest.py again).

Verification run:

  • uv run pytest -m e2e -v tests/platform_integrations/test_codex_sharing.py
  • Result: 33 passed

The two additional failures mentioned in the thread (test_sync.py symlink behavior and Codex uninstall hook pruning) are tracked separately in #220.

@gaodan-fang gaodan-fang force-pushed the codex/locate-keyword-tips-references branch from 2e0ca27 to 15a5b3e Compare April 25, 2026 03:24
@visahak visahak self-requested a review April 25, 2026 18:34
@visahak visahak merged commit 68cbfbf into main Apr 25, 2026
16 checks passed
@visahak visahak deleted the codex/locate-keyword-tips-references branch April 25, 2026 21:02
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.

3 participants