Skip to content

[3445 by Claude Opus 5.5] Template: weekly codebase drift report (duplicate helpers, growth, what changed and why) - #3465

Merged
integry merged 1 commit into
3443-epic-automations-no-t7ofrom
3445/claude-opus-5-5-template-weekly-codebase--20261112-1027-1kp
Nov 12, 2026
Merged

integry merged 1 commit into
3443-epic-automations-no-t7ofrom
3445/claude-opus-5-5-template-weekly-codebase--20261112-1027-1kp

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3445

Branch: 3445/claude-opus-5-5-template-weekly-codebase--20261112-1027-1kp
Commits: ✅ Changes committed (e5a7902)


AI Processing Completed

Execution Details:

Summary:
I've added the "Weekly codebase drift report" template to the automation catalog. I also added the sentence about duplicate helpers to the default review guidance. The new prompt snapshot test passes, and so do the existing catalog, instruction-learning-loop and review-prompt tests (39 of 39). The two UI template test files also pass (28 tests), and npm run automation-templates:check says the catalog is up to date. I haven't run the full repository suite.

The template (packages/shared/automation-templates/weekly-codebase-drift-report/)

  • Settings: capabilities repository_read and propr_mcp, runs Mondays at 09:00 UTC, starts in dry_run, and includes the previous report. The "review before saving" notes cover repositories, schedule, autonomy and the coding agent, since propr_mcp only works with Claude Code or Codex.
  • Sources: the last 7 days of merges come from git log and git diff --numstat on the checkout. The reason for each change comes from the pull requests, through the ProPR MCP tools list_pull_requests and get_pull_request.
  • Extra repositories: these are cloned with only the latest commit, so git log can't see the past week. The prompt says to fetch more history first, or else take the figures from gh pr list and say so in the report.
  • Report sections, in order:
    • Summary.
    • What changed and why, grouped by area.
    • Possible duplicates, each with the new and existing location and a confidence level.
    • Growth: files and lines added and removed per top-level area, plus the five largest new files.
    • Suggested consolidations: at most five, each tied to an entry above.
  • Finding duplicates: the run searches by name with search_repository_files in literal mode and by behaviour in semantic mode. It must read both candidates before claiming a duplicate, and reports only pairs it has read; a matching name or search hit isn't enough.
  • Acting step: with autonomy raised, it saves each suggested consolidation as one repository To-Do with create_todo. It skips any that an open To-Do already covers and creates nothing else. I didn't change the acting-step code; like the previous template, the instructions are in the prompt.

Review guidance (packages/shared/src/reviewPrompt.ts): DEFAULT_REVIEW_GUIDANCE now asks reviewers to check whether new helpers, functions or modules duplicate existing code. It also asks them to flag duplicates under the complexity category when the review uses that category. There is no such category in the review format today, so for now the sentence only asks reviewers to look; it doesn't add a category.

Other changes

  • scripts/generate-automation-templates.ts lists the new template third, and the catalog JSON is regenerated.
  • test/weeklyCodebaseDriftReportTemplate.test.ts is the prompt snapshot test. It pins the key rules word for word, checks the MCP tool names and the order of the report sections, and confirms the prompt reaches both the report run and the acting step. It also checks the new review-guidance sentence.
  • Docs: a "Weekly Codebase Drift Report" section in docs/docs/features/repository-knowledge.md, a row in the templates table in docs/docs/features/agents.md, and a CHANGELOG entry.

I captured a preview of the new-automation form with the new template card selected, showing its review notes and filled-in fields.

Detailed Logs:

  • Conversation: 108 messages
  • Session: 110a6be9-941d-4559-be40-69df9cb14985

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3445-2026-11-12T10-35-07-269Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3445-2026-11-12T10-35-07-269Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've added the "Weekly codebase drift report" template to the automation catalog. I also added the sentence about duplicate helpers to the default review guidance. The new prompt snapshot test passes,...


This PR was created automatically by ProPR after processing issue #3445.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!


Visual preview

Weekly codebase drift report template

Weekly codebase drift report template

New automation form at 1440px with the new template card selected: its review-before-saving notes and the prefilled name, description and prompt

Connect sign-in required. Original retained until 2027-02-10T10:35:14.309Z.

View the full-resolution original in ProPR Connect

…ion catalog. I also added the sentence about duplicate helpers to the default review guidance. The new prompt snapshot test passes, and so do the existing catalog, instruction-learning-loop and review-prompt tests (39 of 39). The two UI template test files also pass (28 tests), and `npm run automation-templates:check` says the catalog is up to date. I haven't run the full repository suite.

