Skip to content

t18697: aidevops secret dependents: show what uses a credential before rename, rotation or revocation - #34733

Merged
marcusquinn merged 16 commits into
mainfrom
feature/gh34719-credential-dependents
Oct 15, 2026
Merged

marcusquinn merged 16 commits into
mainfrom
feature/gh34719-credential-dependents

Conversation

@marcusquinn

@marcusquinn marcusquinn commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Resolves #34719. For #34680.

Stacked on #34732 (t18696), which is stacked on #34726 (t18695). Base is the #34732 branch, so this diff shows only the dependents work.

Adds aidevops secret dependents NAME [--json]: a local, read-only answer to "what uses this credential?" before a rename, rotation or revocation. It searches the name and its declared aliases (and works when given an alias).

Source How
Every repo in ~/.config/aidevops/repos.json and all its linked worktrees git grep -F --untracked (honours .gitignore), 30 s timeout per worktree, parallel
~/.aidevops/agents/custom/ bounded walk (5000 files)
~/.config/aidevops/*.json|conf|toml|yaml (e.g. site-inventory.json credential_env) file scan; the registry itself is excluded
~/Library/LaunchAgents/*.plist (binary plists decoded), ~/.config/systemd/user/*, crontab -l file/command scan

Safety properties:

  • No values, no network: it reads no secret store and outputs locations only (path:line and the matched name). Line text is used for classification and never returned, so values in scanned files cannot leak.
  • Never claims "unused" without evidence: lines that build a name dynamically ("CLOUDFLARE_${ACCOUNT}_API_TOKEN", concatenation, f-strings, %s/.format) are reported as possible-dynamic and set complete: false. Timeouts, truncation and unreadable files do the same. "No references found" is printed only for a complete, empty result.
  • Literal matches are token-exact, so CLOUDFLARE_API_TOKEN does not match CLOUDFLARE_ACME_API_TOKEN.

Files

  • .agents/scripts/credential_inventory_scan.py (new): needle building, literal/dynamic classification, bounded git grep/file scanning; one subprocess site with an absolute executable (# nosec B603).
  • .agents/scripts/credential_inventory_dependents.py (new): source discovery (repos/worktrees, custom agents, configs, schedulers, crontab), report and text rendering.
  • .agents/scripts/credential_inventory_names.py: related_names (canonical first, then aliases).
  • .agents/scripts/credential_inventory.py: dependents subcommand.
  • .agents/scripts/secret-helper.sh: dispatch and help line.
  • .agents/tools/credentials/credential-inventory.md: Quick Reference rule ("run dependents before renaming/rotating/revoking; only trust complete: true") and a "Dependents" section.

Verification

Isolated-HOME runtime script: two git repos (one with a linked worktree), custom agent, site-inventory.json, a binary LaunchAgent plist, and a canonical name plus an alias:

  • Literal hits found in a tracked file, an untracked file, the linked worktree, the custom agent, the config (via the alias) and the binary plist; the gitignored file was not reported.
  • CLOUDFLARE_${ACCOUNT}_API_TOKEN and f"CLOUDFLARE_{acct}_API_TOKEN" were reported as possible-dynamic, giving complete: false and an INCOMPLETE warning.
  • A fake value placed on a matching line does not appear in the JSON output.
  • After removing the dynamic lines, the result is complete: true with 7 literal hits.
  • An unreferenced name prints "No references found in the scanned sources."
  • Querying by alias returns the canonical name with its aliases.
  • ShellCheck, py_compile and markdownlint are clean.

Regression Evidence

This is not a platform fix. systemd, cron and LaunchAgent are mentioned only as read-only scan locations for a new command, and no platform-specific behaviour changes. No repository test was added: under the repo's test policy (reference/ci-gate-policy.md), the new feature was verified through the product path with an isolated-HOME runtime fixture (see Verification). That fixture covered a binary plist, linked worktrees, ignored and untracked files, dynamic name construction, and no value leakage. Existing test-secret-helper.sh passes 26/26.


aidevops.sh v3.39.31 plugin for OpenCode v1.19.0 with claude-opus-5-5 spent 54m and 274,339 tokens on this with the user in an interactive session.

@marcusquinn marcusquinn added the origin:interactive Created by interactive user session label Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1
🚫 Excluded labels (none allowed): 1
  • no-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: marcusquinn/aidevops/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9887ad50-eefd-468d-a322-458b4a868831

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

codacy-production Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 124 complexity

Metric Results
Complexity 124

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Qlty New-File Smell Gate

✅ Clean — 2 new source file(s) scanned, no smells found.

Base (c304f69) Head (ada2adf) New files Smells
2 0

New files scanned

  • .agents/scripts/credential_inventory_dependents.py
  • .agents/scripts/credential_inventory_scan.py

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Qlty Smell Regression Gate

✅ No change — smell count unchanged.

Metric Base (c304f69) Head (ada2adf) Delta
Total smells 65 65 +0

…ory-multi-account-provi' into feature/gh34718-credential-aliases-defaults-injection

# Conflicts:
#	.agents/scripts/credential_inventory.py
…es-defaults-injection' into feature/gh34719-credential-dependents
@marcusquinn
marcusquinn marked this pull request as ready for review October 15, 2026 01:01
@marcusquinn
marcusquinn changed the base branch from feature/gh34718-credential-aliases-defaults-injection to main October 15, 2026 01:15
…ntial-dependents

# Conflicts:
#	.agents/scripts/credential_inventory.py
#	.agents/scripts/credential_inventory_names.py
#	.agents/scripts/secret-helper.sh
#	.agents/tools/credentials/credential-inventory.md
#	TODO.md
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Markdown Lint (changed-line scoped)

No new violations in changed lines (0 pre-existing in touched files — ignored).

Metric Base (c304f69) Head (ada2adf)
Total in touched files — 0
New (in changed lines) — 0

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Shell Function Complexity Regression Gate

✅ No regression — no new function(s) >100 lines.

Metric Base (c304f69) Head (ada2adf)
Total function(s) >100 lines 0 0

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Bash 3.2 Compatibility Regression Gate

✅ No regression — no new bash 3.2-incompatible construct(s).

Metric Base (c304f69) Head (ada2adf)
Total bash 3.2-incompatible construct(s) 0 0

Comment on lines +145 to +146
except Exception: # noqa: BLE001 - malformed plist falls back to raw text
pass
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

SonarCloud: 0 bugs, 0 vulnerabilities, 1 code smells

Thu Oct 15 01:20:40 UTC 2026: Code review monitoring started
Thu Oct 15 01:20:40 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 1
Thu Oct 15 01:22:48 UTC 2026: Codacy analysis completed - issues found (exit 2)

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 1
  • VULNERABILITIES: 0

Generated on: Thu Oct 15 01:22:49 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Shell Nesting Depth Regression Gate

✅ No regression — no new file(s) with nesting depth >8.

Metric Base (c304f69) Head (ada2adf)
Total file(s) with nesting depth >8 0 0

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

File Size Regression Gate

✅ No regression — no new non-README Markdown file(s) >1000 lines at root / >500 elsewhere.

Metric Base (c304f69) Head (ada2adf)
Total non-README Markdown file(s) >1000 lines at root / >500 elsewhere 0 0

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

SonarCloud: 0 bugs, 0 vulnerabilities, 1 code smells

Thu Oct 15 01:32:19 UTC 2026: Code review monitoring started
Thu Oct 15 01:32:19 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 1
Thu Oct 15 01:34:42 UTC 2026: Codacy analysis completed - issues found (exit 2)

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 1
  • VULNERABILITIES: 0

Generated on: Thu Oct 15 01:34:42 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn
marcusquinn merged commit 7feecf4 into main Oct 15, 2026
54 checks passed
@marcusquinn
marcusquinn deleted the feature/gh34719-credential-dependents branch October 15, 2026 01:40
@github-actions github-actions Bot added the status:done Task is complete label Oct 15, 2026
marcusquinn pushed a commit that referenced this pull request Oct 15, 2026
Planning-Publication-ID: cffea7ba4242bd0c1ad21efc838b70488db72008
Planning-Publication-Handoff-ID: 850a821abc7577bbb0648a754dd6e21a19e137bd
alex-solovyev pushed a commit that referenced this pull request Oct 15, 2026
Planning-Publication-ID: cffea7ba4242bd0c1ad21efc838b70488db72008
Planning-Publication-Handoff-ID: 850a821abc7577bbb0648a754dd6e21a19e137bd

Co-authored-by: GitHub Actions <actions@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:interactive Created by interactive user session status:done Task is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

t18697: aidevops secret dependents: show what uses a credential before rename, rotation or revocation

2 participants