feat(host): expose memcard controls and qualify process persistence
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
# Historical baseline investigation
|
||||
|
||||
These files record the diagnosis at revision `dcf6561ea73446e0a3e1cf1c73eda20923b38df0`, before the public memcard interface and exclusive backend locking were implemented. The probe intentionally tests the old behavior and is not a current conformance runner. Current qualification, commands, artifact fingerprints and limits are recorded in [the provider evidence summary](../summary.json).
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
root = Path.cwd()
|
||||
scratch = Path(tempfile.mkdtemp(prefix="runtime-memcard-review-"))
|
||||
source = scratch / "image_access.rs"
|
||||
source.write_text(r'''
|
||||
use prometeu_drivers::memcard::FileMemcard;
|
||||
use prometeu_hal::memcard::MemcardIoError;
|
||||
use prometeu_system::memcard::{image::IMAGE_BYTES, transaction::Card};
|
||||
|
||||
fn main() {
|
||||
let args: Vec<_> = std::env::args().collect();
|
||||
let path = std::path::Path::new(&args[1]);
|
||||
if args.get(2).is_some() {
|
||||
let second = FileMemcard::open(path, false)
|
||||
.map_err(|e| format!("{e:?}"))
|
||||
.and_then(|io| Card::mount(Box::new(io)).map_err(|e| format!("{e:?}")));
|
||||
match second {
|
||||
Ok(card) => {
|
||||
println!("second_process_rw_mount_accepted");
|
||||
drop(card);
|
||||
}
|
||||
Err(error) => println!("second_process_rw_mount_rejected:{error}"),
|
||||
}
|
||||
return;
|
||||
}
|
||||
let io = FileMemcard::create(path, IMAGE_BYTES, |io, id| {
|
||||
Card::format(io, id).map_err(|_| MemcardIoError::IoError)
|
||||
}).expect("create private probe image");
|
||||
let first_card = Card::mount(Box::new(io)).expect("first mount");
|
||||
let output = std::process::Command::new(std::env::current_exe().unwrap())
|
||||
.arg(path).arg("child").output().expect("child process");
|
||||
assert!(output.status.success());
|
||||
print!("{}", String::from_utf8(output.stdout).unwrap());
|
||||
drop(first_card);
|
||||
}
|
||||
''')
|
||||
binary = scratch / "image-access"
|
||||
command = ["rustc", "--edition=2024", str(source), "-o", str(binary),
|
||||
"-L", "dependency=" + str(root / "target/debug/deps")]
|
||||
for crate in ("prometeu_drivers", "prometeu_hal", "prometeu_system"):
|
||||
rlib = max((root / "target/debug/deps").glob("lib" + crate + "-*.rlib"),
|
||||
key=lambda p: p.stat().st_mtime_ns)
|
||||
command += ["--extern", crate + "=" + str(rlib)]
|
||||
subprocess.run(command, check=True, capture_output=True, text=True)
|
||||
access = subprocess.run([str(binary), str(scratch / "probe.pmc")],
|
||||
check=True, capture_output=True, text=True)
|
||||
|
||||
process = subprocess.Popen([str(root / "target/debug/prometeu"), "headless", "--stdio"],
|
||||
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, text=True)
|
||||
hello = json.loads(process.stdout.readline())
|
||||
def request(identity, command, params):
|
||||
process.stdin.write(json.dumps({"requestId": identity, "command": command, "params": params}) + "\n")
|
||||
process.stdin.flush()
|
||||
return json.loads(process.stdout.readline())
|
||||
required = request("probe-capability", "initialize", {
|
||||
"protocolVersion": {"major": 1, "minor": 0}, "requiredCapabilities": ["memcard"]})
|
||||
initialized = request("init", "initialize", {
|
||||
"protocolVersion": {"major": 1, "minor": 0}, "requiredCapabilities": []})
|
||||
invalid = request("probe-field", "boot", {"path": str(scratch), "memcard": {}})
|
||||
state = request("state", "get_state", {})
|
||||
shutdown = request("stop", "shutdown", {})
|
||||
process.stdin.close()
|
||||
process.wait(timeout=10)
|
||||
assert process.returncode == 0
|
||||
assert required["error"]["code"] == "unsupported_capability"
|
||||
assert invalid["error"]["code"] == "invalid_params"
|
||||
assert shutdown["result"] == {"closed": True}
|
||||
report = {
|
||||
"runtime_revision": subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip(),
|
||||
"scope": "read-only diagnosis using checkout debug binaries and isolated disposable image; no installed-process persistence qualification",
|
||||
"scratch_directory": str(scratch),
|
||||
"file_access_probe": {
|
||||
"backend": "FileMemcard + Card::mount on a valid freshly created image",
|
||||
"first_process_holds_rw_card": True,
|
||||
"second_process_result": access.stdout.strip(),
|
||||
"payload_writes": False,
|
||||
},
|
||||
"wire_probe": {
|
||||
"capabilities": hello["capabilities"],
|
||||
"required_capability_memcard": required["error"],
|
||||
"unknown_boot_field_memcard": invalid["error"],
|
||||
"get_state_fields": sorted(state["result"]),
|
||||
"shutdown": shutdown["result"],
|
||||
"note": "The memcard capability/field names are intentionally unsupported test input, not a proposed public contract.",
|
||||
},
|
||||
}
|
||||
report_path = scratch / "summary.json"
|
||||
report_path.write_text(json.dumps(report, indent=2) + "\n")
|
||||
print(json.dumps(report, indent=2))
|
||||
print("report_path=" + str(report_path))
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"runtime_revision": "dcf6561ea73446e0a3e1cf1c73eda20923b38df0",
|
||||
"scope": "read-only diagnosis using checkout debug binaries and isolated disposable image; no installed-process persistence qualification",
|
||||
"scratch_directory": "/var/folders/0t/tfsqc14j5wbgh9h4s4dytwb00000gq/T/runtime-memcard-review-qa13v648",
|
||||
"file_access_probe": {
|
||||
"backend": "FileMemcard + Card::mount on a valid freshly created image",
|
||||
"first_process_holds_rw_card": true,
|
||||
"second_process_result": "second_process_rw_mount_accepted",
|
||||
"payload_writes": false
|
||||
},
|
||||
"wire_probe": {
|
||||
"capabilities": [
|
||||
"boot",
|
||||
"reset",
|
||||
"set_input",
|
||||
"clear_input",
|
||||
"advance",
|
||||
"capture",
|
||||
"get_state",
|
||||
"get_fault",
|
||||
"cancel",
|
||||
"shutdown"
|
||||
],
|
||||
"required_capability_memcard": {
|
||||
"code": "unsupported_capability",
|
||||
"details": {},
|
||||
"message": "required capability unavailable"
|
||||
},
|
||||
"unknown_boot_field_memcard": {
|
||||
"code": "invalid_params",
|
||||
"details": {},
|
||||
"message": "unknown field `memcard`, expected `path`"
|
||||
},
|
||||
"get_state_fields": [
|
||||
"appId",
|
||||
"logicalFrameIndex",
|
||||
"pc",
|
||||
"stackTop",
|
||||
"status",
|
||||
"tickIndex"
|
||||
],
|
||||
"shutdown": {
|
||||
"closed": true
|
||||
},
|
||||
"note": "The memcard capability/field names are intentionally unsupported test input, not a proposed public contract."
|
||||
},
|
||||
"date": "2026-10-29",
|
||||
"platform": "macOS-27.0.1-arm64-arm-64bit-Mach-O",
|
||||
"studio_revision": "3a3417eb44c2e99ca183ce6f3fbbfff738b70f87",
|
||||
"reproduction": [
|
||||
"cargo test -p prometeu-cli --test automation_process -- --test-threads=1",
|
||||
"python3 discussion/workflow/agendas/AGD-0071-evidence/review_probe.py"
|
||||
],
|
||||
"automation_process_tests": {
|
||||
"passed": 12,
|
||||
"failed": 0,
|
||||
"ignored": 1,
|
||||
"ignored_test": "packaged_installation_smoke",
|
||||
"ignored_reason": "requires PROMETEU_PROTOCOL_TEST_INSTALL pointing to an extracted dist archive",
|
||||
"covers_memcard": false
|
||||
},
|
||||
"qualification_limits": [
|
||||
"No Studio Gradle/native memcard suite was rerun; its summary was inspected as existing evidence.",
|
||||
"No configured installed-runtime memcard persistence test was performed.",
|
||||
"Two simultaneous valid RW mounts were accepted; no concurrent payload publication was attempted.",
|
||||
"No product code, normative specs or Studio files were modified."
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user