Adds a new MCP tool that exposes scripts/aggregate_directives.py as an
LLM-callable endpoint. The tool reads a presets markdown file, resolves
each directive's v1.md, and returns the concatenated clean directive
bodies. metadata (meta.md) is never read.
Tool contract:
name: aggregate_directives
params: preset_path (string, default current_baseline.md), max_chars (int, default 0)
result: text content (clean bodies) or 'ERROR: ...' string on failure
Dispatch runs the impl in asyncio.to_thread so the 66+ v1.md reads do not
block the MCP stdio loop. Errors from aggregate_directives are caught and
formatted as 'ERROR: aggregate_directives(<path>) failed: <type>: <msg>' so
the LLM can read the failure mode inline. Tool count: 45 (MCP_TOOL_SPECS)
+ 2 (run_powershell, aggregate_directives) = 47.
Added scripts/ to sys.path so 'from aggregate_directives import ...' works
inside the MCP server process; idempotent with existing project_root and src
path inserts.
Wraps the body-building core in a public aggregate_directives() function that
returns the rendered string and raises FileNotFoundError/ValueError on errors.
The existing aggregate() CLI wrapper catches those and preserves the prior
stdout/file output behavior. parse_preset now accepts an optional root param so
directive paths inside the preset resolve against a caller-supplied
project_root instead of always REPO_ROOT. No behavior change for the CLI; the
new function is the API surface used by the upcoming MCP server tool.
Aggregates v1.md bodies from a preset markdown into a single output stream.
NEVER reads meta.md (pollution fix). Stdlib-only; supports stdout and -o.
5 tests in tests/test_aggregate_directives.py cover: success path,
no-meta-md pollution, missing-file error, -o flag, no provenance leakage.
The 'update role prompts' step in Phase 2 was specified as in-place
edits to the 5 .opencode/agents/*.md role prompts. The user clarified
2026-07-02 that this should be making duplicates with a .warm.md
suffix so the originals stay as an explicit rollback target.
Changed:
- spec.md: added a USER DIRECTIVE block above 'The role-prompt
bootstrap' section explaining the .warm.md duplicate convention.
- plan.md: the Phase 2 preamble references the spec directive; Steps
2.3-2.7 rewritten as 'Create duplicate <name>.warm.md (do NOT
modify the original)'. Output paths now include .warm.md suffix.
- dispatch_tier3_phase1.md: appended a USER DIRECTIVE section at the
end + a NEVER-run-chronology-regenerate note (the script corrupts
Unicode, per the 2026-07-02 revert of bfebb718).
Phase 1 work (51 v1.md directives + 11 commits ee36eaed..8162f629)
is unaffected. Master is at 068411ee (after the chronology revert).
This commit brings master to this point.
Systematic extraction of every directive-like statement from the entire doc tree
into conductor/directives/<name>/v1.md files. 51 v1 files lifted verbatim from
production docs.
Per-task atomic commits (t1_1..t1_10) provide the per-directive provenance.
This meta-commit captures the harvest-level summary.
Sources combed: AGENTS.md, conductor/workflow.md, conductor/product-guidelines.md,
conductor/tech-stack.md, all 14 conductor/code_styleguides/*.md,
.opencode/commands/*.md.
Original docs remain untouched as canonical source. The conductor/directives/
tree is a parallel structure, not a replacement. Future v2+ variants can
test alternative encodings (rationale-first, before/after, tabular) against
this baseline.