Skip to content

fix: localize infraguard policy metadata#113

Merged
Prodesire merged 5 commits into
mainfrom
feature/infrauard_skill
Jun 10, 2026
Merged

fix: localize infraguard policy metadata#113
Prodesire merged 5 commits into
mainfrom
feature/infrauard_skill

Conversation

@xiao201208

Copy link
Copy Markdown
Collaborator

Summary

  • localize InfraGuard policy metadata where non-zh locales copied Chinese text
  • update the policy generator to emit ja/de/es/fr/pt metadata
  • add regression guards for copied zh metadata and Chinese text in non-CJK locales

Tests

  • uv run pytest tests/skills/bundled/test_iac_skill.py
  • uv run ruff check tests/skills/bundled/test_iac_skill.py src/iac_code/skills/bundled/iac_aliyun/scripts/generate_infraguard_policies.py
  • git diff --check

@Prodesire

Copy link
Copy Markdown
Member

Directly putting various InfraGuard Rego policies into iac-code is inappropriate, as it increases maintenance costs and can easily lead to inconsistencies between the two sides. Recommendation:

  • Add a new pac-aliyun (Policy as Code for Aliyun) skill to host PAC-related capabilities.
  • In the skill, lazily fetch InfraGuard and its policies (check for updates) before implementing subsequent PAC capabilities.

@xiao201208

Copy link
Copy Markdown
Collaborator Author

@Prodesire thanks for the clear direction. Addressed in 9f046c6: added a new bundled pac-aliyun skill for InfraGuard/PAC workflows, moved the policy-generation guidance there, and made the first PAC step a lazy InfraGuard sync via infraguard version, infraguard policy update, and infraguard policy list before generation/validation/catalog lookup.

I also narrowed iac-aliyun back to ROS/Terraform IaC workflows, removed the embedded InfraGuard Rego catalog and generator from iac-code, and updated auto-trigger tests so InfraGuard/Rego/PAC prompts route to pac-aliyun only. Verified with uv run pytest tests/skills -q and uv run ruff check src/iac_code/skills tests/skills; the pushed revision is ready for CI/re-review.

Comment thread .gitignore Outdated
eggs/
.eggs/
lib/
!src/iac_code/skills/bundled/iac_aliyun/references/infraguard-policies/lib/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Redundant ignore

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@binxin-wbx Fixed in 64c69f5 by removing the redundant .gitignore exceptions from the branch. The PR is updated and ready for re-check.

]


def should_trigger(prompt: str) -> bool:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

PAC should not be triggered in the IaC skill.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@Prodesire Fixed in 64c69f5. I removed the PAC workflow classifier from iac-aliyun; pac-aliyun now declares supersedes: iac-aliyun, and the generic auto-trigger dispatcher filters the broader IaC match. Verified with targeted auto-trigger tests, including the mixed Rego + ROS prompt.

@Prodesire Prodesire merged commit 3e9875b into main Jun 10, 2026
12 checks passed
@xiao201208 xiao201208 deleted the feature/infrauard_skill branch June 12, 2026 09: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