Skip to content

fix: sync commandless chat trigger schema - #28

Merged
byapparov merged 3 commits into
mainfrom
fix/4820-workflow-schema-bundle
Aug 22, 2026
Merged

fix: sync commandless chat trigger schema#28
byapparov merged 3 commits into
mainfrom
fix/4820-workflow-schema-bundle

Conversation

@byapparov

Copy link
Copy Markdown
Contributor

Refs aictrl-dev/aictrl#3763
Unblocks aictrl-dev/aictrl#4820

Problem

The bundled workflow schema predates commandless chat triggers. The upcoming
aictrl release therefore fails its workflow-schema bundle drift check.

Behavior

  • Keeps exact slash-command chat triggers valid without a chat allowlist.
  • Allows commandless triggers only with a non-empty chats allowlist.
  • Documents both authoring modes and updates schema provenance and checksums.

Scope

  • The public schema is validation-equivalent to source commit
    748107cc025bfaab890a4e37161c8e29a64c3c20 after description annotations are removed.
  • No runtime, deployment, or workflow-execution code changes.

Rollout and risks

Merge this public bundle before advancing the matching baseline in aictrl.
The aictrl baseline update is already prepared and verified locally.

Verification

  • Normalized source and public schemas both hash to 322cc471d1e0a5d9380bd368638710d3e2f694466f9548a719a067f52a038a6e.
  • Command, commandless, missing-allowlist, and empty-allowlist contract cases passed.
  • All three bundled workflow examples passed schema and DAG validation.
  • npm test — 27 tests passed.
  • npm run validate — 14 public skills and the public plugin validated.
  • Checksum manifest and git diff --check passed.

Comment thread evals/results.md Outdated
repository pull request and verify that the generated draft grounds every claim
in the selected commit.

## create-workflow chat catch-all schema sync — 2026-08-22

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Eval log says "catch-all"; PR says "commandless".

--- a/evals/results.md
+++ b/evals/results.md
@@ -159,7 +159,7 @@ Pending (human): run the scenario in a fresh agent session against a public
 repository pull request and verify that the generated draft grounds every claim
 in the selected commit.
 
-## create-workflow chat catch-all schema sync — 2026-08-22
+## create-workflow commandless chat trigger schema sync — 2026-08-22
 
 Method: synchronized the bundled v1 trigger definitions and authoring guidance
 with source commit `748107cc025bfaab890a4e37161c8e29a64c3c20`, then ran the
🤖 Fix with your agent
Fix this code review finding (aictrl-dev/skills PR #28, evals/results.md:162):

Problem: Eval log says "catch-all"; PR says "commandless"
Detail: The new eval section is titled "create-workflow chat catch-all schema sync", but the schema descriptions, authoring-guide.md, and the PR title all call this feature "commandless". The term "catch-all" is also semantically misleading: commandless mode is the opposite of catch-all — it fires only for chats in a required non-empty allowlist.
Suggested fix: Rename the heading to "create-workflow commandless chat trigger schema sync — 2026-08-22" so the log entry uses the same terminology as the schema and authoring guide it claims to validate.

Suggested patch:
--- a/evals/results.md
+++ b/evals/results.md
@@ -159,7 +159,7 @@ Pending (human): run the scenario in a fresh agent session against a public
 repository pull request and verify that the generated draft grounds every claim
 in the selected commit.
 
-## create-workflow chat catch-all schema sync — 2026-08-22
+## create-workflow commandless chat trigger schema sync — 2026-08-22
 
 Method: synchronized the bundled v1 trigger definitions and authoring guidance
 with source commit `748107cc025bfaab890a4e37161c8e29a64c3c20`, then ran the


Implement the fix on the PR head branch and add a regression test that fails before the fix and passes after.
Why this matters

The new eval section is titled "create-workflow chat catch-all schema sync", but the schema descriptions, authoring-guide.md, and the PR title all call this feature "commandless". The term "catch-all" is also semantically misleading: commandless mode is the opposite of catch-all — it fires only for chats in a required non-empty allowlist.

Pending (human): run the scenario in a fresh agent session against a public
repository pull request and verify that the generated draft grounds every claim
in the selected commit.

## create-workflow chat catch-all schema sync — 2026-08-22

Method: synchronized the bundled v1 trigger definitions and authoring guidance
with source commit `748107cc025bfaab890a4e37161c8e29a64c3c20`, then ran the

"description": "Slash command that fires this trigger when it is the first whitespace-delimited token of a chat message (e.g. `/run-review`). Same grammar as the comment trigger; matched exactly and case-sensitively."
"description": "Optional slash command that fires this trigger when it is the first whitespace-delimited token of a chat message (e.g. `/run-review`). Omit it to match ordinary non-command messages; a commandless trigger must declare at least one chats entry. Same grammar as the comment trigger; matched exactly and case-sensitively."
},
"chats": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Empty chats allowlist passes when command present.

🤖 Fix with your agent
Fix this code review finding (aictrl-dev/skills PR #28, skills/create-workflow/reference/v1/workflow.schema.json:236-241):

Problem: Empty chats allowlist passes when command present
Detail: The new allOf/then branch enforces minItems:1 on chats only for commandless triggers; a command trigger with chats: [] still validates. An empty allowlist semantically means the trigger can match no chat (docs say "omit it to fire for any chat", not "set it empty"), yielding a silently dead trigger that passes schema validation. The gap predates this PR (chats never had minItems), but this PR adds the minItems machinery and leaves the empty-array case unconstrained in the command branch. Note: the bundle mirrors the upstream source schema (aictrl-dev/aictrl/schemas/workflow/v1), so the durable fix belongs upstream, then re-synced here.
Suggested fix: If the empty-allowlist semantics are unintended, add "minItems": 1 to the base chats property (next to maxItems: 100) in the source schema aictrl-dev/aictrl/schemas/workflow/v1/workflow.schema.json, so chats: [] is rejected in both branches (the then-branch then only needs required: ["chats"]), and re-sync the bundle. If empty-means-any is intended, document it in the chats description instead.

Implement the fix on the PR head branch and add a regression test that fails before the fix and passes after.
Why this matters

The new allOf/then branch enforces minItems:1 on chats only for commandless triggers; a command trigger with chats: [] still validates. An empty allowlist semantically means the trigger can match no chat (docs say "omit it to fire for any chat", not "set it empty"), yielding a silently dead trigger that passes schema validation. The gap predates this PR (chats never had minItems), but this PR adds the minItems machinery and leaves the empty-array case unconstrained in the command branch. Note: the bundle mirrors the upstream source schema (aictrl-dev/aictrl/schemas/workflow/v1), so the durable fix belongs upstream, then re-synced here.

        "chats": {
          "type": "array",
          "description": "Optional allowlist of chat/channel ids this trigger fires for. Ints (Telegram) or strings (Slack/Discord) are stored as text. Command triggers may omit it to fire for any chat; commandless triggers require at least one entry. Max 100 entries.",
          "items": { "type": ["string", "integer"] },
          "maxItems": 100
        },

@aictrl-dev

aictrl-dev Bot commented Aug 22, 2026

Copy link
Copy Markdown

Code review

Verdict: Looks good — only minor / nit comments below. · 🔴 0 · 🟠 0 · 🟡 2 · ⚪ 0 · 0/2 resolved

  • 🟡 evals/results.md:162 — Eval log says "catch-all"; PR says "commandless"
  • 🟡 skills/create-workflow/reference/v1/workflow.schema.json:236-241 — Empty chats allowlist passes when command present
🤖 Fix all 2 open findings with your agent
Fix the following code review findings on aictrl-dev/skills PR #28 (head branch).
Run the relevant tests/linters after each change.

1. evals/results.md:162 — Eval log says "catch-all"; PR says "commandless"
   Detail: The new eval section is titled "create-workflow chat catch-all schema sync", but the schema descriptions, authoring-guide.md, and the PR title all call this feature "commandless". The term "catch-all" is also semantically misleading: commandless mode is the opposite of catch-all — it fires only for chats in a required non-empty allowlist.
   Suggested fix: Rename the heading to "create-workflow commandless chat trigger schema sync — 2026-08-22" so the log entry uses the same terminology as the schema and authoring guide it claims to validate.
2. skills/create-workflow/reference/v1/workflow.schema.json:236-241 — Empty chats allowlist passes when command present
   Detail: The new allOf/then branch enforces minItems:1 on chats only for commandless triggers; a command trigger with chats: [] still validates. An empty allowlist semantically means the trigger can match no chat (docs say "omit it to fire for any chat", not "set it empty"), yielding a silently dead trigger that passes schema validation. The gap predates this PR (chats never had minItems), but this PR adds the minItems machinery and leaves the empty-array case unconstrained in the command branch. Note: the bundle mirrors the upstream source schema (aictrl-dev/aictrl/schemas/workflow/v1), so the durable fix belongs upstream, then re-synced here.
   Suggested fix: If the empty-allowlist semantics are unintended, add "minItems": 1 to the base chats property (next to maxItems: 100) in the source schema aictrl-dev/aictrl/schemas/workflow/v1/workflow.schema.json, so chats: [] is rejected in both branches (the then-branch then only needs required: ["chats"]), and re-sync the bundle. If empty-means-any is intended, document it in the chats description instead.
📋 Out-of-diff findings (2)
Sev Location Finding
🟡 evals/results.md:162 Eval log says "catch-all"; PR says "commandless"
🟡 skills/create-workflow/reference/v1/workflow.schema.json:236-241 Empty chats allowlist passes when command present

Reviewed 5 files · 0 inline · view all 2 findings ↗


aictrl · AI code review for fast-moving teams · aictrl.dev

@byapparov

Copy link
Copy Markdown
Contributor Author
Finding Verdict / action Resolution Verification
Eval log says catch-all TRUE · FIX Renamed the eval heading to use the public contract term commandless chat trigger in c6b8677. npm test — 27/27 PASS; npm run validate — PASS; checksum manifest and git diff --check — PASS.
Empty chats on a command trigger FALSE · IGNORE The claimed dead-trigger impact is contradicted by the upstream contract: chatAllowed intentionally treats absent or empty allowlists as any chat for command triggers, and chat-trigger-adapter-unit.test.ts asserts that an exact command fires with chats: []. Changing only the public mirror would also break its required validation equivalence with source commit 748107cc0. Upstream runtime test fires for any chat when the allowlist is empty; normalized public/source hash remains 322cc471….

Please re-review exact head c6b8677 for this bounded remediation round.

@aictrl-dev

aictrl-dev Bot commented Aug 22, 2026

Copy link
Copy Markdown

Code review

Verdict: Looks good — only minor / nit comments below. · 🔴 0 · 🟠 0 · 🟡 2 · ⚪ 0 · 0/2 resolved

  • 🟡 skills/create-workflow/reference/authoring-guide.md:34 — Guide says up to 10 triggers; schema caps at 1
  • 🟡 skills/create-workflow/SPEC.md:24-25 — SPEC bundle tree omits reference/v1 schema
🤖 Fix all 2 open findings with your agent
Fix the following code review findings on aictrl-dev/skills PR #28 (head branch).
Run the relevant tests/linters after each change.

1. skills/create-workflow/reference/authoring-guide.md:34 — Guide says up to 10 triggers; schema caps at 1
   Detail: authoring-guide.md (top-level fields comment ~line 34 "up to 10 file-declared event triggers", the Triggers section prose, and the authoring checklist "At most 10 entries in triggers:") claims up to 10 triggers, but the shipped schema that validate.mjs compiles (reference/workflow.schema.json) sets triggers maxItems: 1 with description "at most one trigger per workflow". Pre-existing and not introduced by this PR, but it sits in the same Triggers documentation this PR refreshes for the chat-message contract, leaving a contradicting count uncorrected.
   Suggested fix: Align the guide with the shipped schema: state "at most 1 trigger per workflow" in the top-level fields comment, the Triggers intro, and the authoring checklist (or confirm upstream intent and relax the schema instead).
2. skills/create-workflow/SPEC.md:24-25 — SPEC bundle tree omits reference/v1 schema
   Detail: The Bundle layout tree in SPEC.md lists reference/ as only authoring-guide.md, workflow.schema.json, and examples/, omitting reference/v1/workflow.schema.json — the very artifact this PR re-syncs. The same document's sync procedure and the refreshed Provenance table both depend on that file, and validate.mjs unconditionally reads it (ajv.addSchema of reference/v1/workflow.schema.json), so the inventory contradicts the rest of the SPEC. Pre-existing gap, but this PR edits SPEC.md to update the v1 provenance row without completing the tree.
   Suggested fix: Add a `v1/workflow.schema.json` entry under `reference/` in the Bundle layout tree so the inventory matches the sync procedure, the Provenance table, and validate.mjs's expectations.
📋 Out-of-diff findings (2)
Sev Location Finding
🟡 skills/create-workflow/reference/authoring-guide.md:34 Guide says up to 10 triggers; schema caps at 1
🟡 skills/create-workflow/SPEC.md:24-25 SPEC bundle tree omits reference/v1 schema

Reviewed 5 files · 0 inline · view all 2 findings ↗


aictrl · AI code review for fast-moving teams · aictrl.dev

@byapparov

Copy link
Copy Markdown
Contributor Author
Finding Verdict / action Resolution Verification
Guide says 10 triggers while bundled v2 caps at 1 TRUE · DEFER The contradiction is real, but changing the guide to one trigger would preserve the wrong side of the drift: upstream v1/runtime support multiple triggers and aictrl#3739 explicitly requires coexisting chat and GitHub triggers. The durable fix is upstream v2 schema parity, followed by a public v2 re-sync; this release-blocking v1 mirror PR does not change that separate schema. Public v2 maxItems: 1; upstream v1 maxItems: 10; runtime/store coverage supports N triggers.
SPEC tree omits bundled v1 schema TRUE · FIX Added reference/v1/workflow.schema.json to the bundle inventory in ccf10b2 and regenerated its checksum. npm test — 27/27 PASS; npm run validate — PASS; checksum manifest and git diff --check — PASS.

This is the second and final bounded remediation head: ccf10b2.

@byapparov byapparov self-assigned this Aug 22, 2026
@byapparov
byapparov merged commit 89fda6b into main Aug 22, 2026
9 checks passed
@byapparov
byapparov deleted the fix/4820-workflow-schema-bundle branch August 22, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant