add(skills): Simplify state machine
This commit is contained in:
@@ -39,41 +39,35 @@ Generated files (`bilingual.dj`) are not committed either.
|
|||||||
|
|
||||||
## Translation State Machine
|
## Translation State Machine
|
||||||
|
|
||||||
All translation work follows this deterministic workflow. Non-deterministic LLM work (drafting, reviewing) happens at the edges; the states and transitions are fixed.
|
Non-deterministic LLM work happens at the states; transitions are fixed.
|
||||||
|
|
||||||
```mermaid
|
| Current state | Event / condition | Next state | Notes |
|
||||||
stateDiagram-v2
|
|---|---|---|---|
|
||||||
[*] --> idle
|
| `*start*` | source loaded | `idle` | Begin from a new source. |
|
||||||
idle --> translating: SOURCE_LOADED
|
| `*start*` | bilingual loaded | `idle` | Begin from an existing review file. |
|
||||||
idle --> other_reviewing: BILINGUAL_LOADED
|
| `idle` | `SOURCE_LOADED` | `translating` | |
|
||||||
translating --> bilingual_ready: TRANSLATION_DRAFTED
|
| `idle` | `BILINGUAL_LOADED` | `other_reviewing` | |
|
||||||
bilingual_ready --> self_reviewing: BILINGUAL_GENERATED
|
| `translating` | `TRANSLATION_DRAFTED` | `bilingual_ready` | |
|
||||||
self_reviewing --> translating: SELF_REJECTED
|
| `bilingual_ready` | `BILINGUAL_GENERATED` | `self_reviewing` | |
|
||||||
self_reviewing --> other_reviewing: SELF_APPROVED [peer review required]
|
| `self_reviewing` | `SELF_REJECTED` | `translating` | |
|
||||||
self_reviewing --> approved: SELF_APPROVED [no peer review]
|
| `self_reviewing` | `SELF_APPROVED` and peer review required | `other_reviewing` | `peer_review_required` flag decides the branch. |
|
||||||
note right of self_reviewing
|
| `self_reviewing` | `SELF_APPROVED` and no peer review | `approved` | |
|
||||||
peer_review_required flag decides the branch
|
| `other_reviewing` | `PEER_REJECTED` | `translating` | |
|
||||||
end note
|
| `other_reviewing` | `PEER_APPROVED` | `approved` | |
|
||||||
other_reviewing --> translating: PEER_REJECTED
|
| `approved` | `TYPESET_REQUESTED` | `typesetting` | Optional. |
|
||||||
other_reviewing --> approved: PEER_APPROVED
|
| `approved` | `COMPLETE` | `done` | |
|
||||||
approved --> typesetting: TYPESET_REQUESTED
|
| `typesetting` | `TYPESET_COMPLETE` | `done` | |
|
||||||
approved --> done: COMPLETE
|
|
||||||
typesetting --> done: TYPESET_COMPLETE
|
|
||||||
done --> [*]
|
|
||||||
```
|
|
||||||
|
|
||||||
States:
|
States:
|
||||||
|
|
||||||
| State | Meaning | Output artifact |
|
: `idle` — Waiting for source or an existing bilingual file.
|
||||||
|---|---|---|
|
: `translating` — Draft `target.dj`.
|
||||||
| `idle` | Waiting for source or an existing bilingual file. | — |
|
: `bilingual_ready` — `bilingual.dj` generated from `source.dj` + `target.dj`.
|
||||||
| `translating` | Agent loads `mpi-translation` + `mpi-terms-search` skills and drafts `target.dj`. | `target.dj` |
|
: `self_reviewing` — Self-review with `mpi-translation-review` (self mode); edit `target.dj`.
|
||||||
| `bilingual_ready` | `bilingual.dj` generated from `source.dj` + `target.dj`. | `bilingual.dj` |
|
: `other_reviewing` — Peer review with `mpi-translation-review` (other mode); write `review-comments.dj`.
|
||||||
| `self_reviewing` | Self-review with unified ruleset (self mode). Edit target.dj. | `target.dj` (edited) |
|
: `approved` — Translation accepted; may typeset or finish.
|
||||||
| `other_reviewing` | Peer review with unified ruleset (other mode). Write review-comments.dj. | `review-comments.dj` |
|
: `typesetting` — Produce PDF/DOCX.
|
||||||
| `approved` | Translation accepted. May typeset or finish. | — |
|
: `done` — Complete.
|
||||||
| `typesetting` | Producing PDF/DOCX from approved bilingual content. | `.pdf` / `.docx` |
|
|
||||||
| `done` | Complete. | — |
|
|
||||||
|
|
||||||
## Workflow A: Translation(翻译)
|
## Workflow A: Translation(翻译)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user