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
10 changes: 0 additions & 10 deletions .github/workflows/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,3 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: python3 -I scripts/spec.py publish --file "$RUNNER_TEMP/spec/family.json"

propose:
needs: publish
if: github.repository == 'nodemode-dev/formadaptor' && github.ref == 'refs/heads/main'
permissions:
contents: read
uses: ./.github/workflows/propose.yml
secrets:
FORMADAPTOR_APP_ID: ${{ secrets.FORMADAPTOR_APP_ID }}
FORMADAPTOR_APP_PRIVATE_KEY: ${{ secrets.FORMADAPTOR_APP_PRIVATE_KEY }}
111 changes: 0 additions & 111 deletions .github/workflows/propose.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## v0.3.0 · 2026-11-26

- formadaptor holds no secret. Proposing moves to formcompiler's `adaptor.yml`, with formcompiler's release App from its `release` environment; hourly.yml now builds and publishes the spec only, and propose.yml is gone.
- `scripts/propose.py plan` runs a target's generator as `run` does, needs no token, and writes `proposal.json` (format `formadaptor-plan`, version 1) with a byte copy of each changed file and its sha256; nothing to propose writes nothing. `changed --plans DIR` lists the enabled targets with a plan, as `matrix` does, and skips a malformed one with a warning. `apply` needs the token, runs no target code, re-checks every planned file (paths against the target's files, sha256, no link, repository, branch, base commit and change hash), and opens the pull request as `run` did; when the target's `main` has moved since the plan it pushes nothing and the next run proposes again.
- docs/OWNER_SETUP.md steps 3 and 4: no App and no secret here; formcompiler's release App needs "Pull requests: read and write" beside Contents and an installation on each target.
- 82 tests in 5 files.

## v0.2.3 · 2026-11-25

- `spec/ids.json` gains FormCraft (`nodemode-dev/formcraft`, catalogue and site id `formcraft`) and FormRig (`nodemode-dev/formrig`, catalogue and site id `formrig`), rows 36 and 37. formcompiler's `main` registers both, and `ids --check` compares every registry entry, so the `lint` job failed on the two names and the hourly build would have stopped on them. The file now pairs all 37 registry entries.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ You need Python 3.11 or newer. The scripts use the standard library only; the te

| Folder | What is there |
| --- | --- |
| `.github/workflows` | hourly, propose and self-check |
| `.github/workflows` | hourly and self-check; proposing is formcompiler's `adaptor.yml`, which runs `propose.py plan`, `changed` and `apply` |
| `scripts` | github_api, registry, visibility, releases, manifest, spec and propose |
| `spec` | the id pairs and the two schemas |
| `docs` | the spec, the target contract and the owner setup |
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

One family spec for the Form apps, and pull requests that keep every repository that lists the apps in step with it.

formadaptor reads formcompiler's registry, asks GitHub which app repositories are public and which release each public app last published, and writes `family.json`. It then runs each target repository's own generator against that file and opens a pull request in the target when its committed files differ. The targets are formMCP, formskills, form.ext and formai-templates (the organisation profile is listed and off); formai-templates gathers each public app's templates and demos, so before its generator runs formadaptor puts a shallow clone of each public app at its released tag beside the checkout. Each target keeps a copy of the spec its files were generated from and checks itself against it in its own CI. A target's generated files change only when something that target shows changes: they never carry the registry version, the spec's build time or its hash, so a compiler release that changes nothing a target shows proposes nothing, and a run warns when a generator records anything else. Every hour formadaptor also reports, without acting, where an app's `main` offers agents something its newest release does not. It never pushes to `main` anywhere and never runs app code.
formadaptor reads formcompiler's registry, asks GitHub which app repositories are public and which release each public app last published, and writes `family.json`. Its `scripts/propose.py` then runs each target repository's own generator against that file and opens a pull request in the target when its committed files differ; formcompiler's `adaptor.yml` runs it in two jobs, `plan` with no secret and `apply` with the token and no target code, and formadaptor itself holds no secret. The targets are formMCP, formskills, form.ext and formai-templates (the organisation profile is listed and off); formai-templates gathers each public app's templates and demos, so before its generator runs formadaptor puts a shallow clone of each public app at its released tag beside the checkout. Each target keeps a copy of the spec its files were generated from and checks itself against it in its own CI. A target's generated files change only when something that target shows changes: they never carry the registry version, the spec's build time or its hash, so a compiler release that changes nothing a target shows proposes nothing, and a run warns when a generator records anything else. Every hour formadaptor also reports, without acting, where an app's `main` offers agents something its newest release does not. It never pushes to `main` anywhere and never runs app code.

