@kici-dev/compiler 0.7.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/cli.js +5 -4
  2. package/dist/commands/docs.js +2 -2
  3. package/dist/commands/feedback.d.ts +23 -1
  4. package/dist/commands/feedback.js +86 -9
  5. package/dist/commands/index.d.ts +2 -2
  6. package/dist/commands/index.js +2 -2
  7. package/dist/commands/local.d.ts +13 -5
  8. package/dist/commands/local.js +19 -8
  9. package/dist/commands/report/identity.js +1 -1
  10. package/dist/commands/run-banner.d.ts +1 -1
  11. package/dist/commands/run-banner.js +1 -1
  12. package/dist/commands/run-routed.js +3 -0
  13. package/dist/commands/run.js +5 -2
  14. package/dist/commands/runs/logs.js +3 -2
  15. package/dist/commands/verify-attestation.js +1 -1
  16. package/dist/llm-context/llms-architecture.txt +9 -7
  17. package/dist/llm-context/llms-cli-remote.txt +27 -12
  18. package/dist/llm-context/llms-cli.txt +6 -4
  19. package/dist/llm-context/llms-features-execution.txt +9 -9
  20. package/dist/llm-context/llms-features.txt +452 -133
  21. package/dist/llm-context/llms-full.txt +561 -197
  22. package/dist/llm-context/llms-getting-started.txt +34 -17
  23. package/dist/llm-context/llms-providers.txt +2 -2
  24. package/dist/llm-context/llms-sdk-runtime.txt +16 -2
  25. package/dist/llm-context/llms-sdk.txt +7 -12
  26. package/dist/llm-context/llms.txt +7 -6
  27. package/dist/local-plane/orchestrator-process.d.ts +4 -5
  28. package/dist/local-plane/orchestrator-process.js +5 -1
  29. package/dist/local-plane/paths.d.ts +1 -0
  30. package/dist/local-plane/paths.js +1 -0
  31. package/dist/local-plane/plane-log.d.ts +27 -0
  32. package/dist/local-plane/plane-log.js +39 -0
  33. package/dist/local-plane/plane-manager.js +2 -2
  34. package/dist/local-plane/plane-trigger.d.ts +28 -0
  35. package/dist/local-plane/plane-trigger.js +57 -2
  36. package/dist/local-plane/postgres.js +9 -6
  37. package/dist/local-plane/run-follow.js +2 -1
  38. package/dist/remote/output/streaming.d.ts +12 -0
  39. package/dist/remote/output/streaming.js +20 -1
  40. package/dist/remote/platform-client.d.ts +2 -0
  41. package/dist/templates/agents-md.d.ts +1 -1
  42. package/dist/templates/agents-md.js +9 -7
  43. package/dist/templates/package-json.d.ts +9 -7
  44. package/dist/templates/package-json.js +11 -9
  45. package/dist/templates/workflows/hello-world.ts +1 -1
  46. package/dist/templates/workflows/pr-checks.ts +2 -2
  47. package/dist/test-runner/job-executor.js +3 -2
  48. package/dist/types.d.ts +12 -35
  49. package/dist/types.js +2 -12
  50. package/dist/types.test-d.d.ts +2 -0
  51. package/dist/types.test-d.js +63 -0
  52. package/dist/workflows/hello-world.ts +1 -1
  53. package/dist/workflows/pr-checks.ts +2 -2
  54. package/package.json +15 -15
  55. package/sbom.spdx.json +1303 -1483
@@ -44,9 +44,7 @@ behalf). The token is printed once — save it now; it cannot be retrieved later
44
44
 
45
45
  **Option B — an agent org API key.** Create one from the dashboard's
46
46
  **Settings → API keys** tab: set the key's kind to **Agent** and give it an
47
- agent name (the agent label). The same key can also be minted with
48
- `kici-platform-admin user api-key create --org <id> --agent --agent-label <label>`.
49
- Reach for an org agent key when the agent should act as a shared service account
47
+ agent name (the agent label). Reach for an org agent key when the agent should act as a shared service account
50
48
  rather than as a single user — for example, a long-lived CI bot that outlives any
51
49
  individual's membership.
52
50
 
@@ -761,7 +759,7 @@ In interactive mode (TTY), `kici init` prompts you to:
761
759
 
