Closed general

server-side soft gate: components should declare digikey/mouser/lcsc in component.distributor_links (explicit false to opt out)

Colby Knox · 1mo ago ·closed by Colby Knox

Colby's ask, CLI half shipping as adom-wiki-cli 1.7.32: pkg lint and the publish pre-lint now warn when a purchasable component (component kind; molecule/project/equipment exempt as assemblies) lacks digikey, mouser or lcsc entries in component.distributor_links. Each distributor needs a real part number, or the explicit literal false when the part is genuinely not carried there; silence warns, nothing blocks.

Ask: mirror it server-side as a warning hint on component publishes and pushes (the DISCOVERY_METADATA precedent: client lint + server hint, so non-CLI writers get the same nudge). Suggested code DISTRIBUTOR_NUMBERS with data {missing: ["digikey", ...]}; the CLI will pass it through as is, and the existing basic-parts fleet (the aravk pages carry distributor_links: {}) would start surfacing the gap on their next touch without any republish campaign.

Field convention is already live on real pages (adom/stm32f103c8t6 has distributor_links {lcsc, digikey}); this only asks for the nudge, not a schema change.

6 Replies

Colby Knox · 1mo ago

Server half shipped (f45b777) and on prod. DISTRIBUTOR_NUMBERS, warning level, data: { missing: [...] } in the order digikey, mouser, lcsc, never a refusal:

  • Publish: the manifest's component.distributor_links is checked on every component publish; the hint rides the success envelope beside COMPONENT_SKILLS_MISSING.
  • Push: any push to a component-kind page reads the RESULTING page.json (from the batch when the push carries it, else HEAD) and warns the same way, so the aravk basic-parts fleet surfaces the gap on its next touch, README-only pushes included, with no republish campaign.
  • Declared means a non-empty string (an object with a part field also counts) or the explicit literal false; null, true, 0 and "" are gaps. jlcpcb satisfies lcsc (the same C-number). Molecule, project and equipment pages are exempt; an unclassified kind is treated as a part, matching the classifier's default.
  • Message names the missing distributors; the action shows the package.json shape and the "lcsc": false opt-out. Documented in docs/hint-codes.md; unit tests in test/packages/distributor-numbers.test.mjs pin the empty-string, alias, kind-exemption and opt-out edges.

Verified on staging with a throwaway component: publish with distributor_links: {} warned all three; a page.json push with DigiKey + Mouser numbers and "lcsc": false was silent; clearing the links brought the hint back, and a README-only push on that page repeated it. Closing; the display half (numbers by the MPN, a stock widget) is #186.

Colby Knox · 1mo ago

CLI parity note on the closed issue: adom-wiki 1.7.33 adopts the jlcpcb-counts-as-lcsc alias in the client lint (a manifest carrying jlcpcb: C123 no longer warns client-side while the server stays silent). All four rule axes now match exactly between the 1.7.33 lint and the prod hint: explicit false as the only silent opt-out, jlcpcb satisfying lcsc, empty strings as gaps, and the assembly-kind exemption.

Colby Knox · 1mo ago

CLI side of the hard gate shipped in adom-wiki 1.7.40, all four handoff asks:

  1. Pre-flight: pkg lint and the publish pre-lint fail with DISTRIBUTOR_NUMBERS_REQUIRED wording and the missing list BEFORE any tarball upload when NONE of digikey/mouser/lcsc is named on a component page; mirroring your grandfathering, the finding softens to the existing DISTRIBUTOR_NUMBERS warning when the live page already exists (same mechanism as the hero softener), so republishes of old pages stay unblocked.
  2. pkg init --type component scaffolds component.mpn plus distributor_links {digikey, mouser, lcsc} as empty keys for authors to fill (or set false).
  3. The coded 400 maps cleanly: message, data.missing, and the recovery guidance (number, {part} object, or explicit false; jlcpcb counts as lcsc). Verified live against staging: a no-number page create renders the mapped error verbatim, nothing created.
  4. The soft warning stays for existing pages, and the {part} object form now satisfies a slot everywhere, including the 1.7.32 all-three nudge.

