Skip to content

chore(qa): pre-upstream cleanup + sign-off matrix (COW-1063)#26

Open
brunota20 wants to merge 3 commits into
feat/ethflow-watcher-host-trait-bleu-855from
qa/cleanup-cow-1063
Open

chore(qa): pre-upstream cleanup + sign-off matrix (COW-1063)#26
brunota20 wants to merge 3 commits into
feat/ethflow-watcher-host-trait-bleu-855from
qa/cleanup-cow-1063

Conversation

@brunota20

Copy link
Copy Markdown
Collaborator

What does this PR do?

Pre-upstream QA pass on the M2 + M3 stack (PRs #2-#25). Lands two mechanical fixes plus a sign-off matrix capturing what is ready, what is deferred, and two architectural findings that need mfw78's call before the consolidated upstream PR.

Why

We have 25 stacked PRs in the fork, none merged yet. Before upstream review, a structured sweep catches issues mfw78 would otherwise spend time pointing out, and surfaces architectural decisions (doc vs code drift, missing ADRs) that benefit from explicit triage.

Changes

  1. `cargo fmt --all` sweep. Bulk of churn is in M1 `supervisor/tests.rs` (pre-existing drift). M2/M3 leaf modules picked up minor reformats. No semantic changes.
  2. Em-dash fix in `modules/examples/price-alert/src/strategy.rs:4` (one slipped past the rust-idiomatic pass). Three em-dashes remain in `wit/**.wit` files (mfw78's M1 prose) - intentionally left.
  3. `docs/qa-signoff-cow-1063.md` - the sign-off matrix with the full mechanical-check table, per-PR shape audit, and two architectural findings.

Architectural findings (need mfw78's call)

  1. `docs/05-sdk-design.md` describes a 2-layer SDK (`nexum-sdk` + `shepherd-sdk`) with proc macros, alloy Provider, Signer, typed local-store helpers. M3 actually shipped only the thinner Host-trait + helpers + MockHost surface. Doc is currently aspirational; code is M3-scoped. They need to agree before upstream review. Two paths: (a) trim doc to M3 scope, (b) treat doc as M5 north-star and implement remaining layers in M4/M5.

  2. No ADR captures the M3 Host trait surface (the `ChainHost` / `LocalStoreHost` / `CowApiHost` / `LoggingHost` + supertrait `Host` design, and the strategy.rs / lib.rs adapter recipe). Worth one short ADR (0009 candidate) before upstream review.

Breaking changes

None.

Testing

  • `cargo fmt --all --check` clean.
  • `cargo clippy --all-targets --workspace -- -D warnings` clean.
  • `cargo test --workspace` -> 145 host tests + 1 doctest passing.
  • `cargo build --target wasm32-wasip2 --release -p ` clean for all 5 modules.
  • 0 em-dashes in `crates/` + `modules/` + `docs/`.

Numbers

Module WASM size
twap-monitor 313,926 B
ethflow-watcher 281,518 B
stop-loss 311,290 B
price-alert 215,080 B
balance-tracker 101,518 B

Outstanding / deferred

  • COW-1029 (BLEU-853): `#[non_exhaustive]` batch on SDK public enums - held until just before upstream cut.
  • WIT-file em-dashes (3 occurrences) - ask mfw78 in upstream review.
  • balance-tracker host-trait refactor for shape consistency - optional follow-up.

AI assistance disclosure

AI Assistance: this QA pass was run by a Claude Code agent (Claude Opus 4.7 1M context), including writing the sign-off matrix and this description. A human (Bruno) is accountable for the result and has reviewed it.

Linear: COW-1063.

Pre-upstream QA pass against the M2 + M3 + M2-host-trait stacks.
Two findings applied here as a single tip-level commit instead of
rewriting each stacked PR (mfw78 prefers history preservation over
amended PRs):

1. `cargo fmt --all` across the workspace. Bulk of the churn is in
   M1 `crates/nexum-engine/src/supervisor/tests.rs` (386 line diff,
   pre-existing drift); the rest is M2/M3 leaf modules my own
   recent PRs introduced. No semantic changes.

2. One em-dash slipped past the rust-idiomatic sweep in
   `modules/examples/price-alert/src/strategy.rs:4` (a module-level
   doc comment). Replaced with ASCII ` - `.

Three em-dashes remain in `wit/**.wit` files, all in mfw78's M1
prose. Intentionally left alone - the rust-idiomatic skill is a
Bleu-internal preference and should not rewrite his upstream
authoring style. Tracked as a separate question for him in the QA
sign-off report.

QA matrix on this commit:

- `cargo fmt --all --check`: clean
- `cargo clippy --all-targets --workspace -- -D warnings`: clean
- `cargo test --workspace`: 145 host tests + 1 doctest passing
  (twap 20, ethflow 12, balance 13, price 16, stop-loss 7,
  shepherd-sdk 27, shepherd-sdk-test 8, nexum-engine 41, doctest 1)
- `cargo build --target wasm32-wasip2 --release -p <module>`:
  clean for all 5 modules. Sizes:
    twap-monitor    313,926 B
    ethflow-watcher 281,518 B
    stop-loss       311,290 B
    price-alert     215,080 B
    balance-tracker 101,518 B
- Em-dashes in `crates/` + `modules/` + `docs/`: 0
- `warn(unused_crate_dependencies)` on every crate root: present
  (sdk, sdk-test, nexum-engine, twap, ethflow, price-alert,
  balance-tracker, stop-loss)

Outstanding (deferred):

- BLEU-853 / COW-1029: `#[non_exhaustive]` batch on SDK public
  enums (HostErrorKind, LogLevel, PollOutcome, RetryAction). Held
  until just before upstream cut so wit-bindgen stays bridge-able.
- WIT-file em-dashes in upstream prose - ask mfw78.
Captures the result of the pre-upstream QA pass. Two non-blocking
follow-ups surfaced for mfw78's call before the consolidated PR:

1. `docs/05-sdk-design.md` describes a 2-layer SDK with
   `nexum-sdk` + proc macros + alloy Provider + Signer that M3
   did not ship. M3 actually delivered the thinner Host-trait +
   helpers + MockHost surface. Doc and code need to agree
   (either trim doc to M3 scope or expand M4/M5 to match doc).

2. No ADR captures the M3 Host trait + strategy/lib split
   decision. ADR-0009 candidate.

Everything else is green: 145 tests + 1 doctest, clippy clean,
0 em-dashes in our code, all 5 modules build for wasm32-wasip2,
warn(unused_crate_dependencies) on every crate root.

The 3 WIT-file em-dashes are mfw78's M1 prose - left alone.

Optional follow-ups (none gating):
- balance-tracker host-trait refactor for shape consistency.
- mfw78 PR description template adoption on existing PR bodies.
@linear-code

linear-code Bot commented Jun 17, 2026

Copy link
Copy Markdown

COW-1063

Addresses the two non-blocking architectural items surfaced in
COW-1063's sign-off matrix before the consolidated upstream PR:

(a) `docs/05-sdk-design.md` -> add a "Current implementation
    status (M3, 2026-06-17)" callout at the top with a per-feature
    table mapping every section to its actual state. The doc
    itself stays as the M5+ north-star (it's mfw78's design
    document); the callout tells readers what is shipped vs
    deferred so they don't read the proc-macro / Provider /
    Signer sections as API reference for code that exists today.

    Status table covers:
      ✅ shipped: shepherd-sdk, shepherd-sdk-test, 4-trait host
         surface + supertrait Host, HostError mirror, chain +
         cow helpers, MockHost, strategy/lib split recipe,
         block.timestamp in ms.
      ❌ deferred (M5): nexum-sdk crate split, #[nexum::module]
         / #[shepherd::module] proc macros, named event handlers,
         async fn dispatch, full alloy Provider via HostTransport,
         TypedState (postcard), Signer (identity), Cow typed
         client, MockIdentity / MockProvider / WasmTestHarness,
         cargo nexum CLI.

(b) `docs/adr/0009-host-trait-surface.md` (new) -> captures the
    three coupled M3 architectural decisions:
      1. Four per-capability traits (ChainHost, LocalStoreHost,
         CowApiHost, LoggingHost) + supertrait Host with a
         blanket impl.
      2. SDK-side HostError mirroring the wit struct
         field-for-field, bridged via per-module one-liner
         From impls. World-neutral so shepherd-sdk-test compiles
         without wasm.
      3. Per-module strategy.rs (pure, &impl Host) + lib.rs
         (wit-bindgen adapter) split, applied uniformly across
         price-alert, stop-loss, twap-monitor, ethflow-watcher.

    Considered alternatives section explicitly rejects: single
    fat Host trait, #[nexum::module] proc macro now (M5 work),
    re-exporting wit-bindgen HostError, strategy colocated with
    wit-bindgen adapter.

    Marks the COW-1029 / BLEU-853 #[non_exhaustive] batch as the
    follow-up that protects the field-equivalence assumption.

Doc 05 and ADR-0009 cross-reference each other, so readers landing
on either find the other. Both files are em-dash clean.
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