Skip to content

fix(interface): word reassembly, trace, output-format and engine-fallback messages in the house form (#2303) - #2374

Merged
JarryShaw merged 1 commit into
mainfrom
fix/2303-interface-message-form
Oct 27, 2026
Merged

JarryShaw merged 1 commit into
mainfrom
fix/2303-interface-message-form

Conversation

@JarryShaw

@JarryShaw JarryShaw commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

What is the purpose of your pull request?

  • fix — bug fix

Description

Closes #2303.

  • Problem: reassemble and trace raised "Unsupported ... protocol: foo" — capitalised, and without the value's !r; follow_tcp_stream warned "fallback to default engine" where Extractor says "using default engine instead", and left the engine's name unquoted in its own "no reassembly adapter" warning; TraceFlowBase.make_fout warned a capitalised "Unsupported output format: ..."; and Extractor.make_name raised "unknown output format: foo" with the value unquoted — for an empty format, that leaves nothing after the colon.
  • Fix: lowercase each message and quote the rejected value with !r, and use "using default engine instead" for every engine fallback.
  • Test: tests/interface/test_message_form_2303_unit.py pins all seven messages.

@JarryShaw JarryShaw moved this to In review in PyPCAPKit Oct 27, 2026
@github-actions github-actions Bot added this to the PyPCAPKit v1.5 milestone Oct 27, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: NEEDS CHANGES at 737e19a79 (Sonnet). All 5 targeted messages are correct, pinned and regression-free. Two scope gaps, ruling both in-scope of #2303 since they're the same defect class in the same area:

  1. extraction.py:1041 — unknown output format: {fmt} needs !r (live-reachable, confirmed: format='' prints nothing after the colon).
  2. interface/misc.py:185-186 — a second unquoted unsupported extraction engine ...: {exeng.name} warning in the function this PR already touches (live-reachable via a registered third-party Engine subclass).
  3. PR body/commit message overclaim: Extractor's edit at extraction.py:1505 is for a warning that's never been reachable since 2022 (confirmed via git log -S) — will correct the wording myself.

Fix for 1/2/the docstring-tense nit in progress.

@JarryShaw JarryShaw added bug Issues reporting a defect (set by the bug report template; a default, not an assessment) fix Pull requests that fix a defect (fix: subject prefix) labels Oct 27, 2026
…back messages in the house form (#2303)

reassemble and trace raised "Unsupported ... protocol: foo", capitalised and
without the value's repr; follow_tcp_stream warned "fallback to default
engine" where Extractor says "using default engine instead", and left the
engine's name unquoted when it has no reassembly adapter; TraceFlowBase.make_fout
warned a capitalised "Unsupported output format: ..."; and Extractor.make_name
raised "unknown output format: foo" with the value unquoted -- which, for an
empty format, ends the message at the colon with nothing after it.

Lowercase each message and quote the rejected value with !r, and use
"using default engine instead" for every engine fallback.

Test: tests/interface/test_message_form_2303_unit.py pins all seven messages.
@JarryShaw
JarryShaw force-pushed the fix/2303-interface-message-form branch from 737e19a to f90b62a Compare October 27, 2026 08:20
@JarryShaw JarryShaw changed the title fix(interface): word reassembly, trace and engine-fallback messages in the house form (#2303) fix(interface): word reassembly, trace, output-format and engine-fallback messages in the house form (#2303) Oct 27, 2026
@JarryShaw

Copy link
Copy Markdown
Owner Author

Rebased and amended 737e19a79 → f90b62aa0 (6 commits onto current origin/main, clean): fixed the two missed sites (extraction.py:1041 make_name's unquoted value, interface/misc.py:185-186's second unquoted engine warning — both confirmed live-reachable), added 2 pinning tests, reworded the docstring off change-relative narrative, and corrected the title/commit/body's overclaim about the unreachable Extractor warning at line 1505 (confirmed dead since 2022 via git log -S — make_name always raises first when that warning's guard admits). 7/7 tests pass.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Review: GOOD TO GO at f90b62aa0 (Sonnet, round 2). Both fixes independently re-verified live (own third-party Engine subclass for site 2), 7 mutation checks all catch exactly the right test, line-1505 unreachability confirmed with one honest caveat (reachable only if a subclass overrides make_name to return ext=None — dead on the stock class, not logically dead), scope-completeness AST walk found nothing else missing the house form, regression clean (569 vs 562 passed, delta = exactly the new tests), PR text matches measurements.

All findings across both rounds now addressed.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage: 91.58% (unit tier, Python 3.15, f90b62aa0, Unit Tests run success)

Package Statements Missed Branches Partial Cover
pcapkit (top level) 104 4 20 2 95.16%
pcapkit/const 19601 881 2620 867 92.12%
pcapkit/corekit 2596 74 818 37 96.51%
pcapkit/dumpkit 282 3 102 3 98.44%
pcapkit/foundation 3029 23 1050 25 98.82%
pcapkit/interface 138 4 52 3 96.32%
pcapkit/protocols 17455 218 4598 185 98.15%
pcapkit/toolkit 914 36 334 10 95.51%
pcapkit/utilities 502 7 144 5 98.14%
pcapkit/vendor 4432 1988 1018 167 51.87%

Per-file detail: the coverage-html artifact of this run.

@JarryShaw

Copy link
Copy Markdown
Owner Author

Ready to merge.

Review: GOOD TO GO (Sonnet, round 2) at f90b62aa0.
CI: Required checks passed, 0 failures (only the non-blocking experimental GraalPy leg still pending).
Mergeable, 0 unresolved threads.

@JarryShaw JarryShaw added the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 27, 2026
@JarryShaw
JarryShaw merged commit ee0da57 into main Oct 27, 2026
62 checks passed
@JarryShaw
JarryShaw deleted the fix/2303-interface-message-form branch October 27, 2026 15:13
@github-project-automation github-project-automation Bot moved this from In review to Done in PyPCAPKit Oct 27, 2026
@JarryShaw JarryShaw removed the review: good-to-go Cross-review at the current head says ready; CI state is separate label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issues reporting a defect (set by the bug report template; a default, not an assessment) fix Pull requests that fix a defect (fix: subject prefix)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(interface): reassembly, trace and engine-fallback messages break the house form

1 participant