[PR #1315] [CLOSED] fix(symbols): discover emitted Swift protocol descriptors #2795

Closed
opened 2026-10-17 21:10:21 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1315
Author: @rudycelekli
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: fix/swift-protocol-descriptor-discovery


📝 Commits (1)

  • ec11098 fix(symbols): discover emitted Swift protocol descriptors

📊 Changes

4 files changed (+52 additions, -2 deletions)

View changed files

📝 src/domain/swiftSymbolClassification.ts (+3 -1)
📝 src/domain/symbolAnalysis.test.ts (+22 -0)
📝 src/domain/symbolAnalysis.ts (+5 -1)
📝 tests/boundary/mcp/enhancedTools.04-uses-complete-inventories-inline.test.ts (+22 -0)

📄 Description

The public get_objc_protocols tool advertises Swift protocol discovery but only recognizes legacy _TtP labels. Apple swiftc emits the current protocol descriptor _$s4main7ScoringMp, which is absent from the inventory; the shared Swift classifier also leaves it unclassified because descriptor names omit the nominal P marker before Mp. Decode that exact descriptor suffix after the existing literal module/nominal parser, and include only classified Mp descriptor labels in protocol discovery. Preserve unknown substitution encodings and exclude requirement methods and nonprotocol descriptors.

An owned public protocol Scoring { func score() -> Int } fixture compiled with swiftc -emit-object -module-name main confirms the emitted _$s4main7ScoringMp descriptor. Regression tests exercise classification and public MCP discovery, with method/nonprotocol controls.

Validation: baseline 4 failed regressions and 31 passing controls; fixed affected suites pass all 37 tests. npm run check passes all 6 tasks and git diff --check passes with pinned Node 24.18.0/npm 11.16.0. No real provider or full repository certification is claimed. Prepared with AI assistance.

Hosted validation: Hosted Static checks fail at jscpd on exact merge base 8b4c359135: unchanged 8041 duplicated lines and 730 clones already fail the 2.5% threshold before this PR. The original campaign base passes. Hosted other completed lanes pass; this inherited failure remains open.


🔄 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/1315 **Author:** [@rudycelekli](https://github.com/rudycelekli) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/swift-protocol-descriptor-discovery` --- ### 📝 Commits (1) - [`ec11098`](https://github.com/morluto/rea/commit/ec11098a9e6d37c1270bb3779510719b839c5cc4) fix(symbols): discover emitted Swift protocol descriptors ### 📊 Changes **4 files changed** (+52 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/swiftSymbolClassification.ts` (+3 -1) 📝 `src/domain/symbolAnalysis.test.ts` (+22 -0) 📝 `src/domain/symbolAnalysis.ts` (+5 -1) 📝 `tests/boundary/mcp/enhancedTools.04-uses-complete-inventories-inline.test.ts` (+22 -0) </details> ### 📄 Description The public get_objc_protocols tool advertises Swift protocol discovery but only recognizes legacy _TtP labels. Apple swiftc emits the current protocol descriptor _$s4main7ScoringMp, which is absent from the inventory; the shared Swift classifier also leaves it unclassified because descriptor names omit the nominal P marker before Mp. Decode that exact descriptor suffix after the existing literal module/nominal parser, and include only classified Mp descriptor labels in protocol discovery. Preserve unknown substitution encodings and exclude requirement methods and nonprotocol descriptors. An owned `public protocol Scoring { func score() -> Int }` fixture compiled with `swiftc -emit-object -module-name main` confirms the emitted `_$s4main7ScoringMp` descriptor. Regression tests exercise classification and public MCP discovery, with method/nonprotocol controls. Validation: baseline 4 failed regressions and 31 passing controls; fixed affected suites pass all 37 tests. `npm run check` passes all 6 tasks and `git diff --check` passes with pinned Node 24.18.0/npm 11.16.0. No real provider or full repository certification is claimed. Prepared with AI assistance. Hosted validation: Hosted Static checks fail at jscpd on exact merge base 8b4c3591358ee59297d8298ede1b63d08459d817: unchanged 8041 duplicated lines and 730 clones already fail the 2.5% threshold before this PR. The original campaign base passes. Hosted other completed lanes pass; this inherited failure remains open. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:10:21 +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#2795
No description provided.