Skip to content

remove faker help metadata adapter#229

Merged
eviltester merged 3 commits into
masterfrom
codex/remove-faker-help-metadata
Jun 18, 2026
Merged

remove faker help metadata adapter#229
eviltester merged 3 commits into
masterfrom
codex/remove-faker-help-metadata

Conversation

@eviltester

@eviltester eviltester commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Refactor
    • Reworked command help metadata to use alias-based domain lookups with consistent normalization (safe defaults, args/params handling) and consolidated faker helper help metadata generation/lookup.
  • Bug Fixes
    • Updated schema interaction validation to treat unknown as an acceptable allowed type when verifying row compatibility.
  • Tests
    • Expanded/adjusted tests to confirm helper and domain-sourced help stay consistent and match expected metadata fields.
  • Chores
    • Removed the old auto-generation script and shifted to the new modular metadata approach.

Copilot AI review requested due to automatic review settings June 17, 2026 22:41
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@eviltester, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 24 minutes and 35 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b0ff299a-9eca-476c-8f0f-e4dd4359e779

📥 Commits

Reviewing files that changed from the base of the PR and between b62b69e and 463efb6.

📒 Files selected for processing (2)
  • packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js
  • packages/core-ui/src/tests/interaction/support/generated-value-quality.js
📝 Walkthrough

Walkthrough

Removes the 2571-line auto-generated faker-command-help-metadata.js file and its 595-line generator script. Faker command help is now derived dynamically: helpers.* commands get metadata from an expanded faker-helper-keyword-definitions.js, and domain-backed faker commands fall back to a new alias-based lookup added to domain-keywords.js. All getFakerCommandHelp import sites are rewired accordingly, and type validation is broadened to treat unknown as permissive alongside string.

Changes

Faker Help Metadata Refactor

Layer / File(s) Summary
Domain keyword help normalization API
packages/core/js/domain/domain-keywords.js
Adds normalizeDomainKeywordHelp (trims and shapes a keyword's help into a safe structure with array defaults) and getDomainKeywordHelpByAlias (resolves via alias index and returns normalized help), both exported as the canonical lookup foundation.
Faker helper definitions: metadata fields and lookup utilities
packages/core/js/faker/faker-helper-keyword-definitions.js
Expands all helpers.* entries with docsUrl, example, and returnType fields; adds FAKER_HELPERS_DOCS_URL; exports normalizeFakerHelperKeywordHelp, buildFakerHelperHelpMetadata, getFakerHelperKeywordHelp, mapDomainKeywordHelpToFakerCommandHelp, and getFakerCommandHelp with helper-first lookup and domain-alias fallback.
faker-commands.js derives helpers list from definitions
packages/core/js/faker/faker-commands.js
Builds HELPER_FAKER_COMMANDS from Object.keys(FAKER_HELPER_KEYWORD_DEFINITIONS) and spreads it into KNOWN_FAKER_COMMANDS, removing the previously hardcoded helpers.* string array.
getDomainCommandHelp rewired to alias-based lookup
packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js
Replaces getDomainKeywordByCommand with getDomainKeywordHelpByAlias, rebuilds the returned metadata object from the normalized alias result with field defaults, and returns null when no help is found.
Remove faker help generator script
package.json
Deletes the generate:faker-help npm script that previously invoked the 595-line scripts/generate-faker-help.js to produce the auto-generated metadata module.
Import rewiring across codebase
packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js, packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js, packages/core-ui/src/tests/interaction/matrix/support/generator-interaction-harness.js, packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js, packages/core-ui/src/tests/interaction/support/generated-value-quality.js, scripts/generate-schema-interaction-matrix.mjs
All getFakerCommandHelp import sites redirect from former local/core-ui paths to @anywaydata/core/faker/faker-helper-keyword-definitions.js; the core-ui re-export module is left with no exports.
Type validation broadening for permissive types
packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js, packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js, packages/core-ui/src/tests/interaction/support/generated-value-quality.js, scripts/generate-schema-interaction-matrix.mjs
Type-validation checks now treat allowedTypes containing 'unknown' as valid in addition to 'string'; new helper hasPermissiveAllowedType abstracts this in generated-value-quality.js.
Test coverage updates for dynamic resolution
packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js, packages/core-ui/src/tests/utils/faker-command-help-metadata.test.js
Replaces FAKER_COMMAND_HELP_METADATA comparisons with tests verifying buildFakerHelperHelpMetadata keys exactly match FAKER_HELPER_KEYWORD_DEFINITIONS, that getFakerCommandHelp aligns with getDomainKeywordHelpByAlias for domain-backed commands, and that helpers.multiple reports returnType as 'array'; updates expected param/type strings for domain commands.
Story resilience fix
apps/web/src/stories/shared-schema-definition.stories.js
ParamsDialog play test re-queries the "prefix" textbox into a let variable and waits for it to become document.activeElement after clicking, making the focus assertion resilient to DOM re-renders.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant getFakerCommandHelp
  participant getFakerHelperKeywordHelp
  participant buildFakerHelperHelpMetadata
  participant getDomainKeywordHelpByAlias
  participant mapDomainKeywordHelpToFakerCommandHelp

  Caller->>getFakerCommandHelp: commandValue
  alt helpers.* command
    getFakerCommandHelp->>getFakerHelperKeywordHelp: commandValue
    getFakerHelperKeywordHelp->>buildFakerHelperHelpMetadata: definitions
    buildFakerHelperHelpMetadata-->>getFakerHelperKeywordHelp: helpers.* map
    getFakerHelperKeywordHelp-->>getFakerCommandHelp: normalized helper help
    getFakerCommandHelp-->>Caller: helper help object
  else domain-backed command
    getFakerCommandHelp->>getDomainKeywordHelpByAlias: commandValue
    getDomainKeywordHelpByAlias-->>getFakerCommandHelp: normalized domain help
    getFakerCommandHelp->>mapDomainKeywordHelpToFakerCommandHelp: domain help
    mapDomainKeywordHelpToFakerCommandHelp-->>getFakerCommandHelp: mapped command help
    getFakerCommandHelp-->>Caller: mapped command help
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 No more giant generated files in sight,
The helpers now define themselves just right!
Aliases lead to help with a trim and a check,
Two thousand lines vanished — what a tech wreck!
Dynamic at last, the metadata flows clean,
This rabbit hops forward to build better routines. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'remove faker help metadata adapter' directly and clearly describes the main change: removal of the faker help metadata adapter module and its replacement with a new architecture using faker helper keyword definitions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/remove-faker-help-metadata

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 and usage tips.

@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: 58e75b2c79

ℹ️ 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/core/js/faker/faker-helper-keyword-definitions.js
Comment thread scripts/generate-faker-help.js
@greptile-apps

greptile-apps Bot commented Jun 17, 2026

Copy link
Copy Markdown

Greptile Summary

  • Replaces generated faker help metadata with shared domain-backed and helper-specific metadata lookup paths.
  • Removes the old faker help generation script and package script entry.
  • Updates UI help builders and tests to use the new metadata modules.
  • Relaxes schema interaction validation so unknown return types are treated as acceptable.

Confidence Score: 0/5

No concrete merge-safety assessment was provided with the review context.

No confidence value was provided to carry through.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex ran the faker-help-metadata comparison to verify the pre- and post-change state of the helper metadata, identifying a shift from base exports to head exports including getFakerCommandHelp.
  • T-Rex ran the domain-help-aliases comparison to confirm domain keyword help exports and updated normalization for aliases, including whitespace handling and case variance behavior.
  • T-Rex ran the unknown-allowed-type test to verify permissive type handling for the 'unknown' type and the associated error/progression, including exit codes across before and after runs.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 Allowed faker command list excludes helper definitions

    • Bug
      • The PR claims helper command registration is sourced from FAKER_HELPER_KEYWORD_DEFINITIONS and the validation objective requires getAllowedFakerCommandsAlphabetical to include all helpers from those definitions. On head, the executed contract check reports helperCount: 18 but missingHelpers still includes helpers.objectKey, helpers.objectValue, helpers.objectEntry, and helpers.enumValue, so users cannot select/use every helper that has registered metadata.
    • Cause
      • packages/core/js/faker/faker-commands.js spreads HELPER_FAKER_COMMANDS into KNOWN_FAKER_COMMANDS at line 23, but then getAllowedFakerCommandsAlphabetical() filters out FORBIDDEN_FAKER_COMMANDS at lines 262-286. That forbidden list includes four helper keys that are present in FAKER_HELPER_KEYWORD_DEFINITIONS.
    • Fix
      • Either remove those four helper commands from FAKER_HELPER_KEYWORD_DEFINITIONS if they are intentionally unsupported, or remove them from FORBIDDEN_FAKER_COMMANDS / adjust the allowed-list contract so getAllowedFakerCommandsAlphabetical() returns every helper definition key.

    T-Rex Ran code and verified through T-Rex

Reviews (3): Last reviewed commit: "dedupe permissive matrix type check" | Re-trigger Greptile

Copilot AI 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.

Pull request overview

This PR removes the generated faker-command help metadata layer and routes faker help lookups through (1) the domain keyword help source-of-truth for domain-backed faker commands and (2) a curated helper-only definitions map for helpers.* commands.

Changes:

  • Replace usage of the removed faker-command-help-metadata adapter with getFakerCommandHelp from @anywaydata/core/faker/faker-helper-keyword-definitions.js (and domain keyword help where appropriate).
  • Delete the previously generated faker help metadata file and its generator script.
  • Update core/core-ui tests to validate the new help/metadata behavior (domain-backed vs helper-only).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/generate-schema-interaction-matrix.mjs Switch faker help import to the new core helper/domain-backed help provider.
scripts/generate-faker-help.js Removed generator script for the deleted generated faker help metadata file.
packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js Updates tests to validate help is sourced from domain keywords + helper definitions.
packages/core/js/faker/faker-helper-keyword-definitions.js Centralizes helper-only faker help metadata and adds a getFakerCommandHelp fallback to domain keyword help.
packages/core/js/faker/faker-commands.js Sources helpers.* command registration from the helper definitions map.
packages/core/js/faker/faker-command-help-metadata.js Removes the large generated faker help metadata blob.
packages/core/js/domain/domain-keywords.js Adds normalized domain keyword help accessor (getDomainKeywordHelpByAlias).
packages/core-ui/src/tests/utils/faker-command-help-metadata.test.js Updates UI-side tests to reflect helper-only direct metadata + domain-backed fallback behavior.
packages/core-ui/src/tests/interaction/support/generated-value-quality.js Switch faker help import to the new core help provider.
packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js Switch faker help import to the new core help provider.
packages/core-ui/src/tests/interaction/matrix/support/generator-interaction-harness.js Switch faker help import to the new core help provider.
packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js Switch faker help import to the new core help provider.
packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js Switch faker help lookup to the new core help provider.
packages/core-ui/js/gui_components/shared/faker-command-help-metadata.js Removes the core-ui re-export adapter for the deleted generated metadata module.
packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js Uses core domain keyword help as the backing source for domain command help.
Comments suppressed due to low confidence (1)

scripts/generate-faker-help.js:1

  • This script is deleted, but the root package.json still defines a "generate:faker-help" script that runs node ./scripts/generate-faker-help.js. As-is, pnpm run generate:faker-help will fail because the entrypoint no longer exists. Either remove/update that package.json script, or replace this file with a stub that explains the new workflow.

Comment thread packages/core/js/faker/faker-helper-keyword-definitions.js Outdated
Comment thread packages/core/js/faker/faker-helper-keyword-definitions.js Outdated
Comment thread packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js Outdated

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/core/js/faker/faker-helper-keyword-definitions.js`:
- Line 188: The example value on line 188 uses a realistic card-number pattern
that triggers security scanning. Replace the current example string
'6453-2433-5050-4456-3526' with a clearly synthetic placeholder that does not
resemble an actual card number format. Use an obviously fake pattern to avoid
recurring static analysis alerts while maintaining the purpose of showing the
format structure.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: cb6b7d46-ee51-4d77-acf6-1c9cc5e19089

📥 Commits

Reviewing files that changed from the base of the PR and between 5ab0c39 and 58e75b2.

📒 Files selected for processing (15)
  • packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js
  • packages/core-ui/js/gui_components/shared/faker-command-help-metadata.js
  • packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js
  • packages/core-ui/src/tests/interaction/matrix/schema-interaction-scenario-builder.test.js
  • packages/core-ui/src/tests/interaction/matrix/support/generator-interaction-harness.js
  • packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js
  • packages/core-ui/src/tests/interaction/support/generated-value-quality.js
  • packages/core-ui/src/tests/utils/faker-command-help-metadata.test.js
  • packages/core/js/domain/domain-keywords.js
  • packages/core/js/faker/faker-command-help-metadata.js
  • packages/core/js/faker/faker-commands.js
  • packages/core/js/faker/faker-helper-keyword-definitions.js
  • packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js
  • scripts/generate-faker-help.js
  • scripts/generate-schema-interaction-matrix.mjs
💤 Files with no reviewable changes (3)
  • packages/core-ui/js/gui_components/shared/faker-command-help-metadata.js
  • packages/core/js/faker/faker-command-help-metadata.js
  • scripts/generate-faker-help.js

Comment thread packages/core/js/faker/faker-helper-keyword-definitions.js Outdated

@coderabbitai coderabbitai 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.

🧹 Nitpick comments (1)
packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js (1)

753-753: ⚡ Quick win

Consider reusing the shared hasPermissiveAllowedType helper.

The same permissive-type check is abstracted into hasPermissiveAllowedType in generated-value-quality.js (lines 94–96). Importing that helper would eliminate duplication and centralize the definition.

♻️ Proposed refactor

Add the import at the top of the file:

+import { hasPermissiveAllowedType } from '../../support/generated-value-quality.js';

Then update the condition:

  const allowedTypes = getAllowedTypesForScenarioRow(row);
- if (allowedTypes.includes('string') || allowedTypes.includes('unknown')) {
+ if (hasPermissiveAllowedType(allowedTypes)) {
    return true;
  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js`
at line 753, Replace the duplicated condition check
allowedTypes.includes('string') || allowedTypes.includes('unknown') with a call
to the existing hasPermissiveAllowedType helper function. First, add an import
statement for hasPermissiveAllowedType from the module where it is already
defined. Then, update the if statement at the specified location to invoke
hasPermissiveAllowedType(allowedTypes) instead of the inline condition check,
eliminating code duplication and centralizing the permissive type logic in a
single location.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js`:
- Line 753: Replace the duplicated condition check
allowedTypes.includes('string') || allowedTypes.includes('unknown') with a call
to the existing hasPermissiveAllowedType helper function. First, add an import
statement for hasPermissiveAllowedType from the module where it is already
defined. Then, update the if statement at the specified location to invoke
hasPermissiveAllowedType(allowedTypes) instead of the inline condition check,
eliminating code duplication and centralizing the permissive type logic in a
single location.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: beb589d2-48d1-4272-99ef-c1e9c24a74de

📥 Commits

Reviewing files that changed from the base of the PR and between 58e75b2 and b62b69e.

📒 Files selected for processing (8)
  • apps/web/src/stories/shared-schema-definition.stories.js
  • package.json
  • packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js
  • packages/core-ui/js/gui_components/shared/test-data/help/help-model-builder.js
  • packages/core-ui/src/tests/interaction/matrix/support/schema-interaction-scenario-builder.js
  • packages/core-ui/src/tests/interaction/support/generated-value-quality.js
  • packages/core/js/faker/faker-helper-keyword-definitions.js
  • scripts/generate-schema-interaction-matrix.mjs
💤 Files with no reviewable changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/core-ui/js/gui_components/shared/domain-command-help-metadata.js
  • packages/core/js/faker/faker-helper-keyword-definitions.js

@eviltester

Copy link
Copy Markdown
Owner Author

closes #228

@eviltester eviltester merged commit 0c6d147 into master Jun 18, 2026
12 checks passed
@eviltester eviltester deleted the codex/remove-faker-help-metadata branch June 18, 2026 11:19
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