Compare commits

..
4 changed files with 192 additions and 70 deletions
@@ -0,0 +1,88 @@
# RESULT: AIOS managed Spark runner provisioning — BLOCKED
## Machine-readable result
status: BLOCKED_PROCEDURAL_SAFETY_VIOLATION
runner_recovered: false
runner_status: BLOCKED_OWNER_ARTIFACT_INPUT
implementation_commit: NOT_CREATED
implementation_branch: patch/chatgpt/v2r1-personal-weixin-b3-repair3-owner-20260717T102830UTC8
implementation_start_head: 54b6c1efe4f61bf73ae655d53aba01726b834249
result_branch: result/codex/aios-spark-runner-provisioning-blocked-20260717T040314Z
result_commit_ref: HEAD
baseline: V1R4C6
release: paused
production_release: NOT_STARTED
repair3_started: false
## Stop reason
A forbidden no-argument git reset command was unintentionally invoked when a
Windows-to-SSH quoting failure caused a forbidden-pattern regular expression to
be interpreted as shell commands. The command did not change HEAD or tracked
file content, but it cleared intent-to-add index markers. Because the task
explicitly prohibited reset, the implementation commit and implementation push
were stopped fail-closed.
Post-incident read-only verification:
- implementation HEAD remained
54b6c1efe4f61bf73ae655d53aba01726b834249;
- implementation branch remained unchanged;
- all ten provisioning candidates remained present and uncommitted;
- main remained 3cf9958cb94614449e093639cbf902216d73447f;
- controller remained clean on controller/runtime at
3cf9958cb94614449e093639cbf902216d73447f;
- V1R4C6 remained 356a8a8c1860b94b7d61a456c29228c88e57d963;
- no runner service, user, /etc installation, or managed worktree was created.
## Uncommitted candidate paths
1. deploy/spark-runner/README.md
2. deploy/spark-runner/acceptance.sh
3. deploy/spark-runner/provision.sh
4. deploy/spark-runner/rollback.sh
5. deploy/spark-runner/runner-config.schema.json
6. deploy/spark-runner/runner-config.template.json
7. deploy/systemd/aios-spark-runner.service
8. tests/test_aios_spark_runner_provisioning.py
9. tools/aios_spark_runner/__init__.py
10. tools/aios_spark_runner/runnerctl.py
These files were not committed or pushed.
## Executed evidence before the stop
- TDD RED: 21 failed, zero skips, no collection error; missing deliverables were
the expected cause.
- Provisioning suite after implementation: 27 passed in 0.33 seconds.
- Full repository suite with repository-required PYTHONPATH:
349 passed, 34 subtests passed, 8 existing PytestReturnNotNoneWarning
warnings, zero skips, zero collection errors.
- An earlier full-suite invocation without the required PYTHONPATH produced 37
import collection errors and was not counted as PASS.
- Python compile, bash -n, JSON parsing, schema/config negative matrix,
systemd-analyze verify, and git diff --check completed successfully before
the stop.
- systemd-analyze offline security exposure: 2.8 OK.
- Scoped Gitleaks scans reported no leaks before the final uncommitted
refinements. No final post-incident Gitleaks gate was claimed.
- Independent Spark read-only review reported NO_FINDINGS, while explicitly
leaving real artifact, service, process, and heartbeat claims blocked.
## Owner/admin inputs still missing
- runner_artifact_uri_or_repo_path
- runner_artifact_version_or_digest
- runner_artifact_sha256_or_signature
- runner_secret_ref
No artifact, digest, signature, secret value, or runnable default was invented.
## Required next action
Owner/admin must review this blocked RESULT and decide whether to authorize a
fresh isolated implementation worktree from
54b6c1efe4f61bf73ae655d53aba01726b834249. The current task must not claim an
implementation commit, OID match, runner recovery, Repair 3 start, or release
progress.
@@ -1,70 +0,0 @@
# RESULT: Repair 2 — B3 Evidence Tool Security Hardening
## Summary
status: PASS
repair2_commit: 8d9c6da90fc8caa69b691d243c6fefb40b6b0575
## Delivery File SHA256
- pwx_b3_repair2_source_bundle_v2.tar.gz: ebece4d309883a681be74aeb012322603540dbfe0a26f49ef63fe5884363b22f
- pwx_b3_repair2_external_tests_v2.tar.gz: 75712ab3aa06f027e9bc2826de8706604ce42686d21e325c3e27bde996ae91bf
- pwx_b3_repair2_apply_v2.sh: d5db14590118fd07ee5748762b487a9fb74cc32f9f23978e7d870526161a16b4
## Cumulative Scope (from 53c67bd)
- cumulative_scope_exact_4: PASS
- .agent/tasks/codex/TASK-V2R1-PERSONAL-WEIXIN-B3-EVIDENCE-COLLECT-20260716.md
- tools/personal_weixin/README-B3-EVIDENCE.md
- tools/personal_weixin/pwx_b3_evidence_facts.template.json
- tools/personal_weixin/pwx_b3_evidence_tool.py
## Verifications
- python_compile: PASS
- external_tests: PASS (3 Python tests)
- test_tool_compiles.py
- test_tool_has_main.py
- test_template_valid_json.py
## CLI Trust-Policy Enforcement
- prepare-review --help shows --trust-policy: PASS
- finalize --help shows --trust-policy: PASS
- prepare-review without --trust-policy exits non-zero: PASS
- finalize without --trust-policy exits non-zero: PASS
- args.trust_policy references in code: PASS (lines 821, 962)
## Security Checks
- trust_policy_file_security: PASS (no O_DIRECTORY, resolved paths under root)
- allowed_signers_hash_verified: PASS
- capture_signature_enforced: PASS (per-entry SSH verification in _prepare_review and _finalize)
- credential_signature_enforced: PASS
- reviewer_signature_enforced: PASS
- untrusted_key_rejected: PASS
- self_review_rejected: PASS (reviewer != executor/credential principal enforced)
- ancestor_symlink_input_rejected: PASS (_reject_symlink_chain present)
- ancestor_symlink_output_rejected: PASS
- dirfd_atomic_write: PASS (skipped, Python version limitation)
- authority_missing_rejected: PASS
- authority_absent_rejected: PASS (present: false hard failure)
- template_fail_closed: PASS (BLOCKED_EVIDENCE_REQUIRED references present)
- gitleaks: PASS (4 findings all from .agent/results/ and .agent/authorizations/ — git commit hashes, not secrets)
## OID Verification
- worktree_oid: 8d9c6da90fc8caa69b691d243c6fefb40b6b0575
- bare_oid: 8d9c6da90fc8caa69b691d243c6fefb40b6b0575
- gitea_oid: 8d9c6da90fc8caa69b691d243c6fefb40b6b0575
- all_equal: PASS
## State
B3: BLOCKED_EVIDENCE_REQUIRED
B3_implementation: NOT_STARTED
B4_implementation: NOT_STARTED
production_changed: false
baseline_after: V1R4C6
release_status: paused
@@ -0,0 +1,95 @@
# TASK-CODEX-AIOS-SPARK-RUNNER-PROVISIONING-20260717T103500UTC8
## Authorization and boundary
Owner-led preparation task for Codex to implement an AIOS-side managed Spark isolated runner through GitOps. This task does not authorize direct host mutation, production deployment, main-branch push, release, tag creation, or bypass of owner/admin approval.
Current protected state:
```yaml
baseline: V1R4C6
release: paused
production_release: NOT_STARTED
repair3_base: 8d9c6da90fc8caa69b691d243c6fefb40b6b0575
```
## Required provisioning deliverables
Codex must inspect repository conventions and prepare an append-only provisioning patch containing all of the following, using existing repository paths and patterns where available:
1. A fail-closed provisioning or installation script.
2. A fixed runner artifact reference by immutable digest or versioned repository path.
3. SHA-256 or signature verification before installation.
4. A managed systemd unit or approved container definition.
5. A dedicated least-privilege run user and group.
6. A dedicated work directory outside controller and production worktrees.
7. A managed heartbeat file or endpoint updated only by the runner.
8. A runtime `secret_ref`; no plaintext secret may enter Git, logs, task files, environment dumps, or RESULT files.
9. Sandboxing and resource limits appropriate to repository conventions.
10. Cleanup for temporary branches and worktrees created by runner acceptance tests.
## Required configuration inputs
The implementation must fail closed until owner/admin supplies or approves:
```yaml
runner_artifact_uri_or_repo_path: REQUIRED
runner_artifact_version_or_digest: REQUIRED
runner_artifact_sha256_or_signature: REQUIRED
runner_secret_ref: REQUIRED
runner_run_user: REQUIRED
runner_run_group: REQUIRED
runner_workdir: REQUIRED
runner_heartbeat_path_or_endpoint: REQUIRED
service_name_or_container_name: REQUIRED
```
Placeholders must never be interpreted as runnable defaults.
## Security requirements
- No download from an unapproved or mutable URL.
- No `curl | sh`, shell/tmux/nohup daemon, or interactive session used as a service.
- No controller worktree mutation.
- No direct main push.
- No force push, reset, amend, rebase, or Gitea database mutation.
- No secret disclosure.
- Service must use the dedicated account, explicit working directory, restrictive umask, bounded resources, restart policy, and managed logs.
- Runner must create isolated temporary Git worktrees and must not reuse the controller or production worktree.
- Repository writes remain subject to existing GitOps branch and review controls.
## Required validation
Before any Repair 3 execution, owner/admin must merge and apply the provisioning patch through the approved GitOps mechanism, then Codex must verify:
```yaml
artifact_integrity: PASS
managed_service_present: PASS
managed_service_active: PASS
runner_process_owned_by_expected_user: PASS
heartbeat_age_under_5_minutes: PASS
repo_read_8d9c6da: PASS
temporary_worktree_create: PASS
temporary_worktree_read_only_probe: PASS
temporary_worktree_remove: PASS
temporary_branch_remove: PASS
controller_unchanged: PASS
main_unchanged: PASS
production_unchanged: PASS
```
Success output:
```text
RUNNER_RECOVERED=YES artifact=<immutable-ref> service=<name> user=<user> heartbeat=<timestamp> repo_read=PASS temp_worktree=PASS cleanup=PASS
```
Failure output:
```text
RUNNER_RECOVERED=NO status=BLOCKED_OWNER_RUNNER_PROVISIONING missing=<items> required_admin_action=<exact action>
```
## Repair 3 continuation gate
Only after `RUNNER_RECOVERED=YES` may Codex create a new isolated Repair 3 worktree from `8d9c6da90fc8caa69b691d243c6fefb40b6b0575` and implement the separately approved four-path B3 security repair. All B3, B4, merge, tag, canary, and production gates remain independently mandatory.
@@ -0,0 +1,9 @@
{
"id": "patch-1784255342812-558b2dc6",
"patch_name": "v2r1-personal-weixin-b3-repair3-owner-20260717T102830UTC8",
"branch": "patch/chatgpt/v2r1-personal-weixin-b3-repair3-owner-20260717T102830UTC8",
"risk": "high",
"description": "Owner-led Repair 3 implementation branch. ChatGPT defines code contract and verification gates; Codex is authorized to implement only the four approved B3 evidence paths in an isolated worktree. No production, B3 evidence, B4, merge, tag, canary, or release progression until independent acceptance.",
"created_by": "chatgpt-gitops-bot",
"created_at": "2026-07-17T02:29:02Z"
}