Skip to content

feat(adt-plugin-gcts): spec file-name grammar + full source-extension coverage - #234

Open
ThePlenkov wants to merge 1 commit into
aff/w1-familiesfrom
aff/w2-singletons
Open

ThePlenkov wants to merge 1 commit into
aff/w1-familiesfrom
aff/w2-singletons

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

User description

  • parseGctsFilename: .properties files get their spec grammar —
    {name}.{type}.{lang}.properties and
    {name}.{type}.{content_type}.{lang}.properties (PROG selections/
    headings/texts). Previously the 5-part shape misparsed the type
    segment into the name; every upstream example filename now parses.
  • TYPE_TO_SOURCE_EXT: full spec surface — .acds for all CDS-family
    stubs (ddla ddlx dtsc dtix dteb dtdc dras drty dsfd), .csn (csnm),
    .xdp (sfpf); .ddic + .properties recognized in parse.
  • i18n.propertiesFilename: optional content-type segment.
  • deserializer SOURCE_EXTENSIONS: acds/abdl/csn/xdp/ddic/properties so
    companion files are collected, not silently skipped.

tests/aff/filename-grammar.test.ts: 10/10 incl. whole-corpus sweep;
existing format tests 28/28 unchanged.

Divergence noted for W5: gCTS .asddls/.asdcls kept for DDLS/DCLS
(test-pinned) though upstream AFF examples uniformly use .acds.

Generated with Devin

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Stack created with GitHub Stacks CLI • Give Feedback 💬

Summary by Sourcery

Align gCTS filename handling and deserialization with the AFF specification so source files, translations, and DOCU companions round-trip correctly.

New Features:

  • Support AFF-compliant parsing and generation for translation filenames with optional content-type and language segments.
  • Recognize and generate the full set of additional AFF source formats, including CDS-family, CSNM, and SFPF files.
  • Preserve DOCU companions and .properties translations during gCTS deserialization.

Bug Fixes:

  • Correct filename partitioning so translated properties files no longer misidentify the object type or name.
  • Prevent DOCU companion metadata from overwriting the primary object metadata.

Enhancements:

  • Expand deserialization companion-file collection and bounded content loading for newly supported source and translation files.

Tests:

  • Add filename grammar coverage for upstream AFF examples, source-extension mappings, and a whole-corpus parsing sweep.

Summary by cubic

Aligns adt-plugin-gcts filename parsing, generation, and deserialization with the AFF spec grammar so every upstream example filename now parses correctly.

  • .properties files now parse per {name}.{type}.{lang}.properties and {name}.{type}.{content_type}.{lang}.properties; the 5-part shape previously misparsed the type segment into the name.
  • TYPE_TO_SOURCE_EXT adds .acds for all CDS-family types, .csn for CSNM, and .xdp for SFPF; .ddic and .properties are recognized in parsing.
  • propertiesFilename and createPropertiesFiles accept an optional content-type segment.
  • The deserializer's SOURCE_EXTENSIONS now collects .acds, .abdl, .csn, .xdp, .ddic, and .properties companion files.
  • gCTS keeps .asddls/.asdcls for DDLS/DCLS even though upstream AFF examples use .acds (test-pinned divergence).
  • Adds grammar tests for upstream example shapes plus a whole-corpus parsing sweep.

Written for commit f6c7257. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Keep AFF translations and companion files intact during gCTS imports

What Changed

  • .properties filenames with content type and language are parsed and generated with the correct object name and type.
  • DOCU files and translations are retained with their owning object instead of being skipped or mistaken for metadata or source.
  • Imports recognize additional AFF source formats, including CDS-family, CSNM, Adobe form, and DDIC files.

Impact

✅ Correct object names for translated properties files
✅ Translation and DOCU companions retained on import
✅ CDS, CSNM, and Adobe form sources included in imports

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@ThePlenkov
ThePlenkov added this pull request to stack #236 October 22, 2026 14:58
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bad767cd-b1b6-4862-8cf5-41a989176c77
Commits

Reviewing files that changed from the base of the PR and between 4bd6f30 and 3bb5394.

