79 lines
6.0 KiB
Markdown
79 lines
6.0 KiB
Markdown
# Handoff — `i18n-translate-backend-comments` (Issue #7)
|
|
|
|
## Status
|
|
**Complete.** All in-scope Chinese docstrings and `#` comments under `backend/` have been translated to English.
|
|
|
|
This second installment of the ticket-#7 cleanup builds on the first installment (PR #20) and finishes the remaining 12 files. Together, the two installments cover the full 35-file in-scope set.
|
|
|
|
## Completed across both installments (35 files)
|
|
|
|
### First installment (PR #20 — landed on `feat/i18n-6-externalize-backend-logs`, then merged here via `merge main` into this branch)
|
|
- **Root**: `backend/app/__init__.py`, `backend/app/config.py`, `backend/run.py`
|
|
- **API package init**: `backend/app/api/__init__.py`
|
|
- **Models** (full package): `backend/app/models/__init__.py`, `project.py`, `task.py`
|
|
- **Utils** (full package): `backend/app/utils/__init__.py`, `file_parser.py`, `llm_client.py`, `locale.py`, `logger.py`, `retry.py`, `zep_paging.py`
|
|
- **Services** (partial): `backend/app/services/__init__.py`, `graph_builder.py`, `ontology_generator.py`, `simulation_ipc.py`, `simulation_manager.py`, `text_processor.py`, `zep_entity_reader.py`
|
|
- **Scripts** (partial): `backend/scripts/action_logger.py`, `backend/scripts/test_profile_format.py`
|
|
|
|
### Second installment (this PR — finishes the ticket)
|
|
| File | Starting in-scope hits | Comment-the-obvious deletions |
|
|
| --- | --- | --- |
|
|
| `backend/app/api/graph.py` | 70 | 25 |
|
|
| `backend/app/api/report.py` | 104 | 11 |
|
|
| `backend/app/api/simulation.py` | 351 | ~25 |
|
|
| `backend/app/services/oasis_profile_generator.py` | 185 | ~14 |
|
|
| `backend/app/services/report_agent.py` | 335 | 8 |
|
|
| `backend/app/services/simulation_config_generator.py` | 148 | 0 |
|
|
| `backend/app/services/simulation_runner.py` | 277 | ~31 |
|
|
| `backend/app/services/zep_graph_memory_updater.py` | 97 | 5 |
|
|
| `backend/app/services/zep_tools.py` | 269 | 6 |
|
|
| `backend/scripts/run_parallel_simulation.py` | 227 | ~7 |
|
|
| `backend/scripts/run_reddit_simulation.py` | 75 | 12 |
|
|
| `backend/scripts/run_twitter_simulation.py` | 97 | 21 |
|
|
| **Total** | **2,235** | **~165** |
|
|
|
|
After the pass, every file in the table reports zero in-scope hits from the AST scanner.
|
|
|
|
## Remaining residuals (out of scope — owned by sibling tickets)
|
|
After this PR, the only files under `backend/` that still contain CJK characters do so exclusively inside string literals. These are owned by sibling tickets and are intentional residuals for this spec:
|
|
|
|
- LLM prompt template strings: `oasis_profile_generator.py`, `ontology_generator.py`, `simulation_config_generator.py`, `report_agent.py` — owned by tickets #2 / #3 / #4 / #5.
|
|
- Runtime log strings, API response messages, exception arguments, CLI prints: distributed across `api/`, `services/`, `scripts/`, `utils/retry.py`, `utils/locale.py`, `run.py`, `app/config.py` — owned by ticket #6 (with follow-up tickets #18, #24 for residuals).
|
|
- Sample-data values returned to clients: `services/zep_tools.py`, `services/zep_graph_memory_updater.py`, `services/zep_entity_reader.py`, etc.
|
|
|
|
The CJK CI guard (`scripts/ci/i18n_cjk_guard.py`) enforces that this set never grows; the per-path baseline at `.kiro/specs/i18n-ci-guard/baseline.txt` is updated as part of this PR to reflect the new (lower) count.
|
|
|
|
## Verification methodology
|
|
The AST-aware scanner at `.kiro/specs/i18n-translate-backend-comments/scan_chinese.py` (committed in this branch) classifies every CJK-bearing line into one of three buckets:
|
|
|
|
- `DOCSTRING` — line lies inside a module/class/function docstring (in scope).
|
|
- `COMMENT` — line contains a `#` and is not inside a docstring or string-literal span (in scope).
|
|
- `STRING` — line is part of a string-literal value (out of scope, owned by sibling tickets).
|
|
|
|
For every translated file in this installment:
|
|
|
|
1. `python3 -m py_compile <file>` succeeds.
|
|
2. The scanner reports `0` in-scope hits.
|
|
3. `git diff <file>` shows only docstring lines and `#` comment lines changed; no signature, import, decorator, expression, or string-literal byte changes.
|
|
|
|
For two of the largest files (`api/simulation.py`, `report_agent.py`), the implementing agent additionally ran an AST-equivalence check (parsing both before and after, stripping docstrings, and confirming structural equality) to validate that no executable surface changed.
|
|
|
|
## Test environment caveat
|
|
The repo's `uv sync` builds `tiktoken` from source, which requires a Rust toolchain. The sandbox running this implementation pass does not have Rust, so `cd backend && uv run python -m pytest scripts/test_profile_format.py` cannot be executed end-to-end here. Because the change set is comments-and-docstrings-only, runtime behavior cannot be affected; the syntactic-validity check (`py_compile` across all 12 files) stands in for the test run in this environment.
|
|
|
|
A developer with the project's normal dev environment (Rust toolchain installed, full `uv sync` succeeded) should re-run `cd backend && uv run python -m pytest scripts/test_profile_format.py` against this branch before merging to confirm.
|
|
|
|
## What is NOT changed
|
|
- No string literal anywhere in the touched files (verified by AST classification).
|
|
- No executable Python statement.
|
|
- No symbol renamed; `zep_*` legacy filenames preserved per steering rule.
|
|
- No file added or removed (other than the AST scanner inside `.kiro/specs/i18n-translate-backend-comments/`).
|
|
- No dependency added or version-bumped.
|
|
|
|
## Branch & PR
|
|
- Branch: `docs/i18n-7-translate-backend-comments` (re-used from PR #20; that PR was merged into `feat/i18n-6-externalize-backend-logs` after `feat/i18n-6` had already merged into `main`, which orphaned PR #20's content from `main`).
|
|
- This PR re-targets the branch at `main`, including: the four prior commits from PR #20, a `Merge branch 'main'` commit (one conflict resolved in `services/ontology_generator.py` to combine PR #20's translated comment with main's English prompt-string), and the new commits for the 12 files completed here.
|
|
- Commits follow Conventional Commits in the form `docs(i18n): translate chinese docstrings/comments in backend/<area>`.
|
|
- The PR description references issue #7 with `Closes #7`.
|
|
- No `Co-Authored-By:` watermarks.
|