Add S3-compatible artifact storage with MinIO proof#151
Conversation
…-s3-compatible-minio-aws # Conflicts: # scripts/test_agent_gates.py
…-s3-compatible-minio-aws
…-s3-compatible-minio-aws # Conflicts: # .agent-loop/LOOP_STATE.md # .agent-loop/WORK_QUEUE.md
📝 WalkthroughWalkthroughWS-ART-001-02B1 adds an S3-compatible artifact adapter with MinIO integration, strict configuration and namespace validation, isolated AWS credential handling, runtime eligibility guards, expanded proof tests, CI coverage enforcement, documentation, and updated workstream state. ChangesS3-compatible artifact storage
Estimated code review effort: 5 (Critical) | ~90+ minutes Sequence Diagram(s)sequenceDiagram
participant Application
participant ArtifactStoreFactory
participant S3CompatibleArtifactStore
participant MinIO
Application->>ArtifactStoreFactory: create artifact store bootstrap
ArtifactStoreFactory->>S3CompatibleArtifactStore: validate and initialize after namespace claim
S3CompatibleArtifactStore->>MinIO: put, head, open, or verify immutable object
MinIO-->>S3CompatibleArtifactStore: object response or provider error
S3CompatibleArtifactStore-->>Application: artifact result or domain error
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…-s3-compatible-minio-aws
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/app/adapters/artifacts/s3_compatible.py`:
- Around line 826-836: Update the pending-buffer fill loop around `_iterator`
and `_pending` to retain a memoryview cursor for each source chunk and extend
`_pending` only with the portion needed to satisfy the requested amount, rather
than copying the entire chunk first. Preserve the bytes-type validation and
ensure any unconsumed chunk data remains available for subsequent reads while
keeping `_pending` within the configured buffer threshold.
- Around line 1115-1127: Update the workload-identity credential resolution flow
around session.get_credentials() to materialize deferred credentials by awaiting
credentials.get_frozen_credentials() before returning. If materialization fails,
raise the same AWS workload identity configuration error used for resolution
failures, while preserving the existing method validation and successful return
behavior.
In `@backend/app/core/s3_validation.py`:
- Around line 90-96: Canonicalize IPv6 hostnames before constructing the
normalized endpoint in the scheme/hostname formatting flow. Parse IPv6 literals
with the standard IP address utility and use its compressed canonical
representation, then apply bracket and port formatting; leave domain and IPv4
handling unchanged so equivalent IPv6 spellings produce the same namespace
identity.
In `@backend/tests/assertion_helpers.py`:
- Around line 23-26: Update the assertion helper’s value-scanning logic to
handle byte buffers by checking the secret against bytes values, and recursively
inspect public object state stored in __dict__. Ensure nested values are scanned
before declaring the secret absent, while preserving the existing str and
SecretStr handling.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1c891da0-3df5-4f6c-9a0b-e73e917eb5f1
📒 Files selected for processing (47)
.agent-loop/LOOP_STATE.md.agent-loop/WORK_QUEUE.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/CHUNK_MAP.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/PLAN.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/STATUS.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-02B1-s3-compatible-minio-aws.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-02C1-admission-put-attempt-foundation.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-02C2-verification-publication-fencing.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-02C3-recovery-attempt-idempotency.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-02D-operator-artifact-operations.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-03-guide-source-cutover.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-04A-upload-inspection-sealing.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-04B-pre-submit-admission.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-05-submission-artifact-cutover.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-06A-checker-input-materialization.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-06B-checker-output-routing.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-07-recovery-live-proof.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-internal-review-evidence.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-pr-trust-bundle.md.agent-loop/merge-intents/WS-ART-001-02B1.json.github/workflows/backend.ymlREADME.mdbackend/app/adapters/artifacts/__init__.pybackend/app/adapters/artifacts/local.pybackend/app/adapters/artifacts/references.pybackend/app/adapters/artifacts/s3_compatible.pybackend/app/core/config.pybackend/app/core/s3_validation.pybackend/app/interfaces/artifacts.pybackend/app/workers/artifacts.pybackend/app/workers/celery_app.pybackend/pyproject.tomlbackend/tests/assertion_helpers.pybackend/tests/test_artifact_architecture.pybackend/tests/test_artifact_cleanup_wiring.pybackend/tests/test_artifact_store_conformance.pybackend/tests/test_assertion_helpers.pybackend/tests/test_audit.pybackend/tests/test_aws_credential_isolation.pybackend/tests/test_config.pybackend/tests/test_local_artifact_store.pybackend/tests/test_s3_artifact_store.pydocker-compose.ymldocs/architecture_lockdown.mddocs/decision_0013_immutable_artifact_storage_boundary.mddocs/spec_artifact_storage_service.mdscripts/test_agent_gates.py
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
@.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-internal-review-evidence.md:
- Line 131: Update the test-count sentence in the review evidence to hyphenate
the compound modifier, changing “443 real-service focused tests” to “443
real-service-focused tests.”
- Line 56: Update the credential-materialization wording in the review evidence
text from “Required selected AWS workload credentials” to “Required the selected
AWS workload credentials,” preserving the rest of the statement unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 85332753-4e8d-4671-a9f8-af09fae9be14
📒 Files selected for processing (11)
.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/STATUS.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-external-review-response.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-internal-review-evidence.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-pr-trust-bundle.mdbackend/app/adapters/artifacts/s3_compatible.pybackend/app/core/s3_validation.pybackend/tests/assertion_helpers.pybackend/tests/test_assertion_helpers.pybackend/tests/test_aws_credential_isolation.pybackend/tests/test_config.pybackend/tests/test_s3_artifact_store.py
🚧 Files skipped from review as they are similar to previous changes (6)
- backend/tests/assertion_helpers.py
- .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-pr-trust-bundle.md
- backend/app/core/s3_validation.py
- .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/STATUS.md
- backend/app/adapters/artifacts/s3_compatible.py
- backend/tests/test_aws_credential_isolation.py
Workstream PR Trust Bundle
Chunk
WS-ART-001-02B1-S3-Compatible MinIO And AWSMerge intent:
.agent-loop/merge-intents/WS-ART-001-02B1.jsonGoal
Add one provider-neutral S3 protocol implementation, prove it against real
MinIO for local/CI, and validate isolated native AWS configuration without
making AWS runtime-eligible before the separately owned live-proof chunk.
Human-Approved Intent
.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/PLAN.md.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-02B1-s3-compatible-minio-aws.mdWhat Changed
S3CompatibleArtifactStorebehind the existing ArtifactStore v2 and typed external-service factory boundaries.artifact_provider_live_proof_requiredguard.Why It Changed
Workstream needs provider-neutral immutable artifact storage before submission
admission, verification, publication, and recovery can safely bind product
records to exact bytes.
Design Chosen
One S3-protocol adapter serves MinIO proof and the inactive AWS profile. MinIO
is non-production proof; AWS is configuration-ready but unavailable until
Chunk 07 supplies release-bound live proof.
Alternatives Rejected
Scope Control
Allowed Files Changed
Files Outside Contract
Product Behavior
Evidence
Commands Run
Result Summary
Acceptance Criteria Proof
02C1remains inactive.Test Delta
Tests Added
Tests Modified
Tests Removed Or Skipped
Internal Reviewer Results
Reviewed code SHA:
9cd5620ef5f72e7ba9abc75e9ac7b398996f0c8aReviewed at:
2026-07-18T23:40:43ZReviewer run IDs are recorded in the committed internal-review evidence.
External Review
External review response file:
.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/reviews/WS-ART-001-02B1-external-review-response.mdCI And Gate Integrity
Remaining Risks
Follow-Up Work
WS-ART-001-02C1is the same-initiative successor but requires a separateexplicit user start after this PR merges.
Human Review Focus
Human Merge Ownership
Summary by CodeRabbit
New Features
Bug Fixes
Documentation