Files selected for processing: 5
  • openspec/changes/add-aff-full-coverage/tasks.md
  • packages/adt-plugin-gcts/src/lib/deserializer.ts
  • packages/adt-plugin-gcts/src/lib/format/filename.ts
  • packages/adt-plugin-gcts/src/lib/format/i18n.ts
  • packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Aligns AFF/gCTS filename parsing, generation, and deserialization with the specification by correctly handling content-typed translation properties, recognizing the full source-extension surface, preserving DOCU and translation companions, and validating behavior against upstream examples and a corpus-wide sweep.

Flow diagram for AFF/gCTS filename parsing

flowchart LR
    F["AFF/gCTS filename"] --> E{"Extension"}
    E -->|json| M["Parse metadata name and type"]
    E -->|properties| P["Parse name, type, and optional suffix"]
    E -->|known source extension| S["Parse name, type, and optional suffix"]
    E -->|unknown extension| U["Ignore"]
Loading

Flow diagram for typed translation properties

flowchart LR
    I["Translation entries"] --> C{"Content type provided?"}
    C -->|no| L["propertiesFilename(name, type, language)"]
    C -->|yes| V{"Language provided?"}
    V -->|yes| T["propertiesFilename(name, type, language, contentType)"]
    V -->|no| X["Throw Error"]
    L --> O["name.type.language.properties"]
    T --> Q["name.type.content_type.language.properties"]
Loading

File-Level Changes

Change Details Files
Reworked AFF/gCTS filename parsing around extension-specific grammars, including typed translation property files and broader source-format recognition.
  • Added dedicated parsing for metadata, source, and .properties filenames.
  • Preserved composite translation suffixes such as texts.en, selections.en, and headings.en.
  • Added source-extension mappings for CDS-family, CSNM, and SFPF types while retaining gCTS DDLS/DCLS extensions.
  • Recognized .ddic and companion source extensions during parsing.
packages/adt-plugin-gcts/src/lib/format/filename.ts
Extended translation filename generation to support optional content types while rejecting ambiguous output.
  • Added content-type support to propertiesFilename and createPropertiesFiles.
  • Generated five-part {name}.{type}.{content_type}.{language}.properties filenames when applicable.
  • Required a language when a content type is supplied.
packages/adt-plugin-gcts/src/lib/format/i18n.ts
Expanded deserialization to collect and expose additional source and companion files instead of dropping them.
  • Added AFF source extensions to collection, including acds, abdl, csn, xdp, and ddic.
  • Separated DOCU companions from metadata anchors and exposed parsed or raw content as data.docu.
  • Collected .properties companions keyed by parsed suffix and exposed them as data.properties.
  • Read companion files in parallel before object payload construction.
packages/adt-plugin-gcts/src/lib/deserializer.ts
Added conformance tests for filename grammar, extension mappings, and upstream AFF corpus coverage.
  • Covered typed translation filenames and PROG content types.
  • Covered representative source extensions and type-to-extension mappings.
  • Added a corpus-wide parsing sweep against upstream AFF examples.
packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit 3bb5394
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6add403f6980f1adfb47a6ff

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Summary

This PR extends the gCTS/AFF filename grammar with .properties spec support, adds a full TYPE_TO_SOURCE_EXT surface for CDS-family types, and expands SOURCE_EXTENSIONS in the deserializer. The overall direction is correct, but there are four blocking defects that must be addressed before merge:

Critical Issues

  1. parseGctsFilename — dot-in-name breakage (4-part and 3-part .properties) (filename.ts, lines 154–166): Both the 4-part ({name}.{type}.{lang}.properties) and 3-part ({name}.{type}.properties) branches hard-code parts[0]/parts[1] as name and type. Any object whose name contains a dot (valid in ABAP) silently produces a wrong name/type, causing the deserializer to orphan those source files. The fix is to use parts.slice(0, -3).join('.') + parts.at(-3) (4-part) and parts.slice(0, -2).join('.') + parts.at(-2) (3-part), mirroring the existing ≥5-part branch. Comments with suggestions have been posted on each branch.

  2. Serializer/parser round-trip broken for content_type segment (i18n.ts, lines 49–52): createPropertiesFiles never passes contentType to propertiesFilename, so the serializer can never emit 5-part filenames even though the parser can now read them. A corpus file with a content_type segment (e.g. prog.selections.en.properties) would parse with a composite suffix selections.en that has no corresponding serializer output, making the round-trip asymmetric and breaking checkin for such objects.

  3. Crash on missing submodule in tests (filename-grammar.test.ts, line 128): walk(AFF_EXAMPLES) calls readdirSync on a git submodule path that won't exist in a fresh CI checkout, causing a synchronous ENOENT crash that aborts the entire test suite. Add an existsSync guard.

  4. Unused import (filename-grammar.test.ts, line 11): readFileSync is imported but never used, which will fail noUnusedLocals/lint in CI.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread packages/adt-plugin-gcts/src/lib/format/filename.ts Outdated
Comment thread packages/adt-plugin-gcts/src/lib/format/filename.ts
Comment thread packages/adt-plugin-gcts/src/lib/format/i18n.ts
Comment thread packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
Comment thread packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts Outdated
@codacy-production

codacy-production Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 127 complexity · 4 duplication

Metric Results
Complexity 127
Duplication 4

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@deepsource-io

deepsource-io Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 4bd6f30...3bb5394 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Secrets Oct 24, 2026 11:33p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@nx-cloud

nx-cloud Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 2d554f8

Command Status Duration Result
nx affected -t lint test build e2e-ci --verbose... ✅ Succeeded 1m 38s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-22 18:18:42 UTC

@ThePlenkov
ThePlenkov force-pushed the aff/w2-singletons branch 2 times, most recently from 57a71da to a878f0d Compare October 24, 2026 22:22
@ThePlenkov
ThePlenkov marked this pull request as ready for review October 24, 2026 22:32

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a878f0d7fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/adt-plugin-gcts/src/lib/deserializer.ts

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts" line_range="122" />
<code_context>
+        if (e.isDirectory()) walk(full);
+        else if (dir.includes('examples') && e.name.includes('.')) {
+          const p = parseGctsFilename(e.name);
+          if (!p?.type) unparsed.push(e.name);
+        }
+      }
</code_context>
<issue_to_address>
**Wrong corpus parses pass**

When the parser produces a truthy but incorrect type for example filenames, when `parseGctsFilename` returns a nonempty but incorrect type for corpus entries, the `no example filename is unparsable` test records a failure only for `!p?.type` at line 122, so even assigning every filename the same type passes the sweep.

Check parsed name, type, and extension against expected values for each corpus filename, or use a reference parser to verify the results.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and a filename-parsing mistake could attach a DOCU or translation companion to the wrong object or suffix, and a downstream import could write that content into the system. Correcting the files and importing again can repair the affected values, but reverting the parser alone would not undo an import already performed.

Blocking findings: packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts:122


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/adt-plugin-gcts/src/lib/deserializer.ts Outdated
Comment thread packages/adt-plugin-gcts/src/lib/format/i18n.ts
@gitar-bot

gitar-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts Outdated
Comment thread packages/adt-plugin-gcts/src/lib/deserializer.ts Outdated
@codacy-production

codacy-production Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 137 complexity · 20 duplication

Metric Results
Complexity 137
Duplication 20

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 4 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread openspec/changes/add-aff-full-coverage/tasks.md Outdated
… coverage

- parseGctsFilename: .properties files get their spec grammar —
  {name}.{type}.{lang}.properties and
  {name}.{type}.{content_type}.{lang}.properties (PROG selections/
  headings/texts). Previously the 5-part shape misparsed the type
  segment into the name; every upstream example filename now parses.
- TYPE_TO_SOURCE_EXT: full spec surface — .acds for all CDS-family
  stubs (ddla ddlx dtsc dtix dteb dtdc dras drty dsfd), .csn (csnm),
  .xdp (sfpf); .ddic + .properties recognized in parse.
- i18n.propertiesFilename: optional content-type segment.
- deserializer SOURCE_EXTENSIONS: acds/abdl/csn/xdp/ddic/properties so
  companion files are collected, not silently skipped.

tests/aff/filename-grammar.test.ts: 10/10 incl. whole-corpus sweep;
existing format tests 28/28 unchanged.

Divergence noted for W5: gCTS .asddls/.asdcls kept for DDLS/DCLS
(test-pinned) though upstream AFF examples uniformly use .acds.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

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

baz: pending size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant