Skip to content

Structure for features#192

Merged
JaclynCodes merged 87 commits intocopilot/resolve-feature-request-issue-againfrom
main
Feb 5, 2026
Merged

Structure for features#192
JaclynCodes merged 87 commits intocopilot/resolve-feature-request-issue-againfrom
main

Conversation

@JaclynCodes
Copy link
Owner

@JaclynCodes JaclynCodes commented Jan 26, 2026

This pull request introduces significant improvements to project documentation, CI/CD workflows, and testing configuration, with a focus on scientific rigor, maintainability, and automation. The README is completely restructured to emphasize the scientific foundation, interface-first design, and a documentation-as-code testing philosophy. CI workflows are enhanced with caching, markdown linting, and more robust parsing. Testing infrastructure is strengthened with stricter pytest configuration and support for parallel execution.

Documentation and Scientific Foundation:

  • Major rewrite and expansion of README.md to clearly articulate the scientific motivation (acoustic energy density), interface-first API design, documentation-as-code testing approach, phased roadmap, and scientific references. The README now includes diagrams, example code, and detailed explanations of project phases and scientific background. [1] [2] [3] [4] [5]
  • Added a new .markdownlint.json configuration to enforce markdown style and code block language tags, improving documentation quality.
  • Clarified technical precedence in the architecture document.

CI/CD and Workflow Enhancements:

  • Updated .github/workflows/blank.yml to enable pip caching for Python dependencies, optimize test runs, and add a new markdown linting job using markdownlint-cli2-action. [1] [2] [3]
  • Changed the deployment workflow trigger branch from canary to main in .github/workflows/static.yml for more standard release management.
  • Improved robustness and accuracy of task parsing in the iteration status email workflow by refining grep patterns and making dashboard links point to the exact commit SHA. [1] [2]

Testing Infrastructure:

  • Enhanced pytest.ini with strict marker/config enforcement, cache directory, and explicit test markers for better test organization and error detection.
  • Added pytest-xdist to setup.py for parallel test execution, improving CI speed.

These changes collectively improve the project's scientific clarity, documentation quality, workflow automation, and testing reliability.


Summary by cubic

Implements core audio and energy modules with a clean public API, and upgrades CI/testing and documentation to lay a reliable, science-first foundation.

  • New Features

    • Audio: load_audio, save_audio, normalize_peak, to_mono, frame_signal.
    • Energy: acoustic_intensity_proxy, frame_energy_density, energy_decomposition_proxy.
    • Top-level exports added for the new helpers.
    • README rebuilt with scientific background and interface-first API; architecture doc clarified.
  • CI/CD and Testing

    • GitHub Actions: pip caching, new markdown lint job (markdownlint-cli2), Pages deploy branch switched to main.
    • Iteration-status emails workflow: safer grep patterns and dashboard link pinned to commit SHA.
    • Pytest: strict markers/config, cache dir, and parallel runs via pytest-xdist.
    • Extensive tests added for audio, energy, public API exports, and workflow integration; dependencies updated and pinned (librosa, soundfile, numpy) with a libsndfile CVE note.

Written for commit d04f63b. Summary will update on new commits.

Copilot AI and others added 30 commits January 23, 2026 22:54
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
…audio-file

Add documentation comments to `__all__` in audio.py
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
## Implementation Plan

- [x] Update dependencies in requirements.txt and tests/requirements.txt
  - [x] Add librosa, soundfile, and numpy to requirements.txt
  - [x] Update test dependencies
- [x] Implement audio processing module (src/symphonic_joules/audio.py)
  - [x] Add load_audio function
  - [x] Add save_audio function
  - [x] Add normalize_peak function
  - [x] Add to_mono function
  - [x] Add frame_signal function
- [x] Extend energy calculations module (src/symphonic_joules/energy.py)
  - [x] Add acoustic_intensity_proxy function
  - [x] Add frame_energy_density function
  - [x] Add energy_decomposition_proxy function
- [x] Create test suite (tests/test_audio.py)
  - [x] Add tests for all audio functions
- [x] Add markdown linting to CI/CD
  - [x] Create .markdownlint.json configuration
  - [x] Update .github/workflows/blank.yml with lint-markdown job
  - [x] Update tests/test_integration_suite.py to verify lint-markdown job
- [x] Update tests/test_energy.py with tests for new acoustic energy functions
- [x] Address code review feedback
  - [x] Fix error message consistency
  - [x] Make test assertions more flexible for version updates
- [x] Run tests and verify all changes work correctly
- [x] Address security issues
  - [x] Add explicit permissions to lint-markdown job (contents: read)

**Security Summary**: No security vulnerabilities found. Added explicit permissions block to the lint-markdown job to follow the principle of least privilege.

**Test Results**: All 52 tests specific to the new implementation pass successfully.

<!-- START COPILOT ORIGINAL PROMPT -->



<details>

<summary>Original prompt</summary>

