Skip to content

fix(criterion): reject future-dated performance evidence - #72

Draft
seonghobae wants to merge 9 commits into
developfrom
fix/criterion-observation-chronology
Draft

fix(criterion): reject future-dated performance evidence#72
seonghobae wants to merge 9 commits into
developfrom
fix/criterion-observation-chronology

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Scope

Hardens criterion-observation chronology without rewriting the already-installed 0011 migration or replacing its trigger binding. Valid delta to preserve: 0014_criterion_observation_chronology.sql rejects impossible recorded-before-observed/future chronology, 0015_criterion_observation_statement_default.sql uses PostgreSQL statement time for omitted recorded_from, and the PostgreSQL contract covers the long-transaction boundary.

Live authority correction

Exact feature head remains a8ddab514ebf5e09c44186862884b4b9b4e6f4dd. The PR is open · Draft and GitHub reports it non-mergeable. Its recorded develop-era base is 9e3e4847510e1e612b48474ba42b177b8ed824df, while live protected develop is eb9757f8649aaad026a9865508d9aad50c1a7a4f through #161 repository-quality consolidation.

Fresh ancestry inspection shows protected 9e3e484... → eb9757f... is only three commits, but it materially overlaps this feature in exactly the surfaces that must be reconciled rather than chosen wholesale: protected #161 removes .github/workflows/criterion-temporal-quality.yml, modifies canonical .github/workflows/foundation-ci.yml, adds its consolidation entry to CHANGELOG.md, rebuilds manifest.json, and removes the retired job-analysis-api-quality.yml requirement from both scripts/foundation-contract-core.mjs and tests/validate_repository.py. The chronology migrations, ADR 0009, docs/TRACEABILITY.md, and tests/test_criterion_observation_scope_postgres.sh are not changed by the protected-parent delta and therefore remain preservable feature evidence.

Historical exact-head acceptance on a8ddab51... remains useful predecessor evidence: Foundation 33268250168, Criterion Temporal Quality 33268250121, Recovery 33268250146, SAST 33268250134, Job-Analysis API 33268250166, Selection Review 33268250154, and Requisition Review 33268250160 were terminal SUCCESS. Security 33268250126 failed. These runs predate protected #161 and cannot be transferred to a reconciled successor.

All currently visible inline review findings are resolved. The valid repair chain includes: sequential 0014 instead of rewriting installed 0011; explicit rejection of future observed_at; explicit rejection of future recorded_from; and 0015 statement-time default so a long transaction can still record a newly observed event without weakening explicit chronology validation.

Required repair path

This is a repair finding, not a close candidate. Build the successor tree from current protected truth without force/destructive rebase and preserve the chronology migrations/tests/ADR/traceability semantics. Reconciliation must:

  • keep the retired .github/workflows/criterion-temporal-quality.yml deleted and use canonical Foundation CI's isolated PostgreSQL contract path;
  • preserve both new migrations and the upgraded tests/test_criterion_observation_scope_postgres.sh, including trigger-binding, future-observation, future-recording, UTC/system-time and long-transaction regressions;
  • merge the chronology CHANGELOG text with fix(ci): use explicit Ubuntu 24.04 runners #161's repository-workflow consolidation entry instead of choosing either side;
  • add 0014 and 0015 to both canonical Python/Node required-file inventories while preserving fix(ci): use explicit Ubuntu 24.04 runners #161's removal of the retired job-analysis leaf workflow requirement;
  • regenerate manifest.json from the final bytes rather than reusing either predecessor manifest;
  • keep ADR 0009 and TRACEABILITY code-current without prematurely describing the feature as protected truth.

Only after that semantic tree is created should the branch obtain fresh exact-head Foundation/PostgreSQL/security/review evidence. Do not reuse predecessor GREEN, self-approve, use administrative bypass, weaken chronology constraints, drop historical-evidence semantics, resurrect package-local CI, force-push/destructively rebase, or simply Close the valid delta.

@coderabbitai

coderabbitai Bot commented Aug 21, 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: e7ab8304-8f59-4504-989d-74886e38ae23

📥 Commits

Reviewing files that changed from the base of the PR and between 9e3e484 and 90cdb78.

📒 Files selected for processing (6)
  • .github/workflows/criterion-temporal-quality.yml
  • CHANGELOG.md
  • database/migrations/0011_criterion_observation_scope.sql
  • docs/TRACEABILITY.md
  • docs/adr/0009-performance-criterion-observation-scope.md
  • manifest.json

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


📝 Walkthrough

Walkthrough

criterion observation 트리거가 recorded_from < observed_at 조건을 거부합니다. PostgreSQL 품질 워크플로가 정확한 오류를 검증합니다. 추적성 문서, ADR, 변경 로그 및 manifest가 갱신됩니다.

Changes

Criterion observation chronology

Layer / File(s) Summary
Chronology validation contract
database/migrations/0011_criterion_observation_scope.sql, docs/adr/0009-performance-criterion-observation-scope.md
enforce_criterion_observation_scope()recorded_from < observed_at일 때 23514 오류를 발생시킵니다. ADR이 이 계약과 검증 절차를 기록합니다.
Workflow rejection test
.github/workflows/criterion-temporal-quality.yml, docs/TRACEABILITY.md
품질 워크플로가 잘못된 chronology 삽입을 실행하고 지정된 오류 메시지를 확인합니다. 추적성 행이 새 검증과 active PR 상태를 반영합니다.
Project records and integrity metadata
CHANGELOG.md, manifest.json
변경 로그가 chronology guard를 기록합니다. manifest가 변경된 파일의 해시, 바이트 수 및 줄 수를 갱신합니다.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 90cdb

The trigger now rejects criterion observations recorded before their observation time, preventing future-dated performance evidence from being accepted. No actionable merge-blocking risk remains after normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant QualityWorkflow
  participant PostgreSQL
  participant ObservationTrigger
  QualityWorkflow->>PostgreSQL: criterion_observation INSERT 실행
  PostgreSQL->>ObservationTrigger: enforce_criterion_observation_scope 호출
  ObservationTrigger-->>PostgreSQL: 지정 오류 메시지와 함께 23514 반환
  PostgreSQL-->>QualityWorkflow: 실패 출력 반환
  QualityWorkflow->>QualityWorkflow: 오류 메시지 검증
Loading

Suggested reviewers: cursoragent

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 제목은 recorded_fromobserved_at보다 이른 성과 증거를 거부하는 주요 변경 사항을 간결하게 설명합니다. 변경 범위와 직접 관련됩니다.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/criterion-observation-chronology

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.

@seonghobae
seonghobae marked this pull request as ready for review August 21, 2026 22:58

@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: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please review the current unchanged head against protected develop. Local exact-head verification: all owned package suites pass at 100% statement/branch coverage.

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[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.

Devin Review found 2 new potential issues.

Devin Review

Comment thread database/migrations/0014_criterion_observation_chronology.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant