Private
Public Access
Archive directive hotswap harness
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
# Directive Harvest — Phase 1 Summary
|
||||
|
||||
**Status:** Phase 1 complete. 51 directive variants lifted verbatim into `conductor/directives/<name>/v1.md`.
|
||||
|
||||
## What shipped
|
||||
|
||||
51 v1.md files across 51 directive directories. Each is a verbatim lift of the imperative-ban / rationale-bullet style currently in production, with a header annotating the source location for future cross-referencing.
|
||||
|
||||
| Task | # of directives | Sources |
|
||||
|---|---|---|
|
||||
| t1_1 | 7 | `conductor/code_styleguides/python.md` §17.1-17.7 |
|
||||
| t1_2 | 3 | `.opencode/commands/mma-tier3-worker.md:42-46` (drift-corrected from python.md §17.9) |
|
||||
| t1_3 | 2 | `conductor/code_styleguides/error_handling.md` |
|
||||
| t1_4 | 2 new + 1 updated | `data_oriented_design.md` §8.5 + `type_aliases.md` + python.md §17.7/17.8 |
|
||||
| t1_5 | 5 | `python.md` + `workflow.md` + `product-guidelines.md` + `AGENTS.md` |
|
||||
| t1_6 | 3 | `AGENTS.md` + `workflow.md` |
|
||||
| t1_7 | 10 | `AGENTS.md` + `workflow.md` |
|
||||
| t1_8 | 6 | `AGENTS.md` §Process Anti-Patterns + `workflow.md` Skip-Marker Policy |
|
||||
| t1_9 | 5 | `product-guidelines.md` + `python.md` §15 |
|
||||
| t1_10 | 8 | 4 from plan + 4 from new styleguides (config_state_owner, workspace_paths, test_sandbox, chroma_cache_path) |
|
||||
| **Total** | **51** | |
|
||||
|
||||
## What was skipped
|
||||
|
||||
Of the 5 newly-added styleguides (per the 2026-07-02 spec edit), 4 contained directive-like content and were harvested; 1 was skipped:
|
||||
|
||||
- **`conductor/code_styleguides/code_path_audit.md`** — SKIPPED. The 4 conventions (per-aggregate profile structure, the 4 decomposition directions, the override file format, the mem-dim classification rules) describe the audit script's outputs and formats, not what the agent should do. They are descriptive of an internal tool, not prescriptive for the LLM. If future tracks need an "audit-script-usage" directive, that should be created separately with explicit rules like "before modifying an aggregate, run `python scripts/code_path_audit/code_path_audit.py <aggregate_name>` and check the recommended_direction".
|
||||
|
||||
## Source drift corrections
|
||||
|
||||
Several plan line refs were stale (the doc tree moved during the 2026-06-27 cruft-elimination refactor). All v1.md `**Source:**` lines reflect the actual verified line ranges:
|
||||
|
||||
- `python.md` plan claimed §17 = lines 243-473; actual file is 359 lines. The §17.1-17.7 ranges were corrected in v1.md headers (each off by ~1 line).
|
||||
- `python.md` plan claimed §17.9 = lines 364-443; that section was deleted during the cruft_elimination_20260627 refactor. The §17.9 content (local imports / _PREFIX aliasing / repeated from_dict) now lives in `.opencode/agents/tier3-worker.md` and `.opencode/commands/mma-tier3-worker.md`. The 3 directives (t1_2) lift from `.opencode/commands/mma-tier3-worker.md:42-46`.
|
||||
- All other plan line refs were close to actual (off by 1-3 lines); verified by `get_file_slice` before each lift and corrected in the v1.md `**Source:**` line where drifted.
|
||||
|
||||
## Phase 1 stop point
|
||||
|
||||
Per the dispatch prompt: "After Phase 1 completes, you STOP and report back to the Tier 2 Tech Lead. Phase 2 (baseline preset + role-prompt warm-with: bootstrap) requires the Tier 2's review and decision on per-tier preset variants before dispatching Tier 3 again."
|
||||
|
||||
Phase 2 work (current_baseline.md + 5 role-prompt warm with: updates) is deferred to the next Tier 2 dispatch.
|
||||
@@ -1,254 +0,0 @@
|
||||
Track: directive_hotswap_harness_20260627
|
||||
Plan: conductor/tracks/directive_hotswap_harness_20260627/plan.md
|
||||
Spec: conductor/tracks/directive_hotswap_harness_20260627/spec.md
|
||||
State: conductor/tracks/directive_hotswap_harness_20260627/state.toml
|
||||
|
||||
You are executing Phase 1 (Directive Harvest) of the harness plan.
|
||||
This is a docs-only track — the artifacts are markdown files under
|
||||
conductor/directives/. No src/*.py code changes in this phase.
|
||||
|
||||
# Pre-flight (MANDATORY before any edit)
|
||||
|
||||
1. Read conductor/tracks/directive_hotswap_harness_20260627/spec.md in full (verbatim, do not paraphrase).
|
||||
2. Read conductor/tracks/directive_hotswap_harness_20260627/plan.md in full.
|
||||
3. Read conductor/tracks/directive_hotswap_harness_20260627/state.toml — update current_phase from 0 to 1 when starting; advance task statuses as you complete each.
|
||||
4. Update conductor/index.md's "Last comprehensive doc refresh" date if you touch any guide.
|
||||
5. Update conductor/tracks.md to add `directive_hotswap_harness_20260627` row in the Standby section IF NOT already present. CHECK FIRST.
|
||||
6. Read `conductor/code_styleguides/python.md` §17 once for the verbatim source text you'll be lifting (the plan's line refs were updated 2026-07-02; verify they still match by get_file_slice, do not trust the plan blindly).
|
||||
|
||||
# Atomic per-task commits (HARD RULE)
|
||||
|
||||
- ONE task = ONE commit. No batching.
|
||||
- Every commit MUST be atomic per the project's commit discipline (see conductor/workflow.md §"AT THE END OF EACH TASK").
|
||||
- Per-task git notes are REQUIRED: see step 10 in workflow.md §"Standard Task Workflow".
|
||||
- Use Conventional Commits prefix `feat(directives):` for the harvest commits and `docs(role-prompts):` for Phase 2.
|
||||
|
||||
# Phase 1 tasks (follow plan §1.1 through §1.11 in order)
|
||||
|
||||
For EACH plan task (t1_1 through t1_10), the directive creates N variant
|
||||
files. For each v1.md file:
|
||||
|
||||
1. Source the directive text via `get_file_slice` (the line range the
|
||||
plan provides is the planner's best estimate; verify against current
|
||||
line numbers via `grep -n` first).
|
||||
2. Create `conductor/directives/<name>/v1.md` using the EXACT format from
|
||||
the plan (the variant header format block under t1_1).
|
||||
3. The variant content is a VERBATIM lift of the source text — NOT a
|
||||
rewrite. The harvester is documenting current state.
|
||||
4. After each batch of v1.md files (per plan step), run `git add` +
|
||||
`git commit` with message: `feat(directives): harvest <count>
|
||||
directives from <source-file> (§<N>)`.
|
||||
|
||||
The current line refs in plan.md (post 2026-07-02 drift-fix) are:
|
||||
|
||||
- python.md §17: 243-473. The 7 banned patterns + §17.7 boundary exception + §17.8 enforcement + §17.9 local imports + §17.10 enforcement inventory.
|
||||
- python.md §17.1 ban_dict_any: 247-264
|
||||
- python.md §17.2 ban_any_type: 266-277
|
||||
- python.md §17.3 ban_optional_returns: 279-299
|
||||
- python.md §17.4 ban_hasattr_dispatch: 301-326
|
||||
- python.md §17.5 ban_getattr_dispatch: 328-338
|
||||
- python.md §17.6 ban_dict_get_on_known_fields: 340-350
|
||||
- python.md §17.7 boundary_layer_exception: 352-354
|
||||
- python.md §17.9 (all 3): 364-443 (covers §17.9a/17.9b/17.9c)
|
||||
- python.md §1-§2 (one_space_indent + type_hints_required pieces): 7-31
|
||||
- python.md §8 (no_comments, no_diagnostic_noise): 64-71
|
||||
- python.md §12 (sdm_dependency_tags): 202-211
|
||||
- python.md §13 (vertical_compaction): 212-224
|
||||
- python.md §15 (modular_controller_pattern): 234-241
|
||||
- error_handling.md §1 (The 5 Patterns): 22-131
|
||||
- error_handling.md §2 (Hard Rules): 212-264
|
||||
- error_handling.md §3 (Boundary Types): 284-365
|
||||
- data_oriented_design.md §8.5-8.7: 176-215
|
||||
- type_aliases.md (the per-aggregate pattern + promotion rules): 13-160
|
||||
|
||||
Verify each before lifting. If a line range has drifted, fix it in
|
||||
the v1.md's header (the "Source:" line) to reflect the actual range
|
||||
you lifted from. Do not propagate stale refs into the harvest.
|
||||
|
||||
# Spec amendments made 2026-07-02 (during drift audit)
|
||||
|
||||
The drift audit (11 commits f463edf9..6f4832b6) added 5 new styleguides
|
||||
to the spec's "Sources to comb" list (in the spec file itself — verify
|
||||
the edit landed at spec.md line ~134-156). The 5 new sources are:
|
||||
|
||||
- conductor/code_styleguides/config_state_owner.md — AppController is single source of truth for config I/O
|
||||
- conductor/code_styleguides/workspace_paths.md — test infrastructure paths must live under ./tests/
|
||||
- conductor/code_styleguides/test_sandbox.md — FR1/FR2/FR3 test sandbox conventions
|
||||
- conductor/code_styleguides/chroma_cache.md — ChromaDB cache conventions
|
||||
- conductor/code_styleguides/code_path_audit.md — per-aggregate data pipeline audit convention
|
||||
|
||||
**Before lifting from any of these 5, read the file first** to determine
|
||||
if it contains directive-like content (imperative/ban/preference). If
|
||||
purely descriptive, SKIP and add a note to t1_11's commit body listing
|
||||
which were skipped and why. This may bump the directive count below
|
||||
the plan's 48.
|
||||
|
||||
Also note that the audit found that `conductor/code_styleguides/python.md`
|
||||
§17.8 and §17.10 referenced `audit_optional_returns.py` which does NOT
|
||||
exist (corrected in commit 9d1fef73 to `audit_optional_in_3_files.py`).
|
||||
When you lift §17.8 enforcement content, use the CURRENT version (the
|
||||
post-fix python.md), not the pre-fix version.
|
||||
|
||||
# Phase 1 task order
|
||||
|
||||
Strictly sequential (each step depends on the prior):
|
||||
|
||||
t1_1 → §17 banned patterns (7 directives; ban_dict_any..boundary_layer_exception)
|
||||
t1_2 → §17.9 import/aliasing bans (3 directives)
|
||||
t1_3 → Error handling conventions (2 directives)
|
||||
t1_4 → Type/data-structure conventions (3 directives; updates boundary_layer_exception)
|
||||
t1_5 → Code style directives (5 directives)
|
||||
t1_6 → File/taxonomy conventions (3 directives)
|
||||
t1_7 → Process/workflow directives (10 directives)
|
||||
t1_8 → Process anti-patterns (6 directives)
|
||||
t1_9 → GUI/architecture directives (5 directives)
|
||||
t1_10 → Feature-flag + RAG + cache + knowledge directives (4 directives)
|
||||
t1_11 → Commit the harvest (one final commit summarizing the 48 lifted v1.md files)
|
||||
|
||||
After t1_11: per state.toml, advance current_phase to 2 (mark phase_1
|
||||
complete = true via the verification table).
|
||||
|
||||
# Phase 2 (do NOT execute yet)
|
||||
|
||||
After Phase 1 completes, you STOP and report back to the Tier 2 Tech
|
||||
Lead. Phase 2 (baseline preset + role-prompt warm-with: bootstrap)
|
||||
requires the Tier 2's review and decision on per-tier preset variants
|
||||
before dispatching Tier 3 again. Do not auto-execute Phase 2.
|
||||
|
||||
# Conventions (mandatory per the project's data-oriented styleguide)
|
||||
|
||||
- 1-space indentation for Python (you won't write any Python here; this
|
||||
is a docs-only track).
|
||||
- No diagnostic stderr writes.
|
||||
- No new src/*.py files.
|
||||
- NO COMMENTS in the v1.md files unless the source doc had comments
|
||||
(verbatim lifts preserve everything). Actually — VERBATIM means
|
||||
the directive text INCLUDING any formatting/headers the source has.
|
||||
- Each v1.md's `**Source:**` line is metadata about where the directive
|
||||
came from, so it's fine to add (it's not a comment about your code).
|
||||
|
||||
# Skill activation
|
||||
|
||||
Before any action: `activate_skill mma-orchestrator`. Then activate
|
||||
the sub-skill pattern by following the role-prompt warm-up rules
|
||||
(currently the role prompts hardcode ~11 files to read; just read
|
||||
those 11 files yourself).
|
||||
|
||||
# Acknowledgment
|
||||
|
||||
After completing the dispatch:
|
||||
1. Update `conductor/tracks/directive_hotswap_harness_20260627/state.toml`:
|
||||
- current_phase: 1 -> 2
|
||||
- phase_1.complete = true
|
||||
- phase_1.checkpointsha = <commit hash>
|
||||
- task t1_1 through t1_11 complete with respective commit hashes
|
||||
2. Run `uv run python scripts/audit/generate_chronology.py --draft >
|
||||
conductor/chronology.md` to regenerate (per workflow.md Chronology
|
||||
Maintenance section).
|
||||
3. Run the chronology quality gate: `uv run python -m
|
||||
scripts.audit.chronology_quality_gate --strict` (must exit 0 before
|
||||
the regenerated-chronology commit).
|
||||
4. Commit the regenerated chronology.
|
||||
5. Hand off to Tier 2 with a summary.
|
||||
|
||||
# Files you'll touch
|
||||
|
||||
- NEW: conductor/directives/<48 names>/v1.md (per the plan; possibly fewer
|
||||
if the 5 new styleguides have no directive content)
|
||||
- NEW: conductor/directives/presets/current_baseline.md (Phase 2 — NOT YET)
|
||||
- MODIFIED: conductor/tracks/directive_hotswap_harness_20260627/state.toml
|
||||
- MODIFIED (regenerated): conductor/chronology.md
|
||||
|
||||
# Coverage contract
|
||||
|
||||
The track's verification_criteria (per metadata.json, when you read it)
|
||||
will assert:
|
||||
- directive_count == 48 (or fewer if you skip any of the 5 new styleguides)
|
||||
- phase_1_complete == true
|
||||
- role_prompts_updated == false (that's Phase 2, NOT yet)
|
||||
- preset_exists == false (that's Phase 2, NOT yet)
|
||||
|
||||
If verification_criteria has other fields, address each.
|
||||
|
||||
# COMMIT / GIT NOTE discipline
|
||||
|
||||
Every commit MUST have a git note attached. See conductor/workflow.md
|
||||
§"Standard Task Workflow" step 10 for the format. The git note content
|
||||
must include:
|
||||
- Task name + number
|
||||
- Files touched (with line counts)
|
||||
- The core "why"
|
||||
|
||||
Use `git notes add -m "..." <commit-hash>` after each commit.
|
||||
|
||||
# Deliverables per task
|
||||
|
||||
For each lifted v1.md:
|
||||
1. The v1.md file at conductor/directives/<name>/v1.md
|
||||
2. The atomic commit
|
||||
3. The git note
|
||||
|
||||
For the Phase 1 checkpoint commit (t1_11):
|
||||
- One commit covering t1_11's summarization (or N commits, one per
|
||||
lifted group, then t1_11 as the meta summary)
|
||||
- The git note summarizing the harvest
|
||||
|
||||
After Phase 1 done:
|
||||
- Updated state.toml
|
||||
- Regenerated chronology.md
|
||||
- Updated chronology quality gate committed
|
||||
|
||||
# STOP AFTER PHASE 1
|
||||
|
||||
Per the "Phase 2 do NOT execute yet" rule above, stop and hand off.
|
||||
|
||||
If you encounter blockers that the plan does not cover:
|
||||
- File drift the plan does not address
|
||||
- Directive ambiguity (merge/split/keep)
|
||||
- Styleguide content where the directive nature is unclear
|
||||
|
||||
Report the blocker with file:line evidence and let Tier 2 decide.
|
||||
|
||||
# Per-skill activation note
|
||||
|
||||
This task does NOT require `mma-tier1-orchestrator` (you are not
|
||||
creating a new track — the track is already initialized). It DOES
|
||||
require `mma-tier2-tech-lead` (you are executing the plan). Activate it.
|
||||
|
||||
# Final note
|
||||
|
||||
USE EXACTLY 1-SPACE INDENTATION FOR PYTHON IF YOU WRITE ANY. You
|
||||
shouldn't be writing Python for this task — it's markdown only — but if
|
||||
you do write any tooling or verification scripts, 1-space it.
|
||||
|
||||
NEVER use `git checkout -- <file>`, `git restore`, or `git reset`
|
||||
without explicit user permission. See AGENTS.md for the ban list.
|
||||
|
||||
NEVER filter test output through Select-Object/head/tail per
|
||||
AGENTS.md. Redirect to a log file.
|
||||
|
||||
NEVER run `scripts/audit/generate_chronology.py` to regenerate
|
||||
`conductor/chronology.md` — it corrupts Unicode characters (em-dashes,
|
||||
ellipses, BOM markers all become mojibake). The user will regenerate
|
||||
the chronology manually if needed.
|
||||
|
||||
# USER DIRECTIVE (2026-07-02) — Phase 2 file convention
|
||||
|
||||
Phase 2's "update role prompts" step is **making duplicates**, NOT
|
||||
modifying in place. Concretely:
|
||||
|
||||
- For each of the 5 originals, create a NEW file with `.warm.md`
|
||||
suffix: `<name>.md` stays untouched as the fallback path; `<name>.warm.md`
|
||||
is the experimental role prompt that uses the `warm with:` bootstrap.
|
||||
- Output files: `.opencode/agents/tier1-orchestrator.warm.md`,
|
||||
`.opencode/agents/tier2-tech-lead.warm.md`,
|
||||
`.opencode/agents/tier3-worker.warm.md`,
|
||||
`.opencode/agents/tier4-qa.warm.md`,
|
||||
`conductor/tier2/agents/tier2-autonomous.warm.md`.
|
||||
- The user can `mv <name>.warm.md <name>.md` to promote a duplicate
|
||||
to active, or `rm <name>.warm.md` to fall back to the original.
|
||||
- The originals stay as the rollback target. NO in-place edits.
|
||||
|
||||
This directive is also recorded in
|
||||
`conductor/tracks/directive_hotswap_harness_20260627/spec.md` §"The role-
|
||||
prompt bootstrap" and plan.md's Phase 2 section.
|
||||
@@ -1,108 +0,0 @@
|
||||
{
|
||||
"track_id": "directive_hotswap_harness_20260627",
|
||||
"name": "Directive Hot-Swap Harness (OpenCode Directive Presets)",
|
||||
"status": "active",
|
||||
"branch": "master",
|
||||
"created": "2026-06-27",
|
||||
"owner": "Tier 1 (initialized); implementation delegated to Tier 2/3.",
|
||||
"blocked_by": [],
|
||||
"blocks": ["directive_encoding_experiments (future; alternative v2+ variant authoring)", "manual_slop_directive_lab (future; GUI integration)"],
|
||||
"scope": {
|
||||
"new_files": [
|
||||
"conductor/directives/<48 directive directories>/v1.md (48 files)",
|
||||
"conductor/directives/presets/current_baseline.md",
|
||||
"docs/reports/TRACK_COMPLETION_directive_hotswap_harness_20260627.md"
|
||||
],
|
||||
"modified_files": [
|
||||
".opencode/agents/tier1-orchestrator.md (replace hardcoded reading list with warm with:)",
|
||||
".opencode/agents/tier2-tech-lead.md (same)",
|
||||
".opencode/agents/tier3-worker.md (same)",
|
||||
".opencode/agents/tier4-qa.md (same)",
|
||||
"conductor/tier2/agents/tier2-autonomous.md (same)"
|
||||
],
|
||||
"deleted_files": []
|
||||
},
|
||||
"estimated_effort": {
|
||||
"method": "scope (per workflow.md Tier 1 Track Initialization Rules. NO day estimates.)",
|
||||
"phase_1": "10 steps: harvest 48 directives from doc tree into conductor/directives/ with exact source file:line refs",
|
||||
"phase_2": "8 steps: baseline preset + 5 role-prompt warm with: updates",
|
||||
"phase_3": "4 steps: verification + end-of-track report"
|
||||
},
|
||||
"verification_criteria": [
|
||||
"48 directive directories exist under conductor/directives/, each with a v1.md file",
|
||||
"Each v1.md has a header annotating the source location (file:line) and why this iteration exists",
|
||||
"conductor/directives/presets/current_baseline.md exists and lists all 48 directives",
|
||||
"All 5 tier role prompts have a 'warm with: conductor/directives/presets/current_baseline.md' line",
|
||||
"Non-directive reads (AGENTS.md, workflow.md, edit_workflow.md, forbidden-files.txt, guide_*.md) remain hardcoded in the role prompts",
|
||||
"Original docs are NOT modified (conductor/directives/ is a parallel structure)",
|
||||
"No scripts, no TOML, no build steps — markdown-only",
|
||||
"docs/reports/TRACK_COMPLETION_directive_hotswap_harness_20260627.md exists"
|
||||
],
|
||||
"regressions_and_pre_existing_failures": [],
|
||||
"pre_existing_failures_remaining": [],
|
||||
"deferred_to_followup_tracks": [
|
||||
{
|
||||
"title": "Alternative encoding authoring (v2+ variants)",
|
||||
"description": "Author v2_rationale_first.md, v3_before_after.md, v4_tabular.md etc. per directive. The actual experimentation.",
|
||||
"track_status": "not yet initialized"
|
||||
},
|
||||
{
|
||||
"title": "Manual Slop Directive Lab (GUI integration)",
|
||||
"description": "A Directive Lab panel in Manual Slop for virtualized directive selection + context aggregation.",
|
||||
"track_status": "not yet initialized"
|
||||
},
|
||||
{
|
||||
"title": "Token-cost analysis tooling",
|
||||
"description": "Measure token cost per directive variant. Compare compliance vs token cost.",
|
||||
"track_status": "not yet initialized"
|
||||
},
|
||||
{
|
||||
"title": "Automated compliance testing",
|
||||
"description": "Test harness to measure LLM compliance per encoding (does the LLM follow the directive?).",
|
||||
"track_status": "not yet initialized"
|
||||
},
|
||||
{
|
||||
"title": "Video Analysis Campaign 2 (4 new videos)",
|
||||
"description": "Separate campaign; follows the 3-pass pattern. May inform alternative encoding strategies.",
|
||||
"track_status": "not yet initialized; separate track"
|
||||
}
|
||||
],
|
||||
"risk_register": [
|
||||
{
|
||||
"id": "R1",
|
||||
"description": "Harvest completeness: directives embedded in prose may be missed",
|
||||
"likelihood": "medium",
|
||||
"impact": "the baseline preset is incomplete; some directives are not swappable",
|
||||
"mitigation": "systematic combing of the entire doc tree with grep; the plan's Step 1.1-1.10 cover every doc file identified in the spec's source list"
|
||||
},
|
||||
{
|
||||
"id": "R2",
|
||||
"description": "Granularity ambiguity: some directives overlap (e.g., ban_dict_any + typed_dataclass_fields are two sides of the same coin)",
|
||||
"likelihood": "medium",
|
||||
"impact": "the directive count is inflated by overlapping directives; preset becomes verbose",
|
||||
"mitigation": "the 48-directive list is the initial best-guess; granularity is resolved iteratively as the user experiments. Merging directives is a future preset edit, not a blocker."
|
||||
},
|
||||
{
|
||||
"id": "R3",
|
||||
"description": "LLM doesn't follow the warm with: instruction reliably",
|
||||
"likelihood": "low",
|
||||
"impact": "the LLM doesn't read the preset or the variant files; directives are missing from context",
|
||||
"mitigation": "the instruction is simple (read a file, read the files it lists) and uses the existing file-reading behavior. The Step 3.2 manual verification catches this."
|
||||
},
|
||||
{
|
||||
"id": "R4",
|
||||
"description": "Role-prompt update breaks existing Tier 2 autonomous runs",
|
||||
"likelihood": "low",
|
||||
"impact": "Tier 2 starts reading a different set of files; behavior changes",
|
||||
"mitigation": "the current_baseline preset lists the exact same directives that were hardcoded. The change is structural (where the list lives), not semantic (what the directives say)."
|
||||
}
|
||||
],
|
||||
"campaign_context": {
|
||||
"campaign_name": "Directive Encoding Campaign (Campaign A)",
|
||||
"track_1": "directive_hotswap_harness_20260627 (THIS; harvest + scaffold + baseline preset + role-prompt bootstrap)",
|
||||
"track_2": "directive_encoding_experiments (future; v2+ variant authoring + preset experimentation)",
|
||||
"track_3": "manual_slop_directive_lab (future; GUI integration)",
|
||||
"sibling_campaign": "Video Analysis Campaign 2 (Campaign B; 4 new videos; separate track)",
|
||||
"cross_campaign_relationship": "Intellectual cross-pollination; no hard dependency. Video insights may surface alternative encoding strategies. The harness design mirrors the video campaign's deobfuscation pattern (same content, different encoding)."
|
||||
}
|
||||
}
|
||||
@@ -1,493 +0,0 @@
|
||||
# Directive Hot-Swap Harness Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
||||
|
||||
**Goal:** Build a directive hot-swap harness that lets the user maintain alternative encodings of the same directive as separate files, compose them into named presets (markdown bills of materials), and hot-swap which preset is active via a single `warm with: <path>` instruction in the role prompt or session message.
|
||||
|
||||
**Architecture:** A `conductor/directives/` directory tree where each directive is a subdirectory and each encoding variant is a file (`v1.md`, `v2_<style>.md`). Presets in `conductor/directives/presets/` are markdown files listing which variant files to read. The 5 tier role prompts are updated with a single `warm with: <preset_path>` line that replaces the hardcoded mandatory-reading list. No scripts, no TOML, no build steps — markdown-only, LLM-native.
|
||||
|
||||
**Tech Stack:** Markdown files. No code changes. No tests (this is a documentation/tooling track, not a code track). The "test" is: does an LLM follow the `warm with:` instruction and read the listed files?
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-06-27-directive-hotswap-harness-design.md`
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
### New files (created by this plan)
|
||||
|
||||
```
|
||||
conductor/directives/
|
||||
ban_dict_any/v1.md
|
||||
ban_any_type/v1.md
|
||||
ban_optional_returns/v1.md
|
||||
ban_hasattr_dispatch/v1.md
|
||||
ban_getattr_dispatch/v1.md
|
||||
ban_dict_get_on_known_fields/v1.md
|
||||
ban_local_imports/v1.md
|
||||
ban_prefix_aliasing/v1.md
|
||||
ban_repeated_from_dict/v1.md
|
||||
boundary_layer_exception/v1.md
|
||||
result_error_pattern/v1.md
|
||||
nil_sentinel_pattern/v1.md
|
||||
typed_dataclass_fields/v1.md
|
||||
metadata_boundary_type/v1.md
|
||||
one_space_indent/v1.md
|
||||
no_comments_in_body/v1.md
|
||||
no_diagnostic_noise/v1.md
|
||||
type_hints_required/v1.md
|
||||
sdm_dependency_tags/v1.md
|
||||
file_naming_convention/v1.md
|
||||
no_new_src_files_without_permission/v1.md
|
||||
large_files_are_fine/v1.md
|
||||
atomic_per_task_commits/v1.md
|
||||
tdd_red_green_required/v1.md
|
||||
ban_arbitrary_core_mocking/v1.md
|
||||
live_gui_poll_not_sleep/v1.md
|
||||
batch_verification_not_isolation/v1.md
|
||||
git_hard_bans/v1.md
|
||||
ban_day_estimates/v1.md
|
||||
no_output_filtering/v1.md
|
||||
prefer_targeted_tier_runs/v1.md
|
||||
mandatory_research_first/v1.md
|
||||
no_skip_markers_as_avoidance/v1.md
|
||||
deduction_loop_limit/v1.md
|
||||
report_instead_of_fix_ban/v1.md
|
||||
scope_creep_track_doc_ban/v1.md
|
||||
inherited_cruft_ask_first/v1.md
|
||||
verbose_commit_message_ban/v1.md
|
||||
imgui_scope_verification/v1.md
|
||||
modular_controller_pattern/v1.md
|
||||
ui_delegation_for_hot_reload/v1.md
|
||||
strict_state_management/v1.md
|
||||
comprehensive_logging/v1.md
|
||||
feature_flag_delete_to_turn_off/v1.md
|
||||
rag_six_rules/v1.md
|
||||
cache_stable_to_volatile/v1.md
|
||||
knowledge_harvest_pattern/v1.md
|
||||
|
||||
presets/
|
||||
current_baseline.md
|
||||
```
|
||||
|
||||
### Modified files
|
||||
|
||||
```
|
||||
.opencode/agents/tier1-orchestrator.md (replace mandatory-reading list with warm with:)
|
||||
.opencode/agents/tier2-tech-lead.md (same)
|
||||
.opencode/agents/tier3-worker.md (same)
|
||||
.opencode/agents/tier4-qa.md (same)
|
||||
conductor/tier2/agents/tier2-autonomous.md (same)
|
||||
```
|
||||
|
||||
### NOT modified (the original docs stay untouched)
|
||||
|
||||
```
|
||||
AGENTS.md (stays as canonical source)
|
||||
conductor/workflow.md (stays as canonical source)
|
||||
conductor/product-guidelines.md (stays as canonical source)
|
||||
conductor/code_styleguides/*.md (all stay as canonical source)
|
||||
docs/*.md (all stay as canonical source)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase 1: Directive Harvest
|
||||
|
||||
Focus: Systematically comb the doc tree, extract every directive-like statement into a candidate list, resolve granularity (which to merge, split, keep standalone). This is the bulk of the work.
|
||||
|
||||
Each task creates one or more `conductor/directives/<name>/v1.md` files. The v1 content is a verbatim lift from the source doc (not a rewrite). The variant header annotates the source location and why this iteration exists.
|
||||
|
||||
- [ ] **Step 1.1: Harvest §17 banned patterns (7 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/code_styleguides/python.md:243-473` (§17 Banned Patterns — the 7 banned patterns + §17.7 boundary exception + §17.8 enforcement + §17.9 local imports + §17.10 enforcement inventory)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
1. `conductor/directives/ban_dict_any/v1.md` — source: `python.md:247-264` (§17.1). Content: the `dict[str, Any]` ban + before/after examples + the boundary exception cross-ref.
|
||||
2. `conductor/directives/ban_any_type/v1.md` — source: `python.md:266-277` (§17.2). Content: the `Any` ban + before/after.
|
||||
3. `conductor/directives/ban_optional_returns/v1.md` — source: `python.md:279-299` (§17.3). Content: the `Optional[T]` return ban + the `Result[T]` replacement pattern.
|
||||
4. `conductor/directives/ban_hasattr_dispatch/v1.md` — source: `python.md:301-326` (§17.4). Content: the `hasattr()` for entity type dispatch ban + the typed Union alternative.
|
||||
5. `conductor/directives/ban_getattr_dispatch/v1.md` — source: `python.md:328-338` (§17.5). Content: the `getattr(x, 'field', default)` for type dispatch ban.
|
||||
6. `conductor/directives/ban_dict_get_on_known_fields/v1.md` — source: `python.md:340-350` (§17.6). Content: the `.get('field', default)` on a `dict[str, Any]` ban + direct attribute access alternative.
|
||||
7. `conductor/directives/boundary_layer_exception/v1.md` — source: `python.md:352-354` (§17.7). Content: the ONE exception — the wire boundary (TOML/JSON parse) where `dict[str, Any]` is allowed.
|
||||
|
||||
**Variant header format** (use for ALL v1 files):
|
||||
```markdown
|
||||
# <directive_name> — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/code_styleguides/python.md` §17.N (lines N-M).
|
||||
This is the baseline encoding — the style currently in production. Future variants
|
||||
will test alternative encodings (rationale-first, before/after, tabular) against this baseline.
|
||||
|
||||
**Source:** `conductor/code_styleguides/python.md:NNN-MMM`
|
||||
|
||||
---
|
||||
|
||||
<verbatim directive text from the source>
|
||||
```
|
||||
|
||||
- [ ] **Step 1.2: Harvest §17.9 import/aliasing bans (3 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/code_styleguides/python.md:364-443` (§17.9 local imports + aliasing + repeated from_dict)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
8. `conductor/directives/ban_local_imports/v1.md` — source: `python.md:364-443` (§17.9a). Content: local imports inside functions are banned + the `try/except ImportError` exception + the vendor-SDK-warmup whitelist.
|
||||
9. `conductor/directives/ban_prefix_aliasing/v1.md` — source: `python.md` (§17.9b, within the 336-409 range). Content: `import X as _X` aliasing-for-naming-convenience is banned.
|
||||
10. `conductor/directives/ban_repeated_from_dict/v1.md` — source: `python.md` (§17.9c, within the 336-409 range). Content: repeated `.from_dict()` calls in the same expression are banned.
|
||||
|
||||
- [ ] **Step 1.3: Harvest error handling conventions (2 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/code_styleguides/error_handling.md:22-56` (the 5 patterns) + `error_handling.md:212-264` (hard rules) + `error_handling.md:284-365` (boundary types)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
11. `conductor/directives/result_error_pattern/v1.md` — source: `error_handling.md:22-56, 212-242`. Content: the `Result[T]` dataclass pattern (data + errors list, not `Optional[T]` + exceptions). The 5 patterns (nil-sentinel, zero-init, fail-early, AND over OR, error-info as side-channel). The hard rules (`Optional[T]` returns forbidden in baseline files; `Result[T]` for any function that can fail).
|
||||
12. `conductor/directives/nil_sentinel_pattern/v1.md` — source: `error_handling.md:24-47` (Pattern 1 — Nil-Sentinel Dataclasses). Content: the `NIL_T` singleton pattern replacing `None`. The sentinel type contract.
|
||||
|
||||
- [ ] **Step 1.4: Harvest type/data-structure conventions (3 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/code_styleguides/data_oriented_design.md:176-215` (§8.5 Python Type Promotion Mandate + §8.6 Boundary Layer + §8.7 C11 framing)
|
||||
- `conductor/code_styleguides/type_aliases.md:13-87` (the canonical alias set + the extended per-aggregate dataclasses table) + `type_aliases.md:89-160` (Decision Pattern 2.5 — when to promote to its own dataclass) + `type_aliases.md:284-365` (boundary types + anti-patterns)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
13. `conductor/directives/typed_dataclass_fields/v1.md` — source: `data_oriented_design.md:176-199` (§8.5). Content: the Python Type Promotion Mandate — use typed `@dataclass(frozen=True, slots=True)` with explicit fields. The 7 banned patterns table.
|
||||
14. `conductor/directives/metadata_boundary_type/v1.md` — source: `type_aliases.md:40-81` + `data_oriented_design.md:200-215` (§8.6). Content: `Metadata` is the typed fat struct at the wire boundary, NOT `TypeAlias = dict[str, Any]`. The boundary is 2-3 functions per file. When to promote to per-aggregate dataclass vs. when to keep as collapsed codepath.
|
||||
15. `conductor/directives/boundary_layer_exception/v1.md` — UPDATE the file created in Step 1.1 to also include the `data_oriented_design.md:200-215` (§8.6) and `type_aliases.md` boundary-layer content. This directive cross-references §17.7 (the exception) + §8.6 (the boundary definition) + type_aliases.md (the Metadata-as-boundary-type rule).
|
||||
|
||||
- [ ] **Step 1.5: Harvest code style directives (5 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/code_styleguides/python.md:7-21` (§1 Indentation + §2 Type Annotations)
|
||||
- `conductor/code_styleguides/python.md:64-71` (§8 AI-Agent Specific Conventions — no comments, no diagnostic noise)
|
||||
- `conductor/code_styleguides/python.md:202-211` (§12 SDM)
|
||||
- `conductor/code_styleguides/python.md:212-224` (§13 Vertical Compaction)
|
||||
- `conductor/workflow.md:5-20` (Code Style section)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
16. `conductor/directives/one_space_indent/v1.md` — source: `python.md:7-20` + `workflow.md:7`. Content: 1-space indentation for ALL Python code. CRLF line endings on Windows. No comments unless explicitly requested.
|
||||
17. `conductor/directives/no_comments_in_body/v1.md` — source: `python.md:66` + `AGENTS.md:56`. Content: no comments in source code; documentation lives in `/docs`. Only comment on *why* when non-obvious.
|
||||
18. `conductor/directives/no_diagnostic_noise/v1.md` — source: `python.md:70` + `AGENTS.md` "No Diagnostic Noise in Production" section. Content: no `sys.stderr.write("[XYZ_DIAG] ...")` in production code. Diag goes to log files or temp scripts.
|
||||
19. `conductor/directives/type_hints_required/v1.md` — source: `python.md:24-31` + `product-guidelines.md:58`. Content: mandatory strict type hints for all parameters, return types, and global variables.
|
||||
20. `conductor/directives/sdm_dependency_tags/v1.md` — source: `python.md:202-211` (§12) + `product-guidelines.md:59`. Content: Structural Dependency Mapping tags (`[C: ...]`, `[M: ...]`, `[U: ...]`) in docstrings for AI-assisted impact analysis.
|
||||
|
||||
- [ ] **Step 1.6: Harvest file/taxonomy conventions (3 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `AGENTS.md:62-76` (File Size and Naming Convention HARD RULE)
|
||||
- `conductor/workflow.md:45` (File Naming Convention HARD RULE)
|
||||
- `conductor/code_styleguides/python.md:234-241` (§15 Modular Controller Pattern)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
21. `conductor/directives/file_naming_convention/v1.md` — source: `AGENTS.md:62-76` + `workflow.md:45`. Content: new `src/<thing>.py` files may only be created on the user's explicit request. Helpers go in the parent module. Large files are FINE.
|
||||
22. `conductor/directives/no_new_src_files_without_permission/v1.md` — source: `AGENTS.md:68-76`. Content: the audit trigger — "is `<thing>` a new system, or is it part of an existing system?" If it's part of an existing system, the file goes in that system's file.
|
||||
23. `conductor/directives/large_files_are_fine/v1.md` — source: `AGENTS.md:62-67`. Content: large files are FINE. The "small files are good" stance is propaganda from LLM training data. Cognitive load is managed via naming, regions, and navigation tools — NOT via file splitting.
|
||||
|
||||
- [ ] **Step 1.7: Harvest process/workflow directives (10 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/workflow.md:80-120` (Standard Task Workflow — TDD, atomic commits, delegate)
|
||||
- `conductor/workflow.md:112-170` (Phase Completion Verification + API Hooks verification)
|
||||
- `conductor/workflow.md:262-280` (Structural Testing Contract)
|
||||
- `AGENTS.md:49-85` (Critical Anti-Patterns)
|
||||
- `AGENTS.md:86-118` (Session-Learned Anti-Patterns)
|
||||
- `AGENTS.md:119-185` (Process Anti-Patterns)
|
||||
- `conductor/workflow.md:385-391` (Tier 2 conventions — the 2 new rules)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
24. `conductor/directives/atomic_per_task_commits/v1.md` — source: `workflow.md:112` + `AGENTS.md:55`. Content: commit per-task for atomic rollback. Do NOT batch commits.
|
||||
25. `conductor/directives/tdd_red_green_required/v1.md` — source: `workflow.md:78-100` (Standard Task Workflow steps 4-6). Content: write failing tests before implementing. Run tests, confirm they fail (Red). Implement, run, confirm pass (Green). The Zero-Assertion Ban (tests must have meaningful assertions).
|
||||
26. `conductor/directives/ban_arbitrary_core_mocking/v1.md` — source: `workflow.md:262`. Content: ban on `unittest.mock.patch` to bypass core infrastructure unless explicitly authorized.
|
||||
27. `conductor/directives/live_gui_poll_not_sleep/v1.md` — source: `workflow.md:465-475` (Anti-Pattern: push_event + time.sleep + assert). Content: replace `time.sleep(N)` with a poll loop on `get_value` or `wait_for_event`.
|
||||
28. `conductor/directives/batch_verification_not_isolation/v1.md` — source: `workflow.md:510-514` (Isolated-Pass Verification Fallacy). Content: the only verification that matters for `live_gui` tests is the batch run. Do NOT commit a fix verified only in isolation.
|
||||
29. `conductor/directives/git_hard_bans/v1.md` — source: `AGENTS.md:59` + `workflow.md:417-430`. Content: `git restore`, `git checkout -- <file>`, `git reset` are FORBIDDEN without explicit user permission. Use `git show` for inspection, not `git checkout`.
|
||||
30. `conductor/directives/ban_day_estimates/v1.md` — source: `AGENTS.md:60`. Content: no day/hour/minute estimates in track artifacts. Measure effort by scope (N files, M sites, N tasks).
|
||||
31. `conductor/directives/no_output_filtering/v1.md` — source: `workflow.md:386`. Content: NEVER filter test output through `Select-Object`, `head`, `tail`. Always redirect to a log file.
|
||||
32. `conductor/directives/prefer_targeted_tier_runs/v1.md` — source: `workflow.md:387`. Content: do NOT run the full 11-tier batch for every verification. Run targeted tiers.
|
||||
33. `conductor/directives/mandatory_research_first/v1.md` — source: `workflow.md:46`. Content: before reading any file >50 lines, use `get_file_summary`/`py_get_skeleton`/`py_get_code_outline` to map the structure first.
|
||||
|
||||
- [ ] **Step 1.8: Harvest process anti-patterns (6 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `AGENTS.md:119-185` (Process Anti-Patterns — the 8 named patterns)
|
||||
- `conductor/workflow.md` "Skip-Marker Policy" section
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
34. `conductor/directives/no_skip_markers_as_avoidance/v1.md` — source: `workflow.md` "Skip-Marker Policy" + `AGENTS.md:54`. Content: `@pytest.mark.skip` is documentation of a known failure, not an escape from fixing the bug. Fix in-session when feasible.
|
||||
35. `conductor/directives/deduction_loop_limit/v1.md` — source: `AGENTS.md:127` (Process Anti-Pattern #1). Content: at most 2 test runs in a single investigation. After the 2nd failure, STOP and read the code.
|
||||
36. `conductor/directives/report_instead_of_fix_ban/v1.md` — source: `AGENTS.md:134` (Process Anti-Pattern #2). Content: a 200-line status report is a confession, not a fix. A good status report is 5-10 sentences.
|
||||
37. `conductor/directives/scope_creep_track_doc_ban/v1.md` — source: `AGENTS.md:143` (Process Anti-Pattern #3). Content: if the user asks for a fix, your output is the fix. A track doc is only for multi-day work.
|
||||
38. `conductor/directives/inherited_cruft_ask_first/v1.md` — source: `AGENTS.md:149` (Process Anti-Pattern #4). Content: if a file is broken from a previous session, ASK the user before trying to fix it.
|
||||
39. `conductor/directives/verbose_commit_message_ban/v1.md` — source: `AGENTS.md:176` (Process Anti-Pattern #7). Content: a commit message is 1-3 sentences. If it's longer than 15 lines, it's a report.
|
||||
|
||||
- [ ] **Step 1.9: Harvest GUI/architecture directives (5 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/product-guidelines.md:29-43` (UX & UI Principles + Code Standards)
|
||||
- `conductor/workflow.md:39` (ImGui Verification)
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
40. `conductor/directives/imgui_scope_verification/v1.md` — source: `product-guidelines.md:39` + `workflow.md:39`. Content: all changes to `gui_2.py` MUST be verified using `scripts/check_imgui_scopes.py`. Use `imscope` context managers over manual push/pop.
|
||||
41. `conductor/directives/modular_controller_pattern/v1.md` — source: `product-guidelines.md:40`. Content: state-independent logic must be moved to module-level functions. Massive `if/elif` dispatch blocks must be refactored into handler maps.
|
||||
42. `conductor/directives/ui_delegation_for_hot_reload/v1.md` — source: `product-guidelines.md:41`. Content: all complex ImGui rendering logic must be extracted from the `App` class into module-level `render_xxx(app)` functions. The `App` class should only contain thin delegation wrappers.
|
||||
43. `conductor/directives/strict_state_management/v1.md` — source: `product-guidelines.md:37`. Content: rigorous separation between the Main GUI rendering thread and daemon execution threads. The UI should NEVER hang during AI communication. Use lock-protected queues and events.
|
||||
44. `conductor/directives/comprehensive_logging/v1.md` — source: `product-guidelines.md:38`. Content: aggressively log all actions, API payloads, tool calls, and executed scripts. Maintain timestamped JSON-L and markdown logs.
|
||||
|
||||
- [ ] **Step 1.10: Harvest feature-flag + RAG + cache + knowledge directives (4 directives)**
|
||||
|
||||
**Files to read:**
|
||||
- `conductor/code_styleguides/feature_flags.md`
|
||||
- `conductor/code_styleguides/rag_integration_discipline.md:11-20` (the 6 rules)
|
||||
- `conductor/code_styleguides/cache_friendly_context.md:52-74` (the byte-comparison test)
|
||||
- `conductor/code_styleguides/knowledge_artifacts.md`
|
||||
|
||||
**Directives to create:**
|
||||
|
||||
45. `conductor/directives/feature_flag_delete_to_turn_off/v1.md` — source: `feature_flags.md`. Content: file presence ("delete to turn off") for side artifacts; config flags for persistent preferences; CLI flags for one-shot overrides.
|
||||
46. `conductor/directives/rag_six_rules/v1.md` — source: `rag_integration_discipline.md:11-20`. Content: the 6 rules (opt-in, complements, provenance, no mutation, feature-gated, graceful failure).
|
||||
47. `conductor/directives/cache_stable_to_volatile/v1.md` — source: `cache_friendly_context.md:52-74`. Content: stable-to-volatile context ordering. The byte-comparison test. Layers 1-7 cacheable, 8-12 not.
|
||||
48. `conductor/directives/knowledge_harvest_pattern/v1.md` — source: `knowledge_artifacts.md`. Content: the category files + provenance + sha256 ledger + digest regeneration pattern.
|
||||
|
||||
- [ ] **Step 1.11: Commit the directive harvest**
|
||||
|
||||
```bash
|
||||
git add conductor/directives/
|
||||
git commit -m "feat(directives): harvest 48 directives from doc tree into conductor/directives/
|
||||
|
||||
Systematic extraction of every directive-like statement (imperative,
|
||||
preference, hard ban, convention, anti-pattern) from the entire doc tree
|
||||
into conductor/directives/<name>/v1.md files. Each v1 is a verbatim lift
|
||||
from the source doc with a header annotating the source location.
|
||||
|
||||
Sources combed: AGENTS.md, conductor/workflow.md, conductor/product-guidelines.md,
|
||||
conductor/tech-stack.md, all 10 conductor/code_styleguides/*.md, docs/AGENTS.md.
|
||||
|
||||
Original docs remain untouched as canonical source. The conductor/directives/
|
||||
tree is a parallel structure, not a replacement."
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase 2: Baseline Preset + Role-Prompt Bootstrap
|
||||
|
||||
Focus: Create the `current_baseline.md` preset that lists all 48 directives, then create DUPLICATE role prompts (`.bak` files) that use the `warm with:` bootstrap. The original role prompts stay untouched as the fallback path. See the USER DIRECTIVE in spec.md §"The role-prompt bootstrap" (2026-07-02).
|
||||
|
||||
> **USER DIRECTIVE (2026-07-02):** Do NOT modify the 5 original `.md` role prompts. Make duplicates with the `.bak` suffix (e.g., `.opencode/agents/tier3-worker.md` becomes a new file `.opencode/agents/tier3-worker.md.bak` — wait, that conflicts with the extension. Use `.warm.md` instead). Update plan steps 2.3-2.7 accordingly: the output files are `.opencode/agents/tier1-orchestrator.warm.md`, `.opencode/agents/tier2-tech-lead.warm.md`, `.opencode/agents/tier3-worker.warm.md`, `.opencode/agents/tier4-qa.warm.md`, `conductor/tier2/agents/tier2-autonomous.warm.md`. The user can `mv <name>.warm.md <name>.md` to promote a duplicate to active, or `rm <name>.warm.md` to fall back.
|
||||
|
||||
- [ ] **Step 2.1: Create the baseline preset**
|
||||
|
||||
**File:** `conductor/directives/presets/current_baseline.md`
|
||||
|
||||
**Content:**
|
||||
|
||||
```markdown
|
||||
# Preset: current_baseline
|
||||
|
||||
The baseline directive composition — all v1 variants lifted verbatim from the
|
||||
current production docs. This is the starting point; alternative presets swap
|
||||
variants to test different encodings.
|
||||
|
||||
## Directives to warm
|
||||
|
||||
Read each file below before any action.
|
||||
|
||||
- ban_dict_any: conductor/directives/ban_dict_any/v1.md
|
||||
- ban_any_type: conductor/directives/ban_any_type/v1.md
|
||||
- ban_optional_returns: conductor/directives/ban_optional_returns/v1.md
|
||||
- ban_hasattr_dispatch: conductor/directives/ban_hasattr_dispatch/v1.md
|
||||
- ban_getattr_dispatch: conductor/directives/ban_getattr_dispatch/v1.md
|
||||
- ban_dict_get_on_known_fields: conductor/directives/ban_dict_get_on_known_fields/v1.md
|
||||
- boundary_layer_exception: conductor/directives/boundary_layer_exception/v1.md
|
||||
- ban_local_imports: conductor/directives/ban_local_imports/v1.md
|
||||
- ban_prefix_aliasing: conductor/directives/ban_prefix_aliasing/v1.md
|
||||
- ban_repeated_from_dict: conductor/directives/ban_repeated_from_dict/v1.md
|
||||
- result_error_pattern: conductor/directives/result_error_pattern/v1.md
|
||||
- nil_sentinel_pattern: conductor/directives/nil_sentinel_pattern/v1.md
|
||||
- typed_dataclass_fields: conductor/directives/typed_dataclass_fields/v1.md
|
||||
- metadata_boundary_type: conductor/directives/metadata_boundary_type/v1.md
|
||||
- one_space_indent: conductor/directives/one_space_indent/v1.md
|
||||
- no_comments_in_body: conductor/directives/no_comments_in_body/v1.md
|
||||
- no_diagnostic_noise: conductor/directives/no_diagnostic_noise/v1.md
|
||||
- type_hints_required: conductor/directives/type_hints_required/v1.md
|
||||
- sdm_dependency_tags: conductor/directives/sdm_dependency_tags/v1.md
|
||||
- file_naming_convention: conductor/directives/file_naming_convention/v1.md
|
||||
- no_new_src_files_without_permission: conductor/directives/no_new_src_files_without_permission/v1.md
|
||||
- large_files_are_fine: conductor/directives/large_files_are_fine/v1.md
|
||||
- atomic_per_task_commits: conductor/directives/atomic_per_task_commits/v1.md
|
||||
- tdd_red_green_required: conductor/directives/tdd_red_green_required/v1.md
|
||||
- ban_arbitrary_core_mocking: conductor/directives/ban_arbitrary_core_mocking/v1.md
|
||||
- live_gui_poll_not_sleep: conductor/directives/live_gui_poll_not_sleep/v1.md
|
||||
- batch_verification_not_isolation: conductor/directives/batch_verification_not_isolation/v1.md
|
||||
- git_hard_bans: conductor/directives/git_hard_bans/v1.md
|
||||
- ban_day_estimates: conductor/directives/ban_day_estimates/v1.md
|
||||
- no_output_filtering: conductor/directives/no_output_filtering/v1.md
|
||||
- prefer_targeted_tier_runs: conductor/directives/prefer_targeted_tier_runs/v1.md
|
||||
- mandatory_research_first: conductor/directives/mandatory_research_first/v1.md
|
||||
- no_skip_markers_as_avoidance: conductor/directives/no_skip_markers_as_avoidance/v1.md
|
||||
- deduction_loop_limit: conductor/directives/deduction_loop_limit/v1.md
|
||||
- report_instead_of_fix_ban: conductor/directives/report_instead_of_fix_ban/v1.md
|
||||
- scope_creep_track_doc_ban: conductor/directives/scope_creep_track_doc_ban/v1.md
|
||||
- inherited_cruft_ask_first: conductor/directives/inherited_cruft_ask_first/v1.md
|
||||
- verbose_commit_message_ban: conductor/directives/verbose_commit_message_ban/v1.md
|
||||
- imgui_scope_verification: conductor/directives/imgui_scope_verification/v1.md
|
||||
- modular_controller_pattern: conductor/directives/modular_controller_pattern/v1.md
|
||||
- ui_delegation_for_hot_reload: conductor/directives/ui_delegation_for_hot_reload/v1.md
|
||||
- strict_state_management: conductor/directives/strict_state_management/v1.md
|
||||
- comprehensive_logging: conductor/directives/comprehensive_logging/v1.md
|
||||
- feature_flag_delete_to_turn_off: conductor/directives/feature_flag_delete_to_turn_off/v1.md
|
||||
- rag_six_rules: conductor/directives/rag_six_rules/v1.md
|
||||
- cache_stable_to_volatile: conductor/directives/cache_stable_to_volatile/v1.md
|
||||
- knowledge_harvest_pattern: conductor/directives/knowledge_harvest_pattern/v1.md
|
||||
|
||||
## Notes
|
||||
|
||||
All v1 (verbatim lifts from current production docs). No alternative encodings
|
||||
tested yet. This preset is the control group for future experiments.
|
||||
|
||||
To create an experimental preset: copy this file, change the variant path for
|
||||
the directives you want to test (e.g., swap `v1.md` for `v2_rationale_first.md`),
|
||||
and update the Notes section with your hypothesis.
|
||||
```
|
||||
|
||||
- [ ] **Step 2.2: Commit the preset**
|
||||
|
||||
```bash
|
||||
git add conductor/directives/presets/current_baseline.md
|
||||
git commit -m "feat(directives): add current_baseline preset (48 directives, all v1)"
|
||||
```
|
||||
|
||||
- [ ] **Step 2.3: Create duplicate `.opencode/agents/tier1-orchestrator.warm.md` (do NOT modify the original)**
|
||||
|
||||
**New file:** `.opencode/agents/tier1-orchestrator.warm.md`
|
||||
|
||||
**How to create it:** Read the original `.opencode/agents/tier1-orchestrator.md` to get the FULL current content. In the duplicate, find the "MANDATORY: Pre-Action Required Reading" section (or equivalent hardcoded file list). Replace the directive-reading portion with:
|
||||
|
||||
```markdown
|
||||
## MANDATORY: Directive Warm-up
|
||||
|
||||
warm with: conductor/directives/presets/current_baseline.md
|
||||
|
||||
Read the preset file above. It lists directive variant files to read before any action.
|
||||
Read each file the preset references. These are your active directives for this session.
|
||||
|
||||
If the user specifies a different preset (e.g., "warm with: conductor/directives/presets/exploratory_rationale.md"),
|
||||
use that instead. The user's instruction overrides the default.
|
||||
```
|
||||
|
||||
**What stays (non-directive reads that remain hardcoded):**
|
||||
- `AGENTS.md` — project operating rules
|
||||
- `conductor/workflow.md` — operational workflow
|
||||
- `conductor/edit_workflow.md` — edit tool contract
|
||||
- The relevant `docs/guide_*.md` — architecture reference
|
||||
|
||||
- [ ] **Step 2.4: Create duplicate `.opencode/agents/tier2-tech-lead.warm.md` (do NOT modify the original)**
|
||||
|
||||
**New file:** `.opencode/agents/tier2-tech-lead.warm.md`
|
||||
|
||||
Same procedure as Step 2.3 (read original → duplicate → swap directive-reading portion). Non-directive reads that stay hardcoded:
|
||||
- `AGENTS.md`
|
||||
- `conductor/workflow.md`
|
||||
- `conductor/edit_workflow.md`
|
||||
- `conductor/tier2/githooks/forbidden-files.txt`
|
||||
- The relevant `docs/guide_*.md`
|
||||
|
||||
- [ ] **Step 2.5: Create duplicate `.opencode/agents/tier3-worker.warm.md` (do NOT modify the original)**
|
||||
|
||||
**New file:** `.opencode/agents/tier3-worker.warm.md`
|
||||
|
||||
Same procedure. Note: Tier 3 may benefit from a reduced preset (fewer directives — they don't need the planning/strategy directives). But for now, use `current_baseline.md` and let the user create a `worker_minimal.md` preset later.
|
||||
|
||||
- [ ] **Step 2.6: Create duplicate `.opencode/agents/tier4-qa.warm.md` (do NOT modify the original)**
|
||||
|
||||
**New file:** `.opencode/agents/tier4-qa.warm.md`
|
||||
|
||||
Same procedure. Tier 4 reads narrowly; the preset can be customized later.
|
||||
|
||||
- [ ] **Step 2.7: Create duplicate `conductor/tier2/agents/tier2-autonomous.warm.md` (do NOT modify the original)**
|
||||
|
||||
**New file:** `conductor/tier2/agents/tier2-autonomous.warm.md`
|
||||
|
||||
Same procedure. This file has the most extensive hardcoded reading list. Replace the directive-reading portion with the `warm with:` bootstrap. The non-directive reads that stay:
|
||||
- `AGENTS.md`
|
||||
- `conductor/workflow.md`
|
||||
- `conductor/edit_workflow.md`
|
||||
- `conductor/tier2/githooks/forbidden-files.txt`
|
||||
- `conductor/tracks/tier2_leak_prevention_20260620/spec.md` (this is a track spec, not a directive — stays hardcoded)
|
||||
- `conductor/tracks/tier2_leak_prevention_20260620/spec.md` (this is a track spec, not a directive — stays hardcoded)
|
||||
|
||||
- [ ] **Step 2.8: Commit the role-prompt updates**
|
||||
|
||||
```bash
|
||||
git add .opencode/agents/tier1-orchestrator.md .opencode/agents/tier2-tech-lead.md .opencode/agents/tier3-worker.md .opencode/agents/tier4-qa.md conductor/tier2/agents/tier2-autonomous.md
|
||||
git commit -m "feat(role-prompts): replace hardcoded directive lists with warm with: bootstrap
|
||||
|
||||
All 5 tier role prompts now use 'warm with: conductor/directives/presets/current_baseline.md'
|
||||
instead of a hardcoded list of ~11 files. The LLM reads the preset, then reads
|
||||
the variant files it lists. Non-directive reads (AGENTS.md, workflow.md,
|
||||
edit_workflow.md, forbidden-files.txt, guide_*.md) remain hardcoded.
|
||||
|
||||
The user can override the preset per-session by saying 'warm with: <path>' in
|
||||
their session message. This is the hot-swap mechanism."
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Phase 3: Verification + End-of-Track
|
||||
|
||||
- [ ] **Step 3.1: Verify the directory structure**
|
||||
|
||||
```bash
|
||||
# Count directive directories
|
||||
ls conductor/directives/ | wc -l
|
||||
|
||||
# Count v1.md files
|
||||
find conductor/directives/ -name "v1.md" | wc -l
|
||||
|
||||
# Verify preset exists
|
||||
test -f conductor/directives/presets/current_baseline.md
|
||||
|
||||
# Verify all 5 role prompts have the warm with: line
|
||||
grep -l "warm with:" .opencode/agents/tier1-orchestrator.md .opencode/agents/tier2-tech-lead.md .opencode/agents/tier3-worker.md .opencode/agents/tier4-qa.md conductor/tier2/agents/tier2-autonomous.md
|
||||
```
|
||||
|
||||
Expected: 48 directive directories, 48 v1.md files, preset exists, 5 role prompts have `warm with:`.
|
||||
|
||||
- [ ] **Step 3.2: Manual verification — does the LLM follow the warm with: instruction?**
|
||||
|
||||
Start a new OpenCode session with any tier role. Observe whether the LLM:
|
||||
1. Reads the preset file at `conductor/directives/presets/current_baseline.md`
|
||||
2. Reads each variant file listed in the preset
|
||||
3. Has the directives in context for the session
|
||||
|
||||
This is the "test" — there's no automated test for this. The signal is: does the LLM behave as if it has read the directives?
|
||||
|
||||
- [ ] **Step 3.3: Write end-of-track report**
|
||||
|
||||
**File:** `docs/reports/TRACK_COMPLETION_directive_hotswap_harness_20260627.md`
|
||||
|
||||
Document:
|
||||
- What shipped (48 directives + baseline preset + 5 role-prompt updates)
|
||||
- The directory structure
|
||||
- The preset format
|
||||
- The `warm with:` bootstrap
|
||||
- How to hot-swap (create a new preset or tell the LLM "warm with: <path>")
|
||||
- What's NOT included (no scripts, no TOML, no v2+ variants yet)
|
||||
- Handoff to future tracks (alternative encoding authoring, Manual Slop integration, token-cost analysis)
|
||||
|
||||
- [ ] **Step 3.4: Commit the end-of-track report**
|
||||
|
||||
```bash
|
||||
git add docs/reports/TRACK_COMPLETION_directive_hotswap_harness_20260627.md
|
||||
git commit -m "docs(reports): TRACK_COMPLETION_directive_hotswap_harness_20260627"
|
||||
```
|
||||
@@ -1,239 +0,0 @@
|
||||
# Design: Directive Hot-Swap Harness (OpenCode Directive Presets)
|
||||
|
||||
**Date:** 2026-06-27
|
||||
**Status:** Draft — pending user review
|
||||
**Track ID (proposed):** `directive_hotswap_harness_20260627`
|
||||
|
||||
## Problem
|
||||
|
||||
The codebase's directives — the instructions that tell LLMs how to behave (banned patterns, conventions, hard bans, anti-patterns) — are scattered across the entire doc tree: `AGENTS.md`, `conductor/workflow.md`, `conductor/product-guidelines.md`, `conductor/tech-stack.md`, every `conductor/code_styleguides/*.md`, `docs/Readme.md`, `docs/AGENTS.md`, all 14 `docs/guide_*.md`, etc. They're embedded in prose, tables, anti-pattern sections, "Critical Anti-Patterns" lists, "Hard Rules," styleguide sections.
|
||||
|
||||
The 4 tier role prompts (`.opencode/agents/tier1-orchestrator.md`, `tier2-tech-lead.md`, `tier3-worker.md`, `tier4-qa.md`) plus the autonomous variant (`conductor/tier2/agents/tier2-autonomous.md`) currently hardcode a list of ~11 files to read before any action. This list is static — every session gets the same directives regardless of the task. There's no mechanism to:
|
||||
- Test whether an alternative encoding of the same directive (imperative-ban vs. rationale-first vs. before/after) produces better LLM compliance
|
||||
- Hot-swap which encoding is active without manually editing files or navigating the filesystem
|
||||
- Exercise per-session control over which directives the LLM warms up with
|
||||
|
||||
## Goal
|
||||
|
||||
Build a **directive hot-swap harness** that lets the user:
|
||||
1. Maintain multiple alternative encodings ("variants") of the same directive as separate files
|
||||
2. Compose active directive sets into named "presets" (markdown bills of materials)
|
||||
3. Hot-swap which preset is active via a single `warm with: <path>` instruction in the role prompt or session message
|
||||
4. Use the existing file-reading behavior LLMs already have — no scripts, no TOML, no build steps
|
||||
|
||||
## Design
|
||||
|
||||
### The directive directory structure
|
||||
|
||||
```
|
||||
conductor/directives/
|
||||
<directive_name>/
|
||||
v1.md ← the baseline encoding (verbatim lift from current docs)
|
||||
v2_<style>.md ← alternative encodings (added over time)
|
||||
presets/
|
||||
current_baseline.md ← the default preset (all v1)
|
||||
<experimental>.md ← alternative presets (added over time)
|
||||
```
|
||||
|
||||
**Naming convention:** lowercase, underscore-separated, action-oriented (`ban_dict_any`, not `dict_str_any_ban`). The name describes the directive's intent.
|
||||
|
||||
**Variant file format:** each `vN.md` has a short header annotating why this iteration exists, then the directive text:
|
||||
|
||||
```markdown
|
||||
# <directive_name> — v1
|
||||
|
||||
**Why this iteration:** Lifted verbatim from `conductor/code_styleguides/python.md` §17.1.
|
||||
This is the baseline encoding — the imperative-ban style currently in production.
|
||||
Future variants will test alternative encodings against this baseline.
|
||||
|
||||
---
|
||||
|
||||
<directive text>
|
||||
```
|
||||
|
||||
### The preset format
|
||||
|
||||
A preset is a markdown bill of materials. It tells the LLM which directive variant files to read for this run. Nothing more.
|
||||
|
||||
```markdown
|
||||
# Preset: current_baseline
|
||||
|
||||
The baseline directive composition — all v1 variants lifted from the current
|
||||
production docs.
|
||||
|
||||
## Directives to warm
|
||||
|
||||
Read each file below before any action.
|
||||
|
||||
- ban_dict_any: conductor/directives/ban_dict_any/v1.md
|
||||
- ban_optional_returns: conductor/directives/ban_optional_returns/v1.md
|
||||
- no_local_imports: conductor/directives/no_local_imports/v1.md
|
||||
- ...
|
||||
|
||||
## Notes
|
||||
|
||||
All v1 (verbatim lifts from current production docs). No alternative encodings
|
||||
tested yet. This preset is the control group for future experiments.
|
||||
```
|
||||
|
||||
**Key properties:**
|
||||
- **Flat list.** No nesting, no conditionals, no includes. The LLM reads the list, reads the files.
|
||||
- **Human-readable name.** `current_baseline`, `exploratory_rationale`, `minimal_tokens` — pick by name.
|
||||
- **Notes section.** Documents the hypothesis being tested. This is the experiment log, inline with the preset.
|
||||
- **Partial swaps.** Swap 2-3 directives to v2, leave the rest at v1. The preset makes the diff explicit.
|
||||
- **No script needed.** Author a new preset by copying an existing one and changing variant paths. Hot-swap by telling the LLM which preset to use.
|
||||
|
||||
### The role-prompt bootstrap
|
||||
|
||||
> **USER DIRECTIVE (2026-07-02):** Phase 2's "update role prompts" step is **making duplicates** of the role prompts (e.g., `.opencode/agents/tier3-worker.md.bak`), NOT modifying the originals in place. The duplicates use the `warm with:` bootstrap. The originals stay untouched as the fallback path. This means if a role-prompt regression surfaces, the user can `mv .bak .md` to restore. Do NOT modify the original `.md` role prompts.
|
||||
|
||||
The 5 role prompts (`.opencode/agents/tier1-orchestrator.md`, `tier2-tech-lead.md`, `tier3-worker.md`, `tier4-qa.md`, and `conductor/tier2/agents/tier2-autonomous.md`) have a hardcoded "MANDATORY: Pre-Action Required Reading" section listing ~11 specific files. This is replaced with a single `warm with:` directive.
|
||||
|
||||
```markdown
|
||||
## MANDATORY: Directive Warm-up
|
||||
|
||||
warm with: conductor/directives/presets/current_baseline.md
|
||||
|
||||
Read the preset file above. It lists directive variant files to read before any action.
|
||||
Read each file the preset references. These are your active directives for this session.
|
||||
|
||||
If the user specifies a different preset (e.g., "warm with: conductor/directives/presets/exploratory_rationale.md"),
|
||||
use that instead. The user's instruction overrides the default.
|
||||
```
|
||||
|
||||
**Key properties:**
|
||||
- **One line is the bootstrap.** `warm with: <path>` is the entire mechanism.
|
||||
- **User override.** The user can tell the LLM "warm with: <path>" in their session message and it uses that preset instead of the default. This is the hot-swap — no file editing, just a text instruction.
|
||||
- **Per-role defaults.** Each tier role prompt can default to a different preset.
|
||||
- **Non-directive reads remain hardcoded.** Files that aren't tunable directives (e.g., `conductor/tracks/tier2_leak_prevention_20260620/spec.md`, `conductor/tier2/githooks/forbidden-files.txt`) stay as direct references in the role prompt.
|
||||
|
||||
### What stays in the role prompt (not directive-based)
|
||||
|
||||
- `AGENTS.md` — project operating rules (contains directives AND non-directive rules)
|
||||
- `conductor/workflow.md` — operational workflow
|
||||
- `conductor/edit_workflow.md` — edit tool contract
|
||||
- `conductor/tier2/githooks/forbidden-files.txt` — file denylist
|
||||
- The relevant `docs/guide_*.md` — architecture reference
|
||||
|
||||
These are context, not tunable directives. They stay hardcoded in the role prompt.
|
||||
|
||||
### The directive harvest
|
||||
|
||||
The directives are NOT limited to the 11 files the role prompts mandate. They're scattered across the entire doc tree. The track's first phase is a systematic harvest:
|
||||
|
||||
**A directive is any statement that tells the LLM:**
|
||||
- "Do X" / "Don't do X" (imperative)
|
||||
- "Use Y instead of Z" (preference)
|
||||
- "This is BANNED" (hard ban)
|
||||
- "Follow pattern P" (convention)
|
||||
- "Never do Q" (anti-pattern)
|
||||
|
||||
**NOT a directive:**
|
||||
- Descriptive prose ("The App class holds GUI state")
|
||||
- Architecture documentation ("Thread domains are separated by...")
|
||||
- Reference material ("The 45-tool inventory includes...")
|
||||
|
||||
**Sources to comb (non-exhaustive; updated 2026-07-02 to cover all 14 `conductor/code_styleguides/*.md`):**
|
||||
- `AGENTS.md` — "Critical Anti-Patterns", "File Size and Naming Convention", "Session-Learned Anti-Patterns", "Process Anti-Patterns"
|
||||
- `conductor/workflow.md` — "Code Style", "Guiding Principles", "Testing Requirements", "Known Pitfalls", "Process Anti-Patterns", "Tier 2 Autonomous Sandbox conventions"
|
||||
- `conductor/product-guidelines.md` — "Core Value", "Code Standards & Architecture", "Data-Oriented Error Handling", "Phase 5: Heavy Curation"
|
||||
- `conductor/tech-stack.md` — "Core Value" header
|
||||
- `conductor/code_styleguides/data_oriented_design.md` — §8.5 "Python Type Promotion Mandate", the 7-question simplification pass, the 10-question self-check
|
||||
- `conductor/code_styleguides/python.md` — §10 "Anti-OOP Conventions", §17 "LLM Default Anti-Patterns" (the 7 banned patterns)
|
||||
- `conductor/code_styleguides/error_handling.md` — the Result[T] convention, the AI Agent Checklist
|
||||
- `conductor/code_styleguides/type_aliases.md` — "When NOT to promote"
|
||||
- `conductor/code_styleguides/feature_flags.md` — "delete to turn off" convention
|
||||
- `conductor/code_styleguides/agent_memory_dimensions.md` — the 4-dimension decision tree
|
||||
- `conductor/code_styleguides/rag_integration_discipline.md` — "conservative-RAG rule"
|
||||
- `conductor/code_styleguides/cache_friendly_context.md` — stable-to-volatile ordering
|
||||
- `conductor/code_styleguides/knowledge_artifacts.md` — the harvest pattern
|
||||
- `conductor/code_styleguides/config_state_owner.md` — AppController is the single source of truth for config I/O (directive: no `models.save_config`/`models.load_config` in `src/`; enforced by `scripts/audit_no_models_config_io.py`)
|
||||
- `conductor/code_styleguides/workspace_paths.md` — test-infrastructure paths must live under `./tests/` (directive: no `tmp_path_factory.mktemp`, no env vars for test paths, no CLI args for test paths; conftest is the right place)
|
||||
- `conductor/code_styleguides/test_sandbox.md` — the test-sandbox hardening conventions (FR1 runtime guard, FR2 live_gui workspace fixture, FR3 sync coalescing)
|
||||
- `conductor/code_styleguides/chroma_cache.md` — ChromaDB cache conventions (if directive-like content present)
|
||||
- `conductor/code_styleguides/code_path_audit.md` — the per-aggregate data-pipeline audit convention
|
||||
- `docs/AGENTS.md` — "Convention Enforcement"
|
||||
- `docs/Readme.md` — any directive-like content in feature descriptions
|
||||
|
||||
> **Note (added 2026-07-02):** the original source list named 9 of the 14 styleguides. The 5 added here (`config_state_owner.md`, `workspace_paths.md`, `test_sandbox.md`, `chroma_cache.md`, `code_path_audit.md`) contain directive-like content that should be harvested. The harvester should verify each contains a harvestable directive before creating a `v1.md`; if a styleguide is purely descriptive (no imperative/ban/preference), skip it and note the skip in the harvest commit.
|
||||
|
||||
**Granularity resolution:** the harvest produces a candidate list. Then the question of which directives to merge (e.g., `ban_prefix_aliasing` + `no_local_imports` might become `import_hygiene`), split, or keep standalone is resolved in the harvest phase — not locked in upfront.
|
||||
|
||||
### The original docs stay untouched
|
||||
|
||||
The `conductor/directives/` tree is a *parallel* structure, not a replacement. The original docs (`python.md`, `error_handling.md`, `AGENTS.md`, etc.) remain the canonical source until a future track deprecates them. The harness is useful immediately (the v1 variants are exact copies); the old docs are not broken.
|
||||
|
||||
### Why no scripts / TOML
|
||||
|
||||
The user explicitly rejected TOML manifests and scripts for this initial version: "no need to systematize that hard when I don't know what's going to work yet." The preset is markdown. The hot-swap is a text instruction. The variant selection is a path in a markdown file. No build steps, no generated files, no tooling dependencies. If the system proves useful, a future track can add automation (auto-generating presets from the directory tree, token-cost analysis per variant, automated compliance testing).
|
||||
|
||||
## Scope: Two Parallel Campaigns
|
||||
|
||||
The user's request bundles two distinct campaigns that share a theme ("how do you encode information densely for an LLM?") but are tracked and executed independently.
|
||||
|
||||
### Campaign A: Directive Hot-Swap Harness (this spec)
|
||||
|
||||
**Track A-1 (this):** directive harvest + scaffold + baseline preset + role-prompt bootstrap update. Gets the system working with v1 (current) encodings.
|
||||
|
||||
Future tracks in Campaign A:
|
||||
- Alternative encoding authoring (v2, v3 per directive — the actual experimentation)
|
||||
- Manual Slop integration (a "Directive Lab" panel for virtualized directive selection)
|
||||
- Token-cost analysis tooling
|
||||
- Automated compliance testing
|
||||
|
||||
### Campaign B: Video Analysis (4 new videos)
|
||||
|
||||
A separate research campaign following the established 3-pass pattern from the previous 12-video campaign (Pass 1: extract → Pass 2: deobfuscate → Pass 3: project to C11/Python). The 4 videos:
|
||||
|
||||
1. **Reinventing Entropy | Compression is Intelligence Part 1** (https://youtu.be/l6DKRf-fAAM)
|
||||
2. **Yann LeCun: World Models: Enabling the next AI revolution** (https://www.youtube.com/watch?v=72Xj8k5WQX4)
|
||||
3. **Yann LeCun's $1B Bet Against LLMs [Part 1]** (https://youtu.be/kYkIdXwW2AE)
|
||||
4. **Recursive Self-Improvement** (https://youtu.be/t7_ZXgfJVG8)
|
||||
|
||||
### Cross-Campaign Relationship
|
||||
|
||||
The two campaigns inform each other but have no hard dependency:
|
||||
|
||||
- **The video analysis informs directive encoding.** The entropy/compression video (video 1) provides theoretical grounding for how information density affects comprehension. LeCun's world-model work (videos 2-3) informs how LLMs model directive intent. Recursive self-improvement (video 4) is directly relevant to the meta-question of whether better directive encodings can be discovered iteratively. Insights from the video analysis may surface alternative encoding strategies to test in Campaign A's harness.
|
||||
|
||||
- **The harness informs the video analysis.** The previous video campaign produced a lexicon + C11 reference + deobfuscation DSL. The directive harness is itself a compression-aid tool — it encodes the same directive in fewer/different tokens and observes the effect. The harness's design (preset as bill-of-materials, variant as alternative encoding) is the same pattern as the video campaign's deobfuscation pass (same content, different encoding). The harness may inform how the video analysis encodes its own outputs.
|
||||
|
||||
- **Execution order:** the campaigns can run in parallel. Campaign A (Track A-1) is an engineering track; Campaign B is a research track. They don't share files. The cross-pollination is intellectual, not structural.
|
||||
|
||||
### The video analysis track structure (Campaign B)
|
||||
|
||||
Follows the established 3-pass pattern from `docs/reports/2026-06-15/CAMPAIGN_CLOSE_OUT_video_analysis_20260621.md`:
|
||||
|
||||
- **Pass 1:** Information extraction (4 deep-dive reports, one per video). Uses the existing `scripts/video_analysis/` pipeline (download_video, extract_transcript, extract_keyframes, ocr_frames, synthesize_report). The lexicon v2 from the previous campaign is the starting point for deobfuscation.
|
||||
- **Pass 2:** Deobfuscation (apply the lexicon v2 to the 4 new videos' content). May produce lexicon v3 corrections if the new videos surface notation the lexicon doesn't cover.
|
||||
- **Pass 3:** C11/Python projection (project each video's deobfuscated content to code in the user's idiomatic style).
|
||||
|
||||
The video analysis track is initialized as a separate conductor track (`video_analysis_campaign_2_20260627` or similar). Its spec/plan is authored separately from this design doc.
|
||||
|
||||
## Out of Scope (for Track A-1)
|
||||
|
||||
- **Authoring alternative encodings (v2+).** This track only creates v1 (verbatim lifts). The experimentation is a future activity.
|
||||
- **Deprecating the original docs.** The old docs stay as canonical source.
|
||||
- **Scripts for preset generation or variant selection.** No automation in this version.
|
||||
- **Manual Slop GUI integration.** The harness is OpenCode-only for now.
|
||||
- **Token-cost analysis.** No tooling to measure token cost per variant in this version.
|
||||
- **Automated compliance testing.** No test harness to measure LLM compliance per encoding.
|
||||
- **The 4-video analysis (Campaign B).** Separate track, separate campaign. This design doc covers Campaign A (the harness) only. The video analysis gets its own track spec.
|
||||
|
||||
## Risks
|
||||
|
||||
1. **Harvest completeness.** The directive harvest might miss directives embedded in prose. Mitigation: systematic combing of the doc tree + the user reviews the candidate list before variants are created.
|
||||
2. **Granularity ambiguity.** Some directives overlap (e.g., "ban dict[str, Any]" and "use typed dataclass fields" are two sides of the same coin). Mitigation: the harvest phase produces a candidate list; the granularity is resolved there, not upfront.
|
||||
3. **Role-prompt drift.** The 5 role prompts need to be updated consistently. Mitigation: the `warm with:` line is the only change; the rest of each role prompt is untouched.
|
||||
4. **Adoption friction.** LLMs might not follow the `warm with:` instruction reliably. Mitigation: the instruction is simple (read a file, read the files it lists) and uses the existing file-reading behavior the LLMs already have.
|
||||
|
||||
## See Also
|
||||
|
||||
- `conductor/tier2/agents/tier2-autonomous.md` — the role prompt that will be updated with `warm with:` (verified present 2026-07-02; 17,940 bytes)
|
||||
- `conductor/tier2/commands/tier-2-auto-execute.md` — the slash command template
|
||||
- `conductor/code_styleguides/python.md` §17 — the primary source of directives to harvest
|
||||
- `conductor/code_styleguides/error_handling.md` — the Result[T] convention to harvest
|
||||
- `AGENTS.md` "Critical Anti-Patterns" — the hard bans to harvest
|
||||
- `docs/guide_meta_boundary.md` — the meta-tooling / application distinction (relevant to why this harness lives in the meta-tooling domain)
|
||||
- `docs/reports/2026-06-15/CAMPAIGN_CLOSE_OUT_video_analysis_20260621.md` — the previous video campaign's closeout (the pattern Campaign B follows)
|
||||
- `scripts/video_analysis/` — the existing video analysis pipeline (Campaign B reuses this)
|
||||
@@ -1,204 +0,0 @@
|
||||
# Track state for directive_hotswap_harness_20260627
|
||||
# Initialized by Tier 1 Orchestrator on 2026-06-27.
|
||||
# Implementation delegated to Tier 2 (autonomous) or Tier 3 worker dispatch.
|
||||
# This is Track 1 of Campaign A (Directive Encoding Campaign).
|
||||
# Phase 2 + Phase 3 completed 2026-07-02 (manual verification §3.2 deferred to user).
|
||||
|
||||
[meta]
|
||||
track_id = "directive_hotswap_harness_20260627"
|
||||
name = "Directive Hot-Swap Harness (OpenCode Directive Presets)"
|
||||
status = "active"
|
||||
current_phase = 5
|
||||
last_updated = "2026-07-02"
|
||||
|
||||
[blocked_by]
|
||||
# None. Pure documentation/track-artifact work; no code changes, no tests,
|
||||
# zero overlap with any running track.
|
||||
|
||||
[blocks]
|
||||
directive_encoding_experiments = "planned (future; v2+ variant authoring)"
|
||||
manual_slop_directive_lab = "planned (future; GUI integration)"
|
||||
|
||||
[phases]
|
||||
phase_1 = { status = "completed", checkpointsha = "ce0564fe", name = "Directive Harvest (10 steps: 51 directives from doc tree into conductor/directives/)" }
|
||||
phase_2 = { status = "completed", checkpointsha = "6ba4bdd", name = "Baseline Preset + Role-Prompt Bootstrap (8 steps: preset + 5 role-prompt warm with: updates)" }
|
||||
phase_3 = { status = "completed", checkpointsha = "c9f30abf", name = "Verification + End-of-Track (4 steps: dir structure verify + manual LLM verify + report + commit)" }
|
||||
phase_4 = { status = "completed", checkpointsha = "465433e0", name = "Directive Library Expansion (scope A back-fill + 15 new directives + aggregation script)" }
|
||||
phase_5 = { status = "completed", checkpointsha = "b2ebe25d", name = "Scavenge Pass (15 new directives from MMA_Support + nagent_review + intent_dsl_survey + handoffs)" }
|
||||
|
||||
[tasks]
|
||||
# Phase 1: directive harvest
|
||||
t1_1 = { status = "completed", commit_sha = "f4dfb846", description = "Harvest 17.1-17.7 banned patterns (7 directives: ban_dict_any, ban_any_type, ban_optional_returns, ban_hasattr_dispatch, ban_getattr_dispatch, ban_dict_get_on_known_fields, boundary_layer_exception)" }
|
||||
t1_2 = { status = "completed", commit_sha = "545ccee1", description = "Harvest 17.9 import/aliasing bans (3 directives: ban_local_imports, ban_prefix_aliasing, ban_repeated_from_dict)" }
|
||||
t1_3 = { status = "completed", commit_sha = "0340925d", description = "Harvest error handling conventions (2 directives: result_error_pattern, nil_sentinel_pattern)" }
|
||||
t1_4 = { status = "completed", commit_sha = "62fc04b1", description = "Harvest type/data-structure conventions (3 directives: typed_dataclass_fields, metadata_boundary_type, update boundary_layer_exception)" }
|
||||
t1_5 = { status = "completed", commit_sha = "b5baaaaa", description = "Harvest code style directives (5 directives: one_space_indent, no_comments_in_body, no_diagnostic_noise, type_hints_required, sdm_dependency_tags)" }
|
||||
t1_6 = { status = "completed", commit_sha = "fa488ccf", description = "Harvest file/taxonomy conventions (3 directives: file_naming_convention, no_new_src_files_without_permission, large_files_are_fine)" }
|
||||
t1_7 = { status = "completed", commit_sha = "412494d2", description = "Harvest process/workflow directives (10 directives: atomic_per_task_commits, tdd_red_green_required, ban_arbitrary_core_mocking, live_gui_poll_not_sleep, batch_verification_not_isolation, git_hard_bans, ban_day_estimates, no_output_filtering, prefer_targeted_tier_runs, mandatory_research_first)" }
|
||||
t1_8 = { status = "completed", commit_sha = "77ee0c68", description = "Harvest process anti-patterns (6 directives: no_skip_markers_as_avoidance, deduction_loop_limit, report_instead_of_fix_ban, scope_creep_track_doc_ban, inherited_cruft_ask_first, verbose_commit_message_ban)" }
|
||||
t1_9 = { status = "completed", commit_sha = "fa3e5381", description = "Harvest GUI/architecture directives (5 directives: imgui_scope_verification, modular_controller_pattern, ui_delegation_for_hot_reload, strict_state_management, comprehensive_logging)" }
|
||||
t1_10 = { status = "completed", commit_sha = "cdc0f140", description = "Harvest feature-flag + RAG + cache + knowledge directives + 4 new styleguides (8 directives: feature_flag_delete_to_turn_off, rag_six_rules, cache_stable_to_volatile, knowledge_harvest_pattern, config_state_owner, workspace_paths, test_sandbox, chroma_cache_path). Skipped code_path_audit.md (descriptive)." }
|
||||
t1_11 = { status = "completed", commit_sha = "ce0564fe", description = "Commit the directive harvest summary (51 v1.md files; +1 meta-summary HARVEST_SUMMARY.md)" }
|
||||
# Phase 2: baseline preset + role-prompt bootstrap
|
||||
t2_1 = { status = "completed", commit_sha = "2ddaeb52", description = "Create conductor/directives/presets/current_baseline.md (51 directives listed; not the 48 in the plan)" }
|
||||
t2_2 = { status = "completed", commit_sha = "2ddaeb52", description = "Commit the baseline preset (combined with t2_1 in a single atomic commit; commit includes 1-line state.toml scope drift setting phase_2 to in_progress)" }
|
||||
t2_3 = { status = "completed", commit_sha = "35831084", description = "Create .opencode/agents/tier1-orchestrator.warm.md duplicate with warm with: bootstrap (Session Start Checklist items 6-9 replaced)" }
|
||||
t2_4 = { status = "completed", commit_sha = "b082cb15", description = "Create .opencode/agents/tier2-tech-lead.warm.md duplicate with warm with: bootstrap (TWO sections: CRITICAL: Read the canonical docs FIRST + Session Start Checklist; items 6-9 replaced in both)" }
|
||||
t2_5 = { status = "completed", commit_sha = "40764252", description = "Create .opencode/agents/tier3-worker.warm.md duplicate with warm with: bootstrap (Task Start Checklist items 2-3 replaced)" }
|
||||
t2_6 = { status = "completed", commit_sha = "b2aebbc9", description = "Create .opencode/agents/tier4-qa.warm.md duplicate with warm with: bootstrap (Context Amnesia 'must read' sentence replaced)" }
|
||||
t2_7 = { status = "completed", commit_sha = "7b0d1164", description = "Create conductor/tier2/agents/tier2-autonomous.warm.md duplicate with warm with: bootstrap (Pre-Action Required Reading items 7-10 replaced)" }
|
||||
t2_8 = { status = "completed", commit_sha = "6ba4bdd", description = "Combined summary meta-commit (empty -- all 5 .warm.md files were committed atomically in t2_3..t2_7)" }
|
||||
# Phase 3: verification + end-of-track
|
||||
t3_1 = { status = "completed", commit_sha = "bbbfbd39", description = "Verify directory structure (53 entries, 51 v1.md files, preset exists, 5 .warm.md role-prompt duplicates exist, 5 originals untouched) -- all 5 criteria PASS" }
|
||||
t3_2 = { status = "deferred", commit_sha = "", description = "Manual verification: does the LLM follow the warm with: instruction? DEFERRED to user per directive (requires live OpenCode session)" }
|
||||
t3_3 = { status = "completed", commit_sha = "PENDING", description = "Write docs/reports/TRACK_COMPLETION_directive_hotswap_harness_20260627.md" }
|
||||
t3_4 = { status = "in_progress", commit_sha = "PENDING", description = "Commit the end-of-track report + this state.toml update atomically" }
|
||||
# Phase 4: directive library expansion (2026-07-02 user directive)
|
||||
t4_1 = { status = "completed", commit_sha = "e9a19523", description = "E.1 Back-fill batch 1/5: atomic_per_task_commits, ban_any_type, ban_arbitrary_core_mocking, ban_day_estimates, ban_dict_any, ban_dict_get_on_known_fields, ban_getattr_dispatch, ban_hasattr_dispatch (8 directives)" }
|
||||
t4_2 = { status = "completed", commit_sha = "71e01dfe", description = "E.1 Back-fill batch 2/5: ban_local_imports, ban_optional_returns, ban_prefix_aliasing, ban_repeated_from_dict, batch_verification_not_isolation, boundary_layer_exception, cache_stable_to_volatile, chroma_cache_path, comprehensive_logging (9 directives)" }
|
||||
t4_3 = { status = "completed", commit_sha = "83149962", description = "E.1 Back-fill batch 3/5: config_state_owner, deduction_loop_limit, feature_flag_delete_to_turn_off, file_naming_convention, git_hard_bans, imgui_scope_verification, inherited_cruft_ask_first, knowledge_harvest_pattern, large_files_are_fine (9 directives)" }
|
||||
t4_4 = { status = "completed", commit_sha = "68352ee2", description = "E.1 Back-fill batch 4/5: live_gui_poll_not_sleep, mandatory_research_first, metadata_boundary_type, modular_controller_pattern, nil_sentinel_pattern, no_comments_in_body, no_diagnostic_noise, no_new_src_files_without_permission, no_output_filtering (9 directives)" }
|
||||
t4_5 = { status = "completed", commit_sha = "5b0f932c", description = "E.1 Back-fill batch 5a/5: no_skip_markers_as_avoidance, one_space_indent, prefer_targeted_tier_runs, rag_six_rules, report_instead_of_fix_ban, result_error_pattern, scope_creep_track_doc_ban, sdm_dependency_tags, strict_state_management (9 directives)" }
|
||||
t4_6 = { status = "completed", commit_sha = "559db09c", description = "E.1 Back-fill batch 5b/5: tdd_red_green_required, test_sandbox, type_hints_required, typed_dataclass_fields, ui_delegation_for_hot_reload, verbose_commit_message_ban, workspace_paths (7 directives; total back-fill: 51)" }
|
||||
t4_7 = { status = "completed", commit_sha = "8407742a", description = "E.2 Harvest from docs/AGENTS.md (2 directives): core_value_read_first, convention_enforcement_4_mechanisms" }
|
||||
t4_8 = { status = "completed", commit_sha = "782530ba", description = "E.2 Harvest from conductor/edit_workflow.md (6 directives): edit_small_incremental, verify_before_editing, decorator_orphan_pitfall, ast_parse_insufficient, contract_change_audit, preserve_line_endings" }
|
||||
t4_9 = { status = "completed", commit_sha = "a758f0a4", description = "E.2 Harvest from docs/guide_testing.md (5 directives): no_real_io_during_tests, live_gui_session_scoped_no_restart, defer_not_catch_for_native_crashes, test_narrow_not_kitchen_sink, ast_verify_class_methods_after_edit" }
|
||||
t4_10 = { status = "completed", commit_sha = "454fac1b", description = "E.2 Harvest from docs/guide_state_lifecycle.md (2 directives): undo_redo_100_snapshot_capacity, reset_session_preserves_project_path (total scope A: 15 directives)" }
|
||||
t4_11 = { status = "completed", commit_sha = "9d3222dd", description = "E.3 Write scripts/aggregate_directives.py + 5 pytest tests (stdlib-only; reads v1.md only, never meta.md; supports stdout and -o)" }
|
||||
t4_12 = { status = "completed", commit_sha = "465433e0", description = "E.4 Update current_baseline preset with 15 new directives (total 66; alphabetical order preserved)" }
|
||||
t4_13 = { status = "completed", commit_sha = "8ef66e02", description = "E.5 Update state.toml with task records e_1..e_4 and phase_4 entry; archive throwaway expansion helpers under scripts/tier2/artifacts/" }
|
||||
t5_1 = { status = "completed", commit_sha = "PENDING", description = "Every v1.md starts with an explicit '# <rule-statement>' header (63 back-filled in 8 batches; 3 already-titled: chroma_cache_path, config_state_owner, workspace_paths). New pytest test asserts the header on all 66." }
|
||||
# Phase 5: scavenge pass — directive library expansion from unread markdown
|
||||
# Per user directive 2026-07-02: "can markdown you haven't read yet to make sure you scavanged all possible directives buried in this codebase. Ignore most tracks except the intent based dsl track and the nagent track."
|
||||
s_1 = { status = "completed", commit_sha = "bea5d6b1", description = "Scavenge batch 1/3: 5 directives from docs/MMA_Support/ — tier1_orchestrator_no_implementation, tier3_worker_amnesia, tier4_qa_compressed_fix, token_firewall_prevents_bloat, stub_before_implement" }
|
||||
s_2 = { status = "completed", commit_sha = "ebca201d", description = "Scavenge batch 2/3: 5 directives from conductor/tracks/nagent_review_20260608/ — subagent_returns_artifact_not_transcript, parse_failure_visible_to_conversation, state_visible_at_the_right_layer, file_id_stable_across_rename, decompose_or_isolate_never_offload" }
|
||||
s_3 = { status = "completed", commit_sha = "883f7ec5", description = "Scavenge batch 3/3: 5 directives from intent_dsl_survey + handoffs — intent_signal_postfix_not_xml, pipeline_immediate_mode_no_object, dsl_uses_first_class_spans_for_errors, search_all_call_sites_after_signature_change, run_full_tier_after_phase_refactor" }
|
||||
s_4 = { status = "completed", commit_sha = "9656bf2e", description = "Update current_baseline preset with 15 new directives alphabetically interleaved (total 81); updated Notes section to track three harvest passes" }
|
||||
s_5 = { status = "completed", commit_sha = "PENDING", description = "Update state.toml with s_1..s_4 task records + phase_5 entry; commit atomically with this file" }
|
||||
s_6 = { status = "completed", commit_sha = "b2ebe25d", description = "Add tests/test_scavenge_directives_lift.py: 79 parametrized cases verifying the 15 new directives have v1.md + meta.md, headings, sections, preset references; plus 5 aggregate tests for total count >= 81" }
|
||||
|
||||
[verification]
|
||||
phase_1_complete = true
|
||||
phase_2_complete = true
|
||||
phase_3_complete = true # §3.1 + §3.3 + §3.4 done; §3.2 deferred to user
|
||||
phase_4_complete = true # scope A back-fill + 15 new directives + aggregation script + preset update
|
||||
phase_5_complete = true # scavenge pass — 15 new directives from MMA_Support + nagent_review + intent_dsl_survey + handoffs + test + preset update
|
||||
directive_count = 81
|
||||
back_fill_meta_md_count = 81 # every v1.md (51 + 15 + 15) has a corresponding meta.md
|
||||
preset_exists = true
|
||||
role_prompts_updated = true # the 5 .warm.md duplicates exist; originals are intact as rollback
|
||||
end_of_track_report_exists = true
|
||||
manual_verification_deferred = true # §3.2 deferred to user
|
||||
aggregation_script_exists = true # scripts/aggregate_directives.py
|
||||
aggregation_tests_pass = true # 15 tests in tests/test_aggregate_directives.py (original 5 + 10 added during Phase 4 back-fill)
|
||||
scavenge_lift_tests_pass = true # 79 tests in tests/test_scavenge_directives_lift.py
|
||||
|
||||
[campaign_context]
|
||||
campaign_name = "Directive Encoding Campaign (Campaign A)"
|
||||
track_1 = "directive_hotswap_harness_20260627 (THIS; harvest + scaffold + baseline preset + role-prompt bootstrap + Phase A expansion) — Phase 4 complete"
|
||||
track_2 = "directive_encoding_experiments (future; v2+ variant authoring + preset experimentation)"
|
||||
track_3 = "manual_slop_directive_lab (future; GUI integration)"
|
||||
sibling_campaign = "Video Analysis Campaign 2 (Campaign B; 4 new videos; separate track)"
|
||||
cross_campaign_relationship = "Intellectual cross-pollination; no hard dependency."
|
||||
|
||||
[expansion_20260702]
|
||||
# Phase 4 expansion: scope A back-fill + new directives + aggregation script
|
||||
directives_before = 51
|
||||
directives_after = 66
|
||||
new_directives_count = 15
|
||||
new_directive_sources = "docs/AGENTS.md (2), conductor/edit_workflow.md (6), docs/guide_testing.md (5), docs/guide_state_lifecycle.md (2)"
|
||||
metadata_convention = "Per user directive 2026-07-02: v1.md holds pure body; meta.md holds provenance (why/source/lifted). Aggregator NEVER reads meta.md."
|
||||
aggregation_script = "scripts/aggregate_directives.py (stdlib-only; 5 pytest tests in tests/test_aggregate_directives.py)"
|
||||
|
||||
[titles_20260702]
|
||||
# Per user directive 2026-07-02: every v1.md must open with an explicit '# <rule-statement>' heading.
|
||||
# Complaint: "banned local imports doesn't explicitly state in its content that local imports is banned."
|
||||
directives_total = 66
|
||||
titles_back_filled = 63
|
||||
already_titled = 3 # chroma_cache_path, config_state_owner, workspace_paths (top-level '# ' heading already present)
|
||||
batches = 8 # 8 back-fill commits (~8 files each) + 1 test/state commit
|
||||
test_added = "tests/test_aggregate_directives.py::test_every_v1_has_top_level_heading (+ test_v1_heading_is_not_meta_provenance_format)"
|
||||
aggregation_pollution_preserved = true # scripts/aggregate_directives.py output has no meta.md leakage after header back-fill
|
||||
|
||||
[scavenge_20260702]
|
||||
# Phase 5 scavenge pass: directive library expansion from unread markdown.
|
||||
# Per user directive 2026-07-02: "can markdown you haven't read yet to make sure you scavanged all possible directives buried in this codebase."
|
||||
# Scope: docs/MMA_Support/, docs/handoffs/, docs/ideation/, docs/superpowers/{specs,plans}/, docs/reports/ (recursing except code_path_audit/ + license_cve_audit/), docs/type_registry/, docs/transcripts/, docs/Readme.md, docs/smoke_test_*.md, conductor/todos/, conductor/tracks/intent_dsl_survey_20260612/, conductor/tracks/nagent_review_20260608/.
|
||||
# Out of scope: other conductor/tracks/<other>/ (the user said "ignore most tracks except the intent based dsl track and the nagent track"); conductor/archive/; this track's own history.
|
||||
directives_before = 66
|
||||
directives_after = 81
|
||||
new_directives_count = 15
|
||||
new_directive_sources = "docs/MMA_Support/ (5), conductor/tracks/nagent_review_20260608/ (5), conductor/tracks/intent_dsl_survey_20260612/ + docs/handoffs/ (5)"
|
||||
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)"
|
||||
|
||||
[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)"
|
||||
|
||||
[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)"
|
||||
|
||||
[scavenge_20260703_batch_4]
|
||||
# Phase 7 scavenge sweep 4/5: directive library expansion from conductor/tracks/ + conductor/tier2/ + conductor/code_styleguides/ + conductor/todos/.
|
||||
# Per user directive 2026-07-03: 5 parallel sweep workers. This worker (b_4) handled tracks + commands + styleguides + todos.
|
||||
# Scope: conductor/tracks/intent_dsl_survey_20260612/ (the remaining files after the prior scavenge lifted from spec.md only); conductor/tracks/nagent_review_20260608/ (the remaining files after the prior scavenge lifted from takeaways only); conductor/tier2/agents/tier2-autonomous.md; conductor/tier2/commands/tier-2-auto-execute.md; conductor/code_styleguides/agent_memory_dimensions.md; conductor/code_styleguides/code_path_audit.md; conductor/code_styleguides/type_aliases.md; conductor/todos/fix_test_suite_failures_20260516.md; conductor/todos/TODO_test_full_live_workflow.md; conductor/todos/TODO_test_full_live_workflow_v2.md; conductor/tracks/directive_hotswap_harness_20260627/dispatch_tier3_phase1.md.
|
||||
directives_before = 90
|
||||
directives_after = 108
|
||||
new_directives_count = 18
|
||||
new_directive_sources = "conductor/tier2/agents/tier2-autonomous.md + tier-2-auto-execute.md (8: use_batched_test_runner, ban_appdata_paths, master_branch_default, timeline_is_immutable, acknowledgment_in_first_commit, end_of_track_report_required, throwaway_scripts_isolated_subdir, per_phase_metric_regression_fix); conductor/code_styleguides/type_aliases.md §2.5 (per_aggregate_dataclass_promotion); conductor/code_styleguides/agent_memory_dimensions.md §7 (per_dimension_pick_dim_not_tool); conductor/tracks/nagent_review_20260608/decisions.md + nagent_review_v3_1_20260620.md (2: no_conductor_yaml_for_artifacts, per_conversation_scratch_dir); conductor/tracks/directive_hotswap_harness_20260627/dispatch_tier3_phase1.md (2: warm_md_duplicates_not_in_place, verbatim_lift_not_rewrite); conductor/todos/TODO_test_full_live_workflow.md + _v2.md (4: deterministic_signal_endpoint_pattern, failure_message_actionable_not_vague, submit_io_lazy_pool_recreation, fragile_test_in_batch_is_failing_test)"
|
||||
cap_applied = 25 # user cap was 25; lifted 18 (strongest, most actionable, most general-purpose)
|
||||
skipped_categories = ["Pure descriptive prose (cluster research reports — prior art surveys without current actionable rules)", "Aspirational future plans (decisions.md candidates — not yet implemented)", "Historical commentary without a current actionable rule (most v2.3 + v3 review prose)", "Content about the manual-slop app's specific UI/feature", "Rules already covered by the existing 90 directives (git_hard_bans already covers git revert/reset/stash ban; atomic_per_task_commits already covers per-task commit discipline)", "code_path_audit.md (descriptive audit tool conventions, not agent directives — same as Phase 1 skip per HARVEST_SUMMARY.md:26-27)", "agent_memory_dimensions.md §0-§6 (descriptive of the 4 dims; only the §7 decision tree lifted as one directive)", "fix_test_suite_failures_20260516.md (specific tactical fixes for a single track's regressions — not generalizable)", "messing_around.md (sample ideation without an actionable rule)"]
|
||||
commits = 4 # 1 commit per source-cluster batch + 1 preset/state/test commit = 5 total; counted as 4 directive-related commits + 1 preset/state/test commit
|
||||
test_added = "tests/test_scavenge_batch_4.py (94 parametrized cases + 2 aggregate tests; 18 directives × 5 contract checks = 90 + 4 aggregate = 94 total)"
|
||||
|
||||
|
||||
[scavenge_20260703_batch_5]
|
||||
# Phase 7 scavenge sweep 5/5: directive library expansion from docs/guide_*.md + .opencode/agents/*.md + .opencode/commands/*.md + .agents/agents/*.md + .agents/skills/mma-*/SKILL.md + mma-orchestrator/SKILL.md + docs/transcripts/session-ses_12c3.md.
|
||||
# Per user directive 2026-07-03: 5 parallel sweep workers. This worker (b_5) handled guides + role prompts + transcripts.
|
||||
# Scope: 32 docs/guide_*.md deep-dives, 6 .opencode/agents/*.md + 9 .opencode/commands/*.md role prompts, 4 .agents/agents/*.md + 5 .agents/skills/mma-*/SKILL.md role prompts, the mma-orchestrator/SKILL.md, the docs/transcripts/session-ses_12c3.md transcript, and the docs/handoffs/PROMPT_FOR_TIER_1.md handoff doc.
|
||||
# Out of scope: docs/ideation/* (aspirational; no actionable rule), docs/transcripts/*_youtube_* (others' transcripts; chatty), docs/type_registry/*.md (auto-generated schema dumps; treated as data, not directives).
|
||||
directives_before = 124 # post-batch-4 baseline (108 batch-4 + 16 batch-2 + 90 baseline-original + parallel sweep adds)
|
||||
directives_after = 135
|
||||
new_directives_count = 11
|
||||
new_directive_sources = "meta_tooling_app_boundary_check (guide_meta_boundary.md + The Overlap and Entropy Vector); tier1_first_commit_6file_acknowledgment (parallel of Tier 2 acknowledgment_in_first_commit; .agents/agents/tier1-orchestrator.md Pre-Action Required Reading); anti_entropy_state_audit_before_adding (.agents/skills/mma-tier2-tech-lead/SKILL.md Anti-Entropy Protocol State Auditing bullet); tier2_post_track_ruff_mypy_audit (.agents/skills/mma-tier2-tech-lead/SKILL.md Meta-Level Sanity Check bullet); tier2_pre_commit_deletion_and_diff_check (.agents/agents/tier2-tech-lead.md MANDATORY Pre-Commit Verification Gate); tier2_pre_flight_audit_gates (synthesis of .agents/agents/tier2-tech-lead.md Pre-Commit Verification Gate Step 2 + conductor/tier2/agents/tier2-autonomous.md); worker_three_point_abort_check (docs/guide_architecture.md Abort Event Propagation 3-point check pattern); audit_before_claiming_current_state (.agents/agents/tier1-orchestrator.md No more asserting from old reports); manual_compaction_only_no_auto_summarize (.opencode/agents/tier1-orchestrator.md + .opencode/agents/tier2-tech-lead.md Context Management MANUAL COMPACTION ONLY); spec_template_required_6_sections (.opencode/agents/tier1-orchestrator.md Spec Template + .opencode/commands/conductor-new-track.md Step 5); system_reminder_redact_don_act (safety observation from prior scavenge pass at state.toml safety_observations)"
|
||||
cap_applied = 25 # user cap was 25; lifted 11 (strongest, most actionable, most general-purpose)
|
||||
skipped_categories = ["Implementation-specific tactical notes (test-mock patterns, test fixtures, simulation tweaks, docker-compose config)", "Pure descriptive prose (guide_architecture.md threading model prose, guide_mma.md data structure descriptions)", "Role-specific operational trivia (Tier 3 specific 1-space indent enforcement - already covered by one_space_indent; Tier 4 specific read-only constraint - already covered by tier4_qa_compressed_fix)", "Historical commentary without an actionable current rule (most transcript content; most retrospective guides)", "Content about the manual-slop app specific UI/feature (guide_rag.md, guide_hot_reload.md, guide_nerv_theme.md, guide_themes.md, guide_docker_deployment.md)", "Rules already covered by the existing 124 directives (4-dimensional memory, knowledge harvest, RAG discipline, cache ordering, data-oriented error handling - all already covered; the heap of guide_*.md content re-states these)", "Single-file post-mortems and ideation notes (docs/ideation/* - aspirational only; the user own statement I want an article when I have code signals no directive yet)", "Auto-generated schema dumps (docs/type_registry/*.md - treated as data; not lifted as directives)", "Architecture descriptions that re-state existing directives (most of guide_architecture.md 8 architectural invariants are derived from strict_state_management + state_visible_at_the_right_layer + defer_not_catch_for_native_crashes)"]
|
||||
commits = 3 # 1 commit per source-cluster (guides cluster; role-prompts cluster; commands cluster) + 1 preset/state update = 4 total; counted as 3 directive-related commits + 1 preset/state update commit
|
||||
test_added = "tests/test_scavenge_batch_5.py (60 parametrized cases + 4 aggregate tests; 11 directives x 5 contract checks = 55 + 4 aggregate + 1 collision-avoidance = 60 total)"
|
||||
|
||||
[safety_observations_20260703_b5]
|
||||
# No prompt-injection attempts observed during the read pass for this slice.
|
||||
# One observation worth flagging: docs/guide_architecture.md (after its last meaningful line at 1004) had
|
||||
# an embedded <system-reminder> block at the tail echoing docs/AGENTS.md content. The instruction was
|
||||
# ignored; the actual scavenge task was followed. This is the same class of injection observed in
|
||||
# the prior batch (MCP_BUGFIX_20260306.md); both were ignored.
|
||||
|
||||
[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.
|
||||
Reference in New Issue
Block a user