Skip to content

fix: quick wins from a sweep of the open issues - #1075

Merged
krokoko merged 80 commits into
mainfrom
fix/1074-quick-wins-sweep
Nov 24, 2026
Merged

krokoko merged 80 commits into
mainfrom
fix/1074-quick-wins-sweep

Conversation

@krokoko

@krokoko krokoko commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

A sweep of the open issues for small fixes that nobody had picked up. Every open issue without a pull request or an assignee was read against main. An issue is on this branch when its fix is small, already decided by the issue or by the code, and provable without a deployment. Seven commits go beyond that rule. Five touch what AGENTS.md lists as ask-first: workflows (#131, #328, #891), a new pinned tool (#278) and the agent prompt (#492). Two need a reviewer's decision: a new stored attribute (#447) and the scope of an audit exception (#916). Two more commits add only a comment to a workflow file (#329, #569).

The sweep is 65 commits. Each covers one issue, or two or three that share a fix, and its message gives the reasoning. This pull request closes 31 issues. 37 more are referred to. For each of them the commit fixes the part that was small, and its entry below says what is left. 29 of them are open. Eight were closed on 2026-11-21, after their triage comment: #118, #228, #254, #719, #750, #782, #851 and #916.

After the review the branch also holds two merges of main and thirteen commits. Ten answer the two reviews, and three correct what that work turned up and no review named (edad1338, ddaa6704, a4ff8932). They are described under "After the review".

Nothing was deployed and no AWS call was made in making this pull request. A reviewer has since deployed the reviewed head to a dev stack. Both are under "How it was checked".

Area

  • cdk — infrastructure, handlers, constructs
  • agent — Python runtime / Docker image
  • cli — bgagent client
  • docs — guides or design sources (docs/guides/, docs/design/)
  • tooling — root mise.toml, scripts, CI workflows

Also web/README.md and web/AGENTS.md. Eight workflow files change (see "Workflows" below).

Related

Closes #1074, the tracking issue of this work.

Closes #57
Closes #59
Closes #89
Closes #172
Closes #260
Closes #278
Closes #551
Closes #560
Closes #569
Closes #635
Closes #670
Closes #683
Closes #686
Closes #701
Closes #758
Closes #759
Closes #767
Closes #793
Closes #794
Closes #810
Closes #818
Closes #841
Closes #847
Closes #850
Closes #878
Closes #883
Closes #889
Closes #892
Closes #1016
Closes #1017
Closes #1020

Referred to and open: #72, #111, #113, #127, #128, #131, #192, #225, #328, #329, #400, #447, #492, #571, #583, #702, #734, #749, #751, #760, #781, #783, #817, #843, #891, #901, #919, #928, #1019.

Referred to and closed on 2026-11-21: #118, #228, #254, #719, #750, #782, #851, #916.

Of the open ones, #447 and #891 have nothing left to build. Closing them is a maintainer's decision, and their entries say why. #782 and #851 had nothing left to build either and are among the eight that were closed.

Changes

Read these first: what changes on purpose

Deploying and operating

Tasks and the agent

API and CLI

Contributors

Workflows

Eight files under .github/workflows/ change. All of .github is admin-owned.

Not changed: pull-request-lint.yml, where a condition tests for an event the workflow never receives (part of #328). Removing that test is a one-line change, left for a maintainer to make by hand. Behaviour is the same with or without it.

Agent runtime and prompts

#749 Two more mise missing-task errors recognized (a0e17648)
Where a repository has no mise lint or build task, mise can print "unknown command: lint" or "no task build found", and the agent read both as a failed run. Lint was reported red on every task, and a missing build task as a failed build. Both wordings on mise's own error line now count as a gate that did not run. Still open: a pull request the agent opened itself gets no warning that gating is off.

#551 Blocked-host reason only from network tools (297ea1df)
A task that failed without a reason of its own was reported as an egress denial whenever any tool's output had quoted a failed connection to another host, so reading a log file could blame a host the task never called. The reason is now taken only from a Bash result and from a WebFetch call that failed. The live agent_blocked event is still written for every tool. A blocked connection seen only in another tool's result, such as a background command's output file, no longer sets the reason.

#817 ARN-check constants gated, stale comments corrected (3d5007fb)
The agent's MicroVM ARN check reads arn_keys and account_anchor_key from contracts/constants.json, but a hard-coded copy of either passed mise run check:constants-sync. The gate now covers both and fails on an assignment that is not a plain read of the contract. Comments that contradicted the code are corrected, such as the claim that the agent refreshes its heartbeat on ECS. No runtime behaviour changes. Still open: the cross-workspace case of the ARN check, the NO_INGRESS probe and the test for a truncated payload, among others.

#758, #759, #760 Task fails if registry .mcp.json could be committed (75a26646)
The registry mcp_server config in the clone's .mcp.json, which may hold secrets, could reach a commit when the file was a symlink, or when the guard that keeps the file out of commits failed with only a warning. apply_mcp_assets now raises RegistryAssetLoadError instead, so the task fails before the agent starts. A repository that tracks .mcp.json is refused too when sparse checkout is enabled in the clone. Still open: #760, because the agent's own edits to .mcp.json are still left out of its commits.

#225 Turn, tool-call and error events screened for credentials (052f2d92)
Only tool results were screened for credentials. The model's thinking and text, tool inputs and the text of an error that ends the session went unscreened into the task's events, and so to bgagent watch, the web console and Slack. The runner now screens them the way it screens a tool result. False positives come with it. A path such as docs/walkthroughs_intro.md contains ghs_ and is shown partly masked. Still open: the policy per entity type, the audit record, PII detection and the gate on pull-request content.

#750 Build command with unclosed quote goes to bash (e8caaf1f)
A build or lint command with an unclosed quote or a trailing backslash made shlex raise an error nothing caught. One typo in a blueprint failed every coding task of that repository before the agent ran. resolve_verify_argv now hands such a command to bash -lc, like a command with a shell operator, so an unclosed quote shows as a failed baseline or gate instead of an exception. Not done: the separate error classification the issue suggests; #1052 met its other asks.

#118 Telemetry redaction tests compare the whole message (92777089)
The tests for a secret in the error text of a METRICS_REPORT event checked only that the secret was gone and its marker present, so they also passed for a redaction that replaces the whole message, which is what the issue was filed against. They now compare the whole logged value. No product code changes. The expected values are what main already logs. Not done: the issue's check of the dashboard on a deployed stack; the redaction it asked for is already on main.

#113 Long deny reasons keep the no-retry instruction (15493161)
When a reviewer denied a gated tool call, the instruction not to retry that class of action stood at the end of a text cut at 500 characters, so a reason of more than about 220 characters cut into it. The reason is now shortened instead, to about 200 characters, and the full reason still follows in the <user_denial> block. The user guide says what a deny does. Still open: the end-to-end run on a deployed stack that shows the agent stops retrying.

#841 Server-test thread join pinned by a test (ff0cf401)
The race of this issue is already fixed, but nothing held the fix in place. With the join in reset_server_state deleted, agent/tests/test_server.py stayed green in most runs. A new test runs pytest on a throwaway module and fails when the join is removed or comes after the stubs are undone. Tests that shared the task id t-pc now use their own. Not done: the join at fixture setup, which would have nothing to join, and the re-run of #680, which has merged.

#919 bgagent status shows the count that max_turns limits (f97fe515)
bgagent status could show a turn count above the limit, such as 90 / ~80. The task record took its counts from the SDK's num_turns, which grows with every tool result. turns_completed is now the runner's count of the model's answers, the count that max_turns limits, and bgagent status shows that count, without the ~. turns_completed and the turn of agent_cost_update change their source, not their shape, so deploy the agent with or before the CLI. Still open: the Linear and Jira comments print turns_attempted against max_turns.

#751 No-change run no longer called a transient fault (47cf61a7)
A task whose request was already met rightly changed nothing, yet failed as "The change was not saved", a transient fault to be retried, which could only fail again. The delivery gate cannot tell that run from one whose changes were lost, so the classification now reads "No change was delivered" and names both causes. The class moves from transient to user; the classification stays retryable. Still open: such a run still ends FAILED, since the agent cannot report that no change was needed.

#810 Unread log-write failure counter removed (4733f8bf)
The agent server counted failed CloudWatch log writes in a variable nothing read, while comments, the README and tests called it an alarm signal, so someone debugging a silent task could look for an alarm that does not exist. Of the two options the issue leaves, the counter is removed, not exposed, and the texts name the stdout line a failed write leaves. Runtime behaviour does not change. The deployment guide no longer describes a cloudwatch_write_failed record, which the agent never emitted.

#781 Agent registry reader treats nulls like the API (b2ae3827)
The agent's registry reader mirrors the API-side adapter but answered some stored records differently. An explicit null in a descriptor or a record name raised an error resolve() does not catch, and a payload holding NaN or Infinity resolved. It now reads a null in a descriptor as an absent payload (REMOVED) and those literals as MALFORMED. Nothing constructs this reader in production yet. Still open: the adapters still differ on other records, and the API side still casts a status it does not know.

#635 run_task restores the environment it changed (f1219e0a)
run_task wrote the commit identity, the GitHub token, TASK_ID and PROMPT_VERSION into the process environment and never took them out. The Linear and Jira credentials a task resolves stayed there too. A process that carried on after the task would therefore commit as bgagent and keep the task's credentials. run_task now puts the whole environment back as it found it when it returns or raises. The restore wraps the whole call, not the block the issue sketches, because the token can be set outside that block. A token the server resolved before calling run_task stays in GITHUB_TOKEN. The first commit restored eight named variables. The commit for #560 added WORKFLOW_ID and WORKFLOW_STEP to the list. The whole environment came with the review (84e335de).

#560 Workflow-Id and Workflow-Step commit trailers (104b8a2b)
Task-Id and Prompt-Version linked a commit to its task and to the task's prompt version, but git log could not tell which workflow or step made it. The workflow step runner now sets WORKFLOW_ID and WORKFLOW_STEP when a step starts, and the prepare-commit-msg hook writes them as Workflow-Id and Workflow-Step trailers. For a task with a repository the runner runs only the agent step, so every commit names that step, the safety-net commit included. Pull requests the platform opens list two more lines per commit.

#492 Markers around GitHub content in agent prompts (53ccf21b)
A GitHub issue or pull request stood unmarked in the prompt, so an instruction in it read like the platform's own. It now stands between a BEGIN line, which says that the text is data, and <<<END UNTRUSTED EXTERNAL CONTENT>>>, and the coding system prompts gain a rule about the markers. Inside, text that spells a marker's words becomes [SANITIZED_MARKER], though not every text that resembles a marker. The effect on a live model was not measured. Still open: the optional strict mode and a trust note for attachments.

API, webhooks and integrations

#57 Create-webhook response carries the webhook URL (66003cc6)
POST /v1/webhooks returned the webhook id and the secret but not the URL the external system posts to, so a user had to join the API URL and /webhooks/tasks by hand. The 201 response now carries webhook_url, built from the host and stage of the request, and bgagent webhook create prints it above the secret. The URL is the same for every webhook of a deployment. With a custom domain it is right only when the API is mapped under the stage name.

#850 Slack mention reads a pasted GitHub link (fc82747b)
In a Slack mention, @Shoof fix https://github.com/org/repo/issues/42 was refused with "Repository 'github.com/org' is not onboarded", or started on the channel default without the issue. A GitHub link to a repo, an issue or a pull request now names owner/repo and passes the number as issue_number, and any other link names no repo. A link that names a repo wins over the channel default, also inside pasted output, so a message that used to start on the default is refused when the linked repo is not onboarded. Since the review a link to one of 27 listed pages of github.com names no repo (33ac53b5).

#883 Remove-workspace refuses an ambiguous slug with 409 (abaf0639)
When several active registry rows carried one slug, DELETE /v1/linear/workspaces/{slug} removed the row its scan read first and answered 200, and the others stayed active. The scan now reads the whole registry, and several active rows are refused with 409 WORKSPACE_SLUG_AMBIGUOUS. Nothing is written, and the message names the linear_workspace_id of each. The 409 follows the admin check, so only a caller who installed one of the rows sees the ids. The endpoint takes no linear_workspace_id parameter, which the issue left open. The Linear setup guide gives the manual steps.

#734 Jira event retried when the registry read fails (2e1af400)
A failed read of the Jira workspace registry was taken for "tenant not in registry". The processor ended successfully with a WARN, Lambda did not retry, and the event was lost. The trigger-label and @bgagent comment paths now read the row with getRegistryRowStrict. A failed read is logged at ERROR and fails the invocation, so Lambda delivers the event again. Still open: the same change in the Linear processor, a decision for Slack, dead-letter queues with depth alarms for the three processors, and the runbook notes.

#901 Failed heartbeat edits logged, Jira comment module renamed (df0d723d)
The heartbeat sweep ignored a failed Jira edit. A tenant with a rejected credential gave "edited: 0", like a sweep with nothing to edit. A failed edit is now logged with its task id, and the completion line reports attempted next to edited. A screenshot URL that is not allowed no longer stops an iteration's status comment, which is posted without it. jira_preview_claimed is typed true instead of boolean, and jira-preview.ts is renamed jira-iteration-comment.ts. Still open: the preview claim state machine, a typed ADF document and the positional string parameters.

#583 GitHub status comment updated on a timeout (25021604)
The GitHub status comment of a timed-out task was never posted, or stayed at RUNNING, because the GitHub channel did not subscribe to task_timed_out. The channel's default event set now contains the event. The user guide section on this comment is rewritten to match the code. A timeout after pr_created can drop the "Pull request" row, as task_failed already does. Still open: turns and the stop reason in the comment, the outcome framing that the Linear and Jira comments use, and what depends on the GitHub Issues channel.

#783 Registry adapter comments corrected, one delete state dropped (c7e4c309)
Comments in the Agent Registry adapter and its port did not match the code. They now say where a SKILL record keeps its runtime config, that autoApprove gates only the approval, and that waitPastCreating ends at the first status after CREATING. DeleteAttempt merges started and retryable into pending; behaviour is unchanged. A test proves that isComplete rethrows an unexpected GetRegistry failure. Still open: evaluating a type that links kind to its payload, and the auto_approve comment of the API wire type, which keeps the old sentence.

#782 Test for the 502 of an incomplete publish (1861b3c7)
No test ran the branch that answers 502 REGISTRY_PUBLISH_INCOMPLETE when a registry publish fails after its record was created. With the branch removed, the handler's tests still passed. A new case pins the status, the error code, the record id and the instruction to approve or delete the record before retrying, and the adapter's test now checks that instruction too. Only tests change. Nothing is left to build, because #1052 already gave the publish function 28 s against a 20 s wait for record creation, without citing the issue.

#683 PDF screening tested with real PDFs (aebb08ad)
#695 fixed the defect of #683, but the suite still mocked pdf-parse, so a later API mismatch would not have failed it. A new test runs the real screenTextFile and the installed pdf-parse on PDFs built in memory, with only the guardrail stubbed. The text of both pages of a two-page PDF must reach the guardrail, and a 51-page PDF must be refused. The screening runs in a child process, because under Jest pdfjs cannot import its ES module worker. The cdk suite gains about one second.

#794 Metric and alarm for failed webhook screening (91b610b3)
The Jira and Linear webhook processors drop comments, and Linear project documents, when the guardrail call that screens them fails, and the only trace was a warning in the log. Each failed call now writes an embedded-metric line, ABCA/Webhooks:WebhookScreeningFailed, with a source dimension and a total without dimensions. Where Linear or Jira is deployed, an alarm on the total notifies the OperationalAlerts topic at the first failure. The alarm sits in the ConcurrencyMaintenance nested stack because the root stack's widest configuration already fills its resource budget. Since the review a failed screening of the context of a Linear agent session counts too (6c101b42), and the alarm's description names that context (a4ff8932).

#686 Lambda error alarms notify the alerts topic (628dd786)
The orchestrator's OrchestratorErrorAlarm and the screenshot processor's WebhookProcessorErrorAlarm changed state without notifying anyone, so a failing orchestrator was visible only in the CloudWatch console. Both are now passed to operationalAlerts.addAlarmActions with the other alarms, and a stack test fails on any alarm of the root stack's default template that does not list the topic. Since the review that test reads the nested stacks of the default synth too, and a second test fails on an alarm without an action in any deployment profile (9de906d7). A subscriber of the OperationalAlerts topic receives two more kinds of notification, on the transition into ALARM only. The deploy updates the two alarms in place and adds no resource.

#228 Comments and docs say the dead-letter alarms notify (27eb0411)
Code comments and two design documents still described the notification of the CloudWatch alarms as future work, although AgentStack attaches the OperationalAlerts SNS topic to both dead-letter alarms (#629). The comments on FanOutConsumer and ApprovalMetricsPublisherConsumer now say that the alarm notifies the topic, and the two documents say what exists. Only comments and documents change. Not done: the optional OK action of the issue, which is left to the maintainers.

CLI and setup

#1020 Setup failure screen shows preflight and build errors (a9b2f614)
When the bootstrap preflight stopped mise //cdk:deploy, bgagent setup showed only [//cdk:deploy] ERROR task failed under "Cause", and the real message stayed in setup-deploy.log. Any line that contains fail, in any letter case, now counts as an error line, which covers the bootstrap preflight's FAIL: and the fail: line CDK prints for an asset build or publish. The closing line of mise is never listed. A failed cdk diff and a failed account preparation use the same helper, so their screens change too.

#172 License header enforced on CLI shebang files (32ba6862)
license-header/header was switched off for src/bin, so bgagent.ts, the CLI's one shebang file, could lose or change its header and lint still passed. With the override removed, a shebang file is reported when its header is missing, altered or not exactly one blank line below the shebang. The rule accepts a shebang. The override was there because, without --fix, the parser reads the file from disk, where the header looks misplaced. disallowAutomaticSingleRunInference turns that off for the CLI's check-only lint, which takes about as long as before.

#847 Stack outputs read once; default model follows geography (a6dacb57)
Four operator commands sent one DescribeStacks call per output, 11 for platform doctor, and repo show named the shipped global. model as the platform default on stacks that grant only another geography. platform doctor, repo onboard, repo show and runtime status now read their outputs with one call through getStackOutputs. repo show takes the geography from the BedrockGeoRegion output, so --output json reports a different effective.model_id where the geography is not global. The issue offered a helper or a cache; the helper was chosen.

#1016 Shared deployment-profile cases run by CDK and CLI (4a84417a)
The profile parser, the per-feature context switches and the profile file naming exist in both the CDK and the CLI, and the only cross-check compared source text, so behaviour could drift unseen. Both Jest suites now run the cases of contracts/deployment-profile-vectors/ against their own copy, and the source-text comparisons they replace are gone. Only tests, fixtures and contributor documentation change. The README beside the cases records one difference left outside them. The CLI reads a one-element array as a switch value, and synthesis rejects it.

#1017 MicroVM Regions in the catalog, checked by setup (ed204b28)
bgagent setup --compute lambda-microvm in an unsupported Region failed only at cdk diff, because the Region list lived outside the capability catalog. The list is now in the compute.lambda-microvm entry of contracts/deployment-capabilities.json, which the CDK reads and the CLI mirrors. Before the feature prompts and the diff, setup rejects a backend not listed for the Region, unless microvm_region_override is set, as at synthesis. persistentContext() now ranks cdk.json above cdk.context.json, so setup also takes networkTopology from cdk.json when both set it. The Regions were not checked against AWS again.

#1019 Diff parsing and account plan split from setup (19499d12)
cli/src/commands/setup.ts mixed prompts, cdk diff parsing, bootstrap decisions, process spawning and UI, and tests reached four of its private functions only through whole wizard runs. setup-diff.ts now holds parseStateBearingChanges and describeDataLoss, and setup-account.ts holds planAccountPreparation, versionAtLeast and bootstrapNameProblem, each with its own test file. The logic moved unchanged, so prompts, output and exit codes stay the same. Still open: setup.ts keeps the loop that runs the account-preparation steps, the screens, the context checks and the AWS and terminal adapters; the issue wants orchestration only.

#254 CLI lint rejects imports from outside the package (856bb060)
An import in cli/src of cdk/lib output or of a JSON file in contracts/ compiled and passed lint, although an installed CLI ships neither. import-x/no-restricted-paths now fails any import in cli/src of a repository file outside cli/, by path or by workspace package name, and says to mirror or copy the value. cli/src has no such import, so the rule starts as an error; tests are exempt. cdk/AGENTS.md and cli/AGENTS.md also explain the import-x/no-cycle messages. Not done: an import-cycle check for the web package.

#719 The three UA sanitizers agree on non-BMP characters (bdf03907)
For a character outside the Basic Multilingual Plane, the two TypeScript user-agent sanitizers wrote two dashes and agent/src/ua.py wrote one, and contracts/ua-vectors.json had no vector for the case. Both TypeScript regular expressions now carry the u flag, match by code point and write one dash, and the contract gains that vector. No value sent today differs, because every component label in use is ASCII. Not done: the app-id sanitizer in cdk/src/constructs/solution-ua-aspect.ts. It has its own copy of the expression and no vector, and it still writes two dashes.

CDK, bootstrap and deployment

#400 Assertion stack named after the integ run (1d403b69)
Every integ run in an account and Region created, updated and deleted the same assertion stack, TaskApiSmokeDefaultTestDeployAssert413BE3D6, because only the stack under test took its name from INTEG_STACK_NAME. The integ app now names that stack <stack name>-assert, which in CI is int-<sha>-<run>-assert. Only an approved integ run can prove the deploy and destroy on AWS. A stack left under the old name has to be deleted by hand. Still open: the offline cdk diff for the approver, and a teardown that does not fail the run.

#192 Five deprecation warnings cleared from the build (94e5bddb)
The two warnings the issue names were gone, but the build still printed deprecation notices at five other sites. TaskOrchestrator now constructs its live alias itself instead of calling Version#addAlias, under the same scope and id, so the alias keeps its logical ID. EcsAgentCluster passes containerInsightsV2, and two test fixtures and the docs site's Astro config drop a deprecated method, runtime and option. Synthesized templates are byte-identical except for one cdk-nag reason string. Still open: the process the issue proposes, capturing the build's warnings or failing on new ones.

#843, #127 Tests tie the deploy task to the pipeline (f150c699)
Nothing at the deploy task of cdk/mise.toml said that deploy.yml does not run it, and nothing failed when the task gained a step the pipeline lacks. A comment there now says what the pipeline does for each entry, and a test fails when an entry is added or changed, or its step in deploy.yml is gone. A second suite runs the bootstrap preflight and pins when its exit code stops cdk deploy. No behaviour changes. Still open: deploy.yml has no bootstrap preflight step; #127 decides whether it gets one.

#128 Bootstrap tasks, preflight and versioning documented (75ea6b38)
The bootstrap shipped without the documentation the issue lists, although its preflight sends operators to the deployment guide. The guide gains "Bootstrap with least-privilege" with a remedy for each preflight result, DEPLOYMENT_ROLES.md gains "Versioning", and AGENTS.md and cdk/AGENTS.md say where bootstrap changes go. The documented command that sets ComputeTypes did not run as printed. It now quotes the parameter and keeps the stack's other parameters with UsePreviousValue. Still open: removing the JSON policy blocks from DEPLOYMENT_ROLES.md, which a test reads as its baseline.

#701 Bootstrap task replaces an existing bootstrap (2720c9cc)
mise //cdk:bootstrap did nothing and exited 0 on an account with a standard CDK bootstrap, so the execution role kept AdministratorAccess. The task now passes --force and replaces the bootstrap it finds. For operators this is a change. The other CDK apps of that account and Region then deploy through the ABCA policies. Passing -- --no-force cancels the flag, and bgagent setup still leaves a standard bootstrap alone. The issue also allowed failing loudly, but the bootstrap preflight names the bare task as its remedy. Since the review that preflight no longer reports a profile that cannot sign in as an account without a bootstrap (edad1338), and ADR-002 records the choice (f11969bd).

#889 Cedar layer no longer lists Node.js 20 (edba0659)
The Cedar layer still listed nodejs20.x among its compatible runtimes after the engines range stopped admitting Node 20, and the issue left "drop or keep" open. It is dropped. The list is now nodejs22.x and nodejs24.x. Lambda deprecated nodejs20.x on 2026-04-30 and every function of the stacks runs nodejs24.x, so no function changes behaviour. On the next deploy CloudFormation replaces the layer version, and the CedarWasmLayerArn output carries the new ARN. Operators have nothing to do.

#878 Documented why no bootstrap policy grants registry actions (4ced6c7b)
The bootstrap policies grant no agent-registry action although the stack provisions an Agent Registry, and nothing that a search would find said why. DEPLOYMENT_ROLES.md and a comment at RESOURCE_ACTION_MAP now give the rule: for a custom resource the execution role only invokes the provider, whose Lambda makes the AWS calls under its own role. This is the issue's second option. Granting the actions would add privilege that nothing uses. The build now fails when a Custom::* type of the map lists more than lambda:InvokeFunction. No policy changes.

#59 Trace bucket exception names the SessionRole (15985afa)
The AwsSolutions-S1 exception on the trace-artifacts bucket still said "writes confined to runtime IAM role by grantPut", a grant that has not existed since #211. The reason, which cdk-nag copies into the template and the NagReport, now names the per-task SessionRole, whose upload permission is tag-scoped to its own user and task prefixes. The build fails if any other identity policy of the stack, nested stacks included, can put or delete objects in the bucket. No IAM statement and no logical id changes.

#892 Blueprint model IDs validated at synth (f7245e09)
A Blueprint wrote agent.modelId to the RepoTable unchecked, so a bare ID or an ungranted model deployed and every task of that repository failed at turn 0. The construct now checks the value at synth and accepts only <geo>.<model>, with the deployment's geography and a granted model. This tightens what deploys. An ARN, an alias such as haiku or a CDK token also fails cdk synth. The shipped Blueprints pin no model. Also fixed: the issue's other items in platform doctor, inferenceProfileId, test_sdk_smoke.py and the guides.

#89 Latest-SDK and EC23 synth warnings remediated (1409f3a3)
Every synth printed two of the three warnings the issue lists. buildApp now sets the installLatestAwsSdk default to false, so an AwsCustomResource uses the Lambda runtime's SDK instead of installing the latest at deploy time. AwsSolutions-EC23 cannot evaluate the endpoint security groups, whose ingress is the VPC range as an intrinsic. AgentVpc exempts that validation failure only, and the build checks the ingress itself. AwsSolutions-DDB3 was already fixed by #206. On the next deploy each Custom::AWS resource is updated in place and reruns its onUpdate call.

#928 Bootstrap documented as commercial-partition only (ab8f8b40)
No document said that the least-privilege bootstrap policies work in the commercial aws partition only, although the capability catalog lists us-gov-west-1 for the core platform. DEPLOYMENT_ROLES.md now states the limit, and the deployment guide says that a Region listed in the catalog has the required services and that the list says nothing more. Neither text says how a deployment fails in another partition, because that was not tested. Still open: all four acceptance criteria of the issue; the policies themselves are unchanged.

#851 Deployment guide no longer quotes a resource count (ba92b24f)
The deployment guide gave the widest inline combination as 484 resources, a figure nothing ties to the templates. The census measured 482 on main. The sentence now gives no count and names the widest sampled combination: all three backends with every option, on two zones with the default model allowlist. Zones and allowlist are named because the census samples three zones and larger allowlists on single backends only. Nothing is left to build, because #854 and #912 delivered the headroom and guard the issue asks for. The issue and #735 were closed on 2026-11-21.

#111, #702 Teardown advice aligned with the deployment guide (74e81211)
The Quick Start and the /deploy and /setup skills promised that a stack stuck in DELETE_FAILED clears in 20 to 40 minutes, against the deployment guide. They now say the delay is not fixed and can take hours, and lead to the guide's procedure. The developer guide and the README link there too. In the skills, retaining blocked resources changes from "never" to "not on the assistant's own initiative". Still open: the tag schema, sweep script and operations page of #111, and the code changes #702 asks for.

#767 Docs say how to clear a per-repo override (561a86c4)
REPO_ONBOARDING.md said that a redeploy overwrites the RepoConfig record, but an override deleted from a Blueprint keeps its last value. A deleted agent.maxBudgetUsd is still the repo's budget. The design doc now states the lifecycle of the record and why the update is selective. bgagent repo onboard writes the same record, so clearing undeclared attributes would delete an operator's CLI pin. The user guide gains "Removing a per-repo override", with an aws dynamodb update-item command that fails on a mistyped repository name. Documentation only.

#447 Blueprint sets a per-repo memory token budget (cb0da8fa)
Hydration trimmed every task's memory context to a fixed 2000 tokens; the Blueprint prop agent.memoryTokenBudget existed only in the design doc. The construct now writes that prop to the repository's row as memory_token_budget, and hydration trims that repository's memory context to it. A repo-less task has no row and always gets 2000 tokens. Still open: nothing to build; a backfill of existing rows and a per-task override, both named in the issue's list, are declined on purpose, so closing the issue is a maintainer's decision.

#916 IAM5 exception on ECS and MicroVM overflow policies (05132b44)
With a long bedrockModels list, CDK moved statements of the ECS task role and the MicroVM execution role into overflow policies without the AwsSolutions-IAM5 exception, and cdk synth failed. An aspect on each role now gives those policies the base policy's exception. A limit stays. The Bedrock grant is one statement, and from about 37 model ids it exceeds IAM's size limit for a managed policy. That was measured on templates, not tried against IAM. Not done: splitting that grant; the SessionRole case that #916 reports was fixed on main.

CI, hooks, tooling and other documents

#670 /review_prs sketch accepts args as a JSON string (3ceb07aa)
A /review_prs run stopped before any review agent started when args reached the Stage 2 script as a JSON-encoded string. The sketch in .abca/commands/review_prs.md, which each run writes its script from, called args.map(), and a string has no .map. The sketch now parses args when it is a string and uses an array unchanged, and the Stage 2 text tells the script to normalize args first. Nothing else in the file changes.

#329 Gitleaks range scan defaults to HEAD (203e6b68)
With GITLEAKS_RANGE unset or empty, mise run security:secrets:range scanned every ref and failed on findings from other branches: 16 on a developer clone, none in the history of HEAD. The task now falls back to the history of HEAD, the scope of security:secrets. A range that is set reaches gitleaks unchanged, so the per-PR and merge-queue check behaves as before. In security-pr.yml only a comment changes. Still open: one scan task with the scope as a parameter, automatic updates of the pinned scanner versions, and the check:hooks-ci-sync check.

#328 Gitleaks fixture allowlists limited to rule and file (39dec223)
Two allowlist entries in .gitleaks.toml each exempted a test fixture value in every file under every rule. Both now name their rule, generic-api-key, and their one test file, and set condition = "AND", without which gitleaks treats the criteria as alternatives. A new suite fails on a global allowlist that exempts a value without all three. The second #328 entry covers the Yarn flag and docs.yml. Still open: a shorter pre-push hook, semgrep without --config auto, a label for the security suite's issue and the condition in pull-request-lint.yml that can never be true.

#72 Tests for the ephemeral stack cleanup script (b4828c91)
scripts/cleanup-ephemeral-stacks.sh deletes CloudFormation stacks and had no test. A new suite runs the unchanged script against a fake aws on PATH and checks which stacks it deletes, which it leaves alone, and how it fails. It starts the script only when bash resolves aws to that fake. One test ties the fixtures to the stack description in cdk/src/main.ts, the text the script selects by. The forced detach of network interfaces is not covered. Still open: the scheduled cleanup itself, the replacement of that detach, and stack discovery by tag.

#569 Integ log explains the NEW snapshot lines (2616e48a)
No snapshot is committed, so every integ run in CI listed each test as NEW and printed "Tests: 1 failed, 1 total" before the real run, which read as a failed smoke test. The integ task now prints one line ahead of integ-runner that calls those lines expected and points to the deploy-then-verify run under "Test Results". This is the issue's option 1. The runner's command, output and exit code are unchanged. mise prints the command before its output, so the line appears twice. integ.yml gains a comment only.

#260 Type-check commit hooks for cdk, cli and web (876da502)
No commit hook type-checked the TypeScript of cdk, cli or web, so a type error could be committed and was found later, by the build. Three pre-commit hooks, cdk-typecheck, cli-typecheck and web-typecheck, run their package's typecheck task when one of its TypeScript files is staged. Each checks the whole package, in about 9, 5 and 2 seconds, because tsc cannot check one file under its project's settings. Python gets no new hook, since agent-quality already runs ty check. CONTRIBUTING.md gains a section on type checks in the editor.

#793 ADR-026 records the content-screening failure rule (6173c8c0)
How the Jira and Linear webhook processors treat content they cannot screen was written only in three suppression comments. ADR-026 states it: content that specifies the task fails closed, and advisory enrichment that is blocked or cannot be screened is dropped without rejecting the task. The suppressions cite it, and no behaviour changes. It is a new ADR because ADR-009 covers development-time agents, and 026 because open pull requests claim 025. Its advisory list includes a sub-issue's own files in a Linear epic, which the issue does not name, and since the review the context of a Linear agent session (6c101b42).

#818 REGISTRY.md states the 443-only reach of MCP servers (b4e998ae)
REGISTRY.md said nothing about the network an mcp_server asset is reached from. Section 2.1 now says that the agent connects from inside the task's compute session, where the security group of every backend allows outbound TCP 443 only, so an http or sse server on another port is not supported. The issue assumed this of lambda-microvm alone. Of its two options this is the note, not a reachability check. A pin to an unreachable server still resolves. Its other asks are already on main.

#571 Docs say arm64 emulation is lost at reboot (47975105)
On an x86_64 host the image build failed again with exec format error after a reboot, and the /setup and /deploy skills called the emulation registration a one-time step. The Quick Start and both skills now say that it is lost at reboot and that repeating the command is harmless. The text names a reboot only. The issue's Docker daemon restart is disputed by its one comment and was not verified. Still open: a native arm64 builder for the image, which the issue prefers, or a registration that persists.

#131 Weekly expiry warning also reads .trivyignore (bb6be212)
The Security workflow warns 21 days before a scan ignore expires, but it read only the osv-scanner.toml files, so an agent/.trivyignore entry would expire unannounced and the image scan would fail in the pre-push hook. It now reads every tracked .trivyignore too. The repository's four ignores expire on 2026-12-16, so a run of the workflow lists them from 2026-11-25. AGENTS.md now calls accepting a finding a maintainer's decision; no check enforces that. Still open: the issue's own design, which scans without the ignore file, and a check for incomplete entries.

#328 Workflow part: lockfile flag and docs job permissions (55ab8258)
deploy.yml and integ.yml ran yarn install --immutable, a Yarn Berry flag that Yarn 1 silently ignores. They now pass --frozen-lockfile. The build job of docs.yml loses pages: write and id-token: write, and its push filter loses three redundant paths. None of this runs in the pull request's checks. The mise and withastro/action installs stay unfrozen on purpose, against the issue's wording. Still open: a shorter pre-push hook, semgrep without --config auto, a label for the security suite's issue and the condition in pull-request-lint.yml that can never be true.

#278 check:shell lints shell scripts with shellcheck (8b744cc0)
Shell scripts had no linter, although one is copied into the agent image and one deletes CloudFormation stacks. The new task check:shell runs a pinned shellcheck over every *.sh file that git tracks or would add. It runs in the build through drift-prevention, in mise run security and in a commit hook. Errors and warnings fail (--severity=warning), and no existing script had to change. SC2086, which the issue names, is info level and is not enforced. An untracked scratch script with a warning fails the local build.

#891 MISE_EXPERIMENTAL removed from configs, hooks and docs (9b878a92)
Contributors were told to export MISE_EXPERIMENTAL=1 for tasks like mise //cdk:build, and the root mise.toml, workflows, commit hooks and bgagent setup set the flag. Every mise release the repository accepts runs those tasks without it. The setting, the variable and the instructions are removed. A shell that still exports the variable keeps working. Still open: nothing in the repository; the issue asks to see integ and the weekly security run pass without the flag, and both run the workflow file on main, so that comes after the merge.

After the review

Two reviews came in on 2026-11-23. This section says what changed in answer to them, and what three more commits correct that no review named: the sign-in report of the bootstrap preflight (edad1338), the Prompt-Version rows (ddaa6704) and the description of the screening alarm (a4ff8932). The entries above describe the commits of the sweep. Six of them also say what a later commit changed (#635, #686, #701, #793, #794, #850).

main was merged first (112952af), for #1070 and #1076. One file conflicted, cdk/src/stacks/agent.ts, where both sides added an alarm to the same addAlarmActions call. Both alarms are kept. One test of #1076 took the only alarm of the ConcurrencyMaintenance nested stack to be its own. This branch puts the webhook screening alarm into the same nested stack, so that test now picks its alarm by logical id. main was merged a second time (c4bb0c2f) after the first twelve commits below, for #1078, which installs gh in the agent image from its pinned release. Nothing conflicted.

Slack: a link to a page of github.com names no repo (33ac53b5)
A mention with a link such as https://github.com/settings/tokens was submitted for the repo settings/tokens and refused as not onboarded. A link whose first path segment is a page of the site (27 names, none of them an account) now names no repo, so a channel default gets the whole message. A link to a real repo that is not onboarded is still refused. A typed link ends before trailing punctuation.

Two expressions of the handler took quadratic time on long input, on main as well, and are linear now. One reading changes with that. Where a word ended in front of a dot or hyphen, the old pattern began a second word there and the new one reads on. compare lib/utils./other/web#5 went to the channel default and is now submitted for other/web#5.

A failed screening of a Linear agent-session context is counted (6c101b42)
The Linear agent-session path dropped the session context when the guardrail call that screens it failed, without a WebhookScreeningFailed count. The failure is now counted under the source linear-session-context, and the alarm of #794 covers it. ADR-026 lists the session context as a fourth kind of advisory enrichment and says why it skips number 025. Its status is proposed, which the ADR lifecycle asks for while a record's pull request is in review. ATTACHMENTS.md principle 3 names the exception the record makes for a sub-issue's own files.

The forced bootstrap in ADR-002 and two skills (f11969bd)
The deploy and troubleshoot skills of the plugin named mise //cdk:bootstrap without saying that it replaces a bootstrap the account already has. Both say so now, and tell an assistant to ask the user first unless the user has said that no other CDK app deploys there. ADR-002 records that the task forces and why it does not fail on a variant mismatch instead. Two statements of that record called the deploy-time preflight not implemented and are corrected. ADR-023 gets the Last-updated date and the changelog entry of its edit for #916.

A failed sign-in is not reported as "not bootstrapped" (edad1338)
The bootstrap preflight is the first command of mise //cdk:deploy. It reported "not bootstrapped" and named mise //cdk:bootstrap for every AWS CLI error whose text contains "does not exist", and the errors of a profile that cannot sign in contain those words. With --force (#701), running the task after signing in replaces the bootstrap the account has. The script now takes only CloudFormation's own answer for a missing stack. Every other failure stops the deploy as a stack that could not be read, and names no task.

run_task puts the whole environment back (84e335de)
The restore of #635 worked from a list of ten names. The Linear token and the Jira credentials that a task resolves were not on it and stayed in the process environment. run_task now copies the environment when it starts and puts the copy back when it returns or raises, so there is no list to extend. The sweep of older reactions on a Linear issue runs in a thread that can outlive its task. It is given the token it was started with, and that token is masked in what it logs.

The one-task note at the blocker latch, in two lines (f24b6bf3)
The comment that #551 asked for at _LAST_BLOCKER_REASON took four lines. It says the same in two. The latch is not keyed by task id. A process holds more per-task state than this value, so a key on the latch alone would not let two tasks share a process.

Alarm tests, the claim type and the webhook URL comment (9de906d7)
The test that every alarm notifies the alerts topic read the root template only. It reads the nested templates of the default synth too and follows a nested alarm's action through the stack parameter. The two nested stacks that exist only behind a feature switch hold no alarm, and a test fails when one is added there. The test that synthesizes every deployment profile fails on an alarm without an action. The @ts-expect-error guard on jira_preview_claimed is now a type-level assertion. The doc comment of webhookTasksUrl states that the public path has to start with the stage name.

Stack outputs keyed by name (76c92db7)
getStackOutputs returned a tuple in the order of the keys asked for, so a key added without a name at the same place bound every later name to another output. It returns an object keyed by output name. repo show, repo onboard, runtime status and the platform doctor read their outputs by name.

Corrections in the guides and design documents (fade98b7)
The user guide called a task COMPLETED when the agent "determined no changes were needed". The row now says what a completed task delivers, and two paragraphs say that a task expected to open a new pull request ends as FAILED when it changes nothing. OBSERVABILITY.md lists all eleven alarms that notify the OperationalAlerts topic, and the topic has one name in ten places. API_CONTRACT.md lists the 409 WORKSPACE_SLUG_AMBIGUOUS.

The deployment guide gains the two operator notes that were only in this description, on the leftover integ assertion stack and on the in-place update of the Custom::AWS resources. The second note says that it follows from the synthesized template and has not been observed on a deployed stack.

Comments of this pull request shortened or removed (627d5add)
One review measured the comments this pull request adds against a strict rule. Every comment block that the sweep and the nine commits above added or changed was read against its code: 633 blocks in 150 files, the workflow files left out. 210 are deleted and 156 are shortened or reworded, most of them to one or two lines. 267 stay as they were: license headers, comments a tool reads, documentation of exported symbols, and short comments about something the code cannot show.

No code changes. For each of the 115 changed files the code tokens, the Python syntax trees and the lines of code are the same before and after, and every line that is removed or rewritten is one this pull request added. The result was read a second time for facts that went with a comment. Five were put back then, and a sixth when the replies to the reviews were checked.

Long passages restructured (a66a9ab3)
The same review found passages too long to follow, em dashes and figures of speech. Eleven passages that the sweep wrote are split by subject or turned into steps, and no statement is added or dropped. Among them are the manual fallback for an ambiguous Linear workspace slug and the paragraph on the merged .mcp.json. Three figures of speech in the documents read literally now. The two in ADR-026 were replaced in 6c101b42.

Of the 38 added Markdown lines with an em dash, 24 carry a dash that main has, 11 are rows in the form of their list on main and one quotes a marker line the code writes. The two in running prose are rewritten. One sentence of the agent's system prompt loses two dashes and keeps every word.

What the Prompt-Version trailer is (ddaa6704)
Two tables that the sweep added called the trailer a hash of the system prompt. The orchestrator computes it from the constant system_prompt_v1 and the Blueprint's system prompt overrides, and the text of the prompt is not an input. Both tables say so now. The behaviour itself is on main and is not changed.

The screening alarm's description names the session context (a4ff8932)
Since 6c101b42 the alarm of #794 also fires when the guardrail call that screens the context of a Linear agent session fails. Its description still named comments and project documents only. It now names the session context too, in the words of the alarm's row in OBSERVABILITY.md. The alarm's metric, threshold and action are as before.

Known limits

Open pull requests that change the same files

On 2026-11-21, 19 of the 25 open pull requests change a file that this branch changes. Each was merged with this branch in a scratch clone to see what conflicts:

#374 and #988 still set MISE_EXPERIMENTAL. That keeps working, and the lines can go when those branches are rebased. The script that #988 adds passes the new shellcheck gate.

These trial merges were not repeated after the review.

How it was checked

On the branch as pushed (the 65 commits of the sweep, main at b2c2d290 merged, thirteen commits after the review), on one development machine:

  • mise run build with MISE_EXPERIMENTAL unset passes and leaves the tree unchanged. cdk: 9,546 tests passed, 42 skipped. Agent: 3,275 passed, 11 skipped. CLI: 1,639 passed. Web: 555 passed. The docs build, the link check, the drift checks, the shellcheck task, lint and the type checks pass.
  • gitleaks over the history of the head and over the commits of the branch (security:secrets, security:secrets:range): no leak.
  • The silent-success-masking scan passes, over the whole tree and for the range (security:sast:masking, security:sast:masking:range). The branch adds no nosemgrep suppression. There are 75 before and after.
  • The Semgrep registry packs, over the tree and for findings the branch adds (security:sast, security:sast:range): no finding.
  • security:deps, security:grype and security:retire pass.
  • zizmor over .github (security:gh-actions), shellcheck (check:shell) and Bandit over the agent at high severity, the level of its task: no finding.
  • The first 58 commits of the sweep were made through the repository's commit hooks, then replayed onto a newer main and amended there without the hooks running again one by one. The seven that followed, the two merges of main and the thirteen commits after the review were committed through the hooks.
  • The comment commit (627d5add) was checked on its own. For each of its 115 files the code tokens (TypeScript, JavaScript), the syntax tree (Python) and the lines of code are the same as before it.

By a reviewer, on the reviewed head (9b878a92), which does not hold the commits after the review:

Not done:

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

bgagent added 30 commits November 20, 2026 22:19
is_verify_command_inert tells a build or lint command that could not
run from one that ran and failed. Of the ways mise words a task that
does not exist, it knew "no tasks defined" and "task not found:". The
wording depends on what else the repository defines. Where there is no
task at all and the name resembles one of mise's own commands (`lint`
does, `build` does not), mise says "unknown command: lint"; where other
tasks exist, it says "no task <name> found". Both were read as a failed
run. A repository without a mise lint task got a red lint baseline and
lint_passed=false on every task. A repository with mise tasks but no
`build` task got no warning that build-regression gating is off, and
build_passed=false on its tasks, which the platform takes for a failed
build in its reply to an iteration and in the release of dependent
sub-issues.

The detector accepts both wordings on mise's own error line, as it does
for "not found" since #1052. Elsewhere in the log the words are no
signal: pip says "unknown command" inside a task that ran, and mise
warns "no task <name> found, but a non-executable file exists" before
it makes that file executable and runs it. The task name is matched as
one word, so the search stays linear in the length of a line of build
output.

For a repository that configures no command and has no such mise task,
setup records the gate as inert, and the existing inert paths apply; no
message text changes. The two INERT notes reach the agent under "Setup
results" in its prompt. Lint is not run again after the agent and is
stored as passed. The post-agent gate classifies the same output as a
command that could not run, as it does for the other missing-task
signals, and no build result is stored, which the platform does not
take for a failure.

A pull request that the platform opens carries the gating-off warning
and "NOT RUN" for the build. One that exists already gets neither from
the platform, which leaves its description as it is: that is the case
when the agent opened it itself, as its prompt tells it to. The issue
expects the warning there as well; this change does not add it.

The tests feed the detector the verbatim output of mise 2026.8.4 (the
issue's) and 2026.11.6 (the version the agent image pins), and run
setup_repo for both repository shapes.

Refs #749
The Stage-2 Workflow sketch of /review_prs iterates the PR descriptors
with args.map(). When args reaches the script as a JSON-encoded string
instead of the array, a string has no .map and the script throws before
any review agent spawns. The sketch is regenerated on every run, so
every run can hit this again.

The sketch parses args when it is a string and iterates the result; an
array is used unchanged. The Stage-2 bullet that tells the script to
read args says that the script must normalize it first, and why. No
other line changes: the sketch stays an illustrative sketch.

Closes #670
The egress detector reads the result of every tool call. When a
failed-connection signature named a host, it wrote the agent_blocked
event and also latched BLOCKED[egress_denied] as the terminal reason,
whichever tool had returned the text. A Read or a Grep of a log that
quotes "Could not resolve host: foo.com" was enough: when the task
later failed without a reason of its own, for example at the build
gate, it was reported as an egress denial, with the remedy to
allowlist a host it had never called.

The detector sets the latch only from the two results in which a
failed connection of the task itself shows: the output of a Bash
command, and the error of a WebFetch call that failed. Bash and
WebFetch are the two built-in tools through which a task opens
outbound connections. A fetch that completed has reached its host,
and what it returns is the page: content, like a file. In the pinned
CLI a fetch that cannot connect is a failed call. MCP tools are left
out on purpose: their result is text handed on from a server. Repo
setup and the fail-closed policy path set the latch as before.

The issue offers to gate the detection or the latch. This gates the
latch only, so the live agent_blocked event is still written for
every tool.

What changes for an operator: a failed task whose only egress signal
came from another tool, or from a fetched page, ends with its own
reason instead of the non-retryable egress verdict. In return, a
blocked connection that only such a result shows no longer becomes
the terminal reason; the event still names the host. In the pinned
CLI that is the case for a command that runs in the background, or
is moved there at its timeout: its output goes to a file, and a
failure that the task sees only by reading that file with the Read
tool is not latched.

The comment at the latch states what it depends on: a process runs
one task at a time, which holds because every task gets its own
compute session. Before the execution model lets tasks share a
process, the latch has to be keyed by task id.

Item 3 of the issue (no live producer for the auth_failure remedy of
a resource that is not an ARN) asks for no action.

Closes #551
When `mise //cdk:deploy` fails before CloudFormation starts, `bgagent
setup` lists the last error-looking lines of the output under "Cause".
mise ends a failed task with `[<task>] ERROR task failed`, which reads
as an error, while the bootstrap preflight's `bootstrap preflight:
FAIL: ...` matched none of the words searched for. The Cause was
mise's line alone, and the real message was only in setup-deploy.log.

A line that contains `fail` in any letter case counts as an error
line. That covers the preflight's `FAIL:` and the `[N%] fail: ...`
reason the CDK prints when an asset build or publish fails, which
stayed hidden behind `Failed to publish asset`. mise's closing line is
never listed, also when no line looks like an error and the last
lines of the output are shown instead: it names the task, not the
cause.

The helper is shared, so the screens of a failed `cdk diff` and of a
failed account preparation change the same way. A screen that listed
fewer than three error lines beside mise's line shows one earlier
line in its place.

The standard-bootstrap failure the issue was opened for is fixed
since #973; this is the remainder its comment narrows it to.

Closes #1020
cli/eslint.config.mjs switched license-header/header off for
src/bin/**, so cli/src/bin/bgagent.ts, the one file of the package
that starts with a shebang, could lose or change its header and lint
would still pass.

The override worked around the parser, not the rule. The rule accepts
a shebang above the header, but it looks for the shebang among the
comments, and only the text ESLint hands the parser has it as one.
Started from the command line without --fix, @typescript-eslint/parser
infers a single run and takes each syntax tree from the file on disk
instead, where the header looks misplaced. With the override gone and
nothing else changed, `mise //cli:eslint:check` fails with
"Superfluous new lines before license header" while the --fix lint of
the build passes.

Remove the override and set disallowAutomaticSingleRunInference, so
the check-only lint parses the text the --fix lint parses. A shebang
file is reported when its header is missing, altered or not exactly
one blank line below the shebang, and --fix puts the header back and
keeps the shebang. bgagent.ts already has that layout and is not
changed.

The option turns off the parser's single-run shortcut for the cli
check-only lint; the --fix lint never used it. The run takes about as
long as before: the difference stays within a few tenths of a second.

Two tests in cli/test/eslint-config.test.ts: a table of shebang
snippets linted as src/bin/a.ts, and a run of the check-only command
line on src/bin. The second is what lets CI see a missing parser
option, because the build lints with --fix.

Closes #172
`security:secrets:range` gave gitleaks an empty --log-opts when
GITLEAKS_RANGE was unset or empty. gitleaks does not read that as "no
range": it walks every ref of the clone, so the task failed on what
other branches hold. Measured on a developer clone: 2900 commits and
16 findings, none of them in the history of HEAD, where the sweep
scans 362 commits and finds nothing. The fallback was written in #330,
when the sweep itself was a bare `gitleaks git .`; #728 moved the
sweep to HEAD and the fallback stayed behind.

Without a range the task scans the history of HEAD, the scope of
`security:secrets`. A range that is set reaches gitleaks unchanged, so
the per-PR and merge-queue check behaves as before, and
GITLEAKS_RANGE=--all still scans every ref for whoever asks. The
default is not origin/main..HEAD: on main that range is empty, and
where origin/main is missing gitleaks scans nothing and exits 0.

New tests in cdk/test/scripts/mise-tasks.test.ts run the three
gitleaks commands with a shell function in place of the binary. They
hold the default for an unset and for an empty variable, the
pass-through of a range, and the same rule file, redaction and output
flags in the sweep, the range scan and the staged scan.

The comment on the merge-queue range in
.github/workflows/security-pr.yml follows: without a range the task
scans the history of HEAD, and it is gitleaks itself that walks every
ref when it is given an empty range.

Refs #329
integ-runner deploys two stacks per run: the stack under test and a
second one that holds the assertions. Only the first took its name from
INTEG_STACK_NAME (`int-<sha>-<run>` in CI). IntegTest named the second
after its construct path, TaskApiSmokeDefaultTestDeployAssert413BE3D6,
so every CI run, and a local run in the same account and region,
created, updated and deleted that one stack. Integ runs are keyed per
pull request since #1047, on the ground that stack names are
run-unique: two approved runs can be in the account at the same time,
and a copy left behind by a cancelled run is what the next run meets.

The app passes IntegTest an assertion stack of its own, named
`<stack name>-assert`: `int-<sha>-<run>-assert` in CI, which keeps the
`int-` prefix that marks a stack as ephemeral, and
`backgroundagent-integ-local-assert` on the local path. The template of
the stack under test does not change, and the assertion stack holds the
same resources and outputs.

A unit test synthesizes the app in a child process, as integ-runner
does, and checks that the cloud assembly holds exactly the two stacks
named after the run, with and without INTEG_STACK_NAME. It needs no AWS
access.

Only an approved integ run can prove the deploy and the destroy of the
renamed stack on AWS. A stack named
TaskApiSmokeDefaultTestDeployAssert413BE3D6 that an earlier run left in
an account is not picked up by later runs: delete it once by hand.

The issue stays open for the offline `cdk diff` for the approver and
for a teardown that does not fail the run.

Refs #400
The agent checks the ARN values of a MicroVM platform_config block
against two constants read from contracts/constants.json: the keys to
check (arn_keys) and the key that anchors them (account_anchor_key).
The constants drift gate owned neither, so a literal re-declaration of
either under agent/src passed check:constants-sync and would have
stopped following the contract.

Both names are in OWNED_PYTHON_NAMES, with their value-parity rows in
agent/tests/test_constants_parity.py (the gate refuses an owned name
that test does not compare). An assignment to either that is not a
plain read of its contract key fails the gate; the gate reports 17
Python names instead of 15.

Thirteen comments and docstrings contradicted the code. They state
the facts instead: the Region is not compared because the execution
role's Secrets Manager grants are Region-scoped, not account-scoped;
a boto3 session frozen into a snapshot carries the build role's
credentials, not its region; the build role has a Logs grant, scoped
to /aws/lambda-microvms/*; and ECS is left out of the heartbeat check
as a hard constraint, not a preference. Three of them said that the
agent writes its heartbeat every 45 s on every compute backend (the
doc comment of agent_heartbeat_at in the API types and its CLI mirror,
and a test comment): on ECS it is written once at start, as
API_CONTRACT.md says. No runtime behaviour changes.

Refs #817
The defect of #683, the v1 call shape against pdf-parse v2, was fixed
by #695, which also made the mock a PDFParse class. One ask of the
issue stayed open: a test with a real PDF, so that a later API
mismatch fails loudly. The mocked suite cannot give that. It proves
that the code matches the mock, not that the mock matches the
package.

The new test runs the real screenTextFile with the installed
pdf-parse on PDFs built in memory. Only the guardrail call is a stub.
The text of every page of a two-page PDF has to reach the guardrail,
and a 51-page PDF has to be refused by the page limit. Against the
source as it was before #695, both tests fail with "TypeError:
pdfParseFn is not a function".

The screening runs in a child process, on an esbuild bundle in the
shape of a Lambda bundle (CommonJS, pdf-parse left in node_modules),
because under Jest pdfjs cannot import() its ES module worker. Two
comments of the mocked suite said that real extraction is validated
on the live deploy. They name the new test instead.

No production code changes. The cdk suite gains about one second.

Closes #683
On an x86_64 host the arm64 agent image builds only under QEMU
emulation. The Quick Start and the /setup and /deploy skills tell the
deployer to register it with `docker run --privileged --rm
tonistiigi/binfmt --install arm64`, and all three presented that as a
one-time step. The registration is kernel state (binfmt_misc), not a
setting saved on disk, so it is gone after a reboot, and stopping and
starting a cloud dev box is a reboot. A host that deployed before then
fails again with `exec /bin/sh: exec format error`, and no document
said why.

The Step 3 caution and the "Common errors" row of the Quick Start
state the lifetime and the remedy: run the command again, which is
harmless to repeat because the tool leaves an existing handler as it
is. They offer a native arm64 host to readers who would rather not
register after every reboot. The /setup skill no longer says
"One-Time" or "once per host", the /deploy skill no longer says
"once", and both tell the agent to run the command again after a
restart. That is the command the skills already run, not a new one.

The text names a reboot only. The issue also names a Docker daemon
restart and proposes distribution packages for a persistent
registration; its only comment disputes both and neither could be
verified here, so neither is documented. The structural fix the issue
prefers, building the image on a native ARM64 builder, stays open.

Refs #571
The two warnings the issue names (ts-jest TS151002 and
GrantOnPrincipalOptions#scope) no longer appear, but the build of main
prints the same class of notice at five other sites. Each of them
becomes a break when the deprecated API is removed.

- TaskOrchestrator created its `live` alias with Version#addAlias. It
  constructs the Alias itself, under the same scope (the current
  version) and id, so the alias keeps the logical ID that deployed
  stacks hold. Function#addAlias, the other replacement the notice
  names, would move it to a new logical ID, and CloudFormation would
  try to create a second alias named `live` before it deletes the
  first. A test pins the logical ID.
- EcsAgentCluster passes containerInsightsV2: ENABLED instead of
  containerInsights: true. The cluster setting is the same, and the
  AwsSolutions-ECS4 suppression reason names the prop in use.
- Two test fixtures: Stack#addStackDependency instead of
  addDependency, its former name, and a nodejs24.x function instead of
  a nodejs20.x one, which CloudFormation Validate reports as
  deprecated.
- The docs site hands its remark plugins to
  `markdown.processor: unified({...})`. Astro 7 builds that processor
  from the legacy `markdown.remarkPlugins` key and warns.

No behaviour changes. The synthesized templates are byte-identical
except for one cdk-nag metadata string on the ECS cluster (the
suppression reason), and the built docs site is byte-identical.

The process the issue proposes, capturing the warnings of the build or
failing it on new ones, is not part of this change.

Refs #192
The Jira and Linear webhook processors drop advisory enrichment that
is blocked or cannot be screened (recent comments, Linear project
documents, a sub-issue's own files in a Linear epic) and do not
reject the task for it, while content that specifies the task fails
closed. That rule was written out in three suppression comments and
in no document, although vision tenet 4 asks for an ADR where a path
degrades.

ADR-026 states the rule and its threat model once, with its
requirements in EARS form as ADR-020 asks. SECURITY.md links it and
the three suppressions cite it. No behaviour changes.

The issue speaks of about four call sites. The triage it quotes
counts a fourth site that was already suppressed, and the only one
of that kind is the fallback for a failed comment fetch in
jira-attachments.ts. A failed fetch is no screening decision, so it
is outside the record and that suppression keeps its own reason.

A new ADR instead of a section in ADR-009: ADR-009 covers
development-time agents and is still proposed. ADR-025 is claimed by
two open pull requests, hence 026. Its status is accepted: the
behaviour it records has shipped. The record lists a sub-issue's own
files as a third advisory kind that the issue does not name, because
the code drops them the same way, and names that path as an exception
to the principle that attachments are never silently dropped.

Closes #793
POST /v1/webhooks returned the webhook id and the one-time secret but
not the URL the external system has to post to. A caller had to know
the route (/webhooks/tasks), find the API URL in the CLI config and
join the two by hand, once per environment.

The 201 response carries webhook_url. The handler builds it from the
host and stage the request came in on: API Gateway serves every route
of the API there, so no template, IAM or table change is needed. The
URL belongs to the API deployment, not to the webhook, so every
webhook gets the same one and the list and revoke responses do not
repeat it. The Host header is read in any letter case. A request
without one gets a 500 before the secret or the table item is
created, rather than a malformed URL; API Gateway always sends the
header.

bgagent webhook create prints the URL and a one-line hint between
"Created:" and the secret, which stays the last line. --output json
passes the field through, and --help says the URL is the same for
every webhook and need not be fetched again. Against an API deployed
before this change the text output is unchanged and the JSON has no
webhook_url until that stack is deployed again.

With a custom domain the URL is right when the API is mapped under
the stage name (/v1), the form the API contract documents.

Closes #57
The stack deploys its CloudWatch alarms and one SNS topic for them
(OperationalAlerts). The alarms published to the topic, except the two
Lambda error alarms: the orchestrator's OrchestratorErrorAlarm
and the screenshot processor's WebhookProcessorErrorAlarm changed
state without telling anyone, so a failing orchestrator was visible
only to someone already watching the CloudWatch console.

Pass both to operationalAlerts.addAlarmActions, next to the alarms
that were already there. Every alarm of the root stack is in that one
call, and a stack test fails on any alarm of the stack's default
template that does not list the topic. An alarm in a nested stack, or
one that only a non-default feature deploys, is outside that test.

For operators: a subscriber of the topic receives two more kinds of
notification, on the transition into ALARM only. The orchestrator
alarm needs 3 or more errors in each of two consecutive 5-minute
periods; the screenshot processor alarm needs one error in a 5-minute
period, and a fault that also exhausts the async retries notifies
twice (Errors, then DLQ depth). With no subscriber, the default,
nothing is delivered.

The deploy updates the two alarms in place and changes the description
of the OperationalAlertsTopicArn output. No resource is added or
replaced, and the topic and key policies already admit every alarm of
the account and Region.

Docs: OBSERVABILITY.md says which alarms notify and how to subscribe,
the screenshots guide says its two alarms notify, and the stack-output
table describes the topic as it is.

Closes #686
A GitHub link in a mention was read as slash words: the host and the
first path segment became the repo. Without a channel default,
"@shoof fix https://github.com/org/repo/issues/42" was refused with
"Repository 'github.com/org' is not onboarded"; with a default the
task started on the default, without the issue.

The command processor reads a link whole, in the three forms it can
arrive in: <url> and <url|label> as Slack delivers them, and bare
text. A GitHub link to a repo, an issue or a pull request names
owner/repo and carries the number as issue_number. It counts like
owner/repo#42: the first such reference of the message decides, it
wins over the channel default without a RepoTable read, and a linked
repo that is not onboarded gets the "not onboarded" answer instead of
a task on the default. A clone address (.../repo.git) names the repo
without the suffix. Any other link names no repo and none of its
parts is read as word/word: another site, gist.github.com included,
or a file, a branch or a workflow run on GitHub. The link that named
the repo leaves the description as the word does, label included. A
message without a link is read as before.

What users of a channel with a default repo will notice, and anyone
who names an onboarded repo after a link: the first GitHub repo,
issue or pull request link decides wherever it stands, also inside
pasted output or a diff. The task starts on the linked repo when that
one is onboarded and is refused with "Repository '<linked>' is not
onboarded" when it is not. These started on acme/api and are refused:

- default acme/api, a pasted log line "npm ERR! see
  npm/cli#4828 for details";
- default acme/api, a pasted diff that holds
  "url: https://github.com/old/charts";
- "bump flask, see <pallets/flask#5000> in
  acme/api".

The guide gives the way out: write the onboarded repo the task is for
before the link. Treating a link as certain, like owner/repo#42, is
the choice made here. Reading it as certain only when its repo is
onboarded would leave those three messages as they were, and would
start a task on the default when the linked repo is not onboarded.

Known limits:

- A typed repo link that Slack did not wrap (in a code span) is not
  recognised when a backtick or a closing parenthesis follows it, and
  is read with a full stop that follows it.
- A label the user wrote on the link is dropped with the link.
- A link into an issue or pull request (a comment, the files tab)
  gives the number; the place it pointed to is not passed on.
- When owner/repo stands as a word before its own issue link, the
  word decides and the number is not carried. A repo link before
  owner/repo#N of the same repo wins, and the number stays in the
  description.
- A GitHub address of two path segments that is no repo
  (/settings/tokens) is read as one and refused.

Closes #850
DELETE /v1/linear/workspaces/{slug} found the workspace with a filtered
scan that stopped at the first active match. When more than one active
registry row carried the slug, it removed whichever row the scan read
first and answered 200, while the other rows stayed active. When
different admins had installed the rows, the answer was 403 or 200
depending on the order of the table.

The scan reads to the end of the registry, within MAX_SCAN_PAGES, and
collects every match. More than one active row for the slug is refused
with 409 WORKSPACE_SLUG_AMBIGUOUS: nothing is written and no secret is
deleted, with or without purge=true, and the message names the
linear_workspace_id of each of those rows. The CLI prints the message
and the code as it does for any API error, so it does not change, and
neither does the success response.

For review:
- The 409 comes after the admin check. A caller who installed none of
  the rows gets the 403 that a single row gives, without the ids; the
  admin of any of the rows gets the 409.
- The caller's own row is not removed alone, because the rows share
  the secret that the slug names.
- Only active rows count. With no active row for the slug, the revoked
  row read first is removed, as it was.
- A scan that reaches the page cap with pages left answers 500 also
  when it has read an active row: the unread pages can hold a second
  one. The registry holds one row per workspace, far below the cap.
- The endpoint takes no linear_workspace_id parameter, which the issue
  leaves open. The Linear setup guide documents the code and how to
  resolve it by revoking a row by id, and the message of the 409
  refers the operator to it.

Closes #883
The registry loader writes the resolved mcp_server config, which may
hold secrets, into the clone's .mcp.json and then has git leave that
file out of commits. In two cases the config could still reach a
commit, and with it the pull request:

- The repository commits .mcp.json as a symlink. The write followed
  the link, so the config landed in the link's target, a file the
  commit guard does not cover.
- The guard did not take. When `git update-index --skip-worktree`
  failed (index.lock held, unmerged index entry) or a git call raised,
  the loader logged a warning and went on to report a successful load.

apply_mcp_assets now raises RegistryAssetLoadError in both cases, so
the task fails before the agent starts and nothing is committed:

- A symlinked .mcp.json is refused before it is read or written (the
  check the issue proposes, not O_NOFOLLOW: the error names the cause,
  and nothing is read through the link either).
- The guard no longer trusts the exit code of update-index. It reads
  the flag back with `git ls-files -v` and raises when the flag is not
  set, or when a git call fails or times out. Only skip-worktree
  counts; an entry that is merely assume-unchanged does not. A
  .mcp.json that the repository tracks, or that its .gitignore
  re-includes, in a clone with sparse checkout enabled ends in the
  same refusal, and so does a directory outside a repository.

Either mechanism of the guard (the clone's exclude file, or
skip-worktree) also keeps the agent's own edits of .mcp.json out of
its commits, and git names a .gitignore file or a sparse-checkout
definition as the cause. The loader now logs one TASK line that names
the file as platform-managed for the task, and switches off git's
advice for the skip-worktree refusal as it already does for the
ignored file. The edits themselves are still left out: #760 stays
open for the redesign that lifts that limit.

For operators: a task whose Blueprint pins a registry mcp_server now
fails at start where it used to run, when .mcp.json is a symlink, or,
where the repository tracks .mcp.json or its .gitignore re-includes
it, when index.lock is held, the entry has an unresolved merge
conflict, or sparse checkout is enabled in the clone. Where the
clone's exclude file keeps the file out (the repository has no
.mcp.json and does not re-include it), no index entry is needed and
the last three do not fail the task. docs/design/REGISTRY.md describes
the guard and these failures.

Tests that used a plain directory as the clone now run in a git
repository, as a task does (test_registry_loader.py, and the
agent_step fixture of test_pipeline.py).

Closes #758
Closes #759
Refs #760
The deploy job of deploy.yml runs `npx cdk deploy` on the assembly that
build.yml synthesized, so the pipeline does nothing of what
`mise //cdk:deploy` does before it deploys unless the workflow has a
step of its own. Nothing at the task said so, and nothing failed when
the task gained a step: the bootstrap preflight that #976 made its
first command has no counterpart in the pipeline.

The comment on [tasks.deploy] says that the pipeline does not run the
task, and what the pipeline does instead for each entry in front of
`cdk deploy`. test/scripts/deploy-workflow.test.ts holds the task to a
table of its dependencies and commands, each with its step in
deploy.yml or with none.

The test fails when an entry of the task is added, removed, moved or
changed and the table does not follow. A command is compared whole,
with the argument template that ends it, because mise also runs a
default written in the template and whatever follows it. The test
fails as well when the task holds anything it does not read: another
key, a string that is not double-quoted, or a sub-table, whose header
it recognises with or without indentation, spaces and quoted keys.

It fails when a recorded step is no longer in the workflow: the
log-delivery check with --check-only in the diff job, and
`npx cdk deploy --app cdk/cdk.out` in the deploy job. And it fails
when a step of the workflow runs a preflight that the table does not
record for it. The bootstrap preflight is recorded as not run by the
pipeline, so the test holds that until the step is recorded; whether
deploy.yml gets that step is left to #127.

test/scripts/preflight-bootstrap.test.ts runs the bootstrap preflight
as the task does, as a subprocess with a fake `aws`. Its exit code is
what keeps `cdk deploy` from starting, and no test ran the script. The
suite pins exit 0 on PASS and WARN, exit 1 on FAIL and on a state the
script cannot read, the --json output, the one DescribeStacks call
with --profile and --region, and the compute backends read from the
context arguments and from cdk.json, where the last argument wins. It
also pins the bypass: ABCA_SKIP_BOOTSTRAP_PREFLIGHT=1 lets the deploy
start without a call to AWS, and the check runs when the variable is
not set or has another value.

No behaviour changes: the edit of cdk/mise.toml is comments only. Two
sentences of the same comment called the log-delivery preflight the
first command of the task; the bootstrap preflight is.

Refs #843
Refs #127
The least-privilege bootstrap shipped without the documentation that
issue #128 lists. The root AGENTS.md did not mention bootstrap, the
command list of cdk/AGENTS.md had none of the three tasks and the file
had no entry for cdk/bootstrap/, and the deployment guide had no section
on bootstrapping, although the preflight's failure message sends
operators to that guide.

AGENTS.md routes bootstrap-policy and preflight changes to
cdk/src/bootstrap/ and names what moves with them: the generated
artifacts, the golden JSON in DEPLOYMENT_ROLES.md, the hash snapshot and
the bundle version the CLI requires. cdk/AGENTS.md lists the three
tasks, both directories and the scripts the tasks run, and the mistake
of editing an artifact by hand, with the tests that catch it.

The deployment guide gains "Bootstrap with least-privilege": an account
with no bootstrap, the ComputeTypes parameter, an account that already
has a bootstrap, and the preflight with a remedy for each result. It
says what the preflight leaves unchecked: a compute backend that only a
deployment profile selects. Replacing a standard CDK bootstrap is shown
with --force, because the CDK CLI otherwise changes nothing and exits 0
(#701); the setup section gives the same command. The section says what
the replacement means for the other CDK apps of the account and Region,
and that --force also lets the CLI downgrade a newer CDK bootstrap
version. It explains the "Using default execution policy of
...AdministratorAccess" line the CLI prints during a bootstrap: that
line describes the standard template, not this one.

DEPLOYMENT_ROLES.md gains "Versioning": the three CDKToolkit outputs,
where each comes from and what it answers. They describe the template
that was deployed, not what is attached to the execution role, and the
section says so. The preflight table moves from there to the guide.

The command in DEPLOYMENT_ROLES.md that sets ComputeTypes did not run
as printed: its value was unquoted, so the shell removed the backslash
that escapes the comma, and the AWS CLI rejected the value as a list.
With the escaping repaired it named only ComputeTypes, and
CloudFormation sets every parameter that an update leaves out to its
template default. The block now quotes the parameter, reads the names
of the stack's other parameters and names each with UsePreviousValue,
which is the update `bgagent setup` makes. It sends the update only
when it could read them, so that a read that fails, for example
because --profile was given to the update alone, cannot leave an
update that names ComputeTypes alone. The comment in that block loses
its backticks: pasted into a zsh that does not treat # as a comment at
the prompt, the macOS default, the block ran `cdk bootstrap` from
them. The Lambda MicroVMs section of the guide passed --parameters to
`aws cloudformation deploy`, which has no such option; that step links
to the new section instead.

The comment above the bootstrap task in cdk/mise.toml carried a third
copy of the old command, and the task's description sends operators
there. It points to the section of DEPLOYMENT_ROLES.md instead.

The JSON policy blocks of DEPLOYMENT_ROLES.md stay. They are the
baseline that cdk/test/bootstrap/golden-baseline.test.ts reads by
position, so the issue's request to remove them is not met.

Refs #128
Of the events the runner writes, only tool results were screened. The
model's thinking and text, the input of a tool call and the text of an
exception that ends the session went into the task's events as they
were, and from there to `bgagent watch`, the web console and the Slack
notice of an agent error.

The runner screens each of these texts the way it screens a tool
result, and before the progress writer cuts it to a preview: what the
output scanner or the redaction of log lines takes for a credential is
replaced by a marker. The text of a session error is screened once,
for the event and for the task's error message, which the failure
notice quotes.

A tool input is recorded as the repr of a dict. Its strings are
screened first, because a repr escapes the quotes, tabs and newlines
the patterns rely on. The repr as a whole then passes the scanner
only, for a secret that only a key and its value show together: the
log redaction replaces up to the next blank, which in a repr takes
the quote and the comma that close an argument, and the web console
reads the arguments back from that text. Tool results go through the
same helper. A string result is recorded as before; a result that is
a list of content blocks keeps what stands between a marker and the
next blank, as a string result does.

For operators: these previews show what tool-result previews and log
lines already show, false positives included. In a path or identifier
that contains `ghs_`, `ghp_`, `gho_`, `ghu_` or `ghr_` followed by
word characters, the rest of the word reads `***`
(`docs/walkthroughs_intro.md` becomes `docs/walkthroughs_***`), and
so does the value after `Authorization: Bearer` or `Authorization:
token`, a variable reference included. An input in which nothing is
found is recorded exactly as before. Event types and field names do
not change.

One part of #225. The policy per entity type, the audit record, PII
detection and the gate on pull-request content stay open.

Refs #225
Two global allowlists in .gitleaks.toml exempted a test fixture by
stopword alone: the Slack signing secret of slack-verify.test.ts and
the idempotency key of orchestration-release.test.ts. With no `paths`,
no `targetRules` and no condition, each value passed the secret scan in
every file and under every rule, so a copy of either one outside its
test was not reported.

Each entry now names its rule (generic-api-key, the only rule that
reports the fixture) and its one test file, and sets
`condition = "AND"`. Without the condition gitleaks ORs the criteria:
the value would still be allowed everywhere, and every finding of the
rule would be allowed in the listed file. The history of HEAD still
scans clean. Either value in another file is reported, and so is a
secret in the two test files that does not contain the fixture value.

A comment above the entries states the convention, and the new suite
cdk/test/scripts/gitleaks-config.test.ts holds it: every global
allowlist lists its files in patterns anchored at both ends, and one
that exempts a value or a commit also names its rule and requires every
criterion. No JavaScript workspace declares a TOML parser, so the suite
reads the file as text and fails on a line in any other TOML form than
the one the file uses: gitleaks reads those forms too, and names in any
letter case, so an entry written that way would go unread. The file as
it is would pass a looser reading as well, so a second block gives the
same reading small configs that it has to refuse.

When a listed file moves, its old path has to stay in `paths` next to
the new one: the history scan reads each commit under the paths of its
time.

Refs #328
scripts/cleanup-ephemeral-stacks.sh deletes CloudFormation stacks and
had no test: nothing held which stacks it selects, which it leaves
alone, or how it fails.

The suite runs the real script with a fake `aws` on PATH that answers
from a fixture and logs every call. The script deletes whatever its
`aws` reaches, so the suite starts it only when a bash that is started
the same way resolves `aws` to that fake. Where it does not, the tests
fail with that reason and the script is not run; one test holds that.

The suite holds that:

- an ABCA stack older than the default 48 hours is deleted, with or
  without the solution id in its description, and one in DELETE_FAILED
  is deleted again;
- the listing asks for the stacks that are complete, rolled back or
  failed to delete, and for no other state;
- a stack with termination protection, a younger stack, one whose
  creation time cannot be read and one that is in progress when it is
  described are left alone, each with its reason printed and counted;
- a stack of another application, the network stack of the same
  application and a stack without a description are left alone;
- of a stack that is left alone only the description is read, and a
  dry run stops once it has described the stack;
- --prefix limits the sweep, --max-age-hours replaces the default max
  age and --region is the region of every call;
- a refused deletion does not end the run, and its error is shown;
- a failing list-stacks and a failing identity call end the run with
  exit 1, and an unknown option or an invalid --max-age-hours is
  rejected before any AWS call.

One test reads cdk/src/main.ts: it fails when the application stack
gets another description than the one in the fixtures, which is the
text the script selects by.

Left out on purpose: the forced detach of network interfaces, which
issue #72 records as unable to release the interfaces AgentCore holds
and due to be replaced, and the exit code after a refused deletion,
which depends on that replacement. Not held either: --max-age-hours 0,
a stack that cannot be described, whether a stack with another
description is counted, and MAX_AGE_HOURS and AWS_DEFAULT_REGION read
from the environment, which the suite empties.

The script is unchanged, so every test passes before and after this
commit. Each test was seen to fail against a copy of the script, of
main.ts or of the suite's own start-up check with the line it guards
changed. The fake starts node for every `aws` call, 93 times in a run,
which is where the run time goes: 8 to 19 seconds on a development
laptop, depending on its load.

Refs #72
agent/src/ua.py, cdk/src/handlers/shared/ua.ts and cli/src/ua.ts must
sanitize a label identically (AGENTS.md, #319), and the vectors of
contracts/ua-vectors.json hold them to it. One case had no vector, and
in it the modules disagreed: a character outside the Basic Multilingual
Plane. The two TypeScript modules matched UTF-16 code units and wrote
two dashes for it; the Python module iterates characters and writes
one. For "a", U+1F600, "b" that is a--b against a-b.

The regular expression of both TypeScript modules takes the `u` flag,
so it matches by code point and writes one dash. That is the contract's
own rule: every character outside the token alphabet becomes '-'. The
contract gains a fourteenth vector for the case, its input written as a
JSON surrogate-pair escape so that the file stays ASCII. The three
suites load the vectors themselves and need no change. Without the flag
the vector fails the cdk and the cli suite (expected a-b, received
a--b); the agent suite passes it either way, because its module already
does what the other two do with the flag.

Nothing else moves: the thirteen existing vectors pass unchanged, a
lone surrogate stays one dash in all three modules, and no value sent
today differs, since every component label in use is an ASCII constant.

Not covered: the app-id value built in
cdk/src/constructs/solution-ua-aspect.ts. It has its own copy of the
expression, no counterpart in another language and no vector, so a
character outside the Basic Multilingual Plane in an app-id override
still becomes two dashes there.

Refs #719
A build or lint command without a shell operator is split with shlex
and started directly. shlex raises on a quote that is never closed and
on a trailing backslash, and nothing caught the ValueError: a coding
task failed during setup, before the agent ran, and a review task,
whose setup runs no baseline, failed in the gate after the review. The
blueprint stores the command unchecked, so one typo did that to every
task of the repository.

The same text beside a shell operator goes to `bash -lc`, where a
quote that is never closed is a syntax error with exit status 2: a
failed baseline or gate, not an exception. resolve_verify_argv sends a
command that shlex cannot split there as well, so both forms behave
alike, as they do since #1052 for a program that is not installed.
What a trailing backslash becomes is the shell's decision; its exit
status is the result either way.

The asks of the issue were met by #1052. This is an adjacent input
that still ended a task before the agent started.

Refs #750
When a publish fails after its record was created, the handler answers
502 REGISTRY_PUBLISH_INCOMPLETE with the record id and the adapter's
instruction to approve or delete the record before retrying. Publishing
the same version again is refused while that record exists, so this
answer is how the publisher learns which record has to be approved or
deleted.

No test executed that branch. With it removed the answer becomes the
generic 500, and all 46 tests of the two suites that load the handler
still passed.

Add one case that pins the status, the error code, the record id and
the instruction in the message. Test only, no product code changes.

The asks of #782 were met by #1052, which gave the publish function
28 s against a wait of 20 s for record creation but did not cite the
issue. This case covers the answer that change protects.

Refs #782
Four comments describe the notification channel of the CloudWatch
alarms as future work: the alarm property of FanOutConsumer and of
ApprovalMetricsPublisherConsumer, the comment on the publisher's
dead-letter queue, and the header of the publisher's handler. One
speaks of an action that "can be attached once a notification channel
is provisioned". The channel exists: AgentStack attaches the
OperationalAlerts SNS topic to both dead-letter alarms as their alarm
action (#629), and the stack tests pin it.

The two property comments state that in the present tense, so a
reader of either construct learns that the alarm notifies the alerts
topic and why the property is typed as the concrete Alarm class. The
queue comment ends at the alarm, whose own comment says the rest. The
handler's header keeps what holds for its metrics, that an alarm can
be defined on them; no such alarm exists, so it says nothing about
where one would notify. Comments only; the code is unchanged.

Two design documents said the same. Section 9.5 of
INTERACTIVE_AGENTS.md called alarm notification deferred for want of a
channel, and the status note of section 15 of CEDAR_HITL_GATES.md
listed the alarm plumbing as deferred. Both say what exists; what
stays deferred there are the additional alarms of section 11.5.

The required asks of #228 are met on main. Its optional OK action is
not implemented and is left to the maintainers.

Refs #228
The three tests for a secret in the error text of a METRICS_REPORT
event checked that the secret is gone and that its marker is there.
Both are also true when the whole message is replaced by the marker,
so the tests passed for a function that drops the readable text of
every error that holds a secret. Keeping that text is what #118 asked
for, and only the tests for errors without a secret pinned it.

Each of the three tests compares the whole logged value instead. The
comparison implies the two checks it replaces: a value that still
holds the secret, or lacks the marker, fails it as before. The
expected values are what main logs, so no product code changes.

Refs #118
`mise //cdk:bootstrap` did nothing on an account whose CDKToolkit stack
records another bootstrap variant, and exited 0. The CDK CLI does not
overwrite such a stack unless it is given --force: it warns and leaves
the stack as it is. A standard `cdk bootstrap` records another variant,
so the execution role kept AdministratorAccess and the ABCA policies
were never attached. The stack can keep the old variant value after a
forced bootstrap, so a later run without the flag did nothing again.
The deploy preflight names this task as the remedy, and `bgagent setup`
runs it and checks only the exit code.

The task passes --force. It replaces the bootstrap it finds: a standard
one, another variant, or a newer CDK bootstrap version, which the CLI
also declines to replace without the flag. A fresh account is
bootstrapped as before. On a bootstrap that is already current the CLI
prints its "You used the --force flag" warning and changes nothing.

Behaviour change for operators: on an account with a standard bootstrap
the task replaces it, and the other CDK apps of that account and Region
then deploy through the ABCA execution policies. A script that must not
replace one cancels the flag: `mise //cdk:bootstrap -- --no-force`.
`bgagent setup` still leaves a standard bootstrap unchanged.

DEPLOYMENT_ROLES.md covers the already-bootstrapped account: what the
task changes, what the kept variant value means for a later standard
`cdk bootstrap`, the execution policy list an earlier bootstrap may
have set, and how to check the role.

DEPLOYMENT_GUIDE.md gives the bare task for replacing a standard
bootstrap, and the Quick Start note and cdk/AGENTS.md say that the task
replaces the bootstrap it finds. The preflight message for a standard
bootstrap says that the remedy replaces it for every CDK app of the
account and Region.

The issue also allowed failing loudly on a variant mismatch. The flag
is the choice here because the tool's own remedies name the bare task,
and a stack that keeps the old variant value would fail on every later
run.

A test pins the flag in the task's command line.

Closes #701
When a reviewer denies a gated tool call, the agent gets the reason
inside a fixed text: the rule that gated the call and the instruction
not to retry that class of action. The instruction stands at the end,
and the whole text was cut at 500 characters. The API accepts a reason
of up to 2000 characters, so a reason of more than about 220
characters cut into the instruction, and a longer one removed it and
the rule name altogether. The agent was then left with the bare
reason, which it answers with retries.

The cut now falls in the reviewer's reason: the names of the matching
rules, then the reason, are shortened to the room the fixed text
leaves, and escape sequences are removed before the cut, so that it
cannot split one. A text that fitted is unchanged, and so are the cap
of 500 characters and the wording. With the refused call the agent
sees about the first 200 characters of a long reason; the full reason
still follows in the <user_denial> block at the next Stop seam.

No test held the wording: with the rule name and the instruction
deleted, the suite passed. One test now compares the whole text.

The user guide says what a deny does: the instruction, the 60 seconds
in which the same rule refuses the same tool without a new request,
what a timed-out gate does not do, and when to approve instead. The
design document describes the rule-level cache entries and the text
that is returned.

Refs #113
REGISTRY.md said nothing about the network an mcp_server asset is
reached from, although the registry bullet of the deployment guide
sends the reader there. The agent connects to the server from inside
the task's compute session, and on every backend (AgentCore, ECS and
Lambda MicroVMs) the runtime security group allows outbound TCP 443
only.

Section 2 gains a subsection, 2.1, that says so: an http or sse
server has to be served on port 443 and is not supported on another
port on any backend, the calls of a stdio server are bound by the
same rules, and neither publish nor resolution looks at the port or
tests connectivity, so a pin to a server the session cannot reach
resolves and loads, the task starts, and the agent cannot use the
server's tools. The rule and the DNS Firewall allowlist stay
described in one place, COMPUTE.md, which the subsection links to.

The issue took the restriction to be specific to lambda-microvm; all
three backends have it. Of the two options the issue leaves open, a
reachability check or a note, this is the note, as in the deployment
guide: nothing checks reachability at synth, onboarding or publish
time. The other asks of the issue are met on main: the test that
crosses the 4,096-byte hook limit through resolved_assets landed
with #904 (cdk/test/handlers/orchestrate-task-microvm.test.ts), and
the Lambda MicroVMs sections of COMPUTE.md and of the deployment
guide state the 443-only egress.

Closes #818
@krokoko

krokoko commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Answers to the points of your review that have no thread. The twelve threads are answered in place.

Item 4, proportionality. The sweep stays one pull request. It merges by squash, so a change in it cannot be reverted alone. A problem with one item is fixed by a commit on main. #1074 records that.

Item 8, the description. Corrected. Of the 37 referred issues, 29 are open and eight were closed on 2026-11-21: #118, #228, #254, #719, #750, #782, #851 and #916. The description lists the two groups. The entries of the eight no longer say "Still open". The description also has a section "After the review" for the two merges of main and the commits that follow the two reviews. Six entries of the sweep now name the later commit that changed what they say (#635, #686, #701, #793, #794 and #850).

Item 14, commit attribution. The commits of the branch are authored by bgagent. When a pull request is squashed, GitHub names the pull request's author as the author of the commit and adds a Co-authored-by line for each other author of its commits. The squash commits of the three earlier pull requests that were built this way show it on main. 7539ba14 (#1035), bf52b90c (#1052) and 16cf04b2 (#1076) are authored by the person who opened them and carry Co-authored-by: bgagent <bgagent@noreply.github.com>. So the prompting user and the agent are both named on the squash commit, which is what ADR-003 asks for.

Governance. #1074 is assigned, and a comment on it names the seven changes as accepted.

Section 5, the 409 in the API contract. This holds. The 409 was documented in the Linear setup guide only. docs/design/API_CONTRACT.md has an error-code table, so the 409 is a row there now, with the route, what the answer means and a link to the steps in the setup guide. The document describes no Linear route, and its table lacks eight older codes of routes it does not cover (API keys, the two other codes of the workspace removal, the registry). Those eight are on main and are not part of this pull request.

Section 5, the two facts that were only in the description. This holds. Neither fact was in a document, and docs/guides/DEPLOYMENT_GUIDE.md has both now.

A bullet under "For administrators" of the CI/CD section names the leftover stack, says that a run which names its assertion stack after the run does not delete it, and gives the command to delete it while no integ run is in progress. No guide describes the integ tests, so the note stands with the tasks of the pipeline that shares the deploy environment. A short section under "Known deployment issues" says that the Custom::AWS resources are updated in place and what each onUpdate call does.

As you wrote under "Tests and CI", none of this was proven by a deployment when you reviewed. Since then isadeks has deployed 9b878a92 to a dev stack and reported it in a comment on this pull request. That comment does not report on the Custom::AWS resources or on the integ assertion stack. The section therefore still says that the in-place update follows from the synthesized template, the provider's code and CloudFormation's rule for custom resources, and has not been observed on a deployed stack. The bullet states the name of the assertion stack, which a unit test pins, and not the deploy or the destroy of the renamed stack.

What else changed. main is merged into the branch twice: at #1076 (112952af), with one conflict in cdk/src/stacks/agent.ts, and at #1078 (c4bb0c2f), without one. Thirteen commits follow the two reviews, and the description has a section for them. Ten answer a comment. Three came out of checking the answers. The bootstrap preflight no longer reports a failed sign-in as "not bootstrapped" (edad1338), two tables no longer call the Prompt-Version trailer a hash of the system prompt (ddaa6704), and the description of the screening alarm names the session context of a Linear agent session (a4ff8932).

The comment commit (627d5add) shortened the comment at the deliverable=lost entry of error-classifier.ts that your Clarity note cites. It still says why the class is USER and why the entry is retryable.

@krokoko

krokoko commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Answers to your review and to your follow-up comment, section by section.

Live test

Your follow-up comment reports that you deployed 9b878a92 to your dev stack and that nothing broke. Nothing was deployed in making this pull request, as the description says. The description now names your deploy under "How it was checked".

The commits after 9b878a92 are not covered by your deploy. Four of them change how deployed code behaves: the Slack link handling (33ac53b5), the count of a failed screening on the Linear agent-session path (6c101b42), the restore of the environment in the agent (84e335de) and the punctuation of one sentence of the agent's system prompt (a66a9ab3). A fifth changes no code. It changes the description of the alarm WebhookScreeningFailedAlarm in the template (a4ff8932). The others change tests, the CLI, the bootstrap preflight, comments and documents. The two merges add what main gained: #1070, #1076 and #1078. With #1078, your fix for the gh install, the image build of this head no longer runs go install for gh.

Your follow-up does not report on the Custom::AWS resources. The note that the deployment guide now has on them still says that the in-place update follows from the synthesized template and has not been observed on a deployed stack. If the events of your deploy show the two resources as updated in place, the note can say so. The guardrail version quota that rolled back your first deploy is not from this pull request, and #1079 tracks it.

Documentation

The alarm lists. This holds, and since the first merge of main a second alarm was missing, the error alarm of the hourly read of pull-request outcomes (#1076). The code creates eleven alarms and passes each one to operationalAlerts.addAlarmActions (cdk/src/stacks/agent.ts:2176-2192). The paragraph in docs/design/OBSERVABILITY.md is now a list of all of them, and names the feature for those that are not always deployed. The OperationalAlertsTopicArn row of docs/guides/DEVELOPER_GUIDE.md now also names the XSS matches on the signed webhook routes.

The name of the topic. This holds. The four places now say "the OperationalAlerts topic", and so do six more: three rows of the alarm table and the paragraph on the hourly read of pull-request outcomes in OBSERVABILITY.md, the Linear setup guide and the cost attribution guide. ADR-026 uses the same name.

Four older sentences keep their wording on purpose. Three of them carry the identifier together with the word SNS, which tells a reader what kind of topic it is: "the shared OperationalAlerts SNS topic" in COST_MODEL.md and in the user guide, and "the OperationalAlerts SNS topic" in CEDAR_HITL_GATES.md. The fourth, also in CEDAR_HITL_GATES.md, introduces the topic as "a stack-wide SNS topic" one sentence before it names the construct.

Comments

The comments this pull request adds were read against the code they describe, in one commit of their own (627d5add): 633 blocks in 150 files. 210 are deleted and 156 are shortened or reworded, most of them to one or two lines. 267 stay as they are: license headers, comments a tool reads, documentation comments of exported symbols, and comments that were already one or two lines about something the code cannot show. In the two files you gave as examples, workflow-installs.test.ts and deploy-workflow.test.ts, the suite header of 26 and of 22 lines is two lines now.

What stays says a quirk of a service or a tool, a constraint from elsewhere, a trap, or why an assertion has its shape. 115 files change, by 266 lines added and 1,093 removed. The comments in the workflow files are not part of it.

The commit changes comments only. For each changed file the code tokens are the same (TypeScript and JavaScript), the syntax tree is the same (Python) and the lines that hold code are the same byte for byte. No comment that was on main is touched. Each batch was read a second time for a fact that the code does not show and that went with its comment. Five were put back, among them what Yarn 1's --frozen-lockfile lets pass and why the bootstrap task needs --force on every run. A sixth was put back when these replies were checked: why a task whose deliverable was lost is retryable.

The seven places where you asked for code in place of a comment are answered one by one below.

nosemgrep: ts-silent-success-masking at four sites. What the helpers return is not changed in this pull request. The three screening helpers are on main. This pull request adds the WebhookScreeningFailed count to their catch blocks (#794) and rewords their suppression reasons so that they cite ADR-026. Their callers do not branch on why the content is missing. Each one takes the list it gets and creates the task, which is the behaviour the record describes. The record's last requirement asks for the cited suppression on such a path. The fourth site, getRegistryRow in jira-oauth-resolver.ts, is a best-effort read with a strict variant next to it.

A result such as { kind: 'passed' | 'blocked' | 'unavailable' } would make the drop explicit and remove the suppressions. It changes what the helpers return and what their callers do with it, on a path that ADR-026 has just written down, so it would be a change of its own with its own review.

jira-deployment-preview.test.ts:200, @ts-expect-error. This holds. With the field widened to boolean and a second error on the guarded line, the directive stayed satisfied and the type check passed. In cdk/test/handlers/shared/jira-deployment-preview.test.ts the runtime test and its @ts-expect-error are replaced by a constant whose conditional type is never unless TaskRecord['jira_preview_claimed'] admits only true or absence, so mise //cdk:typecheck fails on boolean, any or a renamed field. One line of comment is left, with the reason.

hooks.py:191, _LAST_BLOCKER_REASON. The condition is real, and it belongs to the process, not to this one value. The task's token and task id in os.environ, the scoped AWS session and the stuck-guard summary are one per process too, so a key on the latch alone would not remove it. It holds on every compute backend, where a task has a process of its own. The comment in agent/src/hooks.py is cut from four lines to two and stays, because it is the note that item 2 of #551 asked for at the latch.

pipeline.py:1352, _TASK_ENV_VARS. The comment was there because the restore worked from a list of names, and the test kept a second copy of that list. _task_environ_restored in agent/src/pipeline.py now restores the whole environment, so the list, its comment and the comment at the setters are deleted. The test no longer keeps a copy of the list. _TASK_ENVIRON in agent/tests/test_run_task.py holds the ten values that one test expects the agent to see, and the restore is checked on the whole environment. A mapping shared with the setters would not have reached the variables that config.py, runner.py and workflow/runner.py write, which include the tracker credentials of Ayush's item 7. The tests now run the runner's environment setup for real and compare the whole environment before and after a task.

context-hydration.ts:938, the marker strings. The comment is gone. A test pins what it said. the local assembler of the agent closes its block with the same line in cdk/test/handlers/shared/context-hydration.test.ts reads agent/src/context.py and fails when the two strings differ.

The strings stay where they are. Moving them into contracts/ adds a contract file that the agent image has to carry and both sides have to load, which AGENTS.md lists as a change to ask for first. The test already fails on a drift, so the move would change where the string is defined and not what is checked.

cli/src/stack-outputs.ts:121. Done as suggested. At 9b878a9 a key added to a list without a name at the same position compiled, and every later name was bound to another output. getStackOutputs in cli/src/stack-outputs.ts now returns Record<K, string | null>, keyed by the output names it was given, still from one DescribeStacks call. The paragraph of its doc comment about tuples is removed.

repo show, repo onboard, runtime status and the platform doctor destructure by name. In those four calls a name that is not in the key list does not compile. A type-level line in cli/test/stack-outputs.test.ts pins that, and mise //cli:typecheck checks it.

slack-command-processor.ts:202 and :210. Done in cdk/src/handlers/slack-command-processor.ts. REPO_REFERENCE and GITHUB_LINK have named groups (slackLink, typedLink, repo, issueNumber), and repoReferences reads them by name. The two comments no longer explain group numbers.

Prose

Em dashes. Before the prose commit (a66a9ab3) the diff showed 38 added Markdown lines with an em dash. I looked up each one on main.

  • 24 carry a dash that main has in that sentence. The diff shows the line because this pull request changed another part of it.
  • 11 are rows of a list or table in which the dash is the separator on main. Five are rows of the "Common mistakes" lists in AGENTS.md, cdk/AGENTS.md and cli/AGENTS.md (a bold title, the dash, the text). Two are rows of the "Where to make changes" table (a path, the dash, a note). Four are changelog lines in ADR-002, ADR-013 and ADR-023 (the date, the dash, the text, as in the template of docs/decisions/README.md). Five of your six examples are such rows.
  • 1 is a code block in docs/design/SECURITY.md that shows the marker line the platform writes. The dash is part of that line.
  • 2 were running prose of this pull request. The sentence you named in CEDAR_HITL_GATES.md is two sentences now. A sentence of README.md that this pull request had joined in front of a dash of main ends in a full stop.

The 11 rows keep their dash. Every row of the three "Common mistakes" lists has it, and 30 of those 35 rows are main's. In the table, the three rows of main that add a note to a path have it in the same place. The changelog lines follow the template, as the changelogs of ADR-003, ADR-004 and ADR-013 do on main. Without the dash these 11 rows would differ from the rows around them and from the template, and changing every row is an edit of main's rows.

The rule in agent/src/prompts/base.py had two dashes in one sentence. They are a pair of parentheses and a comma now. No word of the prompt changed.

Colons and long paragraphs. All three are restructured.

  • LINEAR_SETUP_GUIDE.md: three sentences say what the error means, that nothing was changed and how to tell the rows apart. Two numbered steps follow, then one short paragraph for each end state (one active row left, none left).
  • REGISTRY.md: four blocks. The two ways in which git is made to leave the file out are a list, and so are the two cases in which the task fails instead.
  • AGENTS.md: the row keeps its bold title, and the sentence of about 90 words is five sentences.

Eight more paragraphs of over 100 words that this pull request wrote or rewrote are split by subject:

  • accepting a finding (AGENTS.md);
  • the type-check hooks (CONTRIBUTING.md);
  • teardown (the deploy skill);
  • the per-rule cache (CEDAR_HITL_GATES.md);
  • an account that is already bootstrapped (DEPLOYMENT_ROLES.md);
  • the bootstrap preflight (the deployment guide);
  • a repository given as a link (the Slack setup guide);
  • what a deny tells the agent (the user guide).

In these eleven passages the long sentences are split where a colon or a semicolon joined two sentences. In three sentences "therefore" or "then" takes the place of the joining colon or "so". Where a split separated a pronoun from its noun, the noun is written out. No statement is added or dropped. Three short sentences of this pull request in AGENTS.md keep a semicolon, and the sentences that main wrote in the teardown and Slack paragraphs keep their punctuation.

Not changed: paragraphs of main in which this pull request changed a few words or one sentence. Nine list items and one table row of over 100 words also keep the form of their lists. Their longest sentence has 50 words.

  • cli/AGENTS.md:98;
  • the two items under "Type checks in your editor" in CONTRIBUTING.md;
  • "Imitations are replaced" and "Limits" in SECURITY.md;
  • the standard-bootstrap item of the deployment guide;
  • "Advisory enrichment fails open, by being dropped" and "Rejecting would let third parties block the task" in ADR-026;
  • step d and row 15 in CEDAR_HITL_GATES.md.

Figures of speech. "The date speaks for that page" stood in two places, the deployment guide and the row on the capability catalog in AGENTS.md. Both read "The date records the last check of that page" now. lastVerified is the day on which the Regions of core and of the features were last checked against the AgentCore Regions page, and the synthesis error prints the date and the page together.

"A veto" and "that lever" were in the first bullet of the threat model of ADR-026. Its heading reads "Rejecting would let third parties block the task" now, and "Dropping takes that lever away" reads "Dropping prevents that". The sentence between them already says who can stop whose task and how.

I read the other Markdown lines this pull request adds for more. Two were in the README of the deployment profile vectors. "Holds the two lists to each other" reads "keeps the two lists the same", and "The same parity test holds them" reads "The same parity test covers them". "Escape hatch" in the deployment guide stays, because it is the name ADR-021 gives that override.

@isadeks isadeks left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review at a4ff8932. Thanks for the answers. I checked the fixes, and I redeployed this head to the nested Lambda MicroVM dev stack. Nothing broke.

Your two questions

The commits after 9b878a92 are covered by this deploy. It needed one local override, the dev stack's existing execution-role description. The gh tweak was not needed, because #1078 is in this head. The image was built from this PR's Dockerfile.

The two Custom::AWS resources. The stack events of my earlier deploy (22:28Z on 2026-11-23) show them updated in place:

  • DnsFirewall/FirewallConfig and ModelInvocationLogging both went UPDATE_IN_PROGRESS → UPDATE_COMPLETE.
  • Their physical ids did not change (dns-firewall-config, bedrock-invocation-logging), and there was no create or delete event.
  • Afterwards, invocation logging was still configured, and FirewallFailOpen was ENABLED, the value onCreate and onUpdate set.

The deployment guide's note can say this was observed.

Live test of this head

  • MicroVM acceptance: 8/8 pass, including approve and deny after sleep, the defaults, expiry while asleep, cancel while suspended, declined suspend and a 3-task burst.
    • In the parallel run, deny failed at its first bgagent call with "Credentials file is corrupt". Run on its own, it passed.
    • The cause is not this PR: the CLI saves the credentials file non-atomically (cli/src/config.ts:115), and parallel processes can read it half-written. It was on main before #1052. #1080 tracks it.
  • A Linear issue end to end: the task started in 5 s, the start, PR and completion comments were posted, it completed, and the ✅ reaction was added.
  • Health afterwards: no errors in any of the stack's 64 functions, no concurrency seats held, and no active tasks. The orchestrator's one warning was the declined scenario's deliberate suspend.
  • Not testable on this stack: the Slack link handling (33ac53b5) and the agent-session screening count (6c101b42). The stack has no Slack workspace, and agent sessions are off, so those rest on their unit tests.

The fixes

I checked these at this head:

  • @ts-expect-error is replaced by the type-level check.
  • The Slack regexes use named groups.
  • _task_environ_restored snapshots and restores the whole environment, and _TASK_ENV_VARS is gone.
  • getStackOutputs returns a record keyed by name.
  • The marker strings have a parity test.
  • The alarm list and the topic name are fixed.

The environment restore removes only the keys a task added and puts the old values back with update, so a concurrent reader never sees an empty environment. The server's fallback terminal write after run_task needs none of the variables a task sets, which are the git identity, the tokens, TASK_ID and PROMPT_VERSION.

I accept your reasons for keeping the screening helpers' return type, the marker strings in place, and the list and table separators.

Merged via the queue into main with commit 4fb3f99 Nov 24, 2026
9 of 10 checks passed
@krokoko
krokoko deleted the fix/1074-quick-wins-sweep branch November 24, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment