-
Notifications
You must be signed in to change notification settings - Fork 11
feat(docs): top level docs for repository structure and sops #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Workers documentation | ||
|
|
||
| This folder collects **procedures** (SOPs) and **shared architecture** for | ||
| workers in this monorepo. Per-worker deep docs stay inside each worker folder | ||
| (e.g. [`session-manager/architecture/`](../session-manager/architecture/)). | ||
|
|
||
| ## I want to… | ||
|
|
||
| | Goal | Read | | ||
| |---|---| | ||
| | Add a new worker to the repo | [`sops/new-worker.md`](sops/new-worker.md) | | ||
| | Scaffold a Rust `deploy: binary` worker | [`sops/binary-worker.md`](sops/binary-worker.md) | | ||
| | Ship a version to the registry | [`sops/release.md`](sops/release.md) | | ||
| | Fix a failed release | [`sops/release.md`](sops/release.md) § Troubleshooting | | ||
| | Write a consumer `README.md` | [`worker-readme.md`](../worker-readme.md) | | ||
| | Author `skills/SKILL.md` | [`DOCUMENTATION_GUIDELINES.md`](../DOCUMENTATION_GUIDELINES.md) | | ||
| | Understand `iii.worker.yaml` fields | [`architecture/iii-worker-yaml.md`](architecture/iii-worker-yaml.md) | | ||
| | Understand CI gates on a PR | [`architecture/testing-and-ci.md`](architecture/testing-and-ci.md) | | ||
| | Integrate with session-manager | [`session-manager/architecture/integration.md`](../session-manager/architecture/integration.md) | | ||
|
|
||
| ## Layout | ||
|
|
||
| ```text | ||
| docs/ | ||
| ├── README.md # this file | ||
| ├── sops/ # step-by-step procedures | ||
| │ ├── new-worker.md # cross-cutting onboarding | ||
| │ ├── binary-worker.md # Rust binary scaffold | ||
| │ └── release.md # cut, monitor, verify releases | ||
| └── architecture/ # shared reference (not step-by-step) | ||
| ├── worker-model.md | ||
| ├── iii-worker-yaml.md | ||
| ├── deploy-modes.md | ||
| ├── testing-and-ci.md | ||
| ├── skills-and-permissions.md | ||
| └── per-worker-architecture.md | ||
| ``` | ||
|
|
||
| ## Related docs (repo root) | ||
|
|
||
| - [`worker-readme.md`](../worker-readme.md) — consumer README contract | ||
| - [`DOCUMENTATION_GUIDELINES.md`](../DOCUMENTATION_GUIDELINES.md) — `skills/SKILL.md` authoring | ||
| - [`tech-specs/`](../tech-specs/) — product-level specs before or alongside implementation |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Shared worker architecture | ||
|
|
||
| Reference material for concepts that apply across workers. For step-by-step | ||
| procedures, see [`../sops/`](../sops/). | ||
|
|
||
| | Document | Summary | | ||
| |---|---| | ||
| | [`worker-model.md`](worker-model.md) | Worker lifecycle, engine bus, function ids, registry discovery | | ||
| | [`iii-worker-yaml.md`](iii-worker-yaml.md) | Manifest field reference and which CI/CD jobs consume each field | | ||
| | [`deploy-modes.md`](deploy-modes.md) | `binary` / `image` / `bundle` paths through build and publish | | ||
| | [`testing-and-ci.md`](testing-and-ci.md) | PR discovery, gates, interface boot smoke, dedicated e2e workflows | | ||
| | [`skills-and-permissions.md`](skills-and-permissions.md) | `SKILL.md` lifecycle and `iii-permissions.yaml` conventions | | ||
| | [`per-worker-architecture.md`](per-worker-architecture.md) | When to add `<worker>/architecture/`; session-manager as reference | | ||
|
|
||
| ## Per-worker architecture | ||
|
|
||
| Workers with non-trivial integration surfaces may ship their own | ||
| `<worker>/architecture/` folder. Example: | ||
| [`session-manager/architecture/`](../../session-manager/architecture/). |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Deploy modes | ||
|
|
||
| How `iii.worker.yaml` `deploy` routes CI interface smoke and release builds. | ||
|
|
||
| ## Overview | ||
|
|
||
| | `deploy` | Artifact | Build workflow | Typical language | | ||
| |---|---|---|---| | ||
| | `binary` | Per-target CLI archives on GitHub Release | `_rust-binary.yml` | Rust | | ||
| | `image` | `ghcr.io/<owner>/<worker>:<version>` | `_container.yml` | Node, Python | | ||
| | `bundle` | `<worker>.tar.gz` on GitHub Release | `_bundle.yml` | Node (esbuild) | | ||
|
|
||
| Release dispatcher: [`release.yml`](../../.github/workflows/release.yml) reads | ||
| `deploy` from `iii.worker.yaml` via `parse_release_tag.py`. | ||
|
|
||
| ## Binary | ||
|
|
||
| - **Build:** up to 9 cross-compiled targets (or `targets:` subset). | ||
| - **Assets:** `<bin>-<triple>.tar.gz` / `.zip` + `.sha256` checksums. | ||
| - **Publish boot:** downloads `*-x86_64-unknown-linux-gnu.tar.gz` from the | ||
| Release, runs the binary for interface collection. | ||
| - **Registry payload:** per-target download URLs resolved by | ||
| `resolve_binary_artifacts.py`. | ||
|
|
||
| ## Image | ||
|
|
||
| - **Build:** multi-arch Docker image pushed to GHCR. | ||
| - **Publish boot:** from local source via `iii worker add ./<worker>` (the | ||
| image itself is not booted; `runtime`/`scripts.start` drive the local run). | ||
| - **Registry payload:** the built image reference (`image_tag` output). | ||
|
|
||
| Templates: [`todo-worker/`](../../todo-worker/), [`todo-worker-python/`](../../todo-worker-python/). | ||
|
|
||
| ## Bundle | ||
|
|
||
| - **Build:** esbuild single-file `index.mjs` + `iii.worker.yaml` packed into | ||
| `<worker>.tar.gz`. | ||
| - **Asset URL:** `https://github.com/<repo>/releases/download/<tag>/<worker>.tar.gz` | ||
| - **Publish boot:** extracts bundle, runs `node ./index.mjs`. | ||
| - **Dependencies:** bundled worker may declare in-repo deps in `iii.worker.yaml` | ||
| `dependencies`; when the bundle worker's source changes, those deps join the | ||
| CI matrix (see [`testing-and-ci.md`](testing-and-ci.md)). | ||
|
|
||
| Example: [`harness/`](../../harness/). | ||
|
|
||
| ## Publish boot modes | ||
|
|
||
| [`manifest_version.py deploy-mode`](../../.github/scripts/manifest_version.py) | ||
| selects how `_publish-registry.yml` starts the worker: | ||
|
|
||
| | Mode | When | Boot | | ||
| |---|---|---| | ||
| | `release-binary` | `deploy: binary` | Download + run Linux gnu binary from Release | | ||
| | `release-bundle` | `deploy: bundle` | Extract tarball, `node ./index.mjs` | | ||
| | `iii-add` | Other deploys with `runtime` or `scripts.start` | `iii worker add ./<worker>` | | ||
| | `cargo-run` | Other deploys, Rust, no `runtime`/`scripts.start` | `cargo run` (+ `config.collect.yaml` if present) | | ||
|
|
||
| ## config.collect.yaml | ||
|
|
||
| Workers whose default `config.yaml` spawns sidecars or requires local paths | ||
| unavailable on CI ship `config.collect.yaml` — a lighter config used only for | ||
| interface collection at publish time and in the `interface-smoke` CI job. | ||
|
|
||
| Precedents: `storage`, `shell`, `coder`, `database`. | ||
|
|
||
| ## Related | ||
|
|
||
| - Release SOP: [`../sops/release.md`](../sops/release.md) | ||
| - Testing: [`testing-and-ci.md`](testing-and-ci.md) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| # iii.worker.yaml contract | ||
|
|
||
| Every worker folder ships `iii.worker.yaml` at its root. CI discovery, | ||
| release routing, and registry publish all read this file. | ||
|
|
||
| ## Required fields | ||
|
|
||
| | Field | Type | Purpose | | ||
| |---|---|---| | ||
| | `iii` | `v1` | Schema version | | ||
| | `name` | string | Folder name; git tag prefix; registry id | | ||
| | `language` | enum | `rust` \| `javascript` \| `node` \| `python` — routes CI language job | | ||
| | `deploy` | enum | `binary` \| `image` \| `bundle` — routes release build + publish | | ||
| | `manifest` | path | Version source: `Cargo.toml`, `package.json`, `pyproject.toml` | | ||
| | `description` | string | Registry + `--manifest` output | | ||
|
|
||
| ## Binary-specific | ||
|
|
||
| | Field | Purpose | Consumer | | ||
| |---|---|---| | ||
| | `bin` | Cargo binary name (defaults to `name`) | `_rust-binary.yml`, publish boot | | ||
| | `targets` | Optional list of Rust triples to build | `_rust-binary.yml` matrix subset; `supported_targets` in manifest | | ||
|
|
||
| When `targets` is omitted, all nine default triples are built: macOS | ||
| x86_64/aarch64, Windows x86_64/i686/aarch64, Linux x86_64 gnu/musl, | ||
| aarch64 gnu, and armv7 gnueabihf (the matrix lives in | ||
| [`_rust-binary.yml`](../../.github/workflows/_rust-binary.yml)). | ||
|
|
||
| ## Opt-outs and runtime | ||
|
|
||
| | Field | Purpose | Consumer | | ||
| |---|---|---| | ||
| | `interface_smoke: false` | Skip interface boot smoke + registry publish | `ci.yml`, `release.yml` | | ||
| | `runtime` / `scripts.start` | Local boot definition; presence routes publish boot to `iii-add` for non-binary/bundle deploys | `manifest_version.py deploy-mode`, `iii worker add` | | ||
| | `scripts.install` | Build command for local install | `iii worker add` (local source) | | ||
|
Comment on lines
+31
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n "interface_smoke" .github/workflows .github/scriptsRepository: iii-hq/workers Length of output: 1359 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show release.yml semantics around the interface_smoke gate
sed -n '1,260p' .github/workflows/release.yml | nl -ba | sed -n '1,260p'
# Show ci.yml semantics around the interface_smoke gate
sed -n '150,260p' .github/workflows/ci.yml | nl -ba | sed -n '1,260p'
# Find and show documentation text about interface_smoke (e.g., testing-and-ci.md)
rg -n "interface_smoke" docs -S || true
rg -n "interface_smoke" . -S --glob '!**/node_modules/**' --glob '!**/dist/**' | head -n 50Repository: iii-hq/workers Length of output: 101 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show relevant parts of release.yml (with line numbers via cat -n)
cat -n .github/workflows/release.yml | sed -n '1,260p'
# Show relevant parts of ci.yml
cat -n .github/workflows/ci.yml | sed -n '150,260p'
# Locate docs and show the surrounding interface_smoke text
rg -n "interface_smoke" docs -S || true
docfile="$(rg -l "interface_smoke" docs -S | head -n 1 || true)"
if [ -n "$docfile" ]; then
echo "=== $docfile ==="
cat -n "$docfile" | sed -n '1,260p'
fi
# Also print the specific comment blocks near the earlier matches in workflows
rg -n "A worker may declare `interface_smoke: false`|opts out of interface boot smoke|interface_smoke != 'false'|needs.setup.outputs.interface_smoke != 'false'" .github/workflows -SRepository: iii-hq/workers Length of output: 24968 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the exact table row in the file under review
echo "=== docs/architecture/iii-worker-yaml.md (around interface_smoke) ==="
cat -n docs/architecture/iii-worker-yaml.md | sed -n '1,120p'
# Show testing-and-ci.md section that defines interface_smoke opt-out semantics
echo "=== docs/architecture/testing-and-ci.md (interface_smoke section) ==="
cat -n docs/architecture/testing-and-ci.md | sed -n '1,140p'
# Show any other doc references for cross-check
echo "=== Other docs mentioning interface_smoke ==="
rg -n "interface_smoke" docs/architecture -SRepository: iii-hq/workers Length of output: 7704 Clarify
🤖 Prompt for AI Agents |
||
|
|
||
| ## Bundle-specific | ||
|
|
||
| | Field | Purpose | | ||
| |---|---| | ||
| | `dependencies` | Map of worker name → semver range for bundled sub-workers | | ||
|
|
||
| Example: [`harness/iii.worker.yaml`](../../harness/iii.worker.yaml). | ||
|
|
||
| ## Example (minimal Rust binary) | ||
|
|
||
| ```yaml | ||
| iii: v1 | ||
| name: session-manager | ||
| language: rust | ||
| deploy: binary | ||
| manifest: Cargo.toml | ||
| bin: session-manager | ||
| description: Durable, reactive, branching store of typed conversation entries. | ||
| ``` | ||
|
|
||
| ## Example (POSIX-only targets) | ||
|
|
||
| ```yaml | ||
| targets: | ||
| - x86_64-apple-darwin | ||
| - aarch64-apple-darwin | ||
| - x86_64-unknown-linux-gnu | ||
| - x86_64-unknown-linux-musl | ||
| - aarch64-unknown-linux-gnu | ||
| - armv7-unknown-linux-gnueabihf | ||
| ``` | ||
|
|
||
| See [`shell/iii.worker.yaml`](../../shell/iii.worker.yaml). | ||
|
|
||
| ## Validation | ||
|
|
||
| - `pr-checks` parses the file via [`validate_worker.py`](../../.github/scripts/validate_worker.py). | ||
| - `parse_release_tag.py` rejects unknown `deploy` values at release time. | ||
|
|
||
| ## Related | ||
|
|
||
| - Deploy routing: [`deploy-modes.md`](deploy-modes.md) | ||
| - Onboarding checklist: [`../sops/new-worker.md`](../sops/new-worker.md) §6 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Call out the required Linux boot target.
The
targetslist reads like an arbitrary subset, but the release path always boots thex86_64-unknown-linux-gnuartifact. If a manifest omits that triple, publish will build successfully but fail at boot time. Please document that customtargetsmust keep the Linux gnu target.🛠️ Suggested doc tweak
📝 Committable suggestion
🧰 Tools
🪛 LanguageTool
[uncategorized] ~26-~26: The official name of this software platform is spelled with a capital “H”.
Context: ...nd armv7 gnueabihf (the matrix lives in
_rust-binary.yml). ## Opt-o...(GITHUB)
🤖 Prompt for AI Agents