Skip to content

fix(pchronicle): harden Storyline resource boundaries and retention - #78

Draft
reiase wants to merge 39 commits into
mainfrom
storyline-resource-retention
Draft

fix(pchronicle): harden Storyline resource boundaries and retention#78
reiase wants to merge 39 commits into
mainfrom
storyline-resource-retention

Conversation

@reiase

@reiase reiase commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add opt-in per-document, per-chunk, and per-import Storyline resource limits while preserving existing defaults
  • verify ATIF missing/null/value presence through the real three-table Lance round trip
  • vacuum objects.lance and prune only expired, non-current physical generations
  • cover non-empty object-store replacement CAS conflicts deterministically and add an ignored real S3 multiprocess contract
  • align Storyline storage and RFC documentation with the implemented mutation keys, indexes, watermark invariants, and ATIF identity mapping

Why

Storyline's correctness boundaries were strong, but several resource costs grew monotonically with document size, import size, or store age. Large documents and imports had no configurable hard limits, offloaded object versions were not physically vacuumed, and rebuilt table generations were retained indefinitely. The object-store replacement path also lacked deterministic conflict coverage.

Impact

Existing callers keep the previous unbounded import behavior unless they opt into limits. Maintenance now reports and vacuums the content-object dataset, and the existing vacuum retention also governs expired physical generations while always preserving the current generation and malformed/foreign directories. Optimistic-CAS conflicts remain explicit and retryable from the latest snapshot.

Validation

  • cargo fmt --all -- --check
  • cargo test -p persisting-pchronicle --lib store::storyline::tests — 36 passed
  • cargo test -p persisting-pchronicle --test atif_lance_corpus — 7 passed
  • cargo test -p persisting-pchronicle --test s3_storage — 4 ignored as expected
  • cargo clippy -p persisting-pchronicle --all-targets -- -D warnings

The real S3/MinIO multiprocess contract is compiled and remains opt-in via PCHRONICLE_S3_TEST_URI; it was not executed without credentials.

reiase added 30 commits August 17, 2026 19:17
# Conflicts:
#	crates/persisting-gateway/src/engine/tests/markdown_stream.rs
#	crates/persisting-gateway/src/engine/tests/replay_dedup.rs
#	crates/persisting-gateway/src/projection/frontmatter.rs
#	crates/persisting-gateway/src/projection/pipeline.rs
#	crates/persisting-gateway/tests/agenticmd_bridge.rs
#	crates/persisting-gateway/tests/agenticmd_golden.rs
#	crates/persisting-gateway/tests/markdown_trajectory.rs
#	crates/persisting-pchronicle-cli/src/exchange.rs
#	crates/persisting-pchronicle-cli/src/lib.rs
#	crates/persisting-pchronicle/Cargo.toml
#	crates/persisting-pchronicle/benches/json_streaming.rs
#	crates/persisting-pchronicle/benches/lance_vs_json.rs
#	crates/persisting-pchronicle/benches/pchronicle_criterion.rs
#	crates/persisting-pchronicle/benches/projection_pipeline.rs
#	crates/persisting-pchronicle/src/agenticmd/codec.rs
#	crates/persisting-pchronicle/src/agenticmd/convert.rs
#	crates/persisting-pchronicle/src/agenticmd/mod.rs
#	crates/persisting-pchronicle/src/agenticmd/projection.rs
#	crates/persisting-pchronicle/src/atif.rs
#	crates/persisting-pchronicle/src/convert/actf.rs
#	crates/persisting-pchronicle/src/convert/atif.rs
#	crates/persisting-pchronicle/src/convert/events.rs
#	crates/persisting-pchronicle/src/convert/mod.rs
#	crates/persisting-pchronicle/src/convert/openai_msg.rs
#	crates/persisting-pchronicle/src/document.rs
#	crates/persisting-pchronicle/src/format.rs
#	crates/persisting-pchronicle/src/formats/mod.rs
#	crates/persisting-pchronicle/src/formats/openai_corpus.rs
#	crates/persisting-pchronicle/src/formats/storyline.rs
#	crates/persisting-pchronicle/src/lib.rs
#	crates/persisting-pchronicle/src/model.rs
#	crates/persisting-pchronicle/src/projection/mod.rs
#	crates/persisting-pchronicle/src/query.rs
#	crates/persisting-pchronicle/src/storage.rs
#	crates/persisting-pchronicle/src/store/catalog/tests.rs
#	crates/persisting-pchronicle/src/store/document_source.rs
#	crates/persisting-pchronicle/src/store/files/atif_reader.rs
#	crates/persisting-pchronicle/src/store/files/mod.rs
#	crates/persisting-pchronicle/src/store/local_query_manifest.rs
#	crates/persisting-pchronicle/src/store/mod.rs
#	crates/persisting-pchronicle/src/store/storyline/model.rs
#	crates/persisting-pchronicle/src/store/storyline/rows.rs
#	crates/persisting-pchronicle/src/store/storyline/tests.rs
#	crates/persisting-pchronicle/src/tests.rs
#	crates/persisting-pchronicle/tests/atif_lance_corpus.rs
#	crates/persisting-pchronicle/tests/capture_fixture_corpus.rs
#	crates/persisting-pchronicle/tests/direct_file_query.rs
#	crates/persisting-pchronicle/tests/document_source.rs
#	crates/persisting-pchronicle/tests/import_roundtrip_fixtures.rs
#	crates/persisting-pchronicle/tests/public_api.rs
#	crates/persisting-pchronicle/tests/query_engine.rs
#	crates/persisting-pchronicle/tests/s3_storage.rs
#	crates/persisting-pchronicle/tests/storyline_lance_roundtrip.rs
#	docs/superpowers/specs/2026-08-17-pchronicle-document-source-convergence-design.md
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