Skip to content

refactor(structure): S5 — separate partner declarations from delivery machinery - #163

Merged
Polichinel merged 2 commits into
developmentfrom
feat/s5-partner-machinery-boundary
Jul 31, 2026
Merged

Polichinel merged 2 commits into
developmentfrom
feat/s5-partner-machinery-boundary

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

Closes #153 · Epic #148 · Register C-69 and C-70 closed · The clone-enabling change

Two commits, deliberately separate so the move is reviewable as a move.

S5a — the move (no behaviour change)

views_postprocessing/ now has three top-level packages, each answering a different question:

package question contents
delivery/ what makes a delivery valid the representation-free invariants (unchanged)
contract/ how a delivery is built the ADR-013 machinery — wire/ + frames, gaul asset, artifact builders, external-fact readers
unfao/ who a delivery is for product.py, appwrite_env.py, managers/ — 3 files, all genuinely FAO

~800 lines moved out from under one partner's name. Imports rewritten across 28 files plus tests and scripts.

S5b — the coupling the move exposed

This is the part that mattered. With everything under unfao/ it was invisible:

# contract/wire/sink.py — before
from views_postprocessing.unfao import product
def deliver_run(..., upload_enabled=product.UPLOAD_ENABLED,
                     consumer_name=product.CONSUMER_DOCUMENT_NAME,
                     s_min=product.S_MIN): ...

Not in its logic — as default argument values. The parameters already existed, so DIP was satisfied on paper; the defaults reached back into the partner anyway. A clone importing this wire would have silently inherited FAO's consumer name and FAO's collapse floor.

They are now required arguments the manager supplies explicitly. The mechanism declares what it needs; the partner provides it.

contract/ now contains no code reference to unfao. #155 makes that mechanical rather than conventional.

C-70 folded in

gaul_schema is partner-neutral machinery and this was the one time it was being handled.

COLUMNS declares each column's (name, role, wire_dtype) once; METADATA_COLS, CODE_COLS, NAME_COLS, COORD_COLS and a new WIRE_DTYPE map all derive from it. One list had been carrying three meanings — membership, normative wire order, and null-gate scope — while its comment named only the first, and the dtype policy was re-derived positionally by if col in CODE_COLS in three modules.

Two tests pin it: the derivation (roles partition the nine exactly; the §5.1 dtype ruling holds) and the normative order written out literally, so a reorder fails with a readable diff rather than only as a fixture byte mismatch.

I verified the derived lists are identical to the hand-written ones they replace before relying on them.

Verification

ruff clean · 297 passed, 41 xfailed · the 5 failures are the known local pyarrow byte-parity tests; CI authoritative.

The byte-parity fixtures are untouched and must stay green — that is the proof this was a restructure and not a contract change.

Register: 71 concerns, 27 open, 44 resolved. Integrity guard green.

🤖 Generated with Claude Code

Polichinel and others added 2 commits August 1, 2026 01:45
…ct/ (pure move)

Part 1 of #153. NO behaviour change: file moves plus import rewrites only.
The behavioural half — decoupling the wire from the partner's product — is the
next commit, deliberately separate so this one is reviewable as a move.

views_postprocessing/ now has three top-level packages, each answering a
different question:

    delivery/    what makes a delivery VALID   — representation-free invariants
    contract/    how a delivery is BUILT       — the ADR-013 machinery (NEW)
    unfao/       who a delivery is FOR         — product, appwrite_env, manager

Moved into contract/: wire/ (7 modules), frames, frame_extraction,
track_a_source, gaul_lookup, gaul_schema, enrichment, historical,
source_metadata, store_metadata, launch_config. unfao/ keeps product.py,
appwrite_env.py and managers/ — 3 files, all genuinely FAO.

Structure now matches ADR-002's declared layering, which S6 will re-state (its
illustration still names unfao/extraction.py as the seam, deleted in #151).

Imports rewritten across 28 files + tests + scripts. test_input_integrity_
design_contract.py's path assertions follow the move.

ruff clean; 295 passed, 5 known local pyarrow byte-parity failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…; column contract as data

Part 2 of #153 (part 1 was the pure move). Closes register C-69 and C-70.

THE MOVE EXPOSED A REAL COUPLING. With everything under unfao/ it was
invisible: wire/sink.py imported unfao.product — not in its logic, but as
DEFAULT ARGUMENT VALUES for upload_enabled, consumer_name and s_min. The
parameters already existed, so DIP was satisfied; the defaults reached back into
the partner anyway. They are now required arguments the manager supplies
explicitly. The mechanism declares what it needs; the partner provides it.

contract/ now contains no code reference to unfao. #155 makes that mechanical.

C-70 folded in, because gaul_schema is partner-neutral machinery and this was
the one time it was being handled: COLUMNS declares each column's
(name, role, wire_dtype) once and METADATA_COLS / CODE_COLS / NAME_COLS /
COORD_COLS / WIRE_DTYPE derive from it. One list had been carrying three
meanings — membership, normative wire ORDER, and null-gate scope — while its
comment named only the first, and the dtype policy was re-derived positionally
in three modules.

Two tests pin it: the derivation itself (roles partition the nine exactly; the
§5.1 dtype ruling holds), and the normative order written out literally so a
reorder fails with a readable diff rather than only as a fixture byte mismatch.

Verified the derived lists are byte-identical to the hand-written ones they
replace, and the byte-parity fixtures are unaffected.

ruff clean; 297 passed, 5 known local pyarrow byte-parity failures.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Polichinel
Polichinel merged commit cbb5cbe into development Jul 31, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/s5-partner-machinery-boundary branch July 31, 2026 23:50
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