Repository navigation
Description
Update 2026-11-26 (infra move): The cache bucket rule is in dan-petty/homelab now.
k8s/object-store/buckets.yaml there expires cache after 7 days. This item writes only product code. The k8s row of this repository cannot show that rule.
Problem or Motivation
When devops review runs in the runner shell (#3827), the session folder (review.md, findings.json, findings.sarif, files/) is on the pod disk. The pod stops, and the session is lost. Then devops review findings, the MCP findings tools and the PR evidence cannot read it.
Proposed Solution & Architectural Design
- The runner publishes the session folder through the
devops storeadapter (feat(cli): publish and read content-store files #4761) to bucketcache, prefixsessions/<owner>/<repo>/<session-id>/. - The lifecycle rule of
cacheremoves the objects after 7 days, the same age asdevops cleanupuses for local sessions. - When no local copy exists,
devops review findings <session-id>reads the session from the store. - A session can hold cited code of a private repository, so it never goes to a bucket that the files host serves.
Target Subsystem
AI & Agentic Review Pipeline (src/devops_cli/review/), with the store adapter.
Existing Tool Considered
The S3 API through the devops store adapter (boto3). No new tool. Cost (estimate): about 80 lines with tests, about 100k tokens and 1 hour.
Acceptance Criteria
- A runner review leaves a session in
cache. devops review findings <session-id>reads that session from another pod.- The object expires after 7 days.
- The files host cannot serve the session (a GET through
files.<domain>returns the 404 page).
Dependencies
- feat(roadmap): devops review runs in the runner shell #3827 (devops review runs in the runner shell).
- feat(cli): publish and read content-store files #4761 (the
devops storeadapter). - Tracker: feat(k8s): track the cluster content store #4742 (child 10).
Source: #4742
Alternatives check of 2026-11-24: in-use.
The repository already uses this tool.
Tool: boto3 (https://pypi.org/project/boto3), Apache-2.0, last activity 2026-11-23, maintained.
Reason: Searches and the package facts found boto3, the standard Python S3 client already held in uv.lock and pinned by the store adapter, which stores and reads session objects; the bucket guard, prefix layout, CLI/MCP wiring and expiration stay in this item.
Covers:
- Signed S3 object upload and download from Python
- Configurable endpoint, region and credentials for S3-compatible stores
- Built-in retries and streaming file transfer per object
Lacks:
- No session prefix layout or owner/repo key convention
- No CLI or MCP findings read path and no local-first precedence
- No refusal of a public files-host bucket
- No object expiration; the 7-day rule stays a cluster resource
Proposed design
Problem statement
A review that runs in the runner shell keeps its session (review.md, findings.json, findings.sarif, files/) on the pod disk. The pod stops and the session is lost. Then devops review findings, the MCP review_findings tool and the PR evidence cannot read it. This change publishes every file of a published session to the private cache bucket under sessions/<owner>/<repo>/<session-id>/ through the devops store adapter of #4761. It adds a local-first store fallback to the read path. The cache bucket's 7-day expiration comes from #4756, so this item writes no lifecycle configuration.
Acceptance criteria
Requirement: Runner session upload
The runner SHALL upload every file under a published review session folder, at its path relative to that folder, to the cache bucket under sessions/<owner>/<repo>/<session-id>/ through the devops store adapter, where owner and repo are the casefolded RepoRef.path_parts of the reviewed repository.
Scenario: Fake adapter records session files
- WHEN A runner review publishes a session with
review.md,findings.json,findings.sarifandfiles/example.py, and a fake store adapter records each upload. - THEN The fake adapter records each file at the session prefix with its relative path, and the local session folder stays readable.
Requirement: Store fallback for findings
devops review findings <session-id> SHALL read the session from the store under the prefix of the repository that the checkout origin names when no local session folder exists.
Scenario: Read findings from the store
- WHEN The local session folder is absent, the checkout origin names the reviewed repository, and a fake store holds
findings.jsonunder that repository's session prefix. - THEN The command prints the findings parsed from that file and creates no local session folder.
Requirement: MCP findings read of a stored session
The MCP review_findings tool SHALL return the findings of a stored session when no local session folder exists.
Scenario: MCP reads a stored session
- WHEN The local session folder is absent, a fake store holds the session, and
review_findings(session=<session-id>)runs. - THEN The tool returns the findings of the stored session and sends no store write.
Requirement: Private session storage
The session publisher MUST take the bucket from the store adapter's cache target and MUST refuse any other session bucket before it uploads any session file, because only the reports and reports-private buckets are served anonymously.
Scenario: Anonymously readable bucket refused
- WHEN The store adapter's session target names the anonymously readable
reportsbucket and the publisher runs with a fake store adapter. - THEN The publisher fails with the refusal error naming
reports, and the fake adapter records no upload.
Requirement: Local session precedence
devops review findings <session-id> SHALL read a local session folder before it reads the store.
Scenario: Local copy present
- WHEN A local session folder exists and the fake store also holds the session.
- THEN The command prints the local findings and the fake store records no read.
Requirement: Missing session report
devops review findings <session-id> SHALL print the no-session warning naming the local reviews directory and the store prefix, and exit 0, when neither place holds the session.
Scenario: Session absent
- WHEN No local session folder exists, the fake store holds no object for the session, and
devops review findings <session-id>runs. - THEN The command prints the warning naming the reviews directory and the session prefix and exits 0.
Requirement: Store read dry-run plan
devops review findings SHALL declare the request-plan dry-run class and, under --dry-run with no local session, print the store read it would make and send none.
Scenario: Dry run of the store read
- WHEN
devops review findings <session-id> --dry-runruns and no local session folder exists. - THEN The command prints the session prefix it would read, the fake store records no read, and
devops review findings --helplists--dry-run.
Requirement: Store upload failure
The runner SHALL exit nonzero when it cannot store the session after the adapter's retries.
Scenario: Store upload fails
- WHEN The fake store adapter fails every upload attempt for the session.
- THEN The runner exits nonzero and keeps the local session folder.
Requirement: Verdict writes stay local
devops review verify MUST read and write only a local session folder and MUST NOT load a session from the store.
Scenario: Verify with only a stored session
- WHEN No local session folder exists, the fake store holds the session, and
devops review verify --session <session-id> --index 1 --status VERIFIEDruns. - THEN The command exits 1 with the session-not-found message and the fake store records no read and no write.
Requirement: No lifecycle write
Session publication MUST NOT write a bucket lifecycle configuration.
Scenario: No lifecycle write
- WHEN The session publisher runs with a fake store adapter that records lifecycle calls.
- THEN The fake adapter records no lifecycle call.
Requirement: Cache bucket expiration
The cache bucket SHALL expire every object under sessions/ after 7 days.
Scenario: Cache lifecycle expires sessions
- WHEN A person reads
k8s/object-store/buckets.yamlof dan-petty/homelab. - THEN
BucketLifecyclePolicycacheexpires objects after 7 days. This repository has no check for it.
Existing Tool Considered
boto3 (https://pypi.org/project/boto3), Apache-2.0, maintained, last activity 2026-11-23. The alternatives block of 2026-11-24 records the verdict in-use: the repository already uses this tool. The block's Lacks: list is the source for what the tool lacks, and this item supplies what that list names: the session prefix layout, the CLI and MCP read path with local-first precedence, the refusal of a public files-host bucket, and the 7-day expiration from the cache bucket lifecycle. uv.lock:343 holds boto3 today only as an indirect dependency of litellm (uv.lock:2310), and #4761 pins it as a direct dependency, so this item adds no dependency and writes no S3 client. Cost of the project wiring (estimate): about 80 lines with tests, about 100k tokens and 1 hour.
Key questions
- Where does the runner publish a review session so that another pod can read it?: The runner uploads the session folder through the
devops storeadapter to the privatecachebucket undersessions/<owner>/<repo>/<session-id>/afterReviewSession.publish()returns the published directory. The upload keeps the local folder.cacheis private: onlyreportsandreports-privatesetanonymousRead. (best practice) [sources: src/devops_cli/review/session.py:151, src/devops_cli/ai/review/runner.py:1104, k8s/object-store/buckets.yaml:42, k8s/object-store/buckets.yaml:11]- Chosen: Store adapter to the
cachebucket. It uses the existing adapter and a durable object store, so another pod can read the session. - Rejected: Pod volume. The pod disk stops with the pod and loses the session.
- Rejected: Database table. It adds a new store and a schema for file-shaped session data.
- Chosen: Store adapter to the
- How does
devops review findings <session-id>find a session?: It reads the local session folder first through_find_session_dir. Only when that returns nothing does the read command fetch the requested file (findings.jsonorcandidates.json) from the store prefix. The fallback stays in the read command, not in_find_session_dir, sodevops review verifykeeps its local-only resolver. The MCPreview_findingstool runs the same CLI command and uses the same read path. (best practice) [sources: src/devops_cli/commands/review.py:1120, src/devops_cli/ai/review/runner.py:107, src/devops_cli/commands/review.py:1163, tests/ai/mcp/test_mcp_run_command.py:62]- Chosen: Local first, then store, in the read command only. It keeps the offline path and verdict writes on disk, and adds the store only as a read fallback.
- Rejected: Store first. It adds a network read to every local lookup.
- Rejected: Fallback inside
_find_session_dir.verifyand the other writers would find a session that is not on disk and fail when they write the verdict.
- How does the read path know the repository of a stored session, so that it can build the session prefix?: From the origin of the current checkout:
get_repo_origin_namegives the name andRepoRef.path_partsgives the casefolded owner and name.review findingshas no--repo, and the architecture gives a command with no--repothe root of the working directory. When no origin resolves, the command prints the no-session warning that names both places. (best practice) [sources: ARCHITECTURE.md:208, src/devops_cli/ai/review/runner.py:972, src/devops_cli/github/repo_ref.py:150]- Chosen: Resolve the prefix from the checkout origin. It needs no new option and gives the same
RepoRefthat the runner used, because the pod that reads the session has the checkout. - Rejected: Add a
--repooption toreview findings. It adds an option to the read command and its MCP twin for no requirement of the issue. - Rejected: List every repository prefix in
cache. It needs List on the bucket and a scan of every session for one lookup.
- Chosen: Resolve the prefix from the checkout origin. It needs no new option and gives the same
- Which repository name does the store prefix hold?: The casefolded owner and name from
RepoRef.path_parts, built from the origin of the checkout or the--repoargument.RepoRefis the one value type for a repository name, so the code parses noowner/nameitself. (best practice) [sources: src/devops_cli/github/repo_ref.py:150, ARCHITECTURE.md:227, docs/adr/0022-one-repository-reference-names-the-objects-labels-and-keys-of-each-repository.md]- Chosen:
RepoRef.path_parts. One value type gives the casefolded owner and name, matches the clone path, and avoids a second parser. - Rejected: Parse the remote in the session code. It repeats parsing and can give two prefixes for one repository.
- Rejected: Use the GitHub spelling. Two spellings of one repository can make two prefixes.
- Chosen:
- Where is the 7-day rule for a stored session declared?: In the
BucketLifecyclePolicyofcacheink8s/object-store/buckets.yamlof dan-petty/homelab, whoseexpirerule sets 7 days with no prefix, so every object undersessions/expires with the bucket. The change of feat(k8s): apply store buckets, keys and rules from git #4756 that adds it is archived and the manifest is in the tree. This item writes no lifecycle configuration, because a second rule would duplicate that resource. (best practice) [sources: k8s/object-store/buckets.yaml:116, openspec/changes/archive/2026-11-22-4756-store-buckets-from-git/design.md:16, src/devops_cli/core/cleanup.py:263]- Chosen: Use the feat(k8s): apply store buckets, keys and rules from git #4756 lifecycle resource. The resource declares the 7-day rule on
cache, and this item does not fight the resource. - Rejected: Write a lifecycle configuration in this item. It duplicates the feat(k8s): apply store buckets, keys and rules from git #4756 rule and can fight the
BucketLifecyclePolicyresource.
- Chosen: Use the feat(k8s): apply store buckets, keys and rules from git #4756 lifecycle resource. The resource declares the 7-day rule on
- How does the publisher keep a session off a bucket that the files host serves?: The publisher takes the bucket from the store adapter's
cachetarget, not from its caller, and refuses any other bucket before the first upload. Onlyreportsandreports-privatesetanonymousRead;cachesets none, so a session there is not served anonymously. The refusal names the bucket and records no upload. (best practice) [sources: k8s/object-store/buckets.yaml:11, k8s/object-store/buckets.yaml:42, openspec/specs/object-store/spec.md:290]- Chosen: One bucket from the adapter's
cachetarget, plus a refusal of any other bucket. The caller cannot choose a bucket, and one check before upload gives a clear test for an anonymously readable bucket. - Rejected: Prefix check only. An anonymously readable bucket can still serve the prefix.
- Rejected: No check. A configuration error can expose cited private code.
- Chosen: One bucket from the adapter's
- Which files of the session folder are uploaded?: Every file under the session folder, at its relative path:
review.md,findings.json,findings.sarif,candidates.json,analysis.jsonandfiles/. The MCP tools and the PR evidence read the whole session, cited code included. (best practice) [sources: src/devops_cli/review/session.py:96, src/devops_cli/review/session.py:140, src/devops_cli/ai/review/exporter.py:45]- Chosen: All files at their relative paths. The MCP tools and the PR evidence need the full session, including the cited files.
- Rejected: Only the findings files. It drops
review.mdandfiles/, so the evidence and MCP reads fail. - Rejected: One archive. It forces a full download to read one file.
- Should a store upload failure fail the review?: Yes. The runner retries the adapter uploads and then exits nonzero if the session is still not stored. It keeps the local folder, so a runner review fails closed rather than report success without its stored session. The review already fails this way when it cannot publish the session (
ReviewSessionExistsErrorexits 1), and the runner review's fail-closed rule and AGENTS.md rule 2 forbid swallowing the error. (best practice) [sources: AGENTS.md:8, docs/ERRORS.md:118, src/devops_cli/review/session.py:151, src/devops_cli/ai/review/runner.py:1104, openspec/changes/archive/2026-11-21-3827-devops-review-runs-in-the-runner/design.md:9]- Chosen: Fail closed after retries. A review that cannot store its evidence must not report success, and the review already exits nonzero when it cannot publish its session.
- Rejected: Warn and continue. It swallows the error, and the pod stop still loses the session.
- What does
devops review findingsdo when neither the local folder nor the store holds the session?: It prints the no-session warning, now naming both the local reviews directory and the store prefix, and exits 0. This keeps the recorded behavior ofreview findingsand adds the store location to the warning. (best practice) [sources: src/devops_cli/commands/review.py:1121, src/devops_cli/lang/en/messages.py:84]- Chosen: Warning naming both places, exit 0. It keeps the recorded behavior of
review findingsand only adds the store location to the warning. - Rejected: Exit nonzero. It changes the command's recorded exit code for no requirement of the issue.
- Rejected: Warning naming the local directory only. It hides the second place the session could be.
- Chosen: Warning naming both places, exit 0. It keeps the recorded behavior of
- How does
devops review findingsbehave under--dry-runonce it can read the store?: It declares therequest-plandry-run class and exposes--dry-run. With no local session, a dry run prints the store prefix it would read and sends no read. A local session still prints its findings, because a local read sends no external request. The command isno-external-requesttoday, so the class changes with the new read. (best practice) [sources: ARCHITECTURE.md:170, src/devops_cli/commands/review.py:1079]- Chosen:
request-planwith a--dry-runoption. The command now makes an external read, and a dry run must print the requests it would send. - Rejected: Keep
no-external-request. A dry run would then read the store, which the class forbids. - Rejected: Keep the store read out of a dry run by reading local only. A dry run would hide the request that a real run makes when no local session exists.
- Chosen:
- Does
devops review verifyread the store once the findings command can?: No.verifyresolves its session through_require_session_dir, which calls the local-only_find_session_dir. A verdict therefore needs a local session folder, and the status is given with the required--status VERIFIEDoption. (best practice) [sources: src/devops_cli/commands/review.py:1163, src/devops_cli/ai/review/runner.py:107]- Chosen: Keep
verifylocal-only. A verdict writes into the session folder, so a session read from the store could not take the write. - Rejected: Download the session, then write the verdict. It adds a store write path and a local copy for a command that needs no network read.
- Chosen: Keep
- How does the MCP
review_findingstool read a stored session?: It uses the same local-first read path asdevops review findings: local session first, then the store prefix. It returns findings and sends no store write. The MCP tool runs the CLI command, so the change needs no second store client. (best practice) [sources: docs/MCP_TOOLS.md:1816, src/devops_cli/commands/review.py:1120, tests/ai/mcp/test_mcp_run_command.py:62]- Chosen: Shared local-first read path. One read path keeps the command and the MCP tool consistent.
- Rejected: Separate MCP store client. It duplicates the store read and its tests.
- Does this item still wait on feat(roadmap): devops review runs in the runner shell #3827 and feat(k8s): apply store buckets, keys and rules from git #4756?: No. The change of feat(roadmap): devops review runs in the runner shell #3827 is archived and the review runner keeps its session at
runner.py:1104; the change of feat(k8s): apply store buckets, keys and rules from git #4756 is archived and itscachelifecycle policy is in the tree. Only feat(cli): publish and read content-store files #4761, thedevops storeadapter, is still needed first. [sources: openspec/changes/archive/2026-11-21-3827-devops-review-runs-in-the-runner/design.md:9, src/devops_cli/ai/review/runner.py:1104, openspec/changes/archive/2026-11-22-4756-store-buckets-from-git/design.md:16, k8s/object-store/buckets.yaml:104]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(review)scope of the title gives the scope.It unblocks the runner review workflow but is not a security fix or a blocking defect.Without it, runner review sessions are lost when the pod stops, so findings and PR evidence are unreadable.The body estimates about 80 lines with tests and one hour of work.Both deal with the review session store, but #771 defines the local directory layout and #4742-child-10 adds remote S3 persistence for runner pods.devops-cli-service commentedon Nov 14, 2026
Alternatives check: covers
Reason: The searches found that the S3 API through boto3 already covers the need: it writes and reads the session-folder objects in a bucket and configures a lifecycle rule that expires them after a set number of days. The issue itself names this tool ("The S3 API through the
devops storeadapter (boto3). No new tool."), so it is already in use and no new library is required.Tool: boto3 (https://pypi.org/project/boto3)
Covers:
Lacks:
devops storeadapter, the cache bucket/prefix layout, and the refusal to serve the session from the files hostdevops review findings <session-id>store-read path and its testsTools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Owner question: The alternatives check found that
https://pypi.org/project/boto3covers this item. Adopt the tool, or keep the item and give the reason. (a person decides)Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 20, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 21, 2026
Answer to the open question: adopt boto3 through the
devops storeadapter of #4761. This item writes no S3 client of its own.uv.lockholds boto3 only as an indirect dependency. feat(cli): publish and read content-store files #4761 pins it as a direct dependency. So this item adds no new dependency.Correction to the Proposed design: remove the session lifecycle applier and its two requirements. #4756 declares the 7-day rule of the bucket
cacheas aBucketLifecyclePolicyresource in git. Code that writes a lifecycle configuration would fight that resource. This item writes no lifecycle configuration.devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 24, 2026
The result in the alternatives block of the issue body changed. Before this check:
covers, tool https://pypi.org/project/boto3. A person decides what the new result means for the item.Searches (7)
Tools considered:
Searches run:
Sources:
9 remaining items
chore(main): release 0.236.0 (#7602)
devops-cli-service commentedon Nov 28, 2026
Released in v0.236.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.236.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 17:56 UTC