Skip to content

docs: the Loom route table names a card, never its source - record the private-card design, its options and the open owner decision (engine#3385) - #3473

Merged
bong-water-water-bong merged 1 commit into
mainfrom
fix/3385-private-card-source
Nov 24, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
fix/3385-private-card-source

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Lands the design for engine#3385 as a new section, docs/loom-route.md "Card sources": where a private Loom card could come from, which builds may carry one, how the route table would name a source, and how a pin would be verified. Refs #3385, not Closes: the issue is a DESIGN/RFC request whose closure criterion is a maintainer-recorded decision in a Discussions RFC ("accepted with the chosen option implemented and documented, or declined with the reason in docs/loom-route.md"). That decision — which builds may carry a private card — is the owner's and is not in this PR. No private source is implemented, no pin is moved, no schema is added, and no test row changes.

Why the deliverable is a document

The issue says "design note only; no code until the orchestrator says", and CONTRIBUTING's RFC rule (CONTRIBUTING.md:51-70) makes "a change to how pins move" RFC-gated before code. So the honest state is: an owner decision with no code change now. The note is landed in the tree because docs/ is where this repo records a design that a reader will need after the issue queue moves on (docs/template-publishing.md carries a "Proposal:" section the same way), and because the issue itself names docs/loom-route.md as the place its outcome is written.

Two things the reading found that the note states as facts, because they change what a reviewer would otherwise assume:

  • A private card is servable today with zero engine change. serve resolves a card by name in the cards directory and checks no provenance (app/serve.cpp:1662-1688, :1708-1712), so the open question is which installer may install one and which build or image may carry it — not how serve loads it.
  • The two gates disagree about a route key today. app/loom_route.h:161 refuses any key it does not know (:164-171, held by tests/loom_route_test.cpp:89-91), so a card_source key added to the table makes serve refuse the whole table at startup — while tools/loom_cards.py --check passes it (measured below). Any option that names a source in the table has to change both in one commit.

The note

  • Today's mechanism, cited: a card arrives by loom-fetch from a published Hugging Face repo, or in the 1bit OS payload, whose staging pins every file's sha256 and size but downloads from a URL with no credential path (os/v3/puppy/stage-loom.sh:96-111, os/v3/puppy/loom-cards.pin:21-101).
  • Why a private card is not the published case: a card is .loom source that loom-serve compiles at load (a missing leaf registers failed, "no alternate source directory or precompiled artifact can satisfy a missing leaf" at the config/loom.config:61 pin), which is the opposite shape to our closed-source kernels shipping only as compiled code objects (docs/hrx.md:1794-1803). ZAYA1-8B (engine#3322) is measured-only on two independent grounds — private card and the gate's decode bar — so a private source removes the distribution blocker only.
  • Three build-placement options, each with where the pin lives, who can verify it and what a leak is: private builds only; a compiled card artifact (the only one that reaches a public-release user with the source private, and it needs a vendor path that does not exist at the pin); server-side only.
  • Three ways the table could name a source (no field / the proposed per-entry card_source / a source map), including the disclosure question the proposal raises: the tree already keeps private repositories out of the public pins file (tools/pin_watch.py:285-296, docs/model-pins.md:200-202).
  • How a pin is verified: commit + path already fixes content in git's object model (scripts/fetch-private.sh:52-56); the proposed tree_sha256 is a second identifier whose definition has to be written down, and the OS payload's per-file <sha256> <size> <path> form is the existing shape that names the file on a mismatch. What no pin proves is listed too (not review, not the weights, not build presence, and nothing to a user of a distributed build).
  • The code list if the owner says introduce it — the kKeys change in the same commit as the table key, the loader unchanged, the installer on fetch-private.sh's pin shape, the CI arm that refuses a route key the runtime refuses, the negative release/OS row (a public artifact does not carry the private card) that nothing asserts today, and the gate.
  • The open decision: which builds may carry a private Loom card — owner's, RFC-gated, three options above.

Control

A design note has no failing-before arm to add. The control is that the note's claims are the tree's state: every file the probes below read is untouched by this diff, so the outputs are the base tree's state as well.

$ git diff --stat
 docs/loom-route.md | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 153 insertions(+), 1 deletion(-)

$ git show origin/main:docs/loom-route.md | grep -c '^## Card sources'   # 0 (base)
$ grep -c '^## Card sources' docs/loom-route.md                          # 1 (branch)

$ git grep -n card_source origin/main -- . ':!third_party'               # no match, rc 1

The shipped table's key set — no entry names a source:

routes: 9
entry keys: ['args', 'card', 'device', 'gate', 'id', 'match', 'preset']
match keys: ['gguf_sha256', 'gguf_size', 'model']

The asymmetry: a copy of config/loom-routes.json with card_source added to entry 0 of 9, checked the way CI checks it — passes, while app/loom_route.h:161 would refuse the table at serve startup:

$ python3 tools/loom_cards.py --check --routes ~/.cache/scratch-3385/routes-with-card-source.json --pins models/pins.json
loom-cards check: 0 errors
$ python3 tools/loom_cards.py --check                    # the tool, unmodified
loom-cards check: 0 errors

Gate

pre-pr-checks: all 16 check(s) green, 2 skipped, 0 could not be told, 2 open-PR row(s) not run (--tree-only)

The same summary as the run on the branch before the change. The two skips are hip_f16_audit and kernel_id_selftest: no gpu-kernels tree here ($GPU_KERNELS_DIR unset). No ctest row was added or run: this PR changes no code.

Not verified

Everything the note records about a private card. No private card was fetched, no pin moved, no card_source implemented, and the hrx-loom 0.3.0 premise for a compiled-only card (which the issue records for 0.2.0) was read in the pinned tree, not measured. Whether strixhalo has the credentials a private-card gate row would need is not established here.

Refs #3385

…e private-card design, its options and the open owner decision (engine#3385)

Engine#3385 asks where a private Loom card could come from: cards from 1bit-MONSTER/loom-kernels, pinned by
sha, for the route table `1bit serve` reads. No route entry, parser, tool or config names a source kind today,
and the issue says "design note only; no code until the orchestrator says", so this lands the design as
`docs/loom-route.md` "Card sources". It changes no behaviour: no schema, no pin, no parser, no test row.

What the note records, each point cited in the tree:

- a card reaches the cards directory by `loom-fetch` from a published Hugging Face repo, or in the 1bit OS
  payload, which pins every file's sha256 and size but downloads from a URL with no credential path
  (os/v3/puppy/stage-loom.sh:96-111, os/v3/puppy/loom-cards.pin:21-101);
- serve resolves a card by name and checks no provenance (app/serve.cpp:1662-1688, :1708-1712), so a private
  card is servable today on a box that has it, and a missing card is a skip, never a failure;
- a card is `.loom` source that `loom-serve` compiles at load - the opposite of the policy for our closed-source
  kernels (docs/hrx.md:1794-1803) - so a package that carries one publishes it;
- the three build-placement options (private builds only / a compiled card artifact / server-side only) and,
  for each, where the pin lives, who can verify it and what a leak looks like;
- the three ways the table could name a source, with the two gates each needs: app/loom_route.h:161 refuses a
  route key it does not know (:164-171, held by tests/loom_route_test.cpp:89-91) while tools/loom_cards.py
  --check passes one (measured below), so a `card_source` key added today would stop serve and pass CI;
- `commit` + `path` is already the content pin in git's object model (scripts/fetch-private.sh:52-56); the
  proposed `tree_sha256` is a second identifier that has to be defined exactly, and the per-file
  `<sha256> <size> <path>` shape the OS payload already verifies is the existing form to reuse;
- the code list if the owner says introduce it, including the negative release/OS row - a public artifact does
  not carry the private card - that nothing asserts today.

The decision is the owner's and is RFC-gated: CONTRIBUTING.md:51-70 puts "a change to how pins move" in
Discussions, with a maintainer recording accept or decline in the thread. This section is the draft that RFC
would link; #3385 stays open.

Evidence
--------
Control. A design note has no failing-before arm to add, so the control is that its claims are the tree's state.
Every file the probes below read is untouched by this diff (`git diff --stat`: docs/loom-route.md only), so the
outputs are the base tree's state as well.

  $ git diff --stat
   docs/loom-route.md | 154 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
   1 file changed, 153 insertions(+), 1 deletion(-)

  $ git show origin/main:docs/loom-route.md | grep -c '^## Card sources'   # 0 (base)
  $ grep -c '^## Card sources' docs/loom-route.md                          # 1 (branch)

  $ git grep -n card_source origin/main -- . ':!third_party'               # no match, rc 1
  (nothing in the tree names a card source; the note's own paragraph says so and dates the measurement)

  $ python3 - <<'PY'                                                        # the shipped table's key set
  import json
  d=json.load(open('config/loom-routes.json')); keys=set(); m=set()
  for r in d['routes']: keys|=set(r); m|=set(r.get('match') or {})
  print('routes:', len(d['routes'])); print('entry keys:', sorted(keys)); print('match keys:', sorted(m))
  PY
  routes: 9
  entry keys: ['args', 'card', 'device', 'gate', 'id', 'match', 'preset']
  match keys: ['gguf_sha256', 'gguf_size', 'model']

  $ # a copy of config/loom-routes.json with "card_source" added to entry 0 of 9, checked the way CI checks it:
  $ python3 tools/loom_cards.py --check --routes ~/.cache/scratch-3385/routes-with-card-source.json --pins models/pins.json
  loom-cards check: 0 errors
  $ python3 tools/loom_cards.py --check                                     # the tool, unmodified
  loom-cards check: 0 errors

The first result is the asymmetry the note names: CI passes a route key that app/loom_route.h:161 refuses at
serve startup, which is why the note's code list changes both gates in one commit.

Gate: `scripts/pre-pr-checks.sh --tree-only --base origin/main` -> "all 16 check(s) green, 2 skipped, 0 could not
be told, 2 open-PR row(s) not run (--tree-only)" - the same summary as the run before the change. The two skips are
hip_f16_audit and kernel_id_selftest: no gpu-kernels tree here ($GPU_KERNELS_DIR unset). No ctest row was added or
run, because this PR changes no code.

Not verified: everything the note records about a private card. No private card was fetched, no pin moved, no
`card_source` implemented, and the hrx-loom 0.3.0 premise for a compiled-only card (which the issue records for
0.2.0) was read in the pinned tree, not measured.

Co-authored-by: bong-water-water-bong <[email protected]>
@bong-water-water-bong
bong-water-water-bong enabled auto-merge (squash) November 24, 2026 08:22
@bong-water-water-bong
bong-water-water-bong merged commit 648e9e0 into main Nov 24, 2026
10 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the fix/3385-private-card-source branch November 24, 2026 08:35
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

3385 - Partially compliant

Compliant requirements:

  • Design note only; no code until the orchestrator says
  • Record the design for a private card source in docs/loom-route.md
  • Document the options for where a private card could be carried
  • Document how the route table would name a source
  • Document how a pin would be verified
  • Record the open owner decision about which builds may carry private cards

Non-compliant requirements:

  • None

Requires further human verification:

  • The owner's decision on which builds may carry private cards (RFC-gated)
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Documentation Clarity

The documentation states that "a card reaches the cards directory by loom-fetch from a published Hugging Face repo, or in the 1bit OS payload" but does not clearly distinguish between the two methods in terms of how they are handled or verified. This could lead to confusion for readers trying to understand the difference between these two sources.

- `loom-fetch` on a published Hugging Face repo: every shipped entry's card is one (the table above),
  pinned at the card repository's revision.
- The 1bit OS payload: `os/v3/puppy/stage-loom.sh:96-111` downloads each file from
  `https://huggingface.co/<repo>/resolve/<rev>/<path>` and refuses one that is not its pinned sha256 and size
  (`os/v3/puppy/loom-cards.pin:21-101`); at boot `1bit-loom-cards` assembles it into `/data/loom-cards`, the
  `ONEBIT_LOOM_CARDS` 10lemonade exports (`os/v3/puppy/embed/etc/init.d/10lemonade:170-172`). The download has no
  credential path, so only public repositories are reachable through it.
Missing Implementation Details

The document describes a proposed card_source field but does not provide sufficient detail on how exactly this would be implemented in the codebase. Specifically, the changes needed in app/loom_route.h and tools/loom_cards.py are outlined but lack concrete examples or implementation steps that would be necessary for a developer to follow.

The proposed shape is a per-entry `card_source` (`kind`, `repo`, `path`, `commit`, `tree_sha256`) beside `card`.
Three shapes, ordered by how much of the source they put in the public tree:

1. **No field.** The installer owns provenance and the entry keeps naming a card, as today; a box whose table the
   public tree must not carry runs `--loom-routes FILE` (`app/serve.cpp:1624-1634`). Zero schema change, nothing about
   the private repository in the public tree, and the private table is checked by the same
   `tools/loom_cards.py --check --routes FILE` wherever it is run. Cost: the skip line cannot name the source that is
   missing, and the public check tools see a plain entry.
2. **`card_source` per entry**, as proposed. It puts the private repository's name and the pinned commit in a public
   file, which is a disclosure decision of its own: the tree already keeps private repositories out of the public pins
   file for that reason (`tools/pin_watch.py:285-296`, `docs/model-pins.md:200-202`). It also needs both gates
   changed in one commit: `app/loom_route.h:161` refuses a route key it does not know (`:164-171`, held by
   `tests/loom_route_test.cpp:89-91`), so a table carrying `card_source` makes serve refuse the whole table at startup
   while `tools/loom_cards.py --check` passes it today (measured 2026-11-24: a copy of `config/loom-routes.json` with
   `card_source` added answers `loom-cards check: 0 errors`).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant