# Publish artefacts, name them honestly, keep installs the operator's A run's job ends at a reviewed, committed change and, when the operator must try it, a published build. Publishing to a phone, a device or a service is a delivery step with its own rules. ## Run artifacts - Every agent visit gets a per-run/step artifacts directory under the data directory. The directory is passed to the stage as `PIPELINES_ARTIFACTS_DIR` and stated in the agent prompt next to `Run directory:`; the instruction is to save images, screenshots, reports and logs there (`references/operations.md`). - After the visit the server makes one bounded inventory and records each file's name, size, content type and URL; they appear under the step's `artifacts` in `inspect RUN_ID --json` and are served at `GET /artifacts///`. - Artifacts are **evidence, not a gate**: an absent, unreadable, symlinked or oversized file records nothing and never changes the verdict. Never invent an artifact or claim a stage produced one — the server observes the directory after the stage. ## Publish a build to the LAN - When an item builds something the operator should try (an app, a binary, a report), have the run publish the built file into the **current run's** artifacts directory and report its LAN URL: `http://:/artifacts///`. - **Verify the URL serves the real file** before reporting it; a printed path or an exit-0 publish is not proof. Fetch it and confirm the bytes are the artefact. - The phone or client reaches the server at its configured endpoint; never hardcode a server address into the project. A URL the operator's device cannot reach is not a delivery. ## Name a WIP so it cannot be mistaken for verified - Give a not-yet-verified build a name that marks it: `wip-` (for example `myapp-wip-1fece88.apk`). - **Reserve the plain, unmarked name for the verified build**, so the operator and later runs can tell at a glance which artefact passed review and which did not. - Never overwrite or relabel a WIP as verified without the review that qualifies it. ## Install and deploy boundaries - **Installing onto the operator's physical device is the operator's job, not a run's.** A run may install only on the emulator or device its lane owns (`references/lanes.md`). - **Restarting, rebuilding or reconfiguring the Pipelines/OpenCode service is the operator's job.** A run may not stop a server another run depends on. - A run may build and publish; it may not deploy a service, install to hardware the operator holds, or push or tag a shared branch. ## Drafts, approvals and immutable history - Delivery still obeys the authoring rules (`SKILL.md`): drafts are retained, publication creates **immutable** versions, and submission, execution, retry, cancellation and deletion ask for explicit confirmation. - `--yes` approves only the specific action you named; it is not approval to publish, run or schedule. A run must not submit a pipeline or activate a schedule. ## Example (this repository, not a rule) This repository's Android client is delivered as a debug APK: - Build and publish the APK into the current run's artifacts directory as `pipelines-debug-wip-.apk` and report the LAN URL, for example `http://10.0.0.249:8080/artifacts//1/pipelines-debug-wip-1fece88.apk`. The plain name is reserved for the verified build. - Screenshots come from `android/scripts/capture_png.sh -s ` (and `--check ` to re-validate); it captures on the device, pulls and checks the PNG magic bytes, deleting a file that is not a real image. Never write `adb ... screencap` to a file through `exec-out` or a redirect. - The lane's emulator serial is fixed per lane (for example `emulator-5554` for one lane, `emulator-5556` for another); the operator's attached Pixel is never the runs' device. - This is the concrete instance of the general rules above; a different project substitutes its own build artefact, capture tool and device, and keeps the naming and boundary rules.