Skip to content

feat(adt-plugin-gcts): LIMU sub-objects + extension-aware source keys - #238

Open
ThePlenkov wants to merge 1 commit into
aff/w3-sourcefrom
aff/w4-limu
Open

ThePlenkov wants to merge 1 commit into
aff/w3-sourcefrom
aff/w4-limu

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

User description

Summary

  • Parse {parent}.{ptype}.{sub}.{stype}.{ext} LIMU filenames (func, reps, cpub, cpro, cprt, cpri, sotr, sotu) as companions of the parent object — previously silently dropped
  • Extension-aware source keys: {suffix}.{ext} for companions whose extension differs from the type's default (.properties texts, LIMU .json metadata, .xdp); main.{ext} for suffix-less companions
  • GctsSourceEntry.ext plumbed through gctsFilename so emission is fully symmetric with parsing

Test plan

  • filename-grammar.test.ts: 16/16 — incl. full upstream fugr corpus resolving to parent FUGR, sourceKey/splitSourceKey round-trips
  • existing filename.test.ts + source-companions + schema-conformance + generic-roundtrip: all green locally (node --test, no builds)

Generated with Devin

Summary by Sourcery

Preserve LIMU sub-objects and extension-specific companion files across gCTS import and export round trips.

New Features:

  • Preserve LIMU sub-object metadata and source files by associating them with their parent objects.
  • Support extension-aware companion source keys so non-default files such as JSON metadata and translated properties round-trip correctly.

Bug Fixes:

  • Prevent LIMU sub-objects and unhandled companion files from being silently dropped during gCTS deserialization and emission.

Enhancements:

  • Make filename parsing and generation symmetric for LIMU companions, source extensions, documentation, translations, and staged sources.
  • Export filename and source-key utilities for consistent companion handling across handlers.

Tests:

  • Add filename grammar and handler coverage for LIMU routing, extension-aware source-key round trips, and parent-scoped function-module files.

Chores:

  • Refresh the lockfile.

Summary by cubic

Parses LIMU sub-object files ({parent}.{ptype}.{sub}.{stype}.{ext} for func, reps, cpub, cpro, cprt, cpri, sotr, sotu) as companions of the parent object instead of silently dropping them during AFF deserialization.

Source keys now encode file extensions so companions round-trip: a companion whose extension differs from the type's default uses a {suffix}.{ext} key (.properties texts, LIMU .json metadata, .xdp), and suffix-less companions use main.{ext}. GctsSourceEntry.ext carries the override through gctsFilename, making emission fully symmetric with parsing; the new sourceKey/splitSourceKey helpers, LIMU_SUBTYPES, and gctsSourceExt are exported.

Written for commit 8103a0e. Summary will update on new commits.

View guided diff Turn on auto-fix


CodeAnt-AI Description

Preserve LIMU sub-objects and companion files in gCTS round trips

What Changed

  • LIMU files, including function-module metadata and source, now stay attached to their parent object instead of being dropped or detached.
  • Companion files such as JSON metadata and translated text retain their file type when imported and exported.
  • Documentation and translation files are emitted again even when an object type has no dedicated handling for them.
  • Namespaced objects use AFF-safe filenames so namespace slashes do not create unintended directories.

Impact

✅ LIMU files stay attached to their parent objects
✅ JSON metadata and translated text survive round trips
✅ Namespaced objects stay in the correct file path

💡 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.

@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 44 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: 5de79f7d-2cd9-4ba0-b1bb-eb6b68e41dd1
Commits

Reviewing files that changed from the base of the PR and between f92067d and 138c11d.

Files ignored due to path filters: 1
  • bun.lock is excluded by !**/*.lock
Files selected for processing: 8
  • packages/adt-plugin-gcts/src/index.ts
  • packages/adt-plugin-gcts/src/lib/aff/generic.ts
  • packages/adt-plugin-gcts/src/lib/deserializer.ts
  • packages/adt-plugin-gcts/src/lib/format/filename.ts
  • packages/adt-plugin-gcts/src/lib/handlers/base.ts
  • packages/adt-plugin-gcts/src/lib/handlers/objects/fugr.ts
  • packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
  • packages/adt-plugin-gcts/tests/handlers/wave1.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

Preserves LIMU sub-objects and extension-specific companion files through gCTS import and export by routing them to parent objects, encoding extension overrides in source keys, and making companion emission symmetric with parsing.

Sequence diagram for extension-aware gCTS companion round-trip

sequenceDiagram
    participant GctsFiles
    participant Deserializer
    participant FilenameParser
    participant AdkObject
    participant Handler
    participant GctsEmitter

    GctsFiles->>Deserializer: parseGctsFilename(path)
    Deserializer->>FilenameParser: parseGctsFilename(path)
    FilenameParser-->>Deserializer: parent type suffix extension
    Deserializer->>Deserializer: sourceKey(type, suffix, ext)
    Deserializer->>AdkObject: stagePendingSources(sources)
    AdkObject->>Handler: companionFiles(object, type, objectName, emitted)
    Handler->>Handler: splitSourceKey(key)
    Handler->>FilenameParser: gctsFilename(objectName, type, source, suffix, ext)
    FilenameParser-->>Handler: extension-aware companion path
    Handler-->>GctsEmitter: serialized companion files
Loading

Flow diagram for LIMU sub-object routing to parent objects

flowchart LR
    L["parent.ptype.sub.stype.ext"] --> P[parseGctsFilename]
    P --> R["Parent object + suffix sub.stype"]
    R --> K["sourceKey suffix.ext"]
    K --> A["Parent ADK object sources"]
    A --> E["gctsFilename parent suffix ext"]
    E --> O["LIMU companion file"]
Loading

File-Level Changes

Change Details Files
Adds parsing and parent-object routing for LIMU sub-object metadata and source files.
  • Recognize the supported LIMU subtype patterns and map them to the parent object with a compound suffix.
  • Collect LIMU JSON metadata and source companions during deserialization instead of dropping them.
  • Update function-group emission to use parent-scoped LIMU filenames.
packages/adt-plugin-gcts/src/lib/format/filename.ts
packages/adt-plugin-gcts/src/lib/deserializer.ts
packages/adt-plugin-gcts/src/lib/handlers/objects/fugr.ts
packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
packages/adt-plugin-gcts/tests/handlers/wave1.test.ts
Introduces extension-aware source-key encoding and symmetric filename generation.
  • Encode non-default extensions in companion keys, including main.{ext} for suffix-less files.
  • Decode source keys back into suffix and extension components for emission.
  • Thread extension overrides through GctsSourceEntry and gctsFilename.
packages/adt-plugin-gcts/src/lib/format/filename.ts
packages/adt-plugin-gcts/src/lib/aff/generic.ts
packages/adt-plugin-gcts/src/lib/handlers/base.ts
packages/adt-plugin-gcts/src/index.ts
packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
Centralizes companion preservation and re-emission across generic and handler-specific paths.
  • Stage pending sources when handlers lack a dedicated source setter.
  • Emit staged sources, DOCU files, and .properties translations while avoiding duplicate paths.
  • Refactor deserialization into source collection, payload construction, and option fallback helpers without changing package/language fallback behavior.
packages/adt-plugin-gcts/src/lib/deserializer.ts
packages/adt-plugin-gcts/src/lib/handlers/base.ts
packages/adt-plugin-gcts/src/lib/aff/generic.ts
Expands coverage for LIMU parsing, extension-aware source-key round trips, and generated filenames.
  • Test all supported upstream LIMU shapes and parent-type resolution.
  • Verify default and non-default extension key encoding/decoding.
  • Verify parent-scoped function-group companion filenames.
packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
packages/adt-plugin-gcts/tests/handlers/wave1.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

@nx-cloud

nx-cloud Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 8103a0e

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

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


☁️ Nx Cloud last updated this comment at 2026-10-23 09:04:04 UTC

@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 54 complexity · 2 duplication

Metric Results
Complexity 54
Duplication 2

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.

@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 correctly implements LIMU sub-object filename parsing and extension-aware source keys. The core logic in parseGctsFilename, sourceKey/splitSourceKey, and the plumbing of GctsSourceEntry.ext through gctsFilename is sound and the test coverage is solid.

Three issues require attention before merge:

  1. parsePropertiesName — dotted-name misparsing (filename.ts lines 220–226): The 3-part .properties branch uses hardcoded parts[0]/parts[1] instead of slice-based access, causing silent truncation for any object name that contains a dot. Every other parse branch in the same file uses parts.slice(0, N).join('.').

  2. suffixToSourceKey drops extension (deserializer.ts lines 170–178): When a handler's suffixToSourceKey map resolves a suffix, the ext override is discarded. A LIMU companion's .json (or .properties) extension is not propagated into the source key, so a subsequent round-trip would emit it with the type's default extension instead.

  3. Unused import (filename-grammar.test.ts line 11): readFileSync is imported but never referenced, which will trigger a TypeScript/ESLint unused-variable error under strict linting.


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
Comment thread packages/adt-plugin-gcts/tests/aff/filename-grammar.test.ts
Comment thread packages/adt-plugin-gcts/src/lib/deserializer.ts Outdated
@deepsource-io

deepsource-io Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in f92067d...138c11d 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:49p.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.

@netlify

netlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit 138c11d
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6add43f324b67e1c502e862c

@ThePlenkov
ThePlenkov marked this pull request as ready for review October 24, 2026 22:32
@codeant-ai codeant-ai Bot added size:XL This PR changes 500-999 lines, ignoring generated files and removed size:L This PR changes 100-499 lines, ignoring generated files labels Oct 24, 2026

@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: b435bd0073

ℹ️ 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 reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If LIMU files are parsed or emitted with the wrong parent, suffix, or extension, a gCTS repository can retain incorrect or missing companion files after export. Those artifacts are bounded and can generally be restored by correcting the mapping and re-exporting or reverting the repository change.


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

Comment thread packages/adt-plugin-gcts/src/lib/handlers/base.ts
Comment thread packages/adt-plugin-gcts/src/lib/handlers/base.ts Outdated
Comment thread packages/adt-plugin-gcts/src/lib/deserializer.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 9 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/handlers/objects/fugr.ts
Comment thread packages/adt-plugin-gcts/src/lib/handlers/base.ts
Comment thread packages/adt-plugin-gcts/src/lib/deserializer.ts Outdated
Comment thread packages/adt-plugin-gcts/src/lib/aff/generic.ts
Comment thread packages/adt-plugin-gcts/src/lib/handlers/base.ts Outdated
Comment thread packages/adt-plugin-gcts/src/lib/handlers/objects/fugr.ts
Comment thread packages/adt-plugin-gcts/src/lib/deserializer.ts Outdated
@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

@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 58 complexity · 4 duplication

Metric Results
Complexity 58
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.

Spec grammar: {parent}.{ptype}.{sub}.{stype}.{ext} — func/reps/cpub/
cpro/cprt/cpri/sotr/sotu files parse as companions of the parent object
(suffix '{sub}.{stype}') instead of being silently dropped.

Companions whose extension differs from the type's default encode it in
the source key ('{suffix}.{ext}'), so .properties texts, LIMU .json
metadata, and .xdp/.ddic companions round-trip through setSources /
getSources. 'main.{ext}' covers suffix-less companions (master
.properties). GctsSourceEntry.ext carries the override through
gctsFilename.

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:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant