Skip to content

fix(storage): reject unknown artifact-store modes on current main - #413

Open
seonghobae wants to merge 4 commits into
mainfrom
fix/artifact-store-mode-main-20260812-r2
Open

fix(storage): reject unknown artifact-store modes on current main#413
seonghobae wants to merge 4 commits into
mainfrom
fix/artifact-store-mode-main-20260812-r2

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Objective

Fail closed on unsupported or corrupted artifact-store modes while preserving the secure filesystem default.

Exact current-head evidence

  • protected base: 961f44a19c4ced87f8062b3ab9842a9a08d05235;
  • test-only RED head: 1709b150faef6009f449ccc2f1c3f6ba2b96e391;
  • exact GREEN head: e9b97b9212d5dbfafb8af47a17c6ef26f4002800;
  • CI, Security Scan, SAST Semgrep, and fuzz: terminal-success;
  • mergeable: true;
  • unresolved review threads: zero.

Contract

Explicit filesystem values normalize deterministically; unknown modes such as URI-like secret-bearing text and NUL-corrupted known-mode input are rejected with a controlled failure; a rejected setter call cannot replace the secure default.

Scope boundary

Configuration integrity only. Artifact bytes, atomic writes, signed links, tenant authority, deletion lifecycle, and credential adapters are unchanged.

Merge gate

Keep this exact head unchanged. Auto-merge may act only after live checks remain successful, zero valid unresolved findings remain, and a qualifying independent non-author approval is attached to this exact head. Automated evidence and predecessor reviews do not transfer.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 958284dc-cd66-49b0-b887-9043bd53c93b


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae
seonghobae marked this pull request as ready for review August 12, 2026 06:24
@seonghobae
seonghobae enabled auto-merge (squash) August 12, 2026 07:09

Copy link
Copy Markdown
Collaborator Author

@opencode-agent review

Please review the unchanged exact current head 188d972438c10562206785e6b080c05682212364 against live protected main and repository gates. Treat checks/model output as evidence only and submit a formal review only for this exact head.

Copy link
Copy Markdown
Collaborator Author

Exact-current-head read-only review request for e9b97b9212d5dbfafb8af47a17c6ef26f4002800 on protected main 961f44a19c4ced87f8062b3ab9842a9a08d05235. CI, Security Scan, SAST Semgrep, and fuzz are terminal-success; the two-file configuration-integrity delta is mergeable with zero unresolved threads. Verify deterministic filesystem normalization, controlled unknown/NUL-corrupted mode rejection, and preservation of the secure default after failed mutation. Do not mutate the branch or bypass independent approval.

@opencode-agent review
@cwl-noema-review review
@strix review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="961f44a19c4ced87f8062b3ab9842a9a08d05235"
head="e9b97b9212d5dbfafb8af47a17c6ef26f4002800"
repo="ContextualWisdomLab/clearfolio"
pr="413"

echo "== checked-out commit =="
git rev-parse HEAD
echo "== requested commits present =="
git cat-file -t "$base"
git cat-file -t "$head"

echo "== exact two-dot diff summary =="
git diff --stat "$base" "$head"
echo "== changed paths =="
git diff --name-status "$base" "$head"
echo "== exact diff =="
git diff --no-ext-diff --unified=80 "$base" "$head"

echo "== AST outline for changed source/test files =="
git diff --name-only "$base" "$head" | while IFS= read -r file; do
  echo "--- $file ---"
  ast-grep outline "$file" --items all --view expanded 2>&1 || true
done

echo "== artifact-store related definitions and tests =="
rg -n -i -C 4 \
  '(artifact[-_ ]?store|filesystem|set[A-Za-z0-9_]*mode|store[A-Za-z0-9_]*mode|NUL|\\0)' \
  -g '!node_modules/**' -g '!dist/**' -g '!build/**' .

echo "== GitHub PR live metadata =="
gh pr view "$pr" --repo "$repo" --json number,state,isDraft,mergeable,baseRefOid,headRefOid,reviewDecision,statusCheckRollup,reviews

echo "== GitHub PR review threads =="
gh api "repos/$repo/pulls/$pr/comments?per_page=100" \
  --jq '.[] | {id, user: .user.login, path, line, side, body, created_at}' || true

