[PR #2896] [CLOSED] fix(reference-source): classify configured multi-segment generated paths #5478

Closed
opened 2026-10-31 01:06:58 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2896
Author: @ShitK
Created: 10/13/2026
Status: ❌ Closed

Base: main ← Head: fix/reference-source-generated-paths


📝 Commits (1)

  • a89bcdc fix(reference-source): classify configured multi-segment generated paths

📊 Changes

2 files changed (+57 additions, -22 deletions)

View changed files

📝 src/domain/referenceSourceClassification.ts (+34 -22)
📝 tests/boundary/filesystem/referenceSourceImport.test.ts (+23 -0)

📄 Description

Summary

Importing docs/api/client.ts currently produces documentation and source classifications but omits the configured generated classification. Preserve all three labels for files under this path, including nested packages and case variants.

Fixes #2604.

Problem and expected behavior

GENERATED_DIRECTORY_NAMES contains docs/api, but the classifier compares each individual path segment against that set. The two-segment rule can never match. Matching must respect complete, adjacent segments: docs/apis, mydocs/api, docs/manual/api, and docs/api.ts must not acquire the generated label from this rule.

Change and scope

Separate multi-segment generated-directory rules from single-directory names. Normalize classification segments once and match the configured path as a contiguous sequence, retaining directory-entry classification as well as file classification. Original inventory paths remain unchanged.

Extend the existing filesystem import regression with positive cases, boundary negatives, directory entries, and existing basename/single-directory controls. No new provider or execution capability is introduced; advance maintainer scope approval is not applicable to this routine metadata correction.

Contract and boundary impact

  • Semantic owner: src/domain/referenceSourceClassification.ts.
  • Observable change: the existing imported graph classifications field includes the missing configured label. No CLI/MCP schema or tool-catalog change.
  • Provider/platform: provider-independent TypeScript classification; verified on macOS arm64.
  • Evidence: retain original paths, language classifications, and the existing import behavior. No change to target authority or cleanup.
  • Package/install/generated metadata: no changes.
  • Expected effect: read an existing caller-selected source tree and correct its classification metadata; this change adds no process execution, mutation, or network behavior.

Evidence and regression coverage

On the base implementation, the expanded existing import test fails for docs/api/client.ts because generated is absent (13 passed, 1 failed). With the fix, all 14 tests in that file pass.

On the previously verified base 2b98fc5f5, the compiled public CLI also returned the expected classifications for seven source-file paths, with exit code 0 and no parse failures. Representative result:

{"path":"docs/api/client.ts","classifications":["documentation","generated","source"]}

Validation performed

Node.js 24.18.0, npm 11.16.0, macOS arm64; locked dependencies installed with npm ci.

On the current PR base 72b9ab4af:

node_modules/.bin/vitest run src/domain/referenceSourceGraph.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts tests/boundary/filesystem/referenceSourceTestFilenames.test.ts tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts tests/boundary/filesystem/referenceSourceDockerfileLanguage.test.ts
# 5 files, 46 tests passed; these tests use source imports

The normal pre-commit hook passed formatting and lint for both changed files. git diff --check passed.

The standard npm run test:focused -- <same files> command is blocked before tests by an upstream compile error: src/application/SupportedClients.ts:542,744,809 uses the devin format outside the declared union. That file is unchanged from the base. The direct source tests above still pass.

The normal pre-push hook ran and failed on the unchanged duplicate join import. This draft was published with a one-time pre-push bypass; the failures are not treated as passing checks.

The branch also inherits the following check failures:

  • Formatting: unchanged src/domain/functionComparison.test.ts and src/ida/IdaOperationRunner.ts fail oxfmt --check.
  • Typechecking: unchanged tests/boundary/cli/clientProfileLifecycle.test.ts:297 has TS2345; unchanged tests/boundary/mcp/ghidraInventoryMcp.test.ts:4,17 has TS2300 for duplicate join. A clean archive of the original base 2b98fc5f5, using the same dependencies, reproduced these diagnostics.
  • Full lint: the same duplicate join import causes an error.

On the original base 2b98fc5f5, the same patch passed the normal focused command (46 tests), seven compiled CLI classification checks, targeted formatting/lint, knip, metadata checks, architecture guards and module-boundary checks. npm run check was blocked by the inherited errors above. Those earlier results are not claimed as reruns against the current base.

Compatibility and remaining coverage

No breaking API changes or migration. No native engine is required for this correction. The full repository test suite, CI, and other host platforms were not run. This PR makes no performance-improvement claim.

Before merge

  • One focused outcome, linked issue, conventional title.
  • Base regression observed; changed behavior and boundary cases verified.
  • Reviewed the two-file diff; no generated files or personal notes included.
  • Resolve or otherwise account for the known upstream check failures and obtain current CI results.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/2896 **Author:** [@ShitK](https://github.com/ShitK) **Created:** 10/13/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/reference-source-generated-paths` --- ### 📝 Commits (1) - [`a89bcdc`](https://github.com/morluto/rea/commit/a89bcdca786ca66880f1081696a96d292c3636f2) fix(reference-source): classify configured multi-segment generated paths ### 📊 Changes **2 files changed** (+57 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/referenceSourceClassification.ts` (+34 -22) 📝 `tests/boundary/filesystem/referenceSourceImport.test.ts` (+23 -0) </details> ### 📄 Description ### Summary Importing `docs/api/client.ts` currently produces `documentation` and `source` classifications but omits the configured `generated` classification. Preserve all three labels for files under this path, including nested packages and case variants. Fixes #2604. ### Problem and expected behavior `GENERATED_DIRECTORY_NAMES` contains `docs/api`, but the classifier compares each individual path segment against that set. The two-segment rule can never match. Matching must respect complete, adjacent segments: `docs/apis`, `mydocs/api`, `docs/manual/api`, and `docs/api.ts` must not acquire the generated label from this rule. ### Change and scope Separate multi-segment generated-directory rules from single-directory names. Normalize classification segments once and match the configured path as a contiguous sequence, retaining directory-entry classification as well as file classification. Original inventory paths remain unchanged. Extend the existing filesystem import regression with positive cases, boundary negatives, directory entries, and existing basename/single-directory controls. No new provider or execution capability is introduced; advance maintainer scope approval is not applicable to this routine metadata correction. ### Contract and boundary impact - Semantic owner: `src/domain/referenceSourceClassification.ts`. - Observable change: the existing imported graph `classifications` field includes the missing configured label. No CLI/MCP schema or tool-catalog change. - Provider/platform: provider-independent TypeScript classification; verified on macOS arm64. - Evidence: retain original paths, language classifications, and the existing import behavior. No change to target authority or cleanup. - Package/install/generated metadata: no changes. - Expected effect: read an existing caller-selected source tree and correct its classification metadata; this change adds no process execution, mutation, or network behavior. ### Evidence and regression coverage On the base implementation, the expanded existing import test fails for `docs/api/client.ts` because `generated` is absent (13 passed, 1 failed). With the fix, all 14 tests in that file pass. On the previously verified base `2b98fc5f5`, the compiled public CLI also returned the expected classifications for seven source-file paths, with exit code 0 and no parse failures. Representative result: ```json {"path":"docs/api/client.ts","classifications":["documentation","generated","source"]} ``` ### Validation performed Node.js 24.18.0, npm 11.16.0, macOS arm64; locked dependencies installed with `npm ci`. On the current PR base `72b9ab4af`: ```sh node_modules/.bin/vitest run src/domain/referenceSourceGraph.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts tests/boundary/filesystem/referenceSourceTestFilenames.test.ts tests/boundary/filesystem/referenceSourceTypeScriptExtensions.test.ts tests/boundary/filesystem/referenceSourceDockerfileLanguage.test.ts # 5 files, 46 tests passed; these tests use source imports ``` The normal pre-commit hook passed formatting and lint for both changed files. `git diff --check` passed. The standard `npm run test:focused -- <same files>` command is blocked before tests by an upstream compile error: `src/application/SupportedClients.ts:542,744,809` uses the `devin` format outside the declared union. That file is unchanged from the base. The direct source tests above still pass. The normal pre-push hook ran and failed on the unchanged duplicate `join` import. This draft was published with a one-time pre-push bypass; the failures are not treated as passing checks. The branch also inherits the following check failures: - Formatting: unchanged `src/domain/functionComparison.test.ts` and `src/ida/IdaOperationRunner.ts` fail `oxfmt --check`. - Typechecking: unchanged `tests/boundary/cli/clientProfileLifecycle.test.ts:297` has TS2345; unchanged `tests/boundary/mcp/ghidraInventoryMcp.test.ts:4,17` has TS2300 for duplicate `join`. A clean archive of the original base `2b98fc5f5`, using the same dependencies, reproduced these diagnostics. - Full lint: the same duplicate `join` import causes an error. On the original base `2b98fc5f5`, the same patch passed the normal focused command (46 tests), seven compiled CLI classification checks, targeted formatting/lint, `knip`, metadata checks, architecture guards and module-boundary checks. `npm run check` was blocked by the inherited errors above. Those earlier results are not claimed as reruns against the current base. ### Compatibility and remaining coverage No breaking API changes or migration. No native engine is required for this correction. The full repository test suite, CI, and other host platforms were not run. This PR makes no performance-improvement claim. ### Before merge - [x] One focused outcome, linked issue, conventional title. - [x] Base regression observed; changed behavior and boundary cases verified. - [x] Reviewed the two-file diff; no generated files or personal notes included. - [ ] Resolve or otherwise account for the known upstream check failures and obtain current CI results. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:06:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5478
No description provided.