Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ App 15368 is GitHub Actions, the app the current checks are pinned to.
| packages.yml | `types`, `agent` | Python 3.12 | Python 3.12 | Python 3.10 and 3.12 |
| packages.yml | `verify-clean-install` | Python 3.12 | Python 3.12 | Python 3.10 and 3.12 |
| packages.yml | `flow-lint`, `flow-critical`, `flow-onprem-offline` | yes | yes | yes |
| ci.yml | `smoke` (with the file-size ratchet against the base), `ci` | yes | yes | no |
| ci.yml | `smoke` (with the file-size ratchet against the base and the generated-page check), `ci` | yes | yes | no |
| packages.yml | `flow-unit` | 3 shards packed by measured time, fast lane (without `nightly_only.txt`) | no | 2 shards, without the `live ` entries (nightly runs them) |
| packages.yml | `flow-native-census` | no | no | Windows and macOS |
| packages.yml | `capture-linux` | Python 3.12 | Python 3.12 | Python 3.10 (ubuntu-22.04), 3.11, 3.12 |
Expand All @@ -131,6 +131,23 @@ App 15368 is GitHub Actions, the app the current checks are pinned to.
| codeql.yml | `Analyze` (Python, JavaScript/TypeScript, Rust) | per changed language | per changed language | all languages on main (one analysis at a time, newest waiting push wins) and weekly |
| secret-scan.yml, dependency-review.yml, platform-manifest.yml | all | yes | yes | yes |
| docs.yml, link-check.yml (internal), production-lifecycle.yml, release-health.yml (self-test) | all | yes | no | main only |
| refresh-generated.yml | `refresh` (opens a draft pull request that regenerates CAPABILITIES.md and llms-full.txt) | no | no | when their sources change on main, daily, and on dispatch |

## Generated pages

CAPABILITIES.md and llms-full.txt are generated, and nearly every pull request
changes their sources. When each pull request regenerated them, every merge
made the other open pull requests conflict. Now a pull request edits only the
sources (a row file under `capabilities/`, a command file, README.md, ...),
and `refresh-generated.yml` regenerates both pages after the change lands. It
opens a draft pull request from `bot/refresh-generated-<sha>-<run>` and closes the
one it replaces; it never pushes to main. GitHub starts no workflows for a
pull request the workflow token opens, so the pull request is a draft, and
marking it ready runs CI. On a pull request, the smoke job's
`build_capabilities.py --check-pr HEAD^1` fails only a hand edit of a page (a
page that matches neither its sources nor the base), since the refresh would
drop it. Main can trail its sources until the refresh merges; nothing strict
runs on main or nightly, so a pending refresh never turns main red.

Ubuntu package callers use the composite at the immutable
`OpenAdaptAI/OpenAdapt/.github/actions/apt-install@94f724c7dc0b0995a7108b7b99bbb53f0749cb68`.
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@ jobs:
# file this change grew (or whose budget row it edited), so a file
# someone else left over budget never fails an unrelated change.
run: python3 scripts/check_file_size_ratchet.py --base HEAD^1
- name: No generated page was edited by hand
# CAPABILITIES.md and llms-full.txt are generated from sources (row
# files under capabilities/, README.md, ...). A change edits the
# sources only; refresh-generated.yml regenerates the pages after it
# lands. This fails only when the change edits a page so that it no
# longer matches its sources, an edit the next refresh would drop. A
# page that merely trails its sources passes.
run: python3 scripts/build_capabilities.py --check-pr HEAD^1
- uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
enable-cache: true
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ env:
--exclude-path '(^|/)(legacy|node_modules|\.venv|growth-worktrees|\.claude)/'
--exclude-path 'CHANGELOG\.md$'
--exclude-path '/\.github/'
--exclude-path '(^|/)capabilities/'
'./**/*.md'

jobs:
Expand All @@ -70,8 +71,14 @@ jobs:
exit 0
fi
files="$(git diff --name-only --diff-filter=d HEAD^1 HEAD -- '*.md' \
| grep -Ev '(^|/)(legacy|node_modules|\.venv|growth-worktrees|\.claude|\.github)/|(^|/)CHANGELOG\.md$' \
| grep -Ev '^capabilities/|(^|/)(legacy|node_modules|\.venv|growth-worktrees|\.claude|\.github)/|(^|/)CHANGELOG\.md$' \
| sed "s/.*/'&'/" | tr '\n' ' ' || true)"
# Row files under capabilities/ link relative to CAPABILITIES.md,
# where they print: check the page assembled from them instead.
if git diff --name-only HEAD^1 HEAD -- capabilities | grep -q .; then
python3 scripts/build_capabilities.py
files="$files 'CAPABILITIES.md'"
fi
echo "paths=$files" >> "$GITHUB_OUTPUT"
echo "Checking: ${files:-nothing}"

