Skip to content

Make template traversal deterministic across platforms - #274

Merged
dDevAhmed merged 1 commit into
DigiNodes:mainfrom
Daluworks:deterministic-template-order
Oct 19, 2026
Merged

dDevAhmed merged 1 commit into
DigiNodes:mainfrom
Daluworks:deterministic-template-order

Conversation

@Daluworks

Copy link
Copy Markdown
Contributor

Summary

Ensures template traversal/generation order is deterministic across all supported platforms.
The original implementation used localeCompare, which can yield different ordering on systems with different locales or language settings. The change replaces it with a locale‑independent comparator (</> checks) and adds a comment explaining the rationale. This guarantees that equivalent templates produce a stable processing order, while the output contents remain unchanged.

Related Issue

Closes #138

Scope

  • Updated src/generator/template-generation.ts to sort directory entries with a deterministic comparator.
  • Added explanatory comment above the sorting logic.
  • No other files were modified.

Testing

  • Ran the full test suite (npm test / vitest) after the change; all tests passed.

  • Verified that the build, lint, and type‑checking steps succeed.

  • Tests added/updated where applicable

  • Existing relevant tests pass

  • Lint/type/build checks pass where available

Security Impact

  • No security-sensitive behavior is changed

Security notes: The change only affects internal file‑system traversal order and does not introduce new dependencies, child processes, or modify any configuration that could affect security.

Release Impact

  • No published/user-visible behavior change

  • Patch

  • Minor

  • Breaking/pre‑1.0 contract change

  • Changeset included where required

  • Changeset not required; reason explained above (pure deterministic sorting tweak, no functional API change)

Release notes: None required – the modification is invisible to end users.

Documentation

  • Documentation updated where applicable
  • No documentation change required

Checklist

  • I read docs/contributing/wave-architecture.md for Stellar Wave work
  • I stayed within the agreed issue scope
  • I checked for overlapping open contributor PRs
  • I did not include secrets or sensitive data
  • I reviewed new/updated dependencies if any (none)
  • I considered failure/error paths, not only the happy path
  • I am not disclosing an unresolved vulnerability publicly

@Daluworks
Daluworks requested a review from dDevAhmed as a code owner October 18, 2026 17:19
@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 20313d50-7196-4f0f-a64d-4bdacfd6b005
  • 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.

@dDevAhmed
dDevAhmed merged commit a93cb4f into DigiNodes:main Oct 19, 2026
1 check passed
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.

SW-036 — Add deterministic generator file-order tests

2 participants