Repository navigation
perf(ci): parallelize the quality gate and narrow tests to changed sources - #354
Merged
Merged
Conversation
…urces Split the single Validation job into independent Static Analysis, Tests, and DevContainer Image jobs so lint and typing failures surface in about a minute instead of queuing behind the suite, and the image build leaves the critical path entirely. Build and publish the PR devcontainer image only for pull requests targeting main, and only when the change touches content baked into the image. An architectural invariant asserts the watched paths stay in sync with the Dockerfile, so a new COPY cannot silently publish a stale image. Teach `devops ci test` to accept source paths and run only the tests that cover them, matching both by naming convention and by which tests import the module. An uncovered source escalates to the full suite rather than reporting success without running anything. Move the advisory dependency freshness check to a nightly schedule so its PyPI round-trip no longer sits on the pull request critical path.
dan-petty
added a commit
that referenced
this pull request
Sep 22, 2026
* fix(release): disable github automatic release notes appending in release workflow (#332) * docs(roadmap): add OCI container image packaging and GHCR metadata configuration (#333) * chore(release): bootstrap v0.2.22 release cycle (#334) * feat(k8s): implement dynamic informer and native in-process service (#307) (#336) * feat(github): implement GraphQL batch consolidation, ETag caching and rate optimization (#316) (#337) * feat(github): implement GraphQL batch consolidation, ETag caching and rate optimization (#316) * fix(github): remove unused import in graphql.py * feat(mcp): implement FastMCP in-process execution, dispatching and resource subscriptions (#318) (#338) * fix(release): eliminate duplicated issue text from automatic GitHub issue reference expansion (#339) (#340) * feat(ai): implement Pydantic AI structured workflows, prompt caching and token governance (#320) (#341) * feat(gh): add project workflows inspection & linking, decommission bot project-automation workflow (#342) (#343) * fix(ai): eliminate arbitrary defaults in network slot leasing and elevate file size limits to 50 MiB (#344) (#345) * feat(devcontainer): add claude cli and vscode extension to devcontainer configuration and lifecycle (#346) (#347) * feat(devcontainer): add claude cli and vscode extension to devcontainer configuration and lifecycle (#346) * fix(devcontainer): include node feature dependency for claude code installation (#346) * feat(docker): route all container operations through the Engine API socket (#308) (#348) Introduce DockerEngineService as the single Engine API client, speaking directly to the daemon Unix domain socket with a cached connection, typed Pydantic container state models, streamed cgroup resource samples, and BuildKit layer cache introspection via `devops docker cache`. Remove every `docker` CLI subprocess fallback shim from the workload sandbox runner, sandbox lifecycle engine, and metrics collector, along with the human-readable `docker stats` string parsers they required. Co-authored-by: Claude Opus 5 (1M context) <[email protected]> * fix(review): correct feedback loop calibration and remediate verified findings (#349) (#350) Neutralize 104 auto-learned suppression signatures that were single English words such as "unvalidated", "traversal" and "unbounded", each broad enough to bury genuine security findings, and require learned signatures to name two distinctive keywords. Load the builtin hallucination catalog per-entry, so one malformed record no longer discards all 27 and leaves verification running on auto-learned entries alone. Consolidate findings that name the same code symbol or repeat a title at a different line range, while keeping distinct defects in one function separate. Remediate the verified session defects: publish the informer's active watch so stop() can interrupt it and join its worker, bound the informer cache, honour the per-entry cache TTL, log context realignment failures, and wrap GraphQL transport errors. Mandate one finding per root cause, segment-boundary honesty, and a non-empty fix in the review prompts. * feat(argo): manipulate Argo custom resources natively via the Kubernetes API (#351) * feat(argo): manipulate Argo custom resources natively via the Kubernetes API (#309) Introduce ArgoCRDService, which reads and patches Applications, Rollouts, Workflows, and AnalysisRuns in-process through CustomObjectsApi, and typed state models projecting those payloads. Replace the `argo`, `kubectl`, and `kubectl argo rollouts` shell-outs behind workflow listing/submission/logs, rollout listing/status, rollout promote/abort/restart, and GitOps root-app bootstrap, removing the external CLI binary prerequisite. * test(argo): cover the native CRD engine and localize name validation (#309) Add 28 unit tests for ArgoCRDService covering client resolution, 404 versus transport error translation, manifest create-then-patch, rollout control-plane mutations, workflow projection, and sparse payload tolerance. Raise ArgoError instead of typer.Exit on invalid resource names, since the service is consumed by FastMCP tools and the TUI as well as the CLI. * feat(tf): analyze HCL and state in-process for graphs and drift (#310) (#352) Parse Terraform/OpenTofu configuration and state directly into typed models, answering resource-graph, blast-radius, and drift queries without invoking the binary or requiring an initialized working directory. Add `devops tf graph` for the dependency table and per-resource blast radius, and `devops tf drift` for configuration-versus-state divergence. * feat(security): unify secret resolution and manage Vault lease lifecycle (#353) * feat(security): unify secret resolution and manage Vault lease lifecycle (#311) Resolve every credential through one ordered provider chain — keyring, Vault, environment, configuration — replacing nine hand-written fallback ladders that disagreed with each other, and record which provider answered each lookup without ever retaining the value. Authenticate with Vault natively via AppRole or the in-cluster ServiceAccount, track issued leases, and renew them before they lapse so a long CI run never presents an expired credential. Wrap local credentials with the Transit engine so the encryption key never leaves Vault. * fix(security): name the audited value a credential identifier, not a secret (#311) CodeQL flagged the audit trail's debug log as clear-text logging of a secret. The expression carries an identifier such as `github.token`, never a value, so rename it `credential_id` to say so plainly and pin the guarantee with a test asserting no credential value can reach the log record. * perf(ci): parallelize the quality gate and narrow tests to changed sources (#354) Split the single Validation job into independent Static Analysis, Tests, and DevContainer Image jobs so lint and typing failures surface in about a minute instead of queuing behind the suite, and the image build leaves the critical path entirely. Build and publish the PR devcontainer image only for pull requests targeting main, and only when the change touches content baked into the image. An architectural invariant asserts the watched paths stay in sync with the Dockerfile, so a new COPY cannot silently publish a stale image. Teach `devops ci test` to accept source paths and run only the tests that cover them, matching both by naming convention and by which tests import the module. An uncovered source escalates to the full suite rather than reporting success without running anything. Move the advisory dependency freshness check to a nightly schedule so its PyPI round-trip no longer sits on the pull request critical path. * fix(ci): drop the invalid --depth=0 from devcontainer change detection (#355) * fix(ci): drop the invalid --depth=0 from devcontainer change detection `git fetch --depth=0` is rejected with "depth 0 is not a positive number", so the DevContainer Image job failed on the first pull request targeting main. The checkout already fetches full history, so the flag was never needed. Add a regression test that executes the workflow step against a scratch repository, since YAML validation and actionlint both passed while the step failed at runtime. * fix(ci): rebuild the devcontainer image when the build workflow changes The workflow fixes the image name, tag, cache source, and builder action version, so editing it changes what gets published even when every build input is identical. Watch it alongside the Dockerfile and its build context, and pin the requirement with an architectural invariant. * feat(valkey): pool connections, batch commands, and unify caching tiers (#312) (#356) Amortise TCP setup and authentication across callers with a bounded connection pool, so a cache hit costs one round trip instead of three, and collapse command batches into a single round trip via pipelining and MGET. Introduce a tiered cache: a bounded in-process LRU in front of Valkey, with one key builder rooted at a shared namespace. This replaces the per-module key prefixes that made namespace-wide invalidation impossible and let two call sites disagree about where a value lived. Collapse the three near-identical get/set trios in the AI cache provider onto the shared builder, which also gives them L1 caching and batch lookups. * feat(rag): fuse lexical and dense retrieval, and quantize stored vectors (#313) (#357) Dense similarity smooths over the exact tokens that make a query specific, so a chunk defining `_set_cached` could rank below a merely thematic neighbour. Score the dense candidate pool with BM25 as well and fuse both orderings, recovering literal symbol matches without losing semantic ones. Extract BM25 into one shared ranker and refactor conversation search onto it, rather than maintaining a second implementation that could drift. Store vectors as int8 via scalar quantization, cutting index memory to roughly a quarter, and decompose the retriever's search into targeting, projection, and ranking stages — which also brings a pre-existing complexity breach back under the cap. * feat(prometheus): validate PromQL locally and analyse series client-side (#314) (#358) Catch unbalanced brackets, unterminated strings, and malformed durations before a query leaves the machine, reporting the offending character instead of relaying the server's phrasing. The validator checks only what is unambiguously malformed and never polices function names, since wrongly rejecting a valid query is worse than forwarding one the server would reject anyway. Add `devops prometheus analyze` for z-score anomaly detection, EWMA smoothing, magnitude-scaled trend classification, and forward projection, computed locally rather than through server-side subqueries. * feat(grafana): build dashboards declaratively and lint them statically (#315) (#359) Dashboards were 884 lines of JSON repeating datasource bindings, styling, and hand-written grid coordinates on every panel, with no way to catch a broken layout or query before Grafana rendered a blank panel. Add typed schema models, panel builders that assign ids and lay panels out automatically, and a linter detecting overlapping panels, duplicate ids, unbound datasources, and malformed PromQL — reusing the validator the Prometheus commands already apply, so a query rejected at the command line cannot ship inside a dashboard. * docs(roadmap): schedule AI review verification integrity work for v0.2.23 (#360) Investigating the AI review subsystem against an empirical run of 286 findings surfaced five defects in the verification stage. The deterministic pre-verification layer works as designed; the failures are in how its results are bound, scored, and fed back. - Identity-Bound Verification Verdicts (P0): _validate_segment_findings binds verdicts to findings by list position, choosing between two incompatible index spaces with a length heuristic — data[unresolved_idx] when the model returns one item per unresolved finding, otherwise data[idx] indexed over all findings including those already invalidated and never sent. Any count mismatch applies verdicts to the wrong findings. Observed: 23 records simultaneously carrying an invalidation_reason and status VERIFIED, and 7 never updated. The module already has _is_matching_finding for identity matching; the call site does not use it. - Executable Verification Criteria (P0): personas emit deterministic shell assertions, and nothing runs them. They are counted instead, so confidence_score is the model's agreement with its own criteria rather than evidence, and every finding reports verified_by "llm". - Construct-Aware Location Validation (P1): _check_line_boundaries invalidates only when a line exceeds file length, so an in-bounds location pointing at unrelated code passes. Observed: a genuine SSRF finding citing a handler ~170 lines from the vulnerable function. Such locations should be repaired by symbol search, not discarded. - Closed-Loop Hallucination Ledger (P1): auto_record_invalidated_finding writes the ledger and load_common_hallucinations has zero consumers, so every review re-derives the same false positives at full model cost. - Verdict Polarity & Field Distribution (P2): nothing compares observed against expected, so an inverted polarity claim passed at high confidence; and reportable was true for all 286 findings including the 7 unverified, making it a column rather than a filter. Roadmap entries and prioritization matrix rows only; no source changes. * feat(tui): refresh dashboard domains on workers and virtualize log tailing (#317) (#361) DashboardApp.action_refresh_data called five blocking provider functions in sequence directly from the keypress handler and the mount hook, so the interface was unresponsive for the sum of five network round trips and one unreachable cluster froze every unrelated tab -- including the key bound to quitting. Refreshes now run on a worker thread per domain and publish into a shared state store that the UI reads, so each panel renders as soon as its own fetch returns. A provider failure becomes an error snapshot rather than an exception escaping a worker, which would kill the refresh silently and leave the panel showing data that never updates again; the previously fetched rows stay on screen beneath the error, since a transient outage should dim a panel rather than blank it. The five near-identical _refresh_* methods are replaced by a DomainPanel widget that declares its own columns and renders its own snapshot, with banner and row construction extracted as pure functions of each summary type. Tabs, bindings, panels, columns, fetchers and the CLI --tab map all derive from CONST_DASHBOARD_DOMAINS, so adding a domain no longer needs edits in five places. VirtualLogBuffer retains a fixed window and hands out only the visible slice, so a tail costs bounded memory and bounded work per frame however long it runs, and LogPane consumes it to stream a pod's logs selected from the Kubernetes table. 124 tests. state, log_buffer, projections and refresh at 100% coverage; the 17 pre-existing dashboard tests pass unmodified. * fix(telemetry): propagate W3C trace context into child processes (#319) (#362) run_subprocess and run_subprocess_async both documented W3C trace context propagation and both called inject_trace_context(sub_env) -- a function that returns a copy of the mapping it is given. Neither used the return value, so no child process ever received its parent span. Every subprocess began a fresh root trace, and traces only appeared connected because of an inherited ambient TRACEPARENT from whichever process sat at the top of the chain; the intervening spans were orphaned. Injection into a process environment now mutates in place, under the uppercase TRACEPARENT name, and clears any inherited value under the lowercase spelling so a grandparent's context cannot shadow the one being injected. HTTP headers keep the lowercase name and the copying contract. Traceparent parsing existed twice and the two disagreed: one checked field lengths and ignored the version, the other checked the version and ignored the lengths, and neither rejected non-hex characters or the all-zero ids the specification forbids. Since one carrier is the ambient environment, a malformed value was carried into trace ids and exported as real. Both now delegate to one strict implementation, and a span validates an inherited context before adopting it. Also adds ContextPropagatingThread and bind_context for work moved onto threads, and replaces the completed-span list with a bounded deque -- the list used pop(0), shifting every retained span per append once full. 71 tests; propagation.py at 100% coverage. Existing telemetry suites unmodified. * feat(security): unify scanner findings behind a SARIF engine (#321) (#363) Eleven scanners each produced a Finding whose location was a free-form string and whose rule id, where it survived at all, was smuggled into the title as a bracketed prefix. That is enough to print a table and nothing more: two scanners flagging one line could not be recognised as related, a result could not be suppressed by rule, a finding reported twice by overlapping scans appeared twice, and SARIF could not be emitted at all because it needs a ruleId and a structured location. A normalized taxonomy recovers that structure, kept separate from Finding itself so tightening it does not constrain what a model may return during AI review. Identity is tool, rule, path and canonical message -- deliberately not the line, since a finding pushed down by an unrelated edit is the same finding and including the line would re-open every suppression on the next commit. SARIF 2.1.0 emission and ingestion are inverses over that taxonomy. Emission writes one run per tool and carries both the level and the numeric security-severity GitHub ranks by; ingestion accepts any SARIF-emitting tool with no bespoke parser. Findings at one location group into clusters that report which tools agreed, without merging them: two tools reporting one line may describe different problems, and collapsing them would hide one. Only fingerprint-identical results are discarded. Suppression policies compose through extends and every rule may expire; an expired suppression stops suppressing and is reported, and an unparseable expiry is treated as already expired so a typo cannot become permanent. Adds devops scan report and devops scan sarif. 155 tests; normalization at 100%, sarif at 99% coverage. * fix(git): verify SSH host keys before trusting them (#322) (#364) _ensure_known_host ran ssh-keyscan and appended whatever came back to ~/.ssh/known_hosts unconditionally. ssh-keyscan performs no verification -- it reports the key the network hands it -- so anyone able to intercept the first SSH connection had their key pinned permanently and silently, and it ran automatically on every SSH clone. Scanned keys are now verified against fingerprints the host's operator publishes over TLS (GitHub serves them at api.github.com/meta), so trust in the SSH host key derives from TLS PKI rather than from assuming the first answer received is honest. Verification fails closed: an unverifiable key for a pinned host is refused and nothing is written, because accepting it anyway is indistinguishable from having no check. Trust-on-first-use remains available for hosts that publish nothing, and is refused for hosts that do, so the option cannot reintroduce the defect. The entry is recorded under the hostname that was requested rather than the one the scan claimed, so a response naming other hosts cannot pin a key under them. Membership is now parsed in-process instead of shelling out to ssh-keygen -F, which required the OpenSSH client and cost a spawn per check. The replacement handles what a substring search cannot: hashed hostnames, [host]:port forms, alias lists, wildcards, negations, and @revoked markers -- a host whose only entries are revoked is not trusted, where a substring check would report it as known and skip verification. Fingerprints were validated against GitHub's live API: computing them from the raw keys independently reproduces every published value. 66 tests; host_keys and known_hosts at 100% coverage. * feat(gh): close issues linked by pull requests merged outside main (#342) (#366) GitHub honours a closing keyword only when the pull request merges into the repository's default branch. Every task pull request here targets release/v<version>, so `Closes #317` in a body has never done anything, and the link is not recovered at release time either: the merge commits carry `(#317)` as a plain reference, which is not a closing keyword. Seventeen issues for merged, shipped work were still open as a result. `devops gh issues close-merged` performs the closure GitHub declines to, reading the same keywords the author already wrote so the pull request body stays the single place the relationship is declared. It closes exactly what GitHub would have closed: only the nine keywords GitHub itself honours count, a bare `#317` does not, and a reference qualified with another repository is ignored rather than applied to the same number here. Code fences, inline code and quoted lines are stripped before scanning. This project's own documentation shows `Closes #NNN` in examples, and reading those as live declarations would close whatever number the example used. It refuses on an unmerged pull request, since a closing keyword states what merging will do rather than what has happened, and skips pull requests that merged into the default branch so it cannot claim credit for a close GitHub performed. Each closed issue gets a comment naming the pull request and branch; a silent close leaves no way to tell completed work from tidying up. A sweep whose lookups fail records them as errors and exits non-zero. Reporting "no issues needed closing" is indistinguishable from a genuinely up-to-date repository, which is how a broken sweep would go unnoticed -- the first run of this code did exactly that, silently, because `merged` is not a field gh exposes. AGENTS.md now requires running this after any merge into a release branch. 53 tests. * fix(k8s): honour the configured cluster context when connecting (#367) * fix(k8s): honour the configured cluster context when connecting settings.k8s.context was write-only. `devops k8s context <name>` stored it and `devops config` displayed it, but nothing read it when opening a connection: KubernetesService.load_config() passed context=None straight through to load_kube_config, which falls back to whatever `kubectl config current-context` happens to be. A workstation whose config.yaml named homelab-k3s therefore talked to minikube, and the only symptom was a connection error citing 192.168.49.2:8443 -- an address the operator never configured and cannot find in their own config. Context resolution now lives in one place. An explicit --context still wins, since that is a deliberate per-command override; otherwise the configured context is used, and only when none is configured does the ambient kubeconfig apply. Settings are re-read per call rather than captured once, so a long-running dashboard or MCP server follows a context change instead of pinning the value it started with. The context is resolved before the client cache is consulted, so passing None and passing the configured name are not treated as different cache keys for the same cluster. The dashboard had the same defect independently: ui/data_providers loaded the kubeconfig with no context at all, so the Kubernetes panel could describe a different cluster than `devops k8s pods` in the same shell. 20 tests. * fix(devcontainer): align kubectl with the configured cluster context on start The CLI now resolves the configured context itself, but kubectl and every other tool in the container follow the kubeconfig's own current-context. Leaving them disagreeing is how a container ends up running `devops k8s pods` against one cluster and `kubectl get pods` against another -- and the current-context drifts back to whatever was cached on any rebuild, which is exactly what kept happening here. The post-start lifecycle now points kubectl at the context named in the project configuration. Nothing is changed when that context is absent from the kubeconfig: selecting one that does not exist breaks kubectl outright, which is worse than leaving it where it already pointed, so the step reports that instead. An unreadable kubeconfig, a missing kubectl, or an unconfigured context all leave the container starting normally. * fix(devcontainer): stop the configured context being overwritten on start Two things were resetting kubectl's current-context back to minikube on a workstation configured for another cluster. The post-start lifecycle runs a background minikube supervisor, and `minikube start` rewrites current-context. The alignment step added in the previous commit ran before it, so it was undone immediately. It now runs last, after the supervisor, which is the only position where it survives. The test suite was rewriting the developer's real kubeconfig. KubernetesService.switch_context edits ~/.kube/config on disk, and the switch-context tests mock the kubectl invocation but not the native one, so running the suite silently repointed kubectl at minikube. Rather than mocking it in those two tests, KUBECONFIG is now redirected to a throwaway file for the whole run, in the same spirit as the existing guard that blocks external network calls: the possibility is removed instead of each test having to remember. That second one is why the context appeared to drift back on its own between unrelated commands. * fix(tui): correct the Docker, telemetry, Valkey and review panels (#368) Docker: the panel listed only running containers, so it disagreed with `docker ps -a`, and images, networks, volumes and registries were not shown at all. The whole inventory is now fetched in one pass and presented under the single Docker tab as nested views, each carrying its row count in its label. Docker resources are Docker state; promoting them to top-level tabs would make them compete with Kubernetes and Valkey for attention. Telemetry: the panel read the in-process metric registry, which is empty in a freshly launched dashboard -- indistinguishable from broken instrumentation. It now reads Prometheus when one is configured and falls back to the in-process registry otherwise, naming in the banner which registry produced the figures and which endpoint failed when one does. Prometheus is reached with allow_private, as Loki already is: SSRF protection exists to stop an attacker-supplied URL reaching internal services, not to stop an operator reaching their own. Valkey: the provider ignored the configured host, port, password and database and always connected to the compiled-in defaults. An offline banner now names the endpoint that was tried and why it failed; "Offline" alone cannot distinguish a cache that is not deployed from one that is refusing connections, and sends the reader to the wrong place. AI review: a running review creates its session directory before it writes any findings, so taking the newest directory presented an empty in-flight session as the latest result and hid the last real review behind it. The panel now shows the newest completed session and offers a session list, newest first, to open an earlier one. Sessions without findings are reported as "incomplete" rather than "in flight": no running-marker is written, so a session still in progress is indistinguishable on disk from one that was abandoned. Footer: nine bindings overflowed the footer, truncating it mid-word at "q Qu". The numeric tab bindings are hidden -- each tab already shows its own number -- and the logs pane moved to "l". COMMAND_PALETTE_DISPLAY makes the palette hint read "ctrl+p palette" rather than "^p palette". 169 tests. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat(k8s): address cluster services without localhost port-forwarding (#369) * fix(k8s): honour the configured cluster context when connecting settings.k8s.context was write-only. `devops k8s context <name>` stored it and `devops config` displayed it, but nothing read it when opening a connection: KubernetesService.load_config() passed context=None straight through to load_kube_config, which falls back to whatever `kubectl config current-context` happens to be. A workstation whose config.yaml named homelab-k3s therefore talked to minikube, and the only symptom was a connection error citing 192.168.49.2:8443 -- an address the operator never configured and cannot find in their own config. Context resolution now lives in one place. An explicit --context still wins, since that is a deliberate per-command override; otherwise the configured context is used, and only when none is configured does the ambient kubeconfig apply. Settings are re-read per call rather than captured once, so a long-running dashboard or MCP server follows a context change instead of pinning the value it started with. The context is resolved before the client cache is consulted, so passing None and passing the configured name are not treated as different cache keys for the same cluster. The dashboard had the same defect independently: ui/data_providers loaded the kubeconfig with no context at all, so the Kubernetes panel could describe a different cluster than `devops k8s pods` in the same shell. 20 tests. * fix(devcontainer): align kubectl with the configured cluster context on start The CLI now resolves the configured context itself, but kubectl and every other tool in the container follow the kubeconfig's own current-context. Leaving them disagreeing is how a container ends up running `devops k8s pods` against one cluster and `kubectl get pods` against another -- and the current-context drifts back to whatever was cached on any rebuild, which is exactly what kept happening here. The post-start lifecycle now points kubectl at the context named in the project configuration. Nothing is changed when that context is absent from the kubeconfig: selecting one that does not exist breaks kubectl outright, which is worse than leaving it where it already pointed, so the step reports that instead. An unreadable kubeconfig, a missing kubectl, or an unconfigured context all leave the container starting normally. * fix(devcontainer): stop the configured context being overwritten on start Two things were resetting kubectl's current-context back to minikube on a workstation configured for another cluster. The post-start lifecycle runs a background minikube supervisor, and `minikube start` rewrites current-context. The alignment step added in the previous commit ran before it, so it was undone immediately. It now runs last, after the supervisor, which is the only position where it survives. The test suite was rewriting the developer's real kubeconfig. KubernetesService.switch_context edits ~/.kube/config on disk, and the switch-context tests mock the kubectl invocation but not the native one, so running the suite silently repointed kubectl at minikube. Rather than mocking it in those two tests, KUBECONFIG is now redirected to a throwaway file for the whole run, in the same spirit as the existing guard that blocks external network calls: the possibility is removed instead of each test having to remember. That second one is why the context appeared to drift back on its own between unrelated commands. * feat(k8s): address cluster services without localhost port-forwarding Configured endpoints were localhost URLs backed by `kubectl port-forward`: a background process per service, ports that collide between clusters, config that has to be rewritten whenever the cluster changes, and "connection refused" the moment a forward dies. It is also not portable -- one config.yaml cannot describe two clusters. The API server already proxies to any Service and is reachable wherever the kubeconfig is, so a k8s:// URL names the Service itself: k8s://monitoring/prometheus:9090/api/v1/query k8s+https://argocd/argocd-server:443 No local port, no process to keep alive, and the same address resolves against whichever cluster is configured. Credentials and TLS come from the kubeconfig, so nothing new has to be configured to authenticate; client certificates and a custom CA are combined into one SSL context because httpx cannot take both as plain values. get_json accepts either form, so an endpoint can move between direct and proxied addressing without touching the code that reads it. The port is required rather than guessed: a Service may expose several, and picking one would silently target the wrong port. A malformed k8s:// URL raises instead of falling back to direct addressing, which would surface as a DNS failure naming a host the operator never configured. Query strings are carried separately from the path because urlparse splits them off, and a Prometheus endpoint is almost entirely query string -- dropping it turned every request into a bare /proxy call the API server rejects with 400. That was caught against the live cluster before it shipped. Adds `devops k8s service-url`, which prints the portable address and can fetch through it. Verified against a live k3s cluster: 2262 metric names and 28 targets returned from Prometheus with no port-forward running. 40 tests. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * feat(k8s): resolve dashboard endpoints through cluster-native addressing (#370) #369 added k8s:// service addresses but nothing consumed them: the telemetry provider still made its own httpx call against a localhost URL, so the panel kept reporting "connection refused" whenever no port-forward was running. The provider now reads through get_json, which resolves either form, so it does not branch on the address shape and a configuration can move to cluster-native addressing without this code changing. The banner reports the address as written rather than the resolved API server URL. `devops k8s configure-urls --addressing proxy` records those addresses. It discovers each service rather than assuming a name, because charts rarely install one under the bare name an operator thinks in -- Prometheus ships as kube-prometheus-kube-prome-prometheus, which is why exact-name detection found nothing and the endpoint had been hand-written as a localhost URL. Patterns are matched most-specific first so a loose "prometheus" cannot select the node exporter, and a port hint is preferred because a Service commonly exposes several. The default stays nodeport, so existing configurations are untouched; an unrecognised mode is rejected rather than silently falling back. Verified against a live k3s cluster: configure-urls recorded addresses for argocd, grafana, prometheus and jaeger, and the telemetry panel then reported 556 counters, 866 gauges and 772 histograms with no port-forward running. 15 tests. * fix(review): address session findings and ground verification in tooling (#371) Triaged the 42 findings from review session 20260921-212653. Of the ten highest-severity, four were false positives and two of those were marked VERIFIED at 0.94-0.95 confidence. Fixed, because they are real: - The composite toolchain action installed uv at "latest". Every `uses:` in that file is SHA-pinned, but the toolchain it installs was not, so a broken or tampered release would enter every job silently and a past CI run could not be reproduced. Pinned to 0.12.16. - ValkeyClient had no locking anywhere. RESP carries no request identifiers -- replies are matched to commands purely by order -- so two threads sharing a connection read each other's replies, silently, as plausible-looking data for the wrong key. Each request/response cycle is now atomic under a reentrant lock, reentrant because the error paths close the connection from inside a held section. The test for this was initially useless: it passed against the unlocked client because the mocked window was too narrow for threads to interleave. With a yield between write and read it now reports 398 overlaps unlocked and 0 locked. - pipeline() joined an entire batch into one buffer before writing, so memory scaled with the batch rather than the connection -- on exactly the mass embedding fetches its own docstring advertises. Batches are now split on both a command count and a byte budget, since many tiny commands and a few huge values are different shapes of the same problem and either limit alone lets the other through. Declined, with the reasoning recorded in docs/SELF_IMPROVEMENT.md: two claimed AttributeErrors on fields the schema declares as plain `str`; a claim that duplicate detection no longer checks same-file and same-line, both of which are present; and a `:latest` supply-chain claim against a `cacheFrom` build hint. The loop change matters more than the fixes. Two of the four false positives were decidable by `mypy --strict`, which this repository already runs on every commit -- the verification stage was reasoning about types instead of consulting the type checker. _check_none_dereference_hallucination now invalidates a claimed None dereference when the cited module type checks cleanly, before the model verifier sees it; both CRITICAL false positives are caught by it. The other two classes became falsification rules in the verifier prompt, and the calibration record explains why a high-confidence VERIFIED is not evidence: confidence measures the model's agreement with itself, and a deterministic oracle outranks it. 27 tests. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix(tui): quit promptly instead of hanging on an open log stream (#372) Pressing `q` while tailing a pod hung the dashboard until the process was killed. A followed log never ends and the read blocks until the next line arrives -- which for a quiet pod may be never -- so doing that read inside a Textual thread worker meant shutdown waited on it forever. The reader now runs on a daemon thread that hands lines to the worker through a bounded queue. The worker waits with a timeout, so it observes the stop flag promptly even when the stream is silent, and the thread Textual actually waits for is always one that can return. The reader is never joined: it is blocked in a read that cannot be interrupted, so the only way to stop waiting for it is not to. The stop hook belongs on the pane, not the application. Tried from the app first: by the time it unmounts, the widget tree is torn down and a query for the pane returns nothing, so nothing was stopped and the consumer kept spinning. Faulthandler showed the app exiting cleanly and the interpreter then blocking in threading._shutdown, which is what made the cause hard to see from the symptom. The hand-off queue applies backpressure rather than dropping. Discarding when full was the first attempt and it broke the buffer's count of everything the stream produced -- the figure the status line reports true position from, and a property the virtualized buffer was built around. Exit now completes in 0.28s with a stream open, against an unbounded hang. * perf(git): evaluate ignore rules in memory instead of per-file subprocesses (#373) is_ignored_by_git loaded only the repository root's .gitignore and, on a miss, spawned `git check-ignore` for the file. A miss is the common case -- most files in a repository are not ignored -- so the fast path was the rare one and a process was spawned per file: 39.5 ms per tracked file, against 0.3 ms for a file the root pattern happened to match. Reading only the root file was also wrong. Git consults a .gitignore in every directory between the root and the file, plus .git/info/exclude, with deeper files overriding shallower ones and `!` re-including; this repository has 187 of them. A nested rule was invisible in memory and resolvable only by the subprocess it was meant to avoid. Ignore rules are now evaluated fully in process against pathspec, including the rule that a path inside an ignored directory stays ignored however it is re-included -- git does not descend into an excluded directory, so evaluating a file's own rules without checking its ancestors reports it as tracked when git would not. Correctness first: every semantic test asks real `git check-ignore` for the answer rather than encoding an assumption, and the implementation was cross-checked against 260 real paths in this repository spanning tracked sources, .venv, .data, k8s, .github and build caches. Zero mismatches, re-run after each optimization. The first correct version was still slow at 21.1 ms/file. Profiling showed 2404 stat and 2396 lstat calls for 150 files -- four path resolutions and ten ignore-file stats each -- plus an O(depth^2) ancestor walk: it evaluated the rules correctly and spent all its time in the filesystem. A single linear descent, paths taken as given rather than resolved, and interval-revalidated specs bring it to 1.9 ms/file, or 0.73 when the caller supplies is_dir. That last figure is 54x the baseline. The revalidation interval is a measured trade -- 4.97 ms/file checking every call against 0.40 cached, which over a 10,000 file index is 50 seconds against 4 -- and its cost is that an edit takes up to two seconds to appear. reset_indexes() makes it immediate. 22 tests. * perf(http): share pooled connections instead of rebuilding them per request (#374) Sixty call sites used `with httpx2.Client(...) as client:` around a single request, which builds a connection pool, performs one request, and tears the pool down. Every call paid for a fresh TCP handshake and TLS negotiation: 19 ms per request against the cluster API, and 247 ms against a remote endpoint that takes 61 ms once the connection is reused. Clients are now keyed on transport configuration only -- TLS material, redirects, protocol -- because that is what a connection can be shared across. Headers and per-request timeouts are passed to the request, so an authorization header does not fragment the pool into one client per caller. Shared clients negotiate HTTP/2, carry explicit connection limits, and close at interpreter exit; reuse without a ceiling would trade connection churn for the descriptor exhaustion this is meant to prevent. Migrated the paths that repeat: the cluster service proxy, which the dashboard issues once per panel per refresh, and the LLM providers, once per inference. Pooling alone left the proxied request at 25 ms, so the remainder was attributed rather than assumed. resolve_proxy_target reloaded and reparsed the kubeconfig on every call (24 ms) and resolve_context reloaded settings on every call (10.8 ms) -- both larger than the HTTP. Each is now cached against the modification time of the file it reads, which keeps the freshness property it was written for. The context resolver was deliberately uncached earlier in this release precisely so a long-running process follows a context switch; that property is preserved and now asserted through a changed file rather than a reload count. Measured end to end by stashing the change: 34 ms/req before, 13 after. Moving the timeout to the request is required, and the first version of that change dropped it from the Ollama chat call, which would have aborted every long review at the generic HTTP timeout. The existing test caught it, which is what it was for. 23 tests. * fix(ci): make the CI cache fingerprint content-addressed (#375) The fingerprint described git state rather than content: it hashed HEAD, the written tree, and the staged and unstaged diffs separately. Staging a file changed it, and committing changed it again, even though no file content differed. Committing is precisely what happens between running `devops ci` and pushing, so the pre-push hook could never hit the cache. Every push re-ran the entire suite, by construction, however recently the same tree had been verified. Demonstrated before the fix on a scratch repository where nothing but git state changed: 1. after devops ci 5a1068246a174190 2. after git add e461f79567e8eca3 3. after git commit 772276011f33c68e The fingerprint is now computed over the content the checks will actually read: the index blob hash for every tracked path, overridden by the working copy where it differs, with deleted paths removed. That is invariant across `git add`, `git commit` and `git commit --amend`, and still changes for an edit, a new file, a deletion or a rename. Two details decide correctness. Worktree files are hashed by `git hash-object` rather than directly, because a git blob hash covers a header as well as the bytes -- mixing the two hash spaces made a staged file look different from the identical unstaged one, which is the invariance being sought. And porcelain status is read unstripped: its first two columns are status codes and an unmodified index is reported as a leading space, so stripping shifted every column by one and a file modified in the working tree read as one modified in the index, inverting the distinction the caller needs. Both were caught by the tests failing on the real behaviour rather than the intended one. Hashing is batched through a single `git hash-object --stdin-paths` invocation; per-file hashing would spawn a process per changed file on every fingerprint. Roadmap records the larger follow-ups this exposed: per-check input scoping, so a markdown edit stops re-running mypy; deterministic test selection from changed sources; and general settings load caching. 16 tests. * fix(k8s): validate only actual manifests, and loosen the argocd probe (#376) Reviewing the cluster's logs and manifests turned up one defect in this repository's own tooling and one configuration problem it can fix. The manifest validator reported nine HIGH findings against k8s/, every one of them false. It treated the absence of apiVersion and kind as a defect, but that absence is precisely how a non-manifest is recognised, so every Helm values file in the repository was reported as a broken manifest. A validator that flags correct files is how people learn to ignore it. Validation is now scoped to documents declaring apiVersion, which is the Kubernetes-specific marker. Keying on kind does not work: charts legitimately expose it as a values key -- fluent-bit uses it to choose between a DaemonSet and a Deployment -- and that file survived the first fix and forced the discriminator to change. Across this repository every real manifest declares both fields and exactly one values file declares kind alone. The trade is that a manifest omitting apiVersion entirely is skipped. kubectl apply rejects that immediately with a clearer message than this fallback could give, whereas a correct values file being flagged has no such recourse. A file that cannot be parsed at all is now reported as unparseable rather than silently passing. Separately, argocd-repo-server inherited the chart's 1 second liveness timeout. It fetches git repositories and renders manifests, so a slow fetch trips the probe and restarts the pod, losing in-flight work and emptying the repository cache -- which makes the next probe likelier to time out. The cluster shows recurring "Liveness probe failed: context deadline exceeded" events for exactly this. Raised to 10 seconds with an explicit period and failure threshold. The remaining problems found are cluster state rather than repository defects and are recorded in the roadmap: a node left NotReady,SchedulingDisabled with metrics-server retrying it every 12 seconds; a PersistentVolume whose delete has been timing out for three days behind a stuck helper pod; and a collector that logs a burst of connection refused at startup because its dependency on Jaeger is expressed as a retry rather than a readiness gate. 19 tests. * fix(templates): encode values as JSON instead of pasting them between quotes (#378) Both packaged templates emit JSON, and the environment disabled autoescaping while interpolating values between literal quotes. A project name containing a quote produced a file no parser accepts, and a crafted one produced valid JSON of the author's choosing: the name could close its own key, finish the entry, and open a new MCP server entry with an arbitrary command, which the editor runs when it loads .vscode/mcp.json. Values now go through `tojson`, which emits the quoting itself, and rendered output is parsed before it is written. Parsing what was produced is the check that the encoding actually held: a template interpolating without the filter passes review and fails there, which is the only place the mistake is visible before the file reaches something that acts on it. Enabling StrictUndefined found a latent defect on the first render. The devcontainer template gates the kubectl, helm and minikube feature behind `{% if minikube %}` and no caller ever passed `minikube`, so the default Undefined evaluated falsy and every scaffolded devcontainer has silently omitted those tools. `devops devcontainer init` now takes --minikube/--no-minikube. The environment is shared rather than rebuilt per render, which was discarding Jinja2's compiled-template cache on every call, and is sandboxed. The sandbox is not what fixes this. CWE-1336 requires an attacker to control the template, and these ship inside the package; the user controls only values, which Jinja2 treats as data. Shipping the sandbox while leaving interpolation unescaped would have closed the theoretical hole and left the real one open. 19 tests. * feat(rag): reach Qdrant through the cluster API instead of a port-forward (#379) `devops ai rag query` failed with "Cannot connect to Qdrant vector store at http://localhost:6333" while Qdrant was running healthily in the cluster. The configured address was a port-forward target and nothing was listening, which is the same failure the telemetry panel had before cluster-native addressing. The k8s:// scheme added in this release only worked for requests this project issues itself. The Qdrant client is vendored and takes a URL, so it could not consume one -- leaving the scheme unable to help the workload most likely to need it. It turns out it can. The client accepts a base URL and a path prefix separately, which is exactly the shape of an API server proxy endpoint, and it accepts the headers and TLS context to go with them. So a library this project does not control can be pointed at a Service using the credentials already in the kubeconfig, with nothing new to configure. Verified against the live cluster: `devops ai rag query "auth middleware"` returns ranked results from collections devops_code and devops_docs with no port-forward running. Two things had to follow. SSRF validation is skipped for a k8s:// address because it names a Service rather than a host -- what is actually dialled is the API server from the kubeconfig, and if that were untrusted the credentials in that file would already be the larger problem. And the liveness check built its own client straight from base_url, bypassing all of this, so a store that could list its collections still reported itself unreachable; it now goes through the same builder as every other request. 11 tests. * fix(review): act on the verified findings and close the classes that produced the rest (#380) Review session `20260922-034125` returned 33 findings and marked all 33 VERIFIED, eleven at 0.95 confidence. Five described real defects. Fixed: - `core/gitignore.py`: `Path.relative_to` is lexical, so `root/../../etc/x` is "relative to" root and the containment guard passed. A path outside the repository was evaluated against the repository's ignore rules; git answers `is outside repository` for the same input. `..` is now collapsed first. - `core/gitignore.py`: `is_within_git_dir` fell back to the target's own components when the path was outside the repository, so any unrelated checkout with a `.git` ancestor reported as inside this one. - `telemetry/`: the traceparent presence check was case-sensitive while the tracestate check beside it was not, so a caller's `TraceParent` got a second, lowercase traceparent alongside it. W3C Trace Context allows one; a receiver must treat the pair as malformed, and the trace breaks at that hop. - `ai/rag/embeddings.py`: `EmbeddingsError` reused `LLM_INFERENCE_ERROR` while exiting 1 rather than 10, so one machine-readable code mapped to two exit statuses. It now carries `EMBEDDINGS_ERROR`, and a test asserts the property across the whole hierarchy. - `docs/generator.py`: the error catalog omitted the class name, so a base class and its subclass rendered as indistinguishable duplicate rows. The token bucket's negative balance was reported as a leak; it is the pacing mechanism, and the returned delay repays the shortfall exactly. The invariant is now stated in the docstring and pinned by a test, since an unstated invariant is what drew the finding. Declined the rest, and closed three classes mechanically rather than leaving them to the model verifier: - A vulnerability claim naming a package this run's own advisory scan resolved CLEAN. The FastAPI finding is the sharpest case: `external_dependencies` in the same `findings.json` lists both packages clean with no advisory records. - A finding whose evidence is a placeholder advisory identifier (`CVE-2023-xxxx`). - A compatibility claim about a Python below the declared `requires-python` floor. Five further classes became verifier prompt rules: named-advisory grounding with component-wise version comparison, declared-runtime grounding, sink grounding for injection claims, boundary arithmetic stated as a traced sequence, and deliberate mechanisms reported as documentation gaps. `docs/SELF_IMPROVEMENT.md` records the calibration. The lesson it adds to the previous session: the failures are not distributed like the difficulty. Every false positive was refutable in under a minute by reading one file or noticing a placeholder, while each real defect took real tracing. Confidence tracked neither. * fix(gh): report which project automations are off and what they should do (#381) Five of the six built-in workflows on the roadmap board are disabled, including `Item closed` and `Pull request merged`, so items never leave the column they were added to and the board stops reflecting the work. `devops gh project workflows list` showed only enabled or disabled, which made a board that had never been configured look the same as one deliberately kept manual. It now carries the configuration each automation is expected to have and names the gap against the live board. These cannot be enabled from here: GitHub's GraphQL API exposes `deleteProjectV2Workflow` and no counterpart that creates or enables one, so a board owner sets them in the web UI. The command prints the settings URL. Naming the gap precisely is the whole remedy available, and leaving it unreported is how a board silently stops tracking what it is supposed to track. The expected configuration lives in `config/constants.py` with the other classification tables. The gap is counted against the automations the board actually exposes, so a workflow absent from a given board is not reported missing. * perf(gh): sweep merged pull requests in a few calls instead of one per issue (#382) `devops gh issues close-merged` hung. Over this repository's last 100 merged pull requests it spawned 170 `gh` subprocesses -- one `pr view` per pull request to read a body, then one `issue view` per linked issue -- at roughly 0.45s each, around 76 seconds before it could report anything. `gh pr list` returns the body, base branch and URL in the same call that lists the numbers: 0.8s for all 100. `gh issue list` returns every issue's state in one more. The sweep now reads both up front and pull requests merged into the default branch are dropped from the listing rather than fetched and then skipped, since GitHub has already honoured their keywords. Measured on this repository: 76s to 6.4s. This also fixes a correctness bug it was covering. `get_issue_state` claimed a pull request number "reads as None here, which keeps the caller from closing a pull request by mistake" -- but `gh issue view 335` resolves pull request #335 and reports it OPEN, so a closing keyword naming an open pull request read back as an open issue and would have been closed as one. A listing of issues contains only issues, so the batched lookup cannot be fooled this way. `get_issue_state` is gone; there is one mechanism now rather than two that disagree. A failed listing propagates rather than returning an empty sweep: a result with no error and nothing closed is the same output as a genuinely up-to-date repository, which is how a broken sweep goes unnoticed. * feat(release): republish release descriptions from the changelog (#383) Four published releases carried a "What's Changed" section listing a single pull request and a comparison link. A release here is cut from one `feat(release): vX.Y.Z` pull request, so GitHub's generated summary names that pull request and nothing else. The workflow stopped requesting it in #332, but a release body is written once at publish time and nothing in the repository could change it afterwards, so the four published before that kept carrying it. `devops release sync-notes` republishes a release description from its `CHANGELOG.md` entry, either for one version or, with `--all`, for every published release. That both strips what GitHub appended and keeps an edited changelog entry reaching the release it describes, which was previously a one-way write. A release whose body cannot be read is skipped rather than overwritten from a guess, and one with no changelog entry is skipped rather than blanked. A release already equal to its entry is left alone, so a sweep does not churn the feed. The report says when the generated summary was what changed. * docs(agents): hard-wrap source files, not the text the program emits (#384) Terminal messages, commit bodies, pull request descriptions, release notes and issue comments were being composed with newlines inserted to keep lines near the source limit. Nothing measures those lines. The terminal and the receiving surface wrap at their own width, so a break that looked right at 100 columns reads as ragged at every other width, and it breaks copy-paste and search. The rule now says where wrapping applies and where it does not, and gives the alternative for a long string that must still satisfy the source line limit: implicit string concatenation across physical lines rather than an embedded newline. Added to both the canonical AGENTS.md and the template in `instruction_generator.py`, so a regenerated instruction file keeps it. * fix(ai): make prompt-eval measure something instead of reporting 1.0 (#385) `devops ai prompt-eval` reported `accuracy_score` 1.0 and `false_positive_rate` 0.0 on every run, across 1311 cases. It read the feedback dataset, counted how many records carried each label, assigned `verified_matches = valid_expected`, `fpr = 0.0` and `accuracy = 1.0`, and returned. No model was called and no prompt was evaluated. A tool whose purpose is to detect false positives reported their absence by construction, while two calibration sessions were measuring rates near 40% and 85% among high-severity findings. It now replays the deterministic pre-verification layer over the dataset and compares each decision with the verdict that finding was recorded with. On this repository's dataset: 31.8% of recorded invalidations are reached without a model, and 7.5% of recorded verifications are contested by the layer. The two are reported separately rather than combined. A contested record is either over-suppression or a verdict that was itself a false positive, and both need reading; a single accuracy figure would let a gain on one side hide a loss on the other. The four hardcoded baseline pairs that stood in for a missing dataset are gone. A measurement over invented records describes nothing, and printing it in the same shape as a real one made them indistinguishable -- which is how `test_prompt_evaluation` passed: it asserted `total_cases > 0` against the fallback, never against a dataset. Benchmarking prompt variations needs a model in the loop and is a separate piece of work. This measures the layer that runs before any model is asked, which is deterministic, free, and reproducible. * perf(ai): compress the two hot-path review prompts and scope their host rules (#386) `review.md` is prepended to every persona's system prompt, so it is sent once per persona per segment. `verify_finding_system.md` is sent on every verification batch. Between them they had accumulated 4785 tokens of instructions, much of it role-play preamble, nominalised headings, and rules restated in the shape of the rule before them. Both are rewritten: 4785 tokens to 3244, a 32% reduction, with every decision preserved. A test in each suite pins the markers -- one per rule -- so a later edit that trims a decision along with its prose fails rather than showing up as a new class of false positive months later. `review.md` also contradicted itself. Its first rule says never to impose this CLI's layout, task structure or module names on another repository; fourteen of the bullets that followed named `SqlitePlanStore`, `sanitize_prompt_injection`, `validate_url_egress`, `response_repair.py` and this repository's own CI workflow, as general inspection rules. Reviewing any other target, they were noise that pointed at symbols the target does not have. They are unchanged in content and now sit under a heading that says they apply only when the target is this repository. Two further things stay as they are, deliberately. The host-specific rules duplicate rules the verifier prompt already applies, and generator-side suppression is cheaper than generate-then-invalidate -- but removing them would trade fewer tokens for more findings, and there is no measurement here to say by how much. That needs the prompt benchmark, which is a roadmap item rather than a guess. * docs(roadmap): prompt benchmarking and synthetic corpora for evaluation (#387) Five items covering how prompts and the review loop get measured rather than argued about. Prompt benchmarking is the blocker for the rest. Every prompt edit in this project has shipped on an argument that no decision was lost, including the 32% compression in this release, where the evidence is a keyword coverage test rather than any observed change in output. The item states the hard part plainly: the feedback dataset's 1066 `VERIFIED` records were labelled by the same verifier under test, and two calibration sessions put the false positive rate among high-severity findings near 40% and 85%, so `VERIFIED` is a prior rather than a label. The 122 human-verified records are the only trustworthy seed. Generator-side rule pruning depends on that benchmark. The shared review prompt duplicates about a dozen invalidation rules the verifier already applies, but suppressing a false positive at generation time is cheaper than generating and then invalidating it, and nothing measures which way the trade falls. Doing it by argument is how the duplication arose. Synthetic defect corpora address the circularity directly: inject a known defect at a known line and recall becomes measured rather than inferred. The constraint is recorded with it -- an injection the generator knows how to make is one the prompt can be tuned to find, so it measures regression, not capability. Structured fuzzing comes from this release's own evidence. Nearly every boundary defect found by hand -- `relative_to` accepting `..`, `fnmatch` reading `[host]:port` as a character class, `lstrip("./")` stripping a character set, porcelain output shifted by a stripped space -- is what a property test generates in seconds. The properties have to come from the specifications, not from what the implementation happens to do. Prompt adversaries close the last gap: reviewed code is attacker-controlled whenever this tool is pointed at an arbitrary repository, and nothing tests whether embedded instructions can steer a review. * fix(k8s): preview what configure-urls would write, and honour the dry-run variable (#388) Two defects in the same mechanism, found while removing the last concrete private address from `src`. `devops k8s configure-urls --dry-run` previewed eight hardcoded URLs against `192.168.49.2`, a minikube node address with assigned NodePort numbers. It described a cluster the command was not going to configure, and printed the same NodePort block whichever `--addressing` mode was requested, so `--addressing proxy --dry-run` previewed the NodePort result. The preview is now derived from the tables the real path uses: proxy mode shows the `k8s://` addresses it will write, NodePort mode names the shape of a value only the cluster can supply. No address literal remains. The survey behind this found nothing else to change. The RFC 1918 addresses in `tests/` are the subjects of their own assertions -- you cannot test that a private address is rejected without naming one -- and no `.lan` hostname or real topology appears in tracked files. Separately, `is_dry_run()` reads `DEVOPS_CLI_DRY_RUN`, but the root callback called `set_dry_run(dry_run)` with the flag's value, and `set_dry_run(False)` pops that variable. Every invocation without the flag discarded an exported request and ran live, printing nothing to say the request had been dropped. That is how a `release sync-notes --all` intended as a preview republished every release description in this repository. The first attempt at that fix was wrong and the suite caught it: honouring the variable naively made one `--dry-run` latch for the life of the process, so `test_repos_clone_org_dry_run_and_missing_org` and a Grafana export both stopped doing anything. A flag applies to the invocation carrying it; an exported variable applies to every command in that environment. `dr…
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Speeds up the CI quality gate based on measured step timings, and makes
devops ci testusable as a pre-commit hook.Measured baseline
25 recent runs: median 290s, trending to ~340s. Breakdown of a representative 331s run:
Two items were 83% of the run.
Cost basis
This repository is public, so standard-runner minutes are free and unlimited — parallelising into more jobs costs nothing. Larger runners are billed even on public repos, so none are used here; the speedup comes entirely from removing work from the critical path rather than buying more compute. Actions cache sits at 3.96 GB of the 10 GB limit, so no eviction pressure.
Changes
Parallel jobs. The single
Validationjob becomes three independent jobs with noneeds:between them:uv check, lockfile, audit (~60s incl. setup)Typical PR wall clock drops from ~330s to ~127s; the errors you hit most often now fail in about a minute.
Image builds only for PRs targeting
main, and only when image content changed. The image packages devops-cli itself, so the watched path set is derived from what the Dockerfile actually copies —.devcontainer,src,pyproject.toml,uv.lock,README.md— not just.devcontainer/**. A new architectural invariant,test_devcontainer_image_path_filter_covers_dockerfile_sources, parses the Dockerfile'sCOPYdirectives and fails if any lands outside the watched set, so a futureCOPYcannot silently start publishing a stale image while CI reports success. I verified the test fails when aCOPY config.example.yaml k8s/is added.Shared composite action (
.github/actions/setup-toolchain) so the three jobs' setup cannot drift apart, with per-job cache suffixes so concurrent jobs don't race to save the same key.Nightly dependency freshness.
uv tree --outdatedhit PyPI on every PR for advisory information. It now runs on a schedule, off the critical path.devops ci test <paths>for pre-commitdevops ci testnow accepts source paths and runs only the tests covering them, matching by both naming convention and by which tests import the module — the union. On this repo,src/devops_cli/security/secrets.pyselectstest_secret_resolution.pyandtest_telemetry_logfire.py; convention alone would have missed both, and imports alone would miss conventionally-named tests.Measured: 72 tests in 24s instead of 3,764 in 86s.
The safety property that shaped the design: a narrowed run must never report a false green. A staged source with no covering test escalates to the full suite by default (
--no-fallbackfails instead), and a docs-only commit runs nothing and exits 0. Reporting success without executing a single test is the one outcome the hook cannot produce.A
devops-ci-test-changedpre-commit hook wires this to staged Python files. The pre-push full-gate hook is unchanged.Verification
uv run devops ci— all gates pass.tests/test_test_selection.py, plus updated CI workflow-structure tests asserting the jobs run in parallel and the image gate isbase_ref == 'main'.actionlintclean.Not changed, deliberately
fetch-depth: 0— checkout is 4s on a 4.7 MB repo. Shallow cloning is the usual suggestion and would buy nothing while risking history-dependent steps.