Skip to content

fix(operations): bound workflow registry response streaming - #504

Merged
seonghobae merged 101 commits into
mainfrom
fix/workflow-registry-stream-bounds
Aug 30, 2026
Merged

fix(operations): bound workflow registry response streaming#504
seonghobae merged 101 commits into
mainfrom
fix/workflow-registry-stream-bounds

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Repair authority

Canonical Noema workflow-registry privileged-transport and destructive-mutation authority lane for #226.

  • protected base: main@59cc1abf8531f4f151cbb9b490ccc1659adf775a;
  • current exact head: 85ab7fb38b011e1a77f3cdf2c352bfa3a178d017;
  • PR: open / Ready / mergeable;
  • ancestry: exact head is 101 commits ahead / 0 behind protected main, with protected main as the exact merge base.

Current repair contract

This branch preserves fail-closed workflow-registry response handling and destructive-operation authority, including bounded streaming with no unsafe arrayBuffer() fallback, one unchanged end-to-end request deadline, cancellation of rejected unread response bodies without replacing the owning failure, exact repository/workflow/path/status semantics, strict UTF-8/JSON authority, delegated-token closure, protected-main SHA binding, fresh active-PR ownership revalidation immediately before mutation, and immutable before/after receipt rules.

The accumulated test-first lineage covers unstreamable responses, timeout/EOF races, response-body size/media/status rejection, late cleanup, protected-main drift, capability-path aliases, active-PR ownership changes, and post-mutation audit integrity.

Exact current evidence

Only unchanged exact-head evidence for 85ab7fb38b011e1a77f3cdf2c352bfa3a178d017 is eligible.

  • Application CI 33316529385: terminal-success; exact checkout/live-base/lockfile control, typecheck, full release tests, release security, KPI, dependency-license inventory, acquisition manifest/integrity and final base-drift refusal passed;
  • reviewer-ci 33316529392: terminal-success; hash-pinned dependencies, exact 100% line+branch coverage, 100% docstring coverage, authenticated/scanned distroless sandbox and real no-network CodeGraph smoke passed;
  • required Security Scan 33316529372: terminal-success; exact base/head OSV, exact-head Dependency Review support+gate, exact-head Trivy, and Scorecard completed successfully;
  • dedicated patch-validator-image 33316529368: terminal-success; exact-head build, static Node identity, dynamic-runtime exclusion, real no-network/read-only/non-root smoke, CycloneDX SBOM, static/embedded runtime vulnerability receipts, exact-source/image receipt verification and stale-head refusal all passed;
  • visible review threads: 0 unresolved. Historical bug findings are resolved; current formal review submissions are COMMENTED evidence, not synthesized approvals.

Central security authority

The live organization ruleset 18794436 requires .github/workflows/security-scan.yml@refs/heads/main on Noema's default branch, has no bypass actors, and reports current_user_can_bypass=never.

Central .github/main advanced after this Security Scan run from parent 6ffd8f8a03999cae6420c3b0b970be19f0d52386 to 1ff8268255b061461d9d49b4cab4febf9a8e7bfa, but the required security-scan.yml blob is unchanged at 148e944310593958d7c6dd96590c5327a0c4b355. Therefore the successful exact-head Security Scan was produced under the same required-workflow source bytes that are live now; no stale scanner-generation evidence is being transferred.

Merge boundary

This exact head is technically merge-eligible only while head/base/governance remain unchanged and no valid unresolved finding appears. Source/check evidence does not synthesize external workflow-registry/OIDC production postconditions. Central .github, naruon, contextual-orchestrator, and other dedicated-writer repositories remain read-only source dependencies.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d57fa745-6c42-472a-8dde-69ee226313ae

📥 Commits

Reviewing files that changed from the base of the PR and between 05e42f2 and 85ab7fb.

📒 Files selected for processing (3)
  • scripts/workflow-registry-disable-plan.mjs
  • scripts/workflow-registry-live-disable.mjs
  • test/workflow-registry-response-authority-regressions.test.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

워크플로 레지스트리 감사와 비활성화 흐름의 입력 검증, GitHub 응답 처리, deadline, 스트리밍 제한, 변이 전후 감사 검증, 토큰 오류 정제를 강화했습니다.

Changes

워크플로 레지스트리 보안 강화

