Skip to content

refactor(git-read): use shared search seams - #368

Open
seekskyworld wants to merge 5 commits into
openpi-dev:mainfrom
seekskyworld:refactor/issue-73-shared-search-seam
Open

seekskyworld wants to merge 5 commits into
openpi-dev:mainfrom
seekskyworld:refactor/issue-73-shared-search-seam

Conversation

@seekskyworld

@seekskyworld seekskyworld commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Implements the cross-extension import slice of #73. git-read imports file-search private output/process helpers, coupling extension internals that share the same bounded execution behavior.

Value

Give both consumers a single, explicit shared implementation and prevent new value imports from reintroducing that private dependency.

Approach

Move the real implementations to shared/search-output.ts and shared/search-process.ts, update consumers and tests, and add a narrowly scoped import-boundary guard. The guard allows pure type references and existing rendering seams; it checks POSIX and Windows paths and rejects value, mixed and re-export imports. Contributor history and current main f98d6a4 are retained.

Validation

Final head: f128a2a.

  • Focused runtime and cross-platform boundary checks: 19 passed on local Node 26 and Node 22.23.2.
  • bun run check: passed.
  • bun run test: passed; Node 2452 passed / 9 skipped, UI 1338 passed in 88 files.
  • Head/tree stayed frozen throughout the final run; the worktree is clean.
  • Two independent final reviews passed on this exact head. The Windows separator defect found during review is fixed; earlier-head results are historical.

Fresh final-head CI passed all 18 checks. Independent last-push approval remains required; the existing CHANGES_REQUESTED review has not been dismissed. No installed-runtime or manual Pi smoke is claimed.

Impact

Runtime implementation is moved without changing timeout, cancellation, 10 MiB capture, truncation or temporary-file cleanup semantics. No user-visible UI, tool schema, model context, persisted configuration or lifecycle change. The guard is limited to this shared boundary; remaining #73 work stays out of scope.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head review: a9d7ec4

[P1] This moves the import name but does not remove the cross-extension private dependency required by Issue #73. extensions/shared/search-output.ts and search-process.ts are only re-export shims whose implementations still come from ../file-search/src/output.ts and ../file-search/src/process.ts. The shared layer therefore depends on a feature extension private src tree; refactoring or packaging file-search can still break git-read through the new alias.

Issue #73 acceptance requires extensions to stop importing another extension private implementation, and the PR claims a stable shared seam. Please move the reusable bounded-output/process implementation into extensions/shared (or define a genuinely owner-neutral shared module), then have both file-search and git-read depend on it. Add an import-boundary guard so a future shared-to-feature dependency fails CI.

Verification boundary: exact-head Standards + Spec static review; no runtime behavior change is claimed, so the blocker is the unresolved dependency direction itself.

Move bounded search output/process implementations into extensions/shared
so file-search and git-read depend on an owner-neutral module. Add an
import-boundary regression so shared cannot depend on feature extensions.
@seekskyworld
seekskyworld force-pushed the refactor/issue-73-shared-search-seam branch from a9d7ec4 to d0572d0 Compare September 13, 2026 06:17
@seekskyworld

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and addressed the P1:

  • Moved the bounded output/process implementation into extensions/shared/search-output.ts and search-process.ts.
  • file-search and git-read now depend on that shared module; there is no re-export shim back into file-search/src.
  • Added tests/extensions/shared/import-boundary.test.ts so a future shared→feature import fails CI.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

审查提交:d0572d0758e9c313f1ed1c893e85f5fa473f90db。

本轮未发现新的阻断问题。以下结论仅覆盖所列验证范围,不是合并批准。

验证范围

Shared implementation is now physically moved, not re-exported from feature internals: old architecture finding resolved. Full rename-aware diff reviewed. 14 Node tests and 30 file-search Vitest tests pass.

限制与后续

Needs current-main integration and refreshed final-head checks. No native Windows runtime run locally.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the complete rename-aware diff again. Shared bounded capture implementation is physically moved to shared modules; both consumers and tests use the new imports. No blocking issue found. Required CI passed on this head; refreshed current-main checks are required before merge. Exact reviewed head: d0572d0.

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Integration head c6cd37a fails all three Node CI jobs. [P2] Make the new import-boundary gate compatible with current main (tests/extensions/shared/import-boundary.test.ts:7-21). The regex scans every shared source and rejects the existing type-only import from ../subagents/src/domain.ts in web-observer-registry.ts. Node 24 job 108427629093 reports actual offenders [web-observer-registry.ts] versus expected []. The production search-module move remains sound, but this new required test prevents the integrated branch from passing bun run test. Define the intended type/runtime boundary and accommodate or migrate the existing shared type contract, then rerun final-head CI. This is a deterministic integration failure, not an infrastructure retry.

This branch has not been deployed

No deployments
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.

2 participants