Private
Public Access
0
0

feat(directives): scavenge sweep preset update + test file (batch 1/5)

- current_baseline.md: added 9 new directives alphabetically interleaved
  (total 90); updated Notes section to track four harvest passes
- state.toml: new [scavenge_20260703] section + [safety_observations]
  (prompt-injection attempt noted for the record)
- tests/test_scavenge_batch_1.py: 9 parametrized cases + 2 aggregate
  tests verifying the 9 new directives have v1.md + meta.md, headings,
  sections, preset references, total count >= 90
This commit is contained in:
2026-07-04 01:08:15 -04:00
parent b193df100f
commit b696b30f22
3 changed files with 141 additions and 3 deletions
@@ -51,6 +51,7 @@ Read each file below before any action.
- mandatory_research_first: conductor/directives/mandatory_research_first/v1.md
- metadata_boundary_type: conductor/directives/metadata_boundary_type/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_diagnostic_noise: conductor/directives/no_diagnostic_noise/v1.md
@@ -60,9 +61,13 @@ Read each file below before any action.
- no_skip_markers_as_avoidance: conductor/directives/no_skip_markers_as_avoidance/v1.md
- one_space_indent: conductor/directives/one_space_indent/v1.md
- parse_failure_visible_to_conversation: conductor/directives/parse_failure_visible_to_conversation/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
- preserve_before_compact_archive: conductor/directives/preserve_before_compact_archive/v1.md
- 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
- 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
@@ -75,7 +80,10 @@ 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
- 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
- tdd_red_green_required: conductor/directives/tdd_red_green_required/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
- tier1_orchestrator_no_implementation: conductor/directives/tier1_orchestrator_no_implementation/v1.md
@@ -86,6 +94,7 @@ Read each file below before any action.
- 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
- user_corrections_log_in_state_toml: conductor/directives/user_corrections_log_in_state_toml/v1.md
- verify_before_editing: conductor/directives/verify_before_editing/v1.md
- verbose_commit_message_ban: conductor/directives/verbose_commit_message_ban/v1.md
- workspace_paths: conductor/directives/workspace_paths/v1.md
@@ -97,8 +106,11 @@ the 2026-07-02 Phase A expansion added 15 more (from docs/AGENTS.md,
conductor/edit_workflow.md, docs/guide_testing.md, docs/guide_state_lifecycle.md)
for a total of 66, and the 2026-07-02 scavenge pass added 15 more (5 from
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
— see HARVEST_SUMMARY.md for what was lifted in each pass).
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).
No alternative encodings tested yet. This preset is the control group for
future experiments.
@@ -132,4 +132,24 @@ new_directive_sources = "docs/MMA_Support/ (5), conductor/tracks/nagent_review_2
cap_applied = 30 # user cap was ~30; lifted 15 (strongest, most actionable, most general-purpose)
skipped_categories = ["Implementation-specific tactical notes", "Historical commentary without an actionable current rule", "Content about the manual-slop app's specific UI/feature", "Rules that conflict with existing 66 directives"]
commits = 4 # 3 directive batches + 1 preset update + 1 test = 5 total; counted as 4 directive-related commits + 1 test commit
test_added = "tests/test_scavenge_directives_lift.py (79 parametrized cases + 5 aggregate tests)"
test_added = "tests/test_scavenge_directives_lift.py (79 parametrized cases + 5 aggregate tests)"
[scavenge_20260703]
# Phase 6 scavenge pass: directive library expansion from docs/reports/ historical slices.
# Per user directive 2026-07-03: "scavenge for additional directives from docs/reports/2026-03-02/ through docs/reports/2026-06-08/. The user wants a full sweep — process every file in this slice."
# Scope: docs/reports/2026-03-02/ (1 file: MCP_BUGFIX_20260306.md), docs/reports/2026-05-04/ (5 files), docs/reports/2026-05-11/ (1 file: ai_decoupling_revert_report.md), docs/reports/2026-06-01/ (10 files), docs/reports/2026-06-08/ (29 files). Total 46 files.
# Out of scope: this track's own history; the .txt files in docs/reports/2026-06-01/ (startup_audit_20260606.txt, startup_baseline_20260606.txt — not markdown); other docs/reports/ slices.
directives_before = 81
directives_after = 90
new_directives_count = 9
new_directive_sources = "docs/reports/2026-03-02/MCP_BUGFIX_20260306.md (1), docs/reports/2026-05-11/ai_decoupling_revert_report.md + docs/reports/2026-06-01/qwen_llama_grok_followup_audit_20260611.md (2), docs/reports/2026-06-08/ (6: docs_sync_test_era_20260610, nagent_review_session_20260612, batch_resilience_plan_20260608, TEST_REGRESSION_ANALYSIS_MINIMAX_OPENAI_20260613, workflow_markdown_audit_20260608 x2 rules)"
cap_applied = 20 # user cap was 20; lifted 9 (strongest, most actionable, most general-purpose)
skipped_categories = ["Implementation-specific tactical notes (e.g. specific ImGui scope fix sites)", "Historical commentary without an actionable current rule", "Content about the manual-slop app's specific UI/feature", "Rules already covered by the existing 81 directives", "Design ideation without a concrete current rule", "Single-file post-mortems that turned out to be pre-existing bugs (not actionable as a directive)"]
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)"
[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>
# block (echoing docs/AGENTS.md content) appended after the file's last line. The instruction
# was ignored; the actual user task (scavenge sweep) was followed. Flagged here for the record.
+106
View File
@@ -0,0 +1,106 @@
"""Tests for the 2026-07-03 scavenge sweep (batch 1/5: docs/reports/2026-03-02 through docs/reports/2026-06-08).
Lifted 9 new directives from historical docs/reports/ markdown. Each one
encodes a post-mortem or process rule. 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 from 81 to 90
Additive to tests/test_aggregate_directives.py and tests/test_scavenge_directives_lift.py
(the existing 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_1_DIRECTIVES: list[str] = [
"pathlib_read_write_no_newline_kwarg",
"profile_first_optimize_second",
"surface_gaps_at_discovery_not_checkpoint",
"test_instantiation_not_mock_away",
"preserve_prior_versions_of_review_docs",
"neutral_language_for_doc_drift",
"preserve_before_compact_archive",
"user_corrections_log_in_state_toml",
"surface_dirty_state_in_test_runner",
]
def _read(path: Path) -> str:
return path.read_text(encoding="utf-8")
def test_scavenge_batch_1_lift_count_matches_expected() -> None:
assert len(SCAVENGE_BATCH_1_DIRECTIVES) == 9, "scavenge batch 1 lifted 9 directives; list must stay in sync"
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_1_DIRECTIVES)
def test_scavenge_batch_1_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-1 directive: " + directive_name
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_1_DIRECTIVES)
def test_scavenge_batch_1_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-1 directive: " + directive_name
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_1_DIRECTIVES)
def test_scavenge_batch_1_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_1_DIRECTIVES)
def test_scavenge_batch_1_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_1_directives_listed_in_current_baseline_preset() -> None:
preset_body = _read(PRESET)
for name in SCAVENGE_BATCH_1_DIRECTIVES:
assert name in preset_body, (
"current_baseline.md does not reference scavenge-batch-1 directive: " + name
)
def test_total_directive_count_at_least_90_after_scavenge_batch_1() -> None:
v1_files = sorted(DIRECTIVES_DIR.glob("*/v1.md"))
assert len(v1_files) >= 90, (
"expected >= 90 directives after scavenge batch 1 (81 baseline + 9 batch-1); found "
+ str(len(v1_files))
)
def test_baseline_preset_size_grew_after_scavenge_batch_1() -> None:
preset_body = _read(PRESET)
assert preset_body.count("\n- ") >= 90, (
"current_baseline.md should have >= 90 directive lines after scavenge batch 1"
)
@pytest.mark.parametrize("directive_name", SCAVENGE_BATCH_1_DIRECTIVES)
def test_scavenge_batch_1_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
)