nvx-rs: share one byte-level EXEC and MAPS decoder between the host and the guest
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
The duplicated logic sits in nvx::protocol: compare decode_exec_payload and decode_maps_payload with decode_guest_exec_payload and decode_guest_maps_payload to map the shared framing, flags, and length checks. Keep the host's inherit_default_env rule and the guest's separate rule explicit, and check the result against the C agent parity fixtures that #358 adds. Done means one structural parser feeding both decoders, with the host API, its diagnostics, and guest acceptance unchanged. The issue says to wait until #358 is finished, so do not start before then.
Written by the indexing model from the issue text.
Description
Summary
nvx::protocol decodes the NVXC EXEC and MAPS payloads twice. decode_exec_payload and decode_maps_payload produce the host's UTF-8 types, and decode_guest_exec_payload and decode_guest_maps_payload, which #531 adds, produce the guest's byte strings. Each pair repeats the framing, flags, lengths, and field validation, so a later format or validation change can update one decoder and leave the other behind.
Found in the #531 review. #531 keeps a faithful port of the C agent, so this waits until the #358 series is done.
Proposal
Share the byte-oriented structural parsing, and keep the host's UTF-8 types behind conversions:
- Keep the public host API and its diagnostics, and keep accepting non-UTF-8 guest arguments, paths, and environment entries.
- Make intentional host and guest differences explicit rather than substituting one type for the other. For example, the two
inherit_default_envfields differ when no explicit environment is supplied: the host's istrue(flags & EXEC_ENVIRONMENT_PRESENT == 0 || flags & EXEC_INHERIT_DEFAULT_ENV != 0), and the guest's followsEXEC_INHERIT_DEFAULT_ENValone.
#537 and #545 can then build on one parsing implementation rather than another pair of codecs.
Tasks
- Share the structural parsing of
EXECandMAPSbetween the host and guest decoders, with the host API, its diagnostics, and the guest's acceptance unchanged. - Check the shared decoder against the C agent's parity fixtures, which #358 checks in before it removes the C agent. Their expected outcomes must not come from the new decoder.
- Dominant language
- Python
- Stars
- 408
- Forks
- 28
- Avg merge
- 13h 18m
- Merged PRs (30d)
- 292
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
Track sandbox live share bugs: the time ABI bind hides or breaks shares at /run targetsPossibly taken @jay23606 claimed this 2 days ago. Openbug-hunt confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 45/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 15/100
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
521xueweihan/HelloGitHub#4025 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
aws-samples/sample-per-model-bedrock#321 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
FavioVazquez/showtime#101 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
koush/ha_scrypted#81 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
google/osv-scanner-action#147 ·