# Fix the translation agent overwriting reviewed translations

## TL;DR

The agent pushes machine output over human-reviewed strings, so make it skip anything already reviewed. Reviewed translations are the protected asset, unreviewed machine output is expendable. Filter the push set to unreviewed strings only, and require an explicit flag to ever touch reviewed ones.

## The error

```text
Translation agent pushed MT output over 200 reviewed German strings
reviewers have to redo a week of work
```

## Fix it

### Step 1: Assess the damage: list what was overwritten

```bash
node -e "console.log('in the TMS: filter strings by updated-by the agent and reviewed status, export the list')"
```

Expected: You know exactly which strings lost their reviews.

### Step 2: Restore reviewed strings from history

```bash
node -e "console.log('most TMS platforms keep string history -- revert the agent-updated reviewed strings to the prior version')"
```

Expected: Reviewed translations are restored.

### Step 3: Filter pushes to unreviewed strings only

```bash
grep -n "push\|upload" scripts/translate-agent.js | head -5
```

Expected: You find the push call to gate.

### Step 4: Add the reviewed guard

```bash
node -e "console.log('pattern: before pushing a string, check its reviewed flag, skip when true unless --force-reviewed is passed')"
```

Expected: Reviewed strings are now untouchable by default.

## When to use this

- A translation agent overwrote reviewed translations
- Machine output replaced human work

## When NOT to use this

- The strings were unreviewed, then overwriting is the agent's job
- You want the agent to update reviewed strings deliberately, use the explicit flag

## Tool and version compatibility

- Any TMS with reviewed/unreviewed string states
- Agent push pipelines

## Variant phrasings

### agent overwrote approved but not reviewed strings

Same guard. Treat any human-approved state as protected, whatever your TMS calls it.

### partial overwrite discovered late

Restore from history first, then add the guard. The guard prevents recurrence, history fixes the past.

## Why it happens

The agent's push logic does not check string state, it writes whatever it computed. Without a reviewed guard, a routine re-push of machine translations clobbers human work that the system cannot distinguish from unreviewed output.

## Edge cases

- The explicit override flag needs its own audit log, it is dangerous by design
- Lock the reviewed state in the TMS too, defense in depth
- Test the guard with a dry run before the next real push

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_q0NWFcCQpOfaRRe1NKVeng
