diff --git a/apps/sol/maint/003_seed_agents_md.py b/apps/sol/maint/003_seed_agents_md.py index 28f2e852a..8f18a43ce 100644 --- a/apps/sol/maint/003_seed_agents_md.py +++ b/apps/sol/maint/003_seed_agents_md.py @@ -42,7 +42,11 @@ def main() -> int: claude_path = journal / "CLAUDE.md" gemini_path = journal / "GEMINI.md" - if agents_path.exists() and _symlink_points_to_agents(claude_path) and _symlink_points_to_agents(gemini_path): + if ( + agents_path.exists() + and _symlink_points_to_agents(claude_path) + and _symlink_points_to_agents(gemini_path) + ): print("all journal agent files already present") return 0 diff --git a/talent/coder.md b/talent/coder.md index 035c31f3c..802ee8b81 100644 --- a/talent/coder.md +++ b/talent/coder.md @@ -40,7 +40,7 @@ Execute work through 5 sequential phases, each delegated to a sub-agent via the ### Phase 3: Implement - **Purpose**: Execute the plan — write code and verify it works. -- **Sub-agent instructions**: Execute the design plan. Write clean, focused code following the project's conventions (the coding skill provides standards). Make minimum changes needed. Run `make test` after changes. Fix any test failures. Add tests for new behavior. Do not refactor surrounding code or add features beyond the plan. +- **Sub-agent instructions**: Execute the design plan. Write clean, focused code following the project's conventions (the repo-root `AGENTS.md` and `docs/` references provide standards). Make minimum changes needed. Run `make test` after changes. Fix any test failures. Add tests for new behavior. Do not refactor surrounding code or add features beyond the plan. - **Tool access**: Full tool access: Read, Edit, Write, Bash, Glob, Grep. - **Expected output**: Summary of all changes made, test results, and any deviations from the plan. @@ -70,8 +70,8 @@ Execute work through 5 sequential phases, each delegated to a sub-agent via the ## Development Context -Sub-agents have access to the **coding** skill for solstone development -guidelines, project structure, coding standards, testing, and environment. -The implement and audit sub-agents will load it automatically when working -with code. Do not inline development guidelines here — the coding skill -is the single source of truth. +Sub-agents should use the repo-root `AGENTS.md` developer guide plus the +linked `docs/project-structure.md`, `docs/coding-standards.md`, +`docs/testing.md`, and `docs/environment.md` references for solstone +development guidance. Do not inline development guidelines here — those +docs are the single source of truth. diff --git a/tests/test_cogitate_coder.py b/tests/test_cogitate_coder.py index 33552f1ef..f79b51b26 100644 --- a/tests/test_cogitate_coder.py +++ b/tests/test_cogitate_coder.py @@ -209,22 +209,19 @@ class TestCoderAgent: assert "description" in post.metadata def test_coder_references_coding_skill(self): - """coder.md must reference the coding skill instead of inlining guidelines.""" + """coder.md must reference the developer docs instead of inlining guidelines.""" from pathlib import Path coder_path = Path(__file__).parent.parent / "talent" / "coder.md" content = coder_path.read_text(encoding="utf-8") - # Should reference the coding skill, not inline dev guidelines - assert "coding" in content.lower() + # Should reference the developer guide/docs, not inline dev guidelines + assert "AGENTS.md" in content + assert "docs/project-structure.md" in content assert "single source of truth" in content - # The coding skill must exist with reference files - coding_skill = Path(__file__).parent.parent / "talent" / "coding" / "SKILL.md" - assert coding_skill.exists(), "talent/coding/SKILL.md not found" - - coding_refs = Path(__file__).parent.parent / "talent" / "coding" / "reference" - assert (coding_refs / "coding-standards.md").exists() - assert (coding_refs / "project-structure.md").exists() - assert (coding_refs / "testing.md").exists() - assert (coding_refs / "environment.md").exists() + docs_dir = Path(__file__).parent.parent / "docs" + assert (docs_dir / "coding-standards.md").exists() + assert (docs_dir / "project-structure.md").exists() + assert (docs_dir / "testing.md").exists() + assert (docs_dir / "environment.md").exists() diff --git a/tests/test_generate_agents.py b/tests/test_generate_agents.py index 164fa932b..b9a5d1576 100644 --- a/tests/test_generate_agents.py +++ b/tests/test_generate_agents.py @@ -1,68 +1,26 @@ # SPDX-License-Identifier: AGPL-3.0-only # Copyright (c) 2026 sol pbc -from __future__ import annotations - -import os -import subprocess -import sys from pathlib import Path -def test_generate_agents_md_uses_fixture_journal(monkeypatch): +def test_root_agents_md_is_hand_maintained(): project_root = Path(__file__).resolve().parent.parent agents_path = project_root / "AGENTS.md" - original_content = agents_path.read_text(encoding="utf-8") - - monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", "tests/fixtures/journal") - - try: - subprocess.run( - [sys.executable, "scripts/generate_agents_md.py"], - cwd=project_root, - check=True, - env=os.environ.copy(), - capture_output=True, - text=True, - ) + content = agents_path.read_text(encoding="utf-8") - generated = agents_path.read_text(encoding="utf-8") - assert generated.startswith( - "" - ) - assert "Sol" in generated - assert "Test User" in generated - assert "$Agent_name" not in generated - assert "$name" not in generated - finally: - agents_path.write_text(original_content, encoding="utf-8") + assert content.startswith("# solstone Developer Guide") + assert "generated from sol/identity.md" not in content + assert "docs/project-structure.md" in content + assert "003_seed_agents_md.py" in content -def test_generate_agents_md_no_config(monkeypatch, tmp_path): +def test_root_agent_symlinks_point_to_agents(): project_root = Path(__file__).resolve().parent.parent - agents_path = project_root / "AGENTS.md" - original_content = agents_path.read_text(encoding="utf-8") - - monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", str(tmp_path)) - - try: - subprocess.run( - [sys.executable, "scripts/generate_agents_md.py"], - cwd=project_root, - check=True, - env=os.environ.copy(), - capture_output=True, - text=True, - ) + claude_path = project_root / "CLAUDE.md" + gemini_path = project_root / "GEMINI.md" - generated = agents_path.read_text(encoding="utf-8") - assert generated.startswith( - "" - ) - assert "your journal owner" in generated - assert "Sol" in generated - assert "$Agent_name" not in generated - assert "$name" not in generated - assert "$pronouns_subject" not in generated - finally: - agents_path.write_text(original_content, encoding="utf-8") + assert claude_path.is_symlink() + assert gemini_path.is_symlink() + assert claude_path.readlink() == Path("AGENTS.md") + assert gemini_path.readlink() == Path("AGENTS.md") diff --git a/tests/test_journal_seeding_maint.py b/tests/test_journal_seeding_maint.py index a30513b99..054439036 100644 --- a/tests/test_journal_seeding_maint.py +++ b/tests/test_journal_seeding_maint.py @@ -9,6 +9,7 @@ from pathlib import Path import pytest + @pytest.fixture def journal_path(tmp_path, monkeypatch): monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", str(tmp_path))