docs(specs): add directive preset system design + implementation plan

This commit is contained in:
ed
2026-07-05 14:36:33 -04:00
parent f63769ac1a
commit 887589d1bc
2 changed files with 2491 additions and 0 deletions
@@ -0,0 +1,322 @@
# Directive Preset System Design
**Date:** 2026-07-05
**Status:** Draft
**Scope:** Replace the single `current_baseline.md` preset (which lists all 172 directives indiscriminately) with a layered preset system: one baseline preset containing only the directives required to operate in the codebase without entropy, plus engagement-specific presets that inherit baseline and add targeted directives for common work patterns. Also: define new op-specific directives where gaps exist, deduplicate the `.warm.md` agent prompt against the directives, and add a non-directive-context section so agents read the product/tech-stack markdown they tend to skip.
---
## 1. Overview
### 1.1 The problem
`conductor/directives/presets/current_baseline.md` lists all 172 directives. Every agent that warms via `manual-slop_aggregate_directives` ingests all 172 (~283K chars, ~75K tokens) regardless of what it's doing. An agent auditing the codebase does not need the 23 test-writing directives; an agent fixing a regression does not need the 5 RAG-specific directives; an agent ideating UX concepts does not need the 20 tier-2-sandbox directives. The preset is the control group from the original harvest — it was never curated for engagement type.
Two related problems:
1. **Agents skip non-directive markdown.** `conductor/product.md`, `conductor/product-guidelines.md`, `conductor/tech-stack.md`, and the `conductor/code_styleguides/*.md` files are the original source docs the directives were lifted from. The directives are the granular reinforcement, but the full docs carry product vision and tech-stack context the directives don't fully encode. Agents skip them. There is no preset mechanism to force-read non-directive context.
2. **The `.warm.md` agent prompt duplicates directive content.** `conductor/tier2/agents/tier2-autonomous.warm.md` (17.9KB) still contains inline bulk-markdown sections that duplicate ~9 directive subject areas (AppData, git restore/stash, timeline-immutable, run_tests_batched, failcount, tier3/tier4 delegation, etc.). The agent reads the directives AND the inline duplicates. The warm prompt should be a thin shell once the directives carry that content.
### 1.2 The solution
A layered preset system with three mechanisms:
1. **Baseline preset** — only the 57 directives required to do anything in the codebase without creating entropy. Plus a non-directive-context section listing `AGENTS.md`, `conductor/product.md`, `conductor/product-guidelines.md`, `conductor/tech-stack.md` for product/tech context.
2. **Engagement presets** — each inherits baseline and adds the targeted directives for one work pattern (auditing, fixing tests, implementing features, refactoring, scripts, meta-tooling, directives curation, documentation, media analysis, ideation). New op-specific directives are created where gaps exist.
3. **Dedup of `.warm.md`** — the inline bulk-markdown sections that duplicate directive content get stripped; the warm prompt becomes a thin shell (domain distinction, pre-action reading list, the `warm with:` aggregate call, tier-2-sandbox targeted additions). The directives are the single source of truth.
### 1.3 The engagement presets (mapping to user-named ops)
| Preset file | User-named op | Inherits | Adds |
|---|---|---|---|
| `baseline.md` | Codebase knowledge + conventions | — | 57 BASELINE directives + 4 non-directive context files |
| `audit.md` | Auditing the codebase | baseline | 3 new audit directives |
| `fix_tests.md` | Fixing tests based on regressions | baseline | 23 TARGETED:testing + 2 new regression-fix directives |
| `implement_feature.md` | Implementing a new feature into ./src, ./simulation, or ./tests | baseline | 23 TARGETED:testing + 14 APP:architecture + 6 APP:imgui + 3 APP:app-controller + 5 APP:rag-memory + 1 APP:mcp (the agent loads the union; an op-specific subset can be selected at invocation if size matters) |
| `refactor.md` | Refactoring or overhauling the codebase | baseline | 23 TARGETED:testing + 2 new refactor directives |
| `new_script_tool.md` | Making new script tools | baseline | 2 new script-authoring directives |
| `meta_tooling.md` | Adjusting meta-tooling | baseline | 1 APP:mcp + 1 new meta-tooling directive |
| `directives_curation.md` | Improving, curating, or adding workflow directives or context | baseline | 3 META + 3 TARGETED:documentation + 1 new curation directive |
| `documentation.md` | Writing or updating codebase documentation | baseline | 3 TARGETED:documentation + 1 new doc-update directive |
| `media_analysis.md` | Doing analysis on content from various media sources | baseline | 2 new media-analysis directives (no TARGETED:testing — media analysis does not touch the test suite) |
| `ideation.md` | Ideating new concepts or tools or ux with the user | baseline | 7 PROCESS:planning + 1 new ideation directive |
| `tier2_autonomous.md` | Tier-2 autonomous sandbox execution | baseline | 20 TARGETED:tier2-sandbox + 23 TARGETED:testing + 8 PROCESS:delegation |
---
## 2. Current State Audit (as of 2026-07-05)
### 2.1 Already Implemented (DO NOT re-implement)
- `conductor/directives/` — 172 directives, each `<name>/v1.md` + `meta.md`. 283K chars total, avg 1.6K chars each.
- `conductor/directives/tags.toml` — 6-dimension classification (layer, operation, tier, subject, severity, provenance) for all 172.
- `conductor/directives/presets/current_baseline.md` — the existing single preset; lists all 172. To be replaced (not deleted — kept as the original control group per its own Notes section).
- `manual-slop_aggregate_directives` MCP tool — resolves a preset's directive list and returns all `v1.md` bodies concatenated as one text blob. Already wired into `conductor/tier2/agents/tier2-autonomous.warm.md` (the `warm with:` block added 2026-07-05).
- `scripts/tier2/setup_tier2_clone_directives.ps1` — the Option A directive-based bootstrap (added 2026-07-05). Copies `.warm.md` into the clone's active agent slot, verifies the preset path resolves.
- `conductor/tier2/agents/tier2-autonomous.warm.md` — the directive-variant agent prompt. Currently 17.9KB; still contains inline bulk-markdown sections that duplicate ~9 directive subject areas.
### 2.2 Gaps to Fill (This Track's Scope)
1. **No curated baseline preset.** `current_baseline.md` is a flat list of all 172; no engagement filtering. The 57 BASELINE directives need to be separated out as their own preset.
2. **No engagement presets.** No `audit.md`, `fix_tests.md`, `implement_feature.md`, etc. An agent doing test-fix work warms on the same 172 as an agent doing media analysis.
3. **No non-directive-context section in presets.** The preset format only lists directives. There is no mechanism to force-read `conductor/product.md`, `conductor/tech-stack.md`, etc. — the product/tech context agents skip.
4. **No preset inheritance.** Each preset is a standalone list. Engagement presets re-list baseline directives by hand (or skip them). The `## Inherits` section is missing.
5. **`.warm.md` duplicates directive content.** ~9 inline sections in `tier2-autonomous.warm.md` duplicate directives already in the aggregate blob. The warm prompt is larger than it needs to be.
6. **Missing op-specific directives.** The 172 existing directives do not cover some engagement-specific behavior (audit-gate-as-convention, regression-bisect-to-clean-baseline, refactor-preserves-behavior, scripts-namespace-isolated, media-source-cited-in-output, etc.). New directives are needed for the engagement presets to have something targeted to add beyond the existing tagged subsets.
### 2.3 The 57 BASELINE directives (the cut)
Classification of all 172 by engagement relevance. The 57 BASELINE are the rules required to do anything in the codebase without creating entropy — type promotion, edit discipline, git hard bans, research-first, error handling, state management, process anti-patterns. Excludes anything tier-specific (tier1/tier2/tier3/tier4), anything app-subsystem-specific (imgui/rag/mcp/dsl/app-controller), anything testing-specific, anything documentation-specific, anything meta-directive.
```
atomic_per_task_commits
git_hard_bans
timeline_is_immutable
verbose_commit_message_ban
verify_before_editing
edit_small_incremental
mandatory_research_first
ast_parse_insufficient
ast_verify_class_methods_after_edit
decorator_orphan_pitfall
preserve_line_endings
contract_change_audit
search_all_call_sites_after_signature_change
anti_entropy_state_audit_before_adding
no_diagnostic_noise
no_comments_in_body
one_space_indent
type_hints_required
no_new_src_files_without_permission
file_naming_convention
large_files_are_fine
core_value_read_first
ban_any_type
ban_dict_any
ban_dict_get_on_known_fields
ban_getattr_dispatch
ban_hasattr_dispatch
ban_optional_returns
ban_local_imports
ban_prefix_aliasing
ban_repeated_from_dict
boundary_layer_exception
metadata_boundary_type
per_aggregate_dataclass_promotion
typed_dataclass_fields
nil_sentinel_pattern
result_error_pattern
missing_data_renders_as_em_dash_not_crash
comprehensive_logging
modular_controller_pattern
strict_state_management
inherited_cruft_ask_first
deduction_loop_limit
report_instead_of_fix_ban
scope_creep_track_doc_ban
reproduction_before_fix
single_hypothesis_minimal_test
three_fix_failures_question_architecture
cheap_fix_first_investigation_phases
evidence_before_completion_claims
verify_clean_baseline_before_starting
master_branch_default
pathlib_read_write_no_newline_kwarg
sdm_dependency_tags
convention_enforcement_4_mechanisms
skill_check_before_clarifying
no_content_duplication_across_agent_docs
```
Full classification (all 172 → category) is in §2.4 below for the record.
### 2.4 Full classification (all 172)
| Category | Count | Directives |
|---|---|---|
| BASELINE | 57 | (listed in §2.3) |
| TARGETED:testing | 23 | tdd_red_green_required, test_must_fail_for_believed_reason, test_passing_immediately_proves_nothing, test_narrow_not_kitchen_sink, batch_verification_not_isolation, fragile_test_in_batch_is_failing_test, no_skip_markers_as_avoidance, ban_arbitrary_core_mocking, test_instantiation_not_mock_away, adapt_test_mocks_to_production_api_change, live_gui_poll_not_sleep, live_gui_session_scoped_no_restart, no_real_io_during_tests, enforce_no_real_toml_in_tests, test_sandbox, workspace_paths, opt_in_integration_test_via_env_var_marker, deterministic_signal_endpoint_pattern, failure_message_actionable_not_vague, three_tier_test_strategy_for_fragile_subsystems, test_classification_via_import_presence, surface_dirty_state_in_test_runner, imscope_tuple_return_per_scope_override |
| TARGETED:tier2-sandbox | 20 | ban_appdata_paths, use_batched_test_runner, no_output_filtering, prefer_targeted_tier_runs, throwaway_scripts_isolated_subdir, acknowledgment_in_first_commit, end_of_track_report_required, tier2_pre_commit_deletion_and_diff_check, tier2_pre_flight_audit_gates, tier2_post_track_ruff_mypy_audit, per_phase_metric_regression_fix, run_full_tier_after_phase_refactor, user_corrections_log_in_state_toml, surface_gaps_at_discovery_not_checkpoint, chronology_must_regenerate_after_every_track_ship, use_git_history_as_classification_source_of_truth, classifier_must_emit_per_row_evidence, quality_gate_catches_broken_classifier_before_ship, manual_compaction_only_no_auto_summarize, preserve_before_compact_archive |
| APP:architecture | 14 | defer_heavy_sdk_imports_to_subprocess, defer_not_catch_for_native_crashes, graceful_optional_dependency_degradation, submit_io_lazy_pool_recreation, log_pruner_backoff_for_locked_files, undo_redo_100_snapshot_capacity, feature_flag_delete_to_turn_off, runtime_config_flag_vs_test_env_var_gate, interceptor_activates_only_on_matching_shape, quarantine_flag_the_engine_not_shared_types, profile_first_optimize_second, state_visible_at_the_right_layer, per_conversation_scratch_dir, file_id_stable_across_rename |
| PROCESS:delegation | 8 | tier3_worker_amnesia, tier4_qa_compressed_fix, token_firewall_prevents_bloat, never_inherit_session_history_to_subagent, subagent_returns_artifact_not_transcript, agent_prompt_one_independent_domain, decompose_or_isolate_never_offload, worker_three_point_abort_check |
| PROCESS:planning | 7 | brainstorm_even_for_simple_projects, design_leads_with_recommendation, spec_self_review_four_checks, plan_steps_2_to_5_minutes_each, plans_no_placeholders_or_tbds, review_plan_critically_before_executing, surface_upstream_api_limits_honestly_in_spec |
| PROCESS:review | 7 | review_after_each_task_not_end, spec_review_before_quality_review, verify_critique_before_implementing, no_performative_agreement_in_review, clarify_unclear_review_before_partial_impl, verify_tests_before_offering_completion_options, exactly_four_completion_options |
| APP:imgui | 6 | imgui_scope_verification, imgui_scope_entered_flag_for_no_op_return, ui_delegation_for_hot_reload, modal_explicit_opened_list_for_lifecycle, view_composes_does_not_leak_into_theme_get_color, float_only_math_for_visual_transforms |
| APP:rag-memory | 5 | per_dimension_pick_dim_not_tool, cache_stable_to_volatile, rag_six_rules, knowledge_harvest_pattern, chroma_cache_path |
| PROCESS:tier1 | 5 | tier1_orchestrator_no_implementation, tier1_first_commit_6file_acknowledgment, spec_template_required_6_sections, audit_before_claiming_current_state, ban_day_estimates |
| APP:dsl-research | 4 | dsl_uses_first_class_spans_for_errors, intent_signal_postfix_not_xml, pipeline_immediate_mode_no_object, parse_failure_visible_to_conversation |
| APP:app-controller | 3 | controller_property_delegation_no_dual_state, config_state_owner, reset_session_preserves_project_path |
| META | 3 | verbatim_lift_not_rewrite, warm_md_duplicates_not_in_place, generation_script_walks_filesystem_fresh_each_run |
| PROCESS:workflow | 3 | detect_existing_isolation_before_creating, preserve_prior_versions_of_review_docs, system_reminder_redact_don_act |
| TARGETED:documentation | 3 | docs_philosophy_then_boundaries_then_logic_then_verify, neutral_language_for_doc_drift, no_conductor_yaml_for_artifacts |
| APP:mcp | 1 | meta_tooling_app_boundary_check |
---
## 3. Goals
- **G1:** Curated `baseline.md` preset containing only the 57 BASELINE directives + 4 non-directive context files (`AGENTS.md`, `conductor/product.md`, `conductor/product-guidelines.md`, `conductor/tech-stack.md`).
- **G2:** Engagement presets (12 total) that inherit baseline and add targeted directives per work pattern.
- **G3:** Preset format extension: `## Inherits` (parent preset name) + `## Non-directive context` (full markdown files to read separately from the directive aggregate).
- **G4:** `manual-slop_aggregate_directives` MCP tool extended to resolve `## Inherits` (recursively flatten parent directives into the child's directive list) and to surface non-directive-context files in the returned blob (as a separate prefixed section, so the agent reads them as full docs, not as directives).
- **G5:** 15 new op-specific directives created to fill engagement-preset gaps (audit: 3, fix_tests: 2, refactor: 2, new_script_tool: 2, meta_tooling: 1, directives_curation: 1, documentation: 1, media_analysis: 2, ideation: 1). Each follows the existing `<name>/v1.md + meta.md` convention.
- **G6:** `conductor/tier2/agents/tier2-autonomous.warm.md` deduplicated — inline bulk-markdown sections that duplicate directives (AppData, git restore/stash, timeline-immutable, run_tests_batched, failcount, tier3/tier4 delegation, etc.) stripped. The warm prompt becomes a thin shell: domain distinction, pre-action reading list (the 11 files), the `warm with:` aggregate call pointing at the new `tier2_autonomous.md` preset, and the tier-2-sandbox targeted additions not covered by directives.
- **G7:** `current_baseline.md` retained as the original control-group preset (not deleted); the new `baseline.md` is the curated replacement. The Notes section of `current_baseline.md` is updated to mark it deprecated-but-kept.
- **G8:** `scripts/tier2/setup_tier2_clone_directives.ps1` `-PresetPath` default updated from `conductor/directives/presets/current_baseline.md` to `conductor/directives/presets/tier2_autonomous.md`.
---
## 4. Functional Requirements
### 4.1 Preset file format
Each preset is a markdown file in `conductor/directives/presets/`. Structure:
```markdown
# Preset: <name>
<one-paragraph description of what this preset is for>
## Inherits
<parent_preset_name_without_md_extension>
# (optional — omit if this is baseline)
## Directives to warm
Read each file below before any action.
- <directive_name>: conductor/directives/<directive_name>/v1.md
- ...
## Non-directive context
Read each file below as full documents (NOT as directives — these carry product/tech/architecture context the directives reinforce but do not fully encode).
- <file_description>: <relative_path>
## Notes
<provenance, hypothesis, what this preset is testing if experimental>
```
### 4.2 Aggregate tool behavior
`manual-slop_aggregate_directives(preset_path, max_chars)`:
1. Parse the preset file. Extract `## Inherits` (if any), `## Directives to warm` (the list), `## Non-directive context` (the list).
2. Recursively resolve `## Inherits`: read the parent preset, append its directives + non-directive-context to this preset's (child wins on conflict — if a directive appears in both, it appears once; if a non-directive file appears in both, it appears once).
3. For each directive in the flattened list, read `conductor/directives/<name>/v1.md` and concatenate the body into the output blob (same format as today: `========\n<name>\n========\n\n<body>\n\n`).
4. After the directives section, append a `========\nNON-DIRECTIVE CONTEXT\n========\n\n` section listing each non-directive-context file's full path + the full file body. The agent reads these as full documents, not as directives.
5. Return the concatenated blob. `max_chars` caps total size.
### 4.3 Engagement preset composition
Each engagement preset:
- `## Inherits`: `baseline`
- `## Directives to warm`: the targeted subset for that engagement (e.g., `fix_tests.md` lists the 23 TARGETED:testing directives + the 2 new regression-fix directives)
- `## Non-directive context`: engagement-specific docs (e.g., `documentation.md` lists `docs/Readme.md` + `docs/AGENTS.md`; `meta_tooling.md` lists `docs/guide_meta_boundary.md`)
- `## Notes`: hypothesis + provenance
### 4.4 New op-specific directives (15 total)
Each follows the existing `<name>/v1.md + meta.md` convention. The `v1.md` is a verbatim lift or a new imperative rule (per `verbatim_lift_not_rewrite`, only lift when there's a source; new rules are written from scratch with the same format). The `meta.md` records the source (or "new rule, no prior source" for the new ones).
| Directive | Engagement preset | What it says |
|---|---|---|
| `audit_script_as_gate` | audit | Audit scripts that classify or summarize must have a `--strict` quality gate that exits 1 on regression |
| `audit_walks_filesystem_fresh` | audit | Audit scripts walk the filesystem fresh on every run — never pin to a historical snapshot |
| `baseline_capture_before_work` | audit | Before any track, capture the audit baseline numbers to a file so per-task deltas are auditable |
| `regression_bisect_to_clean_baseline` | fix_tests | When fixing a regression, bisect to the last known-green commit before proposing a fix |
| `adapt_test_not_skip_test` | fix_tests | When a test fails due to a production API change, adapt the test to the new contract — never skip it |
| `refactor_preserves_behavior` | refactor | A refactor must preserve observable behavior — tests passing before must pass after |
| `refactor_one_subsystem_per_phase` | refactor | Refactor one subsystem per phase — never touch two subsystems in the same atomic commit |
| `scripts_namespace_isolated` | new_script_tool | Scripts are namespace-isolated by directory — no `from scripts.foo import bar` across script dirs |
| `scripts_audit_pattern` | new_script_tool | New audit scripts follow the `audit_<thing>.py` naming + `--json` + `--strict` pattern of the existing 4 |
| `meta_tooling_no_app_imports` | meta_tooling | Meta-tooling scripts must not import `src/` application modules — the meta-tooling domain is distinct from the application domain |
| `directive_one_concept_per_file` | directives_curation | One directive per directory — do not combine two rules in one `v1.md` |
| `doc_update_after_track_ships` | documentation | After a track ships, update the affected `docs/guide_*.md` to reflect the new module structure |
| `media_source_cited_in_output` | media_analysis | Media analysis output must cite the source URL/timestamp for every claim — no unsourced assertions |
| `media_analysis_neutral_voice` | media_analysis | Media analysis output uses neutral voice — value judgments about the source content are the user's call, not the agent's |
| `ideation_leads_with_recommended` | ideation | Ideation sessions lead with a recommended concept + the reasoning, not 3 unranked options |
### 4.5 `.warm.md` dedup
Strip these inline sections from `conductor/tier2/agents/tier2-autonomous.warm.md` (their content is in the directives now):
- "Hard Bans" section (covered by `git_hard_bans`, `ban_appdata_paths`, `timeline_is_immutable`)
- "Conventions" section test-runner rules (covered by `use_batched_test_runner`, `no_output_filtering`, `prefer_targeted_tier_runs`, `master_branch_default`, `preserve_line_endings`, `throwaway_scripts_isolated_subdir`, `end_of_track_report_required`)
- "Sub-Agent Delegation" section (covered by `tier3_worker_amnesia`, `tier4_qa_compressed_fix`, `agent_prompt_one_independent_domain`, `decompose_or_isolate_never_offload`)
- "Failcount Contract" section (kept inline — no directive covers the specific thresholds; this is tier-2-sandbox operational detail that belongs in the prompt)
- "TDD Protocol" section (covered by `tdd_red_green_required`, `per_phase_metric_regression_fix`)
- "Pre-Delegation Checkpoint" section (kept inline — no directive covers the specific `git add .` safety net)
- "Per-Task Commit Protocol" section (covered by `atomic_per_task_commits`, `verbose_commit_message_ban`)
- "Limitations" section (kept inline — tier-2-specific scope, no directive)
After dedup, the `.warm.md` is approximately: frontmatter + domain distinction + pre-action reading list (the 11 files) + the `warm with:` aggregate call (now pointing at `tier2_autonomous.md` preset) + failcount contract (inline, no directive) + pre-delegation checkpoint (inline) + limitations (inline). Estimated ~6KB down from 17.9KB.
---
## 5. Non-Functional Requirements
- **NFR1:** Preset files are markdown (no YAML, no TOML — per `no_conductor_yaml_for_artifacts`). Parseable by the aggregate tool via simple regex / line-by-line scan.
- **NFR2:** The aggregate tool's `## Inherits` resolution is bounded to 3 levels deep (preset → parent → grandparent) to prevent infinite loops. Baseline has no parent.
- **NFR3:** The aggregate tool's non-directive-context section is prefixed clearly so the agent can distinguish "directive body" from "full document context" in the returned blob.
- **NFR4:** New directives follow the 1-space-indent + type-hints + no-comments-in-body conventions (the directives themselves are markdown, so the Python conventions don't apply to the `v1.md` body, but any code examples inside the `v1.md` must follow them).
- **NFR5:** `tags.toml` is updated for the 15 new directives (6-dim classification per the existing schema).
- **NFR6:** The `current_baseline.md` file is retained; its Notes section is updated to mark it deprecated-but-kept as the original control group.
---
## 6. Architecture Reference
- **Existing preset mechanism:** `conductor/directives/presets/current_baseline.md` (the single preset; lists all 172 directives). Documented in `conductor/directives/warm_md_duplicates_not_in_place/v1.md`.
- **Aggregate tool:** `manual-slop_aggregate_directives` MCP tool (in `scripts/mcp_server.py` via the `mcp_tool_specs.py` registry). Resolves a preset's directive list, reads each `v1.md`, concatenates. Already supports `max_chars` capping.
- **Warm-up wiring:** `conductor/tier2/agents/tier2-autonomous.warm.md` §"MANDATORY: Directive Warm-up (single aggregate read)" — calls the aggregate tool with the preset path. Added 2026-07-05.
- **Directive conventions:** `conductor/directives/verbatim_lift_not_rewrite/v1.md` (harvest rule: verbatim lift, not rewrite), `conductor/directives/warm_md_duplicates_not_in_place/v1.md` (experimental variants as `.warm.md` duplicates, originals untouched).
- **Tag system:** `conductor/directives/tags.toml` — 6-dim classification (layer / operation / tier / subject / severity / provenance). The 15 new directives need entries here.
- **Bootstrap script:** `scripts/tier2/setup_tier2_clone_directives.ps1``-PresetPath` parameter (default `conductor/directives/presets/current_baseline.md`; to be updated to `tier2_autonomous.md`).
---
## 7. Out of Scope
- **Preset auto-discovery / fuzzy selection.** The user (or the agent's invoker) passes the preset path explicitly. No "auto-detect the engagement type from the task prompt" mechanism in this track.
- **A/B testing harness for presets.** The `current_baseline.md` Notes section mentions "alternative encodings" as a future experiment. This track creates the preset files but does not build the comparison harness.
- **Per-tier-3-worker sub-presets.** Tier-3 workers get surgical prompts from Tier-2; they do not warm on presets themselves. This track is about Tier-1/Tier-2/interactive-agent warm-ups.
- **Non-directive-context for `docs/guide_*.md`.** The 33 deep-dive guides are too large (606K total) to force-read in every warm-up. They remain on-demand. Only the 4 small conductor docs (`AGENTS.md`-equivalent, product, product-guidelines, tech-stack) are in the baseline non-directive-context. Engagement presets may add specific guides (e.g., `documentation.md` adds `docs/Readme.md`).
- **The `tier2-autonomous.md` (bulk-markdown original) prompt.** This track deduplicates `.warm.md`; the bulk-markdown original stays untouched as the rollback target per `warm_md_duplicates_not_in_place`.
---
## 8. Risks
- **R1: Aggregate tool returns too large a blob for engagement presets that union many categories.** `implement_feature.md` inherits baseline (57) + TARGETED:testing (23) + APP:architecture (14) + APP:imgui (6) + APP:app-controller (3) + APP:rag-memory (5) + APP:mcp (1) = 109 directives + 4 non-directive files. At avg 1.6K chars/directive, that's ~175K chars (~44K tokens) for directives alone, plus the non-directive context. Mitigation: the agent picks the engagement preset at invocation; if size matters, an op-specific subset can be passed. The `max_chars` cap exists.
- **R2: New directives are written from scratch (no prior source to verbatim-lift).** The `verbatim_lift_not_rewrite` rule says "verbatim lift of source text, not rewrite." The 15 new directives have no prior source — they are new rules. The `meta.md` records "new rule, no prior source" per the existing convention (the original harvest also created new directives when no source existed).
- **R3: Dedup of `.warm.md` removes content the agent actually needs inline.** The failcount contract, pre-delegation checkpoint, and limitations sections are kept inline because no directive covers the specific tier-2 operational detail. The risk is removing something that turns out to be load-bearing. Mitigation: the dedup is conservative — only sections whose content is fully covered by a directive are stripped.
---
## 9. Verification
- **V1:** `manual-slop_aggregate_directives(preset_path="conductor/directives/presets/baseline.md")` returns a blob containing exactly the 57 baseline directive bodies + the 4 non-directive context files.
- **V2:** `manual-slop_aggregate_directives(preset_path="conductor/directives/presets/fix_tests.md")` returns the 57 baseline + 23 TARGETED:testing + 2 new regression-fix directives + the 4 non-directive context files (inherited from baseline).
- **V3:** Each of the 15 new directives has a `v1.md` + `meta.md` + a `tags.toml` entry.
- **V4:** `conductor/tier2/agents/tier2-autonomous.warm.md` is reduced from ~17.9KB to ~6KB; the stripped sections' content is present in the directive aggregate when warming with `tier2_autonomous.md` preset.
- **V5:** `scripts/tier2/setup_tier2_clone_directives.ps1 -PresetPath` defaults to `conductor/directives/presets/tier2_autonomous.md`; the script runs clean and the clone's agent slot has the aggregate call.
---
## 10. Coordination with Pending Tracks
No blocking tracks. The `directive_hotswap_harness_20260627` track (the original harvest) is complete; its artifacts (`current_baseline.md`, `tags.toml`, the 172 directives) are the inputs to this track. The `tier2_leak_prevention_20260620` track is merged; its spec is referenced by the `.warm.md` pre-action reading list but is not a structural dependency.
---
## 11. See Also
- `conductor/directives/presets/current_baseline.md` — the original control-group preset (retained)
- `conductor/directives/tags.toml` — the 6-dim classification
- `conductor/directives/verbatim_lift_not_rewrite/v1.md` — the harvest rule
- `conductor/directives/warm_md_duplicates_not_in_place/v1.md` — the `.warm.md` duplicate rule
- `conductor/tier2/agents/tier2-autonomous.warm.md` — the directive-variant agent prompt (to be deduplicated)
- `scripts/tier2/setup_tier2_clone_directives.ps1` — the directive-based bootstrap
- `docs/superpowers/specs/2026-07-05-directive-preset-system-design.md` — this spec
File diff suppressed because it is too large Load Diff