Skip to content

feat(operations): run default-branch Maintainer App preflight - #62

Merged
seonghobae merged 44 commits into
mainfrom
feat/maintainer-app-preactivation-evidence
Aug 4, 2026
Merged

feat(operations): run default-branch Maintainer App preflight#62
seonghobae merged 44 commits into
mainfrom
feat/maintainer-app-preactivation-evidence

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add the default-branch-only maintainer-app-readiness repository_dispatch pre-activation workflow for the dedicated Maintainer GitHub App
  • mint a single-repository Maintainer token with explicit Actions/checks/contents/metadata/pull-request/status permissions and no administration permission
  • authenticate the existing Reviewer App with a separate Metadata-read-only token, bind NOEMA_REVIEWER_LOGIN to the action-authenticated app-slug and positive installation-id, and never expose the Reviewer token to scripts
  • audit live main governance, effective Maintainer identity/scope/permissions/API probes, disabled activation state, and the existing commercial-readiness loop in no-write mode
  • keep all retained preflight source files beneath ${RUNNER_TEMP}/noema-maintainer-app-readiness/, outside the checked-out repository tree, and upload only those exact absolute paths
  • canonicalize dry-run evidence through a reusable fail-closed normalizer before upload: one-mebibyte input/output bounds, fatal UTF-8 decoding, exact repository and apply=false schema, canonical UTC, unique decoded object keys, maximum 256-level JSON nesting, allowlisted fields, bounded result/reason data, full SHAs, and fixed dry_run_report_invalid replacement
  • close the artifact filesystem trust gap with runner-temporary path isolation, regular-file validation, O_RDONLY | O_NOFOLLOW, descriptor-to-path device/inode/size binding, exact-byte reads, unpredictable private same-filesystem temporary directories, exclusive mode-0600 writes, atomic rename, and rollback cleanup
  • reject duplicate object names before JavaScript can apply last-key-wins semantics, including literal/escaped-equivalent names, in line with RFC 8259 interoperability guidance
  • execute 100% production statement/branch/function/line coverage for both src/**/*.ts and the evidence normalizer; add realistic deterministic schema, UTF-8, JSON-grammar, duplicate-key, nesting, security, rollback, command-boundary, workflow-policy, and coverage-policy tests
  • cancel superseded ci and reviewer-ci runs in workflow-and-PR-specific concurrency groups, while pinning every external action in those workflows to an immutable full commit SHA
  • update authoritative APA 7th documentation and CHANGELOG.md, including the RFC 8259/WHATWG/Node.js fatal-decoding rationale in docs/doctoring/commercial-readiness-evidence-utf8-boundary.md

Dependency and lineage

Prerequisites already merged:

  1. feat(operations): validate Maintainer and Reviewer App evidence #60 — fail-closed Maintainer/Reviewer App evaluator and governance input hardening
  2. feat(operations): collect bounded Maintainer App readiness evidence #61 — bounded evidence collector and operations:preflight command

#59 was closed without merge after its review-trigger evidence became unusable. This PR supersedes it without reusing predecessor-PR or stale-head checks, comments, or approvals. The merge decision must be made only against the exact current head shown by GitHub.

Security and operational boundaries

  • repository_dispatch resolves workflow code only from the default branch; checkout is bound to event-time github.sha rather than a moving branch lookup
  • job-level GITHUB_TOKEN remains contents: read and is not a write fallback
  • both App-token actions are pinned by full commit SHA and scoped to ContextualWisdomLab/noema
  • the Maintainer token alone reaches governance, API-probe, and dry-run scripts
  • the Reviewer token value never reaches a script
  • the privileged job does not install repository dependencies or execute package lifecycle hooks
  • retained evidence never uses a checkout-relative source path; missing runner-temporary files fail artifact upload instead of falling back to the workspace
  • malformed UTF-8, malformed or duplicate-key JSON, excessive nesting, wrong repository, write-enabled mode, swapped or short reads, symlinks, and oversized evidence are replaced with bounded canonical failure evidence and cannot satisfy the final gate
  • failed token mints, identity mismatch, broadened scope, excess permission, stale governance, enabled maintenance, or dry-run failure remain explicit final-gate failures while bounded diagnostic artifacts are retained
  • the preflight never enables maintenance, dispatches a review, changes repository policy, or merges a pull request
  • a passing run proves only the scoped tokens and API/evidence observations for that run; complete App registration, key ownership/rotation, installation suspension, administrator bypass, and break-glass ownership remain independent operator evidence under chore(operations): provision and activate hourly maintainer App #29 and chore(governance): protect main and enforce release checks #27

Exact-head verification required before merge

The exact current head must independently satisfy ci, reviewer-ci, the central Security Scan, substantive CodeRabbit and organization-required OpenCode/Noema review evidence where repository policy requires them, zero unresolved review threads, branch protection, and every repository gate. Queued, pending, cancelled, stale-head, predecessor-PR, metadata-only, or self-approval evidence is not accepted.

