Skip to content

docs(agent): add repository agent harness and dev-tool preflight#185

Open
liamnwhite1 wants to merge 2 commits into
mainfrom
docs/180-add-repo-agent-harness
Open

docs(agent): add repository agent harness and dev-tool preflight#185
liamnwhite1 wants to merge 2 commits into
mainfrom
docs/180-add-repo-agent-harness

Conversation

@liamnwhite1
Copy link
Copy Markdown
Collaborator

Summary

Adds a repository-specific agent and documentation harness for Myna so maintainers, contributors, and coding agents can orient themselves from a fresh clone and validate the local development environment before making changes.

Related issues

Details

This is a documentation and maintenance change. It addresses generic .codex guidance by adding a Myna-specific repository harness.

The implementation adds:

  • .codex/AGENTS.md as the compact coding-agent entrypoint with setup, commands, testing guidance, architecture rules, documentation rules, PR guidance, security notes, and handoff checklist.
  • ARCHITECTURE.md as the detailed repository map covering runtime model, workflow concepts, control flow, dependency boundaries, extension points, validation, docs architecture, external systems, and known gaps.
  • docs/testing.md for pytest markers, default tests, external-application checks, CI expectations, and skipped-check reporting.
  • docs/documentation.md for MkDocs/LazyDocs maintenance, generated API docs, docs update rules, and agent harness maintenance.
  • docs/decisions/ with an index and lightweight ADR template.
  • scripts/check_dev_tools.py for fresh-clone/dev-shell preflight checks.
  • scripts/check_docs_harness.py for required harness headings and .codex/AGENTS.md link validation.

The docs harness check is wired into pre-commit and main CI. README, developer guide, getting started docs, and docs navigation were updated to point at the new surfaces. The documented external-app pytest command was also corrected to uv run pytest -m apps.

Impact

No Myna runtime behavior, CLI behavior, public workflow input format, database behavior, or simulation output behavior is changed.

Risk level: Low. The change is limited to documentation, standalone maintenance scripts, and CI/pre-commit harness validation.

Testing strategy

Environment used while drafting:

  • OS/shell: Linux 6.17.0-29-generic, bash
  • Python: 3.12.3
  • Install method: existing uv-managed development environment
  • Commit: 1e952cb

Validation:

  • python scripts/check_dev_tools.py
  • uv run --frozen --no-sync python scripts/check_docs_harness.py
  • uv run --frozen --no-sync ruff check scripts/check_dev_tools.py scripts/check_docs_harness.py
  • uv run --frozen --no-sync ruff format --check scripts/check_dev_tools.py scripts/check_docs_harness.py
  • uv run --frozen --no-sync scripts/group_docs.py
  • uv run --frozen --no-sync mkdocs build --strict
  • uv run --frozen --no-sync pytest
  • uv run --frozen --no-sync pre-commit run --files <changed files>
  • git diff --check
  • python3 scripts/check_docs_harness.py

External application tests were not rerun because this PR is limited to documentation, repository maintenance scripts, and harness validation.

Add a repository-level agent harness so future coding agents and
contributors can orient themselves, validate their environment, and make
architecture-respecting changes from a fresh clone.

Added:
- Add root ARCHITECTURE.md with verified repository structure, runtime model,
  core concepts, control flow, dependency boundaries, extension points,
  validation commands, docs architecture, external dependencies, and known gaps.
- Add root AGENTS.md as the compact agent entrypoint with setup commands,
  repository map, architecture rules, testing guidance, documentation rules,
  and handoff checklist.
- Add docs/testing.md to document pytest markers, default tests, external-app
  tests, CI expectations, and skipped-check reporting.
- Add docs/documentation.md to document MkDocs, generated API docs, agent
  harness maintenance, and documentation update rules.
- Add docs/decisions/ with an index and lightweight ADR template.
- Add scripts/check_docs_harness.py to verify required harness files,
  required headings, AGENTS.md links, and the AGENTS.md -> ARCHITECTURE.md
  relationship.
- Add scripts/check_dev_tools.py to verify fresh-clone development readiness,
  including Python version, uv availability, writable caches, uv lock state,
  project Python, and dev tools available through uv run.

Changed:
- Wire the docs harness check into pre-commit and CI.
- Update docs navigation for testing, documentation, changelog, and decisions.
- Update README development links to point to the new architecture, agent, and
  testing docs.
- Update developer setup docs to run the dev-tool preflight before and after
  syncing dev dependencies.
- Fix the documented external-app pytest command from `uv run pytest --apps`
  to `uv run pytest -m apps`.

Rationale:
- Make repository knowledge the system of record for future agents and
  maintainers.
- Avoid relying on local shell state, hidden setup assumptions, or chat history.
- Give agents a deterministic first command for detecting missing tools,
  unwritable caches, unsynced dev dependencies, and docs-generation Python
  parity issues.
- Keep AGENTS.md short while linking to deeper, focused documentation.

Validation:
- python scripts/check_dev_tools.py
- uv run --frozen --no-sync python scripts/check_docs_harness.py
- uv run --frozen --no-sync ruff check scripts/check_dev_tools.py scripts/check_docs_harness.py
- uv run --frozen --no-sync ruff format --check scripts/check_dev_tools.py scripts/check_docs_harness.py
- uv run --frozen --no-sync scripts/group_docs.py
- uv run --frozen --no-sync mkdocs build --strict
- uv run --frozen --no-sync pytest
- uv run --frozen --no-sync pre-commit run --files <changed files>
- git diff --check
Comment thread .codex/config.toml Outdated
@liamnwhite1 liamnwhite1 requested a review from gknapp1 June 2, 2026 11:47
Copy link
Copy Markdown
Collaborator

@gknapp1 gknapp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit hard to quantify effectiveness here, but I tested out the agent harness this seems to be reducing the context size compared to what I had previously seen (~50k tokens for a broadly scoped planning prompt instead of of ~100k). And documentation is useful, even outside of agentic coding applications.

My main concern is the decisions template. In having an agent plan changes, including assessing if a decision document was needed, it seems to either prefer writing a decision document over updating architecture.md (creating a documentation mismatch) or updating both (unncessary duplication). Is there any strong benefit to having the lengthier decision document over making sure that architecture.md stays up to date and maybe includes some short rationale for decisions in key places?

Comment thread docs/testing.md
Comment on lines +98 to +108
## Reporting Skipped Or Unavailable Checks

When handing off work, include:

- the exact command run;
- whether it passed or failed;
- the reason if it could not run, such as missing external executable, unavailable
optional extra, container dependency, or network restriction.

Do not replace a missing external-app test with a default pytest run and call the
external behavior covered. Say what was covered and what remains unverified.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is agent-only instructions, this would better in an AGENTS.md within tests?

Comment thread .codex/config.toml
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If "pragmatic" and "gpt-5.5" are the only settings we are enforcing in config.toml, why include a .codex directory in Myna? These configurations are outside of Myna's scope. AGENTS.md can be moved to the repo root and then be portable for different model providers.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the use of enforcing that AGENTS.md must link the ARCHITECTURE.md document. But the required headings seem overly prescriptive and add bloat that has to be maintained. Does the heading check solve a particular issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: clean up .codex to remove non-repository specific settings

2 participants