Repository navigation
test: prove operator CLI public-key execution and replay denial across killed process restart - #76
Conversation
| status, data = _request(base + "/health") | ||
| if status == 200 and data["status"] == "healthy": | ||
| return process | ||
| except (OSError, ValueError): |
There was a problem hiding this comment.
Pull Request Overview
Two test assertions currently weaken the evidence this PR provides. The process restart should use an unconditional kill to demonstrate recovery after abrupt termination, and the audit-root check should validate that the exported root is present and valid rather than only comparing two values. The coverage report is empty, so it does not independently establish production-path coverage.
Test suggestions
- Start the actual CLI in a spawned process and wait for a healthy loopback HTTP service.
- Reject an unauthenticated submit request.
- Reject an authenticated request with a spoofed actor.
- Accept a valid signed permit and execute the configured echo tool.
- Preserve the audit root across forced termination and restart.
- Reject reuse of the original signed permit as a replay after restart.
- Verify that the service configuration contains only public issuer key material.
TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback
|
|
||
| def _terminate(process): | ||
| if process.is_alive(): | ||
| process.terminate() |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Replace the normal terminate() path used by this test with an unconditional hard kill (for example, process.kill()), so the ledger is reopened after an actual abrupt process death rather than a potentially graceful shutdown.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
| restarted = _launch(config_path, base) | ||
| try: | ||
| status, restored = _request(base + "/evidence", bearer=bearer) | ||
| assert status == 200 |
There was a problem hiding this comment.
🟡 MEDIUM RISK
Suggestion: Assert that the exported root hash is present and valid before terminating the service, rather than relying solely on equality after restart.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 21 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
Process-boundary acceptance proof for #69 / #63
Adds real subprocess isolation using Python multiprocessing spawn, invoking the actual
shards-kernel serve --configCLI parser in a fresh interpreter. The test issuer holds a freshly generated Ed25519 private key in the parent test interpreter; only public verification material enters the service config. The secret bearer is supplied via environment rather than committed source.Assertion sequence
/healthon fixed loopback, using validated operator config./submit→ HTTP 401.one-time.Requires Python 3.9–3.12 CI, all static/security checks, coverage and docs to pass.
Explicit limitations
The side effect is built-in
echo, not a non-idempotent external action. This does not establish distributed nonce transactions, secure remote agent credentials, independent protected issuer deployment, wallet safety, signed configuration or multi-node recovery. All relevant P0 issues remain open.