Skip to content

feat(result): persist PostgreSQL immutable snapshots - #51

Merged
seonghobae merged 18 commits into
mainfrom
feat/result-snapshot-persistence-20260813
Aug 16, 2026
Merged

feat(result): persist PostgreSQL immutable snapshots#51
seonghobae merged 18 commits into
mainfrom
feat/result-snapshot-persistence-20260813

Conversation

@seonghobae

Copy link
Copy Markdown
Contributor

Why

Open PRs #43#50 remain merge-blocked on queued org workflows and missing independent review. ROADMAP Continuous rank 1 is the unfinished participant journey; result persistence is the next independent buyer-gap after in-flight instrument (#50), item-delivery (#48), consent (#49), session-bind (#47), data-rights (#46), and digest (#44/#43) slices.

What

  • migrations/0007_result_snapshot.sql for immutable result_snapshot and result_snapshot_observation
  • src/postgres_result_snapshot.rs persists a domain ResultSnapshot under READ COMMITTED
  • Exact replay, fail-closed identity/observation rebinding, supersession without predecessor mutation
  • TRACEABILITY/ERD/AS_BUILT/CHANGELOG updated. HTTP result transport stays Target.

Does not overlap #43/#44/#46/#47/#48/#49/#50. Does not recreate fast-mlsirm kernels.

Test plan

  • TEST_DATABASE_URL persistence + schema + error-contract tests
  • cargo clippy --all-targets -- -Dwarnings
  • cargo fmt --all -- --check
  • Exact-head required Checks after open

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 55 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: eb8afe20-d957-4c4a-aae8-f55b30f2bbee

📥 Commits

Reviewing files that changed from the base of the PR and between cc5850a and c2ecc8b.

📒 Files selected for processing (7)
  • migrations/0007_result_snapshot.sql
  • src/lib.rs
  • src/postgres_result_snapshot.rs
  • tests/postgres_result_snapshot_error_contract.rs
  • tests/postgres_result_snapshot_immutability.rs
  • tests/postgres_result_snapshot_persistence.rs
  • tests/postgres_result_snapshot_schema_constraints.rs

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.

Store one copied result-snapshot identity plus construct-level
observations under READ COMMITTED, with exact replay and fail-closed
identity rebinding. Psychometric values stay referenced, not recomputed.
CI line coverage failed at 3756/3757 because replay only hid the
header SELECT error. Drop the observation relation after insert so
persist_result_snapshot reaches the observation SELECT question-mark.
@seonghobae
seonghobae force-pushed the feat/result-snapshot-persistence-20260813 branch from a61ce8c to 65dc31a Compare August 13, 2026 19:55
Fold landed consent-ownership authorization into Implemented and keep
**Active PR** #51 as the named result-snapshot persistence slice, not protected-main truth.
# Conflicts:
#	CHANGELOG.md
#	docs/TRACEABILITY.md
Treat landed PostgreSQL readiness as Implemented and keep #51 as the
Active persist slice.
Treat landed migration rollback coverage as Implemented and keep #51
as the Active persist slice.
Carry only the result-snapshot migration, adapter, and PostgreSQL contracts across the current protected-main tree. Preserve protected-main documentation and newer persistence modules while adding the result persistence module.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please perform a bounded independent current-head review of 494dbc5d8d4dffbf58b9805161f12b8c25e243d9 against main and the repository's current ruleset. Do not update the branch or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please perform a bounded independent current-head review of 494dbc5d8d4dffbf58b9805161f12b8c25e243d9 against protected main cc5850a0d1eacbbf16d03075534fce460a8286e6 and the repository's current ruleset. Do not update the branch or merge.

Copy link
Copy Markdown
Contributor Author

@opencode-agent

