Repository navigation
Description
Refreshed plan (2026-10-17, unblocking review)
This section supersedes any text below that conflicts with it.
Decisions
- Decision D11 (owner, 2026-10-17): "feat(rag): Index managed repos, exclude private from unscoped search #1389 is split into a CLI ingestion pass now and an Argo cluster lane later (new item)." This item is the CLI pass. The cluster lane becomes a new item, drafted for intake and not yet filed.
- The pass is a command,
devops ai rag ingest. This reverses the body's answer "A CLI command that runs one pass? Proposed: no", because under feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535's design every cluster job is adevopscommand run by a WorkflowTemplate, so the cluster lane can run this command unchanged. Decision D4 (owner, 2026-10-17) holds feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 to step 1 for now: "feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 is re-scoped to step 1 now (install the Argo Workflows controller and measure, ...); steps 2-6 are filed after its go/no-go." A person can run the command whatever that go/no-go decides. - The body's other reason for "no", that a second writer would fight the lane's cache, moves to the cluster-lane item: once that lane runs, it decides whether a person still runs the pass against the same Qdrant.
service.rag.enabledis dropped. Running the command is the opt-in, and no Service lane reads the setting any more.--repo <owner>/<name>(repeatable) narrows a pass, and each value must be inservice.repos. A repository outside that list would be deleted as removed by the next full pass, and the cluster lane's push trigger needs to run one repository at a time.- When one repository fails, the pass still indexes the others, then exits 1 naming every repository that failed. One broken repository should not leave the rest stale.
- Effort drops from L to M, because the Service, router and cluster work moved out. Priority stays P2. Under the owner's blocker rule this item blocks only the cluster-lane item, which has no priority yet, so it gets no raise.
status/blockednow points to fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 instead of chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562, and comes off when fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 merges. Decision D1 (owner, 2026-10-17): "chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 holds the roadmap Service's deployment only; Service code is built, tested offline and merged at 0 replicas (replicas: 0, its test, and the no-scale/no-restart/no-secret-push rules stay)." After the split this item neither changes nor runs the Service. The chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 task file still lists feat(rag): Index managed repos, exclude private from unscoped search #1389 (docs/agent/tasks/task-1562-suspend-roadmap-service.md:19) and AGENTS.md:151 still keeps items pointing to chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 blocked; the block-scope item records the lift in both.
Scope
- This item delivers the ingestion pass a person runs from a workstation with their own git and GitHub credentials. It has four parts:
src/devops_cli/ai/rag/ingest.py, as the body's "One run for one repository" describes;- the
devops ai rag ingestcommand, which works throughservice.reposin order, one repository at a time; - the
visibilitypayload and its keyword index; - the
must_notfilter inSemanticRetriever.
- It no longer touches the Service,
src/devops_cli/server/,k8s/or the ConfigMap template, and it no longer needs the machine account. - The new cluster-lane item takes the rest. Its draft is "feat(k8s): an argo workflow keeps the rag index of every managed repository's default branch current, on the poll schedule and on each default-branch push". It gets:
- the triggers. The body planned a
rag-ingestconsumer on feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 for the poll tick and default-branch pushes, with a shared-worker mode,/healthzand drain. The draft instead runs the pass from a CronWorkflow under one globalrag-ingestmutex, as Decision D3 (owner, 2026-10-17) says: "feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 and feat(service): each subscribed webhook event runs the roadmap update scoped to it at once, and the 5-minute poll reconciles board edits and lost deliveries #1533 build on today's in-process lanes, with schedules left to feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535's CronWorkflows; feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 step 3 later swaps the delivery seam." A default-branch push submits a run once feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 and feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535's router step land; - the Qdrant Secret and its push-secrets entry, the Qdrant URL and key in the ingest pods' environment, and the two NetworkPolicies (egress from the ingest pods only, and the matching ingress on the llm side);
- the template's
ai.gateway_concurrency.embedding: 1; - the
behindand last-success gauges,RagIngestBehindand itsSERVED_SERIESentry; - the k8s/README.md text and the cluster checks under "Pending a person".
- the triggers. The body planned a
- The cluster lane mounts the Qdrant key only in its own workflow pods, never in roadmap-service.
Delivery
- One PR, size M. It carries the module, the command, the payload index, the retriever filter, tests and docs.
- The private filter ships in the same PR as private ingestion, so no private chunk is ever searchable without a project.
Acceptance criteria
These replace four of the body's sections: "One ingestion lane in the Service", "Embedding load", "Reporting" and "Cluster". "One run for one repository" and "Searches leave private repositories out unless they are named" stand as written, with the changes below.
-
devops ai rag ingestruns one pass overservice.reposin configured order, one repository at a time.--repo <owner>/<name>(repeatable) runs only those repositories. A value that is not inservice.reposfails with aConfigurationErrornaming it, before any request. An emptyservice.reposfails the same way, namingservice.repos, before any request or removed-repository cleanup, so a pass run with the wrong configuration deletes nothing. - The visibility read goes through the GitHub session (refactor(github): the github session owns transport, ledger, error classes and link pagination #983) once that lands, and through
run_ghuntil then. It never makes a bareghcall. - Removed-repository cleanup runs at the start of every pass, including
--repopasses. It compares the pass's recorded state withservice.repos. It touches only projects the pass recorded, never a workstation-indexed project. - The checkout, cache and
state.jsonsit underrepos/<owner>/<name>indata.rag_dir. They are resolved withsafe_resolve_subpath, and a path outside that directory or a forbidden system path is refused, as_resolve_roadmap_repo_pathdoes. Nothing is written under the roadmap clone's<data dir>/roadmap/. -
state.jsonis written atomically, using the same write fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 gives the index cache. - If
qdrant.urlis not set in the configuration file or the environment, the command fails with aConfigurationErrornamingqdrant.urlbefore any request or clone. It never uses thehttp://localhost:6333default (fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165). - A failed repository logs one ERROR record naming the repository, the head it tried and the error. The record has a traceback, except for a
ConfigurationError(fix(roadmap): the roadmap service logs each failed job's own error with its repository, and a configuration error without a traceback #1365). The pass continues with the next repository. - Each repository's run is one
trace_span, and countsdevops_cli_rag_ingest_runs_total{repo,result}inGLOBAL_METRICS, withresulteithersuccessorerror. - The help text is in
src/devops_cli/lang/en/help.py, anddevops docs generate --sync-readmerefreshes the CLI reference. -
docs/cheatsheets/ai_and_rag.mdsays what the pass indexes. It also says thatdevops ai rag clearempties the pass's projects and the next pass refills them, and that a working tree should not be indexed under<owner>/<name>. - Tests: the body's Tests section stands (offline, each test under 1 s, no devops_cli name patched, test(cli): tests double only process edges and mirror the source tree #1307, with real
gitagainstfile://bare remotes and a fake Qdrant client, embedder andghrunner passed in through arguments), with these changes:- the router case moves to the cluster lane;
- the case "a repository worker and the lane run on one repository at the same time" becomes "a pass leaves a roadmap clone of the same repository under
<data dir>/roadmap/untouched"; - new:
--reponaming a repository outsideservice.reposfails before any request; - new: an empty
service.reposfails before any request and leaves a recorded project's points in place; - new: when one repository fails, the next is still indexed, and the command exits 1 naming the failure.
-
uv run devops cipasses. - Pending a person, after merge, from a workstation with their own credentials:
uv run devops ai rag ingestreports one first index per repository and exits 0;devops ai rag statusshows the points;- a second run straight after embeds nothing;
- after a push that edits, deletes and renames a file, a re-run makes
devops ai rag query "<text of the edit>" --project <owner>/<name>return the new text, and the deleted file's text no longer comes back; - a phrase from a private repository comes back only with
--project.
Current references (main 3dd7fa6)
devops ai rag indexissrc/devops_cli/commands/rag.py:106-224, mounted underdevops aiatsrc/devops_cli/commands/ai.py:96-99._build_rag_filter_payloadis atsrc/devops_cli/ai/rag/retriever.py:67-83, andSemanticRetriever.searchapplies it at:475. Qdrant builds onlymustconditions (src/devops_cli/ai/rag/qdrant.py:114-122). The body'sretriever.py:63-79andqdrant.py:85-93are stale.SemanticRetrieveris built at three places:src/devops_cli/commands/rag.py:405;src/devops_cli/ai/tools/builtin_tools.py:394;src/devops_cli/ai/rag/investigator.py:247.
- MCP
rag_searchis atsrc/devops_cli/ai/mcp/server.py:941, and runsdevops ai rag query. Review reaches the retriever throughsrc/devops_cli/ai/review/pipeline.py:1834until refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 lands.ai/review/verification.pyis gone (refactor(review): the model verifier, the hallucination catalog and the model-claim guards are deleted, and person-recorded verdicts become suppressions #1150), andai/review/runner.pyno longer reads RAG. WorkspaceIndexertakescache_diratsrc/devops_cli/ai/rag/indexer.py:588.index_workspaceis at:690-697, and it checks each collection's embedding model first (:700-701, fix(ai): a rag collection records its embedding model, a mismatch fails instead of wiping the collection, and ranking keeps the cosine score #1066).- Still fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388's to fix:
_generate_idhas no project (src/devops_cli/ai/rag/chunker.py:779-783);- the purge delete sends
wait=False(indexer.py:216); - the cache is written with
write_text(indexer.py:634).
service.reposisServiceConfig.repos(src/devops_cli/config/settings.py:636), anddata.rag_diris atsettings.py:683.qdrant.urldefaults toDEFAULT_QDRANT_URL(src/devops_cli/config/defaults.py:188,settings.py:194), and the client timeout is atdefaults.py:370.- Path containment:
_resolve_roadmap_repo_pathis atsrc/devops_cli/roadmap/run.py:253-271;ensure_checkoutis atrun.py:324;safe_resolve_subpathis atsrc/devops_cli/core/paths.py:34.
run_ghis atsrc/devops_cli/github/rate_limiter.py:2059.- fix(roadmap): the job clone tracks the current release's branch while origin has it and the default branch otherwise, so close, refine and metrics run between a ship and the next release's start #1366 has landed:
_make_bare_remotealready runsgit init --bare --initial-branch=main(tests/test_roadmap_run.py:162-166).
Dependencies and order
- fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 (open, v0.2.38, no priority label, not built) provides ids per project, waited deletes, the atomic cache, the points check and the payload-index list. This item lands after it. The native blocked-by link from fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 already exists.
- fix(ai): a rag collection records its embedding model, a mismatch fails instead of wiping the collection, and ranking keeps the cosine score #1066 is closed (completed in v0.2.34). Its PR fix(ai): a rag collection records its embedding model, a mismatch fails instead of wiping the collection, and ranking keeps the cosine score (#1066) #1557 (branch commit 7b4f53e) reached main in the v0.2.34 release commit 6e862cd.
- refactor(github): the github session owns transport, ledger, error classes and link pagination #983 (open, v0.2.37, P1) is optional: the visibility read moves onto its session once it lands.
- refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 (open, v0.2.38, P1) removes review-time RAG. Until it lands, review is one of the callers the filter covers.
- fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165 (open, P2, no milestone) owns the localhost default. This item's own check does not wait for it.
- feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386, feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535, chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562 and a cluster GitHub identity (Decision D2's GitHub App installation, or chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562's revert) are needed only by the cluster-lane item, no longer by this one.
- feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's body still names feat(rag): Index managed repos, exclude private from unscoped search #1389 as its first push consumer, as the owner of the shared-worker mode, and under Blocks. Those now belong to the cluster-lane item, and feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's refresh should point them there.
- This item blocks the cluster-lane item once that is filed.
- No milestone is set. The item follows fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388, and a person sets its milestone.
Problem
Nothing ingests repositories.
devops ai rag indexis run by hand (src/devops_cli/commands/rag.py:99-214).- feat(rag): autonomous rag index drift detection and auto-reindexing scheduler #81 shipped only
rag drift --auto-sync. No command, schedule or hook runs ingestion (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137, R2). - fix(ai): the knowledge base is re-indexed whenever the installed knowledge base differs from what its collection holds, and rag status and drift read Qdrant instead of the local cache #1139 re-indexes the bundled knowledge base on use, but no repository.
- The owner asked on 2026-10-08 for the main branch of every repository in
service.reposto be ingested and kept current.
The roadmap Service already has most of what a watcher needs.
- It receives HMAC-verified GitHub deliveries (
src/devops_cli/server/routes/webhooks.py), which feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 turns into typed events delivered to the consumers that subscribe to them. - It polls every repository every 300 s (
src/devops_cli/server/service.py:258-277;DEFAULT_SERVICE_POLL_INTERVAL_SECONDS,src/devops_cli/config/defaults.py:963). - It keeps a PVC at
/home/devops(k8s/devops/roadmap-service/deployment.yaml,pvc.yaml). - It authenticates git as the machine account through
gh auth git-credential(Dockerfile:36-37; ADR 0002,reposcope). With that, it already clones the two private managed repositories for close and refine (src/devops_cli/roadmap/run.py:184-251).
Push deliveries already reach the Service.
- Read on 2026-10-08: each of the eight managed repositories has an active hook on
/webhooks/githubthat sendspush. Three send every event and five send onlypush. The last response of each was 2xx. - Today the route enqueues every verified delivery to the repository's worker as
(webhook, <event>, <action>)(webhooks.py:231-236). No row of the due table matches a push (src/devops_cli/config/constants.py:2455-2464), yet the worker opens the roadmap and reads the board's changes (run.py:870,:821-823,:683-689). So each push spends GitHub reads and makes no job due. fix(roadmap): the job clone tracks the current release's branch while origin has it and the default branch otherwise, so close, refine and metrics run between a ship and the next release's start #1366 records the quota pressure those reads add to. - Deliveries sent by the machine account are dropped (
webhooks.py:175), so only the next poll sees the machine account's own pushes. - feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 changes all three: a default-branch push reaches only the consumers subscribed to pushes, an unsubscribed event starts no round, and the machine-account filter moves into the roadmap consumer. No consumer subscribes to pushes yet. This item adds the first.
The Service cannot reach Qdrant, and the cluster Jobs must not.
- k8s/README.md:326: "Commands that need Qdrant, Prometheus, Grafana, Argo CD or a repository checkout do not run there yet."
devops-default-perimeterselects every pod in namespacedevops(podSelector: {},k8s/devops/networkpolicy.yaml:10). It allows egress to DNS, the gateway on 4000, the collector and public 443 only (:14-55).llm-default-perimeter, which covers the Qdrant pod, admits only namespacellm, monitoring and Traefik (k8s/llm/networkpolicy.yaml:22-38).- The ConfigMap template has no
qdrantblock (k8s/devops/configmap.example.yaml), soqdrant.urlis thehttp://localhost:6333default (defaults.py:197; fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165). - The cluster Jobs read the same ConfigMap, and the same Secret through
envFrom(k8s/devops/cronjob.yaml:48-50,k8s/devops/roadmap-service/deployment.yaml:58-60). - Qdrant's client waits up to 300 s per attempt by default (
DEFAULT_QDRANT_TIMEOUT_SECONDS,defaults.py:372). If a pod got a Qdrant URL that its NetworkPolicy blocks, its RAG lookups would wait out that timeout instead of failing at once. - Secret
devops/devops-clicarries no Qdrant key (src/devops_cli/k8s/cluster_secrets.py:223-248).- The only Qdrant key is the instance's master key,
llm/qdrant-api-key(:181-194). - Open WebUI keeps its own collections in the same instance (
k8s/llm/values-open-webui.yaml:33-36).
- The only Qdrant key is the instance's master key,
Why not a row in the roadmap due table.
- Every row runs after
_open_roadmap(run.py:870), which needs.github/roadmap.tomland the board. Ingestion needs only git and Qdrant.- Until they were set up, between 2026-10-07 23:51 and 2026-10-08 00:17 UTC, six repositories failed there on every poll (feat(roadmap): onboard checks a repository for the roadmap jobs #1359).
- Reprioritize failed 9 times between 2026-10-05 and 2026-10-08, on the GraphQL reserve and on REST timeouts (fix(roadmap): the job clone tracks the current release's branch while origin has it and the default branch otherwise, so close, refine and metrics run between a ship and the next release's start #1366).
- Rows run in each repository's own worker thread (
service.py:243-245), so up to eight repositories would index at once. A consumer on feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's default per-repository workers would do the same, which is why this one runs on one shared worker.- Each embedding call runs up to
ai.gateway_concurrency.embeddingrequests on its own pool (src/devops_cli/ai/rag/embeddings.py:964-968). The default is 4, and the live ConfigMap doesn't set it. - Those requests go to
bge-m3:latestonollama-48gib-slow(k8s/llm/gateway/configmap.yaml:53-59). That tier runs one request per model at a time (OLLAMA_NUM_PARALLEL=1,k8s/llm/profiles/ollama-profiles.yaml:471-472). Ollama's FAQ describes the setting as "The maximum number of parallel requests each model will process at the same time". - The same tier serves
devops-background, the roadmap jobs' model.
- Each embedding call runs up to
- A first index of this repository is about 20,000 chunks at 910b823 (fix(ai): a rag collection records its embedding model, a mismatch fails instead of wiping the collection, and ranking keeps the cosine score #1066 estimated 17,500 chunks and 15-30 minutes on that tier). As a row, it would hold up the repository's other jobs for that long.
- The roadmap clone tracks the default branch (
run.py:244-291). A second thread running git in that clone would collide on its locks.
Why not a separate Deployment. It would need all of these, only to get the isolation that one more thread in the existing process already gives:
- its own webhook route and HMAC secrets (
service.py:325-351); - its own poll tick, GitHub token, PVC and NetworkPolicy;
- its own Argo CD resources;
- a second webhook on every repository.
The index isn't ready for many repositories.
- Projects that share a path overwrite each other's points, and a default index already does this. Failed deletes are forgotten, and a lost collection is never refilled (fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388).
- A search can wipe a collection, and no point records its embedding model (fix(ai): a rag collection records its embedding model, a mismatch fails instead of wiping the collection, and ranking keeps the cosine score #1066).
Private repositories would leak into unscoped searches.
- Two of the eight managed repositories are private (feat(roadmap): onboard checks a repository for the roadmap jobs #1359).
- A search names no project unless its caller passes one (
src/devops_cli/ai/rag/retriever.py:63-79). The callers that pass none:devops review(src/devops_cli/ai/review/pipeline.py:1805,ai/review/runner.py:277,ai/review/verification.py:297). Its output is posted to pull requests, public ones included, until refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 removes review-time RAG.- chat (
src/devops_cli/commands/ai.py:1113,:1279) and the agents (src/devops_cli/ai/agents/agent.py:882,:1170); analyzeoutlines (ai/analyze/outlines.py:104,:302) and the benchmark runner (ai/benchmark/runner.py:315);devops ai rag query, the MCPrag_searchtool (ai/mcp/server.py:933) and the agent toolrag_search(ai/tools/builtin_tools.py:360).
- All of them search through
SemanticRetriever;investigate_rag_contextbuilds one atai/rag/investigator.py:247. - A generic question asked while working on a public repository would get private chunks back, and these could be quoted into public GitHub text. AGENTS.md:28 forbids exposing private content.
Acceptance criteria
One ingestion lane in the Service, as a consumer on #1386
- With
service.rag.enabled: true(defaultfalse), the Service declares arag-ingestconsumer on feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386. It takes default-branchpushevents and the poll tick. With the setting off, the consumer isn't declared, and a push getsno_subscriber. - A shared worker. This item adds the router's shared-worker mode: a consumer may declare one worker instead of one per subject. Its batch carries the subjects that became due since its last batch, and
rag-ingestworks through them one at a time, inservice.reposorder. The worker's job series carryconsumer="rag-ingest"and an emptyrepo; per-repository results are this item's own metrics (Reporting). - A repository becomes due on every poll tick, and on every default-branch push the router delivers for it. Webhooks only cut latency (ADR 0003): the next tick catches a missed or dropped delivery.
-
/healthzreports unhealthy if the shared worker dies, as it does for any router worker (service.py:295-304). - Drain waits for the current run within
drain_timeout_seconds(service.py:306-322). The next start resumes an interrupted run. -
DEFAULT_DUE_TABLEandservice_jobare unchanged, and ingestion never opens the roadmap store.
One run for one repository. A new module, src/devops_cli/ai/rag/ingest.py, takes the remote URL, a git runner, a GitHub runner and the indexer as arguments. The Service passes https://github.com/<owner>/<name>.git, as ensure_checkout(remote_url=...) does (run.py:184-196).
- Visibility, on every run.
- The run reads the repository's visibility with one
GET repos/<owner>/<name>, through the GitHub session (refactor(github): the github session owns transport, ledger, error classes and link pagination #983), or through the store'sghrunner until refactor(github): the github session owns transport, ledger, error classes and link pagination #983 lands. publiccounts as public. Any other value,privateorinternal, counts as private.- If the visibility differs from the recorded value, the run first rewrites
visibilityon the project's existing points, with oneset_payloadby filter per collection. - That is eight REST requests per 300 s, about 96 an hour.
- The run reads the repository's visibility with one
- Head check.
- The run reads the default branch and its head with
git ls-remote --symref <remote> HEAD. That is two small HTTPS requests on one connection, three for a private repository because of the credential challenge, outside the REST and GraphQL quotas. - The run ends here only when the head equals the commit recorded in
state.jsonand the indexer's check (fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388) finds the project's points still in place. The check is two exactcountrequests.
- The run reads the default branch and its head with
- Checkout. Otherwise the run updates a shallow, single-branch checkout of that branch at
repos/<owner>/<name>/treeunderdata.rag_dir:- the first run clones with
git clone --depth 1 --single-branch --no-tags; - later runs use
git fetch --depth 1 origin <branch>, thengit checkout --detach FETCH_HEAD; - the checkout is separate from the roadmap clone, so no two threads run git in one repository;
- paths are resolved and checked against traversal, as
_resolve_roadmap_repo_pathdoes (run.py:163-181).
- the first run clones with
- Index. The run calls
WorkspaceIndexer.index_workspace(<tree>, project="<owner>/<name>", include_kb=False), with its cache inrepos/<owner>/<name>underdata.rag_dir.- Only files whose content changed are embedded.
- Deleted and renamed paths lose their points (fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388).
- Every point's payload carries
visibility, eitherpublicorprivate. - The payload-index list (fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388) gains a keyword index on
visibility.
- Recording. Only after the indexer returns does the run record the head, branch, visibility and time in
state.json, with an atomic write. A failed run records nothing, so the repository is retried at the next trigger. The incomplete-file markers (fix(ai): an interrupted rag index resumes every file whose chunks were not all stored #1296) resume embedding where it stopped. - First index and lost points.
- A repository with no state is indexed in full. That is how a repository newly added to
service.reposis ingested after the nextdeploy-stack. - A project whose points the check finds missing is re-indexed in full (fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388). So the next tick refills the index after a
devops ai rag clearor a lost Qdrant volume.
- A repository with no state is indexed in full. That is how a repository newly added to
- Removed repositories. On start, a repository that has lane state but is no longer in
service.reposhas its points deleted from both collections, filtered onproject_name. Its state and checkout are then removed. Only projects the lane recorded are touched, never a workstation-indexed project. - Empty repositories. A repository with no head is recorded as empty, which is not an error.
Embedding load
- The ConfigMap template sets
ai.gateway_concurrency.embedding: 1. Each embedding call then sends one request at a time (embeddings.py:964-968), and the lane is a single thread.
Searches leave private repositories out unless they are named
- A search without a project adds a
must_notcondition onvisibility = private(retriever.py:63-79,src/devops_cli/ai/rag/qdrant.py:85-93). - A search with a project searches that project, whatever its visibility.
- Points without
visibility, such as workstation indexes and the knowledge base, are unaffected. - The condition lives in
SemanticRetriever, so it covers every caller listed under Problem, review first.
Reporting
- Each failed run logs one ERROR record naming the repository, the head it tried and the error, with its traceback. A configuration error is logged without a traceback, as fix(roadmap): the roadmap service logs each failed job's own error with its repository, and a configuration error without a traceback #1365 does for
ConfigurationError. -
/metricsexposes:devops_cli_rag_ingest_runs_total{repo,result}, withresulteithersuccessorerror;devops_cli_rag_ingest_behind{repo}, which is 1 while the recorded commit differs from the last head seen, and 0 otherwise;devops_cli_rag_ingest_last_success_timestamp_seconds{repo}.
- One warning rule,
RagIngestBehind:max by (repo) (devops_cli_rag_ingest_behind) == 1for 2h, its summary naming the repository.SERVED_SERIES(tests/test_k8s_monitoring_alerting.py:31-75) gainsdevops_cli_rag_ingest_behind, served by roadmap-service's annotation scrape, andtest_the_baseline_rule_setlists the rule. A person sees it in chat once feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392 routes alerts there.
Cluster: only the Service's pods reach Qdrant
-
k8s/devops/roadmap-service/deployment.yamlsetsDEVOPS_CLI_QDRANT_URLtohttp://qdrant.llm.svc.cluster.local:6333, andDEVOPS_CLI_QDRANT_API_KEYfrom Secretdevops/roadmap-service-qdrant. The ConfigMap gets noqdrantblock, so cluster Jobs still have no Qdrant URL and no key. -
cluster_secrets.pygains Secretdevops/roadmap-service-qdrant:- its one key,
DEVOPS_CLI_QDRANT_API_KEY, comes from keyringqdrant_api_keyand is adopted fromllm/qdrant-api-key api-key; - pushing it restarts
roadmap-service; - the Cluster Secrets table in k8s/README.md lists it.
- its one key,
-
k8s/devops/roadmap-service/networkpolicy.yamlgains a NetworkPolicy,roadmap-service-egress-qdrant. It selectsapp.kubernetes.io/name: roadmap-serviceand allows egress to namespacellmon TCP 6333. The peer is namespace-selector-only, as the gateway rule's is (k8s/devops/networkpolicy.yaml:25-33).devops-default-perimeteris unchanged; because policies add up, Jobs still cannot reach Qdrant. -
k8s/llm/networkpolicy.yamlgains a NetworkPolicy that selectsapp.kubernetes.io/name: qdrantand admits namespacedevopson TCP 6333. - Both files are already listed in
_MANIFESTS_BY_STACK(src/devops_cli/commands/k8s/stack_lifecycle.py:168-194) and in the kustomizations Argo CD syncs. A test checks that both new policies sit in files that both lists name, which is the miss fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795 records for the gateway policy. - The ConfigMap template sets
service.rag.enabled: trueandai.gateway_concurrency.embedding: 1.render_devops_configmap_content(src/devops_cli/k8s/configmap.py:23-58) still renders and validates it, and a render test checks both values. - If
service.rag.enabledis set butqdrant.urlor its key is not configured, the lane logs one ERROR at start naming the setting, and ingests nothing. The roadmap workers run as before. The lane never falls back to localhost (fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165). - k8s/README.md:
- "Roadmap service" step 9, which feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 rewrites, says that Pushes are now needed;
- the sentence at :326 stays true for Jobs, and gains one sentence saying that the Service reaches Qdrant for the lane;
- a short section says what the lane indexes and which metrics show its progress. It also says that
devops ai rag clearempties the lane's projects too, and that the lane refills them at the next tick.
Tests (offline; each test under 1 s; no devops_cli name patched, #1307)
- The edges are passed in through arguments:
- real
gitagainst bare remotes intmp_path, given asfile://URLs, because git ignores--depthfor a plain local path; - each bare remote's HEAD names a pushed default branch (
git init --bare --initial-branch=main), as fix(roadmap): the job clone tracks the current release's branch while origin has it and the default branch otherwise, so close, refine and metrics run between a ship and the next release's start #1366 changes_make_bare_remote(tests/test_roadmap_run.py:78) to do, or as the lane's own helper does; - a fake Qdrant client that keeps points by id, a fake embedder and a fake
ghrunner.
- real
- The cases:
- the first run indexes every file and records the head;
- a second run at the same head makes only the visibility read, the
ls-remoteand two counts, and embeds nothing; - a push that edits one file, deletes one and renames one embeds only the edited and the renamed file, and leaves no point for the deleted path or the old name;
- an embedding failure halfway records no head, and the next run embeds only the files that weren't stored;
- after
git symbolic-ref HEAD refs/heads/<new>in the bare remote, the run follows the renamed default branch; - one collection emptied under a matching
state.jsonmakes the next run embed every file again; - a repository removed from
service.reposloses its points and state, while a workstation project in the same collections keeps its points; - a private repository's points carry
visibility: private. A search without a project doesn't return them, and a search naming the project does; - a repository turned public has its payload rewritten; one turned private at the same head is left out of unscoped searches after the next run;
internalcounts as private; - a default-branch push through the router makes the repository due on the shared worker and adds nothing to the roadmap worker's queue. A poll tick makes every repository due. A push to another branch, and other events, don't. With the setting off, a default-branch push gets
no_subscriber; - a repository worker and the lane run on one repository at the same time without touching each other's directories.
-
uv run devops cipasses.
Pending a person, after merge
uv run devops k8s push-secrets --only devops/roadmap-service-qdrant, thenuv run devops k8s deploy-stack --stack llmanduv run devops k8s deploy-stack --stack devops.- Watch the first index:
kubectl -n devops logs deploy/roadmap-service --tail=200 | grep -i ragshows one first index per repository;devops_cli_rag_ingest_behindreaches 0 for every repository;devops ai rag statusshows the points;kubectl -n devops get pod -l app.kubernetes.io/name=roadmap-serviceshows no restart.
- After the first index, run
kubectl -n devops exec deploy/roadmap-service -- df -h /home/devops. The PVC is 1 GiB (k8s/devops/roadmap-service/pvc.yaml:17) and already holds eight roadmap clones. Above 80% used, file a follow-up to grow the volume. - While the first index runs,
devops_cli_service_jobs_total{result="success"}keeps rising for every repository, and Loki shows no newRoadmap job ... failedrecords. - Push a commit to a managed repository's default branch that edits, deletes and renames a file. Within a minute:
devops ai rag query "<text of the edit>" --project <owner>/<name>returns the new text;- a query for the deleted file's text returns nothing from it.
devops ai rag query "<a phrase from a private repository>"returns no chunk of that repository without--project, and does return it with--project.devops k8s run-job -- ai rag statusstill finds no Qdrant: Jobs got neither the URL nor the key.
Key questions
- A row in the roadmap due table, a lane in the Service, or a separate service? Proposed: a lane in the Service. The reasons are under Problem.
- Why still check the head, when feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 delivers only default-branch pushes? A re-delivered push, a push the poll already caught, or a force-push back to an indexed commit would each re-index for nothing. The head check costs one
ls-remoteand two counts. - Find changed files with
git diff, or with content hashes? Proposed: content hashes, which is the indexer's own incremental path.- A diff from the recorded commit needs history that the shallow checkout doesn't keep.
- A second change-detection path would duplicate the indexer's cache.
- Hashing one commit's files is quick: this repository has 1,860 tracked files, about 21 MB.
- Private repositories: include them, skip them, or use a separate collection? Proposed: include them, record
visibility, and leave them out of searches that name no project.- The request covers every configured repository, and skipping them would drop two of the eight.
- Qdrant's guide reserves multiple collections for "a limited number of tenants that need strict isolation", which two private repositories arguably are. But a separate collection would make every caller know about it. The filter sits in
SemanticRetriever, the one class every search goes through. - The checkouts sit on the same PVC as the roadmap clones, under the same machine account.
- Read the visibility on every tick? Proposed: yes. Otherwise a repository made private without a new push would stay public in the index. It costs about 96 REST requests an hour across eight repositories.
- Should public sibling repositories show up in searches that name no project? Proposed: yes.
- Every chunk carries its project in the formatted context (
retriever.py:493). - AGENTS.md's privacy rule governs what an agent copies into GitHub text.
- Alternative: default the project to the checkout's origin.
- Every chunk carries its project in the formatted context (
- What project name? Proposed:
<owner>/<name>, the formservice.reposuses.- A workstation
rag indexdefaults to the directory name (src/devops_cli/ai/rag/indexer.py:48-61), so the Service's projects never collide with a working tree's index. - The README asks people not to index a working tree under
<owner>/<name>.
- A workstation
- An opt-in setting? Proposed:
service.rag.enabled,falseby default, so a workstationdevops serve --servicestarts no embedding. The ConfigMap template turns it on. There is no per-repository list, because the lane coversservice.repos. - Put the Qdrant URL in the ConfigMap or in the Deployment? Proposed: in the Deployment.
- Jobs share the ConfigMap, and their egress doesn't reach Qdrant.
- A URL there would make their RAG lookups wait out the 300 s client timeout, instead of failing on an unset URL.
- Should the Service hold Qdrant's master key? Proposed: yes for now, under two limits: only the Service's Deployment reads the Secret, and only its pods have egress to Qdrant.
- The Service also accepts internet-facing webhooks. If it were compromised, the attacker would reach every collection, Open WebUI's included.
- Qdrant's JWT RBAC (
service.jwt_rbac, tokens signed with the API key and scoped to collections) is the least-privilege follow-up. It needs a JWT library and a Qdrant values change, so it is outside this item.
- A process-wide limit on embedding requests? Proposed: no.
- With the setting at 1, each call sends one request at a time, and the lane is one thread.
- Intake's embeds from the repository workers (
src/devops_cli/roadmap/intake_model.py:155-160) then wait in Ollama's queue behind at most one lane request. Ollama's FAQ onOLLAMA_MAX_QUEUE: "The maximum number of requests Ollama will queue when busy before rejecting additional requests. The default is 512".
- Should ingestion pause while roadmap jobs run? Proposed: no.
bge-m3:latestandqwen3.8:27bare separate models on the tier, each with its own single slot. They share the GPU without queueing behind each other.- Other embedding callers wait for at most one request.
- A CLI command that runs one pass? Proposed: no. A person can already run
devops ai rag index <checkout> --project <name>. A second automatic writer would fight the lane's cache. - Grow the PVC? Proposed: not now.
- A shallow checkout holds one commit.
- The person-run check reads the volume's usage after the first index. A larger volume becomes a follow-up if it is needed.
- Who reads the index?
- Chat, the agents,
analyze,rag query, and the MCP and agentrag_searchtools. - Reviews too, until refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 removes review-time RAG.
- feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 keeps embeddings for chat, MCP and the KB index. This item doesn't bring RAG back into reviews.
- Chat, the agents,
Strategic alignment
- Priority: P2. The owner asked for it on 2026-10-08. It adds a capability and fixes no breakage, so it is not P1. The readers it feeds are chat, the agents, MCP,
rag query,analyze, and reviews until refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151. - Value: M. Effort: L.
- Library-first: no new dependency, no new Deployment and no hand-rolled helper.
- Git does the change detection (
ls-remote --symref) and the shallow fetch. - The existing
WorkspaceIndexerand its content-hash cache index the files. qdrant-client'sset_payload, delete by filter,countandcreate_payload_indexhandle visibility, removed repositories and lost points.- Kubernetes NetworkPolicies and the existing push-secrets path scope Qdrant access.
- feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's push delivery and the Service's poll tick trigger the runs.
- Git does the change detection (
- Depends on:
- fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388: ids per project, waited deletes, the points check;
- fix(ai): a rag collection records its embedding model, a mismatch fails instead of wiping the collection, and ranking keeps the cosine score #1066: no search wipes a collection, and each point records its embedding model;
- feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386: default-branch push delivery to subscribed consumers, which this item extends with the shared-worker mode.
- Blocks: nothing.
- Related:
- fix(ai): the knowledge base is re-indexed whenever the installed knowledge base differs from what its collection holds, and rag status and drift read Qdrant instead of the local cache #1139 (KB re-index; drift and status read Qdrant), fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165 (no localhost fallback);
- test(ai): Wire rag once in ai/rag, test with edge fakes #1329 and refactor(ai): Valkey, Qdrant and the embedder each have one seam, with shared fakes and contract suites #1317 (RAG wiring and seams). The lane uses test(ai): Wire rag once in ai/rag, test with edge fakes #1329's wiring function if it has landed.
- fix(roadmap): the job clone tracks the current release's branch while origin has it and the default branch otherwise, so close, refine and metrics run between a ship and the next release's start #1366 (the roadmap clone's branch and the bare-remote helper; the clone is untouched here), fix(roadmap): the roadmap service logs each failed job's own error with its repository, and a configuration error without a traceback #1365 (job error logging), fix(roadmap): the metrics job walks release tags in each repository's own clone, and a missing or type-less labels.yml stops intake as a configuration error before any model call #1358, feat(roadmap): onboard checks a repository for the roadmap jobs #1359 (onboarding; the eight managed repositories);
- fix(k8s): deploy-stack applies the llm gateway policy and narrows its egress #795 (deploy-stack's manifest list), fix(ai): gateway reviews keep requests in flight at the backend slot count, however many ai.ollama_urls are configured #1354 (requests above a backend's slots, for reviews);
- feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 and refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151 (where RAG stays), feat(ai): embeddings through the llm gateway, with embedding model evaluation #481 (the embedding model), refactor(github): the github session owns transport, ledger, error classes and link pagination #983 (GitHub session), feat(k8s): qdrant metrics with an authenticated scrape, and its dashboard row restored #823 (Qdrant metrics), feat(rag): autonomous rag index drift detection and auto-reindexing scheduler #81 (the earlier auto-sync);
- feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392 (delivers
RagIngestBehindto chat), feat(roadmap): the roadmap service posts each release cut, ship and start to mattermost's releases channel #1394 (adds its own roadmap-service egress policy to the same file); - ADR 0002, ADR 0003.
Alternatives check of 2026-11-01: not-applicable.
Tool: none found.
Proposed design
Problem statement
Nothing ingests the managed repositories into the RAG index. A person must run devops ai rag index by hand. Two of the eight managed repositories are private, and an unscoped search returns their chunks. This item delivers devops ai rag ingest, which runs one pass over service.repos, records each point's visibility, and leaves private chunks out of searches that name no project. The pass runs from a workstation with the person's own git and GitHub credentials.
Acceptance criteria
Requirement: Default pass over service.repos
The command devops ai rag ingest SHALL run one ingestion pass over service.repos in configured order, one repository at a time.
Scenario: Two configured repositories
- WHEN
service.reposlists repository A then repository B and a person runsdevops ai rag ingestwith no--repo. - THEN The pass indexes A before it starts B and exits 0.
Requirement: Repository selection
The --repo / option SHALL run only the named repositories and MUST reject a value that is not in service.repos with a ConfigurationError before any request.
Scenario: Unknown repository
- WHEN A person runs
devops ai rag ingest --repo foo/barandfoo/baris not inservice.repos. - THEN The command raises
ConfigurationErrornamingfoo/barand makes no network request.
Requirement: Empty repository list
An empty service.repos SHALL fail with a ConfigurationError naming service.repos before any request or removed-repository cleanup.
Scenario: Empty service.repos
- WHEN
service.reposis empty and a person runsdevops ai rag ingest. - THEN The command raises
ConfigurationErrornamingservice.reposand deletes no point.
Requirement: Visibility read
The visibility read SHALL use the GitHub session when it exists and MUST use run_gh until then, never a bare gh call.
Scenario: Visibility request path
- WHEN The pass reads the visibility of a repository.
- THEN The test's fake GitHub runner receives the request and no bare
ghsubprocess runs.
Requirement: Removed repository cleanup
The pass SHALL delete the points and state of a repository that the pass recorded and that service.repos no longer lists, and MUST touch no other project.
Scenario: Removed repository beside a workstation project
- WHEN A pass recorded
owner/name,owner/nameis removed fromservice.repos, and a workstation project exists in the same collections. - THEN The next pass deletes the points and state of
owner/namethroughdelete_points_by_projectand keeps every point of the workstation project.
Requirement: Data paths
The checkout, cache and state.json SHALL sit under repos// in data.rag_dir and MUST be resolved with safe_resolve_subpath.
Scenario: Path containment
- WHEN The pass writes the checkout, cache and state for
owner/name. - THEN Each path is under
data.rag_dir/repos/owner/name, no file appears under the roadmap clone's/roadmap/, and a traversal path is refused.
Requirement: Atomic state write
The pass SHALL write state.json atomically with the index cache's write_json_file(..., atomic=True) and MUST record the head only after the indexer returns.
Scenario: Failed run
- WHEN The indexer raises an error after embedding part of a repository.
- THEN No
state.jsonrecords the new head and the next run embeds the files that were not stored.
Requirement: Qdrant URL required
The command SHALL fail with a ConfigurationError naming qdrant.url before any request or clone when qdrant.url is unset, and MUST NOT use the localhost default.
Scenario: Unset Qdrant URL
- WHEN Neither the configuration file nor the environment sets
qdrant.urland a person runsdevops ai rag ingest. - THEN The command raises
ConfigurationErrornamingqdrant.urland makes no clone or network request.
Requirement: Failed repository
A failed repository SHALL log one ERROR record naming the repository, the head and the error, with a traceback except for ConfigurationError, and the pass MUST continue with the next repository and exit 1 naming every failure.
Scenario: One repository fails
- WHEN The first of two configured repositories fails and the second is valid.
- THEN One ERROR names the first repository with a traceback, the second repository is indexed, and the command exits 1 naming the first repository.
Requirement: Run span and metric
Each repository's run SHALL be one trace_span and MUST count devops_cli_rag_ingest_runs_total{repo,result} in GLOBAL_METRICS.
Scenario: Metric labels
- WHEN A pass indexes one repository successfully and fails another.
- THEN Two spans exist and
devops_cli_rag_ingest_runs_totalhasrepoandresultlabels withsuccessanderror.
Requirement: Head check
The pass SHALL read the default branch and head with git ls-remote --symref HEAD and MUST skip embedding when the head equals the recorded commit and WorkspaceIndexer.points_intact finds the project's points.
Scenario: Second run at the same head
- WHEN A second pass runs at the head recorded in
state.jsonandpoints_intactreturns true. - THEN The pass makes the visibility read, the
ls-remoteand twocountrequests, and embeds nothing.
Requirement: Shallow checkout
The pass SHALL keep a shallow, single-branch checkout at repos///tree and MUST use git clone --depth 1 --single-branch --no-tags on the first run and git fetch --depth 1 origin then git checkout --detach FETCH_HEAD later.
Scenario: First and later checkout
- WHEN A repository has no checkout, and then its default branch moves.
- THEN The first run makes a depth-1 single-branch clone and the later run fetches depth 1 and checks out
FETCH_HEADdetached.
Requirement: Index with project and visibility
The pass SHALL call WorkspaceIndexer.index_workspace(, project="/", include_kb=False) with its cache under repos// and MUST write visibility on every point.
Scenario: Private repository index
- WHEN A private repository is indexed.
- THEN Every point carries
visibility: privateandCONST_RAG_PAYLOAD_INDEXESgains a keyword index onvisibility.
Requirement: Changed files and deletions
The pass SHALL embed only files whose content changed and MUST remove the points of deleted and renamed paths.
Scenario: Edit, delete and rename
- WHEN A push edits one file, deletes one file and renames one file.
- THEN Only the edited and renamed files are embedded, and no point remains for the deleted path or the old name.
Requirement: First index and lost points
The pass SHALL index a repository with no state in full and MUST re-index in full a project whose points_intact check fails.
Scenario: No state and emptied collection
- WHEN A repository has no
state.json, or its collection is emptied under a matchingstate.json. - THEN The next pass embeds every file again.
Requirement: Empty repository
The pass SHALL record a repository with no head as empty and MUST NOT treat it as an error.
Scenario: Empty remote
- WHEN A configured repository has no default-branch head.
- THEN The pass records it as empty and exits 0 for that repository.
Requirement: Unscoped search filter
A search without a project SHALL add a must_not condition on visibility = private, and a search with a project MUST search that project whatever its visibility.
Scenario: Private and public projects
- WHEN One private and one public project are indexed and a search runs without a project, then with
--projecton the private project. - THEN The unscoped search returns no private chunk, the scoped search returns the private chunk, and a workstation project without
visibilitystill appears unscoped.
Requirement: Visibility changes
The pass SHALL rewrite visibility on existing points when the read visibility differs from the recorded value and MUST count internal as private.
Scenario: Repository turns private at the same head
- WHEN A repository recorded public is now private at the same head.
- THEN The run rewrites
visibilityon its points and the next unscoped search leaves them out.
Requirement: Help and docs
The command help SHALL live in src/devops_cli/lang/en/help.py and devops docs generate --sync-readme MUST refresh the CLI reference.
Scenario: Generated reference
- WHEN A person runs
uv run devops docs generate --sync-readme. - THEN The generated reference includes
devops ai rag ingestwith its description and--repooption.
Requirement: Cheatsheet
docs/cheatsheets/ai_and_rag.md SHALL say what the pass indexes, that devops ai rag clear empties the pass's projects and the next pass refills them, and that a working tree should not be indexed under /.
Scenario: Cheatsheet text
- WHEN A person reads
docs/cheatsheets/ai_and_rag.md. - THEN The file states the pass indexes
service.repos, the clear-and-refill behavior, and the working-tree warning.
Requirement: Offline tests
The change SHALL add offline tests under 1 s each that use real git against file:// bare remotes and pass a fake Qdrant client, embedder and gh runner through arguments, without patching a devops_cli name.
Scenario: Test run
- WHEN A person runs
uv run devops ci. - THEN The tests pass and no test patches a
devops_cliname.
Requirement: CI gate
uv run devops ci SHALL pass.
Scenario: Clean checkout
- WHEN A person runs
uv run devops ciin a clean checkout. - THEN The command exits 0.
Existing Tool Considered
No open, maintained tool covers the whole need. The alternatives check of 2026-11-01 returned not-applicable and named no tool, and the closest maintained pieces are the git CLI and qdrant-client: git supplies ls-remote --symref and the shallow clone/fetch (git docs), and qdrant-client supplies set_payload, delete_points_by_project, count and create_payload_index (https://qdrant.tech/documentation/tutorials-operations/incremental-embedding-updates/). Qdrant documents incremental re-embedding as a pipeline a caller writes, not as a library, so the project keeps a thin src/devops_cli/ai/rag/ingest.py and the devops ai rag ingest command on top of its existing WorkspaceIndexer. The written cost is about 250 to 400 lines of code and tests, about 40k tokens to build, about 10k tokens to keep and fix, and 1 to 2 engineer-days.
Key questions
- Which delivery shape runs the ingestion pass?: A CLI command,
devops ai rag ingest, runs one pass from a workstation. Owner decision D11 splits the Argo cluster lane into a deferred item, and the project's own fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 follow-up list records the same split: the ingestion pass command is feat(rag): Index managed repos, exclude private from unscoped search #1389 and the Argo cluster workflow lane is its follow-up. (best practice) [sources: openspec/changes/archive/2026-10-26-1388-rag-project-isolation/tasks.md:43, openspec/changes/archive/2026-10-26-1388-rag-project-isolation/tasks.md:44]- Chosen: CLI command
devops ai rag ingest. Owner decision D11. It runs with the person's own credentials, and the cluster lane can reuse the command. - Rejected: Service lane in roadmap-service. Owner decision D11 moves this work to the deferred cluster-lane item.
- Rejected: Separate Deployment. Owner decision D11 moves this work to the deferred cluster-lane item.
- Chosen: CLI command
- What project name does a managed repository use?:
/, the form thatservice.reposuses. (best practice) [sources: src/devops_cli/config/settings.py:636, src/devops_cli/ai/rag/indexer.py:894]- Chosen:
/. It matchesservice.reposand keeps a workstation index separate. - Rejected: Directory name. It collides with a workstation index.
- Rejected: Repository name only. Two owners can share a repository name.
- Chosen:
- How does the pass find changed files?: It uses the existing
WorkspaceIndexercontent-hash cache. A shallow checkout keeps no diff history. (best practice) [sources: src/devops_cli/ai/rag/indexer.py:894, openspec/changes/archive/2026-10-26-1388-rag-project-isolation/tasks.md:20]- Chosen: Content hashes in the indexer cache. It is the indexer's own incremental path and needs no history.
- Rejected:
git difffrom the recorded commit. The shallow checkout does not keep that history. - Rejected: A second change-detection cache. It duplicates the indexer's cache.
- Should the pass check the remote head before indexing?: Yes. It runs
git ls-remote --symref HEAD. It skips embedding when the head equals the recorded state andWorkspaceIndexer.points_intactreturns true. (best practice) [sources: src/devops_cli/ai/rag/indexer.py:693, openspec/changes/archive/2026-10-26-1388-rag-project-isolation/tasks.md:22]- Chosen: Head check with
ls-remoteand points count. It avoids a re-index for a re-delivered push or a force-push back to an indexed commit. - Rejected: Re-index on every run. It wastes embeddings.
- Rejected: Trust the webhook only. A missed delivery or a force-push would leave the index stale.
- Chosen: Head check with
- How does the pass treat private repositories?: It includes them, writes
visibilityon each point, and adds amust_notfilter onvisibility = privatefor searches that name no project. The filter lives in_build_rag_filter_payload/SemanticRetriever, the one path every caller uses. (best practice) [sources: AGENTS.md:28, src/devops_cli/ai/rag/retriever.py:66-82, src/devops_cli/ai/rag/qdrant.py:115-123]- Chosen: Include private repositories and filter unscoped searches. The request covers every configured repository, and the filter sits in the one class that every search uses.
- Rejected: Skip private repositories. It drops two of the eight managed repositories.
- Rejected: Use a separate collection. Every caller would need to know about it.
- How often does the pass read repository visibility?: Every run. A repository made private without a push leaves unscoped searches after the next pass. The existing roadmap code already reads visibility on demand through the store, so the pass does the same. (best practice) [sources: src/devops_cli/roadmap/github_store.py:879-883, src/devops_cli/roadmap/refine.py:867-875, src/devops_cli/roadmap/run.py:652]
- Chosen: Every run. A visibility change needs no push.
- Rejected: Only when the head changes. A repository made private at the same head would stay public in the index.
- Rejected: Only when a webhook says so. A webhook delivery can be missed.
- Where do the checkout, cache and state live?: Under
repos//indata.rag_dir, resolved withsafe_resolve_subpath. Nothing is written under the roadmap clone. (best practice) [sources: src/devops_cli/config/settings.py:683, src/devops_cli/core/paths.py:34, src/devops_cli/roadmap/run.py:253-271]- Chosen:
repos//underdata.rag_dir. It keeps the pass away from the roadmap clone and its git locks. - Rejected: Under the roadmap clone. Two threads would run git in one repository.
- Rejected: A temporary directory. The cache and state must survive a run.
- Chosen:
- What does the pass do when
qdrant.urlis unset?: It fails with aConfigurationErrornamingqdrant.urlbefore any request or clone. It never falls back tohttp://localhost:6333. (best practice) [sources: src/devops_cli/config/defaults.py:188, src/devops_cli/config/settings.py:194]- Chosen: Fail before any request. It reports a configuration error at once and avoids a 300 s client wait.
- Rejected: Use the localhost default. fix(config): service clients use only configured urls and never fall back to an unconfigured localhost default #1165 owns the default, and a cluster pod must not reach localhost.
- Rejected: Skip the pass silently. It hides a configuration error.
- How does the pass handle a failed repository?: It logs one ERROR naming the repository, the head and the error, with a traceback except for
ConfigurationError. It continues with the next repository and exits 1 naming every failure. That is the project's existing job-error rule (fix(roadmap): the roadmap service logs each failed job's own error with its repository, and a configuration error without a traceback #1365): a configuration-only failure is logged without a traceback. (best practice) [sources: openspec/changes/archive/2026-10-25-1365-roadmap-service-job-errors/tasks.md, src/devops_cli/roadmap/run.py]- Chosen: Continue and exit 1. One broken repository must not leave the rest stale.
- Rejected: Stop the pass. It would leave the other repositories unindexed.
- Rejected: Exit 0 and log. The command must report failure.
- What does removed-repository cleanup touch?: At the start of every pass, including
--repopasses, it compares the pass's recorded state withservice.reposand deletes only projects the pass recorded.delete_points_by_projectis the project-scoped, waited delete that fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 added. (best practice) [sources: src/devops_cli/config/settings.py:636, src/devops_cli/ai/rag/qdrant.py:285, src/devops_cli/ai/rag/qdrant.py:860]- Chosen: Only pass-recorded projects. It never deletes a workstation-indexed project.
- Rejected: Every project in both collections. It would delete a workstation index.
- Rejected: No cleanup. A removed repository would stay searchable.
- How is
state.jsonwritten?: With the atomic write that fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 gives the index cache:write_json_file(..., atomic=True). A failed run records nothing. (best practice) [sources: openspec/changes/archive/2026-10-26-1388-rag-project-isolation/tasks.md:21, src/devops_cli/output/file_writer.py:112]- Chosen: Atomic write from fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388. A crash must not leave a partial state file.
- Rejected: Plain
write_text. It can leave a partial state file. - Rejected: No state file. The head check needs the recorded head.
- How does the visibility read reach GitHub?: Through the GitHub session when refactor(github): the github session owns transport, ledger, error classes and link pagination #983 lands, and through
run_ghuntil then. It never makes a bareghcall. The roadmap store already routes its visibility read throughrun_gh, which keeps the rate limiter. (best practice) [sources: src/devops_cli/github/rate_limiter.py:1862, src/devops_cli/roadmap/github_store.py:879-883, src/devops_cli/roadmap/request_plan.py:437]- Chosen: GitHub session, or
run_ghuntil then. It keeps the rate limiter and the session seam. - Rejected: Bare
ghsubprocess. It bypasses the session and the rate limiter. - Rejected: Direct HTTP with a new token. It duplicates the GitHub client.
- Chosen: GitHub session, or
- What is the disposition of the Argo cluster lane?: It is deferred to a new item. The project's fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388 follow-up list already records the Argo cluster workflow lane as a separate feat(rag): Index managed repos, exclude private from unscoped search #1389 follow-up, and it waits on feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535's Argo Workflows go/no-go, feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's router delivery, chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562's Service suspension and a cluster GitHub identity. (best practice) [sources: openspec/changes/archive/2026-10-26-1388-rag-project-isolation/tasks.md:44]
- Chosen: Defer the cluster lane. Owner decision D11 splits it out, and it cannot be built before those items land.
- Rejected: Build it in this pull request. It has blocks that only other items and an outside go/no-go can clear.
- Rejected: Drop it. The owner asked for the index to stay current.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
- StatusShow more project fieldsNew
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The owner explicitly requested it on 2026-10-08 and it fills a stated gap, but it is a new feature rather than a defect or security fix.Without repository ingestion the RAG system has no project-specific content, making it useless for the eight managed repositories.Requires NetworkPolicy changes, ConfigMap/Secret updates for Qdrant access, a new webhook consumer, poll-based ingestion logic, and git-clone plumbing across multiple k8s and application layers.dan-petty commentedon Oct 11, 2026
Blocked by #1562: the roadmap Service's machine account is suspended, and the Service is held at 0 replicas. This item develops the Service or can only be checked on it, so it waits until the account is reinstated or the jobs act as a GitHub App.
Generated by Claude Code
[-]feat(rag): the roadmap service keeps a rag index of every managed repository's default branch, updated on each default-branch push and each poll[/-][+]feat(rag): one ingestion pass indexes each managed repository's default branch, and unscoped searches leave private repositories out[/+]dan-petty commentedon Oct 26, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The item is important but not critical enough for P1 priority.This change improves the RAG functionality and search filtering for users.The effort is medium as parts of the work were moved to a cluster-lane item.a CLI command that indexes each managed repository's default branch and filters private repositories from unscoped searchesas the change that both ask for.The candidate and item #1653 both ask for a CLI ingestion pass that indexes each managed repository's default branch and filters private repositories.A person closes one of the two if that is so.dan-petty commentedon Oct 28, 2026
Refine cannot set this item to Ready at 0b76871 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
SemanticRetriever, the one class every search goes through.retriever.py:493).rag indexdefaults to the directory name (src/devops_cli/ai/rag/indexer.py:48-61), so the Service's projects never collide with a working tree's index./.service.jwt_rbac, tokens signed with the API key and scoped to collections) is the least-privilege follow-up. It needs a JWT library and a Qdrant values change, so it is outside this item.src/devops_cli/roadmap/intake_model.py:155-160) then wait in Ollama's queue behind at most one lane request. Ollama's FAQ onOLLAMA_MAX_QUEUE: "The maximum number of requests Ollama will queue when busy before rejecting additional requests. The default is 512".bge-m3:latestandqwen3.8:27bare separate models on the tier, each with its own single slot. They share the GPU without queueing behind each other.analyze,rag query, and the MCP and agentrag_searchtools.7 remaining items
devops-cli-service commentedon Nov 5, 2026
Status set to Ready at d254410 (see proposed design in issue body).
Moved to new items: #3589.
[-]feat(rag): one ingestion pass indexes each managed repository's default branch, and unscoped searches leave private repositories out[/-][+]feat(rag): Index managed repos, exclude private from unscoped search[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 121 characters, and the limit is 60. The type and the scope stay.
feat(rag): one ingestion pass indexes each managed repository's default branch, and unscoped searches leave private repositories outfeat(rag): Index managed repos, exclude private from unscoped searchfeat(rag): index managed repos and exclude private from search
chore(main): release 0.77.0 (#3888)
devops-cli-service commentedon Nov 7, 2026
Released in v0.77.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.77.0
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 05:06 UTC
feat(k8s): add an Argo workflow to keep the RAG index current (#4180)