PARTIAL — protected provider-file lifecycle primitives
Protected main contains the reviewed remote-file lifecycle primitives in pg_llm_batch/batch_api_client.py, with OpenTelemetry parity and retention tests/doctoring:
BatchAPIClient.upload_jsonl(..., expires_after_seconds=...) supports bounded input-file expiry with local fail-before-provider validation;
BatchAPIClient.create_batch_job(..., output_expires_after_seconds=...) supports bounded generated output/error-file expiry;
BatchAPIClient.delete_file() is an explicit caller-authorized provider deletion primitive, not inferred cleanup authority; and
OpenTelemetryBatchAPIClient preserves those controls without adding content-bearing telemetry authority.
These are implemented primitives, not end-to-end retention/erasure. They do not establish provider capability negotiation, automatic cleanup, already-deleted/not-found reconciliation, durable cleanup audit, local PostgreSQL retention/erasure, backup deletion or legal-erasure guarantees.
Residual bounded target
Complete the remaining remote content-lifecycle policy test-first:
- establish an explicit provider capability/compatibility contract for input/output expiry rather than assuming every OpenAI-compatible gateway accepts optional retention fields;
- define reviewed already-deleted/not-found reconciliation semantics; uncertain transport failure remains reconciliation work rather than success;
- never infer deletion authority from batch terminal state alone;
- if automatic cleanup is introduced, require explicit retention/reconciliation policy after compatible terminal/retrieval state, bounded crash/restart-safe execution, and no distributed exactly-once claim;
- retain provider input/output/error file identity plus bounded cleanup/expiry evidence needed for audit after remote content disappears instead of overwriting history with
NULL;
- keep remote provider retention, local PostgreSQL retention/export/erasure, backups and host logs as separate authorities;
- keep diagnostics/telemetry/audit free of prompts/results/provider bodies, credentials, DSNs, arbitrary provider text and dynamic exception names; and
- cover supported/unsupported capability, already-deleted/not-found reconciliation, transient failure, cancellation with partial output, cleanup ordering and restart/recovery with realistic tests.
Current writer boundary
Do not start a competing batch_api_client.py retention branch while Draft #317 is active. #317 is the canonical overlapping provider-client writer for #301/#302/#347. Its exact current head c7d62daccb746999a269917e6120d3d3fe6260d1 is repository-local exact-head GREEN after the #347 provider resource-ID authority repair and its induced test-fixture repair, but #317 remains Draft/unintegrated. Branch-local GREEN does not create writer vacancy and is not protected-main or immutable-release authority. Mutable exact workflow/review state belongs in #317/#244.
That overlap is a repair/serialization finding, not a reason to close #136 or discard valid predecessor work. Residual retention source work may begin only after #317 ceases to be the active writer through normal protected integration or verified complete successor inheritance, followed by a fresh intended-path inventory of every open and no-PR branch touching provider-client/schema/package/test surfaces. #316 remains the branch-lifecycle authority; historical branch counts are not writer-safety evidence.
Documentation and completion boundary
#229 owns canonical PRD/TRD/documentation-fitness, #324 owns root architecture/CHANGELOG/product-gap documentation, and #321 owns root README/docs index. Do not create a competing provider-retention documentation branch. #195/#196 own repository-wide threat/data-governance convergence. Remote provider expiry/deletion must not be promoted into local PostgreSQL erasure, backup erasure, cryptographic erasure or legal-erasure claims.
#233 remains the earliest protected integration root. Mutable central workflows/ruleset/review state belongs to #244 and live owners. Close only after residual capability/reconciliation behavior is normally integrated from writer-safe ancestry, canonical docs agree with exact protected source, all then-live exact-head gates pass, and any released claim is bound through #198 to immutable protected version/tag/package/SBOM/provenance/reproducibility/rollback identity.
Refs #136, #172, #195, #196, #198, #229, #233, #244, #301, #302, #316, #317, #321, #324, #347.
PARTIAL — protected provider-file lifecycle primitives
Protected
maincontains the reviewed remote-file lifecycle primitives inpg_llm_batch/batch_api_client.py, with OpenTelemetry parity and retention tests/doctoring:BatchAPIClient.upload_jsonl(..., expires_after_seconds=...)supports bounded input-file expiry with local fail-before-provider validation;BatchAPIClient.create_batch_job(..., output_expires_after_seconds=...)supports bounded generated output/error-file expiry;BatchAPIClient.delete_file()is an explicit caller-authorized provider deletion primitive, not inferred cleanup authority; andOpenTelemetryBatchAPIClientpreserves those controls without adding content-bearing telemetry authority.These are implemented primitives, not end-to-end retention/erasure. They do not establish provider capability negotiation, automatic cleanup, already-deleted/not-found reconciliation, durable cleanup audit, local PostgreSQL retention/erasure, backup deletion or legal-erasure guarantees.
Residual bounded target
Complete the remaining remote content-lifecycle policy test-first:
NULL;Current writer boundary
Do not start a competing
batch_api_client.pyretention branch while Draft #317 is active. #317 is the canonical overlapping provider-client writer for #301/#302/#347. Its exact current headc7d62daccb746999a269917e6120d3d3fe6260d1is repository-local exact-head GREEN after the #347 provider resource-ID authority repair and its induced test-fixture repair, but #317 remains Draft/unintegrated. Branch-local GREEN does not create writer vacancy and is not protected-main or immutable-release authority. Mutable exact workflow/review state belongs in #317/#244.That overlap is a repair/serialization finding, not a reason to close #136 or discard valid predecessor work. Residual retention source work may begin only after #317 ceases to be the active writer through normal protected integration or verified complete successor inheritance, followed by a fresh intended-path inventory of every open and no-PR branch touching provider-client/schema/package/test surfaces. #316 remains the branch-lifecycle authority; historical branch counts are not writer-safety evidence.
Documentation and completion boundary
#229 owns canonical PRD/TRD/documentation-fitness, #324 owns root architecture/CHANGELOG/product-gap documentation, and #321 owns root README/docs index. Do not create a competing provider-retention documentation branch. #195/#196 own repository-wide threat/data-governance convergence. Remote provider expiry/deletion must not be promoted into local PostgreSQL erasure, backup erasure, cryptographic erasure or legal-erasure claims.
#233 remains the earliest protected integration root. Mutable central workflows/ruleset/review state belongs to #244 and live owners. Close only after residual capability/reconciliation behavior is normally integrated from writer-safe ancestry, canonical docs agree with exact protected source, all then-live exact-head gates pass, and any released claim is bound through #198 to immutable protected version/tag/package/SBOM/provenance/reproducibility/rollback identity.
Refs #136, #172, #195, #196, #198, #229, #233, #244, #301, #302, #316, #317, #321, #324, #347.