feat(sandbox): add quarantined patch validation - #65
Conversation
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (23)
Comment |
|
@coderabbitai review Please review exact current head |
|
I will treat findings on earlier heads as stale. I will focus on the specified security boundaries, validation logic, evidence limits, tests, documentation, and standards claims.
|
|
@opencode-agent @cwl-noema-review Independent exact-head review requested for |
|
Implement the valid exact-head CI finding on current head
|
seonghobae
left a comment
There was a problem hiding this comment.
Exact-head security review for c604f929df89c387b1e28d6892247b2ce810e15d: one boundedness gap remains blocking despite green coverage.
_verify_exact_tree_limits() invokes git ls-tree -r -l -z --full-tree with stdout=subprocess.PIPE through subprocess.run, so the entire hostile exact-tree listing is accumulated in memory before MAX_SOURCE_ARCHIVE_MEMBERS, aggregate byte, and path validation runs. A timeout is not a byte bound; a repository with far more than 20,000 entries can emit a large result quickly and exhaust runner memory before the fail-closed parser executes. _verify_source_head() has the same pattern for git status --porcelain=v2 --untracked-files=all --ignored=matching, even though any first output byte is already sufficient to reject a dirty worktree.
Please implement streaming, configuration-isolated reads with explicit byte/record ceilings and early process termination; bound individual path bytes and aggregate metadata bytes before archive creation; add RED regressions proving the reader never accumulates beyond the configured ceiling for oversized exact trees and dirty-worktree output. Preserve exact-head refusal and do not add repair workflows or write-capable Actions. @opencode-agent
This is not an approval and the PR must remain unmerged until this finding, current automated review, and eligible independent approval are complete.
|
@coderabbitai review Please review exact current head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/noema"
pr="65"
requested="c604f929df89c387b1e28d6892247b2ce810e15d"
head_before="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
checked_out="$(git rev-parse HEAD)"
resolved_requested="$(git rev-parse "${requested}^{commit}")"
printf '%s\n' '== Exact revision state =='
printf 'checked_out_head=%s\nrequested_head=%s\npr_head_before=%s\n' \
"$checked_out" "$resolved_requested" "$head_before"
git status --short
printf '%s\n' '== Changes in the PR =='
git diff --stat "${resolved_requested}^" "$resolved_requested"
git diff-tree --no-commit-id --name-status -r "$resolved_requested"
printf '%s\n' '== Current checks =='
gh pr view "$pr" --repo "$repo" --json reviewDecision,statusCheckRollup \
--jq '{reviewDecision,checks:[.statusCheckRollup[] | {name,status,conclusion,detailsUrl}]}'
printf '%s\n' '== Candidate files =='
fd -t f -a . reviewer docs .github 2>/dev/null | \
rg '(patch_validation|quarantined-patch-validation|CHANGELOG|doctor|workflow)' | sort
printf '%s\n' '== Production structure =='
ast-grep outline reviewer/noema_reviewer/patch_validation.py --items all --view signatures
printf '%s\n' '== Relevant production controls =='
rg -n -C 5 \
'def (validate|inspect_patch_bytes|_verify_source_head|_materialize_committed_source|_preflight|_read_result_payload|_read_bounded|_run_git|_create_isolated_git_control|_validated_repository_path)|MAX_(PATCH|RESULT|TREE|ARCHIVE)|ls-tree|git archive|status --porcelain|TRUSTED_GIT_EXECUTABLE|GIT_NO_(REPLACE_OBJECTS|LAZY_FETCH)|O_NOFOLLOW|fstat|lstat|/output/result\.json|--network|--read-only|--user=|cap-drop|no-new-privileges|seccomp|--pull=never|--ulimit|fsize|DEVNULL|PASSED|returncode|head_sha|base_sha|patch_sha' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Test coverage and contract references =='
rg -n -C 3 \
'(patch_validation|ls-tree|archive|worktree|result\.json|Docker|MAX_RESULT|no newline|hunk|100%|docstring)' \
reviewer/tests pyproject.toml pytest.ini setup.cfg .coveragerc 2>/dev/null || true
printf '%s\n' '== Documentation and changelog claims =='
rg -n -C 3 \
'(patch validation|Patch validation|exact head|exact-head|credential|Docker|result\.json|16 KiB|64 MiB|ls-tree|archive|coverage|APA|NIST|SLSA)' \
docs CHANGELOG.md README.md 2>/dev/null || true
printf '%s\n' '== Workflow privilege scan =='
rg -n -i -C 2 \
'(contents:\s*write|permissions:.*write|github-token|COPILOT_GITHUB_TOKEN|repair[-_ ]?pr|self[-_ ]?modif|git push|gh pr)' \
.github 2>/dev/null || true
printf '%s\n' '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='noema' -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
path
line
comments(first: 1) { nodes { author { login } body } }
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)' || true
head_after="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
printf '%s\n' '== Exact-head recheck =='
printf 'pr_head_after=%s\n' "$head_after"
if [ "$checked_out" != "$resolved_requested" ] ||
[ "$head_before" != "$resolved_requested" ] ||
[ "$head_after" != "$resolved_requested" ]; then
printf '%s\n' 'EXACT_HEAD_MISMATCH_OR_CHANGED' >&2
exit 2
fiLength of output: 197417 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Exact head and checks, compact =='
git rev-parse HEAD
gh pr view 65 --repo ContextualWisdomLab/noema --json headRefOid,reviewDecision,statusCheckRollup \
--jq '{headRefOid,reviewDecision,checks:[.statusCheckRollup[] | {name,conclusion,status}]}'
printf '%s\n' '== Production symbol map =='
ast-grep outline reviewer/noema_reviewer/patch_validation.py --items all --view expanded
printf '%s\n' '== Function locations =='
rg -n \
'^(def (validate|_validated_repository_path|_read_|_verify_source_head|_create_isolated_git_control|_isolated_git_environment|_preflight|_materialize_committed_source|_validate_|_build)|class (DockerPatchValidationRunner|PatchValidation))' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Constants and subprocess calls =='
rg -n -C 4 \
'MAX_|subprocess\.(run|Popen)|communicate\(|capture_output|stdout=|stderr=|timeout=|ls-tree|archive|status|Docker|docker|--network|--user|--mount|result\.json|RLIMIT_FSIZE|O_NOFOLLOW|os\.open|fstat|lstat' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Focused test definitions =='
rg -n \
'^\s*def test_.*(tree|archive|worktree|result|docker|hunk|path|metadata|output|timeout|descriptor|credential|materializ)' \
reviewer/tests
printf '%s\n' '== Patch-validation file list =='
fd -t f -a . reviewer/tests | rg 'patch_validation' | sortLength of output: 48137 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Exact-tree and archive implementation =='
sed -n '838,1088p' reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Runner and result implementation =='
sed -n '1110,1315p' reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Prearchive and archive tests =='
sed -n '1,180p' reviewer/tests/test_patch_validation_prearchive_and_result_channel.py
sed -n '1,340p' reviewer/tests/test_patch_validation_archive_boundaries.py
sed -n '1,260p' reviewer/tests/test_patch_validation_exact_tree_and_output.py
printf '%s\n' '== Final live-head check =='
printf 'checked_out=%s\n' "$(git rev-parse HEAD)"
gh pr view 65 --repo ContextualWisdomLab/noema --json headRefOid --jq '.headRefOid'Length of output: 41341
I found one blocking security issue. I do not approve this head. Blocking: the exact-tree preflight is neither output-bounded nor bound to the archive.
As a result, the implementation does not establish the documented “exact-tree and archive/extracted-manifest identity binding.” An archive that is structurally safe but omits a preflight file, adds a different file, or replaces a blob with equal-sized content can pass the current archive and extraction checks. Use a bounded incremental The completed checks and coverage evidence are positive, but they do not close this trust-boundary gap.
|
|
@coderabbitai review Please review exact current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/noema"
pr="65"
base="9adb784902cae19a150146a8fadd6a0491f67814"
head="9e03b17d0bdda75809f394aaafb0b44cf1267a51"
pr_head_before="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
pr_base_before="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq '.baseRefOid')"
checked_out="$(git rev-parse HEAD)"
resolved_base="$(git rev-parse "${base}^{commit}")"
resolved_head="$(git rev-parse "${head}^{commit}")"
printf '%s\n' '== Exact revision state =='
printf 'checked_out=%s\nrequested_base=%s\nrequested_head=%s\npr_base_before=%s\npr_head_before=%s\n' \
"$checked_out" "$resolved_base" "$resolved_head" "$pr_base_before" "$pr_head_before"
git status --short
printf '%s\n' '== PR checks and review state =='
gh pr view "$pr" --repo "$repo" --json reviewDecision,statusCheckRollup \
--jq '{reviewDecision, checks: [.statusCheckRollup[] | {name, status, conclusion, detailsUrl}]}'
printf '%s\n' '== Changed files against requested base =='
git diff --name-status "$resolved_base" "$resolved_head"
git diff --stat "$resolved_base" "$resolved_head"
printf '%s\n' '== Candidate files =='
fd -t f -a . | rg '(^|/)(patch_validation\.py|test_.*patch_validation.*\.py|CHANGELOG\.md|.*patch.validation.*\.md|.*doctor.*\.md)$' | sort
printf '%s\n' '== Production symbol outline =='
ast-grep outline reviewer/noema_reviewer/patch_validation.py --items all --view signatures
printf '%s\n' '== Relevant production definitions and controls =='
rg -n -C 5 \
'^(def (_|)?(validate|inspect_patch_bytes|_validated_repository_path|_verify_source_head|_create_isolated_git_control|_isolated_git_environment|_verify_clean|_preflight|_materialize|_read|_run|_validate)|class )|git (status|ls-tree|archive)|Popen|PIPE|communicate|O_NOFOLLOW|fstat|lstat|MAX_(RESULT|PATCH|TREE|ARCHIVE)|GIT_NO_(REPLACE_OBJECTS|LAZY_FETCH)|--network|--read-only|--user=|cap-drop|no-new-privileges|--pull=never|result\.json|PASSED|returncode|head_sha|base_sha|patch_sha' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Focused implementation sections =='
for range in 1,200 350,780 780,1150 1150,1450; do
sed -n "${range}p" reviewer/noema_reviewer/patch_validation.py
done
printf '%s\n' '== Focused test declarations =='
rg -n -C 2 \
'^\s*def test_.*(tree|archive|status|worktree|result|descriptor|hunk|path|metadata|docker|materializ|bound|timeout)' \
reviewer/tests
printf '%s\n' '== Public documentation and changelog claims =='
rg -n -C 4 \
'(quarantined patch|patch validation|exact.head|exact tree|ls-tree|archive|descriptor|result\.json|credential|Docker|16 KiB|64 MiB|NIST|SLSA|APA)' \
README.md CHANGELOG.md docs 2>/dev/null || true
printf '%s\n' '== Workflow privilege and repair-workflow scan =='
rg -n -i -C 2 \
'(contents:\s*write|permissions:.*write|COPILOT_GITHUB_TOKEN|repair[-_ ]?pr|self[-_ ]?modif|git push|gh pr)' \
.github 2>/dev/null || true
printf '%s\n' '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='noema' -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
path
line
comments(first: 1) { nodes { author { login } body } }
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)' || true
pr_head_after="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
pr_base_after="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq '.baseRefOid')"
printf '%s\n' '== Exact revision recheck =='
printf 'pr_base_after=%s\npr_head_after=%s\n' "$pr_base_after" "$pr_head_after"
if [ "$checked_out" != "$resolved_head" ] ||
[ "$pr_base_before" != "$resolved_base" ] ||
[ "$pr_head_before" != "$resolved_head" ] ||
[ "$pr_base_after" != "$resolved_base" ] ||
[ "$pr_head_after" != "$resolved_head" ]; then
printf '%s\n' 'EXACT_REVISION_MISMATCH_OR_CHANGED' >&2
exit 2
fiLength of output: 200693 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '== Current exact head and checks =='
git rev-parse HEAD
gh pr view 65 --repo ContextualWisdomLab/noema --json headRefOid,baseRefOid,reviewDecision,statusCheckRollup \
--jq '{baseRefOid,headRefOid,reviewDecision,checks:[.statusCheckRollup[] | {name,status,conclusion}]}'
printf '%s\n' '== Source function map =='
rg -n \
'^(def (_read|_run|_stream|_validate|_preflight|_materialize|_verify|_create|_build|validate)|class DockerPatchValidationRunner|class PatchValidation)' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Exact-tree, archive, and extraction implementation =='
sed -n '760,1120p' reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Git status, Git control, descriptor reads, and path/hunk parser =='
sed -n '250,760p' reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Docker command, result channel, and request/result checks =='
sed -n '1120,1480p' reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Focused patch-validation test files =='
fd -t f -a . reviewer/tests | rg 'patch_validation' | sort
printf '%s\n' '== Exact-tree and archive regression tests =='
for file in \
reviewer/tests/test_patch_validation_prearchive_and_result_channel.py \
reviewer/tests/test_patch_validation_archive_boundaries.py \
reviewer/tests/test_patch_validation_exact_tree_and_output.py
do
if [ -f "$file" ]; then
printf '\n== %s ==\n' "$file"
cat -n "$file"
fi
done
printf '%s\n' '== Streaming, worktree, and diff-parser regression declarations =='
rg -n -C 3 \
'def test_.*(stream|tree|status|dirty|worktree|archive|extract|result|descriptor|hunk|metadata|path|Docker|credential|timeout|terminate)' \
reviewer/tests
printf '%s\n' '== Exact revision recheck =='
printf 'checked_out=%s\n' "$(git rev-parse HEAD)"
gh pr view 65 --repo ContextualWisdomLab --json headRefOid,baseRefOid \
--jq '{baseRefOid,headRefOid}'Length of output: 155700
I found one blocking issue. I do not approve this head. Blocking: the exact-tree preflight is not bound to the archive or extracted source bytes.
The code does not compare archive members to the authenticated A structurally valid archive can omit a preflight path, add a path, or replace a blob with equal-size content. The current archive and extraction checks can accept it because both checks use the archive-derived manifest. Retain an immutable exact-tree inventory from the streamed preflight. The inventory should contain each canonical path, mode, object ID, and size. Require the archive file set and sizes to match that inventory exactly. Before Docker starts, verify each extracted regular file against its authenticated Git blob bytes or a trusted digest derived from that blob. Add regressions for:
The streamed status and tree readers now use bounded incremental reads. The descriptor-safe result-file boundary and Docker controls also appear materially improved. Those controls do not close the missing source-byte binding. You are interacting with an AI system. |
|
@opencode-agent @cwl-noema-review Independent review is requested for exact current head |
|
@coderabbitai review Exact-head request: base |
|
|
|
@coderabbitai review Please perform the substantive review of exact current head |
|
Your plan includes PR reviews subject to rate limits. More reviews will be available in 20 seconds. |
|
Implement the valid blocking CodeRabbit finding on exact current head Add RED regressions first for mutation or substitution between the streamed Cover at least: same-size blob substitution, different-size substitution, added/removed/renamed archive paths, mode drift, object-ID mismatch, tree/archive race, malformed or duplicate inventory entries, and all new failure/cleanup branches. Maintain 100% production statement and branch coverage plus 100% public docstring coverage. Update authoritative documentation and |
|
@coderabbitai review Exact-head review request: base |
|
I will treat a queued, pending, skipped, rate-limited, or commit-status-only response as incomplete review evidence.
|
|
Implement the valid exact-head security finding on current head The RED regression Fix test-first by parsing every Update |
|
@coderabbitai review Review exact current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/noema"
pr="65"
base="9adb784902cae19a150146a8fadd6a0491f67814"
head="89b4e5c40e6bdd7eab4f364ccd9161870cf68390"
pr_base_before="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq '.baseRefOid')"
pr_head_before="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
checked_out="$(git rev-parse HEAD)"
resolved_base="$(git rev-parse "${base}^{commit}")"
resolved_head="$(git rev-parse "${head}^{commit}")"
printf '%s\n' '== Exact revision state =='
printf 'checked_out=%s\nrequested_base=%s\nrequested_head=%s\npr_base_before=%s\npr_head_before=%s\n' \
"$checked_out" "$resolved_base" "$resolved_head" "$pr_base_before" "$pr_head_before"
git status --short
printf '%s\n' '== PR changes and checks =='
git diff --name-status "$resolved_base" "$resolved_head"
gh pr view "$pr" --repo "$repo" --json reviewDecision,statusCheckRollup \
--jq '{reviewDecision,checks:[.statusCheckRollup[] | {name,status,conclusion,detailsUrl}]}'
printf '%s\n' '== Production structure =='
ast-grep outline reviewer/noema_reviewer/patch_validation.py --items all --view signatures
printf '%s\n' '== Mode metadata parser and patch integrity implementation =='
rg -n -C 10 \
'(old mode|new mode|new file mode|deleted file mode|inspect_patch_bytes|_validated_repository_path|index |diff --git|@@ |no newline|120000|160000|100644|100755|fullmatch|match\()' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Bounded evidence and Docker isolation implementation =='
rg -n -C 6 \
'(git status|ls-tree|Popen|PIPE|O_NOFOLLOW|fstat|MAX_|--network|--read-only|--user=|cap-drop|no-new-privileges|--pull=never|result\.json|DEVNULL|GIT_NO_)' \
reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Focused source sections =='
rg -n '^(def (inspect_patch_bytes|_validated_repository_path|_verify_source_head|_preflight|_materialize|_read|_run)|class )' \
reviewer/noema_reviewer/patch_validation.py
sed -n '250,780p' reviewer/noema_reviewer/patch_validation.py
sed -n '780,1480p' reviewer/noema_reviewer/patch_validation.py
printf '%s\n' '== Focused regression tests =='
rg -n -C 5 \
'(trailing_mode_tokens|mode.*symlink|symlink|gitlink|old mode|new mode|new file mode|deleted file mode|hunk|descriptor|result|Docker|worktree|ls-tree)' \
reviewer/tests
printf '%s\n' '== Public contract and workflow scan =='
rg -n -C 4 \
'(mode metadata|trailing|symlink|gitlink|patch validation|exact-token|credential|Docker|result\.json)' \
docs CHANGELOG.md README.md 2>/dev/null || true
rg -n -i -C 3 \
'(contents:\s*write|permissions:.*write|repair[-_ ]?pr|self[-_ ]?modif|git push|gh pr|COPILOT_GITHUB_TOKEN)' \
.github 2>/dev/null || true
printf '%s\n' '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='noema' -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
path
line
comments(first: 1) { nodes { author { login } body } }
}
}
}
}
}' --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)' || true
pr_base_after="$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq '.baseRefOid')"
pr_head_after="$(gh pr view "$pr" --repo "$repo" --json headRefOid --jq '.headRefOid')"
printf '%s\n' '== Exact revision recheck =='
printf 'pr_base_after=%s\npr_head_after=%s\n' "$pr_base_after" "$pr_head_after"
if [ "$checked_out" != "$resolved_head" ] ||
[ "$pr_base_before" != "$resolved_base" ] ||
[ "$pr_head_before" != "$resolved_head" ] ||
[ "$pr_base_after" != "$resolved_base" ] ||
[ "$pr_head_after" != "$resolved_head" ]; then
echo 'EXACT_REVISION_MISMATCH_OR_CHANGED' >&2
exit 2
fiLength of output: 197658 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo="ContextualWisdomLab/noema"
pr="65"
base="9adb784902cae19a150146a8fadd6a0491f67814"
head="89b4e5c40e6bdd7eab4f364ccd9161870cf68390"
printf '%s\n' '== Exact revision precheck =='
git rev-parse HEAD
gh pr view "$pr" --repo "$repo" --json baseRefOid,headRefOid \
--jq '{baseRefOid,headRefOid}'
printf '%s\n' '== Mode parser definitions and nearby source =='
rg -n \
'(MODE|mode|inspect_patch_bytes|_parse|_validate.*metadata|new file mode|deleted file mode|old mode|new mode)' \
reviewer/noema_reviewer/patch_validation.py
for line in $(rg -n \
'(new file mode|deleted file mode|old mode|new mode|def inspect_patch_bytes)' \
reviewer/noema_reviewer/patch_validation.py | cut -d: -f1 | sort -nu); do
start=$((line - 18))
[ "$start" -lt 1 ] && start=1
end=$((line + 30))
printf '\n== reviewer/noema_reviewer/patch_validation.py:%s-%s ==\n' "$start" "$end"
sed -n "${start},${end}p" reviewer/noema_reviewer/patch_validation.py
done
printf '%s\n' '== Exact committed RED regression and related mode tests =='
rg -n -C 12 \
'(trailing_mode_tokens_cannot_hide_a_symlink_mode|new file mode|deleted file mode|old mode|new mode|120000|160000|trailing)' \
reviewer/tests
printf '%s\n' '== Files changed in this PR under workflows =='
git diff --name-status "$base" "$head" -- .github/workflows
git diff -- "$base" "$head" -- .github/workflows | \
rg -n -i -C 3 '(repair|self.modif|workflow_dispatch|contents:\s*write|git push|gh pr|curl .*api\.github)' || true
printf '%s\n' '== Repair workflow and transient mutator inventory =='
fd -t f -a .github/workflows reviewer -E .git | \
rg -i '(repair|patch.validation.*repair|mutat)' || true
rg -n -i -C 2 \
'(repair[-_ ]?pr|self[-_ ]?modif|self[-_ ]?delet|git\s+commit|git\s+push|gh\s+pr)' \
.github/workflows 2>/dev/null || true
printf '%s\n' '== Current check failures only =='
gh pr view "$pr" --repo "$repo" --json statusCheckRollup \
--jq '.statusCheckRollup[] | select(.conclusion != "SUCCESS") | {name,status,conclusion,detailsUrl}'
printf '%s\n' '== Exact revision postcheck =='
printf 'checked_out=%s\n' "$(git rev-parse HEAD)"
gh pr view "$pr" --repo "$repo" --json baseRefOid,headRefOid \
--jq '{baseRefOid,headRefOid}'Length of output: 32417
I found one blocking issue. I do not approve this head. Blocking: mode metadata accepts a trailing-token symlink bypass.
if not line.endswith((" 100644", " 100755")):
raise ValueError("patch contains an unsupported file mode")This accepts: The special-mode expression does not match because the line has an extra token. The suffix test then accepts the trailing The committed regression in Parse each mode metadata line with one The live base and head remained unchanged during inspection. The failing You are interacting with an AI system. |
|
Apply the already-validated minimal production fix only if PR #65 still has exact head
MODE_METADATA_PATTERN = re.compile(
r"^(?:old mode|new mode|new file mode|deleted file mode) (?P<mode>[0-9]{6})$"
)
This preserves distinct malformed, special-object, and unsupported-regular-mode semantics and closes the Git-accepted Update |
Summary
Adds a credential-free, allowlisted patch-validation boundary for exact-head review evidence. Untrusted source, patch content, repository scripts, Git status and exact-tree output, archive metadata, extracted filesystem objects, and validator output remain outside GitHub App, reviewer-model, NVIDIA NIM, Cloudflare, OIDC, publication, deployment, and Docker-socket credentials.
Buyer-visible gap addressed
Noema could quarantine source for graph inspection but lacked a bounded contract for validating a proposed patch against an authenticated exact Git revision without crossing a credential boundary. This PR supplies that evidence plane while preserving separation among check runs, commit statuses, review evidence, model judgement, protected-branch approval, build provenance, release acceptance, and deployment authority.
Implemented boundary
--pull=never;git ls-tree -r -l -z --full-treepreflight before archive allocation, retaining at most one bounded partial record and permitting only canonical100644/100755blobs with valid object identities;export-ignoreandexport-substneutralized;lstatpath/type/size equality before Docker receives the source;.githandling with symlink/special-object refusal and type-compatible empty metadata boundaries;/output/result.jsonevidence file with stdout/stderr discarded;PASSED→zero-exit consistency, and exact command re-binding;CHANGELOG.md, and APA 7th standards doctoring.Addressed review and CI findings
contents: writerepair workflow; no.github/workflows/repair-*file remains.---,+++, rename, and copy paths to the active primary diff identity while permitting complete canonical metadata families.git archivestorage allocation.Exact-head status
Current head:
9e03b17d0bdda75809f394aaafb0b44cf1267a51ci: completed successfullySecurity Scan: completed successfullyreviewer-ci: completed successfully — 331 passed; 100% production statement coverage; 100% production branch coverage; 100% public docstring coverageAPPROVE: not submitted9adb784902cae19a150146a8fadd6a0491f67814and head9e03b17d0bdda75809f394aaafb0b44cf1267a51, but CodeRabbit reported the review limit was reached and the review did not start. Rate limiting is not review success.Scope boundary
This PR adds a tested library and evidence contract. It does not yet build, publish, sign, scan, attest, or activate the dedicated patch-validator image in the reviewer decision flow. Those remain explicit follow-on gates. No version bump or release is claimed.
Merge policy
Do not merge unless the live exact head remains current, every required check and security gate succeeds, current human and automated findings are addressed, every addressed thread is resolved, CodeRabbit/current automated review is complete where repository policy requires it, and an eligible independent reviewer submits
APPROVE. Queued, pending, or rate-limited checks and reviews are not success, and no protection may be bypassed or weakened.Related: #9