Skip to content

feat(operations): audit external scheduler continuation evidence - #97

Open
seonghobae wants to merge 24 commits into
mainfrom
feat/external-scheduler-evidence-audit
Open

feat(operations): audit external scheduler continuation evidence#97
seonghobae wants to merge 24 commits into
mainfrom
feat/external-scheduler-evidence-audit

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Purpose

Turn issue #96's external hourly-scheduler control-plane gap into repository-owned, fail-closed, executable evidence validation. This PR validates retained evidence bytes and exposes an operator command; it does not operate the provider-side scheduler.

Current exact identity

  • protected base: main at c85d710804139c0697d7ef8fa47d02b1389e6d84;
  • head branch: feat/external-scheduler-evidence-audit;
  • exact current head: a84d490c1f6596a49d4f29c41babf4996f9ad86f;
  • current head is mergeable and Ready for review;
  • requested reviewers: none because the historically tested bot-looking routes remain ineligible/unprovisioned under chore(operations): provision and activate hourly maintainer App #29; no reviewer is invented merely to manufacture a request.

Test-first and review-hardening lineage

The implementation was developed through explicit RED boundaries for schema/operator absence, production coverage, and CLI safety/testability. CodeRabbit subsequently identified valid current defects around duplicate decoded JSON keys, failed-report data retention, camelCase/credential aliases, resumed-action identity binding, and materially-distinct action semantics. Those inline findings are now addressed/resolved on the current lineage.

The latest exact-head correction, a84d490c1f6596a49d4f29c41babf4996f9ad86f (fix(operations): fail closed without no-follow opens), removes the permissive 0 fallback for O_NOFOLLOW: platforms that cannot provide a real no-follow file-open flag now fail closed rather than silently weakening the evidence-file boundary.

Current exact-head technical evidence

For unchanged head a84d490c1f6596a49d4f29c41babf4996f9ad86f:

  • application ci run 31389470222: terminal success;
  • reviewer-ci run 31389470263: terminal success;
  • central Security Scan run 31389470311: terminal success under its scanner/revision semantics;
  • current CodeRabbit formal review is COMMENTED and was submitted against predecessor head 53df217b980616916b6f3d85d0aaf4b8942c5e36, not a qualifying independent approval;
  • all five current inline CodeRabbit review threads are resolved; resolved/outdated predecessor findings do not become approval authority.

Technical CI/reviewer/scanner success remains separate from formal review, live ruleset authority, operational scheduler evidence, release/deployment acceptance, and acquisition evidence.

Implemented evidence boundary

  • exact repository/task/prompt/protected-main identity validation;
  • canonical scheduler-time and generic-error-recovery evidence validation;
  • work-conserving continuation, deferred-lane, normal double-exit-sweep or explicit invocation-budget evidence;
  • recursive sensitive-field rejection including credential aliases;
  • duplicate decoded JSON-key and malformed UTF-8 rejection before JSON values become evidence;
  • generic-error resumed-action identity binding to an actually retained GitHub action;
  • materially-distinct action requirements only when at least two safe lanes exist;
  • bounded regular-file reads and atomic private report publication;
  • no-follow file opens fail closed when the platform cannot provide the required primitive;
  • failed validation reports retain derived checks/failure codes rather than copying untrusted evidence values.

npm run operations:external-scheduler-evidence -- <evidence.json> remains the repository-owned operator interface. The retained report is evidence only and cannot satisfy GitHub checks, formal approval, merge, release, deployment, or acquisition authority.

Documentation / architecture boundary

PR #71 remains the single canonical whole-product PRD/TRD/Architecture/ADR/UML/ERD/Traceability authority. This PR adds the missing executable operational evidence contract rather than a parallel architecture graph. No physical relational ERD is asserted for this JSON evidence boundary.

Provider-side acceptance still owned by #96

This PR does not prove live provider configuration. Issue #96 still requires independently retained evidence for one enabled hourly task identity/configuration, prompt digest, duplicate disablement, generic-error recovery, work-conserving execution receipts, writer-safety refetches, and two clean fresh exit sweeps or a concrete practical invocation-budget boundary.

Acquisition / merge boundary

Noema still lacks real production KPI/provenance, immutable release-publication and deployment/attestation evidence, production environment governance, revenue/customer evidence, and legal/transfer/IP evidence required by the final acquisition gate. No outbound license is chosen here.

Merge remains fail closed on actual live #27 governance and a qualifying independent non-author formal-review path under #29 where required. No self-approval, protection weakening, synthetic status, repair/self-modifying workflow, version bump, release, deployment, licensing decision, or acquisition-ready claim is made.

Related: #27, #29, #71, #80, #96

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

외부 스케줄러 증거 감사 문서와 평가기를 추가했다. CLI는 입력 파일을 fail-closed로 검증하고, PASS 또는 FAIL 보고서를 권한 제한 임시 파일에서 원자적으로 게시한다. 테스트와 커버리지 설정도 새 도구를 대상으로 갱신했다.

Changes

외부 스케줄러 감사

