Skip to content

fix(publish): publish host-provided singletons as peers and keep repository peer choices - #18

Merged
pkarw merged 14 commits into
mainfrom
fix/host-provided-peers
Oct 30, 2026
Merged

pkarw merged 14 commits into
mainfrom
fix/host-provided-peers

Conversation

@wojciechszyjka

@wojciechszyjka wojciechszyjka commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Tracking plan: .ai/runs/2026-10-29-host-provided-peers.md
Status: complete

🎯 What changes

Exported modules now publish @tanstack/react-query and @tanstack/react-table as ^<installed> peer dependencies and keep their exact installed versions in devDependencies. The module therefore shares the host application's React context and TanStack types instead of installing an exact nested runtime copy.

Linked releases also reconcile repository manifests safely: a package cannot remain in both peerDependencies and dependencies; a repository peer range for an imported runtime or host-provided package is kept when the supported range check accepts the built version, and otherwise the generated caret range wins.

The branch now includes current main. Conflict resolution preserves main's caret framework peers, exact build-time dependencies, package description/keywords, and catalog behavior alongside this PR's host-provided peer rules.

💥 Compatibility

The published package layout is a protected surface. Already-published package versions do not change; newly exported or republished modules receive the new layout. Framework peers continue to follow current main. The changelog, guide, and BACKWARD_COMPATIBILITY.md document the contract.

🧪 Validation

  • npm run typecheck: pass
  • npm test: 247 tests, 242 pass, 0 fail, 5 expected environment-dependent skips
  • npm pack --dry-run: pass, 59 files, 105.9 kB
  • Hermetic consumer evidence: an offline npm install reuses a compatible host-provided TanStack package and creates no nested module copy
  • Authoritative re-review: approved after the consumer-evidence blocker was fixed in 628aa34

No registry publication or real-app release was performed; repository policy keeps those outside unit validation. GitHub CI for the final head remains a merge gate.

📋 Progress

All steps in the tracking plan are complete.

@wojciechszyjka wojciechszyjka added the bug Something isn't working label Oct 29, 2026
@wojciechszyjka

Copy link
Copy Markdown
Contributor Author

🏷️ label rationale - om-auto-create-pr

  • 🐛 bug: published modules could install a second copy of @tanstack/react-query and @tanstack/react-table, which breaks types and the shared QueryClient.

The pipeline labels this run would also apply (review, needs-qa, priority-medium, risk-medium) do not exist in this repository, so they were skipped. Intended: review because the PR waits for code review; needs-qa because the published manifest layout changes for module authors; priority-medium from the audit severity; risk-medium because it changes a protected surface listed in BACKWARD_COMPATIBILITY.md.

@wojciechszyjka

Copy link
Copy Markdown
Contributor Author

🤖 om-auto-create-pr - run summary

Final status: complete
@tanstack/react-query and @tanstack/react-table are now published as host-provided peers. Linked releases never list a peer as a dependency and keep the repository's peer range while it allows the built version. The PR is ready for review.
🧪 typecheck, lint, npm pack --dry-run and git diff --check pass; npm test 233 tests, 228 pass, 0 fail, 5 skipped (need OPEN_MERCATO_ROOT). A read-only code review found two merge gaps, both fixed in 2e80d07; the re-review found no issues at medium severity or above. GitHub CI has not been checked by this run.
⚠️ The published package layout is a protected surface (BACKWARD_COMPATIBILITY.md). A maintainer needs to accept the change, see "Decisions to review" in the PR description. Expect a conflict with #13 in the singleton block of src/package.ts.
Engine: om-auto-create-pr (steps: 4, --loop: no)
Current change and scope

@wojciechszyjka
wojciechszyjka marked this pull request as ready for review October 29, 2026 01:21
@pkarw pkarw self-assigned this Oct 29, 2026
@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 om-auto-continue-pr started by @pkarw at 2026-10-29T05:53:36Z. Other auto-skills will skip this PR until the lock is released.

@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 om-auto-review-pr taking over the chain lock — authoritative review and autofix. Started: 2026-10-29T05:57:34Z.

@pkarw pkarw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Code Review: fix(publish): publish host-provided singletons as peers and keep repository peer choices

Verdict

❌ request changes — the implementation and conflict resolution are coherent, but this risk-high shared-contract change still needs consumer-side integration evidence before approval.

🎯 Summary

Exported modules now treat TanStack Query and Table as host-provided caret peers with exact development versions, and linked releases avoid publishing the same package as both a peer and runtime dependency. The resolved merge preserves main's caret framework peers and catalog metadata behavior.

Findings

