Skip to content

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

Merged
gknapp1 merged 9 commits into
mainfrom
docs/180-add-repo-agent-harness
Jun 19, 2026
Merged

docs(agent): add repository agent harness and dev-tool preflight#185
gknapp1 merged 9 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

@gknapp1 gknapp1 left a comment

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.

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 Outdated
Comment thread .codex/config.toml Outdated
Comment thread scripts/check_docs_harness.py
gknapp1 added 2 commits June 15, 2026 16:49
- remove Codex-specific scope from repo
- focus agent instructions through repo documentation and architecture map
@gknapp1

gknapp1 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

@liamnwhite1, I pushed changes that address my comments. Thoughts?

gknapp1 added 5 commits June 17, 2026 16:43
- Shortened AGENTS.md into a routing-focused entrypoint (~1900 tokens -> ~1400 tokens)
- Relaxed scripts/check_docs_harness.py to check key structure, required links, link validity, and compactness.
- Updated scripts/check_dev_tools.py with shell-neutral PATH/cache guidance.
- Updated docs in ARCHITECTURE.md, docs/developer_guide.md, and docs/documentation.md.
- AI contribution: human-led and edited, gpt-5.5 feature implmentation drafting
- documentation should not be an issue tracker, leave that to GitHub site
- updates header name in doc harness check

@gknapp1 gknapp1 left a comment

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.

Overall, think this is a useful addition to the documentation. I've added my changes and made some corrections, so this is good to go for now.

We can iterate if the agent-specific instructions need tweaking or if some aspects of the docs become routinely stale.

@gknapp1 gknapp1 merged commit 4aed848 into main Jun 19, 2026
3 checks passed
@gknapp1 gknapp1 deleted the docs/180-add-repo-agent-harness branch June 19, 2026 20:02
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