Skip to content

feat(audit): add bounded snapshot manifests - #84

Closed
seonghobae wants to merge 3 commits into
agent/bounded-checkpoint-audit-export-pages-v4from
agent/checkpoint-audit-snapshot-manifest-v2
Closed

feat(audit): add bounded snapshot manifests#84
seonghobae wants to merge 3 commits into
agent/bounded-checkpoint-audit-export-pages-v4from
agent/checkpoint-audit-snapshot-manifest-v2

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Linearized replacement for #66

This Draft replays the exact checkpoint-audit snapshot-manifest delta onto replacement pagination predecessor #83 exact head 0d3366de78c6b1373588d682560d3d50a6ee8a9a.

RCA and replacement boundary

Old #66 remained based on superseded #65 history. Replacement #83 reproduces #65's exact 12-file feature result on the current stack. All #66-modified baseline files inherited from #65 were therefore exact by construction; the two additional existing targets outside that replay (.github/workflows/ci.yml and tests/test_checkpoint_audit_ci_contract.py) were independently verified byte-identical between old #65 and #83 before replay. No force-push, conflict-side selection, or hand-edited merge resolution was used.

Replacement head d2fee308e48cc963a195fb6d52846a70fe46cf63 is exactly one commit ahead and zero behind exact current #83 head 0d3366de78c6b1373588d682560d3d50a6ee8a9a and reproduces #66's exact 16-file delta and aggregate 1887 additions / 26 deletions. It preserves the strict active read-only REPEATABLE READ/SERIALIZABLE transaction boundary, bounded event/page limits, fail-closed overflow, page-partition-invariant schema-v1 digest framing, fixed compatibility vector, live PostgreSQL concurrency checks, public API, and authoritative ADR/operator/assurance documentation.

Old #66 is closed unmerged as superseded. No predecessor-head check, review, or approval transfers.

