test(seams): harden Loomweave/Legis/Filigree seams — contract tests + degraded-state pins (PDR-018)#7
Conversation
… degraded-state pins (PDR-018) Retires the last 3 named production blockers plainweave-side. Test-and-docs only — zero src/plainweave/*.py changes; the seam BEHAVIOR already exists, this freezes/pins it. - #5 Filigree: tests/contracts/test_filigree_contract.py pins open_linked_work as reserved-but-never-emitted (absence is the in-band linked_work_facts_unavailable warning, never empty-but-ok), filigree_issue trace opacity + canonical relations, and the dossier's verdict-free advisory boundary (key + whitelisted-value scan — the dossier legitimately carries lifecycle "approved"/"rejected" values, so the peer-facts scanner doesn't apply). - #4 Legis: behavioral coverage for orphaned_entity_link (previously zero); ADR-006 annotated with the 8-of-11 emission status (active/waived_finding_linked superseded by the dedicated wardline_peer_facts producer; open_linked_work handed off to Filigree); doc-staleness fix (the legis consumer now exists). - #3 Loomweave: tests/loomweave_contract.py validate_loomweave_catalog + degraded golden, pinning the cardinal no-silent-clean invariant — an unavailable adapter never returns a clean-empty page and never advertises positive coverage/pagination while down. Every new test mutation-proven red-first. make ci green (390 tests, 91.18% cov, mypy --strict + ruff); wardline scan 0 active; legis cross-repo preflight oracle stayed green (28 passed — additive, no plainweave obligation). Adversarially reviewed (3 lenses: decorative-test, no-silent-clean/boundary, claim-honesty); all findings applied. Owner-gated Filigree open_linked_work handoff authored (docs/handoffs/2026-06-29-filigree-linked-work-facts.md). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1086187368
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| from typing import Any | ||
|
|
||
| LOOMWEAVE_ADAPTER_STATUSES = {"available", "unavailable"} |
There was a problem hiding this comment.
Include the degraded adapter status in the catalog contract
When the Loomweave DB exists but lacks the catalog schema or SEI tables, the existing producer returns adapter_status["status"] == "degraded" (covered by tests/test_loomweave_adapter.py:128-160). This new validator rejects that already-supported partial state, so any contract check over live MCP output for a schema-missing or SEI-unsupported catalog fails even though the producer is correctly carrying degradation in-band. Please include degraded in the allowed vocabulary and apply the appropriate no-silent-clean expectations to it.
Useful? React with 👍 / 👎.
| """The real producer over a root with no Loomweave db: an unavailable adapter, an | ||
| empty page, and a degraded reason carried in-band (no silent-clean).""" | ||
| data = _data(_surface(tmp_path).plainweave_loomweave_catalog_list(limit=50, offset=0)) | ||
| validate_loomweave_catalog(data) |
There was a problem hiding this comment.
Compare the live degraded envelope to the golden
In the no-Loomweave-DB scenario this only runs the live payload through the structural validator, so the committed catalog-degraded.json can drift from the producer without failing the test; for example, changing the live degraded code/message away from loomweave_db_missing still passes because the validator only requires code/message keys. If this fixture is meant to be a golden pin, load it here and compare live output to it after normalizing path-sensitive fields.
Useful? React with 👍 / 👎.
| is reserved vocab the local-only producer never constructs today, so it must never appear | ||
| as an empty-but-ok fact list when a future live Filigree join lands (sibling-gated).""" | ||
| service = service_for(tmp_path) | ||
| requirement_id = approve_requirement(service) |
There was a problem hiding this comment.
Seed a Filigree trace before guarding open_linked_work
This test claims to pin that the local-only producer never emits open_linked_work, but its setup only creates a requirement and no filigree_issue trace. If a future change incorrectly translates existing local Filigree traces into open_linked_work facts while still leaving the unavailable warning, this contract stays green; add a scoped requirement with a Filigree trace before asserting that the reserved fact is absent.
Useful? React with 👍 / 👎.
Seam hardening — production blockers #3/#4/#5 retired plainweave-side (PDR-018)
Retires the last 3 named production blockers. Test-and-docs only — zero
src/plainweave/*.pychanges: the seam behavior already exists; this freezes and pins it.A scoping workflow (3 investigators + adversarial challenge per blocker) established the honest size of each: #3 and #4 were behaviorally built and tested already; the genuine gaps were contract-test/parity artifacts and one zero-coverage fact kind. The adversarial pass rejected two unsafe over-scopes (suppressing the Legis
*_unavailablewarnings — a silent-clean hole; a dedicated Filigree validator module — Filigree emits no.v1payload).What landed
tests/contracts/test_filigree_contract.pypinsopen_linked_workas reserved-but-never-emitted (absence is the in-bandlinked_work_facts_unavailablewarning, never empty-but-ok),filigree_issuetrace opacity + canonical relations, and the dossier's verdict-free advisory boundary (key + whitelisted-value scan — the dossier legitimately carries lifecycle"approved"/"rejected"values, so the peer-facts scanner doesn't apply).orphaned_entity_link(previously zero); ADR-006 annotated with its 8-of-11 emission status (active/waived_finding_linkedsuperseded by the dedicatedwardline_peer_factsproducer;open_linked_workhanded off to Filigree); doc-staleness fix.tests/loomweave_contract.py::validate_loomweave_catalog+ a degraded golden, pinning the cardinal no-silent-clean invariant: anunavailableadapter never returns a clean-empty page and never advertises positive coverage/pagination while down.Verification
make cigreen: 390 tests (up from 378), 91.18% coverage, mypy--strict+ ruff clean.wardline scanclean (0 active).Owner-gated follow-on
docs/handoffs/2026-06-29-filigree-linked-work-facts.md— a peer prompt asking Filigree to emit a local, boundary-clean linked-work facts artifact that Plainweave could adapt in-grant to emit realopen_linked_workfacts. The live join +gap_create_workwrite path stay out (would mutate a sibling).🤖 Generated with Claude Code