Related: #59, #29, #27

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 256865b2-7816-4ad6-af34-9c36c458c3b9

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc520c and 6decdc9.

📒 Files selected for processing (18)
  • .github/workflows/ci.yml
  • .github/workflows/maintainer-app-readiness.yml
  • .github/workflows/reviewer-ci.yml
  • CHANGELOG.md
  • docs/doctoring/commercial-readiness-evidence-utf8-boundary.md
  • docs/maintainer-app-readiness-audit.md
  • package.json
  • scripts/normalize-commercial-readiness-evidence.mjs
  • test/commercial-readiness-evidence.test.ts
  • test/commercial-readiness-json-duplicates.test.ts
  • test/commercial-readiness-json-scan-performance.test.ts
  • test/commercial-readiness-utf8.test.ts
  • test/maintainer-app-readiness-workflow-hardening.test.ts
  • test/maintainer-app-readiness-workflow.test.ts
  • test/production-coverage-policy.test.ts
  • test/url-parser-defensive-branches.test.ts
  • test/workflow-concurrency-policy.test.ts
  • vitest.config.ts
📝 Walkthrough

Walkthrough

Maintainer App readiness 워크플로와 상업적 준비성 증거 정규화기가 추가되었습니다. 워크플로는 App 토큰, 감사, 드라이런, 증거 업로드를 실패-폐쇄 방식으로 처리합니다. CI 동시성, 액션 SHA 고정, 커버리지 정책도 강화되었습니다.

Changes

Readiness hardening

