Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,18 @@ See docs/UPSTREAM_SYNC.md for TS->Python translation patterns.
- Markdown parser handles common cases but is not full CommonMark
- StreamingMarkdownRenderer's _remend is simplified vs the npm `remend` library
- No setext headings, no footnotes, no HTML nodes in the parser

## Test Fidelity Verification

After modifying or adding tests, run:
```bash
python3 scripts/verify_test_fidelity.py
```
This verifies every TS `it("...")` test has a matching Python `def test_...()`.
The script must show `0 missing` before committing test changes.

When porting a new TS test file:
1. Add the mapping to `scripts/verify_test_fidelity.py` MAPPING dict
2. Run with `--fix` to generate stubs
3. Translate each stub by reading the TS test body line-by-line
4. Verify with the script before committing
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,16 @@ All PRs must pass `ruff check` with zero errors.
## License

By contributing you agree that your contributions will be licensed under the MIT License.

## Test Translation Process

When porting tests from the TypeScript SDK:

1. **Add the mapping** to `scripts/verify_test_fidelity.py`
2. **Generate stubs**: `python3 scripts/verify_test_fidelity.py --fix`
3. **Translate each stub** by reading the TS `it("...")` block line-by-line
4. **Verify names match**: `python3 scripts/verify_test_fidelity.py` must show 0 missing
5. **Run tests**: `uv run pytest tests/ -q`

Test function names MUST be derivable from the TS `it("...")` description.
Do NOT write new tests — translate the EXISTING TS tests.
5 changes: 5 additions & 0 deletions src/chat_sdk/shared/mock_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,13 @@ def get_channel_visibility(self, thread_id: str) -> ChannelVisibility:

async def open_modal(
self,
<<<<<<< Updated upstream
trigger_id: str = "",
modal: Any = None,
=======
trigger_id: str,
modal: Any,
>>>>>>> Stashed changes
Comment on lines +172 to +178
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

critical

Merge conflict markers detected in the code. These must be resolved before the PR can be merged. Based on the surrounding context and the adapter protocol, the version without default values for trigger_id and modal appears to be the intended implementation.

        trigger_id: str,
        modal: Any,

context_id: str | None = None,
) -> dict[str, str]:
return {"view_id": "V123"}
Expand Down
Loading
Loading