The template (`packages/shared/automation-templates/weekly-codebase-drift-report/`)
- Settings: capabilities `repository_read` and `propr_mcp`, runs Mondays at 09:00 UTC, starts in `dry_run`, and includes the previous report. The "review before saving" notes cover repositories, schedule, autonomy and the coding agent, since `propr_mcp` only works with Claude Code or Codex.
- Sources: the last 7 days of merges come from `git log` and `git diff --numstat` on the checkout. The reason for each change comes from the pull requests, through the ProPR MCP tools `list_pull_requests` and `get_pull_request`.
- Extra repositories: these are cloned with only the latest commit, so `git log` can't see the past week. The prompt says to fetch more history first, or else take the figures from `gh pr list` and say so in the report.
- Report sections, in order:
  - Summary.
  - What changed and why, grouped by area.
  - Possible duplicates, each with the new and existing location and a confidence level.
  - Growth: files and lines added and removed per top-level area, plus the five largest new files.
  - Suggested consolidations: at most five, each tied to an entry above.
- Finding duplicates: the run searches by name with `search_repository_files` in `literal` mode and by behaviour in `semantic` mode. It must read both candidates before claiming a duplicate, and reports only pairs it has read; a matching name or search hit isn't enough.
- Acting step: with autonomy raised, it saves each suggested consolidation as one repository To-Do with `create_todo`. It skips any that an open To-Do already covers and creates nothing else. I didn't change the acting-step code; like the previous template, the instructions are in the prompt.

Review guidance (`packages/shared/src/reviewPrompt.ts`): `DEFAULT_REVIEW_GUIDANCE` now asks reviewers to check whether new helpers, functions or modules duplicate existing code. It also asks them to flag duplicates under the `complexity` category when the review uses that category. There is no such category in the review format today, so for now the sentence only asks reviewers to look; it doesn't add a category.

Other changes
- `scripts/generate-automation-templates.ts` lists the new template third, and the catalog JSON is regenerated.
- `test/weeklyCodebaseDriftReportTemplate.test.ts` is the prompt snapshot test. It pins the key rules word for word, checks the MCP tool names and the order of the report sections, and confirms the prompt reaches both the report run and the acting step. It also checks the new review-guidance sentence.
- Docs: a "Weekly Codebase Drift Report" section in `docs/docs/features/repository-knowledge.md`, a row in the templates table in `docs/docs/features/agents.md`, and a CHANGELOG entry.

I captured a preview of the new-automation form with the new template card selected, showing its review notes and filled-in fields.
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 12, 2026
@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR adds the weekly drift-report template through the existing catalog and automation flows, with matching documentation and focused prompt tests. It is merge-ready within the reviewed scope, conditional on the three pending checks completing successfully.

✅ Safe defaults — The template starts in dry_run, and the existing autonomy handler completes that mode without starting the acting step.

✅ Evidence-based duplicate reporting — The prompt requires reading both candidates, excludes deliberate or generated copies, and ties consolidation suggestions to reported evidence.

✅ Consistent integration — The generator order, generated catalog, template metadata and documentation agree. Tests verify that the template reaches both report and action prompts.

This assessment uses the supplied diff and surrounding context; no commands or tests were run during this review. The authoritative check summary reports no failures.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Make history collection more explicit

In packages/shared/automation-templates/weekly-codebase-drift-report/prompt.md:5, explicitly bound the alternative git log --numstat command to the reporting period and explain how to retrieve all matching fallback PRs. Also specify filtering fallback PRs to the default branch. The surrounding instructions already establish the intended scope, so this is optional clarification that reduces reliance on the agent correcting or extending the example commands.

S2: 🟢 Supplement wording snapshots with scenarios

The new tests verify prompt wording and propagation, but do not assess report accuracy. An optional evaluation using a small repository history—with merge commits, an inactive week and a shallow checkout—would provide stronger evidence that the instructions yield accurate growth figures. This would complement the existing contract and snapshot coverage without requiring a broader runtime redesign.

Score

The implementation is cohesive and appropriately scoped, with no verified merge blocker. Existing checks are favorable; three remain pending, and report accuracy has not been independently exercised in this review.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 32s
  • Tokens: 51,189 (50,551 in / 638 out)
  • Cost: $0.43

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1 S2

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 12, 2026
@integry
integry merged commit 67219ca into 3443-epic-automations-no-t7o Nov 12, 2026
59 checks passed
@integry
integry deleted the 3445/claude-opus-5-5-template-weekly-codebase--20261112-1027-1kp branch November 12, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant