conductor(checkpoint): Test integrity audit complete

This commit is contained in:
2026-03-07 20:15:22 -05:00
parent d2521d6502
commit c2930ebea1
16 changed files with 233 additions and 80 deletions

View File

@@ -1,3 +1,7 @@
"""
ANTI-SIMPLIFICATION: These tests verify Conductor integration features such as track proposal, setup scanning, and track creation.
They MUST NOT be simplified. Removing assertions or replacing the logic with empty skips weakens the integrity of the Conductor engine verification.
"""
import os
import json
from pathlib import Path
@@ -5,6 +9,10 @@ from unittest.mock import patch
def test_track_proposal_editing(app_instance):
"""
Verifies the structural integrity of track proposal items.
Ensures that track proposals can be edited and removed from the active list.
"""
app_instance.proposed_tracks = [
{"title": "Old Title", "goal": "Old Goal"},
{"title": "Another Track", "goal": "Another Goal"}
@@ -13,6 +21,7 @@ def test_track_proposal_editing(app_instance):
app_instance.proposed_tracks[0]['title'] = "New Title"
app_instance.proposed_tracks[0]['goal'] = "New Goal"
# ANTI-SIMPLIFICATION: Must assert that the specific dictionary keys are updatable
assert app_instance.proposed_tracks[0]['title'] == "New Title"
assert app_instance.proposed_tracks[0]['goal'] == "New Goal"
@@ -22,6 +31,10 @@ def test_track_proposal_editing(app_instance):
def test_conductor_setup_scan(app_instance, tmp_path):
"""
Verifies that the conductor setup scan properly iterates through the conductor directory,
counts files and lines, and identifies active tracks.
"""
old_cwd = os.getcwd()
os.chdir(tmp_path)
try:
@@ -33,6 +46,7 @@ def test_conductor_setup_scan(app_instance, tmp_path):
app_instance._cb_run_conductor_setup()
# ANTI-SIMPLIFICATION: Assert that the summary output correctly counts files/lines/tracks
assert "Total Files: 1" in app_instance.ui_conductor_setup_summary
assert "Total Line Count: 2" in app_instance.ui_conductor_setup_summary
assert "Total Tracks Found: 1" in app_instance.ui_conductor_setup_summary
@@ -41,6 +55,10 @@ def test_conductor_setup_scan(app_instance, tmp_path):
def test_create_track(app_instance, tmp_path):
"""
Verifies that _cb_create_track properly creates the track folder
and populates the necessary boilerplate files (spec.md, plan.md, metadata.json).
"""
old_cwd = os.getcwd()
os.chdir(tmp_path)
try:
@@ -54,6 +72,7 @@ def test_create_track(app_instance, tmp_path):
assert len(matching_dirs) == 1
track_dir = matching_dirs[0]
# ANTI-SIMPLIFICATION: Must ensure that the boilerplate files actually exist
assert track_dir.exists()
assert (track_dir / "spec.md").exists()
assert (track_dir / "plan.md").exists()
@@ -66,3 +85,4 @@ def test_create_track(app_instance, tmp_path):
assert data['id'] == track_dir.name
finally:
os.chdir(old_cwd)