- The spec and the agent manifest the apps write: [docs/SPEC.md](docs/SPEC.md)
- The contract each target's generator meets: [docs/TARGETS.md](docs/TARGETS.md)
Expand All @@ -13,7 +13,9 @@ python3 -I scripts/spec.py build --compiler ../formcompiler --out family.json
python3 -I scripts/propose.py run --target formmcp --checkout ../formMCP --family family.json --dry-run
python3 -I scripts/propose.py checkouts --target formai-templates --checkout ../formai-templates --family family.json
python3 -I scripts/propose.py run --target formai-templates --checkout ../formai-templates --family family.json --dry-run
python3 -I scripts/propose.py plan --target formmcp --checkout ../formMCP --family family.json --out plans/plan-formmcp
python3 -I scripts/propose.py changed --plans plans
python3 -I scripts/advisory.py --family family.json
```

Version 0.2.3. Licence: GPL-3.0-only (see LICENSE and NOTICE).
Version 0.3.0. Licence: GPL-3.0-only (see LICENSE and NOTICE).
6 changes: 3 additions & 3 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ Use **Report a vulnerability** on this repository's Security tab (GitHub's priva

## What formadaptor holds

- A GitHub App's client ID and private key (`FORMADAPTOR_APP_ID`, `FORMADAPTOR_APP_PRIVATE_KEY`). Each run mints a token for one target repository at a time, with Contents and Pull requests write only.
- No secret and no App key. Pull requests in the targets are opened by formcompiler's `adaptor.yml` with formcompiler's release App, which mints a token for one target repository at a time; the scripts it runs are this repository's `scripts/propose.py plan`, `changed` and `apply`.
- The built-in workflow token, which writes only this repository's `spec` branch.

## In scope

| Threat | What stops it |
|---|---|
| An outside pull request runs code in CI | Pull requests run only `self-check.yml`: no secret, a read-only token, `persist-credentials: false`. |
| A fork runs the hourly or propose workflows | Every job that publishes or proposes is guarded by `github.repository == 'nodemode-dev/formadaptor'` on `main` (tested in `tests/test_workflows.py`). |
| A fork runs the hourly workflow | Every job that publishes is guarded by `github.repository == 'nodemode-dev/formadaptor'` on `main` (tested in `tests/test_workflows.py`). |
| A private app reaches a public file | A private repository's app is an id with `public: false`; nothing else about it is read or written. |
| A target's generator misuses the token | The generator runs with a minimal environment and no token; the checkout keeps no credential; a change outside the target's declared files is refused. |
| A target's generator misuses the token | The generator runs with `plan`, in a job with no secret and no environment, with a minimal environment and no token; a change outside the target's declared files is refused. The job that holds the token runs `apply`: it runs no target code and re-checks every planned file (its path against the target's files, its sha256, no link, the repository, the branch, the base commit and the change hash) before anything is pushed. |
| A change reaches a target's main unreviewed | formadaptor only opens pull requests from `bot/formadaptor-*` branches; a person merges them. |
| A compromised action | Actions are pinned to full commit SHAs. |

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.3
0.3.0
12 changes: 6 additions & 6 deletions docs/OWNER_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Nothing here has run on GitHub yet. In order:

1. Create the empty public repository `nodemode-dev/formadaptor`. Push `main` once, then push `feat/first-build-0.1.0` and open its pull request. Merge with a merge commit (no squash) so each commit and its signature stay.
2. Settings, Actions, General: allow GitHub Actions; Workflow permissions "Read repository contents" (the workflows widen it per job). Do not allow Actions to create or approve pull requests here; formadaptor opens them only in the targets, with the App.
3. Create a GitHub App owned by `nodemode-dev`, for example `formadaptor-bot`: no webhook; repository permissions Contents read and write, Pull requests read and write, Metadata read. Install it on the target repositories only: formMCP, formskills, form.ext and formai-templates (step 11) now; .github when the profile target is switched on (step 6). Not on formtray: it is not a target (its app list is your dated release schedule, kept by hand). Generate a private key and note the client ID.
4. In formadaptor: Settings, Secrets and variables, Actions: `FORMADAPTOR_APP_ID` (the client ID, `Iv...`; the numeric App ID also works) and `FORMADAPTOR_APP_PRIVATE_KEY` (the whole `.pem` file). The workflows mint a token per target repository, for that one repository.
5. In each target: if `main` has a ruleset, make sure it does not stop the App from pushing `bot/*` branches (a branch ruleset that restricts creation must list the App as a bypass actor for `bot/**`). Pull requests opened with the App token start the target's checks, unlike those opened with the built-in token.
2. Settings, Actions, General: allow GitHub Actions; Workflow permissions "Read repository contents" (the workflows widen it per job). Do not allow Actions to create or approve pull requests here; formadaptor opens none; formcompiler's `adaptor.yml` opens them in the targets.
3. formadaptor holds no secret: add none here, and create no App for it. Proposing is formcompiler's `adaptor.yml`, which signs in with formcompiler's release App from formcompiler's `release` environment. Its plan job runs each target's generator with `scripts/propose.py plan` and holds no secret and no environment; its apply job holds the token, runs no target code, and re-checks every planned file with `scripts/propose.py apply`.
4. On formcompiler's release App: add the Repository permission "Pull requests: read and write" beside Contents, and install it on each target repository in targets.json: formMCP, formskills, form.ext and formai-templates (step 11) now; .github when the profile target is switched on (step 6). Not on formtray: it is not a target (its app list is your dated release schedule, kept by hand). Each run mints a token for one target repository at a time.
5. In each target: if `main` has a ruleset, make sure it does not stop that App from pushing `bot/*` branches (a branch ruleset that restricts creation must list the App as a bypass actor for `bot/**`). Pull requests opened with the App token start the target's checks, unlike those opened with the built-in token.
6. Merge the target changes (docs/TARGETS.md) in formMCP, formskills and form.ext, each with its generated files regenerated from the current spec and its copy of that spec committed beside them (`setup/family.spec.json` in all three), so the first proposal finds nothing to change. The profile target (.github) is disabled in `targets.json`: it is switched on when the page's listing rule is chosen. The page lists apps whose registry `state` is `live`; six apps formai.studio shows as live are `public` or `prelaunch` in the registry, so decide first which is right (fix the registry's `catalog.state`, or change the page's listing rule in .github), make .github's generator write its copy at `scripts/family.spec.json`, regenerate the page, then set `"enabled": true` for `profile` here and install the App on .github.
7. Run `hourly` by hand once (Actions, hourly, Run workflow). It creates the `spec` branch with `family.json`. Then run `propose` by hand to see every enabled target answer "in step".
7. Run `hourly` by hand once (Actions, hourly, Run workflow). It creates the `spec` branch with `family.json`. Then run formcompiler's `adaptor` by hand to see every enabled target answer "in step".
8. form.ext is enabled here with the three files its generator writes (`.claude/skills/HOSTS.md`, `setup/hosts.json`, `setup/family.spec.json`); its generator must be on form.ext's `main` before the first run, or that one job fails (the others go on). The hourly summary's advisory section names apps whose `main` offers agents something their newest release does not; it never fails the run and needs nothing from you except, when you want it, a release.
9. formai.studio is private: the App needs access there for a site target, or the site's own CI runs the generator's `--check` against `family.json`. Not configured in 0.1.0.
10. In formcompiler's `formai-build` list of repositories it does not build, add formadaptor (it is not an app and has no registry entry).
11. formai-templates (since 0.2.0): create the empty public repository `nodemode-dev/formai-templates` and push its `main` from the local build (no squash). Add it to the App's installation (Settings of the App, Install App, `nodemode-dev`, the selected repositories); no new secret, the same `FORMADAPTOR_APP_ID` and `FORMADAPTOR_APP_PRIVATE_KEY` mint its token, for that one repository. Step 5 applies to it as to the others. Until it exists and the App is installed, its propose job is a skip with one line in the summary and nothing fails. The apps' own repositories need nothing: formadaptor clones the public ones at their released tags with no token.
11. formai-templates (since 0.2.0): create the empty public repository `nodemode-dev/formai-templates` and push its `main` from the local build (no squash). Add it to the installation of formcompiler's release App (Settings of the App, Install App, `nodemode-dev`, the selected repositories); no new secret, the same App mints its token, for that one repository. Step 5 applies to it as to the others. Until it exists and the App is installed, its job in `adaptor.yml` is a skip with one line in the summary and nothing fails. The apps' own repositories need nothing: formadaptor clones the public ones at their released tags with no token.
Loading