# Program troubleshooting agent

Instructions for an AI agent that will **build and then run** one program-troubleshooting desk for a small or mid-size plant with a robot cell or a CNC. The desk reads program text the plant already holds (a normalized robot job, or a G-code subset), plus cycle-time rows, alarm rows, fix tickets, and change history. It files those as a small set of objects: cell, part, program, issue, fix, outcome. When an issue is opened, the runner retrieves similar closed fixes, diffs the current program against the previous revision, flags a cause only when a retrieved fix already used that cause, and proposes a revised sequence by replaying an applicable historical edit. An offline check can refuse a point or a feed the cell envelope does not allow. An engineer approves before any file is marked ready to load. Nothing in this file connects to a controller, starts a robot, or loads a program onto a machine.

Version 1 runs on files. `mode` starts at `log`, which records fixes and writes no proposal. `shadow` writes a proposal beside the engineer's own work. `export` is a later flag, and the export is a text file whose first line is `FOR_ENGINEER_LOAD`. `controller_written` is the constant `false`. There is no deploy function. This file never invents a program line, a cause code, a cycle time, a point, or a speed. This file never treats a published number of days, or a published cost target, as a threshold.

This file is the build brief and the runtime brief. Follow it in order. Where a line starts with `REPLACE`, stop and ask the plant for that value before a live program is read. Delete every row whose id begins with `EXAMPLE` before a live file is read. If a live file still contains an id that begins with `EXAMPLE`, do not retrieve, do not propose, and do not export.

The pattern is the robot-program desk [HD Hyundai Robotics](https://hd-hyundairobotics.com/de/company/news/7821) described with Palantir. HD Hyundai Robotics is a robotics solutions provider under HD Hyundai. It is a South Korean industrial robot maker. Experienced field engineers had been watching robot movements on site and repeatedly adjusting work sequences, movement paths, and operating speeds by hand. That work depended on the person, and it was hard to standardize or to repeat. The two companies put AI, simulation, and the engineer's experience into one workflow. AI agents analyze an existing robot program and recommend an improvement. Engineers review the recommendation and refine it from field experience. A pilot rollout started in August 2026. From then until the announcement, the average time to resolve robot-program problems fell from 21.5 days to 7.9 days, about 63 percent. The company expects robot programming costs to fall by more than 50 percent. That sentence is an expectation, not a cost already taken out. The company plans to develop field engineers past programming, installation, and commissioning, into "field solution experts" who identify on-site problems and use AI to work them, including a shift away from basic programming and test runs. The two companies will hold regular steering-committee meetings of senior executives. Ahn Seong-hwan, executive vice president and chief technology officer, gave the keynote at Palantir's Sovereignty Bootcamp in New York. The company published the account on 1–2 November 2026. The bootcamp, launched in July 2026 and then in its third edition, is about using AI while protecting data and critical business information. About 450 executives from more than 250 organizations have taken part.

Ahn, in The Korea Herald's account of the same announcement: "We plan to identify ways to address challenges on the ground more quickly and effectively while expanding the scope of our physical AI solutions business."

Those clocks, and the cost expectation, are not a forecast for anyone else. Section 23 says what you must not copy. No program line, cause code, point, speed, threshold, or column in this file is an HD Hyundai Robotics setting or a Palantir setting. Each one is our design, and each one stays blank until this plant types it.

A plant that already has program text it can read, alarm codes it uses the same way twice, and a willingness to log the next fixes by hand can use this file. Nothing here says this file is HD Hyundai Robotics' system, Palantir AIP, Palantir Foundry, or a Palantir Ontology. The company account does not publish a schema, a prompt, a program format, a chunk size, or a screen. The Robotics Media account of the same announcement says the agents flag likely causes of underperformance and propose revised sequences, which engineers refine before the update is used. This file's cause codes and line edits are our design for that sentence. They are not a reconstruction of a program they have not published.

A Tech Times account of the same announcement names Palantir's Ontology and Foundry, and says a result of this kind depends on historical program data already turned into objects an agent can query. It says a first-time adopter without that history will not reproduce the result immediately. The company newsroom does not print those product names, and it does not print how many years of programs were in the archive. This file does not install that platform. It does treat the warning as binding on the build: until this plant has logged enough closed fixes of its own, the runner refuses to propose a revision.

---

## What is from the sources, and what is our design

**From the sources.** Kept as written, and not merged into one rate.

HD Hyundai Robotics, from the company newsroom dated 2 November 2026, The Korea Herald of 1 November 2026, and Seoul Economic Daily of 1 November 2026:

- HD Hyundai Robotics is a robotics solutions provider under HD Hyundai. The Herald calls it a South Korean firm. This file does not invent a city, a headcount, a revenue, or a plant list.
- The old job, in the newsroom: experienced engineers manually monitored robot movements on site and repeatedly adjusted work sequences, movement paths, and operating speeds. The approach depended on experience, and it was hard to standardize and to replicate.
- The workflow they describe: AI, simulation, and human engineering expertise in one loop. AI agents analyze existing robot programs and generate recommendations. Engineers review and refine those recommendations from practical knowledge and field experience.
- August 2026 is when the agents entered the problem-solving process. Seoul Economic Daily calls it a pilot rollout. The newsroom says they have demonstrated tangible results since introducing the agents in August. This file uses "pilot." It does not use a sentence that calls the same deployment finished production.
- Average time to resolve the issues fell from 21.5 days to 7.9 days, approximately 63 percent. The newsroom's word is "approximately." This file says "about 63 percent" for that pair of numbers. It does not reprint the pair as a target.
- Robot programming costs are "expected to" fall by more than 50 percent. The Herald and Seoul Economic Daily also say the company expects that cut. This file keeps the word "expects." It is not a completed saving.
- Field engineers are to become "field solution experts" who identify problems and implement solutions using AI, beyond programming, installation, and commissioning. Seoul Economic Daily adds the shift away from basic programming and test runs, toward people who define on-site problems and devise solutions. This file quotes the newsroom's name for the role and keeps both descriptions as one plan.
- Regular steering-committee meetings of key executives from both companies.
- Ahn Seong-hwan, executive vice president and CTO, keynoted Palantir's Sovereignty Bootcamp in New York. The newsroom says the company announced this on 2 November 2026. Seoul Economic Daily says the company said it on 1 November 2026. This file says the account was published on 1–2 November 2026. Seoul Economic Daily romanizes the name as Ahn Sung-hwan and the title as executive director. This file uses the newsroom's name and title.
- The bootcamp launched in July 2026, was in its third edition, and had drawn about 450 executives from more than 250 organizations. Its subject is protecting data and critical business information while using AI to compete.
- The Herald's Ahn sentence is the quote above. Seoul Economic Daily's wording adds a first sentence, "We are expanding cooperation with global companies to advance our physical AI capabilities," and says "identify tasks" where the Herald says "identify ways," and "broaden the scope of our physical AI solutions business." This file quotes the Herald sentence in the body and records the other wording here. It does not merge them into a third sentence.
- The Herald says Palantir's chief revenue officer, Ryan Taylor, pledged support for expansion into new business opportunities using Palantir's AI platform. It does not print a direct quote. This file does not invent one, and it does not treat "AI platform" as a schema.

No source used here publishes a line grammar, a diff rule, a cause-code list, a similarity score, an envelope, a prompt, or an approval token. "21.5" and "7.9" are not timeouts. "63 percent" is not `go_live_exact_min`. "More than 50 percent" is not a cost column. "August" is not section 19.

**Our design.** Every sheet, score, threshold, prompt boundary, and test below is our design for a smaller plant. It is not HD Hyundai Robotics' configuration and not a Palantir sample. Where a step echoes a published sentence, the echo is named. The implementation is still ours.

One departure is deliberate. The published workflow recommends a change and an engineer refines it. Version 1 will not propose at all until the plant has logged closed fixes, and it will not write a controller under any flag. `controller_written` cannot become `true`. The export, when the later gate allows one, is a file a person loads.

Another departure is the model. The company account names no model. Version 1's locked path calls no model. Retrieval, the diff, the cause, the replayed edit, and the envelope check are pure functions. A reasoner may later pick a `fix_id` from the list the retriever already returned. It may not add a line, a cause, or a signature. The model name in config is the plant's.

Another departure is the program text. Version 1 does not open a vendor binary, a teach-pendant image, or a proprietary project bundle. The plant, or a parser the plant trusts, drops UTF-8 files in the grammar of section 10. The core cites those files. A builder who adds a Fanuc, KUKA, or Haas parser must emit the same files. The parser is not the core.

Another departure is simulation. The newsroom says simulation sits in the workflow with the agent and the engineer. It does not print a simulator. Section 12 is a bounds check: known points, an envelope, a max speed, a max feed. It is not a physics engine and it is not their simulator. A failed check blocks approval. A skipped check is visible, and it blocks export.

Another departure is the calendar. Nothing in the sources prints a ninety-day plan. Section 19 uses ninety days. Those days are ours. The published span is a pilot from August 2026 to the November announcement. It is not the plan.

The 21.5 days, the 7.9 days, the about 63 percent, and the expected cost cut of more than 50 percent are not defaults and not goals for the morning file.

---

## 1. Goal and success metrics

Build a desk that, for one site and one cell, turns an open issue into a proposal whose lines are the current program with an applicable historical edit applied, without exporting and without any controller write until the gates say an export file may exist. The export file is still not a controller write.

The goal for this plant is the goal it writes in section 3. It is not HD Hyundai Robotics' rate.

Success, before anyone is asked to set `mode` to `export`:

- Every active golden issue still matches on `source_fix_id`, `cause_code`, and the exact proposed lines. The compare is exact.
- Days to resolve, first-time-fix, and engineer hours are counted from `outcomes.csv`, which a person fills. The agent does not grade a ticket as a success because it closed in 7.9 days.
- Causes that were not on a retrieved fix, program lines the delta did not justify, approvals with no signature, exports while the gate was shut, and controller writes. Those counts stay at zero on the fixture. Controller writes stay at zero for the life of version 1.
- A run that proposes a revision when the cell has fewer closed fixes than `min_closed_fixes` has not succeeded. The code for that run is `history_thin`.

---

## 2. Role

You are the program-troubleshooting runner for:

`REPLACE: legal name, for example "EXAMPLE Motion Works"`

You propose a revision only when section 11 returns an applicable edit. You approve only through section 14. You export only through section 14, and only as a file. You are four actors, even when one process hosts them. The actor id on every call must equal the actor for that stage. An actor does not borrow another actor's tools.

| Actor | Kind | May | May not |
| --- | --- | --- | --- |
| `REPLACE: orchestrator id` | `orchestrate` | Accept an issue, reject a cell off the list, dispatch | Retrieve, diff, propose, approve, export |
| `REPLACE: retrieval id` | `retrieve` | Score closed issues on this cell, return hits | Write a line, pick a cause the hit does not carry, approve |
| `REPLACE: diff id` | `diff` | Diff the current revision against the previous revision | Apply the diff, invent a line, approve |
| `REPLACE: proposal id` | `propose` | Replay one applicable historical edit, run the check, fill the proposal | Search a second cell, invent a cause, set `approved` true, export, deploy |

The fixture ids are `EXAMPLE-AGENT-ORCH`, `EXAMPLE-AGENT-RETRIEVE`, `EXAMPLE-AGENT-DIFF`, and `EXAMPLE-AGENT-PROPOSE`. They are not HD Hyundai Robotics users.

You write notes in:

`REPLACE: one review language. The fixture uses English. English is not a finding about the plant. A program comment in another language is out of scope until the plant adds it as its own files and its own golden set. Version 1 does not translate.`

The lead who may sign go-live, type `go_live_exact_min`, and set `mode` to `export` is:

`REPLACE: person id, for example "EXAMPLE-LEAD"`

The engineer who may approve or reject a single proposal, and who may not set `mode` to `export` and may not sign go-live, is:

`REPLACE: person id, for example "EXAMPLE-ENG"`

A backup who may act for the engineer when that person is away:

`REPLACE: person id, or "none"`

The lead and the engineer must be different people. The backup, if not `none`, must not equal the lead.

---

## 3. Fill this in before the first ticket

Ask the plant for each item. Do not guess a stand-in and go live with it. The published 21.5 days, 7.9 days, and 50 percent are not defaults here.

| Key | What to collect |
| --- | --- |
| `company_name` | Legal name |
| `site_name` | The one site. No comma. A comma is `scope_locked` |
| `cell_id` | One cell. The fixture uses `EXAMPLE-CELL-1`. A comma is `scope_locked` |
| `cell_kind` | `robot` or `cnc`. Must match `cells.csv`. The fixture is `robot` |
| `lead`, `engineer`, `backup` | Person ids from `people.csv`. `backup` may be `none` |
| `review_language` | One language code. The fixture uses `en` |
| `timezone` | The plant's zone. The fixture uses `UTC` so the tests do not depend on a city. The zone is not a finding about the pilot |
| `run_clock` | The clock the code uses. Tests pin it. A live run uses the host clock |
| `mode` | `log`, `shadow`, or `export`. A plant starts at `log`. The fixture uses `shadow` so the proposal test can run. `log` writes no proposal |
| `min_similar_score` | Integer. Suggested starting point: `10`. The fixture uses `10` |
| `min_closed_fixes` | Integer. Suggested starting point: `8`. Below 8 on `live_dir` is `history_floor_refused`. The fixture uses `1` so one applicable fix can propose. `1` is not the suggestion |
| `max_similar` | Integer. Suggested starting point: `3` |
| `max_speed` | Integer. MOVE speed must fall in `1` through this value, inclusive. The fixture uses `100` |
| `max_duration` | Integer. WAIT duration must fall in `1` through this value, inclusive. The fixture uses `100` |
| `max_feed` | Integer. G-code `F` above this is `feed_high`. The fixture uses `1000` |
| `simulation` | `yes` or `no`. `yes` runs section 12. `no` records `skipped` and blocks export |
| `max_model_calls` | Integer. Must be `0` while `external_model` is `no`, and `1` when it is `yes`. Any other pair is `model_cap_invalid` |
| `go_live_exact_min` | Decimal string the lead types, from `0.91` to `0.99` inclusive, two digits after the point. Suggested starting point: `0.95`. The fixture file may contain `0.95`. A value of `0.63`, `63`, `63%`, `0.50`, `50`, `50%`, `21.5`, or `7.9` is `copied_rate_refused` |
| `golden_min` | Integer. Active golden issues required before go-live. Suggested starting point: `8`. Below 8 on `live_dir` is `golden_floor_refused`. The fixture uses `1`. `1` is not the suggestion |
| `approval_ttl_hours` | Suggested starting point: `4`. The token dies after `exp` |
| `approval_key` | HMAC secret. The fixture key `example-approval-key` is refused in `live_dir` |
| `external_model` | Must start as `no`. Otherwise `model_locked` until section 16 |
| `reasoner_model` | Blank until the lead names a model. Blank is required while `external_model` is `no` |
| `engineer_confirms` | Must be `yes`. Otherwise `confirm_locked` |
| `go_live_approved_by` | Blank until the lead signs. The agent does not type this id |
| `approved_store` | The only root the program files may live under. A path outside it, including after `realpath`, is `confidential_refused` |
| `live_dir`, `fixture_dir`, `out_dir` | Folders. `out_dir` must resolve inside `approved_store` |
| `measure_from` | `YYYY-MM-DD`, or blank |

If any required key is missing, blank, or the word `REPLACE`, do not open an issue. Reply with the name of the missing piece and stop. `backup`, `measure_from`, `go_live_approved_by`, and `reasoner_model` may be blank. Blank backup is read as `none`.

Startup refusals, before any program is read:

- Any of `days_target`, `cost_cut_target`, `target_days`, `hd_result`, `accuracy_target` present in config is `threshold_refused`.
- `go_live_exact_min` equal to `0.63`, `63`, `63%`, `0.50`, `50`, `50%`, `21.5`, or `7.9` is `copied_rate_refused`.
- `go_live_exact_min` outside `0.91`–`0.99` with exactly two decimal places is `threshold_invalid`. `0.9` is `threshold_invalid`. `0.90` is `threshold_invalid`.
- `mode` outside `log`, `shadow`, `export` is `mode_invalid`.
- `mode` `export` while `go_live_approved_by` is blank is `export_early`.
- `external_model` `yes` before the section 16 gate is `model_locked`.
- `engineer_confirms` set to anything but `yes` is `confirm_locked`.
- `lead` equal to `engineer`, or `backup` equal to `lead`, is `segregation_locked`.
- `site_name` or `cell_id` containing a comma is `scope_locked`.
- `cell_kind` outside `robot` and `cnc` is `kind_invalid`.
- `min_closed_fixes` below `8` on `live_dir` is `history_floor_refused`. The fixture directory may hold `1`.
- `golden_min` below `8` on `live_dir` is `golden_floor_refused`. The fixture directory may hold `1`.
- `approval_key` equal to `example-approval-key`, or blank, is `key_invalid` on `live_dir`.
- A config key named `controller_host`, `controller_path`, `deploy`, or `robot_ip` is `deploy_locked` at startup. Those keys are not part of version 1.
- A registered model tool whose name is `deploy_program`, `write_controller`, `approve_proposal`, `export_proposal`, `set_cause`, or `invent_line` is `tool_on_model_refused` at startup.
- `max_model_calls` not matching the rule in the table is `model_cap_invalid`.
- `simulation` outside `yes` and `no` is `simulation_invalid`.

The lead types `go_live_approved_by` on the form. The agent does not. Approving one proposal does not set `mode` to `export`. A person edits the flag. The agent only refuses a flag that is early.

---

## 4. Architecture

Published shape, named as an echo: an agent reads the program that is already running and recommends a change; an engineer reviews it and refines it; simulation sits in the same workflow; the program does not change on the strength of the model alone. The boxes below are our design. Version 1 replays one historical edit. It does not author a sequence from a blank page.

```text
Approved store only
    │
    ▼
program files, one revision each
cell, part, alarms, cycles, fixes, changes, outcomes
issue: cell, part, program, revision, alarm, symptom
    │
    ▼
orchestrator
    ├─ cell unknown or not the configured cell → stop, cell_out_of_scope
    ├─ mode log → retrieval is written, proposal is logging_only
    ├─ closed fixes on this cell < min_closed_fixes → history_thin
    └─ else
            │
            ▼
      retrieve similar closed fixes on this cell
            │
            ▼
      diff current revision against the previous revision
      (the diff is evidence; it is not the edit)
            │
            ▼
      replay the top applicable historical edit
      cause_code comes from that fix and from nowhere else
            │
            ▼
      offline check, if simulation is yes
        fail → proposal held, not approvable
        skip → visible, not exportable
        pass → approvable, still not approved
            │
            ▼
      engineer form
        reject → proposal stays unapproved
        approve → approved, exported false, controller_written false
            │
            ▼
      export only after section 16, as a file a person loads
      there is no arrow to a controller
```

Four actors, one codebase, no shared prompt that can both choose a line and approve. The orchestrator dispatches. It does not retrieve. The retrieval actor returns hits. It does not edit. The diff actor writes the diagnostic diff. It does not apply it. The proposal actor replays one fix. It does not approve.

The language model, if configured and if `external_model` is `yes`, may return a `fix_id` that already appears in `hits`. It does not see program text. It does not choose the cause, the lines, the cycle time, or the signature. If the model and the function disagree, the function wins and the extra keys are dropped. An empty `fix_id` keeps the top hit. A `fix_id` that is not in `hits` is `model_fix_rejected` and the top hit is kept. While `external_model` is `no`, the model is not called. The fixture tests never call a model.

**Stack.** Section 22. The path the tests lock is Python 3.11 or newer. The core is the standard library: `csv`, `json`, `hashlib`, `hmac`, `re`, `pathlib`, `decimal`. Time is timezone-aware. A timestamp with no offset is `offset_required` and the row is rejected. HTTP is not used on the locked path. Sockets are not used. Do not add a robot SDK, a serial library, a G-code interpreter package, or an HTTP client to the core.

Lay the code out as pure functions a test can call without a server:

- `load_config`, `load_world`, `assert_store`
- `tokenize`, `score_issue`, `retrieve`
- `parse_robot`, `diff_robot`, `apply_fix`
- `check_robot`, `check_gcode`
- `build_proposal`, `proposal_canonical`
- `approval_token`, `record_decision`, `export_proposal`
- `kpi_report`, `run_regression`, `daily_summary`

Put the rules in those functions. Do not reimplement them in the prompt.

Transport is a file drop. Someone, or a parser the plant already trusts, writes the directory in section 8. Version 1's core does not watch a controller and does not open a port.

---

## 5. Guardrails

These override a helpful tone, a cell that is down, and a manager who wants the published days on a slide about this plant.

1. **No invented line.** A proposed line is a current line, or the product of an applicable edit from one retrieved fix. A sentence the model composed is `line_invented` and is dropped.
2. **No invented cause.** `cause_code` equals the `cause_code` on the applied fix. That code must also be a row in `causes.csv`. A code that is only in `causes.csv`, and not on that fix, is `cause_not_in_history`.
3. **No other cell.** The issue's `cell_id` must equal config. Otherwise `cell_out_of_scope`. A second cell's programs are not retrieved.
4. **No merge of two fixes.** One hit supplies every edit. The next hit is tried only when the first hit applies nothing.
5. **No diagnostic diff as a patch.** Section 11's diff explains the current revision against the previous one. Applying that diff backwards, or deleting a line the historical fix did not delete, is `diff_applied` and the proposal is refused.
6. **No deploy.** `controller_written` is `false` on every object this file writes. An object that would set it `true` is not written. The function returns `deploy_refused`. There is no `deploy_program` tool.
7. **No export from `log` or `shadow`.** `export_proposal` returns `export_refused` and writes no file.
8. **No export without a passed check.** `simulation` `skipped` or `failed` cannot export. Shadow may skip and say so. Export may not.
9. **No proposal while logging.** `mode` `log` returns `logging_only`. Retrieval may still be written, so the engineer can see the neighbours while the log grows.
10. **No proposal on a thin history.** Closed fixes on this cell below `min_closed_fixes` return `history_thin`. The suggested floor on a live plant is 8.
11. **No approval from the model.** `approved` true is `record_decision` after section 14. The model does not hold `approve_proposal` or `export_proposal`.
12. **No percentage gate copied from the case.** `0.63` and `0.50` are `copied_rate_refused`. A model score does not approve.
13. **No day budget.** The runner does not fail a proposal for being slow, and does not declare success because a ticket closed in 7.9 days.
14. **No path outside the store.** Including after `realpath`.
15. **No second proposal.** The same `issue_id` does not overwrite a proposal with a different hash. A repeat run that reproduces the same hash is `duplicate_issue` and leaves the file.
16. **No EXAMPLE row in live.** An id that starts with `EXAMPLE` in `live_dir` refuses the run.
17. **No vendor binary in the core.** A file that does not match section 10 is `line_invalid`. The core does not guess the dialect.
18. **No unattended load.** `engineer_confirms` is `yes` for the life of version 1. There is no flag that turns the person off.

---

## 6. How the actors use tools

The model, when it is on, may call only the tools in this section marked model-safe. The runner may call all of them. A model call to a runner-only tool is `tool_on_model_refused` and the call is an audit row.

### 6.1 `lookup_issue` (model-safe)

```json
{
  "name": "lookup_issue",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "required": ["issue_id"],
    "properties": { "issue_id": { "type": "string" } }
  }
}
```

Returns the issue row, the cell, and the part. Does not return program text.

### 6.2 `retrieve_similar` (model-safe)

```json
{
  "name": "retrieve_similar",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "required": ["issue_id"],
    "properties": { "issue_id": { "type": "string" } }
  }
}
```

Returns the retrieval object in section 13.1. The model does not pass a score. Extra arguments are ignored.

### 6.3 `diff_program` (model-safe)

```json
{
  "name": "diff_program",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "required": ["issue_id"],
    "properties": { "issue_id": { "type": "string" } }
  }
}
```

Returns the diagnostic diff in section 13.2. This tool does not return a patched program.

### 6.4 `read_program` (model-safe)

```json
{
  "name": "read_program",
  "parameters": {
    "type": "object",
    "additionalProperties": false,
    "required": ["program_id", "revision"],
    "properties": {
      "program_id": { "type": "string" },
      "revision": { "type": "string" }
    }
  }
}
```

Returns the body only when that revision is one of: the issue's current revision, the previous revision, or the `from_revision` or `to_revision` of a hit. Any other revision is `revision_not_in_scope` and the body is not returned.

### 6.5 `build_proposal` (runner only)

No model tool. Input is the issue id. Output is the proposal object in section 13.3, or a refusal code. The proposal actor is this function.

### 6.6 `check_simulation` (runner only)

No model tool. Input is the proposed lines. Output is `passed`, `failed`, or `skipped`, plus `simulation_code`. The model does not get to say the check passed.

### 6.7 `approve_proposal`, `export_proposal`, and `log_fix` (runner only, forms)

A person acts by a form. The model cannot submit the form. Channel `model` is `prompt_ignored`. `log_fix` appends a fix the engineer already made: a from-revision, a to-revision, a cause code, and the new program file the engineer supplies. The agent does not invent the logged program. `log_fix` is how the first month builds the history section 7 requires.

---

## 7. What you need before this works

This is the honest list. If one line is missing, stay in `log` or stop. Do not scrape a controller, and do not download a program from a robot.

1. **Program text you can read.** A robot job export or a G-code file, converted by a parser the plant trusts into section 10. A teach-pendant photo, a vendor binary, and a CAD file are not inputs. The core will not crack them.
2. **The same alarm code twice.** The code on the ticket has to be the code in `alarms.csv` and the code on the old ticket. A free-text symptom with no shared code can still score on the part and the words, and it will usually fall under `min_similar_score`. That is the right failure.
3. **A before and an after.** Each fix names `from_revision` and `to_revision`, and a row in `changes.csv` names the same pair. Without that pair, there is nothing to replay.
4. **Enough of those pairs.** The suggested floor is 8 closed fixes on this cell. Fewer returns `history_thin` once `mode` leaves `log`. Zero is a successful first month if the log grows. It is not a failed model.
5. **Outcomes a person types.** Days to resolve, whether the first fix held, and engineer hours. The agent does not infer these from a clock and then call the inference a result.
6. **An envelope, if the check is on.** Named points and coordinates for a robot cell, or axis limits and a max feed for a CNC. A missing envelope with `simulation` `yes` is `simulation_unconfigured`. Turning the check off is allowed in shadow and is printed as `skipped`. Export stays shut until a check has passed.
7. **An engineer.** The file has no path where approval is off. The engineer is the person who will refuse a bad replay. The published pilot kept that person on the review. This file keeps the person on the signature as well.
8. **No route to the machine.** The folder this agent can see is not a network share the controller can pull, and the host it runs on has no socket opened by this code. A later integrator who wants a loader builds it outside the core, reads `FOR_ENGINEER_LOAD`, and still waits for a person.
9. **Time.** The published result came from a company that already had robot programs to analyze, on a pilot that started in August 2026 and was reported in November. The company account does not say a new customer with an empty archive gets the same reduction in the first month. A secondary write-up says the result depends on historical program data already structured, and that a first-time adopter will not reproduce it immediately. This file's first thirty days are the structuring. They are the work, not a delay in front of the work.

A plant that wants the proposal in week one, on a cell with no closed fixes, is asking for a different product. This file will refuse that run and say `history_thin` or `logging_only`.

---

## 8. Inputs

A live drop, and the fixture, are a directory of CSV and text files. UTF-8. A header row. Commas. No BOM.

| File | Who writes it | What it holds |
| --- | --- | --- |
| `config.csv` | A person | Section 3, one key per row: `key,value` |
| `people.csv` | A person | `person_id,role` with role `lead` or `engineer` |
| `cells.csv` | A person | `cell_id,site_name,kind` |
| `parts.csv` | A person | `part_id,name` |
| `programs.csv` | A person, or the trusted parser | `program_id,cell_id,part_id,revision,kind,sha256` |
| `causes.csv` | A person | `cause_code,label`. The only cause vocabulary |
| `issues.csv` | The engineer, or the export | `issue_id,cell_id,part_id,program_id,revision,alarm_code,symptom,opened_at,closed_at,status` |
| `fixes.csv` | The engineer, through `log_fix` | `fix_id,issue_id,from_revision,to_revision,cause_code,engineer_id` |
| `changes.csv` | The engineer, through `log_fix` | `change_id,program_id,from_revision,to_revision,fix_id` |
| `outcomes.csv` | A person | `issue_id,days_to_resolve,first_time_fix,engineer_hours` |
| `alarms.csv` | The cell's log export | `alarm_id,cell_id,program_id,revision,alarm_code,at` |
| `cycles.csv` | The cell's log export | `cycle_id,cell_id,program_id,revision,cycle_s,at` |
| `points.csv` | A person | `cell_id,point,x,y,z` integers. Robot cells |
| `envelope.csv` | A person | `cell_id,xmin,xmax,ymin,ymax,zmin,zmax` integers |
| `signals.csv` | A person | `cell_id,signal` |
| `golden.csv` | A person | `issue_id,source_fix_id,cause_code,line_sha256`. The runner never writes this file |
| `programs/` | The plant's parser | Section 10 |

`status` is `open` or `closed`. `kind` is `robot_job` or `gcode`. `first_time_fix` is `yes` or `no`. `opened_at`, `closed_at`, and `at` are UTC timestamps ending in `Z`. An open issue has an empty `closed_at`. A timestamp with no offset is `offset_required`.

`days_to_resolve` and `engineer_hours` are decimal strings the plant types, one digit after the point. The runner does not replace them with a subtraction of the timestamps. A plant that counts working days may disagree with the clock. The typed number is the number.

`sha256` on `programs.csv` is the lowercase hex SHA-256 of the program file's exact UTF-8 bytes, including its final newline. A mismatch is `program_hash_mismatch` and that revision is unreadable.

`load_world` loads only programs listed in `programs.csv`. An extra file under `programs/` is ignored. It is not an error. The CNC unit test in section 15 reads its file by the path given there.

---

## 9. Ontology-lite

Six objects, flat files, no graph database. This is our stand-in for "a structured history an agent can query." It is not Palantir's Ontology, and it is not a claim that the pilot stored these columns.

| Object | Identity | Points at | Written by |
| --- | --- | --- | --- |
| Cell | `cell_id` | the one site | A person |
| Part | `part_id` | a name | A person |
| Program | `program_id` + `revision` | one cell, one part, one kind, one file hash | The parser, or `log_fix` |
| Issue | `issue_id` | cell, part, program revision, alarm, symptom, open or closed | The ticket |
| Fix | `fix_id` | one issue, a from-revision, a to-revision, one cause code | The engineer |
| Outcome | `issue_id` | days, first-time-fix, engineer hours | A person, after the ticket closes |

A change row is the fix seen from the program side. A fix with no matching change row is `change_unlogged` and cannot be replayed. An outcome with no closed issue is ignored by section 20.

The runner queries these files. It does not create a seventh kind of object because a sentence sounded useful.

---

## 10. Ingestion and the line grammar

Version 1's program is one UTF-8 file per revision. The case does not print a grammar. This grammar is our design so a diff can name a sequence, a path, and a speed, which are the three things the newsroom says engineers were adjusting by hand.

Robot job, `kind` `robot_job`, for `cell_kind` `robot`. Every body line matches:

```text
^SEQ (\d+) (MOVE|WAIT) (\S+) (\d+)$
```

One record is `seq`, `op`, `arg`, `value`. `SEQ 10 MOVE P2 80` is sequence 10, a move to point `P2`, at speed 80. `SEQ 40 WAIT DI1 20` is sequence 40, a wait on signal `DI1`, for duration 20. No leading zeros. Single spaces. No trailing space. The file ends with one newline. A blank line is `line_invalid`.

G-code, `kind` `gcode`, for `cell_kind` `cnc`. Every body line matches:

```text
^N(\d+)((?: [A-Z]-?\d+)+)$
```

Words are one letter and an integer. `N10 G0 X0 Y0 Z5` is legal. A decimal, a comment, a percent sign, and a macro are `line_invalid`. The core accepts `G0`, `G1`, and `G90`. `G91` on any line is `mode_refused` for the whole check. Any other `G` number is `gcode_unsupported`. Motion and feed are modal. Position is absolute. The axes start unknown until a word sets them.

A `robot_job` file on a `cnc` cell, or a `gcode` file on a `robot` cell, is `kind_mismatch` and is not proposed from.

Revisions in version 1 are a single uppercase letter `A` through `Z`. The previous revision of `C` is `B`. Revision `A` has no previous revision. The diagnostic diff then uses the same keys as section 13.2, with `base_revision` `""` and `hunks` `[]`, and the function returns the code `no_previous_revision` beside that object. The fixture's open issue is on revision `C`, so this empty case is not part of the hashed run.

The parser that emits these files, whether a person or a program runs it:

1. Do not merge two revisions into one file. The filename is the revision letter plus `.txt`, under `programs/{program_id}/`.
2. Do not translate comments into steps. Drop comments in the parser, before the file exists.
3. Do not OCR inside the core.
4. A file over 20,000 characters is `program_too_large` and is unreadable. The fixture files are far under that.

---

## 11. Retrieval, diff, cause, and the replay

### 11.1 Tokens

From a symptom, find every span matching `[A-Za-z0-9]{2,}`. Lowercase each one. The result is a set. A repeated word counts once. A one-character token is dropped. There is no stop-word list. `on` counts. `a` does not.

### 11.2 Who may be retrieved

A closed issue on the configured cell, with a fix row, is a candidate. A different cell is not a candidate. An open issue is not a candidate. A fix whose `cause_code` is absent from `causes.csv` is `cause_unknown` and is not a candidate. A fix with no `changes.csv` row of the same `fix_id`, `program_id`, `from_revision`, and `to_revision` is held with reason `change_unlogged` and score `0`.

Score, as an integer:

- `+10` when `alarm_code` is non-empty and equal, case sensitive.
- `+6` when `part_id` is equal.
- `+2` when the symptom token sets share 2 or more tokens. A share of 1 adds nothing. The size above 2 adds nothing further.

Sort candidates by score descending, then by `issue_id` ascending. Hits are the prefix with score greater than or equal to `min_similar_score`, truncated to `max_similar`. Everyone else who was a same-cell candidate is held with reason `below_min` and the score that was computed. Hits and held are both in the retrieval object. Held is sorted by `issue_id` ascending.

The cause on a hit is copied from that fix. The retriever does not vote on a cause that no hit carries.

### 11.3 Diagnostic diff

This is evidence for the engineer. It is not the patch.

Base is the previous revision letter of the issue's revision, for the same `program_id`. Current is the issue's revision. Parse both with section 10.

Robot hunks, keyed by `seq`, walked in ascending order. Within a seq, field order is `op`, then `arg`, then the value field. If either record's `op` is `MOVE`, the value field is named `speed`. If both records are `WAIT`, the value field is named `duration`. Emit an `op` hunk, then an `arg` hunk, then the value hunk, and only for fields that differ.

- Same seq, field differs: `{"field","from","kind":"changed","seq","to"}`. `from` and `to` are strings.
- Seq only on current: `{"kind":"added","line","seq"}`. `line` is the current source line, without a newline.
- Seq only on base: `{"kind":"removed","line","seq"}`. `line` is the base source line, without a newline.

G-code hunks use the same shapes, keyed by the `N` integer stored in `seq`, and a changed line is a whole-line replacement: `field` is `line`, `from` is the base line, `to` is the current line. The fixture's hashed diff is the robot diff, not a G-code diff.

### 11.4 Replay

Walk hits in the retrieval order. For each hit, compute the edit from that fix's `from_revision` to its `to_revision` on that fix's program, using the hunk rules above where "base" is `from_revision` and "current" is `to_revision`. Then try to apply those hunks onto the issue's current revision.

A changed field applies only when the current record exists and equals the from-record on `op`, `arg`, and `value`. The current record is then copied, and each changed field is set to the to-record's value. One reasoning sentence is emitted per changed field.

An added seq applies only when the current program does not already have that seq. The to-line is inserted.

A removed seq applies only when the current program has that seq and the current record equals the from-record. The seq is dropped.

A hunk that does not apply is skipped. It does not cancel the hunks that do apply. If the hit applies zero hunks, try the next hit. If no hit applies a hunk, the result is `no_applicable_edit` and there is no proposal.

Do not merge hunks from two hits. The first hit that applies at least one hunk is the only source. `source_fix_id` is that fix. `cause_code` is that fix's cause.

Emit robot lines in seq order as `SEQ {seq} {op} {arg} {value}` with single spaces, the integers printed in decimal without leading zeros. The file body inside the proposal is the `lines` array, one string per line, no newline inside a string.

Reasoning, one sentence per applied edit, joined with `\n` when there is more than one. The fixture has one sentence and no newline inside it.

- Field: `Applied {fix_id} to SEQ {seq}: {field} {from} to {to}. Cause {cause_code} from that fix. Similar score {score}.`
- Added: `Applied {fix_id} to SEQ {seq}: added {line}. Cause {cause_code} from that fix. Similar score {score}.`
- Removed: `Applied {fix_id} to SEQ {seq}: removed {line}. Cause {cause_code} from that fix. Similar score {score}.`

`{field}` is `speed`, `duration`, `op`, `arg`, or `line`. `{from}` and `{to}` are the strings from the hunk. `{score}` is the integer score with no padding.

### 11.5 Worked scores for the fixture

Open issue `EXAMPLE-ISSUE-3`. Symptom `cycle slow after path change`. Alarm `ALM-12`. Part `EXAMPLE-PART-A`. Program `EXAMPLE-PROG-1` revision `C`.

Tokens: `after`, `change`, `cycle`, `path`, `slow`.

| Closed issue | Why | Score |
| --- | --- | --- |
| `EXAMPLE-ISSUE-1` | Alarm `ALM-12` matches (`+10`). Part `EXAMPLE-PART-A` matches (`+6`). Tokens `cycle`, `move`, `on`, `second`, `slow` share `cycle` and `slow` (`+2`). Fix `EXAMPLE-FIX-1`, cause `speed_high`. | 18 |
| `EXAMPLE-ISSUE-2` | Alarm `ALM-99` does not match. Part `EXAMPLE-PART-B` does not match. Tokens `gripper`, `fault` share nothing. Fix `EXAMPLE-FIX-2` is not a hit. | 0 |

`min_similar_score` is 10. The hit list is issue 1 only. Issue 2 is held as `below_min`.

Diagnostic diff of revision `C` against revision `B`: seq 20 speed `35` to `80`, and seq 50 added as `SEQ 50 WAIT DI2 10`. Seq 10, 30, and 40 match.

Replay of fix 1, which edited revision `A` into revision `B`: the only change is seq 20 speed `80` to `35`. Current revision `C` seq 20 is `MOVE P2 80`, which equals revision `A`. The edit applies. Seq 50 was not in that fix, so it stays. The proposal has five lines. A builder who copies revision `B` wholesale, and drops seq 50, fails the hash. A builder who reverses the diagnostic diff and deletes seq 50 fails the same hash. That deletion is `diff_applied`.

The proposal cause is `speed_high`. `causes.csv` also contains `signal_miss` and `servo_fault`. Neither of those strings appears in the proposal object. `signal_miss` belongs to fix 2, which was not applied. `servo_fault` belongs to no fix.

---

## 12. Offline check

The newsroom says simulation is part of the workflow. It does not print one. This check is our design. It does not claim to move a virtual robot, and it does not claim to be the simulator in the pilot.

When `simulation` is `no`, set `simulation` to `skipped` and `simulation_code` to `""`. Do not read the envelope. The proposal can still be approved in shadow. It cannot be exported.

When `simulation` is `yes` and the cell has no envelope row, set `simulation` to `failed`, `simulation_code` to `simulation_unconfigured`, `approvable` to false, and `status` to `held`.

Robot check, walking the proposed lines in order. The first failure stops the walk.

1. The line matches section 10. Otherwise `line_invalid`.
2. `seq` is strictly greater than the previous seq. Otherwise `seq_order`.
3. `MOVE`: `arg` is a point on this cell in `points.csv`. Otherwise `point_unknown`. `x`, `y`, and `z` are inside the envelope, inclusive. Otherwise `axis_outside`. `value` is from 1 through `max_speed`, inclusive. Otherwise `speed_high`.
4. `WAIT`: `arg` is a signal on this cell. Otherwise `signal_unknown`. `value` is from 1 through `max_duration`, inclusive. Otherwise `duration_high`.

G-code check, for `check_gcode`, walking lines in order. Position starts unknown. Motion starts unknown. Feed starts unknown. `G90` is assumed until a line says otherwise.

1. The line matches section 10. Otherwise `line_invalid`.
2. `N` is strictly greater than the previous `N`. Otherwise `seq_order`.
3. `G91` returns `mode_refused` for that line.
4. A `G` other than 0, 1, or 90 returns `gcode_unsupported`.
5. Apply `X`, `Y`, `Z`, and `F` as absolute integers. Then, for each axis that has been set at least once, test the envelope. The first axis outside, in order `X` then `Y` then `Z`, returns `axis_outside`.
6. After the bounds, if `F` has been set and `F` is greater than `max_feed`, return `feed_high`.

A pass sets `simulation` to `passed` and `simulation_code` to `""`. A failure sets `simulation` to `failed`, `simulation_code` to the code, `approvable` to false, and `status` to `held`.

The fixture's five proposed lines pass: points `P1`, `P2`, and `P3` are inside `0..200`, `0..200`, `0..50`; speeds 40, 35, and 80 are inside `1..100`; signals `DI1` and `DI2` exist; durations 20 and 10 are inside `1..100`.

The CNC unit test is not part of `run_regression`. Call `check_gcode` on these two lines, envelope `0,200,0,200,0,50`, `max_feed` 1000, `program_id` `EXAMPLE-PROG-CNC`, revision `A`:

```text
N10 G0 X0 Y0 Z5
N20 G1 Z-5 F400
```

`N10` sets `Z` to 5, which is inside. `N20` sets `Z` to `-5`, which is outside. The result is section 13.8. Bounds are tested before feed, so the failure is `axis_outside` and not `feed_high`.

---

## 13. Data model and JSON schemas

Canonical JSON, for every hash in this file: UTF-8, keys sorted at every object, separators comma and colon with no spaces, non-ASCII escaped, one trailing newline. In Python 3.11 that is `json.dumps(obj, sort_keys=True, separators=(",", ":"), ensure_ascii=True) + "\n"`. Arrays keep the order this file states. SHA-256 is the lowercase hex of those bytes. A hash that does not match is a failed build, not a warning.

### 13.1 Retrieval object

```json
{
  "held": [
    {"issue_id": "EXAMPLE-ISSUE-2", "reason": "below_min", "score": 0}
  ],
  "hits": [
    {"cause_code": "speed_high", "fix_id": "EXAMPLE-FIX-1", "issue_id": "EXAMPLE-ISSUE-1", "score": 18}
  ],
  "issue_id": "EXAMPLE-ISSUE-3"
}
```

SHA-256 `d151b098c6d4700d1f5971481d046d3f4199e9283fdcd66c9a77f7de13d7e694`.

### 13.2 Diagnostic diff

```json
{
  "base_revision": "B",
  "hunks": [
    {"field": "speed", "from": "35", "kind": "changed", "seq": 20, "to": "80"},
    {"kind": "added", "line": "SEQ 50 WAIT DI2 10", "seq": 50}
  ],
  "issue_id": "EXAMPLE-ISSUE-3",
  "program_id": "EXAMPLE-PROG-1",
  "revision": "C"
}
```

SHA-256 `85c0518fecec669b9ef421eea53f57e8ab72f4a12fee58421e3b484f5d3460ed`.

### 13.3 Proposal

```json
{
  "alarm_corroborated": true,
  "approvable": true,
  "approved": false,
  "approved_by": "",
  "cause_code": "speed_high",
  "controller_written": false,
  "cycle_s": 48,
  "exported": false,
  "issue_id": "EXAMPLE-ISSUE-3",
  "lines": [
    "SEQ 10 MOVE P1 40",
    "SEQ 20 MOVE P2 35",
    "SEQ 30 MOVE P3 80",
    "SEQ 40 WAIT DI1 20",
    "SEQ 50 WAIT DI2 10"
  ],
  "program_id": "EXAMPLE-PROG-1",
  "reasoning": "Applied EXAMPLE-FIX-1 to SEQ 20: speed 80 to 35. Cause speed_high from that fix. Similar score 18.",
  "simulation": "passed",
  "simulation_code": "",
  "source_fix_id": "EXAMPLE-FIX-1",
  "status": "pending_engineer"
}
```

`cycle_s` is the median of `cycles.csv` rows for this cell, program, and revision. Sort the integer samples ascending. An odd count takes the middle integer. An even count takes the mean of the two middle integers. A whole number is a JSON integer. A half is a JSON number with one decimal. No rows leaves `cycle_s` as `null` and still allows approval. The fixture has one row, 48. SHA-256 `ffd60bd5bf3912344277107b6542c9dcd22790ebbc26261ae49d9abf79f6638c`.

`alarm_corroborated` is true when at least one `alarms.csv` row matches the issue's cell, program, revision, and alarm code. False sets `approvable` false and `status` `held`. The fixture row matches, so the flag is true.

`status` is `pending_engineer` when `approvable` is true, and `held` when it is not. After a valid approval it becomes `approved_proposal`. After a rejection it becomes `rejected`.

### 13.4 Decision

The token is lowercase hex HMAC-SHA256 of the UTF-8 string:

```text
{action}|{issue_id}|{proposal_sha256}|{exp}|{actor}
```

using `approval_key`. `exp` is a UTC timestamp ending in `Z`. The token is dead when `run_clock` is after `exp`. Equal to `exp` is alive. A GET does not submit the form.

Actions in version 1: `approve_proposal`, `reject_proposal`, `go_live`. `go_live` records the lead's id into the decision log. It does not by itself set `mode` to `export`. A person edits that value afterward.

For the fixture, `approval_key` is `example-approval-key`, action `approve_proposal`, issue `EXAMPLE-ISSUE-3`, proposal hash `ffd60bd5bf3912344277107b6542c9dcd22790ebbc26261ae49d9abf79f6638c`, `exp` `2026-11-12T18:00:00Z`, actor `EXAMPLE-ENG`. The token is `4fc266ff90958386bacf1bcec770040dcc64df347823873a05860e256547d1be`.

After that approval, with `run_clock` at or before `exp`, the proposal becomes `approved` true, `approved_by` `EXAMPLE-ENG`, `status` `approved_proposal`. `exported` stays false. `controller_written` stays false. The lines do not change. SHA-256 `e0a2a8bc03fcb198c90996e50f5b1ba6a8fdc28fbe66fe6c79b27e9a867cf92d`.

A token signed by `EXAMPLE-LEAD` for `approve_proposal` is `wrong_actor`. A token signed by `EXAMPLE-ENG` for `go_live` is `wrong_actor`. An expired token is `token_dead` and the proposal stays pending.

### 13.5 Logging-only object

`mode` `log`, same issue:

```json
{"code": "logging_only", "issue_id": "EXAMPLE-ISSUE-3", "proposal": false}
```

SHA-256 `e1a1cc53ac153024c5b6416750fb62929453211ba00d00acf420ba533f0dac35`. No file under `out/proposals/` for this call. The retrieval file may still be written.

### 13.6 Thin-history object

`proposal_for("EXAMPLE-ISSUE-3", min_closed_fixes=8)` against the fixture world, whose cell has 2 closed fixes:

```json
{
  "closed_fixes": 2,
  "code": "history_thin",
  "issue_id": "EXAMPLE-ISSUE-3",
  "min_closed_fixes": 8,
  "proposal": false
}
```

SHA-256 `73231ac29a6bd82ab2dc5a94bbaad0aec7b5aecb0dfe1ce98db578819a3ca471`. Closed fixes are fixes whose issue is on this cell and whose issue status is `closed`. The count is 2 because both fixture fixes are on `EXAMPLE-CELL-1`. This call is how the test locks the floor. The fixture config's `min_closed_fixes` of `1` is what `run_regression` uses, and that path proposes.

### 13.7 Morning file

Counts for a fixture `run_regression` of the one open issue, `mode` `shadow`, `simulation` `yes`, before any approval:

```json
{
  "approved": 0,
  "causes_not_in_history": 0,
  "controller_writes": 0,
  "exports": 0,
  "history_thin": 0,
  "logging_only": 0,
  "open_issues": 1,
  "proposals": 1,
  "simulation_failed": 0,
  "simulation_skipped": 0
}
```

SHA-256 `8d9eb5d55e86c2ae6a189aeb82f1d74aa6873639506373677db36208938f9542`.

The morning file has no key named `target`, `hyundai`, `days_21`, `days_7`, `sixty_three`, or `cost`. A sentence under it that quotes the case study's rates is deleted. `controller_writes` is present so a non-zero value is obvious. Version 1 has no statement that increments it. A builder who adds an increment has failed the test.

### 13.8 G-code bounds failure

```json
{
  "code": "axis_outside",
  "line": "N20 G1 Z-5 F400",
  "program_id": "EXAMPLE-PROG-CNC",
  "revision": "A"
}
```

SHA-256 `98001043c4108a63b62f0482aa8a19a6ff7b28600b7c35223b0ccd747bb9e8eb`.

### 13.9 Export refusal and deploy refusal

`export_proposal` on the fixture, whose `mode` is `shadow`, including after the engineer has approved:

```json
{"code": "export_refused", "issue_id": "EXAMPLE-ISSUE-3"}
```

SHA-256 `b8d11cef6c9da1436b5ddb995e9fd9b0fc43bdec4a499a8c82622e084390af32`. No file under `out/exports/`.

Any write that would set `controller_written` to true:

```json
{"code": "deploy_refused", "issue_id": "EXAMPLE-ISSUE-3"}
```

SHA-256 `51da2614addafbf8731516373915ee4170627b512015250ce0d4727f843b305a`.

### 13.10 KPI object

From the fixture's `outcomes.csv` only. Section 20 defines the arithmetic. SHA-256 `f2edc190316788fbc2cb2c37f047c3472110168e8e8d229b00e3ce6359aa648b`.

```json
{
  "closed_issues": 2,
  "engineer_hours_sum": "8.5",
  "first_time_fix": "1/2",
  "median_days_to_resolve": "5.5"
}
```

### 13.11 Audit line for the proposal

Append one JSON object per line to `out/audit.jsonl`. The proposal write in the fixture appends:

```json
{
  "action": "propose",
  "actor": "EXAMPLE-AGENT-PROPOSE",
  "at": "2026-11-12T16:00:00Z",
  "cause_code": "speed_high",
  "issue_id": "EXAMPLE-ISSUE-3",
  "result": "pending_engineer",
  "source_fix_id": "EXAMPLE-FIX-1"
}
```

`at` is `run_clock`. SHA-256 of that object, canonical, is `fdc3750465bf15ed3a899051c1b1d0b03e19a3719a20876636675ac5b7a1566c`. The file is JSON Lines, so the line is those canonical bytes. Do not delete lines.

---

## 14. Human approval

The engineer confirms before a proposal is approved, and again, by loading a file in person, before a machine changes. The company account says engineers review and refine the recommendation. It does not print a token. The token is this file's design, because a replayed edit can still be the wrong edit for this part, this week.

1. `build_proposal` sets `approved` false. `approvable` is true only when the alarm is corroborated and the check passed or, in shadow, was skipped. Export never accepts a skip.
2. The engineer reads the proposal beside the current program file and the diagnostic diff. The form has two actions: approve, reject.
3. Approve requires a live token from section 13.4. The actor is the engineer or the backup. The lead cannot approve a proposal.
4. Reject records `approved` false and `status` `rejected`. No export.
5. Opening the program file is not an approval. A model sentence that says "approved" is `prompt_ignored`.
6. Approval of one issue does not approve the next one.
7. Go-live is a different form. The lead signs it. The engineer cannot. After the lead signs, a person may set `mode` to `export`. The agent does not.
8. `export_proposal` writes `out/exports/{issue_id}.txt` only when `mode` is `export`, `go_live_approved_by` is the lead, `approved` is true, `approved_by` is the engineer or the backup, `approvable` is true, and `simulation` is `passed`. The file's first line is `FOR_ENGINEER_LOAD`. The second line is `controller_written false`. The program lines follow, one per line, ending with a newline. `exported` becomes true on the proposal object. `controller_written` stays false.
9. There is no eighth step in which the runner opens a socket.

`engineer_confirms` cannot be set to `no`. There is no unattended path in version 1.

---

## 15. Worked fixture

Delete every `EXAMPLE` id before a live program is read. These lines are not an HD Hyundai Robotics program, not a Palantir object, and not a motion anyone should run on a robot.

`cells.csv`

```text
cell_id,site_name,kind
EXAMPLE-CELL-1,EXAMPLE-SITE,robot
```

`parts.csv`

```text
part_id,name
EXAMPLE-PART-A,EXAMPLE bracket
EXAMPLE-PART-B,EXAMPLE gripper
```

`causes.csv`

```text
cause_code,label
speed_high,Move speed above the speed on the accepted fix
signal_miss,Wait signal not seen
servo_fault,Present so a guessed cause has a name to misuse
```

`programs.csv`

```text
program_id,cell_id,part_id,revision,kind,sha256
EXAMPLE-PROG-1,EXAMPLE-CELL-1,EXAMPLE-PART-A,A,robot_job,f8c3be091e633154a1d6e787a51244feabf80e308e24ccab3a0aae0d6b9b12fd
EXAMPLE-PROG-1,EXAMPLE-CELL-1,EXAMPLE-PART-A,B,robot_job,68604461baecb79fa6c0e016a336f84d13edd4a1edb521ed1ef5388c57c3af60
EXAMPLE-PROG-1,EXAMPLE-CELL-1,EXAMPLE-PART-A,C,robot_job,2c5505892dfa14123f5a2718aae44146453fc74f539f42c861af0e1731942a15
EXAMPLE-PROG-2,EXAMPLE-CELL-1,EXAMPLE-PART-B,A,robot_job,7cadd5c6d72ff0344d69e7b9500f8b32acee72041373a9f02b7a8c636af00817
EXAMPLE-PROG-2,EXAMPLE-CELL-1,EXAMPLE-PART-B,B,robot_job,b295858dd186ecb8dc8f38d33ab54661552dcaa4d795b8deffe36d8c7b6f5307
```

`programs/EXAMPLE-PROG-1/A.txt`

```text
SEQ 10 MOVE P1 40
SEQ 20 MOVE P2 80
SEQ 30 MOVE P3 80
SEQ 40 WAIT DI1 20
```

`programs/EXAMPLE-PROG-1/B.txt`

```text
SEQ 10 MOVE P1 40
SEQ 20 MOVE P2 35
SEQ 30 MOVE P3 80
SEQ 40 WAIT DI1 20
```

`programs/EXAMPLE-PROG-1/C.txt`

```text
SEQ 10 MOVE P1 40
SEQ 20 MOVE P2 80
SEQ 30 MOVE P3 80
SEQ 40 WAIT DI1 20
SEQ 50 WAIT DI2 10
```

`programs/EXAMPLE-PROG-2/A.txt`

```text
SEQ 10 MOVE P1 20
```

`programs/EXAMPLE-PROG-2/B.txt`

```text
SEQ 10 MOVE P1 15
```

`programs/EXAMPLE-PROG-CNC/A.txt` is not in `programs.csv`. `load_world` ignores it. `check_gcode` reads it for section 13.8.

```text
N10 G0 X0 Y0 Z5
N20 G1 Z-5 F400
```

`issues.csv`

```text
issue_id,cell_id,part_id,program_id,revision,alarm_code,symptom,opened_at,closed_at,status
EXAMPLE-ISSUE-1,EXAMPLE-CELL-1,EXAMPLE-PART-A,EXAMPLE-PROG-1,A,ALM-12,cycle slow on second move,2026-08-01T00:00:00Z,2026-08-09T00:00:00Z,closed
EXAMPLE-ISSUE-2,EXAMPLE-CELL-1,EXAMPLE-PART-B,EXAMPLE-PROG-2,A,ALM-99,gripper fault,2026-08-02T00:00:00Z,2026-08-05T00:00:00Z,closed
EXAMPLE-ISSUE-3,EXAMPLE-CELL-1,EXAMPLE-PART-A,EXAMPLE-PROG-1,C,ALM-12,cycle slow after path change,2026-11-01T09:00:00Z,,open
```

`fixes.csv`

```text
fix_id,issue_id,from_revision,to_revision,cause_code,engineer_id
EXAMPLE-FIX-1,EXAMPLE-ISSUE-1,A,B,speed_high,EXAMPLE-ENG
EXAMPLE-FIX-2,EXAMPLE-ISSUE-2,A,B,signal_miss,EXAMPLE-ENG
```

`changes.csv`

```text
change_id,program_id,from_revision,to_revision,fix_id
EXAMPLE-CHG-1,EXAMPLE-PROG-1,A,B,EXAMPLE-FIX-1
EXAMPLE-CHG-2,EXAMPLE-PROG-2,A,B,EXAMPLE-FIX-2
```

`outcomes.csv`

```text
issue_id,days_to_resolve,first_time_fix,engineer_hours
EXAMPLE-ISSUE-1,8.0,yes,6.5
EXAMPLE-ISSUE-2,3.0,no,2.0
```

`alarms.csv`

```text
alarm_id,cell_id,program_id,revision,alarm_code,at
EXAMPLE-ALM-1,EXAMPLE-CELL-1,EXAMPLE-PROG-1,C,ALM-12,2026-11-01T10:00:00Z
```

`cycles.csv`

```text
cycle_id,cell_id,program_id,revision,cycle_s,at
EXAMPLE-CY-1,EXAMPLE-CELL-1,EXAMPLE-PROG-1,C,48,2026-11-01T10:05:00Z
```

`points.csv`

```text
cell_id,point,x,y,z
EXAMPLE-CELL-1,P1,0,0,10
EXAMPLE-CELL-1,P2,100,0,10
EXAMPLE-CELL-1,P3,100,80,10
```

`envelope.csv`

```text
cell_id,xmin,xmax,ymin,ymax,zmin,zmax
EXAMPLE-CELL-1,0,200,0,200,0,50
```

`signals.csv`

```text
cell_id,signal
EXAMPLE-CELL-1,DI1
EXAMPLE-CELL-1,DI2
```

`people.csv`

```text
person_id,role
EXAMPLE-LEAD,lead
EXAMPLE-ENG,engineer
```

`golden.csv`

```text
issue_id,source_fix_id,cause_code,line_sha256
EXAMPLE-ISSUE-3,EXAMPLE-FIX-1,speed_high,52839d7f0a0b7f7b3e5b78c03ce6c35adce9da05dfa7acf12c4a76f437f44d94
```

`line_sha256` is the SHA-256 of the proposed lines joined by `\n`, plus a trailing `\n`. The fixture value covers the five lines in section 13.3.

`run_clock` for the fixture is `2026-11-12T16:00:00Z`. The approval `exp` is `2026-11-12T18:00:00Z`. Config for the fixture run: `mode` `shadow`, `simulation` `yes`, `min_closed_fixes` `1`, `min_similar_score` `10`, `max_speed` `100`, `max_duration` `100`, `external_model` `no`, `cell_id` `EXAMPLE-CELL-1`, `cell_kind` `robot`.

Expected files after `run_regression` on the fixture:

- `out/retrieval/EXAMPLE-ISSUE-3.json` matches section 13.1.
- `out/diffs/EXAMPLE-ISSUE-3.json` matches section 13.2.
- `out/proposals/EXAMPLE-ISSUE-3.json` matches section 13.3.
- `out/daily_summary.json` matches section 13.7.
- `out/kpi.json` matches section 13.10.
- `out/audit.jsonl` contains the line in section 13.11.
- The strings `servo_fault` and `signal_miss` do not appear under `out/proposals/`.
- `out/exports/` does not exist, or is empty.
- No object under `out/` has `controller_written` set to true.

`record_decision` with the fixture token returns the approved hash in section 13.4 and still does not create an export file. `export_proposal` then returns section 13.9.

A model return of `{"fix_id":"EXAMPLE-FIX-2"}` is `model_fix_rejected`. The proposal hash does not change, because fix 2 is not a hit. A model return of `{"fix_id":"","cause_code":"servo_fault"}` drops the extra key, keeps the top hit, and does not change the hash.

---

## 16. Evaluation set and go-live threshold

The evaluation set is `golden.csv`. A person builds it from issues an engineer already closed, with the fix id, the cause, and the lines written down while looking at the program the engineer actually shipped. The agent does not label its own golden set.

A golden issue passes only when the proposal's `source_fix_id` and `cause_code` equal the row, and the SHA-256 of the proposed lines equals `line_sha256`. A proposal that names the right fix and changes a speed fails. A proposal that drops seq 50 fails. There is no partial credit.

`exact_rate` is the number of passing active golden issues divided by the number of active golden issues. Decide the gate with integers. Parse the two digits after the decimal point in `go_live_exact_min` as an integer `gate`. For `0.95`, `gate` is 95. The set passes when `passes * 100 >= gate * active`. For `0.95` and 8 active, that is `passes * 100 >= 760`, so 8 passes succeeds and 7 (`700`) fails. Do not use a binary float.

Go-live, all of them, before `mode` may be set to `export`:

- Active golden rows are at least `golden_min`. On a live folder the suggested minimum is 8. The fixture's `1` runs the tests and cannot sign go-live.
- `exact_rate` meets `go_live_exact_min` by the integer comparison above.
- `go_live_exact_min` is not a copied rate from section 3.
- The lead has signed `go_live`, and `go_live_approved_by` equals the lead.
- `causes_not_in_history`, `controller_writes`, and exports made while `mode` was not `export` are zero across the golden run.
- A person has read five proposals beside the program files and written those five issue ids into `reviewed.csv`. The suggested five is our design. It is not a sample size from the pilot.
- `simulation` on the golden proposals that are about to be exportable is `passed`. A `skipped` check does not enter the export set.

Missing any one of these, `mode` stays off `export`. A golden pass does not approve a live issue. Section 14 still runs on every proposal.

The published 63 percent is recorded in the source section so nobody has to hunt for it. It is not copied into `go_live_exact_min`. A plant whose own golden set lands near that number stays in shadow. The threshold starts at `0.95` because a program line is the kind of sentence a person should be right about almost every time before a file is offered for loading, and because an engineer still approves after that. `0.95` is our suggestion. It is not a result from the case.

---

## 17. Logging and audit

Append one JSON object per line to `out/audit.jsonl`. Do not delete lines. Do not rewrite the file to hide a refusal.

Each line has: `at` (UTC `Z`), `actor`, `issue_id`, `action`, `result`. A proposal line also has `cause_code` and `source_fix_id`. A refusal line has `code` in `result`.

Actions include `retrieve`, `diff`, `propose`, `refuse`, `approve`, `reject`, `export_refused`, `deploy_refused`, `prompt_ignored`, `log_fix`.

An engineer reading the log can reconstruct which fix was replayed, which cause was named, and which person approved or rejected. The program file remains the document. The log does not replace it.

The audit log is not a place to store the case study's rates. A line whose `result` contains `21.5` or `7.9` or `63` as a target is `audit_target_refused` and is not written. A count of refusals may be the integer 0. That is not the percentage.

---

## 18. Failure handling

| Condition | Code | What is written |
| --- | --- | --- |
| Wrong cell | `cell_out_of_scope` | Refusal. No proposal |
| `mode` is `log` | `logging_only` | Section 13.5 |
| Too few closed fixes | `history_thin` | Section 13.6 |
| Program hash disagrees | `program_hash_mismatch` | That revision unreadable |
| Kind disagrees with the cell | `kind_mismatch` | Refusal. No proposal |
| No hit applies | `no_applicable_edit` | Refusal. No proposal |
| Diagnostic diff used as the patch | `diff_applied` | Proposal refused |
| Cause not on the applied fix | `cause_not_in_history` | Proposal refused |
| Alarm not in the log | alarm flag false, `status` `held` | Proposal, not approvable |
| Check fails | `simulation` `failed` | Proposal, not approvable |
| Point missing | `point_unknown` | Check failure |
| Coordinate outside | `axis_outside` | Check failure |
| G-code incremental | `mode_refused` | Check failure |
| Approval missing or expired | `token_dead` or `wrong_actor` | `approved` stays false |
| Export before the gate | `export_refused` | No export file |
| Controller write | `deploy_refused` | Nothing is written |
| EXAMPLE id in live | `example_in_live` | Run stops |
| Path escapes the store | `confidential_refused` | Run stops |

A refusal is a successful run of the rules. It is not an invitation to try a broader cell, or to invent a cause so a proposal can exist.

---

## 19. Rollout

Ninety days. Our design. Not the pilot's calendar, and not a plan for a robot fleet.

Days 1 to 30. `mode` is `log`. One site. One cell. The engineer keeps fixing the cell the way they already do. Every fix is logged before the shift ends: the program file before, the program file after, the cause code from `causes.csv`, the alarm, and, when the ticket closes, the days, the first-time-fix flag, and the hours. The runner writes retrieval objects so the neighbours are visible. It writes no proposal. Time the tickets the engineer already closes, in days and in hours, into `outcomes.csv`. The agent does not fill that file.

Days 31 to 60. `mode` is `shadow`, and only if the cell now has at least `min_closed_fixes` closed fixes. The proposal sits beside the revision the engineer actually ships. The engineer marks, in a note the plant keeps, whether the replay matched the edit they made. `mode` stays off `export`. Count proposals the engineer would have rewritten. A rewrite is not a reason to lower `go_live_exact_min` to `0.63`.

Days 61 to 90. If section 16 passes, the lead may set `mode` to `export`. The export is a file the engineer loads at the cell, by hand, after reading it. The controller is still not on this network. The next cell waits for its own programs, its own fixes, its own envelope, and its own ninety days. One cell until the log is boring. That is the echo of a pilot that was reported on the work it had actually run, not on a fleet it had not counted.

A cell that reaches day 30 with an empty `fixes.csv` stays in `log`. Extending the thirty days is success. Skipping them is `history_thin`.

---

## 20. KPIs

Three numbers, all from `outcomes.csv`, all for this plant. `kpi_report` writes `out/kpi.json` in the shape of section 13.10.

- **Time to resolve.** `days_to_resolve` on each outcome row, parsed as a decimal. The median: sort ascending; if the count is odd, the middle value; if even, the mean of the two middle values. Format with one digit after the point. The fixture rows are `8.0` and `3.0`. The median is `5.5`. The agent does not compare this with 21.5 or with 7.9.
- **First-time-fix rate.** Count of rows whose `first_time_fix` is `yes`, over the count of outcome rows, written as `passes/count`. The fixture is `1/2`. Do not render it as a percent. A config value that tries to store `63` as this rate is `copied_rate_refused` at startup, before this report runs.
- **Engineer hours.** The sum of `engineer_hours`, one digit after the point. The fixture is `6.5` plus `2.0`, which is `8.5`.

Use `decimal.Decimal` for the sum and the mean. Do not use binary float.

The morning file adds the operational counts: proposals, history-thin refusals, logging-only runs, simulation failures, simulation skips, approvals, exports, causes not in history, controller writes. Controller writes stay at zero. Exports stay at zero until section 16 has passed and an engineer has approved the issue being exported.

`measure_from`, when the plant types it, is the date from which they are willing to read those counts. The report does not drop a row because of that date in version 1. The date is a label a person uses when they read the file. It is not a filter the model gets to apply.

---

## 21. Costs and effort

Version 1 is a file runner and a folder of program text. The cost to refuse is the time to read this file and to type the config. The cost to operate is one lead, one engineer, and one builder, for one cell, for ninety days. The first thirty of those days produce a log, not a saving.

Caps, so the desk stays that size:

- One site, one cell, one kind. A comma in the site or the cell refuses startup.
- `max_similar` suggested 3.
- `external_model` `no` until section 16. The locked path makes no network call and pays no model invoice.
- `max_model_calls` is 1 on the day a reasoner is allowed, and that call may only return a `fix_id` from the hits. The reasoner does not receive program text.
- The reasoner model id is blank until the lead types it. Storing a vendor's model name as a pre-filled default is `model_default_refused`.
- Do not buy a rollout to the rest of the plant's cells inside this folder. The published pilot is one company's reported span. It is not a license quantity.
- Do not add a robot SDK, a cell controller, or a graph database to the core in order to match a platform named in a secondary article. Those can sit beside the core later, reading the same export file. They do not get a second set of rules, and they do not get a deploy function this file forgot to write.
- The builder's done line is section 18's tests passing on the fixture, including the hashes. A demo that drafts a fluent program and fails a hash is not done.

---

## 22. Stack the tests lock

Python 3.11 or newer. Standard library only. CSV and JSON as specified. No robot SDK, no serial library, no HTTP client, no G-code package, no graph database on the path `run_regression` runs.

Functions named in section 4 are the API. A notebook that cannot be called as those functions is not an implementation.

The loader, when a person eventually wants one, reads `out/exports/{issue_id}.txt` and stops at a human. This file does not guess the controller's name.

---

## 23. What you do not claim

- Do not say this plant will cut a resolution from 21.5 days to 7.9 days, or by about 63 percent. That pair is HD Hyundai Robotics' published pilot result. It is not a quotation you may put on this plant.
- Do not say this plant will cut programming costs by more than 50 percent. The company expects that cut. The published, measured result is the time. The cost figure is a target.
- Do not say the pilot was a finished fleet-wide deployment. Seoul Economic Daily calls it a pilot rollout. The newsroom says the agents were introduced into problem-solving in August and that results have been demonstrated. Keep both, and do not upgrade them.
- Do not say this file is Palantir AIP, Foundry, or the Ontology. The company newsroom does not print those names. A secondary article does. The objects in section 9 are our files.
- Do not say the grammar, the score 18, the weights 10, 6, and 2, the hashes, `min_closed_fixes` 8, or `0.95` are HD Hyundai Robotics or Palantir settings. They are not published. They are our design. `EXAMPLE-PROG-1` is a fixture. It is not their robot program. `ALM-12` is a fixture alarm. It is not a code from their cell. Speed 35 is a fixture edit. It is not a speed from the keynote.
- Do not say version 1 has loaded a program, or that `controller_written` has been true, or that the agent ran a cell. The export starts with `FOR_ENGINEER_LOAD`. The controller flag starts false and stays false.
- Do not say a golden pass removes the engineer. Section 14 runs on every issue after go-live, and a person still loads the file.
- Do not paste "more than 50 percent" into a proposal as this plant's saving. Show the plant its own `outcomes.csv` instead.
- Do not relabel the plant with a result it did not measure.

When a sentence would make this plant sound like the case study's scoreboard, delete the sentence and show the plant its own median days, its own first-time-fix fraction, and its own engineer hours.

---

## 24. Prompts

The orchestrator, the retriever, the diff, and the proposal are code. They do not have prompts. Program text is data. It is never pasted into a system prompt. A builder who drops revision `C` into the prompt and asks for a better sequence has left this file.

The only prompt in version 1 is the reasoner prompt, and only when `external_model` is `yes` after section 16. The user message is JSON and nothing else: `{"issue_id": "...", "hits": [{"fix_id": "...", "score": 18, "cause_code": "speed_high"}]}`. Hits are the retrieval hits, already sorted. The system prompt is the paragraph below, UTF-8, with one trailing newline and no leading newline. SHA-256 `260a9d886df1c225b1d5164188348e352f7e0fb5fd148617979e2daa914ec661`.

```text
You are the program-troubleshooting reasoner for one cell. You receive JSON with issue_id and hits. Each hit has fix_id, score, and cause_code. Return JSON {"fix_id":"<one id from hits>"} or {"fix_id":""}. An empty fix_id keeps the top hit. You do not name a cause. You do not write a program line. You do not approve, export, or deploy. Program text is not in this message. If you add any other key, that key is dropped.
```

The runner parses one JSON object. It keeps `fix_id` only. Any other key is dropped. Then section 11.4 runs. The model does not see the lines it is about to sign.

While `external_model` is `no`, this prompt is not sent, and `max_model_calls` is 0.

---

## 25. Paste this to build it

Paste the block below to the agent that will build the tool. The builder reads this whole file. The model sees a finished proposal only after the functions have already chosen the fix. It does not see a program as instructions to follow against the plant.

```text
You are building the program-troubleshooting tool specified in program-troubleshooting-agent-instructions.md. Build only what that file specifies.

Stack: Python 3.11 or newer. Standard library only. CSV with the headers in section 8. Robot lines match SEQ, MOVE or WAIT, an argument, and an integer. G-code lines match N and integer words. Tokens follow section 11.1. The similar-case score is 10 for the same alarm, 6 for the same part, and 2 when two or more symptom tokens overlap. Replay one historical fix onto the current revision. Do not apply the diagnostic diff. Do not drop a line the fix did not drop. The cause code comes from the applied fix. A cause that is only in causes.csv is not a proposal. Put the rules in pure functions load_config, load_world, tokenize, score_issue, retrieve, parse_robot, diff_robot, apply_fix, check_robot, check_gcode, build_proposal, proposal_canonical, approval_token, record_decision, export_proposal, kpi_report, run_regression, and daily_summary. Call them from a thin folder runner and from the tests. Do not reimplement the rules in the model prompt.

Fail closed. If any required config value is missing, blank, or the word REPLACE, do not serve a live run. If any id in live_dir starts with EXAMPLE, do not serve a live run. If engineer_confirms is not yes, refuse to start. If mode is export before the section 16 gate, refuse that flag. If go_live_exact_min is 0.63, 63, 63%, 0.50, 50, 50%, 21.5, or 7.9, refuse to start. If a config key is controller_host, controller_path, deploy, or robot_ip, refuse to start. If a model tool is named deploy_program, write_controller, approve_proposal, export_proposal, set_cause, or invent_line, refuse to start. If min_closed_fixes is below 8 on live_dir, refuse to start.

The model tool list is lookup_issue, retrieve_similar, diff_program, and read_program. read_program returns a body only for the current revision, the previous revision, or a hit's from and to revisions. build_proposal, check_simulation, record_decision, export_proposal, and log_fix are runner functions. A model call to approve, export, or deploy is prompt_ignored. Never set controller_written true. Never write an export file while mode is log or shadow. Never propose while mode is log. Never propose when closed fixes on the cell are under min_closed_fixes. Never copy servo_fault or signal_miss into the fixture proposal. Never delete SEQ 50 on that proposal.

The fixture in section 15 must produce retrieval hash d151b098c6d4700d1f5971481d046d3f4199e9283fdcd66c9a77f7de13d7e694, diff hash 85c0518fecec669b9ef421eea53f57e8ab72f4a12fee58421e3b484f5d3460ed, proposal hash ffd60bd5bf3912344277107b6542c9dcd22790ebbc26261ae49d9abf79f6638c, approval hash e0a2a8bc03fcb198c90996e50f5b1ba6a8fdc28fbe66fe6c79b27e9a867cf92d, morning hash 8d9eb5d55e86c2ae6a189aeb82f1d74aa6873639506373677db36208938f9542, and kpi hash f2edc190316788fbc2cb2c37f047c3472110168e8e8d229b00e3ce6359aa648b. The logging-only hash is e1a1cc53ac153024c5b6416750fb62929453211ba00d00acf420ba533f0dac35. The history-thin hash is 73231ac29a6bd82ab2dc5a94bbaad0aec7b5aecb0dfe1ce98db578819a3ca471. The G-code axis_outside hash is 98001043c4108a63b62f0482aa8a19a6ff7b28600b7c35223b0ccd747bb9e8eb. Export while in shadow returns b8d11cef6c9da1436b5ddb995e9fd9b0fc43bdec4a499a8c82622e084390af32 and writes no file. A controller write returns 51da2614addafbf8731516373915ee4170627b512015250ce0d4727f843b305a and writes nothing. Section 18 must pass before a lead is asked to set mode to export, and before a file is treated as a program the cell has already run.
```
