Skip to content

fix(dedup-program): resolve Track B activation findings - #60

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/track-b-activation-findings
Jul 4, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/track-b-activation-findings

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 4, 2026 •

Copy link
Copy Markdown
Member

Resolves the three deferred config-distribution review findings captured from the Track B scaffolding PR (#53), so they no longer block wiring the sync.

1. Ruff stub: per-file-ignore scope drift (verified empirically)

Ruff resolves a config file's relative paths against that file's own directory when the file is reached via extend/auto-discovery, but against the CWD when it is passed via --config (configuration docs). Via the root stub, the module's "tests/**" ignores therefore resolved to modules/python/tests/**, so local auto-discovered Ruff flagged S101 in repo-root test files that the CI run (--config modules/python/ruff.toml) accepts — reproduced with a synthetic tests/test_synth.py before the fix.

  • The root stub now re-anchors the path-anchored ignores via [lint.extend-per-file-ignores] (unanchored keys — __init__.py, **/conftest.py — match in both modes and are not repeated; also verified).
  • The module's downstream-extension example now shows extend-per-file-ignores and documents the anchoring semantics: a plain [lint.per-file-ignores] table in a child replaces the extended parent's map entirely (verified empirically — the parent's __init__.py F401 ignore was lost).
  • Parity re-verified both ways: bad fixture 8/8 findings, synthetic test file clean in discovery and --config modes; modules/python/python.test.sh passes.

2. Activation plan no longer assumes Pulumi creates the GitHub App

The Pulumi GitHub provider only exposes authentication as an existing App and AppInstallationRepository for already-installed Apps; App creation is unsupported upstream (terraform-provider-github#2389). The plan's Auth section now records the limitation with sources and adds the one-time manual bootstrap per account (direct or App-manifest registration) that hands the IDs/private key off to github-iac (Pulumi) for everything the provider can express.

3. Explicit pre-activation target re-confirmation

Per the manifest's own header, the gated activation checklist now opens with re-confirming every target's layout and include list against the live repos immediately before wiring — rollout.md (which seeded the manifest) is a dated snapshot, and the authoring-time manifest pass does not stand in for it.

The sync workflow itself remains inert / not wired — no activation in this PR.

Closes #55

🤖 Generated with Claude Code

https://claude.ai/code/session_017K9RRMdUKD7HLExmHwMXAe


Note

Low Risk
Documentation and Ruff stub configuration only; no sync wiring, auth secrets, or production runtime changes.

Overview
Closes deferred Track B review items so config distribution can be wired later; the sync workflow stays inert in this PR.

Ruff local vs CI parity: The root ruff.toml stub now adds [lint.extend-per-file-ignores] for tests/** so auto-discovered runs match CI (--config modules/python/ruff.toml). Ruff anchors relative ignore paths to the config file under extend, but to the CWD under --config, which had narrowed test ignores to modules/python/tests/** locally. modules/python/ruff.toml comments now document extend-per-file-ignores, replace-vs-merge behavior, and this anchoring; config-distribution-plan.md records the same for the dogfood stub.

Activation plan: Auth no longer assumes Pulumi can create a GitHub App—manual bootstrap per account, then github-iac for repo grants and caller secrets. The gated checklist adds re-confirm manifest targets against live repos immediately before wiring (rollout snapshot is not enough).

Reviewed by Cursor Bugbot for commit 43c4f64. Bugbot is set up for automated code reviews on this repo. Configure here.

@claude

claude Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 2m 17s —— View job


Code Review

  • Gather context (CLAUDE.md, PR diff)
  • Review ruff.toml (root stub) — per-file-ignore anchoring fix
  • Review modules/python/ruff.toml — downstream extension example
  • Review docs/dedup-program/config-distribution-plan.md — Pulumi/GitHub App limitation + pre-activation checklist
  • Post final review

Overall this is a well-motivated, technically sound set of fixes. The Ruff anchoring fix is correct, the Pulumi limitation is accurately characterized, and the activation checklist update is sensible. A few observations below.


ruff.toml — Path re-anchoring

The core fix is correct. Using [lint.extend-per-file-ignores] (additive) rather than [lint.per-file-ignores] (replacive) is the right choice: it adds the repo-root-anchored tests/** ignores on top of the module's already-resolved (and now module-root-anchored) modules/python/tests/** ignores. Both paths end up ignored, which is the desired behavior.

Lockstep maintenance surface. The comment correctly flags ruff.toml:16:

Keep these keys in lockstep with the module's [lint.per-file-ignores].

This is unavoidable given the Ruff path-resolution behavior, but the duplication is now a real drift surface: if S108 or another Bandit rule is added to the module's test ignores later, this stub must be updated manually. The comment is the right mitigation, but worth making sure reviewers of future module changes are aware this stub exists and needs to track along. No action needed now — just confirming the trade-off is understood.

**/conftest.py correctly omitted from re-anchoring. The **-prefixed pattern isn't anchored to a directory, so it matches anywhere in the project tree regardless of which config-resolution mode is active. Omitting it from the re-anchor block is correct.


modules/python/ruff.toml — Downstream extension example

Improvement is correct. Changing the example from [lint.per-file-ignores] to [lint.extend-per-file-ignores] (with the new note that a plain per-file-ignores table replaces the parent's map entirely) is an important correction — the old example would have silently dropped the __init__.py F401 ignore for any downstream consumer who added test ignores. The new example guides consumers toward the composing variant by default.

Path anchoring comment at modules/python/ruff.toml:14–18. Thorough and accurate — documents the discovery-vs---config distinction and explicitly points readers at the root stub as the worked example. This is the right place to put it.


docs/dedup-program/config-distribution-plan.md

Auth section — Pulumi limitation. The characterization is accurate. The Pulumi GitHub provider is a Terraform-hosted provider wrapping terraform-provider-github, so citing that upstream issue is the right source. The two-step flow (manual bootstrap → IaC from there) is a clean way to document the constraint without pretending the provider can express something it can't.

One minor note: the bootstrap step says "record the app ID / installation ID; store the private key per the secrets policy" without specifying where to record the IDs. In practice this probably means github-iac's Pulumi config (or a companion doc), but if there's an established place for that, calling it out explicitly here would close the loop for whoever performs the bootstrap.

Activation checklist. Placing the re-confirmation step first in the gated section is the right call — it's the one that can change what everything else operates on (wrong layout or include list would propagate through the rest of the checklist). The motivation (rollout.md is a dated snapshot) is clearly stated inline.

Self-dogfooding section update. The revised description of the ruff stub (extend plus the re-anchor block) now matches what was actually shipped. The before/after is clear.


Summary

No blocking issues. The three fixes address real problems (local/CI disagreement on test ignores, Pulumi stall risk, stale snapshot risk) with the minimal changes needed. The main ongoing concern is the tests/** lockstep between the module and the root stub — the comment acknowledges it, which is the right mitigation at this scope.

cursor[bot]
cursor Bot approved these changes Jul 4, 2026 •

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e660e9bdaa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@claude

claude Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 2m 1s —— View job


Code Review

  • Gather context (CLAUDE.md, PR diff)
  • Review ruff.toml (root stub) — per-file-ignore anchoring fix
  • Review modules/python/ruff.toml — downstream extension example
  • Review docs/dedup-program/config-distribution-plan.md — Pulumi/GitHub App limitation + pre-activation checklist
  • Assess Codex finding re: AppInstallationRepository auth
  • Post final review

No blocking issues. All three fixes are correct and the documentation accurately reflects the constraints.


ruff.toml — root stub re-anchoring

The fix is correct. Using [lint.extend-per-file-ignores] (additive) rather than replacing [lint.per-file-ignores] means the repo-root-anchored tests/** ignores stack on top of the module's already-resolved (module-directory-anchored) patterns. The four rules listed — S101, S105, S106, S107 — exactly mirror modules/python/ruff.toml:80, which is the correct source of truth.

One note on scope: the stub comment at ruff.toml:15 says "keep these keys in lockstep with the module's [lint.per-file-ignores]." That's the right mitigation for the duplication surface. Worth making sure that instruction is visible to anyone editing the module — it's easy to add a Bandit rule to modules/python/ruff.toml:80 and not realize the root stub also needs updating. No action required in this PR, just confirming the trade-off is load-bearing.

**/conftest.py is correctly omitted from the re-anchor block — the ** prefix makes it non-path-anchored, so it matches in both discovery and --config modes.


modules/python/ruff.toml — downstream extension example

The change from [lint.per-file-ignores] to [lint.extend-per-file-ignores] in the header example is a meaningful correctness fix — the old example would silently drop the __init__.py → F401 ignore for any downstream consumer who added test-file ignores. The new example with the "REPLACES" warning is the right guidance to surface here.

The path anchoring comment at modules/python/ruff.toml:14–19 is accurate. Using "docs/**" = ["ERA001"] as the example path in the header (rather than repeating "tests/**") is reasonable — it avoids readers conflating the example with the real config below. Not a problem.


docs/dedup-program/config-distribution-plan.md

Pulumi limitation (Auth section). The characterization is accurate: the provider wraps terraform-provider-github and citing #2389 is the right upstream source. The two-step split (manual bootstrap → IaC for everything expressible) is the correct mental model given the constraint.

Codex P2 finding — already addressed. The Codex reviewer's concern is that AppInstallationRepository is incompatible with GitHub App Installation authentication. The PR text at config-distribution-plan.md:150–157 explicitly states: "manage the App's per-repo grants with AppInstallationRepository — under github-iac's regular provider credential, not by authenticating as the sync App: the resource's docs note it is not compatible with the GitHub App Installation authentication method." The finding is already handled.

One documentation gap (non-blocking). Step 2 says to use github-iac's "regular provider credential" but doesn't specify what that credential needs to be (PAT? OAuth token? what scopes?). Anyone executing the bootstrap who doesn't already know github-iac's auth setup may need to refer elsewhere. Fine to leave implicit if github-iac has its own setup doc, but worth a follow-up note if it doesn't.

Pre-activation re-confirmation step. Placing it first in the gated checklist is correct — a stale manifest target invalidates everything downstream. The rationale (rollout.md is a dated snapshot) is stated inline, which is exactly the right place for it.

Self-dogfooding section. The updated description of the ruff.toml stub (extend + re-anchor block) now matches what shipped. Clear before/after.


Summary

Correct fixes, accurate documentation. The Codex P2 finding is already addressed in the PR text. The only ongoing concern is the tests/** lockstep between the module and root stub — the inline comment is the right mitigation at this scope. The "regular provider credential" gap is worth a follow-up if github-iac lacks its own credential docs, but it doesn't block this PR.

cursor[bot]
cursor Bot approved these changes Jul 4, 2026 •
kyle-sexton and others added 2 commits July 4, 2026 07:32
Three deferred config-distribution review findings, resolved before the
sync workflow is wired:

1. Ruff stub ignore-scope drift: Ruff resolves an extended config's
   relative per-file-ignores against that file's own directory, but
   against the CWD under --config (docs.astral.sh/ruff/configuration).
   Via the root stub the module's "tests/**" ignores therefore meant
   modules/python/tests/**, so local auto-discovered Ruff rejected test
   files the CI run accepts. The stub now re-anchors the path-anchored
   ignores with [lint.extend-per-file-ignores]; parity verified
   empirically both ways (bad fixture 8/8; synthetic tests/ file clean
   in both modes). The module's downstream-extension example now uses
   extend-per-file-ignores — a plain per-file-ignores table in a child
   replaces the parent's map entirely (verified) — and documents the
   anchoring semantics.

2. The activation plan gated on provisioning the sync GitHub App via
   Pulumi, which the provider cannot do (it only authenticates as an
   existing App and grants repo access via AppInstallationRepository;
   creation is unsupported upstream). The plan now records the provider
   limitation with sources and adds the one-time manual bootstrap
   (direct or App-manifest registration) that hands off to IaC.

3. The activation checklist now carries an explicit gated step to
   re-confirm every manifest target's layout and include list against
   the live repos immediately before wiring (rollout.md and the
   manifest seeded from it are dated snapshots).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017K9RRMdUKD7HLExmHwMXAe
The AppInstallationRepository resource is documented as incompatible
with GitHub App Installation authentication, so the plan's IaC handoff
now states the grants run under github-iac's regular provider
credential; the sync App's IDs/key only feed the caller-workflow
secrets.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017K9RRMdUKD7HLExmHwMXAe
@kyle-sexton
kyle-sexton force-pushed the fix/track-b-activation-findings branch from f769bcd to 43c4f64 Compare July 4, 2026 11:32
@claude

claude Bot commented Jul 4, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 8s —— View job


Code Review

  • Gather context (CLAUDE.md, PR diff)
  • Review ruff.toml (root stub) — per-file-ignore anchoring fix
  • Review modules/python/ruff.toml — downstream extension example
  • Review docs/dedup-program/config-distribution-plan.md — Pulumi/GitHub App limitation + pre-activation checklist
  • Post final review

No blocking issues. All three fixes are correct, and the Codex P2 finding (added in the second commit) is properly addressed.


ruff.toml — root stub re-anchoring (L17–18)

The fix is correct. [lint.extend-per-file-ignores] is additive, so the repo-root-anchored tests/** ignores stack on top of the module's already-resolved patterns rather than replacing them. The four rules — S101, S105, S106, S107 — exactly mirror modules/python/ruff.toml:80, which is the correct source of truth.

**/conftest.py is correctly omitted — the ** prefix makes it non-path-anchored, matching in both discovery and --config modes. The lockstep comment at L15–16 is the right mitigation for the ongoing drift surface (e.g. adding a new Bandit rule to the module's test ignores later must also update this stub).


modules/python/ruff.toml — downstream extension example (L8–19)

Changing the example from [lint.per-file-ignores] to [lint.extend-per-file-ignores] is a meaningful correctness fix — the old example would have silently dropped the __init__.py → F401 ignore for any downstream consumer who naively added test-file ignores. The "REPLACES this file's map entirely" warning surfaces the footgun clearly. Using "docs/**" = ["ERA001"] as the example path (rather than tests/**) avoids conflating the example with the live config below — sensible choice.


docs/dedup-program/config-distribution-plan.md

Auth section — Pulumi limitation (L133–157).
Accurate characterization. The two-step flow (manual bootstrap → IaC for everything the provider can express) is the right mental model. The second commit (43c4f64) correctly handles the Codex P2 finding: AppInstallationRepository grants now run under github-iac's regular provider credential, not the sync App's authentication — matching the resource docs' explicit incompatibility note.

One minor gap (non-blocking): step 1 says "store the private key per the secrets policy" without specifying where to record the app ID / installation ID for handoff to github-iac. If github-iac has its own setup doc, a cross-reference here would close the loop for whoever performs the bootstrap.

Pre-activation re-confirmation step (L192–196).
Placing it first in the gated checklist is correct — a stale manifest target (wrong layout or include list) would silently propagate through the rest of the checklist. The inline rationale (rollout.md is a dated snapshot) is the right context to leave in place.

Self-dogfooding section (L228–239).
The updated description of the ruff.toml stub now accurately matches what shipped — the extend + re-anchor block is clearly explained with the discovery-vs---config distinction inline.


Summary

Correct fixes across all three files. The Codex P2 finding is addressed in 43c4f64. The only ongoing concern is the tests/** lockstep between the module and root stub — the inline comment is the right mitigation at this scope. Ready to merge.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: low. Cursor Bugbot completed successfully with no findings requiring human review. Approved; no reviewers assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@kyle-sexton
kyle-sexton merged commit 1c0c16c into main Jul 4, 2026
4 checks passed
@kyle-sexton
kyle-sexton deleted the fix/track-b-activation-findings branch July 4, 2026 11:35
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.

Track B activation: resolve deferred config-distribution review findings before wiring

1 participant