Skip to content

Add Core 1 development credential path - #8

Open
devteapot wants to merge 1 commit into
mainfrom
feature/core1-dev-credentials
Open

Add Core 1 development credential path#8
devteapot wants to merge 1 commit into
mainfrom
feature/core1-dev-credentials

Conversation

@devteapot

Copy link
Copy Markdown
Owner

Summary

  • Add a dedicated userdebug Core 1 development product for credential-backed agent testing.
  • Implement the v1 credential protocol, stdin-only client, secure secret handling, and dedicated proxy tooling.
  • Add isolated Core-dev packages, SELinux domains, network boundaries, and no-Zygote product selection.
  • Add Rust, C++, TypeScript, host bridge, and contract tests for credential and agent-smoke flows.
  • Record the implementation and evidence in docs/progress.md.

Testing

  • Not run: repository test and build results were not provided.
  • Added protocol contract coverage, C++ client harness coverage, agent runner tests, and a33xctl host/patch-series tests.

- Add isolated userdebug credential client and protocol
- Package dedicated Core-dev agent, proxy, and SELinux policy
- Add contract tests and deterministic agent smoke support

@devteapot devteapot left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found several concrete host regressions and scope/evidence issues. The security boundary itself is thoughtfully isolated, but the new validation surface currently does not run cleanly on the repository’s macOS host, and the progress ledger needs to remain a concise index.

Comment thread tools/a33xctl
0005-s5e8825-select-no-zygote-for-sos-core1.patch
0006-s5e8825-allow-sos-core-tsp-enable.patch
0007-s5e8825-chown-tsp-enabled.patch
declare -A SOURCE_PATCH_STATES=()

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep a33xctl startup compatible with the supported macOS host

This top-level declare -A executes before command dispatch, but the macOS system Bash is 3.2 and has no associative arrays. I reproduced this with bash tests/a33xctl-host-test.sh: tools/a33xctl: line 870: declare: -A: invalid option. Because this declaration is global, even unrelated commands now abort at startup; the pre-existing associative array was local to a specific function and did not impose that failure on every command. Please use a Bash-3-compatible representation here, or add and enforce a newer-Bash bootstrap before any Bash-4-only syntax executes.

// state after fork. Failure aborts spawn instead of leaking descriptors.
unsafe {
command.pre_exec(|| {
let result = libc::syscall(libc::SYS_close_range, 3_u32, u32::MAX, CLOSE_RANGE_CLOEXEC);

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Gate the Linux-only syscall in host-test builds

core_child_fds is compiled under cfg(test) on non-Android hosts, but libc::SYS_close_range is not defined on macOS. On the repository’s macOS host, cargo test --locked -p core-agent-contract-test fails at this line before running any tests; the same module is also included in sos-experience library tests. Please cfg-gate the Linux/Android syscall path and use the existing fcntl fallback on other Unix hosts, or scope this contract package explicitly to Linux.

let output =
Path::new(&env::var_os("OUT_DIR").expect("OUT_DIR")).join("core-dev-credential-cpp-client");
let compiler = env::var_os("CXX").unwrap_or_else(|| "c++".into());
let status = Command::new(compiler)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Do not unconditionally build Android/Linux C++ with the host compiler

This package is now a workspace member, but its build script always compiles the production client with the local host C++ compiler. On macOS, cargo test --locked -p core-dev-credential-protocol-test fails because the included client uses Linux/Bionic-only memset_explicit and SOCK_CLOEXEC. That makes the newly added contract suite—and workspace-wide tests—unbuildable on the documented macOS host. Please gate the harness to supported targets or provide host shims that preserve the production behavior being tested.

Comment thread docs/progress.md
@@ -8997,3 +8997,2167 @@ SHA-256
run its separate one-sideload Core 1 no-Zygote readiness, exact Pi authority,
credential-clear, leak/crash/AVC, manifest, and soak gate. No Core hardware
claim is made here.

## 2026-08-18 — Harden Core Node startup and reduce credential transcription risk

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Keep the progress ledger concise instead of committing the full iteration transcript

This PR appends 2,164 lines and 25 same-milestone entries (r1 through the final E2E) for one feature. The repository agreement says docs/progress.md is the concise chronological index and directs focused milestone detail elsewhere. Please retain a compact final entry with the decisive failures, accepted artifact/evidence identities, remaining risk, and next gate, and move any necessary run-by-run narrative to a focused report. The current volume obscures the actual decision and accounts for over 20% of this already-large PR.

$(call inherit-product, $(SRC_TARGET_DIR)/product/core_no_zygote.mk)
else
$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk)
--

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Make the recorded diff-check evidence true for the submitted branch

git diff --check origin/main...origin/pr/8 currently fails on this trailing space, even though many of the added progress entries state that git diff --check passed. Please remove the whitespace and rerun the recorded check against the exact submitted commit so the evidence ledger matches the branch reviewers receive.

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