fix: fail closed on missing review timestamps - #175
Conversation
|
Important Review skippedNo new commits to review since the last review. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughИзменена функция ChangesИсправление parseTime
Estimated code review effort: 1 (Trivial) | ~3 минуты Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review Exact head: 50becc0 |
PR Summary by QodoFail closed when AI-review timestamps are missing or blank
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
gh pr view 175 --repo safal207/robys-coffee-house-demo --json headRefOid,title,files --jq '.headRefOid, .title'
echo "---"
gh api repos/safal207/robys-coffee-house-demo/pulls/175/files --jq '.[].filename'Length of output: 502 🏁 Script executed: #!/bin/bash
set -euo pipefail
gh api repos/safal207/robys-coffee-house-demo/contents/scripts/verify-ai-review-contract.cjs?ref=50becc089f1ba17f6fcc8cec0c5ee2260208ffe6 --jq '.content' | base64 -d > /tmp/verify.cjs
wc -l /tmp/verify.cjs
grep -n "parseTime" -A 15 /tmp/verify.cjsLength of output: 1748
function parseTime(value) {
if (typeof value !== "string" || value.trim() === "") return 0;
const parsed = Date.parse(value);
return Number.isFinite(parsed) ? parsed : 0;
}Соответствует всем пунктам correction:
Дефект с ✅ Action performedReview finished.
|
🚦 Roby’s Lighthouse contractMobile
Hard assertions: ✅ · Regression: ✅ Desktop
Hard assertions: ✅ · Regression: ✅ D.1 runs in observability mode. The final gate is enabled only after the reviewed baseline commit. |
|
Trust-Update-Exception: BOOTSTRAP_NOT_ON_DEFAULT_BRANCH This one-file PR patches the trusted verifier itself. The current default-branch AI workflow is the legacy inline gate and cannot validate the new verifier bytes before they are merged. Independent exact-head CodeRabbit status is successful, no review threads are open, and all ordinary exact-head security, browser, visual, performance, runtime, traceability, reviewdog, and route-preflight checks are green. Product PR #173 remains blocked until it pins and executes the immutable merge SHA produced by this trust patch. |
|
Head: 50becc0
Overall conclusion: READY_WITH_ADVISORY_GAPS All ordinary exact-head CI is green. The remaining legacy AI workflow gap is explicitly classified as |
|
Proof-Depth-Seal: PDG-001 |
|
/merge-ready 50becc0 |
Summary
Harden the trusted AI-review verifier so absent or malformed timestamp values fail closed.
This PR changes exactly one helper in one file:
scripts/verify-ai-review-contract.cjsFinding
Date.parse(value ?? 0)is unsafe for missing timestamps because Node/V8 may parse the coerced string"0"as a valid date instead of returningNaN. A missingcreated_atcould therefore produce a nonzero freshness anchor and silently widen the accepted evidence window.Correction
parseTimenow:0for non-string values;0for empty or whitespace-only strings;Date.parseonly for a non-empty string;All reviewer identities, request ordering, exact-head binding, submitted-review guards, status context, permission handling, retries, and timeout behavior remain unchanged.
Trust boundary
This patch must be merged into
mainbefore product PR #173 is updated. PR #173 will then:PRRT_kwDOS-8ZNM6OsEnkonly after the trusted patch is active.Scope
No product, CSS, service-worker, visual, generated, or integrity-manifest files are changed.
Checklist
0beforeDate.parse.