Layer / File(s) Summary
증거 정규화와 fail-closed 검증
scripts/normalize-commercial-readiness-evidence.mjs, test/commercial-readiness-*.test.ts, docs/doctoring/*
JSON 중복 키, malformed UTF-8, 스키마, 중첩 깊이, 파일 메타데이터를 검증합니다. 유효하지 않은 입력은 operational_error 또는 dry_run_report_invalid 증거로 대체합니다. 결과는 원자적으로 저장합니다.
Maintainer App readiness 게이트
.github/workflows/maintainer-app-readiness.yml, test/maintainer-app-readiness-*.test.ts, docs/maintainer-app-readiness-audit.md, CHANGELOG.md
기본 브랜치의 이벤트 커밋을 체크아웃하고 Maintainer·Reviewer App 토큰을 분리해 생성합니다. 감사, readiness 검사, 쓰기 금지 드라이런, 증거 정규화와 업로드를 실행합니다. 실패한 게이트는 최종 상태를 실패로 설정합니다.
CI 동시성 및 커버리지 정책
.github/workflows/ci.yml, .github/workflows/reviewer-ci.yml, package.json, vitest.config.ts, test/*policy.test.ts
동일 PR 또는 ref의 이전 실행을 취소합니다. 외부 액션을 커밋 SHA로 고정하고 checkout 자격 증명 저장을 비활성화합니다. 테스트 명령에 커버리지를 포함하고 정규화 스크립트와 100% 기준을 적용합니다.

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

Possibly related issues

Possibly related PRs

  • ContextualWisdomLab/noema#48 — Vitest 100% 커버리지 기준을 적용하며, 이번 변경은 증거 정규화 스크립트까지 커버리지 대상을 확장합니다.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant GitHubApps
  participant ReadinessChecks
  participant EvidenceNormalizer
  GitHubActions->>GitHubApps: Maintainer 및 Reviewer 설치 토큰 생성
  GitHubActions->>ReadinessChecks: 거버넌스와 readiness 검사 실행
  ReadinessChecks->>EvidenceNormalizer: 상업적 준비성 보고서 전달
  EvidenceNormalizer-->>GitHubActions: 정규화된 증거와 실패 상태 반환
  GitHubActions->>GitHubActions: 모든 사전 활성화 게이트 검증
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 70.00% which is insufficient. The required threshold is 80.00%. 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 제목은 기본 브랜치에서 Maintainer App 사전 점검을 실행하는 주요 변경 사항을 명확하게 요약합니다.
✨ 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 feat/maintainer-app-preactivation-evidence

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

@seonghobae seonghobae closed this Aug 4, 2026
@seonghobae seonghobae reopened this Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please run a full review against the exact current head f1a7d7fe648e4d6632ba8a1b1d93133d3745f818. The prior attempt was rate-limited and did not produce substantive review evidence.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@seonghobae I will run a full review of PR #62 against head f1a7d7fe648e4d6632ba8a1b1d93133d3745f818.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 33 minutes.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please perform a full review against the exact current head f1a7d7fe648e4d6632ba8a1b1d93133d3745f818. The prior request was rate-limited and produced no substantive review submission; do not reuse predecessor-PR or stale-head evidence.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@seonghobae I will perform a full review of #62 against f1a7d7fe648e4d6632ba8a1b1d93133d3745f818.

I will use evidence from this exact head only. I will not reuse evidence from #59 or any stale head.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 32 minutes.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please run a full review against the exact current head 52214a19685c94fac68b74acd8a92bd16df72757. Review the reusable dry-run evidence normalizer, canonical timestamp and symlink defenses, exact-PR workflow concurrency, immutable action pins, and 100% production coverage gate. Do not reuse findings or status from an earlier head.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

@seonghobae I will perform a full substantive review of PR #62 against exact head 157d51cd99aa0cc39cb898308000e082f7871ab6.

I will evaluate all changed files. I will assess the specified security boundaries, workflow controls, and 100% production coverage gate. I will use evidence from this exact head only.

✅ Action performed

Full review finished.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please independently review exact current head 157d51cd99aa0cc39cb898308000e082f7871ab6. Verify the complete 16-file Maintainer App pre-activation slice, including separate Maintainer/Reviewer identities, default-branch and event-bound workflow trust, runner-temporary evidence isolation, strict fatal UTF-8 decoding, duplicate decoded JSON-key rejection, bounded no-write schema, O_NOFOLLOW descriptor binding, atomic rollback, immutable action pins, exact-PR concurrency, and the 100% production statement/branch/function/line coverage contract. Submit APPROVE only after exact-head checks succeed and no actionable finding remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review exact current head 157d51cd99aa0cc39cb898308000e082f7871ab6 after its exact-head checks complete. Confirm the Maintainer App pre-activation workflow, Reviewer App identity separation, runner-temporary artifacts, fatal UTF-8 and duplicate-key evidence rejection, filesystem race defenses, exact-head merge policy, coverage enforcement, and CWL MSA governance boundaries remain fail-closed. Submit APPROVE only if no blocking finding remains.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (3)
scripts/normalize-commercial-readiness-evidence.mjs (1)

93-100: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

parseJsonPrimitive의 전체 나머지 문자열 복사를 제거하십시오.

text.slice(state.index)는 원시 토큰마다 남은 문자열 전체를 복사합니다. 1 MiB 문서가 숫자 토큰 수십만 개로 구성되면 스캔 비용이 입력 길이에 대해 제곱으로 증가합니다. sticky 정규식과 lastIndex를 사용하면 복사가 사라집니다.

♻️ 제안 수정
-const primitivePattern = /^(?:-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)/;
+const primitivePattern = /(?:-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null)/y;
 function parseJsonPrimitive(text, state) {
-  const match = primitivePattern.exec(text.slice(state.index));
-  if (!match) {
+  primitivePattern.lastIndex = state.index;
+  const match = primitivePattern.exec(text);
+  if (!match) {
     throw new SyntaxError(`Unexpected JSON token at character ${state.index}.`);
   }
   state.index += match[0].length;
   return false;
 }
🤖 Prompt for 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.

In `@scripts/normalize-commercial-readiness-evidence.mjs` around lines 93 - 100,
Update the parseJsonPrimitive function to eliminate the quadratic complexity
caused by text.slice. Convert primitivePattern to use the sticky regex flag
('y') so it anchors matches to a specific position, then set
primitivePattern.lastIndex to state.index before executing the match operation,
eliminating the text.slice call that copies the remaining string for each
primitive token.
test/maintainer-app-readiness-workflow-hardening.test.ts (1)

90-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

정규화기 상수는 소스 텍스트 대신 모듈 import로 단정하십시오.

이 세 단정은 scripts/normalize-commercial-readiness-evidence.mjs의 소스 문자열을 그대로 비교합니다. 공백, 숫자 구분자, 따옴표 스타일만 바뀌어도 동작 변화 없이 테스트가 실패합니다. MAX_REPORT_BYTES는 이미 export되어 있으므로 값으로 단정할 수 있습니다.

♻️ 제안 수정
-    expect(normalizer).toContain("export const MAX_REPORT_BYTES = 1_048_576;");
-    expect(normalizer).toContain('const EXPECTED_REPOSITORY = "ContextualWisdomLab/noema";');
-    expect(normalizer).toContain('code: "dry_run_report_invalid"');
+    expect(MAX_REPORT_BYTES).toBe(1_048_576);
+    const replaced = normalizeCommercialReadinessEvidence(Buffer.from("{"));
+    expect(replaced.valid).toBe(false);
+    expect(replaced.report.repository).toBe("ContextualWisdomLab/noema");
+    expect(replaced.report.results[0].reasons[0].code).toBe("dry_run_report_invalid");
 import { readFileSync } from "node:fs";
 import { describe, expect, it } from "vitest";
+import {
+  MAX_REPORT_BYTES,
+  normalizeCommercialReadinessEvidence,
+} from "../scripts/normalize-commercial-readiness-evidence.mjs";
🤖 Prompt for 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.

In `@test/maintainer-app-readiness-workflow-hardening.test.ts` around lines 90 -
92, The test assertions are checking for exact source code strings from the
normalize script, which makes the test brittle to formatting changes that don't
affect behavior. Since MAX_REPORT_BYTES is already exported from the module,
refactor the three expect assertions to import the actual exported constant
values and verify the values directly rather than searching for source text
patterns. This preserves the verification intent while making the test resilient
to code formatting, whitespace, and quote style changes.
.github/workflows/maintainer-app-readiness.yml (1)

114-117: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

실패 보고서의 repository 값을 정규화기의 기대값과 동일한 상수로 고정하십시오.

실패 보고서는 process.env.GITHUB_REPOSITORY를 사용합니다. scripts/normalize-commercial-readiness-evidence.mjsmain은 하드코딩된 EXPECTED_REPOSITORY만 비교합니다(529행). 두 값이 다르면 정규화기가 보고서를 폐기하고 maintainer_token_unavailable 또는 commercial_loop_failed 이유 코드를 일반 dry_run_report_invalid로 대체합니다. 진단 구분이 사라집니다. 현재 이 리포지터리에서는 두 값이 같으므로 동작하지만, 리포지터리 이름 변경이나 fork 실행에서 계약이 깨집니다.

또한 reasonCode 지역 변수와 호출자의 동일 이름 변수가 중복됩니다. 호출자에서 리터럴을 직접 전달하면 중복이 사라집니다.

♻️ 제안 수정
-            repository: process.env.GITHUB_REPOSITORY || "ContextualWisdomLab/noema",
+            repository: "ContextualWisdomLab/noema",
🤖 Prompt for 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.

In @.github/workflows/maintainer-app-readiness.yml around lines 114 - 117, The
repository field in the report object uses process.env.GITHUB_REPOSITORY with a
fallback, but the normalizer script in
scripts/normalize-commercial-readiness-evidence.mjs has a hardcoded
EXPECTED_REPOSITORY constant at line 529 that must match exactly. When these
values diverge due to repository rename or fork execution, the normalizer
discards valid reports and loses diagnostic reason codes. Fix by replacing the
process.env.GITHUB_REPOSITORY expression with the same hardcoded constant string
that the normalizer expects. Additionally, remove the reasonCode local variable
and pass the reason code literal directly to the caller to eliminate variable
name duplication.
🤖 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 `@docs/doctoring/commercial-readiness-evidence-utf8-boundary.md`:
- Line 17: Update the verification-contract sentence in the UTF-8 boundary
evidence document to match the actual companion test: the valid Korean and
punctuation text is placed in the allowlist-dropped `ignored` member, and the
normalized output must not preserve it. Remove the conflicting claim that the
text is in an allowlisted reason detail and requires exact preservation.

---

Nitpick comments:
In @.github/workflows/maintainer-app-readiness.yml:
- Around line 114-117: The repository field in the report object uses
process.env.GITHUB_REPOSITORY with a fallback, but the normalizer script in
scripts/normalize-commercial-readiness-evidence.mjs has a hardcoded
EXPECTED_REPOSITORY constant at line 529 that must match exactly. When these
values diverge due to repository rename or fork execution, the normalizer
discards valid reports and loses diagnostic reason codes. Fix by replacing the
process.env.GITHUB_REPOSITORY expression with the same hardcoded constant string
that the normalizer expects. Additionally, remove the reasonCode local variable
and pass the reason code literal directly to the caller to eliminate variable
name duplication.

In `@scripts/normalize-commercial-readiness-evidence.mjs`:
- Around line 93-100: Update the parseJsonPrimitive function to eliminate the
quadratic complexity caused by text.slice. Convert primitivePattern to use the
sticky regex flag ('y') so it anchors matches to a specific position, then set
primitivePattern.lastIndex to state.index before executing the match operation,
eliminating the text.slice call that copies the remaining string for each
primitive token.

In `@test/maintainer-app-readiness-workflow-hardening.test.ts`:
- Around line 90-92: The test assertions are checking for exact source code
strings from the normalize script, which makes the test brittle to formatting
changes that don't affect behavior. Since MAX_REPORT_BYTES is already exported
from the module, refactor the three expect assertions to import the actual
exported constant values and verify the values directly rather than searching
for source text patterns. This preserves the verification intent while making
the test resilient to code formatting, whitespace, and quote style changes.
🪄 Autofix

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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f1570d2c-4dad-474a-a9ed-3df95e5fb0bf

📥 Commits

Reviewing files that changed from the base of the PR and between 5cc520c and 8ad7410.

📒 Files selected for processing (16)
  • .github/workflows/ci.yml
  • .github/workflows/maintainer-app-readiness.yml
  • .github/workflows/reviewer-ci.yml
  • CHANGELOG.md
  • docs/doctoring/commercial-readiness-evidence-utf8-boundary.md
  • docs/maintainer-app-readiness-audit.md
  • package.json
  • scripts/normalize-commercial-readiness-evidence.mjs
  • test/commercial-readiness-evidence.test.ts
  • test/commercial-readiness-json-duplicates.test.ts
  • test/commercial-readiness-utf8.test.ts
  • test/maintainer-app-readiness-workflow-hardening.test.ts
  • test/maintainer-app-readiness-workflow.test.ts
  • test/production-coverage-policy.test.ts
  • test/workflow-concurrency-policy.test.ts
  • vitest.config.ts

Comment thread docs/doctoring/commercial-readiness-evidence-utf8-boundary.md

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please independently review exact current head 6decdc94d5e4b8421da12173dd770b7c8a987b7d. Verify the complete Maintainer App pre-activation slice and the new deterministic URL-parser fail-closed coverage, including separate Maintainer/Reviewer identities, event-bound default-branch workflow trust, runner-temporary evidence isolation, fatal UTF-8 and duplicate-key rejection, bounded no-write schema, O_NOFOLLOW descriptor binding, atomic rollback, immutable action pins, exact-PR concurrency, and the 100% production statement/branch/function/line coverage contract. Submit APPROVE only after exact-head checks succeed and no actionable finding remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review exact current head 6decdc94d5e4b8421da12173dd770b7c8a987b7d after its exact-head checks complete. Confirm the Maintainer App pre-activation workflow, Reviewer App identity separation, runner-temporary artifacts, fatal UTF-8 and duplicate-key evidence rejection, filesystem race defenses, exact-head merge policy, 100% production coverage enforcement, the new URL-parser fail-closed regression coverage, and CWL modular MSA governance boundaries remain fail-closed. Submit APPROVE only if no blocking finding remains.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review exact current head 6decdc94d5e4b8421da12173dd770b7c8a987b7d only. Re-check the six files changed since your prior reviewed head and submit substantive exact-head findings; do not reuse stale or predecessor-head conclusions.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='6decdc94d5e4b8421da12173dd770b7c8a987b7d'
base='157d51cd99aa0cc39cb898308000e082f7871ab6'

printf '%s\n' '== Checked-out commit =='
git rev-parse HEAD
printf '%s\n' '== Target commit =='
git show -s --format='%H%n%P%n%s' "$target"

printf '%s\n' '== Changed files and status =='
git diff --name-status "$base" "$target"
printf '%s\n' '== Changed-line summary =='
git diff --stat "$base" "$target"
printf '%s\n' '== Exact range diff =='
git diff --find-renames --find-copies --unified=80 "$base" "$target"

printf '%s\n' '== Candidate source outlines =='
git diff --name-only "$base" "$target" | while IFS= read -r f; do
  case "$f" in
    *.js|*.mjs|*.cjs|*.ts|*.tsx)
      printf '\n--- %s ---\n' "$f"
      ast-grep outline "$f" --items all --view compact || true
      ;;
  esac
done

Length of output: 28335


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='6decdc94d5e4b8421da12173dd770b7c8a987b7d'
base='157d51cd99aa0cc39cb898308000e082f7871ab6'

printf '%s\n' '== Ancestry and range verification =='
git merge-base --is-ancestor "$base" "$target" && echo 'base is an ancestor of target'
git diff --name-only "$base...$target"
git diff --name-only "$target^" "$target"

printf '%s\n' '== Normalizer symbol map =='
ast-grep outline scripts/normalize-commercial-readiness-evidence.mjs \
  --items all --view expanded

printf '%s\n' '== JSON scanner implementation =='
sed -n '1,260p' scripts/normalize-commercial-readiness-evidence.mjs

printf '%s\n' '== URL-parser symbol locations =='
rg -n -C 8 --glob '*.ts' \
  'function isTrustedGithubApiBase|const isTrustedGithubApiBase|function trustedClientIdentifier|const trustedClientIdentifier' \
  src test

printf '%s\n' '== Source module maps =='
fd -t f -e ts . src | while IFS= read -r f; do
  if rg -q 'isTrustedGithubApiBase|trustedClientIdentifier' "$f"; then
    printf '\n--- %s ---\n' "$f"
    ast-grep outline "$f" --items all --view expanded
  fi
done

printf '%s\n' '== Source implementations and workflow header =='
rg -n -C 35 --glob '*.ts' \
  'isTrustedGithubApiBase|trustedClientIdentifier' src
sed -n '1,240p' .github/workflows/maintainer-app-readiness.yml

printf '%s\n' '== Coverage configuration and policies =='
fd -t f 'vitest.config.ts' 'package.json' test | sort | while IFS= read -r f; do
  if [ "$f" = 'vitest.config.ts' ] || [ "$f" = 'package.json' ] || [[ "$f" == *coverage* ]]; then
    printf '\n--- %s ---\n' "$f"
    sed -n '1,240p' "$f"
  fi
done

Length of output: 38755


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Evidence normalization and filesystem boundary =='
sed -n '240,575p' scripts/normalize-commercial-readiness-evidence.mjs

printf '%s\n' '== Changed tests with line numbers =='
for f in \
  test/commercial-readiness-json-scan-performance.test.ts \
  test/maintainer-app-readiness-workflow-hardening.test.ts \
  test/url-parser-defensive-branches.test.ts
do
  printf '\n--- %s ---\n' "$f"
  nl -ba "$f"
done

printf '%s\n' '== Exact changed production lines with line numbers =='
for f in \
  .github/workflows/maintainer-app-readiness.yml \
  scripts/normalize-commercial-readiness-evidence.mjs
do
  printf '\n--- %s ---\n' "$f"
  git diff --unified=12 157d51cd99aa0cc39cb898308000e082f7871ab6 \
    6decdc94d5e4b8421da12173dd770b7c8a987b7d -- "$f"
done

printf '%s\n' '== Package and Vitest configuration =='
for f in package.json vitest.config.ts; do
  printf '\n--- %s ---\n' "$f"
  nl -ba "$f"
done

printf '%s\n' '== Coverage policy test =='
fd -t f 'production-coverage-policy.test.ts' . -x sh -c '
  for f do
    printf "\n--- %s ---\n" "$f"
    nl -ba "$f"
  done
' sh {} \;

Length of output: 11117


🏁 Script executed:

#!/bin/bash
set -euo pipefail

numbered() {
  awk '{ printf "%6d  %s\n", NR, $0 }' "$1"
}

printf '%s\n' '== Worktree and exact current commit =='
git rev-parse HEAD
git status --short

printf '%s\n' '== Changed tests with line numbers =='
for f in \
  test/commercial-readiness-json-scan-performance.test.ts \
  test/maintainer-app-readiness-workflow-hardening.test.ts \
  test/url-parser-defensive-branches.test.ts
do
  printf '\n--- %s ---\n' "$f"
  numbered "$f"
done

printf '%s\n' '== Production changes with current line numbers =='
for range in '100,145' '30,60'; do
  :
done
printf '\n--- .github/workflows/maintainer-app-readiness.yml ---\n'
awk 'NR >= 95 && NR <= 150 { printf "%6d  %s\n", NR, $0 }' .github/workflows/maintainer-app-readiness.yml
printf '\n--- scripts/normalize-commercial-readiness-evidence.mjs ---\n'
awk 'NR >= 25 && NR <= 110 { printf "%6d  %s\n", NR, $0 }' scripts/normalize-commercial-readiness-evidence.mjs

printf '%s\n' '== Package and Vitest configuration =='
for f in package.json vitest.config.ts; do
  printf '\n--- %s ---\n' "$f"
  numbered "$f"
done

printf '%s\n' '== Production coverage policy test =='
fd -t f 'production-coverage-policy.test.ts' . -x awk \
  '{ printf "%6d  %s\n", NR, $0 }' {}

printf '%s\n' '== References to URL-parser defensive coverage =='
rg -n -C 4 --glob '*.ts' \
  'isTrustedGithubApiBase|trustedClientIdentifier|URL parser defensive branches' test

Length of output: 28829


@seonghobae I reviewed exact head 6decdc94d5e4b8421da12173dd770b7c8a987b7d.

I verified that 157d51cd99aa0cc39cb898308000e082f7871ab6 is an ancestor of this head. The range contains five changed files. The target commit itself changes only the URL-parser defensive regression test.

I found no actionable findings in the changed files.

The review confirmed these controls:

  • The failure report uses the fixed ContextualWisdomLab/noema repository value.
  • The JSON primitive scanner avoids suffix copies and still rejects malformed or trailing input.
  • The evidence normalizer remains fail-closed for UTF-8, duplicate decoded keys, schema, timestamps, repository binding, apply: false, and descriptor metadata.
  • The new URL-parser tests cover parser failure and malformed IPv6 hostname output.
  • The production coverage configuration enforces 100% lines, branches, functions, and statements.

I did not execute repository tests because the review sandbox prohibits executing repository files.

✅ Action performed

Review finished.

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
Contributor Author

@coderabbitai review

Please perform a full substantive review against the exact current head 6decdc94d5e4b8421da12173dd770b7c8a987b7d. Re-evaluate all 18 changed files and current tests, including the post-review fixes for sticky primitive scanning, behavior-based normalizer assertions, repository-bound failure evidence, both dropped-field and allowlisted international UTF-8 cases, beginner-readable public docstrings, exact-PR workflow concurrency, immutable action pins, and the enforced 100% production statement/branch/function/line coverage. Do not reuse stale-head or predecessor-PR evidence.

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please independently review exact current head 6decdc94d5e4b8421da12173dd770b7c8a987b7d. Verify the complete 18-file Maintainer App pre-activation slice, including separate Maintainer/Reviewer identities, default-branch and event-bound workflow trust, runner-temporary evidence isolation, fatal UTF-8 handling, decoded-key duplicate rejection, bounded no-write schema, O_NOFOLLOW descriptor binding, atomic rollback, immutable action pins, exact-PR concurrency, beginner-readable public documentation, and the 100% production statement/branch/function/line coverage contract. Submit APPROVE only after exact-head checks succeed and no actionable finding remains.

Copy link
Copy Markdown
Contributor Author

@cwl-noema-review Please independently review exact current head 6decdc94d5e4b8421da12173dd770b7c8a987b7d after its exact-head checks. Confirm that the Maintainer App pre-activation workflow, Reviewer App identity separation, runner-temporary artifacts, fatal UTF-8 and duplicate-key evidence rejection, filesystem race defenses, fail-closed exact-head merge policy, full coverage enforcement, and CWL MSA governance boundaries remain defensible. Submit APPROVE only if no blocking finding remains.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='6decdc94d5e4b8421da12173dd770b7c8a987b7d'

printf '%s\n' '== Exact-head verification =='
printf 'HEAD: '
git rev-parse HEAD
printf 'Target: '
git rev-parse "$target"
git show -s --format='Commit: %H%nParents: %P%nSubject: %s' "$target"

printf '%s\n' '== PR merge base and changed files =='
base="$(git merge-base "$target" origin/main 2>/dev/null || git merge-base "$target" main)"
printf 'Base: %s\n' "$base"
git merge-base --is-ancestor "$base" "$target"
git diff --name-status "$base" "$target"
git diff --stat "$base" "$target"

printf '%s\n' '== Source outlines =='
git diff --name-only "$base" "$target" | while IFS= read -r file; do
  case "$file" in
    *.js|*.mjs|*.cjs|*.ts|*.tsx)
      printf '\n--- %s ---\n' "$file"
      ast-grep outline "$file" --items all --view compact || true
      ;;
  esac
done

printf '%s\n' '== Full exact-head diff =='
git diff --find-renames --find-copies --unified=55 "$base" "$target"

Length of output: 114719


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '%s\n' '== Workflow-called script locations =='
for name in main-governance-audit.mjs maintainer-app-readiness.mjs hourly-commercial-readiness.mjs; do
  fd -t f -a "$name" . -x sh -c '
    for file do
      printf "%s\n" "$file"
    done
  ' sh {} \;
done

printf '%s\n' '== Script outlines =='
for name in main-governance-audit.mjs maintainer-app-readiness.mjs hourly-commercial-readiness.mjs; do
  fd -t f -a "$name" . -x ast-grep outline {} --items all --view expanded \;
done

printf '%s\n' '== Workflow-called script contents =='
for name in main-governance-audit.mjs maintainer-app-readiness.mjs hourly-commercial-readiness.mjs; do
  fd -t f -a "$name" . -x sh -c '
    for file do
      printf "\n--- %s ---\n" "$file"
      nl -ba "$file"
    done
  ' sh {} \;
done

printf '%s\n' '== Write-capable calls and dry-run argument handling =='
rg -n -C 6 --glob '*.mjs' \
  '(?:--apply|process\.argv|argv|octokit|gh api|fetch\(|POST|PATCH|PUT|DELETE|merge|createPull|updatePull|GITHUB_TOKEN|GH_TOKEN)' \
  scripts

printf '%s\n' '== Relevant Worker implementations =='
rg -n -C 35 --glob '*.ts' \
  '\b(isTrustedGithubApiBase|trustedClientIdentifier)\b' src

printf '%s\n' '== Workflow static checks =='
python3 - <<'PY'
from pathlib import Path
import re

for path in [Path(".github/workflows/ci.yml"),
             Path(".github/workflows/reviewer-ci.yml"),
             Path(".github/workflows/maintainer-app-readiness.yml")]:
    text = path.read_text()
    print(f"\n--- {path} ---")
    refs = re.findall(r'^\s*uses:\s*([^\s#]+)', text, flags=re.M)
    print("actions:", *refs, sep="\n  ")
    for ref in refs:
        print(f"pinned {ref}: {bool(re.fullmatch(r'[^@]+@[0-9a-f]{40}', ref))}")
PY

printf '%s\n' '== Coverage configuration and package scripts =='
nl -ba package.json
nl -ba vitest.config.ts

Length of output: 9603


🏁 Script executed:

#!/bin/bash
set -euo pipefail

print_file() {
  file="$1"
  printf '\n--- %s ---\n' "$file"
  awk '{ printf "%6d  %s\n", NR, $0 }' "$file"
}

printf '%s\n' '== Workflow-called entrypoints =='
for file in \
  scripts/main-governance-audit.mjs \
  scripts/maintainer-app-readiness.mjs \
  scripts/hourly-commercial-readiness.mjs
do
  print_file "$file"
done

printf '%s\n' '== Commercial-loop evaluator write decision boundary =='
fd -t f -a 'commercial-readiness-loop.mjs' scripts -x sh -c '
  for file do
    printf "\n--- %s ---\n" "$file"
    awk "{ printf \"%6d  %s\\n\", NR, \$0 }" "$file"
  done
' sh {} \;

printf '%s\n' '== Readiness evaluation contract =='
fd -t f -a 'maintainer-app-readiness.mjs' scripts/lib -x sh -c '
  for file do
    printf "\n--- %s ---\n" "$file"
    awk "{ printf \"%6d  %s\\n\", NR, \$0 }" "$file"
  done
' sh {} \;

printf '%s\n' '== Action pins and coverage policy =='
python3 - <<'PY'
from pathlib import Path
import re
for path in map(Path, [
    ".github/workflows/ci.yml",
    ".github/workflows/reviewer-ci.yml",
    ".github/workflows/maintainer-app-readiness.yml",
]):
    text = path.read_text()
    refs = re.findall(r'^\s*uses:\s*([^\s#]+)', text, flags=re.M)
    print(f"{path}:")
    for ref in refs:
        print(f"  {ref} pinned={bool(re.fullmatch(r'[^@]+@[0-9a-f]{40}', ref))}")
PY
awk '{ printf "%6d  %s\n", NR, $0 }' package.json
awk '{ printf "%6d  %s\n", NR, $0 }' vitest.config.ts

printf '%s\n' '== Worker defensive functions =='
rg -n -C 30 --glob '*.ts' \
  '\b(isTrustedGithubApiBase|trustedClientIdentifier)\b' src

Length of output: 93468


🏁 Script executed:

#!/bin/bash
set -euo pipefail

target='6decdc94d5e4b8421da12173dd770b7c8a987b7d'
base='5cc520cce23e9bef090cfbe0a668909e3594ed33'

printf '%s\n' '== Exact-range whitespace check =='
git diff --check "$base" "$target"

printf '%s\n' '== YAML syntax check =='
python3 - <<'PY'
from pathlib import Path
try:
    import yaml
except ImportError as error:
    print(f"PyYAML unavailable: {error}")
else:
    for name in (
        ".github/workflows/ci.yml",
        ".github/workflows/reviewer-ci.yml",
        ".github/workflows/maintainer-app-readiness.yml",
    ):
        value = yaml.safe_load(Path(name).read_text())
        print(f"{name}: top-level keys={sorted(map(str, value.keys()))}")
        print(f"{name}: jobs={sorted(value.get('jobs', {}).keys())}")
PY

printf '%s\n' '== Production coverage source inventory =='
printf '%s\n' 'Worker sources:'
fd -t f -e ts . src | sort
printf '%s\n' 'Normalizer imports and focused tests:'
rg -n -C 2 --glob '*.ts' \
  'normalizeCommercialReadinessEvidence|hasDuplicateJsonObjectKeys|readBoundedReport|writeAtomically|runAsCommand|isBoundedRegularEvidence' \
  test

printf '%s\n' '== Changed-file line counts =='
git diff --numstat "$base" "$target"

printf '%s\n' '== Current worktree state =='
git rev-parse HEAD
git status --short

Length of output: 14689


@seonghobae I completed a full static review of exact head 6decdc94d5e4b8421da12173dd770b7c8a987b7d.

I reviewed the 18-file range from merge base 5cc520cce23e9bef090cfbe0a668909e3594ed33. I found no actionable findings.

The review confirmed:

  • The Maintainer and Reviewer App token mints use separate credentials and scopes.
  • The Reviewer token is not exposed to repository scripts.
  • The workflow checks out the event-bound github.sha and disables persisted checkout credentials.
  • The commercial loop remains no-write without --apply. Dispatch and merge calls are guarded by apply.
  • Failure evidence is repository-bound and is normalized before upload.
  • The normalizer rejects malformed UTF-8, duplicate decoded JSON keys, unsafe schema values, noncanonical timestamps, wrong repositories, and apply: true.
  • The file reader uses O_NOFOLLOW and compares descriptor metadata to pre-open metadata.
  • Atomic replacement uses a private temporary directory and an atomic rename.
  • CI and reviewer CI concurrency groups isolate pull requests by pull request number.
  • All reviewed external actions use 40-character commit SHA pins.
  • Coverage includes src/**/*.ts and scripts/normalize-commercial-readiness-evidence.mjs, with 100% thresholds for statements, branches, functions, and lines.
  • The focused tests cover primitive scanner behavior, both UTF-8 cases, duplicate keys, filesystem defenses, workflow policy, and defensive URL-parser branches.

git diff --check completed without errors. I did not execute repository code or tests. YAML parser verification was inconclusive because PyYAML is unavailable in the sandbox.

✅ Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 37 minutes.

Copy link
Copy Markdown
Contributor Author

Merge remains fail-closed on exact head 6decdc94d5e4b8421da12173dd770b7c8a987b7d. ci, reviewer-ci, and the central Security Scan are successful; CodeRabbit's exact-head incremental review reported no actionable findings; all inline review threads are resolved. The remaining gate is an independent APPROVE on this exact head. OpenCode and Noema review mentions are pending. A direct GitHub review-request attempt for opencode-agent and cwl-noema-review was rejected with HTTP 422 because one or more accounts are not repository collaborators, so this gate cannot be satisfied autonomously without an eligible independent reviewer or collaborator/installation configuration change. No protection was bypassed and no merge was attempted.

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