Please perform a bounded independent current-head review of 665d93de9ec608416b1f46076f4208fb5bd29b49 against protected main cc5850a0d1eacbbf16d03075534fce460a8286e6. Exact-head Runtime CI, Security Scan, SAST Semgrep, coverage-evidence, and the required OpenCode workflow check are successful. Do not update the branch or merge.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 665d93de9ec608416b1f46076f4208fb5bd29b49.

  • Head SHA: 665d93de9ec608416b1f46076f4208fb5bd29b49

  • Workflow run: 31817234092

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test (3 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (3 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent

opencode-agent Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

OpenCode Review Overview

  • Head SHA: c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098
  • Workflow run: 31897761305
  • Workflow attempt: 1
  • Gate result: REQUEST_CHANGES (approval step)

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098.

  • Head SHA: c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098

  • Workflow run: 31897761305

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test (4 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (4 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head 47d724868ef99061c96d6b4e2f5c857de391b212.

  • Head SHA: 47d724868ef99061c96d6b4e2f5c857de391b212

  • Workflow run: 31856097966

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test (4 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (4 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098.

  • Head SHA: c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098

  • Workflow run: 31894350529

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test (4 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (4 files)"]
  R2 --> V2["targeted test run"]
Loading

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

OpenCode cannot approve yet because required coverage evidence did not pass.

Review outcome

1. HIGH .github/workflows/opencode-review.yml:1 - Coverage evidence did not prove required test/docstring evidence

  • Problem: The required coverage-evidence job result was failure, so OpenCode cannot establish approval sufficiency for this head.

  • Root cause: Automated approval is only valid when the same-head coverage-evidence job proves supported repository test suites passed and configured docstring gates passed or were advisory, or reports not applicable because no supported source files or package manifests exist. Missing, failed, skipped, unavailable, or unsupported-tooling test evidence is a blocker.

  • Fix: Install or configure the repository test/docstring evidence tooling when source files or package manifests exist, rerun the current-head coverage-evidence job, and approve only after it reports success with required evidence or explicit no-source not-applicable evidence.

  • Regression test: Keep the approval branch checking needs.coverage-evidence.result == success before posting APPROVE, and publish REQUEST_CHANGES when coverage-evidence blocker states such as cancelled, skipped, failed, unsupported-tooling, or below-100 evidence are present.

  • Result: REQUEST_CHANGES

  • Reason: coverage-evidence result was failure, so required test/docstring evidence was not proven for current head c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098.

  • Head SHA: c2ecc8b4ebcf42ba55bf6f6b4f7174d7d39bf098

  • Workflow run: 31897761305

  • Workflow attempt: 1

Coverage evidence

Coverage Decision

  • Result: FAIL
  • Test evidence: not proven passing
  • Docstring evidence: not proven passing when configured
  • Failure count: 1

Changed-File Evidence Map

flowchart LR
  PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
  Evidence --> S1["Changed file (3 files)"]
  S1 --> I1["repository behavior"]
  I1 --> R1["Review risk: Changed file (3 files)"]
  R1 --> V1["required checks"]
  Evidence --> S2["Test (4 files)"]
  S2 --> I2["regression suite"]
  I2 --> R2["Review risk: Test (4 files)"]
  R2 --> V2["targeted test run"]
Loading

@seonghobae
seonghobae dismissed stale reviews from opencode-agent[bot] and opencode-agent[bot] August 16, 2026 13:39

Superseded by later same-head evidence: coverage-evidence and opencode-review completed successfully for unchanged head c2ecc8b. This REQUEST_CHANGES contains only the now-false coverage-evidence failure and no surviving source finding.

@seonghobae
seonghobae merged commit 62524a3 into main Aug 16, 2026
30 checks passed
seonghobae added a commit that referenced this pull request Aug 16, 2026
Keep the response-event ledger adapter beside item-delivery and result
snapshot modules now on protected main.
cursor Bot pushed a commit that referenced this pull request Aug 16, 2026
Keep the evaluated baseline at 62524a3 for #48/#51 persist evidence.
Discard the stale Active PR claim that merged #76 is still open work.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
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