Expand Down
156 changes: 156 additions & 0 deletions .github/workflows/refresh-generated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Refresh generated pages

# CAPABILITIES.md and llms-full.txt are generated from sources (row files
# under capabilities/, packages/flow/docs/commands/, README.md, the Flow docs
# and changelog). Pull requests change only the sources: when every pull
# request also regenerated the pages, each merge to main made every other
# open pull request conflict. This workflow regenerates both pages from main
# and opens a draft pull request with the result. It never pushes to main.
#
# The pull request is opened with the workflow's own token, and GitHub starts
# no workflows for that, so it opens as a draft: marking it ready for review
# (a person's action) runs CI as usual. A newer refresh closes the older one.
# On a pull request, ci.yml only checks that neither page was edited by hand
# (scripts/build_capabilities.py --check-pr).

on:
push:
branches: [main]
paths:
- "capabilities/**"
- "packages/flow/docs/commands/**"
- "README.md"
- "packages/flow/docs/SURFACES.md"
- "packages/flow/docs/LIMITS.md"
- "packages/flow/CHANGELOG.md"
- "packages/flow/pyproject.toml"
- "scripts/build_capabilities.py"
- "scripts/build_command_map.py"
- "scripts/build_llms_full.py"
# A merged refresh runs once more, finds nothing to do, and closes any
# refresh pull request it made obsolete.
- "CAPABILITIES.md"
- "llms-full.txt"
schedule:
- cron: "17 6 * * *"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: refresh-generated
cancel-in-progress: true

jobs:
refresh:
name: refresh CAPABILITIES.md and llms-full.txt
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: main
# The step below pushes the refresh branch (never main).
persist-credentials: true
- name: Regenerate, and open or replace the refresh pull request
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
# Stop, rather than drop a row, when the page changed outside the
# generator (a pull request whose CI passed before --check-pr).
python3 scripts/build_capabilities.py --guard
python3 scripts/build_capabilities.py
python3 scripts/build_llms_full.py
python3 scripts/build_capabilities.py --check
python3 scripts/build_llms_full.py --check

prefix="bot/refresh-generated-"
open_prs="$(gh pr list --repo "$GITHUB_REPOSITORY" --state open \
--author "app/github-actions" --limit 100 \
--json number,headRefName,body \
--jq "map(select(.headRefName | startswith(\"$prefix\")))")"

if git diff --quiet -- CAPABILITIES.md capabilities/CAPABILITIES.md.sha256 llms-full.txt; then
echo "CAPABILITIES.md and llms-full.txt are current."
for number in $(jq -r '.[].number' <<<"$open_prs"); do
gh pr close "$number" --repo "$GITHUB_REPOSITORY" --delete-branch \
--comment "main already has these pages; nothing to refresh."
done
exit 0
fi

digest="$(cat CAPABILITIES.md llms-full.txt | sha256sum | cut -c1-16)"
if jq -e --arg d "content: $digest" 'any(.[]; .body | contains($d))' <<<"$open_prs" >/dev/null; then
echo "An open refresh pull request already has this content ($digest)."
exit 0
fi

# Lines the refresh drops from CAPABILITIES.md, for the reviewer: a
# row edited or removed through its row file shows here, and so
# would a hand edit of the page that never reached a row file.
removed="$(git diff -U0 -- CAPABILITIES.md | grep -E '^-[^-]' | cut -c2-200 | head -20 || true)"
sha="$(git rev-parse --short=12 HEAD)"
# The run id keeps a rerun on the same commit off an old branch.
branch="${prefix}${sha}-${GITHUB_RUN_ID}"
git switch -c "$branch"
git add CAPABILITIES.md capabilities/CAPABILITIES.md.sha256 llms-full.txt
git -c user.name="github-actions[bot]" \
-c user.email="41898282+github-actions[bot]@users.noreply.github.com" \
commit -q -m "docs: refresh CAPABILITIES.md and llms-full.txt"
git push -q origin "HEAD:refs/heads/$branch"

body="$(printf '%s\n' \
"Regenerated from main at ${sha} by \`.github/workflows/refresh-generated.yml\`:" \
"\`python scripts/build_capabilities.py\` and \`python scripts/build_llms_full.py\`." \
"" \
"This is a draft because GitHub runs no workflows for a pull request the workflow token opens. Mark it ready for review to run CI, then merge it like any other." \
"" \
"Lines this refresh removes from CAPABILITIES.md (an edited or removed row shows here; anything else is a hand edit to move into capabilities/ first):" \
"" \
'```' \
"${removed:-(none)}" \
'```' \
"" \
"content: ${digest}")"
url="$(gh pr create --repo "$GITHUB_REPOSITORY" --draft --base main \
--head "$branch" \
--title "docs: refresh CAPABILITIES.md and llms-full.txt" \
--body "$body")"
echo "opened $url"
for number in $(jq -r '.[].number' <<<"$open_prs"); do
gh pr close "$number" --repo "$GITHUB_REPOSITORY" --delete-branch \
--comment "Superseded by $url."
done

blocked:
name: refresh blocked issue
needs: refresh
if: failure()
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write
steps:
- name: Open, or comment on, the issue
env:
GH_TOKEN: ${{ github.token }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
set -euo pipefail
title="CAPABILITIES.md refresh blocked"
body="The refresh of CAPABILITIES.md and llms-full.txt stopped: ${RUN_URL}

Usually the page on main was edited by hand, so regenerating it would drop that edit. The run log lists the lines no file under capabilities/ produces. Add a row file for each (or edit section.md) and run python scripts/build_capabilities.py in the same pull request."
number="$(gh issue list -R "$GITHUB_REPOSITORY" --state open \
--search "\"$title\" in:title" --json number,title \
-q "map(select(.title == \"$title\")) | .[0].number // empty")"
if [ -n "$number" ]; then
gh issue comment "$number" -R "$GITHUB_REPOSITORY" --body "$body"
else
gh issue create -R "$GITHUB_REPOSITORY" --title "$title" --body "$body"
fi
15 changes: 10 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ under `packages/flow`, next to `packages/agent`, `packages/types` and
`packages/capture`. The standalone openadapt-flow, openadapt-agent and
openadapt-types repositories are frozen; changes go here.
[CAPABILITIES.md](CAPABILITIES.md) is the map of what exists and how proven
it is; update it in the same pull request as any capability change. For a
new `openadapt-flow` command, add `packages/flow/docs/commands/<group>/<verb>.md`
and run `python scripts/build_command_map.py` (a test enforces it). Refresh the review brief with `python scripts/build_llms_full.py` when you
change README.md, CAPABILITIES.md, SURFACES.md, LIMITS.md or the flow
CHANGELOG, and always before a release.
it is. It is generated from `capabilities/`, one file per table row: in the
same pull request as any capability change, add or update your row file
(`capabilities/<NN>-<section>/<NNNN>-<slug>.md`, one table line) or the
section's `section.md`. For a new `openadapt-flow` command, add
`packages/flow/docs/commands/<group>/<verb>.md` (a test enforces it). Do not
regenerate or hand-edit CAPABILITIES.md or llms-full.txt in a pull request:
`.github/workflows/refresh-generated.yml` opens a draft pull request that
refreshes both after the change lands, and CI fails a hand edit. Before a
release, merge the open refresh pull request (or run the workflow) so the
review brief names the new version.

The current product compiles demonstrated GUI workflows into deterministic,
locally executable programs. Healthy runs make no model calls. Training,
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ package availability, repository text, or a sibling repository.
- Test durable behavior and package contracts rather than ordinary copy.
- Keep changes focused and update the canonical documentation when behavior
changes.
- A capability change documents itself in the same pull request: add or edit
its row file under `capabilities/` (one file per row of the
[CAPABILITIES.md](CAPABILITIES.md) tables; `capabilities/README.md` says
how). Don't edit or regenerate `CAPABILITIES.md` or `llms-full.txt`: a
workflow regenerates them after your change lands, so your pull request
doesn't conflict with the others that add rows. CI fails a hand edit.
- Never place customer-derived data, deployment recipes, or secrets in a public
fixture or package artifact.

Expand Down
23 changes: 23 additions & 0 deletions capabilities/00-what-openadapt-can-do/section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# What OpenAdapt can do

OpenAdapt turns a task that a person or an AI agent does once in an
application into a program that repeats it with new inputs. The program makes
the same entry every time with no calls to a hosted AI model, checks that the
entry landed in the right record by reading it back, and stops instead of
guessing. It is for web, desktop and remote-desktop applications with no
usable API. EMRs and payer portals are examples of highly regulated settings
where those checks matter most.

This page indexes what OpenAdapt implements, with the status, the evidence and
the code for each capability:

- [Ten capabilities](#openadapt-in-ten-capabilities) and [often missed](#often-missed)
- [The core: a checked entry](#the-core-a-checked-entry-every-time),
[approvals](#approvals), [branching work](#branching-work-not-one-linear-path)
- [Surfaces](#surfaces), [the fastest layer](#the-fastest-layer-the-app-allows),
[when the app changes](#when-the-app-changes)
- [Computer-use agents](#computer-use-agents),
[recording, privacy and proof](#recording-privacy-and-proof)
- [Every command](#every-command-by-capability) and
[measured results](#measured-results)

Loading
Loading