feat: emit native DGR-003 shard identity
This commit is contained in:
@@ -138,3 +138,49 @@ schema versions, and owned range. At `SessionOpen`, compare its
|
||||
A digest match is not certification. Only tracker-recorded evidence from the
|
||||
same exact fingerprint and a real complete distributed forward can move that
|
||||
recipe out of dark status.
|
||||
|
||||
## Native emission closure — 2026-07-14
|
||||
|
||||
Status: **done**. DGR-004/DGR-005's native loaded-artifact seam now reaches the
|
||||
production capability-report path through `NativeWorkerBackendAdapter`.
|
||||
|
||||
### Files changed
|
||||
|
||||
- `packages/node/meshnet_node/native_backend.py` — immutable loaded-GGUF report,
|
||||
immutable artifact and numerical pins, exact identity derivation, and the
|
||||
SessionOpen boundary.
|
||||
- `packages/node/meshnet_node/doctor.py` — includes exact identity only for the
|
||||
native adapter and derives all matching capability-proof fields from it.
|
||||
- `tests/test_native_identity_emission.py` — deterministic native report,
|
||||
immutable-pin, SessionOpen, capability emission, legacy-dark, and
|
||||
tracker-uncertified tests.
|
||||
- This issue, `prd.json`, and this evidence directory.
|
||||
|
||||
### Correctness and trust boundary
|
||||
|
||||
The native report carries the end-exclusive owned range, mapped/resident/
|
||||
registered bytes, GGUF architecture metadata digest, and layer count. The
|
||||
adapter constructs `ShardIdentity` only from that report plus immutable artifact
|
||||
pin, tokenizer revision, and numerical recipe inputs. It does not accept a
|
||||
caller-supplied shard range.
|
||||
|
||||
`on_session_open()` calls `check_session_open()` before returning
|
||||
`SessionAccepted`, preserving fingerprint, schema, range, tracker-session, and
|
||||
epoch fail-closed behavior. The legacy Transformers backend is deliberately not
|
||||
an adapter and its doctor report remains identity-free.
|
||||
|
||||
The tracker evaluates a self-consistent native report as `uncertified`: digest
|
||||
equality is canonical consistency, not node authenticity. Only its owned
|
||||
certification ledger can promote a real distributed forward.
|
||||
|
||||
### Verification
|
||||
|
||||
- Focused/adversarial DGR-003, node/tracker capability, doctor, and native
|
||||
dependency suites: **171 passed, 1 skipped**.
|
||||
- Native protocol CMake configure/build plus CTest: **1/1 passed**.
|
||||
- `compileall`, Ruff, and `git diff --check`: pass.
|
||||
- Full deterministic suite: **902 passed, 13 skipped** (255.01s).
|
||||
|
||||
No model payload, GPU, external API, network node, or real distributed forward
|
||||
was run or claimed. The standalone gRPC process remains DGR-008 work; this
|
||||
story supplies its exact native identity and fail-closed SessionOpen contract.
|
||||
|
||||
@@ -1,5 +1,26 @@
|
||||
# DGR-003 final verification — 2026-07-14
|
||||
|
||||
# Native emission closure — 2026-07-14
|
||||
PYTHONPATH=packages/node:packages/tracker:packages/contracts /run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/python -m pytest -q tests/test_native_identity_emission.py tests/test_runtime_recipe_identity.py tests/test_node_capability.py tests/test_tracker_capability_admission.py tests/test_node_doctor.py tests/test_llama_cpp_dependency.py
|
||||
# result: 171 passed, 1 skipped in 7.07s
|
||||
|
||||
ruff check packages/node/meshnet_node/native_backend.py packages/node/meshnet_node/doctor.py tests/test_native_identity_emission.py
|
||||
# result: All checks passed
|
||||
|
||||
git diff --check
|
||||
# result: pass
|
||||
|
||||
/run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/python -m compileall packages tests
|
||||
# result: pass
|
||||
|
||||
/run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/cmake -S packages/node/native -B build/dgr-003-native-protocol -DCMAKE_PREFIX_PATH=/tmp/pbsrc/install
|
||||
/run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/cmake --build build/dgr-003-native-protocol -j2
|
||||
/run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/ctest --test-dir build/dgr-003-native-protocol --output-on-failure
|
||||
# result: configured and built shard_protocol_conformance; 1/1 CTest passed
|
||||
|
||||
/run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/python -m pytest -q
|
||||
# result: 902 passed, 13 skipped in 255.01s
|
||||
|
||||
PYTHONPATH=packages/node:packages/tracker:packages/contracts /run/media/popov/d/DEV/repos/d-popov.com/AI/.venv/bin/python -m pytest -q tests/test_runtime_recipe_identity.py tests/test_node_capability.py tests/test_tracker_capability_admission.py
|
||||
# result: 99 passed in 4.76s
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# 03 — Define exact Artifact and runtime recipe identity
|
||||
|
||||
Status: ready-for-agent
|
||||
Status: done
|
||||
|
||||
## Mandatory fresh-session context
|
||||
|
||||
@@ -23,7 +23,7 @@ As the Tracker, I need exact compatibility identity so that only numerically and
|
||||
|
||||
- [x] Separate weight quantization, activation dtype, compute dtype, KV dtype/layout, tokenizer revision, architecture adapter, backend, and runtime version.
|
||||
- [x] Bind derivative or split artifacts to an exact source Model Artifact hash and Shard range.
|
||||
- [ ] Produce a stable compatibility fingerprint used by live capability emission/admission and the gRPC handshake. The tracker parses, re-derives, admits, partitions, and certifies supplied exact identities, but the current production doctor/backend path does not yet derive one from authoritative loaded-artifact/runtime state. It must stay dark rather than be claimed complete.
|
||||
- [x] Produce a stable compatibility fingerprint used by live capability emission/admission and the gRPC handshake. The native backend adapter derives it only from its immutable loaded-artifact report and immutable artifact/runtime pins; the legacy Transformers doctor path remains identity-free.
|
||||
- [x] Fail closed on mismatched artifact, tokenizer, architecture, range, boundary schema, activation recipe, or cache layout.
|
||||
- [x] Keep unsupported recipes registered-but-dark until a real distributed forward certifies them.
|
||||
- [x] Targeted pytest tests pass
|
||||
@@ -35,7 +35,7 @@ As the Tracker, I need exact compatibility identity so that only numerically and
|
||||
- [x] Read and verify every dependency evidence README before relying on dependency behavior
|
||||
- [x] Preserve all pre-existing working-tree changes and stage only files belonging to this story
|
||||
- [x] Write .scratch/distributed-gguf-runtime/evidence/DGR-003/README.md with files changed, exact commands and real results, limitations, compatibility notes, and dependent-story handoff
|
||||
- [ ] Update only this story issue to Status: done after every acceptance criterion and quality gate passes
|
||||
- [x] Update only this story issue to Status: done after every acceptance criterion and quality gate passes
|
||||
|
||||
## Dependency handoff
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@
|
||||
"Update only this story issue to Status: done after every acceptance criterion and quality gate passes"
|
||||
],
|
||||
"priority": 4,
|
||||
"passes": false,
|
||||
"notes": "Delayed-review repair: tracker-side exact identity contract is covered by deterministic tests, but live doctor/backend capability emission has no authoritative ShardIdentity construction yet. DGR-003 remains incomplete and exact recipes stay dark; see .scratch/distributed-gguf-runtime/issues/03-define-exact-artifact-and-runtime-recipe-identity.md.",
|
||||
"passes": true,
|
||||
"notes": "DGR-003-emission: native loaded-artifact adapter derives exact identity from immutable GGUF/runtime inputs, doctor emits it only for that adapter, and SessionOpen fails closed before acceptance. Exact identities remain tracker-uncertified and dark until a real distributed forward is certified.",
|
||||
"dependsOn": [
|
||||
"DGR-002",
|
||||
"DGR-017"
|
||||
|
||||
Reference in New Issue
Block a user