Skip to content

Docs/langchain issue intake proposal#486

Merged
stranske merged 7 commits intomainfrom
docs/langchain-issue-intake-proposal
Jan 3, 2026
Merged

Docs/langchain issue intake proposal#486
stranske merged 7 commits intomainfrom
docs/langchain-issue-intake-proposal

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Jan 3, 2026

No description provided.

Explores using LangChain to improve the Agents 63 issue intake pipeline:

1. Human Language → AGENT_ISSUE_TEMPLATE conversion (P1)
2. Contextual data injection for PRs (P2)
3. Agent capability pre-flight check (P0) - validates tasks are agent-actionable
4. Analyze → Approve → Format hybrid optimization (P1) - stateless two-phase flow

Key insight: #4 uses label-based approval (agents:optimize → agents:apply-suggestions)
instead of stateful multi-turn conversation, reducing complexity from 5-7d to 2-3d
while reusing the Formatter (#1) infrastructure.

Also identifies additional opportunities:
- Task decomposition for large tasks
- Duplicate/related issue detection
- Post-merge learning feedback
CRITICAL: This fix ensures we NEVER ship outdated versions to consumer repos.

Problem:
- The sync scripts read from autofix-versions.env which contained static pins
- These pins could become stale without any mechanism to detect or update them
- Consumer repos received outdated versions, wasting significant time

Solution:
1. New script: scripts/update_versions_from_pypi.py
   - Queries PyPI for latest stable versions
   - Can check or update autofix-versions.env
   - Fails if versions are outdated (--fail-on-outdated)

2. New tests: tests/scripts/test_update_versions_from_pypi.py
   - 31 tests including integration tests that query real PyPI
   - Consumer repo sampling tests that verify versions are current
   - Regression prevention tests

3. Modified: maint-52-sync-dev-versions.yml
   - Added verify-versions-current job that BLOCKS sync if outdated
   - Syncing now FAILS if autofix-versions.env has stale versions

4. New workflow: maint-auto-update-pypi-versions.yml
   - Runs daily at 03:00 UTC (before weekly sync at 05:00)
   - Auto-creates PRs when versions need updating

This ensures versions are verified against PyPI before every sync.
- Add detailed comparison of Levenshtein vs embeddings-based similarity
- Include code example using LangChain + FAISS vector store
- Document advantages: catches 'same idea, different phrasing' duplicates
- Clarify integration point in agents-63-issue-intake.yml

Addresses concern about upgrading Agents 63 issue reuse/dedup from
Levenshtein to semantic matching.
Enhancement #6 now covers:
1. Issue deduplication - semantic similarity for duplicate detection
2. Label matching - replace Levenshtein in findMatchingLabel() with embeddings

Both use cases share the same embeddings infrastructure (FAISS + GitHub Models).

Examples of label matching improvements:
- 'defect' → 'bug' (synonyms)
- 'improvement' → 'enhancement' (synonyms)
- 'testing' → 'tests' (related concepts)

Updated issue #481 with expanded scope and tasks.
Copilot AI review requested due to automatic review settings January 3, 2026 17:41
…antic matching

Resolved conflict in docs/plans/langchain-issue-intake-proposal.md by
keeping the expanded Enhancement #6 that covers both:
- Issue deduplication (semantic similarity)
- Label matching (upgrade from Levenshtein to embeddings)
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces automation for keeping dev tool versions current by fetching latest versions from PyPI, along with a comprehensive proposal for integrating LangChain to enhance the issue intake pipeline for agent-driven workflows.

Key changes:

  • New script to automatically fetch and update package versions from PyPI
  • Daily workflow to check for outdated versions and create update PRs
  • Pre-sync verification step to prevent shipping stale versions to consumer repos
  • Comprehensive test suite with unit, integration, and regression tests
  • Detailed proposal document outlining LangChain integration strategies for issue formatting, capability checking, and agent optimization

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
scripts/update_versions_from_pypi.py New script that queries PyPI API and updates autofix-versions.env with latest stable package versions
tests/scripts/test_update_versions_from_pypi.py Comprehensive test suite covering parsing, version checks, PyPI integration, and consumer repo simulations
.github/workflows/maint-auto-update-pypi-versions.yml Daily workflow to automatically check PyPI and create PRs for version updates
.github/workflows/maint-52-sync-dev-versions.yml Adds pre-sync verification step to prevent shipping outdated versions to consumer repos
docs/plans/langchain-issue-intake-proposal.md Detailed technical proposal for using LangChain to improve issue intake, task validation, and human-agent collaboration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +81 to +84
if git diff --quiet .github/workflows/autofix-versions.env; then
echo "No changes to commit"
exit 0
fi
Copy link

Copilot AI Jan 3, 2026

Choose a reason for hiding this comment

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

The git diff check uses '--quiet' flag which suppresses all output and only returns exit codes. However, the echo after it will always print "No changes to commit" even if there are changes, because git diff exits with 0 (no changes) or 1 (has changes). The condition should be 'if ! git diff --quiet' to properly detect when there ARE changes and only then exit early when there are NO changes.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30dca198ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@agents-workflows-bot
Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #486. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@stranske stranske temporarily deployed to agent-high-privilege January 3, 2026 17:49 — with GitHub Actions Inactive
@github-actions github-actions bot added the autofix Opt-in automated formatting & lint remediation label Jan 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 3, 2026

Status | ✅ no new diagnostics
History points | 1
Timestamp | 2026-01-03 20:14:45 UTC
Report artifact | autofix-report-pr-486
Remaining | 0
New | 0
No additional artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 3, 2026

Automated Status Summary

Head SHA: 14619b1
Latest Runs: ⏳ pending — Gate
Required contexts: Gate / gate, Health 45 Agents Guard / Enforce agents workflow protections
Required: core tests (3.11): ⏳ pending, core tests (3.12): ⏳ pending, docker smoke: ⏳ pending, gate: ⏳ pending

Workflow / Job Result Logs
(no jobs reported) ⏳ pending

Coverage Overview

  • Coverage history entries: 1

Coverage Trend

Metric Value
Current 92.21%
Baseline 85.00%
Delta +7.21%
Minimum 70.00%
Status ✅ Pass

Top Coverage Hotspots (lowest coverage)

File Coverage Missing
scripts/workflow_health_check.py 62.6% 28
scripts/classify_test_failures.py 62.9% 37
scripts/ledger_validate.py 65.3% 63
scripts/mypy_return_autofix.py 82.6% 11
scripts/ledger_migrate_base.py 85.5% 13
scripts/fix_cosmetic_aggregate.py 92.3% 1
scripts/coverage_history_append.py 92.8% 2
scripts/workflow_validator.py 93.3% 4
scripts/update_autofix_expectations.py 93.9% 1
scripts/pr_metrics_tracker.py 95.7% 3
scripts/generate_residual_trend.py 96.6% 1
scripts/build_autofix_pr_comment.py 97.0% 2
scripts/aggregate_agent_metrics.py 97.2% 0
scripts/fix_numpy_asserts.py 98.1% 0
scripts/sync_test_dependencies.py 98.3% 1

Updated automatically; will refresh on subsequent CI/Docker completions.


Keepalive checklist

Scope

No scope information available

Tasks

  • No tasks defined

Acceptance criteria

  • No acceptance criteria defined

- Remove unnecessary str() cast in get_latest_pypi_version (Copilot)
- Fix update detection logic that would never find outdated versions (Copilot + Codex P1)
- Improve test to catch more fallback version naming patterns (Copilot)

The workflow check step was incorrectly relying on exit codes when the
script always exits 0 for --check mode. Now directly greps output for
'outdated' to properly detect when updates are needed.
@stranske stranske temporarily deployed to agent-high-privilege January 3, 2026 17:53 — with GitHub Actions Inactive
Add the new workflow to:
- test_workflow_naming.py EXPECTED_NAMES mapping
- docs/ci/WORKFLOWS.md workflow list
- docs/ci/WORKFLOW_SYSTEM.md description and reference table

This fixes the failing workflow inventory tests.
@stranske
Copy link
Copy Markdown
Owner Author

stranske commented Jan 3, 2026

@codex fix comments

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • python -m pytest tests/scripts/test_update_versions_from_pypi.py -k "fallback or check_version" /tmp/pytest-log.txtL1-L9

View task →

@stranske stranske temporarily deployed to agent-high-privilege January 3, 2026 20:14 — with GitHub Actions Inactive
@stranske stranske merged commit 8ee4957 into main Jan 3, 2026
37 checks passed
@stranske stranske deleted the docs/langchain-issue-intake-proposal branch January 3, 2026 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix Opt-in automated formatting & lint remediation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants