The #688 provenance pins hardcode the column index and use short rows
Found reviewing #740 (round 1).
The two new tests construct the wrapper as:
```python
_StrainProvenanceWriter(_Sink(), knowledge_source="infores:bacdive", ks_column_index=4)
```
Production computes it from the header instead:
```python
ks_column_index=self.edge_header.index(PRIMARY_KNOWLEDGE_SOURCE_COLUMN)
```
Two consequences:
- **The pin does not track the header.** `4` is correct today, but if a column were inserted before `primary_knowledge_source` production would adapt and the tests would keep passing while exercising a position that no longer exists in the real output. A pin that cannot notice the thing it pins moving is a weak pin.
- **The rows are 5 columns, the real header is 7** (`subject, predicate, object, relation, primary_knowledge_source, knowledge_level, agent_type`). The wrapper's `len(row) > self._ks_idx` guard means a short row still works, so the tests pass — but they are not exercising the row shape production actually writes.
Neither is a defect in the wrapper; both weaken the regression value of the tests added for #688, which is the entire point of that issue.
Fix: derive `ks_column_index` from the shared header constant the way production does, and use full-width rows.
关闭于 18 天前 1 条评论