Skip to content

chore(checks): enforce agent-guidance rules with checks - #10778

Merged
waleedlatif1 merged 20 commits into
stagingfrom
chore/agent-text-ablation
Dec 5, 2026
Merged

waleedlatif1 merged 20 commits into
stagingfrom
chore/agent-text-ablation

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Turn enforceable agent-guidance rules into checks, each shown red on a deliberate violation:
    • registries: tool key equals id and snake_case, every tools.access id registered, operation → tool inside tools.access, block registry alphabetical (fixes 5 slips), enrichment providers are hosted tools, connector and polling parity as types, triggers.available ids registered
    • source audits: LRUCache needs max/maxSize; no hand-built JSON/empty responses in v2 routes (adds v2NoContent); named randomUUID imports; retired styling forms (now also in packages/workflow-renderer); snapshot matchers; non-barrel re-exports and route-level recordAudit (ratcheted); no deep @sim/emcn imports (drops the ./* export)
    • types and tests: exhaustive coerceValue, clickLabel required on activatable SettingsResourceRow, exhaustive settings section registration, isolated-vm worker module and message allowlist, capability configKeys equal the keys read, defaultValue-only operation dropdowns (fixes a2a and WhatsApp), unreadable docs actions
  • Correct the few guidance lines these checks make false (coerceValue, clickLabel, v2NoContent, docs actions)
  • The prose prune of skills and rules is split into its own PR so each file can be reviewed on its own

Type of Change

  • Chore

Testing

  • Every new or changed check script on the rebased tree, plus check-block-registry, check-canvas-sentences --require-coverage, sync-tool-metadata --check, generate-docs --check, check:skills, check-guidance-refs
  • Changed tests: 109 script tests, 108 app tests
  • Full CI gate green on the previous push

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner December 5, 2026 01:57
@vercel

vercel Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Dec 5, 2026 9:03am UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@cubic-dev-ai cubic-dev-ai Bot 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.

5 issues found across 141 files

Confidence score: 3/5

  • settings-resource-row.tsx allows callers to pass both href and onClick, but rendering the link silently drops the click handler. Make the activated cases mutually exclusive in the type.
  • validate-model/SKILL.md no longer checks hosted providers’ {PREFIX}_COUNT and {PREFIX}_1..N key pools, so validation can report a model ready when hosted execution will fail. Restore that check.
  • add-column-type/SKILL.md omits the packages/emcn/src/icons/index.ts barrel export, so the documented column icon import can fail type-checking. Add the Type{Pascal} export step.
  • .claude/rules/emcn-components.md points package authors to styling guidance that does not match packages/emcn/**. Add the package glob to sim-styling.md or keep the package-specific token convention here.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/app/workspace/[workspaceId]/settings/components/settings-resource-row/settings-resource-row.tsx">

<violation number="1" location="apps/sim/app/workspace/[workspaceId]/settings/components/settings-resource-row/settings-resource-row.tsx:90">
P2: This activation type should make `href` and `onClick` mutually exclusive; otherwise callers can pass both and the component silently drops `onClick` because `href` wins at render time. Split the activated cases into an `onClick` variant and an `href` variant, and reject a label without an activation target.</violation>
</file>

<file name=".claude/rules/emcn-components.md">

<violation number="1" location=".claude/rules/emcn-components.md:9">
P2: This reference leaves package authors without the styling rule it points them to: `sim-styling.md` does not match `packages/emcn/**`. Add the package glob to `sim-styling.md` or keep the package-specific token conventions in this rule so the new path-scoped guidance is actually available.</violation>
</file>

<file name="scripts/check-import-specifiers.ts">

<violation number="1" location="scripts/check-import-specifiers.ts:283">
P3: The diagnostic lists wildcard export patterns as concrete imports, such as `@sim/testing/factories/*`, which users cannot import literally. Exclude wildcard keys from the actionable import list or label them as patterns so the check does not suggest another invalid specifier.</violation>
</file>

<file name=".agents/skills/add-column-type/SKILL.md">

<violation number="1" location=".agents/skills/add-column-type/SKILL.md:20">
P2: This step creates a type icon but omits the required `packages/emcn/src/icons/index.ts` barrel export. Add the new `Type{Pascal}` export, or the column definition's standard `@sim/emcn/icons` import will fail type-checking.</violation>
</file>

<file name=".agents/skills/validate-model/SKILL.md">

<violation number="1" location=".agents/skills/validate-model/SKILL.md:22">
P2: The condensed procedure no longer verifies hosted providers’ `{PREFIX}_COUNT` / `{PREFIX}_1..N` key pools. Validation can therefore report a hosted model as ready while hosted executions fail because its deployment pool is unset; retain this deployment check.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread .agents/skills/babysit/SKILL.md Resolved
Comment thread .agents/skills/add-tools/SKILL.md Resolved
Comment thread .agents/skills/add-selector/SKILL.md Resolved
Comment thread scripts/check-import-specifiers.ts Resolved
Comment thread .claude/rules/sim-queries.md Resolved
Comment thread .claude/rules/sim-styling.md Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 141 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread .agents/skills/db-migrate/SKILL.md Resolved
Comment thread .agents/skills/add-hosted-key/SKILL.md Resolved
Comment thread .agents/skills/ship/SKILL.md Resolved
Comment thread .agents/skills/babysit/SKILL.md Resolved
Comment thread .claude/rules/sim-hooks.md Resolved
Comment thread .agents/skills/add-connector/SKILL.md Resolved
Comment thread scripts/check-source-text.ts Resolved
Comment thread .claude/rules/sim-sandbox.md Resolved
…:utils

(cherry picked from commit 3f7d50182d96129ca940a0296563decabd65568b)
(cherry picked from commit 5c3f3c0d0d1525445367103ff5a99cf6ad7b062c)
…exports and route audit in check:source-conventions

lru-cache-ceiling and v2-raw-response are zero-tolerance (empty baseline).
The two v2 upload routes that built a bare 204 now return the new
v2NoContent helper, which adds the private no-store header every v2
response carries. non-barrel-reexport (57) and route-audit (53) are
baselined; --init-rule is now repeatable.

(cherry picked from commit 2259f40b41cada711c43b1c78f97b13adf4b9d7d)
Arbitrary font weights, --font-weight-* variables, var(--divider) and
hand-rolled shadow-[inset_0_-1px_0 lines fail in apps/sim and emcn;
react-email templates keep off-scale weights. Zero hits today.

(cherry picked from commit e5990cc6aa3cef87f96285eb89769f9b3a7f4260)
The package now exports only its barrel, ./icons, ./syntax-theme and the
code stylesheet, the subpaths the repo imports. check:import-specifiers
already rejects a subpath a package does not export; its message now
lists the exported ones.

(cherry picked from commit 978cfaf21503d676b7277c55e917081de107aede)
Delete prose that restates code or that a check already enforces, fix stale facts against the code, replace code templates with exemplar paths, re-scope mis-scoped rules, and remove generic design and React skills.

(cherry picked from commit f2c9a674b6c2d59cb77406e0e09b06bc1ac5aa7c)
(cherry picked from commit 57c65e4b22b3e632a90d1b1b3ea122473bd41cd5)
A new column type now fails compilation in coerceValue until it gets an
arm, instead of silently storing String(value).

(cherry picked from commit 21e01874bd3a43977b21df8045c29b006531f862)
The props are now a union: passing onClick or href without clickLabel
fails compilation. Integrations rows pick href or onClick explicitly
instead of passing both.

(cherry picked from commit 676a8ade3c05eb44bd096f2473596a53df8595fa)
SECTION_MODULES must now cover every code-split SettingsSection, and the
section renderer is a switch with a never default, so a new section
fails compilation until it is registered and rendered.

(cherry picked from commit cd4188607ba0e234a6dd3d8305ec86f7e995fc1c)
Parses the worker and asserts it loads only isolated-vm, node:fs and
node:path, and that the message types it dispatches on equal the remote
host's ALLOWED_INBOUND_TYPES.

(cherry picked from commit 5a165d1474d9eece4873513d8049df772221cd22)
…t reads

Runs every rule's deniedBy against a recording Proxy over the
unrestricted config and asserts the keys read equal configKeys.

(cherry picked from commit ec07e21f6a12450c808a807e2b68bc132598fb4b)
…try invariants

- check:tool-metadata fails when a tool registry key differs from tool.id or is not snake_case
- enrichment providers must call registered, hosted-key, non-Apollo/LinkedIn tools
- CONNECTOR_REGISTRY and CONNECTOR_META_REGISTRY share keys, each equal to the config id
- POLLING_PROVIDERS matches the POLLING_HANDLERS keys

(cherry picked from commit 5f42694133096512367b12bfd836145ff87c2910)
check-block-registry now fails when a tools.access id is unregistered, an operation
option selects a tool outside tools.access, a triggers.available id is unregistered,
or BLOCK_REGISTRY/BLOCK_META_REGISTRY drift out of base-type-then-version order.
Re-sorts the five existing order slips (apollo, millionverifier, neverbounce, zerobounce).

(cherry picked from commit 77132f21dde88c6a092f6f927b18e99b2831a88d)
…cs actions

- check:canvas-sentences fails an operation dropdown that sets defaultValue without value;
  a2a and whatsapp now seed with value
- generate-docs fails an integration block whose tools.access entry or operation option id
  is not a string literal (same-file const string arrays resolve), instead of silently
  dropping the action

(cherry picked from commit 78f16302bd9a9ecbd8013cbf53b6e960f0e59232)
(cherry picked from commit 9af767acb4813e5c8568028b55f85fe0e2f25ca6)
(cherry picked from commit 1af24b2e1c1b361b60c4a652a1f9889daa8c8e66)
… new checks make false

The prose prune moves to its own PR so each skill and rule can be reviewed on its own. Also extend the retired-styling audit to packages/workflow-renderer.
@waleedlatif1 waleedlatif1 changed the title chore(agents): replace restated agent guidance with checks chore(checks): enforce agent-guidance rules with checks Dec 5, 2026
@waleedlatif1
waleedlatif1 force-pushed the chore/agent-text-ablation branch from e08321d to 3a409ec Compare December 5, 2026 08:51
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 39 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread .agents/skills/add-block/SKILL.md Resolved
Comment thread scripts/check-source-text.ts Resolved
@waleedlatif1
waleedlatif1 merged commit fdddeb2 into staging Dec 5, 2026
93 checks passed
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