Repository navigation
feat(application): add 521 acoustic anomaly WASM operators - #871
Draft
Alain Uyidi (auyidi1) wants to merge 4 commits into
Draft
Alain Uyidi (auyidi1) wants to merge 4 commits into
Alain Uyidi (auyidi1) wants to merge 4 commits into
Conversation
- featurize-acoustic: DCASE-style log-mel rows as predict adapter requests - threshold-anomaly: score adapter responses against a required threshold - librosa 0.11 parity fixture and generator script - two graph definitions bridged by the 518 MQTT predict adapter - register in codecov ignore, VS Code, spelling, and application index 🎧 - Generated by Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📚 Documentation Health ReportGenerated on: 2026-10-08 18:19:47 UTC 📈 Documentation Statistics
🏗️ Three-Tree Architecture Status
🔍 Quality Metrics
This report is automatically generated by the Documentation Automation workflow. |
🎨 - Generated by Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📚 Documentation Health ReportGenerated on: 2026-10-08 18:36:44 UTC 📈 Documentation Statistics
🏗️ Three-Tree Architecture Status
🔍 Quality Metrics
This report is automatically generated by the Documentation Automation workflow. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #871 +/- ##
=======================================
Coverage 42.15% 42.15%
=======================================
Files 42 42
Lines 7334 7334
=======================================
Hits 3092 3092
Misses 4242 4242
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
- use reflect STFT padding and regenerate the librosa fixture - serialize compact f32 rows; cap request and context bytes - featurize only the forwarded windows; add expected_sample_rate - default score_field to score; overflow-safe mean - test against the 518 predict adapter response shape 🔧 - Generated by Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- add full-multi-node-cluster acoustic anomaly tfvars example - set CloudEvents type and source headers on graph destinations - document reflect padding, request and context limits, 517 ranges - add prerequisites section 📝 - Generated by Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📚 Documentation Health ReportGenerated on: 2026-10-08 20:41:43 UTC 📈 Documentation Statistics
🏗️ Three-Tree Architecture Status
🔍 Quality Metrics
This report is automatically generated by the Documentation Automation workflow. |
17 of 29 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Adds component 521 acoustic anomaly operators: two WASM map operators for AIO data flow graphs that detect acoustic anomalies with an autoencoder. The model runs outside the graph. Two data flow graphs are bridged over MQTT by the 518 predict adapter (#869), which calls a predictive endpoint such as a Foundry Local
/v1/predictdeployment.featurize-acoustic:{sample_rate, samples}into 640-dimensional log-mel rows, following the DCASE 2020 Task 2 autoencoder baseline: power STFT (n_fft1024, hop 512, periodic Hann window, centered reflect padding as in the baseline's librosa 0.6), 128 Slaney mel bands,10*log10(power + eps), and 5 frames concatenated frame-major. Models must be trained and calibrated with the same padding.{"inputs": [...], "context": {...}}with compact f32 rows (about 7 KB each), copying configured identity fields such asasset_idintocontextso the verdict can identify its source.expected_sample_rate), samples (finite, in [-1, 1], 2048 up tomax_samples), the serialized context against 518's 1 KiB limit, and the request size againstmax_request_bytes(default 1 MiB, 518'sMAX_REQUEST_BYTESdefault). Only the firstmax_batch_sizewindows are computed; the rest are counted as dropped.threshold-anomaly:score_field(defaultscore, matching 518's response example and mock model) in the adapter responseoutputs: a number, per-window numbers, or single-value rows. It never searches for other numbers.meanormaxand compares against a required threshold that has no default.BACKEND_TIMEOUT,INVALID_RESULT, and so on), so failures stay visible.graph-featurize-acoustic.yamlandgraph-threshold-anomaly.yamlvalidate against theaio-wasm-graph-config-1.0.0schema.blueprints/full-multi-node-cluster/terraform/dataflow-graphs-acoustic-anomaly.tfvars.examplewires both graphs (requiresshould_include_acr_registry_endpoint = true) and sets the CloudEventstypeandsourceheaders on each destination while keepingidandtraceparent.scripts/build-wasm.shandscripts/push-to-acr.shfollow the 515 pattern (clippy, host tests, optional audit, release build; push refuses to overwrite by default and records an audit log). They also handle the underscore.wasmfile name of hyphenated crates.Related Issue
Part of the custom workload messaging work tracked in #835 and published in #852. Depends on #868 and #869.
Type of Change
Implementation Details
wasm_graph_sdk =1.1.3from the AIO SDK feed,wit-bindgen 0.22,serde_jsonwithalloc, and the same clippy lint levels and release profile.featurize-acousticaddsrustfft 6.build_request,wav_to_features,build_verdict, and others) never call the SDK logger, which panics on the host target. Logging and metrics happen only in the operator entry points, so all logic is unit-testable withcargo teston the host.f64::EPSILONcast tof32, which matches the reference'ssys.float_info.epsilon, so silent bins equal the reference.codecov.ymlignorelike the other WASM components, the rust-analyzerlinkedProjectsin.vscode/settings.json, the application index, and.cspell/general-technical.txt..nobuildexcludes the component from the container pipeline.Testing Performed
scripts/build-wasm.shpasses end to end: clippy with-D warningson the WASM target, host tests (20 forfeaturize-acoustic, 8 forthreshold-anomaly), cargo-audit, and release builds (300 KB and 136 KB).cargo fmt --checkpasses.pad_mode="reflect"within 0.05 dB on 14 sampled values and the mean of every window. The fixture and its generator script are included.max_batch_sizewindows equal those of the full clip), request and context size limits measured as 518 measures them, and 518's exact success and error response shapes.pump-07) went throughfeaturize-acoustic, producing 5 x 640 rows withcontext{asset_id: pump-07, ...}.successwith the context echoed.threshold-anomaly, producing a verdict withanomaly,score,windows, and the original context.BACKEND_UNAVAILABLEbecame an error verdict that kept the context.https://www.schemastore.org/aio-wasm-graph-config-1.0.0.json.terraform fmt -check, and thefull-multi-node-clusterblueprint passesterraform validate; the example'sdataflow_graphs(includingheaders) type-checks against the blueprint variable viaterraform console(Terraform 1.16.5).Validate-RustCrateRegistration.ps1passes (19 crates). shellcheck, ruff, and yamllint (warnings only, matching existing graph files) pass. Grype finds no vulnerabilities in either lock file. gitleaks finds no leaks. markdownlint, markdown-table-formatter, cspell, and frontmatter validation pass. The CI documentation link check passes; a local markdown-link-check of this README flags only the relative 517 and 518 links, which resolve once feat(application): add 517 synthetic sensor simulator and chart #868 and feat(application): add 518 MQTT predict adapter for HTTP model endpoints #869 merge.Validation Steps
cd src/500-application/521-acoustic-anomaly-operators && ./scripts/build-wasm.sh(requires thewasm32-wasip2target)resources/graphs/and the README deployment example.Checklist
terraform fmton all Terraform codeterraform validateon all Terraform codeaz bicep formaton all Bicep codeaz bicep buildto validate all Bicep codeSecurity Review
Additional Notes