Skip to content

fix(lint): require target on ActionBlock#38

Merged
monga-puneet merged 1 commit into
mainfrom
pm/require-action-target
May 15, 2026
Merged

fix(lint): require target on ActionBlock#38
monga-puneet merged 1 commit into
mainfrom
pm/require-action-target

Conversation

@monga-puneet
Copy link
Copy Markdown
Contributor

Summary

  • An action declared with only a description (no target, no body) was silently accepted by lint and compiler. Reasoning could bind to it, and at runtime the call was a no-op because nothing wired it to a real implementation.
  • Mark ActionBlock.target as .required() so the existing requiredFieldPass emits a missing-required-field diagnostic when it is absent.
  • No new lint pass needed — the schema-level signal plugs into machinery that already exists (StringValue.required()__metadata.requiredrequiredFieldPass.isRequired).
  • Adds colocated unit tests in packages/language/src/lint/required-fields.test.ts covering: missing target, present target, inputs/outputs without target, and multiple actions where only some are missing.

Test plan

  • pnpm --filter @agentscript/language test — 170 passed (4 new)
  • pnpm --filter @agentscript/agentscript-dialect test — 1104 passed
  • pnpm --filter @agentscript/agentforce-dialect test — 265 passed
  • pnpm --filter @agentscript/agentfabric-dialect test — 54 passed
  • pnpm --filter @agentscript/compiler test — 801 passed
  • pnpm --filter @agentscript/agentforce test — 300 passed
  • pnpm --filter @agentscript/lsp test — 77 passed
  • Verified existing .agent fixtures already declare target — no fixture updates required

An action declared with only a description (no target, no body) was
silently accepted by lint and compiler. Reasoning could bind to it,
and at runtime the call was a no-op because nothing wired it to a
real implementation.

Mark ActionBlock.target as .required() so the existing
requiredFieldPass emits a missing-required-field diagnostic when it
is absent. No new lint pass is needed — the schema-level signal plugs
into machinery that already exists.

Adds colocated unit tests covering the missing/present/multiple
cases.
inputs: InputsBlock,
outputs: OutputsBlock,
target: StringValue.describe(
target: StringValue.required().describe(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice.

@monga-puneet monga-puneet merged commit 67542bc into main May 15, 2026
6 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.

2 participants