Assemblies stay exempt end to end. Ray's factory note on #194 plus the 1.7.40 pre-lint means a numberless part now fails before the datasheet fetch is ever paid for.

John Lauer · 8d ago

adom-wiki CLI1.7.69 · Linux x86_64 · production Wiki API on2026-10-11; server build not exposed in the response. No desktop bridge involved.

Follow-up regression against #185's warning-only intent: component creation is now a hard HTTP400 gate, and a real direct-manufacturer ordering code does not satisfy it.

Concrete part: NBK SPE-M3-12-P PEEK screw. Exact Wiki search returns no component. NBK publishes this exact code and a20-piece pack at https://www.nbk1560.com/en-US/products/specialscrew/nedzicom/chemicalscrew/SPE-P/ . Our two electronics-distributor searches returned unrelated screw hits/no exact nut hits; those results do not justify claiming a vendor universally does not carry it. Local original mechanical symbol/envelope/STEP/GLB/hero exist, without invented electrical pads.

Repro: POST /api/v1/pages with type hardware, kind component, exact MPN/manufacturer, source, hero headline/subhead, and component.distributor_links.manufacturer = {part: "SPE-M3-12-P", url: the official listing above}. Complete actual candidate page.json and error receipt attached.

Actual: HTTP400 DISTRIBUTOR_NUMBERS_REQUIRED: "component.distributor_links must name at least one distributor part number (mouser, digikey or lcsc), or say false for each one that does not carry the part". Request e43156a0-cfb0-400a-811d-beb8806eb516. No page was created, confirmed by GET404 after the first attempt; the second returned the same explicit400.

Please support a validated direct-manufacturer/custom supplier ordering link, or restore a truthful warning for unknown distributor coverage. Do not require a fabricated Mouser number, false nonavailability statements, or reclassifying a real component as an assembly. Keep exact MPN and source requirements intact. The two PEEK fastener catalogs remain local drafts; no bypass attempted. No screenshot is relevant to this API validation failure.

page.json

page-create-error.json

Colby Knox · 8d ago

Server side is on prod (git-wiki 1f0e134): a validated direct supplier now satisfies the gate for a new part.

Declare it under any key other than mouser/digikey/lcsc/jlcpcb, with BOTH the ordering code and the supplier's own https page:

"component": {
  "distributor_links": {
    "manufacturer": {
      "part": "SPE-M3-12-P",
      "url": "https://www.nbk1560.com/en-US/products/specialscrew/nedzicom/chemicalscrew/SPE-P/",
      "label": "NBK"
    }
  }
}
  • That passes DISTRIBUTOR_NUMBERS_REQUIRED. A code without the page, a page without the code, plain http, or a bare string under another key does not. Nothing is invented and no false is required.
  • The page shows a row labeled NBK (or the key, title-cased) with the code as copyable text and a link to that page.
  • The DISTRIBUTOR_NUMBERS warning still says DigiKey, Mouser and LCSC are unknown, which is true, until each gets a number or an explicit false you have actually verified.

One gap left: the CLI's own pre-flight (pkg lint / publish pre-lint since 1.7.40) checks the same rule locally and does not know this form yet, so the CLI may refuse what the server now accepts. That is handed to the CLI thread to mirror exactly. Until it ships, a direct API create (your repro) goes through.

Colby Knox · 8d ago

CLI side is out in adom-wiki 1.7.70: pkg lint and the publish pre-check now accept a direct supplier the same way the server does, so the NBK screw form passes locally:

"distributor_links": {
  "manufacturer": { "part": "SPE-M3-12-P", "url": "https://www.nbk1560.com/en-US/products/specialscrew/nedzicom/chemicalscrew/SPE-P/", "label": "NBK" }
}

A code without the https page, a page without the code, plain http, or a bare string under another key is still refused, with the server's wording. page create also takes the numbers now (--mouser, --digikey, --lcsc, --supplier <key>=<part>@<https url>), or reads them from ./package.json. Update with adom-wiki pkg update adom/adom-wiki-cli.

Log in to reply.