> Implement the core audio processing and energy calculation modules for the Symphonic-Joules framework, and strengthen the CI/CD pipeline with markdown linting.
> 
> ### 1. Audio Core Implementation (`src/symphonic_joules/audio.py`)
> Flesh out the existing placeholder with a robust API using `librosa` and `soundfile`:
> - `load_audio(path, sr=None, mono=True)`: Returns waveform, sample rate, and a metadata dictionary (duration, n_samples, channels).
> - `save_audio(path, y, sr)`: Saves the waveform to a file.
> - `normalize_peak(y)`: Normalizes signal to peak amplitude 1.0.
> - `to_mono(y)`: Converts multi-channel audio to mono.
> - `frame_signal(y, frame_length, hop_length)`: Frames the signal for analysis.
> 
> ### 2. Acoustic Energy Foundation (`src/symphonic_joules/energy.py`)
> Create a new module for physics-informed energy computations:
> - `acoustic_intensity_proxy(y)`: Computes a proxy for instantaneous intensity (square of pressure).
> - `frame_energy_density(y, frame_length, hop_length)`: Computes average energy density per frame.
> - `energy_decomposition_proxy(y, sr)`: Concepts for potential/kinetic energy proxies via frequency band splitting (Low vs High frequencies).
> 
> ### 3. CI/CD & Documentation Strengthening
> - **Update `.github/workflows/blank.yml`**: Add a `lint-markdown` job using `davidanson/markdownlint-cli2-action` to enforce `MD040` (fenced code blocks must have language tags).
> - **Create `.markdownlint.json`**: Configure linting rules to enforce MD040 and specify allowed languages (python, sh, yaml, etc.).
> - **Add Tests**: Create `tests/test_audio.py` with unit tests for the new audio functions.
> - **Update Integration Tests**: Update `tests/test_integration_suite.py` to verify that the `lint-markdown` job is present in the workflow configuration.
> 
> ### 4. Project Dependencies
> - Ensure `librosa`, `soundfile`, and `numpy` are added to the development/test dependencies.


</details>



<!-- START COPILOT CODING AGENT SUFFIX -->

*This pull request was created from Copilot chat.*
>

<!-- START COPILOT CODING AGENT TIPS -->
---

✨ Let Copilot coding agent [set things up for you](https://github.com/JaclynCodes/Symphonic-Joules/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Implements core audio processing and energy calculation modules, and adds markdown linting to CI. Enables loading, framing, and energy analysis of audio while enforcing fenced code block language tags.

- **New Features**
  - audio.py: load_audio, save_audio, normalize_peak, to_mono, frame_signal.
  - energy.py: acoustic_intensity_proxy, frame_energy_density, energy_decomposition_proxy.

- **CI/CD**
  - Add lint-markdown job enforcing MD040; include .markdownlint.json with allowed languages.
  - Add explicit permissions (contents: read) to lint-markdown job.
  - Tests: unit tests for audio and energy; integration test verifies the lint job exists.
  - Dependencies: add librosa, soundfile, numpy.

<sup>Written for commit 685ded9. Summary will update on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
…ctions-again

Set up Copilot instructions for repository
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
…ction-names

Improve loop variable readability in frame energy calculation
…uidance comment

Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: JaclynCodes <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
JaclynCodes and others added 2 commits January 29, 2026 12:11
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/symphonic_joules/audio.py">

<violation number="1" location="src/symphonic_joules/audio.py:91">
P2: save_audio now requires a different channel orientation than load_audio returns, so a common load→save flow will write with swapped dimensions or fail. Either accept channel‑first input from load_audio or convert it before writing.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/symphonic_joules/audio.py">

<violation number="1" location="src/symphonic_joules/audio.py:91">
P2: save_audio no longer handles the channels-first arrays produced by load_audio, so saving multi-channel output from this module will write incorrect audio unless callers manually transpose. This is an API inconsistency/regression in the module.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

if y.ndim > 1 and y.shape[0] < y.shape[1]: # Heuristic to check if channels are first dimension
y = y.T # Transpose if channels are the first dimension
sf.write(path, y, sr)
except Exception as e:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh pr checkout 178

# y = y.T # This should be handled by the caller to ensure correct orientation.
if y.ndim > 1 and y.shape[0] < y.shape[1]: # Heuristic to check if channels are first dimension
y = y.T # Transpose if channels are the first dimension
sf.write(path, y, sr)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
Signed-off-by: Misfit <218383634+JaclynCodes@users.noreply.github.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/symphonic_joules/audio.py">

<violation number="1" location="src/symphonic_joules/audio.py:92">
P2: The auto-transpose heuristic assumes samples > channels. For short multi‑channel arrays where n_samples < n_channels, it will transpose valid (n_samples, n_channels) data and silently save corrupted audio. Consider requiring explicit orientation or validating shape instead of guessing.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

try:
# Transpose if multi-channel audio is in (n_channels, n_samples) format
# to match soundfile's expected (n_samples, n_channels) format
if y.ndim == 2 and y.shape[0] < y.shape[1]:
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The auto-transpose heuristic assumes samples > channels. For short multi‑channel arrays where n_samples < n_channels, it will transpose valid (n_samples, n_channels) data and silently save corrupted audio. Consider requiring explicit orientation or validating shape instead of guessing.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/symphonic_joules/audio.py, line 92:

<comment>The auto-transpose heuristic assumes samples > channels. For short multi‑channel arrays where n_samples < n_channels, it will transpose valid (n_samples, n_channels) data and silently save corrupted audio. Consider requiring explicit orientation or validating shape instead of guessing.</comment>

<file context>
@@ -86,9 +87,11 @@ def save_audio(path: str, y: np.ndarray, sr: int) -> None:
-        # Caller must provide waveform in (n_samples, n_channels) orientation.
+        # Transpose if multi-channel audio is in (n_channels, n_samples) format
+        # to match soundfile's expected (n_samples, n_channels) format
+        if y.ndim == 2 and y.shape[0] < y.shape[1]:
+            y = y.T
+            
</file context>
Fix with Cubic

Copilot AI and others added 2 commits February 5, 2026 02:26
…les-infrastructure

Update Symphonic Joules Infrastructure to v2
@JaclynCodes JaclynCodes added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file labels Feb 5, 2026
@JaclynCodes JaclynCodes merged commit 4fe134f into copilot/resolve-feature-request-issue-again Feb 5, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants