Skip to content

Improve codebase organization for AI-assisted development#141

Draft
ian-flores wants to merge 8 commits intomainfrom
improve-ai-codebase-organization
Draft

Improve codebase organization for AI-assisted development#141
ian-flores wants to merge 8 commits intomainfrom
improve-ai-codebase-organization

Conversation

@ian-flores
Copy link
Contributor

Summary

  • Add architecture documentation covering config flow (YAML→Go→Python), step dependencies, and Pulumi conventions
  • Enhance CLAUDE.md with danger zones, key patterns, and development guidance
  • Add inline docstrings to the 5 largest Python Pulumi files documenting constructor patterns, method ordering, and critical resource names
  • Add Go↔Python config sync validation script with CI integration
  • Standardize Python test fixtures with shared conftest.py and TESTING.md guide

Motivation

AI assistants (and new contributors) struggle with two things in this codebase:

  1. Making correct changes to Python Pulumi code — implicit method ordering dependencies, resource naming that affects Pulumi state, and inconsistent constructor patterns
  2. Orienting to the infrastructure architecture — config parsed in two languages, undocumented step dependencies, tribal knowledge about the autoload pattern

These changes codify tribal knowledge into documentation and add guardrails to prevent common mistakes.

Test plan

  • All 124 Python Pulumi tests pass (111 existing + 13 new fixture tests)
  • Config sync validation passes cleanly (python3 scripts/validate-config-sync.py)
  • No code logic changes — documentation and tooling only
  • Review architecture docs for accuracy
  • Verify CI workflow runs config sync validation on PRs touching lib/types/ or python-pulumi/

…assisted development

Add three architecture docs covering config flow (YAML→Go→Python), step
dependencies and execution pipeline, and Pulumi conventions (resource naming,
autoload pattern, Output[T] handling). Enhance CLAUDE.md with danger zones,
key patterns, and Python Pulumi development guidance to prevent common mistakes
like accidental resource destruction from name changes.
Add targeted docstrings to the 5 largest Python files documenting constructor
patterns (builder vs all-in-init vs autoload), method ordering dependencies,
critical Pulumi state names, and Go/Python config sync requirements. No logic
changes — documentation only.
Add a validation script (scripts/validate-config-sync.py) that compares Go
struct YAML tags against Python dataclass fields to catch config drift between
the two languages. Integrate into CI and Justfile.

Standardize Python Pulumi test infrastructure with shared fixtures in
conftest.py (ptd_root, pulumi_mocks, aws_workload, azure_workload) and
comprehensive TESTING.md guide covering both test paradigms.
…docstrings

Add Azure naming conventions (CAF prefixes, character limits), AKS step
details (Go-based unlike Python EKS), and Azure-specific gotchas to all
three architecture docs and CLAUDE.md. Add inline docstrings to the 3
largest Azure Pulumi files documenting constructor patterns and resource
naming constraints.
Fix sentence case in ~80 headings, expand ~12 acronyms on first use
(IAM, EKS, AKS, VPC, RDS, etc.), remove ~15 instances of bold-for-emphasis,
fix ~6 passive voice instances, use long-form product names on first mention,
and add custom IDs to all Step headings.
Remove unused imports (pytest, typing), suppress ARG001/ARG002 for
pytest fixture args and Pulumi interface method args that are required
by the interface but unused in the implementation, and fix import ordering.
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