一键导入
port-fidelity
Audit, diff, and port changes between TypeScript and Python codebases to keep them in sync during the migration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit, diff, and port changes between TypeScript and Python codebases to keep them in sync during the migration.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How authenticated HTTP calls to the Opal backend work — the host/guest architecture, fetchWithCreds, the fetch allowlist, and the OpalBackendClient migration. Read this before adding, modifying, or debugging any backend call.
Learn how to make widgets on canvas
Produce high-quality React apps from natural language descriptions.
Teaches you how to properly operate in the sandboxed environment you're in.
Learn how to present your work as a structured surface — a curated manifest of artifacts that the user's application renders in real time.
Learn how to use `window.opalSDK` inside your sandboxed React component to read files, call host services, and listen for events from the application.
| name | port-fidelity |
| description | Audit, diff, and port changes between TypeScript and Python codebases to keep them in sync during the migration. |
Systematic comparison of TypeScript and Python implementations to detect drift and port changes faithfully.
packages/opal-backend/PROVENANCE.md/daily-dig that targets opal-backendOpen packages/opal-backend/PROVENANCE.md and find the row for the module
you're investigating. Note the TS source path.
Open the Python module and its TS counterpart side by side. Focus on:
to_dict() / JSON output must match both sides exactly| Category | Action |
|---|---|
| Intentional (architectural, e.g., Protocol vs inline) | Document in PROVENANCE.md notes column |
| Drift (TS was updated, Python wasn't) | Port the change |
| Bug (Python diverges from TS behavior) | File as finding, write a test |
| Enhancement (Python is ahead of TS) | Confirm intent with maintainer |
When porting a TS change to Python:
Promise<T> → async def ... -> TRecord<K,V> → dict[K, V]interface → Protocol or @dataclass?. → explicit if x is not None guardsArray.map/filter → list comprehensionsthrow new Error → raise ValueErrornpm run test -w packages/opal-backendProduce a structured summary:
## Port Fidelity Report: <module>
**Python**: `opal_backend/<module>.py` **TypeScript**:
`visual-editor/src/a2/agent/<ts-file>.ts`
### Status
- [ ] API shape matches
- [ ] Control flow matches
- [ ] Constants/config matches
- [ ] Wire format matches
### Differences Found
| # | Category | Description | Action |
| --- | -------- | ---------------------------- | -------------- |
| 1 | drift | TS added retry logic in v2.3 | Port to Python |
### Changes Made
- Ported retry logic from TS commit abc123
- Added test for retry behavior
shared_schemas.py. When a TS schema changes,
update it there, not in individual function files.http_client.py, backend_client.py,
and interaction_store.py are new for Python. Don't look for a TS counterpart
— but do verify they're consistent with how TS uses the same backend APIs.