Layer / File(s) Summary
토큰 및 입력 경계 검증
scripts/lib/delegated-github-token.mjs, scripts/workflow-registry-disable-plan.mjs, scripts/workflow-registry-live-disable.mjs, test/maintainer-app-token-capability.test.ts, test/workflow-registry-live-disable-main.test.ts, test/*redaction*.test.ts
제어 문자 제거 순서를 변경했습니다. 워크플로 경로, 토큰 경로, 저장소 식별자, workflow ID 검증을 강화했습니다.
감사 기준과 식별자 검증
scripts/workflow-registry-live-audit.mjs, test/workflow-registry-live-audit*.test.ts, test/workflow-registry-protected-main-sha-authority.test.ts
변경 워크플로 경로를 head 트리 기준으로 계산합니다. 보호 브랜치 SHA 형식을 제한합니다. 관련 감사 입력 테스트를 추가했습니다.
비활성화 계획 transport 경계
scripts/workflow-registry-disable-plan.mjs, test/workflow-registry-disable-plan-*.test.ts, test/workflow-registry-response-authority-regressions.test.ts
요청 deadline, 스트리밍 응답 크기 제한, JSON content type, UTF-8 디코딩, 응답 취소 처리를 적용했습니다.
라이브 레지스트리 응답 처리
scripts/workflow-registry-live-disable.mjs, test/workflow-registry-live-disable-*.test.ts, test/workflow-registry-unstreamable-response.test.ts
HTTP 200, JSON media type, bounded stream, timeout, 비스트리밍 응답, 취소 오류 처리를 검증합니다.
변이 전후 권한 및 영수증 검증
scripts/workflow-registry-live-disable.mjs, test/workflow-registry-live-disable-operator.test.ts, test/workflow-registry-live-disable-pre-mutation-authority.test.ts, test/workflow-registry-live-disable-residual-coverage.test.ts
변이 직전에 감사와 후보를 새로 확인합니다. 사후 감사의 잔여 실패, ID, protected-main SHA, workflow identity를 검증합니다.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: 🟡 Moderate · up to 85ab7

The change strengthens bounded response processing for privileged workflow-registry operations, but merge should wait because the required exact-head image validation has not yet reached terminal success and its runtime, security, and provenance checks remain unconfirmed.

Sequence Diagram(s)

sequenceDiagram
  participant Operator
  participant runWorkflowRegistryDisablement
  participant collectLiveWorkflowRegistryAudit
  participant GitHubTransport
  participant disableWorkflow
  Operator->>runWorkflowRegistryDisablement: workflow ID 전달
  runWorkflowRegistryDisablement->>collectLiveWorkflowRegistryAudit: 초기 감사 요청
  collectLiveWorkflowRegistryAudit->>GitHubTransport: GitHub JSON 요청
  GitHubTransport-->>collectLiveWorkflowRegistryAudit: 제한된 JSON 응답
  runWorkflowRegistryDisablement->>collectLiveWorkflowRegistryAudit: 변이 직전 감사 재요청
  runWorkflowRegistryDisablement->>disableWorkflow: 재검증된 workflow 비활성화
  runWorkflowRegistryDisablement->>collectLiveWorkflowRegistryAudit: 사후 감사 요청
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.82% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 49 functions across 25 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 워크플로 레지스트리 응답 스트리밍을 제한하는 핵심 변경을 정확하고 간결하게 설명합니다. 응답 본문 스트리밍, 데드라인, 취소 처리가 주요 변경 사항과 일치합니다.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/workflow-registry-stream-bounds

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.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 0 new potential issues.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 0 new potential issues.

Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 0 new potential issues.

Devin Review

Copy link
Copy Markdown
Contributor Author

Triage note (not a merge action — this PR is already self-documented as blocked behind #500 and has no approving review yet).

Current head 150452e8834f95159860be2e5e4eb3d6de09c94c's verify-patch-validator-image check is red, independent of the #500 dependency: job 99218251871 fails in scripts/lib/patch-validator-static-runtime-evidence.mjs (verifyEmbeddedRuntimeEvidence) with:

Error: blocking embedded runtime vulnerabilities are not allowed

This is the Grype embedded-runtime scan over the patch-validator image's bundled Node runtime, and it looks like a real finding rather than a flake (the rest of the job — Trivy image scan, SBOM, smoke — passed). The raw per-component Grype JSON is written to a build artifact rather than echoed to the log, so I couldn't pull the exact CVE/package from the log alone; whoever picks this up should download the patch-validator-image-verification-150452e8834f95159860be2e5e4eb3d6de09c94c artifact (or re-run and inspect embedded-runtime-vulnerability-scan.json) to identify the affected package and bump it per this repo's "bump the vulnerable dependency, never weaken the gate" convention — the check enforces exactly that policy already, so it shouldn't be relaxed.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Root-cause diagnosis: verify-patch-validator-image failure on exact head 150452e8834f95159860be2e5e4eb3d6de09c94c

This is a real, reproducible finding — not flaky CI — but it is not caused by this PR's diff. It is a live grype vulnerability-database refresh surfacing genuinely new CVEs against the same Node 24.19.0 static runtime every other open PR also bundles.

Confirmed by pulling job 99218251871's uploaded evidence artifact and re-running scripts/lib/patch-validator-static-runtime-evidence.mjs + scripts/lib/patch-validator-embedded-runtime-applicability.mjs locally against it:

After the existing reviewed-non-applicable allowlist correctly dismisses its 5 known exceptions (nghttp2 CVE-2026-58055, OpenSSL CVE-2026-14456, and the 3 legacy V8 CVEs), 8 new blocking-severity matches remain:

  • OpenSSL 3.5.7 (4 new, real, currently-unfixed-upstream CVEs from the Aug 25 2026 OpenSSL security advisory): CVE-2026-18798, CVE-2026-63076, CVE-2026-63072, CVE-2026-14457.
  • sqlite 3.53.3 (3): BIT-sqlite-2025-6965, BIT-sqlite-2024-0232, BIT-sqlite-2025-29088.
  • zlib (1): GHSA-g857-hhfv-j68w.

Research against upstream (Node release index + nodejs/node v24.20.0 tag, released 2026-08-26):

  • Node 24.20.0 (latest 24.x LTS) bumps sqlite to 3.53.4, rebuilds zlib (...-42c2f19), and bumps nghttp2 to 1.70.0 — this would very likely clear the sqlite and zlib findings and needs a fresh nghttp2 applicability review.
  • Node 24.20.0 still ships OpenSSL 3.5.7 (confirmed via deps/openssl/openssl/VERSION.dat at that tag). The Aug 25 advisory's fix (OpenSSL 3.5.8) landed one day before 24.20.0 cut, so no current upstream Node 24.x release fixes the 4 remaining OpenSSL CVEs — this portion is genuinely blocked on an upstream Node release, not on anything in this repo.

I'm not pushing a Node-version bump myself: it wouldn't turn this check green anyway (the OpenSSL CVEs would still block), and the exact-version/CPE/checksum pinning this verifier enforces (EXPECTED_NODE_VERSION, EXPECTED_NGHTTP2_VERSION/CPE, EXPECTED_V8_VERSION, Docker Node-source checksum, plus a fresh applicability judgment on whether CVE-2026-18798/63076/63072/14457 are genuinely non-applicable the way CVE-2026-14456 was) needs a security-informed reviewer decision, not a blind constant edit from me.

Recommended next step once actionable: bump to Node 24.20.0 for the sqlite/zlib/nghttp2 fixes, and track the 4 OpenSSL CVEs against the next Node 24.x point release that bundles OpenSSL ≥ 3.5.8. Note this same finding will very likely reproduce on #508's and #503's verify-patch-validator-image runs once those (currently in-progress) checks complete, since they scan the same Node 24.19.0 baseline.


Generated by Claude Code

claude added 2 commits August 30, 2026 10:09
…-registry-stream-bounds

Co-Authored-By: Claude <noreply@anthropic.com>
…gistry-stream-bounds

Co-Authored-By: Claude <noreply@anthropic.com>

# Conflicts:
#	scripts/lib/delegated-github-token.mjs
#	scripts/workflow-registry-live-audit.mjs
#	scripts/workflow-registry-live-disable.mjs
#	test/maintainer-app-token-capability.test.ts
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 0 new potential issues.

Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

Devin Review found 1 new potential issue.

Devin Review

Comment thread scripts/workflow-registry-disable-plan.mjs

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

Devin Review

Comment thread scripts/workflow-registry-live-disable.mjs
@seonghobae
seonghobae merged commit 5a7ca74 into main Aug 30, 2026
18 checks passed
@seonghobae
seonghobae deleted the fix/workflow-registry-stream-bounds branch August 30, 2026 16:38
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.

2 participants