Repository navigation
Description
Problem or Motivation
devops ai ast graph runs re.search with a new pattern for each pair of body and name (src/devops_cli/ai/ast/graph.py:55-56, 71-72). That is 376,800 calls for 1,849 names, and each call misses the re cache. It also runs one rglob for each of 32 extensions (graph.py:20-22).
The dry-run test runs the command on the whole repository and checks only exit 0. It takes 15.06 s in CI and 19.3 s locally with no coverage (measured).
Saving: 15 s of CI worker time per run (measured) and 19 s locally.
Found by the CI and test audit of 2026-11-11. The account runs at most 20 hosted jobs at one time (measured), so each job that does no work makes the queue of each pull request longer.
Proposed Solution & Architectural Design
- Compile one pattern per name (
functools.lru_cache), or tokenise each body once with\b(\w+)\s*\(and intersect the tokens with the set of names. - Walk the tree once with
os.walk, and prune the ignored folders. - Run the dry-run test with
--diron a small tmp tree.
Risk: Low. The call regex stays the same.
Target Subsystem
AI & Agentic Review Pipeline (src/devops_cli/ai/ast/graph.py, tests/commands/test_ai_local_dry_run.py).
Existing Tool Considered
The standard library: re, functools.lru_cache and os.walk. No new tool. Cost: about 15,000 tokens and 1 hour.
Acceptance Criteria
- The build over the repository gives the same 1,849 nodes and 6 edges in 5 s or less (from 17.9-19.8 s; with cached patterns it took 4.5-4.8 s, measured).
- The dry-run case takes 1 s or less.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
perfprefix of the title gives the type.(ai)scope of the title gives the scope.Saves 15 s of CI worker time per run but does not fix a defect or block a release.Reduces CI queue time for all pull requests on a 20-job account.Standard library only, one file plus one test, estimated at 1 hour.Both are perf(ai) items in the AI subsystem, but 118 optimises context_packer truncation while this optimises ast/graph.py regex and file-walk.chore(main): release 0.118.0 (#5050)
devops-cli-service commentedon Nov 12, 2026
Released in v0.118.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.118.0
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 12:40 UTC