feat(audio-alm): agent-ready ALM data-builder and pretrain stages#2179
feat(audio-alm): agent-ready ALM data-builder and pretrain stages#2179shubhamNvidia wants to merge 2 commits into
Conversation
…idency resolver Shared base imported by the audio stage modules to make them agent-ready: - _agent_ready.py: AgentReady mixin, StageContract/IOSpec/Gates/Role - _residency.py: input residency resolver (file/waveform/auto) - common.py: agent-ready helpers (ensure_mono/ensure_waveform_2d) Excludes the agent orchestration layer (registry/catalog/conformance/planning/agent).
Greptile SummaryThis PR makes eight audio pipeline stages agent-ready by subclassing
Confidence Score: 3/5The changes are additive and core processing logic is untouched, but the agent-facing contracts have concrete gaps that would produce incorrect stage-chaining decisions. Two describe() implementations misreport the actual data keys consumed and produced — the gaps in ALMDataOverlapStage are particularly wide (eight undeclared writes). describe_static() will crash unconditionally due to a missing dependency module. These issues directly undermine the stated goal of the PR. alm_data_overlap.py and alm_data_builder.py have incomplete describe() contracts; _agent_ready.py has a broken describe_static() entrypoint. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Agent
participant AgentReady
participant Stage
participant _agent_registry
Agent->>AgentReady: describe_static()
AgentReady->>_agent_registry: static_contract(cls)
Note over _agent_registry: Module does not exist - ModuleNotFoundError
Agent->>Stage: stage.describe()
Stage-->>Agent: StageContract(reads, writes, gates, ...)
Agent->>Agent: Chain stages by matching IOSpec keys
Note over Agent: ALMDataBuilderStage omits swift_audio_filepath_key from reads
Note over Agent: ALMDataOverlapStage omits 8+ writes
Agent->>Stage: stage.process(task)
Stage-->>Agent: AudioTask (modified data)
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Agent
participant AgentReady
participant Stage
participant _agent_registry
Agent->>AgentReady: describe_static()
AgentReady->>_agent_registry: static_contract(cls)
Note over _agent_registry: Module does not exist - ModuleNotFoundError
Agent->>Stage: stage.describe()
Stage-->>Agent: StageContract(reads, writes, gates, ...)
Agent->>Agent: Chain stages by matching IOSpec keys
Note over Agent: ALMDataBuilderStage omits swift_audio_filepath_key from reads
Note over Agent: ALMDataOverlapStage omits 8+ writes
Agent->>Stage: stage.process(task)
Stage-->>Agent: AudioTask (modified data)
|
| properties[p.name] = schema | ||
| if p.required: |
There was a problem hiding this comment.
to_json_schema silently drops default: None from the JSON schema
The guard if p.default is not None skips emitting "default": null for parameters whose true default is None. An agent reading the schema cannot distinguish "no default declared" from "default is None", and may incorrectly treat those parameters as required. Using a sentinel (e.g. _MISSING = object()) in ParamSpec to represent "no default" would preserve the distinction.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
Makes the ALM (audio-language-model) data-pipeline stages agent-ready. Additive only.
alm/alm_data_builder.py,alm/alm_data_overlap.py,alm/pretrain/extraction.py,alm/pretrain/io.py,alm/pretrain/planning.py— subclassAgentReadyand adddescribe()/StageContractdeclaring each stage's reads/writes; some hardcoded keys made configurable. Core data-building / planning / IO logic is unchanged.Notes for reviewers
describe()matches what the stage actually reads/writes.Test plan
pytest tests/stages/audio/alm -q