Skip to content

Fix leading-space/bare-POS fragment in ambiguous dictionary suggestions - #28

Merged
Malcolmnixon merged 2 commits into
mainfrom
fix/ambiguous-suggestion-empty-alternatives
Sep 29, 2026
Merged

Malcolmnixon merged 2 commits into
mainfrom
fix/ambiguous-suggestion-empty-alternatives

Conversation

@Malcolmnixon

Copy link
Copy Markdown
Member

Pull Request

Description

Fixes a formatting defect in ambiguous STE100-DICT dictionary findings: when a candidate
sense had no alternatives at all (a pure role restriction, disallowed with no suggested
replacement word), it was still included in the combined Suggestion string, producing a
stray leading-space/bare-part-of-speech fragment such as " (adjective)" with no term before
it. This is reported in the integrator write-up as a data-hygiene defect in dictionary
suggestion formatting.

Such candidates are now excluded from the Suggestion string; their role restriction is still
surfaced via the diagnostic message's "possible corrections" text (unaffected).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code quality improvement

Related Issues

Closes #

Pre-Submission Checklist

Build and Test

  • Code builds successfully and all tests pass: pwsh ./build.ps1 (1347/1347 passed)
  • Code produces zero warnings

Code Quality

  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

  • All linters pass: pwsh ./lint.ps1 (clean)

Testing

  • Added unit tests for new functionality (regression test reproducing the exact fragment,
    confirmed failing before the fix and passing after)
  • Updated existing tests if behavior changed (no existing test assertions changed)
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable) - not applicable, no user-facing CLI/schema change
  • Updated docs/ documentation (if applicable) - design and verification docs updated
  • Added code examples for new features (if applicable) - not applicable
  • Updated requirements.yaml (if applicable) - added new test to the existing
    Ste100Mark-Linting-DictionaryPos requirement's traceability list

Additional Notes

No user-visible schema or behavior change beyond the corrected suggestion string content;
existing tests for other ambiguous/confident dictionary cases pass unchanged.

An ambiguous dictionary candidate sense with no alternatives at all (a pure
role restriction disallowed with no suggested replacement word) previously
left a stray fragment like ' (adjective)' in the combined Suggestion string.
Such candidates are now excluded from the suggestion; their role restriction
is still surfaced via the message's 'possible corrections' text.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 29, 2026 20:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The regression test must verify that the role restriction remains in the diagnostic message.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Fixes ambiguous dictionary suggestions by omitting senses without alternatives while preserving diagnostic role restrictions.

Changes:

  • Filters empty-alternative senses from suggestions.
  • Adds regression coverage.
  • Updates design, verification, and requirement documentation.
File Summary
test/​DemaConsulting.Ste100Mark.Tests/​Linting/​DictionaryCheckerTests.cs Adds regression coverage; should also assert the adjective clause remains in the diagnostic message.
src/​DemaConsulting.Ste100Mark/​Linting/​DictionaryChecker.cs Excludes candidates without alternatives from suggestions.
docs/​verification/​ste100-mark/​linting.md Documents verification coverage.
docs/​reqstream/​ste100-mark/​linting.yaml Links the test to the requirement.
docs/​design/​ste100-mark/​linting/​dictionary-checker.md Documents suggestion behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test/DemaConsulting.Ste100Mark.Tests/Linting/DictionaryCheckerTests.cs Outdated
…idate

Address review feedback: the regression test now also asserts that the
adjective candidate's role-restriction clause ('as a adjective') remains
present in the diagnostic message, alongside the noun candidate's
alternative, confirming the fix only trims the empty fragment from the
Suggestion field and does not drop the role-restriction information itself.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 29, 2026 21:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Approval readiness is not unanimous, so final human review is warranted.

Review effort: Lite
Findings: None

Resolved since last review (1)

@Malcolmnixon
Malcolmnixon merged commit e04e124 into main Sep 29, 2026
16 checks passed
@Malcolmnixon
Malcolmnixon deleted the fix/ambiguous-suggestion-empty-alternatives branch September 29, 2026 21:36
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