Skip to content

Commit f0e1f79

Browse files
ScriptedAlchemyScriptedAlchemy
andauthored
feat(bdd): [agent]/[no-ai] bracket annotations replacing @-style comment markers (#2678)
* feat(bdd)!: bracket comment-marker syntax to avoid cucumber tag confusion Replace the @-prefixed step-marker comments (# @agent, # @no-ai, # @Soft) with square-bracket markers (# [agent], # [no-ai], # [soft]) so per-step comment annotations can no longer be mistaken for cucumber's native tag syntax. Real Gherkin tags (@flow, @param:, scenario-level @no-ai/@Soft) are unchanged, and $skill tokens still work on marker lines. Clean break (the package is unreleased): the old syntax no longer routes, but collectAnnotationFootguns now flags marker-only @-style comments with a migration hint, surfaced as a new 'legacy-annotation' health kind in the explore model and dashboard. * feat(bdd-dashboard): regenerate dev fixture for bracket marker syntax Regenerated from packages/bdd/example via `midscene-bdd dashboard` after the comment markers moved to # [agent] / # [no-ai] / # [soft]; picks up the shifted line numbers from the gherkin-tour explainer comments. * refactor(bdd): derive marker regexes from one source and trim legacy-marker copy * chore(bdd-dashboard): tighten legacy-annotation health description * refactor(bdd): structured annotation footguns per simplify review collectAnnotationFootguns now returns {kind, line, message} findings, so the explore model maps health kinds directly instead of sniffing warning prose (a copy-edit could silently reclassify findings) and stops re-parsing uri:line out of the message. Legacy @-markers at the start of a prose line ("# @agent check the logs") now get the migration hint — they routed before the syntax change, and silence was the one migration gap. Marker names and the skill-token grammar each derive from a single source, and the audit reuses the comment normalization markerBody already computed. --------- Co-authored-by: ScriptedAlchemy <zack@module-federation.io>
1 parent e6ff3a3 commit f0e1f79

27 files changed

Lines changed: 429 additions & 247 deletions

File tree

apps/bdd-dashboard/src/components/HealthView.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,17 @@ const KIND_META: Record<HealthKind, KindMeta> = {
4040
'detached-annotation': {
4141
label: 'Detached annotation comments (ignored)',
4242
severity: 'warn',
43-
desc: 'An annotation comment (# @agent, # @no-ai, …) is not directly above a step, so it silently has no effect.',
43+
desc: 'An annotation comment (# [agent], # [no-ai], …) is not directly above a step, so it silently has no effect.',
44+
},
45+
'legacy-annotation': {
46+
label: 'Legacy @-style markers (ignored)',
47+
severity: 'warn',
48+
desc: 'A comment uses the retired @-marker syntax (# @agent, …), which no longer routes — write the bracket form (# [agent], …) instead.',
4449
},
4550
'tag-level-agent': {
4651
label: 'Tag-level @agent (ignored)',
4752
severity: 'warn',
48-
desc: '@agent only works as a comment directly above a step — as a tag on a scenario it is ignored.',
53+
desc: 'Agent routing only works as a # [agent] comment directly above a step — @agent as a tag on a scenario is ignored.',
4954
},
5055
'unused-flow': {
5156
label: 'Unused flows',

apps/bdd-dashboard/src/components/HelpPanel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ const GLOSSARY: [string, string][] = [
8282
[
8383
'Step routing',
8484
'Where a step executes. Unmarked steps run on the Midscene UI agent; an ' +
85-
'"agent" badge (# @agent or a $skill token) sends the step to a ' +
86-
'general coding agent; "no-ai" runs a classic user-registered callback.',
85+
'"agent" badge (a # [agent] comment or a $skill token) sends the step ' +
86+
'to a general coding agent; "no-ai" runs a classic user-registered ' +
87+
'callback.',
8788
],
8889
[
8990
'soft',

0 commit comments

Comments
 (0)