Current exact-head staged evidence

  • Head: d2fee308e48cc963a195fb6d52846a70fe46cf63.
  • Exact current base tip: 0d3366de78c6b1373588d682560d3d50a6ee8a9a (feat(audit): add bounded stable export pages #83).
  • Ancestry: one commit ahead, zero behind; merge base equals the exact base tip.
  • CI 31286925728: completed / success on this exact source head.
  • Release Acceptance 31286925720: completed / success on this exact source head.
  • CodeRabbit exact-head review-only analysis: comment 5229592582 verified this exact head/base and reported no source defects in the requested transaction, pagination, overflow, digest-framing, timestamp, and assurance scope. The service also reported its review quota was rate-limited, so that comment is useful automated review evidence but not a formal review or independent approval.
  • Formal reviews: none at current inspection.
  • Unresolved inline review threads: zero.
  • GitHub reports the PR mergeable and intentionally Draft.

This is current stacked-stage evidence only. Default-branch-only organization/security/review gates are not inferred as passing while this PR remains stacked.

Dependency and merge boundary

Required order remains .github#790 -> pg-llm-batch#53 -> #55 -> #56 -> #57 -> #58 -> #59 -> #60 -> #78 -> #79 -> #80 -> #83 -> this PR.

Keep Draft while earlier prerequisites remain unintegrated. After every prerequisite safely reaches protected main, reconcile or retarget this slice onto the actual integrated base and regenerate all required exact-head/exact-base CI, live PostgreSQL, migration/rollback/concurrency, security, dependency, SBOM/provenance, packaging, automated-review, branch-protection, repository-policy, and Release Acceptance gates. Merge only with zero unresolved valid findings and a qualifying independent non-author GitHub APPROVED review on the unchanged final head. Queued, pending, failed, cancelled, skipped-required, neutral-required, absent, stale-head/base, predecessor, status-only, author-only, or synthetic-only evidence is never acceptance.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e666b595-4724-44a7-8b93-e48128240c5d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Review exact current source head d2fee308e48cc963a195fb6d52846a70fe46cf63 against exact stacked base 0d3366de78c6b1373588d682560d3d50a6ee8a9a. Review only; do not mutate the branch. Focus on snapshot-stability and fail-closed correctness: the caller-owned active read-only REPEATABLE READ/SERIALIZABLE boundary, tenant-qualified keyset traversal, exact max-events overflow detection, page-size-invariant domain-separated length framing, inclusion of every retained audit-event field, UTC microsecond timestamp normalization, identity-range/count consistency, and the documented boundary that the SHA-256 manifest is deterministic content identity rather than authentication/non-repudiation. CI 31286925728 and Release Acceptance 31286925720 are exact-source staged successes; report any source defect separately from downstream protected-main integration/review prerequisites.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="0d3366de78c6b1373588d682560d3d50a6ee8a9a"
head="d2fee308e48cc963a195fb6d52846a70fe46cf63"

echo "== checked-out commit =="
git rev-parse HEAD
echo "== requested commits =="
git rev-parse "$base"
git rev-parse "$head"
echo "== merge base / ancestry =="
git merge-base "$base" "$head"
git rev-list --left-right --count "$base...$head"

echo "== changed files =="
git diff --name-status "$base" "$head"

echo "== diff stat =="
git diff --stat "$base" "$head"

echo "== Python outlines in changed files =="
git diff --name-only "$base" "$head" -- '*.py' |
while IFS= read -r file; do
  echo "-- $file"
  ast-grep outline "$file" --lang python --items all || true
done

echo "== focused transaction and digest references =="
rg -n -i -C 3 \
  'repeatable read|serializable|read.?only|transaction|snapshot|keyset|max.?events|overflow|sha-?256|digest|manifest|timestamp|microsecond|tenant' \
  $(git diff --name-only "$base" "$head" -- '*.py' '*.md' '*.yml' '*.yaml' '*.toml') || true

echo "== complete diff =="
git diff --find-renames --find-copies --minimal "$base" "$head"

Length of output: 125776


🏁 Script executed:

#!/bin/bash
set -euo pipefail

base="0d3366de78c6b1373588d682560d3d50a6ee8a9a"
head="d2fee308e48cc963a195fb6d52846a70fe46cf63"

echo "== exact revision evidence =="
printf 'HEAD: '; git rev-parse HEAD
printf 'BASE: '; git rev-parse "$base"
printf 'REQUESTED_HEAD: '; git rev-parse "$head"
printf 'MERGE_BASE: '; git merge-base "$base" "$head"
printf 'AHEAD_BEHIND: '; git rev-list --left-right --count "$base...$head"

echo "== checkpoint_audit.py outline =="
ast-grep outline pg_llm_batch/checkpoint_audit.py --lang python --items all

echo "== event model, row decoding, and page traversal =="
sed -n '1,330p' pg_llm_batch/checkpoint_audit.py
sed -n '480,700p' pg_llm_batch/checkpoint_audit.py

echo "== manifest tests, full focused sections =="
sed -n '1,380p' tests/test_checkpoint_audit_snapshot_manifest.py
sed -n '1,320p' tests/test_checkpoint_audit_snapshot_transaction_boundary.py
sed -n '1,280p' tests/test_checkpoint_audit_snapshot_integration.py

echo "== pagination implementation and manifest call sites =="
rg -n -C 8 \
  'def list_audit_event_page_in_transaction|def list_audit_event_page|SELECT|ORDER BY|before_audit_event_id|build_audit_snapshot_manifest_in_transaction' \
  pg_llm_batch/checkpoint_audit.py tests

echo "== all changed test names =="
git diff --name-only "$base" "$head" -- 'tests/*.py' |
while IFS= read -r file; do
  echo "-- $file"
  rg -n '^def test_|^class Test' "$file" || true
done

Length of output: 184340


@seonghobae Review complete for d2fee308e48cc963a195fb6d52846a70fe46cf63 against 0d3366de78c6b1373588d682560d3d50a6ee8a9a.

I verified the checked-out head and merge base. The head is one commit ahead and zero commits behind the requested stacked base.

I found no source defects in the requested scope.

The implementation:

  • Requires caller-owned libpq INTRANS state before any manifest probe or page read.
  • Rejects autocommit, READ COMMITTED, malformed transaction metadata, and read-write transactions.
  • Requires read-only REPEATABLE READ or SERIALIZABLE.
  • Reuses tenant-qualified, full-key, descending keyset pagination with a strict < continuation predicate and lookahead.
  • Bounds every page and the total event count.
  • Raises when a continuation exists after max_events is consumed. It does not emit a truncated manifest.
  • Frames the domain, trusted key, every retained event field, UTC microsecond timestamp, count, and identity bounds with explicit lengths.
  • Excludes page boundaries from the digest.
  • Validates empty, single-event, and multi-event identity-range rules without incorrectly requiring contiguous PostgreSQL sequence values.
  • Documents SHA-256 as deterministic content identity and change detection only. It does not claim authentication, provenance, or non-repudiation.

The new focused tests cover the transaction boundary, overflow behavior, fixed schema-v1 digest compatibility, page-size invariance, and a live concurrent-insert case.

The reported exact-head CI and Release Acceptance successes are consistent with the staged evidence. Protected-main integration, fresh final-head checks, and a qualifying independent approval remain downstream merge prerequisites. They are not source defects in this review.

⚠️ Action not completed

Review rate limited.

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

Superseded by #97, which rebuilds this snapshot-manifest feature on the current #96 pagination predecessor and preserves the later pagination/key-revalidation stack before composing the snapshot implementation. This branch remains on stale #83 ancestry, so its checks/reviews cannot become final integration evidence. Closing unmerged to keep one canonical snapshot-manifest line; no evidence transfers to #97.

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