接续上一轮,先做 L4-USER-M-PROCESS,完全接入仿真系统

结论:已将 L4-USER-M-PROCESS 的 millturn M128/M129 受控状态转换接入 virtual HAL、真实 browser simulation、OPFS 会话 payload、SDK API 和 release diagnostics validation;外部 user-M process execution 与 promotion 仍保持 locked,不伪装为 native process 解锁。
This commit is contained in:
2026-06-20 06:33:00 +08:00
parent 15b98c3ecf
commit d0e55ba11e
12 changed files with 676 additions and 7 deletions

View File

@@ -1732,6 +1732,12 @@ M2
<dd><span data-python-remap-runtime="mode">contract-only</span> | callable <span data-python-remap-runtime="callable">locked</span> | generator <span data-python-remap-runtime="generator">locked</span> | state <span data-python-remap-runtime="interpreter">locked</span></dd>
<dt>Python Promotion</dt>
<dd>execution <span data-python-remap-runtime="execution">disabled</span> | promotion <span data-python-remap-runtime="promotion">locked</span></dd>
<dt>User-M Process</dt>
<dd><span data-user-m-process="boundary">L4-USER-M-PROCESS</span> | <span data-user-m-process="path">axis/vismach/millturn/example.ngc</span> | <span data-user-m-process="phase">ready</span></dd>
<dt>Millturn Mode</dt>
<dd><span data-user-m-process="active-code">none</span> | remap <span data-user-m-process="active-remap">none</span> | mode <span data-user-m-process="active-mode">none</span> | switchkins <span data-user-m-process="switchkins">none</span></dd>
<dt>User-M Promotion</dt>
<dd>execution <span data-user-m-process="execution">disabled</span> | promotion <span data-user-m-process="promotion">locked</span></dd>
<dt>Limits/Home</dt>
<dd data-limits-home-summary>source unavailable | X home no limit off/off fault none</dd>
<dt>Overrides</dt>
@@ -1851,7 +1857,9 @@ M2
VIRTUAL_HAL_SIM_CONFIG_MACRO_LOAD_FIXTURES as SHARED_VIRTUAL_HAL_SIM_CONFIG_MACRO_LOAD_FIXTURES,
VIRTUAL_HAL_SIM_CONFIG_PROMOTION_CANDIDATES as SHARED_VIRTUAL_HAL_SIM_CONFIG_PROMOTION_CANDIDATES,
VIRTUAL_HAL_SIM_CONFIG_SOURCE_TARGETS as SHARED_VIRTUAL_HAL_SIM_CONFIG_SOURCE_TARGETS,
VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY as SHARED_VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY,
applyVirtualHalAction as applySharedVirtualHalAction,
applyVirtualHalMillturnUserMProcessState as applySharedVirtualHalMillturnUserMProcessState,
applyVirtualHalPinUpdates as applySharedVirtualHalPinUpdates,
cloneVirtualHalState as cloneSharedVirtualHalState,
createVirtualHalCommandScriptFixtureReport as createSharedVirtualHalCommandScriptFixtureReport,
@@ -1859,6 +1867,7 @@ M2
createVirtualHalIntegrityReport as createSharedVirtualHalIntegrityReport,
createVirtualHalLimitsHomeState as createSharedVirtualHalLimitsHomeState,
createVirtualHalMachineStatusState as createSharedVirtualHalMachineStatusState,
createVirtualHalMillturnUserMProcessBoundaryReport as createSharedVirtualHalMillturnUserMProcessBoundaryReport,
createVirtualHalMotionControllerMatrixReport as createSharedVirtualHalMotionControllerMatrixReport,
createVirtualHalPinRegistry as createSharedVirtualHalPinRegistry,
createVirtualHalSimConfigEvidenceExpansionReport as createSharedVirtualHalSimConfigEvidenceExpansionReport,
@@ -2036,7 +2045,22 @@ M2
const VIRTUAL_HAL_SIM_CONFIG_PROMOTION_CANDIDATES = SHARED_VIRTUAL_HAL_SIM_CONFIG_PROMOTION_CANDIDATES;
const VIRTUAL_HAL_SIM_CONFIG_EVIDENCE_EXPANSION_CANDIDATES = SHARED_VIRTUAL_HAL_SIM_CONFIG_EVIDENCE_EXPANSION_CANDIDATES;
const VIRTUAL_HAL_MOTION_MATRIX_MANIFEST_ENTRIES = SHARED_VIRTUAL_HAL_SIM_CONFIG_SOURCE_TARGETS.flatMap((target) => target.sourceFiles ?? []);
const VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY = SHARED_VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY;
let virtualHalState = createVirtualHalState();
let millturnUserMProcessState = {
apiName: "real-browser-simulation-millturn-user-m-process-state",
stateVersion: 1,
phase: "ready",
boundaryClass: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.boundaryClass,
path: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.path,
activeUserMCode: "none",
activeRemapCode: "none",
activeMode: "none",
switchkinsTarget: "none",
executionEnabled: false,
promotionAllowed: false,
processExecutionReady: false,
};
function setAllText(selector, value) {
document.querySelectorAll(selector).forEach((node) => {
@@ -2562,6 +2586,67 @@ M2
return createSharedVirtualHalSimulationReplacementReport(virtualHalState);
}
function createVirtualHalMillturnUserMProcessBoundaryReport() {
return createSharedVirtualHalMillturnUserMProcessBoundaryReport({
manifestEntries: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.sourceFiles,
});
}
function renderMillturnUserMProcessState(state = millturnUserMProcessState) {
const nextState = {
apiName: "real-browser-simulation-millturn-user-m-process-state",
stateVersion: 1,
phase: state.phase ?? "ready",
boundaryClass: state.boundaryClass ?? VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.boundaryClass,
path: state.path ?? VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.path,
activeUserMCode: state.activeUserMCode ?? "none",
activeRemapCode: state.activeRemapCode ?? "none",
activeMode: state.activeMode ?? "none",
switchkinsTarget: state.switchkinsTarget ?? "none",
executionEnabled: state.executionEnabled === true,
promotionAllowed: state.promotionAllowed === true,
processExecutionReady: state.processExecutionReady === true,
};
millturnUserMProcessState = nextState;
document.body.dataset.userMProcessPhase = nextState.phase;
document.body.dataset.userMProcessActiveCode = nextState.activeUserMCode;
document.body.dataset.userMProcessActiveMode = nextState.activeMode;
setAllText("[data-user-m-process=\"boundary\"]", nextState.boundaryClass);
setAllText("[data-user-m-process=\"path\"]", nextState.path);
setAllText("[data-user-m-process=\"phase\"]", nextState.phase);
setAllText("[data-user-m-process=\"active-code\"]", nextState.activeUserMCode);
setAllText("[data-user-m-process=\"active-remap\"]", nextState.activeRemapCode);
setAllText("[data-user-m-process=\"active-mode\"]", nextState.activeMode);
setAllText("[data-user-m-process=\"switchkins\"]", String(nextState.switchkinsTarget));
setAllText("[data-user-m-process=\"execution\"]", nextState.executionEnabled ? "enabled" : "disabled");
setAllText("[data-user-m-process=\"promotion\"]", nextState.promotionAllowed ? "allowed" : "locked");
return { ...nextState };
}
function applyMillturnUserMProcessState(codeOrOptions = "M128", options = {}) {
const result = applySharedVirtualHalMillturnUserMProcessState(virtualHalState, codeOrOptions, {
manifestEntries: VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.sourceFiles,
...options,
});
virtualHalState = result.state;
renderVirtualHalState();
renderMillturnUserMProcessState({
phase: "applied",
boundaryClass: result.boundaryClass,
path: result.path,
activeUserMCode: result.userMCode,
activeRemapCode: result.remapCode,
activeMode: result.stateMode,
switchkinsTarget: result.switchkinsTarget,
executionEnabled: result.executionEnabled,
promotionAllowed: result.promotionAllowed,
processExecutionReady: result.processExecutionReady,
});
pushStatusHistory("user-m-process", `${result.remapCode}->${result.userMCode} ${result.stateMode}`);
renderAxisStatusbar();
return result;
}
function createVirtualHalSourceComplianceReport() {
return createSharedVirtualHalSourceComplianceReport({ halState: virtualHalState });
}
@@ -2741,6 +2826,7 @@ M2
renderVirtualHalDro();
}
renderLimitsHomeState(createVirtualHalLimitsHomeState());
renderMillturnUserMProcessState();
const promotionCandidateReport = createVirtualHalSimConfigPromotionCandidateReport();
renderPromotionFamilyRows(promotionCandidateReport);
renderPromotionCandidateSummary(createVirtualHalPromotionCandidateSummary(promotionCandidateReport));
@@ -2793,6 +2879,8 @@ M2
virtualHal: cloneVirtualHalState(),
virtualHalSimulationReplacement: createVirtualHalSimulationReplacementReport(),
virtualHalSourceCompliance: createVirtualHalSourceComplianceReport(),
virtualHalMillturnUserMProcessBoundary: createVirtualHalMillturnUserMProcessBoundaryReport(),
virtualHalMillturnUserMProcessState: renderMillturnUserMProcessState(),
virtualHalSimConfigSourceCoverage: createVirtualHalSimConfigSourceCoverageReport(),
virtualHalSimConfigPromotionCandidates: createVirtualHalSimConfigPromotionCandidateReport(),
virtualHalSimConfigEvidenceExpansion: createVirtualHalSimConfigEvidenceExpansionReport(),
@@ -2833,6 +2921,7 @@ M2
virtualHal: virtualHal.state,
virtualHalSimulationReplacement: virtualHal.diagnostics,
virtualHalSourceCompliance: virtualHal.sourceCompliance,
virtualHalMillturnUserMProcessBoundary: virtualHal.millturnUserMProcessBoundary,
virtualHalSimConfigSourceCoverage: virtualHal.simConfigSourceCoverage,
virtualHalSimConfigPromotionCandidates: virtualHal.simConfigPromotionCandidates,
virtualHalSimConfigEvidenceExpansion: virtualHal.simConfigEvidenceExpansion,
@@ -3773,6 +3862,7 @@ M2
...VIRTUAL_HAL_SIM_CONFIG_PROMOTION_CANDIDATES.flatMap((candidate) => candidate.sourceFiles ?? []),
...VIRTUAL_HAL_SIM_CONFIG_EVIDENCE_EXPANSION_CANDIDATES.flatMap((candidate) => candidate.sourceFiles ?? []),
...VIRTUAL_HAL_SIM_CONFIG_MACRO_LOAD_FIXTURES.flatMap((fixture) => fixture.sourceFiles ?? []),
...VIRTUAL_HAL_MILLTURN_USER_M_PROCESS_BOUNDARY.sourceFiles,
],
});
const payload = createMachineSessionSnapshotPayload(session.machineId, {
@@ -4236,6 +4326,9 @@ M2
stepVirtualHalMotionController: (options = {}) => stepVirtualHalMotionController(options),
getVirtualHalSimulationRuntimeReport: () => createVirtualHalSimulationRuntimeReport(),
getVirtualHalSimulationReplacementReport: () => createVirtualHalSimulationReplacementReport(),
getVirtualHalMillturnUserMProcessBoundaryReport: () => createVirtualHalMillturnUserMProcessBoundaryReport(),
getMillturnUserMProcessState: () => renderMillturnUserMProcessState(),
applyMillturnUserMProcessState: (codeOrOptions = "M128", options = {}) => applyMillturnUserMProcessState(codeOrOptions, options),
getVirtualHalSourceComplianceReport: () => createVirtualHalSourceComplianceReport(),
getVirtualHalSimConfigSourceCoverageReport: () => createVirtualHalSimConfigSourceCoverageReport(),
getVirtualHalSimConfigPromotionCandidateReport: () => createVirtualHalSimConfigPromotionCandidateReport(),