Skip to content

feat: don't process some modalities#24

Merged
pkoch merged 1 commit intomasterfrom
feat/dont-process-some-modalities
Mar 4, 2026
Merged

feat: don't process some modalities#24
pkoch merged 1 commit intomasterfrom
feat/dont-process-some-modalities

Conversation

@pkoch
Copy link
Copy Markdown
Member

@pkoch pkoch commented Mar 4, 2026

Summary by CodeRabbit

  • Documentation

    • Added comprehensive details on Treasury and Staking Rewards distribution schedules, including vesting timelines, cliffs, and beneficiary information.
  • Tests

    • Added test coverage for proper handling of manually-disbursed distribution modalities.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 4, 2026

📝 Walkthrough

Walkthrough

The pull request introduces a distinction between script-disbursed and manually-disbursed modalities in the initial distribution system. It adds new type definitions, constants, and a helper function to identify script-disbursed modalities, then updates the CSV loading logic to filter out manually-handled modalities while maintaining proper mapping.

Changes

Cohort / File(s) Summary
Word List
project-words.txt
Added "Masterlist" entry to project word list.
Documentation
script/initial-distribution/README.md
Added Note well and Post-scriptums sections documenting manual vesting contract funding, modality schedules, beneficiary addresses, and deployed contract details.
Modality Type System
script/initial-distribution/src/modalities.ts
Introduced MODALITIES_NOT_DISBURSED_BY_OUR_SCRIPT constant and related type aliases (ModalityScriptDisbursed, ModalityNotScriptDisbursed, Modality). Added isScriptDisbursedModality() helper function. Updated MODALITIES_TS_TO_EVM to only map script-disbursed modalities and enhanced isKnownModality() to recognize both script and manually-disbursed modalities.
CSV Processing
script/initial-distribution/src/csv.ts
Added filter in loadDisbursementCsv to exclude rows where modality is not script-disbursed, using the new isScriptDisbursedModality() check.
Test Suite
script/initial-distribution/src/modalities.test.ts, script/initial-distribution/src/csv.test.ts
Added test case for excluding manual modalities (C-12-36, C-6-36, Treasury, Staking Rewards) from CSV loading. Reformatted modalities test assertions to single-line form. Added test verifying that non-script-disbursed modalities are recognized as known.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Add reasonable test coverage #20: Directly touches the same modality handling files (modalities.ts, modalities.test.ts, csv.ts, csv.test.ts) and implements related functionality for distinguishing script-disbursed versus manual modalities.

Poem

🐰 Modalities split with care and thought,
Some script-disbursed, some manually wrought,
Filters now guide the CSV flow,
Treasury and Staking Rewards steal the show!
Manual dreams, script-bound schemes, 🚀

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: don't process some modalities' directly reflects the main change: filtering out certain modalities from script-based processing.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/dont-process-some-modalities

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@script/initial-distribution/README.md`:
- Around line 3-7: The README's post-scriptum section contains grammar and
clarity issues: replace "post-scriptums" with "post-scripts" or "postscripts"
(or simply "postscript") in the post-scriptum heading/body, correct the phrase
"The treasury is end date…" to a clear possessive or phrasing such as "The
treasury's end date is…" or "At the treasury's end date…" to convey meaning, and
change "its transactions" referring to the four contracts to the plural "their
transactions" (or explicitly name the contracts) so subject/verb agreement is
correct; apply these edits in the post-scriptum section and the other referenced
paragraphs that repeat the same wording.

In `@script/initial-distribution/src/modalities.ts`:
- Around line 59-62: The isKnownModality function uses the `in` operator which
checks the prototype chain and can falsely accept inherited keys; replace that
check with an own-property test (e.g., use
Object.prototype.hasOwnProperty.call(MODALITIES, s) or a Map/Set lookup) so only
real keys on MODALITIES are accepted, while keeping the existing fallback to
(MODALITIES_NOT_DISBURSED_BY_OUR_SCRIPT as readonly string[]).includes(s);
update isKnownModality accordingly to prevent inherited keys (which break
lookups like MODALITIES_TS_TO_EVM in loadDisbursementCsv) from passing
validation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: ef3a82df-91e5-49f0-8bef-4f2600559436

📥 Commits

Reviewing files that changed from the base of the PR and between 0089fd8 and 227f88a.

📒 Files selected for processing (6)
  • project-words.txt
  • script/initial-distribution/README.md
  • script/initial-distribution/src/csv.test.ts
  • script/initial-distribution/src/csv.ts
  • script/initial-distribution/src/modalities.test.ts
  • script/initial-distribution/src/modalities.ts
📜 Review details
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-03-01T13:52:43.616Z
Learnt from: pkoch
Repo: idos-network/contracts PR: 19
File: script/initial-distribution/src/tde.ts:38-48
Timestamp: 2026-03-01T13:52:43.616Z
Learning: In the idos-network/contracts repository, the team uses `getContract({ client: walletClient })` and successfully calls `.read.*` methods on the resulting contract instances in viem 2.23.x, even though the walletClient is not explicitly extended with publicActions. This pattern is used throughout script/initial-distribution/src/ (tde.ts, cca.ts).

Applied to files:

  • script/initial-distribution/README.md
📚 Learning: 2026-03-01T13:52:37.088Z
Learnt from: pkoch
Repo: idos-network/contracts PR: 19
File: script/initial-distribution/src/tde.ts:38-48
Timestamp: 2026-03-01T13:52:37.088Z
Learning: In script/initial-distribution, when using getContract({ client: walletClient }), it is possible to call read.* methods on the resulting contract even if walletClient is not explicitly extended with publicActions (as observed in tde.ts and cca.ts with viem 2.23.x). Treat this as an intentional pattern to verify: - confirm that the behavior is supported by the specific viem version and contract bindings, - document any assumptions about publicActions not being required for read operations, - ensure there are no security implications (e.g., unintended read access) and that access controls are still correct, - consider adding comments or tests that demonstrate expected usage and edge cases, and - if this behavior is relied upon in other files, apply the same pattern consistently within the script/initial-distribution directory.

Applied to files:

  • script/initial-distribution/src/modalities.test.ts
  • script/initial-distribution/src/csv.ts
  • script/initial-distribution/src/modalities.ts
  • script/initial-distribution/src/csv.test.ts
🔇 Additional comments (5)
project-words.txt (1)

6-6: Wordlist update looks correct.

Adding Masterlist on Line 6 should prevent false-positive spellcheck noise for domain terms already used in this PR.

script/initial-distribution/src/modalities.ts (1)

16-29: Separation between script-disbursed and manually-disbursed modalities is solid.

This improves intent and keeps MODALITIES_TS_TO_EVM aligned with what the script should actually execute.

Also applies to: 46-57

script/initial-distribution/src/csv.ts (1)

51-57: Filtering before mapping is the right behavior here.

Lines 51-57 correctly exclude manual modalities from script output while preserving existing address/modality/amount mapping for script-disbursed rows.

script/initial-distribution/src/csv.test.ts (1)

90-105: Good regression coverage for manual-modality exclusion.

This test captures the exact scenario introduced by the new filtering rule and asserts both row count and mapped values.

script/initial-distribution/src/modalities.test.ts (1)

4-10: Nice test extension for newly recognized manual modalities.

The new assertions ensure isKnownModality remains consistent with MODALITIES_NOT_DISBURSED_BY_OUR_SCRIPT.

Also applies to: 19-23

Comment thread script/initial-distribution/README.md
Comment thread script/initial-distribution/src/modalities.ts
@pkoch pkoch merged commit 1090f25 into master Mar 4, 2026
3 checks passed
@pkoch pkoch deleted the feat/dont-process-some-modalities branch March 4, 2026 16:09
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.

1 participant