Skip to content

feat(wgm): vendor IE discovery + calibrated score boost (rebased onto main) - #353

Merged
c03rad0r merged 3 commits into
OpenTollGate:mainfrom
felixfelix-bot:rebase/pr-332
Aug 30, 2026
Merged

c03rad0r merged 3 commits into
OpenTollGate:mainfrom
felixfelix-bot:rebase/pr-332

Conversation

@felixfelix-bot

Copy link
Copy Markdown
Contributor

Rebased version of #332. Conflicts resolved: kept main's refined vendor_element_manager.go, config_manager_config.go, vendor_ie_encode_test.go. 3 commits applied cleanly. Build verified.

@felixfelix-bot

Copy link
Copy Markdown
Contributor Author

Rebased onto main by felixfelix-bot (supersedes #332). Ready for c03rad0r review + merge. This PR contains the vendor IE discovery v2 feature with calibrated score boost. All conflicts resolved during rebase.

@c03rad0r
c03rad0r requested review from Amperstrand and c03rad0r and removed request for c03rad0r August 20, 2026 12:19

@Amperstrand Amperstrand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fidelity-verified against our original #332's final reviewed state: the Required:true→false schema fix is present, and the scanner.go staging-marker hunk carried too (struct alignment + the STAGED comment). CI green.

Two notes before merge, neither blocking from our side:

  1. CHANGELOG entry missing — per repo convention this is a user-visible change (configs that predate the key were being rejected). Suggested entry under Fixed: 'Config schema: vendor_ie_discovery no longer Required — optional-with-default upgrades cleanly (#353).'
  2. Overlap with #355 on (yours changes the Required field; #355 reformats the block) — whichever merges second will need a trivial rebase. Sequencing note only.

@Amperstrand Amperstrand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fidelity-verified against our original #332's final reviewed state: the vendor_ie_discovery Required:true->false schema fix is present, and the scanner.go staging-marker hunk carried too (struct alignment + the STAGED comment). CI green.

Two notes before merge, neither blocking from our side:

  1. CHANGELOG entry missing - per repo convention this is a user-visible change (configs that predate the key were being rejected). Suggested entry under Fixed: "Config schema: vendor_ie_discovery no longer Required - optional-with-default upgrades cleanly (#353)."
  2. Overlap with #355 on src/config_manager/config_schema.go (yours changes the Required field; #355 reformats the block) - whichever merges second will need a trivial rebase. Sequencing note only.

@Amperstrand Amperstrand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — minimal staging change: schema vendor_ie_discovery flips to Required: false, scanner.go gofmt alignment, plus an explicit comment that the vendor-IE parse wiring lands in a follow-up. Zero runtime delta; CI fully green. Approving — merge at your discretion.

(E2E cloud-lab run for this head is in flight; results will be posted as a follow-up comment.)

@Amperstrand

Copy link
Copy Markdown
Collaborator

E2E results: deployed head 87e018a as ci-pr-353.196.87e018a (CI-built ipk) on the OpenWrt x86_64 QEMU lab:

Suite Result
api/test_quote_persistence 4/4 passed
api/test_lightning_backoff 3/3 passed

As expected for a zero-runtime-delta staging change, the build deploys and behaves identically to main. (Approve + merge at your discretion.)

amperstand added 3 commits August 30, 2026 18:51
1. Encoder: guard total body length against uint8 overflow
   (per-field checks existed but sum could exceed 255)
2. Parser: respect declared bodyLen instead of raw[2:]
   (was reading trailing bytes as TLVs)
3. Docs: update vendor_element_manager description
   (was referencing removed 'Bitcoin/Lightning info')

Addresses items 1, 2, 6 from c03rad0r's consolidated review.
Items 3 (OUI hardware validation), 4 (ubus health check),
5 (JSON via fmt.Sprintf), 7 (map ordering) are informational —
no code change needed for this PR's scope.
…TollGate#235)

Addresses c03rad0r's change requests:

1. Encoder: moved len(body) > 255 check BEFORE uint8 cast
   (was after, meaning truncation already happened)
2. Added 11 encoder/parser unit tests:
   - 5 encode→decode round-trip tests (minimal, flags, mint, pubkey, full)
   - TestEncodeRejectsOversizedBody (>255 bytes)
   - TestParseRejectsInvalidOUI (wrong OUI)
   - TestParseRejectsTooShort (<8 bytes)
   - TestParseRejectsWrongElementType (wrong elem type byte)
   - TestParseRespectsBodyLen (trailing garbage ignored)

All tests pass.
- scanner.go: staging marker where NetworkInfo is built —
  IsTollGate/RawIEs/pricing stay zero here; the vendor-IE parse that
  fills them and the VendorIEDiscovery gate land in the wiring
  follow-up. Makes the intentional staging legible at the seam.
- config schema: vendor_ie_discovery Required true → false. A Required
  key with Default false rejects every existing config that predates
  the key; optional-with-default upgrades cleanly.

Review findings: cold review 2026-08-18 (majors 1-3 are the staged
wiring by design — deferred with this PR per merge order; minor 3).
@c03rad0r
c03rad0r merged commit f2fd8ce into OpenTollGate:main Aug 30, 2026
felixfelix-bot added a commit to felixfelix-bot/tollgate-module-basic-go that referenced this pull request Sep 7, 2026
c03rad0r added a commit that referenced this pull request Sep 8, 2026
* docs(changelog): backfill [Unreleased] for v0.6.0

Add entries for PRs #331, #312, #299, #347, #361, #365, #366, #368,
#369, #370 under [Unreleased] (Added / Changed / Internal), matching
existing Keep-a-Changelog style. Ref #339.

* docs(changelog): backfill #359 and #353 entries

---------

Co-authored-by: Felix <301398501+felixfelix-bot@users.noreply.github.com>
Co-authored-by: c03rad0r <1100745+c03rad0r@users.noreply.github.com>
felixfelix-bot added a commit to felixfelix-bot/tollgate-module-basic-go that referenced this pull request Sep 20, 2026
… main) (OpenTollGate#353)

* fix(wgm): address c03rad0r change requests on OpenTollGate#199

1. Encoder: guard total body length against uint8 overflow
   (per-field checks existed but sum could exceed 255)
2. Parser: respect declared bodyLen instead of raw[2:]
   (was reading trailing bytes as TLVs)
3. Docs: update vendor_element_manager description
   (was referencing removed 'Bitcoin/Lightning info')

Addresses items 1, 2, 6 from c03rad0r's consolidated review.
Items 3 (OUI hardware validation), 4 (ubus health check),
5 (JSON via fmt.Sprintf), 7 (map ordering) are informational —
no code change needed for this PR's scope.

* fix(wgm): encoder overflow check before cast + round-trip tests (OpenTollGate#235)

Addresses c03rad0r's change requests:

1. Encoder: moved len(body) > 255 check BEFORE uint8 cast
   (was after, meaning truncation already happened)
2. Added 11 encoder/parser unit tests:
   - 5 encode→decode round-trip tests (minimal, flags, mint, pubkey, full)
   - TestEncodeRejectsOversizedBody (>255 bytes)
   - TestParseRejectsInvalidOUI (wrong OUI)
   - TestParseRejectsTooShort (<8 bytes)
   - TestParseRejectsWrongElementType (wrong elem type byte)
   - TestParseRespectsBodyLen (trailing garbage ignored)

All tests pass.

* fix(wgm): mark vendor-IE pipeline as staged; schema key not Required

- scanner.go: staging marker where NetworkInfo is built —
  IsTollGate/RawIEs/pricing stay zero here; the vendor-IE parse that
  fills them and the VendorIEDiscovery gate land in the wiring
  follow-up. Makes the intentional staging legible at the seam.
- config schema: vendor_ie_discovery Required true → false. A Required
  key with Default false rejects every existing config that predates
  the key; optional-with-default upgrades cleanly.

Review findings: cold review 2026-08-18 (majors 1-3 are the staged
wiring by design — deferred with this PR per merge order; minor 3).

---------

Co-authored-by: amperstand <atlas@oh-my-opencode.com>
felixfelix-bot added a commit to felixfelix-bot/tollgate-module-basic-go that referenced this pull request Sep 20, 2026
* docs(changelog): backfill [Unreleased] for v0.6.0

Add entries for PRs OpenTollGate#331, OpenTollGate#312, OpenTollGate#299, OpenTollGate#347, OpenTollGate#361, OpenTollGate#365, OpenTollGate#366, OpenTollGate#368,
OpenTollGate#369, OpenTollGate#370 under [Unreleased] (Added / Changed / Internal), matching
existing Keep-a-Changelog style. Ref OpenTollGate#339.

* docs(changelog): backfill OpenTollGate#359 and OpenTollGate#353 entries

---------

Co-authored-by: Felix <301398501+felixfelix-bot@users.noreply.github.com>
Co-authored-by: c03rad0r <1100745+c03rad0r@users.noreply.github.com>
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.

3 participants