Skip to content

Define the PostgreSQL observation and protection-lifetime binding for governed reads #392

Description

@samovers

Status and purpose

This issue tracks the already-authorized implementation-side PostgreSQL binding task. It is not another prerequisite to that task, a new canonical RFC, or implementation approval. The concrete mechanism is still unresolved; finish that Phase A here rather than commissioning another general design or coordination service.

Consumers: #353 / PR #359, then the applicable readback integration around #178, and eventually the separately bounded temporal child of #176. This issue is not that temporal child and does not satisfy #176.

Canonical owner: OFARM #36 / PR #37, approved decision OFARM-ISSUE36-GOVERNED-READ-TRANSACTION-COVERAGE-DISCLOSURE-001, version 2, at 41cd45b90fb8e133f6377d8f389858b89c3dd7ae. Approval record. That approval defines the required behavior, not an admitted PostgreSQL provider.

The task user authorized issue creation conditionally on a drift/overdesign check. The check supports one owner issue after removing the extra-prerequisite framing: no duplicate owner issue was found; #353 excludes storage/transaction ownership, #178 excludes governed reads from its write protocol, and #177 retains permission/redaction/output integration. The issue records existing RD-BIND03 work, including RD-BIND03-W, without adding an approval stage or prescribing a mechanism.

Outcome and primary trust boundary

Deliver the bounded database/source binding needed for one complete governed-read observation, exact evidence membership, and protection lasting across evidence commit until the first irreversible disclosure handoff or irrevocable termination.

Primary trust boundary: governed-read database observation, evidence membership and protection lifetime. Database enforcement, narrowly justified privileges and mechanical writer participation may belong to this boundary; independent identity, key, selector, authorization, output or custody authority does not.

The user-visible contribution is a prerequisite for truthful, currently authorized readback without revealing hidden history through a changed success/failure response. It does not itself expose an endpoint or claim that the complete reader is ready.

Inspected basis

OFARM2 main: 9d7541d96bc708e9270b986927d7f4b8a035454f. OFARM main: 71ca724a8b6ec23f1655b086a6f549496d10a47f. PR #359 remains at 7de8a2c4cf6eb1f293560af67e69565122c42f25; canonical PR #11 remains at 4494924998183fe3fa7bc1b63b76a85893335044. All three referenced PRs remain draft and unmerged.

These findings reject particular reuse shortcuts. They neither prove every possible PostgreSQL design impossible nor establish that new roles, a service, a lease or a scheduler must be built.

Required binding and acceptance

Use the approved order: A = durable admission; S = final complete observation; P = frozen preparation; C = atomic evidence commit; L = first irreversible handoff; O = later truthful observations. Preserve A → S → P → C → L → O, with irrevocable stops and no same-identity protected replay.

The rows below map existing canonical obligations; they do not create another invariant registry.

Existing obligation Required concrete result and smallest hostile/positive evidence
RD-I01/I08; RD-BIND01 Map the exact canonical logical tuple to distinct physical A/C/O transactions and immutable evidence. Concurrent duplicates, changed session/caller facts and lost acknowledgement cannot take over the old attempt. Internal transaction IDs never become new caller requests.
RD-I02/I09; RD-BIND03 Name the authoritative collections, exact membership predicates and consistent S/c mapping under unchanged binder semantics. Cover absence, sets, historical packages, qualifiers of qualifiers and unresolved/malformed-root partitions. A pre-cut commit with a delayed notification must be included; an omitted partition cannot yield a completeness claim.
RD-I13; RD-BIND03-W; RD-C20/C21 Select and explain the actual protection mechanism, acquisition/commit participation, deadlock order, lifetime and independently verifiable evidence. Hold independent authority/session/deadline/fault facts fixed: a hidden writer already holding or queuing protection cannot alone change a permitted limited reply into timeout/failure. Order any conflicting commit after L/termination; demonstrate actual post-L commitment in C20's admitted positive pair, without granting a new writer authority. Test uniform policy exclusion and the separate disclosable-history comparator too.
RD-I06/I07/I08; RD-BIND01/03 Bind the complete atomic C set and authoritative reconciliation. Partial or unknown C permits no L; any complete C leaves consumption spent even if its acknowledgement is lost or disclosure stops. A receipt records established preparation facts, not future continuity or delivery.
RD-I02/I07/I08; RD-C09/C13/C18 Specify the exact storage-to-output contract for continuous protection, owner loss, cancellation and exclusive deadlines. A final database check followed by an unguarded send is insufficient. The output owner implements L separately; this issue proves the database side and states its integration obligations honestly.

