fix(lint): require target on ActionBlock#38
Merged
Conversation
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.
setu4993
approved these changes
May 15, 2026
| inputs: InputsBlock, | ||
| outputs: OutputsBlock, | ||
| target: StringValue.describe( | ||
| target: StringValue.required().describe( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
description(notarget, 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.ActionBlock.targetas.required()so the existingrequiredFieldPassemits amissing-required-fielddiagnostic when it is absent.StringValue.required()→__metadata.required→requiredFieldPass.isRequired).packages/language/src/lint/required-fields.test.tscovering: 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 passedpnpm --filter @agentscript/agentforce-dialect test— 265 passedpnpm --filter @agentscript/agentfabric-dialect test— 54 passedpnpm --filter @agentscript/compiler test— 801 passedpnpm --filter @agentscript/agentforce test— 300 passedpnpm --filter @agentscript/lsp test— 77 passed.agentfixtures already declaretarget— no fixture updates required