loopctl-mcp-server 3.59.0 → 3.60.1
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.
- package/README.md +1 -1
- package/index.js +21 -4
- package/lib/intake-sources.js +22 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -649,7 +649,7 @@ The order to wire it up, the stage machine these tools move a story through, and
|
|
|
649
649
|
| `merge_precondition` | **Run the merge gate over a story's real pull request** (`POST /api/v1/stories/:id/merge-precondition`). Both delivery gates run again over the diff that exists, plus custody, the 12-file / 1000-line hard bound, the head-has-not-moved check and the self-deploy exclusion; the story must be at stage `ci`. **Gate A reads what triage persisted, never the caller**: the lens verdicts recorded with the story's most recent triage, or a human's re-queue of a Gate A escalation — `gate_a_inputs` on the answer says which, and `missing` refuses with `gate_a_inputs_missing`. This tool sends no trio. Decisions: `allow` (recorded against the head; the only thing that licenses a merge), `refuse` (the story is escalated before this returns), `already_merged`, `head_moved`, `unevaluated` (503 with `Retry-After`). **The pull request must target exactly the base branch of the story's own intake source** (`base_branch` on the answer, compared case-sensitively): a pull request into any other branch, open or already merged, is a `refuse` with reason `pr_base_mismatch` (never `already_merged`), and one whose base cannot be read is a `refuse` with `pr_base_unreadable`; the story is escalated like any refusal, and the remedy is to retarget the pull request (`gh pr edit --base <base_branch>`). Requires an orchestrator- or user-ROLE key (`exact_role: [:orchestrator, :user]`, so an agent key is 403'd); `LOOPCTL_ORCH_KEY` is sent when set, else `LOOPCTL_API_KEY`. 403 `custody_tier_required` without a human anchor, 404 for an unknown story, 409 `change_protocol_enrolled` when the story's intake source is in mode `chg` (the PR route is closed; land with `chg submit` — decided before any GitHub read, nothing escalated), 422 when the story is not at `ci`. Required: `story_id` (refused locally if not a UUID) and `claim_epoch` (a non-negative integer, refused locally otherwise); optional `effect_proof`. |
|
|
650
650
|
| `intake_source_enroll` | **Bind a GitHub repository to a work project and mint its webhook secret** (`POST /api/v1/intake/sources`) — the step that gives the delivery loop an input, and the row `place_dispatch` reads `repo` and `base_branch` from (each story reads its OWN source; its 409 `no_intake_source` means the story has none). **The secret is returned ONCE and can never be read again** — the column is encrypted at rest and redacted on the schema, so no other tool carries it and losing it costs a revoke, a re-enrolment and a reconfigured GitHub webhook. **This tool does not return it either:** a tool result lands in the transcript and the audit log, so it is written to the required `secret_file` with mode 0600 (the handling `runner_enroll` gives a runner credential) and the result carries the source row, the `webhook_url` and that path. The path is reserved before the request, so an existing file or an unwritable directory is refused with nothing enrolled, and any outcome that is not a clean creation withholds the response body — an unparsed 2xx body IS the secret. A 2xx carrying the source and the secret but no webhook path is RECOVERED rather than discarded (the path is derived from the source id, flagged `webhook_url_derived`), and an outcome that proves a source id but no usable secret REVOKES that source rather than leaving it holding the repository's unique slot. Then configure GitHub: Payload URL = the returned `webhook_url`, content type `application/json`, Secret = the contents of the file, and the **Issues** and **Pull requests** events (a merged pull request queues a read of its `## Review findings` section) — `gh api repos/OWNER/REPO/hooks -f name=web -f config[url]=<webhook_url> -f config[content_type]=json -f config[secret]="$(cat <secret_file>)" -f 'events[]=issues' -f 'events[]=pull_request'`. Every later delivery failure is the SAME 401 `invalid_signature` — unknown or revoked source, suspended tenant, missing or wrong signature, or a payload whose `repository.full_name` does not match — so the webhook's Recent Deliveries tab cannot tell you which. `base_branch` is set HERE: it defaults to `master` when the body does not name it, so name `main` for a repository created on GitHub since 2020 or every dispatch is cut from a trunk that does not exist. It is not nullable (a dispatch must name a branch), so null or blank is refused rather than falling back to the default, and `intake_source_update` changes it afterwards. Refusals: 403 `api_key_mint_forbidden` if your key was minted by a dispatch (this mints a credential belonging to no lineage, so only an unlineaged operator key may), 403 `custody_tier_required` on an agent-rooted tenant, 422 for a repository that is not `owner/name`, a project that is missing / archived / the wrong kind for the mode, or a `target_epic_id` outside that project. **One source per repository AND base branch (US-54.1):** a repository may have a second live source (a release, staging or e2e branch) on the same project, and `issue_label` (1-50 characters, compared case-insensitively) says which issues are whose. A project has ONE live `pr`/`chg` source with no label — its primary — so every other source of it carries one. Three refusals, each a 422 naming the field: `repo_full_name` `already has a live intake source on base branch <b>`, `issue_label` `is already the label of another live source on this repository`, and `issue_label` `is required: this project already has a source with no issue label`. `issue_label` is optional here (leave it out for the primary) and a null or blank one is refused locally. `mode` is the merge route: `pr` (the default when omitted; the merge gate reads a pull request) or `chg` (Epic 47: the change protocol lands the repository's changes with `chg submit`, and `merge_precondition` refuses every story on the source with 409 `change_protocol_enrolled`), both on a work project; or `ledger` (loopctl #1047), which enrols a repository for the chg ledger alone: `project_id` is then its active KB scope (`create_kb_scope`), or its active work project when that project has no intake route (its stories stay unbound), the source is never a dispatch binding (`place_dispatch` and candidate selection skip it), and GitHub deliveries to it are refused. Any other value, null included, is refused. **Sending is not routing:** the two chg credentials authenticate the ledger and change-event endpoints in every mode, so a `pr` source holding them sends its ledger too and stays `pr` — its events are recorded and move no story. A `chg` or `ledger` enrolment needs `change_events_secret` (or, preferred, `change_events_secret_file`, a path the tool reads so the value never enters the transcript) AND a root in the same call — `mint_chg_root: true` (preferred: loopctl mints a keyless, agentless root in the same write and returns its id) or `chg_root_dispatch_id` — refused locally and 422 at the server without them, and 422 with both. A root minted with `dispatch` takes its agent's one orchestrator-key slot, so it is 422 when that agent already holds a live key; the expiry sweep never revokes the row of a root a live source names. A named root that is not a parentless, unrevoked, orchestrator-role dispatch of this tenant with more than 300 s left before it expires is 422 `chg_root_invalid` (a child, a revoked or agent-role dispatch, another tenant's and an unknown id all alike). The change-events secret is write-only: no response and no tool result ever carries it. `required_checks` are the CI checks story verification judges a story's commit by, GitHub Actions job names, bounded in number and length by the server; `local-gate` is refused because whoever pushed posts it. Story verification judges a story's commit against the same `required_checks` in EITHER mode, satisfied only by a job of a push run of the story's branch; it first needs a GitHub credential for this tenant, its own token (`set_github_credential`) or an entry in the operator's `VERIFICATION_OPERATOR_TOKEN_TENANTS` (`credential_unavailable` otherwise, whatever the list holds); then a `pr` source that names none records `no_required_checks` and reads nothing, so naming them is how a pr source opts in, and a source that names some has its (tenant, repository) credential resolved before any GitHub read (`credential_unavailable` if there is none). Required: `repo_full_name`, `project_id`, `secret_file`. `triage_requires_ticket` decides which issues are triaged at all: false (the default), every issue the webhook delivers; true, only an issue HomeCareBilling filed from a support ticket (its single `#HCB-xxxxxxxx` Ticket line confirmed by the HomeCareBilling footer, which intake records as `ticket_id`), and every other issue stays an intake record with no story until it gains a ticket; anything but a boolean is refused. It filters on the format, it does not authenticate: anyone who can open an issue can type it. `deploy_environment` (US-54.7) is the GitHub deployment environment post-deploy verification reads this source's stories against; leave it out for the default, the operator's fleet-wide `DELIVERY_DEPLOY_ENVIRONMENT` (`production` when unset), and name it (e.g. `e2e-sandbox`) for a branch whose deploy workflow writes another environment: 1-255 characters with no control character (null, blank or a control character is refused locally, 422 on `deploy_environment` at the server); a wrong name is not a silent pass, the story escalates at the sweep's bound. Optional: `base_branch`, `issue_label`, `deploy_environment`, `mode`, `required_checks`, `triage_requires_ticket`, `change_events_secret` / `change_events_secret_file`, `chg_root_dispatch_id` or `mint_chg_root`, and `target_epic_id` — **omitting the epic is not a neutral default**: with no epic every triaged report is escalated to a human and every record stays `pending_triage` until `intake_source_update` names one. Requires `LOOPCTL_USER_KEY`. |
|
|
651
651
|
| `intake_source_list` | List the tenant's intake sources (`GET /api/v1/intake/sources`): `id` (the webhook URL is `/api/v1/intake/github/<id>`), `project_id`, `repo_full_name`, `base_branch`, `issue_label` (null on the project's primary source), `deploy_environment` (the deployment environment its stories are verified against; null means the fleet-wide `DELIVERY_DEPLOY_ENVIRONMENT`, `production` when unset), `mode` (`pr`, `chg` or `ledger`), `required_checks`, `triage_requires_ticket`, `chg_root_dispatch_id`, `target_epic_id`, `revoked_at`, timestamps. **The webhook secret is not here and is not anywhere**, and neither is a `chg` source's change-events secret — it is returned once by `intake_source_enroll`, so this is not how to recover one. Use it to find the source behind a 409 `no_intake_source` or `base_branch_mismatch`, to check a repository's `base_branch` before placing work, to see a repository's sources side by side (`base_branch`, `issue_label`) before enrolling another, and to identify a source left behind by an enrolment whose outcome was unknown. Optional: `include_revoked`. Requires `LOOPCTL_USER_KEY`; the only one of the four that does not also need a human-anchored tenant. |
|
|
652
|
-
| `intake_source_update` | **Set where a source's work lands** (`PATCH /api/v1/intake/sources/:id`): `target_epic_id`, the epic triaged stories are created in, `base_branch`, the branch every dispatch for this repository is cut from, `issue_label`, the GitHub label that marks this source's issues (an explicit null clears it, which makes the source its project's primary; a `base_branch` or `issue_label` change meets the same three 422 refusals as `intake_source_enroll`: `already has a live intake source on base branch <b>`, `is already the label of another live source on this repository`, `is required: this project already has a source with no issue label`), `deploy_environment`, the GitHub deployment environment post-deploy verification reads this source's stories against (US-54.7; an explicit null clears it, returning the source to the fleet-wide `DELIVERY_DEPLOY_ENVIRONMENT`, `production` when unset; read on every sweep, so it reaches stories already waiting; an empty string, a control character or more than 255 characters is refused locally and 422 at the server), `fly_app`, the Fly app the post-deploy monitor reads this source's edge metrics for with the tenant's own Fly metrics credential (US-55.7, `set_fly_metrics_credential`; an explicit null clears it, which stops the monitor reading the source; anything but a Fly app name, lowercase letters, digits and hyphens of at most 63 characters starting with a letter or digit, is refused locally and 422 on `fly_app` at the server), `mode` (`pr` or `chg` on a work project, `ledger` on a KB scope or a work project; a switch into or out of `ledger` is 422), the `change_events_secret` / `change_events_secret_file` and `chg_root_dispatch_id` that authenticate the source's chg ledger and change events (or `mint_chg_root: true`, which has loopctl mint a new keyless root in the write: the fix for a source with no root or a revoked one, 422 beside a named root) (on a `pr` source they let chg send the ledger while the source stays `pr` and its merge gate still reads the PR — do not switch to `chg` for that), and `required_checks`, the checks story verification judges a story's commit by — once the tenant has a GitHub credential, its own token (`set_github_credential`) or an entry in the operator's `VERIFICATION_OPERATOR_TOKEN_TENANTS` (`credential_unavailable` otherwise), a source naming none records `no_required_checks` and reads nothing, and one naming some has its (tenant, repository) credential resolved before any GitHub read (`local-gate` is refused), and `triage_requires_ticket`, which issues are triaged at all (true: only issues HomeCareBilling filed from a support ticket; read at dispatch time, so it reaches stories already waiting at `detected`; null is refused), and `deploys`, whether a merge is followed by a GitHub deployment (false: the merge is the release, so post-deploy verification moves a merged story on with `release_id` `merge:<sha>` and reads no deployment; read on every sweep; null is refused). Presence decides — a field you do not name is left exactly as it was, and naming none of them is 422 `nothing_to_update`. `mode` has no cleared state either, and a null or unknown value is refused locally. Each implement dispatch records the base branch it was placed under, and the merge gate reads that; `mode` is not bound that way — the gate reads the source's current mode. **Switching to `chg` closes the PR route for every story on the source at once** (409 `change_protocol_enrolled`; land with `chg submit`), and the switch itself is 409 `pr_route_in_flight`, naming `story_ids`, while a story of the project sits at `ci` holding a merge allow it has not merged on. The resulting source must carry both credentials, named here or kept from an earlier `chg` stint (422 naming the missing one), and the root is re-checked on every write that leaves the source `chg`, a secret rotation or a base-branch edit included (422 `chg_root_invalid`, also for a named root with 300 s or less left; switching to `pr` is never blocked by it). Switching to `pr` KEEPS both and they stay LIVE: the sender's ledger and its new changes' events are still accepted (recorded, routing nothing), while an event for a change the `chg` route already acted on is 401 until the source is `chg` again, so send an explicit null to refuse the sender; on a `pr` source an explicit null clears either, on a `chg` or `ledger` source it is a 422. Naming either credential, or setting `mode` to `chg` or `ledger` (which re-activates the kept ones), needs the tenant's operator key, one no dispatch minted (403 `chg_registration_forbidden` otherwise — a key minted by a dispatch beneath yours is refused the same way), and the secret never comes back. **Do not send `target_epic_id: null` to mean "not changing this":** an explicit null is the only way to CLEAR the epic, which returns the source to escalating every report instead of filing a story. `base_branch` has no cleared state and a null there is refused locally. This is how a source already pointed at the wrong trunk is corrected — `intake_source_enroll` takes `base_branch` itself, so a `main` repository no longer needs a second call — and the remedy for a source with no epic — every record from it stays `pending_triage` and is retried until one is named, then they promote on the next run with nothing lost. Revoked sources are 404, not a no-op: revoking clears the target so the epic can be deleted, and repointing one would put that block back. 422 when the epic is not in this source's project. Required: `source_id` (refused locally if it is not a UUID — the server answers the same 404 for malformed and unknown). Requires `LOOPCTL_USER_KEY` and a human-anchored tenant. |
|
|
652
|
+
| `intake_source_update` | **Set where a source's work lands** (`PATCH /api/v1/intake/sources/:id`): `target_epic_id`, the epic triaged stories are created in, `base_branch`, the branch every dispatch for this repository is cut from, `issue_label`, the GitHub label that marks this source's issues (an explicit null clears it, which makes the source its project's primary; a `base_branch` or `issue_label` change meets the same three 422 refusals as `intake_source_enroll`: `already has a live intake source on base branch <b>`, `is already the label of another live source on this repository`, `is required: this project already has a source with no issue label`), `deploy_environment`, the GitHub deployment environment post-deploy verification reads this source's stories against (US-54.7; an explicit null clears it, returning the source to the fleet-wide `DELIVERY_DEPLOY_ENVIRONMENT`, `production` when unset; read on every sweep, so it reaches stories already waiting; an empty string, a control character or more than 255 characters is refused locally and 422 at the server), `fly_app`, the Fly app the post-deploy monitor reads this source's edge metrics for with the tenant's own Fly metrics credential (US-55.7, `set_fly_metrics_credential`; an explicit null clears it, which stops the monitor reading the source; anything but a Fly app name, lowercase letters, digits and hyphens of at most 63 characters starting with a letter or digit, is refused locally and 422 on `fly_app` at the server), `mode` (`pr` or `chg` on a work project, `ledger` on a KB scope or a work project; a switch into or out of `ledger` is 422), the `change_events_secret` / `change_events_secret_file` and `chg_root_dispatch_id` that authenticate the source's chg ledger and change events (or `mint_chg_root: true`, which has loopctl mint a new keyless root in the write: the fix for a source with no root or a revoked one, 422 beside a named root) (on a `pr` source they let chg send the ledger while the source stays `pr` and its merge gate still reads the PR — do not switch to `chg` for that), and `required_checks`, the checks story verification judges a story's commit by — once the tenant has a GitHub credential, its own token (`set_github_credential`) or an entry in the operator's `VERIFICATION_OPERATOR_TOKEN_TENANTS` (`credential_unavailable` otherwise), a source naming none records `no_required_checks` and reads nothing, and one naming some has its (tenant, repository) credential resolved before any GitHub read (`local-gate` is refused), and `triage_requires_ticket`, which issues are triaged at all (true: only issues HomeCareBilling filed from a support ticket; read at dispatch time, so it reaches stories already waiting at `detected`; null is refused), and `deploys`, whether a merge is followed by a GitHub deployment (false: the merge is the release, so post-deploy verification moves a merged story on with `release_id` `merge:<sha>` and reads no deployment; read on every sweep; null is refused), and `ephemeral_items`, whether the source's interactive work items are a harness's (true, as on the e2e sandbox source: the reservation sweep abandons a released item whose branch is gone with no merged pull request once its one-day grace has passed, instead of after three days; a branch that exists still waits; null is refused). Presence decides — a field you do not name is left exactly as it was, and naming none of them is 422 `nothing_to_update`. `mode` has no cleared state either, and a null or unknown value is refused locally. Each implement dispatch records the base branch it was placed under, and the merge gate reads that; `mode` is not bound that way — the gate reads the source's current mode. **Switching to `chg` closes the PR route for every story on the source at once** (409 `change_protocol_enrolled`; land with `chg submit`), and the switch itself is 409 `pr_route_in_flight`, naming `story_ids`, while a story of the project sits at `ci` holding a merge allow it has not merged on. The resulting source must carry both credentials, named here or kept from an earlier `chg` stint (422 naming the missing one), and the root is re-checked on every write that leaves the source `chg`, a secret rotation or a base-branch edit included (422 `chg_root_invalid`, also for a named root with 300 s or less left; switching to `pr` is never blocked by it). Switching to `pr` KEEPS both and they stay LIVE: the sender's ledger and its new changes' events are still accepted (recorded, routing nothing), while an event for a change the `chg` route already acted on is 401 until the source is `chg` again, so send an explicit null to refuse the sender; on a `pr` source an explicit null clears either, on a `chg` or `ledger` source it is a 422. Naming either credential, or setting `mode` to `chg` or `ledger` (which re-activates the kept ones), needs the tenant's operator key, one no dispatch minted (403 `chg_registration_forbidden` otherwise — a key minted by a dispatch beneath yours is refused the same way), and the secret never comes back. **Do not send `target_epic_id: null` to mean "not changing this":** an explicit null is the only way to CLEAR the epic, which returns the source to escalating every report instead of filing a story. `base_branch` has no cleared state and a null there is refused locally. This is how a source already pointed at the wrong trunk is corrected — `intake_source_enroll` takes `base_branch` itself, so a `main` repository no longer needs a second call — and the remedy for a source with no epic — every record from it stays `pending_triage` and is retried until one is named, then they promote on the next run with nothing lost. Revoked sources are 404, not a no-op: revoking clears the target so the epic can be deleted, and repointing one would put that block back. 422 when the epic is not in this source's project. Required: `source_id` (refused locally if it is not a UUID — the server answers the same 404 for malformed and unknown). Requires `LOOPCTL_USER_KEY` and a human-anchored tenant. |
|
|
653
653
|
| `intake_source_revoke` | **Revoke an intake source** (`DELETE /api/v1/intake/sources/:id`). The verb is DELETE and the action is a revoke: `revoked_at` is stamped, the row is kept, and `intake_source_list` still returns it with `include_revoked`; nothing already received is discarded. Afterwards every delivery to that URL is refused 401 `invalid_signature` exactly as a wrong secret is, so the GitHub webhook does not know it has been cut off and should be deleted on the repository too. Idempotent — a second revoke answers 200 with the original `revoked_at`. It frees the source's uniqueness slots — its repository and base branch, its `issue_label`, and its project's primary slot (every identity index is partial on not-yet-revoked) — so a source with a lost secret, a wrong project or a typo'd repository is corrected by revoking and enrolling again; and it clears `target_epic_id`, which is what makes that epic deletable and is the remedy an epic-delete refusal names. Required: `source_id` (refused locally if it is not a UUID). Requires `LOOPCTL_USER_KEY` and a human-anchored tenant. |
|
|
654
654
|
|
|
655
655
|
### Dispatch & Chain of Custody (v2) Tools
|
package/index.js
CHANGED
|
@@ -11884,7 +11884,8 @@ const TOOLS = [
|
|
|
11884
11884
|
"summed for the tenant (`fleet`), `in_flight` counts per stage from claimed through " +
|
|
11885
11885
|
"verified; `waiting` counts for detected, triaged and queued and for escalated per " +
|
|
11886
11886
|
"reason class, each with its oldest item's age in seconds; `throughput` (items reaching " +
|
|
11887
|
-
"done in the window, median seconds from opened to done
|
|
11887
|
+
"done in the window, median seconds from opened to done, leaving out `issue_closed` ends " +
|
|
11888
|
+
"of stories whose issue closed before triage); `failure_classes` (moves into " +
|
|
11888
11889
|
"escalated or failed in the window, by the stage machine's edge); `reserved` (queue " +
|
|
11889
11890
|
"items a released move reserves for one host, holder or the cloud: count, oldest age, " +
|
|
11890
11891
|
"`by_kind`), counted there and not again under `waiting` (a released move to the loop " +
|
|
@@ -11893,7 +11894,8 @@ const TOOLS = [
|
|
|
11893
11894
|
"`waiting`: items reserved for an interactive session after its claim lapsed, with the " +
|
|
11894
11895
|
"oldest age); `detected_blocked` (the `waiting.detected` items split by why each is " +
|
|
11895
11896
|
"still there, under the first reason that holds: `no_intake_record`, `issue_closed` " +
|
|
11896
|
-
"(
|
|
11897
|
+
"(closed under an hour: then ended at done, and a later reopen files a new story), " +
|
|
11898
|
+
"`no_triage_source`, `intake_paused`, " +
|
|
11897
11899
|
"`ticket_required`, `triaging` (a triage dispatch is in flight), `no_runner_for_repo` " +
|
|
11898
11900
|
"(no live connected runner takes triage for its repository without a config refusal), `runners_busy`, `triage_due`; each a count and oldest age, summing to " +
|
|
11899
11901
|
"`waiting.detected.count`). Every count is read " +
|
|
@@ -13228,7 +13230,10 @@ const TOOLS = [
|
|
|
13228
13230
|
"`chg`/`gate`, counts per verdict), `fallbacks` (checks that ran mode all, the rate, " +
|
|
13229
13231
|
"the top reasons), `selection` (stats, plus misses: a chg check that passed on a " +
|
|
13230
13232
|
"commit whose gate failed), `phase_times` (hydrate, static, affected, tests, " +
|
|
13231
|
-
"lock_wait: rows, mean and max ms
|
|
13233
|
+
"lock_wait: rows, mean and max ms, shadow and gate-mode checks together), " +
|
|
13234
|
+
"`gate_checks` (gate-mode checks split into `at_build` and `live_tree`, each with " +
|
|
13235
|
+
"its median push wait in ms; a check by a chg that does not record hydrate_ms on " +
|
|
13236
|
+
"gate rows counts as live_tree), `flaky`, `runner_samples`, `review_outcomes` " +
|
|
13232
13237
|
"(merged PRs' findings by severity and disposition, and how many merged without a " +
|
|
13233
13238
|
"counted review round), `attention` (changes flagged gap or stale). Lists are capped " +
|
|
13234
13239
|
"at 50 rows. A panel whose read was shed under load is the string `unavailable`; " +
|
|
@@ -13929,7 +13934,9 @@ const TOOLS = [
|
|
|
13929
13934
|
"credential (US-55.7; null clears it; anything but a Fly app name is refused here and " +
|
|
13930
13935
|
"422 on `fly_app` at the server), `deploys` (false: the merge is the release, and " +
|
|
13931
13936
|
"post-deploy verification waits for no deployment; null is refused here and 422 at the " +
|
|
13932
|
-
"server), `
|
|
13937
|
+
"server), `ephemeral_items` (true: the source's interactive work items are a harness's, " +
|
|
13938
|
+
"so the reservation sweep abandons a gone branch's item after its one-day grace instead " +
|
|
13939
|
+
"of three days; null is refused here and 422 at the server), `mode`, the merge route (`pr` or `chg`, " +
|
|
13933
13940
|
"or `ledger` on a KB scope or a work project), and the `change_events_secret` and " +
|
|
13934
13941
|
"`chg_root_dispatch_id` " +
|
|
13935
13942
|
"that authenticate a source's chg ledger and change events.\n\n" +
|
|
@@ -14106,6 +14113,16 @@ const TOOLS = [
|
|
|
14106
14113
|
"on every pass, so it reaches the stories and records already waiting. Null is " +
|
|
14107
14114
|
"refused; omit the field to leave it alone.",
|
|
14108
14115
|
},
|
|
14116
|
+
ephemeral_items: {
|
|
14117
|
+
type: "boolean",
|
|
14118
|
+
description:
|
|
14119
|
+
"WHETHER THIS SOURCE'S INTERACTIVE WORK ITEMS ARE A HARNESS'S. False (the " +
|
|
14120
|
+
"default): a released interactive reservation whose branch is gone from the forge " +
|
|
14121
|
+
"with no merged pull request is abandoned after three days, the time a real " +
|
|
14122
|
+
"session gets to push its branch. True (the e2e sandbox source): it is abandoned " +
|
|
14123
|
+
"once its one-day grace period has passed. A branch that exists still waits. " +
|
|
14124
|
+
"Null is refused; omit the field to leave it alone.",
|
|
14125
|
+
},
|
|
14109
14126
|
deploys: {
|
|
14110
14127
|
type: "boolean",
|
|
14111
14128
|
description:
|
package/lib/intake-sources.js
CHANGED
|
@@ -399,6 +399,20 @@ export function deploysRefusal(value) {
|
|
|
399
399
|
);
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
+
/**
|
|
403
|
+
* `ephemeral_items`: a boolean, never null (`Source.put_ephemeral_items/2` answers 422 for null).
|
|
404
|
+
* True says the source's interactive items are a harness's, abandoned after the grace period.
|
|
405
|
+
*/
|
|
406
|
+
export function ephemeralItemsRefusal(value) {
|
|
407
|
+
if (typeof value === "boolean") return null;
|
|
408
|
+
|
|
409
|
+
return refuse(
|
|
410
|
+
"`ephemeral_items` must be true (the source's interactive work items are a harness's, " +
|
|
411
|
+
"abandoned once their grace period passed) or false (a gone branch's item waits three " +
|
|
412
|
+
"days). It cannot be null; leave it out to keep the current value.",
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
|
|
402
416
|
/** The longest `issue_label`, in characters: GitHub's own label limit (`Source.max_issue_label_chars/0`). */
|
|
403
417
|
export const MAX_ISSUE_LABEL_CHARS = 50;
|
|
404
418
|
|
|
@@ -519,6 +533,7 @@ export function publicSource(source) {
|
|
|
519
533
|
required_checks: source.required_checks,
|
|
520
534
|
triage_requires_ticket: source.triage_requires_ticket,
|
|
521
535
|
deploys: source.deploys,
|
|
536
|
+
ephemeral_items: source.ephemeral_items,
|
|
522
537
|
// `change_events_secret` is NEVER named here: write-only (US-47.2).
|
|
523
538
|
chg_root_dispatch_id: source.chg_root_dispatch_id,
|
|
524
539
|
target_epic_id: source.target_epic_id,
|
|
@@ -942,6 +957,12 @@ export async function updateIntakeSource(
|
|
|
942
957
|
body.deploys = args.deploys;
|
|
943
958
|
}
|
|
944
959
|
|
|
960
|
+
if (args.ephemeral_items !== undefined) {
|
|
961
|
+
const badEphemeral = ephemeralItemsRefusal(args.ephemeral_items);
|
|
962
|
+
if (badEphemeral) return badEphemeral;
|
|
963
|
+
body.ephemeral_items = args.ephemeral_items;
|
|
964
|
+
}
|
|
965
|
+
|
|
945
966
|
// Switching to `chg` may rely on credentials an earlier `chg` stint left on the row, so their
|
|
946
967
|
// absence here is the SERVER's to judge (422 naming the missing one); only their shape is
|
|
947
968
|
// judged here.
|
|
@@ -954,7 +975,7 @@ export async function updateIntakeSource(
|
|
|
954
975
|
"Nothing to update. Name at least one of `target_epic_id` (null clears it), " +
|
|
955
976
|
"`base_branch`, `issue_label` (null clears it), `deploy_environment` (null clears " +
|
|
956
977
|
"it), `fly_app` (null clears it), `mode`, `required_checks`, " +
|
|
957
|
-
"`triage_requires_ticket`, `deploys`, " +
|
|
978
|
+
"`triage_requires_ticket`, `deploys`, `ephemeral_items`, " +
|
|
958
979
|
"`change_events_secret` (or " +
|
|
959
980
|
"`change_events_secret_file`), `chg_root_dispatch_id` or `mint_chg_root`. A body " +
|
|
960
981
|
"carrying none of them " +
|