plc_program_drift
Compare an exported PLC program against its approved snapshot to report whether bytes or extracted logic blocks changed, naming moved variables, calls, branches, and timers.
Instructions
[READ][risk=low] Has this program changed since its approved snapshot, and what moved?
Three verdicts, and the wording of each is load-bearing. **identical** means
the same SHA-256 and nothing else earns the word. **logic_changed** means the
extracted structure differs — reported per block, naming which categories
(variables / calls / branches / timers_counters) moved. **changed_outside_
extracted_structure** means the bytes differ while every block fingerprint
matched: usually comments or formatting, but these parsers extract structure
rather than parse a grammar, so a real change inside a construct they do not
model looks identical from here. Calling that "documentation only" would be
the comfortable reading of evidence that does not support it, so it is not
called that, and it is not a clearance — line and comment counts are reported
beside it so a reviewer can see which way it leans.
Nothing here decides whether a change was authorised; that is change control's
job. No device is touched — this reads a file a person exported.
Args:
path: The current exported program file to check (same roots as above).
name: Tracked program name (defaults to the file's stem).
against: Snapshot id to compare with; default is the latest.
Returns dict: {program, name_source, baseline:{snapshot_id, taken_at, label,
source_file}, current:{source_file}, verdict, content_changed,
structure_changed, content_sha256:{before, after}, blocks:{added[],
removed[], changed:[{block, kind, line, previous_line, changed[]}],
unchanged}, totals:{block_count, line_count, comment_count}, parse_errors,
note, advisory}.
Example: plc_program_drift(path="~/.iaiops/plc/Line3_today.scl", name="Line3").
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "plc_program_drift"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| path | Yes | ||
| against | No |