obs(07): native-plugin fail-closed, value/trace privacy test and final gate evidence

This commit is contained in:
cflmy committed 2026-11-22 16:12:47 +08:00
1 parent 2d51f08340
commit 1d3dca7c18
9 files changed
+189 -5

No files matched your search

+4 -2
View File
@@ -100,6 +100,8 @@ This section records work **after** the `v3.0.0-beta.1` tag. It is not part of
the tagged beta archive and no new release tag has been created. The design
input is RFC-OBS-0001 (issue `#1`), the frozen decision is ADR-0059 and the
normative contract is [`spec/execution-events-v1.md`](../spec/execution-events-v1.md).
Executed evidence for this section is
[`evidence/2026-11-22-execution-events-v1.md`](evidence/2026-11-22-execution-events-v1.md).
- **Implemented (P0/P1):** `run/call --event-stream jsonl` writes a pure NDJSON
`marqdo.execution-events` v1 stream; lifecycle/terminal events; byte-exact
@@ -122,8 +124,8 @@ Executed local gate on this tree (Linux x86_64, Rust 1.100.0):
```text
cargo fmt --all -- --check PASS
cargo clippy --workspace --all-targets -- -D warnings PASS
cargo test --workspace --locked PASS: 628 passed, 0 failed, 2 ignored
cargo test -p marqdo-cli --test execution_events PASS: 12 passed
cargo test --workspace --locked PASS: 630 passed, 0 failed, 2 ignored
cargo test -p marqdo-cli --test execution_events PASS: 14 passed
cargo test -p marqdo-host --test observation PASS: 8 passed
cargo test -p marqdo-runtime --test observation PASS: 4 passed
python3 tests/consumers/execution_events_consumer.py PASS on a live real-binary stream (schema, seq, terminal, byte_count)
+1 -1
View File
@@ -44,7 +44,7 @@ platform".
| Dimension | Current state | Source |
|---|---|---|
| Implemented | Rust workspace `3.0.0-beta.1`: RFC-LANG-0002 Markdown/frontend/IR, v2 statement parser, tree-walk runtime, `Memory`, capability host, Tool/Analysis/Trace, Plugin ABI, Foreign kernels, migrated bundled stdlib, CLI composition root; post-baseline Execution Events v1 observation (ADR-0059) | `Cargo.toml`, `crates/`, `stdlib/` |
| Tested locally | `cargo test --workspace --locked`: **628 passed, 0 failed, 2 ignored** on the post-baseline observability tree (Linux x86_64); `cargo fmt --check` and `clippy -D warnings` clean. Historical baseline: 599 passed before Execution Events v1, 507 at `9c1723d`. | `docs/STATUS.md` §0.5, `docs/evidence/2026-11-22-ext-implementation.md` |
| Tested locally | `cargo test --workspace --locked`: **630 passed, 0 failed, 2 ignored** on the post-baseline observability tree (Linux x86_64); `cargo fmt --check` and `clippy -D warnings` clean. Historical baseline: 599 passed before Execution Events v1, 507 at `9c1723d`. | `docs/STATUS.md` §0.5, `docs/evidence/2026-11-22-ext-implementation.md` |
| Bundled stdlib released | In-repo bundle `marqdo-stdlib@0.1.0`, SHA-256 digest verified before loading; it is **not** an external registry package | `stdlib/stdlib.json`, `stdlib/README.md` |
| Multi-platform verified | Linux local gate is the only executed lane here; Windows/macOS native lanes are **UNVERIFIED**, and the GitHub security lane remains a **VM-only** gate | `docs/STATUS.md` §1, §4 |
+3
View File
@@ -93,6 +93,9 @@ an untrusted Git URL does not make the code trustworthy.
silent fallback to `project`.
* The live lane is tested on Linux x86_64; macOS/Windows are unverified for
this option like the rest of the beta CLI.
* In-process native plugins are rejected in event mode
(`ext.event_stream_unsupported_native_plugin`) because they share the process
and can write the protocol fd directly; worker plugins remain usable.
* Observation lowers confidentiality when values are explicitly enabled. Text
needs a second opt-in; View/agents must not enable these flags by default.
@@ -0,0 +1,72 @@
# Execution Events v1 — local implementation evidence
- **Date:** 2026-11-22
- **Scope:** RFC-OBS-0001 P0 (OBS-00..03) and P1 (OBS-04..05); OBS-06/P2
memory metadata deliberately deferred.
- **Source SHA:** `2d51f0834090aa8a78f081dc176a0463bf53d51c` (post-beta tree;
the tagged beta is `2c7c4f31e7a388d3fcfa717a77067e696ed13854` and does **not**
contain this feature).
- **Normative contract:** [`spec/execution-events-v1.md`](../../spec/execution-events-v1.md),
schema `spec/schemas/execution-events-v1.schema.json`, decision
[ADR-0059](../adr/0059-runtime-observability-and-execution-events.md).
This file records commands actually executed on Linux x86_64 with Rust
1.100.0. It is local evidence, not a same-SHA CI or published-release claim.
## Static and test gate
```text
cargo fmt --all -- --check PASS
cargo clippy --workspace --all-targets -- -D warnings PASS
cargo test --workspace --locked PASS: 630 passed, 0 failed, 2 ignored
cargo test -p marqdo-cli --test execution_events PASS: 14 passed
cargo test -p marqdo-host --test observation PASS: 8 passed
cargo test -p marqdo-runtime --test observation PASS: 4 passed
cargo test -p marqdo-cli --test docs_consistency PASS
cargo test -p marqdo-cli --test architecture_boundaries PASS
```
The `execution_events` suite covers: pure JSONL envelope, contiguous `seq`,
terminal ordering, byte-exact base64 reconstruction (including invalid UTF-8
and multi-byte text), live `READY` delivery while the child is still running,
prepare/runtime terminals, exact value selection and text redaction, Trace v2
coexistence/shared run id, structural-budget truncation, output-budget
fail-closed, the checked-in JSON Schema fixtures, the structure fixture, and
broken-pipe failure (`observe.transport_failed`, non-zero exit), native-plugin
fail-closed, and observed values never entering Trace v2.
## Frozen-binary black-box consumer
A local release archive was built from the source SHA and the independent
Python consumer was run against the extracted binary's live stream:
```text
archive: dist/marqdo-3.0.0-beta.1-x86_64-unknown-linux-gnu.tar.gz
archive sha256: e000fc4afd7d68c3aaed3a28393f1f2301ee61e692c7d471b6f0b9cde1ff5994
extracted marqdo sha256 before: c45ba7fd81c171dd349ba2250b5af0434152cd9ffa39f37dfec31a435b2b730e
extracted marqdo sha256 after: c45ba7fd81c171dd349ba2250b5af0434152cd9ffa39f37dfec31a435b2b730e (unchanged)
run: marqdo run tests/consumers/fixtures/execution-events/basic.mq.md --event-stream jsonl
run exit: 0
consumer: execution events consumer: ok: 297 events, terminal=run.completed, stdout+stderr bytes=11
```
The stream began with `stream.opened` (`seq 0`), contained exactly one
`run.started`, emitted the two committed stdout chunks before the terminal
event, and ended with `run.completed` (`{"type":"int","decimal":"10"}`).
Concatenated chunk bytes were `START\nDONE\n`, equal to a normal run.
`tools/release/smoke.py --archive ... --skip-strict` on the same archive:
`smoke: PASS` (includes the new live-stream consumer step and `run --help`
protocol option check). The disposable-VM strict lane was not run because this
environment is not a disposable VM; in any case `--mode strict` explicitly
refuses `--event-stream` (structured `run.rejected`, no downgrade).
## Non-claims
- Not included in the `v3.0.0-beta.1` archive and no new release tag was
created.
- No macOS/Windows native verification for this option.
- No memory metadata/value of containers/handles, no debugger, stepping,
breakpoints, time travel, raw memory read or bidirectional debug protocol.
- No performance gate; observation is off by default and the disabled path does
not build observation events, but this file makes no percentage claim.