Skip to content

feat(issues): clean a description once in the use-cases and store its text and policy - #305

Merged
aRustyDev merged 1 commit into
mainfrom
feat/48-description-stripped
Nov 18, 2026
Merged

aRustyDev merged 1 commit into
mainfrom
feat/48-description-stripped

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

Part 3 of 3 for #48, the work items' half. It follows #300 (the sanitiser moved into crates/core/html) and #302 (the hardened default), both merged. A work item now keeps one form of its description, and what is derived from it. #48 itself stays open: the pages half waits for M3, and no page exists in this repository yet.

What changes

  • thrust_html::describe is the one place a description is cleaned and its text taken, and the use-cases call it: create_issue, and update_issue before anything reads the asks, so the history compares and quotes the cleaned form. The compat plane and /api/v1 hand it the text as sent and keep only the size check, in the pin's words and with their other fields' problems. A new IssueError::InvalidDescription is the use-case's own answer to an oversize one that came anyway.
  • description_stripped (the text: Django's strip_tags of the cleaned HTML) and description_schema (the version of the policy it was cleaned under, thrust_html::SCHEMA_VERSION; ADR-0012's "record a schema version") are carried by WorkItemAttrs and WorkItemUpdate. An update that names no description leaves the row's own.
  • Migration 0019 adds the two columns, nullable, no default (an expand file; the lint accepts it). There is no description_json or description_binary column: a second stored form would be a second source of truth, one of them not cleaned (FR-14), and thrust-editor-doc derives them from the HTML at P1.
  • The Postgres and memory adapters read and write them.
  • The strip_tags port is tested for the first time. Mutation testing had found 77 of the crate's mutants surviving, all in it. It now has a parity_ test against 507 answers of Django's function, recorded by tools/strip-tags/record.py (the default sanitiser's output for the XSS corpus and the editor corpus, and 75 hand-written cases).
  • The ledger tests' made-up migration files were numbered 0019_…, "the next file"; they sort before the real 0019 now, so they are numbered 9000_… and up, after every real file however many there are.
  • D-020 and G-46 say what is stored and which tests pin it.

For you to decide or know

  1. Rows written before 0019 are left as they are, as you chose: NULL in both new columns, and HTML cleaned by Plane's plain allow-list. Nothing backfills or reads them, so nothing breaks, but a search over the text will need a pass over them first.
  2. An empty description's text is '', and NULL only ever means "written before 0019". That is my rule. The pin's own is not in this repository (its Issue.save is not here), so I did not copy it. No route serves the column, so nothing can tell today.
  3. The port of strip_tags differs from Python's parser on three hand-written inputs: an attribute quote never closed, the text of a <script>, and a malformed character reference followed by more text (Python then stops looking for tags). No sanitiser output can be any of the three (it removes a <script> with its text, quotes every attribute and escapes every stray &), so no description reaches strip_tags in those forms. The test names them and asserts that exactly those three differ, so a fix or a regression of any is seen. The oracle is the standard library's parser on Python 3.12.13, which Plane's image runs; its behaviour may change between patch releases, and I do not know which patch Plane runs.
  4. The fixture is 404 KB because it carries its inputs (the cleaned corpora), so the test reads no corpus. tools/strip-tags/record.py regenerates it; the steps are in its docstring.
  5. Left of feat(editor): work-item descriptions store sanitised HTML only; pages store the validated triple; hardened sanitiser #48: the pages half (a page's HTML sanitised, its binary checked with validate_binary_data and decoded with yrs, and a truncated or non-Yjs binary getting a 400). validate_binary_data is in thrust-html and tested to the byte; nothing calls it yet.

Checked

Check Result
thrust-core tests a creation stores the cleaned HTML, its text and the policy in six cases (none sent, empty, plain, an entity, a script and a handler, what Plane's list lets through), and refuses more than 10 MB and writes nothing, with exactly 10 MB accepted as the control; the update model now sends a description with a <script> in it and expects the text and the policy to follow a description a request names, and to stay as they were when it names none
Control: a creation that stores no text the six creation cases fail
Control: an update that drops the row's own text, and one that skips the cleaning the update model fails each
pg_adapter tests against a real Postgres (Docker) 83 of 83: a_work_item_has_the_one_stored_form_of_a_description_and_no_other (acceptance box 1), the columns, the model comparison with the reference model, the round trip of the text and the policy, and the tests that apply every migration file again over a schema that has them
Control: a description_json column added to the migration the acceptance-box test fails with "work_items has a description_json"; its own control table, which has both columns, is seen to have them
Contract suite, main pass, native-memory and native-pg 73 of 73 on each (the two description tests of #302 now go through the use-cases, and through Postgres on the second)
oracle-v1.sh native-memory controls VERDICT: PASS, gate, corpus, self-test and controls all 0
strip_tags against Django 507 cases, exactly the three known gaps differ; the controls: a recording that was changed, and three ports that are not strip_tags (nothing stripped, no ; on entities, a counter and no parser), each seen
Mutation testing, crates/core/html/src/lib.rs (cargo-mutants 27.1.0) 124 mutants: 112 caught, 11 timeouts (loops that never end, so detected), 1 unviable, 0 missed; the first run on the moved code was 127 mutants with 84 missed, before the boundary tests of #302 and the parity test. One equivalent mutant is excluded in .cargo/mutants.toml with the proof; one redundant n > 0 is removed instead of excluded
Mutation testing of the use-case lines (--in-diff) only 2 mutants, because the change is wiring with few operators, so it proves little; the three controls above, which break the wiring by hand, are the evidence
cargo nextest run --workspace, on the tree rebased onto main 4694 passed, 10 skipped (the oracle_ tests that the profile excludes)
cargo clippy -D warnings --locked: workspace, thrust-worker and thrust-edge on wasm32, thrust-api-v1 with openapi; cargo fmt --check; cargo deny; doctests all exit 0
check-deps, check-layout (+ self-test), check-cargo-lock (+ self-test), check-release-plz --first-release required, check-plane-500, check-contract-counts (+ self-test), check-migration-lint, check-openapi all exit 0, run on the tree rebased onto main (#303)

Not shown

  • The worker-cf cells of the contract suite and the browser journeys are CI's. The book check was not run here (mdbook-mermaid is not installed); the docs change is table text, no page and no link.
  • oracle_v1_write_with_sanitiser_matches_python_plus_js (pinned to plane_builder(), because nh3 is its oracle) was not re-run: it needs the generated spike-0006 output.
  • Nothing reads description_stripped yet: no search, no preview, and no body that is served carries it. So no behaviour a user can see depends on it today.
  • A backfill of the older rows, and a search over the text, are not here.

Refs #48

🤖 Generated with Claude Code

… text and policy

A work item keeps ONE form of its description, the cleaned HTML, and what is derived from it (issue #48, D-020; the
work items' half): `description_stripped`, the text, which is Django's `strip_tags` of the HTML, and
`description_schema`, the version of the policy the HTML was cleaned under (ADR-0012's "record a schema version").
There is no `description_json` or `description_binary` column at P0; a second stored form would be a second source of
truth, one of them not cleaned.

- thrust_html::describe is the one place a description is cleaned and its text taken, and the use-cases call it
  (create_issue, and update_issue before anything reads the asks, so the history compares and quotes the cleaned form).
  The compat plane and /api/v1 hand it the text as sent and keep only the size check, in the pin's words, with their other
  fields' problems; a new IssueError::InvalidDescription is the use-case's own answer to an oversize one that came anyway.
- WorkItemAttrs and WorkItemUpdate carry the two fields; an update that names no description leaves the row's own.
- Migration 0019 adds the two columns, nullable, no default (an expand file). A row written before it has NULL in both
  and HTML cleaned by Plane's plain allow-list; nothing backfills or reads them yet.
- Postgres and memory adapters read and write them. The ledger tests' made-up files were numbered 0019 and sort before the
  real 0019 now, so they are numbered 9000 and up, after every real file.

strip_tags had no test: 77 of the sanitiser crate's mutants survived, all of them in it. It now has a `parity_` test
against 507 answers of Django's function recorded by tools/strip-tags/record.py (Python 3.12.13; the default sanitiser's
output for the XSS and editor corpora, and 75 hand-written cases). The port matches on all but three hand-written inputs
that no sanitiser output can be (an attribute quote never closed, the text of a <script>, a malformed character
reference with text after it); the test names them and asserts that exactly those differ. Mutation testing of the crate
is now 124 mutants, 112 caught, 11 timeouts, 1 unviable, 0 missed; one equivalent mutant is excluded, with the proof.

Shown failing: a creation that stores no text (the six creation cases), an update that drops the row's own text or skips
the cleaning (the update model), and a description_json column in the migration (the Postgres test). Postgres adapter
tests 83 of 83 against a real Postgres, the contract suite's main pass 73 of 73 on native-memory and native-pg, oracle-v1
PASS.

Refs: #48
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aRustyDev
aRustyDev temporarily deployed to preview-control-plane November 18, 2026 06:26 — with GitHub Actions Inactive
@aRustyDev
aRustyDev merged commit 474e6fa into main Nov 18, 2026
45 checks passed
@aRustyDev
aRustyDev deleted the feat/48-description-stripped branch November 18, 2026 06:59
aRustyDev added a commit that referenced this pull request Nov 18, 2026
…309)

A `style` value was judged after its comments were cut out and its backslashes
dropped, so a CSS hex escape was never read: `j\61vascript:`, `\6a avascript:`
and `\65xpression(` passed the value filter. PR #305's report named the first.
The comment cut came before any escape was read as well, so `\/* javascript: */`
lost its tail to a "comment" that a stylesheet never opens.

`css_text` reads both in one pass, in the order a stylesheet does (CSS Syntax 3,
4.3.2 and 4.3.7): a comment runs to the first `*/` or the end of the value
(`/*/` does not close itself), a backslash and one to six hex digits is the code
point they name, taken greedily, and a backslash and any other character is that
character and never an opener. A code point that is no `char` is dropped and a
control character is removed, as `url_ok` already does: both can only make a
token easier to see. A left-over backslash is still dropped.

SCHEMA_VERSION goes from 1 to 2, because the policy changed (ADR-0012): a
description cleaned under 1 may hold a `style` that 2 drops. Nothing re-cleans
those rows, as with the rows from before migration 0019. The update model of
thrust-core now starts its rows at policy 1 and expects 2 after a description is
named, which it could not tell apart from "kept" while both were 1.

Tests, in thrust-html/tests/policy.rs: a generated test that writes each
character of a dangerous token plain, with a backslash, as a short hex escape
closed by any whitespace or by nothing, or as six digits, in either case (the
encoder is written from the spec, apart from the decoder); the pinned family of
the gap; what the greedy reading makes something else, kept; a token inside a
comment, kept; an escaped slash that opens no comment; and escaped harmless
values, kept, as the control. Before the change the three tests that cover the
gap failed and the controls passed.

Refs: #48

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
aRustyDev added a commit that referenced this pull request Nov 18, 2026
…etters table on every target (#310)

* feat(ports): tell a permanent consumer error from a transient one, and say what each means for the message

`EventConsumer::handle` returned `Result<(), String>`, so every failure looked alike: a queue adapter could not know that an event
with no `project_id` can never succeed (Stage 2 delivered one four times before the queue gave up) while a database that was down
might. It now returns `ConsumerError`, `Permanent` or `Transient`.

The policy that follows from the kind is one pair of functions in `thrust-ports`, for every queue adapter to call: `disposition`
(ack, deliver again after a delay, or dead-letter) and `retry_delay` (5 s doubled for every delivery, never more than 60 s).
`MAX_DELIVERIES` is 4, the first delivery and the three retries the Worker's `max_retries = 3` allows.

Core classifies in `consumer_error`: an error about the message (`Invalid`, `NotFound`, the authorization ones, `TooLarge`) is
permanent, one about something the consumer needed (`Internal`, which every port error arrives as, `Upstream`, `RateLimited`,
`Conflict`) is transient. Its `match` names every variant with no wildcard arm. One known misclassification is documented on it: a
history row for a work item the adapter does not have comes back as a backend error, so it is retried and then dead-lettered.

`DeadLetter` joins `Envelope` in `thrust-contracts`; nothing writes or reads one yet. Nothing yet acts on the kinds either: the
queue adapters still ignore or retry as before, which the commits after this one change.

Tested: the disposition of every answer on every delivery count 1..=6 against a table the test owns, and properties over the whole
range of `u32` for the delay and the limit; every `CoreError` variant against its kind, a property that the kind never depends on the
error's text, and the two events the issue names (no `project_id`; a backend error of the memory adapter) through the real consumer.
Controls, each killed (exit 100): a permanent answer retried, an off-by-one at the limit, the limit raised to five, no cap on the
delay, a finished message dead-lettered; permanent and transient swapped in either direction, the reason dropped, `Invalid`
transient.

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* feat(queue): a dead_letters table, written through the consumer and read on `GET /internal/dead-letters`

A message the consumer sets aside now has somewhere to go. `dead_letters` (migration 0020) holds one row per message: the queue's own
id when it has one (so a message delivered again lands on the row it made), when it was set aside, the topic, the event's id when the
body decoded, the body as it arrived, why, and how many times it was delivered (NULL for a message Cloudflare's own dead-letter queue
moved, because that queue starts the count again). It has no tenant: a body that does not decode names none.

Ports: `Database::insert_dead_letter` (idempotent on `id`, the first write stands) and `dead_letters` (newest first, ties broken by
`id` in byte order, which Postgres is asked for with `COLLATE "C"`), both untenanted like the outbox's. `EventConsumer::dead_letter`
is the one way a queue adapter writes one, because an adapter holds no `SystemScope` and `scripts/check-deps.sh` keeps it that way.

Core: `record_dead_letter` stamps the time and, when the queue has no id, mints one. It also replaces a NUL in any text with U+FFFD:
Postgres cannot store a NUL in `text`, a body is whatever a producer sent, and a message whose dead-letter write fails is delivered
again, fails again and is lost, which is what a dead letter exists to prevent. The change is made there, once, so both adapters
answer alike.

`GET /internal/dead-letters` (the admin token, test routes on) lists them, so one contract test can read every target.

The number is 0020 because 0019 is `0019_description_stripped.sql` (issue #48, #305), which landed on main while this was being
built; the issue's own 0002 was taken long before. The Postgres ledger test plants made-up migrations, and since #305 it numbers them
from 9000, so a real 0020 does not collide with them and that test needs no change here (an earlier version of this work moved its
numbers up by one, as was done when 0018 was added; that is no longer needed and was dropped in the rebase).

Nothing sets a message aside yet: the queue adapters still ignore or retry as before, which the next commits change.

Tested: the memory adapter against a reference model over sequences (ties in time, ids that differ in case, a limit, a reset); the
generated parity model of the Postgres adapter gets the same two operations and five new step classes, and its hermetic check that the
generator reaches every class fails when it cannot make a tie, a redelivery or a listing; a round trip of arbitrary text through the
core write, NULs included. Controls, each killed: a second write that replaces the first, a repeated id answering true, oldest first,
ties in ascending id order, no limit, one row too many; a NUL kept in the body, the error or the topic, the queue's id ignored, the
time or the attempts or the event id dropped. These were run before the rebase onto #305; the same tests are re-run on the rebased
tree before the pull request is opened (see its body).

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* feat(queue): the in-process queue retries a transient error with backoff and sets the rest aside

`MemoryQueue` ran the consumer and threw its answer away (`let _ = c.handle(&env).await`), so on native-memory, native-pg and
worker-memory a message that failed was neither retried nor recorded. It now follows the policy of `thrust_ports::disposition` after
every answer: a done message is finished; a transient error is delivered again after `retry_delay` (5, 10, 20 s), up to four deliveries;
a permanent error, or the fourth transient one, is set aside through `EventConsumer::dead_letter` with the message's envelope as its
body, the topic it was sent to, the event's id, why, and how many times it was delivered.

The write of a dead letter gets the same policy: a transient failure is tried again after the same waits, and a write that fails four
times is given up on and counted (`MemoryQueue::lost_count`), because an in-process queue has nowhere else to put the message.

The adapter has no timer, so the wait is brought by the composition root: `MemoryQueue::with_sleep`. The native server passes
`tokio::time::sleep`. Without one a retry follows at once, which is what the hermetic tests and the Worker's in-memory target need (a
task that waits seconds does not outlive the request there), so no existing caller changes.

Tested by a model of the queue against a reference written out in the test (four deliveries, waits of 5, 10 and 20 s, the same for the
write of the letter) over generated answers, with failing writes and with and without a sleep. Controls, each killed: every answer taken
as done, the delivery count skipping one, no wait, a dead letter with an id of its own, without its topic, its event id or its reason,
holding the payload only, with one delivery too many, a lost message not counted, a failed write not tried again, a write that gives
up taken as done.

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* feat(worker): the queue consumer sets a message aside through the dead-letter queue instead of dropping or retrying it blind

The Worker retried every failure after a flat 5 s, whatever it was, and acknowledged and dropped a body that was not an event, so a
message that could never succeed was delivered four times before Cloudflare's own limit moved it, and one that was not an event was
lost with a log line. It now follows the same policy as the in-process queue, and the Worker is a thin shell around the decisions.

Decisions, in `thrust-ports` and tested natively: `settle` decodes the body, asks the consumer, and applies `disposition`: a body that
is not an event is set aside at once, exactly as it came, with no event id, and the consumer is never asked about it; an event the
consumer accepts is done; a permanent error is set aside; a transient one is delivered again after 5, 10 and 20 s and set aside on the
fourth delivery. `settle_dead_letter` is the other queue's side: a message the Worker set aside becomes the row it describes, and a
message Cloudflare moved there itself becomes a row under its own id with no count of deliveries (that queue starts the count again).

The Worker consumes both queues, told apart by `THRUST_EVENTS_DLQ`. It reads each message on its own (`raw_iter`, so one body that is
not a string no longer fails the batch), counts deliveries with `MessageExt::attempts()` (workers-rs 0.9), and acts on the answer:
acknowledge, deliver again after the delay, or send a `DeadLetterMessage` to the dead-letter queue and acknowledge. If that send fails
the message is not acknowledged, so it is delivered again, and the queue's own `max_retries` moves the original there if that keeps
failing, which the consumer of that queue turns into a row all the same. A Worker that does not know the dead-letter queue's name sets
nothing aside, so a misconfiguration cannot make a message go round.

`DeadLetterMessage` is the wire type on that queue, in `thrust-contracts`. It parses text that any producer's message can be, so it has
a fuzz harness, committed seeds and `fuzz_replay_` tests with their must-fail controls (rust-test-fuzz), and properties that run on every
`cargo nextest run`. A cargo-fuzz campaign has not been run: it needs nightly and cargo-fuzz.

Configuration: all four Worker configs get the `EVENTS_DLQ` producer, a consumer on the dead-letter queue (`max_retries = 10`, and no
dead-letter queue of its own, which miniflare refuses), and `THRUST_EVENTS_DLQ`; the local config also gets the `dead_letter_queue` on
the events consumer that only the deploy template had. The deploy parity test now checks the topology in both files (the dead-letter
queue is produced to and consumed, its consumer has none, the var names it) and that the events consumer's `max_retries` allows
`MAX_DELIVERIES`, read from the ports source; 8 new controls, all run under GNU sed as well as BSD sed.

The `queue-raw` probe puts raw text on the events queue binding: `/internal/inject-event` takes only a valid envelope, so it is the one
way to reach the branch for a body that does not decode.

Not run here: the Worker against a real queue (the contract tests of the next commit do that), and
`.github/scripts/tests/test-deploy-target.sh`, which fails on this machine on a clean `main` too.

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* test(queue): the contract suite shows a permanent error set aside at once on every target, and an undecodable message set aside on the Worker

Two tests, one for each way a message used to be lost or retried blind.

- permanent_consumer_error_is_dead_lettered_without_retry (all four targets): an event with no `project_id`, which FR-21 and S2-9 name
  as the example, is set aside after ONE delivery with its error naming the field, and the body in the row decodes to the envelope.
  A second poison event is injected after it and the first still appears once, so a redelivered message cannot make a second row.
  `/internal/dead-letters` is added to the admin gate test (no token, wrong token: 401), because a dead letter carries an event body.
- worker_bindings_undecodable_message_is_dead_lettered (worker-cf `bindings` pass): the `queue-raw` probe sends text that is not an
  envelope straight to the events queue, and the row for it must appear with a null `event_id` and `attempts == 1`. Named
  `worker_bindings_*` because that prefix is what the `bindings` pass selects; the issue's `worker_undecodable_*` would run in no pass.

Counts move by one test each: contract.sh EXPECT_MAIN 73 -> 74 and EXPECT_BINDINGS 5 -> 6 (the admin-gate lines go into an existing
test, so they add none); stage2-contract.sh main 67 -> 68 and bindings 3 -> 4, and its header says why the bindings pass now needs the
dead-letter queue that wrangler.stage2.toml got in the previous commit. scripts/check-contract-counts.sh reads the numbers back.

The planted defect is `mutant_invalid_is_transient` (an invalid message is treated as transient), forwarded by thrust-server and
listed in scripts/mutants.sh. Under it the message is delivered again after 5 s, 10 s and 20 s and set aside at its fourth delivery,
so the 15 s wait in the new test fails: the row is killed.

Verified on this Mac (wrangler 4.151.2, worker-build 0.9.0):
- native-memory, native-pg, worker-memory and worker-cf `main`: 74 of 74. worker-cf `bindings`: 6 of 6.
- the mutant, native-memory and worker-cf: each fails exactly the one test meant for it.
- ack-and-drop put back in the Worker handler, by hand: it fails exactly the tests meant for it. The Worker is not in mutants.sh,
  which builds native-memory only, so both Worker controls were run by hand (the same precedent as G-39).

Not run: stage 2 against a deployed Worker (it needs the staging account).

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* docs(queue): record the consumer failure policy, the dead_letters table and what was not shown

The policy is now one thing on every target, so the pages that described the old behaviour (a flat 5 s retry, an undecodable body
acknowledged and dropped, a dead-letter queue nothing read) say what it is now.

- ADR-0070: an FR-21 paragraph in the round-29 section, and an "Update - issue #53" with the policy table and what it settled: the
  kind is chosen in core by an exhaustive match on CoreError, with one known misclassification (a history row for a work item the
  adapter does not have is a foreign-key error, so it is transient: delivered four times and set aside with its reason, not lost);
  MAX_DELIVERIES is 4 and the deploy parity test holds both wrangler configs to it; the policy lives in thrust-ports; a dead letter
  is a row whose id is the queue's own id, with `attempts` nullable because Cloudflare's DLQ restarts the count; the Worker sends a
  DeadLetterMessage and consumes the dead-letter queue itself so one writer makes every row; a dead letter whose own write fails four
  times is lost; a queue has one active consumer.
- QUESTIONS.md Q-0006.5 was already answered, so it gets "Implemented (issue #53)" and not a second answer; PLAN.md marks the row.
- architecture/infra.md (the queue-consumer paragraph is rewritten), architecture/app.md (the ports table), flows/app.md (the
  `/internal/dead-letters` route and the Failures paragraph) and architecture/deploy.md (the Worker now consumes the dead-letter
  queue, so check that nothing else is attached before the first deploy). patterns.md says an adapter writes a dead letter through
  `EventConsumer::dead_letter` because it holds no SystemScope.
- features.md, evidence-and-controls.md, techniques/mutation.md and defect-matrix.md (X5) list `mutant_invalid_is_transient` and
  the two new contract tests.
- testing/status.md G-47 records what is covered and six things NOT shown: no cargo-fuzz campaign on DeadLetterMessage::parse (needs
  nightly and cargo-fuzz, the owner's to install; the committed seeds are replayed by `fuzz_replay_` on every run); the Worker's
  path ran on local workerd, not on Cloudflare, and stage 2 has not been run against it; a message near Cloudflare's 128 KB limit
  cannot be wrapped and reaches the table by the queue's own backstop with no count and no reason; the transient path is not
  tested over HTTP (its 5, 10 and 20 s are held by the in-process queue's model with a recording sleep, and by `settle`'s table); a
  dead letter whose own write fails four times is lost and nothing reads the count; and test-deploy-target.sh fails on the
  development Mac on an untouched main, so CI is its first verdict.

Verified: the book builds (mdbook with mdbook-mermaid) and its own check scripts, self-test included, pass.

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* fix(ci): the isolated Preview profile knows the dead-letter producer and variable, and still gives a Preview the events producer alone

#304 added the `isolated` profile of scripts/preview-config.py, which accepts production's queue shape only as written: exactly one
producer, EVENTS, and exactly four variables. This branch adds a second producer (EVENTS_DLQ) and a variable (THRUST_EVENTS_DLQ) to the
production template, so on the rebased tree `test_preview_config.py` failed 40 of its isolated runs ("isolated N: succeeds: got 1,
wanted 0"): every isolated Preview would have been refused.

The decision, which the profile exists to force: a Preview consumes nothing (production consumes), so it sets nothing aside, so it has
no use for the dead-letter producer or the variable that names the dead-letter queue. The profile now requires the template to have
exactly the EVENTS and EVENTS_DLQ producers and the five variables, and still writes the events producer alone, under the PR's own queue
name, with the variables it already wrote. A third producer, a missing dead-letter producer and a missing THRUST_EVENTS_DLQ are refused
and named, as an unknown binding always was. The check that a Preview's queue is not production's now covers every production queue.

Tests (test_preview_config.py, 1483 passed, 0 failed; was 40 failed before the change to the script): each of the 40 generated isolated
runs now also holds the producer list to the events producer alone; three refusals are new. Control: the same test run against a copy of
the script with the producer-shape check removed fails exactly the two producer refusals (the variable refusal still passes, as it
should), so those checks can fail.

Not run: a real Preview deploy of an isolated target (it needs the PR's provisioned resources and the account).

Refs: #53
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
preview-control-plane — c88b0921 Deployed Nov 18, 2026 by aRustyDev via reconcile #92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant