Skip to content

SPEC-039 Phase-2 bridge + FR-PKV10 — revision (supersedes #889) (#887) - #894

Draft
Augustas11 wants to merge 2 commits into
mainfrom
fix/889-spec039p2
Draft

SPEC-039 Phase-2 bridge + FR-PKV10 — revision (supersedes #889) (#887)#894
Augustas11 wants to merge 2 commits into
mainfrom
fix/889-spec039p2

Conversation

@Augustas11

Copy link
Copy Markdown
Owner

SPEC-039 Phase-2 runtime bridge + FR-PKV10 (#887) — revision, supersedes #889

Revision of the SPEC-039 Phase-2 bridge after an independent 3-lane audit of the first cut (#889) found 1 CRITICAL + ~5 HIGH + ~4 MEDIUM (self-asserted provenance, unproven FR-CB6 parity overclaim, attach-path lifecycle bugs). This revision hardens the trust model (trusted-descriptor gate), reworks paged gather/remapping + lifecycle preflight + allocator health/rollback, and expands tests.

Safety posture: production never constructs a runtime observation → fail-closed → schedulerBackendAvailable/engineBridgeAvailable stay false → runtime-inert. Attach requires an observed-identity match against a trusted descriptor. Real FR-CB6 parity remains a >32GB-Mac enable-gate item.

Opened for CI + independent audit. Default-off / inert on merge.

SPEC-GOVERNANCE-DECLARATION-BEGIN
{
"schema_version": "spec-pr-governance-v1",
"behavior_change": "yes",
"contract_change": "none",
"specs": ["SPEC-039"],
"requirements": ["SPEC-039-R010"],
"authority_domains": ["paged-kv-attention"],
"arbitration": ["CODE_BUG"],
"tests": ["swift test --filter PagedKVRuntimeBridgeTests", "swift test --filter PagedKVEngineTests"],
"journeys": ["not-required"]
}
SPEC-GOVERNANCE-DECLARATION-END

Augustas11 and others added 2 commits August 4, 2026 16:39
Increment 1 + 2 of the deferred SPEC-039 runtime bridge:
- PagedKVRuntimeBridge: request-scoped attach gated on observed-identity match vs
  a trusted descriptor (admits() rejects empty/partial identity on all four fields);
  live FR-PKV10 contiguous KVCache extraction, reinjection, retain/reattach, and
  mid-block trim; shared [B,1] forward backend adapter.
- ModelRuntime: schedulerBackendAvailable/requestedTuple exposed ONLY when the
  bridge is genuinely attached; production observation stays nil -> inert.
- Bridge + parity tests.

Default-off / runtime-inert: production never measures an observation, so attach
never fires. Real enable proof deferred to a >32GB Mac per the enable gate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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.

1 participant