Skip to content

fix: resolve Python deprecations and improve build timeout resilience#53

Closed
cuioss-oliver wants to merge 12 commits intomainfrom
feature/analyze-python-scripts-deprecations
Closed

fix: resolve Python deprecations and improve build timeout resilience#53
cuioss-oliver wants to merge 12 commits intomainfrom
feature/analyze-python-scripts-deprecations

Conversation

@cuioss-oliver
Copy link
Copy Markdown
Collaborator

Summary

  • Replace datetime.now() with timezone-aware datetime.now(UTC) in 5 scripts across 3 bundles (Python 3.12 deprecation)
  • Consolidate mixed os.path + pathlib.Path usage to pure pathlib in 6 scripts that already import both
  • Fix adaptive timeout learning in python_build.py to update persisted values on timeout, preventing stuck-forever timeouts when test suites grow

Test plan

  • mypy compile passes across all bundles
  • ruff quality-gate passes across all bundles
  • All module tests pass (423s full suite)
  • Timeout fix verified: persisted value updated from 240 to 528 after timeout, next run succeeded

cuioss-oliver and others added 9 commits March 19, 2026 08:21
- Replace datetime.utcnow() with datetime.now(UTC) in manage-lesson.py
- Document valid category values at the plan-marshall call site

Co-Authored-By: Claude <noreply@anthropic.com>
The skill showed only one command form implying all flags were required,
causing the LLM to fabricate empty values (--key "") when no external
dependencies exist, triggering security hook prompts.

Co-Authored-By: Claude <noreply@anthropic.com>
Regenerated derived-data.json with current module discovery (60 scripts,
12 modules). Removed erroneous "none" entries from key_dependencies in
llm-enriched.json that were created by passing --key "" workaround.

Co-Authored-By: Claude <noreply@anthropic.com>
The Bash permission pattern `Bash(python3 .plan/execute-script.py *)` doesn't
match newline characters in heredoc content, causing permission prompts on every
plan execution at phase-3-outline and phase-4-plan.

Two replacement strategies:
- manage-solution-outline: resolve-path → Write tool → validate pattern
- manage-tasks add: --content CLI arg with \n-encoded newlines

Co-Authored-By: Claude <noreply@anthropic.com>
Build commands must never be hard-coded — resolve via
manage-architecture:architecture resolve before execution.
Rule added to dev-general-practices (Tier 1 system skill)
so it applies to all phases including discovery.

Co-Authored-By: Claude <noreply@anthropic.com>
… agents

The plan-marshall orchestrator and its 3 agents (phase-agent,
q-gate-validation-agent, detect-change-type-agent) did not load
dev-general-practices, leaving foundational rules (tool-usage-patterns,
file-operations) absent from context during planning phases 1-4.

Domain agents (java-verify, plugin-doctor, etc.) already loaded it
correctly. This fix ensures consistent coverage across all components.

Co-Authored-By: Claude <noreply@anthropic.com>
Marshall-steward now checks and injects two constraints into CLAUDE.md:
- file_ops: use Glob/Read/Grep instead of Bash for file operations
- build commands: resolved executables from architecture API (Step 9b)

Changes:
- determine-mode.py: data-driven CONTENT_CHECKS with file_ops check
- wizard-flow.md: new Step 9b resolves build commands post-discovery
- menu-maintenance.md: fix cleanup subcommand run→clean
- CLAUDE.md: add file_ops rule and resolved build commands
- Remove ./pw permissions from settings.local.json (gitignored)

Co-Authored-By: Claude <noreply@anthropic.com>
Three process fixes from verification-mode testing:

- detect-change-type-agent: add object disambiguation between bug_fix
  and tech_debt — "fix deprecations" is tech_debt, not bug_fix
- phase-4-plan Step 5: add backtick sanitization instruction to prevent
  shell metacharacter prompts in --content arguments
- phase-4-plan Step 5.5: clarify holistic task module resolution — omit
  --name to use root module, preventing invalid architecture list calls

Co-Authored-By: Claude <noreply@anthropic.com>
Replace datetime.now() with timezone-aware datetime.now(UTC) in 5 scripts
across plan-marshall, pm-plugin-development, and pm-documents bundles.
Consolidate mixed os.path + pathlib usage to pure pathlib in 6 scripts.
Fix adaptive timeout learning to update persisted values on timeout,
preventing stuck-forever timeouts when test suites grow.

Co-Authored-By: Claude <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on modernizing the codebase by addressing Python 3.12 deprecations and enhancing the robustness of build processes. It improves the reliability of Python builds by implementing adaptive timeout adjustments and streamlines script interactions by standardizing argument passing. Additionally, it updates project metadata and documentation to align with these technical improvements and evolving best practices.

Highlights

  • Python Deprecation Fixes: Replaced datetime.now() with timezone-aware datetime.now(UTC) in five Python scripts across three bundles to address Python 3.12 deprecations.
  • Path Handling Modernization: Migrated six Python scripts from mixed os.path and pathlib.Path usage to a pure pathlib approach for consistency and improved readability.
  • Build Timeout Resilience: Implemented adaptive timeout learning in python_build.py to dynamically adjust and persist timeout values, preventing builds from getting stuck indefinitely when test suites grow.
  • Script Interaction Refinement: Refactored manage-solution-outline and manage-tasks scripts to use CLI arguments (--content) instead of stdin (heredocs) for task and solution outline definitions, improving script robustness and permission handling.
  • Documentation and Metadata Updates: Updated project architecture metadata, CLAUDE.md guidelines for build commands and file operations, and various agent/skill documentation to reflect new practices and structural changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively addresses Python 3.12 deprecations by migrating to timezone-aware datetime.now(UTC) across several scripts, enhancing the code's future compatibility and correctness. A significant refactoring has been implemented in the file interaction patterns for solution outlines and task management, moving from stdin/heredoc-based content input to more explicit --content arguments or a resolve-path followed by a Write tool usage. This change improves the robustness and security of file operations by mitigating issues related to shell metacharacters. Additionally, the check-docs functionality has been enhanced to provide more granular and actionable feedback on documentation compliance. The changes are well-supported by updated tests, ensuring the new logic and APIs function as expected.

cuioss-oliver and others added 3 commits March 19, 2026 17:03
- workflow-integration-git: replace inline --body with --body-file for
  PR creation to avoid newline+# security heuristic
- verification-mode: replace raw grep with manage-log API for post-workflow
  log scanning to avoid $() command substitution security heuristic

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@cuioss-oliver
Copy link
Copy Markdown
Collaborator Author

Closing: all 12 commits are included in PR #54 (feature/recipe-plugin-compliance). Merging #54 implicitly covers this PR.

@cuioss-oliver cuioss-oliver deleted the feature/analyze-python-scripts-deprecations branch April 4, 2026 16:38
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.

1 participant