Inventory all paths that can introduce relevant authoritative candidates, including applicable historical import/migration paths. Prove unsupported paths remain unavailable; do not implement recovery/import or activate qualifying-record authorship to fill the inventory. Empty history and an inactive current writer do not establish completeness or writer-deferral proof.

A purported seal that permits the forbidden hidden-history interleaving fails conformance even when it subsequently suppresses output safely. Do not extend deadlines, hide notifications, invent processing bounds or redefine failure as a successful privacy result.

Smallest architecture and boundaries

Complete one concrete Phase A contract under AGENTS.md and TASK_PROMPT.md: trust model, one authority per fact, exact typed operations and ownership, state/ordering, production-entry counterexamples, source/profile bindings and invariant-to-test traceability. Document the actual mechanism and positive path; another list of required provider promises is not completion.

Use the existing tenant foundation where its guarantees fit. No generic SQL/cursor interface, legacy Store fallback, mutable trusted flag, duplicate history truth store or speculative coordination framework. Do not split an issue or PR for each helper, table, lock or test.

Likely implementation areas, to be justified by the selected design: narrow typed storage operations around kernel/tenant_uow.py, an additive migration under kernel/migrations/ if needed, the matching provisioning/readiness enforcement, and focused tenant/read database tests. Existing migrations remain immutable. Do not select new privileges or exact files merely from this list.

Retain existing identity, policy selection, source semantics and retention authority. Specify, but do not implement here, authorization evaluation, full content/redaction/assembly processing or HTTP/proxy/cache disclosure. Do not change the canonical four package families, the full ASSERT_OPERATION_CLAIM / RECEIVE_READ_DATA scope, #359 F4, or the deferred status of the other eighteen actions. No extra evidence-reference carrier unless the actual selected policy requires one.

Not provisional: no temporary unsafe reader or permanently unavailable substitute is proposed. Learning value is the concrete database mechanism and falsifiable proof that the approved read protocol can be bound, without spreading authority across unreviewed components.

Stages, verification and stop rules

First finish the existing implementation-side Phase A and obtain its required review/approval. This issue's creation is not that approval. Preserve PR #11's eleven stages: technical design/static bindings precede runtime work; canonical materialization, binding review, scoped promotion and byte-identical extraction remain separately governed.

At the later authorized implementation stage, use the real typed database entry and participating source paths for the cases above, including actual commit-order and output-owner integration evidence. Keep database-only proof distinct from end-to-end reader admission. Run the mandatory python3 conformance/ofarm_pkg_contract_check.py before commits using the repository's required runtime, plus the focused affected checks and PostgreSQL tests. No runtime experiment is required before its own implementation authorization.

Do not absorb #177/#178/#179/#180/#181/#182/#183/#185/#193 or reopen completed #173/#174. Necessary read inputs must precede their consumers; neither a blanket #353 dependency nor a fake producer may create a cycle.

Stop before an independent authority or canonical semantic change. Explain the exact change, affected files/authority and why it is necessary before requesting a split or exception. Failure to find a mechanism leaves this binding open; it is not an automatic reason to create another prerequisite. Once approved in-scope acceptance passes, remaining preferences become follow-ups under the existing merge and explicit-authorization rules.

Creation verification

Fresh issue/owner and live-head checks; comparison with the authorized binding plan and PR #37's unchanged requirements. No provider feasibility, runtime or semantic approval is claimed. No code, schema, role, source authority, PR, merge or production route changed, and no tests ran for this issue creation. Scope stayed inside recording the bounded database/source binding task.

What is next: finish the concrete PostgreSQL binding design in this issue, starting with the unresolved privacy-safe acquisition and protection-through-L mechanism; do not add another planning layer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deliveryOne independently reviewable capability and primary trust boundary; one live implementation PR.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions