fix(security): make product publisher branch creation atomic - #80
fix(security): make product publisher branch creation atomic#80seonghobae wants to merge 62 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
|
@coderabbitai review |
|
|
@coderabbitai review Please perform a substantive security review of exact head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
head='ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd'
base='e0106ce16b7b8b493f46bf075ec5baf58762bd95'
echo '== exact head =='
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"
echo
echo '== changed files at exact head relative to first parent =='
git diff-tree --no-commit-id --name-status -r "$head"
echo
echo '== diff =='
git diff --find-renames --find-copies "${head}^" "$head" -- .github docs test tests 2>/dev/null || true
echo
echo '== workflow and relevant test/document candidates =='
fd -t f . | rg '(^|/)(.*product.*publisher.*|.*hourly.*product.*|.*atomic.*lease.*|.*publisher.*\.(test|spec)\.[^/]+|.*doctoring.*)$' || true
echo
echo '== outlines for changed source-like files =='
git diff-tree --no-commit-id --name-only -r "$head" | while IFS= read -r f; do
case "$f" in
*.js|*.mjs|*.cjs|*.ts|*.mts|*.cts|*.yml|*.yaml|*.md)
echo "--- $f"
ast-grep outline "$f" --items all 2>/dev/null || true
;;
esac
done
echo
echo '== requested and live remote refs =='
git ls-remote origin \
'refs/heads/*' \
| rg 'ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd|e0106ce16b7b8b493f46bf075ec5baf58762bd95' || true
echo
echo '== PR metadata and current refs =='
gh pr view 80 --repo ContextualWisdomLab/noema \
--json number,state,isDraft,headRefName,headRefOid,baseRefName,baseRefOid,urlLength of output: 5619 🏁 Script executed: #!/bin/bash
set -euo pipefail
head='ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd'
base_ref='origin/fix/nanoid-cve-2026-67213'
merge_base="$(git merge-base "$head" "$base_ref")"
echo "== merge base =="
printf '%s\n' "$merge_base"
git show -s --format='subject=%s' "$merge_base"
echo
echo "== cumulative PR changes =="
git diff --name-status "$merge_base" "$head"
echo
echo "== workflow sections: permissions, publisher stage, Git operations, traps =="
workflow='.github/workflows/hourly-product-development.yml'
git show "$head:$workflow" | nl -ba | rg -n -C 12 \
'(^|\s)(permissions:|publish_product_increment:|trap |force-with-lease|git push|git update-ref|git ls-remote|git fetch|git branch|contents:|pull-requests:|id-token:|actions:|security-events:|proposal|final_candidate|cleanup)' || true
echo
echo "== relevant workflow full file =="
git show "$head:$workflow" | nl -ba
echo
echo "== lease regression test =="
git show "$head:test/hourly-product-development-publisher-lease.test.ts" | nl -ba
echo
echo "== workflow-order and cleanup tests =="
for f in \
test/hourly-product-development-workflow.test.ts \
test/hourly-product-development-final-candidate-cleanup.test.ts \
test/hourly-product-development-git-mode-boundary.test.ts \
test/hourly-product-development-publication-prerequisite.test.ts \
test/hourly-product-development-runner-isolation.test.ts; do
echo "--- $f"
git show "$head:$f" | nl -ba | rg -n -C 8 \
'(force-with-lease|proposal|cleanup|trap|push|delete|permission|contents|publisher|git mode|ls-remote)' || true
done
echo
echo "== doctoring record =="
git show "$head:docs/doctoring/atomic-product-publisher-lease.md" | nl -ba
echo
echo "== workflow references and invocation paths =="
rg -n -C 5 \
'(hourly-product-development|publish_product_increment|workflow_call|workflow_dispatch|schedule)' \
.github README.md docs 2>/dev/null || trueLength of output: 2263 🏁 Script executed: #!/bin/bash
set -euo pipefail
head='ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd'
first='1a7a6eea0e4345f45d743efee9070d2265c779df'
impl='f60c4d93fe54cff211675b47c0f6a0950aadf8bd'
compat='16941a9139bc154403410bd22ee6c6e19c96e3ed'
workflow='.github/workflows/hourly-product-development.yml'
echo '== stated lineage and parents =='
for c in "$first" "$impl" "$compat" "$head"; do
git show -s --format='commit=%H%nparent=%P%nsubject=%s%n' "$c"
done
lineage_base="$(git rev-parse "${first}^")"
echo "== cumulative changes from lineage base $lineage_base =="
git diff --name-status "$lineage_base" "$head"
echo
echo '== workflow: complete exact-head content =='
git show "$head:$workflow" | nl -ba
echo
echo '== workflow: mutation and privilege context =='
git show "$head:$workflow" | nl -ba | rg -n -C 15 \
'(permissions:|publish_product_increment:|trap |force-with-lease|git push|git fetch|git ls-remote|git config|proposal|final_candidate|cleanup|contents:|pull-requests:|id-token:|environment:)' || true
echo
echo '== exact-head executable contracts =='
for f in \
test/hourly-product-development-publisher-lease.test.ts \
test/hourly-product-development-workflow.test.ts \
test/hourly-product-development-final-candidate-cleanup.test.ts \
test/hourly-product-development-git-mode-boundary.test.ts \
test/hourly-product-development-publication-prerequisite.test.ts \
test/hourly-product-development-runner-isolation.test.ts \
docs/doctoring/atomic-product-publisher-lease.md; do
echo "--- $f"
git show "$head:$f" | nl -ba
done
echo
echo '== local references to workflow or publisher stage =='
rg -n -C 5 \
'(hourly-product-development|publish_product_increment|workflow_call|workflow_dispatch|schedule)' \
.github README.md docs 2>/dev/null || true
echo
echo '== GitHub PR file list and current branch refs =='
gh api 'repos/ContextualWisdomLab/noema/pulls/80/files?per_page=100' \
--jq '.[] | [.filename, .status, .sha] | `@tsv`'
gh api 'repos/ContextualWisdomLab/noema/git/ref/heads/fix%2Fatomic-product-publisher-lease' --jq '.object.sha'
gh api 'repos/ContextualWisdomLab/noema/git/ref/heads/fix%2Fnanoid-cve-2026-67213' --jq '.object.sha'Length of output: 3527 🏁 Script executed: #!/bin/bash
set -euo pipefail
head='ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd'
workflow='.github/workflows/hourly-product-development.yml'
number() { awk '{printf "%6d %s\n", NR, $0}'; }
echo '== workflow: complete exact-head content =='
git show "$head:$workflow" | number
echo
echo '== workflow: mutation and privilege context =='
git show "$head:$workflow" | number | rg -n -C 18 \
'(permissions:|publish_product_increment:|trap |force-with-lease|git push|git fetch|git ls-remote|git config|proposal|final_candidate|cleanup|contents:|pull-requests:|id-token:|environment:)' || true
echo
echo '== exact-head regression and doctoring files =='
for f in \
test/hourly-product-development-publisher-lease.test.ts \
test/hourly-product-development-workflow.test.ts \
docs/doctoring/atomic-product-publisher-lease.md; do
echo "--- $f"
git show "$head:$f" | number
done
echo
echo '== exact-head diffs for implementation and tests =='
for c in \
f60c4d93fe54cff211675b47c0f6a0950aadf8bd \
16941a9139bc154403410bd22ee6c6e19c96e3ed \
ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd; do
echo "--- $c"
git show --format= --find-renames "$c" -- \
.github/workflows/hourly-product-development.yml \
test/hourly-product-development-publisher-lease.test.ts \
test/hourly-product-development-workflow.test.ts \
docs/doctoring/atomic-product-publisher-lease.md
done
echo
echo '== all workflow invocation and permission context =='
rg -n -C 8 \
'(hourly-product-development|publish_product_increment|workflow_call|workflow_dispatch|schedule|permissions:|contents:|pull-requests:)' \
.github README.md docs 2>/dev/null || true
echo
echo '== GitHub PR files and current refs =='
gh api 'repos/ContextualWisdomLab/noema/pulls/80/files?per_page=100' \
--jq '.[] | [.filename, .status, .sha] | `@tsv`' || true
printf 'head: '; gh api 'repos/ContextualWisdomLab/noema/git/ref/heads/fix%2Fatomic-product-publisher-lease' --jq '.object.sha' || true
printf 'base: '; gh api 'repos/ContextualWisdomLab/noema/git/ref/heads/fix%2Fnanoid-cve-2026-67213' --jq '.object.sha' || trueLength of output: 197010 🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/noema'
head='ab0819a0f504a00dccaa3e0e3d6c41de4c38a5fd'
echo '== exact-head combined status =='
gh api "repos/$repo/commits/$head/status" \
--jq '{state, sha, statuses: [.statuses[] | {context, state, creator: .creator.login, target_url}]}'
echo
echo '== exact-head check runs =='
gh api "repos/$repo/commits/$head/check-runs?per_page=100" \
--jq '.check_runs[] | {name, status, conclusion, app: .app.slug, started_at, completed_at, details_url}'
echo
echo '== workflow runs directly associated with exact head =='
gh api "repos/$repo/actions/runs?head_sha=$head&per_page=100" \
--jq '.workflow_runs[] | {name, event, status, conclusion, head_sha, head_branch, run_number, html_url, created_at, updated_at}'
echo
echo '== PR review and merge metadata =='
gh pr view 80 --repo "$repo" \
--json isDraft,mergeStateStatus,mergeable,reviewDecision,statusCheckRollup,reviews \
--jq '{isDraft, mergeStateStatus, mergeable, reviewDecision, reviews: [.reviews[] | {author: .author.login, state, submittedAt, commit: .commit.oid}], checks: [.statusCheckRollup[] | {name, status, conclusion, workflowName}]}'
echo
echo '== repository rulesets and main branch protection metadata =='
gh api "repos/$repo/rulesets?includes_parents=true" \
--jq '.[] | {name, target, enforcement, conditions, rules}' || true
gh api "repos/$repo/branches/main/protection" \
--jq '{required_status_checks, required_pull_request_reviews, enforce_admins, restrictions, required_linear_history, required_signatures}' || true
echo
echo '== current PR branch and base refs =='
gh pr view 80 --repo "$repo" \
--json headRefOid,baseRefOid,headRefName,baseRefName,isDraft,updatedAt,urlLength of output: 4533
I found no actionable security defect in the reviewed change.
The live The PR remains Draft. It has no recorded reviews. The branch-protection API was unavailable to this integration with HTTP 403. This review is not approval or merge authority. Current-base exact-head CI, security, coverage, governance, and an eligible independent approval remain required. You are interacting with an AI system. |
|
Exact-head security review for After the leased branch creation succeeds, Required test-first follow-up in this same PR:
Do not add a pre-create |
Purpose
Hardens
hourly-product-development, its atomic proposal publisher, and the NVIDIA NIM credential compartment without adding merge/release/deployment authority or repair/self-modifying workflows. Repository-wide architecture remains canonical on #71; this behavior is Proposed until protected integration and operational proof.Fresh source identity
main.main:c85d710804139c0697d7ef8fa47d02b1389e6d84(fix(security): update transitive nanoid for CVE-2026-67213 #76 integrated;nanoid@3.3.17protected truth).fix/atomic-product-publisher-lease.62b74b65d417b5a9f2519bb67abf0cf101deea17.9adb784902cae19a150146a8fadd6a0491f67814.The old PR body described #76 as unintegrated and #87/#89 as current sibling owners. Those facts are historical: #76 is protected truth; clean direct-main successors #90 and #91 now own governance/AGENTS and deterministic package-manager/install-script controls respectively.
Current convergence hazards
The stale #80 lineage overlaps current protected/successor authority in material paths:
.github/workflows/ci.ymlandtest/workflow-readiness.test.tsoverlap build(reproducibility): restack deterministic npm toolchain #91's deterministic Node/npm/live-base/lockfile/install-script control;AGENTS.mdoverlaps fix(governance): restack independent approval audit after nanoid #90's corrected central Security Scan and independent-governance guidance;CHANGELOG.mdoverlaps the protected fix(security): update transitive nanoid for CVE-2026-67213 #76 baseline and fix(governance): restack independent approval audit after nanoid #90/build(reproducibility): restack deterministic npm toolchain #91 successor evidence;package-lock.jsoncontains fix(security): update transitive nanoid for CVE-2026-67213 #76-era dependency movement that is already protected truth and must not be replayed as independent fix(security): make product publisher branch creation atomic #80 authority.Therefore a non-destructive metadata retarget or sibling merge is not enough. Only #80's unique scheduler/publisher/NIM delta should be rebuilt on the final combined protected lineage after #90/#91 integrate or an equivalent protected baseline is independently proven. No predecessor checks/reviews transfer.
Implemented authority boundary
The scheduler contract requires fresh evidence, falsifiable RCA, materially distinct remedies, feasibility proof, smallest safe action, observable acceptance and immediate queue continuation. Prompt/docs/RCA/test/commit/review/merge/blocker states are intermediate.
The publisher uses expected-absence branch lease, exact proposal-head cleanup, structured PR identity, a hidden high-entropy marker, paginated recovery, exact server-side head/base revalidation and fail-closed ambiguity handling.
The proposer may receive
NVIDIA_NIM_API_KEYbut cannot claim executable RED/GREEN. A separate uncredentialed verifier executes the immutable proposal; a credential-bearing non-executing publisher performs publication:Deterministic governance, formal review, merge, release and deployment authority remain outside model judgement.
Historical exact-head evidence
For current stale head
62b74b65d417b5a9f2519bb67abf0cf101deea17, application CI31346804416and reviewer-ci31346804418were terminal success. Central Security Scan was absent under the then-feature-base event path and was non-passingdefer_until_trigger. Formal reviews and inline review threads were absent at the latest fresh read.That evidence proves only the historical exact head. It does not make the diverged head mergeable or transfer to a future rebuilt successor.
Safe continuation
AGENTS.md, CI/package-manager/lockfile controls and CHANGELOG evidence.No protection bypass, audit waiver, synthetic approval, force push, version bump, release or deployment is introduced.
Related: #27, #29, #71, #76, #77, #79, #90, #91