Length of output: 201847


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="961f44a19c4ced87f8062b3ab9842a9a08d05235"
head="e9b97b9212d5dbfafb8af47a17c6ef26f4002800"
repo="ContextualWisdomLab/clearfolio"
pr="413"

echo "== repository identity and ancestry =="
printf 'checked_out='; git rev-parse HEAD
printf 'merge_base='; git merge-base "$base" "$head"
git merge-base --is-ancestor "$base" "$head" && echo "base_is_ancestor=true"

echo "== changed paths =="
git diff --name-status "$base" "$head"

echo "== exact diff =="
git diff --no-ext-diff --unified=40 "$base" "$head"

echo "== changed-file content at requested head =="
git diff --name-only "$base" "$head" | while IFS= read -r file; do
  echo "--- $file ---"
  git show "$head:$file" | cat -n
done

echo "== configuration declarations and artifact store wiring =="
rg -n -C 12 \
  '(class .*Properties|artifact.*store|ArtifactStore|set[A-Za-z]*Mode|get[A-Za-z]*Mode|filesystem|artifact-store)' \
  src/main/java src/test/java \
  -g '*.java'

echo "== GitHub comparison and branch protection =="
gh api "repos/$repo/compare/$base...$head" \
  --jq '{status, merge_base_commit: .merge_base_commit.sha, ahead_by, behind_by, total_commits, files: [.files[] | {filename, status, additions, deletions}]}'
gh api "repos/$repo/branches/main/protection" \
  --jq '{required_status_checks, required_pull_request_reviews}' || true

echo "== GitHub review comments and reviews =="
gh api "repos/$repo/pulls/$pr/reviews?per_page=100" \
  --jq '.[] | {user: .user.login, state, commit_id, submitted_at, body}' || true
gh api "repos/$repo/pulls/$pr/comments?per_page=100" \
  --jq '.[] | {user: .user.login, path, line, side, body, commit_id}' || true

Length of output: 202192


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="961f44a19c4ced87f8062b3ab9842a9a08d05235"
head="e9b97b9212d5dbfafb8af47a17c6ef26f4002800"
source_file="src/main/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java"
test_file="src/test/java/com/clearfolio/viewer/config/ArtifactStorePropertiesTest.java"

echo "== exact targeted diff =="
git diff --no-ext-diff --unified=100 "$base" "$head" -- "$source_file" "$test_file"

echo "== ArtifactStoreProperties at requested head =="
git show "$head:$source_file" | cat -n

echo "== ArtifactStorePropertiesTest at requested head =="
git show "$head:$test_file" | cat -n

echo "== all mode accessor call sites =="
rg -n -C 5 '\b(getMode|setMode)\s*\(' \
  src/main/java src/test/java -g '*.java'

echo "== explicit test method names at requested head =="
git show "$head:$test_file" | \
  rg -n '^\s*(void|public void|private void)\s+[A-Za-z0-9_]+\s*\('

Length of output: 29069


@seonghobae Reviewed exact head e9b97b9212d5dbfafb8af47a17c6ef26f4002800 against base 961f44a19c4ced87f8062b3ab9842a9a08d05235.

No findings.

  • setMode() normalizes explicit filesystem values deterministically.
  • Unsupported non-blank modes fail with IllegalArgumentException before mode mutation.
  • NUL-corrupted values fail before mode mutation.
  • Rejected mutations preserve the secure filesystem default.
  • The tests cover explicit normalization, URI-like unknown input, NUL-corrupted input, and default preservation.
  • The live PR head and base match the requested commits.
  • The PR is mergeable. The observed CI, Maven, CodeQL, Semgrep, security scans, and fuzz checks are successful.

GitHub reports REVIEW_REQUIRED with no submitted reviews. A qualifying independent non-author approval is still required. I did not approve or modify the branch. The branch-protection configuration could not be read because GitHub returned HTTP 403.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

@opencode-agent review
@coderabbitai review
@cwl-noema-review review
@strix review

Review exact head e9b97b9212d5dbfafb8af47a17c6ef26f4002800 only. Exact-head CI, Security Scan, SAST Semgrep, and fuzz are terminal-success; unresolved inline findings are zero. Validate deterministic filesystem normalization, controlled rejection of unknown/URI-like and NUL-corrupted modes, and preservation of the secure default after a rejected setter call.

