Skip to content

Batch 622 wave: IDE Steps, config editors, alerts, promote, paths; tee relay bounds; harness; results_relay; adt_a03 scrub (BACKLOG #5825, #5826, #5829-#5844, #5846-#5849; #5845 not built) - #3147

Merged
wshallwshall merged 76 commits into
mainfrom
batch/b622-wave
Nov 22, 2026

Conversation

@wshallwshall

Copy link
Copy Markdown
Collaborator

Batch 622 wave: 22 rows across 10 Builder branches (g01, g02, g04 to g11). Group g03 (#5827, #5828) changes a security control and is its own PR, 3146.

Row outcomes:

  • BUILT: #5825, #5826, #5829, #5830, #5831, #5832, #5834, #5835, #5836, #5838, #5839, #5840, #5841, #5842, #5843, #5844, #5846, #5847, #5848, #5849
  • ALREADY FIXED, nothing built: #5833 (engine PR 2966, BACKLOG #5565)
  • NOT A BUG, nothing built: #5837
  • CONFIRMED, NOT BUILT: #5845. A first fix was reverted for a regression (g10 below). A safe fix needs a soft re-projection channel to the Steps page (g11 below). Under ledger ruling R6, batch 622 is not BUILT while #5845 is open.

Merge danger

Reversible: yes. Main squashes, so reverting one item is a hand revert from its source branch head below.

Blast radius: at least these:

  • the IDE extension (ide/src, ide/media/stepsWebview.js): the Steps view, the config editors, Alert Rules, promote, live debug, Test Bench and validate;
  • the tee relay (tee/);
  • the harness detail panel and the acceptance A5 probe;
  • the results_relay porting sample, plus one new optional engine API argument, Message.delete_segments(occurrence=). Without the argument, existing calls behave as before;
  • the de-identified HAPI sample adt_a03.txt.

No security control is weakened. No PHI: every fixture is synthetic or de-identified.

Evidence (combined tree)

Run on the batch tree before g11, at 14c27029:

  • ruff check and ruff format --check: clean.
  • mypy: linux, win32 and tests legs clean.
  • ledger_check --ci: exit 0.
  • pytest on every tests/test_b622_* file plus the touched suites (anon HAPI samples, message, tee relay and CLI, A5 harness, detail body fetch, changelog fragments, checks): 454 passed, 6 skipped.
  • ide: typecheck clean, test:unit 1868 passing.

g11 adds only the IDE Steps follow-up. The batch tip 75c074a2 has exactly g11's tree c88a7ac2, on which g11 ran typecheck clean and test:unit 1874 passing.

Not run: the full Python suite (CI runs it), and the scripts/asvs mypy leg (nothing under it changed).

Each item's Before is a test that fails at origin/main; its After is the same test passing on the branch.


g01: BACKLOG #5825, de-identify the vendored HAPI sample adt_a03.txt

Source b622/g01-adt-a03-scrub @ c67d69b816d82cd14a7b2e4e3a409c4cca5ca850

Merge danger: reversible; touches one sample file, its README section, a new anon overlay and the HAPI sample test.
Evidence:

  • Before: with the upstream bytes, test_every_scrubbed_field_holds_a_surrogate[adt_a03.txt] and test_no_upstream_identifier_is_left_in_adt_a03 fail.
  • After: both pass on the scrubbed file.

What changed:

  • The file is scrubbed with anonymize_checked(require_full_coverage=True), using DEFAULT_RULES plus tests/fixtures/anon/adt_a03.anon.toml.
  • MSH-4, MSH-6 and MSH-7 are also scrubbed, because MSH-7 gave the event time back.
  • PR1-3 and PR1-4 are kept as coded clinical content under ADR 0030, and the README says so.

Banner: BUILT in batch 622: adt_a03.txt scrubbed by DEFAULT_RULES plus a committed overlay (MSH time and facility included), README source notice, held by tests/test_anon_hapi_samples.py.

g02: BACKLOG #5826, results_relay edits OBX through the parsed model

Source b622/g02-results-relay-obx @ ff2471866e13cc9c2a389c682fb9d71069fbb8a7

Merge danger: reversible. Touches the porting sample and adds the optional occurrence= keyword to Message.delete_segments; calls without it behave as before.
Evidence:

  • Before: test_two_orders_keep_every_obx_field_escape_and_order showed every OBX regrouped under the first OBR.
  • After: 13+ tests in tests/test_b622_5826_results_relay_obx.py pass. A second Builder (g02b) fixed an over-delete the first repair introduced, which would have removed the next patient's PID and PV1. Its 8 tests failed at 03c92260 and pass now.

Banner: BUILT in batch 622: results_relay edits each OBX through the parsed Message (per-occurrence delete_segments), drops only a cancelled OBX's NTE/PRT/Z rows, and keeps every other field, escape and OBR grouping.

g04: BACKLOG #5829, tee relay refuses non-positive attempts and queue size

Source b622/g04-tee-relay-bounds @ b1eb73723e7988df98c5431a3b4fd98a100eed46

Merge danger: reversible; tee/relay.py, tee/__main__.py, docs/TEE-RELAY.md.
Evidence:

  • Before: 14 of 16 tests in tests/test_b622_5829_tee_relay_bounds.py fail at origin/main.
  • After: all pass.

Banner: BUILT in batch 622: RelayConfig post_init and positive-int CLI types refuse corepoint_attempts / mefor_queue_max < 1 before any listener starts; assert replaced by an explicit raise.

g05: BACKLOG #5848 and #5849, harness detail panel and A5 TCP port

Source b622/g05-harness-detail-port-probe @ bcaaabb3786bb0eda216bf494e2773facaab8b62

Merge danger: reversible; harness only.
Evidence:

  • #5848 before: test_replay_is_not_offered_while_a_newer_open_is_loading and test_a_non_api_error_fetch_clears_the_previous_message_and_reports fail.
  • #5849 before: test_every_listener_row_a5_names_is_in_the_probe_port_map fails. Its SO_REUSEADDR half was already fixed under BACKLOG #5389.
  • After: all pass.

Banners:

  • #5848: BUILT in batch 622: Replay is withdrawn and the panel blanked while an open loads, a non-ApiError open reports and resets, and a selection made during Replay is kept.
  • #5849: BUILT in batch 622: A5 reports the raw-TCP listener port (2580, IB_Harness_TCP's default). The SO_REUSEADDR half was already fixed under BACKLOG #5389.

g06: BACKLOG #5832, #5833 and #5834, IDE config editors

Source b622/g06-ide-config-editors @ 65e6a2c6a80d09b15bc4d6022e59d01ae314fba2

Merge danger: reversible; ide/src/configEditorModel.ts, configEditors.ts.
Evidence:

  • #5832 before: 4 of 8 tests in b622-5832-config-dir-containment.test.ts fail.
  • #5834 before: reproduced against the real CLI, where a save without --name failed with a create collision.
  • After: both pass.

Banners:

  • #5832: BUILT in batch 622: the custom-editor guard resolves the config dir, folds case only on win32 and darwin, and opens only the CLI's exact file.
  • #5833: ALREADY FIXED: engine PR 2966 (BACKLOG #5565) added the fields branch; nothing built in batch 622.
  • #5834: BUILT in batch 622: the code-set custom editor saves with --name and refuses read-only, unloaded, renamed or wrong-directory saves.

g07: BACKLOG #5831, #5836 and #5837, Alert Rules bounds, degraded promote, status-bar trust

Source b622/g07-ide-alerts-promote-trust @ adc6810ce0d414a29ad10f3867acaaa690b4a022

Merge danger: reversible; ide/src/alertEditorWebview.ts, alertEditor.ts, promoteOutcome.ts.
Evidence:

  • #5831 before: 7 of 9 tests fail.
  • #5836 before: 8 of 9 tests fail.
  • After: both pass.
  • #5837: the existing engine-trust-shell.test.ts cases pass at HEAD, so nothing was built.

Banners:

  • #5831: BUILT in batch 622: Alert Rules Add refuses values outside AlertRule's bounds and unparseable number-box text.
  • #5836: BUILT in batch 622: promote reports a degraded reload and its failed steps as a warning, never a clean promote.
  • #5837: NOT A BUG: engineTrust followCertificateChange already refreshes the trust anchor on a post-start verification failure; pinned by engine-trust-shell.test.ts.

g08: BACKLOG #5835, #5846 and #5847, IDE paths, Test Bench names, validate locations

Source b622/g08-ide-paths-testbench @ be659632676ef2970148b4269b96a1fb6a76b5ff

Merge danger: reversible. New ide/src/pathIdentity.ts and validateDiagnostics.ts; liveDebug.ts, collectionStore.ts, validate.ts.
Evidence:

  • #5846 before: 3 tests fail (__proto__ lost, toString hit).
  • #5847: new location tests.
  • #5835: no failing-before test. The defect sits in the vscode-bound module, so a key test was added instead.

Banners:

  • #5835: BUILT in batch 622: invocationsForFile resolves trace paths against the workspace and compares case-insensitively on Windows.
  • #5846: BUILT in batch 622: the collection store hands back a null-prototype map, so proto and toString are ordinary names.
  • #5847: BUILT in batch 622: validate diagnostics resolve against the workspace, an absolute configDir is kept, and the engine's own "at line N" sets the line.

g09: BACKLOG #5830, #5838, #5839 (part), #5840, #5841 and #5842, IDE Steps model

Source b622/g09-ide-steps-model @ d1cf27b8aee1485ea44dcd8a1b82225d1a813b85

Merge danger: reversible; ide/src/stepsModel.ts, ide/media/stepsWebview.js and the steps-mirror test.
Evidence: each row has a b622-58xx-*.test.ts that failed before; all pass.

Banners:

  • #5830 and #5840: BUILT in batch 622: buildDropSlots enumerates every root suite, and walkMove walks only the moving row's handler.
  • #5838: BUILT in batch 622: isReturnRow counts a Router route row.
  • #5841: BUILT in batch 622: Comment text field; Pragma and multi-line notes shown read-only.
  • #5842: BUILT in batch 622: menu items reset on every open, and the Insert submenus stay visible.

g10: BACKLOG #5843 and #5844, IDE Steps view (#5845 reverted)

Source b622/g10-ide-steps-view @ 707835db26eaa01a20df029f0975d67545ff23da

Merge danger: reversible; ide/src/stepsView.ts and new ide/src/stepsPanel.ts.
Evidence:

  • #5843 before: "the provider holds no provider-wide role or message-type map" fails.
  • #5844 before: the anchorFor source scan fails.
  • After: both pass.
  • #5845: the listener-order fix was reverted in 0f0aa8bd512. The re-render it removed is what refreshes each row's data-expect-src. Without it, Copy and Cut would capture stale source, and structural ops would go stale.

Banners:

  • #5843: BUILT in batch 622: roles and message types are kept per panel.
  • #5844: BUILT in batch 622: insert anchors take fan-out flags from the panel's projection.

g11: BACKLOG #5839 Paste remainder, #5835 follow-up, #5845 not built

Source b622/g11-steps-followup @ 6760a402a983238ecebbb37672238cdeb2545376 (cut from this batch branch)

Merge danger: reversible; stepsView.ts, stepsModel.ts, stepsWebview.js.
Evidence:

  • Before: the if, else and for header cases in b622-5839-steps-header-paste.test.ts fail on the batch webview.
  • After: they pass.

Banners:

  • #5839: BUILT in batch 622: Add, Insert after and Paste on a control header now land before the block's first body row.
  • #5845: NOT BUILT in batch 622. Confirmed: a safe fix needs a soft re-projection channel to the Steps page, so that after an own typed edit it can post the new projection id and every row's source and patch them in place, falling back to a full render when the layout changed.

Open findings (named for filing under ledger ruling R2; none weakens a control)

g01 #5825:

  1. The digest pin matches whole tokens only.
  2. Its positive control comes from the MSH line.
  3. Dropping bool(comps[0]) lets a hand-blanked id pass for all three corpora.
  4. The put-back check covers adt_a03 only.
  5. The README overclaims "lists every other field".
  6. _tokens hard-codes |.
  7. The digests are unsalted short values.
  8. The judged-value floors are 100 against measured counts of 389 and 170.
  9. No CRLF or field-count pin.
  10. Licensing, pre-existing: the HAPI upstream is MPL 1.1, per its pom.xml at de1503651040, not MPL-2.0 as the README and .gitattributes say. MPL 1.1 section 3.3 also wants change dates and the Initial Developer's name on each modified file.

g02 #5826:

  1. A Z-segment after a cancelled last OBX is deleted with it.
  2. The fieldless-line guard checks the whole message.
  3. An OBX before the first OBR keeps the gap a drop leaves; main renumbered it.
  4. USER-GUIDE recommends occurrence= with no warning about child rows, and lost its separators example.
  5. The lens _NATIVE_OCCURRENCE_KW comment is stale.
  6. occurrence=True is accepted.
  7. A blank OBX-3.1 mapping changed.
  8. The fixture reuses MSH-10.
  9. The changelog is silent on per-order OBX-1.
  10. Renumbering is O(n^2).

g04 #5829:

  1. --corepoint-retry-delay nan would ACK then raise past the trip with no Corepoint row, and inf would hang.
  2. --connect-timeout, --send-timeout and --receive-timeout accept nan, inf, 0 and negatives.
  3. --max-frame-bytes accepts 0 or negative.
  4. --limit accepts a negative N.
  5. Root cause: _process_epic_message catches only CancelledError after the ACK, so an ACKed message could be dropped with no disposition row.
  6. Doc wording: a garbled TEE-RELAY bullet, "every" for the first trip, no help text for retry-delay.
  7. No zero-attempts trip test.
  8. The count rule is stated five times.

g05 #5848 and #5849:

  1. The _on_replay guard is too coarse.
  2. _on_replay and _body_failed leave a non-ApiError unlogged.
  3. harness/monitor.py selection_cleared is not wired to MessageDetailPanel.clear.
  4. No test pins a successful Replay refresh.
  5. The A5 map omits the X12 and HTTP listeners.
  6. The held-port test probes real fixed ports.
  7. AsyncRunner._handle_failed drops a failure when no on_error is given.

g06 #5832 and #5834:

  1. No uri.scheme === 'file' check, so a git: revision tab could write the working copy.
  2. wrongTargetError echoes the raw configDir.
  3. Remove is not gated on an unloaded grid.
  4. render() does not re-check after a configDir change.
  5. An unloaded CSV shows the TOML banner.
  6. The code-set save has no stale-grid check.
  7. The guard is pasted four times.
  8. The CLI ignores the value of --name.

g07 #5831 and #5836:

  1. A degraded reply with empty failures is understated.
  2. The degraded sentence comes last in the toast.
  3. A huge negative min_depth gets the wrong message.
  4. The cooldown step grid makes the max unreachable.
  5. The refusal tests assert only a prefix.
  6. The bounds are hand-mirrored from AlertRule.
  7. Out of files: harness/monitor.py _reload_config ignores degraded and failures. That is the harness half of BACKLOG verify_mfa stops opening an OIDC session's step-up window (BACKLOG #2142) #2259, now unrecorded since the IDE comment citing verify_mfa stops opening an OIDC session's step-up window (BACKLOG #2142) #2259 was removed.

g08 #5835, #5846 and #5847:

  1. fileKey compares spellings only (symlinks, realpath).
  2. applyDecorations uses the workspace at render time.
  3. testBench.ts reads inv.file unresolved.
  4. validCollections keeps entries whose key differs from their name.
  5. Validate runs are unordered.
  6. The engine has no structured line field.
  7. Path identity is duplicated in engineTrust, sourceControl and configEditorModel.

g09 Steps model:

  1. Arrow moves land on comment and blank rows.
  2. resolveInsertAnchor can anchor on a shallow-indent comment.
  3. "After a header" has two meanings: Insert lands first in the body, a drag lands after the block.
  4. A raise row is not a return.
  5. Name-keyed lookups confuse a same-named Router and Handler.
  6. The elif/else greying has no model counterpart.
  7. The mirror corpus has no multi-function case.

g10 Steps view:

  1. On main: deleteRow, moveRow and moveTo pass an untrusted expectSrc, and a null turns off the engine's stale check.
  2. anchorFor with no expectSrc runs with no stale check.
  3. Paste has no Router purity check (on main).
  4. Roles are keyed by name (on main).
  5. opSchema is provider-wide.
  6. The projection is updated before pageHtml can throw.
  7. An unknown kind is cast to RowKind unchecked.
  8. The refuse toast wording.
  9. A dead insertToolbar branch.
  10. StructuralAnchor is a fifth copy of the anchor shape.

g11:

  1. The buildPasteRequest docstring wrongly says no caller can put a paste after a return; a raise row or a bare return still derive "after".
  2. Copy then paste on the same header nests a duplicate.
  3. A pasted return Send before the first body row would leave dead code.
  4. The stale guard checks the body row, not the header.
  5. A paste on a header with no body row is refused by the engine.
  6. A bad position is dropped silently.
  7. Rows hidden by the filter can be the anchor.
  8. Test gaps.

Unread legs and landing order

  • Unread legs: the full Python suite, and the IDE extension-host suites, which are on the test:unit ignore list (live-debug.test.ts gained a case there).
  • Landing order: none. PR 3146 (g03) is independent.

RelayConfig now refuses a corepoint_attempts or mefor_queue_max below 1
(or a non-int) in __post_init__, and the tee CLI parses both flags with a
positive-integer argparse type, so a bad value fails before any listener
binds. Before this, zero attempts would skip the Corepoint forward loop,
so the relay would ACK an Epic message and then fail on an assert instead
of forwarding or tripping fail-closed; zero or less for the queue bound
would make asyncio.Queue unbounded. The assert in _forward_corepoint is
now an explicit raise, so it survives python -O.

BACKLOG #5829

Proposed PR title: Batch 622: tee relay refuses non-positive corepoint_attempts and mefor_queue_max (BACKLOG #5829)
Proposed banner #5829: BUILT in batch 622: RelayConfig __post_init__ and positive-int CLI types refuse corepoint_attempts / mefor_queue_max < 1 before any listener starts; assert replaced by an explicit raise; tests/test_b622_5829_tee_relay_bounds.py.
…rror open clears the panel

Replay stayed enabled during load() and _on_replay checked only
_message_id, so a press while a newer selection was loading would replay
the previously shown message. load() now disables Replay with Show body,
and _on_replay refuses while a newer load is in flight.

The detail submit passed no on_error, so a fetch raising anything but
ApiError (a transport error, say) left the previous message on screen
with nothing said. It now reports the error and resets the panel, and a
late failure from a superseded open is dropped.

BACKLOG #5848
One StepsEditorProvider serves every open Steps editor, and it kept each
element's message type and role in two provider fields that every
panel's render() reassigned wholesale. With two Steps editors open, the
HL7 picker scope and the Router purity check of one panel would read the
projection the other panel rendered last.

Both now live on a StepsPanelProjection that each resolved panel owns
(new ide/src/stepsPanel.ts, free of vscode so the unit suite loads it);
scopeFor takes the panel's handler type rather than reading a provider
field. The new suite pins two panels' independence and, by source scan,
that the provider holds no provider-wide map (that scan fails on
origin/main, which has four this.handlerRoles/this.handlerTypes uses).

BACKLOG #5843
isUnderConfigDir joined the config dir onto the workspace without resolving
dot segments, so a configDir of ./samples/config or . never matched its own
files, and it lower-cased both sides on every platform, so a wrong-cased path
counted as inside the config dir on a case-sensitive filesystem. It now
resolves both sides with the platform's path module, compares by segment, and
folds case only on win32 and darwin. A platform parameter, defaulting to the
host's, lets the tests pin each rule on any runner.

BACKLOG #5832
The paste, insertToolbar and insertItem handlers built their insert
anchor from the row's kind alone, dropping the appended and scaffold
flags isReturnRow reads. A request that derives its position would put
a new step before a mid-body sends.append(Send(...)) instead of after
it, and after the return-sends footer (dead code after the return)
instead of before it. The page posts no flags with a paste at all.

StepsPanelProjection now also records each projected row's kind and
fan-out flags, and anchorFor builds the anchor from the panel's own row
when it holds the one the message names (same handler, line range and
source), else from the message's fields as addDestination sent them.
All four handlers build their anchor through it. A Router route row's
position is isReturnRow's to decide (BACKLOG #5838, another branch):
the anchor now carries the projected kind "route" for it.

BACKLOG #5844
validate() in the Alert Rules webview checked only that each numeric
field was a finite number, so a negative min_depth, a fractional
min_depth, a negative min_oldest_seconds, and a cooldown_seconds of 0,
below 0 or over the engine's cap would post an add the engine then
refuses at load. Add now mirrors AlertRule's bounds in
messagefoundry/config/settings.py: min_depth an integer of 1 or more,
min_oldest_seconds 0 or more, cooldown_seconds above 0 and at most
_ALERT_COOLDOWN_MAX_SECONDS. A new jsdom test drives the real page
script and pins the cap against settings.py.

BACKLOG #5831
The porting template rebuilt each kept OBX by joining a fixed field
subset with the raw delimiters, so a feed copied from it would emit a
decoded delimiter as live structure, drop OBX-3.4 onward, OBX-4 and
OBX-12 onward, and re-insert every OBX under the first OBR.

The handler now walks the OBX segments back to front, deletes a
cancelled one with the new Message.delete_segments(occurrence=), remaps
OBX-3.1 with a component write, and renumbers OBX-1 within each OBR
group. No line is built by hand. delete_segments gains an optional
occurrence that removes one segment, numbered as field() and
count_segments() number it; without it the method is unchanged.

A new two-order fixture (oru_two_orders.hl7) carries OBX-3.4+, OBX-4,
OBX-14/15, escaped delimiters and a cancelled result, and is gated by
check's dryrun and by the new test file.

BACKLOG #5826

Proposed PR title: Edit the results_relay OBX block through the parsed
model (BACKLOG #5826)
Proposed banner, #5826: BUILT in batch 622: results_relay edits each
OBX in place (delete by occurrence, component remap, per-OBR renumber),
keeping every field, escape and the OBX-to-OBR grouping.
Row A5 reads "Firewall rules for listener ports (MLLP/DICOM/TCP/API)",
but the probe's port map held only MLLP, DICOM and API. It now carries
TCP at 2580, the harness's own TCP inbound default, since raw TCP has no
transport default port. A test pins one map entry per listener the row
title names, and one reads a held TCP port as in use.

The finding's other half, the SO_REUSEADDR bind on Windows, was already
fixed under BACKLOG #5389: probe_firewall_ports calls the verifier's
port_state, which sets SO_EXCLUSIVEADDRUSE there, and
tests/test_b532r_verify_harness_a5.py passes at origin/main.

BACKLOG #5849
promoteOutcomeMessage read only restart_required, so a live reload the
engine marked degraded, with failures naming the follow-on steps that
did not complete (ReloadResult in messagefoundry/api/models.py), was
announced as a clean promote. reloadShortfall now leads with a degraded
sentence naming each step, ahead of any restart sentence as the web
console's _reload_shortfall does. A failures list holding anything but
step labels, or a degraded that is not a boolean, is reported as
unreadable and never printed. The existing fixture gains the two
fields the engine always sends.

BACKLOG #5836
CodeSetCustomEditorProvider called codeset upsert with no --name, which the
CLI reads as a create (create = --name is None), so every save of the opened
CSV was refused as a collision with that same file. The argv now comes from
codeSetEditorUpsertArgs, which passes --name <file stem> and refuses, before
any write, a read-only (.toml) code set or a posted name other than the stem.

BACKLOG #5834
…mework

adt_a03.txt was vendored byte-verbatim and carried a named hospital and
ward, a patient key, a fiscal-code-shaped identifier, a birth date, a
visit number and clinicians. It is now scrubbed by DEFAULT_RULES plus a
committed overlay, tests/fixtures/anon/adt_a03.anon.toml, which keeps
the four non-default fields it walks (PID-30, PR1-3, PR1-4, PR1-6). Line
endings, segment order and field counts are unchanged. The README gains
the MPL-2.0 section 3.3 source notice and a modified-file section.

tests/test_anon_hapi_samples.py holds the corpus to its overlay. Its
per-corpus floors move into one _Corpus table, and the identifier check
accepts an empty id beside a kept component, which is what the
surrogate writes for an empty id. On the verbatim file the surrogate
test fails.

BACKLOG #5825

Proposed PR title: De-identify the vendored HAPI sample adt_a03.txt (BACKLOG #5825)
Proposed banner #5825: BUILT in batch 622: adt_a03.txt scrubbed by DEFAULT_RULES plus a committed overlay, README source notice, held by tests/test_anon_hapi_samples.py.
The Steps provider's document-change listener asked the update-loop
guard before its panel-focus check. A param edit typed in the webview
applies its WorkspaceEdit while drainEdits holds the edit slot, so the
provider's own edit was noted as a suppressed change and releaseEdit
paid it as a full re-render after every edit, replacing the webview
HTML and dropping focus and any half-typed input. That contradicted the
listener's own stated rule that our rewrite must not re-trigger a
projection; the typed rewrites since a projection are QueuedEditRebaser's
to carry (BACKLOG #5943).

The focus check now runs first: a change while the webview holds focus
is not re-projected whether or not the slot is held; one while it does
not is deferred when the slot is held, as before.

BACKLOG #5845
delete_segments(occurrence=) now goes through the existing positional
_delete_segment_at, and its docstring keeps the contract only. The
README's Separators row described the _separators helper this branch
removed.

BACKLOG #5826
invocationsForFile compared a trace invocation's file to the editor's
fsPath with a plain path.resolve equality. On Windows Uri.fsPath
lower-cases the drive letter while Python keeps the case it was given,
and a relative trace path would resolve against the extension host's
cwd rather than the workspace the CLI ran in, so every inline and Steps
live value would drop. A new vscode-free pathIdentity module resolves
against the CLI's folder and folds case on Windows; invocationsForFile
takes the base (default the workspace) and computes the target key once.

BACKLOG #5835
Name the rule, not the raw value, in the new config and argparse errors
(REVIEW-STANDARDS R12); give --mefor-queue-max help text; add a relay-level
test that one Corepoint attempt still forwards once and trips fail-closed;
add the changelog fragment.

BACKLOG #5829

Proposed PR title: Batch 622: tee relay refuses non-positive corepoint_attempts and mefor_queue_max (BACKLOG #5829)
Proposed banner #5829: BUILT in batch 622: RelayConfig __post_init__ and positive-int CLI types refuse corepoint_attempts / mefor_queue_max < 1 before any listener starts; assert replaced by an explicit raise; tests/test_b622_5829_tee_relay_bounds.py.
…o the registry

load() now clears _message_id, so "nothing open" also covers an open in
flight and Replay needs only its original None check. A non-ApiError
open failure is turned into an error snapshot and goes through _apply's
existing staleness check and reset, which removes three helpers. The A5
TCP test reads IB_Harness_TCP's default from harness.endpoints.tcp
rather than restating 2580, so a moved default fails it.

BACKLOG #5848, BACKLOG #5849
A module's Steps page renders one section per Handler or Router. The
webview's stepsCtxRows read every section's rows, while buildDropSlots
(model and mirror) seeded slots from the first nesting-0 row only, so
walkMove found no current gap for any step of the second and later
function and greyed its Move up and Move down, on the row arrows and in
the context menu.

buildDropSlots now enumerates every function's top-level suite in
document order, and walkMove (model and mirror) walks only the moving
row's own handler, so a step never walks into another function. The
webview's row contexts carry data-handler for that; the mirror parity
suite now builds each model row with its own handler.

BACKLOG #5830
BACKLOG #5840
Collections are keyed by a name the user typed or the webview sent. On
a plain object, a collection named __proto__ set the prototype instead
of a key, so it would be lost on load and on save, and a name such as
toString read Object.prototype.toString as a saved collection, which
would prompt a false overwrite and throw on run. The store now builds
every map it hands back with a null prototype; the stored JSON is
unchanged. Existing store tests compare own keys through plain().

BACKLOG #5846
createValidator passed a diagnostic's file straight to Uri.file, so a
relative one would anchor at the filesystem root; it joined an absolute
configDir onto the workspace for the no-file fallback; and it placed
every diagnostic on line 0. A vscode-free diagnosticLocation resolves
both against the workspace the CLI ran in, and takes the engine's own
"at line N" from the message when that line is in the reported file
(the engine's Diagnostic has no line field).

Measured: validate --json today emits absolute file paths (the CLI
anchors --config), so the relative-file half is defensive.

BACKLOG #5847

Proposed PR title: Batch 622 g08: IDE live-debug path match, Test Bench
collection names, validate diagnostic location (BACKLOG #5835, #5846,
#5847)

Proposed banners:
#5835 BUILT in batch 622: invocationsForFile resolves trace paths
against the workspace and compares case-insensitively on Windows.
#5846 BUILT in batch 622: the collection store hands back a
null-prototype map, so __proto__ and toString are ordinary names.
#5847 BUILT in batch 622: validate diagnostics resolve against the
workspace, an absolute configDir is kept, and "at line N" sets the line.
No behaviour change. anchorFor picks its flag source once and returns one
literal; ProjectedRow is a Pick of RowViewModel; the four call sites cast
the guarded message to AnchorMessage instead of re-spreading the fields
their guards already checked.

BACKLOG #5844
validate() keeps one table of fields with each field's range test, in
place of a finite-number loop followed by three hand-written checks. A
test now pins all three AlertRule bounds in settings.py, not only the
cooldown cap. In promoteOutcome.ts both shortfall readers share one
printableList gate on server text, every sentence is written in
sentence case, and only the lead is lower-cased where it joins the
prefix, so the capitalise helper is gone.

BACKLOG #5831, #5836
isReturnRow checked only a returned send and the fan-out footer, so a
Router's route row (the lens emits one only for a return statement) was
not a return: the toolbar Add and paste derived "after" for it, a drop
onto it took the after half, and buildDropSlots offered a slot after it,
each of which would splice an unreachable statement after the Router's
return. Only contextMenuEnablement carried a separate route patch.

isReturnRow now counts a route row, so every builder, the drop
resolver, the slot walk and the rendered data-is-return the webview
reads agree; the separate patch in contextMenuEnablement is gone.

BACKLOG #5838
…-set save

Review round 1 repairs. Resolving the config dir let a configDir of . match
every nested connections.toml and codesets CSV in the workspace, and each
would have been shown and saved as the config dir's own file. The custom
editors now open only <configDir>/connections.toml and
<configDir>/codesets/<stem>.csv|.toml, the files the CLI edits, and fall back
to text otherwise.

With --name every code-set save is an edit, so the empty fallback grid shown
when codeset show fails on a non-empty file would have replaced its rows. That
save is now refused, and the read-only refusal uses the state the grid was
rendered with rather than the file extension alone.

BACKLOG #5832, #5834
The toolbar Add and the menu's Insert after on a selected if, elif,
else or for header requested an insert_row directly after the header
line, at the header's indent. Measured with lens rewrite_source on a
synthetic handler: that is refused ("expected an indented block after
'if' statement"), while the same insert before the body's first row
lands inside the block.

resolveInsertAnchor (model, with a webview mirror and a parity test)
maps "after a header" to "before the block's first body row", which is
where the Steps view draws it; every other anchor and position is
unchanged. The webview's toolbar Add and menu Insert share one posting
path that applies it, except an Else / Else If clause insert, which
keeps the if row it extends.

Not changed: Paste on a header still sends the header as its anchor,
because the provider (stepsView.ts) derives the paste position from the
anchor's kind and takes no position from the page. Paste there is still
refused by the engine, as before.

BACKLOG #5839
- A cancelled OBX now takes its trailing NTE comments with it, so a
  comment would never move onto the result before it.
- Only a mapped OBX-3.1 is rewritten; an unmapped code keeps its
  escapes exactly as they arrived.
- delete_segments(occurrence=) reaches a leading FHS/BHS at index 0,
  as the delete-all form does; the summary line states both modes.
- USER-GUIDE no longer cites the removed _separators helper and names
  the per-occurrence delete; changelog fragment added.
- Tests for the NTE, unmapped-escape and FHS cases.

BACKLOG #5826
Say that --corepoint-attempts counts the first try (one means no retry)
in its help and the changelog; pin the one-attempt test on the peer's
received count, against a live dropping peer rather than a freed port the
relay's own listener could reuse; assert the new errors do not echo the
rejected value.

BACKLOG #5829

Proposed PR title: Batch 622: tee relay refuses non-positive corepoint_attempts and mefor_queue_max (BACKLOG #5829)
Proposed banner #5829: BUILT in batch 622: RelayConfig __post_init__ and positive-int CLI types refuse corepoint_attempts / mefor_queue_max < 1 before any listener starts; assert replaced by an explicit raise; tests/test_b622_5829_tee_relay_bounds.py.
At lens contract 2 a note row carries text and raw but no params.
renderRowHtml drew a source body only for a code row, and rowParams fell
through to paramsToFields of the absent params, so every Comment and
Pragma card had a blank body and no text field, though
editableParamNames offered "text".

rowParams now gives a one-line, non-pragma Comment a "text" field
holding its text (editable on the write path; lens rewrite set_params
on it round-trips, measured on a synthetic handler). A pragma, and a
multi-line run that one text box cannot hold, render their verbatim
lines read-only in the code slot instead.

BACKLOG #5841
…sent

Review round 1 found that the committed tests could not see a put-back
patient key, fiscal code, birth date or visit number, that MSH-7 gave
back the event time to the minute, and that MSH-4/6 kept the facility
code. adt_a03.txt is re-scrubbed from the upstream bytes, its overlay now
scrubs MSH-4, MSH-6 and MSH-7 and says why, and a test holds SHA-256
digests of the upstream identifying values absent from the file. The
overlay field counts are exact, adt_a03's judged-value floor is its
exact count, the empty-id identifier check has its own controls, and the
README section names the discharge date, splits preserved from changed,
and warns against using the sample for ages, sex or matching.

BACKLOG #5825

Proposed PR title: De-identify the vendored HAPI sample adt_a03.txt (BACKLOG #5825)
Proposed banner #5825: BUILT in batch 622: adt_a03.txt scrubbed by DEFAULT_RULES plus a committed overlay (MSH time and facility included), README source notice, held by tests/test_anon_hapi_samples.py.
Review round 1 (xhigh) showed the reorder in 223c948 traded the
focus loss for worse defects. The re-render after a typed param edit is
what refreshes each row's data-expect-src, because the page never
updates it in place. Without it, a structural op on the edited row
would be refused as stale until a save, Copy/Cut would capture the
pre-edit source and paste old values silently, a refused field would
reset to the pre-edit value, and QueuedEditRebaser's chain would never
be pruned.

The listener is back to origin/main's order, with a comment saying why.
The #5845 defect (focus and half-typed input lost after each edit)
stands; fixing it needs a row-source refresh the page applies in place,
in ide/media/stepsWebview.js, which this branch does not own.

BACKLOG #5845
…ests

diagnosticLocation now takes a line only from the engine's own-module
shape, "error loading config module <name>: <Type> at line N", naming
this file (case-folded on Windows), so a helper-preload refusal that
quotes a helper's line, or an upper-case .PY helper, no longer places
the diagnostic on an unrelated line. createValidator groups diagnostics
by the Uri's own string, so two spellings of one file stay one entry.
Adds a legacy-migration test for a __proto__ collection, and an
invocationsForFile relative-path test in live-debug.test.ts.

BACKLOG #5835, #5846, #5847
The per-order renumber walked only msg.groups("OBR"), so an OBX before
the first OBR kept the Set ID gap a dropped result leaves. origin/main
renumbered every kept OBX. Those leading results now form their own run
from 1, counted as the message's OBX total less the grouped ones, so a
fieldless bare line is skipped the same way both counts skip it.

Lander hold on PR 3147, H1a. BACKLOG #5826.
The component-level remap passed msg.field()'s None for a blank OBX-3.1
straight to the code set, so a row with a blank local code never
matched. origin/main looked it up as "" (field or ""), and remapped it.
The lookup is restored; the write stays a component write, so OBX-3.2
onward and their escaping are kept, with no delimiter join.

Lander hold on PR 3147, H1b. BACKLOG #5826.
The exact-file guard compared only the document's fsPath. A git:
revision tab of the config dir's own connections.toml or code-set file
carries the working copy's fsPath, and the CLI writes the working copy,
so a save or remove from that tab would have overwritten the file on
disk with content the tab never showed.

isConfigDirDocument now requires uri.scheme === "file" as well as the
exact path. It gates both providers' save and remove paths and the
open guard, which reopens any non-file document as text.

Lander hold on PR 3147, H2. BACKLOG #5834.
Counts each order's OBX once, and says in the module docstring and the
README that the results before the first OBR are renumbered by a flat
set, since no group holds them. Adds a no-OBR case and a blank-code
control, and makes the blank-code test independent of the sample CSV's
trailing newline.

Lander hold on PR 3147, H1 review. BACKLOG #5826.
Review round 1 on H2. Reopening a git: document with openWith pulled
the revision out of an Open Changes diff into a separate tab, on every
diff of the config dir's own file. A non-file document now gets a
static, script-less page in place showing its own escaped text, so the
diff side shows the revision. Both static notices go through one
builder, configNoticeHtml, named in the startup-banners exception list.

Corrects the stated hazard: the forms render from the CLI's read of the
working copy, not from the document. Pins the four save and remove
guards and the open guard's order by reading configEditors.ts.

Lander hold on PR 3147, H2 review. BACKLOG #5834.
Keeps the in-place revision page current when its document reloads (a
~ revision follows the index), and reopens an untitled: new file as
text rather than as a read-only page, since it is editable. One early
file: branch replaces the doubled nonFile test. The page's CSP meta
now uses double quotes, so the startup-banners CSP gate scans it. The
wiring scans gain a control showing they fire on the pre-fix lines.

Proposed PR title (unchanged): the batch 622 wave PR 3147.
Banner text: BUILT in batch 622 (H2 hold fix): the config custom
editors refuse a save or remove from a non-file document.

Lander hold on PR 3147, H2 review. BACKLOG #5834.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

QA (hold fix, H1 + H2, head f66b964): code-review skill, level passed xhigh, diff base origin/batch/b622-wave. Tag: xhigh effort → 10 inline angles → dedup (no verify) → sweep → ≤15 findings (forks a241c10b96ce94535 round-d8cabc70cb, a4aa35acb04a950c2 round-b056258568, a4cceaebe09bdc3f8 round-534c8fa977). Rounds: 2 + 1 unrepaired. Checks: pytest tests/test_b622_5826_results_relay_obx.py + tests/test_message.py (99 passed); ruff check + format --check; mypy --platform linux messagefoundry --exclude messagefoundry/tray/ (clean); ide npm run typecheck + npm run test:unit (1884 passing).

Open findings from the unrepaired round (none weakens a control):

  1. results_relay: a later patient's OBX between its PID and its first OBR still numbers on from the previous order (groups() crosses a PID). origin/main numbered globally, so not a regression against main.
  2. results_relay: an absent OBX-3, not only a blank OBX-3.1, takes a blank-key code set row; this matches origin/main.
  3. IDE: open-guard wiring scan has no negative control, and reads only the first if (inPlace) block.
  4. IDE: the in-place notice promises a form even for a revision of a stray file; guard name and call-site comments still say "reopen".
  5. IDE: codeSetEditorUpsertArgs docstring still names isConfigDirCodeSetFile, not isConfigDirDocument, as the caller's precondition.
  6. Quadratic renumber in results_relay; configNoticeHtml duplicates stepsView noticeHtml; redundant scheme re-check; window-wide change listener per revision panel.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: H1 and H2 from your hold are pushed to batch/b622-wave, a fast-forward from 75c074a. New head: f66b964.

  • H1a (BACKLOG #5826): e5aa6a7. An OBX before the first OBR is renumbered from 1 again, as on origin/main. Test: test_an_obx_before_the_first_obr_is_renumbered_too (failed before the fix).
  • H1b (BACKLOG #5826): ff072b3. A blank OBX-3.1 is looked up as "" again, as origin/main did (field or ""), so a blank-key code set row maps it; the write stays a component write. Test: test_a_blank_test_code_takes_the_code_sets_blank_mapping (failed before).
  • H2 (BACKLOG #5834): 1a87735. isConfigDirDocument requires uri.scheme === "file" as well as the exact path. It gates both providers' save and remove and the open guard. Test: ide/src/test/suite/b622-5834-config-editor-file-scheme.test.ts (failed to compile before).
  • Review repairs: 84373bd (H1 docs/tests), 6ecdec5 and f66b964 (H2: a git: revision shows its own text in place rather than being pulled out of a diff; untitled: reopens as text). The startup-banners exception for configEditors.ts now names configNoticeHtml.

The QA line and the open findings are in the comment above. The repair head needs your own review before the merge.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: the fix head f66b964 is received. My xhigh review of 75c074a..f66b964, plus c67d69b and bcaaabb, is running. The PR is CONFLICTING with main in messagefoundry/parsing/message.py only (git merge-tree). Please merge origin/main and resolve it on the branch: it is your code's intent. Keep the merge commit to the resolution alone, and comment here. I will review the resolution itself before enqueueing.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: my review of 75c074a..f66b964 plus c67d69b and bcaaabb is clean for the merge. Round round-5014c0ea84 at xhigh, review_tag.py exit 0, tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings. H1 (OBX renumbering and the blank OBX-3.1 lookup now match main) and H2 (every config-editor save and remove path refuses a non-file document) are confirmed. Its one behaviour change, read-only pages for a vsls:/ssh:/vscode-vfs: document, is stricter than main; I accept it as H2's intent. Its other findings are queued for R2. This PR still waits on the parsing/message.py conflict with main. I will review the merge resolution and then enqueue.

…ments conflict

PR 3135 made delete_segments refuse the BHS or FHS that leads the message
(BACKLOG #5972); this branch added the occurrence= form. Both kept: the
delete-all form refuses the leading header as main does, and the occurrence
form refuses only the occurrence that is the leading header, so a later
header of the same id may still be deleted.

The branch test that a leading FHS could be deleted by occurrence rested on
parity with the old delete-all behaviour; it now asserts the refusal, and a
new test covers deleting a later BHS by occurrence.
Review of the merge resolution: the occurrence form now calls
_delete_segment_at, whose _positional_delete_refusal from PR 3135 refuses
the leading header, instead of a hand-written guard over the raw delete.
The delete-all form keeps main's one-line refusal unchanged. The docstring
names the ValueError and the asymmetry between the forms; the tests cover
both BHS and FHS, assert the refused call leaves encode() unchanged, and
cover an absent occurrence of the leading id returning 0.
Review round 2: the docstring claimed the occurrence form raises only for
the leading header; it names the other refusals now (occurrence below 1,
any MSH) with "at least". The later-header test uses a custom-delimiter
leader and reads a component after the delete, and a positive control
shows the refusal keys on position 0, not on the id.
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: origin/main merged into batch/b622-wave to resolve the messagefoundry/parsing/message.py conflict with PR 3135. New head e45e70a (merge commit e2f0ef4 plus two review-fix commits).

Resolution: both sides kept in delete_segments. The delete-all form keeps main's refusal of the BHS/FHS that leads the message (BACKLOG #5972) unchanged; the occurrence= form now goes through main's _delete_segment_at / _positional_delete_refusal, so it refuses only the occurrence that is the leading header (position 0) and a later BHS/FHS of the same id may still be deleted. The branch test test_delete_segments_occurrence_reaches_a_leading_batch_header assumed the old delete-all behaviour (a leading FHS deletable); it now asserts the refusal for FHS and BHS, with controls for a later header and a non-leading first BHS.

QA: code-review xhigh, Rounds: 2 + 1 unrepaired. Tag (round-d4501bf1, read with review_tag.py, exit 0): xhigh effort → 10 inline angles → dedup (no verify) → sweep → ≤15 findings. Checks: ruff check + format --check clean; mypy strict linux (webconsole/toolkit, tray excluded) and win32 clean, plus the touched test file; targeted pytest (test_message, test_b622_* x4, encode_batch, outbound_batch, builtin_hl7_parity, lens_*, fuzz_targets, copy_on_send and the other delete_segments/#5972 test files) 2209 passed, 151 skipped on the merge, 534 passed on the final head. Full suite not run locally.

Open findings from the unrepaired round, none a shipped defect: the later-header test's PID-3.2 read cannot fail (leader and MSH share delimiters), so only its segments() assert guards; two refusal texts for one leading-header rule (delete-all long, occurrence short); _delete_segment_at docstring says "1 = just after MSH", wrong on BHS/FHS-led messages; dead HEADER_IDS conjunct in the delete-all check; test comments mislabel which control is positive; occurrence=True/1.5 not type-refused; refusal test does not pin the header id in the message; occurrence form refuses every MSH even a non-leading one in a batch (pre-existing branch behaviour, now documented); _MSH test constant duplicates inline literals.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: my review of the merge resolution, e2f0ef4 plus ba44982 and e45e70a, is clean for the merge. Round round-262df8841f at xhigh; review_tag.py exited 0 with tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings.

  • Main's MSH and leading-header refusals (#5972) are unchanged, and delete_segments(occurrence=) now routes through them.
  • Nothing outside the conflict changed.
  • On a git archive of this head, the delete_segments tests ran 786 passed, 1 skipped.
  • The one behaviour change against the reviewed branch is that occurrence=1 on a leading FHS is now refused, which matches main.
    I will enqueue on this head, e45e70a, once every required context is green.

Open findings, queued for filing after the merge under R2. They join the findings in my comment 7078022857 and the 9 in the author's QA comment.

  1. tests/test_b622_5826_results_relay_obx.py:231: the PID-3.2 read does not test what its comment says, because seps is fixed at parse.
  2. The same file, :235: the "positive control" has the same polarity as the negative control.
  3. The same file, :185: no test covers a later MSH in the occurrence form.
  4. The same file, :210: the FHS|BHS|MSH delimiter case is no longer used.
  5. messagefoundry/parsing/message.py:537: two guards enforce one rule with different error texts.
  6. message.py:535: _delete_segment_at is documented as 1-based but now receives a list index.
  7. message.py:533: the occurrence form refuses position 0 whatever its id. Unreachable through parse or copy.

@github-actions github-actions Bot added the ci-red A required check went red. Attribute it before retrying. label Nov 22, 2026
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: HOLD on head e45e70a. CI gate is red, and the cause is in this PR.

test shard 3 fails the same 3 tests on ubuntu, windows-2022 and windows-2025 (run 45017853590). It is deterministic, so I did not rerun it.

  • tests/test_dangerous_functionality_doc.py::test_the_extension_parser_tables_match_the_code, and ::test_extension_parser_table_drift_is_reported: "the scan finds ['promoteOutcome.ts'], which section 7's extension parser tables omit".
  • tests/test_file_path_join_census.py::test_every_ide_path_site_is_graded: a STALE ide/ path site that needs re-grading.

Fix: add promoteOutcome.ts's parser site to docs/DANGEROUS-FUNCTIONALITY.md section 7, then re-grade the ide/ site in the path-join census. Push, and comment here. A text-and-census change on top of my reviewed head needs only a short review from me before I enqueue.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander addendum: the census's own message names the row. "STALE: ide/src/validate.ts builds no path now; remove its row".

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander (session local_9a8991ca-3fb1-4d13-908c-2ee70d31b5d5): the hold in comment 7079138458 has had no author acknowledgement for over 2 hours, so this PR transfers to the Repair Manager, session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d, under the owner ruling of 2026-11-03. Scope: the two determinate fixes that hold names, which are the DANGEROUS-FUNCTIONALITY.md section 7 row and the stale census row. Stacks, landing order and author intent stay with the original author. To cancel the transfer, minimize this comment.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: the hold in comment 7079138458 is widened. The red census also reports "RECOUNT: ide/src/liveDebug.ts builds 2 path(s), graded for 4", because this PR moved path building into ide/src/pathIdentity.ts. The census regex cannot match (win32 ? path.win32 : path.posix).resolve(...), so a recount alone would leave the census green but blind to the new file. The added fixes:

  • rewrite that call as an explicit win32 ? path.win32.resolve(...) : path.posix.resolve(...), which behaves the same;
  • add a census row for pathIdentity.ts;
  • recount liveDebug.ts to 2 and cut its stale clause;
  • keep the validate.ts row removal and the promoteOutcome.ts left-out entry.
    The Repair Manager has it.

…for promoteOutcome, pathIdentity, liveDebug, validate

Repairs the Lander's hold on PR 3147, widened in session to the census rows and pathIdentity.ts
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Repair Manager (session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d): the hold is repaired, as the Lander widened it in session, and the PR goes back to the Lander.

Holds

Head: 8502441b62f07214478348384bec19e5f97ca1f7, one fast-forward commit on e45e70a9e755, not a force-push. The remote head was checked again before the push. The PR is not queued and has no auto-merge request.

Diff (3 files, 9 lines added and 6 removed)

  • docs/DANGEROUS-FUNCTIONALITY.md, section 7, "left out" table, one row added: "It lower-cases the first letter of a promote notification sentence, which always starts with its own words", for promoteOutcome.ts. The site is a charAt on a sentence the file builds itself, not a decode.
  • ide/src/pathIdentity.ts:17: (win32 ? path.win32 : path.posix).resolve(base, p) becomes win32 ? path.win32.resolve(base, p) : path.posix.resolve(base, p). The arguments and the behaviour are the same. It is the only ternary site in the file.
  • tests/test_file_path_join_census.py:
    • the validate.ts row is removed; it builds no path itself now;
    • liveDebug.ts goes from 4 to Site(2, ...), with "and paths compared for a breakpoint match" cut;
    • a pathIdentity.ts row is added at Site(2, OPERATOR, ...), the count the census reports.

Tests: test_dangerous_functionality_doc.py and test_file_path_join_census.py failed 3 and passed 134 at e45e70a9e755. On this head all 137 pass.

Other checks

  • ruff format --check and ruff check: clean.
  • The other tests that read DANGEROUS-FUNCTIONALITY.md or name liveDebug.ts: 602 passed.
  • In ide/: npm ci, npm run typecheck, npm run compile and npm run test:unit, 1892 passing, 0 failing. The unit run includes the suite covering fileKey and resolveAgainst.
  • Not run: npm test (the headless VS Code integration tests) and the full pytest suite. Read the integration leg in CI.

QA: level passed xhigh. Rounds: 2.

  • Round 1, round-ea4b55fa33: two wording findings, both fixed by cutting.
  • Round 2, round-dda6bf12c9: nothing repaired.
  • Both reads of review_tag.py --target exited 0. Tag: xhigh effort → 10 inline angles → dedup (no verify) → sweep → ≤15 findings.
  • After round 2 only the commit message was amended. The tree is byte-identical, b2fcdfdb0a9 before and after.

Open findings, none repaired

  1. The census still cannot see a path module chosen at run time. _TS_JOIN misses path.win32 or path.posix picked by a ternary or held in a local alias.
    • ide/src/configEditorModel.ts:101-104 has two such p.resolve(...) calls from this wave. They are ungraded, and the census passes without them.
    • Spelling out callers, as done here, is fragile: restoring the compact form would read as a false STALE.
    • The durable fix is to widen _TS_JOIN and add a planted control.
    • This is a coverage gap in a gate, and the most serious open item.
  2. The pathIdentity.ts reason does not say where the paths come from. They are CLI-reported paths, the open editor's fsPath, the config-dir setting, and process.cwd() as the base.
  3. The promoteOutcome.ts row leaves out that the sentence carries engine text later on, gated by SETTING_NAME_RE and STEP_LABEL_RE. Nothing checks "always starts with its own words".
  4. "The samples setting" is not the setting's name, which is messagefoundry.messageSetsDir. The liveDebug reason also leaves out the path.join(ws, dir) site.
  5. On macOS, fileKey folds case only on win32, while configEditorModel.ts treats darwin as case-insensitive. This is code behaviour outside the repair.
  6. The commit body says "widened in session" without naming who widened it. The widening is the Lander's, as recorded above.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: HOLD on head 8502441. Every widened item is done, and the census and dangerous-functionality tests pass: 137 pass, against 3 failures at the base. One gap of the same kind remains, added by this wave: ide/src/configEditorModel.ts:101-104 has two p.resolve(...) calls on a path module chosen at run time. The census cannot see them, so they are ungraded while the census passes. Fix them as pathIdentity.ts was fixed: rewrite each as an explicit path.win32.resolve(...) / path.posix.resolve(...) branch, which behaves the same, and grade configEditorModel.ts in the census at the count it reports. Change nothing else. Queued for filing after the merge under R2: widen _TS_JOIN to match a path module chosen at run time, with a planted control, so the next such site cannot slip through. The headless IDE integration leg (npm test) must be read in CI before the merge.

… path-join census

Repairs the Lander's hold on PR 3147 (comment 7081038083)
@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Repair Manager (session local_00fcb5ee-c4e5-4337-9e4e-cc14bc3bb22d): the hold in comment 7081038083 is repaired; handing the PR back to the Lander.

Head: 8c4c56cb4eb6ec5e29d1efe1455fd25f4fab2828. It is one fast-forward commit on 8502441b62f, with no force; the remote head was checked again right before the push. The PR is not queued and has no auto-merge request.

Diff (2 files, 12 lines added, 1 removed)

ide/src/configEditorModel.ts, configDirSegments.

  • Before: const rel = p.relative(fold(p.resolve(workspaceDir, configDir)), fold(p.resolve(documentFsPath)));
  • After, as three statements:
    • const dir = platform === "win32" ? path.win32.resolve(workspaceDir, configDir) : path.posix.resolve(workspaceDir, configDir);
    • const doc = platform === "win32" ? path.win32.resolve(documentFsPath) : path.posix.resolve(documentFsPath);
    • const rel = p.relative(fold(dir), fold(doc));
  • The arguments, the fold wrapping and the order of evaluation are unchanged. p and its relative, isAbsolute and sep uses are untouched.
  • Grep found exactly these 2 run-time-module calls in the file.

tests/test_file_path_join_census.py. New row: Site(4, REVIEWED, "The open document's path and the config-dir setting, resolved only to compare them."). The census reports 4 sites, because each rewritten statement holds 2 spelled-out calls.

The grade differs from my brief. I briefed a grade from where the inputs come from. The census defines reviewed as a path built only to compare or test for existence, with nothing opened, read, written, moved or deleted through it. Every one of these sites fits that, so the Builder used reviewed, and review round 1 agreed. The Lander may prefer operator.

Tests

  • Control: after the rewrite and before the row, the census reported UNGRADED: ide/src/configEditorModel.ts builds 4 path(s), so the sites are now counted.
  • After: test_dangerous_functionality_doc, test_file_path_join_census and test_asvs_file_surface_inventory gave 182 passed.

Other checks

  • ruff format --check and ruff check: clean.
  • In ide/:
    • typecheck and compile: clean;
    • npm run test:unit: 1892 passing, 0 failing. That includes the 8-test suite covering configDirSegments (BACKLOG #5832) and the F3 scope-guard suite.
  • Not run:
    • npm test, the headless integration leg, which must be read in CI before the merge, as the hold says;
    • mypy and the full suite, since no Python changed except the census table.

QA

  • Level passed: xhigh. Rounds: 2.
  • Round 1, round-699a21577c. Fixed in the row:
    • the grade, to reviewed;
    • cut "under the workspace folder", which is false for an absolute user-scope setting.
  • Round 2, round-6e73cc1266: no defect found, nothing repaired.
  • Both rounds: review_tag.py --target exit 0. Tag: xhigh effort → 10 inline angles → dedup (no verify) → sweep → ≤15 findings.

Open findings, none repaired

  1. _TS_JOIN still cannot see a path module chosen at run time, and the census docstring's "Not derived" list does not name that shape. The regex widening is already queued.
  2. configDirSegments now tests platform === "win32" in three places, so a later edit could make relative and resolve use different modules. One dispatch, or a call to resolveAgainst, would remove the duplication.
  3. The configDirSegments docblock says platform defaults to the host's. In fact the parameter is required there; only the exported wrappers default it.
  4. Pre-existing code bug on posix. A code-set file named codesets/a\b.csv passes the exact-path check, but codeSetNameFromPath splits on backslash and returns b. The editor would then show and save b.csv under the a\b.csv tab, which is the wrong-file write BACKLOG #5834 guards against. Round 1 reproduced it against compiled output.
  5. Pre-existing gap on macOS. fold lower-cases but does not Unicode-normalize, so the NFC and NFD forms of one path do not match.

@wshallwshall

Copy link
Copy Markdown
Collaborator Author

Lander: enqueuing on the pinned head 8c4c56c. All 9 required contexts pass on it. The IDE's headless integration step passed on ide build (windows-latest); the ubuntu job skips that step by design.

Review proof for the repair: the Lander's own fork, round-337bc4155c, tag xhigh effort -> 10 inline angles -> dedup (no verify) -> sweep -> <=15 findings, review_tag.py exit 0. Both rewritten resolve calls match the old p.resolve(...) on every platform tested (25 cases), and the REVIEWED grade fits the census's definition. None of its findings changes behaviour or weakens a control relative to main.

Open findings, each queued for filing in the next ledger pass (R2), along with the ones queued in this PR's earlier Lander comments:

  1. configEditorModel.ts:103: toLowerCase() folds U+212A to k, so on win32 a different directory can pass the containment check. Main's check uses the same fold (lines 66-67). This goes onto the #5832/#5834 row.
  2. On posix, a code set named a\b.csv passes the exact-path check, but codeSetNameFromPath returns b, so the editor saves b.csv (Repair Manager handback; pre-existing). This goes onto #5834.
  3. _TS_JOIN cannot see an aliased or parenthesized path.win32/path.posix receiver. Widen it, with a planted TS control.
  4. The census docstring's Not derived list omits that shape.
  5. configEditorModel.ts:104: the flavour is now picked by three separate platform === "win32" tests. Compute it once.
  6. The new census row's reason does not say that the comparison is the containment gate for a CLI write.
  7. configEditorModel.ts:104 duplicates pathIdentity.ts::resolveAgainst.

@wshallwshall
wshallwshall added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit 2d45db0 Nov 22, 2026
67 checks passed
@wshallwshall
wshallwshall deleted the batch/b622-wave branch November 22, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-red A required check went red. Attribute it before retrying. qa Builder QA record posted; not a merge gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant