Release 1.5.0: project-scoped Plainweave runtime autodiscovery#25
Merged
Conversation
…0009, PDR-0010 - PDR-0009: consolidated 1.4.0 release (federation reads + honesty hardenings + H-1..H-4 layering decouple + policy-boundary containment fix + starlette bump); owner-authorized PyPI publish. Closes legis-0186c23a2c -> north-star 0. - PDR-0010: 1.4.0 dependency-security scope (bring in starlette, defer esbuild). - roadmap: honesty bet Now -> won; 1.4.0 shipped. metrics: north-star 1->0 (target met), 1.4.0 guardrail readings. Tracker: closed legis-0186c23a2c; filed legis-a7c9ad6404, legis-70658a5bbc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(fork a); PDR-0011 Owner selected 'federation integration hardening' and the offline-contract-hardening fork after a per-seam audit found the seams contract-shaped but never live-proven, with a silent-drift risk on the SHIPPED /git/renames seam (its contract test asserts against _parse_like_loomweave, a legis-authored mock of Loomweave's Rust parser). - PDR-0011: bet = G16 (replace the self-referential rename mock with a committed two-way shared-vector file + author it for Loomweave) + G8 (backfill resolve guards). Excludes G2 (Loomweave-blocked), G12/oracles (live-fire), Path B (strategy). - roadmap: promoted the bet Now; residual forks kept in Next. metrics: new guardrail (rename-parser conformance vector-pinned, not self-referential — currently BREACHED). - Escalation flagged, not enacted: Loomweave co-committing the shared vectors. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve the Plainweave binding from a project mcpServers.plainweave entry launched as `python -P -m plainweave.mcp_server --root <root>`, not only a `plainweave-mcp` executable. _resolve_plainweave_executable now takes the entry args and, when the arg head is exactly ["-P","-m","plainweave.mcp_server"], accepts the command as a Plainweave launcher only if _is_python_executable confirms it is a real interpreter. _project_plainweave_argv validates args before resolving the executable so every prior fail-closed reject still applies. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
check_changed_format.py decodes git's -z output with errors="surrogateescape", but --print-only then wrote the path list through print() to a strict UTF-8 stdout, raising UnicodeEncodeError on a non-UTF-8 .py filename. Emit the list via sys.stdout.buffer with the matching surrogateescape handler instead. Fixes the red test_changed_format_gate_uses_current_existing_paths; full suite green (1687 passed, 12 skipped). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Branch-review remediation (1 MEDIUM + 1 LOW). MEDIUM: the Codex TOML reader caught (TOMLDecodeError, UnicodeError) but not RecursionError/MemoryError, so a sub-1-MiB but pathologically nested config.toml crashed `legis doctor` with an uncaught RecursionError instead of the documented fail-closed [operator] handling (invariant 5, and a doc-claim contradiction). Catch both and map to a fail-closed "nesting exceeds safe limits" error, mirroring the project-JSON reader's nesting guard. LOW: pin the new python `-m plainweave.mcp_server` launcher's two reject paths (a non-python command carrying the module args; a python launcher for a non-plainweave module) so a future regression that loosened the exact args[:3] match to args[:2] would be caught. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Branch-review remediation (LOW). A hard kill between fsync(temp) and os.replace during a binding repair or MCP registration write leaves an orphaned `.mcp.json.<hex>.tmp` / `.mcp.json<rand>.tmp` in the project root that the finally-block cleanup cannot remove on SIGKILL/power loss. Add `/.mcp.json*.tmp` to the Legis .gitignore rule set so crash residue never surfaces as a tracked change; doctor --fix adds the rule to existing installs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cut the 1.5.0 release line from the Plainweave doctor-binding feature work. - version: pyproject + legis.__version__ 1.4.0 -> 1.5.0 - CHANGELOG: promote the [Unreleased] "legis doctor Plainweave binding" Added entry under a new [1.5.0] — 2026-07-12 heading; add the v1.4.0...v1.5.0 compare link and retarget [Unreleased]. - README: status line and the "1.5.x line" continuity reference. Includes the branch-review remediation carried on the release branch: the Codex config.toml RecursionError fail-closed fix, the .mcp.json repair temp-file ignore rule, the surrogate-safe changed-format gate, and the Plainweave python-launcher reject-path test pins. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Release 1.5.0 focuses on hardening legis doctor and related config-custody paths by adding safe Plainweave launch-binding inspection/repair, introducing stricter/safer project MCP JSON handling, and updating docs/tests to lock the new platform and operational contracts.
Changes:
- Add
legis doctorchecks (and--fixrepair paths) for Plainweave MCP launch bindings across project.mcp.jsonand existing global Codex config. - Harden config custody: stable writer locks, durable atomic writes, strict/size-bounded JSON reads, and POSIX-only platform contract.
- Add/extend regression tests and documentation to freeze release/platform/CI-format/coverage-floor contracts.
Reviewed changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Bumps editable legis version entry to 1.5.0. |
| src/legis/init.py | Updates __version__ to 1.5.0. |
| pyproject.toml | Updates project version and narrows classifiers to POSIX. |
| README.md | Documents 1.5.0 status, POSIX-only contract, and Plainweave doctor binding behavior. |
| CHANGELOG.md | Adds 1.5.0 release notes and link updates. |
| src/legis/install.py | Adds safe POSIX primitives (no-follow dir opens, writer locks), durable atomic writes, strict project .mcp.json reading/parsing, and doctor-safe registration mode. |
| src/legis/doctor.py | Adds Plainweave binding checks, strengthens .mcp.json custody/erroring, and hardens filigree URL scope parsing/diagnostics. |
| src/legis/plainweave_preflight/client.py | Adds bounded requirement pagination controls and strict validation of requirement page metadata. |
| src/legis/service/preflight.py | Threads Plainweave paging controls through service layer and degrades for legacy clients. |
| src/legis/mcp.py | Extends plainweave_preflight_get schema/arg parsing to support requirement pagination. |
| scripts/check_changed_format.py | Adds “format only changed Python files since base” helper with surrogate-safe filename handling. |
| scripts/check_coverage_floors.py | Hardens coverage report validation and adds allowlist semantics for future/unmeasured floors. |
| tests/test_install.py | Adds extensive tests for atomic-write durability, writer locks, .mcp.json safety limits, and doctor-safe behaviors. |
| tests/service/test_preflight.py | Verifies Plainweave paging args are forwarded and legacy clients degrade gracefully. |
| tests/plainweave_preflight/test_client.py | Tests Plainweave pagination forwarding and fail-closed page validation. |
| tests/warpline_preflight/test_client.py | Formatting-only changes to tests. |
| tests/test_release_metadata.py | Adds test to keep pyproject/README/CHANGELOG version metadata consistent. |
| tests/test_platform_contract.py | Adds test enforcing POSIX-only contract in metadata/docs. |
| tests/test_plainweave_plan.py | Adds test asserting CI and plan use changed-format gate (not repo-wide format baseline). |
| tests/test_plainweave_docs.py | Adds tests ensuring docs disclose .mcp.json normalization semantics correctly. |
| tests/test_coverage_floors.py | Adds tests for stricter coverage report validation and allowlist behavior. |
| tests/test_ci_workflow.py | Tightens CI workflow assertions and adds README wording assertions for conditional live oracle gate. |
| tests/test_changed_format_gate.py | Adds tests validating changed-format gate behavior (including non-UTF-8 filenames). |
| tests/conformance/test_governance_read_oracle.py | Minor formatting cleanup in conformance tests. |
| docs/superpowers/specs/2026-07-11-plainweave-doctor-binding-design.md | Design spec for Plainweave doctor binding repair. |
| docs/superpowers/plans/2026-07-11-plainweave-doctor-binding.md | Implementation plan for the Plainweave doctor binding work. |
| docs/guide/configuration.md | Adds detailed Plainweave launch-binding configuration and POSIX-only safety boundary documentation. |
| docs/guide/cli-reference.md | Documents atomic-write mode behavior and Plainweave doctor check meanings/outcomes. |
| docs/guide/reading-legis-output.md | Documents new doctor IDs and strengthened filigree URL scope inspection behavior. |
| docs/product/roadmap.md | Updates roadmap checkpoint and shipped items. |
| docs/product/metrics.md | Updates metrics checkpoint and adds rename-parser guardrail context. |
| docs/product/current-state.md | Updates current state checkpoint and next bet description. |
| docs/product/decisions/0009-ship-legis-1.4.0-consolidated-release.md | Adds recorded decision doc for 1.4.0 consolidated release. |
| docs/product/decisions/0010-1.4.0-dependency-security-scope.md | Adds recorded decision doc for 1.4.0 dependency-security scope. |
| docs/product/decisions/0011-next-bet-federation-offline-contract-hardening.md | Adds recorded decision doc for the next bet. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1145
to
+1151
| def finite_float(value: str) -> float: | ||
| parsed = float(value) | ||
| if not math.isfinite(parsed): | ||
| raise ValueError("non-finite JSON number") | ||
| if Decimal(str(parsed)) != Decimal(value): | ||
| raise ValueError("JSON number cannot be represented without loss") | ||
| return parsed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PLAINWEAVE_MCP_CMDroot pins from project/global configuration.Verification
1739 passed, 12 skipped91.73%; all 11 configured floors passed565 passed, 1 skippedeachTracking
legis-3622e80f2eclosed with root-cause and verification evidence.