Review read-only; preserve independent reviewer identity. Do not mutate the branch, synthesize author approval, weaken protection, or merge.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/clearfolio"
pr="413"
base="961f44a19c4ced87f8062b3ab9842a9a08d05235"
head="e9b97b9212d5dbfafb8af47a17c6ef26f4002800"

echo "== Commit identity and ancestry =="
printf 'checked_out='; git rev-parse HEAD
printf 'base_type='; git cat-file -t "$base"
printf 'head_type='; git cat-file -t "$head"
printf 'merge_base='; git merge-base "$base" "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=true'

echo "== Exact changed paths =="
git diff --name-status "$base" "$head"

echo "== Exact diff =="
git diff --no-ext-diff --unified=80 "$base" "$head"

echo "== Changed-file outlines =="
git diff --name-only "$base" "$head" | while IFS= read -r file; do
  echo "--- $file ---"
  ast-grep outline "$file" --items all --view expanded 2>&1 || true
done

echo "== Artifact-store mode declarations, use sites, and tests =="
rg -n -C 8 --glob '*.java' \
  '\b(class\s+ArtifactStoreProperties|setMode\s*\(|getMode\s*\(|artifact[-_ ]?store|filesystem|IllegalArgumentException|\\0|NUL)\b' \
  src/main/java src/test/java

echo "== Requested-head content for changed Java files =="
git diff --name-only "$base" "$head" -- '*.java' | while IFS= read -r file; do
  echo "--- $file @ $head ---"
  git show "$head:$file" | cat -n
done

echo "== Live pull request state =="
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,mergeable,baseRefOid,headRefOid,reviewDecision,statusCheckRollup,reviews

echo "== Live review comments =="
gh api "repos/$repo/pulls/$pr/comments?per_page=100" \
  --jq '.[] | {user: .user.login, path, line, side, commit_id, created_at, body}' || true

echo "== Live review-thread resolution summary =="
gh api graphql -F owner="ContextualWisdomLab" -F name="clearfolio" -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes { isResolved isOutdated comments(first: 1) { nodes { author { login } body path } } }
      }
    }
  }
}' --jq '
  .data.repository.pullRequest.reviewThreads.nodes
  | {
      total: length,
      unresolved: map(select(.isResolved == false)) | length,
      unresolved_current: map(select(.isResolved == false and .isOutdated == false)) | length
    }' || true

Length of output: 206732


@seonghobae Reviewed exact head e9b97b9212d5dbfafb8af47a17c6ef26f4002800 against protected main 961f44a19c4ced87f8062b3ab9842a9a08d05235.

No findings.

  • The checked-out commit and live PR head match the requested head.
  • The exact diff changes only ArtifactStoreProperties and its tests.
  • setMode(" FILESYSTEM ") normalizes to filesystem.
  • Unsupported non-blank values, including URI-like text, throw IllegalArgumentException before mode changes.
  • NUL-corrupted input throws IllegalArgumentException before mode changes.
  • Rejected setter calls preserve the default filesystem mode.
  • The tests cover each requested behavior.
  • The PR is mergeable.
  • CI, CodeQL, Semgrep, Security Scan, Strix, and fuzz checks are successful.
  • GitHub reports zero review threads.

GitHub still reports REVIEW_REQUIRED and no submitted reviews. A qualifying independent non-author approval is still required. I did not modify the branch, approve the PR, change protection, or merge.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Collaborator Author

Exact-current-head independent review request for e9b97b9212d5dbfafb8af47a17c6ef26f4002800.

The two-file artifact-store configuration boundary is mergeable; CI, Security Scan, SAST Semgrep, and fuzz are terminal-success; unresolved inline findings are zero. Blank authority preserves the secure filesystem default, explicit filesystem/in-memory modes normalize deterministically, and unknown or NUL-corrupted modes fail without replacing the prior value. Protected main has advanced since construction, so any base update must regenerate all exact-head evidence.

@opencode-agent review
@coderabbitai review
@cwl-noema-review review
@strix review

Review this exact head read-only. Do not mutate the branch, synthesize author approval, weaken protection, or merge.

