Skip to content

feat: managing-generators + managing-transforms integration-layer rules#49

Draft
petercrocker wants to merge 31 commits into
mainfrom
general-improvements
Draft

feat: managing-generators + managing-transforms integration-layer rules#49
petercrocker wants to merge 31 commits into
mainfrom
general-improvements

Conversation

@petercrocker

Copy link
Copy Markdown
Contributor

Summary

Closes integration-layer gaps in the Infrahub skills surfaced by a real-world
demo session that hit 7 bugs across one build. Six of seven bugs (all
Infrahub-related; #6 was Streamlit-specific) are now covered by new rules,
deterministic graders, and eval tasks. Adds a cross-cutting GraphQL dry-run
rule and stronger per-path skill activation in the SessionStart hook.

Bug coverage

Bug Description Where covered
1 Union-typed query (DcimDevice.location) missing inline fragments → CoreRepository schema-sync hang managing-transforms/queries-union-fragments + infrahub-common/deployment-gql-dry-run
2 HFID list over-packed for single-component target managing-generators/python-relationship-references
3 Bare string passed as relationship → treated as id managing-generators/python-relationship-references + edit to python-generate.md
4 List passed to RelationshipManager.add() as one peer managing-generators/python-multi-peer-add
5 IpamPrefix uniqueness collision via client.create + .save without upsert managing-generators/patterns-natural-key-preflight
7 /api/artifact/generate treated as sync → silent zero-artifact regen managing-transforms/artifacts-async-regen-polling
(cross-cutting) Skill activation hints hook SessionStart additionalContext

What landed

managing-generators (PR 1 set, 14 commits)

  • 4 new rules: python-relationship-references, python-multi-peer-add, patterns-natural-key-preflight, testing-integration (advisory).
  • Surgical fix to the misleading device_type_id example in python-generate.md that contributed to bug 3.
  • New graders/managing-generators/ package: AST-based deterministic graders, 4 task graders, 10 check functions.
  • 5 new eval tasks in eval.yaml (first evals for this skill), all with trials: 3.
  • 33 grader unit tests in tests/graders/test_generators_lib.py.

managing-transforms (PR 2 set, 8 commits)

  • 2 new rules: queries-union-fragments, artifacts-async-regen-polling. New queries- prefix registered in _sections.md.
  • New graders/managing-transforms/ package: GraphQL text + Python AST helpers, 2 task graders, 5 check functions.
  • 2 new eval tasks, both with trials: 3.
  • 28 grader unit tests.

infrahub-common (PR 3, 2 commits)

  • New rule deployment-gql-dry-run recommending infrahubctl render --dry-run (or equivalent) for any queries/**/*.gql change before opening a PR. Documents what YAML-check misses.

Hook (PR 4, 1 commit)

  • Per-path skill activation triggers in SessionStart additionalContext. When generators/**, transforms/**, queries/**, checks/**, objects/**, menus/**, or .gql files are touched, the hook now explicitly tells Claude to read the corresponding skill + named rule files before editing.

Specs and plans

Committed under dev/specs/ and dev/plans/ for traceability:

  • dev/specs/2026-05-18-managing-generators-integration-rules-design.md + plan
  • dev/specs/2026-05-19-managing-transforms-integration-rules-design.md + plan

Test plan

  • uvx --with pyyaml --with pytest pytest tests/ → 207 passed (62 new grader unit tests + existing schema/menu/checks tests)
  • uvx rumdl check skills/ → no markdown lint issues across affected skills
  • python scripts/sync-evals.py is idempotent — evaluations/*.json regenerated and committed
  • All 4 new transforms + 4 new generators graders verified against hand-crafted compliant + violating Python/GraphQL fixtures (scores 1.0 / 0.0)
  • skillgrade --smoke against the 7 new eval tasks — baseline pass rate to be established (run by reviewer / in CI)

@github-actions github-actions Bot added skill/common Changes to the infrahub-common skill skill/managing-generators Changes to the infrahub-managing-generators skill skill/managing-transforms Changes to the infrahub-managing-transforms skill labels May 19, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026

Copy link
Copy Markdown

Deploying infrahub-skills with  Cloudflare Pages  Cloudflare Pages

Latest commit: d029ea9
Status: ✅  Deploy successful!
Preview URL: https://c28efd2e.infrahub-skills.pages.dev
Branch Preview URL: https://general-improvements.infrahub-skills.pages.dev

View logs

petercrocker and others added 5 commits May 19, 2026 17:14
- rumdl fmt over dev/plans + dev/specs (20 auto-fixes); manual cleanup
  of a corrupted nested code-fence in the PR 1 plan.
- Strengthen has_post_to_artifact_generate with a fallback path: when
  the URL is stored in a variable (URL-in-Name node) the AST literal
  check misses; if py_raw contains the path AND any .post() call
  exists, accept. Catches realistic LLM output like
  'endpoint = f"..."; await client.post(endpoint)'.
- Rule prose: add a 3-item upfront checklist (POST + loop + CoreArtifact
  read) since most failing trials produced output that claimed to do
  the right thing but skipped one of the three.
CI failing trials used infrahub_sdk's private client._post(url=..., payload={},
params={'branch': ...}) helper. The grader was only matching .post — extend
_is_post_like_method to accept any attribute name ending in 'post' (.post,
._post, ._async_post, etc.). Also drop the debug py_raw preview now that
the diagnosis is in.

Rule prose: explicit mention that client._post is an acceptable POST method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skill/common Changes to the infrahub-common skill skill/managing-generators Changes to the infrahub-managing-generators skill skill/managing-transforms Changes to the infrahub-managing-transforms skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants