Private
Public Access
0
0
Commit Graph

4838 Commits

Author SHA1 Message Date
ed ebca201d39 feat(directives): scavenge from nagent_review_20260608/: 5 directives 2026-07-04 00:13:24 -04:00
ed bea5d6b151 feat(directives): scavenge from docs/MMA_Support/: 5 directives 2026-07-04 00:11:15 -04:00
ed 3155518305 test(aggregate_directives): assert clean bodies + pollution-fix + max_chars cap + MCP impl
8 new importable-function tests in tests/test_aggregate_directives.py:
- test_importable_function_returns_clean_body
- test_importable_function_no_meta_md_pollution
- test_importable_function_max_chars_truncates_with_suffix
- test_importable_function_max_chars_zero_is_unlimited
- test_importable_function_max_chars_above_size_is_unlimited
- test_importable_function_missing_preset_raises
- test_importable_function_missing_v1_in_preset_raises
- test_importable_function_accepts_relative_preset_path

7 new MCP-server tests in tests/test_mcp_aggregate_directives.py:
- test_mcp_server_exposes_aggregate_directives_spec
- test_mcp_server_impl_default_preset
- test_mcp_server_impl_explicit_preset_path
- test_mcp_server_impl_max_chars_truncates
- test_mcp_server_impl_missing_preset_returns_error_string
- test_mcp_server_impl_zero_max_chars_is_unlimited
- test_mcp_server_list_tools_includes_aggregate_directives

Tests load modules via importlib.util.spec_from_file_location so the
scripts/mcp_server.py main guard is not triggered during testing.
sandbox-policy compliance: all write paths use tmp_path.

22 tests pass (15 aggregate_directives + 7 MCP); 7 pre-existing CLI
tests still pass byte-identical.
2026-07-03 10:52:16 -04:00
ed a527f6224f feat(mcp-server): add aggregate_directives tool to scripts/mcp_server.py
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.
2026-07-03 10:48:44 -04:00
ed 5df938805e refactor(aggregate_directives): expose importable aggregate_directives(preset_path, max_chars, project_root) function
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.
2026-07-03 10:46:19 -04:00
ed 7d7f88f823 test(aggregate_directives): assert every v1.md has top-level # header 2026-07-03 09:46:33 -04:00
ed 4d2179c38f feat(directives): add rule-statement header to 57-63 of 66 v1.md files 2026-07-03 09:45:50 -04:00
ed 17e3a37b41 feat(directives): add rule-statement header to 49-56 of 66 v1.md files 2026-07-03 09:45:49 -04:00
ed 8cf4b57a74 feat(directives): add rule-statement header to 41-48 of 66 v1.md files 2026-07-03 09:45:49 -04:00
ed ead7cf2869 feat(directives): add rule-statement header to 33-40 of 66 v1.md files 2026-07-03 09:45:48 -04:00
ed e9275236f2 feat(directives): add rule-statement header to 25-32 of 66 v1.md files 2026-07-03 09:45:47 -04:00
ed 4692d01c54 feat(directives): add rule-statement header to 17-24 of 66 v1.md files 2026-07-03 09:45:46 -04:00
ed 85ae99c6a5 feat(directives): add rule-statement header to 9-16 of 66 v1.md files 2026-07-03 09:45:46 -04:00
ed cf8eab9f79 feat(directives): add rule-statement header to 1-8 of 66 v1.md files 2026-07-03 09:45:45 -04:00
ed cd272e5c8e conductor(plan): mark Phase 4 expansion complete (E.1-E.5; 66 directives; aggregation script) 2026-07-03 00:05:42 -04:00
ed 8ef66e0287 chore(artifacts): keep throwaway expansion helpers in scripts/tier2/artifacts/ (per Tier 2 convention) 2026-07-03 00:05:08 -04:00
ed 465433e067 feat(directives): add 15 new directives (Phase A expansion) to current_baseline preset
Adds: ast_parse_insufficient, ast_verify_class_methods_after_edit,
contract_change_audit, convention_enforcement_4_mechanisms,
core_value_read_first, decorator_orphan_pitfall,
defer_not_catch_for_native_crashes, edit_small_incremental,
live_gui_session_scoped_no_restart, no_real_io_during_tests,
preserve_line_endings, reset_session_preserves_project_path,
test_narrow_not_kitchen_sink, undo_redo_100_snapshot_capacity,
verify_before_editing.

Total: 66 directives in the preset (51 original + 15 expansion).
2026-07-03 00:04:54 -04:00
ed 9d3222ddc0 feat(scripts): add scripts/aggregate_directives.py (presets -> clean body aggregation)
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.
2026-07-03 00:03:51 -04:00
ed 454fac1bff feat(directives): harvest 2 directives from docs/guide_state_lifecycle.md (undo/redo 100-snapshot, reset preserves project path) 2026-07-02 23:56:33 -04:00
ed a758f0a4c9 feat(directives): harvest 5 directives from docs/guide_testing.md (sandbox overview, live_gui session-scoped, defer-not-catch, narrow tests, AST method visibility) 2026-07-02 23:56:26 -04:00
ed 782530ba6d feat(directives): harvest 6 directives from conductor/edit_workflow.md (Rules 1, 2, 6, 7, 8 contract-change, 8 EOL) 2026-07-02 23:56:18 -04:00
ed 8407742a14 feat(directives): harvest 2 directives from docs/AGENTS.md (core_value_read_first, convention_enforcement_4_mechanisms) 2026-07-02 23:56:11 -04:00
ed 559db09ce4 refactor(directives): strip metadata header from v1.md (45-51 of 51; meta extracted to meta.md) 2026-07-02 23:47:20 -04:00
ed 5b0f932c4b refactor(directives): strip metadata header from v1.md (36-44 of 51; meta extracted to meta.md) 2026-07-02 23:47:12 -04:00
ed 68352ee206 refactor(directives): strip metadata header from v1.md (27-35 of 51; meta extracted to meta.md) 2026-07-02 23:46:41 -04:00
ed 831499622d refactor(directives): strip metadata header from v1.md (18-26 of 51; meta extracted to meta.md) 2026-07-02 23:46:33 -04:00
ed 71e01dfee7 refactor(directives): strip metadata header from v1.md (9-17 of 51; meta extracted to meta.md) 2026-07-02 23:46:16 -04:00
ed e9a19523d6 refactor(directives): strip metadata header from v1.md (1-8 of 51; meta extracted to meta.md) 2026-07-02 23:46:04 -04:00
ed c9f30abffc docs(reports): TRACK_COMPLETION_directive_hotswap_harness_20260627 2026-07-02 23:27:25 -04:00
ed bbbfbd3947 conductor(verify): Phase 3 §3.1 directory structure verification — all 5 criteria match 2026-07-02 23:26:13 -04:00
ed 6ba4bdde48 feat(role-prompts): add 5 .warm.md duplicates (warm-with: bootstrap; originals untouched as rollback target) 2026-07-02 23:24:17 -04:00
ed 7b0d116479 feat(role-prompts): add tier2-autonomous.warm.md duplicate with warm-with: bootstrap 2026-07-02 23:23:34 -04:00
ed b2aebbc97f feat(role-prompts): add tier4-qa.warm.md duplicate with warm-with: bootstrap 2026-07-02 23:22:47 -04:00
ed 40764252f4 feat(role-prompts): add tier3-worker.warm.md duplicate with warm-with: bootstrap 2026-07-02 23:21:58 -04:00
ed b082cb158c feat(role-prompts): add tier2-tech-lead.warm.md duplicate with warm-with: bootstrap 2026-07-02 23:21:14 -04:00
ed 35831084f5 feat(role-prompts): add tier1-orchestrator.warm.md duplicate with warm-with: bootstrap 2026-07-02 23:20:07 -04:00
ed 2ddaeb52c1 feat(directives): add current_baseline preset (51 directives, all v1) 2026-07-02 23:14:36 -04:00
ed e13d8b9b8a docs(harness): Phase 2 makes .warm.md duplicates not in-place edits (per user 2026-07-02)
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.
2026-07-02 22:53:27 -04:00
ed 068411ee0b Revert "docs(chronology): regenerate after directive_hotswap_harness_20260627 phase-1 commit"
This reverts commit bfebb71871.
2026-07-02 22:46:07 -04:00
ed bfebb71871 docs(chronology): regenerate after directive_hotswap_harness_20260627 phase-1 commit 2026-07-02 22:27:04 -04:00
ed 8162f629c2 conductor(plan): Mark t1_11 complete + phase_1 done (51 directives, current_phase=2) 2026-07-02 22:23:18 -04:00
ed ce0564fef6 feat(directives): commit Phase 1 harvest summary (51 v1.md files)
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.
2026-07-02 22:21:31 -04:00
ed 9d6a30467f conductor(plan): Mark t1_10 complete 2026-07-02 22:17:57 -04:00
ed cdc0f1405c feat(directives): harvest 8 directives from feature_flags/RAG/cache/knowledge styleguides + 4 new styleguides 2026-07-02 22:17:20 -04:00
ed 09d6a9c7c8 conductor(plan): Mark t1_9 complete 2026-07-02 22:11:56 -04:00
ed fa3e5381fe feat(directives): harvest 5 GUI/architecture directives from product-guidelines.md + python.md 2026-07-02 22:11:19 -04:00
ed 2d07df594d conductor(plan): Mark t1_8 complete 2026-07-02 22:09:46 -04:00
ed 77ee0c68fd feat(directives): harvest 6 process anti-pattern directives from AGENTS.md + workflow.md 2026-07-02 22:09:05 -04:00
ed c8094ec225 conductor(plan): Mark t1_7 complete 2026-07-02 22:07:38 -04:00
ed 412494d205 feat(directives): harvest 10 process/workflow directives from AGENTS.md + workflow.md 2026-07-02 22:07:08 -04:00