Repository navigation
[sentry:7871817832] Fixed: user-input validation in the TUI operation editor now throws AtcError('ATC_USAGE', ...) instead of plain Error. In `src/tui/workspace/operations/operation-mode - #116
Open
Ooooze wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Fixed: user-input validation in the TUI operation editor now throws
AtcError('ATC_USAGE', ...)instead of plainError. Insrc/tui/workspace/operations/operation-model.ts,inputObjectandparseField(minimum, maximum, number/integer, object/array shape and malformed-JSON paths, routed through a smallparseJsonhelper) keep their original message texts for the schema guards.expectedFailureinsrc/telemetry/failures.tsalready treats any non-operationalAtcErroras expected, sofailureReportreturns null and theworkspace.actionboundary no longer emitstui workspace.action: unknown. The throw still escapesactivate, so the existingWorkspaceAppcatch still shows the message viaoneLineand the editor overlay is not closed - refusal behavior is unchanged. The carried regression test, extended to cover minimum, maximum, integer, array-shape, non-object body and malformed JSON, fails on the base atexpect(thrown).toBeInstanceOf(AtcError)and passes with the fix. Existingoperation-model.test.tsassertions only match message fragments ('Minimum', 'Maximum', 'integer', 'array', 'object'), all preserved.Evidence:
Event b09cf3310e5342fb8f6a22baebca546a release atc@0.2.21 dist 55067cf equals base 55067cf; release_diffs empty.
Stack line operation-model.ts:62 was
if (field.minimum != null && value < field.minimum) throw new Error(Minimum: ${field.minimum}), column 67 is thenew Error(start.src/telemetry/failures.ts expectedFailure returns true for
error instanceof AtcError && !OPERATIONAL.has(error.code); ATC_USAGE is not in OPERATIONAL, so failureReport returns null.FailureReport on the base returned a report with error_code from reportCodeOf (undefined for plain Error), matching the event's
failure_reason: unknown.src/tui/workspace/WorkspaceApp.tsx:202 catch still runs
captureFailure(...)thenpatch({ message: oneLine(e), busy: false, ... }); captureFailure returns early on an excluded refusal, so only the message changes.operation-actions.ts save-edit branch: on a throw, the following
patch({ overlay: null, edit: '', focus: 'operation-run' })is skipped, so the editor stays open on refusal as before.Check of src/tui/workspace/operations/operation-input-refusal.test.ts passed: 1 test, 0 failures, fullName 'operation form input refusals minimum field value is a usage refusal'.
Existing operation-model.test.ts toThrow assertions use only fragments 'integer', 'Minimum', 'Maximum', 'array', 'object'; the fix preserves each of those substrings in the AtcError messages.
docs/decisions ADR for this refusal was not added because the saved plan permits only the two source/test paths and the controller rejects docs paths; this is recorded for the human reviewer.
Regression tests: src/tui/workspace/operations/operation-input-refusal.test.ts
Full CI and human review are required.
Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/83fa79e8-0e25-4055-9ccd-65fb11f7617c
Sentry: https://atomic-chat.sentry.io/issues/7871817832/