@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="ContextualWisdomLab/clearfolio"
pr="413"
head="e9b97b9212d5dbfafb8af47a17c6ef26f4002800"
source_file="src/main/java/com/clearfolio/viewer/config/ArtifactStoreProperties.java"
test_file="src/test/java/com/clearfolio/viewer/config/ArtifactStorePropertiesTest.java"

echo "== Requested commit and checkout =="
printf 'checked_out='; git rev-parse HEAD
printf 'requested_head_type='; git cat-file -t "$head"
printf 'requested_head_parent='; git rev-parse "${head}^"

echo "== Live PR and protected main refs =="
gh pr view "$pr" --repo "$repo" \
  --json number,state,isDraft,mergeable,baseRefName,baseRefOid,headRefName,headRefOid,reviewDecision,statusCheckRollup,reviews
printf 'live_main='; git ls-remote origin refs/heads/main | awk '{print $1}'

echo "== Requested head ancestry and merge bases =="
requested_base=$(git rev-parse "${head}^")
live_main=$(git ls-remote origin refs/heads/main | awk '{print $1}')
printf 'requested_base='; echo "$requested_base"
printf 'merge_base_requested_base_head='; git merge-base "$requested_base" "$head"
printf 'merge_base_live_main_head='; git merge-base "$live_main" "$head"
if git merge-base --is-ancestor "$live_main" "$head"; then
  echo 'live_main_is_ancestor_of_head=true'
else
  echo 'live_main_is_ancestor_of_head=false'
fi

echo "== Exact PR diff from parent =="
git diff --no-ext-diff --stat "$requested_base" "$head"
git diff --no-ext-diff --name-status "$requested_base" "$head"
git diff --no-ext-diff --unified=80 "$requested_base" "$head"

echo "== Current merge-base diff paths =="
live_merge_base=$(git merge-base "$live_main" "$head")
git diff --no-ext-diff --name-status "$live_merge_base" "$head"

echo "== Changed-file outlines =="
for file in "$source_file" "$test_file"; do
  echo "--- $file ---"
  ast-grep outline "$file" --items all --view expanded
done

echo "== Requested-head source and tests =="
for file in "$source_file" "$test_file"; do
  echo "--- $file @ $head ---"
  git show "$head:$file" | cat -n
done

echo "== Mode accessor and artifact-store call sites =="
rg -n -C 5 --glob '*.java' \
  '\b(getMode|setMode)\s*\(|\bArtifactStoreProperties\b|artifact[-_ ]?store|filesystem|in-memory|IllegalArgumentException|\\0|NUL' \
  src/main/java src/test/java

echo "== Live review thread state =="
gh api graphql -F owner="ContextualWisdomLab" -F name="clearfolio" -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
  repository(owner: $owner, name: $name) {
    pullRequest(number: $number) {
      reviewThreads(first: 100) {
        nodes {
          isResolved
          isOutdated
          comments(first: 1) { nodes { author { login } path line body } }
        }
      }
    }
  }
}' --jq '
  .data.repository.pullRequest.reviewThreads.nodes |
  {total: length,
   unresolved: map(select(.isResolved == false)) | length,
   unresolved_current: map(select(.isResolved == false and .isOutdated == false)) | length}'

echo "== Required status check conclusion summary =="
gh pr checks "$pr" --repo "$repo" --required

Length of output: 199359


@seonghobae Reviewed exact head e9b97b9212d5dbfafb8af47a17c6ef26f4002800 read-only.

No findings.

  • The checked-out commit and live PR head match the requested head.
  • The reviewed delta from merge base 961f44a19c4ced87f8062b3ab9842a9a08d05235 changes only ArtifactStoreProperties and its tests.
  • setMode() normalizes explicit filesystem and in-memory values with whitespace and case variation.
  • Null and blank values select the secure filesystem default.
  • Unknown URI-like values fail with IllegalArgumentException before mode changes.
  • NUL-corrupted values fail with IllegalArgumentException before mode changes.
  • The tests verify that rejected mutations preserve filesystem.
  • GitHub reports zero review threads. The listed CI, security, SAST, and fuzz checks succeeded.

Live main is now eb0a32e87e7470469c8fa0f8c67d9583654bef57. It is newer than the PR base and is not an ancestor of this head. If the branch is updated to that base, regenerate the exact-head evidence.

The PR remains REVIEW_REQUIRED. No approval was submitted. I did not modify the branch, protection, or merge state.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant