Repository navigation
fix(automation): close the cross-review findings on the vocabulary - #79
Merged
Merged
Conversation
An audit record's ErrorCode is a short outcome code from the daemon's own closed vocabulary, and null whenever the record succeeded. The automation audit.record action had no field for the annotation it exists to leave, so it borrowed that one — unbounded operator prose in a code-shaped column, on a succeeded record where every other caller writes null. Detail is that field: caller-authored, never derived from a request payload, and populated only by audit.record. Everything else leaves it null, which is what the regenerated goldens, baseline, and schema record.
Seven defects a cross-review found in the merged automation vocabulary, each one a place where the code did something other than what its own comment or sibling already claimed: - The union converters read through a JsonDocument, which keeps every copy of a repeated property and hands back the last. A second instance_id of null widened a single-instance policy into a fleet-wide one; the unknown-property gate now refuses duplicates on the same walk, nested actions included. - 1e400 is a JSON number no double can hold. It read back as infinity, seated a threshold no reading can reach, and then threw on the way back out because infinity has no JSON form. Refused at the converter, and again in the validator for policies built in process. - The unresponsive trigger searched past a gap for the last real sample, answering a question about the present with evidence the sampler had already disowned. It now reads strictly the newest record and stays quiet on a gap, the discipline its sibling sustained-metric evaluation already keeps. - Suppressions were keyed by instance alone, so a one-minute restart hold silently ended an hour-long maintenance hold placed by an unrelated policy. The two scopes now hold a slot each and expire on their own clocks; a second hold in the same scope still replaces the first. - The delayed half of a two-phase restart started the instance without asking whether a hold had appeared since the stop. It rechecks now, audits the refusal, and drops the pending entry rather than re-queueing it. - The removed-instance sweep cleared statuses and holds but left crash times, pending restarts, and backoff behind — and a wildcard crash-loop trigger matches on the recorded id alone, so it kept firing actions at a ghost. - The dry run skipped null targets, so a daemon-wide trigger whose actions name their own instance reported a free hand where a tick would be refused.
…t detail The pre-merge gate found the confirmed-intent restart keeping the gap its deferred sibling had just closed. That path stops the instance, waits up to thirty seconds for the stop to land, and then started without asking again — so a hold placed inside that window was bypassed silently, with no audited refusal. It now rechecks on the far side of the wait and refuses like every other held restart. The restart is spent rather than retried, matching the drain. The drain itself judged holds against the instant the tick started. Its refusal is permanent, because the pending entry is consumed either way, so a hold that lapsed while the tick was running could take the restart with it. It reads the clock at the moment it judges. AuditRecord.Detail documented a 1024-character bound that nothing enforced: the validator bounds the authored message, and the severity prefix rides on top, so a message at the limit composed past it. The writer now truncates the composed string, and the contract says who bounds it. Adds direct coverage for the two removed-instance prunes that had none — the pending restart and the per-policy backoff — both written the way the crash-time prune already was, around an id a later instance takes over.
The cross-review fixes added a public contract member — `AuditRecord.Detail`, the annotation an automation audit.record action leaves — so the `preview.6` fingerprint for `MCServerLauncher.Common` stopped describing the tree. The baseline moves rather than being re-cut in place, which the NU1403 rule forbids. Exactly one of the eight packed entries differs from `.6`: `Common`, because its source changed. The other seven are byte-identical, `Daemon.API` included, which shows again that the version bump alone touches no payload. The SDK facade is the entry worth a note. Mid-branch an intermediate state of `Common` moved its hash with no SDK source edit, and the final state moved it back — the caveat `.6` left behind, behaving exactly as it said it would. Both documents now record that the hash is stable across versions but not across every intermediate state within one, so a reader packing some middle commit of this branch is not looking at a broken build. Every fingerprint was reproduced by packing into two different `MCSLPinBuildRoot` values. The spec version table retires `.6` and records `.7` with the same reasoning. No scope row moves: preview.7 carries correctness on already-delivered surface.
AresConnor
force-pushed
the
fix/automation-cross-review
branch
from
August 1, 2026 10:40
9e571dc to
aef1057
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the 8 actionable findings from the codex (gpt-5.6-sol, xhigh) cross-review of the merged automation vocabulary, each independently adversarially verified before fixing (the 9th, generated union schemas, is pre-existing and tracked as #78). Because
MCServerLauncher.Commonchanges, the internal baseline moves to2.0.0-preview.7.Fixes
JsonDocument.ParseValue(ref reader)has no options overload and tolerates duplicates last-wins, so"instance_id":"<guid>","instance_id":nulldeserialized to the fleet-wide wildcard (runtime-repro'd). The converters' property walk now throws on a repeated name, uniformly across every kind. (The event-rule converters share the door; that is event-rules: union converters silently drop unknown property names #74's widened scope, not this PR.)1e400no longer becomes infinity that later explodes inUtf8JsonWriter.WriteNumberat persistence time; refused at the converter and again by the validator.mcsl.automation.getlists both slots when both are active. No wire-shape change.automation.suppressed, and spends the pending entry rather than re-queueing it.Detailfield —audit.record's caller-authored text was living inErrorCode, the one field every other record treats as a closed error vocabulary (and always null on success).AuditRecord/AuditEventgain an optional, capped, documentedDetail;audit.recordwrites"<Severity>: <Message>"there andErrorCodereturns to its closed-vocabulary/null-on-success discipline. Onlyaudit.recordpopulates it.mcsl.automation.testnow resolves holds per action via the same predicate execution uses, so a daemon-wide trigger with an explicitly targeted action reports exactly what execution would refuse.Packaging
2.0.0-preview.6→2.0.0-preview.7per the established pin discipline (Common surface changed:Detail+ converter strictness). Fingerprints re-recorded after all source changes, machine-checked byPinnedPayloadHashesMatchTheAcceptanceRecord; spec §12.1 table advanced per its own amendment protocol. No release, no publication.Verification (independent supervisor battery on the final branch)
ProtocolTests 1402/1402 · ApiTests 116/116 (pin check at preview.7 included) · ProtocolDocs
--checkgreen · V1 gate green · WPF build 0 warnings ·git diff --checkclean. Negative controls: the drain-recheck and per-scope-hold regression tests were proven to fail against the pre-fix behavior.Pre-merge codex gate: this PR itself goes through the standing gpt-5.6-sol cross-review before merging, per the 2026-08-01 standing instruction.