762
760
  **Standalone vs workspace integration:** by default `kici init` scaffolds a self-contained `.kici/` with its own `package.json`. When run inside a pnpm, npm, or yarn workspace, it offers an **integrate** option (or pass `--workspace`): `.kici/` joins the workspace, `@kici-dev/sdk` is added to your workspace-root `package.json`, and your workflows can `import` your other workspace packages (e.g. shared build or deploy utilities). In this mode there is no `.kici/package.json` — the workspace root manages dependencies, and the root install resolves the SDK. Your workflows resolve sibling packages through the workspace-root `node_modules`: under npm and yarn every workspace member is hoisted there automatically, while pnpm links only your root's declared dependencies, so under pnpm add the package you want to import to your workspace-root `dependencies` (this is how KiCI's own repository imports its packages from workflows). Pass `--standalone` to force the self-contained layout even inside a workspace. In CI / non-interactive runs the default is standalone; use `--workspace` to opt in explicitly. `--workspace` and `--standalone` are mutually exclusive, and `--workspace` errors if no workspace is found at or above the current directory.
763
761
 
764
- **Development mode:** When `KICI_DEV=true` or `package.json` has `"kici": { "development": true }`, the generated `package.json` uses prerelease-compatible version ranges (`>=0.0.1-0`) so npm resolves Verdaccio's prerelease builds.
762
+ **Development mode:** When `KICI_DEV=true` or `package.json` has `"kici": { "development": true }`, the generated `package.json` pins `@kici-dev/sdk` to the `latest` dist-tag so npm resolves Verdaccio's newest prerelease build.
765
763
 
766
764
  ### kici org
767
765
 
@@ -1198,10 +1196,11 @@ kici verify-attestation --bundle ./app.tgz.kici.json \
1198
1196
  token was minted relative to the build. A normal attestation prints no marker
1199
1197
  (the token was minted live). A **deferred** attestation prints an `ATTESTATION:
1200
1198
  deferred` line — the build facts were sealed at build time and the token was
1201
- minted later, after a transient platform outage, bound to the frozen statement
1202
- by its hash. An **offline-backfill** attestation prints an `ATTESTATION:
1203
- offline-backfill` line — the run was ingested while the platform was down, so its
1204
- run/job rows were backfilled before the token was minted. Both still verify
1199
+ minted later, once the orchestrator's signing key was available again, bound to
1200
+ the frozen statement by its hash. An **offline-backfill** attestation prints an
1201
+ `ATTESTATION: offline-backfill` line — the run was ingested while the platform
1202
+ was down, so its run/job records were replayed to the platform before the token
1203
+ was minted. Both still verify
1205
1204
  (PASS); the marker discloses the temporal gap, and the organization id remains
1206
1205
  the authoritative anchor.
1207
1206
 
@@ -1360,6 +1359,9 @@ kici feedback --open
1360
1359
 
1361
1360
  # Read the same contract as structured data
1362
1361
  kici feedback --json
1362
+
1363
+ # Turn a JSON draft (keys: draftFields from --json) into the prefilled form URL
1364
+ kici feedback --draft draft.json --open
1363
1365
  ```
1364
1366
 
1365
1367
  `--json` exists for coding agents: KiCI is built to be driven by an LLM, and
@@ -1410,10 +1412,11 @@ Synopsis: `kici feedback [options]`
1410
1412
 
1411
1413
  **Options**
1412
1414
 
1413
- | Option | Default | Description |
1414
- | -------- | ------- | ---------------------------------------------------- |
1415
- | `--open` | | Open the prefilled issue form in the default browser |
1416
- | `--json` | | Emit the reporting contract as JSON |
1415
+ | Option | Default | Description |
1416
+ | ---------------- | ------- | --------------------------------------------------------------------------------------------- |
1417
+ | `--open` | | Open the prefilled issue form in the default browser |
1418
+ | `--json` | | Emit the reporting contract as JSON |
1419
+ | `--draft <file>` | | Build the prefilled issue-form URL from a JSON draft keyed by field id (with --open, open it) |
1417
1420
 
1418
1421
  ### `kici notifications`
1419
1422
 
@@ -1707,6 +1710,18 @@ Secrets are always sourced from your real `.kici/` directory, not from the isola
1707
1710
 
1708
1711
  Pass `--in-place` to run against the real working directory instead — useful when you explicitly want in-tree execution. `--in-place` requires no git repository; the default isolated mode does, and fails with an actionable error pointing at `--in-place` when the directory is not a git repository.
1709
1712
 
1713
+ **If the trigger times out:**
1714
+
1715
+ The command waits up to 60 seconds for the local dev plane to create the run. If nothing appears in that window it stops and names the cause it read back from the plane:
1716
+
1717
+ | Message | What it means |
1718
+ | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1719
+ | `plane is not leader yet (election grace period)` | The plane had not finished electing itself. A single-machine plane elects within seconds; if it does not, read the plane log (`kici local logs`). |
1720
+ | `no kici.lock.json at <commit> in <path>` | The plane resolved no lock file for the commit the run packed, so nothing matched. Commit `.kici/kici.lock.json`, or make sure it is present in the working tree. |
1721
+ | `the plane recorded delivery <id> as "<status>"` | The plane processed the trigger and wrote down a terminal status for it without creating a run. The status names the stage that stopped. |
1722
+ | `no run appeared for delivery <id> — see <log>` | Neither the plane's cluster state nor its delivery record explained the timeout. The named log is the next place to look. |
1723
+ | `no run appeared for this trigger — the plane never accepted the webhook` | Every webhook POST came back without a delivery id, so the plane never queued the trigger. Check the plane is up (`kici local status`), then read the named log. |
1724
+
1710
1725
  **Examples:**
1711
1726
 
1712
1727
  ```bash
