# Teaching example for google/ax revision 22954f6.
# Use after installing AX and Agent Substrate in a development cluster.
apiVersion: ax.io/v1alpha1
kind: Workspace
metadata:
  name: readme-review
spec:
  files:
    - path: README.md
      content: |
        # Tiny Project
        A sample project for learning AX.
    - path: check_readme.py
      content: |
        from pathlib import Path

        readme = Path("README.md").read_text()
        headings = [line.lstrip("# ").strip().lower()
                    for line in readme.splitlines() if line.startswith("#")]
        found = any("install" in heading for heading in headings)
        result = "FOUND" if found else "MISSING"
        report = f"Installation heading: {result}\n"
        Path("/workspace/report.txt").write_text(report)
        print(report, end="")
---
apiVersion: ax.io/v1alpha1
kind: Task
metadata:
  name: readme-check
spec:
  workspaces:
    - name: readme-review
      path: /workspace
  command: ["python3", "check_readme.py"]
  debug: true
