# DGR-035 evidence — dense architecture boundary input/output **Implemented:** 2026-08-01 **Authority:** `.scratch/distributed-gguf-runtime/prd.json` ## What changed - `DenseRangeBoundaryExecutor` is a strict execution-facing adapter for the certified `dense-llama` architecture. A head range accepts non-empty token IDs and owns the embedding callback. Middle/tail ranges reject token IDs and require the named `dense.residual.v1` `BoundaryBundle`. - Non-tail execution returns exactly the raw `hidden_states` residual from its local layer callback. Its constructor rejects a final-norm/output callback, preventing final normalization, logits projection, sampling, and tail-only row pruning before the tail. - Tail execution is the only path allowed to own final output and returns an explicit `TailOutput`: either validated logits or a sampled token. The existing wire `TypedTailResult` now serializes and validates both choices. - Unknown architectures, wrong boundary points, and tensor bundles other than one named `hidden_states` tensor fail closed. ## Changed files - `packages/node/meshnet_node/architecture_boundary.py` - `tests/test_dense_range_boundary.py` - `tests/test_architecture_boundary.py` - `.ralph-tui/progress.md` - `.scratch/distributed-gguf-runtime/evidence/DGR-035/README.md` ## Commands and results ```bash TESTPY=/home/popov/.hermes/hermes-agent/venv/bin/python PYTHONPATH=packages/node:packages/tracker "$TESTPY" -m pytest -q tests/test_dense_range_boundary.py tests/test_architecture_boundary.py tests/test_shard_engine.py tests/test_fake_shard_engine.py ``` ```text 37 passed in 0.22s ``` ```bash "$TESTPY" -m ruff check packages/node/meshnet_node/architecture_boundary.py tests/test_dense_range_boundary.py tests/test_architecture_boundary.py PYTHONPATH=packages/node "$TESTPY" -m compileall -q packages tests git diff --check python3 scripts/ralph_prd_schema.py validate .scratch/distributed-gguf-runtime/prd.json ``` ```text All checks passed! OK: 55 stories validated. ``` ## Limitations - This story adds and proves the project-owned boundary contract with deterministic, model-download-free tests. It does not claim real-model range parity; DGR-036 owns that numerical certification. - The llama.cpp graph remains fail-closed for partial owned ranges until DGR-037 binds its worker to this execution contract. No native source or patch-stack file was changed here, so native CMake/CTest and patch-cycle gates are not applicable to this Python contract change. - `.venv/bin/python3` has no `pytest` module in this worktree. The available project validation interpreter above ran the exact targeted tests. ## Dependency handoff - DGR-036 should use `DenseRangeBoundaryExecutor` with its real-engine bridge to compare whole-model and split residual/logits outputs, including prefill and decode. - DGR-037 must adapt the pinned llama.cpp dense graph to `embed_tokens`, `run_layers`, and tail-only `tail_output`; it must preserve `dense.residual.v1` unnormalized and avoid row pruning until the tail. - DGR-069 can propose only a generic residual-in/residual-out llama.cpp hook; architecture names and Meshnet wire/session semantics remain outside upstream.