research: rebuild RBC 1.3 DOMAIN_CALL as evidence-gated native organ ABI - #39
research: rebuild RBC 1.3 DOMAIN_CALL as evidence-gated native organ ABI#39xingxuling wants to merge 83 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Phase 1/2 evidence updateThe source-only salvage layer has now been locally exercised against the user-uploaded RCL v0.94 source snapshot. Before treating that run as relevant, the three runtime dependencies were Git-blob checked against current
Focused salvage result: 7/7 PASS, 0 fail. A second module, GitHub-hosted PR workflows again failed before executing job steps (job has no step records), matching the existing account/runner infrastructure blocker; this is not recorded as a code-test failure. Machine-readable boundary/evidence: Current verdict remains CANDIDATE. No opcode/compiler/native VM/version/authority claim is promoted by this update. |
Goal
Rebuild the useful part of the stale
agent/advanced-runtime-rclRBC 1.3 /DOMAIN_CALLexperiment on top of currentmain, without merging the stale branch, copying its binaries, hard-wiring all 18 old builtins into the canonical VM, or laundering experimental execution into a native claim.Progresses #38. This PR remains deliberately Draft / CANDIDATE.
Architectural decision
The stale branch's 18-builtin VM table is rejected as the target architecture. The replacement is an external, evidence-gated Domain Organ model:
historical semantic candidate→
operation-scoped differential→
native-candidate organ→
RBC 1.3 opcode 45→
Domain Value ABI→
external C organ→
candidate VM materialized from current native/rclvm.c→
native-process differential + semantic-root replay→
native-verified organ→ separate canonical admission decision
Four admitted operations
Only four historical operations have reconstructable reference semantics and are allowed out of quarantine in this slice:
core.echoquantity.makequantitative.measureknowledge.claimThe other 14 historical native-only operations remain quarantined.
Implemented in this PR
Candidate RBC 1.3
src/rbc13-domain-bytecode-candidate.mjsmaterializes experimental RBC1.3/ opcode45in literal and dynamic dispatch modes. Candidate arguments support Number, Truth, Text, recursive Sequence and{ $state: "path" }references.Canonical
src/bytecode.mjsremains unchanged and does not emit opcode 45.Evidence-tiered Domain Organ model
src/domain-operation-organ.mjsdefines the non-compensatory lifecycle:quarantined → differential-verified → native-candidate → native-verifiedRegistration, implementation, native verification and canonical admission are separate gates.
Stable native value membrane
native/rcl_domain_value.h/.cdefines an owned, bounded ABI for Null / finite Number / Truth / Text / Sequence / typed Record. It includes deep clone/free, recursive validation, duplicate-field rejection and bounded recursion/items/text.native/rcl_domain_vm_value_bridge.incconverts the admitted current VMValuesubset to/from Domain Values without exposing the private VM heap layout to external organs.External native organ registry
native/rcl_domain_organ.h/.cprovides a bounded registry with owned identity strings and minimum evidence-tier checks before invocation.Its error channel is now structured (
code+message) rather than a single opaque string.Semantic error preservation
The candidate VM owns dynamically supplied error codes and forwards Domain Organ semantic failures directly instead of wrapping every failure in
RCL_NATIVE_DOMAIN_ORGAN_FAILURE.The first four C candidates align tested current-JS failure identity, including:
TypeError;RCL_MEASUREMENT_TYPE;RCL_UNCERTAINTY_TYPE;RCL_CONFIDENCE_RANGE;RCL_KNOWLEDGE_TYPE;RCL_KNOWLEDGE_CONFIDENCE_RANGE.RCL errors retain the same code-prefixed message form as the current
RCLErrorhierarchy. Native differential adapters reconstruct the same semanticdetailsobject from operation inputs so error observations can actually match, not merely share a headline code.Current-source candidate VM materialization
scripts/materialize-rbc13-domain-vm-candidate.mjstransforms the checked-outnative/rclvm.cat test/runtime-materialization time. It adds experimental RBC 1.3/opcode45 support, the Domain Organ registry, structured error forwarding and the VM↔Domain Value membrane while preserving RBC 1.1/1.2 compatibility.The checked-in canonical
native/rclvm.cis not modified.scripts/materialize-rbc13-domain-vm-public-api.mjsadditionally exposes a candidate host ABI throughnative/rcl_domain_vm_candidate.h:rclvm_instance_register_domain_organrclvm_instance_set_domain_minimum_tierrclvm_instance_domain_organ_countrclvm_instance_domain_minimum_tierThe candidate VM defaults to requiring
native-verified; experimental hosts must explicitly lower that gate to execute anative-candidate.Four external C candidates
native/rcl_domain_admitted_organs.cimplements:core.echoquantity.makequantitative.measureknowledge.claimThey remain candidate implementations until promotion evidence exists.
Operation-scoped semantic differentials
src/rbc13-domain-operation-differential.mjsgives every admitted operation its own current/reference cases, deterministic replay and mutation control instead of issuing one aggregate certificate to all four operations.src/rbc13-domain-organ-candidate-plan.mjsbinds a passed operation differential to its named C candidate while keeping artifact binding and native promotion pending.Separate Domain Organ Native Promotion protocol
The existing canonical
native-capability-promotion.mjsis intentionally left unchanged because it assumes canonical RCL source → canonical RBC.Experimental opcode45 uses a parallel strict gate:
src/rbc13-domain-native-runtime.mjssrc/rbc13-domain-native-promotion.mjsscripts/run-rbc13-domain-native-promotion.mjstests/rbc13-domain-native-promotion.test.mjsdocs/RBC13_DOMAIN_NATIVE_PROMOTION_PROTOCOL_v0.1.mdPer operation, promotion requires:
native/rclvm.c;rcl.semantic-state-root.v1verification on every successful native case;Only if every check passes may
rcl.domain-organ-native-promotion-report.v0.1saynative-verified. Canonical admission remains false after that.Local evidence already obtained
Against the uploaded RCL native snapshot, the candidate architecture has executed:
core.echo;quantity.makepositive and invalid-type controls;Quantity → Measurement → Knowledgechain.The full chain used 51 RBC instructions, allocated/registered seven typed objects, and produced candidate native state that is semantically identical to independently constructed current
quantity(),measurement()andknowledgeClaim()objects after native heap metadata removal.Both canonicalize to semantic root:
736b336eecb96c4fb3a02eaa7d4b9d6e07fd126d65de31d541cf47444bc33509The uploaded native snapshot predates PR #29 native state-root emission, so this local evidence does not upgrade any operation to
native-verified.Exact-current-source gate
Checked-in tests materialize from the repository's actual current
native/rclvm.cand require VM-emitted semantic-root parity plus exact positive/negative semantic identity.The GitHub hosted workflows currently create jobs but fail before any job step executes (
steps: null). Therefore the exact-current-source promotion suite is implemented / execution receipt pending, not passed and not failed semantically.Explicit non-claims
This PR does not:
src/bytecode.mjs;native/rclvm.cornative/rclvm.h;VERSION-CONTRACT.jsonor component versions.Required disposition before merge/canonicalization
Run the operation-scoped differentials and full Domain Organ Native Promotion suite on an execution environment that actually starts the jobs. Review the resulting four operation reports independently. Only verified operations may be represented as
native-verified, and even then RBC 1.3/opcode45 canonical admission requires a separate PR/governance decision.Current disposition
CANDIDATE / DRAFT / NATIVE PROMOTION EXECUTION RECEIPT PENDING.