Layer / File(s) Summary
증거 계약과 운영 범위
docs/external-hourly-scheduler-evidence-audit.md, CHANGELOG.md
증거 스키마, 오류 복구, 안전·지연 레인, 종료 스윕, 금지 필드 및 감사 결과의 범위를 문서화했다.
증거 평가 규칙
scripts/lib/external-scheduler-evidence-audit.mjs, test/external-scheduler-evidence-audit.test.ts, test/external-scheduler-evidence-defensive-branches.test.ts
식별자, 해시, UTC 시간 순서, 오류 복구, GitHub 작업, 중복 작업, 지연 사유, 종료 조건 및 민감 필드를 검사하고 PASS 또는 FAIL을 반환한다.
CLI 입력과 원자적 보고서
scripts/external-scheduler-evidence-audit.mjs, package.json, test/external-scheduler-evidence-cli.test.ts, test/external-scheduler-evidence-cli-defaults.test.ts
CLI가 regular file, 크기, UTF-8, JSON 및 최종 symlink를 검증한다. 보고서는 권한 제한 임시 파일에서 원자적으로 게시한다. 실패 시 종료 코드 1을 반환한다.
커버리지 검증 연결
vitest.config.ts, test/production-coverage-policy.test.ts
새 감사 평가기와 CLI를 Vitest 커버리지 대상 및 생산 커버리지 정책에 추가했다.

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

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 제목은 외부 스케줄러의 실행 지속 증거를 감사하는 PR의 주요 변경 사항을 정확하고 간결하게 설명합니다.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/external-scheduler-evidence-audit

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.

@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: 5

🧹 Nitpick comments (1)
docs/external-hourly-scheduler-evidence-audit.md (1)

1-137: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

운영 설명을 한국어로 작성하십시오.

이 파일은 운영 증거 계약과 운영자 명령을 설명합니다. 현재 설명 문단이 영어입니다. 코드 블록과 고정 식별자는 유지하고, 운영 설명은 한국어로 번역하십시오.

As per coding guidelines, docs/**/*.{md,mdx}: Keep documentation in the language appropriate to the document; the operational and sales/acquisition documentation is largely Korean.

🤖 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 `@docs/external-hourly-scheduler-evidence-audit.md` around lines 1 - 137,
Translate the prose in external-hourly-scheduler-evidence.md into Korean,
including headings, explanatory paragraphs, contract descriptions,
interpretation, sufficiency, and references where appropriate. Preserve all code
blocks, JSON, shell commands, fixed identifiers, field names, enum values, URLs,
and exact contract literals unchanged. Keep the document’s operational meaning
and structure intact while ensuring the operational and acquisition-related
narrative is Korean.

Source: Coding guidelines

🤖 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 `@scripts/external-scheduler-evidence-audit.mjs`:
- Around line 150-154: Update createValidationReport() so FAIL reports retain
only derived checks and failure codes, removing copied evidence fields such as
scheduler_task_identity, prompt_sha256, protected_main_sha, scheduled_at, and
started_at; add a regression test proving sensitive values in failed evidence
are absent from the generated report.
- Around line 81-82: Replace the direct JSON.parse(text) path after
fatalUtf8Decoder.decode(bytes) with a duplicate-key-aware parser or scanner that
detects decoded duplicate keys within each object before constructing the JSON
result. Reject the evidence when any object contains a duplicate key, including
nested objects, while preserving valid arrays and uniquely keyed objects.

In `@scripts/lib/external-scheduler-evidence-audit.mjs`:
- Line 8: Update FORBIDDEN_FIELD_PATTERN validation to normalize field names
from camelCase to snake_case before matching, so accessToken, clientSecret,
privateKey, and hiddenReasoning are rejected. Extend the forbidden patterns to
include api_key and common credential aliases, while preserving rejection of
existing sensitive fields. Add regression tests covering these camelCase and
alias cases.
- Around line 205-210: Update the generic_error_resumed_action_missing
validation to require resumed_action_identity to match an action_identity from
github_actions_performed when generic_error_observed is true, while preserving
the existing format validation. Add a regression test covering evidence with a
non-existent resumed action identity and assert that it is rejected.
- Around line 261-270: Update the materiallyDistinct validation in the external
scheduler evidence audit so the action-kind diversity requirement applies only
when at least two safe lanes are present. When there is one safe lane, allow
multiple actions with the same action_kind to pass; preserve the existing
requirement for two or more safe lanes and the current failure message behavior.

---

Nitpick comments:
In `@docs/external-hourly-scheduler-evidence-audit.md`:
- Around line 1-137: Translate the prose in
external-hourly-scheduler-evidence.md into Korean, including headings,
explanatory paragraphs, contract descriptions, interpretation, sufficiency, and
references where appropriate. Preserve all code blocks, JSON, shell commands,
fixed identifiers, field names, enum values, URLs, and exact contract literals
unchanged. Keep the document’s operational meaning and structure intact while
ensuring the operational and acquisition-related narrative is Korean.
🪄 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: 1b942988-ed36-4f46-b7a4-2a202fe4276d

📥 Commits

Reviewing files that changed from the base of the PR and between c85d710 and 53df217.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • docs/external-hourly-scheduler-evidence-audit.md
  • package.json
  • scripts/external-scheduler-evidence-audit.mjs
  • scripts/lib/external-scheduler-evidence-audit.mjs
  • test/external-scheduler-evidence-audit.test.ts
  • test/external-scheduler-evidence-cli-defaults.test.ts
  • test/external-scheduler-evidence-cli.test.ts
  • test/external-scheduler-evidence-defensive-branches.test.ts
  • test/production-coverage-policy.test.ts
  • vitest.config.ts

Comment thread scripts/external-scheduler-evidence-audit.mjs
Comment thread scripts/external-scheduler-evidence-audit.mjs Outdated
Comment thread scripts/lib/external-scheduler-evidence-audit.mjs Outdated
Comment thread scripts/lib/external-scheduler-evidence-audit.mjs
Comment thread scripts/lib/external-scheduler-evidence-audit.mjs Outdated
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