@@ -1365,7 +1365,7 @@ Manage the **local dev plane** — the warm, per-user orchestrator (plus its own
1365
1365
  kici local up [--offline | --connected] # Start, or reuse an already-running plane
1366
1366
  kici local status [--json] # Port, pid, PostgreSQL backend, attachment mode, readiness
1367
1367
  kici local down # Stop the orchestrator and its PostgreSQL, verifying the port is freed
1368
- kici local logs # Print the orchestrator log file path
1368
+ kici local logs # Print the plane log paths and rotation policy
1369
1369
  kici local attach # Attach to the Platform (hybrid mode)
1370
1370
  kici local detach # Return the plane to offline (independent) mode
1371
1371
  kici local trust-root <file> # Export the dev-signed trust root for offline verification
@@ -1374,7 +1374,7 @@ kici local trust-root <file> # Export the dev-signed trust root fo
1374
1374
  The plane runs in one of two modes:
1375
1375
 
1376
1376
  - **Independent (offline)** — the default for a plane that has never been attached. Identity tokens and attestations are signed by a local dev key under the clearly non-production issuer `kici-local`.
1377
- - **Hybrid (attached)** — `kici local attach` mints an org-scoped key with your logged-in credentials and reboots the plane connected to the Platform, so local runs get real Platform-minted identity and attestation. `kici local up` honors a durable attachment record: an attached plane comes back up hybrid, and falls back to offline with a warning when the Platform is unreachable.
1377
+ - **Hybrid (attached)** — `kici local attach` mints an org-scoped key with your logged-in credentials and reboots the plane connected to the Platform, so local runs get identity and attestation signed by the plane's own key under its own issuer, as a deployed orchestrator would. `kici local up` honors a durable attachment record: an attached plane comes back up hybrid, and falls back to offline with a warning when the Platform is unreachable.
1378
1378
 
1379
1379
  `--offline` forces an independent boot without clearing the attachment record (only `detach` clears it); `--connected` requires an attached, reachable Platform and fails otherwise.
1380
1380
 
@@ -1382,6 +1382,8 @@ The plane runs in one of two modes:
1382
1382
 
1383
1383
  `kici local status` reports a plane whose process is alive but whose readiness probe fails — for example when its PostgreSQL has stopped — as running but not ready, together with its readiness checks, rather than as not running. When the holder is a KiCI plane orchestrator that this config directory did not start — a plane belonging to another `KICI_CONFIG_DIR`, or one whose record here was lost — status names it as such rather than as not ready, since its readiness is never probed, and points at `kici local down`, which does reclaim it. When the port is held by a process that is not a KiCI plane orchestrator, `kici local status` names that holder instead and points at `KICI_LOCAL_ORCH_PORT`, because `kici local down` will not stop it.
1384
1384
 
1385
+ The plane writes its orchestrator log to `orchestrator.log` in its state directory and, when it runs embedded PostgreSQL, the PostgreSQL log to `orchestrator.log.pg` beside it. `kici local logs` prints their location. Each is rotated to a `.1` sibling when it reaches 50 MB, at the next plane start — the plane keeps the current log and one previous generation, so neither can grow without bound.
1386
+
1385
1387
  Pass `--json` for machine-readable output. It prints one object and exits 0 for
1386
1388
  every state, including when the plane is stopped — the state is in the payload,
1387
1389
  not the exit code:
@@ -1540,7 +1542,7 @@ If multiple tools are detected, you are prompted to choose.
1540
1542
  Open the KiCI documentation site in the default browser. With the `llm` subcommand, print the LLM-friendly documentation bundle that ships with `@kici-dev/compiler` — pipe it into a coding agent's context buffer to brief the agent on authoring conventions without an internet round-trip.
1541
1543
 
1542
1544
  ```bash
1543
- kici docs # open https://kici.dev/docs/
1545
+ kici docs # open https://docs.kici.dev/
1544
1546
  kici docs --no-open # print the URL instead of opening a browser
1545
1547
  kici docs llm # print the llms.txt index (a router over the task bundles)
1546
1548
  kici docs llm sdk # print the SDK task bundle
@@ -1674,7 +1676,7 @@ Synopsis: `kici local down`
1674
1676
 
1675
1677
  ### `kici local logs`
1676
1678
 
1677
- Print the local dev plane orchestrator log path
1679
+ Print the local dev plane log paths and rotation policy
1678
1680
 
1679
1681
  Synopsis: `kici local logs`
1680
1682
 
@@ -607,7 +607,7 @@ The KiCI CLI reads the following environment variables to customize its behavior
607
607
 
608
608
  | Variable | Description | Default |
609
609
  | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
610
- | `KICI_DEV` | Enable development mode. When `true`, uses prerelease-compatible version ranges (`>=0.0.1-0`) for dev dependencies and skips npm version resolution. | unset |
610
+ | `KICI_DEV` | Enable development mode. When `true`, pins `@kici-dev/sdk` to the `latest` dist-tag (so a dev registry's prerelease build resolves) and skips npm version resolution. | unset |
611
611
  | `KICI_DEV_REGISTRY` | npm registry the `@kici-dev` scope points at when `KICI_DEV` is set. `kici init` writes it into `.npmrc`; with no value it writes no `.npmrc`. | unset |
612
612
  | `KICI_DEBUG` | Enable debug logging. When `true`, prints verbose diagnostics (SDK alias resolution, step-level debug logs, stack traces on errors). Equivalent to the `--debug` CLI flag. | unset |
613
613
 
@@ -977,7 +977,7 @@ The first two treat "no tier" as untrusted. The last two treat it as "no opinion
977
977
 
978
978
  A subscriber that inherits a tier below `trusted` loses its install secrets. A job that installs from a private registry then fails at install time.
979
979
 
980
- A `minimumTrust` context holds an `unknown` subscriber for security review, whatever value the context declares. Trust is a ref-based judgement with two answers, so `minimumTrust: 'trusted'` and the deprecated `minimumTrust: 'known'` block the same thing. The declared value still decides the wording of the hold reason. A subscriber that inherited the legacy `known` tier from a run row written by an earlier build passes both.
980
+ A `minimumTrust: 'trusted'` context holds an `unknown` subscriber for security review. Trust is a ref-based judgement with two answers, so that is the only floor a context can declare.
981
981
 
982
982
  Both symptoms appear far from their cause. The tier belongs to the **emitting** run, so read that run's tier first.
983
983
 
@@ -1439,9 +1439,8 @@ Global workflows are gated by a **fleet-wide master switch** held by the orchest
1439
1439
  | -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
1440
1440
  | Allowed author repos | Restricts which repos can **author** (register) global workflows. Globs matched against the authoring repo identifier. When OFF, any repo in the org may author globals. | Lock authoring to `myorg/ci-*` so random product repos can't ship org-wide automation. |
1441
1441
  | Blocked source repos | Blocks dispatch for events emitted from these **source** repos, regardless of authoring. Globs matched against the event source repo identifier. When OFF, events from any repo may trigger globals. | Protect against fork spam — e.g. `!myorg/*` via `myorg/fork-*`. |
1442
- | Elevated access | **Deprecated and not enforced.** Stored and echoed back, but nothing reads it — a global workflow's job receives no secrets, so there is no access for it to grant. See _Secrets are not available_. | None. Clear the list so it does not imply a grant that is not in force. |
1443
1442
 
1444
- All three lists accept globs. Leading `!` inside a single pattern is not supported here; negation is via the list-is-implicit-deny semantics, so keep it simple (`myorg/ci-*`, `myorg/platform-*`).
1443
+ Both lists accept globs. Leading `!` inside a single pattern is not supported here; negation is via the list-is-implicit-deny semantics, so keep it simple (`myorg/ci-*`, `myorg/platform-*`).
1445
1444
 
1446
1445
  Patterns match repo identifiers by the same rule as `repos:` on a trigger: an identifier is an owner/name pair, not a file path, so a leading dot carries no meaning of its own and a wildcard segment matches one. `myorg/*` covers `myorg/.github`, and `**` covers every repo in the org. Review any existing entry that relies on a wildcard to reach — or to spare — a dot-prefixed repo name.
1447
1446
 
@@ -1476,8 +1475,6 @@ This is about your **stored secrets**, not about repository access: the job is s
1476
1475
 
1477
1476
  To run something that needs secrets on a source repo's event, put those jobs in a per-repository workflow in that repo, where the workflow's `contexts:` resolve normally.
1478
1477
 
1479
- The **Elevated access** setting reads as the way to lift this, and it is not: it is **deprecated and never consulted**. Nothing in the dispatch path reads the list, and adding a repo to it does not make any secret readable. It is kept only so an existing value stays visible and clearable, and is removed at the next major version — see [Deprecations](https://docs.kici.dev/user/deprecations/).
1480
-
1481
1478
  ## When does it fire?
1482
1479
 
1483
1480
  Same-repo globals (a workflow in `myorg/app` with `repos: ['myorg/app']`) fire on pushes to `myorg/app`. Cross-repo globals fire on pushes to any source repo whose identifier matches a glob on the authoring workflow's trigger. The orchestrator de-duplicates between the per-repo and cross-repo matching passes, so a single event produces at most one run per (workflow, source-repo, trigger) triple.
@@ -1530,7 +1527,7 @@ A `filter` reads the source tree, so the evaluation must be able to obtain one.
1530
1527
  | Global workflow registered but never runs | Master toggle OFF, or allow-list blocks the authoring repo, or deny-list blocks the source repo | Orchestrator log: `Skipping global workflow dispatch` (dispatch time) / `Global workflows excluded from registration` (registration time) |
1531
1528
  | A global workflow is never registered at all — it is absent from `kici-admin registration list` | The fleet-wide master switch is off, or the authoring repo does not match a populated _Allowed author repos_ list. | Orchestrator log: `Global workflows excluded from registration`, naming the organization it decided against. Check the switch first (`kici-admin cluster-settings show`), then that org's allow-list in the dashboard. An `"orgId": "__default__"` in the line is not itself the fault — that anchor carries no lists and restricts nothing. |
1532
1529
  | `repos:` has no effect — workflow only fires on its own repo | The fleet-wide master switch is off. Without it, the orchestrator treats the workflow as per-repo-only. | Check the fleet-wide switch with `kici-admin cluster-settings show`. The dashboard → Settings → Global workflows tab shows it as a read-only badge. |
1533
- | Secrets unavailable in a global job | Expected — a global workflow's job receives no secrets at all, and the _Elevated access_ list is not enforced. | Move the jobs that need credentials into a per-repository workflow in the repo that owns the secrets |
1530
+ | Secrets unavailable in a global job | Expected — a global workflow's job receives no secrets at all. | Move the jobs that need credentials into a per-repository workflow in the repo that owns the secrets |
1534
1531
  | Dashboard shows workflow twice after registering | Both a generic webhook source and a provider source (github, generic) re-registered the same repo. | Check `workflow_registrations` via `kici-admin workflow list` and confirm the right routing key owns the workflow. |
1535
1532
  | Global workflow registered, enabled, allowed — and still no run appears | Its `filter` returned `false`. A global filter runs before the run is created, so a suppressed workflow leaves nothing behind at all. | [Reading a global workflow's filter output](https://docs.kici.dev/user/global-workflows/#reading-a-global-workflows-filter-output) — the evaluation round's own log. The orchestrator also logs `Global workflow skipped by eval round`, naming the workflow and the reason. |
1536
1533
  | Global workflow never fires for one particular source repo | Its `repos:` patterns do not match that repo's identifier. | Orchestrator log: `Global workflows dropped by their repos filter` — one line per delivery, naming each dropped workflow, its repo and its patterns. |
@@ -1870,7 +1867,7 @@ Bind provisioning and teardown workflows to a context that carries the cloud cre
1870
1867
 
1871
1868
  ## The cloud-init that starts the agent
1872
1869
 
1873
- `buildAgentCloudInit(creds, options)` renders the `#cloud-config` that boots the KiCI agent. In the claim-code form it writes the single-use claim code — never a token — into a root-only env file (`0600`, owned by root). The agent exchanges that code for its own token inside the instance, so the token never transits cloud-init, the instance metadata, or any other provisioning channel. The env file holds:
1870
+ `buildAgentCloudInit(creds, options)` renders the `#cloud-config` that boots the KiCI agent. It writes the single-use claim code — never a token — into a root-only env file (`0600`, owned by root). The agent exchanges that code for its own token inside the instance, so the token never transits cloud-init, the instance metadata, or any other provisioning channel. The env file holds:
1874
1871
 
1875
1872
  - `KICI_ORCHESTRATOR_URL` — from `creds.orchestratorUrl`.
1876
1873
  - `KICI_SCALER_CLAIM_CODE` — from `creds.claimCode`. The agent exchanges it for its own token in-instance.
@@ -1886,11 +1883,14 @@ The `0600` env file still protects the non-secret env from other users on the in
1886
1883
 
1887
1884
  Pass any of these options to shape the boot:
1888
1885
 
1886
+ - `agentImage` — the agent image `deliveryMode: 'container'` runs. Defaults to `quay.io/kici-dev/kici-agent:latest`.
1887
+ - `startCommand` — an escape hatch that replaces the whole agent-start command. It ignores `deliveryMode` and `agentImage`.
1889
1888
  - `packages` — extra apt/yum packages, merged into the cloud-init `packages:` list.
1890
1889
  - `writeFiles` — extra `write_files` entries (path, content, permissions, owner). The reserved env-file path is rejected, so a custom file cannot overwrite the credentials.
1891
1890
  - `runcmdBefore` / `runcmdAfter` — shell lines that run before or after the agent starts.
1892
1891
  - `agentEnv` — extra variables appended to the agent env file. Keys must be valid env names, and a value with a newline is rejected.
1893
1892
  - `baseCloudConfig` — a raw cloud-config document to merge everything into (users, ssh keys, apt mirrors, mounts, bootcmd). The builder unions its `packages`, `runcmd`, and `write_files` with yours.
1893
+ - `userDataEncoding` — `'raw'` (the default) returns the plain `#cloud-config` text that Hetzner `user_data` expects; `'base64'` returns it base64-encoded, the form AWS EC2 `UserData` and Azure `customData` expect.
1894
1894
 
1895
1895
  ## The teardown workflow
1896
1896
 
@@ -2061,7 +2061,7 @@ scalers:
2061
2061
 
2062
2062
  On `kici.scaler.scale-up`, the provisioning workflow dispatches a `kici-agent.yml` workflow run in a GitHub repo. It passes the claim code, orchestrator URL, agent id, and labels as dispatch inputs. The token never appears in those inputs — only the single-use claim code, which the agent exchanges for its own token in-instance.
2063
2063
 
2064
- The `kici-agent.yml` run starts the agent on the runner itself with `KICI_SCALER_CLAIM_CODE` set. `KICI_SCALER_MANAGED=1` and a zero idle timeout make the agent register, run one job, and exit. The GitHub Actions run then completes on its own. By default the run installs the published agent from npm; set `agent_bundle_release` to a release tag holding a `kici-admin agent package` tarball to pin an exact build or to serve runners that cannot reach npm.
2064
+ The `kici-agent.yml` run starts the agent on the runner itself with `KICI_SCALER_CLAIM_CODE` set. `KICI_SCALER_MANAGED=1` and a zero idle timeout make the agent register, run one job, and exit. The GitHub Actions run then completes on its own. The job carries `timeout-minutes: 15`. A wedged run (an agent the orchestrator refused, a job that never dispatched) then releases the runner instead of holding it for the six-hour default. Raise the limit if your jobs run longer. By default the run installs the published agent from npm; set `agent_bundle_release` to a release tag holding a `kici-admin agent package` tarball to pin an exact build or to serve runners that cannot reach npm.
2065
2065
 
2066
2066
  Teardown is largely automatic. A GitHub Actions run self-completes when its agent exits. So the `kici.scaler.scale-down` workflow only cancels a run GitHub has not yet marked finished, and only for reasons where the agent will never do useful work (`spawn-timeout`, `heartbeat-timeout`).
2067
2067