Skip to content

test(index): preserve submodule source boundaries - #4719

Closed
ScriptedAlchemy wants to merge 5 commits into
masterfrom
fix/registered-submodule-source-walk
Closed

ScriptedAlchemy wants to merge 5 commits into
masterfrom
fix/registered-submodule-source-walk

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Scope

Refs #4593; does not resolve it. The earlier walker-only submodule feature is withdrawn. A registered parent gitlink does not capture child files or establish their freshness, and allowing live grep/AST traversal alone makes those surfaces disagree with indexed retrieval.

The final patch keeps the existing nested-repository boundary, removes the custom submodule discovery subprocesses and the path-policy APIs added only for that discovery, and retains strict handling of walk errors in the test helper. It adds no production feature switch or fallback.

Regression coverage

  • A real initialized, parent-registered submodule stays outside parent source under broad, exact-file and wildcard includes, including explicit search scopes. Ordinary parent source remains accessible.
  • Malformed .gitmodules cannot break an unrelated source include or admit a nested repository.

The prior feature-admission tests are replaced because the incomplete feature is deliberately withdrawn, not because its failing checks are being hidden. Existing baseline source-walk tests remain.

Validation

A local native Git fixture verified that the child file exists, the parent index records only the gitlink, and Git confirms the child/superproject relation. A second probe reproduced the removed discovery command failing on malformed .gitmodules, even though the intended include was unrelated. The publication blob matches the locally reviewed file exactly.

The Rust source-walk regressions, Rust formatting, and full Bazel/native matrix have not executed locally: this environment has no checkout or Bazel/Rust toolchain. Hosted CI must validate the current revision before merge. The Git probes are not Rust test results.

Full submodule support still requires authenticated capture, freshness and indexed retrieval to be delivered together. Keep #4593 open.


Devin Review

@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e59a83c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

Use the canonical compiled include policy to identify reachable submodule
paths, including a single file or glob below the gitlink. Restrict file
admission inside opted-in submodules to matches of those explicit includes;
a broad traversal may not silently expose unrelated source files. Keep the
normal exclude policy and authenticated gitlink/superproject checks.

Add domain policy and real Git-submodule walker regressions. Rust/Bazel and
full integration validation remain for hosted CI; production scheduler
candidate enumeration is a separate known blocker before merge.
Let Git validate object IDs instead of assuming SHA-1 width, and remove
only its output newline rather than whitespace belonging to a root path.
Reuse one real Git fixture for SHA-1, SHA-256 and Unix whitespace roots;
keep narrow includes, unrelated-clone rejection and removed-gitlink checks.
Fail the walk fixture on entry errors instead of silently dropping them.

Native Git mechanism probes pass. Rust/Bazel execution remains pending.
Keep the established repository boundary: a path include and parent
gitlink do not provide child capture, freshness or indexed retrieval.
Remove discovery subprocesses and the now-unused path-policy APIs instead
of exposing files only to live search.

Retain strict walk fixture errors. Add real registered-submodule coverage
for broad, exact and glob includes with and without explicit search scope,
and a regression for malformed metadata breaking unrelated source reads.

Native Git fixture and failure probes pass. Rust/Bazel tests, formatting
and the complete native matrix have not run in this tool-limited session.
This withdraws the partial feature; it does not complete issue #4593.
@ScriptedAlchemy ScriptedAlchemy changed the title fix(index): admit explicitly included Git submodules test(index): preserve submodule source boundaries Nov 3, 2026

ScriptedAlchemy commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner Author

Review follow-up: I pushed 7da327e on top of the concurrent narrow-include fix d2de698, removing SHA-1-only OID assumptions and whitespace trimming, with shared real-Git fixtures. Four native Git mechanism fixtures passed; the Rust walker tests did not execute locally.

Current-head reconciliation: the repair lane subsequently advanced to 0d0e718 and withdrew the incomplete submodule-admission feature. I reviewed that current diff: it removes the custom discovery commands and discovery-only policy APIs, retains strict walk-error assertions, and adds real registered-submodule boundary and malformed-.gitmodules regressions. I did not restore the superseded production logic or overwrite the concurrent change.

The indexed-capture gap is material: authenticated capture, child freshness and indexed retrieval must land together rather than making live grep/AST disagree with the index. The boundary-preserving replacement is the appropriate scope until that is implemented. Keep #4593 open. My earlier Git mechanism probes do not validate the new Rust boundary regressions; hosted CI on the current head is still required.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Consolidated into #4742 (integrate/open-pull-requests) at the captured head shown in its description, as requested. Continue review and further fixes on #4742. This closure does not assert CI readiness; the replacement remains draft. Source branch retained.

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.

1 participant