⛔ Blocker

  • test/framework-peers.test.cjs:72 — the tests inspect generated manifests, but do not install the generated module into a consumer and prove that a compatible host-provided TanStack version is reused without a nested copy. SDLC.md classifies shared contract surfaces as risk-high and requires the consuming side to be exercised. Add a hermetic consumer-install regression test using local fixture packages, then assert the host copy is present and the module has no nested TanStack copy.

🧪 Validation Gate

Command Status Evidence or limitation
npm run typecheck PASS TypeScript completed with no diagnostics on 09debf9.
npm test PASS 246 tests: 241 passed, 5 expected environment-dependent skips, 0 failed.
npm pack --dry-run PASS 59 files; 105.9 kB package.

💥 Breaking Changes

The peer-dependency layout is a protected published-package contract. The changelog and compatibility table document the migration for newly exported or republished modules; already published versions remain unchanged.

🧪 Test Coverage

Manifest generation, linked-manifest merge behavior, compatible and incompatible simple peer ranges, and stale exact dependency cleanup are covered. The missing consumer-install boundary is the blocker above.

CI pending: Tests against Open Mercato and the latest-app local release lane are still running on this head. Required CI still gates merge; a follow-up will report the result.

@pkarw pkarw assigned wojciechszyjka and unassigned pkarw Oct 29, 2026
@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

@wojciechszyjka, consumer-install integration evidence is required by the shared-contract risk gate; see #18 (review). This autofix run is adding that regression coverage now and will re-request the verdict itself.

@pkarw

pkarw commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🤖 om-auto-review-pr — 🏷️ label rationale

  • 🐛 bug — the change prevents duplicate host-provided TanStack packages from splitting types and React context.

The configured merge-queue, needs-qa, priority-medium, and risk-high labels are not defined in this repository, so their guarded mutations were skipped. Intended state: approved and queued; manual publication-path QA requested; ordinary priority; high risk because the published package layout is a shared contract surface.

@pkarw pkarw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Re-review: fix(publish): publish host-provided singletons as peers and keep repository peer choices

Verdict

✅ approve — the shared-contract evidence blocker is resolved and the final diff passes the complete local gate.

🎯 Summary

The branch now merges cleanly with main, preserves its caret framework-peer and catalog behavior, and publishes TanStack Query/Table as host-provided peers. Linked releases keep valid repository peer choices while preventing a package from remaining in both peer and runtime dependencies.

Resolved finding

  • The missing consumer boundary is covered in 628aa34: an offline npm install consumes the generated module with a compatible host-provided TanStack package and verifies there is no nested module copy.

🧪 Validation Gate

Command Status Evidence or limitation
npm run typecheck PASS TypeScript completed with no diagnostics on 133bcac.
npm test PASS 247 tests: 242 passed, 5 expected environment-dependent skips, 0 failed.
npm pack --dry-run PASS 59 files; 105.9 kB package.

💥 Breaking Changes

The protected peer-dependency layout change is documented in the changelog, guide, and compatibility contract. Existing publications do not change; new exports and republishes receive the new layout.

🧪 Test Coverage

Manifest generation, linked-release merging, compatible and incompatible simple ranges, stale exact dependency cleanup, and the consumer-install boundary are covered.

CI pending: GitHub has not registered checks for head 133bcac yet. Required CI still gates merge; a follow-up will report the result.

@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 om-auto-review-pr completed: APPROVED. Lock retained — chain continues.

One autofix iteration added the consumer-install evidence in 628aa34; the approving re-review is #18 (review). The final GitHub workflow is still running and will be reported separately.

@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 om-auto-review-pr — CI result

✅ Final head 133bcac passed all six workflow jobs, including Open Mercato integration and both local publish/install exercises. The APPROVED verdict remains unchanged.

Review: #18 (review)
Run: https://github.com/open-mercato/create-mercato-module/actions/runs/40826750764

@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 om-auto-continue-pr — resume summary

Status: complete

Merged current main and resolved the four conflicted files while preserving the host-provided peer behavior. The review autofix added hermetic consumer-install regression coverage. The full local gate passed (npm run typecheck, 247 tests with 242 passing and 5 expected skips, and npm pack --dry-run), and all six GitHub CI jobs passed. PR #18 is mergeable and approved. Configured pipeline, QA, priority, and risk labels were unavailable; the existing bug label was preserved.

@pkarw

pkarw commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🤖 om-auto-continue-pr completed. Status: complete. Lock released.

@wojciechszyjka
wojciechszyjka requested a review from pkarw October 29, 2026 15:41
@pkarw
pkarw merged commit f83233d into main Oct 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants