Repository navigation
Conversation
…acement run
Move the request deps, timeout resolution, single-create failure
classification, and poll loop into core/write-run.ts, and the HTML file
reader and run-failure error builder into cli/. Inbox content sources become
{ kind, value } keyed by the API body field, with one command-side table
driving flag selection and dry-run labels.
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.
Stacked on #6. Removes the duplication #6 introduced between
preview runandinbox-placement run. Merge this intofeature/inbox-placement-runbefore #6 lands.Summary
src/lib/core/write-run.ts: shared request deps,resolveTimeoutSeconds,createOnce(single POST, never retried; definitive 4xx rethrows, 429/5xx/transport becomes the product's "uncertain" error), and a genericpollUntilloop. Both product modules keep only their paths, bodies, and settle rules.src/lib/cli/html-source.ts: onereadHtmlSourcefor both commands (limit wording kept per command).src/lib/cli/run-failure.ts: one CLI error builder driven by per-command wording; preview still appends itsreference_idnote.InboxContentSourceis now{ kind, value }withkindas the API body key; a singleCONTENT_OPTIONStable drives flag selection, error text, and dry-run labels. This also removes the internal-invariantUsageError(exit 2) from the dry-run path.Error messages, dry-run JSON, and human output are unchanged.
Behaviour differences
previewpolling now short-circuits explicitly on--timeout 0(it already did in practice).Test plan
npm test(163 pass: timeout test moved tocore/write-run.test.ts, newcreateOnce/pollUntiltests)tsc -p tsconfig.build.json --noEmit