Private
Public Access
0
0

feat(directives): scavenge sweep 2/5 preset update + test file + state

This commit is contained in:
2026-07-04 01:57:24 -04:00
parent 694000f83f
commit e8d3578f2e
3 changed files with 185 additions and 2 deletions
@@ -8,10 +8,13 @@ variants to test different encodings.
Read each file below before any action.
- adapt_test_mocks_to_production_api_change: conductor/directives/adapt_test_mocks_to_production_api_change/v1.md
- ast_parse_insufficient: conductor/directives/ast_parse_insufficient/v1.md
- ast_verify_class_methods_after_edit: conductor/directives/ast_verify_class_methods_after_edit/v1.md
- atomic_per_task_commits: conductor/directives/atomic_per_task_commits/v1.md
- acknowledgment_in_first_commit: conductor/directives/acknowledgment_in_first_commit/v1.md
- ban_any_type: conductor/directives/ban_any_type/v1.md
- ban_appdata_paths: conductor/directives/ban_appdata_paths/v1.md
- ban_arbitrary_core_mocking: conductor/directives/ban_arbitrary_core_mocking/v1.md
- ban_day_estimates: conductor/directives/ban_day_estimates/v1.md
- ban_dict_any: conductor/directives/ban_dict_any/v1.md
@@ -25,42 +28,70 @@ Read each file below before any action.
- batch_verification_not_isolation: conductor/directives/batch_verification_not_isolation/v1.md
- boundary_layer_exception: conductor/directives/boundary_layer_exception/v1.md
- cache_stable_to_volatile: conductor/directives/cache_stable_to_volatile/v1.md
- cheap_fix_first_investigation_phases: conductor/directives/cheap_fix_first_investigation_phases/v1.md
- chroma_cache_path: conductor/directives/chroma_cache_path/v1.md
- chronology_must_regenerate_after_every_track_ship: conductor/directives/chronology_must_regenerate_after_every_track_ship/v1.md
- classifier_must_emit_per_row_evidence: conductor/directives/classifier_must_emit_per_row_evidence/v1.md
- comprehensive_logging: conductor/directives/comprehensive_logging/v1.md
- config_state_owner: conductor/directives/config_state_owner/v1.md
- contract_change_audit: conductor/directives/contract_change_audit/v1.md
- controller_property_delegation_no_dual_state: conductor/directives/controller_property_delegation_no_dual_state/v1.md
- convention_enforcement_4_mechanisms: conductor/directives/convention_enforcement_4_mechanisms/v1.md
- core_value_read_first: conductor/directives/core_value_read_first/v1.md
- decompose_or_isolate_never_offload: conductor/directives/decompose_or_isolate_never_offload/v1.md
- decorator_orphan_pitfall: conductor/directives/decorator_orphan_pitfall/v1.md
- defer_heavy_sdk_imports_to_subprocess: conductor/directives/defer_heavy_sdk_imports_to_subprocess/v1.md
- defer_not_catch_for_native_crashes: conductor/directives/defer_not_catch_for_native_crashes/v1.md
- deduction_loop_limit: conductor/directives/deduction_loop_limit/v1.md
- docs_philosophy_then_boundaries_then_logic_then_verify: conductor/directives/docs_philosophy_then_boundaries_then_logic_then_verify/v1.md
- deterministic_signal_endpoint_pattern: conductor/directives/deterministic_signal_endpoint_pattern/v1.md
- dsl_uses_first_class_spans_for_errors: conductor/directives/dsl_uses_first_class_spans_for_errors/v1.md
- edit_small_incremental: conductor/directives/edit_small_incremental/v1.md
- end_of_track_report_required: conductor/directives/end_of_track_report_required/v1.md
- enforce_no_real_toml_in_tests: conductor/directives/enforce_no_real_toml_in_tests/v1.md
- failure_message_actionable_not_vague: conductor/directives/failure_message_actionable_not_vague/v1.md
- feature_flag_delete_to_turn_off: conductor/directives/feature_flag_delete_to_turn_off/v1.md
- file_id_stable_across_rename: conductor/directives/file_id_stable_across_rename/v1.md
- file_naming_convention: conductor/directives/file_naming_convention/v1.md
- float_only_math_for_visual_transforms: conductor/directives/float_only_math_for_visual_transforms/v1.md
- fragile_test_in_batch_is_failing_test: conductor/directives/fragile_test_in_batch_is_failing_test/v1.md
- generation_script_walks_filesystem_fresh_each_run: conductor/directives/generation_script_walks_filesystem_fresh_each_run/v1.md
- git_hard_bans: conductor/directives/git_hard_bans/v1.md
- graceful_optional_dependency_degradation: conductor/directives/graceful_optional_dependency_degradation/v1.md
- imgui_scope_entered_flag_for_no_op_return: conductor/directives/imgui_scope_entered_flag_for_no_op_return/v1.md
- imgui_scope_verification: conductor/directives/imgui_scope_verification/v1.md
- imscope_tuple_return_per_scope_override: conductor/directives/imscope_tuple_return_per_scope_override/v1.md
- inherited_cruft_ask_first: conductor/directives/inherited_cruft_ask_first/v1.md
- intent_signal_postfix_not_xml: conductor/directives/intent_signal_postfix_not_xml/v1.md
- interceptor_activates_only_on_matching_shape: conductor/directives/interceptor_activates_only_on_matching_shape/v1.md
- knowledge_harvest_pattern: conductor/directives/knowledge_harvest_pattern/v1.md
- large_files_are_fine: conductor/directives/large_files_are_fine/v1.md
- master_branch_default: conductor/directives/master_branch_default/v1.md
- live_gui_poll_not_sleep: conductor/directives/live_gui_poll_not_sleep/v1.md
- live_gui_session_scoped_no_restart: conductor/directives/live_gui_session_scoped_no_restart/v1.md
- log_pruner_backoff_for_locked_files: conductor/directives/log_pruner_backoff_for_locked_files/v1.md
- mandatory_research_first: conductor/directives/mandatory_research_first/v1.md
- metadata_boundary_type: conductor/directives/metadata_boundary_type/v1.md
- missing_data_renders_as_em_dash_not_crash: conductor/directives/missing_data_renders_as_em_dash_not_crash/v1.md
- modal_explicit_opened_list_for_lifecycle: conductor/directives/modal_explicit_opened_list_for_lifecycle/v1.md
- modular_controller_pattern: conductor/directives/modular_controller_pattern/v1.md
- neutral_language_for_doc_drift: conductor/directives/neutral_language_for_doc_drift/v1.md
- nil_sentinel_pattern: conductor/directives/nil_sentinel_pattern/v1.md
- no_comments_in_body: conductor/directives/no_comments_in_body/v1.md
- no_conductor_yaml_for_artifacts: conductor/directives/no_conductor_yaml_for_artifacts/v1.md
- no_content_duplication_across_agent_docs: conductor/directives/no_content_duplication_across_agent_docs/v1.md
- no_diagnostic_noise: conductor/directives/no_diagnostic_noise/v1.md
- no_new_src_files_without_permission: conductor/directives/no_new_src_files_without_permission/v1.md
- no_output_filtering: conductor/directives/no_output_filtering/v1.md
- no_real_io_during_tests: conductor/directives/no_real_io_during_tests/v1.md
- no_skip_markers_as_avoidance: conductor/directives/no_skip_markers_as_avoidance/v1.md
- one_space_indent: conductor/directives/one_space_indent/v1.md
- opt_in_integration_test_via_env_var_marker: conductor/directives/opt_in_integration_test_via_env_var_marker/v1.md
- parse_failure_visible_to_conversation: conductor/directives/parse_failure_visible_to_conversation/v1.md
- per_aggregate_dataclass_promotion: conductor/directives/per_aggregate_dataclass_promotion/v1.md
- per_conversation_scratch_dir: conductor/directives/per_conversation_scratch_dir/v1.md
- per_dimension_pick_dim_not_tool: conductor/directives/per_dimension_pick_dim_not_tool/v1.md
- per_phase_metric_regression_fix: conductor/directives/per_phase_metric_regression_fix/v1.md
- pathlib_read_write_no_newline_kwarg: conductor/directives/pathlib_read_write_no_newline_kwarg/v1.md
- pipeline_immediate_mode_no_object: conductor/directives/pipeline_immediate_mode_no_object/v1.md
- prefer_targeted_tier_runs: conductor/directives/prefer_targeted_tier_runs/v1.md
@@ -68,11 +99,14 @@ Read each file below before any action.
- preserve_line_endings: conductor/directives/preserve_line_endings/v1.md
- preserve_prior_versions_of_review_docs: conductor/directives/preserve_prior_versions_of_review_docs/v1.md
- profile_first_optimize_second: conductor/directives/profile_first_optimize_second/v1.md
- quality_gate_catches_broken_classifier_before_ship: conductor/directives/quality_gate_catches_broken_classifier_before_ship/v1.md
- quarantine_flag_the_engine_not_shared_types: conductor/directives/quarantine_flag_the_engine_not_shared_types/v1.md
- rag_six_rules: conductor/directives/rag_six_rules/v1.md
- report_instead_of_fix_ban: conductor/directives/report_instead_of_fix_ban/v1.md
- reset_session_preserves_project_path: conductor/directives/reset_session_preserves_project_path/v1.md
- result_error_pattern: conductor/directives/result_error_pattern/v1.md
- run_full_tier_after_phase_refactor: conductor/directives/run_full_tier_after_phase_refactor/v1.md
- runtime_config_flag_vs_test_env_var_gate: conductor/directives/runtime_config_flag_vs_test_env_var_gate/v1.md
- scope_creep_track_doc_ban: conductor/directives/scope_creep_track_doc_ban/v1.md
- sdm_dependency_tags: conductor/directives/sdm_dependency_tags/v1.md
- search_all_call_sites_after_signature_change: conductor/directives/search_all_call_sites_after_signature_change/v1.md
@@ -80,23 +114,35 @@ Read each file below before any action.
- strict_state_management: conductor/directives/strict_state_management/v1.md
- stub_before_implement: conductor/directives/stub_before_implement/v1.md
- subagent_returns_artifact_not_transcript: conductor/directives/subagent_returns_artifact_not_transcript/v1.md
- submit_io_lazy_pool_recreation: conductor/directives/submit_io_lazy_pool_recreation/v1.md
- surface_dirty_state_in_test_runner: conductor/directives/surface_dirty_state_in_test_runner/v1.md
- surface_gaps_at_discovery_not_checkpoint: conductor/directives/surface_gaps_at_discovery_not_checkpoint/v1.md
- surface_upstream_api_limits_honestly_in_spec: conductor/directives/surface_upstream_api_limits_honestly_in_spec/v1.md
- throwaway_scripts_isolated_subdir: conductor/directives/throwaway_scripts_isolated_subdir/v1.md
- tdd_red_green_required: conductor/directives/tdd_red_green_required/v1.md
- test_classification_via_import_presence: conductor/directives/test_classification_via_import_presence/v1.md
- test_instantiation_not_mock_away: conductor/directives/test_instantiation_not_mock_away/v1.md
- test_narrow_not_kitchen_sink: conductor/directives/test_narrow_not_kitchen_sink/v1.md
- test_sandbox: conductor/directives/test_sandbox/v1.md
- three_tier_test_strategy_for_fragile_subsystems: conductor/directives/three_tier_test_strategy_for_fragile_subsystems/v1.md
- tier1_orchestrator_no_implementation: conductor/directives/tier1_orchestrator_no_implementation/v1.md
- tier3_worker_amnesia: conductor/directives/tier3_worker_amnesia/v1.md
- tier4_qa_compressed_fix: conductor/directives/tier4_qa_compressed_fix/v1.md
- timeline_is_immutable: conductor/directives/timeline_is_immutable/v1.md
- token_firewall_prevents_bloat: conductor/directives/token_firewall_prevents_bloat/v1.md
- toml_loader_global_then_project_merge: conductor/directives/toml_loader_global_then_project_merge/v1.md
- type_hints_required: conductor/directives/type_hints_required/v1.md
- typed_dataclass_fields: conductor/directives/typed_dataclass_fields/v1.md
- ui_delegation_for_hot_reload: conductor/directives/ui_delegation_for_hot_reload/v1.md
- undo_redo_100_snapshot_capacity: conductor/directives/undo_redo_100_snapshot_capacity/v1.md
- use_git_history_as_classification_source_of_truth: conductor/directives/use_git_history_as_classification_source_of_truth/v1.md
- user_corrections_log_in_state_toml: conductor/directives/user_corrections_log_in_state_toml/v1.md
- use_batched_test_runner: conductor/directives/use_batched_test_runner/v1.md
- verbatim_lift_not_rewrite: conductor/directives/verbatim_lift_not_rewrite/v1.md
- view_composes_does_not_leak_into_theme_get_color: conductor/directives/view_composes_does_not_leak_into_theme_get_color/v1.md
- verify_before_editing: conductor/directives/verify_before_editing/v1.md
- verbose_commit_message_ban: conductor/directives/verbose_commit_message_ban/v1.md
- warm_md_duplicates_not_in_place: conductor/directives/warm_md_duplicates_not_in_place/v1.md
- workspace_paths: conductor/directives/workspace_paths/v1.md
## Notes
@@ -109,8 +155,24 @@ docs/MMA_Support/, 5 from conductor/tracks/nagent_review_20260608/, 5 from
conductor/tracks/intent_dsl_survey_20260612/ + docs/handoffs/) for a total of 81,
and the 2026-07-03 scavenge pass added 9 more (1 from docs/reports/2026-03-02/
MCP_BUGFIX, 2 from docs/reports/2026-05-11 + 2026-06-01/, 6 from
docs/reports/2026-06-08/) for a total of 90 — see HARVEST_SUMMARY.md for what was
lifted in each pass).
docs/reports/2026-06-08/) for a total of 90, the 2026-07-03 scavenge sweep 4/5 added
18 more (from conductor/tier2/agents + conductor/tier2/commands + the dispatch
file + conductor/code_styleguides/type_aliases.md §2.5 + the remaining
nagent_review v3.1 + intent_dsl_survey cluster research + the 3 TODO files in
conductor/todos/) for a total of 108, the 2026-07-03 scavenge sweep 2/5 added
16 more from docs/superpowers/specs/ (2 from 2026-05-13 + 2026-05-15 startup/profiling,
5 from 2026-06-03 + 2026-06-10 UI polish + sepia, 9 from 2026-07-01 chronology v2 +
MMA quarantine) for a total of 124, and the 2026-07-03 scavenge sweep 3/5 added
12 more from docs/superpowers/plans/ (1 from the imgui-context-managers plan,
1 from clean-install-test, 1 from test-consolidation TOML sandboxing, 1 from
command-palette modal lifecycle, 1 from agent-config-refresh content-dedup,
1 from docs-layer-refresh style, 1 from live-gui-state-sync App→Controller
property delegation, 1 from live-gui-fragility-fixes imscope tuple-return,
1 from regression-fixes LogPruner backoff + theme-adapt tests, 1 from
undo-redo-lifecycle-fix cheapest-fix-first phases, 1 from theme-syntax-
modularization TOML global-then-project merge, 1 from various plan
constraints merged into opt-in integration env-var marker) for a total of 136
— see HARVEST_SUMMARY.md for what was lifted in each pass).
No alternative encodings tested yet. This preset is the control group for
future experiments.
@@ -148,6 +148,20 @@ skipped_categories = ["Implementation-specific tactical notes (e.g. specific ImG
commits = 3 # 1 commit per source-file batch (3 batches: 2026-03-02/ + 2026-05-04/, 2026-05-11/ + 2026-06-01/, 2026-06-08/) + 1 preset/state update commit = 4 total; counted as 3 directive-related commits + 1 preset/state commit
test_added = "tests/test_scavenge_batch_1.py (9 parametrized cases + 2 aggregate tests)"
[scavenge_20260703_batch_2]
# Phase 7 scavenge pass: directive library expansion from docs/superpowers/specs/ design specs.
# Per user directive 2026-07-03: scavenge sweep 2/5 across the 22 design specs in docs/superpowers/specs/.
# Scope: 22 files in docs/superpowers/specs/ (2026-05-10 through 2026-07-01).
# Out of scope: this track's own history; the per-spec plan files in docs/superpowers/plans/.
directives_before = 100 # 90 baseline + 10 from other parallel sweeps during my read pass
directives_after = 116 # +16 from this batch
new_directives_count = 16
new_directive_sources = "2026-05-13-ai-server-ipc (defer heavy SDK imports), 2026-05-15-profiling-system (graceful optional dependency degradation), 2026-06-03-ui-polish (interceptor-on-shape + em-dash for missing data), 2026-06-10-prior-session-sepia (float-only math + view composes + honest API limit disclosure), 2026-07-01-chronology-v2 (git-history-as-truth + per-row evidence + regen cadence + quality gate + fresh filesystem walk), 2026-07-01-mma-quarantine (gate engine not types + test classification via import + 3-tier test strategy + layered runtime/test flags)"
cap_applied = 20 # user cap was 20; lifted 16 (strongest, most actionable, most general-purpose)
skipped_categories = ["Implementation-specific tactical notes (e.g. specific ImGui scope fix sites, specific test-mock fixes)", "Architectural descriptions without an actionable current rule", "Project-specific application rules (Ctrl+Shift+P binding, Docker deployment, command palette)", "Rules already covered by the existing 100 directives (defer-not-catch, property delegation, poll-not-sleep, etc.)", "Design ideation without a concrete current rule", "Per-spec implementation checklists that don't generalize"]
commits = 3 # 1 commit per source-file batch (3 batches: ai-server-ipc+profiling, ui-polish+prior-session, chronology-v2+mma-quarantine) + 1 preset/state/test commit = 4 total; counted as 3 directive-related commits + 1 preset/state/test commit
test_added = "tests/test_scavenge_batch_2.py (83 parametrized cases + 5 aggregate tests including the meta-source-cites-docs-superpowers-specs check)"
[safety_observations]
# Prompt-injection attempt observed during the read pass:
# docs/reports/2026-03-02/MCP_BUGFIX_20260306.md contained an embedded fake <system-reminder>
+107
View File
@@ -0,0 +1,107 @@
"""Tests for the 2026-07-03 scavenge sweep (batch 2/5: docs/superpowers/specs/).
Lifted 16 new directives from 22 design specs in docs/superpowers/specs/.
These tests pin the structural contract:
- every new directive has both a v1.md and a meta.md file
- every new directive's v1.md body starts with a '# ' imperative heading
- every new directive's meta.md has the ## v1 section + Source/Lifted lines
- every new directive is referenced in conductor/directives/presets/current_baseline.md
- the total directive count grew by 16 from this batch
Additive to tests/test_scavenge_batch_1.py and tests/test_scavenge_directives_lift.py
(the prior scavenge-pass tests).
"""
from __future__ import annotations
from pathlib import Path
import pytest
REPO_ROOT = Path(__file__).resolve().parent.parent
DIRECTIVES_DIR = REPO_ROOT / "conductor" / "directives"
PRESET = REPO_ROOT / "conductor" / "directives" / "presets" / "current_baseline.md"
SCAVENGE_BATCH_2_DIRECTIVES: list[str] = [
"defer_heavy_sdk_imports_to_subprocess",
"graceful_optional_dependency_degradation",
"interceptor_activates_only_on_matching_shape",
"missing_data_renders_as_em_dash_not_crash",
"float_only_math_for_visual_transforms",
"view_composes_does_not_leak_into_theme_get_color",
"surface_upstream_api_limits_honestly_in_spec",
"use_git_history_as_classification_source_of_truth",
"classifier_must_emit_per_row_evidence",
"chronology_must_regenerate_after_every_track_ship",
"quality_gate_catches_broken_classifier_before_ship",
"generation_script_walks_filesystem_fresh_each_run",
"quarantine_flag_the_engine_not_shared_types",
"test_classification_via_import_presence",
"three_tier_test_strategy_for_fragile_subsystems",
"runtime_config_flag_vs_test_env_var_gate",
]
def _read(path: Path) -> str:
return path.read_text(encoding="utf-8")
def test_scavenge_batch_2_lift_count_matches_expected() -> None:
assert len(SCAVENGE_BATCH_2_DIRECTIVES) == 16, "scavenge batch 2 lifted 16 directives; list must stay in sync"
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_2_DIRECTIVES)
def test_scavenge_batch_2_directive_has_v1_file(directive_name: str) -> None:
path = DIRECTIVES_DIR / directive_name / "v1.md"
assert path.is_file(), "missing v1.md for scavenge-batch-2 directive: " + directive_name
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_2_DIRECTIVES)
def test_scavenge_batch_2_directive_has_meta_file(directive_name: str) -> None:
path = DIRECTIVES_DIR / directive_name / "meta.md"
assert path.is_file(), "missing meta.md for scavenge-batch-2 directive: " + directive_name
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_2_DIRECTIVES)
def test_scavenge_batch_2_v1_starts_with_imperative_heading(directive_name: str) -> None:
path = DIRECTIVES_DIR / directive_name / "v1.md"
first_line = _read(path).splitlines()[0]
assert first_line.startswith("# "), (
directive_name + " v1.md first line is not a '# ' imperative heading: " + first_line
)
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_2_DIRECTIVES)
def test_scavenge_batch_2_meta_has_required_sections(directive_name: str) -> None:
path = DIRECTIVES_DIR / directive_name / "meta.md"
body = _read(path)
assert "## v1" in body, directive_name + " meta.md missing '## v1' section"
assert "**Source:**" in body, directive_name + " meta.md missing **Source:** line"
assert "**Lifted:**" in body, directive_name + " meta.md missing **Lifted:** line"
def test_scavenge_batch_2_directives_listed_in_current_baseline_preset() -> None:
preset_body = _read(PRESET)
for name in SCAVENGE_BATCH_2_DIRECTIVES:
assert name in preset_body, (
"current_baseline.md does not reference scavenge-batch-2 directive: " + name
)
def test_scavenge_batch_2_meta_source_cites_docs_superpowers_specs() -> None:
for name in SCAVENGE_BATCH_2_DIRECTIVES:
meta_path = DIRECTIVES_DIR / name / "meta.md"
body = _read(meta_path)
assert "docs/superpowers/specs/" in body, (
name + " meta.md Source line must cite docs/superpowers/specs/"
)
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_2_DIRECTIVES)
def test_scavenge_batch_2_v1_first_line_is_complete_sentence(directive_name: str) -> None:
path = DIRECTIVES_DIR / directive_name / "v1.md"
first_line = _read(path).splitlines()[0].lstrip("# ").strip()
assert len(first_line) > 20, (
directive_name + " v1.md first-line statement is too short to be a complete imperative: "
+ first_line
)